Pending Transactions

Pending transaction is a method to implement so that the

Create the data field that should be sent to your smart contract when users wish to perform on-chain operations on their NFTs.

Create the data field

const abi = require('ethereumjs-abi');


// Define the function name and parameters
const functionName = 'mint';
const addressParam = 'address';
const amountParam = 'uint256';


// Define the parameter values
const addressValue = '0x123abc...'; // The address parameter value
const amountValue = 100; // The amount parameter value


// Define the function signature
const functionSignature = abi.methodID(functionName, [addressParam, amountParam]).toString('hex');


// Encode the function parameters
const encodedParams = abi.rawEncode([addressParam, amountParam], [addressValue, amountValue]).toString('hex');


// Combine the function signature and encoded parameters
const encodedFunction = '0x' + functionSignature + encodedParams;


console.log(encodedFunction);

Update the Data field

To ensure that the transaction will be executed the next time the user scans the chip, use the following API:

The pendingTransactionData parameter is the function call, including the ABI-encoded parameters, to your smart contract.

The pendingTransactionValue is the value in Wei that users would pay.

Get the Data field

You can read the pending transactions using this request

Last updated

Was this helpful?