Backend wallet with Rest API
Use a backend wallet to transfer an asset using Rest API.
You can also request Openfort's REST API directly to use backend wallets. When requesting the REST API directly, you must set certain headers on your requests.
Get your API Keys
Open your project in the Openfort Dashboard and grab your secret key from the project settings.
All API requests must be authenticated using your secret key. Include it in the Authorization header using Basic auth.
Create a backend wallet
Backend wallet (dac
) can be used for escrow, minting, and transferring assets. Create a new custodial Backend wallet using the API.
The response will include the backend wallet ID (starts with dac_
) and its blockchain address.
Add a contract to Openfort
Add your token contract to Openfort. This example uses a simple ERC-20 contract with transfer functionality.
Save the returned contract ID (starts with con_
) for the next step.
Create a Transfer Transaction
Create a transaction intent to transfer tokens using your backend wallet. Replace:
dac_...
with your Backend wallet IDcon_...
with your contract IDpla_...
with the recipient's player ID- The amount with your desired transfer amount in wei (the example shows 1 token with 18 decimals)
Setting optimistic=true
means the response will be returned after simulation but before on-chain confirmation.
Check Transaction Status
You can check the status of your transaction using the transaction intent ID returned in the previous step.
The response will include the transaction hash and status once the transaction is processed.