Generate AWT Token
Takes in the mnemonic or secret seed (suri) of an Aventus account and returns an AWT token with a valid token age.
// replace <suri> with process.env.SURI if you have already set the environment variable
const optionalSplitFeeOptions = {
hasPayer: true,
payerAddress: '5Ec...'
}
const signer = {
sign: async (data, _) => <sign data using a users's suri>,
address: signer's
}
await avnSdk.awtUtils.generateAwtToken(optionalSplitFeeOptions, signer)
signer
: The signer object can be derived by running avnSdk.signeroptions
: ASplitFee
option object used to determine if the AWT token will contain split fee data.
Example Result
eyJwayI6IjB4NWUzNzkxZjhmMzNlYWY4YjJiMjhhYWM0NzJiZDc3ODJlMTc1NDEzYWZjYWQ1YjkzOWQzNzczZmU4YjljNDY3NyIsImlhdCI6IjIwMjItMDQtMTRUMDY6MTU6MzQuODE4WiIsInNpZyI6IjB4YjA3Y2IwOGYwMGIyZmFhYjhkMThmOTFkNGQ5ZDI5MDQwMWQzOGE4OWRjNTVjMTZmMTRiNWVmMWE4OWNiMmU3M2RkOTAyN2Q5OWRhODA0ZjA5M2U2ODY5NTVlZTczNWRjYWFmYjNkNDEzODg3ZWEzMTQ5NzI4ODM1MWE5MDdjODAifQ==