Serialize
EOSIO Javascript / Exports / Serialize
Namespace: Serialize
Table of contents
Classes
Interfaces
Functions
- arrayToHex
- blockTimestampToDate
- createInitialTypes
- dateToBlockTimestamp
- dateToTimePoint
- dateToTimePointSec
- deserializeAction
- deserializeActionData
- getType
- getTypesFromAbi
- hexToUint8Array
- serializeAction
- serializeActionData
- stringToSymbol
- supportedAbiVersion
- symbolToString
- timePointSecToDate
- timePointToDate
- transactionHeader
Functions
arrayToHex
▸ arrayToHex(data): string
Convert binary data to hex
Parameters
| Name | Type |
|---|---|
data | Uint8Array |
Returns
string
Defined in
src/eosjs-serialize.ts:614
blockTimestampToDate
▸ blockTimestampToDate(slot): string
Convert block_timestamp_type (half-seconds since a different epoch) to to date in ISO format
Parameters
| Name | Type |
|---|---|
slot | number |
Returns
string
Defined in
src/eosjs-serialize.ts:591
createInitialTypes
▸ createInitialTypes(): Map<string, Type>
Create the set of types built-in to the abi format
Returns
Map<string, Type>
Defined in
src/eosjs-serialize.ts:798
dateToBlockTimestamp
▸ dateToBlockTimestamp(date): number
Convert date in ISO format to block_timestamp_type (half-seconds since a different epoch)
Parameters
| Name | Type |
|---|---|
date | string |
Returns
number
Defined in
src/eosjs-serialize.ts:586
dateToTimePoint
▸ dateToTimePoint(date): number
Convert date in ISO format to time_point (miliseconds since epoch)
Parameters
| Name | Type |
|---|---|
date | string |
Returns
number
Defined in
src/eosjs-serialize.ts:564
dateToTimePointSec
▸ dateToTimePointSec(date): number
Convert date in ISO format to time_point_sec (seconds since epoch)
Parameters
| Name | Type |
|---|---|
date | string |
Returns
number
Defined in
src/eosjs-serialize.ts:575
deserializeAction
▸ deserializeAction(contract, account, name, authorization, data, textEncoder, textDecoder): Action
Deserialize action. If data is a string, then it's assumed to be in hex.
Parameters
| Name | Type |
|---|---|
contract | Contract |
account | string |
name | string |
authorization | Authorization[] |
data | string | Uint8Array | number[] |
textEncoder | TextEncoder |
textDecoder | TextDecoder |
Returns
Defined in
src/eosjs-serialize.ts:1133
deserializeActionData
▸ deserializeActionData(contract, account, name, data, textEncoder, textDecoder): any
Deserialize action data. If data is a string, then it's assumed to be in hex.
Parameters
| Name | Type |
|---|---|
contract | Contract |
account | string |
name | string |
data | string | Uint8Array | number[] |
textEncoder | TextEncoder |
textDecoder | TextDecoder |
Returns
any
Defined in
src/eosjs-serialize.ts:1117
getType
▸ getType(types, name): Type
Get type from types
Parameters
| Name | Type |
|---|---|
types | Map<string, Type> |
name | string |
Returns
Defined in
src/eosjs-serialize.ts:996
getTypesFromAbi
▸ getTypesFromAbi(initialTypes, abi): Map<string, Type>
Get types from abi
Parameters
| Name | Type | Description |
|---|---|---|
initialTypes | Map<string, Type> | Set of types to build on. In most cases, it's best to fill this from a fresh call to getTypesFromAbi(). |
abi | Abi | - |
Returns
Map<string, Type>
Defined in
src/eosjs-serialize.ts:1036
hexToUint8Array
▸ hexToUint8Array(hex): Uint8Array
Convert hex to binary data
Parameters
| Name | Type |
|---|---|
hex | string |
Returns
Uint8Array
Defined in
src/eosjs-serialize.ts:623
serializeAction
▸ serializeAction(contract, account, name, authorization, data, textEncoder, textDecoder): SerializedAction
Return action in serialized form
Parameters
| Name | Type |
|---|---|
contract | Contract |
account | string |
name | string |
authorization | Authorization[] |
data | any |
textEncoder | TextEncoder |
textDecoder | TextDecoder |
Returns
Defined in
src/eosjs-serialize.ts:1105
serializeActionData
▸ serializeActionData(contract, account, name, data, textEncoder, textDecoder): string
Convert action data to serialized form (hex)
Parameters
| Name | Type |
|---|---|
contract | Contract |
account | string |
name | string |
data | any |
textEncoder | TextEncoder |
textDecoder | TextDecoder |
Returns
string
Defined in
src/eosjs-serialize.ts:1093
stringToSymbol
▸ stringToSymbol(s): Object
Convert string to Symbol. format: precision,NAME.
Parameters
| Name | Type |
|---|---|
s | string |
Returns
Object
| Name | Type |
|---|---|
name | string |
precision | number |
Defined in
src/eosjs-serialize.ts:597
supportedAbiVersion
▸ supportedAbiVersion(version): boolean
Is this a supported ABI version?
Parameters
| Name | Type |
|---|---|
version | string |
Returns
boolean
Defined in
src/eosjs-serialize.ts:551
symbolToString
▸ symbolToString(__namedParameters): string
Convert Symbol to string. format: precision,NAME.
Parameters
| Name | Type |
|---|---|
__namedParameters | Object |
__namedParameters.name | string |
__namedParameters.precision | number |
Returns
string
Defined in
src/eosjs-serialize.ts:609
timePointSecToDate
▸ timePointSecToDate(sec): string
Convert time_point_sec (seconds since epoch) to to date in ISO format
Parameters
| Name | Type |
|---|---|
sec | number |
Returns
string
Defined in
src/eosjs-serialize.ts:580
timePointToDate
▸ timePointToDate(us): string
Convert time_point (miliseconds since epoch) to date in ISO format
Parameters
| Name | Type |
|---|---|
us | number |
Returns
string
Defined in
src/eosjs-serialize.ts:569
transactionHeader
▸ transactionHeader(refBlock, expireSeconds): Object
TAPoS: Return transaction fields which reference refBlock and expire expireSeconds after timestamp
Parameters
| Name | Type |
|---|---|
refBlock | BlockTaposInfo |
expireSeconds | number |
Returns
Object
| Name | Type |
|---|---|
expiration | string |
ref_block_num | number |
ref_block_prefix | number |
Defined in
src/eosjs-serialize.ts:1081