Split-Fee Transaction as a User
This feature is used by defining the payer details in the options
field when creating an instance of the API.
Options can include:
suri
(optional): The mnemonic or secret seed of the user i.e. sender of the transaction. If it's empty, the value is read from theAVN_SURI
environment variable.hasPayer
(optional): Defaults to false. A user specified flag used to determine if there is a configured payer for this user. If not defined, this defaults to false, and the api will treat this transaction as a "self pay" transaction, requiring the signer to pay for the gateway fees.payerAddress
(optional): The payer address for this user. Defaults to the first payer configured for this user.
const options = {
suri: "0x5392ca60a61aea99fce14358798de93c1bc11c3696a905718738c71fae539c24",
hasPayer: true,
payerAddress: "5EYzWhGxbogEfwNKL52ZRDCgBxu4t8oWDFAsXXVYvH6dMQTo",
};
Initialise the API by passing those values as options.
const avnSdk = new AvnApi(AVN_GATEWAY_URL, options);