Backend wallet with SDK (Node.js)
Use a backend wallet to mint an asset with NodeJS.
You can use backend wallets via Openfort's NodeJS Server SDK (or .net). Follow the instructions below to configure your desired integration.
Set up Openfort Node.js SDK
Open your project in the Openfort Dashboard.
The latest version of the Openfort Node.js server-side SDK supports Node.js versions 14+.
Declare Openfort Environment Variables
After your project is ready, grab your secret_key from the project settings.
Create a .env
file and populate it with your project's secret key.
Create a backend wallet
Backend wallet (dac
) can be used for escrow, minting, and transferring assets. You can create a new custodial backend wallet or add your own external account by providing a signature and address.
Add a contract to Openfort
We'll use a simple ERC-721 contract on the Polygon Amoy network.
Once added, Openfort will return a contract id that starts with con_
.
Mint an NFT using the backend wallet
Use your backend wallet to mint an NFT. The wallet will be used to pay for gas fees.
Make sure to replace the contract id with your own.
Run the script
You're all set! Run the development server on your Terminal.
You can check the transaction details in your dashboard.