Relayer Fees
await api.query.getRelayerFees(avnRelayerAddress);
The will return an object detailing the default fees a particular relayer charges, in AVT, for a set of executable transactions.
Example
const AvnApi = require("avn-api");
const GATEWAY = "<endpoint_url>"; //Replace the endpoint_url with the url received from Aventus.
const api = new AvnApi(GATEWAY);
const avnRelayerAddress = "5DA...gxV"; //replace with the relayer address received from Aventus
async function main() {
await api.init();
const fees = await api.query.getRelayerFees(avnRelayerAddress);
console.log(fees);
}
(async () => {
await main();
})();
Example Output
Below is an example of a returned object showing the transaction types supported by the relayer and what it charges for each transaction type.
{
proxyAvtTransfer: '7000000000000000',
proxyTokenTransfer: '7000000000000000',
proxyMintSingleNft: '7000000000000000',
proxyListNftOpenForSale: '7000000000000000',
proxyTransferFiatNft: '1000000000000000',
proxyCancelListFiatNft: '1000000000000000'
}
JSON-RPC
Returns fees for a particular relayer, optionally by user and/or transaction type
REQUEST
POST https://AVN-API-URL/query
HEADERS
Content-Type: application/json Authorization': bearer <awtToken>
REQUEST PARAMS
relayer
[required] - a string representing the relayer's public key or SS58 address.
user
[optional] - a string representing the user's public key or SS58 address.
transactionType
[optional] - a string representing the transaction type. One of:
"proxyAvtTransfer"
"proxyTokenTransfer"
"proxyMintSingleNft"
"proxyListNftOpenForSale"
"proxyTransferFiatNft"
"proxyCancelListFiatNft"
Example
curl https://AVN-API-URL/query \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: bearer <awtToken>" \
-d '{"jsonrpc":"2.0", "method":"getRelayerFees", "params":{"relayer":"5FbUQ2kJWLoqHuSTSNNqBwKwdQnBVe4HF3TeGyu6UoZaryTh", "user":"5GnPqcyiruWxK5HWVZSdvZk25y2kZjmeaSBaTvpygyLcDTCg"}, "id":1}'
RESULT FIELDS
VALUE - string integer value of the current relayer fee for user and type
OR
OBJECT- object representing fees for relayer (generic or filtered for user if passed)
Example Result
{
"jsonrpc": "2.0",
"id": 1,
"result": "5000000000000000"
}
OR
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"proxyAvtTransfer": "7000000000000000",
"proxyTokenTransfer": "7000000000000000",
"proxyMintSingleNft": "7000000000000000",
"proxyListNftOpenForSale": "7000000000000000",
"proxyTransferFiatNft": "7000000000000000",
"proxyCancelListFiatNft": "7000000000000000"
}
}