Skip to main content
Version: 3.5.0

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. You'll need the claimData 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>)
CHANGE NOTICE

The merkle path was previously required as part of the claimData to complete a Lower transaction on Ethereum. But with the decoupling of lowers from summaries that happened on version 3.5.1 of the Aventus parachain onwards, there is no need for a merkle path generation in order to claim a lower. The proofs now generated on-chain provide the user with all the info they need in order to claim a lower.

Expected Results

  • lowerId- The assigned ID of your lower request.
  • token- The Ethereum contract 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: A string of the lower data required to complete step 2 of the lower process (claim the tokens).
  • name: The name of the transaction type.
important

You can get the AVN_GATEWAY_URL here.

Using The Recipient Ethereum Addresss

const { AvnApi, SetupMode, SigningMode } = require("avn-api");
const AVN_GATEWAY_URL = "gateway url of your chosen network";
const options = {
suri: "suri of your account",
setupMode: SetupMode.SingleUser,
signingMode: SigningMode.SuriBased,
};

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

async function main() {
await avnSdk.init();
const api = await avnSdk.apis();

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();
})();