Skip to main content

/initWallet

  • GET | POST /initWallet { ownerAddress, chainId } { to, data, gas, gasPrice, nonce }

    Notice! Usage of this method is optional and recommended for strong exchange setup

    POST Data:

    { 
    "chainId": 1,
    "ownerAddress": "**0x1234…1234**",
    "contractType" : "payment"
    }

    where

    • chainId - Number of EVM chain

    • ownerAddress - Address of Wallet Owner

    • contractType - check contract types page for more information

    How to get chainId:

    ChainId you can get from https://chainlist.org

    ChainId you can get from https://chainlist.org

    How to get ownerAddress:

    You can use [web3.eth.accounts.create()](https://web3js.readthedocs.io/en/v1.10.0/web3-eth-accounts.html) of  to generate something like this

    {
    address: "0xb8CE9ab6943e0eCED004cDe8e3bBed6568B2Fa01",
    privateKey: "0x348ce564d427a3311b6536bbcff9390d69395b06ed6c486954e971d960fe8709",
    signTransaction: function(tx){...},
    sign: function(data){...},
    encrypt: function(password){...}
    }

    Response:

    {
    "nonce" : 1,
    "gas" : 210000,
    "gasPrice" : 50000
    "data" : "0x2df....Adsd"
    "to" : "0x123...123"
    }

    Basically, this JSON describes the transaction which needs to be signed with Private Key of ownerAddress passed above

    This is exact model required by javascript method https://web3js.readthedocs.io/en/v1.2.11/web3-eth-accounts.html#eth-accounts-signtransaction but you free to use any other language to build and sign the transaction from this data.

    Examples on different programming languages:

    //from previous response 
    const rawTransaction = {
    "nonce" : 1,
    "gas" : 210000,
    "gasPrice" : 50000
    "data" : "0x2df....Adsd"
    "to" : "0x123...123"
    }

    web3.eth.accounts.signTransaction(rawTransaction, privateKey)
    .then(signedTx => {
    console.log('Signed Transaction:', signedTx.rawTransaction);
    })
    .catch(err => {
    console.error('Error signing transaction:', err);
    });

    As result you need to make the rawTx in String, HEX