Skip to main content
This quickstart restores the wallet for your application identity and sends one sponsored transfer on Polygon. It assumes your OIDC issuer is already registered with your OMS project. See identity and credentials for that setup.

Install the SDK

The package is ESM only and requires Web Crypto and Fetch. Use Node.js 24 or newer, or Cloudflare Workers with nodejs_compat.

Configure the transport

Your publishable key is restricted to one origin, so server requests must send that origin explicitly. Requests without it are rejected by the gateway.
WaasTransport verifies the enclave attestation on every response. The approved PCR0 measurements come from your OMS operator, and each one is 96 hexadecimal characters.

Create the wallet client

SerialExecutor is correct for a single Node process. A clustered backend needs a coordinator that holds exclusive ownership across processes, covered in storage and concurrency.

Restore the wallet

createOrRestore authenticates when needed and returns the single wallet for your identity. Calling it again returns the same wallet rather than creating another.

Send a sponsored transfer

Server Wallets run on mainnet networks only, so this example sends to the wallet’s own address. The transfer moves no value and its gas is sponsored.
Persist operationId before you prepare, and reuse it on every retry for that transfer. It is the SDK’s idempotency key: reusing it never prepares a second transfer. Continue with transfers for the full operation lifecycle and the status values you must handle. See storage and concurrency before you deploy.