Skip to main content
Version: 0.6

Payout Stakers

Initiates the payment to stakers the AVT earned in the previous era.

await API.send.payoutStakers(AVN_RELAYER, previousEra)

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);
//Please, request the address or public key from Aventus.
const AVN_RELAYER = "5Fb...yTh";

async function main() {
await API.init();

// Get the current era
let era = await API.query.getActiveEra();
let previousEra = era - 1;

let result = await API.send.payoutStakers(AVN_RELAYER, previousEra)
// Returns a request id
console.log(result);
}

(async () => {
await main();
})();

You have now successfully submitted a transaction to the AVN.

Example Result

1392

JSON-RPC

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 SS58 address.
  • user [required] - a string representing the user's SS58 address.
  • payer [required] - a string representing the payer's SS58 address.
  • era [required] - a string integer value representing the era to payout
  • proxySignature [required] - a proof signed by the user allowing the transaction to be proxied.
  • feePaymentSignature [required] - a proof signed by the payer allowing the relayer fees to be paid.
  • paymentNonce [required] - string integer value of the current payment nonce of the payer.

JSON-RPC Example

curl https://AVN-API-URL/send \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: bearer <awtToken>" \
-d '{"jsonrpc":"2.0", "method":"proxyPayoutstakers", "params":{"relayer":"5Fb...oZaryTh", "user":"5DAgx...VJDdMr", "payer":"5DAgx...VJDdMr", "era":"1599", "proxySignature":"0x22ad3b01db96bf5b22d998a4296ff2d58180dc6eab357300b9613583f9570016fc5c439a80f17639e47ffb7100aa8cbea8def6ab2add7837ba0074321ed9c739", "feePaymentSignature":"0x6efb3277c7ee6f965bbf07d6a3faf2acb2fff71029ccd96f9c39b8ba3e2b27084420eae53fecc2bad956c90c5150df9bc3edbbddae5ef1dc538965b25f9efe41", "paymentNonce":"332"}, "id":1}'

result 👇🏽 - a request ID that can be queried for the transaction's status

Example Output

{
"jsonrpc": "2.0",
"id": 1,
"result": "7fd01739-2a52-4eba-941a-00497e7e0bf0"
}