The Sui wallet adapter handles USDC payments on Sui networks.

Quick setup

import { GalliunClient, createSuiWalletAdapter } from "@galliun/sdk";

const client = new GalliunClient({
  baseUrl: "https://api.galliun.com",
  chain: "sui",
  wallet: createSuiWalletAdapter(suiSigner),
});

Signer interface

interface SuiWalletSigner {
  address: string;
  client: SuiClient;
  signAndExecuteTransaction: (tx: Transaction) => Promise<{ digest: string }>;
  signPersonalMessage?: (message: Uint8Array) => Promise<{ signature: string }>;
}

Integrate with @mysten/dapp-kit or your preferred Sui wallet provider.

Built-in USDC payment

createSuiWalletAdapter(signer) includes built-in USDC transfer via @mysten/sui. The adapter:

Custom pay override

import { createSuiWalletAdapterWithPay, payUsdcOnSui } from "@galliun/sdk";

const wallet = createSuiWalletAdapterWithPay(suiSigner, async (option, requirement, signer) => {
  return payUsdcOnSui(option, signer);
});

Note: custom pay adapters do not include signMessage by default. That is optional.

Networks

Common networks: testnet, mainnet. The 402 accept option specifies the required network — your wallet must be on the matching network.

Verification

The API Sui adapter verifies:

Common mistakes

Next steps