Send as Backend
Send transactions as the backend wallet itself.
The TDK API allows game developers to send on-chain transactions from smart backend wallets, powering game features like admin updates, airdrops, and more.
If the transaction needs to originate from the end user’s Treasure Account, consider sending transactions as users instead.
Setup
Get backend wallet
Check in with the Treasure team to receive your smart backend wallet address and AWS KMS key ARN.
Create AWS role
Create a new IAM role in your AWS account with the following policy attached, filling in the AWS KMS key ARN from the previous step:
Provide the Treasure team with the new role’s ARN to complete the setup process.
Prerequisites
- TDK Core library installed in your project.
Usage
The key change in the above flow is that the TDKAPI
client doesn’t need to be created with a user’s auth token. Instead, the backend wallet signature is specified in the transaction options that will be verified by the TDK API.
If using direct API requests instead of the TDKAPI
client, please provide the signature
in the X-Backend-Wallet-Signature
header and the expirationTime
in the X-Backend-Wallet-Signature-Expiration
header.
See full generateBackendWalletSignature
function documentation for more AWS KMS client configuration options.
Example
An example script showcasing this process is available on GitHub.