Transactions

Get Started

Send, monitor, and manage transactions. Send transactions from user or server wallets, sponsor gas, monitor transaction status, and more.

Send a Transaction

Send a transaction from a user wallet from the frontend, or server wallet from the backend using the thirdweb API.

Transactions can be of type contract-call, encoded or native-transfer, and will be batched atomically onchain.

On the frontend, use your project client ID and the users's auth token to send a transaction on their behalf.

POST /v1/transactions
Host: api.thirdweb.com
Content-Type: application/json
x-client-id: <your-project-client-id>
# user auth token can be obtained from one of the v1/wallet/user login endpoints
Authorization: Bearer <user-auth-token>
{
"from": "0x...", // the user wallet address
"chainId": "1" // the chain id
"transactions": [{
// contract call
"type": "contract-call",
"contractAddress": "0x...",
"method": "function transfer(address to, uint256 amount)",
"params": ["0x...", "1000000000000000000"],
}, {
// encoded transaction
"type": "encoded",
"to": "0x...",
"data": "0x...",
}, {
// native transfer
"type": "native-transfer",
"to": "0x...",
"value": "1000000000000000000", // in wei
}],
}

In React applications that use the SDK, you can obtain the user auth token with the useAuthToken() hook.

In TypeScript applications, you can get it by calling wallet.getAuthToken() on a connected inAppWallet() or ecosystemWallet().

Going further

Explore Full API References

For comprehensive guides on implementing the full thirdweb SDK, explore our language-specific documentation: