Using the SDK

Install (example for local dApp integration):

npm install @crosterix/sdk

Import the SDK into your project:

import { Crosterix } from "@crosterix/sdk";
const crosterix = new Crosterix();

Example 1: Private Token Swap

const swap = await crosterix.privateSwap({
  fromToken: "0xC02aa...", // WETH
  toToken: "0xA0b86...",   // USDC
  amount: "1000000000000000000", // 1 ETH
  chainId: 1, // Ethereum Mainnet
  stealthMode: true, // Enable privacy
});
console.log("Transaction sent:", swap.txHash);

Result: Tokens are swapped through the 1inch/0x router, executed from a stealth address. No logs, no backend, and no link to your main wallet.


Example 2: Generate a Stealth Address

const stealth = await crosterix.generateStealthAddress({
  recipientPubKey: "0x04bfc5...",
});
console.log("New Stealth Address:", stealth.address);

Result: A unique one-time wallet address is generated locally using elliptic-curve Diffie–Hellman. This address cannot be linked to the user’s main wallet.


Example 3: Encrypt & Upload a File

Result: File is encrypted in the browser, uploaded to IPFS (Lighthouse), and accessible only to authorized wallets. No plaintext or metadata is stored on Crosterix servers.


Example 4: Cross-Chain Private Bridge

Result: Assets are bridged from Ethereum → Polygon through Socket or Li.Fi APIs. Funds arrive at a stealth address on the target chain.

Last updated