Menu

Class: Api

Hierarchy

  • Api

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Api(args: object): Api

Parameters:

Name Type Description
args object rpc: Issues RPC calls authorityProvider: Get public keys needed to meet authorities in a transaction abiProvider: Supplies ABIs in raw form (binary) signatureProvider: Signs transactions chainId: Identifies chain textEncoder: TextEncoder instance to use. Pass in null if running in a browser * textDecoder: TextDecoder instance to use. Pass in null if running in a browser

Returns: Api

Properties

abiProvider

abiProvider: AbiProvider


abiTypes

abiTypes: Map‹string, Type


authorityProvider

authorityProvider: AuthorityProvider


cachedAbis

cachedAbis: Map‹string, CachedAbi = new Map<string, CachedAbi>()


chainId

chainId: string


contracts

contracts: Map‹string, Contract = new Map<string, ser.Contract>()


rpc

rpc: JsonRpc


signatureProvider

signatureProvider: SignatureProvider


textDecoder

textDecoder: TextDecoder


textEncoder

textEncoder: TextEncoder


transactionTypes

transactionTypes: Map‹string, Type

Methods

deserialize

deserialize(buffer: SerialBuffer, type: string): any

Parameters:

Name Type
buffer SerialBuffer
type string

Returns: any


deserializeActions

deserializeActions(actions: Action[]): Promise‹Action[]›

Parameters:

Name Type
actions Action[]

Returns: Promise‹Action[]›


deserializeTransaction

deserializeTransaction(transaction: Uint8Array): any

Parameters:

Name Type
transaction Uint8Array

Returns: any


deserializeTransactionWithActions

deserializeTransactionWithActions(transaction: Uint8Array | string): Promise‹any›

Parameters:

Name Type
transaction Uint8Array | string

Returns: Promise‹any›


getAbi

getAbi(accountName: string, reload: boolean): Promise‹Abi

Parameters:

Name Type Default
accountName string -
reload boolean false

Returns: Promise‹Abi


getCachedAbi

getCachedAbi(accountName: string, reload: boolean): Promise‹CachedAbi

Parameters:

Name Type Default
accountName string -
reload boolean false

Returns: Promise‹CachedAbi


getContract

getContract(accountName: string, reload: boolean): Promise‹Contract

Parameters:

Name Type Default
accountName string -
reload boolean false

Returns: Promise‹Contract


getTransactionAbis

getTransactionAbis(transaction: any, reload: boolean): Promise‹BinaryAbi[]›

Parameters:

Name Type Default
transaction any -
reload boolean false

Returns: Promise‹BinaryAbi[]›


jsonToRawAbi

jsonToRawAbi(jsonAbi: Abi): Uint8Array

Parameters:

Name Type
jsonAbi Abi

Returns: Uint8Array


pushSignedTransaction

pushSignedTransaction(__namedParameters: object): Promise‹any›

Parameters:

Name Type
__namedParameters object

Returns: Promise‹any›


rawAbiToJson

rawAbiToJson(rawAbi: Uint8Array): Abi

Parameters:

Name Type
rawAbi Uint8Array

Returns: Abi


serialize

serialize(buffer: SerialBuffer, type: string, value: any): void

Parameters:

Name Type
buffer SerialBuffer
type string
value any

Returns: void


serializeActions

serializeActions(actions: Action[]): Promise‹SerializedAction[]›

Parameters:

Name Type
actions Action[]

Returns: Promise‹SerializedAction[]›


serializeContextFreeData

serializeContextFreeData(contextFreeData: Uint8Array[]): Uint8Array

Parameters:

Name Type
contextFreeData Uint8Array[]

Returns: Uint8Array


serializeTransaction

serializeTransaction(transaction: any): Uint8Array

Parameters:

Name Type
transaction any

Returns: Uint8Array


transact

transact(transaction: any, __namedParameters: object): Promise‹any›

Parameters:

Name Type Default
transaction any -
__namedParameters object {}

Returns: Promise‹any›

node response if broadcast, {signatures, serializedTransaction} if !broadcast