Your first signed transaction, in five steps.
npm install @dfinity/agent @dfinity/candid @dfinity/principal @dfinity/auth-clientexport async function createMeneseActor(): Promise<ActorSubclass<any>> {
const authClient = await AuthClient.create();
const isAuth = await authClient.isAuthenticated();
if (!isAuth) {
await new Promise<void>((resolve, reject) => {
authClient.login({
identityProvider: "https://identity.ic0.app",
onSuccess: resolve,
onError: reject,
});
});
}
const identity = authClient.getIdentity();
const agent = new HttpAgent({ host: IC_HOST, identity });
return Actor.createActor(idlFactory, {
agent,
canisterId: MENESE_CANISTER_ID,
});
}From $20for 30 days, 100 actions
const actor = await createMeneseActor();
const allAddresses = await actor.getAllAddresses();
console.log("\n=== All Addresses (batch) ===");
console.log("Solana:", allAddresses.solana.address);
console.log("EVM:", allAddresses.evm.evmAddress);
console.log("Bitcoin:", allAddresses.bitcoin.bech32Address);
console.log("XRP:", allAddresses.xrp.classicAddress);
console.log("SUI:", allAddresses.sui.suiAddress);
console.log("TON:", allAddresses.ton.nonBounceable);
console.log("Cardano:", allAddresses.cardano.bech32Address);
console.log("Tron:", allAddresses.tron.base58Address);
console.log("Aptos:", allAddresses.aptos.address);
console.log("Near:", allAddresses.near.implicitAccountId);
console.log("Litecoin:", allAddresses.litecoin.bech32Address);async function signOnlySolSend(
toAddress: string,
lamports: bigint,
rpcUrl: string = "https://api.mainnet-beta.solana.com",
) {
const menese = await createMeneseActor();
// Step 1: Fetch latest blockhash from Solana via YOUR RPC
console.log("Fetching latest blockhash...");
const bhRes = await fetch(rpcUrl, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0", id: 1, method: "getLatestBlockhash",
params: [{ commitment: "finalized" }],
}),
});
const bhJson = await bhRes.json();
const blockhash: string = bhJson.result.value.blockhash;
console.log("Blockhash:", blockhash);
// Step 2: Canister signs the transaction (1 action)
console.log("Signing on canister...");
const signed = await menese.signSolTransferRelayer(toAddress, lamports, blockhash);
console.log("Signed TX ready. Size:", signed.signedTxBase64.length, "chars");
// Step 3: Broadcast from frontend via YOUR RPC
console.log("Broadcasting...");
const txSig = await broadcastSolana(signed.signedTxBase64, rpcUrl);
console.log("TX confirmed:", txSig);
console.log("Explorer: https://solscan.io/tx/" + txSig);
return txSig;
}export async function broadcastSolana(
signedTxBase64: string,
rpcUrl: string = "https://api.mainnet-beta.solana.com",
): Promise<string> {
const res = await fetch(rpcUrl, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0", id: 1, method: "sendTransaction",
params: [signedTxBase64, { encoding: "base64", skipPreflight: false }],
}),
});
const json = await res.json();
if (json.error) throw new Error(`Solana RPC error: ${json.error.message}`);
return json.result; // tx signature
}Send on each chain.
Send on Solana
- Amounts
- SOL in lamports: 1 SOL is 1,000,000,000. Tokens in their own smallest unit, from your token account to theirs.
- What comes back
- ok with the transaction signature, or err with the reason. A token send returns the signature and the signed transaction.
Treat a payment as done once the chain shows it: look the transaction up with the chain's own explorer or RPC.
// Returns: Result = { ok: text (txHash), err: text }
async function sendSol(toAddress: string, amountSol: number) {
const menese = await createMeneseActor();
const lamports = BigInt(Math.round(amountSol * 1e9));
console.log(`Sending ${amountSol} SOL to ${toAddress}...`);
const result = await menese.sendSolTransaction(toAddress, lamports) as any;
if ("ok" in result) {
console.log("TX hash:", result.ok);
console.log(`Explorer: https://solscan.io/tx/${result.ok}`);
} else {
console.error("Failed:", result.err);
}
return result;
}// IMPORTANT: transferSplToken takes (amount, sourceAta, destinationAta)
// You must know both ATAs. Use getMySolanaAta(mint) to get yours.
// Create ATAs first with createMySolanaAtaForMint if they don't exist.
// Returns: TransferAndSendResult = { txSignature, serializedTxBase64, blockhash }
async function sendSplToken(
sourceAta: string, // YOUR ATA for this token (get via getMySolanaAta)
destinationAta: string, // Recipient's ATA for this token
amount: number, // Amount in token's smallest unit
) {
const menese = await createMeneseActor();
console.log(`Sending ${amount} tokens from ${sourceAta} to ${destinationAta}...`);
const result = await menese.transferSplToken(BigInt(amount), sourceAta, destinationAta) as any;
console.log("TX signature:", result.txSignature);
return result;
}- Paid in ICP, at the price when you buy. Allow the gateway to take the plan's price from your account (an ICRC-2 approve on the ledger), then call purchaseGatewayPackage with the plan.
- Every send, swap and signing uses one action, and so do many reads: getAllAddresses, getAllBalances and getMyBitcoinAddress use one each; getMySolanaAddress, getMyEvmAddress and getGatewayPricing use none. Each call under Every call says which.
- Buying a plan starts 30 new days with that plan's actions. Actions left from the plan before are not added.
- getMyGatewayAccount says which plan you have, when it ends and how many actions are left.
- To pay for your users: register your app's backend with registerDeveloperCanister; it then calls registerUserForBilling for each user, and their actions come from your plan.
Prices as the gateway lists them, read 2026-11-16 14:17Z.
Errors, testing and every call.
Errors, by name
Subscription required. No active subscription or actions exhausted.- No plan, the 30 days have ended, or the plan's actions are used up. A read that uses an action (getMyBitcoinAddress, for example) rejects the call with the same words instead of answering err. Buy a plan with purchaseGatewayPackage (the message calls it purchasePackage).
Invalid developer key. Register at registerDeveloperCanister() to get a key.- A developer key the gateway does not know. Read your key with getMyDeveloperKey.
Insufficient allowance: <amount>. Approve at least <amount>- Buying a plan without allowing the gateway enough first. Approve at least the amount it names, then buy again.
More errors
Insufficient ICP balance: <amount>- Not enough to pay for the plan. Top up the paying account.
Token '<symbol>' not accepted- Paying in a token the gateway does not take. Pay in ICP.
Free tier is no longer available. Choose Basic, Developer, Pro, or Enterprise.- Asking for the free plan. Choose one of the plans above.
The chain's own reason- The chain refused the transaction (too little to pay its fee, a bad address, and so on). Read err, or message and error in the XRP and TON records.
Test before you go live
- Sign without sending: the sign-only calls (signSolTransferRelayer and the other …Relayer calls) return the signed transaction and send nothing. Decode it with the chain's own tools before you send it.
- Start with small amounts from an account you made for testing, and look up every transaction on the chain's explorer.
- Read getMyGatewayAccount before and after, to see each call's action.
- Type the actor as ActorSubclass<_SERVICE> from the gateway's candid (didc bind -t ts), so a wrong call or argument fails when you build. The SDK's helper types it as any.
Every call
The SDK’s API reference330 calls, the first 3 shown.
getAllAddressescall · 1 action() → record { aptos: record { address: text; publicKeyHex: text; }; bitcoin: record { bech32Address: text; hash160Hex: text; pubKeyHex: text; }; cardano: record { addressBytesHex: text; bech32Address: text; paymentPubKeyHex: text; stakePubKeyHex: text; }; evm: record { evmAddress: text; publicKeyHex: text; }; litecoin: record { bech32Address: text; hash160Hex: text; pubKeyHex: text; }; near: record { implicitAccountId: text; publicKeyBase58: text; publicKeyHex: text; }; solana: record { address: text; publicKeyBytes: vec nat8; publicKeyHex: text; }; sui: record { publicKeyBytes: vec nat8; publicKeyHex: text; suiAddress: text; }; thorchain: record { bech32Address: text; hash160Hex: text; pubKeyHex: text; }; ton: record { bounceable: text; nonBounceable: text; publicKeyHex: text; rawAddress: text; stateInitBocBase64: text; }; tron: record { base58Address: text; hexAddress: text; publicKeyHex: text; }; xrp: record { accountIdBytes: vec nat8; accountIdHex: text; classicAddress: text; publicKeyHex: text; }; }signSolTransferRelayercall · 1 action(toAddress: text, lamports: nat64, blockhashBase58: text) → record { publicKey: vec nat8; signature: vec nat8; signedTxBase64: text; txMessage: vec nat8; }getMyGatewayAccountcall · no action() → record { actionsRemaining: nat; actionsUsed: nat; createdAt: int; creditsMicroUsd: nat; subscriptionExpiry: opt int; tier: variant { Basic; Developer; Enterprise; Free; Pro; }; totalDepositedMicroUsd: nat; }
Tell us what you are building.
The team gets back to you, or book a pilot or ask for a chain.
Your key is never in one place.
Only shares, never a whole key
Your signing key exists only as shares, held on the Internet Computer’s fiduciary subnet. No machine ever holds or sees the whole key, and there is no seed phrase.
34 machines, 34 independent providers
Each machine is run by a different independent provider, in its own data centre, in 24 countries. Signing needs many of them to agree.
Source: the public IC dashboard, subnet pzp6e, which holds the key Menese signs with. Read 2026-11-15 11:01Z. See the subnet · Security