DAPP Client

Below we'll install the client

npm install -g @liquidapps/dapp-client

This example takes:

  • the contract name the LiquidAccount project is deployed to

  • the active private key of that account

  • the regaccount as the action name

  • the payload with the vaccount name

After registering an account, you may also use the library to push LiquidAccount transactions. In the linked example, you can see that the action name has changed to hello and the payload has changed to include the required parameters.

import { getClient } from "./client";

(async () => {
    const service = await (await getClient()).service('vaccounts', "vacctstst123");

    const response = await service.push_liquid_account_transaction(
        "vacctstst123",
        "5JMUyaQ4qw6Zt816B1kWJjgRA5cdEE6PhCb2BW45rU8GBEDa1RC",
        "hello",
        {
            vaccount: 'testing124',
            b: 1,
            c: 2
        }
    );
    console.log(response);
    // { result:
    //     { broadcast: true,
    //       transaction:
    //        { compression: 'none',
    //          transaction: [Object],
    //          signatures: [Array] },
    //       transaction_id:
    //        'ef90712d7bfe7da325a5eb5545b13f1bb05ba1360753463645be96dce18858c2',
    //       processed:
    //        { id:
    //           'ef90712d7bfe7da325a5eb5545b13f1bb05ba1360753463645be96dce18858c2',
    //          block_num: 60942620,
    //          block_time: '2019-08-07T14:12:47.500',
    //          producer_block_id: null,
    //          receipt: [Object],
    //          elapsed: 4414,
    //          net_usage: 400,
    //          scheduled: false,
    //          action_traces: [Array],
    //          account_ram_delta: null,
    //          except: null,
    //          error_code: null } } }
})().catch((e) => { console.log(e); });

For more information on how the DAPP Client works, see below

page@liquidapps/dapp-client

Last updated