api_client_Network.Network

@polymeshassociation/polymesh-sdk / Modules / api/client/Network / Network

Class: Network

api/client/Network.Network

Handles all Network related functionality, including querying for historical events from middleware

Table of contents

Methods

Methods

getEventByIndexedArgs

getEventByIndexedArgs(opts): Promise<null | EventIdentifier>

Retrieve a single event by any of its indexed arguments. Can be filtered using parameters

note uses the middleware

Parameters

Name
Type
Description

opts

Object

-

opts.eventArg0?

string

event parameter value to filter by in position 0

opts.eventArg1?

string

event parameter value to filter by in position 1

opts.eventArg2?

string

event parameter value to filter by in position 2

opts.eventId

EventIdEnum

type of the event to fetch

opts.moduleId

ModuleIdEnum

type of the module to fetch

Returns

Promise<null | EventIdentifier>

Defined in

api/client/Network.ts:158


getEventsByIndexedArgs

getEventsByIndexedArgs(opts): Promise<null | EventIdentifier[]>

Retrieve a list of events. Can be filtered using parameters

note uses the middleware

Parameters

Name
Type
Description

opts

Object

-

opts.eventArg0?

string

event parameter value to filter by in position 0

opts.eventArg1?

string

event parameter value to filter by in position 1

opts.eventArg2?

string

event parameter value to filter by in position 2

opts.eventId

EventIdEnum

type of the event to fetch

opts.moduleId

ModuleIdEnum

type of the module to fetch

opts.size?

BigNumber

page size

opts.start?

BigNumber

page offset

Returns

Promise<null | EventIdentifier[]>

Defined in

api/client/Network.ts:197


getLatestBlock

getLatestBlock(): Promise<BigNumber>

Retrieve the number of the latest block in the chain

Returns

Promise<BigNumber>

Defined in

api/client/Network.ts:52


getNetworkProperties

getNetworkProperties(): Promise<NetworkProperties>

Retrieve information for the current network

Returns

Promise<NetworkProperties>

Defined in

api/client/Network.ts:73


getProtocolFees

getProtocolFees(args): Promise<ProtocolFees[]>

Retrieve the protocol fees associated with running specific transactions

Parameters

Name
Type
Description

args

Object

-

args.tags

TxTag[]

list of transaction tags (i.e. [TxTags.asset.CreateAsset, TxTags.asset.RegisterTicker] or ["asset.createAsset", "asset.registerTicker"])

Returns

Promise<ProtocolFees[]>

Defined in

api/client/Network.ts:97


getSs58Format

getSs58Format(): BigNumber

Retrieve the chain's SS58 format

Returns

BigNumber

Defined in

api/client/Network.ts:66


getTransactionByHash

getTransactionByHash(opts): Promise<null | ExtrinsicDataWithFees>

Retrieve a transaction by hash

note uses the middleware

Parameters

Name
Type
Description

opts

Object

-

opts.txHash

string

hash of the transaction

Returns

Promise<null | ExtrinsicDataWithFees>

Defined in

api/client/Network.ts:241


getTreasuryAccount

getTreasuryAccount(): Account

Get the treasury wallet address

Returns

Account

Defined in

api/client/Network.ts:104


getTreasuryBalance

getTreasuryBalance(): Promise<BigNumber>

Get the Treasury POLYX balance

note can be subscribed to

Returns

Promise<BigNumber>

Defined in

api/client/Network.ts:117

getTreasuryBalance(callback): Promise<UnsubCallback>

Parameters

Name
Type

callback

SubCallback<BigNumber>

Returns

Promise<UnsubCallback>

Defined in

api/client/Network.ts:118


getVersion

getVersion(): Promise<string>

Fetch the current network version (i.e. 3.1.0)

Returns

Promise<string>

Defined in

api/client/Network.ts:59


transferPolyx

transferPolyx(args, opts?): Promise<TransactionQueue<void, void, unknown[][]>>

Transfer an amount of POLYX to a specified Account

note this method is of type ProcedureMethod, which means you can call transferPolyx.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters

Returns

Promise<TransactionQueue<void, void, unknown[][]>>

Defined in

api/client/Network.ts:143

Last updated