How to get signed payload for transfer?

  • getSignedPayloadForTransfer

This function is used to get a signed payload for transferring Native Coins.

import { L1XProvider, GetAccountStateArg } from "@l1x/l1x-wallet-sdk";

let l1xProvider = new L1XProvider({
  clusterType: "mainnet",
    endpoint: "https://v2-mainnet-rpc.l1x.foundation",

});

let params: NativeTokenTransferArg = {
    receipient_address: "3f26a392527cb2f3328a15d3b9fe66d9225d8ec0",
    value: 1 * (10 ** 18),
    private_key: "YOUR_PRIVATE_KEY"
};

l1xProvider.core
  .getSignedPayloadForTransfer(params)
  .then((response) => console.log(response)) // log response
  .catch((err) => console.error(err)); // log error

Parameters:

The parameters to get signed payload for transfer.

{
    "receipient_address": "3f26a392527cb2f3328a15d3b9fe66d9225d8ec0",
    "value": 1 * (10 ** 18),
    "private_key": "YOUR_PRIVATE_KEY"
}

Returns:

A promise that resolves with signed payload transactions.

{
    "nonce": '25',
    "transaction_type": {
        "NativeTokenTransfer": { "address": [Array], "amount": '10000000000000000000' }
    },
    "fee_limit": '1',
    "signature": "YOUR_TRANSACTION_SIGNATURE",
    "verifying_key": "YOUR_VERIFYING KEY"
}

Last updated