Skip to content

LiskApi

martiliones edited this page Jun 12, 2023 · 1 revision

Wallets: LiskApi

liskApi.address

The account's Lisk address

  • Type

    interface LiskApi {
      address: string;
    }

liskApi.addressHex

The account's addres in hex format

  • Type

    interface LiskApi {
      addressHex: string;
    }

liskApi.addressHexBinary

The account's binary address in hex format

  • Type

    interface LiskApi {
      addressHexBinary: Buffer;
    }

liskApi.assetId

The coin's asset id

  • Type

    interface LiskApi {
      assetId: 0;
    }

liskApi.assetSchema

The coin's asset schema

  • Type

    interface LiskApi {
      assetSchema: any;
    }

liskApi.crypto

Name of the wallet coin, should be 'lisk'

  • Type

    interface LiskApi {
      crypto: "lisk";
    }

liskApi.decimals

Number of the coin's decimals

  • Type

    interface LiskApi {
      decimals: 8;
    }

liskApi.keyPair

The account's key pair

  • Type

    interface LiskApi {
      keyPair: KeyPair;
    }
    
    interface KeyPair {
      publicKey: Buffer;
      secretKey: Buffer;
    }

liskApi.moduleId

The coin's module id

  • Type

    interface LiskApi {
      moduleId: 2;
    }

liskApi.multiplier

The coin's multiplier

  • Type

    interface LiskApi {
      multiplier: 100000000;
    }

liskApi.network

Lisk API network information

  • Type

    interface LiskApi {
      network: LiskNetwork;
    }
    
    interface LiskNetwork {
      name: string;
      port: number;
      unit: string;
      wsPort: number;
    }

liskApi.networkIdentifier

The coin's network identifier

  • Type

    interface LiskApi {
      networkIdentifier: Buffer;
    }

liskApi.createTransaction()

Creates a transfer transaction hex (signed JSON tx object) and ID Signed JSON tx object is ready for broadcasting to blockchain network

  • Type

    interface LiskApi {
      createTransaction(
        address: string,
        amount: string,
        fee: number,
        nonce: number,
        data?: string
      ): Promise<SignedJsonTx>;
    }
  • Details

    The address should be in Base32 format, amount and fee should be in coins instead of satoshis

  • References

    SignedJsonTx

liskApi.getAccount()

Gets the account's info including balance

  • Type

    interface LiskApi {
      getAccount(): Promise<LiskAccount>;
    }
  • References

    LiskAccount

liskApi.getHeight()

Gets Lisk height

  • Type

    interface LiskApi {
      getHeight(): Promise<number>;
    }

liskApi.getTransaction()

Gets transaction by the specified id

  • Type

    interface LiskApi {
      getTransaction(transactionId: string): LiskTransaction;
    }
  • References

    LiskTransaction

liskApi.getTransactions()

Gets list of transactions by specified filters

  • Type

    interface LiskApi {
      getTransactions(options: any): LiskTransaction[];
    }
  • References

    LiskTransaction

liskApi.sendTransaction()

Sends a signed transaction

  • Type

    interface LiskApi {
      sendTransaction(signedTx: any): Promise<number>;
    }
  • Details

    Returns transaction id