StableOps
SDKs

Wallet SDK

Send on-chain payments from mainstream self-custody wallets.

Install

pnpm add @stableops/wallet-sdk

The wallet SDK is browser-only. It targets any runtime that ships the global fetch API and supports EIP-1193 / TronLink / Solana wallet adapters.

Decentralized wallet payments (EVM / TRON / Solana)

In the browser, you can pass the paymentInstructions candidate list created by your backend to mainstream self-custody wallets and ask the user to send the on-chain transfer. StableOps still owns order idempotency, deposit-address allocation, chain scanning, confirmations, and webhooks; the wallet helper only transfers funds to the order-specific address.

import {
  getInjectedWalletProviders,
  sendOrderWalletPayment,
} from '@stableops/wallet-sdk'

const sent = await sendOrderWalletPayment({
  order,
  providers: getInjectedWalletProviders(),
})

console.log(sent.txHash)

You can also select a candidate instruction yourself, then call the lower-level sender:

import {
  getInjectedWalletProviders,
  selectWalletPaymentInstruction,
  sendWalletPayment,
} from '@stableops/wallet-sdk'

const { instruction, provider } = selectWalletPaymentInstruction(
  order.paymentInstructions,
  getInjectedWalletProviders(),
)

await sendWalletPayment({
  provider,
  amount: order.amount,
  instruction,
})

The wallet helper now covers every chain supported by the system:

  • ethereum, ethereum-sepolia, base, base-sepolia, arbitrum, arbitrum-sepolia, polygon, polygon-amoy: calls EIP-1193 wallets, switches / adds networks when needed, and sends an ERC-20 transfer.
  • tron, tron-nile: calls TronLink / TronWeb to build, sign, and broadcast a TRC-20 transfer.
  • solana, solana-devnet: calls Solana wallet adapters, creates the recipient associated token account idempotently, and sends an SPL Token TransferChecked. When using solana-devnet, pass solanaRpcUrl: 'https://api.devnet.solana.com' or an equivalent devnet RPC.

Do not expose STABLEOPS_API_KEY in the browser. Create orders on your backend, then pass only the order id, amount, and paymentInstructions to the frontend. The frontend should use the currently available wallets to choose one candidate chain and send the on-chain transfer.

On this page