Class: Api
Hierarchy
- Api
Index
Constructors
Properties
- abiProvider
- abiTypes
- authorityProvider
- cachedAbis
- chainId
- contracts
- rpc
- signatureProvider
- textDecoder
- textEncoder
- transactionTypes
Methods
- buildTransaction
- deflateSerializedArray
- deserialize
- deserializeActions
- deserializeTransaction
- deserializeTransactionWithActions
- getAbi
- getCachedAbi
- getContract
- getTransactionAbis
- inflateSerializedArray
- jsonToRawAbi
- pushCompressedSignedTransaction
- pushSignedTransaction
- query
- rawAbiToJson
- serialize
- serializeActions
- serializeContextFreeData
- serializeTransaction
- transact
- with
Constructors
constructor
+ new Api(args
: object): Api
Parameters:
Name | Type | Description |
---|---|---|
args |
object | 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 in null if running in a browser * textDecoder : TextDecoder instance to use. Pass in null if running in a browser |
Returns: Api
Properties
abiProvider
• abiProvider: AbiProvider
abiTypes
• abiTypes: Map‹string, Type›
authorityProvider
• authorityProvider: AuthorityProvider
cachedAbis
• cachedAbis: Map‹string, CachedAbi› = new Map<string, CachedAbi>()
chainId
• chainId: string
contracts
• contracts: Map‹string, Contract› = new Map<string, ser.Contract>()
rpc
• rpc: JsonRpc
signatureProvider
• signatureProvider: SignatureProvider
textDecoder
• textDecoder: TextDecoder
textEncoder
• textEncoder: TextEncoder
transactionTypes
• transactionTypes: Map‹string, Type›
Methods
buildTransaction
▸ buildTransaction(cb?
: function): TransactionBuilder | void
Parameters:
▪Optional
cb: function
▸ (tx
: TransactionBuilder): void
Parameters:
Name | Type |
---|---|
tx |
TransactionBuilder |
Returns: TransactionBuilder | void
deflateSerializedArray
▸ deflateSerializedArray(serializedArray
: Uint8Array): Uint8Array
Parameters:
Name | Type |
---|---|
serializedArray |
Uint8Array |
Returns: Uint8Array
deserialize
▸ deserialize(buffer
: SerialBuffer, type
: string): any
Parameters:
Name | Type |
---|---|
buffer |
SerialBuffer |
type |
string |
Returns: any
deserializeActions
▸ deserializeActions(actions
: Action[]): Promise‹Action[]›
Parameters:
Name | Type |
---|---|
actions |
Action[] |
Returns: Promise‹Action[]›
deserializeTransaction
▸ deserializeTransaction(transaction
: Uint8Array): Transaction
Parameters:
Name | Type |
---|---|
transaction |
Uint8Array |
Returns: Transaction
deserializeTransactionWithActions
▸ deserializeTransactionWithActions(transaction
: Uint8Array | string): Promise‹Transaction›
Parameters:
Name | Type |
---|---|
transaction |
Uint8Array | string |
Returns: Promise‹Transaction›
getAbi
▸ getAbi(accountName
: string, reload
: boolean): Promise‹Abi›
Parameters:
Name | Type | Default |
---|---|---|
accountName |
string | - |
reload |
boolean | false |
Returns: Promise‹Abi›
getCachedAbi
▸ getCachedAbi(accountName
: string, reload
: boolean): Promise‹CachedAbi›
Parameters:
Name | Type | Default |
---|---|---|
accountName |
string | - |
reload |
boolean | false |
Returns: Promise‹CachedAbi›
getContract
▸ getContract(accountName
: string, reload
: boolean): Promise‹Contract›
Parameters:
Name | Type | Default |
---|---|---|
accountName |
string | - |
reload |
boolean | false |
Returns: Promise‹Contract›
getTransactionAbis
▸ getTransactionAbis(transaction
: Transaction, reload
: boolean): Promise‹BinaryAbi[]›
Parameters:
Name | Type | Default |
---|---|---|
transaction |
Transaction | - |
reload |
boolean | false |
Returns: Promise‹BinaryAbi[]›
inflateSerializedArray
▸ inflateSerializedArray(compressedSerializedArray
: Uint8Array): Uint8Array
Parameters:
Name | Type |
---|---|
compressedSerializedArray |
Uint8Array |
Returns: Uint8Array
jsonToRawAbi
▸ jsonToRawAbi(jsonAbi
: Abi): Uint8Array
Parameters:
Name | Type |
---|---|
jsonAbi |
Abi |
Returns: Uint8Array
pushCompressedSignedTransaction
▸ pushCompressedSignedTransaction(__namedParameters
: object): Promise‹TransactResult›
Parameters:
Name | Type |
---|---|
__namedParameters |
object |
Returns: Promise‹TransactResult›
pushSignedTransaction
▸ pushSignedTransaction(__namedParameters
: object): Promise‹TransactResult›
Parameters:
Name | Type |
---|---|
__namedParameters |
object |
Returns: Promise‹TransactResult›
query
▸ query(account
: string, short
: boolean, query
: Query, __namedParameters
: object): Promise‹any›
Parameters:
Name | Type |
---|---|
account |
string |
short |
boolean |
query |
Query |
__namedParameters |
object |
Returns: Promise‹any›
rawAbiToJson
▸ rawAbiToJson(rawAbi
: Uint8Array): Abi
Parameters:
Name | Type |
---|---|
rawAbi |
Uint8Array |
Returns: Abi
serialize
▸ serialize(buffer
: SerialBuffer, type
: string, value
: any): void
Parameters:
Name | Type |
---|---|
buffer |
SerialBuffer |
type |
string |
value |
any |
Returns: void
serializeActions
▸ serializeActions(actions
: Action[]): Promise‹SerializedAction[]›
Parameters:
Name | Type |
---|---|
actions |
Action[] |
Returns: Promise‹SerializedAction[]›
serializeContextFreeData
▸ serializeContextFreeData(contextFreeData
: Uint8Array[]): Uint8Array
Parameters:
Name | Type |
---|---|
contextFreeData |
Uint8Array[] |
Returns: Uint8Array
serializeTransaction
▸ serializeTransaction(transaction
: Transaction): Uint8Array
Parameters:
Name | Type |
---|---|
transaction |
Transaction |
Returns: Uint8Array
transact
▸ transact(transaction
: Transaction, __namedParameters
: object): Promise‹TransactResult | PushTransactionArgs›
Parameters:
Name | Type | Default |
---|---|---|
transaction |
Transaction | - |
__namedParameters |
object | {} |
Returns: Promise‹TransactResult | PushTransactionArgs›
node response if broadcast
, {signatures, serializedTransaction}
if !broadcast
with
▸ with(accountName
: string): ActionBuilder
Parameters:
Name | Type |
---|---|
accountName |
string |
Returns: ActionBuilder