Skip to main content
Version: 2.4

Get Outstanding Lowers For Account

Get all available lowers and the data to complete them. This accepts either an Ethereum recipient address or AvN sender address.

The first part of the lower transaction is triggered using this. Once this trigger transaction is completed, it takes 24 hours before the data required to complete step-2 of the lower transaction is available. After 24 hours, you can query for the claimData. The claimData object contains two values: the leafData and the path. You'll need both to submit the Ethereum transaction.

Once you have the claimData, you can carryout the Ethereum transaction. You cannot use the this api to carryout Ethereum transactions.

await api.query.getOutstandingLowersForAccount(<params>)
important

You can get the AVN_GATEWAY_URL here.

Expected Results

  • token- The Ethereum address of the token being lowered.
  • from: The public key of the sending Aventus account.
  • to: The address on Ethereum specified to receive the lowered token amount.
  • amount: The amount of the token lowered.
  • claimData: An object containing the lowered data required to complete step 2 of the lower process.

Using The Recipient Ethereum Addresss

const AVN_API = require("avn-api");
const AVN_GATEWAY_URL = "<node_url>";
const options = {
suri: "<account_suri>",
};
const API = new AVN_API(AVN_GATEWAY_URL, options);

// The below Ethereum address is just an example
const RECIPIENT_ETHEREUM_ADDRESS = "0x0aa4a0f15864e2c1c3aa17d505faa0f997b4bdf9"

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

const result = await api.query.getOutstandingLowersForAccount(RECIPIENT_ETHEREUM_ADDRESS)
console.log(result);
}

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

Using The Sender's Public Key

const AVN_API = require("avn-api");
const AVN_GATEWAY_URL = "<node_url>";
const options = {
suri: "<account_suri>",
};
const API = new AVN_API(AVN_GATEWAY_URL, options);
// the below public key is just an example
const SENDER_PUBLIC_KEY = "0x5e3791f8f33eaf8b2b28aac472bd7782e175413afcad5b939d3773fe8b9c4677"

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

// Replace "acct" with the Aventus address or public key
const result = await api.query.getOutstandingLowersForAccount(SENDER_PUBLIC_KEY)
console.log(result);
}

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