Options
All
  • Public
  • Public/Protected
  • All
Menu

The Blockchain class provides an interface for querying and creating transactions on chain.

Example:

import portablegabi from '@kiltprotocol/portablegabi'
// depending on the blockchain, the module where the accumulator is store might be called differently.
// The name can be configured using the 'pgabiModName' option.
const bc = await portablegabi.connect({ pgabiModName: 'portablegabiPallet' })
const acc = await bc.getAccumulatorCount(addr)

Hierarchy

  • Blockchain

Implements

Index

Constructors

constructor

Properties

api

api: ApiPromise & IPortablegabiApi<PgabiModName>

Methods

buildUpdateAccumulatorTX

  • buildUpdateAccumulatorTX(accumulator: Accumulator): SubmittableExtrinsic<"promise">

getAccumulator

  • getAccumulator(address: string, index: number): Promise<Accumulator>

getAccumulatorArray

  • getAccumulatorArray(address: string, startIndex: number, _endIndex?: undefined | number): Promise<Accumulator[]>

getAccumulatorCount

  • getAccumulatorCount(address: string): Promise<number>

getLatestAccumulator

  • getLatestAccumulator(address: string): Promise<Accumulator>

signAndSend

  • signAndSend(tx: SubmittableExtrinsic<"promise">, keypair: KeyringPair): Promise<void>
  • Signs and sends a transaction to a blockchain node.

    Parameters

    • tx: SubmittableExtrinsic<"promise">

      The transaction that should get submitted.

    • keypair: KeyringPair

      The keypair used for signing the transaction.

    Returns Promise<void>

    The returned promise will resolve if the transaction was included in a finalized block. If the transaction fails, the promise will be rejected.

Generated using TypeDoc