Generate Proxy Signature
await avnSdk.proxyUtils.generateProxySignature(
signerAddress,
transactionType,
proxyArgs
);
signerAddress
: The AvN address of the signer.transactionType
: The type of the transaction e.g., token, staking, etc.proxyArgs
: Proxy arguments.
important
Example
const { AvnApi, SetupMode, SigningMode } = require("avn-api");
const AVN_GATEWAY_URL = "https://gateway.testnet.aventus.network";
const singleUserOptions = {
suri: "0x5392ca60a61aea99fce14358798de93c1bc11c3696a905718738c71fae539c24", // this is from the generated example account
setupMode: SetupMode.SingleUser,
signingMode: SigningMode.SuriBased,
};
const avnSdk = new AvnApi(AVN_GATEWAY_URL, singleUserOptions);
// This can be the address or public key.
const RECIPIENT_ADDRESS = "5DA...gxV";
// The token address on Ethereum.
const TOKEN_CONTRACT_ADDRESS = "0x2a...b0e";
//amount of the token in 18 decimals.
const TOKEN_AMOUNT = "123400000";
const signerAddress = "sender_address";
const transactionType = "token";
proxyArgs = {
RECIPIENT_ADDRESS,
TOKEN_CONTRACT_ADDRESS,
TOKEN_AMOUNT,
};
async function main() {
await avnSdk.init();
let result = await avnSdk.proxyUtils.generateProxySignature(
signerAddress,
transactionType,
proxyArgs
);
console.log(result);
}
(async () => {
await main();
})();