Relayer Fees
- Generic
- For Specific Users
- For Specific Transaction Types
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.
You can get the AVN_GATEWAY_URL and AVN_RELAYER here.
Example
const AVN_API = require("avn-api");
//Replace the endpoint_url with the url received from Aventus.
const AVN_GATEWAY_URL = "<endpoint_url>";
const API = new AVN_API(AVN_GATEWAY_URL);
//replace with the relayer address or public key received from Aventus
const AVN_RELAYER = "5DA...gxV";
async function main() {
await api.init();
const fees = await api.query.getRelayerFees(AVN_RELAYER);
console.log(fees);
}
(async () => {
await main();
})();
Example Result
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",
"proxyConfirmTokenLift": "7000000000000000",
"proxyTokenLower": "7000000000000000",
"proxyCreateNftBatch": "7000000000000000",
"proxyMintSingleNft": "7000000000000000",
"proxyMintBatchNft": "7000000000000000",
"proxyListNftOpenForSale": "7000000000000000",
"proxyListNftBatchForSale": "7000000000000000",
"proxyTransferFiatNft": "7000000000000000",
"proxyCancelListFiatNft": "7000000000000000",
"proxyEndNftBatchSale": "7000000000000000",
"proxyBond": "7000000000000000",
"proxyNominate": "7000000000000000",
"proxyIncreaseStake": "7000000000000000",
"proxyUnstake": "7000000000000000",
"proxyWithdrawUnlocked": "7000000000000000",
}
await api.query.getRelayerFees(avnRelayerAddress, user);
The will return an object detailing the default fees a particular relayer charges, in AVT, to execute transactions for a particular user account.
You can get the AVN_GATEWAY_URL and AVN_RELAYER here.
Example
const AVN_API = require("avn-api");
//Replace the endpoint_url with the url received from Aventus.
const AVN_GATEWAY_URL = "<endpoint_url>";
const API = new AVN_API(AVN_GATEWAY_URL);
//replace with the relayer address received from Aventus
const AVN_RELAYER = "5DA...gxV";
//replace with your address on the Aventus network.
const USER = "5DA...gxV";
async function main() {
await api.init();
let fees = await api.query.getRelayerFees(AVN_RELAYER, USER);
console.log(fees);
}
(async () => {
await main();
})();
Example Result
Below is an example of a returned object showing the transaction types supported by the relayer and what it charges for each transaction type for a specific user.
{
proxyAvtTransfer: "7000000000000000",
proxyTokenTransfer: "7000000000000000",
proxyConfirmTokenLift: "7000000000000000",
proxyTokenLower: "7000000000000000",
proxyCreateNftBatch: "7000000000000000",
proxyMintSingleNft: "7000000000000000",
proxyMintBatchNft: "7000000000000000",
proxyListNftOpenForSale: "7000000000000000",
proxyListNftBatchForSale: "7000000000000000",
proxyTransferFiatNft: "7000000000000000",
proxyCancelListFiatNft: "7000000000000000",
proxyEndNftBatchSale: "7000000000000000",
proxyBond: "7000000000000000",
proxyNominate: "7000000000000000",
proxyIncreaseStake: "7000000000000000",
proxyUnstake: "7000000000000000",
proxyWithdrawUnlocked: "7000000000000000",
}
await api.query.getRelayerFees(AVN_RELAYER, user, _transaction_type);
The will return an object detailing the default fees a particular relayer charges, in AVT, to execute a specific transaction for a particular user account.
You can get the AVN_GATEWAY_URL and AVN_RELAYER here.
Example
const AVN_API = require("avn-api");
const AVN_GATEWAY_URL = "<endpoint_url>";
const API = new AVN_API(AVN_GATEWAY_URL);
const AVN_RELAYER = "5DA...gxV";
//replace with your address on the Aventus network or public key.
const USER = "5DA...gxV";
const TRANSACTION_TYPE = "proxyAvtTransfer"; //example of a transaction type.
async function main() {
await api.init();
const fees = await api.query.getRelayerFees(
AVN_RELAYER,
USER,
TRANSACTION_TYPE
);
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.
7000000000000000
JSON-RPC
- Transaction Types
- JSON-RPC Example
- Example Output
Returns fees for a particular relayer, optionally by user and/or transaction type
REQUEST
POST https://AVN_GATEWAY_URL/query
HEADERS
Content-Type: application/json Authorization': bearer <awtToken>
REQUEST PARAMS
relayer
(AVN_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.
Possible Transaction Types
"proxyAvtTransfer",
"proxyTokenTransfer",
"proxyConfirmTokenLift",
"proxyTokenLower",
"proxyCreateNftBatch",
"proxyMintSingleNft",
"proxyMintBatchNft",
"proxyListNftOpenForSale",
"proxyListNftBatchForSale",
"proxyTransferFiatNft",
"proxyCancelListFiatNft",
"proxyEndNftBatchSale",
"proxyBond",
"proxyNominate",
"proxyIncreaseStake",
"proxyUnstake",
"proxyWithdrawUnlocked",
curl https://AVN_GATEWAY_URL/query \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: bearer <awtToken>" \
-d '{"jsonrpc":"2.0", "method":"getRelayerFees", "params":{"relayer":"5FbUQ2kJWLoqHuSTSNNqBwKwdQnBVe4HF3TeGyu6UoZaryTh", "user":"5GnPqcy...gyLcDTCg", "transactionType":"proxyTokenTransfer"}, "id":1}'
Possible Results
- result - 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)
{
"jsonrpc": "2.0",
"id": 1,
"result": "7000000000000000"
}
OR
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"proxyAvtTransfer": "7000000000000000",
"proxyTokenTransfer": "7000000000000000",
"proxyConfirmTokenLift": "7000000000000000",
"proxyTokenLower": "7000000000000000",
"proxyCreateNftBatch": "7000000000000000",
"proxyMintSingleNft": "7000000000000000",
"proxyMintBatchNft": "7000000000000000",
"proxyListNftOpenForSale": "7000000000000000",
"proxyListNftBatchForSale": "7000000000000000",
"proxyTransferFiatNft": "7000000000000000",
"proxyCancelListFiatNft": "7000000000000000",
"proxyEndNftBatchSale": "7000000000000000",
"proxyBond": "7000000000000000",
"proxyNominate": "7000000000000000",
"proxyIncreaseStake": "7000000000000000",
"proxyUnstake": "7000000000000000",
"proxyWithdrawUnlocked": "7000000000000000",
}
}