Hierarchy
Api
Constructors
constructor
⊕ new Api(args: object
): Api
Defined in eosjs-api.ts:45
Parameters:
args: object
rpc
: Issues RPC callsauthorityProvider
: Get public keys needed to meet authorities in a transactionabiProvider
: Supplies ABIs in raw form (binary)signatureProvider
: Signs transactionschainId
: Identifies chaintextEncoder
:TextEncoder
instance to use. Pass innull
if running in a browsertextDecoder
:TextDecoder
instance to use. Pass innull
if running in a browser
Name | Type |
---|---|
Optional abiProvider |
AbiProvider |
Optional authorityProvider |
AuthorityProvider |
Optional chainId |
string |
rpc | JsonRpc |
signatureProvider | SignatureProvider |
Optional textDecoder |
TextDecoder |
Optional textEncoder |
TextEncoder |
Returns: Api
Properties
abiProvider
● abiProvider: AbiProvider
Defined in eosjs-api.ts:24
Supplies ABIs in raw form (binary)
abiTypes
● abiTypes: Map
<string
, ser.Type
>
Defined in eosjs-api.ts:36
Converts abi files between binary and structured form (abi.abi.json
)
authorityProvider
● authorityProvider: AuthorityProvider
Defined in eosjs-api.ts:21
Get subset of availableKeys
needed to meet authorities in a transaction
cachedAbis
● cachedAbis: Map
<string
, CachedAbi> = new Map
Defined in eosjs-api.ts:45
Fetched abis
chainId
● chainId: string
Defined in eosjs-api.ts:30
Identifies chain
contracts
● contracts: Map
<string
, Contract> = new Map
Defined in eosjs-api.ts:42
Holds information needed to serialize contract actions
rpc
● rpc: JsonRpc
Defined in eosjs-api.ts:18
Issues RPC calls
signatureProvider
● signatureProvider: SignatureProvider
Defined in eosjs-api.ts:27
Signs transactions
textDecoder
● textDecoder: TextDecoder
Defined in eosjs-api.ts:33
textEncoder
● textEncoder: TextEncoder
Defined in eosjs-api.ts:32
transactionTypes
● transactionTypes: Map
<string
, ser.Type
>
Defined in eosjs-api.ts:39
Converts transactions between binary and structured form (transaction.abi.json
)
Methods
deserialize
▸ deserialize(buffer: ser.SerialBuffer
, type: string
): any
Defined in eosjs-api.ts:151
Convert data in buffer
to structured form. type
must be a built-in abi type or in transaction.abi.json
.
Parameters:
Name | Type |
---|---|
buffer | ser.SerialBuffer |
type | string |
Returns: any
deserializeActions
▸ deserializeActions(actions: ser.Action
[]): Promise
<ser.Action
[]>
Defined in eosjs-api.ts:187
Convert actions from hex
Parameters:
Name | Type |
---|---|
actions | ser.Action [] |
Returns: Promise
<ser.Action
[]>
deserializeTransaction
▸ deserializeTransaction(transaction: Uint8Array
): any
Defined in eosjs-api.ts:171
Convert a transaction from binary. Leaves actions in hex.
Parameters:
Name | Type |
---|---|
transaction | Uint8Array |
Returns: any
deserializeTransactionWithActions
▸ deserializeTransactionWithActions(transaction: Uint8Array
| string
): Promise
<any
>
Defined in eosjs-api.ts:196
Convert a transaction from binary. Also deserializes actions.
Parameters:
Name | Type |
---|---|
transaction | Uint8Array | string |
Returns: Promise
<any
>
getAbi
▸ getAbi(accountName: string
, reload?: boolean
): Promise
<Abi>
Defined in eosjs-api.ts:114
Get abi in structured form. Fetch when needed.
Parameters:
Name | Type | Default value |
---|---|---|
accountName | string |
- |
Default value reload |
boolean |
false |
Returns: Promise
<Abi>
getCachedAbi
▸ getCachedAbi(accountName: string
, reload?: boolean
): Promise
<CachedAbi>
Defined in eosjs-api.ts:93
Get abi in both binary and structured forms. Fetch when needed.
Parameters:
Name | Type | Default value |
---|---|---|
accountName | string |
- |
Default value reload |
boolean |
false |
Returns: Promise
<CachedAbi>
getContract
▸ getContract(accountName: string
, reload?: boolean
): Promise
<ser.Contract
>
Defined in eosjs-api.ts:130
Get data needed to serialize actions in a contract
Parameters:
Name | Type | Default value |
---|---|---|
accountName | string |
- |
Default value reload |
boolean |
false |
Returns: Promise
<ser.Contract
>
getTransactionAbis
▸ getTransactionAbis(transaction: any
, reload?: boolean
): Promise
<BinaryAbi[]>
Defined in eosjs-api.ts:119
Get abis needed by a transaction
Parameters:
Name | Type | Default value |
---|---|---|
transaction | any |
- |
Default value reload |
boolean |
false |
Returns: Promise
<BinaryAbi[]>
pushSignedTransaction
▸ pushSignedTransaction(__namedParameters: object
): Promise
<any
>
Defined in eosjs-api.ts:259
Broadcast a signed transaction
Parameters:
__namedParameters: object
Name | Type |
---|---|
serializedTransaction | Uint8Array |
signatures | string [] |
Returns: Promise
<any
>
rawAbiToJson
▸ rawAbiToJson(rawAbi: Uint8Array
): Abi
Defined in eosjs-api.ts:79
Decodes an abi as Uint8Array into json.
Parameters:
Name | Type |
---|---|
rawAbi | Uint8Array |
Returns: Abi
serialize
▸ serialize(buffer: ser.SerialBuffer
, type: string
, value: any
): void
Defined in eosjs-api.ts:146
Convert value
to binary form. type
must be a built-in abi type or in transaction.abi.json
.
Parameters:
Name | Type |
---|---|
buffer | ser.SerialBuffer |
type | string |
value | any |
Returns: void
serializeActions
▸ serializeActions(actions: ser.Action
[]): Promise
<ser.SerializedAction
[]>
Defined in eosjs-api.ts:178
Convert actions to hex
Parameters:
Name | Type |
---|---|
actions | ser.Action [] |
Returns: Promise
<ser.SerializedAction
[]>
serializeTransaction
▸ serializeTransaction(transaction: any
): Uint8Array
Defined in eosjs-api.ts:156
Convert a transaction to binary
Parameters:
Name | Type |
---|---|
transaction | any |
Returns: Uint8Array
transact
▸ transact(transaction: any
, __namedParameters?: object
): Promise
<any
>
Defined in eosjs-api.ts:216
Create and optionally broadcast a transaction.
Named Parameters:
broadcast
: broadcast this transaction?sign
: sign this transaction?- If both
blocksBehind
andexpireSeconds
are present, then fetch the block which isblocksBehind
behind head block, use it as a reference for TAPoS, and expire the transactionexpireSeconds
after that block's time.
Parameters:
transaction: any
Default value
__namedParameters: object
Name | Type | Default value |
---|---|---|
blocksBehind | number |
- |
broadcast | boolean |
true |
expireSeconds | number |
- |
sign | boolean |
true |
Returns: Promise
<any
>
node response if broadcast
, {signatures, serializedTransaction}
if !broadcast