Using backend wallets
Create wallet#
Backend wallets can be created through our dashboard or API. You can either create a new wallet or add an existing one.
Using the Dashboard#
Navigate to the Openfort dashboard and create a new developer account.
Using the API#
You can create or add backend wallets through our API:
_10const Openfort = require('@openfort/openfort-node').default;_10const openfort = new Openfort(YOUR_SECRET_KEY);_10_10const settings = await openfort.settings.createDeveloperAccount()
Transactions#
To execute a transaction from your backend wallet:
_14const Openfort = require('@openfort/openfort-node').default;_14const openfort = new Openfort(YOUR_SECRET_KEY);_14_14const transactionintents = await openfort.transactionIntents.create({_14 account: 'dac_...', // Your backend wallet ID_14 chainId: 80002,_14 policy: 'pol_...', // Optional: Policy ID for gas sponsorship_14 optimistic: true,_14 interactions: {_14 contract: 'con_....',_14 functionName: 'transfer',_14 functionArgs: ['recipient_address', 'amount']_14 }_14})
For gas sponsorship, make sure to set up appropriate policies with account_functions rules. Learn more about creating policy sponsors.
Checking transaction status#
You can monitor the status of transactions through our webhook system or by querying the API:
_10const transactionIntent = await openfort.transactionIntents.retrieve('tin_...');_10console.log(transactionIntent.status);
Webhooks
To keep your application in sync with blockchain events, Openfort provides webhooks for various events including transaction status changes and asset transfers.
Signature#
Coming soon