Hierarchy
Api
Constructors
constructor
⊕ new Api(args: object): Api
Defined in eosjs2-api.ts:100
Parameters:
| Param | Type | Description |
|---|---|---|
| args | object |
`rpc`: Issues RPC calls `authorityProvider`: Get public keys needed to meet authorities in a transaction `signatureProvider`: Signs transactions `chainId`: Identifies chain `textEncoder`: `TextEncoder` instance to use. Pass in `null` if running in a browser `textDecoder`: `TextDecider` instance to use. Pass in `null` if running in a browser |
Returns: Api
Properties
abiTypes
● abiTypes: Map<string, ser.Type>
Defined in eosjs2-api.ts:91
Converts abi files between binary and structured form (abi.abi.json)
authorityProvider
● authorityProvider: AuthorityProvider
Defined in eosjs2-api.ts:79
Get subset of availableKeys needed to meet authorities in a transaction
cachedAbis
● cachedAbis: Map<string, CachedAbi> = new Map
Defined in eosjs2-api.ts:100
Fetched abis
chainId
● chainId: string
Defined in eosjs2-api.ts:85
Identifies chain
contracts
● contracts: Map<string, Contract> = new Map
Defined in eosjs2-api.ts:97
Holds information needed to serialize contract actions
rpc
● rpc: JsonRpc
Defined in eosjs2-api.ts:76
Issues RPC calls
signatureProvider
● signatureProvider: SignatureProvider
Defined in eosjs2-api.ts:82
Signs transactions
textDecoder
● textDecoder: TextDecoder
Defined in eosjs2-api.ts:88
textEncoder
● textEncoder: TextEncoder
Defined in eosjs2-api.ts:87
transactionTypes
● transactionTypes: Map<string, ser.Type>
Defined in eosjs2-api.ts:94
Converts transactions between binary and structured form (transaction.abi.json)
Methods
deserialize
▸ deserialize(buffer: ser.SerialBuffer, type: string): any
Defined in eosjs2-api.ts:204
Convert data in buffer to structured form. type must be a built-in abi type or in transaction.abi.json.
Parameters:
| Param | Type |
|---|---|
| buffer | ser.SerialBuffer |
| type | string |
Returns: any
deserializeActions
▸ deserializeActions(actions: ser.Action[]): Promise<ser.Action[]>
Defined in eosjs2-api.ts:240
Convert actions from hex
Parameters:
| Param | Type |
|---|---|
| actions | ser.Action[] |
Returns: Promise<ser.Action[]>
deserializeTransaction
▸ deserializeTransaction(transaction: Uint8Array): any
Defined in eosjs2-api.ts:224
Convert a transaction from binary. Leaves actions in hex.
Parameters:
| Param | Type |
|---|---|
| transaction | Uint8Array |
Returns: any
deserializeTransactionWithActions
▸ deserializeTransactionWithActions(transaction: Uint8Array | string): Promise<any>
Defined in eosjs2-api.ts:249
Convert a transaction from binary. Also deserializes actions.
Parameters:
| Param | Type |
|---|---|
| transaction | Uint8Array | string |
Returns: Promise<any>
getAbi
▸ getAbi(accountName: string, reload?: boolean): Promise<Abi>
Defined in eosjs2-api.ts:167
Get abi in structured form. Fetch when needed.
Parameters:
| Param | Type | Default value |
|---|---|---|
| accountName | string |
- |
Default value reload |
boolean |
false |
Returns: Promise<Abi>
getCachedAbi
▸ getCachedAbi(accountName: string, reload?: boolean): Promise<CachedAbi>
Defined in eosjs2-api.ts:145
Get abi in both binary and structured forms. Fetch when needed.
Parameters:
| Param | Type | Default value |
|---|---|---|
| accountName | string |
- |
Default value reload |
boolean |
false |
Returns: Promise<CachedAbi>
getContract
▸ getContract(accountName: string, reload?: boolean): Promise<ser.Contract>
Defined in eosjs2-api.ts:183
Get data needed to serialize actions in a contract
Parameters:
| Param | Type | Default value |
|---|---|---|
| accountName | string |
- |
Default value reload |
boolean |
false |
Returns: Promise<ser.Contract>
getTransactionAbis
▸ getTransactionAbis(transaction: any, reload?: boolean): Promise<BinaryAbi[]>
Defined in eosjs2-api.ts:172
Get abis needed by a transaction
Parameters:
| Param | Type | Default value |
|---|---|---|
| transaction | any |
- |
Default value reload |
boolean |
false |
Returns: Promise<BinaryAbi[]>
pushSignedTransaction
▸ pushSignedTransaction(__namedParameters: object): Promise<any>
Defined in eosjs2-api.ts:308
Broadcast a signed transaction
Parameters:
| Param | Type |
|---|---|
| __namedParameters | object |
Returns: Promise<any>
rawAbiToJson
▸ rawAbiToJson(rawAbi: Uint8Array): Abi
Defined in eosjs2-api.ts:131
Decodes an abi as Uint8Array into json.
Parameters:
| Param | Type |
|---|---|
| rawAbi | Uint8Array |
Returns: Abi
serialize
▸ serialize(buffer: ser.SerialBuffer, type: string, value: any): void
Defined in eosjs2-api.ts:199
Convert value to binary form. type must be a built-in abi type or in transaction.abi.json.
Parameters:
| Param | Type |
|---|---|
| buffer | ser.SerialBuffer |
| type | string |
| value | any |
Returns: void
serializeActions
▸ serializeActions(actions: ser.Action[]): Promise<ser.SerializedAction[]>
Defined in eosjs2-api.ts:231
Convert actions to hex
Parameters:
| Param | Type |
|---|---|
| actions | ser.Action[] |
Returns: Promise<ser.SerializedAction[]>
serializeTransaction
▸ serializeTransaction(transaction: any): Uint8Array
Defined in eosjs2-api.ts:209
Convert a transaction to binary
Parameters:
| Param | Type |
|---|---|
| transaction | any |
Returns: Uint8Array
transact
▸ transact(transaction: any, __namedParameters?: object): Promise<any>
Defined in eosjs2-api.ts:268
Create and optionally broadcast a transaction.
Named Parameters:
broadcast: broadcast this transaction?- If both
blocksBehindandexpireSecondsare present, then fetch the block which isblocksBehindbehind head block, use it as a reference for TAPoS, and expire the transactionexpireSecondsafter that block's time.
Parameters:
| Param | Type | Default value |
|---|---|---|
| transaction | any |
- |
Default value __namedParameters |
object |
{} |
Returns: Promise<any>
node response if broadcast, {signatures, serializedTransaction} if !broadcast