Skip to main content
Version: 2.4

Generate Fee Payment Signature

await API.proxy.generateFeePaymentSignature({ AVN_RELAYER, user, proxySignature, relayerFee, paymentNonce })
important

This operation uses a relayer account that the sender authorizes to submit the transfer transaction. You can learn more about relayers HERE.

You can get the AVN_GATEWAY_URL and AVN_RELAYER here.

Example

const AVN_API = require("avn-api");
const AVN_GATEWAY_URL = "<node_url>";
const options = {
suri: "<account_suri>",
};
const API = new AVN_API(AVN_GATEWAY_URL, options);

const AVN_RELAYER = "5Fb...yTh";

async function main() {
await API.init();

let result = await API.proxy.generateFeePaymentSignature({ relayer, user, proxySignature, relayerFee, paymentNonce })
console.log(result);
}

(async () => {
await main();
})();
  • For the nonce call getNonce with accountId = payer, nonceType = 'payment'
  • For the relayerFee call getRelayerFees with relayer = relayer, user = payer, transactionType = eg: 'proxyTokenLower'