SDK JS

The SDK simplifies steps 3–4 of the flow: connect wallet, select stablecoin, and fund the OTW.

Installation

TBD

Initialization

To use the SDK, you need to initialize it with your merchant ID:

init.js
const sdk = new SDK({
  merchantId: "your-merchant-id",
});

Open Modal

Opens a modal for the user to connect a wallet, choose a stablecoin, and fund the OTW. When complete, the session is updated with the funding transaction hash and transitions to FUNDED.

The open method takes a payment session ID and opens a modal where the user connects their wallet, selects a stablecoin, and makes a transaction to fund the one-time wallet. The method returns a promise that resolves with the funding transaction hash once the user completes the process.

open-modal.js
const result = await sdk.open({ paymentSessionId: "your-payment-session-id" });
console.log("Funding transaction hash:", result.fundingTransactionHash);

Last updated