FORDEFI
Step 1: Installation
npm i expand-networkStep 2: Wallet Initialisation
const { WalletFordefi , prepareTransaction } = require('expand-network');
async function initialiseFordefiWallet(){
const options = {
accessToken: 'YOUR_ACCESS_TOKEN', //Replace this with your bearer token
xApiKey: 'YOUR_API_KEY', //Replace this with your API key
privateKeyFile: 'YOUR_PRIVATE_KEY', // Necessarily a .pem file
vault_id: 'VAULT_ID'
}
const wallet = new WalletFordefi(options);
return wallet;
}
const wallet = await initialiseFordefiWallet(); //Initialise the walletStep 3: Prepare Transaction
Step 4: Sign Transaction
Step 5: Send Transaction
Sample code to approve a fungible token using Fordefi:
Last updated

