parent
3ec028a8e0
commit
b293597950
@ -0,0 +1,55 @@ |
||||
## Indexes |
||||
|
||||
1. [@harmony-js/core](harmony-core/README.md) |
||||
2. [@harmony-js/account](harmony-account/README.md) |
||||
3. [@harmony-js/transaction](harmony-transaction/README.md) |
||||
4. [@harmony-js/contract](harmony-contract/README.md) |
||||
5. [@harmony-js/network](harmony-network/README.md) |
||||
6. [@harmony-js/crypto](harmony-crypto/README.md) |
||||
7. [@harmony-js/utils](harmony-utils/README.md) |
||||
|
||||
## @harmony-js/core |
||||
|
||||
The Core package, which contains main entry `Classes`, eg. |
||||
- Harmony |
||||
- Blockchain |
||||
|
||||
## @harmony-js/account |
||||
|
||||
The account related sub package, most used are: |
||||
- Wallet |
||||
- Account |
||||
|
||||
## @harmony-js/transaction |
||||
|
||||
The transaction realted sub package, contains: |
||||
- TransactionFactory |
||||
- Transaction |
||||
|
||||
## @harmony-js/contract |
||||
|
||||
The contract related sub package, contains: |
||||
- ContractFactory |
||||
- Contract |
||||
|
||||
|
||||
## @harmony-js/network |
||||
|
||||
The network realted sub package, contains: |
||||
- WSProvider |
||||
- HTTPProvider |
||||
- Messenger |
||||
- Emitter |
||||
- Subscriptions |
||||
|
||||
|
||||
## @harmony-js/crypto |
||||
|
||||
The crypto realted sub package |
||||
|
||||
## @harmony-js/utils |
||||
|
||||
The utils realted sub package, contains a set of tools, including: |
||||
- validator |
||||
- transformer |
||||
- Unit |
@ -0,0 +1,47 @@ |
||||
> **[@harmony-js/account](README.md)** |
||||
|
||||
## Index |
||||
|
||||
### Classes |
||||
|
||||
* [Account](classes/account.md) |
||||
* [HDNode](classes/hdnode.md) |
||||
* [Wallet](classes/wallet.md) |
||||
|
||||
### Type aliases |
||||
|
||||
* [ShardID](README.md#shardid) |
||||
* [Shards](README.md#shards) |
||||
|
||||
### Variables |
||||
|
||||
* [defaultMessenger](README.md#const-defaultmessenger) |
||||
|
||||
## Type aliases |
||||
|
||||
### ShardID |
||||
|
||||
Ƭ **ShardID**: *string | number* |
||||
|
||||
*Defined in [types.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/types.ts#L4)* |
||||
|
||||
test type docs |
||||
|
||||
___ |
||||
|
||||
### Shards |
||||
|
||||
Ƭ **Shards**: *`Map<ShardID, string>`* |
||||
|
||||
*Defined in [types.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/types.ts#L5)* |
||||
|
||||
## Variables |
||||
|
||||
### `Const` defaultMessenger |
||||
|
||||
• **defaultMessenger**: *`Messenger`* = new Messenger( |
||||
new HttpProvider('http://localhost:8545'), |
||||
ChainType.Harmony, |
||||
) |
||||
|
||||
*Defined in [utils.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/utils.ts#L4)* |
@ -0,0 +1,346 @@ |
||||
> **[@harmony-js/account](../README.md)** |
||||
|
||||
[Account](account.md) / |
||||
|
||||
# Class: Account |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Account** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](account.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [address](account.md#optional-address) |
||||
* [balance](account.md#optional-balance) |
||||
* [encrypted](account.md#encrypted) |
||||
* [messenger](account.md#messenger) |
||||
* [nonce](account.md#optional-nonce) |
||||
* [privateKey](account.md#optional-privatekey) |
||||
* [publicKey](account.md#optional-publickey) |
||||
* [shards](account.md#shards) |
||||
|
||||
### Accessors |
||||
|
||||
* [bech32Address](account.md#bech32address) |
||||
* [bech32TestNetAddress](account.md#bech32testnetaddress) |
||||
* [checksumAddress](account.md#checksumaddress) |
||||
* [getShardsCount](account.md#getshardscount) |
||||
|
||||
### Methods |
||||
|
||||
* [_import](account.md#private-_import) |
||||
* [_new](account.md#private-_new) |
||||
* [fromFile](account.md#fromfile) |
||||
* [getBalance](account.md#getbalance) |
||||
* [setMessenger](account.md#setmessenger) |
||||
* [signTransaction](account.md#signtransaction) |
||||
* [toFile](account.md#tofile) |
||||
* [updateShards](account.md#updateshards) |
||||
* [add](account.md#static-add) |
||||
* [new](account.md#static-new) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new Account**(`key?`: undefined | string, `messenger`: `Messenger`): *[Account](account.md)* |
||||
|
||||
*Defined in [account.ts:68](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L68)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`key?` | undefined \| string | - | |
||||
`messenger` | `Messenger` | defaultMessenger | |
||||
|
||||
**Returns:** *[Account](account.md)* |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` address |
||||
|
||||
• **address**? : *undefined | string* |
||||
|
||||
*Defined in [account.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L41)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` balance |
||||
|
||||
• **balance**? : *undefined | string* = "0" |
||||
|
||||
*Defined in [account.ts:42](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L42)* |
||||
|
||||
___ |
||||
|
||||
### encrypted |
||||
|
||||
• **encrypted**: *boolean* = false |
||||
|
||||
*Defined in [account.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L46)* |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *`Messenger`* |
||||
|
||||
*Defined in [account.ts:45](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L45)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` nonce |
||||
|
||||
• **nonce**? : *undefined | number* = 0 |
||||
|
||||
*Defined in [account.ts:43](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L43)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` privateKey |
||||
|
||||
• **privateKey**? : *undefined | string* |
||||
|
||||
*Defined in [account.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L39)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` publicKey |
||||
|
||||
• **publicKey**? : *undefined | string* |
||||
|
||||
*Defined in [account.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L40)* |
||||
|
||||
___ |
||||
|
||||
### shards |
||||
|
||||
• **shards**: *[Shards](../README.md#shards)* = new Map().set('default', '') |
||||
|
||||
*Defined in [account.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L44)* |
||||
|
||||
## Accessors |
||||
|
||||
### bech32Address |
||||
|
||||
• **get bech32Address**(): *string* |
||||
|
||||
*Defined in [account.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L55)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### bech32TestNetAddress |
||||
|
||||
• **get bech32TestNetAddress**(): *string* |
||||
|
||||
*Defined in [account.ts:58](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L58)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### checksumAddress |
||||
|
||||
• **get checksumAddress**(): *string* |
||||
|
||||
*Defined in [account.ts:52](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L52)* |
||||
|
||||
**`function`** checksumAddress checsumAddress getter |
||||
|
||||
**Returns:** *string* |
||||
|
||||
get the checksumAddress |
||||
|
||||
___ |
||||
|
||||
### getShardsCount |
||||
|
||||
• **get getShardsCount**(): *number* |
||||
|
||||
*Defined in [account.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L66)* |
||||
|
||||
**`function`** getShardsCount getShards number with this Account |
||||
|
||||
**Returns:** *number* |
||||
|
||||
shard size |
||||
|
||||
## Methods |
||||
|
||||
### `Private` _import |
||||
|
||||
▸ **_import**(`key`: string): *[Account](account.md)* |
||||
|
||||
*Defined in [account.ts:205](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L205)* |
||||
|
||||
**`function`** _import private method import a private Key |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`key` | string | private key | |
||||
|
||||
**Returns:** *[Account](account.md)* |
||||
|
||||
Account instance |
||||
|
||||
___ |
||||
|
||||
### `Private` _new |
||||
|
||||
▸ **_new**(): *[Account](account.md)* |
||||
|
||||
*Defined in [account.ts:192](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L192)* |
||||
|
||||
**`function`** _new private method create Account |
||||
|
||||
**Returns:** *[Account](account.md)* |
||||
|
||||
Account instance |
||||
|
||||
___ |
||||
|
||||
### fromFile |
||||
|
||||
▸ **fromFile**(`keyStore`: string, `password`: string): *`Promise<Account>`* |
||||
|
||||
*Defined in [account.ts:90](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L90)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`keyStore` | string | |
||||
`password` | string | |
||||
|
||||
**Returns:** *`Promise<Account>`* |
||||
|
||||
___ |
||||
|
||||
### getBalance |
||||
|
||||
▸ **getBalance**(`blockNumber`: string): *`Promise<object>`* |
||||
|
||||
*Defined in [account.ts:111](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L111)* |
||||
|
||||
**`function`** getBalance get Account's balance |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`blockNumber` | string | "latest" | |
||||
|
||||
**Returns:** *`Promise<object>`* |
||||
|
||||
{description} |
||||
|
||||
___ |
||||
|
||||
### setMessenger |
||||
|
||||
▸ **setMessenger**(`messenger`: `Messenger`): *void* |
||||
|
||||
*Defined in [account.ts:185](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L185)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`messenger` | `Messenger` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### signTransaction |
||||
|
||||
▸ **signTransaction**(`transaction`: `Transaction`, `updateNonce`: boolean, `encodeMode`: string, `blockNumber`: string): *`Promise<Transaction>`* |
||||
|
||||
*Defined in [account.ts:153](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L153)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`transaction` | `Transaction` | - | |
||||
`updateNonce` | boolean | true | |
||||
`encodeMode` | string | "rlp" | |
||||
`blockNumber` | string | "latest" | |
||||
|
||||
**Returns:** *`Promise<Transaction>`* |
||||
|
||||
___ |
||||
|
||||
### toFile |
||||
|
||||
▸ **toFile**(`password`: string, `options?`: `EncryptOptions`): *`Promise<string>`* |
||||
|
||||
*Defined in [account.ts:79](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L79)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`password` | string | |
||||
`options?` | `EncryptOptions` | |
||||
|
||||
**Returns:** *`Promise<string>`* |
||||
|
||||
___ |
||||
|
||||
### updateShards |
||||
|
||||
▸ **updateShards**(): *`Promise<string>`* |
||||
|
||||
*Defined in [account.ts:149](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L149)* |
||||
|
||||
**`function`** updateShards |
||||
|
||||
**Returns:** *`Promise<string>`* |
||||
|
||||
{description} |
||||
|
||||
___ |
||||
|
||||
### `Static` add |
||||
|
||||
▸ **add**(`key`: string): *[Account](account.md)* |
||||
|
||||
*Defined in [account.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L34)* |
||||
|
||||
**`function`** add static method add a private key to Account |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`key` | string | private Key | |
||||
|
||||
**Returns:** *[Account](account.md)* |
||||
|
||||
Account instance |
||||
|
||||
___ |
||||
|
||||
### `Static` new |
||||
|
||||
▸ **new**(): *[Account](account.md)* |
||||
|
||||
*Defined in [account.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/account.ts#L25)* |
||||
|
||||
**`function`** new static method create account |
||||
|
||||
**Returns:** *[Account](account.md)* |
||||
|
||||
Account instance |
@ -0,0 +1,301 @@ |
||||
> **[@harmony-js/account](../README.md)** |
||||
|
||||
[HDNode](hdnode.md) / |
||||
|
||||
# Class: HDNode |
||||
|
||||
## Hierarchy |
||||
|
||||
* `HDNode` |
||||
|
||||
* **HDNode** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](hdnode.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [chainCode](hdnode.md#chaincode) |
||||
* [childKey](hdnode.md#private-optional-childkey) |
||||
* [entropy](hdnode.md#private-optional-entropy) |
||||
* [mnemonic](hdnode.md#private-optional-mnemonic) |
||||
* [path](hdnode.md#private-path) |
||||
* [privateKey](hdnode.md#privatekey) |
||||
* [publicKey](hdnode.md#publickey) |
||||
|
||||
### Accessors |
||||
|
||||
* [_privateKey](hdnode.md#_privatekey) |
||||
* [_publicKey](hdnode.md#_publickey) |
||||
|
||||
### Methods |
||||
|
||||
* [derive](hdnode.md#derive) |
||||
* [getChildKey](hdnode.md#getchildkey) |
||||
* [getEntropy](hdnode.md#getentropy) |
||||
* [lock](hdnode.md#lock) |
||||
* [unlock](hdnode.md#unlock) |
||||
* [add](hdnode.md#static-add) |
||||
* [fromMasterSeed](hdnode.md#static-frommasterseed) |
||||
* [generateMnemonic](hdnode.md#static-generatemnemonic) |
||||
* [isValidMnemonic](hdnode.md#static-isvalidmnemonic) |
||||
* [new](hdnode.md#static-new) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new HDNode**(`menmonic?`: undefined | string, `index`: number): *[HDNode](hdnode.md)* |
||||
|
||||
*Overrides void* |
||||
|
||||
*Defined in [hdnode.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L29)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`menmonic?` | undefined \| string | - | |
||||
`index` | number | 0 | |
||||
|
||||
**Returns:** *[HDNode](hdnode.md)* |
||||
|
||||
## Properties |
||||
|
||||
### chainCode |
||||
|
||||
• **chainCode**: *`Buffer`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/node_modules/@types/hdkey/index.d.ts:12 |
||||
|
||||
___ |
||||
|
||||
### `Private` `Optional` childKey |
||||
|
||||
• **childKey**? : *`hdkey`* |
||||
|
||||
*Defined in [hdnode.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L29)* |
||||
|
||||
___ |
||||
|
||||
### `Private` `Optional` entropy |
||||
|
||||
• **entropy**? : *undefined | string* |
||||
|
||||
*Defined in [hdnode.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L28)* |
||||
|
||||
___ |
||||
|
||||
### `Private` `Optional` mnemonic |
||||
|
||||
• **mnemonic**? : *undefined | string* |
||||
|
||||
*Defined in [hdnode.ts:27](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L27)* |
||||
|
||||
___ |
||||
|
||||
### `Private` path |
||||
|
||||
• **path**: *string* |
||||
|
||||
*Defined in [hdnode.ts:26](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L26)* |
||||
|
||||
___ |
||||
|
||||
### privateKey |
||||
|
||||
• **privateKey**: *`Buffer`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/node_modules/@types/hdkey/index.d.ts:11 |
||||
|
||||
___ |
||||
|
||||
### publicKey |
||||
|
||||
• **publicKey**: *`Buffer`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/node_modules/@types/hdkey/index.d.ts:10 |
||||
|
||||
## Accessors |
||||
|
||||
### _privateKey |
||||
|
||||
• **get _privateKey**(): *string* |
||||
|
||||
*Defined in [hdnode.ts:76](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L76)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### _publicKey |
||||
|
||||
• **get _publicKey**(): *string* |
||||
|
||||
*Defined in [hdnode.ts:79](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L79)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
## Methods |
||||
|
||||
### derive |
||||
|
||||
▸ **derive**(`path`: string): *`HDNode`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/node_modules/@types/hdkey/index.d.ts:14 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`path` | string | |
||||
|
||||
**Returns:** *`HDNode`* |
||||
|
||||
___ |
||||
|
||||
### getChildKey |
||||
|
||||
▸ **getChildKey**(`entropy`: string, `index`: number): *`HDNode`* |
||||
|
||||
*Defined in [hdnode.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L44)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`entropy` | string | |
||||
`index` | number | |
||||
|
||||
**Returns:** *`HDNode`* |
||||
|
||||
___ |
||||
|
||||
### getEntropy |
||||
|
||||
▸ **getEntropy**(`mnemonic`: string): *string* |
||||
|
||||
*Defined in [hdnode.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L41)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`mnemonic` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### lock |
||||
|
||||
▸ **lock**(`password`: string, `options`: `EncryptOptions`): *`Promise<void>`* |
||||
|
||||
*Defined in [hdnode.ts:49](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L49)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`password` | string | |
||||
`options` | `EncryptOptions` | |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### unlock |
||||
|
||||
▸ **unlock**(`password`: string): *`Promise<void>`* |
||||
|
||||
*Defined in [hdnode.ts:61](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L61)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`password` | string | |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### `Static` add |
||||
|
||||
▸ **add**(`phrase`: string, `index`: number): *[HDNode](hdnode.md)* |
||||
|
||||
*Defined in [hdnode.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L14)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`phrase` | string | |
||||
`index` | number | |
||||
|
||||
**Returns:** *[HDNode](hdnode.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` fromMasterSeed |
||||
|
||||
▸ **fromMasterSeed**(`seed`: `Buffer`): *`HDNode`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/node_modules/@types/hdkey/index.d.ts:9 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`seed` | `Buffer` | |
||||
|
||||
**Returns:** *`HDNode`* |
||||
|
||||
___ |
||||
|
||||
### `Static` generateMnemonic |
||||
|
||||
▸ **generateMnemonic**(): *string* |
||||
|
||||
*Defined in [hdnode.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L23)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Static` isValidMnemonic |
||||
|
||||
▸ **isValidMnemonic**(`phrase`: string): *boolean* |
||||
|
||||
*Defined in [hdnode.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L17)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`phrase` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Static` new |
||||
|
||||
▸ **new**(): *[HDNode](hdnode.md)* |
||||
|
||||
*Defined in [hdnode.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/hdnode.ts#L11)* |
||||
|
||||
**Returns:** *[HDNode](hdnode.md)* |
@ -0,0 +1,400 @@ |
||||
> **[@harmony-js/account](../README.md)** |
||||
|
||||
[Wallet](wallet.md) / |
||||
|
||||
# Class: Wallet |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Wallet** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](wallet.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [accountMap](wallet.md#private-accountmap) |
||||
* [defaultSigner](wallet.md#protected-optional-defaultsigner) |
||||
* [messenger](wallet.md#messenger) |
||||
|
||||
### Accessors |
||||
|
||||
* [accounts](wallet.md#accounts) |
||||
* [signer](wallet.md#signer) |
||||
|
||||
### Methods |
||||
|
||||
* [addByKeyStore](wallet.md#addbykeystore) |
||||
* [addByMnemonic](wallet.md#addbymnemonic) |
||||
* [addByPrivateKey](wallet.md#addbyprivatekey) |
||||
* [createAccount](wallet.md#createaccount) |
||||
* [decryptAccount](wallet.md#decryptaccount) |
||||
* [encryptAccount](wallet.md#encryptaccount) |
||||
* [getAccount](wallet.md#getaccount) |
||||
* [isValidMnemonic](wallet.md#private-isvalidmnemonic) |
||||
* [newMnemonic](wallet.md#newmnemonic) |
||||
* [removeAccount](wallet.md#removeaccount) |
||||
* [setMessenger](wallet.md#setmessenger) |
||||
* [setSigner](wallet.md#setsigner) |
||||
* [signTransaction](wallet.md#signtransaction) |
||||
* [generateMnemonic](wallet.md#static-generatemnemonic) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new Wallet**(`messenger`: `Messenger`): *[Wallet](wallet.md)* |
||||
|
||||
*Defined in [wallet.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L44)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`messenger` | `Messenger` | defaultMessenger | |
||||
|
||||
**Returns:** *[Wallet](wallet.md)* |
||||
|
||||
## Properties |
||||
|
||||
### `Private` accountMap |
||||
|
||||
• **accountMap**: *`Map<string, Account>`* = new Map() |
||||
|
||||
*Defined in [wallet.ts:26](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L26)* |
||||
|
||||
**`memberof`** Wallet |
||||
|
||||
___ |
||||
|
||||
### `Protected` `Optional` defaultSigner |
||||
|
||||
• **defaultSigner**? : *undefined | string* |
||||
|
||||
*Defined in [wallet.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L21)* |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *`Messenger`* |
||||
|
||||
*Defined in [wallet.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L20)* |
||||
|
||||
## Accessors |
||||
|
||||
### accounts |
||||
|
||||
• **get accounts**(): *string[]* |
||||
|
||||
*Defined in [wallet.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L31)* |
||||
|
||||
**`memberof`** Wallet |
||||
|
||||
**Returns:** *string[]* |
||||
|
||||
accounts addresses |
||||
|
||||
___ |
||||
|
||||
### signer |
||||
|
||||
• **get signer**(): *[Account](account.md) | undefined* |
||||
|
||||
*Defined in [wallet.ts:35](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L35)* |
||||
|
||||
**Returns:** *[Account](account.md) | undefined* |
||||
|
||||
## Methods |
||||
|
||||
### addByKeyStore |
||||
|
||||
▸ **addByKeyStore**(`keyStore`: string, `password`: string): *`Promise<Account>`* |
||||
|
||||
*Defined in [wallet.ts:110](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L110)* |
||||
|
||||
**`function`** addByKeyStore |
||||
|
||||
**`memberof`** Wallet |
||||
|
||||
**`description`** add an account using privateKey |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`keyStore` | string | keystore jsonString to add | |
||||
`password` | string | password to decrypt the file | |
||||
|
||||
**Returns:** *`Promise<Account>`* |
||||
|
||||
return added Account |
||||
|
||||
___ |
||||
|
||||
### addByMnemonic |
||||
|
||||
▸ **addByMnemonic**(`phrase`: string, `index`: number): *[Account](account.md)* |
||||
|
||||
*Defined in [wallet.ts:65](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L65)* |
||||
|
||||
**`function`** addByMnemonic |
||||
|
||||
**`memberof`** Wallet |
||||
|
||||
**`description`** add account using Mnemonic phrases |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | Description | |
||||
------ | ------ | ------ | ------ | |
||||
`phrase` | string | - | Mnemonic phrase | |
||||
`index` | number | 0 | index to hdKey root | |
||||
|
||||
**Returns:** *[Account](account.md)* |
||||
|
||||
___ |
||||
|
||||
### addByPrivateKey |
||||
|
||||
▸ **addByPrivateKey**(`privateKey`: string): *[Account](account.md)* |
||||
|
||||
*Defined in [wallet.ts:84](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L84)* |
||||
|
||||
**`function`** addByPrivateKey |
||||
|
||||
**`memberof`** Wallet |
||||
|
||||
**`description`** add an account using privateKey |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`privateKey` | string | privateKey to add | |
||||
|
||||
**Returns:** *[Account](account.md)* |
||||
|
||||
return added Account |
||||
|
||||
___ |
||||
|
||||
### createAccount |
||||
|
||||
▸ **createAccount**(`password?`: undefined | string, `options?`: `EncryptOptions`): *`Promise<Account>`* |
||||
|
||||
*Defined in [wallet.ts:134](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L134)* |
||||
|
||||
**`function`** createAccount |
||||
|
||||
**`description`** create a new account using Mnemonic |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`password?` | undefined \| string | |
||||
`options?` | `EncryptOptions` | |
||||
|
||||
**Returns:** *`Promise<Account>`* |
||||
|
||||
{description} |
||||
|
||||
___ |
||||
|
||||
### decryptAccount |
||||
|
||||
▸ **decryptAccount**(`address`: string, `password`: string): *`Promise<Account>`* |
||||
|
||||
*Defined in [wallet.ts:200](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L200)* |
||||
|
||||
**`function`** decryptAccount |
||||
|
||||
**`memberof`** Wallet |
||||
|
||||
**`description`** to decrypt an account that lives in the wallet,if not encrypted, return original, |
||||
if not found, throw error |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`address` | string | address in accounts | |
||||
`password` | string | string that used to encrypt | |
||||
|
||||
**Returns:** *`Promise<Account>`* |
||||
|
||||
___ |
||||
|
||||
### encryptAccount |
||||
|
||||
▸ **encryptAccount**(`address`: string, `password`: string, `options?`: `EncryptOptions`): *`Promise<Account>`* |
||||
|
||||
*Defined in [wallet.ts:164](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L164)* |
||||
|
||||
**`function`** encryptAccount |
||||
|
||||
**`memberof`** Wallet |
||||
|
||||
**`description`** to encrypt an account that lives in the wallet, |
||||
if encrypted, returns original one, if not found, throw error |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`address` | string | address in accounts | |
||||
`password` | string | string that used to encrypt | |
||||
`options?` | `EncryptOptions` | encryption options | |
||||
|
||||
**Returns:** *`Promise<Account>`* |
||||
|
||||
___ |
||||
|
||||
### getAccount |
||||
|
||||
▸ **getAccount**(`address`: string): *[Account](account.md) | undefined* |
||||
|
||||
*Defined in [wallet.ts:232](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L232)* |
||||
|
||||
**`function`** getAccount |
||||
|
||||
**`memberof`** Wallet |
||||
|
||||
**`description`** get Account instance using address as param |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`address` | string | address hex | |
||||
|
||||
**Returns:** *[Account](account.md) | undefined* |
||||
|
||||
Account instance which lives in Wallet |
||||
|
||||
___ |
||||
|
||||
### `Private` isValidMnemonic |
||||
|
||||
▸ **isValidMnemonic**(`phrase`: string): *boolean* |
||||
|
||||
*Defined in [wallet.ts:324](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L324)* |
||||
|
||||
**`function`** isValidMnemonic |
||||
|
||||
**`memberof`** Wallet |
||||
|
||||
**`description`** check if Mnemonic is valid |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`phrase` | string | Mnemonic phrase | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### newMnemonic |
||||
|
||||
▸ **newMnemonic**(): *string* |
||||
|
||||
*Defined in [wallet.ts:54](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L54)* |
||||
|
||||
**`function`** newMnemonic |
||||
|
||||
**`memberof`** Wallet |
||||
|
||||
**Returns:** *string* |
||||
|
||||
Mnemonics |
||||
|
||||
___ |
||||
|
||||
### removeAccount |
||||
|
||||
▸ **removeAccount**(`address`: string): *void* |
||||
|
||||
*Defined in [wallet.ts:242](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L242)* |
||||
|
||||
**`function`** removeAccount |
||||
|
||||
**`memberof`** Wallet |
||||
|
||||
**`description`** remove Account using address as param |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`address` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setMessenger |
||||
|
||||
▸ **setMessenger**(`messenger`: `Messenger`): *void* |
||||
|
||||
*Defined in [wallet.ts:249](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L249)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`messenger` | `Messenger` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setSigner |
||||
|
||||
▸ **setSigner**(`address`: string): *void* |
||||
|
||||
*Defined in [wallet.ts:253](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L253)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`address` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### signTransaction |
||||
|
||||
▸ **signTransaction**(`transaction`: `Transaction`, `account`: [Account](account.md) | undefined, `password`: string | undefined, `updateNonce`: boolean, `encodeMode`: string, `blockNumber`: string): *`Promise<Transaction>`* |
||||
|
||||
*Defined in [wallet.ts:260](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L260)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`transaction` | `Transaction` | - | |
||||
`account` | [Account](account.md) \| undefined | this.signer | |
||||
`password` | string \| undefined | undefined | |
||||
`updateNonce` | boolean | true | |
||||
`encodeMode` | string | "rlp" | |
||||
`blockNumber` | string | "latest" | |
||||
|
||||
**Returns:** *`Promise<Transaction>`* |
||||
|
||||
___ |
||||
|
||||
### `Static` generateMnemonic |
||||
|
||||
▸ **generateMnemonic**(): *string* |
||||
|
||||
*Defined in [wallet.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-account/src/wallet.ts#L16)* |
||||
|
||||
**Returns:** *string* |
@ -0,0 +1,943 @@ |
||||
> **[@harmony-js/contract](README.md)** |
||||
|
||||
## Index |
||||
|
||||
### Enumerations |
||||
|
||||
* [ContractStatus](enums/contractstatus.md) |
||||
* [UnicodeNormalizationForm](enums/unicodenormalizationform.md) |
||||
|
||||
### Classes |
||||
|
||||
* [AbiCoder](classes/abicoder.md) |
||||
* [AbiCoderClass](classes/abicoderclass.md) |
||||
* [AbiItem](classes/abiitem.md) |
||||
* [AbiModel](classes/abimodel.md) |
||||
* [Coder](classes/coder.md) |
||||
* [CoderAddress](classes/coderaddress.md) |
||||
* [CoderAnonymous](classes/coderanonymous.md) |
||||
* [CoderArray](classes/coderarray.md) |
||||
* [CoderBoolean](classes/coderboolean.md) |
||||
* [CoderDynamicBytes](classes/coderdynamicbytes.md) |
||||
* [CoderFixedBytes](classes/coderfixedbytes.md) |
||||
* [CoderNull](classes/codernull.md) |
||||
* [CoderNumber](classes/codernumber.md) |
||||
* [CoderString](classes/coderstring.md) |
||||
* [CoderTuple](classes/codertuple.md) |
||||
* [Contract](classes/contract.md) |
||||
* [ContractFactory](classes/contractfactory.md) |
||||
* [ContractMethod](classes/contractmethod.md) |
||||
* [EventFactory](classes/eventfactory.md) |
||||
* [EventMethod](classes/eventmethod.md) |
||||
* [MethodFactory](classes/methodfactory.md) |
||||
|
||||
### Interfaces |
||||
|
||||
* [AbiInput](interfaces/abiinput.md) |
||||
* [AbiItemModel](interfaces/abiitemmodel.md) |
||||
* [AbiOutput](interfaces/abioutput.md) |
||||
* [ContractOptions](interfaces/contractoptions.md) |
||||
* [DecodedResult](interfaces/decodedresult.md) |
||||
* [EventFragment](interfaces/eventfragment.md) |
||||
* [FunctionFragment](interfaces/functionfragment.md) |
||||
* [ParamType](interfaces/paramtype.md) |
||||
* [ParseNode](interfaces/parsenode.md) |
||||
* [ParseState](interfaces/parsestate.md) |
||||
|
||||
### Type aliases |
||||
|
||||
* [CoerceFunc](README.md#coercefunc) |
||||
|
||||
### Variables |
||||
|
||||
* [HashZero](README.md#const-hashzero) |
||||
* [MaxUint256](README.md#const-maxuint256) |
||||
* [NegativeOne](README.md#const-negativeone) |
||||
* [One](README.md#const-one) |
||||
* [Zero](README.md#const-zero) |
||||
* [defaultAbiCoder](README.md#const-defaultabicoder) |
||||
* [paramTypeArray](README.md#const-paramtypearray) |
||||
* [paramTypeBytes](README.md#const-paramtypebytes) |
||||
* [paramTypeNumber](README.md#const-paramtypenumber) |
||||
* [regexIdentifier](README.md#const-regexidentifier) |
||||
* [regexParen](README.md#const-regexparen) |
||||
* [uint256Coder](README.md#const-uint256coder) |
||||
|
||||
### Functions |
||||
|
||||
* [_decodeDynamicBytes](README.md#_decodedynamicbytes) |
||||
* [_encodeDynamicBytes](README.md#_encodedynamicbytes) |
||||
* [abiMapper](README.md#const-abimapper) |
||||
* [alignSize](README.md#alignsize) |
||||
* [bnToString](README.md#bntostring) |
||||
* [decode](README.md#const-decode) |
||||
* [deepCopy](README.md#deepcopy) |
||||
* [defaultCoerceFunc](README.md#const-defaultcoercefunc) |
||||
* [eventFilterEncoder](README.md#const-eventfilterencoder) |
||||
* [flattenTypes](README.md#const-flattentypes) |
||||
* [formatBytes32String](README.md#formatbytes32string) |
||||
* [formatParamType](README.md#formatparamtype) |
||||
* [formatSignature](README.md#formatsignature) |
||||
* [getParamCoder](README.md#getparamcoder) |
||||
* [getTupleParamCoder](README.md#gettupleparamcoder) |
||||
* [inputAddressFormatter](README.md#const-inputaddressformatter) |
||||
* [inputBlockNumberFormatter](README.md#const-inputblocknumberformatter) |
||||
* [inputLogFormatter](README.md#const-inputlogformatter) |
||||
* [isConstant](README.md#const-isconstant) |
||||
* [isPayable](README.md#const-ispayable) |
||||
* [isPredefinedBlockNumber](README.md#const-ispredefinedblocknumber) |
||||
* [isType](README.md#istype) |
||||
* [jsonInterfaceMethodToString](README.md#const-jsoninterfacemethodtostring) |
||||
* [methodEncoder](README.md#const-methodencoder) |
||||
* [outputLogFormatter](README.md#const-outputlogformatter) |
||||
* [pack](README.md#pack) |
||||
* [parseBytes32String](README.md#parsebytes32string) |
||||
* [parseParam](README.md#parseparam) |
||||
* [parseParamType](README.md#parseparamtype) |
||||
* [parseSignature](README.md#parsesignature) |
||||
* [parseSignatureEvent](README.md#parsesignatureevent) |
||||
* [parseSignatureFunction](README.md#parsesignaturefunction) |
||||
* [shallowCopy](README.md#shallowcopy) |
||||
* [splitNesting](README.md#splitnesting) |
||||
* [toTopic](README.md#const-totopic) |
||||
* [toUtf8Bytes](README.md#toutf8bytes) |
||||
* [toUtf8String](README.md#toutf8string) |
||||
* [unpack](README.md#unpack) |
||||
* [verifyType](README.md#verifytype) |
||||
|
||||
### Object literals |
||||
|
||||
* [opaque](README.md#const-opaque) |
||||
* [paramTypeSimple](README.md#const-paramtypesimple) |
||||
|
||||
## Type aliases |
||||
|
||||
### CoerceFunc |
||||
|
||||
Ƭ **CoerceFunc**: *function* |
||||
|
||||
*Defined in [abi/abiCoder.ts:35](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L35)* |
||||
|
||||
#### Type declaration: |
||||
|
||||
▸ (`type`: string, `value`: any): *any* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`value` | any | |
||||
|
||||
## Variables |
||||
|
||||
### `Const` HashZero |
||||
|
||||
• **HashZero**: *"0x0000000000000000000000000000000000000000000000000000000000000000"* = "0x0000000000000000000000000000000000000000000000000000000000000000" |
||||
|
||||
*Defined in [abi/abiCoder.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L28)* |
||||
|
||||
___ |
||||
|
||||
### `Const` MaxUint256 |
||||
|
||||
• **MaxUint256**: *`BN`* = hexToBN( |
||||
'0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', |
||||
) |
||||
|
||||
*Defined in [abi/abiCoder.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L31)* |
||||
|
||||
___ |
||||
|
||||
### `Const` NegativeOne |
||||
|
||||
• **NegativeOne**: *`BN`* = new BN(-1) |
||||
|
||||
*Defined in [abi/abiCoder.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L24)* |
||||
|
||||
___ |
||||
|
||||
### `Const` One |
||||
|
||||
• **One**: *`BN`* = new BN(1) |
||||
|
||||
*Defined in [abi/abiCoder.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L25)* |
||||
|
||||
___ |
||||
|
||||
### `Const` Zero |
||||
|
||||
• **Zero**: *`BN`* = new BN(0) |
||||
|
||||
*Defined in [abi/abiCoder.ts:27](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L27)* |
||||
|
||||
___ |
||||
|
||||
### `Const` defaultAbiCoder |
||||
|
||||
• **defaultAbiCoder**: *[AbiCoder](classes/abicoder.md)* = new AbiCoder() |
||||
|
||||
*Defined in [abi/abiCoder.ts:1568](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1568)* |
||||
|
||||
___ |
||||
|
||||
### `Const` paramTypeArray |
||||
|
||||
• **paramTypeArray**: *`RegExp`* = new RegExp(/^(.*)\[([0-9]*)\]$/) |
||||
|
||||
*Defined in [abi/abiCoder.ts:74](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L74)* |
||||
|
||||
___ |
||||
|
||||
### `Const` paramTypeBytes |
||||
|
||||
• **paramTypeBytes**: *`RegExp`* = new RegExp(/^bytes([0-9]*)$/) |
||||
|
||||
*Defined in [abi/abiCoder.ts:72](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L72)* |
||||
|
||||
___ |
||||
|
||||
### `Const` paramTypeNumber |
||||
|
||||
• **paramTypeNumber**: *`RegExp`* = new RegExp(/^(u?int)([0-9]*)$/) |
||||
|
||||
*Defined in [abi/abiCoder.ts:73](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L73)* |
||||
|
||||
___ |
||||
|
||||
### `Const` regexIdentifier |
||||
|
||||
• **regexIdentifier**: *`RegExp`* = new RegExp('^[A-Za-z_][A-Za-z0-9_]*$') |
||||
|
||||
*Defined in [abi/abiCoder.ts:95](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L95)* |
||||
|
||||
___ |
||||
|
||||
### `Const` regexParen |
||||
|
||||
• **regexParen**: *`RegExp`* = new RegExp('^([^)(]*)\\((.*)\\)([^)(]*)$') |
||||
|
||||
*Defined in [abi/abiCoder.ts:94](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L94)* |
||||
|
||||
___ |
||||
|
||||
### `Const` uint256Coder |
||||
|
||||
• **uint256Coder**: *[CoderNumber](classes/codernumber.md)* = new CoderNumber( |
||||
(type: string, value: any) => { |
||||
return value; |
||||
}, |
||||
32, |
||||
false, |
||||
'none', |
||||
) |
||||
|
||||
*Defined in [abi/abiCoder.ts:627](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L627)* |
||||
|
||||
## Functions |
||||
|
||||
### _decodeDynamicBytes |
||||
|
||||
▸ **_decodeDynamicBytes**(`data`: `Uint8Array`, `offset`: number, `localName`: string): *[DecodedResult](interfaces/decodedresult.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:766](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L766)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
`localName` | string | |
||||
|
||||
**Returns:** *[DecodedResult](interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### _encodeDynamicBytes |
||||
|
||||
▸ **_encodeDynamicBytes**(`value`: `Uint8Array`): *`Uint8Array`* |
||||
|
||||
*Defined in [abi/abiCoder.ts:759](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L759)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | `Uint8Array` | |
||||
|
||||
**Returns:** *`Uint8Array`* |
||||
|
||||
___ |
||||
|
||||
### `Const` abiMapper |
||||
|
||||
▸ **abiMapper**(`abi`: any[], `abiCoder`: [AbiCoderClass](classes/abicoderclass.md)): *`AbiModel`* |
||||
|
||||
*Defined in [utils/mapper.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/mapper.ts#L8)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`abi` | any[] | |
||||
`abiCoder` | [AbiCoderClass](classes/abicoderclass.md) | |
||||
|
||||
**Returns:** *`AbiModel`* |
||||
|
||||
___ |
||||
|
||||
### alignSize |
||||
|
||||
▸ **alignSize**(`size`: number): *number* |
||||
|
||||
*Defined in [abi/abiCoder.ts:855](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L855)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`size` | number | |
||||
|
||||
**Returns:** *number* |
||||
|
||||
___ |
||||
|
||||
### bnToString |
||||
|
||||
▸ **bnToString**(`result`: any): *string | any* |
||||
|
||||
*Defined in [abi/utils.ts:49](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/utils.ts#L49)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`result` | any | |
||||
|
||||
**Returns:** *string | any* |
||||
|
||||
___ |
||||
|
||||
### `Const` decode |
||||
|
||||
▸ **decode**(`abiCoder`: [AbiCoderClass](classes/abicoderclass.md), `abiItemModel`: [AbiItemModel](interfaces/abiitemmodel.md), `response`: any): *any* |
||||
|
||||
*Defined in [utils/decoder.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/decoder.ts#L4)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`abiCoder` | [AbiCoderClass](classes/abicoderclass.md) | |
||||
`abiItemModel` | [AbiItemModel](interfaces/abiitemmodel.md) | |
||||
`response` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### deepCopy |
||||
|
||||
▸ **deepCopy**(`object`: any, `frozen?`: undefined | false | true): *any* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1452](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1452)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`object` | any | |
||||
`frozen?` | undefined \| false \| true | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### `Const` defaultCoerceFunc |
||||
|
||||
▸ **defaultCoerceFunc**(`type`: string, `value`: any): *any* |
||||
|
||||
*Defined in [abi/abiCoder.ts:76](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L76)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`value` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### `Const` eventFilterEncoder |
||||
|
||||
▸ **eventFilterEncoder**(`abiCoder`: [AbiCoderClass](classes/abicoderclass.md), `abiItemModel`: [AbiItemModel](interfaces/abiitemmodel.md), `filter`: any): *any[]* |
||||
|
||||
*Defined in [utils/encoder.ts:36](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/encoder.ts#L36)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`abiCoder` | [AbiCoderClass](classes/abicoderclass.md) | |
||||
`abiItemModel` | [AbiItemModel](interfaces/abiitemmodel.md) | |
||||
`filter` | any | |
||||
|
||||
**Returns:** *any[]* |
||||
|
||||
___ |
||||
|
||||
### `Const` flattenTypes |
||||
|
||||
▸ **flattenTypes**(`includeTuple`: any, `puts`: any[]): *any[]* |
||||
|
||||
*Defined in [abi/utils.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/utils.ts#L12)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`includeTuple` | any | |
||||
`puts` | any[] | |
||||
|
||||
**Returns:** *any[]* |
||||
|
||||
___ |
||||
|
||||
### formatBytes32String |
||||
|
||||
▸ **formatBytes32String**(`text`: string): *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1399](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1399)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`text` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### formatParamType |
||||
|
||||
▸ **formatParamType**(`paramType`: [ParamType](interfaces/paramtype.md)): *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:346](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L346)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`paramType` | [ParamType](interfaces/paramtype.md) | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### formatSignature |
||||
|
||||
▸ **formatSignature**(`fragment`: [EventFragment](interfaces/eventfragment.md) | [FunctionFragment](interfaces/functionfragment.md)): *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:442](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L442)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fragment` | [EventFragment](interfaces/eventfragment.md) \| [FunctionFragment](interfaces/functionfragment.md) | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### getParamCoder |
||||
|
||||
▸ **getParamCoder**(`coerceFunc`: [CoerceFunc](README.md#coercefunc), `param`: [ParamType](interfaces/paramtype.md) | any): *any* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1157](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1157)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](README.md#coercefunc) | |
||||
`param` | [ParamType](interfaces/paramtype.md) \| any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### getTupleParamCoder |
||||
|
||||
▸ **getTupleParamCoder**(`coerceFunc`: [CoerceFunc](README.md#coercefunc), `components`: any[], `localName`: string): *[CoderTuple](classes/codertuple.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1141](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1141)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](README.md#coercefunc) | |
||||
`components` | any[] | |
||||
`localName` | string | |
||||
|
||||
**Returns:** *[CoderTuple](classes/codertuple.md)* |
||||
|
||||
___ |
||||
|
||||
### `Const` inputAddressFormatter |
||||
|
||||
▸ **inputAddressFormatter**(`address`: string): *string* |
||||
|
||||
*Defined in [utils/formatter.ts:122](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/formatter.ts#L122)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`address` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Const` inputBlockNumberFormatter |
||||
|
||||
▸ **inputBlockNumberFormatter**(`blockNumber`: any): *any* |
||||
|
||||
*Defined in [utils/formatter.ts:94](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/formatter.ts#L94)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`blockNumber` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### `Const` inputLogFormatter |
||||
|
||||
▸ **inputLogFormatter**(`options`: any): *any* |
||||
|
||||
*Defined in [utils/formatter.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/formatter.ts#L17)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`options` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### `Const` isConstant |
||||
|
||||
▸ **isConstant**(`abiItem`: [AbiItemModel](interfaces/abiitemmodel.md)): *undefined | false | true* |
||||
|
||||
*Defined in [utils/mapper.ts:87](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/mapper.ts#L87)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`abiItem` | [AbiItemModel](interfaces/abiitemmodel.md) | |
||||
|
||||
**Returns:** *undefined | false | true* |
||||
|
||||
___ |
||||
|
||||
### `Const` isPayable |
||||
|
||||
▸ **isPayable**(`abiItem`: [AbiItemModel](interfaces/abiitemmodel.md)): *boolean* |
||||
|
||||
*Defined in [utils/mapper.ts:95](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/mapper.ts#L95)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`abiItem` | [AbiItemModel](interfaces/abiitemmodel.md) | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isPredefinedBlockNumber |
||||
|
||||
▸ **isPredefinedBlockNumber**(`blockNumber`: string): *boolean* |
||||
|
||||
*Defined in [utils/formatter.ts:114](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/formatter.ts#L114)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`blockNumber` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isType |
||||
|
||||
▸ **isType**(`object`: any, `type`: string): *boolean* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1433](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1433)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`object` | any | |
||||
`type` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` jsonInterfaceMethodToString |
||||
|
||||
▸ **jsonInterfaceMethodToString**(`json`: any): *string* |
||||
|
||||
*Defined in [abi/utils.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/utils.ts#L4)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`json` | any | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Const` methodEncoder |
||||
|
||||
▸ **methodEncoder**(`abiCoder`: [AbiCoderClass](classes/abicoderclass.md), `abiItemModel`: [AbiItemModel](interfaces/abiitemmodel.md), `deployData`: string): *string* |
||||
|
||||
*Defined in [utils/encoder.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/encoder.ts#L5)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`abiCoder` | [AbiCoderClass](classes/abicoderclass.md) | |
||||
`abiItemModel` | [AbiItemModel](interfaces/abiitemmodel.md) | |
||||
`deployData` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Const` outputLogFormatter |
||||
|
||||
▸ **outputLogFormatter**(`log`: any): *any* |
||||
|
||||
*Defined in [utils/formatter.ts:54](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/formatter.ts#L54)* |
||||
|
||||
Formats the output of a log |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`log` | any | object | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
log |
||||
|
||||
___ |
||||
|
||||
### pack |
||||
|
||||
▸ **pack**(`coders`: [Coder](classes/coder.md)[], `values`: any[]): *`Uint8Array`* |
||||
|
||||
*Defined in [abi/abiCoder.ts:859](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L859)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coders` | [Coder](classes/coder.md)[] | |
||||
`values` | any[] | |
||||
|
||||
**Returns:** *`Uint8Array`* |
||||
|
||||
___ |
||||
|
||||
### parseBytes32String |
||||
|
||||
▸ **parseBytes32String**(`bytes`: `Arrayish`): *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1412](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1412)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`bytes` | `Arrayish` | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### parseParam |
||||
|
||||
▸ **parseParam**(`param`: string, `allowIndexed?`: undefined | false | true): *[ParamType](interfaces/paramtype.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:125](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L125)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`param` | string | |
||||
`allowIndexed?` | undefined \| false \| true | |
||||
|
||||
**Returns:** *[ParamType](interfaces/paramtype.md)* |
||||
|
||||
___ |
||||
|
||||
### parseParamType |
||||
|
||||
▸ **parseParamType**(`type`: string): *[ParamType](interfaces/paramtype.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:341](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L341)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
|
||||
**Returns:** *[ParamType](interfaces/paramtype.md)* |
||||
|
||||
___ |
||||
|
||||
### parseSignature |
||||
|
||||
▸ **parseSignature**(`fragment`: string): *[EventFragment](interfaces/eventfragment.md) | [FunctionFragment](interfaces/functionfragment.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:453](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L453)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fragment` | string | |
||||
|
||||
**Returns:** *[EventFragment](interfaces/eventfragment.md) | [FunctionFragment](interfaces/functionfragment.md)* |
||||
|
||||
___ |
||||
|
||||
### parseSignatureEvent |
||||
|
||||
▸ **parseSignatureEvent**(`fragment`: string): *[EventFragment](interfaces/eventfragment.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:301](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L301)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fragment` | string | |
||||
|
||||
**Returns:** *[EventFragment](interfaces/eventfragment.md)* |
||||
|
||||
___ |
||||
|
||||
### parseSignatureFunction |
||||
|
||||
▸ **parseSignatureFunction**(`fragment`: string): *[FunctionFragment](interfaces/functionfragment.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:350](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L350)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fragment` | string | |
||||
|
||||
**Returns:** *[FunctionFragment](interfaces/functionfragment.md)* |
||||
|
||||
___ |
||||
|
||||
### shallowCopy |
||||
|
||||
▸ **shallowCopy**(`object`: any): *any* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1437](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1437)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`object` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### splitNesting |
||||
|
||||
▸ **splitNesting**(`value`: string): *any[]* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1101](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1101)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | string | |
||||
|
||||
**Returns:** *any[]* |
||||
|
||||
___ |
||||
|
||||
### `Const` toTopic |
||||
|
||||
▸ **toTopic**(`value`: any): *any* |
||||
|
||||
*Defined in [utils/formatter.ts:132](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/formatter.ts#L132)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### toUtf8Bytes |
||||
|
||||
▸ **toUtf8Bytes**(`str`: string, `form`: [UnicodeNormalizationForm](enums/unicodenormalizationform.md)): *`Uint8Array`* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1231](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1231)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`str` | string | - | |
||||
`form` | [UnicodeNormalizationForm](enums/unicodenormalizationform.md) | UnicodeNormalizationForm.current | |
||||
|
||||
**Returns:** *`Uint8Array`* |
||||
|
||||
___ |
||||
|
||||
### toUtf8String |
||||
|
||||
▸ **toUtf8String**(`bytes`: `Arrayish`, `ignoreErrors?`: undefined | false | true): *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1274](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1274)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`bytes` | `Arrayish` | |
||||
`ignoreErrors?` | undefined \| false \| true | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### unpack |
||||
|
||||
▸ **unpack**(`coders`: [Coder](classes/coder.md)[], `data`: `Uint8Array`, `offset`: number): *[DecodedResult](interfaces/decodedresult.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:923](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L923)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coders` | [Coder](classes/coder.md)[] | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### verifyType |
||||
|
||||
▸ **verifyType**(`type`: string): *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:97](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L97)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
## Object literals |
||||
|
||||
### `Const` opaque |
||||
|
||||
### ▪ **opaque**: *object* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1446](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1446)* |
||||
|
||||
### boolean |
||||
|
||||
• **boolean**: *true* = true |
||||
|
||||
*Defined in [abi/abiCoder.ts:1447](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1447)* |
||||
|
||||
### number |
||||
|
||||
• **number**: *true* = true |
||||
|
||||
*Defined in [abi/abiCoder.ts:1448](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1448)* |
||||
|
||||
### string |
||||
|
||||
• **string**: *true* = true |
||||
|
||||
*Defined in [abi/abiCoder.ts:1449](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1449)* |
||||
|
||||
___ |
||||
|
||||
### `Const` paramTypeSimple |
||||
|
||||
### ▪ **paramTypeSimple**: *object* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1134](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1134)* |
||||
|
||||
### address |
||||
|
||||
• **address**: *[CoderAddress](classes/coderaddress.md)* = CoderAddress |
||||
|
||||
*Defined in [abi/abiCoder.ts:1135](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1135)* |
||||
|
||||
### bool |
||||
|
||||
• **bool**: *[CoderBoolean](classes/coderboolean.md)* = CoderBoolean |
||||
|
||||
*Defined in [abi/abiCoder.ts:1136](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1136)* |
||||
|
||||
### bytes |
||||
|
||||
• **bytes**: *[CoderDynamicBytes](classes/coderdynamicbytes.md)* = CoderDynamicBytes |
||||
|
||||
*Defined in [abi/abiCoder.ts:1138](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1138)* |
||||
|
||||
### string |
||||
|
||||
• **string**: *[CoderString](classes/coderstring.md)* = CoderString |
||||
|
||||
*Defined in [abi/abiCoder.ts:1137](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1137)* |
@ -0,0 +1,90 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[AbiCoder](abicoder.md) / |
||||
|
||||
# Class: AbiCoder |
||||
|
||||
## Hierarchy |
||||
|
||||
* **AbiCoder** |
||||
|
||||
## Callable |
||||
|
||||
▸ **AbiCoder**(): *[AbiCoderClass](abicoderclass.md)* |
||||
|
||||
*Defined in [abi/index.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/index.ts#L4)* |
||||
|
||||
**Returns:** *[AbiCoderClass](abicoderclass.md)* |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](abicoder.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coerceFunc](abicoder.md#coercefunc) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](abicoder.md#decode) |
||||
* [encode](abicoder.md#encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new AbiCoder**(`coerceFunc?`: [CoerceFunc](../README.md#coercefunc)): *[AbiCoder](abicoder.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1506](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1506)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc?` | [CoerceFunc](../README.md#coercefunc) | |
||||
|
||||
**Returns:** *[AbiCoder](abicoder.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1506](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1506)* |
||||
|
||||
## Methods |
||||
|
||||
### decode |
||||
|
||||
▸ **decode**(`types`: `Array<string | ParamType>`, `data`: `Arrayish`): *any* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1546](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1546)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`types` | `Array<string \| ParamType>` | |
||||
`data` | `Arrayish` | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### encode |
||||
|
||||
▸ **encode**(`types`: `Array<string | ParamType>`, `values`: any[]): *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1516](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1516)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`types` | `Array<string \| ParamType>` | |
||||
`values` | any[] | |
||||
|
||||
**Returns:** *string* |
@ -0,0 +1,206 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[AbiCoderClass](abicoderclass.md) / |
||||
|
||||
# Class: AbiCoderClass |
||||
|
||||
## Hierarchy |
||||
|
||||
* **AbiCoderClass** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](abicoderclass.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coder](abicoderclass.md#coder) |
||||
|
||||
### Methods |
||||
|
||||
* [decodeLog](abicoderclass.md#decodelog) |
||||
* [decodeParameter](abicoderclass.md#decodeparameter) |
||||
* [decodeParameters](abicoderclass.md#decodeparameters) |
||||
* [encodeEventSignature](abicoderclass.md#encodeeventsignature) |
||||
* [encodeFunctionCall](abicoderclass.md#encodefunctioncall) |
||||
* [encodeFunctionSignature](abicoderclass.md#encodefunctionsignature) |
||||
* [encodeParameter](abicoderclass.md#encodeparameter) |
||||
* [encodeParameters](abicoderclass.md#encodeparameters) |
||||
* [isStaticType](abicoderclass.md#isstatictype) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new AbiCoderClass**(`coder`: `ABICoder`): *[AbiCoderClass](abicoderclass.md)* |
||||
|
||||
*Defined in [abi/api.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/api.ts#L7)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coder` | `ABICoder` | |
||||
|
||||
**Returns:** *[AbiCoderClass](abicoderclass.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coder |
||||
|
||||
• **coder**: *`ABICoder`* |
||||
|
||||
*Defined in [abi/api.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/api.ts#L7)* |
||||
|
||||
## Methods |
||||
|
||||
### decodeLog |
||||
|
||||
▸ **decodeLog**(`inputs`: any, `data`: string, `topics`: any): *any* |
||||
|
||||
*Defined in [abi/api.ts:85](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/api.ts#L85)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`inputs` | any | - | |
||||
`data` | string | "" | |
||||
`topics` | any | - | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### decodeParameter |
||||
|
||||
▸ **decodeParameter**(`type`: [ParamType](../interfaces/paramtype.md), `bytes`: `Arrayish`): *any* |
||||
|
||||
*Defined in [abi/api.ts:37](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/api.ts#L37)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | [ParamType](../interfaces/paramtype.md) | |
||||
`bytes` | `Arrayish` | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### decodeParameters |
||||
|
||||
▸ **decodeParameters**(`outputs`: [ParamType](../interfaces/paramtype.md)[], `bytes`: `Arrayish`): *any* |
||||
|
||||
*Defined in [abi/api.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/api.ts#L40)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`outputs` | [ParamType](../interfaces/paramtype.md)[] | |
||||
`bytes` | `Arrayish` | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### encodeEventSignature |
||||
|
||||
▸ **encodeEventSignature**(`functionName`: any): *string* |
||||
|
||||
*Defined in [abi/api.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/api.ts#L18)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`functionName` | any | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### encodeFunctionCall |
||||
|
||||
▸ **encodeFunctionCall**(`jsonInterface`: any, `params`: any[]): *string* |
||||
|
||||
*Defined in [abi/api.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/api.ts#L31)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`jsonInterface` | any | |
||||
`params` | any[] | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### encodeFunctionSignature |
||||
|
||||
▸ **encodeFunctionSignature**(`functionName`: any): *string* |
||||
|
||||
*Defined in [abi/api.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/api.ts#L11)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`functionName` | any | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### encodeParameter |
||||
|
||||
▸ **encodeParameter**(`types`: string | [ParamType](../interfaces/paramtype.md), `param`: any): *string* |
||||
|
||||
*Defined in [abi/api.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/api.ts#L25)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`types` | string \| [ParamType](../interfaces/paramtype.md) | |
||||
`param` | any | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### encodeParameters |
||||
|
||||
▸ **encodeParameters**(`types`: `Array<string | ParamType>`, `params`: any[]): *string* |
||||
|
||||
*Defined in [abi/api.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/api.ts#L28)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`types` | `Array<string \| ParamType>` | |
||||
`params` | any[] | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### isStaticType |
||||
|
||||
▸ **isStaticType**(`type`: any): *boolean* |
||||
|
||||
*Defined in [abi/api.ts:135](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/api.ts#L135)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | any | |
||||
|
||||
**Returns:** *boolean* |
@ -0,0 +1,179 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[AbiItem](abiitem.md) / |
||||
|
||||
# Class: AbiItem |
||||
|
||||
## Hierarchy |
||||
|
||||
* **AbiItem** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](abiitem.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [abiItem](abiitem.md#abiitem) |
||||
* [anonymous](abiitem.md#anonymous) |
||||
* [contractMethodParameters](abiitem.md#contractmethodparameters) |
||||
* [inputs](abiitem.md#optional-inputs) |
||||
* [name](abiitem.md#name) |
||||
* [outputs](abiitem.md#optional-outputs) |
||||
* [payable](abiitem.md#payable) |
||||
* [signature](abiitem.md#signature) |
||||
* [type](abiitem.md#optional-type) |
||||
|
||||
### Methods |
||||
|
||||
* [getIndexedInputs](abiitem.md#getindexedinputs) |
||||
* [getInputLength](abiitem.md#getinputlength) |
||||
* [getInputs](abiitem.md#getinputs) |
||||
* [getOutputs](abiitem.md#getoutputs) |
||||
* [isOfType](abiitem.md#isoftype) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new AbiItem**(`abiItem`: [AbiItemModel](../interfaces/abiitemmodel.md) | any): *[AbiItem](abiitem.md)* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L13)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`abiItem` | [AbiItemModel](../interfaces/abiitemmodel.md) \| any | |
||||
|
||||
**Returns:** *[AbiItem](abiitem.md)* |
||||
|
||||
## Properties |
||||
|
||||
### abiItem |
||||
|
||||
• **abiItem**: *[AbiItemModel](../interfaces/abiitemmodel.md)* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### anonymous |
||||
|
||||
• **anonymous**: *boolean* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### contractMethodParameters |
||||
|
||||
• **contractMethodParameters**: *any[]* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L13)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` inputs |
||||
|
||||
• **inputs**? : *[AbiInput](../interfaces/abiinput.md)[]* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` outputs |
||||
|
||||
• **outputs**? : *[AbiOutput](../interfaces/abioutput.md)[]* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L12)* |
||||
|
||||
___ |
||||
|
||||
### payable |
||||
|
||||
• **payable**: *boolean* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### signature |
||||
|
||||
• **signature**: *string* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L6)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` type |
||||
|
||||
• **type**? : *undefined | string* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L10)* |
||||
|
||||
## Methods |
||||
|
||||
### getIndexedInputs |
||||
|
||||
▸ **getIndexedInputs**(): *[AbiInput](../interfaces/abiinput.md)[]* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:52](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L52)* |
||||
|
||||
**Returns:** *[AbiInput](../interfaces/abiinput.md)[]* |
||||
|
||||
___ |
||||
|
||||
### getInputLength |
||||
|
||||
▸ **getInputLength**(): *number* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L28)* |
||||
|
||||
**Returns:** *number* |
||||
|
||||
___ |
||||
|
||||
### getInputs |
||||
|
||||
▸ **getInputs**(): *[AbiInput](../interfaces/abiinput.md)[]* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:36](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L36)* |
||||
|
||||
**Returns:** *[AbiInput](../interfaces/abiinput.md)[]* |
||||
|
||||
___ |
||||
|
||||
### getOutputs |
||||
|
||||
▸ **getOutputs**(): *[AbiOutput](../interfaces/abioutput.md)[]* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L44)* |
||||
|
||||
**Returns:** *[AbiOutput](../interfaces/abioutput.md)[]* |
||||
|
||||
___ |
||||
|
||||
### isOfType |
||||
|
||||
▸ **isOfType**(`type`: string): *boolean* |
||||
|
||||
*Defined in [models/AbiItemModel.ts:58](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiItemModel.ts#L58)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
|
||||
**Returns:** *boolean* |
@ -0,0 +1,153 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[AbiModel](abimodel.md) / |
||||
|
||||
# Class: AbiModel |
||||
|
||||
## Hierarchy |
||||
|
||||
* **AbiModel** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](abimodel.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [abi](abimodel.md#abi) |
||||
|
||||
### Methods |
||||
|
||||
* [getEvent](abimodel.md#getevent) |
||||
* [getEventBySignature](abimodel.md#geteventbysignature) |
||||
* [getEvents](abimodel.md#getevents) |
||||
* [getMethod](abimodel.md#getmethod) |
||||
* [getMethods](abimodel.md#getmethods) |
||||
* [hasEvent](abimodel.md#hasevent) |
||||
* [hasMethod](abimodel.md#hasmethod) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new AbiModel**(`mappedAbi`: any): *[AbiModel](abimodel.md)* |
||||
|
||||
*Defined in [models/AbiModel.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiModel.ts#L4)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`mappedAbi` | any | |
||||
|
||||
**Returns:** *[AbiModel](abimodel.md)* |
||||
|
||||
## Properties |
||||
|
||||
### abi |
||||
|
||||
• **abi**: *any* |
||||
|
||||
*Defined in [models/AbiModel.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/AbiModel.ts#L4)* |
||||
|
||||
## Methods |
||||
|
||||
### getEvent |
||||
|
||||
▸ **getEvent**(`name`: string): *[AbiItemModel](../interfaces/abiitemmodel.md) | false* |
||||
|
||||
*Defined in [models/types.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L7)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`name` | string | |
||||
|
||||
**Returns:** *[AbiItemModel](../interfaces/abiitemmodel.md) | false* |
||||
|
||||
___ |
||||
|
||||
### getEventBySignature |
||||
|
||||
▸ **getEventBySignature**(`signature`: string): *[AbiItemModel](../interfaces/abiitemmodel.md) | undefined* |
||||
|
||||
*Defined in [models/types.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L9)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`signature` | string | |
||||
|
||||
**Returns:** *[AbiItemModel](../interfaces/abiitemmodel.md) | undefined* |
||||
|
||||
___ |
||||
|
||||
### getEvents |
||||
|
||||
▸ **getEvents**(): *[AbiItemModel](../interfaces/abiitemmodel.md)[]* |
||||
|
||||
*Defined in [models/types.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L8)* |
||||
|
||||
**Returns:** *[AbiItemModel](../interfaces/abiitemmodel.md)[]* |
||||
|
||||
___ |
||||
|
||||
### getMethod |
||||
|
||||
▸ **getMethod**(`name`: string): *[AbiItemModel](../interfaces/abiitemmodel.md) | false* |
||||
|
||||
*Defined in [models/types.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L4)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`name` | string | |
||||
|
||||
**Returns:** *[AbiItemModel](../interfaces/abiitemmodel.md) | false* |
||||
|
||||
___ |
||||
|
||||
### getMethods |
||||
|
||||
▸ **getMethods**(): *[AbiItemModel](../interfaces/abiitemmodel.md)[]* |
||||
|
||||
*Defined in [models/types.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L5)* |
||||
|
||||
**Returns:** *[AbiItemModel](../interfaces/abiitemmodel.md)[]* |
||||
|
||||
___ |
||||
|
||||
### hasEvent |
||||
|
||||
▸ **hasEvent**(`name`: string): *boolean* |
||||
|
||||
*Defined in [models/types.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L10)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`name` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### hasMethod |
||||
|
||||
▸ **hasMethod**(`name`: string): *boolean* |
||||
|
||||
*Defined in [models/types.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L6)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`name` | string | |
||||
|
||||
**Returns:** *boolean* |
@ -0,0 +1,141 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[Coder](coder.md) / |
||||
|
||||
# Class: Coder |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Coder** |
||||
|
||||
* [CoderAnonymous](coderanonymous.md) |
||||
|
||||
* [CoderNull](codernull.md) |
||||
|
||||
* [CoderNumber](codernumber.md) |
||||
|
||||
* [CoderBoolean](coderboolean.md) |
||||
|
||||
* [CoderFixedBytes](coderfixedbytes.md) |
||||
|
||||
* [CoderAddress](coderaddress.md) |
||||
|
||||
* [CoderDynamicBytes](coderdynamicbytes.md) |
||||
|
||||
* [CoderString](coderstring.md) |
||||
|
||||
* [CoderArray](coderarray.md) |
||||
|
||||
* [CoderTuple](codertuple.md) |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](coder.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coerceFunc](coder.md#coercefunc) |
||||
* [dynamic](coder.md#dynamic) |
||||
* [localName](coder.md#optional-localname) |
||||
* [name](coder.md#name) |
||||
* [type](coder.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](coder.md#abstract-decode) |
||||
* [encode](coder.md#abstract-encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new Coder**(`coerceFunc`: [CoerceFunc](../README.md#coercefunc), `name`: string, `type`: string, `localName`: string | undefined, `dynamic`: boolean): *[Coder](coder.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](../README.md#coercefunc) | |
||||
`name` | string | |
||||
`type` | string | |
||||
`localName` | string \| undefined | |
||||
`dynamic` | boolean | |
||||
|
||||
**Returns:** *[Coder](coder.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L486)* |
||||
|
||||
___ |
||||
|
||||
### dynamic |
||||
|
||||
• **dynamic**: *boolean* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` localName |
||||
|
||||
• **localName**? : *undefined | string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:489](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L489)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:487](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L487)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:488](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L488)* |
||||
|
||||
## Methods |
||||
|
||||
### `Abstract` decode |
||||
|
||||
▸ **decode**(`data`: `Uint8Array`, `offset`: number): *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:506](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L506)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### `Abstract` encode |
||||
|
||||
▸ **encode**(`value`: any): *`Uint8Array`* |
||||
|
||||
*Defined in [abi/abiCoder.ts:505](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L505)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | any | |
||||
|
||||
**Returns:** *`Uint8Array`* |
@ -0,0 +1,136 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[CoderAddress](coderaddress.md) / |
||||
|
||||
# Class: CoderAddress |
||||
|
||||
## Hierarchy |
||||
|
||||
* [Coder](coder.md) |
||||
|
||||
* **CoderAddress** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](coderaddress.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coerceFunc](coderaddress.md#coercefunc) |
||||
* [dynamic](coderaddress.md#dynamic) |
||||
* [localName](coderaddress.md#optional-localname) |
||||
* [name](coderaddress.md#name) |
||||
* [type](coderaddress.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](coderaddress.md#decode) |
||||
* [encode](coderaddress.md#encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new CoderAddress**(`coerceFunc`: [CoerceFunc](../README.md#coercefunc), `localName`: string): *[CoderAddress](coderaddress.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[constructor](coder.md#constructor)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:723](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L723)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](../README.md#coercefunc) | |
||||
`localName` | string | |
||||
|
||||
**Returns:** *[CoderAddress](coderaddress.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Inherited from [Coder](coder.md).[coerceFunc](coder.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L486)* |
||||
|
||||
___ |
||||
|
||||
### dynamic |
||||
|
||||
• **dynamic**: *boolean* |
||||
|
||||
*Inherited from [Coder](coder.md).[dynamic](coder.md#dynamic)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` localName |
||||
|
||||
• **localName**? : *undefined | string* |
||||
|
||||
*Inherited from [Coder](coder.md).[localName](coder.md#optional-localname)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:489](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L489)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[name](coder.md#name)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:487](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L487)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[type](coder.md#type)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:488](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L488)* |
||||
|
||||
## Methods |
||||
|
||||
### decode |
||||
|
||||
▸ **decode**(`data`: `Uint8Array`, `offset`: number): *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[decode](coder.md#abstract-decode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:741](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L741)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### encode |
||||
|
||||
▸ **encode**(`value`: string): *`Uint8Array`* |
||||
|
||||
*Overrides [Coder](coder.md).[encode](coder.md#abstract-encode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:727](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L727)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | string | |
||||
|
||||
**Returns:** *`Uint8Array`* |
@ -0,0 +1,144 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[CoderAnonymous](coderanonymous.md) / |
||||
|
||||
# Class: CoderAnonymous |
||||
|
||||
## Hierarchy |
||||
|
||||
* [Coder](coder.md) |
||||
|
||||
* **CoderAnonymous** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](coderanonymous.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coder](coderanonymous.md#private-coder) |
||||
* [coerceFunc](coderanonymous.md#coercefunc) |
||||
* [dynamic](coderanonymous.md#dynamic) |
||||
* [localName](coderanonymous.md#optional-localname) |
||||
* [name](coderanonymous.md#name) |
||||
* [type](coderanonymous.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](coderanonymous.md#decode) |
||||
* [encode](coderanonymous.md#encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new CoderAnonymous**(`coder`: [Coder](coder.md)): *[CoderAnonymous](coderanonymous.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[constructor](coder.md#constructor)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:512](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L512)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coder` | [Coder](coder.md) | |
||||
|
||||
**Returns:** *[CoderAnonymous](coderanonymous.md)* |
||||
|
||||
## Properties |
||||
|
||||
### `Private` coder |
||||
|
||||
• **coder**: *[Coder](coder.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:512](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L512)* |
||||
|
||||
___ |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Inherited from [Coder](coder.md).[coerceFunc](coder.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L486)* |
||||
|
||||
___ |
||||
|
||||
### dynamic |
||||
|
||||
• **dynamic**: *boolean* |
||||
|
||||
*Inherited from [Coder](coder.md).[dynamic](coder.md#dynamic)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` localName |
||||
|
||||
• **localName**? : *undefined | string* |
||||
|
||||
*Inherited from [Coder](coder.md).[localName](coder.md#optional-localname)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:489](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L489)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[name](coder.md#name)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:487](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L487)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[type](coder.md#type)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:488](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L488)* |
||||
|
||||
## Methods |
||||
|
||||
### decode |
||||
|
||||
▸ **decode**(`data`: `Uint8Array`, `offset`: number): *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[decode](coder.md#abstract-decode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:520](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L520)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### encode |
||||
|
||||
▸ **encode**(`value`: any): *`Uint8Array`* |
||||
|
||||
*Overrides [Coder](coder.md).[encode](coder.md#abstract-encode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:517](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L517)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | any | |
||||
|
||||
**Returns:** *`Uint8Array`* |
@ -0,0 +1,156 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[CoderArray](coderarray.md) / |
||||
|
||||
# Class: CoderArray |
||||
|
||||
## Hierarchy |
||||
|
||||
* [Coder](coder.md) |
||||
|
||||
* **CoderArray** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](coderarray.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coder](coderarray.md#coder) |
||||
* [coerceFunc](coderarray.md#coercefunc) |
||||
* [dynamic](coderarray.md#dynamic) |
||||
* [length](coderarray.md#length) |
||||
* [localName](coderarray.md#optional-localname) |
||||
* [name](coderarray.md#name) |
||||
* [type](coderarray.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](coderarray.md#decode) |
||||
* [encode](coderarray.md#encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new CoderArray**(`coerceFunc`: [CoerceFunc](../README.md#coercefunc), `coder`: [Coder](coder.md), `length`: number, `localName`: string): *[CoderArray](coderarray.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[constructor](coder.md#constructor)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:976](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L976)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](../README.md#coercefunc) | |
||||
`coder` | [Coder](coder.md) | |
||||
`length` | number | |
||||
`localName` | string | |
||||
|
||||
**Returns:** *[CoderArray](coderarray.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coder |
||||
|
||||
• **coder**: *[Coder](coder.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:975](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L975)* |
||||
|
||||
___ |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Inherited from [Coder](coder.md).[coerceFunc](coder.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L486)* |
||||
|
||||
___ |
||||
|
||||
### dynamic |
||||
|
||||
• **dynamic**: *boolean* |
||||
|
||||
*Inherited from [Coder](coder.md).[dynamic](coder.md#dynamic)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
___ |
||||
|
||||
### length |
||||
|
||||
• **length**: *number* |
||||
|
||||
*Defined in [abi/abiCoder.ts:976](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L976)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` localName |
||||
|
||||
• **localName**? : *undefined | string* |
||||
|
||||
*Inherited from [Coder](coder.md).[localName](coder.md#optional-localname)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:489](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L489)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[name](coder.md#name)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:487](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L487)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[type](coder.md#type)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:488](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L488)* |
||||
|
||||
## Methods |
||||
|
||||
### decode |
||||
|
||||
▸ **decode**(`data`: `Uint8Array`, `offset`: number): *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[decode](coder.md#abstract-decode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1023](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1023)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### encode |
||||
|
||||
▸ **encode**(`value`: any[]): *`Uint8Array`* |
||||
|
||||
*Overrides [Coder](coder.md).[encode](coder.md#abstract-encode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:991](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L991)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | any[] | |
||||
|
||||
**Returns:** *`Uint8Array`* |
@ -0,0 +1,136 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[CoderBoolean](coderboolean.md) / |
||||
|
||||
# Class: CoderBoolean |
||||
|
||||
## Hierarchy |
||||
|
||||
* [Coder](coder.md) |
||||
|
||||
* **CoderBoolean** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](coderboolean.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coerceFunc](coderboolean.md#coercefunc) |
||||
* [dynamic](coderboolean.md#dynamic) |
||||
* [localName](coderboolean.md#optional-localname) |
||||
* [name](coderboolean.md#name) |
||||
* [type](coderboolean.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](coderboolean.md#decode) |
||||
* [encode](coderboolean.md#encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new CoderBoolean**(`coerceFunc`: [CoerceFunc](../README.md#coercefunc), `localName`: string): *[CoderBoolean](coderboolean.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[constructor](coder.md#constructor)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:637](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L637)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](../README.md#coercefunc) | |
||||
`localName` | string | |
||||
|
||||
**Returns:** *[CoderBoolean](coderboolean.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Inherited from [Coder](coder.md).[coerceFunc](coder.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L486)* |
||||
|
||||
___ |
||||
|
||||
### dynamic |
||||
|
||||
• **dynamic**: *boolean* |
||||
|
||||
*Inherited from [Coder](coder.md).[dynamic](coder.md#dynamic)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` localName |
||||
|
||||
• **localName**? : *undefined | string* |
||||
|
||||
*Inherited from [Coder](coder.md).[localName](coder.md#optional-localname)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:489](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L489)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[name](coder.md#name)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:487](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L487)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[type](coder.md#type)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:488](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L488)* |
||||
|
||||
## Methods |
||||
|
||||
### decode |
||||
|
||||
▸ **decode**(`data`: `Uint8Array`, `offset`: number): *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[decode](coder.md#abstract-decode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:646](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L646)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### encode |
||||
|
||||
▸ **encode**(`value`: boolean): *`Uint8Array`* |
||||
|
||||
*Overrides [Coder](coder.md).[encode](coder.md#abstract-encode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:642](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L642)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | boolean | |
||||
|
||||
**Returns:** *`Uint8Array`* |
@ -0,0 +1,136 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[CoderDynamicBytes](coderdynamicbytes.md) / |
||||
|
||||
# Class: CoderDynamicBytes |
||||
|
||||
## Hierarchy |
||||
|
||||
* [Coder](coder.md) |
||||
|
||||
* **CoderDynamicBytes** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](coderdynamicbytes.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coerceFunc](coderdynamicbytes.md#coercefunc) |
||||
* [dynamic](coderdynamicbytes.md#dynamic) |
||||
* [localName](coderdynamicbytes.md#optional-localname) |
||||
* [name](coderdynamicbytes.md#name) |
||||
* [type](coderdynamicbytes.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](coderdynamicbytes.md#decode) |
||||
* [encode](coderdynamicbytes.md#encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new CoderDynamicBytes**(`coerceFunc`: [CoerceFunc](../README.md#coercefunc), `localName`: string): *[CoderDynamicBytes](coderdynamicbytes.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[constructor](coder.md#constructor)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:806](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L806)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](../README.md#coercefunc) | |
||||
`localName` | string | |
||||
|
||||
**Returns:** *[CoderDynamicBytes](coderdynamicbytes.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Inherited from [Coder](coder.md).[coerceFunc](coder.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L486)* |
||||
|
||||
___ |
||||
|
||||
### dynamic |
||||
|
||||
• **dynamic**: *boolean* |
||||
|
||||
*Inherited from [Coder](coder.md).[dynamic](coder.md#dynamic)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` localName |
||||
|
||||
• **localName**? : *undefined | string* |
||||
|
||||
*Inherited from [Coder](coder.md).[localName](coder.md#optional-localname)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:489](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L489)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[name](coder.md#name)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:487](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L487)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[type](coder.md#type)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:488](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L488)* |
||||
|
||||
## Methods |
||||
|
||||
### decode |
||||
|
||||
▸ **decode**(`data`: `Uint8Array`, `offset`: number): *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[decode](coder.md#abstract-decode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:824](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L824)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### encode |
||||
|
||||
▸ **encode**(`value`: `Arrayish`): *`Uint8Array`* |
||||
|
||||
*Overrides [Coder](coder.md).[encode](coder.md#abstract-encode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:810](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L810)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | `Arrayish` | |
||||
|
||||
**Returns:** *`Uint8Array`* |
@ -0,0 +1,146 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[CoderFixedBytes](coderfixedbytes.md) / |
||||
|
||||
# Class: CoderFixedBytes |
||||
|
||||
## Hierarchy |
||||
|
||||
* [Coder](coder.md) |
||||
|
||||
* **CoderFixedBytes** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](coderfixedbytes.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coerceFunc](coderfixedbytes.md#coercefunc) |
||||
* [dynamic](coderfixedbytes.md#dynamic) |
||||
* [length](coderfixedbytes.md#length) |
||||
* [localName](coderfixedbytes.md#optional-localname) |
||||
* [name](coderfixedbytes.md#name) |
||||
* [type](coderfixedbytes.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](coderfixedbytes.md#decode) |
||||
* [encode](coderfixedbytes.md#encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new CoderFixedBytes**(`coerceFunc`: [CoerceFunc](../README.md#coercefunc), `length`: number, `localName`: string): *[CoderFixedBytes](coderfixedbytes.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[constructor](coder.md#constructor)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:669](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L669)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](../README.md#coercefunc) | |
||||
`length` | number | |
||||
`localName` | string | |
||||
|
||||
**Returns:** *[CoderFixedBytes](coderfixedbytes.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Inherited from [Coder](coder.md).[coerceFunc](coder.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L486)* |
||||
|
||||
___ |
||||
|
||||
### dynamic |
||||
|
||||
• **dynamic**: *boolean* |
||||
|
||||
*Inherited from [Coder](coder.md).[dynamic](coder.md#dynamic)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
___ |
||||
|
||||
### length |
||||
|
||||
• **length**: *number* |
||||
|
||||
*Defined in [abi/abiCoder.ts:669](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L669)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` localName |
||||
|
||||
• **localName**? : *undefined | string* |
||||
|
||||
*Inherited from [Coder](coder.md).[localName](coder.md#optional-localname)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:489](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L489)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[name](coder.md#name)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:487](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L487)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[type](coder.md#type)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:488](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L488)* |
||||
|
||||
## Methods |
||||
|
||||
### decode |
||||
|
||||
▸ **decode**(`data`: `Uint8Array`, `offset`: number): *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[decode](coder.md#abstract-decode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:703](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L703)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### encode |
||||
|
||||
▸ **encode**(`value`: `Arrayish`): *`Uint8Array`* |
||||
|
||||
*Overrides [Coder](coder.md).[encode](coder.md#abstract-encode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:676](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L676)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | `Arrayish` | |
||||
|
||||
**Returns:** *`Uint8Array`* |
@ -0,0 +1,136 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[CoderNull](codernull.md) / |
||||
|
||||
# Class: CoderNull |
||||
|
||||
## Hierarchy |
||||
|
||||
* [Coder](coder.md) |
||||
|
||||
* **CoderNull** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](codernull.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coerceFunc](codernull.md#coercefunc) |
||||
* [dynamic](codernull.md#dynamic) |
||||
* [localName](codernull.md#optional-localname) |
||||
* [name](codernull.md#name) |
||||
* [type](codernull.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](codernull.md#decode) |
||||
* [encode](codernull.md#encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new CoderNull**(`coerceFunc`: [CoerceFunc](../README.md#coercefunc), `localName`: string): *[CoderNull](codernull.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[constructor](coder.md#constructor)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:526](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L526)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](../README.md#coercefunc) | |
||||
`localName` | string | |
||||
|
||||
**Returns:** *[CoderNull](codernull.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Inherited from [Coder](coder.md).[coerceFunc](coder.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L486)* |
||||
|
||||
___ |
||||
|
||||
### dynamic |
||||
|
||||
• **dynamic**: *boolean* |
||||
|
||||
*Inherited from [Coder](coder.md).[dynamic](coder.md#dynamic)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` localName |
||||
|
||||
• **localName**? : *undefined | string* |
||||
|
||||
*Inherited from [Coder](coder.md).[localName](coder.md#optional-localname)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:489](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L489)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[name](coder.md#name)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:487](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L487)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[type](coder.md#type)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:488](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L488)* |
||||
|
||||
## Methods |
||||
|
||||
### decode |
||||
|
||||
▸ **decode**(`data`: `Uint8Array`, `offset`: number): *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[decode](coder.md#abstract-decode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:536](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L536)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### encode |
||||
|
||||
▸ **encode**(`value`: any): *`Uint8Array`* |
||||
|
||||
*Overrides [Coder](coder.md).[encode](coder.md#abstract-encode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:531](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L531)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | any | |
||||
|
||||
**Returns:** *`Uint8Array`* |
@ -0,0 +1,156 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[CoderNumber](codernumber.md) / |
||||
|
||||
# Class: CoderNumber |
||||
|
||||
## Hierarchy |
||||
|
||||
* [Coder](coder.md) |
||||
|
||||
* **CoderNumber** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](codernumber.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coerceFunc](codernumber.md#coercefunc) |
||||
* [dynamic](codernumber.md#dynamic) |
||||
* [localName](codernumber.md#optional-localname) |
||||
* [name](codernumber.md#name) |
||||
* [signed](codernumber.md#signed) |
||||
* [size](codernumber.md#size) |
||||
* [type](codernumber.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](codernumber.md#decode) |
||||
* [encode](codernumber.md#encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new CoderNumber**(`coerceFunc`: [CoerceFunc](../README.md#coercefunc), `size`: number, `signed`: boolean, `localName`: string): *[CoderNumber](codernumber.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[constructor](coder.md#constructor)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:550](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L550)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](../README.md#coercefunc) | |
||||
`size` | number | |
||||
`signed` | boolean | |
||||
`localName` | string | |
||||
|
||||
**Returns:** *[CoderNumber](codernumber.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Inherited from [Coder](coder.md).[coerceFunc](coder.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L486)* |
||||
|
||||
___ |
||||
|
||||
### dynamic |
||||
|
||||
• **dynamic**: *boolean* |
||||
|
||||
*Inherited from [Coder](coder.md).[dynamic](coder.md#dynamic)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` localName |
||||
|
||||
• **localName**? : *undefined | string* |
||||
|
||||
*Inherited from [Coder](coder.md).[localName](coder.md#optional-localname)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:489](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L489)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[name](coder.md#name)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:487](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L487)* |
||||
|
||||
___ |
||||
|
||||
### signed |
||||
|
||||
• **signed**: *boolean* |
||||
|
||||
*Defined in [abi/abiCoder.ts:550](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L550)* |
||||
|
||||
___ |
||||
|
||||
### size |
||||
|
||||
• **size**: *number* |
||||
|
||||
*Defined in [abi/abiCoder.ts:549](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L549)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[type](coder.md#type)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:488](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L488)* |
||||
|
||||
## Methods |
||||
|
||||
### decode |
||||
|
||||
▸ **decode**(`data`: `Uint8Array`, `offset`: number): *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[decode](coder.md#abstract-decode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:598](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L598)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### encode |
||||
|
||||
▸ **encode**(`value`: `BN` | number | string): *`Uint8Array`* |
||||
|
||||
*Overrides [Coder](coder.md).[encode](coder.md#abstract-encode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:564](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L564)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | `BN` \| number \| string | |
||||
|
||||
**Returns:** *`Uint8Array`* |
@ -0,0 +1,136 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[CoderString](coderstring.md) / |
||||
|
||||
# Class: CoderString |
||||
|
||||
## Hierarchy |
||||
|
||||
* [Coder](coder.md) |
||||
|
||||
* **CoderString** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](coderstring.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coerceFunc](coderstring.md#coercefunc) |
||||
* [dynamic](coderstring.md#dynamic) |
||||
* [localName](coderstring.md#optional-localname) |
||||
* [name](coderstring.md#name) |
||||
* [type](coderstring.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](coderstring.md#decode) |
||||
* [encode](coderstring.md#encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new CoderString**(`coerceFunc`: [CoerceFunc](../README.md#coercefunc), `localName`: string): *[CoderString](coderstring.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[constructor](coder.md#constructor)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:832](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L832)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](../README.md#coercefunc) | |
||||
`localName` | string | |
||||
|
||||
**Returns:** *[CoderString](coderstring.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Inherited from [Coder](coder.md).[coerceFunc](coder.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L486)* |
||||
|
||||
___ |
||||
|
||||
### dynamic |
||||
|
||||
• **dynamic**: *boolean* |
||||
|
||||
*Inherited from [Coder](coder.md).[dynamic](coder.md#dynamic)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` localName |
||||
|
||||
• **localName**? : *undefined | string* |
||||
|
||||
*Inherited from [Coder](coder.md).[localName](coder.md#optional-localname)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:489](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L489)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[name](coder.md#name)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:487](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L487)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[type](coder.md#type)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:488](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L488)* |
||||
|
||||
## Methods |
||||
|
||||
### decode |
||||
|
||||
▸ **decode**(`data`: `Uint8Array`, `offset`: number): *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[decode](coder.md#abstract-decode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:848](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L848)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### encode |
||||
|
||||
▸ **encode**(`value`: string): *`Uint8Array`* |
||||
|
||||
*Overrides [Coder](coder.md).[encode](coder.md#abstract-encode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:837](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L837)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | string | |
||||
|
||||
**Returns:** *`Uint8Array`* |
@ -0,0 +1,146 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[CoderTuple](codertuple.md) / |
||||
|
||||
# Class: CoderTuple |
||||
|
||||
## Hierarchy |
||||
|
||||
* [Coder](coder.md) |
||||
|
||||
* **CoderTuple** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](codertuple.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [coders](codertuple.md#coders) |
||||
* [coerceFunc](codertuple.md#coercefunc) |
||||
* [dynamic](codertuple.md#dynamic) |
||||
* [localName](codertuple.md#optional-localname) |
||||
* [name](codertuple.md#name) |
||||
* [type](codertuple.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [decode](codertuple.md#decode) |
||||
* [encode](codertuple.md#encode) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new CoderTuple**(`coerceFunc`: [CoerceFunc](../README.md#coercefunc), `coders`: [Coder](coder.md)[], `localName`: string): *[CoderTuple](codertuple.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[constructor](coder.md#constructor)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1073](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1073)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`coerceFunc` | [CoerceFunc](../README.md#coercefunc) | |
||||
`coders` | [Coder](coder.md)[] | |
||||
`localName` | string | |
||||
|
||||
**Returns:** *[CoderTuple](codertuple.md)* |
||||
|
||||
## Properties |
||||
|
||||
### coders |
||||
|
||||
• **coders**: *[Coder](coder.md)[]* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1073](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1073)* |
||||
|
||||
___ |
||||
|
||||
### coerceFunc |
||||
|
||||
• **coerceFunc**: *[CoerceFunc](../README.md#coercefunc)* |
||||
|
||||
*Inherited from [Coder](coder.md).[coerceFunc](coder.md#coercefunc)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L486)* |
||||
|
||||
___ |
||||
|
||||
### dynamic |
||||
|
||||
• **dynamic**: *boolean* |
||||
|
||||
*Inherited from [Coder](coder.md).[dynamic](coder.md#dynamic)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:490](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L490)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` localName |
||||
|
||||
• **localName**? : *undefined | string* |
||||
|
||||
*Inherited from [Coder](coder.md).[localName](coder.md#optional-localname)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:489](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L489)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[name](coder.md#name)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:487](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L487)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Inherited from [Coder](coder.md).[type](coder.md#type)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:488](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L488)* |
||||
|
||||
## Methods |
||||
|
||||
### decode |
||||
|
||||
▸ **decode**(`data`: `Uint8Array`, `offset`: number): *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
*Overrides [Coder](coder.md).[decode](coder.md#abstract-decode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1093](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1093)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | `Uint8Array` | |
||||
`offset` | number | |
||||
|
||||
**Returns:** *[DecodedResult](../interfaces/decodedresult.md)* |
||||
|
||||
___ |
||||
|
||||
### encode |
||||
|
||||
▸ **encode**(`value`: any[]): *`Uint8Array`* |
||||
|
||||
*Overrides [Coder](coder.md).[encode](coder.md#abstract-encode)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:1089](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1089)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | any[] | |
||||
|
||||
**Returns:** *`Uint8Array`* |
@ -0,0 +1,324 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[Contract](contract.md) / |
||||
|
||||
# Class: Contract |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Contract** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](contract.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [abiCoder](contract.md#abicoder) |
||||
* [abiModel](contract.md#abimodel) |
||||
* [events](contract.md#events) |
||||
* [methods](contract.md#methods) |
||||
* [options](contract.md#options) |
||||
* [status](contract.md#status) |
||||
* [transaction](contract.md#optional-transaction) |
||||
* [wallet](contract.md#wallet) |
||||
|
||||
### Accessors |
||||
|
||||
* [address](contract.md#address) |
||||
* [data](contract.md#data) |
||||
* [jsonInterface](contract.md#jsoninterface) |
||||
|
||||
### Methods |
||||
|
||||
* [connect](contract.md#connect) |
||||
* [deploy](contract.md#deploy) |
||||
* [isCalled](contract.md#iscalled) |
||||
* [isDeployed](contract.md#isdeployed) |
||||
* [isInitialised](contract.md#isinitialised) |
||||
* [isRejected](contract.md#isrejected) |
||||
* [isSent](contract.md#issent) |
||||
* [isSigned](contract.md#issigned) |
||||
* [runEventFactory](contract.md#runeventfactory) |
||||
* [runMethodFactory](contract.md#runmethodfactory) |
||||
* [setStatus](contract.md#setstatus) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new Contract**(`abi`: any, `address`: string, `options`: [ContractOptions](../interfaces/contractoptions.md), `wallet`: `Wallet`, `status`: [ContractStatus](../enums/contractstatus.md)): *[Contract](contract.md)* |
||||
|
||||
*Defined in [contract.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L22)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`abi` | any | [] | |
||||
`address` | string | "0x" | |
||||
`options` | [ContractOptions](../interfaces/contractoptions.md) | {} | |
||||
`wallet` | `Wallet` | - | |
||||
`status` | [ContractStatus](../enums/contractstatus.md) | ContractStatus.INITIALISED | |
||||
|
||||
**Returns:** *[Contract](contract.md)* |
||||
|
||||
## Properties |
||||
|
||||
### abiCoder |
||||
|
||||
• **abiCoder**: *[AbiCoderClass](abicoderclass.md)* |
||||
|
||||
*Defined in [contract.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### abiModel |
||||
|
||||
• **abiModel**: *any | [AbiModel](abimodel.md)* |
||||
|
||||
*Defined in [contract.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L17)* |
||||
|
||||
___ |
||||
|
||||
### events |
||||
|
||||
• **events**: *any* |
||||
|
||||
*Defined in [contract.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L16)* |
||||
|
||||
___ |
||||
|
||||
### methods |
||||
|
||||
• **methods**: *any* |
||||
|
||||
*Defined in [contract.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L15)* |
||||
|
||||
___ |
||||
|
||||
### options |
||||
|
||||
• **options**: *[ContractOptions](../interfaces/contractoptions.md) | any* |
||||
|
||||
*Defined in [contract.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### status |
||||
|
||||
• **status**: *[ContractStatus](../enums/contractstatus.md)* |
||||
|
||||
*Defined in [contract.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L22)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` transaction |
||||
|
||||
• **transaction**? : *`Transaction`* |
||||
|
||||
*Defined in [contract.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L21)* |
||||
|
||||
___ |
||||
|
||||
### wallet |
||||
|
||||
• **wallet**: *`Wallet`* |
||||
|
||||
*Defined in [contract.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L20)* |
||||
|
||||
## Accessors |
||||
|
||||
### address |
||||
|
||||
• **get address**(): *string* |
||||
|
||||
*Defined in [contract.ts:76](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L76)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
• **set address**(`value`: string): *void* |
||||
|
||||
*Defined in [contract.ts:80](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L80)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### data |
||||
|
||||
• **get data**(): *any* |
||||
|
||||
*Defined in [contract.ts:84](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L84)* |
||||
|
||||
**Returns:** *any* |
||||
|
||||
• **set data**(`value`: any): *void* |
||||
|
||||
*Defined in [contract.ts:88](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L88)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### jsonInterface |
||||
|
||||
• **get jsonInterface**(): *any[]* |
||||
|
||||
*Defined in [contract.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L66)* |
||||
|
||||
**Returns:** *any[]* |
||||
|
||||
• **set jsonInterface**(`value`: any[]): *void* |
||||
|
||||
*Defined in [contract.ts:70](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L70)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | any[] | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
## Methods |
||||
|
||||
### connect |
||||
|
||||
▸ **connect**(`wallet`: `Wallet`): *void* |
||||
|
||||
*Defined in [contract.ts:103](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L103)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`wallet` | `Wallet` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### deploy |
||||
|
||||
▸ **deploy**(`options`: any): *any* |
||||
|
||||
*Defined in [contract.ts:93](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L93)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`options` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### isCalled |
||||
|
||||
▸ **isCalled**(): *boolean* |
||||
|
||||
*Defined in [contract.ts:59](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L59)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isDeployed |
||||
|
||||
▸ **isDeployed**(): *boolean* |
||||
|
||||
*Defined in [contract.ts:53](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L53)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isInitialised |
||||
|
||||
▸ **isInitialised**(): *boolean* |
||||
|
||||
*Defined in [contract.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L44)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isRejected |
||||
|
||||
▸ **isRejected**(): *boolean* |
||||
|
||||
*Defined in [contract.ts:56](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L56)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isSent |
||||
|
||||
▸ **isSent**(): *boolean* |
||||
|
||||
*Defined in [contract.ts:50](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L50)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isSigned |
||||
|
||||
▸ **isSigned**(): *boolean* |
||||
|
||||
*Defined in [contract.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L47)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### runEventFactory |
||||
|
||||
▸ **runEventFactory**(): *[Contract](contract.md)* |
||||
|
||||
*Defined in [contract.ts:100](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L100)* |
||||
|
||||
**Returns:** *[Contract](contract.md)* |
||||
|
||||
___ |
||||
|
||||
### runMethodFactory |
||||
|
||||
▸ **runMethodFactory**(): *[Contract](contract.md)* |
||||
|
||||
*Defined in [contract.ts:97](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L97)* |
||||
|
||||
**Returns:** *[Contract](contract.md)* |
||||
|
||||
___ |
||||
|
||||
### setStatus |
||||
|
||||
▸ **setStatus**(`status`: [ContractStatus](../enums/contractstatus.md)): *void* |
||||
|
||||
*Defined in [contract.ts:62](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contract.ts#L62)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`status` | [ContractStatus](../enums/contractstatus.md) | |
||||
|
||||
**Returns:** *void* |
@ -0,0 +1,65 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[ContractFactory](contractfactory.md) / |
||||
|
||||
# Class: ContractFactory |
||||
|
||||
## Hierarchy |
||||
|
||||
* **ContractFactory** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](contractfactory.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [wallet](contractfactory.md#wallet) |
||||
|
||||
### Methods |
||||
|
||||
* [createContract](contractfactory.md#createcontract) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new ContractFactory**(`wallet`: `Wallet`): *[ContractFactory](contractfactory.md)* |
||||
|
||||
*Defined in [contractFactory.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contractFactory.ts#L6)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`wallet` | `Wallet` | |
||||
|
||||
**Returns:** *[ContractFactory](contractfactory.md)* |
||||
|
||||
## Properties |
||||
|
||||
### wallet |
||||
|
||||
• **wallet**: *`Wallet`* |
||||
|
||||
*Defined in [contractFactory.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contractFactory.ts#L6)* |
||||
|
||||
## Methods |
||||
|
||||
### createContract |
||||
|
||||
▸ **createContract**(`abi`: any[], `address?`: undefined | string, `options?`: [ContractOptions](../interfaces/contractoptions.md)): *[Contract](contract.md)* |
||||
|
||||
*Defined in [contractFactory.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/contractFactory.ts#L11)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`abi` | any[] | |
||||
`address?` | undefined \| string | |
||||
`options?` | [ContractOptions](../interfaces/contractoptions.md) | |
||||
|
||||
**Returns:** *[Contract](contract.md)* |
@ -0,0 +1,263 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[ContractMethod](contractmethod.md) / |
||||
|
||||
# Class: ContractMethod |
||||
|
||||
## Hierarchy |
||||
|
||||
* **ContractMethod** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](contractmethod.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [abiItem](contractmethod.md#abiitem) |
||||
* [callPayload](contractmethod.md#optional-callpayload) |
||||
* [callResponse](contractmethod.md#optional-callresponse) |
||||
* [contract](contractmethod.md#contract) |
||||
* [methodKey](contractmethod.md#methodkey) |
||||
* [params](contractmethod.md#params) |
||||
* [transaction](contractmethod.md#protected-transaction) |
||||
* [wallet](contractmethod.md#wallet) |
||||
|
||||
### Methods |
||||
|
||||
* [afterCall](contractmethod.md#protected-aftercall) |
||||
* [call](contractmethod.md#call) |
||||
* [confirm](contractmethod.md#protected-confirm) |
||||
* [createTransaction](contractmethod.md#protected-createtransaction) |
||||
* [debug](contractmethod.md#debug) |
||||
* [encodeABI](contractmethod.md#encodeabi) |
||||
* [estimateGas](contractmethod.md#estimategas) |
||||
* [send](contractmethod.md#send) |
||||
* [sendTransaction](contractmethod.md#protected-sendtransaction) |
||||
* [signTransaction](contractmethod.md#protected-signtransaction) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new ContractMethod**(`methodKey`: string, `params`: any, `abiItem`: [AbiItemModel](../interfaces/abiitemmodel.md), `contract`: [Contract](contract.md)): *[ContractMethod](contractmethod.md)* |
||||
|
||||
*Defined in [methods/method.ts:26](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L26)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`methodKey` | string | |
||||
`params` | any | |
||||
`abiItem` | [AbiItemModel](../interfaces/abiitemmodel.md) | |
||||
`contract` | [Contract](contract.md) | |
||||
|
||||
**Returns:** *[ContractMethod](contractmethod.md)* |
||||
|
||||
## Properties |
||||
|
||||
### abiItem |
||||
|
||||
• **abiItem**: *[AbiItemModel](../interfaces/abiitemmodel.md)* |
||||
|
||||
*Defined in [methods/method.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L22)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` callPayload |
||||
|
||||
• **callPayload**? : *any* |
||||
|
||||
*Defined in [methods/method.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L24)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` callResponse |
||||
|
||||
• **callResponse**? : *any* |
||||
|
||||
*Defined in [methods/method.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### contract |
||||
|
||||
• **contract**: *[Contract](contract.md)* |
||||
|
||||
*Defined in [methods/method.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### methodKey |
||||
|
||||
• **methodKey**: *string* |
||||
|
||||
*Defined in [methods/method.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L20)* |
||||
|
||||
___ |
||||
|
||||
### params |
||||
|
||||
• **params**: *any* |
||||
|
||||
*Defined in [methods/method.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` transaction |
||||
|
||||
• **transaction**: *`Transaction`* |
||||
|
||||
*Defined in [methods/method.ts:26](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L26)* |
||||
|
||||
___ |
||||
|
||||
### wallet |
||||
|
||||
• **wallet**: *`Wallet`* |
||||
|
||||
*Defined in [methods/method.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L21)* |
||||
|
||||
## Methods |
||||
|
||||
### `Protected` afterCall |
||||
|
||||
▸ **afterCall**(`response`: any): *any* |
||||
|
||||
*Defined in [methods/method.ts:272](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L272)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`response` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### call |
||||
|
||||
▸ **call**(`options`: any, `blockNumber`: any): *`Promise<any>`* |
||||
|
||||
*Defined in [methods/method.ts:65](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L65)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`options` | any | - | |
||||
`blockNumber` | any | "latest" | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### `Protected` confirm |
||||
|
||||
▸ **confirm**(`id`: string): *`Promise<void>`* |
||||
|
||||
*Defined in [methods/method.ts:223](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L223)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`id` | string | |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### `Protected` createTransaction |
||||
|
||||
▸ **createTransaction**(): *`Transaction`* |
||||
|
||||
*Defined in [methods/method.ts:241](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L241)* |
||||
|
||||
**Returns:** *`Transaction`* |
||||
|
||||
___ |
||||
|
||||
### debug |
||||
|
||||
▸ **debug**(): *object* |
||||
|
||||
*Defined in [methods/method.ts:190](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L190)* |
||||
|
||||
**Returns:** *object* |
||||
|
||||
* **callPayload**: *any* = this.callPayload |
||||
|
||||
* **callResponse**: *any* = this.callResponse |
||||
|
||||
___ |
||||
|
||||
### encodeABI |
||||
|
||||
▸ **encodeABI**(): *string* |
||||
|
||||
*Defined in [methods/method.ts:182](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L182)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### estimateGas |
||||
|
||||
▸ **estimateGas**(): *`Promise<any>`* |
||||
|
||||
*Defined in [methods/method.ts:159](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L159)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### send |
||||
|
||||
▸ **send**(`params`: any): *`Emitter`* |
||||
|
||||
*Defined in [methods/method.ts:42](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L42)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`params` | any | |
||||
|
||||
**Returns:** *`Emitter`* |
||||
|
||||
___ |
||||
|
||||
### `Protected` sendTransaction |
||||
|
||||
▸ **sendTransaction**(`signed`: `Transaction`): *`Promise<[Transaction, string]>`* |
||||
|
||||
*Defined in [methods/method.ts:214](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L214)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`signed` | `Transaction` | |
||||
|
||||
**Returns:** *`Promise<[Transaction, string]>`* |
||||
|
||||
___ |
||||
|
||||
### `Protected` signTransaction |
||||
|
||||
▸ **signTransaction**(`updateNonce`: boolean): *`Promise<Transaction>`* |
||||
|
||||
*Defined in [methods/method.ts:197](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/method.ts#L197)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`updateNonce` | boolean | |
||||
|
||||
**Returns:** *`Promise<Transaction>`* |
@ -0,0 +1,118 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[EventFactory](eventfactory.md) / |
||||
|
||||
# Class: EventFactory |
||||
|
||||
## Hierarchy |
||||
|
||||
* **EventFactory** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](eventfactory.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [abiCoder](eventfactory.md#abicoder) |
||||
* [abiModel](eventfactory.md#abimodel) |
||||
* [contract](eventfactory.md#contract) |
||||
* [eventKeys](eventfactory.md#private-eventkeys) |
||||
|
||||
### Methods |
||||
|
||||
* [addEventsToContract](eventfactory.md#addeventstocontract) |
||||
* [map](eventfactory.md#private-map) |
||||
* [mapEventKeys](eventfactory.md#private-mapeventkeys) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new EventFactory**(`contract`: [Contract](contract.md)): *[EventFactory](eventfactory.md)* |
||||
|
||||
*Defined in [events/eventFactory.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/eventFactory.ts#L13)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`contract` | [Contract](contract.md) | |
||||
|
||||
**Returns:** *[EventFactory](eventfactory.md)* |
||||
|
||||
## Properties |
||||
|
||||
### abiCoder |
||||
|
||||
• **abiCoder**: *[AbiCoderClass](abicoderclass.md)* |
||||
|
||||
*Defined in [events/eventFactory.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/eventFactory.ts#L12)* |
||||
|
||||
___ |
||||
|
||||
### abiModel |
||||
|
||||
• **abiModel**: *any | [AbiModel](abimodel.md)* |
||||
|
||||
*Defined in [events/eventFactory.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/eventFactory.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### contract |
||||
|
||||
• **contract**: *[Contract](contract.md)* |
||||
|
||||
*Defined in [events/eventFactory.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/eventFactory.ts#L10)* |
||||
|
||||
___ |
||||
|
||||
### `Private` eventKeys |
||||
|
||||
• **eventKeys**: *string[]* |
||||
|
||||
*Defined in [events/eventFactory.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/eventFactory.ts#L13)* |
||||
|
||||
## Methods |
||||
|
||||
### addEventsToContract |
||||
|
||||
▸ **addEventsToContract**(): *[Contract](contract.md)* |
||||
|
||||
*Defined in [events/eventFactory.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/eventFactory.ts#L23)* |
||||
|
||||
**Returns:** *[Contract](contract.md)* |
||||
|
||||
___ |
||||
|
||||
### `Private` map |
||||
|
||||
▸ **map**(`abiItemModel`: [AbiItemModel](../interfaces/abiitemmodel.md), `contract`: [Contract](contract.md), `options`: any): *any* |
||||
|
||||
*Defined in [events/eventFactory.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/eventFactory.ts#L46)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`abiItemModel` | [AbiItemModel](../interfaces/abiitemmodel.md) | |
||||
`contract` | [Contract](contract.md) | |
||||
`options` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### `Private` mapEventKeys |
||||
|
||||
▸ **mapEventKeys**(): *string[]* |
||||
|
||||
*Defined in [events/eventFactory.ts:42](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/eventFactory.ts#L42)* |
||||
|
||||
**`function`** mapMethodKeys |
||||
|
||||
**Returns:** *string[]* |
||||
|
||||
{description} |
@ -0,0 +1,761 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[EventMethod](eventmethod.md) / |
||||
|
||||
# Class: EventMethod |
||||
|
||||
## Hierarchy |
||||
|
||||
* `LogSub` |
||||
|
||||
* **EventMethod** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](eventmethod.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [abiItem](eventmethod.md#abiitem) |
||||
* [connected](eventmethod.md#connected) |
||||
* [connection](eventmethod.md#connection) |
||||
* [contract](eventmethod.md#contract) |
||||
* [emitter](eventmethod.md#emitter) |
||||
* [handlers](eventmethod.md#handlers) |
||||
* [jsonRpc](eventmethod.md#jsonrpc) |
||||
* [messenger](eventmethod.md#messenger) |
||||
* [methodKey](eventmethod.md#methodkey) |
||||
* [middlewares](eventmethod.md#middlewares) |
||||
* [options](eventmethod.md#options) |
||||
* [param](eventmethod.md#param) |
||||
* [params](eventmethod.md#params) |
||||
* [reqMiddleware](eventmethod.md#protected-reqmiddleware) |
||||
* [resMiddleware](eventmethod.md#protected-resmiddleware) |
||||
* [subscriptionId](eventmethod.md#subscriptionid) |
||||
* [subscriptions](eventmethod.md#subscriptions) |
||||
* [url](eventmethod.md#url) |
||||
|
||||
### Methods |
||||
|
||||
* [addEventListener](eventmethod.md#addeventlistener) |
||||
* [clearSubscriptions](eventmethod.md#clearsubscriptions) |
||||
* [constructPayload](eventmethod.md#constructpayload) |
||||
* [createWebsocketProvider](eventmethod.md#createwebsocketprovider) |
||||
* [getMiddleware](eventmethod.md#protected-getmiddleware) |
||||
* [getSubscriptionEvent](eventmethod.md#getsubscriptionevent) |
||||
* [hasSubscription](eventmethod.md#hassubscription) |
||||
* [isConnecting](eventmethod.md#isconnecting) |
||||
* [on](eventmethod.md#on) |
||||
* [onClose](eventmethod.md#onclose) |
||||
* [onConnect](eventmethod.md#onconnect) |
||||
* [onData](eventmethod.md#ondata) |
||||
* [onError](eventmethod.md#onerror) |
||||
* [onMessage](eventmethod.md#onmessage) |
||||
* [onNewSubscriptionItem](eventmethod.md#onnewsubscriptionitem) |
||||
* [onReady](eventmethod.md#onready) |
||||
* [once](eventmethod.md#once) |
||||
* [pushMiddleware](eventmethod.md#protected-pushmiddleware) |
||||
* [reconnect](eventmethod.md#reconnect) |
||||
* [registerEventListeners](eventmethod.md#registereventlisteners) |
||||
* [removeAllSocketListeners](eventmethod.md#removeallsocketlisteners) |
||||
* [removeEventListener](eventmethod.md#removeeventlistener) |
||||
* [reset](eventmethod.md#reset) |
||||
* [resetHandlers](eventmethod.md#resethandlers) |
||||
* [send](eventmethod.md#send) |
||||
* [start](eventmethod.md#start) |
||||
* [subscribe](eventmethod.md#subscribe) |
||||
* [unsubscribe](eventmethod.md#unsubscribe) |
||||
* [validate](eventmethod.md#validate) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new EventMethod**(`methodKey`: string, `params`: any, `abiItem`: [AbiItemModel](../interfaces/abiitemmodel.md), `contract`: [Contract](contract.md)): *[EventMethod](eventmethod.md)* |
||||
|
||||
*Overrides void* |
||||
|
||||
*Defined in [events/event.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/event.ts#L10)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`methodKey` | string | |
||||
`params` | any | |
||||
`abiItem` | [AbiItemModel](../interfaces/abiitemmodel.md) | |
||||
`contract` | [Contract](contract.md) | |
||||
|
||||
**Returns:** *[EventMethod](eventmethod.md)* |
||||
|
||||
## Properties |
||||
|
||||
### abiItem |
||||
|
||||
• **abiItem**: *[AbiItemModel](../interfaces/abiitemmodel.md)* |
||||
|
||||
*Defined in [events/event.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/event.ts#L10)* |
||||
|
||||
___ |
||||
|
||||
### connected |
||||
|
||||
• **connected**: *boolean* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:6 |
||||
|
||||
___ |
||||
|
||||
### connection |
||||
|
||||
• **connection**: *`W3CWebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:10 |
||||
|
||||
___ |
||||
|
||||
### contract |
||||
|
||||
• **contract**: *[Contract](contract.md)* |
||||
|
||||
*Defined in [events/event.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/event.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseSocket.d.ts:24 |
||||
|
||||
___ |
||||
|
||||
### handlers |
||||
|
||||
• **handlers**: *any* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseSocket.d.ts:25 |
||||
|
||||
___ |
||||
|
||||
### jsonRpc |
||||
|
||||
• **jsonRpc**: *`JsonRpc`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:11 |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *`Messenger`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/subscriptions/Subscription.d.ts:7 |
||||
|
||||
___ |
||||
|
||||
### methodKey |
||||
|
||||
• **methodKey**: *string* |
||||
|
||||
*Defined in [events/event.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/event.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### middlewares |
||||
|
||||
• **middlewares**: *object* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseProvider.d.ts:4 |
||||
|
||||
#### Type declaration: |
||||
|
||||
* **request**(): *object* |
||||
|
||||
* **use**(): *function* |
||||
|
||||
* (`fn`: `Map<string | RegExp, any[]>`, `match?`: string | `RegExp`): *void* |
||||
|
||||
* **response**(): *object* |
||||
|
||||
* **use**(): *function* |
||||
|
||||
* (`fn`: `Map<string | RegExp, any[]>`, `match?`: string | `RegExp`): *void* |
||||
|
||||
___ |
||||
|
||||
### options |
||||
|
||||
• **options**: *any* |
||||
|
||||
*Inherited from void* |
||||
|
||||
*Overrides void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/subscriptions/Subscription.d.ts:6 |
||||
|
||||
___ |
||||
|
||||
### param |
||||
|
||||
• **param**: *any* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/subscriptions/Subscription.d.ts:5 |
||||
|
||||
___ |
||||
|
||||
### params |
||||
|
||||
• **params**: *any* |
||||
|
||||
*Defined in [events/event.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/event.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` reqMiddleware |
||||
|
||||
• **reqMiddleware**: *`ReqMiddleware`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseProvider.d.ts:13 |
||||
|
||||
___ |
||||
|
||||
### `Protected` resMiddleware |
||||
|
||||
• **resMiddleware**: *`ResMiddleware`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseProvider.d.ts:14 |
||||
|
||||
___ |
||||
|
||||
### subscriptionId |
||||
|
||||
• **subscriptionId**: *any* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/subscriptions/Subscription.d.ts:8 |
||||
|
||||
___ |
||||
|
||||
### subscriptions |
||||
|
||||
• **subscriptions**: *any* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:8 |
||||
|
||||
___ |
||||
|
||||
### url |
||||
|
||||
• **url**: *string* |
||||
|
||||
*Inherited from void* |
||||
|
||||
*Overrides void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:7 |
||||
|
||||
## Methods |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseSocket.d.ts:29 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### clearSubscriptions |
||||
|
||||
▸ **clearSubscriptions**(`unsubscribeMethod`: string): *`Promise<boolean>`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:23 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`unsubscribeMethod` | string | |
||||
|
||||
**Returns:** *`Promise<boolean>`* |
||||
|
||||
___ |
||||
|
||||
### constructPayload |
||||
|
||||
▸ **constructPayload**(`method`: string, `param`: any, `options?`: any): *`RPCRequestPayload<any>`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/subscriptions/Subscription.d.ts:10 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | string | |
||||
`param` | any | |
||||
`options?` | any | |
||||
|
||||
**Returns:** *`RPCRequestPayload<any>`* |
||||
|
||||
___ |
||||
|
||||
### createWebsocketProvider |
||||
|
||||
▸ **createWebsocketProvider**(`url`: string, `options?`: any): *`W3CWebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:17 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`url` | string | |
||||
`options?` | any | |
||||
|
||||
**Returns:** *`W3CWebsocket` | `WebSocket`* |
||||
|
||||
___ |
||||
|
||||
### `Protected` getMiddleware |
||||
|
||||
▸ **getMiddleware**(`method`: `RPCMethod` | string): *[`ReqMiddleware`[], `ResMiddleware`[]]* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseProvider.d.ts:17 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | `RPCMethod` \| string | |
||||
|
||||
**Returns:** *[`ReqMiddleware`[], `ResMiddleware`[]]* |
||||
|
||||
___ |
||||
|
||||
### getSubscriptionEvent |
||||
|
||||
▸ **getSubscriptionEvent**(`subscriptionId`: any): *any* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:27 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### hasSubscription |
||||
|
||||
▸ **hasSubscription**(`subscriptionId`: string): *boolean* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:28 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isConnecting |
||||
|
||||
▸ **isConnecting**(): *boolean* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:19 |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### on |
||||
|
||||
▸ **on**(`type`: string, `handler`: `mitt.Handler`): *this* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:13 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *this* |
||||
|
||||
___ |
||||
|
||||
### onClose |
||||
|
||||
▸ **onClose**(`closeEvent`: any): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
*Overrides void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:16 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`closeEvent` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onConnect |
||||
|
||||
▸ **onConnect**(): *`Promise<void>`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:26 |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### onData |
||||
|
||||
▸ **onData**(`handler`: any): *this* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:14 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`handler` | any | |
||||
|
||||
**Returns:** *this* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`event`: any): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
*Overrides void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:15 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onMessage |
||||
|
||||
▸ **onMessage**(`msg`: `MessageEvent`): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:25 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`msg` | `MessageEvent` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onNewSubscriptionItem |
||||
|
||||
▸ **onNewSubscriptionItem**(`subscriptionItem`: any): *any* |
||||
|
||||
*Overrides void* |
||||
|
||||
*Defined in [events/event.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/events/event.ts#L29)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionItem` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### onReady |
||||
|
||||
▸ **onReady**(`event`: any): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseSocket.d.ts:33 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseSocket.d.ts:28 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### `Protected` pushMiddleware |
||||
|
||||
▸ **pushMiddleware**(`fn`: any, `type`: `MiddlewareType`, `match`: string | `RPCMethod` | `RegExp`): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseProvider.d.ts:16 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fn` | any | |
||||
`type` | `MiddlewareType` | |
||||
`match` | string \| `RPCMethod` \| `RegExp` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reconnect |
||||
|
||||
▸ **reconnect**(): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:18 |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### registerEventListeners |
||||
|
||||
▸ **registerEventListeners**(): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:24 |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeAllSocketListeners |
||||
|
||||
▸ **removeAllSocketListeners**(): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseSocket.d.ts:32 |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseSocket.d.ts:30 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reset |
||||
|
||||
▸ **reset**(): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseSocket.d.ts:31 |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/baseSocket.d.ts:27 |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### send |
||||
|
||||
▸ **send**(`payload`: `RPCRequestPayload<object>`): *`Promise<any>`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:20 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | `RPCRequestPayload<object>` | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### start |
||||
|
||||
▸ **start**(): *`Promise<this>`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/subscriptions/Subscription.d.ts:11 |
||||
|
||||
**Returns:** *`Promise<this>`* |
||||
|
||||
___ |
||||
|
||||
### subscribe |
||||
|
||||
▸ **subscribe**(): *`Promise<this>`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
*Overrides void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/subscriptions/LogSub.d.ts:5 |
||||
|
||||
**Returns:** *`Promise<this>`* |
||||
|
||||
___ |
||||
|
||||
### unsubscribe |
||||
|
||||
▸ **unsubscribe**(): *`Promise<any>`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
*Overrides void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/subscriptions/Subscription.d.ts:12 |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### validate |
||||
|
||||
▸ **validate**(`response`: any, `payload?`: any): *true | `Error`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-network/dist/providers/ws.d.ts:29 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`response` | any | |
||||
`payload?` | any | |
||||
|
||||
**Returns:** *true | `Error`* |
@ -0,0 +1,99 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[MethodFactory](methodfactory.md) / |
||||
|
||||
# Class: MethodFactory |
||||
|
||||
## Hierarchy |
||||
|
||||
* **MethodFactory** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](methodfactory.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [abiCoder](methodfactory.md#abicoder) |
||||
* [abiModel](methodfactory.md#abimodel) |
||||
* [contract](methodfactory.md#contract) |
||||
* [methodKeys](methodfactory.md#private-methodkeys) |
||||
|
||||
### Methods |
||||
|
||||
* [addMethodsToContract](methodfactory.md#addmethodstocontract) |
||||
* [mapMethodKeys](methodfactory.md#private-mapmethodkeys) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new MethodFactory**(`contract`: [Contract](contract.md)): *[MethodFactory](methodfactory.md)* |
||||
|
||||
*Defined in [methods/methodFactory.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/methodFactory.ts#L10)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`contract` | [Contract](contract.md) | |
||||
|
||||
**Returns:** *[MethodFactory](methodfactory.md)* |
||||
|
||||
## Properties |
||||
|
||||
### abiCoder |
||||
|
||||
• **abiCoder**: *[AbiCoderClass](abicoderclass.md)* |
||||
|
||||
*Defined in [methods/methodFactory.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/methodFactory.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### abiModel |
||||
|
||||
• **abiModel**: *any | [AbiModel](abimodel.md)* |
||||
|
||||
*Defined in [methods/methodFactory.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/methodFactory.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### contract |
||||
|
||||
• **contract**: *[Contract](contract.md)* |
||||
|
||||
*Defined in [methods/methodFactory.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/methodFactory.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### `Private` methodKeys |
||||
|
||||
• **methodKeys**: *string[]* |
||||
|
||||
*Defined in [methods/methodFactory.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/methodFactory.ts#L10)* |
||||
|
||||
## Methods |
||||
|
||||
### addMethodsToContract |
||||
|
||||
▸ **addMethodsToContract**(): *[Contract](contract.md)* |
||||
|
||||
*Defined in [methods/methodFactory.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/methodFactory.ts#L20)* |
||||
|
||||
**Returns:** *[Contract](contract.md)* |
||||
|
||||
___ |
||||
|
||||
### `Private` mapMethodKeys |
||||
|
||||
▸ **mapMethodKeys**(): *string[]* |
||||
|
||||
*Defined in [methods/methodFactory.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/methods/methodFactory.ts#L39)* |
||||
|
||||
**`function`** mapMethodKeys |
||||
|
||||
**Returns:** *string[]* |
||||
|
||||
{description} |
@ -0,0 +1,82 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[ContractStatus](contractstatus.md) / |
||||
|
||||
# Enumeration: ContractStatus |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [CALLED](contractstatus.md#called) |
||||
* [DEPLOYED](contractstatus.md#deployed) |
||||
* [ERROR](contractstatus.md#error) |
||||
* [INITIALISED](contractstatus.md#initialised) |
||||
* [REJECTED](contractstatus.md#rejected) |
||||
* [SENT](contractstatus.md#sent) |
||||
* [SIGNED](contractstatus.md#signed) |
||||
* [TESTED](contractstatus.md#tested) |
||||
|
||||
## Enumeration members |
||||
|
||||
### CALLED |
||||
|
||||
• **CALLED**: = "called" |
||||
|
||||
*Defined in [utils/status.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/status.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### DEPLOYED |
||||
|
||||
• **DEPLOYED**: = "deployed" |
||||
|
||||
*Defined in [utils/status.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/status.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### ERROR |
||||
|
||||
• **ERROR**: = "error" |
||||
|
||||
*Defined in [utils/status.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/status.ts#L4)* |
||||
|
||||
___ |
||||
|
||||
### INITIALISED |
||||
|
||||
• **INITIALISED**: = "initialised" |
||||
|
||||
*Defined in [utils/status.ts:2](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/status.ts#L2)* |
||||
|
||||
___ |
||||
|
||||
### REJECTED |
||||
|
||||
• **REJECTED**: = "rejected" |
||||
|
||||
*Defined in [utils/status.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/status.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### SENT |
||||
|
||||
• **SENT**: = "sent" |
||||
|
||||
*Defined in [utils/status.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/status.ts#L6)* |
||||
|
||||
___ |
||||
|
||||
### SIGNED |
||||
|
||||
• **SIGNED**: = "signed" |
||||
|
||||
*Defined in [utils/status.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/status.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### TESTED |
||||
|
||||
• **TESTED**: = "tested" |
||||
|
||||
*Defined in [utils/status.ts:3](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/status.ts#L3)* |
@ -0,0 +1,55 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[UnicodeNormalizationForm](unicodenormalizationform.md) / |
||||
|
||||
# Enumeration: UnicodeNormalizationForm |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [NFC](unicodenormalizationform.md#nfc) |
||||
* [NFD](unicodenormalizationform.md#nfd) |
||||
* [NFKC](unicodenormalizationform.md#nfkc) |
||||
* [NFKD](unicodenormalizationform.md#nfkd) |
||||
* [current](unicodenormalizationform.md#current) |
||||
|
||||
## Enumeration members |
||||
|
||||
### NFC |
||||
|
||||
• **NFC**: = "NFC" |
||||
|
||||
*Defined in [abi/abiCoder.ts:1225](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1225)* |
||||
|
||||
___ |
||||
|
||||
### NFD |
||||
|
||||
• **NFD**: = "NFD" |
||||
|
||||
*Defined in [abi/abiCoder.ts:1226](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1226)* |
||||
|
||||
___ |
||||
|
||||
### NFKC |
||||
|
||||
• **NFKC**: = "NFKC" |
||||
|
||||
*Defined in [abi/abiCoder.ts:1227](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1227)* |
||||
|
||||
___ |
||||
|
||||
### NFKD |
||||
|
||||
• **NFKD**: = "NFKD" |
||||
|
||||
*Defined in [abi/abiCoder.ts:1228](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1228)* |
||||
|
||||
___ |
||||
|
||||
### current |
||||
|
||||
• **current**: = "" |
||||
|
||||
*Defined in [abi/abiCoder.ts:1224](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L1224)* |
@ -0,0 +1,50 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[AbiInput](abiinput.md) / |
||||
|
||||
# Interface: AbiInput |
||||
|
||||
## Hierarchy |
||||
|
||||
* **AbiInput** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [components](abiinput.md#optional-components) |
||||
* [indexed](abiinput.md#optional-indexed) |
||||
* [name](abiinput.md#name) |
||||
* [type](abiinput.md#type) |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` components |
||||
|
||||
• **components**? : *[AbiInput](abiinput.md)[]* |
||||
|
||||
*Defined in [models/types.ts:36](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L36)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` indexed |
||||
|
||||
• **indexed**? : *undefined | false | true* |
||||
|
||||
*Defined in [models/types.ts:35](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L35)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Defined in [models/types.ts:33](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L33)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Defined in [models/types.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L34)* |
@ -0,0 +1,177 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[AbiItemModel](abiitemmodel.md) / |
||||
|
||||
# Interface: AbiItemModel |
||||
|
||||
## Hierarchy |
||||
|
||||
* **AbiItemModel** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [anonymous](abiitemmodel.md#anonymous) |
||||
* [constant](abiitemmodel.md#optional-constant) |
||||
* [contractMethodParameters](abiitemmodel.md#contractmethodparameters) |
||||
* [funcName](abiitemmodel.md#funcname) |
||||
* [inputs](abiitemmodel.md#inputs) |
||||
* [name](abiitemmodel.md#name) |
||||
* [outputs](abiitemmodel.md#outputs) |
||||
* [payable](abiitemmodel.md#payable) |
||||
* [signature](abiitemmodel.md#signature) |
||||
* [stateMutability](abiitemmodel.md#optional-statemutability) |
||||
* [type](abiitemmodel.md#type) |
||||
|
||||
### Methods |
||||
|
||||
* [getIndexedInputs](abiitemmodel.md#getindexedinputs) |
||||
* [getInputLength](abiitemmodel.md#getinputlength) |
||||
* [getInputs](abiitemmodel.md#getinputs) |
||||
* [getOutputs](abiitemmodel.md#getoutputs) |
||||
* [isOfType](abiitemmodel.md#isoftype) |
||||
|
||||
## Properties |
||||
|
||||
### anonymous |
||||
|
||||
• **anonymous**: *boolean* |
||||
|
||||
*Defined in [models/types.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L17)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` constant |
||||
|
||||
• **constant**? : *undefined | false | true* |
||||
|
||||
*Defined in [models/types.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L22)* |
||||
|
||||
___ |
||||
|
||||
### contractMethodParameters |
||||
|
||||
• **contractMethodParameters**: *any[]* |
||||
|
||||
*Defined in [models/types.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L24)* |
||||
|
||||
___ |
||||
|
||||
### funcName |
||||
|
||||
• **funcName**: *string* |
||||
|
||||
*Defined in [models/types.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### inputs |
||||
|
||||
• **inputs**: *[AbiInput](abiinput.md)[]* |
||||
|
||||
*Defined in [models/types.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Defined in [models/types.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L14)* |
||||
|
||||
___ |
||||
|
||||
### outputs |
||||
|
||||
• **outputs**: *[AbiOutput](abioutput.md)[]* |
||||
|
||||
*Defined in [models/types.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### payable |
||||
|
||||
• **payable**: *boolean* |
||||
|
||||
*Defined in [models/types.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L16)* |
||||
|
||||
___ |
||||
|
||||
### signature |
||||
|
||||
• **signature**: *string* |
||||
|
||||
*Defined in [models/types.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L15)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` stateMutability |
||||
|
||||
• **stateMutability**? : *undefined | string* |
||||
|
||||
*Defined in [models/types.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L21)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Defined in [models/types.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L20)* |
||||
|
||||
## Methods |
||||
|
||||
### getIndexedInputs |
||||
|
||||
▸ **getIndexedInputs**(): *[AbiInput](abiinput.md)[]* |
||||
|
||||
*Defined in [models/types.ts:27](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L27)* |
||||
|
||||
**Returns:** *[AbiInput](abiinput.md)[]* |
||||
|
||||
___ |
||||
|
||||
### getInputLength |
||||
|
||||
▸ **getInputLength**(): *number* |
||||
|
||||
*Defined in [models/types.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L25)* |
||||
|
||||
**Returns:** *number* |
||||
|
||||
___ |
||||
|
||||
### getInputs |
||||
|
||||
▸ **getInputs**(): *[AbiInput](abiinput.md)[]* |
||||
|
||||
*Defined in [models/types.ts:26](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L26)* |
||||
|
||||
**Returns:** *[AbiInput](abiinput.md)[]* |
||||
|
||||
___ |
||||
|
||||
### getOutputs |
||||
|
||||
▸ **getOutputs**(): *[AbiOutput](abioutput.md)[]* |
||||
|
||||
*Defined in [models/types.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L28)* |
||||
|
||||
**Returns:** *[AbiOutput](abioutput.md)[]* |
||||
|
||||
___ |
||||
|
||||
### isOfType |
||||
|
||||
▸ **isOfType**(`value`: string): *boolean* |
||||
|
||||
*Defined in [models/types.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L29)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | string | |
||||
|
||||
**Returns:** *boolean* |
@ -0,0 +1,41 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[AbiOutput](abioutput.md) / |
||||
|
||||
# Interface: AbiOutput |
||||
|
||||
## Hierarchy |
||||
|
||||
* **AbiOutput** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [components](abioutput.md#optional-components) |
||||
* [name](abioutput.md#name) |
||||
* [type](abioutput.md#type) |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` components |
||||
|
||||
• **components**? : *[AbiOutput](abioutput.md)[]* |
||||
|
||||
*Defined in [models/types.ts:42](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L42)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Defined in [models/types.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L40)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Defined in [models/types.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/models/types.ts#L41)* |
@ -0,0 +1,104 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[ContractOptions](contractoptions.md) / |
||||
|
||||
# Interface: ContractOptions |
||||
|
||||
## Hierarchy |
||||
|
||||
* **ContractOptions** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [address](contractoptions.md#optional-address) |
||||
* [data](contractoptions.md#optional-data) |
||||
* [defaultAccount](contractoptions.md#optional-defaultaccount) |
||||
* [defaultBlock](contractoptions.md#optional-defaultblock) |
||||
* [defaultGas](contractoptions.md#optional-defaultgas) |
||||
* [defaultGasPrice](contractoptions.md#optional-defaultgasprice) |
||||
* [transactionBlockTimeout](contractoptions.md#optional-transactionblocktimeout) |
||||
* [transactionConfirmationBlocks](contractoptions.md#optional-transactionconfirmationblocks) |
||||
* [transactionPollingTimeout](contractoptions.md#optional-transactionpollingtimeout) |
||||
* [transactionSigner](contractoptions.md#optional-transactionsigner) |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` address |
||||
|
||||
• **address**? : *undefined | string* |
||||
|
||||
*Defined in [utils/options.ts:3](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/options.ts#L3)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` data |
||||
|
||||
• **data**? : *undefined | string* |
||||
|
||||
*Defined in [utils/options.ts:2](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/options.ts#L2)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` defaultAccount |
||||
|
||||
• **defaultAccount**? : *undefined | string* |
||||
|
||||
*Defined in [utils/options.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/options.ts#L4)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` defaultBlock |
||||
|
||||
• **defaultBlock**? : *undefined | string* |
||||
|
||||
*Defined in [utils/options.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/options.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` defaultGas |
||||
|
||||
• **defaultGas**? : *undefined | string* |
||||
|
||||
*Defined in [utils/options.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/options.ts#L6)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` defaultGasPrice |
||||
|
||||
• **defaultGasPrice**? : *undefined | string* |
||||
|
||||
*Defined in [utils/options.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/options.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` transactionBlockTimeout |
||||
|
||||
• **transactionBlockTimeout**? : *undefined | number* |
||||
|
||||
*Defined in [utils/options.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/options.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` transactionConfirmationBlocks |
||||
|
||||
• **transactionConfirmationBlocks**? : *undefined | string* |
||||
|
||||
*Defined in [utils/options.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/options.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` transactionPollingTimeout |
||||
|
||||
• **transactionPollingTimeout**? : *undefined | number* |
||||
|
||||
*Defined in [utils/options.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/options.ts#L10)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` transactionSigner |
||||
|
||||
• **transactionSigner**? : *any* |
||||
|
||||
*Defined in [utils/options.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/utils/options.ts#L11)* |
@ -0,0 +1,32 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[DecodedResult](decodedresult.md) / |
||||
|
||||
# Interface: DecodedResult |
||||
|
||||
## Hierarchy |
||||
|
||||
* **DecodedResult** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [consumed](decodedresult.md#consumed) |
||||
* [value](decodedresult.md#value) |
||||
|
||||
## Properties |
||||
|
||||
### consumed |
||||
|
||||
• **consumed**: *number* |
||||
|
||||
*Defined in [abi/abiCoder.ts:482](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L482)* |
||||
|
||||
___ |
||||
|
||||
### value |
||||
|
||||
• **value**: *any* |
||||
|
||||
*Defined in [abi/abiCoder.ts:483](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L483)* |
@ -0,0 +1,50 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[EventFragment](eventfragment.md) / |
||||
|
||||
# Interface: EventFragment |
||||
|
||||
## Hierarchy |
||||
|
||||
* **EventFragment** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [anonymous](eventfragment.md#anonymous) |
||||
* [inputs](eventfragment.md#inputs) |
||||
* [name](eventfragment.md#name) |
||||
* [type](eventfragment.md#type) |
||||
|
||||
## Properties |
||||
|
||||
### anonymous |
||||
|
||||
• **anonymous**: *boolean* |
||||
|
||||
*Defined in [abi/abiCoder.ts:50](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L50)* |
||||
|
||||
___ |
||||
|
||||
### inputs |
||||
|
||||
• **inputs**: *[ParamType](paramtype.md)[]* |
||||
|
||||
*Defined in [abi/abiCoder.ts:52](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L52)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L48)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L47)* |
@ -0,0 +1,86 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[FunctionFragment](functionfragment.md) / |
||||
|
||||
# Interface: FunctionFragment |
||||
|
||||
## Hierarchy |
||||
|
||||
* **FunctionFragment** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [constant](functionfragment.md#constant) |
||||
* [gas](functionfragment.md#gas) |
||||
* [inputs](functionfragment.md#inputs) |
||||
* [name](functionfragment.md#name) |
||||
* [outputs](functionfragment.md#outputs) |
||||
* [payable](functionfragment.md#payable) |
||||
* [stateMutability](functionfragment.md#statemutability) |
||||
* [type](functionfragment.md#type) |
||||
|
||||
## Properties |
||||
|
||||
### constant |
||||
|
||||
• **constant**: *boolean* |
||||
|
||||
*Defined in [abi/abiCoder.ts:59](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L59)* |
||||
|
||||
___ |
||||
|
||||
### gas |
||||
|
||||
• **gas**: *`BN` | null* |
||||
|
||||
*Defined in [abi/abiCoder.ts:67](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L67)* |
||||
|
||||
___ |
||||
|
||||
### inputs |
||||
|
||||
• **inputs**: *[ParamType](paramtype.md)[]* |
||||
|
||||
*Defined in [abi/abiCoder.ts:61](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L61)* |
||||
|
||||
___ |
||||
|
||||
### name |
||||
|
||||
• **name**: *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:57](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L57)* |
||||
|
||||
___ |
||||
|
||||
### outputs |
||||
|
||||
• **outputs**: *[ParamType](paramtype.md)[]* |
||||
|
||||
*Defined in [abi/abiCoder.ts:62](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L62)* |
||||
|
||||
___ |
||||
|
||||
### payable |
||||
|
||||
• **payable**: *boolean* |
||||
|
||||
*Defined in [abi/abiCoder.ts:64](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L64)* |
||||
|
||||
___ |
||||
|
||||
### stateMutability |
||||
|
||||
• **stateMutability**: *string | null* |
||||
|
||||
*Defined in [abi/abiCoder.ts:65](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L65)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:56](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L56)* |
@ -0,0 +1,50 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[ParamType](paramtype.md) / |
||||
|
||||
# Interface: ParamType |
||||
|
||||
## Hierarchy |
||||
|
||||
* **ParamType** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [components](paramtype.md#optional-components) |
||||
* [indexed](paramtype.md#optional-indexed) |
||||
* [name](paramtype.md#optional-name) |
||||
* [type](paramtype.md#type) |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` components |
||||
|
||||
• **components**? : *any[]* |
||||
|
||||
*Defined in [abi/abiCoder.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L41)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` indexed |
||||
|
||||
• **indexed**? : *undefined | false | true* |
||||
|
||||
*Defined in [abi/abiCoder.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L40)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` name |
||||
|
||||
• **name**? : *undefined | string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:38](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L38)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L39)* |
@ -0,0 +1,68 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[ParseNode](parsenode.md) / |
||||
|
||||
# Interface: ParseNode |
||||
|
||||
## Hierarchy |
||||
|
||||
* **ParseNode** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [components](parsenode.md#optional-components) |
||||
* [indexed](parsenode.md#optional-indexed) |
||||
* [name](parsenode.md#optional-name) |
||||
* [parent](parsenode.md#optional-parent) |
||||
* [state](parsenode.md#optional-state) |
||||
* [type](parsenode.md#optional-type) |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` components |
||||
|
||||
• **components**? : *any[]* |
||||
|
||||
*Defined in [abi/abiCoder.ts:122](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L122)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` indexed |
||||
|
||||
• **indexed**? : *undefined | false | true* |
||||
|
||||
*Defined in [abi/abiCoder.ts:121](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L121)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` name |
||||
|
||||
• **name**? : *undefined | string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:119](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L119)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` parent |
||||
|
||||
• **parent**? : *any* |
||||
|
||||
*Defined in [abi/abiCoder.ts:117](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L117)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` state |
||||
|
||||
• **state**? : *[ParseState](parsestate.md)* |
||||
|
||||
*Defined in [abi/abiCoder.ts:120](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L120)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` type |
||||
|
||||
• **type**? : *undefined | string* |
||||
|
||||
*Defined in [abi/abiCoder.ts:118](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L118)* |
@ -0,0 +1,59 @@ |
||||
> **[@harmony-js/contract](../README.md)** |
||||
|
||||
[ParseState](parsestate.md) / |
||||
|
||||
# Interface: ParseState |
||||
|
||||
## Hierarchy |
||||
|
||||
* **ParseState** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [allowArray](parsestate.md#optional-allowarray) |
||||
* [allowName](parsestate.md#optional-allowname) |
||||
* [allowParams](parsestate.md#optional-allowparams) |
||||
* [allowType](parsestate.md#optional-allowtype) |
||||
* [readArray](parsestate.md#optional-readarray) |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` allowArray |
||||
|
||||
• **allowArray**? : *undefined | false | true* |
||||
|
||||
*Defined in [abi/abiCoder.ts:109](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L109)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` allowName |
||||
|
||||
• **allowName**? : *undefined | false | true* |
||||
|
||||
*Defined in [abi/abiCoder.ts:110](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L110)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` allowParams |
||||
|
||||
• **allowParams**? : *undefined | false | true* |
||||
|
||||
*Defined in [abi/abiCoder.ts:111](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L111)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` allowType |
||||
|
||||
• **allowType**? : *undefined | false | true* |
||||
|
||||
*Defined in [abi/abiCoder.ts:112](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L112)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` readArray |
||||
|
||||
• **readArray**? : *undefined | false | true* |
||||
|
||||
*Defined in [abi/abiCoder.ts:113](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-contract/src/abi/abiCoder.ts#L113)* |
@ -0,0 +1,18 @@ |
||||
> **[@harmony-js/core](README.md)** |
||||
|
||||
## Index |
||||
|
||||
### Enumerations |
||||
|
||||
* [UrlType](enums/urltype.md) |
||||
|
||||
### Classes |
||||
|
||||
* [Blockchain](classes/blockchain.md) |
||||
* [Harmony](classes/harmony.md) |
||||
|
||||
### Interfaces |
||||
|
||||
* [HarmonyConfig](interfaces/harmonyconfig.md) |
||||
* [HarmonyModule](interfaces/harmonymodule.md) |
||||
* [HarmonySetting](interfaces/harmonysetting.md) |
@ -0,0 +1,513 @@ |
||||
> **[@harmony-js/core](../README.md)** |
||||
|
||||
[Blockchain](blockchain.md) / |
||||
|
||||
# Class: Blockchain |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Blockchain** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](blockchain.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [messenger](blockchain.md#messenger) |
||||
|
||||
### Methods |
||||
|
||||
* [call](blockchain.md#call) |
||||
* [createObservedTransaction](blockchain.md#createobservedtransaction) |
||||
* [estimateGas](blockchain.md#estimategas) |
||||
* [gasPrice](blockchain.md#gasprice) |
||||
* [getBalance](blockchain.md#getbalance) |
||||
* [getBlockByHash](blockchain.md#getblockbyhash) |
||||
* [getBlockByNumber](blockchain.md#getblockbynumber) |
||||
* [getBlockNumber](blockchain.md#getblocknumber) |
||||
* [getBlockTransactionCountByHash](blockchain.md#getblocktransactioncountbyhash) |
||||
* [getBlockTransactionCountByNumber](blockchain.md#getblocktransactioncountbynumber) |
||||
* [getCode](blockchain.md#getcode) |
||||
* [getProtocalVersion](blockchain.md#getprotocalversion) |
||||
* [getRpcResult](blockchain.md#getrpcresult) |
||||
* [getStorageAt](blockchain.md#getstorageat) |
||||
* [getTransactionByBlockHashAndIndex](blockchain.md#gettransactionbyblockhashandindex) |
||||
* [getTransactionByBlockNumberAndIndex](blockchain.md#gettransactionbyblocknumberandindex) |
||||
* [getTransactionByHash](blockchain.md#gettransactionbyhash) |
||||
* [getTransactionCount](blockchain.md#gettransactioncount) |
||||
* [getTransactionReceipt](blockchain.md#gettransactionreceipt) |
||||
* [logs](blockchain.md#logs) |
||||
* [net_peerCount](blockchain.md#net_peercount) |
||||
* [net_version](blockchain.md#net_version) |
||||
* [newBlockHeaders](blockchain.md#newblockheaders) |
||||
* [newPendingTransactions](blockchain.md#newpendingtransactions) |
||||
* [sendRawTransaction](blockchain.md#sendrawtransaction) |
||||
* [sendTransaction](blockchain.md#sendtransaction) |
||||
* [setMessenger](blockchain.md#setmessenger) |
||||
* [syncing](blockchain.md#syncing) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new Blockchain**(`messenger`: `Messenger`): *[Blockchain](blockchain.md)* |
||||
|
||||
*Defined in [blockchain.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L24)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`messenger` | `Messenger` | |
||||
|
||||
**Returns:** *[Blockchain](blockchain.md)* |
||||
|
||||
## Properties |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *`Messenger`* |
||||
|
||||
*Defined in [blockchain.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L24)* |
||||
|
||||
## Methods |
||||
|
||||
### call |
||||
|
||||
▸ **call**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:347](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L347)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`blockNumber` | string | DefaultBlockParams.latest | |
||||
`payload` | any | - | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### createObservedTransaction |
||||
|
||||
▸ **createObservedTransaction**(`transaction`: `Transaction`): *`Emitter`* |
||||
|
||||
*Defined in [blockchain.ts:310](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L310)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`transaction` | `Transaction` | |
||||
|
||||
**Returns:** *`Emitter`* |
||||
|
||||
___ |
||||
|
||||
### estimateGas |
||||
|
||||
▸ **estimateGas**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:329](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L329)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | string | |
||||
`to` | string | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### gasPrice |
||||
|
||||
▸ **gasPrice**(): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:338](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L338)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getBalance |
||||
|
||||
▸ **getBalance**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L47)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`address` | string | - | |
||||
`blockNumber` | string | DefaultBlockParams.latest | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getBlockByHash |
||||
|
||||
▸ **getBlockByHash**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:77](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L77)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`blockHash` | string | - | |
||||
`returnObject` | boolean | true | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getBlockByNumber |
||||
|
||||
▸ **getBlockByNumber**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:99](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L99)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`blockNumber` | string | DefaultBlockParams.latest | |
||||
`returnObject` | boolean | true | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getBlockNumber |
||||
|
||||
▸ **getBlockNumber**(): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:62](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L62)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getBlockTransactionCountByHash |
||||
|
||||
▸ **getBlockTransactionCountByHash**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:117](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L117)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`blockHash` | string | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getBlockTransactionCountByNumber |
||||
|
||||
▸ **getBlockTransactionCountByNumber**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:129](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L129)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`blockNumber` | string | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getCode |
||||
|
||||
▸ **getCode**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:212](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L212)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`address` | string | - | |
||||
`blockNumber` | string | DefaultBlockParams.latest | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getProtocalVersion |
||||
|
||||
▸ **getProtocalVersion**(): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:238](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L238)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getRpcResult |
||||
|
||||
▸ **getRpcResult**(`result`: any): *any* |
||||
|
||||
*Defined in [blockchain.ts:32](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L32)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`result` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### getStorageAt |
||||
|
||||
▸ **getStorageAt**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:252](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L252)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`address` | string | - | |
||||
`blockNumber` | string | DefaultBlockParams.latest | |
||||
`position` | string | - | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getTransactionByBlockHashAndIndex |
||||
|
||||
▸ **getTransactionByBlockHashAndIndex**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:145](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L145)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`blockHash` | string | |
||||
`index` | string | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getTransactionByBlockNumberAndIndex |
||||
|
||||
▸ **getTransactionByBlockNumberAndIndex**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:164](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L164)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`blockNumber` | string | DefaultBlockParams.latest | |
||||
`index` | string | - | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getTransactionByHash |
||||
|
||||
▸ **getTransactionByHash**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:182](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L182)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`txnHash` | string | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getTransactionCount |
||||
|
||||
▸ **getTransactionCount**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:273](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L273)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`address` | string | - | |
||||
`blockNumber` | string | DefaultBlockParams.latest | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getTransactionReceipt |
||||
|
||||
▸ **getTransactionReceipt**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:197](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L197)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`txnHash` | string | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### logs |
||||
|
||||
▸ **logs**(`options`: any): *`LogSub`* |
||||
|
||||
*Defined in [blockchain.ts:386](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L386)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`options` | any | |
||||
|
||||
**Returns:** *`LogSub`* |
||||
|
||||
___ |
||||
|
||||
### net_peerCount |
||||
|
||||
▸ **net_peerCount**(): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:227](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L227)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### net_version |
||||
|
||||
▸ **net_version**(): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:232](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L232)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### newBlockHeaders |
||||
|
||||
▸ **newBlockHeaders**(): *`NewHeaders`* |
||||
|
||||
*Defined in [blockchain.ts:370](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L370)* |
||||
|
||||
**Returns:** *`NewHeaders`* |
||||
|
||||
___ |
||||
|
||||
### newPendingTransactions |
||||
|
||||
▸ **newPendingTransactions**(): *`NewPendingTransactions`* |
||||
|
||||
*Defined in [blockchain.ts:362](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L362)* |
||||
|
||||
**Returns:** *`NewPendingTransactions`* |
||||
|
||||
___ |
||||
|
||||
### sendRawTransaction |
||||
|
||||
▸ **sendRawTransaction**(`transaction`: `Transaction`): *`Promise<undefined | string>`* |
||||
|
||||
*Defined in [blockchain.ts:300](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L300)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`transaction` | `Transaction` | |
||||
|
||||
**Returns:** *`Promise<undefined | string>`* |
||||
|
||||
___ |
||||
|
||||
### sendTransaction |
||||
|
||||
▸ **sendTransaction**(`transaction`: `Transaction`): *`Promise<any>`* |
||||
|
||||
*Defined in [blockchain.ts:288](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L288)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`transaction` | `Transaction` | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### setMessenger |
||||
|
||||
▸ **setMessenger**(`messenger`: `Messenger`): *void* |
||||
|
||||
*Defined in [blockchain.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L29)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`messenger` | `Messenger` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### syncing |
||||
|
||||
▸ **syncing**(): *`Syncing`* |
||||
|
||||
*Defined in [blockchain.ts:378](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/blockchain.ts#L378)* |
||||
|
||||
**Returns:** *`Syncing`* |
@ -0,0 +1,300 @@ |
||||
> **[@harmony-js/core](../README.md)** |
||||
|
||||
[Harmony](harmony.md) / |
||||
|
||||
# Class: Harmony |
||||
|
||||
## Hierarchy |
||||
|
||||
* `HarmonyCore` |
||||
|
||||
* **Harmony** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](harmony.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [blockchain](harmony.md#blockchain) |
||||
* [chainId](harmony.md#chainid) |
||||
* [chainPrefix](harmony.md#chainprefix) |
||||
* [chainType](harmony.md#chaintype) |
||||
* [contracts](harmony.md#contracts) |
||||
* [crypto](harmony.md#crypto) |
||||
* [getChainId](harmony.md#getchainid) |
||||
* [messenger](harmony.md#messenger) |
||||
* [provider](harmony.md#private-provider) |
||||
* [transactions](harmony.md#transactions) |
||||
* [utils](harmony.md#utils) |
||||
* [wallet](harmony.md#wallet) |
||||
|
||||
### Methods |
||||
|
||||
* [onInitSetProvider](harmony.md#private-oninitsetprovider) |
||||
* [setChainId](harmony.md#setchainid) |
||||
* [setChainType](harmony.md#setchaintype) |
||||
* [setProvider](harmony.md#setprovider) |
||||
|
||||
### Object literals |
||||
|
||||
* [Modules](harmony.md#modules) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new Harmony**(`url`: string, `config`: [HarmonyConfig](../interfaces/harmonyconfig.md)): *[Harmony](harmony.md)* |
||||
|
||||
*Overrides void* |
||||
|
||||
*Defined in [harmony.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L30)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`url` | string | utils.defaultConfig.Default.Chain_URL | |
||||
`config` | [HarmonyConfig](../interfaces/harmonyconfig.md) | { |
||||
chainUrl: utils.defaultConfig.Default.Chain_URL, |
||||
chainId: utils.defaultConfig.Default.Chain_ID, |
||||
chainType: utils.defaultConfig.Default.Chain_Type, |
||||
} | |
||||
|
||||
**Returns:** *[Harmony](harmony.md)* |
||||
|
||||
## Properties |
||||
|
||||
### blockchain |
||||
|
||||
• **blockchain**: *[Blockchain](blockchain.md)* |
||||
|
||||
*Defined in [harmony.ts:26](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L26)* |
||||
|
||||
___ |
||||
|
||||
### chainId |
||||
|
||||
• **chainId**: *`ChainID`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-utils/dist/chain.d.ts:35 |
||||
|
||||
___ |
||||
|
||||
### chainPrefix |
||||
|
||||
• **chainPrefix**: *string* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-utils/dist/chain.d.ts:37 |
||||
|
||||
___ |
||||
|
||||
### chainType |
||||
|
||||
• **chainType**: *`ChainType`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-utils/dist/chain.d.ts:34 |
||||
|
||||
___ |
||||
|
||||
### contracts |
||||
|
||||
• **contracts**: *`ContractFactory`* |
||||
|
||||
*Defined in [harmony.ts:27](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L27)* |
||||
|
||||
___ |
||||
|
||||
### crypto |
||||
|
||||
• **crypto**: *any* |
||||
|
||||
*Defined in [harmony.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L28)* |
||||
|
||||
___ |
||||
|
||||
### getChainId |
||||
|
||||
• **getChainId**: *`ChainID`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-utils/dist/chain.d.ts:38 |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *`Messenger`* |
||||
|
||||
*Defined in [harmony.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### `Private` provider |
||||
|
||||
• **provider**: *`HttpProvider` | `WSProvider`* |
||||
|
||||
*Defined in [harmony.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L30)* |
||||
|
||||
___ |
||||
|
||||
### transactions |
||||
|
||||
• **transactions**: *`TransactionFactory`* |
||||
|
||||
*Defined in [harmony.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L24)* |
||||
|
||||
___ |
||||
|
||||
### utils |
||||
|
||||
• **utils**: *any* |
||||
|
||||
*Defined in [harmony.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L29)* |
||||
|
||||
___ |
||||
|
||||
### wallet |
||||
|
||||
• **wallet**: *`Wallet`* |
||||
|
||||
*Defined in [harmony.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L25)* |
||||
|
||||
## Methods |
||||
|
||||
### `Private` onInitSetProvider |
||||
|
||||
▸ **onInitSetProvider**(`providerUrl`: string): *`HttpProvider` | `WSProvider`* |
||||
|
||||
*Defined in [harmony.ts:82](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L82)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`providerUrl` | string | |
||||
|
||||
**Returns:** *`HttpProvider` | `WSProvider`* |
||||
|
||||
___ |
||||
|
||||
### setChainId |
||||
|
||||
▸ **setChainId**(`chainId`: `ChainID`): *void* |
||||
|
||||
*Overrides void* |
||||
|
||||
*Defined in [harmony.ts:68](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L68)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`chainId` | `ChainID` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setChainType |
||||
|
||||
▸ **setChainType**(`chainType`: `ChainType`): *void* |
||||
|
||||
*Overrides void* |
||||
|
||||
*Defined in [harmony.ts:75](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L75)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`chainType` | `ChainType` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setProvider |
||||
|
||||
▸ **setProvider**(`provider`: string | `HttpProvider` | `WSProvider`): *void* |
||||
|
||||
*Defined in [harmony.ts:52](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L52)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`provider` | string \| `HttpProvider` \| `WSProvider` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
## Object literals |
||||
|
||||
### Modules |
||||
|
||||
### ▪ **Modules**: *object* |
||||
|
||||
*Defined in [harmony.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L12)* |
||||
|
||||
### Account |
||||
|
||||
• **Account**: *`Account`* |
||||
|
||||
*Defined in [harmony.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L20)* |
||||
|
||||
### Blockchain |
||||
|
||||
• **Blockchain**: *[Blockchain](blockchain.md)* |
||||
|
||||
*Defined in [harmony.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L16)* |
||||
|
||||
### Contract |
||||
|
||||
• **Contract**: *`Contract`* |
||||
|
||||
*Defined in [harmony.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L21)* |
||||
|
||||
### HttpProvider |
||||
|
||||
• **HttpProvider**: *`HttpProvider`* |
||||
|
||||
*Defined in [harmony.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L13)* |
||||
|
||||
### Messenger |
||||
|
||||
• **Messenger**: *`Messenger`* |
||||
|
||||
*Defined in [harmony.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L15)* |
||||
|
||||
### Transaction |
||||
|
||||
• **Transaction**: *`Transaction`* |
||||
|
||||
*Defined in [harmony.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L19)* |
||||
|
||||
### TransactionFactory |
||||
|
||||
• **TransactionFactory**: *`TransactionFactory`* |
||||
|
||||
*Defined in [harmony.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L17)* |
||||
|
||||
### WSProvider |
||||
|
||||
• **WSProvider**: *`WSProvider`* |
||||
|
||||
*Defined in [harmony.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L14)* |
||||
|
||||
### Wallet |
||||
|
||||
• **Wallet**: *`Wallet`* |
||||
|
||||
*Defined in [harmony.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/harmony.ts#L18)* |
@ -0,0 +1,28 @@ |
||||
> **[@harmony-js/core](../README.md)** |
||||
|
||||
[UrlType](urltype.md) / |
||||
|
||||
# Enumeration: UrlType |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [http](urltype.md#http) |
||||
* [ws](urltype.md#ws) |
||||
|
||||
## Enumeration members |
||||
|
||||
### http |
||||
|
||||
• **http**: |
||||
|
||||
*Defined in [types.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/types.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### ws |
||||
|
||||
• **ws**: |
||||
|
||||
*Defined in [types.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/types.ts#L19)* |
@ -0,0 +1,41 @@ |
||||
> **[@harmony-js/core](../README.md)** |
||||
|
||||
[HarmonyConfig](harmonyconfig.md) / |
||||
|
||||
# Interface: HarmonyConfig |
||||
|
||||
## Hierarchy |
||||
|
||||
* **HarmonyConfig** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [chainId](harmonyconfig.md#chainid) |
||||
* [chainType](harmonyconfig.md#chaintype) |
||||
* [chainUrl](harmonyconfig.md#chainurl) |
||||
|
||||
## Properties |
||||
|
||||
### chainId |
||||
|
||||
• **chainId**: *`ChainID`* |
||||
|
||||
*Defined in [util.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/util.ts#L6)* |
||||
|
||||
___ |
||||
|
||||
### chainType |
||||
|
||||
• **chainType**: *`ChainType`* |
||||
|
||||
*Defined in [util.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/util.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### chainUrl |
||||
|
||||
• **chainUrl**: *string* |
||||
|
||||
*Defined in [util.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/util.ts#L4)* |
@ -0,0 +1,77 @@ |
||||
> **[@harmony-js/core](../README.md)** |
||||
|
||||
[HarmonyModule](harmonymodule.md) / |
||||
|
||||
# Interface: HarmonyModule |
||||
|
||||
## Hierarchy |
||||
|
||||
* **HarmonyModule** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [Account](harmonymodule.md#account) |
||||
* [Blockchain](harmonymodule.md#blockchain) |
||||
* [HttpProvider](harmonymodule.md#httpprovider) |
||||
* [Messenger](harmonymodule.md#messenger) |
||||
* [Transaction](harmonymodule.md#transaction) |
||||
* [TransactionFactory](harmonymodule.md#transactionfactory) |
||||
* [Wallet](harmonymodule.md#wallet) |
||||
|
||||
## Properties |
||||
|
||||
### Account |
||||
|
||||
• **Account**: *`Account`* |
||||
|
||||
*Defined in [types.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/types.ts#L14)* |
||||
|
||||
___ |
||||
|
||||
### Blockchain |
||||
|
||||
• **Blockchain**: *[Blockchain](../classes/blockchain.md)* |
||||
|
||||
*Defined in [types.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/types.ts#L10)* |
||||
|
||||
___ |
||||
|
||||
### HttpProvider |
||||
|
||||
• **HttpProvider**: *`HttpProvider`* |
||||
|
||||
*Defined in [types.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/types.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### Messenger |
||||
|
||||
• **Messenger**: *`Messenger`* |
||||
|
||||
*Defined in [types.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/types.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### Transaction |
||||
|
||||
• **Transaction**: *`Transaction`* |
||||
|
||||
*Defined in [types.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/types.ts#L13)* |
||||
|
||||
___ |
||||
|
||||
### TransactionFactory |
||||
|
||||
• **TransactionFactory**: *`TransactionFactory`* |
||||
|
||||
*Defined in [types.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/types.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### Wallet |
||||
|
||||
• **Wallet**: *`Wallet`* |
||||
|
||||
*Defined in [types.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/types.ts#L12)* |
@ -0,0 +1,38 @@ |
||||
> **[@harmony-js/core](../README.md)** |
||||
|
||||
[HarmonySetting](harmonysetting.md) / |
||||
|
||||
# Interface: HarmonySetting <**T, I**> |
||||
|
||||
## Type parameters |
||||
|
||||
▪ **T**: *`ChainType`* |
||||
|
||||
▪ **I**: *`ChainID`* |
||||
|
||||
## Hierarchy |
||||
|
||||
* **HarmonySetting** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [id](harmonysetting.md#id) |
||||
* [type](harmonysetting.md#type) |
||||
|
||||
## Properties |
||||
|
||||
### id |
||||
|
||||
• **id**: *`I`* |
||||
|
||||
*Defined in [types.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/types.ts#L24)* |
||||
|
||||
___ |
||||
|
||||
### type |
||||
|
||||
• **type**: *`T`* |
||||
|
||||
*Defined in [types.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-core/src/types.ts#L23)* |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,187 @@ |
||||
> **[@harmony-js/crypto](../README.md)** |
||||
|
||||
[HarmonyAddress](harmonyaddress.md) / |
||||
|
||||
# Class: HarmonyAddress |
||||
|
||||
## Hierarchy |
||||
|
||||
* **HarmonyAddress** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](harmonyaddress.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [basic](harmonyaddress.md#basic) |
||||
* [raw](harmonyaddress.md#raw) |
||||
|
||||
### Accessors |
||||
|
||||
* [basicHex](harmonyaddress.md#basichex) |
||||
* [bech32](harmonyaddress.md#bech32) |
||||
* [bech32TestNet](harmonyaddress.md#bech32testnet) |
||||
* [checksum](harmonyaddress.md#checksum) |
||||
|
||||
### Methods |
||||
|
||||
* [getBasic](harmonyaddress.md#private-getbasic) |
||||
* [isValidBasic](harmonyaddress.md#static-isvalidbasic) |
||||
* [isValidBech32](harmonyaddress.md#static-isvalidbech32) |
||||
* [isValidBech32TestNet](harmonyaddress.md#static-isvalidbech32testnet) |
||||
* [isValidChecksum](harmonyaddress.md#static-isvalidchecksum) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new HarmonyAddress**(`raw`: string): *[HarmonyAddress](harmonyaddress.md)* |
||||
|
||||
*Defined in [address.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L48)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`raw` | string | |
||||
|
||||
**Returns:** *[HarmonyAddress](harmonyaddress.md)* |
||||
|
||||
## Properties |
||||
|
||||
### basic |
||||
|
||||
• **basic**: *string* |
||||
|
||||
*Defined in [address.ts:35](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L35)* |
||||
|
||||
___ |
||||
|
||||
### raw |
||||
|
||||
• **raw**: *string* |
||||
|
||||
*Defined in [address.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L34)* |
||||
|
||||
## Accessors |
||||
|
||||
### basicHex |
||||
|
||||
• **get basicHex**(): *string* |
||||
|
||||
*Defined in [address.ts:36](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L36)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### bech32 |
||||
|
||||
• **get bech32**(): *string* |
||||
|
||||
*Defined in [address.ts:43](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L43)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### bech32TestNet |
||||
|
||||
• **get bech32TestNet**(): *string* |
||||
|
||||
*Defined in [address.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L46)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### checksum |
||||
|
||||
• **get checksum**(): *string* |
||||
|
||||
*Defined in [address.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L39)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
## Methods |
||||
|
||||
### `Private` getBasic |
||||
|
||||
▸ **getBasic**(`addr`: string): *string* |
||||
|
||||
*Defined in [address.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`addr` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Static` isValidBasic |
||||
|
||||
▸ **isValidBasic**(`str`: string): *boolean* |
||||
|
||||
*Defined in [address.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L12)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Static` isValidBech32 |
||||
|
||||
▸ **isValidBech32**(`str`: string): *boolean* |
||||
|
||||
*Defined in [address.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L24)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Static` isValidBech32TestNet |
||||
|
||||
▸ **isValidBech32TestNet**(`str`: string): *boolean* |
||||
|
||||
*Defined in [address.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L29)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Static` isValidChecksum |
||||
|
||||
▸ **isValidChecksum**(`str`: string): *boolean* |
||||
|
||||
*Defined in [address.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/address.ts#L18)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | string | |
||||
|
||||
**Returns:** *boolean* |
@ -0,0 +1,32 @@ |
||||
> **[@harmony-js/crypto](../README.md)** |
||||
|
||||
[Decoded](decoded.md) / |
||||
|
||||
# Interface: Decoded |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Decoded** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [consumed](decoded.md#consumed) |
||||
* [result](decoded.md#result) |
||||
|
||||
## Properties |
||||
|
||||
### consumed |
||||
|
||||
• **consumed**: *number* |
||||
|
||||
*Defined in [rlp.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/rlp.ts#L66)* |
||||
|
||||
___ |
||||
|
||||
### result |
||||
|
||||
• **result**: *any* |
||||
|
||||
*Defined in [rlp.ts:65](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/rlp.ts#L65)* |
@ -0,0 +1,41 @@ |
||||
> **[@harmony-js/crypto](../README.md)** |
||||
|
||||
[EncryptOptions](encryptoptions.md) / |
||||
|
||||
# Interface: EncryptOptions |
||||
|
||||
## Hierarchy |
||||
|
||||
* **EncryptOptions** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [kdf](encryptoptions.md#optional-kdf) |
||||
* [level](encryptoptions.md#optional-level) |
||||
* [uuid](encryptoptions.md#optional-uuid) |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` kdf |
||||
|
||||
• **kdf**? : *[KDF](../README.md#kdf)* |
||||
|
||||
*Defined in [types.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L20)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` level |
||||
|
||||
• **level**? : *undefined | number* |
||||
|
||||
*Defined in [types.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L21)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` uuid |
||||
|
||||
• **uuid**? : *number[]* |
||||
|
||||
*Defined in [types.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L22)* |
@ -0,0 +1,25 @@ |
||||
> **[@harmony-js/crypto](../README.md)** |
||||
|
||||
[Hexable](hexable.md) / |
||||
|
||||
# Interface: Hexable |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Hexable** |
||||
|
||||
## Index |
||||
|
||||
### Methods |
||||
|
||||
* [toHexString](hexable.md#tohexstring) |
||||
|
||||
## Methods |
||||
|
||||
### toHexString |
||||
|
||||
▸ **toHexString**(): *string* |
||||
|
||||
*Defined in [bytes.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/bytes.ts#L9)* |
||||
|
||||
**Returns:** *string* |
@ -0,0 +1,66 @@ |
||||
> **[@harmony-js/crypto](../README.md)** |
||||
|
||||
[Keystore](keystore.md) / |
||||
|
||||
# Interface: Keystore |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Keystore** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [Crypto](keystore.md#crypto) |
||||
* [address](keystore.md#optional-address) |
||||
* [id](keystore.md#id) |
||||
* [version](keystore.md#version) |
||||
|
||||
## Properties |
||||
|
||||
### Crypto |
||||
|
||||
• **Crypto**: *object* |
||||
|
||||
*Defined in [types.ts:27](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L27)* |
||||
|
||||
#### Type declaration: |
||||
|
||||
* **cipher**: *string* |
||||
|
||||
* **cipherparams**(): *object* |
||||
|
||||
* **iv**: *string* |
||||
|
||||
* **ciphertext**: *string* |
||||
|
||||
* **kdf**: *[KDF](../README.md#kdf)* |
||||
|
||||
* **kdfparams**: *[KDFParams](../README.md#kdfparams)* |
||||
|
||||
* **mac**: *string* |
||||
|
||||
___ |
||||
|
||||
### `Optional` address |
||||
|
||||
• **address**? : *undefined | string* |
||||
|
||||
*Defined in [types.ts:26](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L26)* |
||||
|
||||
___ |
||||
|
||||
### id |
||||
|
||||
• **id**: *string* |
||||
|
||||
*Defined in [types.ts:37](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L37)* |
||||
|
||||
___ |
||||
|
||||
### version |
||||
|
||||
• **version**: *`3`* |
||||
|
||||
*Defined in [types.ts:38](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L38)* |
@ -0,0 +1,41 @@ |
||||
> **[@harmony-js/crypto](../README.md)** |
||||
|
||||
[PBKDF2Params](pbkdf2params.md) / |
||||
|
||||
# Interface: PBKDF2Params |
||||
|
||||
## Hierarchy |
||||
|
||||
* **PBKDF2Params** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [c](pbkdf2params.md#c) |
||||
* [dklen](pbkdf2params.md#dklen) |
||||
* [salt](pbkdf2params.md#salt) |
||||
|
||||
## Properties |
||||
|
||||
### c |
||||
|
||||
• **c**: *number* |
||||
|
||||
*Defined in [types.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L6)* |
||||
|
||||
___ |
||||
|
||||
### dklen |
||||
|
||||
• **dklen**: *number* |
||||
|
||||
*Defined in [types.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### salt |
||||
|
||||
• **salt**: *string* |
||||
|
||||
*Defined in [types.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L4)* |
@ -0,0 +1,59 @@ |
||||
> **[@harmony-js/crypto](../README.md)** |
||||
|
||||
[ScryptParams](scryptparams.md) / |
||||
|
||||
# Interface: ScryptParams |
||||
|
||||
## Hierarchy |
||||
|
||||
* **ScryptParams** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [dklen](scryptparams.md#dklen) |
||||
* [n](scryptparams.md#n) |
||||
* [p](scryptparams.md#p) |
||||
* [r](scryptparams.md#r) |
||||
* [salt](scryptparams.md#salt) |
||||
|
||||
## Properties |
||||
|
||||
### dklen |
||||
|
||||
• **dklen**: *number* |
||||
|
||||
*Defined in [types.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### n |
||||
|
||||
• **n**: *number* |
||||
|
||||
*Defined in [types.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L12)* |
||||
|
||||
___ |
||||
|
||||
### p |
||||
|
||||
• **p**: *number* |
||||
|
||||
*Defined in [types.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L14)* |
||||
|
||||
___ |
||||
|
||||
### r |
||||
|
||||
• **r**: *number* |
||||
|
||||
*Defined in [types.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L13)* |
||||
|
||||
___ |
||||
|
||||
### salt |
||||
|
||||
• **salt**: *string* |
||||
|
||||
*Defined in [types.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/types.ts#L10)* |
@ -0,0 +1,50 @@ |
||||
> **[@harmony-js/crypto](../README.md)** |
||||
|
||||
[Signature](signature.md) / |
||||
|
||||
# Interface: Signature |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Signature** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [r](signature.md#r) |
||||
* [recoveryParam](signature.md#optional-recoveryparam) |
||||
* [s](signature.md#s) |
||||
* [v](signature.md#optional-v) |
||||
|
||||
## Properties |
||||
|
||||
### r |
||||
|
||||
• **r**: *string* |
||||
|
||||
*Defined in [bytes.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/bytes.ts#L13)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` recoveryParam |
||||
|
||||
• **recoveryParam**? : *undefined | number* |
||||
|
||||
*Defined in [bytes.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/bytes.ts#L17)* |
||||
|
||||
___ |
||||
|
||||
### s |
||||
|
||||
• **s**: *string* |
||||
|
||||
*Defined in [bytes.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/bytes.ts#L14)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` v |
||||
|
||||
• **v**? : *undefined | number* |
||||
|
||||
*Defined in [bytes.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-crypto/src/bytes.ts#L18)* |
@ -0,0 +1,343 @@ |
||||
> **[@harmony-js/network](README.md)** |
||||
|
||||
## Index |
||||
|
||||
### Enumerations |
||||
|
||||
* [EmittType](enums/emitttype.md) |
||||
* [MiddlewareType](enums/middlewaretype.md) |
||||
* [RPCErrorCode](enums/rpcerrorcode.md) |
||||
* [RPCMethod](enums/rpcmethod.md) |
||||
* [SocketConnection](enums/socketconnection.md) |
||||
* [SocketState](enums/socketstate.md) |
||||
* [SubscribeReturns](enums/subscribereturns.md) |
||||
|
||||
### Classes |
||||
|
||||
* [BaseBlockTracker](classes/baseblocktracker.md) |
||||
* [BaseProvider](classes/baseprovider.md) |
||||
* [BaseSocket](classes/basesocket.md) |
||||
* [Emitter](classes/emitter.md) |
||||
* [HttpProvider](classes/httpprovider.md) |
||||
* [JsonRpc](classes/jsonrpc.md) |
||||
* [LogSub](classes/logsub.md) |
||||
* [Messenger](classes/messenger.md) |
||||
* [NewHeaders](classes/newheaders.md) |
||||
* [NewPendingTransactions](classes/newpendingtransactions.md) |
||||
* [PollingBlockTracker](classes/pollingblocktracker.md) |
||||
* [ResponseMiddleware](classes/responsemiddleware.md) |
||||
* [SubscribeBlockTracker](classes/subscribeblocktracker.md) |
||||
* [SubscriptionMethod](classes/subscriptionmethod.md) |
||||
* [Syncing](classes/syncing.md) |
||||
* [WSProvider](classes/wsprovider.md) |
||||
|
||||
### Interfaces |
||||
|
||||
* [Middleware](interfaces/middleware.md) |
||||
* [RPCError](interfaces/rpcerror.md) |
||||
* [RPCRequest](interfaces/rpcrequest.md) |
||||
* [RPCRequestOptions](interfaces/rpcrequestoptions.md) |
||||
* [RPCRequestPayload](interfaces/rpcrequestpayload.md) |
||||
* [RPCResponseBase](interfaces/rpcresponsebase.md) |
||||
* [RPCResponseBody](interfaces/rpcresponsebody.md) |
||||
* [RPCResult](interfaces/rpcresult.md) |
||||
|
||||
### Type aliases |
||||
|
||||
* [ReqMiddleware](README.md#reqmiddleware) |
||||
* [ResMiddleware](README.md#resmiddleware) |
||||
|
||||
### Variables |
||||
|
||||
* [DEFAULT_TIMEOUT](README.md#const-default_timeout) |
||||
* [blockTrackerEvents](README.md#const-blocktrackerevents) |
||||
* [sec](README.md#const-sec) |
||||
|
||||
### Functions |
||||
|
||||
* [_fetch](README.md#_fetch) |
||||
* [calculateSum](README.md#const-calculatesum) |
||||
* [composeMiddleware](README.md#composemiddleware) |
||||
* [getRawForData](README.md#getrawfordata) |
||||
* [getResultForData](README.md#getresultfordata) |
||||
* [onResponse](README.md#onresponse) |
||||
* [performRPC](README.md#const-performrpc) |
||||
* [timeout](README.md#timeout) |
||||
|
||||
### Object literals |
||||
|
||||
* [DEFAULT_HEADERS](README.md#const-default_headers) |
||||
* [defaultOptions](README.md#const-defaultoptions) |
||||
* [fetchRPC](README.md#const-fetchrpc) |
||||
|
||||
## Type aliases |
||||
|
||||
### ReqMiddleware |
||||
|
||||
Ƭ **ReqMiddleware**: *`Map<string | RPCMethod | RegExp, any[]>`* |
||||
|
||||
*Defined in [types.ts:3](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L3)* |
||||
|
||||
___ |
||||
|
||||
### ResMiddleware |
||||
|
||||
Ƭ **ResMiddleware**: *`Map<string | RPCMethod | RegExp, any[]>`* |
||||
|
||||
*Defined in [types.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L4)* |
||||
|
||||
## Variables |
||||
|
||||
### `Const` DEFAULT_TIMEOUT |
||||
|
||||
• **DEFAULT_TIMEOUT**: *number* = 120000 |
||||
|
||||
*Defined in [rpcMethod/net.ts:1](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/net.ts#L1)* |
||||
|
||||
___ |
||||
|
||||
### `Const` blockTrackerEvents |
||||
|
||||
• **blockTrackerEvents**: *string[]* = ['sync', 'latest'] |
||||
|
||||
*Defined in [tracker/baseTracker.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### `Const` sec |
||||
|
||||
• **sec**: *`1000`* = 1000 |
||||
|
||||
*Defined in [tracker/baseTracker.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L4)* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L5)* |
||||
|
||||
## Functions |
||||
|
||||
### _fetch |
||||
|
||||
▸ **_fetch**(`fetchPromise`: `Promise<any>`, `timeout`: number): *`Promise<any>`* |
||||
|
||||
*Defined in [rpcMethod/net.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/net.ts#L5)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fetchPromise` | `Promise<any>` | |
||||
`timeout` | number | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### `Const` calculateSum |
||||
|
||||
▸ **calculateSum**(`accumulator`: number, `currentValue`: number): *number* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L6)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`accumulator` | number | |
||||
`currentValue` | number | |
||||
|
||||
**Returns:** *number* |
||||
|
||||
___ |
||||
|
||||
### composeMiddleware |
||||
|
||||
▸ **composeMiddleware**(...`fns`: any[]): *any* |
||||
|
||||
*Defined in [rpcMethod/net.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/net.ts#L34)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`...fns` | any[] | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### getRawForData |
||||
|
||||
▸ **getRawForData**(`data`: any): *any* |
||||
|
||||
*Defined in [util.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/util.ts#L19)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### getResultForData |
||||
|
||||
▸ **getResultForData**(`data`: any): *any* |
||||
|
||||
*Defined in [util.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/util.ts#L9)* |
||||
|
||||
**`function`** getResultForData |
||||
|
||||
**`description`** get result for data by default |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`data` | any | object get from provider | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
data result or data |
||||
|
||||
___ |
||||
|
||||
### onResponse |
||||
|
||||
▸ **onResponse**(`response`: [ResponseMiddleware](classes/responsemiddleware.md)): *any* |
||||
|
||||
*Defined in [util.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/util.ts#L23)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`response` | [ResponseMiddleware](classes/responsemiddleware.md) | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### `Const` performRPC |
||||
|
||||
▸ **performRPC**(`request`: any, `handler`: any, `fetcher`: any): *`Promise<any>`* |
||||
|
||||
*Defined in [rpcMethod/net.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/net.ts#L20)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`request` | any | |
||||
`handler` | any | |
||||
`fetcher` | any | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### timeout |
||||
|
||||
▸ **timeout**(`duration`: number, `unref`: any): *`Promise<unknown>`* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L7)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`duration` | number | |
||||
`unref` | any | |
||||
|
||||
**Returns:** *`Promise<unknown>`* |
||||
|
||||
## Object literals |
||||
|
||||
### `Const` DEFAULT_HEADERS |
||||
|
||||
### ▪ **DEFAULT_HEADERS**: *object* |
||||
|
||||
*Defined in [rpcMethod/net.ts:3](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/net.ts#L3)* |
||||
|
||||
### Content-Type |
||||
|
||||
• **Content-Type**: *string* = "application/json" |
||||
|
||||
*Defined in [rpcMethod/net.ts:3](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/net.ts#L3)* |
||||
|
||||
___ |
||||
|
||||
### `Const` defaultOptions |
||||
|
||||
### ▪ **defaultOptions**: *object* |
||||
|
||||
*Defined in [providers/http.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L12)* |
||||
|
||||
### headers |
||||
|
||||
• **headers**: *object* = DEFAULT_HEADERS |
||||
|
||||
*Defined in [providers/http.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L15)* |
||||
|
||||
### method |
||||
|
||||
• **method**: *string* = "POST" |
||||
|
||||
*Defined in [providers/http.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L13)* |
||||
|
||||
### password |
||||
|
||||
• **password**: *null* = null |
||||
|
||||
*Defined in [providers/http.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L17)* |
||||
|
||||
### timeout |
||||
|
||||
• **timeout**: *number* = DEFAULT_TIMEOUT |
||||
|
||||
*Defined in [providers/http.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L14)* |
||||
|
||||
### user |
||||
|
||||
• **user**: *null* = null |
||||
|
||||
*Defined in [providers/http.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L16)* |
||||
|
||||
___ |
||||
|
||||
### `Const` fetchRPC |
||||
|
||||
### ▪ **fetchRPC**: *object* |
||||
|
||||
*Defined in [providers/defaultFetcher.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/defaultFetcher.ts#L4)* |
||||
|
||||
### requestHandler |
||||
|
||||
▸ **requestHandler**(`request`: [RPCRequest](interfaces/rpcrequest.md)‹*any[]*›, `headers`: any): *`Promise<Response>`* |
||||
|
||||
*Defined in [providers/defaultFetcher.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/defaultFetcher.ts#L5)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`request` | [RPCRequest](interfaces/rpcrequest.md)‹*any[]*› | |
||||
`headers` | any | |
||||
|
||||
**Returns:** *`Promise<Response>`* |
||||
|
||||
### responseHandler |
||||
|
||||
▸ **responseHandler**(`response`: `Response`, `request`: [RPCRequest](interfaces/rpcrequest.md)‹*any*›, `handler`: any): *`Promise<object>`* |
||||
|
||||
*Defined in [providers/defaultFetcher.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/defaultFetcher.ts#L23)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`response` | `Response` | |
||||
`request` | [RPCRequest](interfaces/rpcrequest.md)‹*any*› | |
||||
`handler` | any | |
||||
|
||||
**Returns:** *`Promise<object>`* |
@ -0,0 +1,565 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[BaseBlockTracker](baseblocktracker.md) / |
||||
|
||||
# Class: BaseBlockTracker |
||||
|
||||
## Hierarchy |
||||
|
||||
* [Emitter](emitter.md) |
||||
|
||||
* **BaseBlockTracker** |
||||
|
||||
* [PollingBlockTracker](pollingblocktracker.md) |
||||
|
||||
* [SubscribeBlockTracker](subscribeblocktracker.md) |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](baseblocktracker.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [_blockResetDuration](baseblocktracker.md#optional-_blockresetduration) |
||||
* [_blockResetTimeout](baseblocktracker.md#_blockresettimeout) |
||||
* [_currentBlock](baseblocktracker.md#_currentblock) |
||||
* [_isRunning](baseblocktracker.md#_isrunning) |
||||
* [emit](baseblocktracker.md#emit) |
||||
* [emitter](baseblocktracker.md#emitter) |
||||
* [handlers](baseblocktracker.md#optional-handlers) |
||||
* [off](baseblocktracker.md#off) |
||||
* [promise](baseblocktracker.md#promise) |
||||
* [reject](baseblocktracker.md#optional-reject) |
||||
* [resolve](baseblocktracker.md#optional-resolve) |
||||
* [then](baseblocktracker.md#optional-then) |
||||
|
||||
### Methods |
||||
|
||||
* [_cancelBlockResetTimeout](baseblocktracker.md#_cancelblockresettimeout) |
||||
* [_end](baseblocktracker.md#_end) |
||||
* [_getBlockTrackerEventCount](baseblocktracker.md#_getblocktrackereventcount) |
||||
* [_maybeEnd](baseblocktracker.md#_maybeend) |
||||
* [_maybeStart](baseblocktracker.md#_maybestart) |
||||
* [_newPotentialLatest](baseblocktracker.md#_newpotentiallatest) |
||||
* [_onNewListener](baseblocktracker.md#_onnewlistener) |
||||
* [_onRemoveListener](baseblocktracker.md#_onremovelistener) |
||||
* [_resetCurrentBlock](baseblocktracker.md#_resetcurrentblock) |
||||
* [_setCurrentBlock](baseblocktracker.md#_setcurrentblock) |
||||
* [_setupBlockResetTimeout](baseblocktracker.md#_setupblockresettimeout) |
||||
* [_setupInternalEvents](baseblocktracker.md#_setupinternalevents) |
||||
* [_start](baseblocktracker.md#_start) |
||||
* [addEventListener](baseblocktracker.md#addeventlistener) |
||||
* [getCurrentBlock](baseblocktracker.md#getcurrentblock) |
||||
* [getLatestBlock](baseblocktracker.md#getlatestblock) |
||||
* [isRunning](baseblocktracker.md#isrunning) |
||||
* [listenerCount](baseblocktracker.md#listenercount) |
||||
* [on](baseblocktracker.md#on) |
||||
* [onData](baseblocktracker.md#ondata) |
||||
* [onError](baseblocktracker.md#onerror) |
||||
* [once](baseblocktracker.md#once) |
||||
* [removeAllListeners](baseblocktracker.md#removealllisteners) |
||||
* [removeEventListener](baseblocktracker.md#removeeventlistener) |
||||
* [resetHandlers](baseblocktracker.md#resethandlers) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new BaseBlockTracker**(`opts`: any): *[BaseBlockTracker](baseblocktracker.md)* |
||||
|
||||
*Overrides [Emitter](emitter.md).[constructor](emitter.md#constructor)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L18)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`opts` | any | { |
||||
blockResetDuration: undefined, |
||||
retryTimeout: undefined, |
||||
keepEventLoopActive: undefined, |
||||
setSkipCacheFlag: false, |
||||
} | |
||||
|
||||
**Returns:** *[BaseBlockTracker](baseblocktracker.md)* |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` _blockResetDuration |
||||
|
||||
• **_blockResetDuration**? : *undefined | number* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L12)* |
||||
|
||||
___ |
||||
|
||||
### _blockResetTimeout |
||||
|
||||
• **_blockResetTimeout**: *any* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L14)* |
||||
|
||||
___ |
||||
|
||||
### _currentBlock |
||||
|
||||
• **_currentBlock**: *any* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L16)* |
||||
|
||||
___ |
||||
|
||||
### _isRunning |
||||
|
||||
• **_isRunning**: *boolean* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### emit |
||||
|
||||
• **emit**: *function* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[emit](emitter.md#emit)* |
||||
|
||||
*Defined in [providers/emitter.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L7)* |
||||
|
||||
#### Type declaration: |
||||
|
||||
▸ (`type`: string, `event?`: any): *void* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`event?` | any | |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[emitter](emitter.md#emitter)* |
||||
|
||||
*Defined in [providers/emitter.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` handlers |
||||
|
||||
• **handlers**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[handlers](emitter.md#optional-handlers)* |
||||
|
||||
*Defined in [providers/emitter.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L4)* |
||||
|
||||
___ |
||||
|
||||
### off |
||||
|
||||
• **off**: *function* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[off](emitter.md#off)* |
||||
|
||||
*Defined in [providers/emitter.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L6)* |
||||
|
||||
#### Type declaration: |
||||
|
||||
▸ (`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
___ |
||||
|
||||
### promise |
||||
|
||||
• **promise**: *`Promise<__type>`* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[promise](emitter.md#promise)* |
||||
|
||||
*Defined in [providers/emitter.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` reject |
||||
|
||||
• **reject**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[reject](emitter.md#optional-reject)* |
||||
|
||||
*Defined in [providers/emitter.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L10)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` resolve |
||||
|
||||
• **resolve**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[resolve](emitter.md#optional-resolve)* |
||||
|
||||
*Defined in [providers/emitter.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` then |
||||
|
||||
• **then**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[then](emitter.md#optional-then)* |
||||
|
||||
*Defined in [providers/emitter.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L11)* |
||||
|
||||
## Methods |
||||
|
||||
### _cancelBlockResetTimeout |
||||
|
||||
▸ **_cancelBlockResetTimeout**(): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:182](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L182)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _end |
||||
|
||||
▸ **_end**(): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:87](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L87)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _getBlockTrackerEventCount |
||||
|
||||
▸ **_getBlockTrackerEventCount**(): *number* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:141](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L141)* |
||||
|
||||
**Returns:** *number* |
||||
|
||||
___ |
||||
|
||||
### _maybeEnd |
||||
|
||||
▸ **_maybeEnd**(): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:132](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L132)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _maybeStart |
||||
|
||||
▸ **_maybeStart**(): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:122](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L122)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _newPotentialLatest |
||||
|
||||
▸ **_newPotentialLatest**(`newBlock`: string): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:147](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L147)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`newBlock` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _onNewListener |
||||
|
||||
▸ **_onNewListener**(`eventName`: string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:105](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L105)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`eventName` | string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _onRemoveListener |
||||
|
||||
▸ **_onRemoveListener**(`eventName`: string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:114](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L114)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`eventName` | string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _resetCurrentBlock |
||||
|
||||
▸ **_resetCurrentBlock**(): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:186](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L186)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _setCurrentBlock |
||||
|
||||
▸ **_setCurrentBlock**(`newBlock`: string): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:161](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L161)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`newBlock` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _setupBlockResetTimeout |
||||
|
||||
▸ **_setupBlockResetTimeout**(): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:168](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L168)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _setupInternalEvents |
||||
|
||||
▸ **_setupInternalEvents**(): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:95](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L95)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _start |
||||
|
||||
▸ **_start**(): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:83](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L83)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[addEventListener](emitter.md#addeventlistener)* |
||||
|
||||
*Defined in [providers/emitter.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L41)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### getCurrentBlock |
||||
|
||||
▸ **getCurrentBlock**(): *any* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L48)* |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### getLatestBlock |
||||
|
||||
▸ **getLatestBlock**(): *`Promise<any>`* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:52](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L52)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### isRunning |
||||
|
||||
▸ **isRunning**(): *boolean* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L44)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### listenerCount |
||||
|
||||
▸ **listenerCount**(`listenKey`: any): *number* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[listenerCount](emitter.md#listenercount)* |
||||
|
||||
*Defined in [providers/emitter.ts:64](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L64)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`listenKey` | any | |
||||
|
||||
**Returns:** *number* |
||||
|
||||
___ |
||||
|
||||
### on |
||||
|
||||
▸ **on**(`type`: string, `handler`: `mitt.Handler`): *`this`* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[on](emitter.md#on)* |
||||
|
||||
*Defined in [providers/emitter.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L30)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onData |
||||
|
||||
▸ **onData**(`data`: any): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[onData](emitter.md#ondata)* |
||||
|
||||
*Defined in [providers/emitter.ts:60](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L60)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`error`: any): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[onError](emitter.md#onerror)* |
||||
|
||||
*Defined in [providers/emitter.ts:56](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L56)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`error` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[once](emitter.md#once)* |
||||
|
||||
*Defined in [providers/emitter.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L34)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeAllListeners |
||||
|
||||
▸ **removeAllListeners**(`eventName`: string): *void* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L66)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`eventName` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[removeEventListener](emitter.md#removeeventlistener)* |
||||
|
||||
*Defined in [providers/emitter.ts:45](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L45)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[resetHandlers](emitter.md#resethandlers)* |
||||
|
||||
*Defined in [providers/emitter.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L24)* |
||||
|
||||
**Returns:** *void* |
@ -0,0 +1,130 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[BaseProvider](baseprovider.md) / |
||||
|
||||
# Class: BaseProvider |
||||
|
||||
## Hierarchy |
||||
|
||||
* **BaseProvider** |
||||
|
||||
* [BaseSocket](basesocket.md) |
||||
|
||||
* [HttpProvider](httpprovider.md) |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](baseprovider.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [reqMiddleware](baseprovider.md#protected-reqmiddleware) |
||||
* [resMiddleware](baseprovider.md#protected-resmiddleware) |
||||
* [url](baseprovider.md#protected-url) |
||||
|
||||
### Methods |
||||
|
||||
* [getMiddleware](baseprovider.md#protected-getmiddleware) |
||||
* [pushMiddleware](baseprovider.md#protected-pushmiddleware) |
||||
|
||||
### Object literals |
||||
|
||||
* [middlewares](baseprovider.md#middlewares) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new BaseProvider**(`url`: string, `reqMiddleware`: [ReqMiddleware](../README.md#reqmiddleware), `resMiddleware`: [ResMiddleware](../README.md#resmiddleware)): *[BaseProvider](baseprovider.md)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L19)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`url` | string | - | |
||||
`reqMiddleware` | [ReqMiddleware](../README.md#reqmiddleware) | new Map() | |
||||
`resMiddleware` | [ResMiddleware](../README.md#resmiddleware) | new Map() | |
||||
|
||||
**Returns:** *[BaseProvider](baseprovider.md)* |
||||
|
||||
## Properties |
||||
|
||||
### `Protected` reqMiddleware |
||||
|
||||
• **reqMiddleware**: *[ReqMiddleware](../README.md#reqmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Defined in [providers/baseProvider.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` resMiddleware |
||||
|
||||
• **resMiddleware**: *[ResMiddleware](../README.md#resmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Defined in [providers/baseProvider.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` url |
||||
|
||||
• **url**: *string* |
||||
|
||||
*Defined in [providers/baseProvider.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L17)* |
||||
|
||||
## Methods |
||||
|
||||
### `Protected` getMiddleware |
||||
|
||||
▸ **getMiddleware**(`method`: [RPCMethod](../enums/rpcmethod.md) | string): *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
*Defined in [providers/baseProvider.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L47)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | |
||||
|
||||
**Returns:** *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
___ |
||||
|
||||
### `Protected` pushMiddleware |
||||
|
||||
▸ **pushMiddleware**(`fn`: any, `type`: [MiddlewareType](../enums/middlewaretype.md), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
*Defined in [providers/baseProvider.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L31)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fn` | any | |
||||
`type` | [MiddlewareType](../enums/middlewaretype.md) | |
||||
`match` | string \| [RPCMethod](../enums/rpcmethod.md) \| `RegExp` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
## Object literals |
||||
|
||||
### middlewares |
||||
|
||||
### ▪ **middlewares**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L5)* |
||||
|
||||
▪ **request**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L6)* |
||||
|
||||
* **use**(`fn`: [ReqMiddleware](../README.md#reqmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
▪ **response**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L11)* |
||||
|
||||
* **use**(`fn`: [ResMiddleware](../README.md#resmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
@ -0,0 +1,298 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[BaseSocket](basesocket.md) / |
||||
|
||||
# Class: BaseSocket |
||||
|
||||
## Hierarchy |
||||
|
||||
* [BaseProvider](baseprovider.md) |
||||
|
||||
* **BaseSocket** |
||||
|
||||
* [WSProvider](wsprovider.md) |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](basesocket.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [emitter](basesocket.md#emitter) |
||||
* [handlers](basesocket.md#handlers) |
||||
* [reqMiddleware](basesocket.md#protected-reqmiddleware) |
||||
* [resMiddleware](basesocket.md#protected-resmiddleware) |
||||
* [url](basesocket.md#url) |
||||
|
||||
### Methods |
||||
|
||||
* [addEventListener](basesocket.md#addeventlistener) |
||||
* [getMiddleware](basesocket.md#protected-getmiddleware) |
||||
* [onClose](basesocket.md#onclose) |
||||
* [onError](basesocket.md#onerror) |
||||
* [onReady](basesocket.md#onready) |
||||
* [once](basesocket.md#once) |
||||
* [pushMiddleware](basesocket.md#protected-pushmiddleware) |
||||
* [removeAllSocketListeners](basesocket.md#removeallsocketlisteners) |
||||
* [removeEventListener](basesocket.md#removeeventlistener) |
||||
* [reset](basesocket.md#reset) |
||||
* [resetHandlers](basesocket.md#resethandlers) |
||||
|
||||
### Object literals |
||||
|
||||
* [middlewares](basesocket.md#middlewares) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new BaseSocket**(`url`: string): *[BaseSocket](basesocket.md)* |
||||
|
||||
*Overrides [BaseProvider](baseprovider.md).[constructor](baseprovider.md#constructor)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L30)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`url` | string | |
||||
|
||||
**Returns:** *[BaseSocket](basesocket.md)* |
||||
|
||||
## Properties |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Defined in [providers/baseSocket.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L29)* |
||||
|
||||
___ |
||||
|
||||
### handlers |
||||
|
||||
• **handlers**: *any* |
||||
|
||||
*Defined in [providers/baseSocket.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L30)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` reqMiddleware |
||||
|
||||
• **reqMiddleware**: *[ReqMiddleware](../README.md#reqmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[reqMiddleware](baseprovider.md#protected-reqmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` resMiddleware |
||||
|
||||
• **resMiddleware**: *[ResMiddleware](../README.md#resmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[resMiddleware](baseprovider.md#protected-resmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### url |
||||
|
||||
• **url**: *string* |
||||
|
||||
*Overrides [BaseProvider](baseprovider.md).[url](baseprovider.md#protected-url)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L28)* |
||||
|
||||
## Methods |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Defined in [providers/baseSocket.ts:51](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L51)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### `Protected` getMiddleware |
||||
|
||||
▸ **getMiddleware**(`method`: [RPCMethod](../enums/rpcmethod.md) | string): *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[getMiddleware](baseprovider.md#protected-getmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L47)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | |
||||
|
||||
**Returns:** *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
___ |
||||
|
||||
### onClose |
||||
|
||||
▸ **onClose**(`error`: null): *void* |
||||
|
||||
*Defined in [providers/baseSocket.ts:88](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L88)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`error` | null | null | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`error`: any): *void* |
||||
|
||||
*Defined in [providers/baseSocket.ts:82](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L82)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`error` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onReady |
||||
|
||||
▸ **onReady**(`event`: any): *void* |
||||
|
||||
*Defined in [providers/baseSocket.ts:78](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L78)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Defined in [providers/baseSocket.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L46)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### `Protected` pushMiddleware |
||||
|
||||
▸ **pushMiddleware**(`fn`: any, `type`: [MiddlewareType](../enums/middlewaretype.md), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[pushMiddleware](baseprovider.md#protected-pushmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L31)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fn` | any | |
||||
`type` | [MiddlewareType](../enums/middlewaretype.md) | |
||||
`match` | string \| [RPCMethod](../enums/rpcmethod.md) \| `RegExp` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeAllSocketListeners |
||||
|
||||
▸ **removeAllSocketListeners**(): *void* |
||||
|
||||
*Defined in [providers/baseSocket.ts:70](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L70)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Defined in [providers/baseSocket.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reset |
||||
|
||||
▸ **reset**(): *void* |
||||
|
||||
*Defined in [providers/baseSocket.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L66)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Defined in [providers/baseSocket.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L39)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
## Object literals |
||||
|
||||
### middlewares |
||||
|
||||
### ▪ **middlewares**: *object* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[middlewares](baseprovider.md#middlewares)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L5)* |
||||
|
||||
▪ **request**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L6)* |
||||
|
||||
* **use**(`fn`: [ReqMiddleware](../README.md#reqmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
▪ **response**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L11)* |
||||
|
||||
* **use**(`fn`: [ResMiddleware](../README.md#resmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
@ -0,0 +1,261 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[Emitter](emitter.md) / |
||||
|
||||
# Class: Emitter |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Emitter** |
||||
|
||||
* [BaseBlockTracker](baseblocktracker.md) |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](emitter.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [emit](emitter.md#emit) |
||||
* [emitter](emitter.md#emitter) |
||||
* [handlers](emitter.md#optional-handlers) |
||||
* [off](emitter.md#off) |
||||
* [promise](emitter.md#promise) |
||||
* [reject](emitter.md#optional-reject) |
||||
* [resolve](emitter.md#optional-resolve) |
||||
* [then](emitter.md#optional-then) |
||||
|
||||
### Methods |
||||
|
||||
* [addEventListener](emitter.md#addeventlistener) |
||||
* [listenerCount](emitter.md#listenercount) |
||||
* [on](emitter.md#on) |
||||
* [onData](emitter.md#ondata) |
||||
* [onError](emitter.md#onerror) |
||||
* [once](emitter.md#once) |
||||
* [removeEventListener](emitter.md#removeeventlistener) |
||||
* [resetHandlers](emitter.md#resethandlers) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new Emitter**(): *[Emitter](emitter.md)* |
||||
|
||||
*Defined in [providers/emitter.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L11)* |
||||
|
||||
**Returns:** *[Emitter](emitter.md)* |
||||
|
||||
## Properties |
||||
|
||||
### emit |
||||
|
||||
• **emit**: *function* |
||||
|
||||
*Defined in [providers/emitter.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L7)* |
||||
|
||||
#### Type declaration: |
||||
|
||||
▸ (`type`: string, `event?`: any): *void* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`event?` | any | |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Defined in [providers/emitter.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` handlers |
||||
|
||||
• **handlers**? : *any* |
||||
|
||||
*Defined in [providers/emitter.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L4)* |
||||
|
||||
___ |
||||
|
||||
### off |
||||
|
||||
• **off**: *function* |
||||
|
||||
*Defined in [providers/emitter.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L6)* |
||||
|
||||
#### Type declaration: |
||||
|
||||
▸ (`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
___ |
||||
|
||||
### promise |
||||
|
||||
• **promise**: *`Promise<__type>`* |
||||
|
||||
*Defined in [providers/emitter.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` reject |
||||
|
||||
• **reject**? : *any* |
||||
|
||||
*Defined in [providers/emitter.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L10)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` resolve |
||||
|
||||
• **resolve**? : *any* |
||||
|
||||
*Defined in [providers/emitter.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` then |
||||
|
||||
• **then**? : *any* |
||||
|
||||
*Defined in [providers/emitter.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L11)* |
||||
|
||||
## Methods |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Defined in [providers/emitter.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L41)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### listenerCount |
||||
|
||||
▸ **listenerCount**(`listenKey`: any): *number* |
||||
|
||||
*Defined in [providers/emitter.ts:64](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L64)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`listenKey` | any | |
||||
|
||||
**Returns:** *number* |
||||
|
||||
___ |
||||
|
||||
### on |
||||
|
||||
▸ **on**(`type`: string, `handler`: `mitt.Handler`): *`this`* |
||||
|
||||
*Defined in [providers/emitter.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L30)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onData |
||||
|
||||
▸ **onData**(`data`: any): *void* |
||||
|
||||
*Defined in [providers/emitter.ts:60](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L60)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`error`: any): *void* |
||||
|
||||
*Defined in [providers/emitter.ts:56](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L56)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`error` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Defined in [providers/emitter.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L34)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Defined in [providers/emitter.ts:45](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L45)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Defined in [providers/emitter.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L24)* |
||||
|
||||
**Returns:** *void* |
@ -0,0 +1,346 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[HttpProvider](httpprovider.md) / |
||||
|
||||
# Class: HttpProvider |
||||
|
||||
## Hierarchy |
||||
|
||||
* [BaseProvider](baseprovider.md) |
||||
|
||||
* **HttpProvider** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](httpprovider.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [fetcher](httpprovider.md#optional-fetcher) |
||||
* [options](httpprovider.md#optional-options) |
||||
* [reqMiddleware](httpprovider.md#protected-reqmiddleware) |
||||
* [resMiddleware](httpprovider.md#protected-resmiddleware) |
||||
* [url](httpprovider.md#url) |
||||
|
||||
### Methods |
||||
|
||||
* [callbackHandler](httpprovider.md#callbackhandler) |
||||
* [endpointHandler](httpprovider.md#endpointhandler) |
||||
* [getMiddleware](httpprovider.md#protected-getmiddleware) |
||||
* [optionsHandler](httpprovider.md#optionshandler) |
||||
* [payloadHandler](httpprovider.md#payloadhandler) |
||||
* [pushMiddleware](httpprovider.md#protected-pushmiddleware) |
||||
* [requestFunc](httpprovider.md#requestfunc) |
||||
* [send](httpprovider.md#send) |
||||
* [sendServer](httpprovider.md#sendserver) |
||||
* [subscribe](httpprovider.md#subscribe) |
||||
* [unsubscribe](httpprovider.md#unsubscribe) |
||||
|
||||
### Object literals |
||||
|
||||
* [middlewares](httpprovider.md#middlewares) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new HttpProvider**(`url`: string, `options?`: any, `fetcher?`: any): *[HttpProvider](httpprovider.md)* |
||||
|
||||
*Overrides [BaseProvider](baseprovider.md).[constructor](baseprovider.md#constructor)* |
||||
|
||||
*Defined in [providers/http.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L23)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`url` | string | |
||||
`options?` | any | |
||||
`fetcher?` | any | |
||||
|
||||
**Returns:** *[HttpProvider](httpprovider.md)* |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` fetcher |
||||
|
||||
• **fetcher**? : *any* |
||||
|
||||
*Defined in [providers/http.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L22)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` options |
||||
|
||||
• **options**? : *any* |
||||
|
||||
*Defined in [providers/http.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` reqMiddleware |
||||
|
||||
• **reqMiddleware**: *[ReqMiddleware](../README.md#reqmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[reqMiddleware](baseprovider.md#protected-reqmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` resMiddleware |
||||
|
||||
• **resMiddleware**: *[ResMiddleware](../README.md#resmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[resMiddleware](baseprovider.md#protected-resmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### url |
||||
|
||||
• **url**: *string* |
||||
|
||||
*Overrides [BaseProvider](baseprovider.md).[url](baseprovider.md#protected-url)* |
||||
|
||||
*Defined in [providers/http.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L21)* |
||||
|
||||
## Methods |
||||
|
||||
### callbackHandler |
||||
|
||||
▸ **callbackHandler**(`data`: any, `cb`: any): *any* |
||||
|
||||
*Defined in [providers/http.ts:145](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L145)* |
||||
|
||||
**`function`** callbackHandler |
||||
|
||||
**`memberof`** HttpProvider.prototype |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`data` | any | from server | |
||||
`cb` | any | callback function | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
- return object or callback function |
||||
|
||||
___ |
||||
|
||||
### endpointHandler |
||||
|
||||
▸ **endpointHandler**(`obj`: object, `endpoint?`: undefined | string): *object* |
||||
|
||||
*Defined in [providers/http.ts:111](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L111)* |
||||
|
||||
**`function`** endpointHandler |
||||
|
||||
**`memberof`** HttpProvider.prototype |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`obj` | object | payload object | |
||||
`endpoint?` | undefined \| string | add the endpoint to payload object | |
||||
|
||||
**Returns:** *object* |
||||
|
||||
- assign a new object |
||||
|
||||
___ |
||||
|
||||
### `Protected` getMiddleware |
||||
|
||||
▸ **getMiddleware**(`method`: [RPCMethod](../enums/rpcmethod.md) | string): *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[getMiddleware](baseprovider.md#protected-getmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L47)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | |
||||
|
||||
**Returns:** *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
___ |
||||
|
||||
### optionsHandler |
||||
|
||||
▸ **optionsHandler**(`obj`: object): *object* |
||||
|
||||
*Defined in [providers/http.ts:127](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L127)* |
||||
|
||||
**`function`** optionsHandler |
||||
|
||||
**`memberof`** HttpProvider.prototype |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`obj` | object | options object | |
||||
|
||||
**Returns:** *object* |
||||
|
||||
- assign a new option object |
||||
|
||||
___ |
||||
|
||||
### payloadHandler |
||||
|
||||
▸ **payloadHandler**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*›): *object* |
||||
|
||||
*Defined in [providers/http.ts:100](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L100)* |
||||
|
||||
**`function`** payloadHandler |
||||
|
||||
**`memberof`** HttpProvider.prototype |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*› | payload object | |
||||
|
||||
**Returns:** *object* |
||||
|
||||
- to payload object |
||||
|
||||
___ |
||||
|
||||
### `Protected` pushMiddleware |
||||
|
||||
▸ **pushMiddleware**(`fn`: any, `type`: [MiddlewareType](../enums/middlewaretype.md), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[pushMiddleware](baseprovider.md#protected-pushmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L31)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fn` | any | |
||||
`type` | [MiddlewareType](../enums/middlewaretype.md) | |
||||
`match` | string \| [RPCMethod](../enums/rpcmethod.md) \| `RegExp` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### requestFunc |
||||
|
||||
▸ **requestFunc**(`__namedParameters`: object): *`Promise<any>`* |
||||
|
||||
*Defined in [providers/http.ts:68](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L68)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **__namedParameters**: *object* |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`callback` | any | |
||||
`endpoint` | undefined \| string | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### send |
||||
|
||||
▸ **send**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*›, `callback?`: any): *`Promise<any>`* |
||||
|
||||
*Defined in [providers/http.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L48)* |
||||
|
||||
**`function`** send |
||||
|
||||
**`memberof`** HttpProvider.prototype |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*› | payload object | |
||||
`callback?` | any | callback function | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
- RPC Response |
||||
|
||||
___ |
||||
|
||||
### sendServer |
||||
|
||||
▸ **sendServer**(`endpoint`: string, `payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*›, `callback`: any): *`Promise<any>`* |
||||
|
||||
*Defined in [providers/http.ts:60](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L60)* |
||||
|
||||
**`function`** sendServer |
||||
|
||||
**`memberof`** HttpProvider.prototype |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`endpoint` | string | endpoint to server | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*› | payload object | |
||||
`callback` | any | callback function | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
- RPC Response |
||||
|
||||
___ |
||||
|
||||
### subscribe |
||||
|
||||
▸ **subscribe**(): *void* |
||||
|
||||
*Defined in [providers/http.ts:152](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L152)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### unsubscribe |
||||
|
||||
▸ **unsubscribe**(): *void* |
||||
|
||||
*Defined in [providers/http.ts:156](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/http.ts#L156)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
## Object literals |
||||
|
||||
### middlewares |
||||
|
||||
### ▪ **middlewares**: *object* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[middlewares](baseprovider.md#middlewares)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L5)* |
||||
|
||||
▪ **request**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L6)* |
||||
|
||||
* **use**(`fn`: [ReqMiddleware](../README.md#reqmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
▪ **response**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L11)* |
||||
|
||||
* **use**(`fn`: [ResMiddleware](../README.md#resmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
@ -0,0 +1,66 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[JsonRpc](jsonrpc.md) / |
||||
|
||||
# Class: JsonRpc |
||||
|
||||
**`class`** JsonRpc |
||||
|
||||
**`description`** json rpc instance |
||||
|
||||
**`returns`** Json RPC instance |
||||
|
||||
## Hierarchy |
||||
|
||||
* **JsonRpc** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](jsonrpc.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [messageId](jsonrpc.md#messageid) |
||||
|
||||
### Methods |
||||
|
||||
* [toPayload](jsonrpc.md#topayload) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new JsonRpc**(): *[JsonRpc](jsonrpc.md)* |
||||
|
||||
*Defined in [rpcMethod/builder.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/builder.ts#L9)* |
||||
|
||||
**Returns:** *[JsonRpc](jsonrpc.md)* |
||||
|
||||
## Properties |
||||
|
||||
### messageId |
||||
|
||||
• **messageId**: *number* |
||||
|
||||
*Defined in [rpcMethod/builder.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/builder.ts#L9)* |
||||
|
||||
## Methods |
||||
|
||||
### toPayload |
||||
|
||||
▸ **toPayload**(`method`: [RPCMethod](../enums/rpcmethod.md) | string, `params`: string | undefined | any[]): *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
*Defined in [rpcMethod/builder.ts:27](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/builder.ts#L27)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | RPC method | |
||||
`params` | string \| undefined \| any[] | params that send to RPC | |
||||
|
||||
**Returns:** *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
payload object |
@ -0,0 +1,727 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[LogSub](logsub.md) / |
||||
|
||||
# Class: LogSub |
||||
|
||||
## Hierarchy |
||||
|
||||
* [SubscriptionMethod](subscriptionmethod.md) |
||||
|
||||
* **LogSub** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](logsub.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [connection](logsub.md#connection) |
||||
* [emitter](logsub.md#emitter) |
||||
* [handlers](logsub.md#handlers) |
||||
* [jsonRpc](logsub.md#jsonrpc) |
||||
* [messenger](logsub.md#messenger) |
||||
* [options](logsub.md#options) |
||||
* [param](logsub.md#param) |
||||
* [reqMiddleware](logsub.md#protected-reqmiddleware) |
||||
* [resMiddleware](logsub.md#protected-resmiddleware) |
||||
* [subscriptionId](logsub.md#subscriptionid) |
||||
* [subscriptions](logsub.md#subscriptions) |
||||
* [url](logsub.md#url) |
||||
|
||||
### Accessors |
||||
|
||||
* [connected](logsub.md#connected) |
||||
|
||||
### Methods |
||||
|
||||
* [addEventListener](logsub.md#addeventlistener) |
||||
* [clearSubscriptions](logsub.md#clearsubscriptions) |
||||
* [constructPayload](logsub.md#constructpayload) |
||||
* [createWebsocketProvider](logsub.md#createwebsocketprovider) |
||||
* [getMiddleware](logsub.md#protected-getmiddleware) |
||||
* [getSubscriptionEvent](logsub.md#getsubscriptionevent) |
||||
* [hasSubscription](logsub.md#hassubscription) |
||||
* [isConnecting](logsub.md#isconnecting) |
||||
* [on](logsub.md#on) |
||||
* [onClose](logsub.md#onclose) |
||||
* [onConnect](logsub.md#onconnect) |
||||
* [onData](logsub.md#ondata) |
||||
* [onError](logsub.md#onerror) |
||||
* [onMessage](logsub.md#onmessage) |
||||
* [onNewSubscriptionItem](logsub.md#onnewsubscriptionitem) |
||||
* [onReady](logsub.md#onready) |
||||
* [once](logsub.md#once) |
||||
* [pushMiddleware](logsub.md#protected-pushmiddleware) |
||||
* [reconnect](logsub.md#reconnect) |
||||
* [registerEventListeners](logsub.md#registereventlisteners) |
||||
* [removeAllSocketListeners](logsub.md#removeallsocketlisteners) |
||||
* [removeEventListener](logsub.md#removeeventlistener) |
||||
* [reset](logsub.md#reset) |
||||
* [resetHandlers](logsub.md#resethandlers) |
||||
* [send](logsub.md#send) |
||||
* [start](logsub.md#start) |
||||
* [subscribe](logsub.md#subscribe) |
||||
* [unsubscribe](logsub.md#unsubscribe) |
||||
* [validate](logsub.md#validate) |
||||
|
||||
### Object literals |
||||
|
||||
* [middlewares](logsub.md#middlewares) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new LogSub**(`options`: any, `messenger`: [Messenger](messenger.md)): *[LogSub](logsub.md)* |
||||
|
||||
*Overrides [SubscriptionMethod](subscriptionmethod.md).[constructor](subscriptionmethod.md#constructor)* |
||||
|
||||
*Defined in [subscriptions/LogSub.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/LogSub.ts#L5)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`options` | any | |
||||
`messenger` | [Messenger](messenger.md) | |
||||
|
||||
**Returns:** *[LogSub](logsub.md)* |
||||
|
||||
## Properties |
||||
|
||||
### connection |
||||
|
||||
• **connection**: *`W3CWebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[connection](wsprovider.md#connection)* |
||||
|
||||
*Defined in [providers/ws.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L22)* |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[emitter](basesocket.md#emitter)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L29)* |
||||
|
||||
___ |
||||
|
||||
### handlers |
||||
|
||||
• **handlers**: *any* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[handlers](basesocket.md#handlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L30)* |
||||
|
||||
___ |
||||
|
||||
### jsonRpc |
||||
|
||||
• **jsonRpc**: *[JsonRpc](jsonrpc.md)* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[jsonRpc](wsprovider.md#jsonrpc)* |
||||
|
||||
*Defined in [providers/ws.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *[Messenger](messenger.md)* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[messenger](subscriptionmethod.md#messenger)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### options |
||||
|
||||
• **options**: *any* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[options](subscriptionmethod.md#options)* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[options](wsprovider.md#options)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### param |
||||
|
||||
• **param**: *any* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[param](subscriptionmethod.md#param)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` reqMiddleware |
||||
|
||||
• **reqMiddleware**: *[ReqMiddleware](../README.md#reqmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[reqMiddleware](baseprovider.md#protected-reqmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` resMiddleware |
||||
|
||||
• **resMiddleware**: *[ResMiddleware](../README.md#resmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[resMiddleware](baseprovider.md#protected-resmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### subscriptionId |
||||
|
||||
• **subscriptionId**: *any* = null |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[subscriptionId](subscriptionmethod.md#subscriptionid)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### subscriptions |
||||
|
||||
• **subscriptions**: *any* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[subscriptions](wsprovider.md#subscriptions)* |
||||
|
||||
*Defined in [providers/ws.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L20)* |
||||
|
||||
___ |
||||
|
||||
### url |
||||
|
||||
• **url**: *string* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[url](wsprovider.md#url)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[url](basesocket.md#url)* |
||||
|
||||
*Defined in [providers/ws.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L19)* |
||||
|
||||
## Accessors |
||||
|
||||
### connected |
||||
|
||||
• **get connected**(): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[connected](wsprovider.md#connected)* |
||||
|
||||
*Defined in [providers/ws.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L15)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
## Methods |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[addEventListener](basesocket.md#addeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:51](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L51)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### clearSubscriptions |
||||
|
||||
▸ **clearSubscriptions**(`unsubscribeMethod`: string): *`Promise<boolean>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[clearSubscriptions](wsprovider.md#clearsubscriptions)* |
||||
|
||||
*Defined in [providers/ws.ts:166](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L166)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`unsubscribeMethod` | string | |
||||
|
||||
**Returns:** *`Promise<boolean>`* |
||||
|
||||
___ |
||||
|
||||
### constructPayload |
||||
|
||||
▸ **constructPayload**(`method`: string, `param`: any, `options?`: any): *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[constructPayload](subscriptionmethod.md#constructpayload)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L19)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | string | |
||||
`param` | any | |
||||
`options?` | any | |
||||
|
||||
**Returns:** *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
___ |
||||
|
||||
### createWebsocketProvider |
||||
|
||||
▸ **createWebsocketProvider**(`url`: string, `options`: any): *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[createWebsocketProvider](wsprovider.md#createwebsocketprovider)* |
||||
|
||||
*Defined in [providers/ws.ts:63](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L63)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`url` | string | - | |
||||
`options` | any | {} | |
||||
|
||||
**Returns:** *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
___ |
||||
|
||||
### `Protected` getMiddleware |
||||
|
||||
▸ **getMiddleware**(`method`: [RPCMethod](../enums/rpcmethod.md) | string): *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[getMiddleware](baseprovider.md#protected-getmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L47)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | |
||||
|
||||
**Returns:** *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
___ |
||||
|
||||
### getSubscriptionEvent |
||||
|
||||
▸ **getSubscriptionEvent**(`subscriptionId`: any): *any* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[getSubscriptionEvent](wsprovider.md#getsubscriptionevent)* |
||||
|
||||
*Defined in [providers/ws.ts:242](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L242)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### hasSubscription |
||||
|
||||
▸ **hasSubscription**(`subscriptionId`: string): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[hasSubscription](wsprovider.md#hassubscription)* |
||||
|
||||
*Defined in [providers/ws.ts:256](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L256)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isConnecting |
||||
|
||||
▸ **isConnecting**(): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[isConnecting](wsprovider.md#isconnecting)* |
||||
|
||||
*Defined in [providers/ws.ts:97](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L97)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### on |
||||
|
||||
▸ **on**(`type`: string, `handler`: `mitt.Handler`): *`this`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[on](wsprovider.md#on)* |
||||
|
||||
*Defined in [providers/ws.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L40)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onClose |
||||
|
||||
▸ **onClose**(`closeEvent`: any): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onClose](wsprovider.md#onclose)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onClose](basesocket.md#onclose)* |
||||
|
||||
*Defined in [providers/ws.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`closeEvent` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onConnect |
||||
|
||||
▸ **onConnect**(): *`Promise<void>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onConnect](wsprovider.md#onconnect)* |
||||
|
||||
*Defined in [providers/ws.ts:223](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L223)* |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### onData |
||||
|
||||
▸ **onData**(`handler`: any): *`this`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onData](wsprovider.md#ondata)* |
||||
|
||||
*Defined in [providers/ws.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L44)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`handler` | any | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`event`: any): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onError](wsprovider.md#onerror)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onError](basesocket.md#onerror)* |
||||
|
||||
*Defined in [providers/ws.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L48)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onMessage |
||||
|
||||
▸ **onMessage**(`msg`: `MessageEvent`): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onMessage](wsprovider.md#onmessage)* |
||||
|
||||
*Defined in [providers/ws.ts:195](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L195)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`msg` | `MessageEvent` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onNewSubscriptionItem |
||||
|
||||
▸ **onNewSubscriptionItem**(`subscriptionItem`: any): *any* |
||||
|
||||
*Overrides [SubscriptionMethod](subscriptionmethod.md).[onNewSubscriptionItem](subscriptionmethod.md#onnewsubscriptionitem)* |
||||
|
||||
*Defined in [subscriptions/LogSub.ts:43](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/LogSub.ts#L43)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionItem` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### onReady |
||||
|
||||
▸ **onReady**(`event`: any): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[onReady](basesocket.md#onready)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:78](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L78)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[once](basesocket.md#once)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L46)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### `Protected` pushMiddleware |
||||
|
||||
▸ **pushMiddleware**(`fn`: any, `type`: [MiddlewareType](../enums/middlewaretype.md), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[pushMiddleware](baseprovider.md#protected-pushmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L31)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fn` | any | |
||||
`type` | [MiddlewareType](../enums/middlewaretype.md) | |
||||
`match` | string \| [RPCMethod](../enums/rpcmethod.md) \| `RegExp` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reconnect |
||||
|
||||
▸ **reconnect**(): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[reconnect](wsprovider.md#reconnect)* |
||||
|
||||
*Defined in [providers/ws.ts:90](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L90)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### registerEventListeners |
||||
|
||||
▸ **registerEventListeners**(): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[registerEventListeners](wsprovider.md#registereventlisteners)* |
||||
|
||||
*Defined in [providers/ws.ts:187](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L187)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeAllSocketListeners |
||||
|
||||
▸ **removeAllSocketListeners**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeAllSocketListeners](basesocket.md#removeallsocketlisteners)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:70](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L70)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeEventListener](basesocket.md#removeeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reset |
||||
|
||||
▸ **reset**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[reset](basesocket.md#reset)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L66)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[resetHandlers](basesocket.md#resethandlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L39)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### send |
||||
|
||||
▸ **send**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*›): *`Promise<any>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[send](wsprovider.md#send)* |
||||
|
||||
*Defined in [providers/ws.ts:101](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L101)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### start |
||||
|
||||
▸ **start**(): *`Promise<this>`* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[start](subscriptionmethod.md#start)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L34)* |
||||
|
||||
**Returns:** *`Promise<this>`* |
||||
|
||||
___ |
||||
|
||||
### subscribe |
||||
|
||||
▸ **subscribe**(): *`Promise<this>`* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[subscribe](wsprovider.md#subscribe)* |
||||
|
||||
*Defined in [subscriptions/LogSub.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/LogSub.ts#L11)* |
||||
|
||||
**Returns:** *`Promise<this>`* |
||||
|
||||
___ |
||||
|
||||
### unsubscribe |
||||
|
||||
▸ **unsubscribe**(): *`Promise<any>`* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[unsubscribe](subscriptionmethod.md#unsubscribe)* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[unsubscribe](wsprovider.md#unsubscribe)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:59](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L59)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### validate |
||||
|
||||
▸ **validate**(`response`: any, `payload?`: any): *true | `Error`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[validate](wsprovider.md#validate)* |
||||
|
||||
*Defined in [providers/ws.ts:259](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L259)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`response` | any | |
||||
`payload?` | any | |
||||
|
||||
**Returns:** *true | `Error`* |
||||
|
||||
## Object literals |
||||
|
||||
### middlewares |
||||
|
||||
### ▪ **middlewares**: *object* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[middlewares](baseprovider.md#middlewares)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L5)* |
||||
|
||||
▪ **request**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L6)* |
||||
|
||||
* **use**(`fn`: [ReqMiddleware](../README.md#reqmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
▪ **response**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L11)* |
||||
|
||||
* **use**(`fn`: [ResMiddleware](../README.md#resmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
@ -0,0 +1,363 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[Messenger](messenger.md) / |
||||
|
||||
# Class: Messenger |
||||
|
||||
**`class`** Messenger |
||||
|
||||
**`description`** Messenger instance |
||||
|
||||
**`param`** HttpProvider |
||||
|
||||
**`param`** config object |
||||
|
||||
**`returns`** Messenger instance |
||||
|
||||
## Hierarchy |
||||
|
||||
* `HarmonyCore` |
||||
|
||||
* **Messenger** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](messenger.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [JsonRpc](messenger.md#jsonrpc) |
||||
* [Network_ID](messenger.md#network_id) |
||||
* [chainId](messenger.md#chainid) |
||||
* [chainPrefix](messenger.md#chainprefix) |
||||
* [chainType](messenger.md#chaintype) |
||||
* [config](messenger.md#optional-config) |
||||
* [getChainId](messenger.md#getchainid) |
||||
* [provider](messenger.md#provider) |
||||
|
||||
### Methods |
||||
|
||||
* [providerCheck](messenger.md#providercheck) |
||||
* [send](messenger.md#send) |
||||
* [setChainId](messenger.md#setchainid) |
||||
* [setChainType](messenger.md#setchaintype) |
||||
* [setNetworkID](messenger.md#setnetworkid) |
||||
* [setProvider](messenger.md#setprovider) |
||||
* [setRPCPrefix](messenger.md#setrpcprefix) |
||||
* [setReqMiddleware](messenger.md#setreqmiddleware) |
||||
* [setResMiddleware](messenger.md#setresmiddleware) |
||||
* [subscribe](messenger.md#subscribe) |
||||
* [unsubscribe](messenger.md#unsubscribe) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new Messenger**(`provider`: [HttpProvider](httpprovider.md) | [WSProvider](wsprovider.md), `chainType`: `ChainType`, `chainId`: `ChainID`, `config?`: undefined | object): *[Messenger](messenger.md)* |
||||
|
||||
*Overrides void* |
||||
|
||||
*Defined in [messenger/messenger.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L28)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`provider` | [HttpProvider](httpprovider.md) \| [WSProvider](wsprovider.md) | - | |
||||
`chainType` | `ChainType` | defaultConfig.Default.Chain_Type | |
||||
`chainId` | `ChainID` | defaultConfig.Default.Chain_ID | |
||||
`config?` | undefined \| object | - | |
||||
|
||||
**Returns:** *[Messenger](messenger.md)* |
||||
|
||||
## Properties |
||||
|
||||
### JsonRpc |
||||
|
||||
• **JsonRpc**: *[JsonRpc](jsonrpc.md)* |
||||
|
||||
*Defined in [messenger/messenger.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L28)* |
||||
|
||||
___ |
||||
|
||||
### Network_ID |
||||
|
||||
• **Network_ID**: *string* = "Default" |
||||
|
||||
*Defined in [messenger/messenger.ts:27](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L27)* |
||||
|
||||
___ |
||||
|
||||
### chainId |
||||
|
||||
• **chainId**: *`ChainID`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-utils/dist/chain.d.ts:35 |
||||
|
||||
___ |
||||
|
||||
### chainPrefix |
||||
|
||||
• **chainPrefix**: *string* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-utils/dist/chain.d.ts:37 |
||||
|
||||
___ |
||||
|
||||
### chainType |
||||
|
||||
• **chainType**: *`ChainType`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-utils/dist/chain.d.ts:34 |
||||
|
||||
___ |
||||
|
||||
### `Optional` config |
||||
|
||||
• **config**? : *undefined | object* |
||||
|
||||
*Defined in [messenger/messenger.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L25)* |
||||
|
||||
___ |
||||
|
||||
### getChainId |
||||
|
||||
• **getChainId**: *`ChainID`* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-utils/dist/chain.d.ts:38 |
||||
|
||||
___ |
||||
|
||||
### provider |
||||
|
||||
• **provider**: *[HttpProvider](httpprovider.md) | [WSProvider](wsprovider.md)* |
||||
|
||||
*Defined in [messenger/messenger.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L24)* |
||||
|
||||
## Methods |
||||
|
||||
### providerCheck |
||||
|
||||
▸ **providerCheck**(): *void* |
||||
|
||||
*Defined in [messenger/messenger.ts:119](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L119)* |
||||
|
||||
**`function`** providerCheck |
||||
|
||||
**`memberof`** Messenger |
||||
|
||||
**`description`** provider checker |
||||
|
||||
**Returns:** *void* |
||||
|
||||
provider validator |
||||
|
||||
___ |
||||
|
||||
### send |
||||
|
||||
▸ **send**(`method`: [RPCMethod](../enums/rpcmethod.md) | string, `params?`: string | any[] | undefined, `rpcPrefix?`: undefined | string): *`Promise<any>`* |
||||
|
||||
*Defined in [messenger/messenger.ts:74](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L74)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | RPC method | |
||||
`params?` | string \| any[] \| undefined | RPC method params | |
||||
`rpcPrefix?` | undefined \| string | - | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
RPC result |
||||
|
||||
___ |
||||
|
||||
### setChainId |
||||
|
||||
▸ **setChainId**(`chainId`: `ChainID`): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-utils/dist/chain.d.ts:39 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`chainId` | `ChainID` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setChainType |
||||
|
||||
▸ **setChainType**(`chainType`: `ChainType`): *void* |
||||
|
||||
*Inherited from void* |
||||
|
||||
Defined in /Users/suwei/dev/harmony-js/packages/harmony-utils/dist/chain.d.ts:40 |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`chainType` | `ChainType` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setNetworkID |
||||
|
||||
▸ **setNetworkID**(`id`: string): *void* |
||||
|
||||
*Defined in [messenger/messenger.ts:153](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L153)* |
||||
|
||||
**`function`** setNetworkID |
||||
|
||||
**`description`** set network id |
||||
|
||||
**`memberof`** Messenger |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`id` | string | network id string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setProvider |
||||
|
||||
▸ **setProvider**(`provider`: [HttpProvider](httpprovider.md) | [WSProvider](wsprovider.md)): *void* |
||||
|
||||
*Defined in [messenger/messenger.ts:109](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L109)* |
||||
|
||||
**`function`** setProvider |
||||
|
||||
**`memberof`** Messenger |
||||
|
||||
**`description`** provider setter |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Description | |
||||
------ | ------ | ------ | |
||||
`provider` | [HttpProvider](httpprovider.md) \| [WSProvider](wsprovider.md) | provider instance | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setRPCPrefix |
||||
|
||||
▸ **setRPCPrefix**(`method`: [RPCMethod](../enums/rpcmethod.md) | string, `prefix`: string): *string* |
||||
|
||||
*Defined in [messenger/messenger.ts:157](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L157)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | |
||||
`prefix` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### setReqMiddleware |
||||
|
||||
▸ **setReqMiddleware**(`middleware`: any, `method`: string): *void* |
||||
|
||||
*Defined in [messenger/messenger.ts:132](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L132)* |
||||
|
||||
**`function`** setReqMiddleware |
||||
|
||||
**`description`** set request middleware |
||||
|
||||
**`memberof`** Messenger |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | Description | |
||||
------ | ------ | ------ | ------ | |
||||
`middleware` | any | - | middle ware for req | |
||||
`method` | string | "*" | method name | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setResMiddleware |
||||
|
||||
▸ **setResMiddleware**(`middleware`: any, `method`: string): *void* |
||||
|
||||
*Defined in [messenger/messenger.ts:143](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L143)* |
||||
|
||||
**`function`** setResMiddleware |
||||
|
||||
**`description`** set response middleware |
||||
|
||||
**`memberof`** Messenger |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | Description | |
||||
------ | ------ | ------ | ------ | |
||||
`middleware` | any | - | middle ware for req | |
||||
`method` | string | "*" | method name | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### subscribe |
||||
|
||||
▸ **subscribe**(`method`: [RPCMethod](../enums/rpcmethod.md) | string, `params?`: string | any[] | undefined, `returnType`: [SubscribeReturns](../enums/subscribereturns.md), `rpcPrefix`: string): *`Promise<any>`* |
||||
|
||||
*Defined in [messenger/messenger.ts:166](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L166)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | - | |
||||
`params?` | string \| any[] \| undefined | - | |
||||
`returnType` | [SubscribeReturns](../enums/subscribereturns.md) | SubscribeReturns.all | |
||||
`rpcPrefix` | string | this.chainPrefix | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### unsubscribe |
||||
|
||||
▸ **unsubscribe**(`method`: [RPCMethod](../enums/rpcmethod.md) | string, `params?`: string | any[] | undefined, `rpcPrefix?`: undefined | string): *`Promise<any>`* |
||||
|
||||
*Defined in [messenger/messenger.ts:211](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/messenger.ts#L211)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | |
||||
`params?` | string \| any[] \| undefined | |
||||
`rpcPrefix?` | undefined \| string | |
||||
|
||||
**Returns:** *`Promise<any>`* |
@ -0,0 +1,732 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[NewHeaders](newheaders.md) / |
||||
|
||||
# Class: NewHeaders |
||||
|
||||
## Hierarchy |
||||
|
||||
* [SubscriptionMethod](subscriptionmethod.md) |
||||
|
||||
* **NewHeaders** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](newheaders.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [connection](newheaders.md#connection) |
||||
* [emitter](newheaders.md#emitter) |
||||
* [handlers](newheaders.md#handlers) |
||||
* [jsonRpc](newheaders.md#jsonrpc) |
||||
* [messenger](newheaders.md#messenger) |
||||
* [options](newheaders.md#options) |
||||
* [param](newheaders.md#param) |
||||
* [reqMiddleware](newheaders.md#protected-reqmiddleware) |
||||
* [resMiddleware](newheaders.md#protected-resmiddleware) |
||||
* [subscriptionId](newheaders.md#subscriptionid) |
||||
* [subscriptions](newheaders.md#subscriptions) |
||||
* [url](newheaders.md#url) |
||||
|
||||
### Accessors |
||||
|
||||
* [connected](newheaders.md#connected) |
||||
|
||||
### Methods |
||||
|
||||
* [addEventListener](newheaders.md#addeventlistener) |
||||
* [clearSubscriptions](newheaders.md#clearsubscriptions) |
||||
* [constructPayload](newheaders.md#constructpayload) |
||||
* [createWebsocketProvider](newheaders.md#createwebsocketprovider) |
||||
* [getMiddleware](newheaders.md#protected-getmiddleware) |
||||
* [getSubscriptionEvent](newheaders.md#getsubscriptionevent) |
||||
* [hasSubscription](newheaders.md#hassubscription) |
||||
* [isConnecting](newheaders.md#isconnecting) |
||||
* [on](newheaders.md#on) |
||||
* [onClose](newheaders.md#onclose) |
||||
* [onConnect](newheaders.md#onconnect) |
||||
* [onData](newheaders.md#ondata) |
||||
* [onError](newheaders.md#onerror) |
||||
* [onMessage](newheaders.md#onmessage) |
||||
* [onNewSubscriptionItem](newheaders.md#onnewsubscriptionitem) |
||||
* [onReady](newheaders.md#onready) |
||||
* [once](newheaders.md#once) |
||||
* [pushMiddleware](newheaders.md#protected-pushmiddleware) |
||||
* [reconnect](newheaders.md#reconnect) |
||||
* [registerEventListeners](newheaders.md#registereventlisteners) |
||||
* [removeAllSocketListeners](newheaders.md#removeallsocketlisteners) |
||||
* [removeEventListener](newheaders.md#removeeventlistener) |
||||
* [reset](newheaders.md#reset) |
||||
* [resetHandlers](newheaders.md#resethandlers) |
||||
* [send](newheaders.md#send) |
||||
* [start](newheaders.md#start) |
||||
* [subscribe](newheaders.md#subscribe) |
||||
* [unsubscribe](newheaders.md#unsubscribe) |
||||
* [validate](newheaders.md#validate) |
||||
|
||||
### Object literals |
||||
|
||||
* [middlewares](newheaders.md#middlewares) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new NewHeaders**(`messenger`: [Messenger](messenger.md)): *[NewHeaders](newheaders.md)* |
||||
|
||||
*Overrides [SubscriptionMethod](subscriptionmethod.md).[constructor](subscriptionmethod.md#constructor)* |
||||
|
||||
*Defined in [subscriptions/NewHeadersSub.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/NewHeadersSub.ts#L4)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`messenger` | [Messenger](messenger.md) | |
||||
|
||||
**Returns:** *[NewHeaders](newheaders.md)* |
||||
|
||||
## Properties |
||||
|
||||
### connection |
||||
|
||||
• **connection**: *`W3CWebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[connection](wsprovider.md#connection)* |
||||
|
||||
*Defined in [providers/ws.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L22)* |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[emitter](basesocket.md#emitter)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L29)* |
||||
|
||||
___ |
||||
|
||||
### handlers |
||||
|
||||
• **handlers**: *any* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[handlers](basesocket.md#handlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L30)* |
||||
|
||||
___ |
||||
|
||||
### jsonRpc |
||||
|
||||
• **jsonRpc**: *[JsonRpc](jsonrpc.md)* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[jsonRpc](wsprovider.md#jsonrpc)* |
||||
|
||||
*Defined in [providers/ws.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *[Messenger](messenger.md)* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[messenger](subscriptionmethod.md#messenger)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### options |
||||
|
||||
• **options**: *any* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[options](subscriptionmethod.md#options)* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[options](wsprovider.md#options)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### param |
||||
|
||||
• **param**: *any* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[param](subscriptionmethod.md#param)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` reqMiddleware |
||||
|
||||
• **reqMiddleware**: *[ReqMiddleware](../README.md#reqmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[reqMiddleware](baseprovider.md#protected-reqmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` resMiddleware |
||||
|
||||
• **resMiddleware**: *[ResMiddleware](../README.md#resmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[resMiddleware](baseprovider.md#protected-resmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### subscriptionId |
||||
|
||||
• **subscriptionId**: *any* = null |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[subscriptionId](subscriptionmethod.md#subscriptionid)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### subscriptions |
||||
|
||||
• **subscriptions**: *any* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[subscriptions](wsprovider.md#subscriptions)* |
||||
|
||||
*Defined in [providers/ws.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L20)* |
||||
|
||||
___ |
||||
|
||||
### url |
||||
|
||||
• **url**: *string* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[url](wsprovider.md#url)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[url](basesocket.md#url)* |
||||
|
||||
*Defined in [providers/ws.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L19)* |
||||
|
||||
## Accessors |
||||
|
||||
### connected |
||||
|
||||
• **get connected**(): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[connected](wsprovider.md#connected)* |
||||
|
||||
*Defined in [providers/ws.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L15)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
## Methods |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[addEventListener](basesocket.md#addeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:51](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L51)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### clearSubscriptions |
||||
|
||||
▸ **clearSubscriptions**(`unsubscribeMethod`: string): *`Promise<boolean>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[clearSubscriptions](wsprovider.md#clearsubscriptions)* |
||||
|
||||
*Defined in [providers/ws.ts:166](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L166)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`unsubscribeMethod` | string | |
||||
|
||||
**Returns:** *`Promise<boolean>`* |
||||
|
||||
___ |
||||
|
||||
### constructPayload |
||||
|
||||
▸ **constructPayload**(`method`: string, `param`: any, `options?`: any): *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[constructPayload](subscriptionmethod.md#constructpayload)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L19)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | string | |
||||
`param` | any | |
||||
`options?` | any | |
||||
|
||||
**Returns:** *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
___ |
||||
|
||||
### createWebsocketProvider |
||||
|
||||
▸ **createWebsocketProvider**(`url`: string, `options`: any): *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[createWebsocketProvider](wsprovider.md#createwebsocketprovider)* |
||||
|
||||
*Defined in [providers/ws.ts:63](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L63)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`url` | string | - | |
||||
`options` | any | {} | |
||||
|
||||
**Returns:** *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
___ |
||||
|
||||
### `Protected` getMiddleware |
||||
|
||||
▸ **getMiddleware**(`method`: [RPCMethod](../enums/rpcmethod.md) | string): *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[getMiddleware](baseprovider.md#protected-getmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L47)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | |
||||
|
||||
**Returns:** *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
___ |
||||
|
||||
### getSubscriptionEvent |
||||
|
||||
▸ **getSubscriptionEvent**(`subscriptionId`: any): *any* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[getSubscriptionEvent](wsprovider.md#getsubscriptionevent)* |
||||
|
||||
*Defined in [providers/ws.ts:242](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L242)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### hasSubscription |
||||
|
||||
▸ **hasSubscription**(`subscriptionId`: string): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[hasSubscription](wsprovider.md#hassubscription)* |
||||
|
||||
*Defined in [providers/ws.ts:256](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L256)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isConnecting |
||||
|
||||
▸ **isConnecting**(): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[isConnecting](wsprovider.md#isconnecting)* |
||||
|
||||
*Defined in [providers/ws.ts:97](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L97)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### on |
||||
|
||||
▸ **on**(`type`: string, `handler`: `mitt.Handler`): *`this`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[on](wsprovider.md#on)* |
||||
|
||||
*Defined in [providers/ws.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L40)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onClose |
||||
|
||||
▸ **onClose**(`closeEvent`: any): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onClose](wsprovider.md#onclose)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onClose](basesocket.md#onclose)* |
||||
|
||||
*Defined in [providers/ws.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`closeEvent` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onConnect |
||||
|
||||
▸ **onConnect**(): *`Promise<void>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onConnect](wsprovider.md#onconnect)* |
||||
|
||||
*Defined in [providers/ws.ts:223](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L223)* |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### onData |
||||
|
||||
▸ **onData**(`handler`: any): *`this`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onData](wsprovider.md#ondata)* |
||||
|
||||
*Defined in [providers/ws.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L44)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`handler` | any | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`event`: any): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onError](wsprovider.md#onerror)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onError](basesocket.md#onerror)* |
||||
|
||||
*Defined in [providers/ws.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L48)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onMessage |
||||
|
||||
▸ **onMessage**(`msg`: `MessageEvent`): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onMessage](wsprovider.md#onmessage)* |
||||
|
||||
*Defined in [providers/ws.ts:195](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L195)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`msg` | `MessageEvent` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onNewSubscriptionItem |
||||
|
||||
▸ **onNewSubscriptionItem**(`subscriptionItem`: any): *any* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[onNewSubscriptionItem](subscriptionmethod.md#onnewsubscriptionitem)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L66)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionItem` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### onReady |
||||
|
||||
▸ **onReady**(`event`: any): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[onReady](basesocket.md#onready)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:78](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L78)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[once](basesocket.md#once)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L46)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### `Protected` pushMiddleware |
||||
|
||||
▸ **pushMiddleware**(`fn`: any, `type`: [MiddlewareType](../enums/middlewaretype.md), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[pushMiddleware](baseprovider.md#protected-pushmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L31)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fn` | any | |
||||
`type` | [MiddlewareType](../enums/middlewaretype.md) | |
||||
`match` | string \| [RPCMethod](../enums/rpcmethod.md) \| `RegExp` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reconnect |
||||
|
||||
▸ **reconnect**(): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[reconnect](wsprovider.md#reconnect)* |
||||
|
||||
*Defined in [providers/ws.ts:90](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L90)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### registerEventListeners |
||||
|
||||
▸ **registerEventListeners**(): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[registerEventListeners](wsprovider.md#registereventlisteners)* |
||||
|
||||
*Defined in [providers/ws.ts:187](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L187)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeAllSocketListeners |
||||
|
||||
▸ **removeAllSocketListeners**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeAllSocketListeners](basesocket.md#removeallsocketlisteners)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:70](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L70)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeEventListener](basesocket.md#removeeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reset |
||||
|
||||
▸ **reset**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[reset](basesocket.md#reset)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L66)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[resetHandlers](basesocket.md#resethandlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L39)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### send |
||||
|
||||
▸ **send**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*›): *`Promise<any>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[send](wsprovider.md#send)* |
||||
|
||||
*Defined in [providers/ws.ts:101](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L101)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### start |
||||
|
||||
▸ **start**(): *`Promise<this>`* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[start](subscriptionmethod.md#start)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L34)* |
||||
|
||||
**Returns:** *`Promise<this>`* |
||||
|
||||
___ |
||||
|
||||
### subscribe |
||||
|
||||
▸ **subscribe**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*›): *`Promise<any>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[subscribe](wsprovider.md#subscribe)* |
||||
|
||||
*Defined in [providers/ws.ts:131](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L131)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### unsubscribe |
||||
|
||||
▸ **unsubscribe**(): *`Promise<any>`* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[unsubscribe](subscriptionmethod.md#unsubscribe)* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[unsubscribe](wsprovider.md#unsubscribe)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:59](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L59)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### validate |
||||
|
||||
▸ **validate**(`response`: any, `payload?`: any): *true | `Error`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[validate](wsprovider.md#validate)* |
||||
|
||||
*Defined in [providers/ws.ts:259](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L259)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`response` | any | |
||||
`payload?` | any | |
||||
|
||||
**Returns:** *true | `Error`* |
||||
|
||||
## Object literals |
||||
|
||||
### middlewares |
||||
|
||||
### ▪ **middlewares**: *object* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[middlewares](baseprovider.md#middlewares)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L5)* |
||||
|
||||
▪ **request**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L6)* |
||||
|
||||
* **use**(`fn`: [ReqMiddleware](../README.md#reqmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
▪ **response**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L11)* |
||||
|
||||
* **use**(`fn`: [ResMiddleware](../README.md#resmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
@ -0,0 +1,732 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[NewPendingTransactions](newpendingtransactions.md) / |
||||
|
||||
# Class: NewPendingTransactions |
||||
|
||||
## Hierarchy |
||||
|
||||
* [SubscriptionMethod](subscriptionmethod.md) |
||||
|
||||
* **NewPendingTransactions** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](newpendingtransactions.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [connection](newpendingtransactions.md#connection) |
||||
* [emitter](newpendingtransactions.md#emitter) |
||||
* [handlers](newpendingtransactions.md#handlers) |
||||
* [jsonRpc](newpendingtransactions.md#jsonrpc) |
||||
* [messenger](newpendingtransactions.md#messenger) |
||||
* [options](newpendingtransactions.md#options) |
||||
* [param](newpendingtransactions.md#param) |
||||
* [reqMiddleware](newpendingtransactions.md#protected-reqmiddleware) |
||||
* [resMiddleware](newpendingtransactions.md#protected-resmiddleware) |
||||
* [subscriptionId](newpendingtransactions.md#subscriptionid) |
||||
* [subscriptions](newpendingtransactions.md#subscriptions) |
||||
* [url](newpendingtransactions.md#url) |
||||
|
||||
### Accessors |
||||
|
||||
* [connected](newpendingtransactions.md#connected) |
||||
|
||||
### Methods |
||||
|
||||
* [addEventListener](newpendingtransactions.md#addeventlistener) |
||||
* [clearSubscriptions](newpendingtransactions.md#clearsubscriptions) |
||||
* [constructPayload](newpendingtransactions.md#constructpayload) |
||||
* [createWebsocketProvider](newpendingtransactions.md#createwebsocketprovider) |
||||
* [getMiddleware](newpendingtransactions.md#protected-getmiddleware) |
||||
* [getSubscriptionEvent](newpendingtransactions.md#getsubscriptionevent) |
||||
* [hasSubscription](newpendingtransactions.md#hassubscription) |
||||
* [isConnecting](newpendingtransactions.md#isconnecting) |
||||
* [on](newpendingtransactions.md#on) |
||||
* [onClose](newpendingtransactions.md#onclose) |
||||
* [onConnect](newpendingtransactions.md#onconnect) |
||||
* [onData](newpendingtransactions.md#ondata) |
||||
* [onError](newpendingtransactions.md#onerror) |
||||
* [onMessage](newpendingtransactions.md#onmessage) |
||||
* [onNewSubscriptionItem](newpendingtransactions.md#onnewsubscriptionitem) |
||||
* [onReady](newpendingtransactions.md#onready) |
||||
* [once](newpendingtransactions.md#once) |
||||
* [pushMiddleware](newpendingtransactions.md#protected-pushmiddleware) |
||||
* [reconnect](newpendingtransactions.md#reconnect) |
||||
* [registerEventListeners](newpendingtransactions.md#registereventlisteners) |
||||
* [removeAllSocketListeners](newpendingtransactions.md#removeallsocketlisteners) |
||||
* [removeEventListener](newpendingtransactions.md#removeeventlistener) |
||||
* [reset](newpendingtransactions.md#reset) |
||||
* [resetHandlers](newpendingtransactions.md#resethandlers) |
||||
* [send](newpendingtransactions.md#send) |
||||
* [start](newpendingtransactions.md#start) |
||||
* [subscribe](newpendingtransactions.md#subscribe) |
||||
* [unsubscribe](newpendingtransactions.md#unsubscribe) |
||||
* [validate](newpendingtransactions.md#validate) |
||||
|
||||
### Object literals |
||||
|
||||
* [middlewares](newpendingtransactions.md#middlewares) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new NewPendingTransactions**(`messenger`: [Messenger](messenger.md)): *[NewPendingTransactions](newpendingtransactions.md)* |
||||
|
||||
*Overrides [SubscriptionMethod](subscriptionmethod.md).[constructor](subscriptionmethod.md#constructor)* |
||||
|
||||
*Defined in [subscriptions/NewPendingTransactionsSub.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/NewPendingTransactionsSub.ts#L4)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`messenger` | [Messenger](messenger.md) | |
||||
|
||||
**Returns:** *[NewPendingTransactions](newpendingtransactions.md)* |
||||
|
||||
## Properties |
||||
|
||||
### connection |
||||
|
||||
• **connection**: *`W3CWebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[connection](wsprovider.md#connection)* |
||||
|
||||
*Defined in [providers/ws.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L22)* |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[emitter](basesocket.md#emitter)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L29)* |
||||
|
||||
___ |
||||
|
||||
### handlers |
||||
|
||||
• **handlers**: *any* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[handlers](basesocket.md#handlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L30)* |
||||
|
||||
___ |
||||
|
||||
### jsonRpc |
||||
|
||||
• **jsonRpc**: *[JsonRpc](jsonrpc.md)* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[jsonRpc](wsprovider.md#jsonrpc)* |
||||
|
||||
*Defined in [providers/ws.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *[Messenger](messenger.md)* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[messenger](subscriptionmethod.md#messenger)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### options |
||||
|
||||
• **options**: *any* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[options](subscriptionmethod.md#options)* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[options](wsprovider.md#options)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### param |
||||
|
||||
• **param**: *any* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[param](subscriptionmethod.md#param)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` reqMiddleware |
||||
|
||||
• **reqMiddleware**: *[ReqMiddleware](../README.md#reqmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[reqMiddleware](baseprovider.md#protected-reqmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` resMiddleware |
||||
|
||||
• **resMiddleware**: *[ResMiddleware](../README.md#resmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[resMiddleware](baseprovider.md#protected-resmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### subscriptionId |
||||
|
||||
• **subscriptionId**: *any* = null |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[subscriptionId](subscriptionmethod.md#subscriptionid)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### subscriptions |
||||
|
||||
• **subscriptions**: *any* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[subscriptions](wsprovider.md#subscriptions)* |
||||
|
||||
*Defined in [providers/ws.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L20)* |
||||
|
||||
___ |
||||
|
||||
### url |
||||
|
||||
• **url**: *string* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[url](wsprovider.md#url)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[url](basesocket.md#url)* |
||||
|
||||
*Defined in [providers/ws.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L19)* |
||||
|
||||
## Accessors |
||||
|
||||
### connected |
||||
|
||||
• **get connected**(): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[connected](wsprovider.md#connected)* |
||||
|
||||
*Defined in [providers/ws.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L15)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
## Methods |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[addEventListener](basesocket.md#addeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:51](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L51)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### clearSubscriptions |
||||
|
||||
▸ **clearSubscriptions**(`unsubscribeMethod`: string): *`Promise<boolean>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[clearSubscriptions](wsprovider.md#clearsubscriptions)* |
||||
|
||||
*Defined in [providers/ws.ts:166](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L166)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`unsubscribeMethod` | string | |
||||
|
||||
**Returns:** *`Promise<boolean>`* |
||||
|
||||
___ |
||||
|
||||
### constructPayload |
||||
|
||||
▸ **constructPayload**(`method`: string, `param`: any, `options?`: any): *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[constructPayload](subscriptionmethod.md#constructpayload)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L19)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | string | |
||||
`param` | any | |
||||
`options?` | any | |
||||
|
||||
**Returns:** *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
___ |
||||
|
||||
### createWebsocketProvider |
||||
|
||||
▸ **createWebsocketProvider**(`url`: string, `options`: any): *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[createWebsocketProvider](wsprovider.md#createwebsocketprovider)* |
||||
|
||||
*Defined in [providers/ws.ts:63](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L63)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`url` | string | - | |
||||
`options` | any | {} | |
||||
|
||||
**Returns:** *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
___ |
||||
|
||||
### `Protected` getMiddleware |
||||
|
||||
▸ **getMiddleware**(`method`: [RPCMethod](../enums/rpcmethod.md) | string): *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[getMiddleware](baseprovider.md#protected-getmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L47)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | |
||||
|
||||
**Returns:** *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
___ |
||||
|
||||
### getSubscriptionEvent |
||||
|
||||
▸ **getSubscriptionEvent**(`subscriptionId`: any): *any* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[getSubscriptionEvent](wsprovider.md#getsubscriptionevent)* |
||||
|
||||
*Defined in [providers/ws.ts:242](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L242)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### hasSubscription |
||||
|
||||
▸ **hasSubscription**(`subscriptionId`: string): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[hasSubscription](wsprovider.md#hassubscription)* |
||||
|
||||
*Defined in [providers/ws.ts:256](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L256)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isConnecting |
||||
|
||||
▸ **isConnecting**(): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[isConnecting](wsprovider.md#isconnecting)* |
||||
|
||||
*Defined in [providers/ws.ts:97](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L97)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### on |
||||
|
||||
▸ **on**(`type`: string, `handler`: `mitt.Handler`): *`this`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[on](wsprovider.md#on)* |
||||
|
||||
*Defined in [providers/ws.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L40)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onClose |
||||
|
||||
▸ **onClose**(`closeEvent`: any): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onClose](wsprovider.md#onclose)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onClose](basesocket.md#onclose)* |
||||
|
||||
*Defined in [providers/ws.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`closeEvent` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onConnect |
||||
|
||||
▸ **onConnect**(): *`Promise<void>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onConnect](wsprovider.md#onconnect)* |
||||
|
||||
*Defined in [providers/ws.ts:223](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L223)* |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### onData |
||||
|
||||
▸ **onData**(`handler`: any): *`this`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onData](wsprovider.md#ondata)* |
||||
|
||||
*Defined in [providers/ws.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L44)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`handler` | any | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`event`: any): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onError](wsprovider.md#onerror)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onError](basesocket.md#onerror)* |
||||
|
||||
*Defined in [providers/ws.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L48)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onMessage |
||||
|
||||
▸ **onMessage**(`msg`: `MessageEvent`): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onMessage](wsprovider.md#onmessage)* |
||||
|
||||
*Defined in [providers/ws.ts:195](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L195)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`msg` | `MessageEvent` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onNewSubscriptionItem |
||||
|
||||
▸ **onNewSubscriptionItem**(`subscriptionItem`: any): *any* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[onNewSubscriptionItem](subscriptionmethod.md#onnewsubscriptionitem)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L66)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionItem` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### onReady |
||||
|
||||
▸ **onReady**(`event`: any): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[onReady](basesocket.md#onready)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:78](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L78)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[once](basesocket.md#once)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L46)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### `Protected` pushMiddleware |
||||
|
||||
▸ **pushMiddleware**(`fn`: any, `type`: [MiddlewareType](../enums/middlewaretype.md), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[pushMiddleware](baseprovider.md#protected-pushmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L31)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fn` | any | |
||||
`type` | [MiddlewareType](../enums/middlewaretype.md) | |
||||
`match` | string \| [RPCMethod](../enums/rpcmethod.md) \| `RegExp` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reconnect |
||||
|
||||
▸ **reconnect**(): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[reconnect](wsprovider.md#reconnect)* |
||||
|
||||
*Defined in [providers/ws.ts:90](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L90)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### registerEventListeners |
||||
|
||||
▸ **registerEventListeners**(): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[registerEventListeners](wsprovider.md#registereventlisteners)* |
||||
|
||||
*Defined in [providers/ws.ts:187](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L187)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeAllSocketListeners |
||||
|
||||
▸ **removeAllSocketListeners**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeAllSocketListeners](basesocket.md#removeallsocketlisteners)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:70](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L70)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeEventListener](basesocket.md#removeeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reset |
||||
|
||||
▸ **reset**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[reset](basesocket.md#reset)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L66)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[resetHandlers](basesocket.md#resethandlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L39)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### send |
||||
|
||||
▸ **send**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*›): *`Promise<any>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[send](wsprovider.md#send)* |
||||
|
||||
*Defined in [providers/ws.ts:101](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L101)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### start |
||||
|
||||
▸ **start**(): *`Promise<this>`* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[start](subscriptionmethod.md#start)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L34)* |
||||
|
||||
**Returns:** *`Promise<this>`* |
||||
|
||||
___ |
||||
|
||||
### subscribe |
||||
|
||||
▸ **subscribe**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*›): *`Promise<any>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[subscribe](wsprovider.md#subscribe)* |
||||
|
||||
*Defined in [providers/ws.ts:131](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L131)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### unsubscribe |
||||
|
||||
▸ **unsubscribe**(): *`Promise<any>`* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[unsubscribe](subscriptionmethod.md#unsubscribe)* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[unsubscribe](wsprovider.md#unsubscribe)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:59](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L59)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### validate |
||||
|
||||
▸ **validate**(`response`: any, `payload?`: any): *true | `Error`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[validate](wsprovider.md#validate)* |
||||
|
||||
*Defined in [providers/ws.ts:259](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L259)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`response` | any | |
||||
`payload?` | any | |
||||
|
||||
**Returns:** *true | `Error`* |
||||
|
||||
## Object literals |
||||
|
||||
### middlewares |
||||
|
||||
### ▪ **middlewares**: *object* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[middlewares](baseprovider.md#middlewares)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L5)* |
||||
|
||||
▪ **request**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L6)* |
||||
|
||||
* **use**(`fn`: [ReqMiddleware](../README.md#reqmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
▪ **response**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L11)* |
||||
|
||||
* **use**(`fn`: [ResMiddleware](../README.md#resmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
@ -0,0 +1,699 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[PollingBlockTracker](pollingblocktracker.md) / |
||||
|
||||
# Class: PollingBlockTracker |
||||
|
||||
## Hierarchy |
||||
|
||||
* [BaseBlockTracker](baseblocktracker.md) |
||||
|
||||
* **PollingBlockTracker** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](pollingblocktracker.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [_blockResetDuration](pollingblocktracker.md#optional-_blockresetduration) |
||||
* [_blockResetTimeout](pollingblocktracker.md#_blockresettimeout) |
||||
* [_currentBlock](pollingblocktracker.md#_currentblock) |
||||
* [_isRunning](pollingblocktracker.md#_isrunning) |
||||
* [_keepEventLoopActive](pollingblocktracker.md#_keepeventloopactive) |
||||
* [_pollingInterval](pollingblocktracker.md#_pollinginterval) |
||||
* [_retryTimeout](pollingblocktracker.md#_retrytimeout) |
||||
* [_setSkipCacheFlag](pollingblocktracker.md#_setskipcacheflag) |
||||
* [emit](pollingblocktracker.md#emit) |
||||
* [emitter](pollingblocktracker.md#emitter) |
||||
* [handlers](pollingblocktracker.md#optional-handlers) |
||||
* [messenger](pollingblocktracker.md#messenger) |
||||
* [off](pollingblocktracker.md#off) |
||||
* [promise](pollingblocktracker.md#promise) |
||||
* [reject](pollingblocktracker.md#optional-reject) |
||||
* [resolve](pollingblocktracker.md#optional-resolve) |
||||
* [then](pollingblocktracker.md#optional-then) |
||||
|
||||
### Methods |
||||
|
||||
* [_cancelBlockResetTimeout](pollingblocktracker.md#_cancelblockresettimeout) |
||||
* [_end](pollingblocktracker.md#_end) |
||||
* [_fetchLatestBlock](pollingblocktracker.md#_fetchlatestblock) |
||||
* [_getBlockTrackerEventCount](pollingblocktracker.md#_getblocktrackereventcount) |
||||
* [_maybeEnd](pollingblocktracker.md#_maybeend) |
||||
* [_maybeStart](pollingblocktracker.md#_maybestart) |
||||
* [_newPotentialLatest](pollingblocktracker.md#_newpotentiallatest) |
||||
* [_onNewListener](pollingblocktracker.md#_onnewlistener) |
||||
* [_onRemoveListener](pollingblocktracker.md#_onremovelistener) |
||||
* [_performSync](pollingblocktracker.md#_performsync) |
||||
* [_resetCurrentBlock](pollingblocktracker.md#_resetcurrentblock) |
||||
* [_setCurrentBlock](pollingblocktracker.md#_setcurrentblock) |
||||
* [_setupBlockResetTimeout](pollingblocktracker.md#_setupblockresettimeout) |
||||
* [_setupInternalEvents](pollingblocktracker.md#_setupinternalevents) |
||||
* [_start](pollingblocktracker.md#_start) |
||||
* [_updateLatestBlock](pollingblocktracker.md#_updatelatestblock) |
||||
* [addEventListener](pollingblocktracker.md#addeventlistener) |
||||
* [checkForLatestBlock](pollingblocktracker.md#checkforlatestblock) |
||||
* [getCurrentBlock](pollingblocktracker.md#getcurrentblock) |
||||
* [getLatestBlock](pollingblocktracker.md#getlatestblock) |
||||
* [isRunning](pollingblocktracker.md#isrunning) |
||||
* [listenerCount](pollingblocktracker.md#listenercount) |
||||
* [on](pollingblocktracker.md#on) |
||||
* [onData](pollingblocktracker.md#ondata) |
||||
* [onError](pollingblocktracker.md#onerror) |
||||
* [once](pollingblocktracker.md#once) |
||||
* [removeAllListeners](pollingblocktracker.md#removealllisteners) |
||||
* [removeEventListener](pollingblocktracker.md#removeeventlistener) |
||||
* [resetHandlers](pollingblocktracker.md#resethandlers) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new PollingBlockTracker**(`messenger`: [Messenger](messenger.md), `opts`: object): *[PollingBlockTracker](pollingblocktracker.md)* |
||||
|
||||
*Overrides [BaseBlockTracker](baseblocktracker.md).[constructor](baseblocktracker.md#constructor)* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L25)* |
||||
|
||||
**Parameters:** |
||||
|
||||
▪ **messenger**: *[Messenger](messenger.md)* |
||||
|
||||
▪`Default value` **opts**: *object*= { |
||||
pollingInterval: undefined, |
||||
retryTimeout: undefined, |
||||
keepEventLoopActive: false, |
||||
setSkipCacheFlag: false, |
||||
} |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`keepEventLoopActive` | boolean | false | |
||||
`pollingInterval` | undefined | undefined | |
||||
`retryTimeout` | undefined | undefined | |
||||
`setSkipCacheFlag` | boolean | false | |
||||
|
||||
**Returns:** *[PollingBlockTracker](pollingblocktracker.md)* |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` _blockResetDuration |
||||
|
||||
• **_blockResetDuration**? : *undefined | number* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_blockResetDuration](baseblocktracker.md#optional-_blockresetduration)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L12)* |
||||
|
||||
___ |
||||
|
||||
### _blockResetTimeout |
||||
|
||||
• **_blockResetTimeout**: *any* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_blockResetTimeout](baseblocktracker.md#_blockresettimeout)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L14)* |
||||
|
||||
___ |
||||
|
||||
### _currentBlock |
||||
|
||||
• **_currentBlock**: *any* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_currentBlock](baseblocktracker.md#_currentblock)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L16)* |
||||
|
||||
___ |
||||
|
||||
### _isRunning |
||||
|
||||
• **_isRunning**: *boolean* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_isRunning](baseblocktracker.md#_isrunning)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### _keepEventLoopActive |
||||
|
||||
• **_keepEventLoopActive**: *boolean* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### _pollingInterval |
||||
|
||||
• **_pollingInterval**: *number* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### _retryTimeout |
||||
|
||||
• **_retryTimeout**: *number* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L21)* |
||||
|
||||
___ |
||||
|
||||
### _setSkipCacheFlag |
||||
|
||||
• **_setSkipCacheFlag**: *boolean* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L25)* |
||||
|
||||
___ |
||||
|
||||
### emit |
||||
|
||||
• **emit**: *function* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[emit](emitter.md#emit)* |
||||
|
||||
*Defined in [providers/emitter.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L7)* |
||||
|
||||
#### Type declaration: |
||||
|
||||
▸ (`type`: string, `event?`: any): *void* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`event?` | any | |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[emitter](emitter.md#emitter)* |
||||
|
||||
*Defined in [providers/emitter.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` handlers |
||||
|
||||
• **handlers**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[handlers](emitter.md#optional-handlers)* |
||||
|
||||
*Defined in [providers/emitter.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L4)* |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *[Messenger](messenger.md)* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L17)* |
||||
|
||||
___ |
||||
|
||||
### off |
||||
|
||||
• **off**: *function* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[off](emitter.md#off)* |
||||
|
||||
*Defined in [providers/emitter.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L6)* |
||||
|
||||
#### Type declaration: |
||||
|
||||
▸ (`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
___ |
||||
|
||||
### promise |
||||
|
||||
• **promise**: *`Promise<__type>`* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[promise](emitter.md#promise)* |
||||
|
||||
*Defined in [providers/emitter.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` reject |
||||
|
||||
• **reject**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[reject](emitter.md#optional-reject)* |
||||
|
||||
*Defined in [providers/emitter.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L10)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` resolve |
||||
|
||||
• **resolve**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[resolve](emitter.md#optional-resolve)* |
||||
|
||||
*Defined in [providers/emitter.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` then |
||||
|
||||
• **then**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[then](emitter.md#optional-then)* |
||||
|
||||
*Defined in [providers/emitter.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L11)* |
||||
|
||||
## Methods |
||||
|
||||
### _cancelBlockResetTimeout |
||||
|
||||
▸ **_cancelBlockResetTimeout**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_cancelBlockResetTimeout](baseblocktracker.md#_cancelblockresettimeout)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:182](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L182)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _end |
||||
|
||||
▸ **_end**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_end](baseblocktracker.md#_end)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:87](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L87)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _fetchLatestBlock |
||||
|
||||
▸ **_fetchLatestBlock**(): *`Promise<any>`* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:106](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L106)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### _getBlockTrackerEventCount |
||||
|
||||
▸ **_getBlockTrackerEventCount**(): *number* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_getBlockTrackerEventCount](baseblocktracker.md#_getblocktrackereventcount)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:141](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L141)* |
||||
|
||||
**Returns:** *number* |
||||
|
||||
___ |
||||
|
||||
### _maybeEnd |
||||
|
||||
▸ **_maybeEnd**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_maybeEnd](baseblocktracker.md#_maybeend)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:132](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L132)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _maybeStart |
||||
|
||||
▸ **_maybeStart**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_maybeStart](baseblocktracker.md#_maybestart)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:122](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L122)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _newPotentialLatest |
||||
|
||||
▸ **_newPotentialLatest**(`newBlock`: string): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_newPotentialLatest](baseblocktracker.md#_newpotentiallatest)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:147](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L147)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`newBlock` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _onNewListener |
||||
|
||||
▸ **_onNewListener**(`eventName`: string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_onNewListener](baseblocktracker.md#_onnewlistener)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:105](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L105)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`eventName` | string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _onRemoveListener |
||||
|
||||
▸ **_onRemoveListener**(`eventName`: string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_onRemoveListener](baseblocktracker.md#_onremovelistener)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:114](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L114)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`eventName` | string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _performSync |
||||
|
||||
▸ **_performSync**(): *`Promise<void>`* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:79](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L79)* |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### _resetCurrentBlock |
||||
|
||||
▸ **_resetCurrentBlock**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_resetCurrentBlock](baseblocktracker.md#_resetcurrentblock)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:186](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L186)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _setCurrentBlock |
||||
|
||||
▸ **_setCurrentBlock**(`newBlock`: string): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_setCurrentBlock](baseblocktracker.md#_setcurrentblock)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:161](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L161)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`newBlock` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _setupBlockResetTimeout |
||||
|
||||
▸ **_setupBlockResetTimeout**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_setupBlockResetTimeout](baseblocktracker.md#_setupblockresettimeout)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:168](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L168)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _setupInternalEvents |
||||
|
||||
▸ **_setupInternalEvents**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_setupInternalEvents](baseblocktracker.md#_setupinternalevents)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:95](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L95)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _start |
||||
|
||||
▸ **_start**(): *void* |
||||
|
||||
*Overrides [BaseBlockTracker](baseblocktracker.md).[_start](baseblocktracker.md#_start)* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:75](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L75)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _updateLatestBlock |
||||
|
||||
▸ **_updateLatestBlock**(): *`Promise<void>`* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:100](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L100)* |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[addEventListener](emitter.md#addeventlistener)* |
||||
|
||||
*Defined in [providers/emitter.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L41)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### checkForLatestBlock |
||||
|
||||
▸ **checkForLatestBlock**(): *`Promise<any>`* |
||||
|
||||
*Defined in [tracker/pollingTracker.ts:65](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/pollingTracker.ts#L65)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getCurrentBlock |
||||
|
||||
▸ **getCurrentBlock**(): *any* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[getCurrentBlock](baseblocktracker.md#getcurrentblock)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L48)* |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### getLatestBlock |
||||
|
||||
▸ **getLatestBlock**(): *`Promise<any>`* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[getLatestBlock](baseblocktracker.md#getlatestblock)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:52](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L52)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### isRunning |
||||
|
||||
▸ **isRunning**(): *boolean* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[isRunning](baseblocktracker.md#isrunning)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L44)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### listenerCount |
||||
|
||||
▸ **listenerCount**(`listenKey`: any): *number* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[listenerCount](emitter.md#listenercount)* |
||||
|
||||
*Defined in [providers/emitter.ts:64](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L64)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`listenKey` | any | |
||||
|
||||
**Returns:** *number* |
||||
|
||||
___ |
||||
|
||||
### on |
||||
|
||||
▸ **on**(`type`: string, `handler`: `mitt.Handler`): *`this`* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[on](emitter.md#on)* |
||||
|
||||
*Defined in [providers/emitter.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L30)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onData |
||||
|
||||
▸ **onData**(`data`: any): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[onData](emitter.md#ondata)* |
||||
|
||||
*Defined in [providers/emitter.ts:60](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L60)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`error`: any): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[onError](emitter.md#onerror)* |
||||
|
||||
*Defined in [providers/emitter.ts:56](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L56)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`error` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[once](emitter.md#once)* |
||||
|
||||
*Defined in [providers/emitter.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L34)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeAllListeners |
||||
|
||||
▸ **removeAllListeners**(`eventName`: string): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[removeAllListeners](baseblocktracker.md#removealllisteners)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L66)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`eventName` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[removeEventListener](emitter.md#removeeventlistener)* |
||||
|
||||
*Defined in [providers/emitter.ts:45](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L45)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[resetHandlers](emitter.md#resethandlers)* |
||||
|
||||
*Defined in [providers/emitter.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L24)* |
||||
|
||||
**Returns:** *void* |
@ -0,0 +1,161 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[ResponseMiddleware](responsemiddleware.md) / |
||||
|
||||
# Class: ResponseMiddleware |
||||
|
||||
**`class`** ResponseMiddleware |
||||
|
||||
**`description`** Response middleware of RPC |
||||
|
||||
**`param`** response from rpc |
||||
|
||||
**`returns`** response middleware instance |
||||
|
||||
## Hierarchy |
||||
|
||||
* **ResponseMiddleware** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](responsemiddleware.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [error](responsemiddleware.md#error) |
||||
* [raw](responsemiddleware.md#raw) |
||||
* [responseType](responsemiddleware.md#responsetype) |
||||
* [result](responsemiddleware.md#result) |
||||
|
||||
### Accessors |
||||
|
||||
* [getError](responsemiddleware.md#geterror) |
||||
* [getRaw](responsemiddleware.md#getraw) |
||||
* [getResult](responsemiddleware.md#getresult) |
||||
|
||||
### Methods |
||||
|
||||
* [getResponseType](responsemiddleware.md#getresponsetype) |
||||
* [isError](responsemiddleware.md#iserror) |
||||
* [isRaw](responsemiddleware.md#israw) |
||||
* [isResult](responsemiddleware.md#isresult) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new ResponseMiddleware**(`ResponseBody`: [RPCResponseBody](../interfaces/rpcresponsebody.md)‹*any*, *any*›): *[ResponseMiddleware](responsemiddleware.md)* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L13)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`ResponseBody` | [RPCResponseBody](../interfaces/rpcresponsebody.md)‹*any*, *any*› | |
||||
|
||||
**Returns:** *[ResponseMiddleware](responsemiddleware.md)* |
||||
|
||||
## Properties |
||||
|
||||
### error |
||||
|
||||
• **error**: *any* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### raw |
||||
|
||||
• **raw**: *any* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L12)* |
||||
|
||||
___ |
||||
|
||||
### responseType |
||||
|
||||
• **responseType**: *string* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L13)* |
||||
|
||||
___ |
||||
|
||||
### result |
||||
|
||||
• **result**: *any* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L10)* |
||||
|
||||
## Accessors |
||||
|
||||
### getError |
||||
|
||||
• **get getError**(): *any* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:27](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L27)* |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### getRaw |
||||
|
||||
• **get getRaw**(): *any* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:33](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L33)* |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### getResult |
||||
|
||||
• **get getResult**(): *any* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L21)* |
||||
|
||||
**Returns:** *any* |
||||
|
||||
## Methods |
||||
|
||||
### getResponseType |
||||
|
||||
▸ **getResponseType**(): *string* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:37](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L37)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### isError |
||||
|
||||
▸ **isError**(): *boolean* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:50](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L50)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isRaw |
||||
|
||||
▸ **isRaw**(): *boolean* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:56](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L56)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isResult |
||||
|
||||
▸ **isResult**(): *boolean* |
||||
|
||||
*Defined in [messenger/responseMiddleware.ts:53](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/messenger/responseMiddleware.ts#L53)* |
||||
|
||||
**Returns:** *boolean* |
@ -0,0 +1,645 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[SubscribeBlockTracker](subscribeblocktracker.md) / |
||||
|
||||
# Class: SubscribeBlockTracker |
||||
|
||||
## Hierarchy |
||||
|
||||
* [BaseBlockTracker](baseblocktracker.md) |
||||
|
||||
* **SubscribeBlockTracker** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](subscribeblocktracker.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [_blockResetDuration](subscribeblocktracker.md#optional-_blockresetduration) |
||||
* [_blockResetTimeout](subscribeblocktracker.md#_blockresettimeout) |
||||
* [_currentBlock](subscribeblocktracker.md#_currentblock) |
||||
* [_isRunning](subscribeblocktracker.md#_isrunning) |
||||
* [emit](subscribeblocktracker.md#emit) |
||||
* [emitter](subscribeblocktracker.md#emitter) |
||||
* [handlers](subscribeblocktracker.md#optional-handlers) |
||||
* [messenger](subscribeblocktracker.md#messenger) |
||||
* [off](subscribeblocktracker.md#off) |
||||
* [promise](subscribeblocktracker.md#promise) |
||||
* [reject](subscribeblocktracker.md#optional-reject) |
||||
* [resolve](subscribeblocktracker.md#optional-resolve) |
||||
* [subscriptionId](subscribeblocktracker.md#subscriptionid) |
||||
* [then](subscribeblocktracker.md#optional-then) |
||||
|
||||
### Methods |
||||
|
||||
* [_cancelBlockResetTimeout](subscribeblocktracker.md#_cancelblockresettimeout) |
||||
* [_end](subscribeblocktracker.md#_end) |
||||
* [_getBlockTrackerEventCount](subscribeblocktracker.md#_getblocktrackereventcount) |
||||
* [_handleSubData](subscribeblocktracker.md#_handlesubdata) |
||||
* [_maybeEnd](subscribeblocktracker.md#_maybeend) |
||||
* [_maybeStart](subscribeblocktracker.md#_maybestart) |
||||
* [_newPotentialLatest](subscribeblocktracker.md#_newpotentiallatest) |
||||
* [_onNewListener](subscribeblocktracker.md#_onnewlistener) |
||||
* [_onRemoveListener](subscribeblocktracker.md#_onremovelistener) |
||||
* [_resetCurrentBlock](subscribeblocktracker.md#_resetcurrentblock) |
||||
* [_setCurrentBlock](subscribeblocktracker.md#_setcurrentblock) |
||||
* [_setupBlockResetTimeout](subscribeblocktracker.md#_setupblockresettimeout) |
||||
* [_setupInternalEvents](subscribeblocktracker.md#_setupinternalevents) |
||||
* [_start](subscribeblocktracker.md#_start) |
||||
* [addEventListener](subscribeblocktracker.md#addeventlistener) |
||||
* [checkForLatestBlock](subscribeblocktracker.md#checkforlatestblock) |
||||
* [getCurrentBlock](subscribeblocktracker.md#getcurrentblock) |
||||
* [getLatestBlock](subscribeblocktracker.md#getlatestblock) |
||||
* [isRunning](subscribeblocktracker.md#isrunning) |
||||
* [listenerCount](subscribeblocktracker.md#listenercount) |
||||
* [on](subscribeblocktracker.md#on) |
||||
* [onData](subscribeblocktracker.md#ondata) |
||||
* [onError](subscribeblocktracker.md#onerror) |
||||
* [once](subscribeblocktracker.md#once) |
||||
* [removeAllListeners](subscribeblocktracker.md#removealllisteners) |
||||
* [removeEventListener](subscribeblocktracker.md#removeeventlistener) |
||||
* [resetHandlers](subscribeblocktracker.md#resethandlers) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new SubscribeBlockTracker**(`messenger`: [Messenger](messenger.md), `opts`: object): *[SubscribeBlockTracker](subscribeblocktracker.md)* |
||||
|
||||
*Overrides [BaseBlockTracker](baseblocktracker.md).[constructor](baseblocktracker.md#constructor)* |
||||
|
||||
*Defined in [tracker/subscribeTracker.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/subscribeTracker.ts#L8)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`messenger` | [Messenger](messenger.md) | - | |
||||
`opts` | object | {} | |
||||
|
||||
**Returns:** *[SubscribeBlockTracker](subscribeblocktracker.md)* |
||||
|
||||
## Properties |
||||
|
||||
### `Optional` _blockResetDuration |
||||
|
||||
• **_blockResetDuration**? : *undefined | number* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_blockResetDuration](baseblocktracker.md#optional-_blockresetduration)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L12)* |
||||
|
||||
___ |
||||
|
||||
### _blockResetTimeout |
||||
|
||||
• **_blockResetTimeout**: *any* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_blockResetTimeout](baseblocktracker.md#_blockresettimeout)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L14)* |
||||
|
||||
___ |
||||
|
||||
### _currentBlock |
||||
|
||||
• **_currentBlock**: *any* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_currentBlock](baseblocktracker.md#_currentblock)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L16)* |
||||
|
||||
___ |
||||
|
||||
### _isRunning |
||||
|
||||
• **_isRunning**: *boolean* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_isRunning](baseblocktracker.md#_isrunning)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### emit |
||||
|
||||
• **emit**: *function* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[emit](emitter.md#emit)* |
||||
|
||||
*Defined in [providers/emitter.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L7)* |
||||
|
||||
#### Type declaration: |
||||
|
||||
▸ (`type`: string, `event?`: any): *void* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`event?` | any | |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[emitter](emitter.md#emitter)* |
||||
|
||||
*Defined in [providers/emitter.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` handlers |
||||
|
||||
• **handlers**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[handlers](emitter.md#optional-handlers)* |
||||
|
||||
*Defined in [providers/emitter.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L4)* |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *[Messenger](messenger.md)* |
||||
|
||||
*Defined in [tracker/subscribeTracker.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/subscribeTracker.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### off |
||||
|
||||
• **off**: *function* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[off](emitter.md#off)* |
||||
|
||||
*Defined in [providers/emitter.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L6)* |
||||
|
||||
#### Type declaration: |
||||
|
||||
▸ (`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
___ |
||||
|
||||
### promise |
||||
|
||||
• **promise**: *`Promise<__type>`* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[promise](emitter.md#promise)* |
||||
|
||||
*Defined in [providers/emitter.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` reject |
||||
|
||||
• **reject**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[reject](emitter.md#optional-reject)* |
||||
|
||||
*Defined in [providers/emitter.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L10)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` resolve |
||||
|
||||
• **resolve**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[resolve](emitter.md#optional-resolve)* |
||||
|
||||
*Defined in [providers/emitter.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### subscriptionId |
||||
|
||||
• **subscriptionId**: *any* |
||||
|
||||
*Defined in [tracker/subscribeTracker.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/subscribeTracker.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` then |
||||
|
||||
• **then**? : *any* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[then](emitter.md#optional-then)* |
||||
|
||||
*Defined in [providers/emitter.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L11)* |
||||
|
||||
## Methods |
||||
|
||||
### _cancelBlockResetTimeout |
||||
|
||||
▸ **_cancelBlockResetTimeout**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_cancelBlockResetTimeout](baseblocktracker.md#_cancelblockresettimeout)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:182](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L182)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _end |
||||
|
||||
▸ **_end**(): *`Promise<void>`* |
||||
|
||||
*Overrides [BaseBlockTracker](baseblocktracker.md).[_end](baseblocktracker.md#_end)* |
||||
|
||||
*Defined in [tracker/subscribeTracker.ts:51](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/subscribeTracker.ts#L51)* |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### _getBlockTrackerEventCount |
||||
|
||||
▸ **_getBlockTrackerEventCount**(): *number* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_getBlockTrackerEventCount](baseblocktracker.md#_getblocktrackereventcount)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:141](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L141)* |
||||
|
||||
**Returns:** *number* |
||||
|
||||
___ |
||||
|
||||
### _handleSubData |
||||
|
||||
▸ **_handleSubData**(`data`: any): *void* |
||||
|
||||
*Defined in [tracker/subscribeTracker.ts:58](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/subscribeTracker.ts#L58)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _maybeEnd |
||||
|
||||
▸ **_maybeEnd**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_maybeEnd](baseblocktracker.md#_maybeend)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:132](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L132)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _maybeStart |
||||
|
||||
▸ **_maybeStart**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_maybeStart](baseblocktracker.md#_maybestart)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:122](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L122)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _newPotentialLatest |
||||
|
||||
▸ **_newPotentialLatest**(`newBlock`: string): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_newPotentialLatest](baseblocktracker.md#_newpotentiallatest)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:147](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L147)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`newBlock` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _onNewListener |
||||
|
||||
▸ **_onNewListener**(`eventName`: string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_onNewListener](baseblocktracker.md#_onnewlistener)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:105](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L105)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`eventName` | string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _onRemoveListener |
||||
|
||||
▸ **_onRemoveListener**(`eventName`: string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_onRemoveListener](baseblocktracker.md#_onremovelistener)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:114](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L114)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`eventName` | string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _resetCurrentBlock |
||||
|
||||
▸ **_resetCurrentBlock**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_resetCurrentBlock](baseblocktracker.md#_resetcurrentblock)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:186](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L186)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _setCurrentBlock |
||||
|
||||
▸ **_setCurrentBlock**(`newBlock`: string): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_setCurrentBlock](baseblocktracker.md#_setcurrentblock)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:161](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L161)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`newBlock` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _setupBlockResetTimeout |
||||
|
||||
▸ **_setupBlockResetTimeout**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_setupBlockResetTimeout](baseblocktracker.md#_setupblockresettimeout)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:168](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L168)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _setupInternalEvents |
||||
|
||||
▸ **_setupInternalEvents**(): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[_setupInternalEvents](baseblocktracker.md#_setupinternalevents)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:95](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L95)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### _start |
||||
|
||||
▸ **_start**(): *`Promise<void>`* |
||||
|
||||
*Overrides [BaseBlockTracker](baseblocktracker.md).[_start](baseblocktracker.md#_start)* |
||||
|
||||
*Defined in [tracker/subscribeTracker.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/subscribeTracker.ts#L31)* |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[addEventListener](emitter.md#addeventlistener)* |
||||
|
||||
*Defined in [providers/emitter.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L41)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### checkForLatestBlock |
||||
|
||||
▸ **checkForLatestBlock**(): *`Promise<any>`* |
||||
|
||||
*Defined in [tracker/subscribeTracker.ts:26](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/subscribeTracker.ts#L26)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getCurrentBlock |
||||
|
||||
▸ **getCurrentBlock**(): *any* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[getCurrentBlock](baseblocktracker.md#getcurrentblock)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L48)* |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### getLatestBlock |
||||
|
||||
▸ **getLatestBlock**(): *`Promise<any>`* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[getLatestBlock](baseblocktracker.md#getlatestblock)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:52](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L52)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### isRunning |
||||
|
||||
▸ **isRunning**(): *boolean* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[isRunning](baseblocktracker.md#isrunning)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L44)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### listenerCount |
||||
|
||||
▸ **listenerCount**(`listenKey`: any): *number* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[listenerCount](emitter.md#listenercount)* |
||||
|
||||
*Defined in [providers/emitter.ts:64](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L64)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`listenKey` | any | |
||||
|
||||
**Returns:** *number* |
||||
|
||||
___ |
||||
|
||||
### on |
||||
|
||||
▸ **on**(`type`: string, `handler`: `mitt.Handler`): *`this`* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[on](emitter.md#on)* |
||||
|
||||
*Defined in [providers/emitter.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L30)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onData |
||||
|
||||
▸ **onData**(`data`: any): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[onData](emitter.md#ondata)* |
||||
|
||||
*Defined in [providers/emitter.ts:60](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L60)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`error`: any): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[onError](emitter.md#onerror)* |
||||
|
||||
*Defined in [providers/emitter.ts:56](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L56)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`error` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[once](emitter.md#once)* |
||||
|
||||
*Defined in [providers/emitter.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L34)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeAllListeners |
||||
|
||||
▸ **removeAllListeners**(`eventName`: string): *void* |
||||
|
||||
*Inherited from [BaseBlockTracker](baseblocktracker.md).[removeAllListeners](baseblocktracker.md#removealllisteners)* |
||||
|
||||
*Defined in [tracker/baseTracker.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/tracker/baseTracker.ts#L66)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`eventName` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[removeEventListener](emitter.md#removeeventlistener)* |
||||
|
||||
*Defined in [providers/emitter.ts:45](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L45)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Inherited from [Emitter](emitter.md).[resetHandlers](emitter.md#resethandlers)* |
||||
|
||||
*Defined in [providers/emitter.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/emitter.ts#L24)* |
||||
|
||||
**Returns:** *void* |
@ -0,0 +1,726 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[SubscriptionMethod](subscriptionmethod.md) / |
||||
|
||||
# Class: SubscriptionMethod |
||||
|
||||
## Hierarchy |
||||
|
||||
* [WSProvider](wsprovider.md) |
||||
|
||||
* **SubscriptionMethod** |
||||
|
||||
* [LogSub](logsub.md) |
||||
|
||||
* [NewHeaders](newheaders.md) |
||||
|
||||
* [NewPendingTransactions](newpendingtransactions.md) |
||||
|
||||
* [Syncing](syncing.md) |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](subscriptionmethod.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [connection](subscriptionmethod.md#connection) |
||||
* [emitter](subscriptionmethod.md#emitter) |
||||
* [handlers](subscriptionmethod.md#handlers) |
||||
* [jsonRpc](subscriptionmethod.md#jsonrpc) |
||||
* [messenger](subscriptionmethod.md#messenger) |
||||
* [options](subscriptionmethod.md#options) |
||||
* [param](subscriptionmethod.md#param) |
||||
* [reqMiddleware](subscriptionmethod.md#protected-reqmiddleware) |
||||
* [resMiddleware](subscriptionmethod.md#protected-resmiddleware) |
||||
* [subscriptionId](subscriptionmethod.md#subscriptionid) |
||||
* [subscriptions](subscriptionmethod.md#subscriptions) |
||||
* [url](subscriptionmethod.md#url) |
||||
|
||||
### Accessors |
||||
|
||||
* [connected](subscriptionmethod.md#connected) |
||||
|
||||
### Methods |
||||
|
||||
* [addEventListener](subscriptionmethod.md#addeventlistener) |
||||
* [clearSubscriptions](subscriptionmethod.md#clearsubscriptions) |
||||
* [constructPayload](subscriptionmethod.md#constructpayload) |
||||
* [createWebsocketProvider](subscriptionmethod.md#createwebsocketprovider) |
||||
* [getMiddleware](subscriptionmethod.md#protected-getmiddleware) |
||||
* [getSubscriptionEvent](subscriptionmethod.md#getsubscriptionevent) |
||||
* [hasSubscription](subscriptionmethod.md#hassubscription) |
||||
* [isConnecting](subscriptionmethod.md#isconnecting) |
||||
* [on](subscriptionmethod.md#on) |
||||
* [onClose](subscriptionmethod.md#onclose) |
||||
* [onConnect](subscriptionmethod.md#onconnect) |
||||
* [onData](subscriptionmethod.md#ondata) |
||||
* [onError](subscriptionmethod.md#onerror) |
||||
* [onMessage](subscriptionmethod.md#onmessage) |
||||
* [onNewSubscriptionItem](subscriptionmethod.md#onnewsubscriptionitem) |
||||
* [onReady](subscriptionmethod.md#onready) |
||||
* [once](subscriptionmethod.md#once) |
||||
* [pushMiddleware](subscriptionmethod.md#protected-pushmiddleware) |
||||
* [reconnect](subscriptionmethod.md#reconnect) |
||||
* [registerEventListeners](subscriptionmethod.md#registereventlisteners) |
||||
* [removeAllSocketListeners](subscriptionmethod.md#removeallsocketlisteners) |
||||
* [removeEventListener](subscriptionmethod.md#removeeventlistener) |
||||
* [reset](subscriptionmethod.md#reset) |
||||
* [resetHandlers](subscriptionmethod.md#resethandlers) |
||||
* [send](subscriptionmethod.md#send) |
||||
* [start](subscriptionmethod.md#start) |
||||
* [subscribe](subscriptionmethod.md#subscribe) |
||||
* [unsubscribe](subscriptionmethod.md#unsubscribe) |
||||
* [validate](subscriptionmethod.md#validate) |
||||
|
||||
### Object literals |
||||
|
||||
* [middlewares](subscriptionmethod.md#middlewares) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new SubscriptionMethod**(`param`: any, `options`: any, `messenger`: [Messenger](messenger.md)): *[SubscriptionMethod](subscriptionmethod.md)* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[constructor](wsprovider.md#constructor)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L11)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`param` | any | |
||||
`options` | any | |
||||
`messenger` | [Messenger](messenger.md) | |
||||
|
||||
**Returns:** *[SubscriptionMethod](subscriptionmethod.md)* |
||||
|
||||
## Properties |
||||
|
||||
### connection |
||||
|
||||
• **connection**: *`W3CWebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[connection](wsprovider.md#connection)* |
||||
|
||||
*Defined in [providers/ws.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L22)* |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[emitter](basesocket.md#emitter)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L29)* |
||||
|
||||
___ |
||||
|
||||
### handlers |
||||
|
||||
• **handlers**: *any* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[handlers](basesocket.md#handlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L30)* |
||||
|
||||
___ |
||||
|
||||
### jsonRpc |
||||
|
||||
• **jsonRpc**: *[JsonRpc](jsonrpc.md)* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[jsonRpc](wsprovider.md#jsonrpc)* |
||||
|
||||
*Defined in [providers/ws.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *[Messenger](messenger.md)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### options |
||||
|
||||
• **options**: *any* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[options](wsprovider.md#options)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### param |
||||
|
||||
• **param**: *any* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` reqMiddleware |
||||
|
||||
• **reqMiddleware**: *[ReqMiddleware](../README.md#reqmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[reqMiddleware](baseprovider.md#protected-reqmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` resMiddleware |
||||
|
||||
• **resMiddleware**: *[ResMiddleware](../README.md#resmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[resMiddleware](baseprovider.md#protected-resmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### subscriptionId |
||||
|
||||
• **subscriptionId**: *any* = null |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### subscriptions |
||||
|
||||
• **subscriptions**: *any* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[subscriptions](wsprovider.md#subscriptions)* |
||||
|
||||
*Defined in [providers/ws.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L20)* |
||||
|
||||
___ |
||||
|
||||
### url |
||||
|
||||
• **url**: *string* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[url](wsprovider.md#url)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[url](basesocket.md#url)* |
||||
|
||||
*Defined in [providers/ws.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L19)* |
||||
|
||||
## Accessors |
||||
|
||||
### connected |
||||
|
||||
• **get connected**(): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[connected](wsprovider.md#connected)* |
||||
|
||||
*Defined in [providers/ws.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L15)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
## Methods |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[addEventListener](basesocket.md#addeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:51](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L51)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### clearSubscriptions |
||||
|
||||
▸ **clearSubscriptions**(`unsubscribeMethod`: string): *`Promise<boolean>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[clearSubscriptions](wsprovider.md#clearsubscriptions)* |
||||
|
||||
*Defined in [providers/ws.ts:166](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L166)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`unsubscribeMethod` | string | |
||||
|
||||
**Returns:** *`Promise<boolean>`* |
||||
|
||||
___ |
||||
|
||||
### constructPayload |
||||
|
||||
▸ **constructPayload**(`method`: string, `param`: any, `options?`: any): *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L19)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | string | |
||||
`param` | any | |
||||
`options?` | any | |
||||
|
||||
**Returns:** *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
___ |
||||
|
||||
### createWebsocketProvider |
||||
|
||||
▸ **createWebsocketProvider**(`url`: string, `options`: any): *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[createWebsocketProvider](wsprovider.md#createwebsocketprovider)* |
||||
|
||||
*Defined in [providers/ws.ts:63](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L63)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`url` | string | - | |
||||
`options` | any | {} | |
||||
|
||||
**Returns:** *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
___ |
||||
|
||||
### `Protected` getMiddleware |
||||
|
||||
▸ **getMiddleware**(`method`: [RPCMethod](../enums/rpcmethod.md) | string): *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[getMiddleware](baseprovider.md#protected-getmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L47)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | |
||||
|
||||
**Returns:** *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
___ |
||||
|
||||
### getSubscriptionEvent |
||||
|
||||
▸ **getSubscriptionEvent**(`subscriptionId`: any): *any* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[getSubscriptionEvent](wsprovider.md#getsubscriptionevent)* |
||||
|
||||
*Defined in [providers/ws.ts:242](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L242)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### hasSubscription |
||||
|
||||
▸ **hasSubscription**(`subscriptionId`: string): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[hasSubscription](wsprovider.md#hassubscription)* |
||||
|
||||
*Defined in [providers/ws.ts:256](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L256)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isConnecting |
||||
|
||||
▸ **isConnecting**(): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[isConnecting](wsprovider.md#isconnecting)* |
||||
|
||||
*Defined in [providers/ws.ts:97](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L97)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### on |
||||
|
||||
▸ **on**(`type`: string, `handler`: `mitt.Handler`): *`this`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[on](wsprovider.md#on)* |
||||
|
||||
*Defined in [providers/ws.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L40)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onClose |
||||
|
||||
▸ **onClose**(`closeEvent`: any): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onClose](wsprovider.md#onclose)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onClose](basesocket.md#onclose)* |
||||
|
||||
*Defined in [providers/ws.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`closeEvent` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onConnect |
||||
|
||||
▸ **onConnect**(): *`Promise<void>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onConnect](wsprovider.md#onconnect)* |
||||
|
||||
*Defined in [providers/ws.ts:223](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L223)* |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### onData |
||||
|
||||
▸ **onData**(`handler`: any): *`this`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onData](wsprovider.md#ondata)* |
||||
|
||||
*Defined in [providers/ws.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L44)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`handler` | any | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`event`: any): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onError](wsprovider.md#onerror)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onError](basesocket.md#onerror)* |
||||
|
||||
*Defined in [providers/ws.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L48)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onMessage |
||||
|
||||
▸ **onMessage**(`msg`: `MessageEvent`): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onMessage](wsprovider.md#onmessage)* |
||||
|
||||
*Defined in [providers/ws.ts:195](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L195)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`msg` | `MessageEvent` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onNewSubscriptionItem |
||||
|
||||
▸ **onNewSubscriptionItem**(`subscriptionItem`: any): *any* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L66)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionItem` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### onReady |
||||
|
||||
▸ **onReady**(`event`: any): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[onReady](basesocket.md#onready)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:78](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L78)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[once](basesocket.md#once)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L46)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### `Protected` pushMiddleware |
||||
|
||||
▸ **pushMiddleware**(`fn`: any, `type`: [MiddlewareType](../enums/middlewaretype.md), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[pushMiddleware](baseprovider.md#protected-pushmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L31)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fn` | any | |
||||
`type` | [MiddlewareType](../enums/middlewaretype.md) | |
||||
`match` | string \| [RPCMethod](../enums/rpcmethod.md) \| `RegExp` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reconnect |
||||
|
||||
▸ **reconnect**(): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[reconnect](wsprovider.md#reconnect)* |
||||
|
||||
*Defined in [providers/ws.ts:90](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L90)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### registerEventListeners |
||||
|
||||
▸ **registerEventListeners**(): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[registerEventListeners](wsprovider.md#registereventlisteners)* |
||||
|
||||
*Defined in [providers/ws.ts:187](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L187)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeAllSocketListeners |
||||
|
||||
▸ **removeAllSocketListeners**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeAllSocketListeners](basesocket.md#removeallsocketlisteners)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:70](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L70)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeEventListener](basesocket.md#removeeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reset |
||||
|
||||
▸ **reset**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[reset](basesocket.md#reset)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L66)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[resetHandlers](basesocket.md#resethandlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L39)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### send |
||||
|
||||
▸ **send**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*›): *`Promise<any>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[send](wsprovider.md#send)* |
||||
|
||||
*Defined in [providers/ws.ts:101](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L101)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### start |
||||
|
||||
▸ **start**(): *`Promise<this>`* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L34)* |
||||
|
||||
**Returns:** *`Promise<this>`* |
||||
|
||||
___ |
||||
|
||||
### subscribe |
||||
|
||||
▸ **subscribe**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*›): *`Promise<any>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[subscribe](wsprovider.md#subscribe)* |
||||
|
||||
*Defined in [providers/ws.ts:131](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L131)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### unsubscribe |
||||
|
||||
▸ **unsubscribe**(): *`Promise<any>`* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[unsubscribe](wsprovider.md#unsubscribe)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:59](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L59)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### validate |
||||
|
||||
▸ **validate**(`response`: any, `payload?`: any): *true | `Error`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[validate](wsprovider.md#validate)* |
||||
|
||||
*Defined in [providers/ws.ts:259](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L259)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`response` | any | |
||||
`payload?` | any | |
||||
|
||||
**Returns:** *true | `Error`* |
||||
|
||||
## Object literals |
||||
|
||||
### middlewares |
||||
|
||||
### ▪ **middlewares**: *object* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[middlewares](baseprovider.md#middlewares)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L5)* |
||||
|
||||
▪ **request**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L6)* |
||||
|
||||
* **use**(`fn`: [ReqMiddleware](../README.md#reqmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
▪ **response**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L11)* |
||||
|
||||
* **use**(`fn`: [ResMiddleware](../README.md#resmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
@ -0,0 +1,741 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[Syncing](syncing.md) / |
||||
|
||||
# Class: Syncing |
||||
|
||||
## Hierarchy |
||||
|
||||
* [SubscriptionMethod](subscriptionmethod.md) |
||||
|
||||
* **Syncing** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](syncing.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [connection](syncing.md#connection) |
||||
* [emitter](syncing.md#emitter) |
||||
* [handlers](syncing.md#handlers) |
||||
* [isSyncing](syncing.md#issyncing) |
||||
* [jsonRpc](syncing.md#jsonrpc) |
||||
* [messenger](syncing.md#messenger) |
||||
* [options](syncing.md#options) |
||||
* [param](syncing.md#param) |
||||
* [reqMiddleware](syncing.md#protected-reqmiddleware) |
||||
* [resMiddleware](syncing.md#protected-resmiddleware) |
||||
* [subscriptionId](syncing.md#subscriptionid) |
||||
* [subscriptions](syncing.md#subscriptions) |
||||
* [url](syncing.md#url) |
||||
|
||||
### Accessors |
||||
|
||||
* [connected](syncing.md#connected) |
||||
|
||||
### Methods |
||||
|
||||
* [addEventListener](syncing.md#addeventlistener) |
||||
* [clearSubscriptions](syncing.md#clearsubscriptions) |
||||
* [constructPayload](syncing.md#constructpayload) |
||||
* [createWebsocketProvider](syncing.md#createwebsocketprovider) |
||||
* [getMiddleware](syncing.md#protected-getmiddleware) |
||||
* [getSubscriptionEvent](syncing.md#getsubscriptionevent) |
||||
* [hasSubscription](syncing.md#hassubscription) |
||||
* [isConnecting](syncing.md#isconnecting) |
||||
* [on](syncing.md#on) |
||||
* [onClose](syncing.md#onclose) |
||||
* [onConnect](syncing.md#onconnect) |
||||
* [onData](syncing.md#ondata) |
||||
* [onError](syncing.md#onerror) |
||||
* [onMessage](syncing.md#onmessage) |
||||
* [onNewSubscriptionItem](syncing.md#onnewsubscriptionitem) |
||||
* [onReady](syncing.md#onready) |
||||
* [once](syncing.md#once) |
||||
* [pushMiddleware](syncing.md#protected-pushmiddleware) |
||||
* [reconnect](syncing.md#reconnect) |
||||
* [registerEventListeners](syncing.md#registereventlisteners) |
||||
* [removeAllSocketListeners](syncing.md#removeallsocketlisteners) |
||||
* [removeEventListener](syncing.md#removeeventlistener) |
||||
* [reset](syncing.md#reset) |
||||
* [resetHandlers](syncing.md#resethandlers) |
||||
* [send](syncing.md#send) |
||||
* [start](syncing.md#start) |
||||
* [subscribe](syncing.md#subscribe) |
||||
* [unsubscribe](syncing.md#unsubscribe) |
||||
* [validate](syncing.md#validate) |
||||
|
||||
### Object literals |
||||
|
||||
* [middlewares](syncing.md#middlewares) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new Syncing**(`messenger`: [Messenger](messenger.md)): *[Syncing](syncing.md)* |
||||
|
||||
*Overrides [SubscriptionMethod](subscriptionmethod.md).[constructor](subscriptionmethod.md#constructor)* |
||||
|
||||
*Defined in [subscriptions/SyncingSub.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/SyncingSub.ts#L5)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`messenger` | [Messenger](messenger.md) | |
||||
|
||||
**Returns:** *[Syncing](syncing.md)* |
||||
|
||||
## Properties |
||||
|
||||
### connection |
||||
|
||||
• **connection**: *`W3CWebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[connection](wsprovider.md#connection)* |
||||
|
||||
*Defined in [providers/ws.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L22)* |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[emitter](basesocket.md#emitter)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L29)* |
||||
|
||||
___ |
||||
|
||||
### handlers |
||||
|
||||
• **handlers**: *any* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[handlers](basesocket.md#handlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L30)* |
||||
|
||||
___ |
||||
|
||||
### isSyncing |
||||
|
||||
• **isSyncing**: *boolean | null* |
||||
|
||||
*Defined in [subscriptions/SyncingSub.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/SyncingSub.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### jsonRpc |
||||
|
||||
• **jsonRpc**: *[JsonRpc](jsonrpc.md)* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[jsonRpc](wsprovider.md#jsonrpc)* |
||||
|
||||
*Defined in [providers/ws.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *[Messenger](messenger.md)* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[messenger](subscriptionmethod.md#messenger)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### options |
||||
|
||||
• **options**: *any* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[options](subscriptionmethod.md#options)* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[options](wsprovider.md#options)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### param |
||||
|
||||
• **param**: *any* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[param](subscriptionmethod.md#param)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` reqMiddleware |
||||
|
||||
• **reqMiddleware**: *[ReqMiddleware](../README.md#reqmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[reqMiddleware](baseprovider.md#protected-reqmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` resMiddleware |
||||
|
||||
• **resMiddleware**: *[ResMiddleware](../README.md#resmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[resMiddleware](baseprovider.md#protected-resmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### subscriptionId |
||||
|
||||
• **subscriptionId**: *any* = null |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[subscriptionId](subscriptionmethod.md#subscriptionid)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### subscriptions |
||||
|
||||
• **subscriptions**: *any* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[subscriptions](wsprovider.md#subscriptions)* |
||||
|
||||
*Defined in [providers/ws.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L20)* |
||||
|
||||
___ |
||||
|
||||
### url |
||||
|
||||
• **url**: *string* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[url](wsprovider.md#url)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[url](basesocket.md#url)* |
||||
|
||||
*Defined in [providers/ws.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L19)* |
||||
|
||||
## Accessors |
||||
|
||||
### connected |
||||
|
||||
• **get connected**(): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[connected](wsprovider.md#connected)* |
||||
|
||||
*Defined in [providers/ws.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L15)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
## Methods |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[addEventListener](basesocket.md#addeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:51](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L51)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### clearSubscriptions |
||||
|
||||
▸ **clearSubscriptions**(`unsubscribeMethod`: string): *`Promise<boolean>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[clearSubscriptions](wsprovider.md#clearsubscriptions)* |
||||
|
||||
*Defined in [providers/ws.ts:166](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L166)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`unsubscribeMethod` | string | |
||||
|
||||
**Returns:** *`Promise<boolean>`* |
||||
|
||||
___ |
||||
|
||||
### constructPayload |
||||
|
||||
▸ **constructPayload**(`method`: string, `param`: any, `options?`: any): *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[constructPayload](subscriptionmethod.md#constructpayload)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L19)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | string | |
||||
`param` | any | |
||||
`options?` | any | |
||||
|
||||
**Returns:** *[RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any*›* |
||||
|
||||
___ |
||||
|
||||
### createWebsocketProvider |
||||
|
||||
▸ **createWebsocketProvider**(`url`: string, `options`: any): *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[createWebsocketProvider](wsprovider.md#createwebsocketprovider)* |
||||
|
||||
*Defined in [providers/ws.ts:63](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L63)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`url` | string | - | |
||||
`options` | any | {} | |
||||
|
||||
**Returns:** *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
___ |
||||
|
||||
### `Protected` getMiddleware |
||||
|
||||
▸ **getMiddleware**(`method`: [RPCMethod](../enums/rpcmethod.md) | string): *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[getMiddleware](baseprovider.md#protected-getmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L47)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | |
||||
|
||||
**Returns:** *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
___ |
||||
|
||||
### getSubscriptionEvent |
||||
|
||||
▸ **getSubscriptionEvent**(`subscriptionId`: any): *any* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[getSubscriptionEvent](wsprovider.md#getsubscriptionevent)* |
||||
|
||||
*Defined in [providers/ws.ts:242](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L242)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### hasSubscription |
||||
|
||||
▸ **hasSubscription**(`subscriptionId`: string): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[hasSubscription](wsprovider.md#hassubscription)* |
||||
|
||||
*Defined in [providers/ws.ts:256](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L256)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isConnecting |
||||
|
||||
▸ **isConnecting**(): *boolean* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[isConnecting](wsprovider.md#isconnecting)* |
||||
|
||||
*Defined in [providers/ws.ts:97](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L97)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### on |
||||
|
||||
▸ **on**(`type`: string, `handler`: `mitt.Handler`): *`this`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[on](wsprovider.md#on)* |
||||
|
||||
*Defined in [providers/ws.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L40)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onClose |
||||
|
||||
▸ **onClose**(`closeEvent`: any): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onClose](wsprovider.md#onclose)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onClose](basesocket.md#onclose)* |
||||
|
||||
*Defined in [providers/ws.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`closeEvent` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onConnect |
||||
|
||||
▸ **onConnect**(): *`Promise<void>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onConnect](wsprovider.md#onconnect)* |
||||
|
||||
*Defined in [providers/ws.ts:223](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L223)* |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### onData |
||||
|
||||
▸ **onData**(`handler`: any): *`this`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onData](wsprovider.md#ondata)* |
||||
|
||||
*Defined in [providers/ws.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L44)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`handler` | any | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`event`: any): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onError](wsprovider.md#onerror)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onError](basesocket.md#onerror)* |
||||
|
||||
*Defined in [providers/ws.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L48)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onMessage |
||||
|
||||
▸ **onMessage**(`msg`: `MessageEvent`): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[onMessage](wsprovider.md#onmessage)* |
||||
|
||||
*Defined in [providers/ws.ts:195](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L195)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`msg` | `MessageEvent` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onNewSubscriptionItem |
||||
|
||||
▸ **onNewSubscriptionItem**(`subscriptionItem`: any): *any* |
||||
|
||||
*Overrides [SubscriptionMethod](subscriptionmethod.md).[onNewSubscriptionItem](subscriptionmethod.md#onnewsubscriptionitem)* |
||||
|
||||
*Defined in [subscriptions/SyncingSub.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/SyncingSub.ts#L12)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionItem` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### onReady |
||||
|
||||
▸ **onReady**(`event`: any): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[onReady](basesocket.md#onready)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:78](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L78)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[once](basesocket.md#once)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L46)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### `Protected` pushMiddleware |
||||
|
||||
▸ **pushMiddleware**(`fn`: any, `type`: [MiddlewareType](../enums/middlewaretype.md), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[pushMiddleware](baseprovider.md#protected-pushmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L31)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fn` | any | |
||||
`type` | [MiddlewareType](../enums/middlewaretype.md) | |
||||
`match` | string \| [RPCMethod](../enums/rpcmethod.md) \| `RegExp` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reconnect |
||||
|
||||
▸ **reconnect**(): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[reconnect](wsprovider.md#reconnect)* |
||||
|
||||
*Defined in [providers/ws.ts:90](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L90)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### registerEventListeners |
||||
|
||||
▸ **registerEventListeners**(): *void* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[registerEventListeners](wsprovider.md#registereventlisteners)* |
||||
|
||||
*Defined in [providers/ws.ts:187](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L187)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeAllSocketListeners |
||||
|
||||
▸ **removeAllSocketListeners**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeAllSocketListeners](basesocket.md#removeallsocketlisteners)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:70](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L70)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeEventListener](basesocket.md#removeeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reset |
||||
|
||||
▸ **reset**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[reset](basesocket.md#reset)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L66)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[resetHandlers](basesocket.md#resethandlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L39)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### send |
||||
|
||||
▸ **send**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*›): *`Promise<any>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[send](wsprovider.md#send)* |
||||
|
||||
*Defined in [providers/ws.ts:101](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L101)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### start |
||||
|
||||
▸ **start**(): *`Promise<this>`* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[start](subscriptionmethod.md#start)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L34)* |
||||
|
||||
**Returns:** *`Promise<this>`* |
||||
|
||||
___ |
||||
|
||||
### subscribe |
||||
|
||||
▸ **subscribe**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*›): *`Promise<any>`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[subscribe](wsprovider.md#subscribe)* |
||||
|
||||
*Defined in [providers/ws.ts:131](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L131)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### unsubscribe |
||||
|
||||
▸ **unsubscribe**(): *`Promise<any>`* |
||||
|
||||
*Inherited from [SubscriptionMethod](subscriptionmethod.md).[unsubscribe](subscriptionmethod.md#unsubscribe)* |
||||
|
||||
*Overrides [WSProvider](wsprovider.md).[unsubscribe](wsprovider.md#unsubscribe)* |
||||
|
||||
*Defined in [subscriptions/Subscription.ts:59](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/subscriptions/Subscription.ts#L59)* |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### validate |
||||
|
||||
▸ **validate**(`response`: any, `payload?`: any): *true | `Error`* |
||||
|
||||
*Inherited from [WSProvider](wsprovider.md).[validate](wsprovider.md#validate)* |
||||
|
||||
*Defined in [providers/ws.ts:259](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L259)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`response` | any | |
||||
`payload?` | any | |
||||
|
||||
**Returns:** *true | `Error`* |
||||
|
||||
## Object literals |
||||
|
||||
### middlewares |
||||
|
||||
### ▪ **middlewares**: *object* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[middlewares](baseprovider.md#middlewares)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L5)* |
||||
|
||||
▪ **request**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L6)* |
||||
|
||||
* **use**(`fn`: [ReqMiddleware](../README.md#reqmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
▪ **response**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L11)* |
||||
|
||||
* **use**(`fn`: [ResMiddleware](../README.md#resmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
@ -0,0 +1,605 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[WSProvider](wsprovider.md) / |
||||
|
||||
# Class: WSProvider |
||||
|
||||
## Hierarchy |
||||
|
||||
* [BaseSocket](basesocket.md) |
||||
|
||||
* **WSProvider** |
||||
|
||||
* [SubscriptionMethod](subscriptionmethod.md) |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](wsprovider.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [connection](wsprovider.md#connection) |
||||
* [emitter](wsprovider.md#emitter) |
||||
* [handlers](wsprovider.md#handlers) |
||||
* [jsonRpc](wsprovider.md#jsonrpc) |
||||
* [options](wsprovider.md#options) |
||||
* [reqMiddleware](wsprovider.md#protected-reqmiddleware) |
||||
* [resMiddleware](wsprovider.md#protected-resmiddleware) |
||||
* [subscriptions](wsprovider.md#subscriptions) |
||||
* [url](wsprovider.md#url) |
||||
|
||||
### Accessors |
||||
|
||||
* [connected](wsprovider.md#connected) |
||||
|
||||
### Methods |
||||
|
||||
* [addEventListener](wsprovider.md#addeventlistener) |
||||
* [clearSubscriptions](wsprovider.md#clearsubscriptions) |
||||
* [createWebsocketProvider](wsprovider.md#createwebsocketprovider) |
||||
* [getMiddleware](wsprovider.md#protected-getmiddleware) |
||||
* [getSubscriptionEvent](wsprovider.md#getsubscriptionevent) |
||||
* [hasSubscription](wsprovider.md#hassubscription) |
||||
* [isConnecting](wsprovider.md#isconnecting) |
||||
* [on](wsprovider.md#on) |
||||
* [onClose](wsprovider.md#onclose) |
||||
* [onConnect](wsprovider.md#onconnect) |
||||
* [onData](wsprovider.md#ondata) |
||||
* [onError](wsprovider.md#onerror) |
||||
* [onMessage](wsprovider.md#onmessage) |
||||
* [onReady](wsprovider.md#onready) |
||||
* [once](wsprovider.md#once) |
||||
* [pushMiddleware](wsprovider.md#protected-pushmiddleware) |
||||
* [reconnect](wsprovider.md#reconnect) |
||||
* [registerEventListeners](wsprovider.md#registereventlisteners) |
||||
* [removeAllSocketListeners](wsprovider.md#removeallsocketlisteners) |
||||
* [removeEventListener](wsprovider.md#removeeventlistener) |
||||
* [reset](wsprovider.md#reset) |
||||
* [resetHandlers](wsprovider.md#resethandlers) |
||||
* [send](wsprovider.md#send) |
||||
* [subscribe](wsprovider.md#subscribe) |
||||
* [unsubscribe](wsprovider.md#unsubscribe) |
||||
* [validate](wsprovider.md#validate) |
||||
|
||||
### Object literals |
||||
|
||||
* [middlewares](wsprovider.md#middlewares) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new WSProvider**(`url`: string, `options`: any): *[WSProvider](wsprovider.md)* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[constructor](basesocket.md#constructor)* |
||||
|
||||
*Defined in [providers/ws.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L23)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`url` | string | - | |
||||
`options` | any | {} | |
||||
|
||||
**Returns:** *[WSProvider](wsprovider.md)* |
||||
|
||||
## Properties |
||||
|
||||
### connection |
||||
|
||||
• **connection**: *`W3CWebsocket` | `WebSocket`* |
||||
|
||||
*Defined in [providers/ws.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L22)* |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[emitter](basesocket.md#emitter)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L29)* |
||||
|
||||
___ |
||||
|
||||
### handlers |
||||
|
||||
• **handlers**: *any* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[handlers](basesocket.md#handlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L30)* |
||||
|
||||
___ |
||||
|
||||
### jsonRpc |
||||
|
||||
• **jsonRpc**: *[JsonRpc](jsonrpc.md)* |
||||
|
||||
*Defined in [providers/ws.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### options |
||||
|
||||
• **options**: *any* |
||||
|
||||
*Defined in [providers/ws.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L21)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` reqMiddleware |
||||
|
||||
• **reqMiddleware**: *[ReqMiddleware](../README.md#reqmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[reqMiddleware](baseprovider.md#protected-reqmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### `Protected` resMiddleware |
||||
|
||||
• **resMiddleware**: *[ResMiddleware](../README.md#resmiddleware)* = new Map().set('*', []) |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[resMiddleware](baseprovider.md#protected-resmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### subscriptions |
||||
|
||||
• **subscriptions**: *any* |
||||
|
||||
*Defined in [providers/ws.ts:20](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L20)* |
||||
|
||||
___ |
||||
|
||||
### url |
||||
|
||||
• **url**: *string* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[url](basesocket.md#url)* |
||||
|
||||
*Defined in [providers/ws.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L19)* |
||||
|
||||
## Accessors |
||||
|
||||
### connected |
||||
|
||||
• **get connected**(): *boolean* |
||||
|
||||
*Defined in [providers/ws.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L15)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
## Methods |
||||
|
||||
### addEventListener |
||||
|
||||
▸ **addEventListener**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[addEventListener](basesocket.md#addeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:51](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L51)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### clearSubscriptions |
||||
|
||||
▸ **clearSubscriptions**(`unsubscribeMethod`: string): *`Promise<boolean>`* |
||||
|
||||
*Defined in [providers/ws.ts:166](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L166)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`unsubscribeMethod` | string | |
||||
|
||||
**Returns:** *`Promise<boolean>`* |
||||
|
||||
___ |
||||
|
||||
### createWebsocketProvider |
||||
|
||||
▸ **createWebsocketProvider**(`url`: string, `options`: any): *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
*Defined in [providers/ws.ts:63](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L63)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`url` | string | - | |
||||
`options` | any | {} | |
||||
|
||||
**Returns:** *`w3cwebsocket` | `WebSocket`* |
||||
|
||||
___ |
||||
|
||||
### `Protected` getMiddleware |
||||
|
||||
▸ **getMiddleware**(`method`: [RPCMethod](../enums/rpcmethod.md) | string): *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[getMiddleware](baseprovider.md#protected-getmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L47)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`method` | [RPCMethod](../enums/rpcmethod.md) \| string | |
||||
|
||||
**Returns:** *[[ReqMiddleware](../README.md#reqmiddleware)[], [ResMiddleware](../README.md#resmiddleware)[]]* |
||||
|
||||
___ |
||||
|
||||
### getSubscriptionEvent |
||||
|
||||
▸ **getSubscriptionEvent**(`subscriptionId`: any): *any* |
||||
|
||||
*Defined in [providers/ws.ts:242](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L242)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | any | |
||||
|
||||
**Returns:** *any* |
||||
|
||||
___ |
||||
|
||||
### hasSubscription |
||||
|
||||
▸ **hasSubscription**(`subscriptionId`: string): *boolean* |
||||
|
||||
*Defined in [providers/ws.ts:256](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L256)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`subscriptionId` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isConnecting |
||||
|
||||
▸ **isConnecting**(): *boolean* |
||||
|
||||
*Defined in [providers/ws.ts:97](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L97)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### on |
||||
|
||||
▸ **on**(`type`: string, `handler`: `mitt.Handler`): *`this`* |
||||
|
||||
*Defined in [providers/ws.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L40)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onClose |
||||
|
||||
▸ **onClose**(`closeEvent`: any): *void* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onClose](basesocket.md#onclose)* |
||||
|
||||
*Defined in [providers/ws.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`closeEvent` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onConnect |
||||
|
||||
▸ **onConnect**(): *`Promise<void>`* |
||||
|
||||
*Defined in [providers/ws.ts:223](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L223)* |
||||
|
||||
**Returns:** *`Promise<void>`* |
||||
|
||||
___ |
||||
|
||||
### onData |
||||
|
||||
▸ **onData**(`handler`: any): *`this`* |
||||
|
||||
*Defined in [providers/ws.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L44)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`handler` | any | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### onError |
||||
|
||||
▸ **onError**(`event`: any): *void* |
||||
|
||||
*Overrides [BaseSocket](basesocket.md).[onError](basesocket.md#onerror)* |
||||
|
||||
*Defined in [providers/ws.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L48)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onMessage |
||||
|
||||
▸ **onMessage**(`msg`: `MessageEvent`): *void* |
||||
|
||||
*Defined in [providers/ws.ts:195](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L195)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`msg` | `MessageEvent` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### onReady |
||||
|
||||
▸ **onReady**(`event`: any): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[onReady](basesocket.md#onready)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:78](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L78)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`event` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### once |
||||
|
||||
▸ **once**(`type`: string, `handler`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[once](basesocket.md#once)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L46)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type` | string | |
||||
`handler` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### `Protected` pushMiddleware |
||||
|
||||
▸ **pushMiddleware**(`fn`: any, `type`: [MiddlewareType](../enums/middlewaretype.md), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[pushMiddleware](baseprovider.md#protected-pushmiddleware)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L31)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fn` | any | |
||||
`type` | [MiddlewareType](../enums/middlewaretype.md) | |
||||
`match` | string \| [RPCMethod](../enums/rpcmethod.md) \| `RegExp` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reconnect |
||||
|
||||
▸ **reconnect**(): *void* |
||||
|
||||
*Defined in [providers/ws.ts:90](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L90)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### registerEventListeners |
||||
|
||||
▸ **registerEventListeners**(): *void* |
||||
|
||||
*Defined in [providers/ws.ts:187](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L187)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeAllSocketListeners |
||||
|
||||
▸ **removeAllSocketListeners**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeAllSocketListeners](basesocket.md#removeallsocketlisteners)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:70](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L70)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### removeEventListener |
||||
|
||||
▸ **removeEventListener**(`type?`: undefined | string, `handler?`: `mitt.Handler`): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[removeEventListener](basesocket.md#removeeventlistener)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`type?` | undefined \| string | |
||||
`handler?` | `mitt.Handler` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### reset |
||||
|
||||
▸ **reset**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[reset](basesocket.md#reset)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L66)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### resetHandlers |
||||
|
||||
▸ **resetHandlers**(): *void* |
||||
|
||||
*Inherited from [BaseSocket](basesocket.md).[resetHandlers](basesocket.md#resethandlers)* |
||||
|
||||
*Defined in [providers/baseSocket.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L39)* |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### send |
||||
|
||||
▸ **send**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*›): *`Promise<any>`* |
||||
|
||||
*Defined in [providers/ws.ts:101](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L101)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*object*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### subscribe |
||||
|
||||
▸ **subscribe**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*›): *`Promise<any>`* |
||||
|
||||
*Defined in [providers/ws.ts:131](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L131)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### unsubscribe |
||||
|
||||
▸ **unsubscribe**(`payload`: [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*›): *`Promise<any>`* |
||||
|
||||
*Defined in [providers/ws.ts:146](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L146)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`payload` | [RPCRequestPayload](../interfaces/rpcrequestpayload.md)‹*any[]*› | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### validate |
||||
|
||||
▸ **validate**(`response`: any, `payload?`: any): *true | `Error`* |
||||
|
||||
*Defined in [providers/ws.ts:259](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/ws.ts#L259)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`response` | any | |
||||
`payload?` | any | |
||||
|
||||
**Returns:** *true | `Error`* |
||||
|
||||
## Object literals |
||||
|
||||
### middlewares |
||||
|
||||
### ▪ **middlewares**: *object* |
||||
|
||||
*Inherited from [BaseProvider](baseprovider.md).[middlewares](baseprovider.md#middlewares)* |
||||
|
||||
*Defined in [providers/baseProvider.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L5)* |
||||
|
||||
▪ **request**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L6)* |
||||
|
||||
* **use**(`fn`: [ReqMiddleware](../README.md#reqmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
||||
|
||||
▪ **response**: *object* |
||||
|
||||
*Defined in [providers/baseProvider.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseProvider.ts#L11)* |
||||
|
||||
* **use**(`fn`: [ResMiddleware](../README.md#resmiddleware), `match`: string | [RPCMethod](../enums/rpcmethod.md) | `RegExp`): *void* |
@ -0,0 +1,28 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[EmittType](emitttype.md) / |
||||
|
||||
# Enumeration: EmittType |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [INSTANCE](emitttype.md#instance) |
||||
* [PUBSUB](emitttype.md#pubsub) |
||||
|
||||
## Enumeration members |
||||
|
||||
### INSTANCE |
||||
|
||||
• **INSTANCE**: = "instance" |
||||
|
||||
*Defined in [providers/baseSocket.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### PUBSUB |
||||
|
||||
• **PUBSUB**: = "pubsub" |
||||
|
||||
*Defined in [providers/baseSocket.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L24)* |
@ -0,0 +1,28 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[MiddlewareType](middlewaretype.md) / |
||||
|
||||
# Enumeration: MiddlewareType |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [REQ](middlewaretype.md#req) |
||||
* [RES](middlewaretype.md#res) |
||||
|
||||
## Enumeration members |
||||
|
||||
### REQ |
||||
|
||||
• **REQ**: |
||||
|
||||
*Defined in [types.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### RES |
||||
|
||||
• **RES**: |
||||
|
||||
*Defined in [types.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L8)* |
@ -0,0 +1,145 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[RPCErrorCode](rpcerrorcode.md) / |
||||
|
||||
# Enumeration: RPCErrorCode |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [RPC_DATABASE_ERROR](rpcerrorcode.md#rpc_database_error) |
||||
* [RPC_DESERIALIZATION_ERROR](rpcerrorcode.md#rpc_deserialization_error) |
||||
* [RPC_INTERNAL_ERROR](rpcerrorcode.md#rpc_internal_error) |
||||
* [RPC_INVALID_ADDRESS_OR_KEY](rpcerrorcode.md#rpc_invalid_address_or_key) |
||||
* [RPC_INVALID_PARAMETER](rpcerrorcode.md#rpc_invalid_parameter) |
||||
* [RPC_INVALID_PARAMS](rpcerrorcode.md#rpc_invalid_params) |
||||
* [RPC_INVALID_REQUEST](rpcerrorcode.md#rpc_invalid_request) |
||||
* [RPC_IN_WARMUP](rpcerrorcode.md#rpc_in_warmup) |
||||
* [RPC_METHOD_DEPRECATED](rpcerrorcode.md#rpc_method_deprecated) |
||||
* [RPC_METHOD_NOT_FOUND](rpcerrorcode.md#rpc_method_not_found) |
||||
* [RPC_MISC_ERROR](rpcerrorcode.md#rpc_misc_error) |
||||
* [RPC_PARSE_ERROR](rpcerrorcode.md#rpc_parse_error) |
||||
* [RPC_TYPE_ERROR](rpcerrorcode.md#rpc_type_error) |
||||
* [RPC_VERIFY_ERROR](rpcerrorcode.md#rpc_verify_error) |
||||
* [RPC_VERIFY_REJECTED](rpcerrorcode.md#rpc_verify_rejected) |
||||
|
||||
## Enumeration members |
||||
|
||||
### RPC_DATABASE_ERROR |
||||
|
||||
• **RPC_DATABASE_ERROR**: = -20 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:88](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L88)* |
||||
|
||||
___ |
||||
|
||||
### RPC_DESERIALIZATION_ERROR |
||||
|
||||
• **RPC_DESERIALIZATION_ERROR**: = -22 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:89](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L89)* |
||||
|
||||
___ |
||||
|
||||
### RPC_INTERNAL_ERROR |
||||
|
||||
• **RPC_INTERNAL_ERROR**: = -32603 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:80](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L80)* |
||||
|
||||
___ |
||||
|
||||
### RPC_INVALID_ADDRESS_OR_KEY |
||||
|
||||
• **RPC_INVALID_ADDRESS_OR_KEY**: = -5 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:86](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L86)* |
||||
|
||||
___ |
||||
|
||||
### RPC_INVALID_PARAMETER |
||||
|
||||
• **RPC_INVALID_PARAMETER**: = -8 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:87](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L87)* |
||||
|
||||
___ |
||||
|
||||
### RPC_INVALID_PARAMS |
||||
|
||||
• **RPC_INVALID_PARAMS**: = -32602 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:77](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L77)* |
||||
|
||||
___ |
||||
|
||||
### RPC_INVALID_REQUEST |
||||
|
||||
• **RPC_INVALID_REQUEST**: = -32600 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:73](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L73)* |
||||
|
||||
___ |
||||
|
||||
### RPC_IN_WARMUP |
||||
|
||||
• **RPC_IN_WARMUP**: = -28 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:92](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L92)* |
||||
|
||||
___ |
||||
|
||||
### RPC_METHOD_DEPRECATED |
||||
|
||||
• **RPC_METHOD_DEPRECATED**: = -32 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:93](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L93)* |
||||
|
||||
___ |
||||
|
||||
### RPC_METHOD_NOT_FOUND |
||||
|
||||
• **RPC_METHOD_NOT_FOUND**: = -32601 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:76](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L76)* |
||||
|
||||
___ |
||||
|
||||
### RPC_MISC_ERROR |
||||
|
||||
• **RPC_MISC_ERROR**: = -1 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:84](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L84)* |
||||
|
||||
___ |
||||
|
||||
### RPC_PARSE_ERROR |
||||
|
||||
• **RPC_PARSE_ERROR**: = -32700 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:81](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L81)* |
||||
|
||||
___ |
||||
|
||||
### RPC_TYPE_ERROR |
||||
|
||||
• **RPC_TYPE_ERROR**: = -3 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:85](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L85)* |
||||
|
||||
___ |
||||
|
||||
### RPC_VERIFY_ERROR |
||||
|
||||
• **RPC_VERIFY_ERROR**: = -25 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:90](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L90)* |
||||
|
||||
___ |
||||
|
||||
### RPC_VERIFY_REJECTED |
||||
|
||||
• **RPC_VERIFY_REJECTED**: = -26 |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:91](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L91)* |
@ -0,0 +1,289 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[RPCMethod](rpcmethod.md) / |
||||
|
||||
# Enumeration: RPCMethod |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [BlockNumber](rpcmethod.md#blocknumber) |
||||
* [Call](rpcmethod.md#call) |
||||
* [EstimateGas](rpcmethod.md#estimategas) |
||||
* [GasPrice](rpcmethod.md#gasprice) |
||||
* [GetBalance](rpcmethod.md#getbalance) |
||||
* [GetBlockByHash](rpcmethod.md#getblockbyhash) |
||||
* [GetBlockByNumber](rpcmethod.md#getblockbynumber) |
||||
* [GetBlockTransactionCountByHash](rpcmethod.md#getblocktransactioncountbyhash) |
||||
* [GetBlockTransactionCountByNumber](rpcmethod.md#getblocktransactioncountbynumber) |
||||
* [GetCode](rpcmethod.md#getcode) |
||||
* [GetFilterChanges](rpcmethod.md#getfilterchanges) |
||||
* [GetPastLogs](rpcmethod.md#getpastlogs) |
||||
* [GetProof](rpcmethod.md#getproof) |
||||
* [GetStorageAt](rpcmethod.md#getstorageat) |
||||
* [GetTransactionByBlockHashAndIndex](rpcmethod.md#gettransactionbyblockhashandindex) |
||||
* [GetTransactionByBlockNumberAndIndex](rpcmethod.md#gettransactionbyblocknumberandindex) |
||||
* [GetTransactionByHash](rpcmethod.md#gettransactionbyhash) |
||||
* [GetTransactionCount](rpcmethod.md#gettransactioncount) |
||||
* [GetTransactionReceipt](rpcmethod.md#gettransactionreceipt) |
||||
* [GetWork](rpcmethod.md#getwork) |
||||
* [NetVersion](rpcmethod.md#netversion) |
||||
* [NewBlockFilter](rpcmethod.md#newblockfilter) |
||||
* [NewFilter](rpcmethod.md#newfilter) |
||||
* [NewPendingTransactionFilter](rpcmethod.md#newpendingtransactionfilter) |
||||
* [PeerCount](rpcmethod.md#peercount) |
||||
* [ProtocalVersion](rpcmethod.md#protocalversion) |
||||
* [SendRawTransaction](rpcmethod.md#sendrawtransaction) |
||||
* [SendTransaction](rpcmethod.md#sendtransaction) |
||||
* [Subscribe](rpcmethod.md#subscribe) |
||||
* [Syncing](rpcmethod.md#syncing) |
||||
* [UnSubscribe](rpcmethod.md#unsubscribe) |
||||
|
||||
## Enumeration members |
||||
|
||||
### BlockNumber |
||||
|
||||
• **BlockNumber**: = "hmy_blockNumber" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:60](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L60)* |
||||
|
||||
___ |
||||
|
||||
### Call |
||||
|
||||
• **Call**: = "hmy_call" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:54](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L54)* |
||||
|
||||
___ |
||||
|
||||
### EstimateGas |
||||
|
||||
• **EstimateGas**: = "hmy_estimateGas" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:56](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L56)* |
||||
|
||||
___ |
||||
|
||||
### GasPrice |
||||
|
||||
• **GasPrice**: = "hmy_gasPrice" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:58](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L58)* |
||||
|
||||
___ |
||||
|
||||
### GetBalance |
||||
|
||||
• **GetBalance**: = "hmy_getBalance" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:26](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L26)* |
||||
|
||||
___ |
||||
|
||||
### GetBlockByHash |
||||
|
||||
• **GetBlockByHash**: = "hmy_getBlockByHash" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:3](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L3)* |
||||
|
||||
___ |
||||
|
||||
### GetBlockByNumber |
||||
|
||||
• **GetBlockByNumber**: = "hmy_getBlockByNumber" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### GetBlockTransactionCountByHash |
||||
|
||||
• **GetBlockTransactionCountByHash**: = "hmy_getBlockTransactionCountByHash" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### GetBlockTransactionCountByNumber |
||||
|
||||
• **GetBlockTransactionCountByNumber**: = "hmy_getBlockTransactionCountByNumber" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### GetCode |
||||
|
||||
• **GetCode**: = "hmy_getCode" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### GetFilterChanges |
||||
|
||||
• **GetFilterChanges**: = "hmy_getFilterChanges" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L46)* |
||||
|
||||
___ |
||||
|
||||
### GetPastLogs |
||||
|
||||
• **GetPastLogs**: = "hmy_getLogs" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:38](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L38)* |
||||
|
||||
___ |
||||
|
||||
### GetProof |
||||
|
||||
• **GetProof**: = "hmy_getProof" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L44)* |
||||
|
||||
___ |
||||
|
||||
### GetStorageAt |
||||
|
||||
• **GetStorageAt**: = "hmy_getStorageAt" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L28)* |
||||
|
||||
___ |
||||
|
||||
### GetTransactionByBlockHashAndIndex |
||||
|
||||
• **GetTransactionByBlockHashAndIndex**: = "hmy_getTransactionByBlockHashAndIndex" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L13)* |
||||
|
||||
___ |
||||
|
||||
### GetTransactionByBlockNumberAndIndex |
||||
|
||||
• **GetTransactionByBlockNumberAndIndex**: = "hmy_getTransactionByBlockNumberAndIndex" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L15)* |
||||
|
||||
___ |
||||
|
||||
### GetTransactionByHash |
||||
|
||||
• **GetTransactionByHash**: = "hmy_getTransactionByHash" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L17)* |
||||
|
||||
___ |
||||
|
||||
### GetTransactionCount |
||||
|
||||
• **GetTransactionCount**: = "hmy_getTransactionCount" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L30)* |
||||
|
||||
___ |
||||
|
||||
### GetTransactionReceipt |
||||
|
||||
• **GetTransactionReceipt**: = "hmy_getTransactionReceipt" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### GetWork |
||||
|
||||
• **GetWork**: = "hmy_getWork" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L40)* |
||||
|
||||
___ |
||||
|
||||
### NetVersion |
||||
|
||||
• **NetVersion**: = "net_version" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:64](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L64)* |
||||
|
||||
___ |
||||
|
||||
### NewBlockFilter |
||||
|
||||
• **NewBlockFilter**: = "hmy_newBlockFilter" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:50](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L50)* |
||||
|
||||
___ |
||||
|
||||
### NewFilter |
||||
|
||||
• **NewFilter**: = "hmy_newFilter" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:52](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L52)* |
||||
|
||||
___ |
||||
|
||||
### NewPendingTransactionFilter |
||||
|
||||
• **NewPendingTransactionFilter**: = "hmy_newPendingTransactionFilter" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L48)* |
||||
|
||||
___ |
||||
|
||||
### PeerCount |
||||
|
||||
• **PeerCount**: = "net_peerCount" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### ProtocalVersion |
||||
|
||||
• **ProtocalVersion**: = "hmy_protocolVersion" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:66](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L66)* |
||||
|
||||
___ |
||||
|
||||
### SendRawTransaction |
||||
|
||||
• **SendRawTransaction**: = "hmy_sendRawTransaction" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L34)* |
||||
|
||||
___ |
||||
|
||||
### SendTransaction |
||||
|
||||
• **SendTransaction**: = "hmy_sendTransaction" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:32](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L32)* |
||||
|
||||
___ |
||||
|
||||
### Subscribe |
||||
|
||||
• **Subscribe**: = "hmy_subscribe" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:36](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L36)* |
||||
|
||||
___ |
||||
|
||||
### Syncing |
||||
|
||||
• **Syncing**: = "hmy_syncing" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L21)* |
||||
|
||||
___ |
||||
|
||||
### UnSubscribe |
||||
|
||||
• **UnSubscribe**: = "hmy_unsubscribe" |
||||
|
||||
*Defined in [rpcMethod/rpc.ts:62](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/rpcMethod/rpc.ts#L62)* |
@ -0,0 +1,46 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[SocketConnection](socketconnection.md) / |
||||
|
||||
# Enumeration: SocketConnection |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [CLOSE](socketconnection.md#close) |
||||
* [CONNECT](socketconnection.md#connect) |
||||
* [ERROR](socketconnection.md#error) |
||||
* [READY](socketconnection.md#ready) |
||||
|
||||
## Enumeration members |
||||
|
||||
### CLOSE |
||||
|
||||
• **CLOSE**: = "close" |
||||
|
||||
*Defined in [providers/baseSocket.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### CONNECT |
||||
|
||||
• **CONNECT**: = "connect" |
||||
|
||||
*Defined in [providers/baseSocket.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### ERROR |
||||
|
||||
• **ERROR**: = "error" |
||||
|
||||
*Defined in [providers/baseSocket.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### READY |
||||
|
||||
• **READY**: = "ready" |
||||
|
||||
*Defined in [providers/baseSocket.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L6)* |
@ -0,0 +1,73 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[SocketState](socketstate.md) / |
||||
|
||||
# Enumeration: SocketState |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [SOCKET_ACCOUNTS_CHANGED](socketstate.md#socket_accounts_changed) |
||||
* [SOCKET_CLOSE](socketstate.md#socket_close) |
||||
* [SOCKET_CONNECT](socketstate.md#socket_connect) |
||||
* [SOCKET_ERROR](socketstate.md#socket_error) |
||||
* [SOCKET_MESSAGE](socketstate.md#socket_message) |
||||
* [SOCKET_NETWORK_CHANGED](socketstate.md#socket_network_changed) |
||||
* [SOCKET_READY](socketstate.md#socket_ready) |
||||
|
||||
## Enumeration members |
||||
|
||||
### SOCKET_ACCOUNTS_CHANGED |
||||
|
||||
• **SOCKET_ACCOUNTS_CHANGED**: = "socket_accountsChanged" |
||||
|
||||
*Defined in [providers/baseSocket.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L19)* |
||||
|
||||
___ |
||||
|
||||
### SOCKET_CLOSE |
||||
|
||||
• **SOCKET_CLOSE**: = "socket_close" |
||||
|
||||
*Defined in [providers/baseSocket.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L15)* |
||||
|
||||
___ |
||||
|
||||
### SOCKET_CONNECT |
||||
|
||||
• **SOCKET_CONNECT**: = "socket_connect" |
||||
|
||||
*Defined in [providers/baseSocket.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L17)* |
||||
|
||||
___ |
||||
|
||||
### SOCKET_ERROR |
||||
|
||||
• **SOCKET_ERROR**: = "socket_error" |
||||
|
||||
*Defined in [providers/baseSocket.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L16)* |
||||
|
||||
___ |
||||
|
||||
### SOCKET_MESSAGE |
||||
|
||||
• **SOCKET_MESSAGE**: = "socket_message" |
||||
|
||||
*Defined in [providers/baseSocket.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L13)* |
||||
|
||||
___ |
||||
|
||||
### SOCKET_NETWORK_CHANGED |
||||
|
||||
• **SOCKET_NETWORK_CHANGED**: = "socket_networkChanged" |
||||
|
||||
*Defined in [providers/baseSocket.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### SOCKET_READY |
||||
|
||||
• **SOCKET_READY**: = "socket_ready" |
||||
|
||||
*Defined in [providers/baseSocket.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/providers/baseSocket.ts#L14)* |
@ -0,0 +1,37 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[SubscribeReturns](subscribereturns.md) / |
||||
|
||||
# Enumeration: SubscribeReturns |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [all](subscribereturns.md#all) |
||||
* [id](subscribereturns.md#id) |
||||
* [method](subscribereturns.md#method) |
||||
|
||||
## Enumeration members |
||||
|
||||
### all |
||||
|
||||
• **all**: = "all" |
||||
|
||||
*Defined in [types.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L12)* |
||||
|
||||
___ |
||||
|
||||
### id |
||||
|
||||
• **id**: = "id" |
||||
|
||||
*Defined in [types.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L13)* |
||||
|
||||
___ |
||||
|
||||
### method |
||||
|
||||
• **method**: = "method" |
||||
|
||||
*Defined in [types.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L14)* |
@ -0,0 +1,32 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[Middleware](middleware.md) / |
||||
|
||||
# Interface: Middleware |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Middleware** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [request](middleware.md#request) |
||||
* [response](middleware.md#response) |
||||
|
||||
## Properties |
||||
|
||||
### request |
||||
|
||||
• **request**: *object* |
||||
|
||||
*Defined in [types.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### response |
||||
|
||||
• **response**: *object* |
||||
|
||||
*Defined in [types.ts:19](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L19)* |
@ -0,0 +1,41 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[RPCError](rpcerror.md) / |
||||
|
||||
# Interface: RPCError |
||||
|
||||
## Hierarchy |
||||
|
||||
* **RPCError** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [code](rpcerror.md#code) |
||||
* [data](rpcerror.md#data) |
||||
* [message](rpcerror.md#message) |
||||
|
||||
## Properties |
||||
|
||||
### code |
||||
|
||||
• **code**: *[RPCErrorCode](../enums/rpcerrorcode.md)* |
||||
|
||||
*Defined in [types.ts:51](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L51)* |
||||
|
||||
___ |
||||
|
||||
### data |
||||
|
||||
• **data**: *any* |
||||
|
||||
*Defined in [types.ts:53](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L53)* |
||||
|
||||
___ |
||||
|
||||
### message |
||||
|
||||
• **message**: *string* |
||||
|
||||
*Defined in [types.ts:52](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L52)* |
@ -0,0 +1,45 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[RPCRequest](rpcrequest.md) / |
||||
|
||||
# Interface: RPCRequest <**T**> |
||||
|
||||
## Type parameters |
||||
|
||||
▪ **T** |
||||
|
||||
## Hierarchy |
||||
|
||||
* **RPCRequest** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [options](rpcrequest.md#options) |
||||
* [payload](rpcrequest.md#payload) |
||||
* [url](rpcrequest.md#url) |
||||
|
||||
## Properties |
||||
|
||||
### options |
||||
|
||||
• **options**: *[RPCRequestOptions](rpcrequestoptions.md)* |
||||
|
||||
*Defined in [types.ts:37](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L37)* |
||||
|
||||
___ |
||||
|
||||
### payload |
||||
|
||||
• **payload**: *[RPCRequestPayload](rpcrequestpayload.md)‹*`T`*›* |
||||
|
||||
*Defined in [types.ts:36](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L36)* |
||||
|
||||
___ |
||||
|
||||
### url |
||||
|
||||
• **url**: *string* |
||||
|
||||
*Defined in [types.ts:35](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L35)* |
@ -0,0 +1,32 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[RPCRequestOptions](rpcrequestoptions.md) / |
||||
|
||||
# Interface: RPCRequestOptions |
||||
|
||||
## Hierarchy |
||||
|
||||
* **RPCRequestOptions** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [headers](rpcrequestoptions.md#headers) |
||||
* [method](rpcrequestoptions.md#method) |
||||
|
||||
## Properties |
||||
|
||||
### headers |
||||
|
||||
• **headers**: *[]* |
||||
|
||||
*Defined in [types.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L30)* |
||||
|
||||
___ |
||||
|
||||
### method |
||||
|
||||
• **method**: *string* |
||||
|
||||
*Defined in [types.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L31)* |
@ -0,0 +1,54 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[RPCRequestPayload](rpcrequestpayload.md) / |
||||
|
||||
# Interface: RPCRequestPayload <**T**> |
||||
|
||||
## Type parameters |
||||
|
||||
▪ **T** |
||||
|
||||
## Hierarchy |
||||
|
||||
* **RPCRequestPayload** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [id](rpcrequestpayload.md#id) |
||||
* [jsonrpc](rpcrequestpayload.md#jsonrpc) |
||||
* [method](rpcrequestpayload.md#method) |
||||
* [params](rpcrequestpayload.md#params) |
||||
|
||||
## Properties |
||||
|
||||
### id |
||||
|
||||
• **id**: *number* |
||||
|
||||
*Defined in [types.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### jsonrpc |
||||
|
||||
• **jsonrpc**: *string* |
||||
|
||||
*Defined in [types.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L24)* |
||||
|
||||
___ |
||||
|
||||
### method |
||||
|
||||
• **method**: *[RPCMethod](../enums/rpcmethod.md) | string* |
||||
|
||||
*Defined in [types.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L25)* |
||||
|
||||
___ |
||||
|
||||
### params |
||||
|
||||
• **params**: *`T`* |
||||
|
||||
*Defined in [types.ts:26](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L26)* |
@ -0,0 +1,34 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[RPCResponseBase](rpcresponsebase.md) / |
||||
|
||||
# Interface: RPCResponseBase |
||||
|
||||
## Hierarchy |
||||
|
||||
* **RPCResponseBase** |
||||
|
||||
* [RPCResponseBody](rpcresponsebody.md) |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [id](rpcresponsebase.md#id) |
||||
* [jsonrpc](rpcresponsebase.md#jsonrpc) |
||||
|
||||
## Properties |
||||
|
||||
### id |
||||
|
||||
• **id**: *string* |
||||
|
||||
*Defined in [types.ts:42](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L42)* |
||||
|
||||
___ |
||||
|
||||
### jsonrpc |
||||
|
||||
• **jsonrpc**: *string* |
||||
|
||||
*Defined in [types.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L41)* |
@ -0,0 +1,62 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[RPCResponseBody](rpcresponsebody.md) / |
||||
|
||||
# Interface: RPCResponseBody <**R, E**> |
||||
|
||||
## Type parameters |
||||
|
||||
▪ **R** |
||||
|
||||
▪ **E** |
||||
|
||||
## Hierarchy |
||||
|
||||
* [RPCResponseBase](rpcresponsebase.md) |
||||
|
||||
* **RPCResponseBody** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [error](rpcresponsebody.md#error) |
||||
* [id](rpcresponsebody.md#id) |
||||
* [jsonrpc](rpcresponsebody.md#jsonrpc) |
||||
* [result](rpcresponsebody.md#result) |
||||
|
||||
## Properties |
||||
|
||||
### error |
||||
|
||||
• **error**: *`E`* |
||||
|
||||
*Defined in [types.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L47)* |
||||
|
||||
___ |
||||
|
||||
### id |
||||
|
||||
• **id**: *string* |
||||
|
||||
*Inherited from [RPCResponseBase](rpcresponsebase.md).[id](rpcresponsebase.md#id)* |
||||
|
||||
*Defined in [types.ts:42](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L42)* |
||||
|
||||
___ |
||||
|
||||
### jsonrpc |
||||
|
||||
• **jsonrpc**: *string* |
||||
|
||||
*Inherited from [RPCResponseBase](rpcresponsebase.md).[jsonrpc](rpcresponsebase.md#jsonrpc)* |
||||
|
||||
*Defined in [types.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L41)* |
||||
|
||||
___ |
||||
|
||||
### result |
||||
|
||||
• **result**: *`R`* |
||||
|
||||
*Defined in [types.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L46)* |
@ -0,0 +1,50 @@ |
||||
> **[@harmony-js/network](../README.md)** |
||||
|
||||
[RPCResult](rpcresult.md) / |
||||
|
||||
# Interface: RPCResult |
||||
|
||||
## Hierarchy |
||||
|
||||
* **RPCResult** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [raw](rpcresult.md#raw) |
||||
* [resultList](rpcresult.md#resultlist) |
||||
* [resultMap](rpcresult.md#resultmap) |
||||
* [resultString](rpcresult.md#resultstring) |
||||
|
||||
## Properties |
||||
|
||||
### raw |
||||
|
||||
• **raw**: *any* |
||||
|
||||
*Defined in [types.ts:60](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L60)* |
||||
|
||||
___ |
||||
|
||||
### resultList |
||||
|
||||
• **resultList**: *any[]* |
||||
|
||||
*Defined in [types.ts:59](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L59)* |
||||
|
||||
___ |
||||
|
||||
### resultMap |
||||
|
||||
• **resultMap**: *`Map<string, any>`* |
||||
|
||||
*Defined in [types.ts:58](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L58)* |
||||
|
||||
___ |
||||
|
||||
### resultString |
||||
|
||||
• **resultString**: *string* |
||||
|
||||
*Defined in [types.ts:57](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-network/src/types.ts#L57)* |
@ -0,0 +1,174 @@ |
||||
> **[@harmony-js/transaction](README.md)** |
||||
|
||||
## Index |
||||
|
||||
### Enumerations |
||||
|
||||
* [TransactionEvents](enums/transactionevents.md) |
||||
* [TxStatus](enums/txstatus.md) |
||||
|
||||
### Classes |
||||
|
||||
* [Transaction](classes/transaction.md) |
||||
* [TransactionFactory](classes/transactionfactory.md) |
||||
|
||||
### Interfaces |
||||
|
||||
* [TransasctionReceipt](interfaces/transasctionreceipt.md) |
||||
* [TxParams](interfaces/txparams.md) |
||||
|
||||
### Variables |
||||
|
||||
* [defaultMessenger](README.md#const-defaultmessenger) |
||||
* [transactionFields](README.md#const-transactionfields) |
||||
* [transactionFieldsETH](README.md#const-transactionfieldseth) |
||||
|
||||
### Functions |
||||
|
||||
* [RLPSign](README.md#const-rlpsign) |
||||
* [handleAddress](README.md#const-handleaddress) |
||||
* [handleNumber](README.md#const-handlenumber) |
||||
* [recover](README.md#const-recover) |
||||
* [recoverETH](README.md#const-recovereth) |
||||
* [sleep](README.md#const-sleep) |
||||
|
||||
## Variables |
||||
|
||||
### `Const` defaultMessenger |
||||
|
||||
• **defaultMessenger**: *`Messenger`* = new Messenger( |
||||
new HttpProvider('http://localhost:8545'), |
||||
ChainType.Harmony, |
||||
) |
||||
|
||||
*Defined in [utils.ts:259](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L259)* |
||||
|
||||
___ |
||||
|
||||
### `Const` transactionFields |
||||
|
||||
• **transactionFields**: *object | object | object[]* = [ |
||||
{ name: 'nonce', length: 32, fix: false }, |
||||
{ name: 'gasPrice', length: 32, fix: false, transform: 'hex' }, |
||||
{ name: 'gasLimit', length: 32, fix: false, transform: 'hex' }, |
||||
{ name: 'shardID', length: 16, fix: false }, |
||||
// recover it after main repo fix |
||||
{ name: 'toShardID', length: 16, fix: false }, |
||||
{ name: 'to', length: 20, fix: true }, |
||||
{ name: 'value', length: 32, fix: false, transform: 'hex' }, |
||||
{ name: 'data', fix: false }, |
||||
] |
||||
|
||||
*Defined in [utils.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L24)* |
||||
|
||||
___ |
||||
|
||||
### `Const` transactionFieldsETH |
||||
|
||||
• **transactionFieldsETH**: *object | object | object[]* = [ |
||||
{ name: 'nonce', length: 32, fix: false }, |
||||
{ name: 'gasPrice', length: 32, fix: false, transform: 'hex' }, |
||||
{ name: 'gasLimit', length: 32, fix: false, transform: 'hex' }, |
||||
{ name: 'to', length: 20, fix: true }, |
||||
{ name: 'value', length: 32, fix: false, transform: 'hex' }, |
||||
{ name: 'data', fix: false }, |
||||
] |
||||
|
||||
*Defined in [utils.ts:36](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L36)* |
||||
|
||||
## Functions |
||||
|
||||
### `Const` RLPSign |
||||
|
||||
▸ **RLPSign**(`transaction`: [Transaction](classes/transaction.md), `prv`: string): *[`Signature`, string]* |
||||
|
||||
*Defined in [utils.ts:264](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L264)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`transaction` | [Transaction](classes/transaction.md) | |
||||
`prv` | string | |
||||
|
||||
**Returns:** *[`Signature`, string]* |
||||
|
||||
___ |
||||
|
||||
### `Const` handleAddress |
||||
|
||||
▸ **handleAddress**(`value`: string): *string* |
||||
|
||||
*Defined in [utils.ts:55](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L55)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Const` handleNumber |
||||
|
||||
▸ **handleNumber**(`value`: string): *string* |
||||
|
||||
*Defined in [utils.ts:45](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L45)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`value` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Const` recover |
||||
|
||||
▸ **recover**(`rawTransaction`: string): *[TxParams](interfaces/txparams.md)* |
||||
|
||||
*Defined in [utils.ts:65](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L65)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`rawTransaction` | string | |
||||
|
||||
**Returns:** *[TxParams](interfaces/txparams.md)* |
||||
|
||||
___ |
||||
|
||||
### `Const` recoverETH |
||||
|
||||
▸ **recoverETH**(`rawTransaction`: string): *[TxParams](interfaces/txparams.md)* |
||||
|
||||
*Defined in [utils.ts:156](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L156)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`rawTransaction` | string | |
||||
|
||||
**Returns:** *[TxParams](interfaces/txparams.md)* |
||||
|
||||
___ |
||||
|
||||
### `Const` sleep |
||||
|
||||
▸ **sleep**(`ms`: number): *`Promise<unknown>`* |
||||
|
||||
*Defined in [utils.ts:247](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L247)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`ms` | number | |
||||
|
||||
**Returns:** *`Promise<unknown>`* |
@ -0,0 +1,642 @@ |
||||
> **[@harmony-js/transaction](../README.md)** |
||||
|
||||
[Transaction](transaction.md) / |
||||
|
||||
# Class: Transaction |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Transaction** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](transaction.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [blockNumbers](transaction.md#blocknumbers) |
||||
* [chainId](transaction.md#private-chainid) |
||||
* [confirmationCheck](transaction.md#confirmationcheck) |
||||
* [confirmations](transaction.md#confirmations) |
||||
* [data](transaction.md#private-data) |
||||
* [emitter](transaction.md#emitter) |
||||
* [from](transaction.md#private-from) |
||||
* [gasLimit](transaction.md#private-gaslimit) |
||||
* [gasPrice](transaction.md#private-gasprice) |
||||
* [id](transaction.md#private-id) |
||||
* [messenger](transaction.md#messenger) |
||||
* [nonce](transaction.md#private-nonce) |
||||
* [rawTransaction](transaction.md#private-rawtransaction) |
||||
* [receipt](transaction.md#optional-receipt) |
||||
* [shardID](transaction.md#private-shardid) |
||||
* [signature](transaction.md#private-signature) |
||||
* [to](transaction.md#private-to) |
||||
* [toShardID](transaction.md#private-toshardid) |
||||
* [txStatus](transaction.md#txstatus) |
||||
* [unsignedRawTransaction](transaction.md#private-unsignedrawtransaction) |
||||
* [value](transaction.md#private-value) |
||||
|
||||
### Accessors |
||||
|
||||
* [txParams](transaction.md#txparams) |
||||
* [txPayload](transaction.md#txpayload) |
||||
|
||||
### Methods |
||||
|
||||
* [confirm](transaction.md#confirm) |
||||
* [emitConfirm](transaction.md#emitconfirm) |
||||
* [emitError](transaction.md#emiterror) |
||||
* [emitReceipt](transaction.md#emitreceipt) |
||||
* [emitTransactionHash](transaction.md#emittransactionhash) |
||||
* [getBlockByNumber](transaction.md#getblockbynumber) |
||||
* [getBlockNumber](transaction.md#getblocknumber) |
||||
* [getRLPSigned](transaction.md#getrlpsigned) |
||||
* [getRLPUnsigned](transaction.md#getrlpunsigned) |
||||
* [getTxStatus](transaction.md#gettxstatus) |
||||
* [isConfirmed](transaction.md#isconfirmed) |
||||
* [isInitialized](transaction.md#isinitialized) |
||||
* [isPending](transaction.md#ispending) |
||||
* [isRejected](transaction.md#isrejected) |
||||
* [isSigned](transaction.md#issigned) |
||||
* [map](transaction.md#map) |
||||
* [normalizeAddress](transaction.md#normalizeaddress) |
||||
* [observed](transaction.md#observed) |
||||
* [recover](transaction.md#recover) |
||||
* [sendTransaction](transaction.md#sendtransaction) |
||||
* [setMessenger](transaction.md#setmessenger) |
||||
* [setParams](transaction.md#setparams) |
||||
* [setTxStatus](transaction.md#settxstatus) |
||||
* [socketConfirm](transaction.md#socketconfirm) |
||||
* [trackTx](transaction.md#tracktx) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new Transaction**(`params?`: [TxParams](../interfaces/txparams.md) | any, `messenger`: `Messenger`, `txStatus`: [TxStatus](../enums/txstatus.md)): *[Transaction](transaction.md)* |
||||
|
||||
*Defined in [transaction.ts:54](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L54)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`params?` | [TxParams](../interfaces/txparams.md) \| any | - | |
||||
`messenger` | `Messenger` | defaultMessenger | |
||||
`txStatus` | [TxStatus](../enums/txstatus.md) | TxStatus.INTIALIZED | |
||||
|
||||
**Returns:** *[Transaction](transaction.md)* |
||||
|
||||
## Properties |
||||
|
||||
### blockNumbers |
||||
|
||||
• **blockNumbers**: *string[]* = [] |
||||
|
||||
*Defined in [transaction.ts:37](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L37)* |
||||
|
||||
___ |
||||
|
||||
### `Private` chainId |
||||
|
||||
• **chainId**: *number* |
||||
|
||||
*Defined in [transaction.ts:51](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L51)* |
||||
|
||||
___ |
||||
|
||||
### confirmationCheck |
||||
|
||||
• **confirmationCheck**: *number* = 0 |
||||
|
||||
*Defined in [transaction.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L39)* |
||||
|
||||
___ |
||||
|
||||
### confirmations |
||||
|
||||
• **confirmations**: *number* = 0 |
||||
|
||||
*Defined in [transaction.ts:38](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L38)* |
||||
|
||||
___ |
||||
|
||||
### `Private` data |
||||
|
||||
• **data**: *string* |
||||
|
||||
*Defined in [transaction.ts:49](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L49)* |
||||
|
||||
___ |
||||
|
||||
### emitter |
||||
|
||||
• **emitter**: *`Emitter`* |
||||
|
||||
*Defined in [transaction.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L34)* |
||||
|
||||
___ |
||||
|
||||
### `Private` from |
||||
|
||||
• **from**: *string* |
||||
|
||||
*Defined in [transaction.ts:42](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L42)* |
||||
|
||||
___ |
||||
|
||||
### `Private` gasLimit |
||||
|
||||
• **gasLimit**: *`BN`* |
||||
|
||||
*Defined in [transaction.ts:47](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L47)* |
||||
|
||||
___ |
||||
|
||||
### `Private` gasPrice |
||||
|
||||
• **gasPrice**: *`BN`* |
||||
|
||||
*Defined in [transaction.ts:48](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L48)* |
||||
|
||||
___ |
||||
|
||||
### `Private` id |
||||
|
||||
• **id**: *string* |
||||
|
||||
*Defined in [transaction.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L41)* |
||||
|
||||
___ |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *`Messenger`* |
||||
|
||||
*Defined in [transaction.ts:35](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L35)* |
||||
|
||||
___ |
||||
|
||||
### `Private` nonce |
||||
|
||||
• **nonce**: *number | string* |
||||
|
||||
*Defined in [transaction.ts:43](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L43)* |
||||
|
||||
___ |
||||
|
||||
### `Private` rawTransaction |
||||
|
||||
• **rawTransaction**: *string* |
||||
|
||||
*Defined in [transaction.ts:52](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L52)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` receipt |
||||
|
||||
• **receipt**? : *[TransasctionReceipt](../interfaces/transasctionreceipt.md)* |
||||
|
||||
*Defined in [transaction.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L40)* |
||||
|
||||
___ |
||||
|
||||
### `Private` shardID |
||||
|
||||
• **shardID**: *number | string* |
||||
|
||||
*Defined in [transaction.ts:45](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L45)* |
||||
|
||||
___ |
||||
|
||||
### `Private` signature |
||||
|
||||
• **signature**: *`Signature`* |
||||
|
||||
*Defined in [transaction.ts:54](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L54)* |
||||
|
||||
___ |
||||
|
||||
### `Private` to |
||||
|
||||
• **to**: *string* |
||||
|
||||
*Defined in [transaction.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L44)* |
||||
|
||||
___ |
||||
|
||||
### `Private` toShardID |
||||
|
||||
• **toShardID**: *number | string* |
||||
|
||||
*Defined in [transaction.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L46)* |
||||
|
||||
___ |
||||
|
||||
### txStatus |
||||
|
||||
• **txStatus**: *[TxStatus](../enums/txstatus.md)* |
||||
|
||||
*Defined in [transaction.ts:36](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L36)* |
||||
|
||||
___ |
||||
|
||||
### `Private` unsignedRawTransaction |
||||
|
||||
• **unsignedRawTransaction**: *string* |
||||
|
||||
*Defined in [transaction.ts:53](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L53)* |
||||
|
||||
___ |
||||
|
||||
### `Private` value |
||||
|
||||
• **value**: *`BN`* |
||||
|
||||
*Defined in [transaction.ts:50](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L50)* |
||||
|
||||
## Accessors |
||||
|
||||
### txParams |
||||
|
||||
• **get txParams**(): *[TxParams](../interfaces/txparams.md)* |
||||
|
||||
*Defined in [transaction.ts:195](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L195)* |
||||
|
||||
**Returns:** *[TxParams](../interfaces/txparams.md)* |
||||
|
||||
___ |
||||
|
||||
### txPayload |
||||
|
||||
• **get txPayload**(): *object* |
||||
|
||||
*Defined in [transaction.ts:179](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L179)* |
||||
|
||||
**Returns:** *object* |
||||
|
||||
* **data**: *string* = this.txParams.data || '0x' |
||||
|
||||
* **from**: *string* = this.txParams.from || '0x' |
||||
|
||||
* **gas**: *string* = this.txParams.gasLimit ? numberToHex(this.txParams.gasLimit) : '0x' |
||||
|
||||
* **gasPrice**: *string* = this.txParams.gasPrice |
||||
? numberToHex(this.txParams.gasPrice) |
||||
: '0x' |
||||
|
||||
* **nonce**: *string* = this.txParams.nonce ? numberToHex(this.nonce) : '0x' |
||||
|
||||
* **shardID**: *string* = this.txParams.shardID ? numberToHex(this.shardID) : '0x' |
||||
|
||||
* **to**: *string* = this.txParams.to || '0x' |
||||
|
||||
* **toShardID**: *string* = this.txParams.toShardID ? numberToHex(this.toShardID) : '0x' |
||||
|
||||
* **value**: *string* = this.txParams.value ? numberToHex(this.txParams.value) : '0x' |
||||
|
||||
## Methods |
||||
|
||||
### confirm |
||||
|
||||
▸ **confirm**(`txHash`: string, `maxAttempts`: number, `interval`: number): *`Promise<Transaction>`* |
||||
|
||||
*Defined in [transaction.ts:353](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L353)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`txHash` | string | - | |
||||
`maxAttempts` | number | 20 | |
||||
`interval` | number | 1000 | |
||||
|
||||
**Returns:** *`Promise<Transaction>`* |
||||
|
||||
___ |
||||
|
||||
### emitConfirm |
||||
|
||||
▸ **emitConfirm**(`data`: any): *void* |
||||
|
||||
*Defined in [transaction.ts:456](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L456)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`data` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### emitError |
||||
|
||||
▸ **emitError**(`error`: any): *void* |
||||
|
||||
*Defined in [transaction.ts:453](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L453)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`error` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### emitReceipt |
||||
|
||||
▸ **emitReceipt**(`receipt`: any): *void* |
||||
|
||||
*Defined in [transaction.ts:450](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L450)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`receipt` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### emitTransactionHash |
||||
|
||||
▸ **emitTransactionHash**(`transactionHash`: string): *void* |
||||
|
||||
*Defined in [transaction.ts:447](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L447)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`transactionHash` | string | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### getBlockByNumber |
||||
|
||||
▸ **getBlockByNumber**(`blockNumber`: string): *`Promise<any>`* |
||||
|
||||
*Defined in [transaction.ts:471](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L471)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`blockNumber` | string | |
||||
|
||||
**Returns:** *`Promise<any>`* |
||||
|
||||
___ |
||||
|
||||
### getBlockNumber |
||||
|
||||
▸ **getBlockNumber**(): *`Promise<BN>`* |
||||
|
||||
*Defined in [transaction.ts:460](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L460)* |
||||
|
||||
**Returns:** *`Promise<BN>`* |
||||
|
||||
___ |
||||
|
||||
### getRLPSigned |
||||
|
||||
▸ **getRLPSigned**(`raw`: any[], `signature`: `Signature`): *string* |
||||
|
||||
*Defined in [transaction.ts:149](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L149)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`raw` | any[] | |
||||
`signature` | `Signature` | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### getRLPUnsigned |
||||
|
||||
▸ **getRLPUnsigned**(): *[string, any[]]* |
||||
|
||||
*Defined in [transaction.ts:103](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L103)* |
||||
|
||||
**Returns:** *[string, any[]]* |
||||
|
||||
___ |
||||
|
||||
### getTxStatus |
||||
|
||||
▸ **getTxStatus**(): *[TxStatus](../enums/txstatus.md)* |
||||
|
||||
*Defined in [transaction.ts:258](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L258)* |
||||
|
||||
**Returns:** *[TxStatus](../enums/txstatus.md)* |
||||
|
||||
___ |
||||
|
||||
### isConfirmed |
||||
|
||||
▸ **isConfirmed**(): *boolean* |
||||
|
||||
*Defined in [transaction.ts:275](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L275)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isInitialized |
||||
|
||||
▸ **isInitialized**(): *boolean* |
||||
|
||||
*Defined in [transaction.ts:263](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L263)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isPending |
||||
|
||||
▸ **isPending**(): *boolean* |
||||
|
||||
*Defined in [transaction.ts:269](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L269)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isRejected |
||||
|
||||
▸ **isRejected**(): *boolean* |
||||
|
||||
*Defined in [transaction.ts:272](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L272)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### isSigned |
||||
|
||||
▸ **isSigned**(): *boolean* |
||||
|
||||
*Defined in [transaction.ts:266](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L266)* |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### map |
||||
|
||||
▸ **map**(`fn`: any): *`this`* |
||||
|
||||
*Defined in [transaction.ts:247](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L247)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`fn` | any | |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### normalizeAddress |
||||
|
||||
▸ **normalizeAddress**(`address`: string): *string* |
||||
|
||||
*Defined in [transaction.ts:486](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L486)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`address` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### observed |
||||
|
||||
▸ **observed**(): *`Emitter`* |
||||
|
||||
*Defined in [transaction.ts:279](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L279)* |
||||
|
||||
**Returns:** *`Emitter`* |
||||
|
||||
___ |
||||
|
||||
### recover |
||||
|
||||
▸ **recover**(`rawTransaction`: string): *[Transaction](transaction.md)* |
||||
|
||||
*Defined in [transaction.ts:168](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L168)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`rawTransaction` | string | |
||||
|
||||
**Returns:** *[Transaction](transaction.md)* |
||||
|
||||
___ |
||||
|
||||
### sendTransaction |
||||
|
||||
▸ **sendTransaction**(): *`Promise<[Transaction, string]>`* |
||||
|
||||
*Defined in [transaction.ts:283](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L283)* |
||||
|
||||
**Returns:** *`Promise<[Transaction, string]>`* |
||||
|
||||
___ |
||||
|
||||
### setMessenger |
||||
|
||||
▸ **setMessenger**(`messenger`: `Messenger`): *void* |
||||
|
||||
*Defined in [transaction.ts:99](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L99)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`messenger` | `Messenger` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setParams |
||||
|
||||
▸ **setParams**(`params`: [TxParams](../interfaces/txparams.md)): *void* |
||||
|
||||
*Defined in [transaction.ts:213](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L213)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`params` | [TxParams](../interfaces/txparams.md) | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setTxStatus |
||||
|
||||
▸ **setTxStatus**(`txStatus`: [TxStatus](../enums/txstatus.md)): *void* |
||||
|
||||
*Defined in [transaction.ts:254](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L254)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`txStatus` | [TxStatus](../enums/txstatus.md) | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### socketConfirm |
||||
|
||||
▸ **socketConfirm**(`txHash`: string, `maxAttempts`: number): *`Promise<Transaction>`* |
||||
|
||||
*Defined in [transaction.ts:414](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L414)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`txHash` | string | - | |
||||
`maxAttempts` | number | 20 | |
||||
|
||||
**Returns:** *`Promise<Transaction>`* |
||||
|
||||
___ |
||||
|
||||
### trackTx |
||||
|
||||
▸ **trackTx**(`txHash`: string): *`Promise<boolean>`* |
||||
|
||||
*Defined in [transaction.ts:313](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/transaction.ts#L313)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`txHash` | string | |
||||
|
||||
**Returns:** *`Promise<boolean>`* |
@ -0,0 +1,131 @@ |
||||
> **[@harmony-js/transaction](../README.md)** |
||||
|
||||
[TransactionFactory](transactionfactory.md) / |
||||
|
||||
# Class: TransactionFactory |
||||
|
||||
## Hierarchy |
||||
|
||||
* **TransactionFactory** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](transactionfactory.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [messenger](transactionfactory.md#messenger) |
||||
|
||||
### Methods |
||||
|
||||
* [clone](transactionfactory.md#clone) |
||||
* [newTx](transactionfactory.md#newtx) |
||||
* [recover](transactionfactory.md#recover) |
||||
* [setMessenger](transactionfactory.md#setmessenger) |
||||
* [getContractAddress](transactionfactory.md#static-getcontractaddress) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new TransactionFactory**(`messenger`: `Messenger`): *[TransactionFactory](transactionfactory.md)* |
||||
|
||||
*Defined in [factory.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/factory.ts#L13)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`messenger` | `Messenger` | |
||||
|
||||
**Returns:** *[TransactionFactory](transactionfactory.md)* |
||||
|
||||
## Properties |
||||
|
||||
### messenger |
||||
|
||||
• **messenger**: *`Messenger`* |
||||
|
||||
*Defined in [factory.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/factory.ts#L13)* |
||||
|
||||
## Methods |
||||
|
||||
### clone |
||||
|
||||
▸ **clone**(`transaction`: [Transaction](transaction.md)): *[Transaction](transaction.md)* |
||||
|
||||
*Defined in [factory.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/factory.ts#L25)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`transaction` | [Transaction](transaction.md) | |
||||
|
||||
**Returns:** *[Transaction](transaction.md)* |
||||
|
||||
___ |
||||
|
||||
### newTx |
||||
|
||||
▸ **newTx**(`txParams?`: [TxParams](../interfaces/txparams.md) | any): *[Transaction](transaction.md)* |
||||
|
||||
*Defined in [factory.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/factory.ts#L21)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`txParams?` | [TxParams](../interfaces/txparams.md) \| any | |
||||
|
||||
**Returns:** *[Transaction](transaction.md)* |
||||
|
||||
___ |
||||
|
||||
### recover |
||||
|
||||
▸ **recover**(`txHash`: string): *[Transaction](transaction.md)* |
||||
|
||||
*Defined in [factory.ts:33](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/factory.ts#L33)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`txHash` | string | |
||||
|
||||
**Returns:** *[Transaction](transaction.md)* |
||||
|
||||
___ |
||||
|
||||
### setMessenger |
||||
|
||||
▸ **setMessenger**(`messenger`: `Messenger`): *void* |
||||
|
||||
*Defined in [factory.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/factory.ts#L17)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`messenger` | `Messenger` | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### `Static` getContractAddress |
||||
|
||||
▸ **getContractAddress**(`tx`: [Transaction](transaction.md)): *string* |
||||
|
||||
*Defined in [factory.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/factory.ts#L7)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`tx` | [Transaction](transaction.md) | |
||||
|
||||
**Returns:** *string* |
@ -0,0 +1,46 @@ |
||||
> **[@harmony-js/transaction](../README.md)** |
||||
|
||||
[TransactionEvents](transactionevents.md) / |
||||
|
||||
# Enumeration: TransactionEvents |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [confirmation](transactionevents.md#confirmation) |
||||
* [error](transactionevents.md#error) |
||||
* [receipt](transactionevents.md#receipt) |
||||
* [transactionHash](transactionevents.md#transactionhash) |
||||
|
||||
## Enumeration members |
||||
|
||||
### confirmation |
||||
|
||||
• **confirmation**: = "confirmation" |
||||
|
||||
*Defined in [utils.ts:255](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L255)* |
||||
|
||||
___ |
||||
|
||||
### error |
||||
|
||||
• **error**: = "error" |
||||
|
||||
*Defined in [utils.ts:254](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L254)* |
||||
|
||||
___ |
||||
|
||||
### receipt |
||||
|
||||
• **receipt**: = "receipt" |
||||
|
||||
*Defined in [utils.ts:256](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L256)* |
||||
|
||||
___ |
||||
|
||||
### transactionHash |
||||
|
||||
• **transactionHash**: = "transactionHash" |
||||
|
||||
*Defined in [utils.ts:253](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/utils.ts#L253)* |
@ -0,0 +1,55 @@ |
||||
> **[@harmony-js/transaction](../README.md)** |
||||
|
||||
[TxStatus](txstatus.md) / |
||||
|
||||
# Enumeration: TxStatus |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [CONFIRMED](txstatus.md#confirmed) |
||||
* [INTIALIZED](txstatus.md#intialized) |
||||
* [PENDING](txstatus.md#pending) |
||||
* [REJECTED](txstatus.md#rejected) |
||||
* [SIGNED](txstatus.md#signed) |
||||
|
||||
## Enumeration members |
||||
|
||||
### CONFIRMED |
||||
|
||||
• **CONFIRMED**: = "CONFIRMED" |
||||
|
||||
*Defined in [types.ts:24](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L24)* |
||||
|
||||
___ |
||||
|
||||
### INTIALIZED |
||||
|
||||
• **INTIALIZED**: = "INITIALIZED" |
||||
|
||||
*Defined in [types.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L21)* |
||||
|
||||
___ |
||||
|
||||
### PENDING |
||||
|
||||
• **PENDING**: = "PENDING" |
||||
|
||||
*Defined in [types.ts:23](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L23)* |
||||
|
||||
___ |
||||
|
||||
### REJECTED |
||||
|
||||
• **REJECTED**: = "REJECTED" |
||||
|
||||
*Defined in [types.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L25)* |
||||
|
||||
___ |
||||
|
||||
### SIGNED |
||||
|
||||
• **SIGNED**: = "SIGNED" |
||||
|
||||
*Defined in [types.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L22)* |
@ -0,0 +1,176 @@ |
||||
> **[@harmony-js/transaction](../README.md)** |
||||
|
||||
[TransasctionReceipt](transasctionreceipt.md) / |
||||
|
||||
# Interface: TransasctionReceipt |
||||
|
||||
## Hierarchy |
||||
|
||||
* **TransasctionReceipt** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [blockHash](transasctionreceipt.md#blockhash) |
||||
* [blockNumber](transasctionreceipt.md#blocknumber) |
||||
* [byzantium](transasctionreceipt.md#optional-byzantium) |
||||
* [contractAddress](transasctionreceipt.md#optional-contractaddress) |
||||
* [cumulativeGasUsed](transasctionreceipt.md#cumulativegasused) |
||||
* [from](transasctionreceipt.md#from) |
||||
* [gasUsed](transasctionreceipt.md#gasused) |
||||
* [logs](transasctionreceipt.md#logs) |
||||
* [logsBloom](transasctionreceipt.md#logsbloom) |
||||
* [r](transasctionreceipt.md#r) |
||||
* [responseType](transasctionreceipt.md#optional-responsetype) |
||||
* [root](transasctionreceipt.md#optional-root) |
||||
* [s](transasctionreceipt.md#s) |
||||
* [status](transasctionreceipt.md#optional-status) |
||||
* [to](transasctionreceipt.md#to) |
||||
* [transactionHash](transasctionreceipt.md#transactionhash) |
||||
* [transactionIndex](transasctionreceipt.md#transactionindex) |
||||
* [v](transasctionreceipt.md#v) |
||||
|
||||
## Properties |
||||
|
||||
### blockHash |
||||
|
||||
• **blockHash**: *string* |
||||
|
||||
*Defined in [types.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L31)* |
||||
|
||||
___ |
||||
|
||||
### blockNumber |
||||
|
||||
• **blockNumber**: *string* |
||||
|
||||
*Defined in [types.ts:32](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L32)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` byzantium |
||||
|
||||
• **byzantium**? : *undefined | false | true* |
||||
|
||||
*Defined in [types.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L44)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` contractAddress |
||||
|
||||
• **contractAddress**? : *string | null* |
||||
|
||||
*Defined in [types.ts:37](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L37)* |
||||
|
||||
___ |
||||
|
||||
### cumulativeGasUsed |
||||
|
||||
• **cumulativeGasUsed**: *string* |
||||
|
||||
*Defined in [types.ts:36](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L36)* |
||||
|
||||
___ |
||||
|
||||
### from |
||||
|
||||
• **from**: *string* |
||||
|
||||
*Defined in [types.ts:33](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L33)* |
||||
|
||||
___ |
||||
|
||||
### gasUsed |
||||
|
||||
• **gasUsed**: *string* |
||||
|
||||
*Defined in [types.ts:35](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L35)* |
||||
|
||||
___ |
||||
|
||||
### logs |
||||
|
||||
• **logs**: *any[]* |
||||
|
||||
*Defined in [types.ts:38](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L38)* |
||||
|
||||
___ |
||||
|
||||
### logsBloom |
||||
|
||||
• **logsBloom**: *string* |
||||
|
||||
*Defined in [types.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L39)* |
||||
|
||||
___ |
||||
|
||||
### r |
||||
|
||||
• **r**: *string* |
||||
|
||||
*Defined in [types.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L41)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` responseType |
||||
|
||||
• **responseType**? : *undefined | string* |
||||
|
||||
*Defined in [types.ts:43](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L43)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` root |
||||
|
||||
• **root**? : *undefined | string* |
||||
|
||||
*Defined in [types.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L46)* |
||||
|
||||
___ |
||||
|
||||
### s |
||||
|
||||
• **s**: *string* |
||||
|
||||
*Defined in [types.ts:42](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L42)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` status |
||||
|
||||
• **status**? : *undefined | string* |
||||
|
||||
*Defined in [types.ts:45](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L45)* |
||||
|
||||
___ |
||||
|
||||
### to |
||||
|
||||
• **to**: *string* |
||||
|
||||
*Defined in [types.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L34)* |
||||
|
||||
___ |
||||
|
||||
### transactionHash |
||||
|
||||
• **transactionHash**: *string* |
||||
|
||||
*Defined in [types.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L29)* |
||||
|
||||
___ |
||||
|
||||
### transactionIndex |
||||
|
||||
• **transactionIndex**: *string* |
||||
|
||||
*Defined in [types.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L30)* |
||||
|
||||
___ |
||||
|
||||
### v |
||||
|
||||
• **v**: *string* |
||||
|
||||
*Defined in [types.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L40)* |
@ -0,0 +1,149 @@ |
||||
> **[@harmony-js/transaction](../README.md)** |
||||
|
||||
[TxParams](txparams.md) / |
||||
|
||||
# Interface: TxParams |
||||
|
||||
## Hierarchy |
||||
|
||||
* **TxParams** |
||||
|
||||
## Index |
||||
|
||||
### Properties |
||||
|
||||
* [chainId](txparams.md#chainid) |
||||
* [data](txparams.md#data) |
||||
* [from](txparams.md#from) |
||||
* [gasLimit](txparams.md#gaslimit) |
||||
* [gasPrice](txparams.md#gasprice) |
||||
* [id](txparams.md#id) |
||||
* [nonce](txparams.md#nonce) |
||||
* [rawTransaction](txparams.md#rawtransaction) |
||||
* [receipt](txparams.md#optional-receipt) |
||||
* [shardID](txparams.md#shardid) |
||||
* [signature](txparams.md#signature) |
||||
* [to](txparams.md#to) |
||||
* [toShardID](txparams.md#toshardid) |
||||
* [unsignedRawTransaction](txparams.md#unsignedrawtransaction) |
||||
* [value](txparams.md#value) |
||||
|
||||
## Properties |
||||
|
||||
### chainId |
||||
|
||||
• **chainId**: *number* |
||||
|
||||
*Defined in [types.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L13)* |
||||
|
||||
___ |
||||
|
||||
### data |
||||
|
||||
• **data**: *string* |
||||
|
||||
*Defined in [types.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### from |
||||
|
||||
• **from**: *string* |
||||
|
||||
*Defined in [types.ts:4](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L4)* |
||||
|
||||
___ |
||||
|
||||
### gasLimit |
||||
|
||||
• **gasLimit**: *`BN`* |
||||
|
||||
*Defined in [types.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### gasPrice |
||||
|
||||
• **gasPrice**: *`BN`* |
||||
|
||||
*Defined in [types.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### id |
||||
|
||||
• **id**: *string* |
||||
|
||||
*Defined in [types.ts:3](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L3)* |
||||
|
||||
___ |
||||
|
||||
### nonce |
||||
|
||||
• **nonce**: *number | string* |
||||
|
||||
*Defined in [types.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L6)* |
||||
|
||||
___ |
||||
|
||||
### rawTransaction |
||||
|
||||
• **rawTransaction**: *string* |
||||
|
||||
*Defined in [types.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L14)* |
||||
|
||||
___ |
||||
|
||||
### `Optional` receipt |
||||
|
||||
• **receipt**? : *[TransasctionReceipt](transasctionreceipt.md)* |
||||
|
||||
*Defined in [types.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L17)* |
||||
|
||||
___ |
||||
|
||||
### shardID |
||||
|
||||
• **shardID**: *number | string* |
||||
|
||||
*Defined in [types.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### signature |
||||
|
||||
• **signature**: *`Signature`* |
||||
|
||||
*Defined in [types.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L16)* |
||||
|
||||
___ |
||||
|
||||
### to |
||||
|
||||
• **to**: *string* |
||||
|
||||
*Defined in [types.ts:5](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L5)* |
||||
|
||||
___ |
||||
|
||||
### toShardID |
||||
|
||||
• **toShardID**: *number | string* |
||||
|
||||
*Defined in [types.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L10)* |
||||
|
||||
___ |
||||
|
||||
### unsignedRawTransaction |
||||
|
||||
• **unsignedRawTransaction**: *string* |
||||
|
||||
*Defined in [types.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L15)* |
||||
|
||||
___ |
||||
|
||||
### value |
||||
|
||||
• **value**: *`BN`* |
||||
|
||||
*Defined in [types.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-transaction/src/types.ts#L12)* |
@ -0,0 +1,814 @@ |
||||
> **[@harmony-js/utils](README.md)** |
||||
|
||||
## Index |
||||
|
||||
### Enumerations |
||||
|
||||
* [AssertType](enums/asserttype.md) |
||||
* [ChainID](enums/chainid.md) |
||||
* [ChainType](enums/chaintype.md) |
||||
* [DefaultBlockParams](enums/defaultblockparams.md) |
||||
* [Units](enums/units.md) |
||||
|
||||
### Classes |
||||
|
||||
* [HarmonyCore](classes/harmonycore.md) |
||||
* [Unit](classes/unit.md) |
||||
|
||||
### Variables |
||||
|
||||
* [HDPath](README.md#const-hdpath) |
||||
* [unitMap](README.md#const-unitmap) |
||||
|
||||
### Functions |
||||
|
||||
* [add0xToString](README.md#const-add0xtostring) |
||||
* [assertObject](README.md#const-assertobject) |
||||
* [defineReadOnly](README.md#definereadonly) |
||||
* [fromWei](README.md#const-fromwei) |
||||
* [generateValidateObjects](README.md#generatevalidateobjects) |
||||
* [hexToBN](README.md#const-hextobn) |
||||
* [hexToNumber](README.md#const-hextonumber) |
||||
* [isAddress](README.md#const-isaddress) |
||||
* [isArray](README.md#const-isarray) |
||||
* [isBech32Address](README.md#const-isbech32address) |
||||
* [isBech32TestNetAddress](README.md#const-isbech32testnetaddress) |
||||
* [isBlockNumber](README.md#const-isblocknumber) |
||||
* [isBoolean](README.md#const-isboolean) |
||||
* [isFunction](README.md#const-isfunction) |
||||
* [isHash](README.md#const-ishash) |
||||
* [isHex](README.md#const-ishex) |
||||
* [isHttp](README.md#const-ishttp) |
||||
* [isInt](README.md#const-isint) |
||||
* [isJsonString](README.md#const-isjsonstring) |
||||
* [isKeyString](README.md#const-iskeystring) |
||||
* [isNumber](README.md#const-isnumber) |
||||
* [isObject](README.md#const-isobject) |
||||
* [isPrivateKey](README.md#const-isprivatekey) |
||||
* [isPublicKey](README.md#const-ispublickey) |
||||
* [isString](README.md#const-isstring) |
||||
* [isValidAddress](README.md#const-isvalidaddress) |
||||
* [isWs](README.md#const-isws) |
||||
* [numToStr](README.md#const-numtostr) |
||||
* [numberToHex](README.md#const-numbertohex) |
||||
* [numberToString](README.md#const-numbertostring) |
||||
* [strip0x](README.md#const-strip0x) |
||||
* [toWei](README.md#const-towei) |
||||
* [validateArgs](README.md#validateargs) |
||||
|
||||
### Object literals |
||||
|
||||
* [DEFAULT_OPTIONS](README.md#const-default_options) |
||||
* [defaultConfig](README.md#const-defaultconfig) |
||||
* [validatorArray](README.md#const-validatorarray) |
||||
|
||||
## Variables |
||||
|
||||
### `Const` HDPath |
||||
|
||||
• **HDPath**: *"m/44'/60'/0'/0/"* = `m/44'/60'/0'/0/` |
||||
|
||||
*Defined in [chain.ts:70](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L70)* |
||||
|
||||
___ |
||||
|
||||
### `Const` unitMap |
||||
|
||||
• **unitMap**: *`Map<Units, string>`* = new Map([ |
||||
[Units.wei, '1'], |
||||
[Units.kwei, '1000'], // 1e3 wei |
||||
[Units.Mwei, '1000000'], // 1e6 wei |
||||
[Units.Gwei, '1000000000'], // 1e9 wei |
||||
[Units.szabo, '1000000000000'], // 1e12 wei |
||||
[Units.finney, '1000000000000000'], // 1e15 wei |
||||
[Units.ether, '1000000000000000000'], // 1e18 wei |
||||
[Units.Kether, '1000000000000000000000'], // 1e21 wei |
||||
[Units.Mether, '1000000000000000000000000'], // 1e24 wei |
||||
[Units.Gether, '1000000000000000000000000000'], // 1e27 wei |
||||
[Units.Tether, '1000000000000000000000000000000'], // 1e30 wei |
||||
]) |
||||
|
||||
*Defined in [transformers.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L18)* |
||||
|
||||
## Functions |
||||
|
||||
### `Const` add0xToString |
||||
|
||||
▸ **add0xToString**(`obj`: string): *string* |
||||
|
||||
*Defined in [transformers.ts:70](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L70)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Const` assertObject |
||||
|
||||
▸ **assertObject**(`input`: any): *`(Anonymous function)`* |
||||
|
||||
*Defined in [utils.ts:111](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L111)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`input` | any | |
||||
|
||||
**Returns:** *`(Anonymous function)`* |
||||
|
||||
___ |
||||
|
||||
### defineReadOnly |
||||
|
||||
▸ **defineReadOnly**(`object`: any, `name`: string, `value`: any): *void* |
||||
|
||||
*Defined in [tools.ts:1](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/tools.ts#L1)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`object` | any | |
||||
`name` | string | |
||||
`value` | any | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### `Const` fromWei |
||||
|
||||
▸ **fromWei**(`wei`: `BN` | string, `unit`: [Units](enums/units.md), `options`: any): *string* |
||||
|
||||
*Defined in [transformers.ts:172](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L172)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`wei` | `BN` \| string | - | |
||||
`unit` | [Units](enums/units.md) | - | |
||||
`options` | any | DEFAULT_OPTIONS | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### generateValidateObjects |
||||
|
||||
▸ **generateValidateObjects**(`validatorObject`: object): *object* |
||||
|
||||
*Defined in [utils.ts:91](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L91)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`validatorObject` | object | |
||||
|
||||
**Returns:** *object* |
||||
|
||||
* **optionalArgs**: *any* |
||||
|
||||
* **requiredArgs**: *any* |
||||
|
||||
___ |
||||
|
||||
### `Const` hexToBN |
||||
|
||||
▸ **hexToBN**(`hex`: string): *`BN`* |
||||
|
||||
*Defined in [transformers.ts:103](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L103)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`hex` | string | |
||||
|
||||
**Returns:** *`BN`* |
||||
|
||||
___ |
||||
|
||||
### `Const` hexToNumber |
||||
|
||||
▸ **hexToNumber**(`hex`: string): *string* |
||||
|
||||
*Defined in [transformers.ts:92](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L92)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`hex` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Const` isAddress |
||||
|
||||
▸ **isAddress**(`address`: string): *boolean* |
||||
|
||||
*Defined in [validators.ts:6](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L6)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`address` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isArray |
||||
|
||||
▸ **isArray**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:72](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L72)* |
||||
|
||||
[isArray verify param input is an Array] |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
[boolean] |
||||
|
||||
___ |
||||
|
||||
### `Const` isBech32Address |
||||
|
||||
▸ **isBech32Address**(`raw`: string): *boolean* |
||||
|
||||
*Defined in [validators.ts:163](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L163)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`raw` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isBech32TestNetAddress |
||||
|
||||
▸ **isBech32TestNetAddress**(`raw`: string): *boolean* |
||||
|
||||
*Defined in [validators.ts:168](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L168)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`raw` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isBlockNumber |
||||
|
||||
▸ **isBlockNumber**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:148](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L148)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isBoolean |
||||
|
||||
▸ **isBoolean**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:62](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L62)* |
||||
|
||||
[isBoolean verify param is a Boolean] |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
[boolean] |
||||
|
||||
___ |
||||
|
||||
### `Const` isFunction |
||||
|
||||
▸ **isFunction**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:107](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L107)* |
||||
|
||||
[isFunction verify param is a Function] |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
[description] |
||||
|
||||
___ |
||||
|
||||
### `Const` isHash |
||||
|
||||
▸ **isHash**(`hash`: string): *boolean* |
||||
|
||||
*Defined in [validators.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L21)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`hash` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isHex |
||||
|
||||
▸ **isHex**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:112](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L112)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isHttp |
||||
|
||||
▸ **isHttp**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:124](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L124)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isInt |
||||
|
||||
▸ **isInt**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L41)* |
||||
|
||||
[isNumber verify param is a Number] |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
[boolean] |
||||
|
||||
___ |
||||
|
||||
### `Const` isJsonString |
||||
|
||||
▸ **isJsonString**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:82](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L82)* |
||||
|
||||
[isJson verify param input is a Json] |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
[boolean] |
||||
|
||||
___ |
||||
|
||||
### `Const` isKeyString |
||||
|
||||
▸ **isKeyString**(`keyString`: string, `lengh`: number): *boolean* |
||||
|
||||
*Defined in [validators.ts:1](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L1)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`keyString` | string | |
||||
`lengh` | number | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isNumber |
||||
|
||||
▸ **isNumber**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L31)* |
||||
|
||||
[isNumber verify param is a Number] |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
[boolean] |
||||
|
||||
___ |
||||
|
||||
### `Const` isObject |
||||
|
||||
▸ **isObject**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:96](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L96)* |
||||
|
||||
[isObject verify param is an Object] |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
[boolean] |
||||
|
||||
___ |
||||
|
||||
### `Const` isPrivateKey |
||||
|
||||
▸ **isPrivateKey**(`privateKey`: string): *boolean* |
||||
|
||||
*Defined in [validators.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L11)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`privateKey` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isPublicKey |
||||
|
||||
▸ **isPublicKey**(`publicKey`: string): *boolean* |
||||
|
||||
*Defined in [validators.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L16)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`publicKey` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isString |
||||
|
||||
▸ **isString**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:52](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L52)* |
||||
|
||||
[isString verify param is a String] |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
[boolean] |
||||
|
||||
___ |
||||
|
||||
### `Const` isValidAddress |
||||
|
||||
▸ **isValidAddress**(`address`: string): *boolean* |
||||
|
||||
*Defined in [validators.ts:173](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L173)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`address` | string | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` isWs |
||||
|
||||
▸ **isWs**(`obj`: any): *boolean* |
||||
|
||||
*Defined in [validators.ts:133](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/validators.ts#L133)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
___ |
||||
|
||||
### `Const` numToStr |
||||
|
||||
▸ **numToStr**(`input`: any): *string* |
||||
|
||||
*Defined in [transformers.ts:51](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L51)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`input` | any | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Const` numberToHex |
||||
|
||||
▸ **numberToHex**(`obj`: any): *string* |
||||
|
||||
*Defined in [transformers.ts:84](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L84)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | any | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Const` numberToString |
||||
|
||||
▸ **numberToString**(`obj`: `BN` | number | string, `radix`: number): *string* |
||||
|
||||
*Defined in [transformers.ts:36](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L36)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`obj` | `BN` \| number \| string | - | |
||||
`radix` | number | 10 | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Const` strip0x |
||||
|
||||
▸ **strip0x**(`obj`: string): *string* |
||||
|
||||
*Defined in [transformers.ts:80](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L80)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`obj` | string | |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Const` toWei |
||||
|
||||
▸ **toWei**(`input`: `BN` | string, `unit`: [Units](enums/units.md)): *`BN`* |
||||
|
||||
*Defined in [transformers.ts:114](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L114)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`input` | `BN` \| string | |
||||
`unit` | [Units](enums/units.md) | |
||||
|
||||
**Returns:** *`BN`* |
||||
|
||||
___ |
||||
|
||||
### validateArgs |
||||
|
||||
▸ **validateArgs**(`args`: any, `requiredArgs`: any, `optionalArgs`: any): *boolean* |
||||
|
||||
*Defined in [utils.ts:44](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L44)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`args` | any | |
||||
`requiredArgs` | any | |
||||
`optionalArgs` | any | |
||||
|
||||
**Returns:** *boolean* |
||||
|
||||
## Object literals |
||||
|
||||
### `Const` DEFAULT_OPTIONS |
||||
|
||||
### ▪ **DEFAULT_OPTIONS**: *object* |
||||
|
||||
*Defined in [transformers.ts:32](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L32)* |
||||
|
||||
### pad |
||||
|
||||
• **pad**: *boolean* = false |
||||
|
||||
*Defined in [transformers.ts:33](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L33)* |
||||
|
||||
___ |
||||
|
||||
### `Const` defaultConfig |
||||
|
||||
### ▪ **defaultConfig**: *object* |
||||
|
||||
*Defined in [chain.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L21)* |
||||
|
||||
▪ **Default**: *object* |
||||
|
||||
*Defined in [chain.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L22)* |
||||
|
||||
* **Chain_ID**: *[ChainID](enums/chainid.md)* = ChainID.Default |
||||
|
||||
* **Chain_Type**: *[ChainType](enums/chaintype.md)* = ChainType.Harmony |
||||
|
||||
* **Chain_URL**: *string* = "http://localhost:9500" |
||||
|
||||
* **Network_ID**: *string* = "Local" |
||||
|
||||
▪ **DefaultWS**: *object* |
||||
|
||||
*Defined in [chain.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L28)* |
||||
|
||||
* **Chain_ID**: *[ChainID](enums/chainid.md)* = ChainID.Default |
||||
|
||||
* **Chain_Type**: *[ChainType](enums/chaintype.md)* = ChainType.Harmony |
||||
|
||||
* **Chain_URL**: *string* = "ws://localhost:9800" |
||||
|
||||
* **Network_ID**: *string* = "LocalWS" |
||||
|
||||
___ |
||||
|
||||
### `Const` validatorArray |
||||
|
||||
### ▪ **validatorArray**: *object* |
||||
|
||||
*Defined in [utils.ts:25](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L25)* |
||||
|
||||
### isAddress |
||||
|
||||
• **isAddress**: *`isAddress`[]* = [isAddress] |
||||
|
||||
*Defined in [utils.ts:36](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L36)* |
||||
|
||||
### isArray |
||||
|
||||
• **isArray**: *`isArray`[]* = [isArray] |
||||
|
||||
*Defined in [utils.ts:29](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L29)* |
||||
|
||||
### isBech32Address |
||||
|
||||
• **isBech32Address**: *`isBech32Address`[]* = [isBech32Address] |
||||
|
||||
*Defined in [utils.ts:39](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L39)* |
||||
|
||||
### isBech32TestNetAddress |
||||
|
||||
• **isBech32TestNetAddress**: *`isBech32TestNetAddress`[]* = [isBech32TestNetAddress] |
||||
|
||||
*Defined in [utils.ts:40](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L40)* |
||||
|
||||
### isBlockNumber |
||||
|
||||
• **isBlockNumber**: *`isBlockNumber`[]* = [isBlockNumber] |
||||
|
||||
*Defined in [utils.ts:38](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L38)* |
||||
|
||||
### isBoolean |
||||
|
||||
• **isBoolean**: *`isBoolean`[]* = [isBoolean] |
||||
|
||||
*Defined in [utils.ts:28](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L28)* |
||||
|
||||
### isFunction |
||||
|
||||
• **isFunction**: *`isFunction`[]* = [isFunction] |
||||
|
||||
*Defined in [utils.ts:32](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L32)* |
||||
|
||||
### isHash |
||||
|
||||
• **isHash**: *`isHash`[]* = [isHash] |
||||
|
||||
*Defined in [utils.ts:37](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L37)* |
||||
|
||||
### isHex |
||||
|
||||
• **isHex**: *`isHex`[]* = [isHex] |
||||
|
||||
*Defined in [utils.ts:33](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L33)* |
||||
|
||||
### isJsonString |
||||
|
||||
• **isJsonString**: *`isJsonString`[]* = [isJsonString] |
||||
|
||||
*Defined in [utils.ts:30](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L30)* |
||||
|
||||
### isNumber |
||||
|
||||
• **isNumber**: *`isNumber`[]* = [isNumber] |
||||
|
||||
*Defined in [utils.ts:26](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L26)* |
||||
|
||||
### isObject |
||||
|
||||
• **isObject**: *`isObject`[]* = [isObject] |
||||
|
||||
*Defined in [utils.ts:31](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L31)* |
||||
|
||||
### isPrivateKey |
||||
|
||||
• **isPrivateKey**: *`isPrivateKey`[]* = [isPrivateKey] |
||||
|
||||
*Defined in [utils.ts:35](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L35)* |
||||
|
||||
### isPublicKey |
||||
|
||||
• **isPublicKey**: *`isPublicKey`[]* = [isPublicKey] |
||||
|
||||
*Defined in [utils.ts:34](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L34)* |
||||
|
||||
### isString |
||||
|
||||
• **isString**: *`isString`[]* = [isString] |
||||
|
||||
*Defined in [utils.ts:27](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L27)* |
||||
|
||||
### isValidAddress |
||||
|
||||
• **isValidAddress**: *`isValidAddress`[]* = [isValidAddress] |
||||
|
||||
*Defined in [utils.ts:41](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L41)* |
@ -0,0 +1,115 @@ |
||||
> **[@harmony-js/utils](../README.md)** |
||||
|
||||
[HarmonyCore](harmonycore.md) / |
||||
|
||||
# Class: HarmonyCore |
||||
|
||||
## Hierarchy |
||||
|
||||
* **HarmonyCore** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](harmonycore.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [chainId](harmonycore.md#chainid) |
||||
* [chainType](harmonycore.md#chaintype) |
||||
|
||||
### Accessors |
||||
|
||||
* [chainPrefix](harmonycore.md#chainprefix) |
||||
* [getChainId](harmonycore.md#getchainid) |
||||
|
||||
### Methods |
||||
|
||||
* [setChainId](harmonycore.md#setchainid) |
||||
* [setChainType](harmonycore.md#setchaintype) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new HarmonyCore**(`chainType`: [ChainType](../enums/chaintype.md), `chainId`: [ChainID](../enums/chainid.md)): *[HarmonyCore](harmonycore.md)* |
||||
|
||||
*Defined in [chain.ts:38](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L38)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | Default | |
||||
------ | ------ | ------ | |
||||
`chainType` | [ChainType](../enums/chaintype.md) | - | |
||||
`chainId` | [ChainID](../enums/chainid.md) | defaultConfig.Default.Chain_ID | |
||||
|
||||
**Returns:** *[HarmonyCore](harmonycore.md)* |
||||
|
||||
## Properties |
||||
|
||||
### chainId |
||||
|
||||
• **chainId**: *[ChainID](../enums/chainid.md)* |
||||
|
||||
*Defined in [chain.ts:38](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L38)* |
||||
|
||||
___ |
||||
|
||||
### chainType |
||||
|
||||
• **chainType**: *[ChainType](../enums/chaintype.md)* |
||||
|
||||
*Defined in [chain.ts:37](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L37)* |
||||
|
||||
## Accessors |
||||
|
||||
### chainPrefix |
||||
|
||||
• **get chainPrefix**(): *string* |
||||
|
||||
*Defined in [chain.ts:46](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L46)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### getChainId |
||||
|
||||
• **get getChainId**(): *[ChainID](../enums/chainid.md)* |
||||
|
||||
*Defined in [chain.ts:59](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L59)* |
||||
|
||||
**Returns:** *[ChainID](../enums/chainid.md)* |
||||
|
||||
## Methods |
||||
|
||||
### setChainId |
||||
|
||||
▸ **setChainId**(`chainId`: [ChainID](../enums/chainid.md)): *void* |
||||
|
||||
*Defined in [chain.ts:62](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L62)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`chainId` | [ChainID](../enums/chainid.md) | |
||||
|
||||
**Returns:** *void* |
||||
|
||||
___ |
||||
|
||||
### setChainType |
||||
|
||||
▸ **setChainType**(`chainType`: [ChainType](../enums/chaintype.md)): *void* |
||||
|
||||
*Defined in [chain.ts:65](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L65)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`chainType` | [ChainType](../enums/chaintype.md) | |
||||
|
||||
**Returns:** *void* |
@ -0,0 +1,523 @@ |
||||
> **[@harmony-js/utils](../README.md)** |
||||
|
||||
[Unit](unit.md) / |
||||
|
||||
# Class: Unit |
||||
|
||||
## Hierarchy |
||||
|
||||
* **Unit** |
||||
|
||||
## Index |
||||
|
||||
### Constructors |
||||
|
||||
* [constructor](unit.md#constructor) |
||||
|
||||
### Properties |
||||
|
||||
* [unit](unit.md#unit) |
||||
* [wei](unit.md#wei) |
||||
|
||||
### Methods |
||||
|
||||
* [asEther](unit.md#asether) |
||||
* [asFinney](unit.md#asfinney) |
||||
* [asGether](unit.md#asgether) |
||||
* [asGwei](unit.md#asgwei) |
||||
* [asKether](unit.md#askether) |
||||
* [asKwei](unit.md#askwei) |
||||
* [asMether](unit.md#asmether) |
||||
* [asMwei](unit.md#asmwei) |
||||
* [asSzabo](unit.md#asszabo) |
||||
* [asTether](unit.md#astether) |
||||
* [asWei](unit.md#aswei) |
||||
* [toEther](unit.md#toether) |
||||
* [toGether](unit.md#together) |
||||
* [toGwei](unit.md#togwei) |
||||
* [toHex](unit.md#tohex) |
||||
* [toKether](unit.md#tokether) |
||||
* [toKwei](unit.md#tokwei) |
||||
* [toMether](unit.md#tomether) |
||||
* [toMwei](unit.md#tomwei) |
||||
* [toSzabo](unit.md#toszabo) |
||||
* [toTether](unit.md#totether) |
||||
* [toWei](unit.md#towei) |
||||
* [toWeiString](unit.md#toweistring) |
||||
* [tofinney](unit.md#tofinney) |
||||
* [Ether](unit.md#static-ether) |
||||
* [Finney](unit.md#static-finney) |
||||
* [Gether](unit.md#static-gether) |
||||
* [Gwei](unit.md#static-gwei) |
||||
* [Kether](unit.md#static-kether) |
||||
* [Kwei](unit.md#static-kwei) |
||||
* [Mether](unit.md#static-mether) |
||||
* [Mwei](unit.md#static-mwei) |
||||
* [Szabo](unit.md#static-szabo) |
||||
* [Tether](unit.md#static-tether) |
||||
* [Wei](unit.md#static-wei) |
||||
* [from](unit.md#static-from) |
||||
|
||||
## Constructors |
||||
|
||||
### constructor |
||||
|
||||
\+ **new Unit**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:257](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L257)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
## Properties |
||||
|
||||
### unit |
||||
|
||||
• **unit**: *`BN` | string* |
||||
|
||||
*Defined in [transformers.ts:257](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L257)* |
||||
|
||||
___ |
||||
|
||||
### wei |
||||
|
||||
• **wei**: *`BN`* |
||||
|
||||
*Defined in [transformers.ts:256](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L256)* |
||||
|
||||
## Methods |
||||
|
||||
### asEther |
||||
|
||||
▸ **asEther**(): *`this`* |
||||
|
||||
*Defined in [transformers.ts:288](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L288)* |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### asFinney |
||||
|
||||
▸ **asFinney**(): *`this`* |
||||
|
||||
*Defined in [transformers.ts:284](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L284)* |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### asGether |
||||
|
||||
▸ **asGether**(): *`this`* |
||||
|
||||
*Defined in [transformers.ts:300](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L300)* |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### asGwei |
||||
|
||||
▸ **asGwei**(): *`this`* |
||||
|
||||
*Defined in [transformers.ts:276](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L276)* |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### asKether |
||||
|
||||
▸ **asKether**(): *`this`* |
||||
|
||||
*Defined in [transformers.ts:292](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L292)* |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### asKwei |
||||
|
||||
▸ **asKwei**(): *`this`* |
||||
|
||||
*Defined in [transformers.ts:268](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L268)* |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### asMether |
||||
|
||||
▸ **asMether**(): *`this`* |
||||
|
||||
*Defined in [transformers.ts:296](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L296)* |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### asMwei |
||||
|
||||
▸ **asMwei**(): *`this`* |
||||
|
||||
*Defined in [transformers.ts:272](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L272)* |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### asSzabo |
||||
|
||||
▸ **asSzabo**(): *`this`* |
||||
|
||||
*Defined in [transformers.ts:280](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L280)* |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### asTether |
||||
|
||||
▸ **asTether**(): *`this`* |
||||
|
||||
*Defined in [transformers.ts:304](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L304)* |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### asWei |
||||
|
||||
▸ **asWei**(): *`this`* |
||||
|
||||
*Defined in [transformers.ts:264](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L264)* |
||||
|
||||
**Returns:** *`this`* |
||||
|
||||
___ |
||||
|
||||
### toEther |
||||
|
||||
▸ **toEther**(): *string* |
||||
|
||||
*Defined in [transformers.ts:348](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L348)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### toGether |
||||
|
||||
▸ **toGether**(): *string* |
||||
|
||||
*Defined in [transformers.ts:369](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L369)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### toGwei |
||||
|
||||
▸ **toGwei**(): *string* |
||||
|
||||
*Defined in [transformers.ts:320](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L320)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### toHex |
||||
|
||||
▸ **toHex**(): *string* |
||||
|
||||
*Defined in [transformers.ts:391](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L391)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### toKether |
||||
|
||||
▸ **toKether**(): *string* |
||||
|
||||
*Defined in [transformers.ts:355](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L355)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### toKwei |
||||
|
||||
▸ **toKwei**(): *string* |
||||
|
||||
*Defined in [transformers.ts:313](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L313)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### toMether |
||||
|
||||
▸ **toMether**(): *string* |
||||
|
||||
*Defined in [transformers.ts:362](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L362)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### toMwei |
||||
|
||||
▸ **toMwei**(): *string* |
||||
|
||||
*Defined in [transformers.ts:327](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L327)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### toSzabo |
||||
|
||||
▸ **toSzabo**(): *string* |
||||
|
||||
*Defined in [transformers.ts:334](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L334)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### toTether |
||||
|
||||
▸ **toTether**(): *string* |
||||
|
||||
*Defined in [transformers.ts:376](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L376)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### toWei |
||||
|
||||
▸ **toWei**(): *`BN`* |
||||
|
||||
*Defined in [transformers.ts:309](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L309)* |
||||
|
||||
**Returns:** *`BN`* |
||||
|
||||
___ |
||||
|
||||
### toWeiString |
||||
|
||||
▸ **toWeiString**(): *string* |
||||
|
||||
*Defined in [transformers.ts:384](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L384)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### tofinney |
||||
|
||||
▸ **tofinney**(): *string* |
||||
|
||||
*Defined in [transformers.ts:341](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L341)* |
||||
|
||||
**Returns:** *string* |
||||
|
||||
___ |
||||
|
||||
### `Static` Ether |
||||
|
||||
▸ **Ether**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:240](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L240)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` Finney |
||||
|
||||
▸ **Finney**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:237](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L237)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` Gether |
||||
|
||||
▸ **Gether**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:249](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L249)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` Gwei |
||||
|
||||
▸ **Gwei**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:231](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L231)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` Kether |
||||
|
||||
▸ **Kether**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:243](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L243)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` Kwei |
||||
|
||||
▸ **Kwei**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:225](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L225)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` Mether |
||||
|
||||
▸ **Mether**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:246](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L246)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` Mwei |
||||
|
||||
▸ **Mwei**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:228](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L228)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` Szabo |
||||
|
||||
▸ **Szabo**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:234](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L234)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` Tether |
||||
|
||||
▸ **Tether**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:252](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L252)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` Wei |
||||
|
||||
▸ **Wei**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:222](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L222)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
||||
|
||||
___ |
||||
|
||||
### `Static` from |
||||
|
||||
▸ **from**(`str`: `BN` | string): *[Unit](unit.md)* |
||||
|
||||
*Defined in [transformers.ts:218](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/transformers.ts#L218)* |
||||
|
||||
**Parameters:** |
||||
|
||||
Name | Type | |
||||
------ | ------ | |
||||
`str` | `BN` \| string | |
||||
|
||||
**Returns:** *[Unit](unit.md)* |
@ -0,0 +1,28 @@ |
||||
> **[@harmony-js/utils](../README.md)** |
||||
|
||||
[AssertType](asserttype.md) / |
||||
|
||||
# Enumeration: AssertType |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [optional](asserttype.md#optional) |
||||
* [required](asserttype.md#required) |
||||
|
||||
## Enumeration members |
||||
|
||||
### optional |
||||
|
||||
• **optional**: = "optional" |
||||
|
||||
*Defined in [utils.ts:22](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L22)* |
||||
|
||||
___ |
||||
|
||||
### required |
||||
|
||||
• **required**: = "required" |
||||
|
||||
*Defined in [utils.ts:21](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/utils.ts#L21)* |
@ -0,0 +1,118 @@ |
||||
> **[@harmony-js/utils](../README.md)** |
||||
|
||||
[ChainID](chainid.md) / |
||||
|
||||
# Enumeration: ChainID |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [Default](chainid.md#default) |
||||
* [EtcMainnet](chainid.md#etcmainnet) |
||||
* [EtcTestnet](chainid.md#etctestnet) |
||||
* [EthMainnet](chainid.md#ethmainnet) |
||||
* [Ganache](chainid.md#ganache) |
||||
* [Geth](chainid.md#geth) |
||||
* [Kovan](chainid.md#kovan) |
||||
* [Morden](chainid.md#morden) |
||||
* [Rinkeby](chainid.md#rinkeby) |
||||
* [RootstockMainnet](chainid.md#rootstockmainnet) |
||||
* [RootstockTestnet](chainid.md#rootstocktestnet) |
||||
* [Ropsten](chainid.md#ropsten) |
||||
|
||||
## Enumeration members |
||||
|
||||
### Default |
||||
|
||||
• **Default**: = 0 |
||||
|
||||
*Defined in [chain.ts:7](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L7)* |
||||
|
||||
___ |
||||
|
||||
### EtcMainnet |
||||
|
||||
• **EtcMainnet**: = 61 |
||||
|
||||
*Defined in [chain.ts:15](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L15)* |
||||
|
||||
___ |
||||
|
||||
### EtcTestnet |
||||
|
||||
• **EtcTestnet**: = 62 |
||||
|
||||
*Defined in [chain.ts:16](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L16)* |
||||
|
||||
___ |
||||
|
||||
### EthMainnet |
||||
|
||||
• **EthMainnet**: = 1 |
||||
|
||||
*Defined in [chain.ts:8](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L8)* |
||||
|
||||
___ |
||||
|
||||
### Ganache |
||||
|
||||
• **Ganache**: = 0 |
||||
|
||||
*Defined in [chain.ts:18](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L18)* |
||||
|
||||
___ |
||||
|
||||
### Geth |
||||
|
||||
• **Geth**: = 1337 |
||||
|
||||
*Defined in [chain.ts:17](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L17)* |
||||
|
||||
___ |
||||
|
||||
### Kovan |
||||
|
||||
• **Kovan**: = 42 |
||||
|
||||
*Defined in [chain.ts:14](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L14)* |
||||
|
||||
___ |
||||
|
||||
### Morden |
||||
|
||||
• **Morden**: = 2 |
||||
|
||||
*Defined in [chain.ts:9](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L9)* |
||||
|
||||
___ |
||||
|
||||
### Rinkeby |
||||
|
||||
• **Rinkeby**: = 4 |
||||
|
||||
*Defined in [chain.ts:11](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L11)* |
||||
|
||||
___ |
||||
|
||||
### RootstockMainnet |
||||
|
||||
• **RootstockMainnet**: = 30 |
||||
|
||||
*Defined in [chain.ts:12](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L12)* |
||||
|
||||
___ |
||||
|
||||
### RootstockTestnet |
||||
|
||||
• **RootstockTestnet**: = 31 |
||||
|
||||
*Defined in [chain.ts:13](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L13)* |
||||
|
||||
___ |
||||
|
||||
### Ropsten |
||||
|
||||
• **Ropsten**: = 3 |
||||
|
||||
*Defined in [chain.ts:10](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L10)* |
@ -0,0 +1,28 @@ |
||||
> **[@harmony-js/utils](../README.md)** |
||||
|
||||
[ChainType](chaintype.md) / |
||||
|
||||
# Enumeration: ChainType |
||||
|
||||
## Index |
||||
|
||||
### Enumeration members |
||||
|
||||
* [Ethereum](chaintype.md#ethereum) |
||||
* [Harmony](chaintype.md#harmony) |
||||
|
||||
## Enumeration members |
||||
|
||||
### Ethereum |
||||
|
||||
• **Ethereum**: = "eth" |
||||
|
||||
*Defined in [chain.ts:3](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L3)* |
||||
|
||||
___ |
||||
|
||||
### Harmony |
||||
|
||||
• **Harmony**: = "hmy" |
||||
|
||||
*Defined in [chain.ts:2](https://github.com/harmony-one/sdk/blob/3ec028a/packages/harmony-utils/src/chain.ts#L2)* |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue