CIRCLE
Step 1: Installation
npm i expand-networkStep 2: Wallet Initialisation
async function initcircleWallet(options){
const userToken = await WalletCircle.getUserToken(options);
options.userToken = userToken.userToken;
options.encryptionKey = userToken.encryptionKey;
const wallet = new WalletCircle(options);
return wallet;
}Step 3: Prepare Transaction
// Preparing the approve transaction from expand.network
const prepareApproveTx = await prepareTransaction('https://api.expand.network/fungibletoken/approve', {
"from": "SENDER_ADDRESS",
"tokenAddress": "0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60",
"to": "RECEIVER_ADDRESS",
"amount": "10000",
"gas": "25000",
"xApiKey": 'YOUR_API_KEY' //Replace with your API key
});Step 4: Sign Transaction
Step 5: Send Transaction
Sample code to approve a fungible token using Circle:
Last updated

