eosjs
- Version 22.1.0
- Published
- 419 kB
- 4 dependencies
- MIT license
Install
npm i eosjs
yarn add eosjs
pnpm add eosjs
Overview
Talk to eos API
Index
Classes
Api
- abiProvider
- abiTypes
- authorityProvider
- buildTransaction()
- cachedAbis
- chainId
- contracts
- deflateSerializedArray()
- deleteTransactionExtensionObjects()
- deserialize()
- deserializeActions()
- deserializeTransaction()
- deserializeTransactionExtensions()
- deserializeTransactionWithActions()
- getAbi()
- getCachedAbi()
- getContract()
- getTransactionAbis()
- inflateSerializedArray()
- jsonToRawAbi()
- pushCompressedSignedTransaction()
- pushSignedTransaction()
- query()
- rawAbiToJson()
- rpc
- serialize()
- serializeActions()
- serializeContextFreeData()
- serializeTransaction()
- serializeTransactionExtensions()
- signatureProvider
- textDecoder
- textEncoder
- transact()
- transactionTypes
- with()
JsonRpc
- abi_bin_to_json()
- abi_json_to_bin()
- db_size_get()
- endpoint
- fetch()
- fetchBuiltin
- get_abi()
- get_account()
- get_accounts_by_authorizers()
- get_activated_protocol_features()
- get_block()
- get_block_header_state()
- get_block_info()
- get_code()
- get_code_hash()
- get_currency_balance()
- get_currency_stats()
- get_info()
- get_kv_table_rows()
- get_producer_schedule()
- get_producers()
- get_raw_abi()
- get_raw_code_and_abi()
- get_scheduled_transactions()
- get_table_by_scope()
- get_table_rows()
- getRawAbi()
- getRequiredKeys()
- history_get_actions()
- history_get_controlled_accounts()
- history_get_key_accounts()
- history_get_transaction()
- push_ro_transaction()
- push_transaction()
- push_transactions()
- send_transaction()
- trace_get_block()
Namespaces
ApiInterfaces
- AbiProvider
- AccountDelta
- ActionReceipt
- ActionSerializerType
- ActionTrace
- AuthorityProvider
- AuthorityProviderArgs
- AuthSequence
- BinaryAbi
- CachedAbi
- ContextFreeGroupCallback
- Query
- QueryConfig
- ResourcePayer
- SignatureProvider
- SignatureProviderArgs
- TransactConfig
- Transaction
- TransactionHeader
- TransactionReceiptHeader
- TransactionTrace
- TransactResult
Numeric
- base58ToBinary()
- base64ToBinary()
- binaryToBase58()
- binaryToDecimal()
- convertLegacyPublicKey()
- convertLegacyPublicKeys()
- decimalToBinary()
- isNegative()
- Key
- KeyType
- negate()
- privateKeyDataSize
- privateKeyToLegacyString()
- privateKeyToString()
- publicKeyDataSize
- publicKeyToLegacyString()
- publicKeyToString()
- signatureDataSize
- signatureToString()
- signedBinaryToDecimal()
- signedDecimalToBinary()
- stringToPrivateKey()
- stringToPublicKey()
- stringToSignature()
RpcInterfaces
- Abi
- AbiBinToJsonResult
- AbiJsonToBinResult
- AccountResourceInfo
- AccountResult
- ActivatedProtocolFeature
- Authority
- BlockHeader
- BlockHeaderStateTaposInfo
- BlockSigningAuthority
- BlockTaposInfo
- DBSizeGetResult
- DBSizeIndexCount
- DeferredTransaction
- GeneratedTransaction
- GetAbiResult
- GetAccountResult
- GetAccountsByAuthorizersResult
- GetActionsResult
- GetActivatedProtocolFeaturesParams
- GetActivatedProtocolFeaturesResult
- GetBlockHeaderStateResult
- GetBlockInfoResult
- GetBlockResult
- GetCodeHashResult
- GetCodeResult
- GetControlledAccountsResult
- GetCurrencyStatsResult
- GetInfoResult
- GetKeyAccountsResult
- GetProducerScheduleResult
- GetProducersResult
- GetRawAbiResult
- GetRawCodeAndAbiResult
- GetScheduledTransactionsResult
- GetTableByScopeResult
- GetTableByScopeResultRow
- GetTableRowsResult
- GetTransactionResult
- IncrementalMerkle
- KeyWeight
- OrderedActionResult
- PackedTransaction
- PackedTrx
- Permission
- PermissionLevel
- PermissionLevelWeight
- ProcessedAction
- ProcessedTransaction
- ProducerAuthority
- ProducerAuthoritySchedule
- ProducerDetails
- ProducerKey
- ProducerScheduleType
- ProtocolFeatureActivationSet
- PushTransactionArgs
- ReadOnlyTransactResult
- RefundRequest
- ResourceDelegation
- ResourceOverview
- RexBalance
- ScheduleInfo
- SecurityGroupInfo
- SignedBlockHeader
- StateExtension
- TraceApiAction
- TraceApiGetBlockResult
- TraceApiTransaction
- TraceApiTransactionHeader
- TransactionReceipt
- VoterInfo
- WaitWeight
Serialize
- Action
- Anyvar
- arrayToHex()
- Authorization
- blockTimestampToDate()
- Contract
- createAbiTypes()
- createInitialTypes()
- createTransactionExtensionTypes()
- createTransactionTypes()
- dateToBlockTimestamp()
- dateToTimePoint()
- dateToTimePointSec()
- deserializeAction()
- deserializeActionData()
- deserializeAnyArray()
- deserializeAnyObject()
- deserializeAnyvar()
- deserializeAnyvarShort()
- Field
- getType()
- getTypesFromAbi()
- hexToUint8Array()
- SerialBuffer
- serializeAction()
- serializeActionData()
- serializeAnyArray()
- serializeAnyObject()
- serializeAnyvar()
- SerializedAction
- serializeQuery()
- SerializerOptions
- SerializerState
- stringToSymbol()
- supportedAbiVersion()
- Symbol
- symbolToString()
- timePointSecToDate()
- timePointToDate()
- transactionHeader()
- Type
Classes
class Api
class Api {}
constructor
constructor(args: { rpc: JsonRpc; authorityProvider?: AuthorityProvider; abiProvider?: AbiProvider; signatureProvider: SignatureProvider; chainId?: string; textEncoder?: TextEncoder; textDecoder?: TextDecoder;});
Parameter args
*
rpc
: Issues RPC calls *authorityProvider
: Get public keys needed to meet authorities in a transaction *abiProvider
: Supplies ABIs in raw form (binary) *signatureProvider
: Signs transactions *chainId
: Identifies chain *textEncoder
:TextEncoder
instance to use. Pass innull
if running in a browser *textDecoder
:TextDecoder
instance to use. Pass innull
if running in a browser
property abiProvider
abiProvider: AbiProvider;
Supplies ABIs in raw form (binary)
property abiTypes
abiTypes: Map<string, ser.Type>;
Converts abi files between binary and structured form (
abi.abi.json
)
property authorityProvider
authorityProvider: AuthorityProvider;
Get subset of
availableKeys
needed to meet authorities in atransaction
property cachedAbis
cachedAbis: Map<string, CachedAbi>;
Fetched abis
property chainId
chainId: string;
Identifies chain
property contracts
contracts: Map<string, ser.Contract>;
Holds information needed to serialize contract actions
property rpc
rpc: JsonRpc;
Issues RPC calls
property signatureProvider
signatureProvider: SignatureProvider;
Signs transactions
property textDecoder
textDecoder: TextDecoder;
property textEncoder
textEncoder: TextEncoder;
property transactionTypes
transactionTypes: Map<string, ser.Type>;
Converts transactions between binary and structured form (
transaction.abi.json
)
method buildTransaction
buildTransaction: ( cb?: (tx: TransactionBuilder) => void) => TransactionBuilder | void;
method deflateSerializedArray
deflateSerializedArray: (serializedArray: Uint8Array) => Uint8Array;
Deflate a serialized object
method deleteTransactionExtensionObjects
deleteTransactionExtensionObjects: (transaction: Transaction) => Transaction;
method deserialize
deserialize: (buffer: ser.SerialBuffer, type: string) => any;
Convert data in
buffer
to structured form.type
must be a built-in abi type or intransaction.abi.json
.
method deserializeActions
deserializeActions: (actions: ser.Action[]) => Promise<ser.Action[]>;
Convert actions from hex
method deserializeTransaction
deserializeTransaction: (transaction: Uint8Array) => Transaction;
Convert a transaction from binary. Leaves actions in hex.
method deserializeTransactionExtensions
deserializeTransactionExtensions: (data: [number, string][]) => any[];
method deserializeTransactionWithActions
deserializeTransactionWithActions: ( transaction: Uint8Array | string) => Promise<Transaction>;
Convert a transaction from binary. Also deserializes actions.
method getAbi
getAbi: (accountName: string, reload?: boolean) => Promise<Abi>;
Get abi in structured form. Fetch when needed.
method getCachedAbi
getCachedAbi: (accountName: string, reload?: boolean) => Promise<CachedAbi>;
Get abi in both binary and structured forms. Fetch when needed.
method getContract
getContract: (accountName: string, reload?: boolean) => Promise<ser.Contract>;
Get data needed to serialize actions in a contract
method getTransactionAbis
getTransactionAbis: ( transaction: Transaction, reload?: boolean) => Promise<BinaryAbi[]>;
Get abis needed by a transaction
method inflateSerializedArray
inflateSerializedArray: (compressedSerializedArray: Uint8Array) => Uint8Array;
Inflate a compressed serialized object
method jsonToRawAbi
jsonToRawAbi: (jsonAbi: Abi) => Uint8Array;
Encodes a json abi as Uint8Array.
method pushCompressedSignedTransaction
pushCompressedSignedTransaction: ( { signatures, serializedTransaction, serializedContextFreeData, }: PushTransactionArgs, readOnlyTrx?: boolean, returnFailureTraces?: boolean) => Promise<TransactResult | ReadOnlyTransactResult>;
method pushSignedTransaction
pushSignedTransaction: ( { signatures, serializedTransaction, serializedContextFreeData, }: PushTransactionArgs, readOnlyTrx?: boolean, returnFailureTraces?: boolean) => Promise<TransactResult | ReadOnlyTransactResult>;
Broadcast a signed transaction
method query
query: ( account: string, short: boolean, query: Query, { sign, requiredKeys, authorization }: QueryConfig) => Promise<any>;
method rawAbiToJson
rawAbiToJson: (rawAbi: Uint8Array) => Abi;
Decodes an abi as Uint8Array into json.
method serialize
serialize: (buffer: ser.SerialBuffer, type: string, value: any) => void;
Convert
value
to binary form.type
must be a built-in abi type or intransaction.abi.json
.
method serializeActions
serializeActions: (actions: ser.Action[]) => Promise<ser.SerializedAction[]>;
Convert actions to hex
method serializeContextFreeData
serializeContextFreeData: (contextFreeData: Uint8Array[]) => Uint8Array;
Serialize context-free data
method serializeTransaction
serializeTransaction: (transaction: Transaction) => Uint8Array;
Convert a transaction to binary
method serializeTransactionExtensions
serializeTransactionExtensions: (transaction: Transaction) => [number, string][];
method transact
transact: ( transaction: Transaction, { broadcast, sign, readOnlyTrx, returnFailureTraces, requiredKeys, compression, blocksBehind, useLastIrreversible, expireSeconds, }?: TransactConfig) => Promise<TransactResult | ReadOnlyTransactResult | PushTransactionArgs>;
Create and optionally broadcast a transaction.
Named Parameters:
broadcast
: broadcast this transaction?sign
: sign this transaction?compression
: compress this transaction?readOnlyTrx
: read only transaction?returnFailureTraces
: return failure traces? (only available for read only transactions currently)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.If both
useLastIrreversible
andexpireSeconds
are present, then fetch the last irreversible block, use it as a reference for TAPoS, and expire the transactionexpireSeconds
after that block's time.Returns
node response if
broadcast
,{signatures, serializedTransaction}
if!broadcast
method with
with: (accountName: string) => ActionBuilder;
class JsonRpc
class JsonRpc implements AuthorityProvider, AbiProvider {}
Make RPC calls
constructor
constructor( endpoint: string, args?: { fetch?: (input?: any, init?: any) => Promise<any> });
Parameter args
fetch
: browsers: leavenull
orundefined
node: provide an implementation
property endpoint
endpoint: string;
property fetchBuiltin
fetchBuiltin: (input?: any, init?: any) => Promise<any>;
method abi_bin_to_json
abi_bin_to_json: ( code: string, action: string, binargs: string) => Promise<AbiBinToJsonResult>;
method abi_json_to_bin
abi_json_to_bin: ( code: string, action: string, args: any[]) => Promise<AbiJsonToBinResult>;
method db_size_get
db_size_get: () => Promise<DBSizeGetResult>;
Raw call to
/v1/db_size/get
method fetch
fetch: (path: string, body: any) => Promise<any>;
Post
body
toendpoint + path
. Throws detailed error information inRpcError
when available.
method get_abi
get_abi: (accountName: string) => Promise<GetAbiResult>;
Raw call to
/v1/chain/get_abi
method get_account
get_account: (accountName: string) => Promise<GetAccountResult>;
Raw call to
/v1/chain/get_account
method get_accounts_by_authorizers
get_accounts_by_authorizers: ( accounts: Authorization[], keys: string[]) => Promise<GetAccountsByAuthorizersResult>;
Raw call to
/v1/chain/get_accounts_by_authorizers
method get_activated_protocol_features
get_activated_protocol_features: ({ limit, search_by_block_num, reverse, lower_bound, upper_bound,}: GetActivatedProtocolFeaturesParams) => Promise<GetActivatedProtocolFeaturesResult>;
Raw call to
get_activated_protocol_features
method get_block
get_block: (blockNumOrId: number | string) => Promise<GetBlockResult>;
Raw call to
/v1/chain/get_block
method get_block_header_state
get_block_header_state: ( blockNumOrId: number | string) => Promise<GetBlockHeaderStateResult>;
Raw call to
/v1/chain/get_block_header_state
method get_block_info
get_block_info: (blockNum: number) => Promise<GetBlockInfoResult>;
Raw call to
/v1/chain/get_block_info
method get_code
get_code: (accountName: string) => Promise<GetCodeResult>;
Raw call to
/v1/chain/get_code
method get_code_hash
get_code_hash: (accountName: string) => Promise<GetCodeHashResult>;
Raw call to
/v1/chain/get_code_hash
method get_currency_balance
get_currency_balance: ( code: string, account: string, symbol?: string) => Promise<string[]>;
Raw call to
/v1/chain/get_currency_balance
method get_currency_stats
get_currency_stats: ( code: string, symbol: string) => Promise<GetCurrencyStatsResult>;
Raw call to
/v1/chain/get_currency_stats
method get_info
get_info: () => Promise<GetInfoResult>;
Raw call to
/v1/chain/get_info
method get_kv_table_rows
get_kv_table_rows: ({ json, code, table, index_name, encode_type, index_value, lower_bound, upper_bound, limit, reverse, show_payer,}: any) => Promise<GetTableRowsResult>;
Raw call to
/v1/chain/get_kv_table_rows
method get_producer_schedule
get_producer_schedule: () => Promise<GetProducerScheduleResult>;
Raw call to
/v1/chain/get_producer_schedule
method get_producers
get_producers: ( json?: boolean, lowerBound?: string, limit?: number) => Promise<GetProducersResult>;
Raw call to
/v1/chain/get_producers
method get_raw_abi
get_raw_abi: (accountName: string) => Promise<GetRawAbiResult>;
Raw call to
/v1/chain/get_raw_abi
method get_raw_code_and_abi
get_raw_code_and_abi: (accountName: string) => Promise<GetRawCodeAndAbiResult>;
Raw call to
/v1/chain/get_raw_code_and_abi
method get_scheduled_transactions
get_scheduled_transactions: ( json?: boolean, lowerBound?: string, limit?: number) => Promise<GetScheduledTransactionsResult>;
Raw call to
/v1/chain/get_scheduled_transactions
method get_table_by_scope
get_table_by_scope: ({ code, table, lower_bound, upper_bound, limit,}: any) => Promise<GetTableByScopeResult>;
Raw call to
/v1/chain/get_table_by_scope
method get_table_rows
get_table_rows: ({ json, code, scope, table, lower_bound, upper_bound, index_position, key_type, limit, reverse, show_payer,}: any) => Promise<GetTableRowsResult>;
Raw call to
/v1/chain/get_table_rows
method getRawAbi
getRawAbi: (accountName: string) => Promise<BinaryAbi>;
calls
/v1/chain/get_raw_code_and_abi
and pulls out unneeded raw wasm code
method getRequiredKeys
getRequiredKeys: (args: AuthorityProviderArgs) => Promise<string[]>;
Get subset of
availableKeys
needed to meet authorities intransaction
. ImplementsAuthorityProvider
method history_get_actions
history_get_actions: ( accountName: string, pos?: number, offset?: number) => Promise<GetActionsResult>;
Raw call to
/v1/history/get_actions
method history_get_controlled_accounts
history_get_controlled_accounts: ( controllingAccount: string) => Promise<GetControlledAccountsResult>;
Raw call to
/v1/history/get_controlled_accounts
method history_get_key_accounts
history_get_key_accounts: (publicKey: string) => Promise<GetKeyAccountsResult>;
Raw call to
/v1/history/get_key_accounts
method history_get_transaction
history_get_transaction: ( id: string, blockNumHint?: number) => Promise<GetTransactionResult>;
Raw call to
/v1/history/get_transaction
method push_ro_transaction
push_ro_transaction: ( { signatures, compression, serializedTransaction }: PushTransactionArgs, returnFailureTraces?: boolean) => Promise<ReadOnlyTransactResult>;
Raw call to `/v1/chain/push_ro_transaction
method push_transaction
push_transaction: ({ signatures, compression, serializedTransaction, serializedContextFreeData,}: PushTransactionArgs) => Promise<TransactResult>;
Push a serialized transaction (replaced by send_transaction, but returned format has changed)
method push_transactions
push_transactions: ( transactions: PushTransactionArgs[]) => Promise<TransactResult[]>;
method send_transaction
send_transaction: ({ signatures, compression, serializedTransaction, serializedContextFreeData,}: PushTransactionArgs) => Promise<TransactResult>;
Send a serialized transaction
method trace_get_block
trace_get_block: (block_num: number) => Promise<TraceApiGetBlockResult>;
Raw call to
/v1/trace_api/get_block
class RpcError
class RpcError extends Error {}
Holds detailed error information
constructor
constructor(json: any);
property details
details: any;
property json
json: any;
Detailed error information
Namespaces
namespace ApiInterfaces
module 'dist/eosjs-api-interfaces.d.ts' {}
Javascript-API copyright defined in eosjs/LICENSE.txt
interface AbiProvider
interface AbiProvider {}
Retrieves raw ABIs for a specified accountName
property getRawAbi
getRawAbi: (accountName: string) => Promise<BinaryAbi>;
Retrieve the BinaryAbi
interface AccountDelta
interface AccountDelta {}
interface ActionReceipt
interface ActionReceipt {}
property abi_sequence
abi_sequence: number;
property act_digest
act_digest: string;
property auth_sequence
auth_sequence: [string, number][];
property code_sequence
code_sequence: number;
property global_sequence
global_sequence: number;
property receiver
receiver: string;
property recv_sequence
recv_sequence: number;
interface ActionSerializerType
interface ActionSerializerType {}
index signature
[actionName: string]: any;
interface ActionTrace
interface ActionTrace {}
property account_disk_deltas
account_disk_deltas: AccountDelta[];
property account_ram_deltas
account_ram_deltas: AccountDelta[];
property act
act: ProcessedAction;
property action_ordinal
action_ordinal: number;
property block_num
block_num: number;
property block_time
block_time: string;
property closest_unnotified_ancestor_action_ordinal
closest_unnotified_ancestor_action_ordinal: number;
property console
console: string;
property context_free
context_free: boolean;
property creator_action_ordinal
creator_action_ordinal: number;
property elapsed
elapsed: number;
property error_code
error_code: number | null;
property except
except: any;
property inline_traces
inline_traces?: ActionTrace[];
property producer_block_id
producer_block_id: string | null;
property receipt
receipt: ActionReceipt;
property receiver
receiver: string;
property return_value
return_value?: any;
property return_value_data
return_value_data?: any;
property return_value_hex_data
return_value_hex_data?: string;
property trx_id
trx_id: string;
interface AuthorityProvider
interface AuthorityProvider {}
Get subset of
availableKeys
needed to meet authorities intransaction
property getRequiredKeys
getRequiredKeys: (args: AuthorityProviderArgs) => Promise<string[]>;
Get subset of
availableKeys
needed to meet authorities intransaction
interface AuthorityProviderArgs
interface AuthorityProviderArgs {}
Arguments to
getRequiredKeys
property availableKeys
availableKeys: string[];
Public keys associated with the private keys that the
SignatureProvider
holds
property transaction
transaction: any;
Transaction that needs to be signed
interface AuthSequence
interface AuthSequence {}
interface BinaryAbi
interface BinaryAbi {}
Structure for the raw form of ABIs
property abi
abi: Uint8Array;
abi in binary form
property accountName
accountName: string;
account which has deployed the ABI
interface CachedAbi
interface CachedAbi {}
Holds a fetched abi
interface QueryConfig
interface QueryConfig {}
Optional query configuration object
property authorization
authorization?: Authorization[];
property requiredKeys
requiredKeys?: string[];
property sign
sign?: boolean;
interface ResourcePayer
interface ResourcePayer {}
property max_cpu_us
max_cpu_us: number;
property max_memory_bytes
max_memory_bytes: number;
property max_net_bytes
max_net_bytes: number;
property payer
payer: string;
interface SignatureProvider
interface SignatureProvider {}
Signs transactions
property getAvailableKeys
getAvailableKeys: () => Promise<string[]>;
Public keys associated with the private keys that the
SignatureProvider
holds
property sign
sign: (args: SignatureProviderArgs) => Promise<PushTransactionArgs>;
Sign a transaction
interface SignatureProviderArgs
interface SignatureProviderArgs {}
Arguments to
sign
property abis
abis: BinaryAbi[];
ABIs for all contracts with actions included in
serializedTransaction
property chainId
chainId: string;
Chain transaction is for
property requiredKeys
requiredKeys: string[];
Public keys associated with the private keys needed to sign the transaction
property serializedContextFreeData
serializedContextFreeData?: Uint8Array;
Context-free data to sign
property serializedTransaction
serializedTransaction: Uint8Array;
Transaction to sign
interface TransactConfig
interface TransactConfig {}
Optional transact configuration object
property blocksBehind
blocksBehind?: number;
property broadcast
broadcast?: boolean;
property compression
compression?: boolean;
property expireSeconds
expireSeconds?: number;
property readOnlyTrx
readOnlyTrx?: boolean;
property requiredKeys
requiredKeys?: string[];
property returnFailureTraces
returnFailureTraces?: boolean;
property sign
sign?: boolean;
property useLastIrreversible
useLastIrreversible?: boolean;
interface Transaction
interface Transaction {}
property actions
actions: Action[];
property context_free_actions
context_free_actions?: Action[];
property context_free_data
context_free_data?: Uint8Array[];
property delay_sec
delay_sec?: number;
property expiration
expiration?: string;
property max_cpu_usage_ms
max_cpu_usage_ms?: number;
property max_net_usage_words
max_net_usage_words?: number;
property ref_block_num
ref_block_num?: number;
property ref_block_prefix
ref_block_prefix?: number;
property resource_payer
resource_payer?: ResourcePayer;
property transaction_extensions
transaction_extensions?: [number, string][];
interface TransactionHeader
interface TransactionHeader {}
property expiration
expiration: string;
property ref_block_num
ref_block_num: number;
property ref_block_prefix
ref_block_prefix: number;
interface TransactionReceiptHeader
interface TransactionReceiptHeader {}
property cpu_usage_us
cpu_usage_us: number;
property net_usage_words
net_usage_words: number;
property status
status: string;
interface TransactionTrace
interface TransactionTrace {}
property account_ram_delta
account_ram_delta: AccountDelta | null;
property action_traces
action_traces: ActionTrace[];
property bill_to_accounts
bill_to_accounts: string[];
property block_num
block_num: number;
property block_time
block_time: string;
property elapsed
elapsed: number;
property error_code
error_code: number | null;
property except
except: string | null;
property id
id: string;
property net_usage
net_usage: number;
property producer_block_id
producer_block_id: string | null;
property receipt
receipt: TransactionReceiptHeader | null;
property scheduled
scheduled: boolean;
interface TransactResult
interface TransactResult {}
property processed
processed: TransactionTrace;
property transaction_id
transaction_id: string;
type ContextFreeGroupCallback
type ContextFreeGroupCallback = (index: { cfa: number; cfd: number }) => { action?: SerializedAction; contextFreeAction?: SerializedAction; contextFreeData?: Uint8Array;};
type Query
type Query = | string | [string, Query[]] | [string, Anyvar, Query[]] | { method: string; arg?: Anyvar; filter?: Query[]; };
A Query may be any of the following: * string: method * [string, Query[]]: [method, filter] * [string, Anyvar, Query[]]: [method, arg, filter] * {method: string, arg?: Anyvar, filter?: Query[]} explicit form
namespace Numeric
module 'dist/eosjs-numeric.d.ts' {}
Is
bignum
a negative number?
variable privateKeyDataSize
const privateKeyDataSize: number;
Private key data size, excluding type field
variable publicKeyDataSize
const publicKeyDataSize: number;
Public key data size, excluding type field
variable signatureDataSize
const signatureDataSize: number;
Signature data size, excluding type field
function base58ToBinary
base58ToBinary: (size: number, s: string) => Uint8Array;
Convert an unsigned base-58 number in
s
to a bignumParameter size
bignum size (bytes)
function base64ToBinary
base64ToBinary: (s: string) => Uint8Array;
Convert an unsigned base-64 number in
s
to a bignum
function binaryToBase58
binaryToBase58: (bignum: Uint8Array, minDigits?: number) => string;
Convert
bignum
to a base-58 numberParameter minDigits
0-pad result to this many digits
function binaryToDecimal
binaryToDecimal: (bignum: Uint8Array, minDigits?: number) => string;
Convert
bignum
to an unsigned decimal numberParameter minDigits
0-pad result to this many digits
function convertLegacyPublicKey
convertLegacyPublicKey: (s: string) => string;
If a key is in the legacy format (
EOS
prefix), then convert it to the new format (PUB_K1_
). Leaves other formats untouched
function convertLegacyPublicKeys
convertLegacyPublicKeys: (keys: string[]) => string[];
If a key is in the legacy format (
EOS
prefix), then convert it to the new format (PUB_K1_
). Leaves other formats untouched
function decimalToBinary
decimalToBinary: (size: number, s: string) => Uint8Array;
Convert an unsigned decimal number in
s
to a bignumParameter size
bignum size (bytes)
function isNegative
isNegative: (bignum: Uint8Array) => boolean;
Is
bignum
a negative number?
function negate
negate: (bignum: Uint8Array) => void;
Negate
bignum
function privateKeyToLegacyString
privateKeyToLegacyString: (key: Key) => string;
Convert private
key
to legacy string (base-58) form
function privateKeyToString
privateKeyToString: (key: Key) => string;
Convert
key
to string (base-58) form
function publicKeyToLegacyString
publicKeyToLegacyString: (key: Key) => string;
Convert public
key
to legacy string (base-58) form
function publicKeyToString
publicKeyToString: (key: Key) => string;
Convert
key
to string (base-58) form
function signatureToString
signatureToString: (signature: Key) => string;
Convert
signature
to string (base-58) form
function signedBinaryToDecimal
signedBinaryToDecimal: (bignum: Uint8Array, minDigits?: number) => string;
Convert
bignum
to a signed decimal numberParameter minDigits
0-pad result to this many digits
function signedDecimalToBinary
signedDecimalToBinary: (size: number, s: string) => Uint8Array;
Convert a signed decimal number in
s
to a bignumParameter size
bignum size (bytes)
function stringToPrivateKey
stringToPrivateKey: (s: string) => Key;
Convert key in
s
to binary form
function stringToPublicKey
stringToPublicKey: (s: string) => Key;
Convert key in
s
to binary form
function stringToSignature
stringToSignature: (s: string) => Key;
Convert key in
s
to binary form
interface Key
interface Key {}
Public key, private key, or signature in binary form
namespace RpcInterfaces
module 'dist/eosjs-rpc-interfaces.d.ts' {}
RPC-API-Methods copyright defined in eosjs/LICENSE.txt
interface Abi
interface Abi {}
Structured format for abis
property abi_extensions
abi_extensions: { tag: number; value: string;}[];
property action_results
action_results?: { name: string; result_type: string;}[];
property actions
actions: { name: string; type: string; ricardian_contract: string;}[];
property error_messages
error_messages: { error_code: number; error_msg: string;}[];
property kv_tables
kv_tables?: { [key: string]: { type: string; primary_index: { name: string; type: string; }; secondary_indices: { [key: string]: { type: string; }; }[]; };}[];
property ricardian_clauses
ricardian_clauses: { id: string; body: string;}[];
property structs
structs: { name: string; base: string; fields: { name: string; type: string; }[];}[];
property tables
tables: { name: string; type: string; index_type: string; key_names: string[]; key_types: string[];}[];
property types
types: { new_type_name: string; type: string;}[];
property variants
variants?: { name: string; types: string[];}[];
property version
version: string;
interface AbiBinToJsonResult
interface AbiBinToJsonResult {}
Return value of
/v1/chain/abi_bin_to_json
property args
args: 'any';
interface AbiJsonToBinResult
interface AbiJsonToBinResult {}
Return value of
/v1/chain/abi_json_to_bin
property binargs
binargs: 'string';
interface AccountResourceInfo
interface AccountResourceInfo {}
property available
available: number;
property current_used
current_used?: number;
property last_usage_update_time
last_usage_update_time?: string;
property max
max: number;
property used
used: number;
interface AccountResult
interface AccountResult {}
property account_name
account_name: string;
property authorizing_account
authorizing_account?: Authorization;
property authorizing_key
authorizing_key?: string;
property permission_name
permission_name: string;
property threshold
threshold: number;
property weight
weight: number;
interface ActivatedProtocolFeature
interface ActivatedProtocolFeature {}
property activation_block_num
activation_block_num: number;
property activation_ordinal
activation_ordinal: number;
property dependencies
dependencies: string[];
property description_digest
description_digest: string;
property feature_digest
feature_digest: string;
property protocol_feature_type
protocol_feature_type: string;
property specification
specification: { name: string; value: string;};
interface Authority
interface Authority {}
interface BlockHeader
interface BlockHeader {}
property action_mroot
action_mroot: string;
property confirmed
confirmed: number;
property header_extensions
header_extensions: [number, string][];
property new_producers
new_producers?: ProducerScheduleType;
property previous
previous: string;
property producer
producer: string;
property schedule_version
schedule_version: number;
property timestamp
timestamp: string;
property transaction_mroot
transaction_mroot: string;
interface BlockHeaderStateTaposInfo
interface BlockHeaderStateTaposInfo {}
Subset of
GetBlockHeaderStateResult
used to calculate TAPoS fields in transactions
interface BlockSigningAuthority
interface BlockSigningAuthority {}
interface BlockTaposInfo
interface BlockTaposInfo {}
Used to calculate TAPoS fields in transactions
interface DBSizeGetResult
interface DBSizeGetResult {}
Return value of
/v1/db_size/get
property free_bytes
free_bytes: number;
property indices
indices: DBSizeIndexCount[];
property size
size: number;
property used_bytes
used_bytes: number;
interface DBSizeIndexCount
interface DBSizeIndexCount {}
interface DeferredTransaction
interface DeferredTransaction extends ProcessedTransaction {}
property deferred_transaction_generation
deferred_transaction_generation?: { sender_trx_id: string; sender_id: string; sender: string;};
interface GeneratedTransaction
interface GeneratedTransaction {}
property delay_until
delay_until: string;
property expiration
expiration: string;
property packed_trx
packed_trx?: string[];
property payer
payer: string;
property published
published: string;
property sender
sender: string;
property sender_id
sender_id: string;
property transaction
transaction?: DeferredTransaction[];
property trx_id
trx_id: string;
interface GetAbiResult
interface GetAbiResult {}
Return value of
/v1/chain/get_abi
property abi
abi?: Abi;
property account_name
account_name: string;
interface GetAccountResult
interface GetAccountResult {}
Return value of
/v1/chain/get_account
property account_name
account_name: string;
property core_liquid_balance
core_liquid_balance?: string;
property cpu_limit
cpu_limit: AccountResourceInfo;
property cpu_weight
cpu_weight: number;
property created
created: string;
property head_block_num
head_block_num: number;
property head_block_time
head_block_time: string;
property last_code_update
last_code_update: string;
property net_limit
net_limit: AccountResourceInfo;
property net_weight
net_weight: number;
property permissions
permissions: Permission[];
property privileged
privileged: boolean;
property ram_quota
ram_quota: number;
property ram_usage
ram_usage: number;
property refund_request
refund_request: RefundRequest | null;
property rex_info
rex_info: any;
property self_delegated_bandwidth
self_delegated_bandwidth: ResourceDelegation | null;
property total_resources
total_resources: ResourceOverview | null;
property voter_info
voter_info: any;
interface GetAccountsByAuthorizersResult
interface GetAccountsByAuthorizersResult {}
Return value of
/v1/chain/get_accounts_by_authorizers
property accounts
accounts: AccountResult[];
interface GetActionsResult
interface GetActionsResult {}
Return value of
/v1/history/get_actions
property actions
actions: OrderedActionResult[];
property last_irreversible_block
last_irreversible_block: number;
property time_limit_exceeded_error
time_limit_exceeded_error?: boolean;
interface GetActivatedProtocolFeaturesParams
interface GetActivatedProtocolFeaturesParams {}
property limit
limit?: number;
property lower_bound
lower_bound?: number;
property reverse
reverse?: boolean;
property search_by_block_num
search_by_block_num?: boolean;
property upper_bound
upper_bound?: number;
interface GetActivatedProtocolFeaturesResult
interface GetActivatedProtocolFeaturesResult {}
Return value of
/v1/chain/get_activated_protocol_features
property activated_protocol_features
activated_protocol_features: ActivatedProtocolFeature[];
property more
more?: number;
interface GetBlockHeaderStateResult
interface GetBlockHeaderStateResult {}
Return value of
/v1/chain/get_block_header_state
property activated_protocol_features
activated_protocol_features: ProtocolFeatureActivationSet;
property active_schedule
active_schedule: ProducerAuthoritySchedule;
property additional_signatures
additional_signatures: string[];
property block_num
block_num: number;
property blockroot_merkle
blockroot_merkle: IncrementalMerkle;
property confirm_count
confirm_count: number[];
property dpos_irreversible_blocknum
dpos_irreversible_blocknum: number;
property dpos_proposed_irreversible_blocknum
dpos_proposed_irreversible_blocknum: number;
property header
header: SignedBlockHeader;
property id
id: string;
property pending_schedule
pending_schedule: ScheduleInfo;
property producer_to_last_implied_irb
producer_to_last_implied_irb: Map<string, number>;
property producer_to_last_produced
producer_to_last_produced: Map<string, number>;
property state_extension
state_extension: [number, StateExtension];
property valid_block_signing_authority
valid_block_signing_authority: any;
interface GetBlockInfoResult
interface GetBlockInfoResult {}
Return value of
/v1/chain/get_block_info
property action_mroot
action_mroot: string;
property block_num
block_num: number;
property confirmed
confirmed: number;
property id
id: string;
property previous
previous: string;
property producer
producer: string;
property producer_signature
producer_signature: string;
property ref_block_num
ref_block_num: number;
property ref_block_prefix
ref_block_prefix: number;
property schedule_version
schedule_version: number;
property timestamp
timestamp: string;
property transaction_mroot
transaction_mroot: string;
interface GetBlockResult
interface GetBlockResult {}
Return value of
/v1/chain/get_block
property action_mroot
action_mroot: string;
property block_num
block_num: number;
property confirmed
confirmed: number;
property id
id: string;
property new_producers
new_producers: ProducerScheduleType | null;
property previous
previous: string;
property producer
producer: string;
property producer_signature
producer_signature: string;
property ref_block_prefix
ref_block_prefix: number;
property schedule_version
schedule_version: number;
property timestamp
timestamp: string;
property transaction_mroot
transaction_mroot: string;
property transactions
transactions: any;
interface GetCodeHashResult
interface GetCodeHashResult {}
Return value of
/v1/chain/get_code_hash
property account_name
account_name: string;
property code_hash
code_hash: string;
interface GetCodeResult
interface GetCodeResult {}
Return value of
/v1/chain/get_code
property abi
abi?: Abi;
property account_name
account_name: string;
property code_hash
code_hash: string;
property wasm
wasm: string;
property wast
wast: string;
interface GetControlledAccountsResult
interface GetControlledAccountsResult {}
Return value of
/v1/history/get_controlled_accounts
property controlled_accounts
controlled_accounts: string[];
interface GetCurrencyStatsResult
interface GetCurrencyStatsResult {}
Return value of
/v1/chain/get_currency_stats
index signature
[key: string]: { supply: string; max_supply: string; issuer: string;};
interface GetInfoResult
interface GetInfoResult {}
Return value of
/v1/chain/get_info
property block_cpu_limit
block_cpu_limit: number;
property block_net_limit
block_net_limit: number;
property chain_id
chain_id: string;
property first_block_num
first_block_num?: number;
property fork_db_head_block_id
fork_db_head_block_id?: string;
property fork_db_head_block_num
fork_db_head_block_num?: number;
property head_block_id
head_block_id: string;
property head_block_num
head_block_num: number;
property head_block_producer
head_block_producer: string;
property head_block_time
head_block_time: string;
property last_irreversible_block_id
last_irreversible_block_id: string;
property last_irreversible_block_num
last_irreversible_block_num: number;
property last_irreversible_block_time
last_irreversible_block_time?: string;
property server_full_version_string
server_full_version_string?: string;
property server_version
server_version: string;
property server_version_string
server_version_string?: string;
property virtual_block_cpu_limit
virtual_block_cpu_limit: number;
property virtual_block_net_limit
virtual_block_net_limit: number;
interface GetKeyAccountsResult
interface GetKeyAccountsResult {}
Return value of
/v1/history/get_key_accounts
property account_names
account_names: string[];
interface GetProducerScheduleResult
interface GetProducerScheduleResult {}
Return value of /v1/chain/get_producer_schedule
interface GetProducersResult
interface GetProducersResult {}
Return value of
/v1/chain/get_producers
property more
more: string;
property rows
rows: ProducerDetails[];
property total_producer_vote_weight
total_producer_vote_weight: string;
interface GetRawAbiResult
interface GetRawAbiResult {}
Return value of
/v1/chain/get_raw_abi
property abi
abi: string;
property abi_hash
abi_hash: string;
property account_name
account_name: string;
property code_hash
code_hash: string;
interface GetRawCodeAndAbiResult
interface GetRawCodeAndAbiResult {}
Return value of
/v1/chain/get_raw_code_and_abi
interface GetScheduledTransactionsResult
interface GetScheduledTransactionsResult {}
Return value of
/v1/chain/get_scheduled_transactions
property more
more: string;
property transactions
transactions: GeneratedTransaction[];
interface GetTableByScopeResult
interface GetTableByScopeResult {}
Return value of
/v1/chain/get_table_by_scope
interface GetTableByScopeResultRow
interface GetTableByScopeResultRow {}
interface GetTableRowsResult
interface GetTableRowsResult {}
Return value of
/v1/chain/get_table_rows
and/v1/chain/get_kv_table_rows
property more
more: boolean;
property next_key
next_key: string;
property next_key_bytes
next_key_bytes: string;
property rows
rows: any[];
interface GetTransactionResult
interface GetTransactionResult {}
Return value of
/v1/history/get_transaction
property block_num
block_num: number;
property block_time
block_time: string;
property id
id: string;
property last_irreversible_block
last_irreversible_block: number;
property traces
traces: any[];
property trx
trx: any;
interface IncrementalMerkle
interface IncrementalMerkle {}
interface OrderedActionResult
interface OrderedActionResult {}
property account_action_seq
account_action_seq: number;
property action_trace
action_trace: any;
property block_num
block_num: number;
property block_time
block_time: string;
property global_action_seq
global_action_seq: number;
interface PackedTransaction
interface PackedTransaction {}
property compression
compression: number | string;
property context_free_data
context_free_data: string[];
property id
id: string;
property packed_context_free_data
packed_context_free_data: string;
property packed_trx
packed_trx: string;
property signatures
signatures: string[];
property transaction
transaction: ProcessedTransaction;
interface PackedTrx
interface PackedTrx {}
property compression
compression: number;
property packed_context_free_data
packed_context_free_data: string;
property packed_trx
packed_trx: string;
property signatures
signatures: string[];
interface Permission
interface Permission {}
property parent
parent: string;
property perm_name
perm_name: string;
property required_auth
required_auth: Authority;
interface PermissionLevel
interface PermissionLevel {}
property actor
actor: string;
property permission
permission: string;
interface PermissionLevelWeight
interface PermissionLevelWeight {}
property permission
permission: PermissionLevel;
property weight
weight: number;
interface ProcessedAction
interface ProcessedAction {}
Returned action from nodeos, data is optional
property account
account: string;
property authorization
authorization: Authorization[];
property data
data?: any;
property hex_data
hex_data?: string;
property name
name: string;
interface ProcessedTransaction
interface ProcessedTransaction {}
property actions
actions: ProcessedAction[];
property context_free_actions
context_free_actions?: ProcessedAction[];
property context_free_data
context_free_data?: Uint8Array[];
property delay_sec
delay_sec?: number;
property expiration
expiration?: string;
property max_cpu_usage_ms
max_cpu_usage_ms?: number;
property max_net_usage_words
max_net_usage_words?: number;
property ref_block_num
ref_block_num?: number;
property ref_block_prefix
ref_block_prefix?: number;
property transaction_extensions
transaction_extensions?: [number, string][];
interface ProducerAuthority
interface ProducerAuthority {}
property authority
authority: [number | string, BlockSigningAuthority];
property producer_name
producer_name: string;
interface ProducerAuthoritySchedule
interface ProducerAuthoritySchedule {}
interface ProducerDetails
interface ProducerDetails {}
property is_active
is_active?: number;
property last_claim_time
last_claim_time?: string;
property location
location?: number;
property owner
owner: string;
property producer_authority
producer_authority?: any[];
property producer_key
producer_key: string;
property total_votes
total_votes: string;
property unpaid_blocks
unpaid_blocks?: number;
property url
url: string;
interface ProducerKey
interface ProducerKey {}
property block_signing_key
block_signing_key: string;
property producer_name
producer_name: string;
interface ProducerScheduleType
interface ProducerScheduleType {}
interface ProtocolFeatureActivationSet
interface ProtocolFeatureActivationSet {}
property protocol_features
protocol_features: string[];
interface PushTransactionArgs
interface PushTransactionArgs {}
Arguments for
push_transaction
property compression
compression?: number;
property serializedContextFreeData
serializedContextFreeData?: Uint8Array;
property serializedTransaction
serializedTransaction: Uint8Array;
property signatures
signatures: string[];
interface ReadOnlyTransactResult
interface ReadOnlyTransactResult {}
Return value of
/v1/chain/push_ro_transaction
property code_hash
code_hash: string;
property head_block_id
head_block_id: string;
property head_block_num
head_block_num: number;
property last_irreversible_block_id
last_irreversible_block_id: string;
property last_irreversible_block_num
last_irreversible_block_num: number;
property pending_transactions
pending_transactions: string[];
property result
result: TransactionTrace;
interface RefundRequest
interface RefundRequest {}
property cpu_amount
cpu_amount: string;
property net_amount
net_amount: string;
property owner
owner: string;
property request_time
request_time: string;
interface ResourceDelegation
interface ResourceDelegation {}
property cpu_weight
cpu_weight: string;
property from
from: string;
property net_weight
net_weight: string;
property to
to: string;
interface ResourceOverview
interface ResourceOverview {}
property cpu_weight
cpu_weight: string;
property net_weight
net_weight: string;
property owner
owner: string;
property ram_bytes
ram_bytes: number;
interface RexBalance
interface RexBalance {}
property matured_rex
matured_rex: number;
property owner
owner: string;
property rex_balance
rex_balance: string;
property rex_maturities
rex_maturities: any;
property version
version: number;
property vote_stake
vote_stake: string;
interface ScheduleInfo
interface ScheduleInfo {}
property schedule
schedule: ProducerScheduleType;
property schedule_hash
schedule_hash: string;
property schedule_lib_num
schedule_lib_num: number;
interface SecurityGroupInfo
interface SecurityGroupInfo {}
property participants
participants: string[];
property version
version: number;
interface SignedBlockHeader
interface SignedBlockHeader extends BlockHeader {}
property producer_signature
producer_signature: string;
interface StateExtension
interface StateExtension {}
property security_group_info
security_group_info: SecurityGroupInfo;
interface TraceApiAction
interface TraceApiAction {}
property account
account: string;
property action
action: string;
property authorization
authorization: Authorization[];
property data
data: any;
property global_sequence
global_sequence: number;
property receiver
receiver: string;
property return_value
return_value: any;
interface TraceApiGetBlockResult
interface TraceApiGetBlockResult {}
Return value of
/v1/trace_api/get_block
property action_mroot
action_mroot?: string;
property id
id: string;
property number
number: number;
property previous_id
previous_id: string;
property producer
producer: string;
property schedule_version
schedule_version: number;
property status
status: string;
property timestamp
timestamp: string;
property transaction_mroot
transaction_mroot?: string;
property transactions
transactions: TraceApiTransaction;
interface TraceApiTransaction
interface TraceApiTransaction {}
property actions
actions: TraceApiAction[];
property bill_to_accounts
bill_to_accounts: string[];
property cpu_usage_us
cpu_usage_us?: number;
property id
id: string;
property net_usage_words
net_usage_words?: number;
property signatures
signatures?: string[];
property status
status?: string;
property transaction_header
transaction_header?: TraceApiTransactionHeader;
interface TraceApiTransactionHeader
interface TraceApiTransactionHeader {}
property delay_sec
delay_sec: number;
property expiration
expiration: string;
property max_cpu_usage_ms
max_cpu_usage_ms: number;
property max_net_usage_words
max_net_usage_words: number;
property ref_block_num
ref_block_num: number;
property ref_block_prefix
ref_block_prefix: number;
interface TransactionReceipt
interface TransactionReceipt extends TransactionReceiptHeader {}
property trx
trx: PackedTransaction;
interface VoterInfo
interface VoterInfo {}
property flags1
flags1: number;
property is_proxy
is_proxy: number;
property last_vote_weight
last_vote_weight: string;
property owner
owner: string;
property producers
producers: string[];
property proxied_vote_weight
proxied_vote_weight: string;
property proxy
proxy: string;
property reserved2
reserved2: number;
property reserved3
reserved3: string;
property staked
staked: number;
interface WaitWeight
interface WaitWeight {}
namespace Serialize
module 'dist/eosjs-serialize.d.ts' {}
Serialize
function arrayToHex
arrayToHex: (data: Uint8Array) => string;
Convert binary data to hex
function blockTimestampToDate
blockTimestampToDate: (slot: number) => string;
Convert
block_timestamp_type
(half-seconds since a different epoch) to to date in ISO format
function createAbiTypes
createAbiTypes: () => Map<string, Type>;
function createInitialTypes
createInitialTypes: () => Map<string, Type>;
Create the set of types built-in to the abi format
function createTransactionExtensionTypes
createTransactionExtensionTypes: () => Map<string, Type>;
function createTransactionTypes
createTransactionTypes: () => Map<string, Type>;
function dateToBlockTimestamp
dateToBlockTimestamp: (date: string) => number;
Convert date in ISO format to
block_timestamp_type
(half-seconds since a different epoch)
function dateToTimePoint
dateToTimePoint: (date: string) => number;
Convert date in ISO format to
time_point
(miliseconds since epoch)
function dateToTimePointSec
dateToTimePointSec: (date: string) => number;
Convert date in ISO format to
time_point_sec
(seconds since epoch)
function deserializeAction
deserializeAction: ( contract: Contract, account: string, name: string, authorization: Authorization[], data: string | Uint8Array | number[], textEncoder: TextEncoder, textDecoder: TextDecoder) => Action;
Deserialize action. If
data
is astring
, then it's assumed to be in hex.
function deserializeActionData
deserializeActionData: ( contract: Contract, account: string, name: string, data: string | Uint8Array | number[], textEncoder: TextEncoder, textDecoder: TextDecoder) => any;
Deserialize action data. If
data
is astring
, then it's assumed to be in hex.
function deserializeAnyArray
deserializeAnyArray: (buffer: SerialBuffer, state?: SerializerState) => any[];
function deserializeAnyObject
deserializeAnyObject: (buffer: SerialBuffer, state?: SerializerState) => any;
function deserializeAnyvar
deserializeAnyvar: (buffer: SerialBuffer, state?: SerializerState) => any;
function deserializeAnyvarShort
deserializeAnyvarShort: (buffer: SerialBuffer) => any;
function getType
getType: (types: Map<string, Type>, name: string) => Type;
Get type from
types
function getTypesFromAbi
getTypesFromAbi: ( initialTypes: Map<string, Type>, abi?: Abi) => Map<string, Type>;
Get types from abi
Parameter initialTypes
Set of types to build on. In most cases, it's best to fill this from a fresh call to
getTypesFromAbi()
.
function hexToUint8Array
hexToUint8Array: (hex: string) => Uint8Array;
Convert hex to binary data
function serializeAction
serializeAction: ( contract: Contract, account: string, name: string, authorization: Authorization[], data: any, textEncoder: TextEncoder, textDecoder: TextDecoder) => SerializedAction;
Return action in serialized form
function serializeActionData
serializeActionData: ( contract: Contract, account: string, name: string, data: any, textEncoder: TextEncoder, textDecoder: TextDecoder) => string;
Convert action data to serialized form (hex)
function serializeAnyArray
serializeAnyArray: (buffer: SerialBuffer, arr: Anyvar[]) => void;
function serializeAnyObject
serializeAnyObject: (buffer: SerialBuffer, obj: any) => void;
function serializeAnyvar
serializeAnyvar: (buffer: SerialBuffer, anyvar: Anyvar) => void;
function serializeQuery
serializeQuery: (buffer: SerialBuffer, query: Query) => void;
function stringToSymbol
stringToSymbol: (s: string) => { name: string; precision: number };
Convert
string
toSymbol
. format:precision,NAME
.
function supportedAbiVersion
supportedAbiVersion: (version: string) => boolean;
Is this a supported ABI version?
function symbolToString
symbolToString: ({ name, precision,}: { name: string; precision: number;}) => string;
Convert
Symbol
tostring
. format:precision,NAME
.
function timePointSecToDate
timePointSecToDate: (sec: number) => string;
Convert
time_point_sec
(seconds since epoch) to to date in ISO format
function timePointToDate
timePointToDate: (us: number) => string;
Convert
time_point
(miliseconds since epoch) to date in ISO format
function transactionHeader
transactionHeader: ( refBlock: BlockTaposInfo, expireSeconds: number) => TransactionHeader;
TAPoS: Return transaction fields which reference
refBlock
and expireexpireSeconds
aftertimestamp
class SerialBuffer
class SerialBuffer {}
Serialize and deserialize data
constructor
constructor({ textEncoder, textDecoder, array,}?: { textEncoder?: TextEncoder; textDecoder?: TextDecoder; array?: Uint8Array;});
Parameter __namedParameters
array
:null
if serializing, or binary data to deserializetextEncoder
:TextEncoder
instance to use. Pass innull
if running in a browsertextDecoder
:TextDecider
instance to use. Pass innull
if running in a browser
property array
array: Uint8Array;
Data in serialized (binary) form
property length
length: number;
Amount of valid data in
array
property readPos
readPos: number;
Current position while reading (deserializing)
property textDecoder
textDecoder: TextDecoder;
property textEncoder
textEncoder: TextEncoder;