Class SmartContractsClient

Smart Contracts Client object enables smart contract deployment, calls and streaming of events.

Hierarchy

  • BaseClient
    • SmartContractsClient

Implements

Constructors

Properties

clientConfig: IClientConfig
publicApiClient: PublicApiClient
walletClient: IWalletClient

Methods

  • Compacts bytes payload per operation.

    Returns

    The compacted bytes payload.

    Parameters

    • data: DataType

      The operation data.

    • opTypeId: OperationTypeId

      The operation type id.

    • expirePeriod: number

      The expire period.

    Returns Buffer

  • Send a read-only smart contract execution request.

    Remarks

    This method is used to dry-run a smart contract execution and get the changes of the states that would have happen if the transaction was really executed on chain. This operation does not modify the blockchain state.

    Returns

    A promise which resolves to an object containing data about the operation.

    Throws

    • If the contract binary data is missing.
    • If the contract contract address is missing.
    • If the result is empty.
    • If the result contains an error.

    Parameters

    • contractData: IContractData

      The data required for the operation.

    Returns Promise<IExecuteReadOnlyResponse>

  • Returns all the private providers.

    Returns

    An array of IProvider containing all the private providers.

    Returns IProvider[]

  • Returns all the public providers.

    Returns

    An array of IProvider containing all the public providers.

    Returns IProvider[]

  • Sends a post JSON rpc request to the node.

    Throws

    An error if the rpc method returns an error.

    Returns

    A promise that resolves as the result of the rpc method.

    Type Parameters

    • T

    Parameters

    • resource: JSON_RPC_REQUEST_METHOD

      The rpc method to call.

    • params: object

      The parameters to pass to the rpc method.

    Returns Promise<T>

  • Set new providers as IProvider.

    Throws

    Will throw an error if no public providers are included in the given array of providers.

    Throws

    Will throw an error if no private providers are included in the given array of providers.

    Parameters

    • providers: IProvider[]

      The new providers to set as an array of IProvider.

    Returns void

Generated using TypeDoc