> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tentaclepay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Pay an x402 service on another chain from your Sui wallet.

This guide pays an x402 service on Base Sepolia from a Sui keypair. The agent never holds funds on the destination chain — it spends Sui stablecoins, and a [dWallet](/cross-chain/architecture) signs for the destination.

<Note>
  Cross-chain is live on testnet. This example pays a Base Sepolia (`eip155:84532`) endpoint.
</Note>

<Card title="Full example on GitHub" icon="github" href="https://github.com/tentaclepay/apps/tree/main/examples/x402/exact-cross-chain">
  The complete, runnable version of this guide — `examples/x402/exact-cross-chain`.
</Card>

## Prerequisites

* A Sui testnet keypair with test USDC and a little SUI for gas
* Node.js 24+
* An x402 endpoint on the destination chain to call

## 1. Install dependencies

<CodeGroup>
  ```bash npm theme={null}
  npm install @tentaclepay/sdk @mysten/sui @x402/core @x402/evm @x402/fetch
  ```

  ```bash pnpm theme={null}
  pnpm add @tentaclepay/sdk @mysten/sui @x402/core @x402/evm @x402/fetch
  ```

  ```bash bun theme={null}
  bun add @tentaclepay/sdk @mysten/sui @x402/core @x402/evm @x402/fetch
  ```
</CodeGroup>

## 2. Set up the Sui client

The cross-chain signer needs a Sui client — funds move on Sui, and the signer follows the client's network (`testnet` or `mainnet`):

```ts client.ts theme={null}
import { SuiGrpcClient } from "@mysten/sui/grpc";
import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";

const keypair = Ed25519Keypair.fromSecretKey(process.env.CLIENT_PRIVATE_KEY!);

const suiClient = new SuiGrpcClient({
  network: "testnet",
  baseUrl: "https://fullnode.testnet.sui.io:443",
});
```

## 3. Create the cross-chain signer

`createCrossChainEvmSigner` returns a signer that looks like a normal EVM signer to x402 — its address is the dWallet's, resolved from the verifier, and every signature is produced by the dWallet, paid for with USDC on Sui:

```ts client.ts theme={null}
import { createCrossChainEvmSigner } from "@tentaclepay/sdk/x402/evm";

const crossChainEvmSigner = await createCrossChainEvmSigner(keypair, {
  verifierUrl: "https://testnet-verifier.tentaclepay.com",
  suiClient,
});
```

## 4. Register the destination scheme and wrap fetch

Register the destination chain's `exact` scheme with the cross-chain signer, then wrap `fetch`:

```ts client.ts theme={null}
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm";
import { wrapFetchWithPayment } from "@x402/fetch";

const client = new x402Client();
client.register("eip155:84532", new ExactEvmScheme(crossChainEvmSigner));

const fetchWithPayment = wrapFetchWithPayment(fetch, client);
```

## 5. Make the request and read the receipt

The call is identical to a native x402 request. The settlement happens on the destination chain:

```ts client.ts theme={null}
import { x402HTTPClient } from "@x402/core/client";

const response = await fetchWithPayment("http://localhost:3000/weather", {
  method: "GET",
  headers: { "Content-Type": "application/json" },
});

console.log("Response:", await response.json());

if (response.ok) {
  const httpClient = new x402HTTPClient(client);
  const paymentResponse = httpClient.getPaymentSettleResponse((name) =>
    response.headers.get(name)
  );
  console.log(
    "Transaction:",
    `https://sepolia.basescan.org/tx/${paymentResponse.transaction}`
  );
}
```

The transaction digest is on the destination chain — funded by the USDC paid on Sui.

## Next steps

<Card title="Architecture" icon="sitemap" href="/cross-chain/architecture">
  How the dWallet, verifier, and on-chain contract authorize each payment.
</Card>
