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

# Wallet Operations

> Send transactions, transfer stablecoins, sign messages, and read balances from an embedded wallet.

Once a user has signed in with an embedded wallet, your app can read balances, sign messages, and submit transactions, all without the user leaving your product.

The examples below use the `@0xsequence/waas` headless SDK, which gives direct access to the wallet without a UI layer. For React apps using wagmi, standard wagmi hooks (`useSendTransaction`, `useSignMessage`, etc.) work directly.

## Get wallet address

```typescript theme={null}
import { SequenceWaaS } from "@0xsequence/waas";

const sequence = new SequenceWaaS({
  projectAccessKey: process.env.PROJECT_ACCESS_KEY,
  waasConfigKey: process.env.WAAS_CONFIG_KEY,
  network: "polygon",
});

await sequence.signIn({ idToken }, "user-session");

const address = await sequence.getAddress();
// 0x1234...abcd
```

## Send a stablecoin payment (USDC)

```typescript theme={null}
const tx = await sequence.sendERC20({
  chainId: 137, // Polygon mainnet
  token: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", // Native USDC
  to: "0xRecipientAddress",
  value: "10000000", // 10 USDC (6 decimals)
});

if (isSentTransactionResponse(tx)) {
  console.log("Transaction hash:", tx.data.txHash);
}
```

## Send a raw transaction

```typescript theme={null}
const tx = await sequence.sendTransaction({
  chainId: 137,
  transactions: [
    {
      to: "0xContractAddress",
      value: "0",
      data: "0x...", // encoded calldata
    },
  ],
});
```

## Call a contract by ABI

```typescript theme={null}
const tx = await sequence.callContract({
  to: "0xContractAddress",
  abi: "transfer(address to, uint256 amount)",
  func: "transfer",
  args: {
    to: "0xRecipientAddress",
    amount: "10000000",
  },
  value: 0,
  chainId: 137,
});
```

## Sign a message

Used for authentication, consent flows, or off-chain verifications:

```typescript theme={null}
const signature = await sequence.signMessage({
  chainId: 137,
  message: "I authorize this payment of 10 USDC",
});
```

## Send ERC-20, ERC-721, ERC-1155

The SDK has helpers for all standard token types:

```typescript theme={null}
// ERC-721 (NFT transfer)
await sequence.sendERC721({
  chainId: 137,
  token: "0xNFTContractAddress",
  to: "0xRecipientAddress",
  id: "42",
});

// ERC-1155 (multi-token)
await sequence.sendERC1155({
  chainId: 137,
  token: "0xTokenContractAddress",
  to: "0xRecipientAddress",
  values: [{ id: "1", amount: "100" }],
});
```

## Gas sponsorship

By default, users pay their own gas in MATIC. To avoid prompting users for gas, sponsor it via the Sequence Gas Tank in Builder. Sponsored transactions submit without prompting the user for gas.

See [fee options](https://docs.sequence.xyz/sdk/headless-wallet/fee-options) on the Sequence docs for configuration.

## Transaction receipts

```typescript theme={null}
import { isSentTransactionResponse } from "@0xsequence/waas";

const result = await sequence.sendERC20({ ... });

if (isSentTransactionResponse(result)) {
  const { txHash, metaTxHash } = result.data;
  // txHash: onchain hash
  // metaTxHash: Sequence relayer hash (useful for tracking sponsored txs)
}
```
