Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "transaction/transactionBuilder"

Index

Functions

Const addSign

  • Signs the transaction object.

    If there is already a signature, the new one will be added to the end. If the signature schema is not provided, default schema for Private key type is used.

    Parameters

    Returns void

buildRestfulParam

buildRpcParam

  • buildRpcParam(tx: Transaction, method?: undefined | string): object
  • deprecated

    Creates params from transaction to send with rpc

    Parameters

    • tx: Transaction

      Transaction

    • Optional method: undefined | string

      Method name

    Returns object

    • id: number
    • jsonrpc: string
    • method: string
    • params: string[]

buildTxParam

  • buildTxParam(tx: Transaction, isPreExec?: boolean): string
  • deprecated

    Creates params from transaction to send with websocket

    Parameters

    • tx: Transaction

      Transactio to send

    • Default value isPreExec: boolean = false

      Decides if it is pre-execute transaction

    Returns string

makeDeployCodeTransaction

  • makeDeployCodeTransaction(code: string, name?: string, codeVersion?: string, author?: string, email?: string, desp?: string, needStorage?: boolean, gasPrice: string, gasLimit: string, payer?: Address): Transaction
  • Creates transaction to deploy smart contract

    Parameters

    • code: string

      Avm code of contract to deploy

    • Default value name: string = ""

      Name of contract

    • Default value codeVersion: string = "1.0"

      version of contract

    • Default value author: string = ""

      Author of contract

    • Default value email: string = ""

      Email of author

    • Default value desp: string = ""

      Description of contract

    • Default value needStorage: boolean = true

      Decides if the contract needs storage

    • gasPrice: string

      Gas price

    • gasLimit: string

      Gas limit

    • Optional payer: Address

      Address to pay for gas

    Returns Transaction

Const makeInvokeTransaction

  • makeInvokeTransaction(funcName: string, params: Parameter[], contractAddr: Address, gasPrice?: undefined | string, gasLimit?: undefined | string, payer?: Address): Transaction
  • Creates transaction to inovke smart contract

    Parameters

    • funcName: string

      Function name of smart contract

    • params: Parameter[]

      Array of Parameters

    • contractAddr: Address

      Address of contract

    • Optional gasPrice: undefined | string

      Gas price

    • Optional gasLimit: undefined | string

      Gas limit

    • Optional payer: Address

      Address to pay for gas

    Returns Transaction

makeNativeContractTx

  • makeNativeContractTx(funcName: string, params: string, contractAddr: Address, gasPrice?: undefined | string, gasLimit?: undefined | string, payer?: Address): Transaction
  • Creates transaction to invoke native contract

    Parameters

    • funcName: string

      Function name of contract to call

    • params: string

      Parameters serialized in hex string

    • contractAddr: Address

      Adderss of contract

    • Optional gasPrice: undefined | string

      Gas price

    • Optional gasLimit: undefined | string

      Gas limit

    • Optional payer: Address

      Address to pay for transaction gas

    Returns Transaction

sendRawTxRestfulUrl

  • sendRawTxRestfulUrl(url: string, preExec?: boolean): string
  • deprecated

    Parameters

    • url: string

      Url of blochchain node

    • Default value preExec: boolean = false

      Decides if is a pre-execute request

    Returns string

Const signTransaction

  • Signs the transaction object.

    If there is already a signature, the new one will replace existing. If the signature schema is not provided, default schema for Private key type is used.

    Parameters

    Returns void

Const signTransactionAsync

  • Signs the transaction object asynchroniously.

    If there is already a signature, the new one will replace existing. If the signature schema is not provided, default schema for Private key type is used.

    Parameters

    Returns Promise<void>

Const signTx

  • Signs the transaction with multiple signatures with multi-sign keys.

    If there is already a signature, the new ones will be added to the end. If the signature schema is not provided, default schema for Private key type is used.

    Parameters

    • tx: Transaction

      Transaction to sign

    • M: number

      m of the (m ,n) multi sign address threshold

    • pubKeys: PublicKey[]

      Array of Public keys of (m,n) multi sign address, the number is n

    • privateKey: PrivateKey

      Private key to sign the tx.

    • Optional scheme: SignatureScheme

      Signature scheme to use

    Returns void

Object literals

Const Default_params

Default_params: object

Action

Action: string = "sendrawtransaction"

Op

Op: string = "test"

Type

Type: string = ""

Version

Version: string = "1.0.0"

Generated using TypeDoc