Description

RpcClient allows interaction with Tezos network through an rpc node

Implements

Constructors

  • Parameters

    • url: string

      rpc root url

    • chain: string = defaultChain

      chain (default main)

    • httpBackend: HttpBackend = ...

      Http backend that issue http request. You can override it by providing your own if you which to hook in the request/response

    Returns RpcClient

    Example

    new RpcClient('https://mainnet.ecadinfra.com/', 'main') this will use https://mainnet.ecadinfra.com//chains/main
    

Properties

chain: string = defaultChain

chain (default main)

httpBackend: HttpBackend = ...

Http backend that issue http request. You can override it by providing your own if you which to hook in the request/response

url: string

rpc root url

Methods

  • Parameters

    • options: RPCOptions = defaultRPCOptions

      contains generic configuration for rpc calls to specified block (default to head) and version.

    Returns Promise<BlockResponse>

    Description

    All the information about a block

    See

    https://tezos.gitlab.io/api/rpc.html#get-block-id

    Example

    getBlock() will default to `/main/chains/block/head?version=0` which shows { kind: endorsement }
    

    Example

    getBlock({ block: 'head~2', version: 1 }) will return an offset of 2 from head blocks and shows { kind: attestation }
    

    Example

    getBlock({ block: 'BL8fTiWcSxWCjiMVnDkbh6EuhqVPZzgWheJ2dqwrxYRm9AephXh~2' }) will return an offset of 2 blocks from given block hash..
    
  • Parameters

    • contract: string

      implicit or originated address we want to retrieve ticket balance of

    • ticket: TicketTokenParams

      object to specify a ticket by ticketer, content type and content

    • options: {
          block: string;
      } = defaultRPCOptions

      contains generic configuration for rpc calls to specified block (default to head)

      • block: string

    Returns Promise<string>

    Description

    Access the contract's balance of ticket with specified ticketer, content type, and content.

    Example

    ticket { ticketer: 'address', content_type: { prim: "string" }, content: { string: 'ticket1' } }
    

    See

    https://tezos.gitlab.io/protocols/016_mumbai.html#rpc-changes

  • Parameters

    • data: PackDataParams

      Data to pack

    • options: RPCOptions = defaultRPCOptions

      contains generic configuration for rpc calls to specified block (default to head)

    Returns Promise<{
        gas: undefined | BigNumber | "unaccounted";
        packed: string;
    }>

    Description

    Computes the serialized version of a data expression using the same algorithm as script instruction PACK Note: You should always verify the packed bytes before signing or requesting that they be signed when using the RPC to pack. This precaution helps protect you and your applications users from RPC nodes that have been compromised. A node that is operated by a bad actor, or compromised by a bad actor could return a fully formed operation that does not correspond to the input provided to the RPC endpoint. A safer solution to pack and sign data would be to use the packDataBytes function available in the @taquito/michel-codec package.

    Example

    packData({ data: { string: "test" }, type: { prim: "string" } })
    

    See

    https://tezos.gitlab.io/api/rpc.html#post-block-id-helpers-scripts-pack-data

Generated using TypeDoc