Creates a new Ain object.
The endpoint URL of the network provider.
Optional
eventHandlerUrl: null | stringThe endpoint URL of the event handler websocket server.
Optional
chainId: numberThe chain ID of the blockchain network.
Optional
ainOptions: AinOptionsThe options of the class.
The axios request config object.
The chain ID of the blockchain network.
The database object.
The event manager object.
Optional
eventThe endpoint Url of the event handler websocket server.
The homorphic encryption object.
The network object.
The network provider object.
The raw result mode option.
The signer object.
The wallet object.
Static
utilsGetter for ain-util library.
Sends a transaction that deposits AIN for consensus staking.
The transaction input object.
Fetches a block with a block hash.
The block hash.
Optional
returnTransactionObjects: booleanIf it's true, returns a block with full transaction objects. Otherwise, returns a block with only transaction hashes.
Fetches a block with a block number.
The block number.
Optional
returnTransactionObjects: booleanIf it's true, returns a block with full transaction objects. Otherwise, returns a block with only transaction hashes.
Fetches a blockchain app's state usage information with an app name.
The blockchain app name.
Fetches a transaction's information with a block hash and an index.
The block hash.
The transaction index in the block
Fetches a transaction's information with a block hash and an index.
The block number.
The transaction index in the block
Fetches a transaction's information with a transaction hash.
The transaction hash.
Sends a signed transaction to the network.
The signature of the transaction.
The transaction body.
The dryrun option.
Signs and sends a transaction to the network.
The transaction input object.
The dryrun option.
Signs and sends multiple transactions in a batch to the network.
The list of the transaction input objects.
Sets a new provider.
The endpoint URL of the network provider. e.g. http://localhost:8081, https://testnet-api.ainetwork.ai
Optional
eventHandlerUrl: null | stringThe endpoint URL of the event handler websocket server. e.g. ws://localhost:5100, wss://testnet-event.ainetwork.ai
Optional
chainId: numberThe chain ID of the blockchain network. e.g. 0 for local or testnet, and 1 for mainnet
Optional
axiosConfig: AxiosRequestConfigThe axios request config.
Sets a new signer.
The signer to set.
Private
stakeA base function for all staking related database changes. It builds a deposit/withdraw transaction and sends the transaction by calling sendTransaction().
The path to set a value with.
The transaction input object.
The dryrun option.
Validates a blockchain app's name.
The blockchain app name.
Sends a transaction that withdraws AIN for consensus staking.
The transaction input object.
Static
instanceofChecks whether an object is an instance of TransactionBody interface.
The object to check.
The main class of the ain-js SDK library.