Network

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

Hierarchy

  • Network

Index

Methods

Methods

getEventByIndexedArgs

▸ getEventByIndexedArgs(opts: object): Promise‹EventIdentifierarrow-up-right | null›

Defined in src/Network.ts:167arrow-up-right

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

note uses the middleware

Parameters:

â–ª opts: object

Name
Type
Description

eventArg0?

undefined | string

event parameter value to filter by in position 0

eventArg1?

undefined | string

event parameter value to filter by in position 1

eventArg2?

undefined | string

event parameter value to filter by in position 2

eventId

EventId

type of the event to fetch

moduleId

ModuleId

type of the module to fetch

Returns: Promise‹EventIdentifierarrow-up-right | null›


getEventByIndexedArgsV2

▸ getEventByIndexedArgsV2(opts: object): Promise‹EventIdentifierarrow-up-right | null›

Defined in src/Network.ts:204arrow-up-right

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

note uses the middlewareV2

Parameters:

â–ª opts: object

Name
Type
Description

eventArg0?

undefined | string

event parameter value to filter by in position 0

eventArg1?

undefined | string

event parameter value to filter by in position 1

eventArg2?

undefined | string

event parameter value to filter by in position 2

eventId

EventId

type of the event to fetch

moduleId

ModuleId

type of the module to fetch

Returns: Promise‹EventIdentifierarrow-up-right | null›


getEventsByIndexedArgs

▸ getEventsByIndexedArgs(opts: object): Promise‹EventIdentifierarrow-up-right[] | null›

Defined in src/Network.ts:250arrow-up-right

Retrieve a list of events. Can be filtered using parameters

note uses the middleware

Parameters:

â–ª opts: object

Name
Type
Description

eventArg0?

undefined | string

event parameter value to filter by in position 0

eventArg1?

undefined | string

event parameter value to filter by in position 1

eventArg2?

undefined | string

event parameter value to filter by in position 2

eventId

EventId

type of the event to fetch

moduleId

ModuleId

type of the module to fetch

size?

BigNumber

page size

start?

BigNumber

page offset

Returns: Promise‹EventIdentifierarrow-up-right[] | null›


getEventsByIndexedArgsV2

▸ getEventsByIndexedArgsV2(opts: object): Promise‹EventIdentifierarrow-up-right[] | null›

Defined in src/Network.ts:300arrow-up-right

Retrieve a list of events. Can be filtered using parameters

note uses the middlewareV2

Parameters:

â–ª opts: object

Name
Type
Description

eventArg0?

undefined | string

event parameter value to filter by in position 0

eventArg1?

undefined | string

event parameter value to filter by in position 1

eventArg2?

undefined | string

event parameter value to filter by in position 2

eventId

EventId

type of the event to fetch

moduleId

ModuleId

type of the module to fetch

size?

BigNumber

page size

start?

BigNumber

page offset

Returns: Promise‹EventIdentifierarrow-up-right[] | null›


getLatestBlock

▸ getLatestBlock(): Promise‹BigNumber›

Defined in src/Network.ts:61arrow-up-right

Retrieve the number of the latest block in the chain

Returns: Promise‹BigNumber›


getNetworkProperties

▸ getNetworkProperties(): Promise‹NetworkPropertiesarrow-up-right›

Defined in src/Network.ts:82arrow-up-right

Retrieve information for the current network

Returns: Promise‹NetworkPropertiesarrow-up-right›


getProtocolFees

▸ getProtocolFees(args: object): Promise‹ProtocolFeesarrow-up-right[]›

Defined in src/Network.ts:106arrow-up-right

Retrieve the protocol fees associated with running specific transactions

Parameters:

â–ª args: object

Name
Type
Description

tags

TxTag[]

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

Returns: Promise‹ProtocolFeesarrow-up-right[]›


getSs58Format

â–¸ getSs58Format(): BigNumber

Defined in src/Network.ts:75arrow-up-right

Retrieve the chain's SS58 format

Returns: BigNumber


getTransactionByHash

▸ getTransactionByHash(opts: object): Promise‹ExtrinsicDataWithFeesarrow-up-right | null›

Defined in src/Network.ts:348arrow-up-right

Retrieve a transaction by hash

note uses the middleware

Parameters:

â–ª opts: object

Name
Type
Description

txHash

string

hash of the transaction

Returns: Promise‹ExtrinsicDataWithFeesarrow-up-right | null›


getTransactionByHashV2

▸ getTransactionByHashV2(opts: object): Promise‹ExtrinsicDataWithFeesarrow-up-right | null›

Defined in src/Network.ts:435arrow-up-right

Retrieve a transaction by hash

note uses the middlewareV2

Parameters:

â–ª opts: object

Name
Type
Description

txHash

string

hash of the transaction

Returns: Promise‹ExtrinsicDataWithFeesarrow-up-right | null›


getTreasuryAccount

â–¸ getTreasuryAccount(): Account

Defined in src/Network.ts:113arrow-up-right

Get the treasury wallet address

Returns: Account


getTreasuryBalance

▸ getTreasuryBalance(): Promise‹BigNumber›

Defined in src/Network.ts:126arrow-up-right

Get the Treasury POLYX balance

note can be subscribed to

Returns: Promise‹BigNumber›

▸ getTreasuryBalance(callback: SubCallback‹BigNumber›): Promise‹UnsubCallback›

Defined in src/Network.ts:127arrow-up-right

Parameters:

Name
Type

callback

SubCallback‹BigNumber›

Returns: Promise‹UnsubCallback›


getVersion

▸ getVersion(): Promise‹string›

Defined in src/Network.ts:68arrow-up-right

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

Returns: Promise‹string›


transferPolyx

▸ transferPolyx(args: TransferPolyxParamsarrow-up-right, opts?: ProcedureOptsarrow-up-right): Promise‹TransactionQueue‹void››

Defined in src/Network.ts:152arrow-up-right

Transfer an amount of POLYX to a specified Account

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

Parameters:

Returns: Promise‹TransactionQueue‹void››

Last updated

Was this helpful?