Skip to main content

TypeScript SDK

@dolphinpay/sdk exposes one client:

import {
createClient,
listAllCoins,
selectCoinsForAmount,
formatCoinAmount,
} from '@dolphinpay/sdk';

DolphinPayClient groups the API by domain:

  • assets: platform allowlist mutation and registry query
  • merchants: registration, Coin policy and merchant query
  • catalog: Product/Plan create, update, activation and query
  • orders: merchant order construction and query
  • payments: exact-Coin checkout, settlement, refund review and query
  • subscriptions: subscribe, renew, renewal-refund approval and query

The public API has no v1 client, AdminConfig, USDC conversion helper, or V2* alias. Monetary and time values crossing the SDK boundary are bigint.

const coins = await listAllCoins(client.suiClient, payer, order.coinType);
const selected = selectCoinsForAmount(coins, order.amount);
const tx = client.payments.buildPayOrder({
merchantId: order.merchantId,
orderId: order.id,
coinType: order.coinType,
coinObjectId: selected.coins[0].objectId,
additionalCoinObjectIds: selected.coins.slice(1).map((coin) => coin.objectId),
amount: order.amount,
});