SerialBuffer
SerializerState
Action
Authorization
Contract
CreateTypeArgs
Field
SerializedAction
SerializerOptions
Symbol
Type
arrayToHex
blockTimestampToDate
checkDateParse
checkRange
createInitialTypes
createType
dateToBlockTimestamp
dateToTimePoint
dateToTimePointSec
deserializeAction
deserializeActionData
deserializeArray
deserializeExtension
deserializeOptional
deserializeStruct
deserializeUnknown
deserializeVariant
getType
getTypesFromAbi
hexToUint8Array
serializeAction
serializeActionData
serializeArray
serializeExtension
serializeOptional
serializeStruct
serializeUnknown
serializeVariant
stringToSymbol
supportedAbiVersion
symbolToString
timePointSecToDate
timePointToDate
transactionHeader
arrayToHex(data: Uint8Array): string
定义于eosjs-serialize.ts:592git
将二进制数据转换为十六进制。github
参数:segmentfault
名称 | 类型 |
---|---|
data | Uint8Array |
返回:string
函数
blockTimestampToDate(slot: number): string
定义于eosjs-serialize.ts:569this
将block_timestamp_type
(自不一样纪元以来的半秒)转换为ISO格式的日期。code
参数:接口
名称 | 类型 |
---|---|
slot | number |
返回:string
ci
checkDateParse(date: string): number
定义于eosjs-serialize.ts:533get
参数:string
名称 | 类型 |
---|---|
date | string |
返回:number
checkRange(orig: number, converted: number): number
参数:
名称 | 类型 |
---|---|
orig | number |
converted | number |
返回:number
createInitialTypes(): Map<string, Type>
建立内置到abi格式的类型集。
返回:Map<string, Type>
createType(attrs: CreateTypeArgs): Type
参数:
名称 | 类型 |
---|---|
attrs | CreateTypeArgs |
返回:Type
dateToBlockTimestamp(date: string): number
将ISO格式的日期转换为block_timestamp_type
(自不一样纪元以来的半秒)。
参数:
名称 | 类型 |
---|---|
date | string |
返回:number
dateToTimePoint(date: string): number
将ISO格式的日期转换为time_point
(自纪元以来的毫秒数)。
参数:
名称 | 类型 |
---|---|
date | string |
返回:number
dateToTimePointSec(date: string): number
将ISO格式的日期转换为time_point_sec
(自纪元以来的秒数)。
参数:
名称 | 类型 |
---|---|
date | string |
返回:number
deserializeAction(contract: Contract, account: string, name: string, authorization: Authorization[], data: string | Uint8Array | number[], textEncoder: TextEncoder, textDecoder: TextDecoder): Action
反序列化操做,若是data
是一个string
,则假定它是十六进制。
参数:
名称 | 类型 |
---|---|
contract | Contract |
account | string |
name | string |
authorization | Authorization[] |
data | string | Uint8Array | number[] |
textEncoder | TextEncoder |
textDecoder | TextDecoder |
返回:Action
deserializeActionData(contract: Contract, account: string, name: string, data: string | Uint8Array | number[], textEncoder: TextEncoder, textDecoder: TextDecoder): any
反序列化操做数据,若是data
是一个string
,则假定它是十六进制。
参数:
名称 | 类型 |
---|---|
contract | Contract |
account | string |
name | string |
data | string | Uint8Array | number[] |
textEncoder | TextEncoder |
textDecoder | TextDecoder |
返回:any
deserializeArray(this: Type, buffer: SerialBuffer, state?: SerializerState, allowExtensions?: boolean): any[]
参数:
名称 | 类型 |
---|---|
this | Type |
buffer | SerialBuffer |
Optional state |
SerializerState |
Optional allowExtensions |
boolean |
返回:any[]
deserializeExtension(this: Type, buffer: SerialBuffer, state?: SerializerState, allowExtensions?: boolean): any
参数:
名称 | 类型 |
---|---|
this | Type |
buffer | SerialBuffer |
Optional state |
SerializerState |
Optional allowExtensions |
boolean |
返回:any
deserializeOptional(this: Type, buffer: SerialBuffer, state?: SerializerState, allowExtensions?: boolean): any
参数:
名称 | 类型 |
---|---|
this | Type |
buffer | SerialBuffer |
Optional state |
SerializerState |
Optional allowExtensions |
boolean |
返回:any
deserializeStruct(this: Type, buffer: SerialBuffer, state?: SerializerState, allowExtensions?: boolean): any
参数:
名称 | 类型 | 默认值 |
---|---|---|
this | Type |
- |
buffer | SerialBuffer |
- |
Optional state |
SerializerState |
new SerializerState() |
Optional allowExtensions |
boolean |
true |
返回:any
deserializeUnknown(buffer: SerialBuffer): SerialBuffer
参数:
名称 | 类型 |
---|---|
buffer | SerialBuffer |
返回:SerialBuffer
deserializeVariant(this: Type, buffer: SerialBuffer, state?: SerializerState, allowExtensions?: boolean): any[]
参数:
名称 | 类型 |
---|---|
this | Type |
buffer | SerialBuffer |
Optional state |
SerializerState |
Optional allowExtensions |
boolean |
返回:any[]
getType(types: Map<string, Type>, name: string): Type
从types
中获取类型。
参数:
名称 | 类型 |
---|---|
types | Map<string, Type> |
name | string |
返回:Type
getTypesFromAbi(initialTypes: Map<string, Type>, abi: Abi): Map<string, Type>
从abi获取类型。
参数:
名称 | 类型 | 描述 |
---|---|---|
initialTypes | Map<string, Type> |
要构建的类型集,在大多数状况下,最好经过对getTypesFromAbi() 的新调用来填充它 |
abi | Abi |
返回:Map<string, Type>
hexToUint8Array(hex: string): Uint8Array
将十六进制转换为二进制数据。
参数:
名称 | 类型 |
---|---|
hex | string |
返回:Uint8Array
serializeAction(contract: Contract, account: string, name: string, authorization: Authorization[], data: any, textEncoder: TextEncoder, textDecoder: TextDecoder): SerializedAction
以序列化形式返回操做。
参数:
名称 | 类型 |
---|---|
contract | Contract |
account | string |
name | string |
authorization | Authorization[] |
data | any |
textEncoder | TextEncoder |
textDecoder | TextDecoder |
返回:SerializedAction
serializeActionData(contract: Contract, account: string, name: string, data: any, textEncoder: TextEncoder, textDecoder: TextDecoder): string
将操做数据转换为序列化形式(十六进制)。
参数:
名称 | 类型 |
---|---|
contract | Contract |
account | string |
name | string |
data | any |
textEncoder | TextEncoder |
textDecoder | TextDecoder |
返回:string
serializeArray(this: Type, buffer: SerialBuffer, data: any[], state?: SerializerState, allowExtensions?: boolean): void
参数:
名称 | 类型 |
---|---|
this | Type |
buffer | SerialBuffer |
data | any[] |
Optional state |
SerializerState |
Optional allowExtensions |
boolean |
返回:void
serializeExtension(this: Type, buffer: SerialBuffer, data: any, state?: SerializerState, allowExtensions?: boolean): void
参数:
名称 | 类型 |
---|---|
this | Type |
buffer | SerialBuffer |
data | any |
Optional state |
SerializerState |
Optional allowExtensions |
boolean |
返回:void
serializeOptional(this: Type, buffer: SerialBuffer, data: any, state?: SerializerState, allowExtensions?: boolean): void
参数:
名称 | 类型 |
---|---|
this | Type |
buffer | SerialBuffer |
data | any |
Optional state |
SerializerState |
Optional allowExtensions |
boolean |
返回:void
serializeStruct(this: Type, buffer: SerialBuffer, data: any, state?: SerializerState, allowExtensions?: boolean): void
参数:
名称 | 类型 | 默认值 |
---|---|---|
this | Type |
- |
buffer | SerialBuffer |
- |
data | any |
- |
Optional state |
SerializerState |
new SerializerState() |
Optional allowExtensions |
boolean |
true |
返回:void
serializeUnknown(buffer: SerialBuffer, data: any): SerialBuffer
参数:
名称 | 类型 |
---|---|
buffer | SerialBuffer |
data | any |
返回:SerialBuffer
serializeVariant(this: Type, buffer: SerialBuffer, data: any, state?: SerializerState, allowExtensions?: boolean): void
参数:
名称 | 类型 |
---|---|
this | Type |
buffer | SerialBuffer |
data | any |
Optional state |
SerializerState |
Optional allowExtensions |
boolean |
返回:void
stringToSymbol(s: string): object
将string
转换为Symbol
,格式:precision,NAME
。
参数:
名称 | 类型 |
---|---|
s | string |
返回:object
supportedAbiVersion(version: string): boolean
这是受支持的ABI版本吗?
参数:
名称 | 类型 |
---|---|
version | string |
返回:boolean
symbolToString(__namedParameters: object): string
将Symbol
转换为string
,格式:precision,NAME
。
参数:
__namedParameters:object
名称 | 类型 |
---|---|
name | string |
precision | number |
返回:string
timePointSecToDate(sec: number): string
将time_point_sec
(自纪元以来的秒数)转换为ISO格式的日期。
参数:
名称 | 类型 |
---|---|
sec | number |
返回:string
timePointToDate(us: number): string
将time_point
(自纪元以来的毫秒数)转换为ISO格式的日期。
参数:
名称 | 类型 |
---|---|
us | number |
返回:string
transactionHeader(refBlock: BlockTaposInfo, expireSeconds: number): object
TAPoS:返回引用refBlock
的交易字段,并在refBlock.timestamp
以后expireSeconds
到期。
参数:
名称 | 类型 |
---|---|
refBlock | BlockTaposInfo |
expireSeconds | number |
返回:object