Confirm Token Lift
Triggers the AvN confirmation of a lift operation that has previously occurred on Ethereum.
await api.send.confirmTokenLift(ETHEREUM_TRANSACTION_HASH_FROM_LIFT);
important
- Example
- Example Result
- JSON-RPC
- JSON-RPC Output
const { AvnApi, SetupMode, SigningMode } = require("avn-api");
const AVN_GATEWAY_URL = "<node_url>";
const singleUserOptions = {
suri: "0x5392ca60a61aea99fce14358798de93c1bc11c3696a905718738c71fae539c24", // this is from the generated example account
setupMode: SetupMode.SingleUser,
signingMode: SigningMode.SuriBased,
};
const avnSdk = new AvnApi(AVN_GATEWAY_URL, singleUserOptions);
// Hash of the successful transaction on Ethereum
const ETHEREUM_TRANSACTION_HASH_FROM_LIFT = "0x64f...f64";
async function main() {
await avnSdk.init();
const api = await avnSdk.apis();
const request_id = await api.send.confirmTokenLift(
ETHEREUM_TRANSACTION_HASH_FROM_LIFT
);
console.log(request_id);
}
(async () => {
await main();
})();
Response: f1710fe7-141f-43c1-b1bb-6ec33d9b3e9a
REQUEST
POST <https://AVN_GATEWAY_URL/send>
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
- eventType [required] - the integer value 1 - representing the enum value for a Lifted event type
- ethereumTransactionHash [required] - a string representing the 32 byte Ethereum transaction hash of the lift
- nonce [required] - string integer value of the current proxy nonce of type 'confirmation'
- 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":"proxyConfirmTokenLift", "params":{"relayer":"5FbUQ2kJWLo...yu6UoZaryTh", "user":"5DAgxVxKm...rSVJDdMr", "payer":"5DAgxVxKm...rSVJDdMr", "eventType": 1, "ethereumTransactionHash": "0xad7190f148fbd57b2a615c964b3ad2dcf17574ebf0d1c9778f6aab09657814ca", "nonce":"10", "proxySignature":"0x362f3e1f9f8f88...4f9ab068d6385baeaa16cd3a060829d5f776444af59d07c0755483acca220007422319", "feePaymentSignature":"0x5f3f0ca4ed32b4172998f...3cf89687f08b9b48b17ca84f1935e8d844a9f133a239df12d7fa3d0fda58bb9a9d65eb10", "paymentNonce":"314"}, "id":1}'
result - a request ID that can be queried for the transaction's status
{
"jsonrpc": "2.0",
"id": 1,
"result": "8f7f76c8-a06e-11ec-b909-0242ac120002"
}
tip
You can query the state of your transaction here using the returned request id.