API Reference TS¶
This page contains a list of all Datastructures and Classes used within the TypeScript IN3 Client.
Examples¶
This is a collection of different incubed-examples.
using Web3¶
Since incubed works with on a JSON-RPC-Level it can easily be used as Provider for Web3:
// import in3-Module
import In3Client from 'in3'
import * as web3 from 'web3'
// use the In3Client as Http-Provider
const web3 = new Web3(new In3Client({
proof : 'standard',
signatureCount: 1,
requestCount : 2,
chainId : 'mainnet'
}).createWeb3Provider())
// use the web3
const block = await web.eth.getBlockByNumber('latest')
...
using Incubed API¶
Incubed includes a light API, allowinng not only to use all RPC-Methods in a typesafe way, but also to sign transactions and call funnctions of a contract without the web3-library.
For more details see the API-Doc
// import in3-Module
import In3Client from 'in3'
// use the In3Client
const in3 = new In3Client({
proof : 'standard',
signatureCount: 1,
requestCount : 2,
chainId : 'mainnet'
})
// use the api to call a funnction..
const myBalance = await in3.eth.callFn(myTokenContract, 'balanceOf(address):uint', myAccount)
// ot to send a transaction..
const receipt = await in3.eth.sendTransaction({
to : myTokenContract,
method : 'transfer(address,uint256)',
args : [target,amount],
confirmations: 2,
pk : myKey
})
...
Reading event with incubed¶
// import in3-Module
import In3Client from 'in3'
// use the In3Client
const in3 = new In3Client({
proof : 'standard',
signatureCount: 1,
requestCount : 2,
chainId : 'mainnet'
})
// use the ABI-String of the smart contract
abi = [{"anonymous":false,"inputs":[{"indexed":false,"name":"name","type":"string"},{"indexed":true,"name":"label","type":"bytes32"},{"indexed":true,"name":"owner","type":"address"},{"indexed":false,"name":"cost","type":"uint256"},{"indexed":false,"name":"expires","type":"uint256"}],"name":"NameRegistered","type":"event"}]
// create a contract-object for a given address
const contract = in3.eth.contractAt(abi, '0xF0AD5cAd05e10572EfcEB849f6Ff0c68f9700455') // ENS contract.
// read all events starting from a specified block until the latest
const logs = await c.events.NameRegistered.getLogs({fromBlock:8022948}))
// print out the properties of the event.
for (const ev of logs)
console.log(`${ev.owner} registered ${ev.name} for ${ev.cost} wei until ${new Date(ev.expires.toNumber()*1000).toString()}`)
...
Main Module¶
Importing incubed is as easy as
import Client,{util} from "in3"
While the In3Client-class is the default import, the following imports can be used:
`
- AccountProof :
interface
- the Proof-for a single Account - AuraValidatoryProof :
interface
- a Object holding proofs for validator logs. The key is the blockNumber as hex - ChainSpec :
interface
- describes the chainspecific consensus params - IN3Client :
class
- Client for N3. - IN3Config :
interface
- the iguration of the IN3-Client. This can be paritally overriden for every request. - IN3NodeConfig :
interface
- a configuration of a in3-server. - IN3NodeWeight :
interface
- a local weight of a n3-node. (This is used internally to weight the requests) - IN3RPCConfig :
interface
- the configuration for the rpc-handler - IN3RPCHandlerConfig :
interface
- the configuration for the rpc-handler - IN3RPCRequestConfig :
interface
- additional config for a IN3 RPC-Request - IN3ResponseConfig :
interface
- additional data returned from a IN3 Server - LogProof :
interface
- a Object holding proofs for event logs. The key is the blockNumber as hex - Proof :
interface
- the Proof-data as part of the in3-section - RPCRequest :
interface
- a JSONRPC-Request with N3-Extension - RPCResponse :
interface
- a JSONRPC-Responset with N3-Extension - ServerList :
interface
- a List of nodes - Signature :
interface
- Verified ECDSA Signature. Signatures are a pair (r, s). Where r is computed as the X coordinate of a point R, modulo the curve order n. - EthAPI :
class
- chainAliases
- chainData
- callContract(client :
Client
, contract :string
, chainId :string
, signature :string
, args :any
[], config :IN3Config
) :Promise<any>
- getChainData(client :
Client
, chainId :string
, config :IN3Config
) :Promise<>
- callContract(client :
- createRandomIndexes(len :
number
, limit :number
, seed :Buffer
, result :number
[] = []) :number
[] - helper function creating deterministic random indexes used for limited nodelists - header
- AuthSpec :
interface
- Authority specification for proof of authority chains - checkBlockSignatures(blockHeaders :
any
[], getChainSpec :) :Promise<number>
- verify a Blockheader and returns the percentage of finality - getChainSpec(b :
Block
, ctx :ChainContext
) :Promise<AuthSpec>
- getSigner(data :
Block
) :Buffer
- AuthSpec :
- typeDefs
- AccountProof :
Object
- AuraValidatoryProof :
Object
- ChainSpec :
Object
- IN3Config :
Object
- IN3NodeConfig :
Object
- IN3NodeWeight :
Object
- IN3RPCConfig :
Object
- IN3RPCHandlerConfig :
Object
- IN3RPCRequestConfig :
Object
- IN3ResponseConfig :
Object
- LogProof :
Object
- Proof :
Object
- RPCRequest :
Object
- RPCResponse :
Object
- ServerList :
Object
- Signature :
Object
- AccountProof :
- util :
any
Package client¶
Type Client¶
Client for N3.
Source: client/Client.ts
- defaultMaxListeners :
number
static
listenerCount(emitter :EventEmitter
, event :string
|symbol
) :number
constructor
constructor(config :Partial<IN3Config>
= {}, transport :Transport
) :Client
- creates a new Client.- defConfig :
IN3Config
- the iguration of the IN3-Client. This can be paritally overriden for every request. - eth :
EthAPI
- ipfs :
IpfsAPI
- simple API for IPFS - config()
- addListener(event :
string
|symbol
, listener :) :this
- call(method :
string
, params :any
, chain :string
, config :Partial<IN3Config>
) :Promise<any>
- sends a simply RPC-Request - clearStats() :
void
- clears all stats and weights, like blocklisted nodes - createWeb3Provider() :
any
- emit(event :
string
|symbol
, args :any
[]) :boolean
- eventNames() :
Array<>
- getChainContext(chainId :
string
) :ChainContext
- getMaxListeners() :
number
- listenerCount(type :
string
|symbol
) :number
- listeners(event :
string
|symbol
) :Function
[] - off(event :
string
|symbol
, listener :) :this
- on(event :
string
|symbol
, listener :) :this
- once(event :
string
|symbol
, listener :) :this
- prependListener(event :
string
|symbol
, listener :) :this
- prependOnceListener(event :
string
|symbol
, listener :) :this
- rawListeners(event :
string
|symbol
) :Function
[] - removeAllListeners(event :
string
|symbol
) :this
- removeListener(event :
string
|symbol
, listener :) :this
- send(request :
RPCRequest
[]|RPCRequest
, callback :, config :Partial<IN3Config>
) :Promise<>
- sends one or a multiple requests. if the request is a array the response will be a array as well. If the callback is given it will be called with the response, if not a Promise will be returned. This function supports callback so it can be used as a Provider for the web3. - sendRPC(method :
string
, params :any
[] = [], chain :string
, config :Partial<IN3Config>
) :Promise<RPCResponse>
- sends a simply RPC-Request - setMaxListeners(n :
number
) :this
- updateNodeList(chainId :
string
, conf :Partial<IN3Config>
, retryCount :number
= 5) :Promise<void>
- fetches the nodeList from the servers.
Type ChainContext¶
Context for a specific chain including cache and chainSpecs.
Source: client/ChainContext.ts
constructor
constructor(client :Client
, chainId :string
, chainSpec :ChainSpec
[]) :ChainContext
- chainId :
string
- chainSpec :
ChainSpec
[] - client :
Client
- Client for N3. - genericCache
- lastValidatorChange :
number
- module :
Module
- registryId :
string
(optional) - clearCache(prefix :
string
) :void
- getChainSpec(block :
number
) :ChainSpec
- returns the chainspec for th given block number - getFromCache(key :
string
) :string
- handleIntern(request :
RPCRequest
) :Promise<RPCResponse>
- this function is calleds before the server is asked. If it returns a promise than the request is handled internally otherwise the server will handle the response. this function should be overriden by modules that want to handle calls internally - initCache() :
void
- putInCache(key :
string
, value :string
) :void
- updateCache() :
void
Type Module¶
Source: client/modules.ts
- name :
string
- createChainContext(client :
Client
, chainId :string
, spec :ChainSpec
[]) :ChainContext
- verifyProof(request :
RPCRequest
, response :RPCResponse
, allowWithoutProof :boolean
, ctx :ChainContext
) :Promise<boolean>
- general verification-function which handles it according to its given type.
Package modules/eth¶
Type EthAPI¶
Source: modules/eth/api.ts
constructor
constructor(client :Client
) :EthAPI
- client :
Client
- Client for N3. - signer :
Signer
(optional) - blockNumber() :
Promise<number>
- Returns the number of most recent block. (as number) - call(tx :
Transaction
, block :BlockType
= “latest”) :Promise<string>
- Executes a new message call immediately without creating a transaction on the block chain. - callFn(to :
Address
, method :string
, args :any
[]) :Promise<any>
- Executes a function of a contract, by passing a method-signature and the arguments, which will then be ABI-encoded and send as eth_call. - chainId() :
Promise<string>
- Returns the EIP155 chain ID used for transaction signing at the current best block. Null is returned if not available. - contractAt(abi :
ABI
[], address :Address
) : - decodeEventData(log :
Log
, d :ABI
) :any
- estimateGas(tx :
Transaction
) :Promise<number>
- Makes a call or transaction, which won’t be added to the blockchain and returns the used gas, which can be used for estimating the used gas. - gasPrice() :
Promise<number>
- Returns the current price per gas in wei. (as number) - getBalance(address :
Address
, block :BlockType
= “latest”) :Promise<BN>
- Returns the balance of the account of given address in wei (as hex). - getBlockByHash(hash :
Hash
, includeTransactions :boolean
= false) :Promise<Block>
- Returns information about a block by hash. - getBlockByNumber(block :
BlockType
= “latest”, includeTransactions :boolean
= false) :Promise<Block>
- Returns information about a block by block number. - getBlockTransactionCountByHash(block :
Hash
) :Promise<number>
- Returns the number of transactions in a block from a block matching the given block hash. - getBlockTransactionCountByNumber(block :
Hash
) :Promise<number>
- Returns the number of transactions in a block from a block matching the given block number. - getCode(address :
Address
, block :BlockType
= “latest”) :Promise<string>
- Returns code at a given address. - getFilterChanges(id :
Quantity
) :Promise<>
- Polling method for a filter, which returns an array of logs which occurred since last poll. - getFilterLogs(id :
Quantity
) :Promise<>
- Returns an array of all logs matching filter with given id. - getLogs(filter :
LogFilter
) :Promise<>
- Returns an array of all logs matching a given filter object. - getStorageAt(address :
Address
, pos :Quantity
, block :BlockType
= “latest”) :Promise<string>
- Returns the value from a storage position at a given address. - getTransactionByBlockHashAndIndex(hash :
Hash
, pos :Quantity
) :Promise<TransactionDetail>
- Returns information about a transaction by block hash and transaction index position. - getTransactionByBlockNumberAndIndex(block :
BlockType
, pos :Quantity
) :Promise<TransactionDetail>
- Returns information about a transaction by block number and transaction index position. - getTransactionByHash(hash :
Hash
) :Promise<TransactionDetail>
- Returns the information about a transaction requested by transaction hash. - getTransactionCount(address :
Address
, block :BlockType
= “latest”) :Promise<number>
- Returns the number of transactions sent from an address. (as number) - getTransactionReceipt(hash :
Hash
) :Promise<TransactionReceipt>
- Returns the receipt of a transaction by transaction hash. Note That the receipt is available even for pending transactions. - getUncleByBlockHashAndIndex(hash :
Hash
, pos :Quantity
) :Promise<Block>
- Returns information about a uncle of a block by hash and uncle index position. Note: An uncle doesn’t contain individual transactions. - getUncleByBlockNumberAndIndex(block :
BlockType
, pos :Quantity
) :Promise<Block>
- Returns information about a uncle of a block number and uncle index position. Note: An uncle doesn’t contain individual transactions. - getUncleCountByBlockHash(hash :
Hash
) :Promise<number>
- Returns the number of uncles in a block from a block matching the given block hash. - getUncleCountByBlockNumber(block :
BlockType
) :Promise<number>
- Returns the number of uncles in a block from a block matching the given block hash. - hashMessage(data :
Data
|Buffer
) :Buffer
- newBlockFilter() :
Promise<string>
- Creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call eth_getFilterChanges. - newFilter(filter :
LogFilter
) :Promise<string>
- Creates a filter object, based on filter options, to notify when the state changes (logs). To check if the state has changed, call eth_getFilterChanges. - newPendingTransactionFilter() :
Promise<string>
- Creates a filter in the node, to notify when new pending transactions arrive. - protocolVersion() :
Promise<string>
- Returns the current ethereum protocol version. - sendRawTransaction(data :
Data
) :Promise<string>
- Creates new message call transaction or a contract creation for signed transactions. - sendTransaction(args :
TxRequest
) :Promise<>
- sends a Transaction - sign(account :
Address
, data :Data
) :Promise<Signature>
- signs any kind of message using the\x19Ethereum Signed Message:\n
-prefix - syncing() :
Promise<>
- Returns the current ethereum protocol version. - uninstallFilter(id :
Quantity
) :Promise<Quantity>
- Uninstalls a filter with given id. Should always be called when watch is no longer needed. Additonally Filters timeout when they aren’t requested with eth_getFilterChanges for a period of time.
Type Block¶
Source: modules/eth/api.ts
- Block
- Hex :
string
- Quantity :
number
|Hex
- Hex :
string
- Quantity :
number
|Hex
- Quantity :
number
|Hex
- Hex :
string
- Hex :
string
- Hex :
string
- Hex :
string
- Quantity :
number
|Hex
- Hex :
string
- Hex :
string
- sealFields :
Data
[] - PoA-Fields - Hex :
string
- Quantity :
number
|Hex
- Hex :
string
- Quantity :
number
|Hex
- Quantity :
number
|Hex
- transactions :
string
|[] - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter - Hex :
string
- uncles :
Hash
[] - Array of uncle hashes
- Hex :
Type Signer¶
Source: modules/eth/api.ts
- prepareTransaction (optional) - optiional method which allows to change the transaction-data before sending it. This can be used for redirecting it through a multisig.
- sign - signing of any data.
- hasAccount(account :
Address
) :Promise<boolean>
- returns true if the account is supported (or unlocked)
Type Transaction¶
Source: modules/eth/api.ts
Type ABI¶
Source: modules/eth/api.ts
Type Log¶
Source: modules/eth/api.ts
- Log
- Hex :
string
- Hex :
string
- Quantity :
number
|Hex
- Hex :
string
- Quantity :
number
|Hex
- removed :
boolean
- true when the log was removed, due to a chain reorganization. false if its a valid log. - topics :
Data
[] - - Array of 0 to 4 32 Bytes DATA of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) - Hex :
string
- Quantity :
number
|Hex
- Hex :
Type LogFilter¶
Source: modules/eth/api.ts
- LogFilter
- Hex :
string
- BlockType :
number
|'latest'
|'earliest'
|'pending'
- Quantity :
number
|Hex
- BlockType :
number
|'latest'
|'earliest'
|'pending'
- topics :
string
|string
[][] - (optional) Array of 32 Bytes Data topics. Topics are order-dependent. It’s possible to pass in null to match any topic, or a subarray of multiple topics of which one should be matching.
- Hex :
Type TransactionDetail¶
Source: modules/eth/api.ts
- TransactionDetail
- Hex :
string
- BlockType :
number
|'latest'
|'earliest'
|'pending'
- Quantity :
number
|Hex
- condition :
any
- (optional) conditional submission, Block number in block or timestamp in time or null. (parity-feature) - Hex :
string
- Hex :
string
- Quantity :
number
|Hex
- Quantity :
number
|Hex
- Hex :
string
- Hex :
string
- Quantity :
number
|Hex
- pk :
any
(optional) - optional: the private key to use for signing - Hex :
string
- Quantity :
number
|Hex
- Hex :
string
- Quantity :
number
|Hex
- Hex :
string
- Quantity :
number
|Hex
- Quantity :
number
|Hex
- Quantity :
number
|Hex
- Hex :
Type TxRequest¶
Source: modules/eth/api.ts
- TxRequest
- args :
any
[] (optional) - the argument to pass to the method - confirmations :
number
(optional) - number of block to wait before confirming - Hex :
string
- Hex :
string
- gas :
number
(optional) - the gas needed - gasPrice :
number
(optional) - the gasPrice used - method :
string
(optional) - the ABI of the method to be used - nonce :
number
(optional) - the nonce - Hex :
string
- Hex :
string
- Quantity :
number
|Hex
- args :
Package modules/ipfs¶
Type IpfsAPI¶
simple API for IPFS
Source: modules/ipfs/api.ts
constructor
constructor(_client :Client
) :IpfsAPI
- client :
Client
- Client for N3. - get(hash :
string
, resultEncoding :string
) :Promise<Buffer>
- retrieves the conent for a hash from IPFS. - put(data :
Buffer
, dataEncoding :string
) :Promise<string>
- stores the data on ipfs and returns the IPFS-Hash.
Package types¶
Type AccountProof¶
the Proof-for a single Account
Source: types/types.ts
- accountProof :
string
[] - the serialized merle-noodes beginning with the root-node - address :
string
- the address of this account - balance :
string
- the balance of this account as hex - code :
string
(optional) - the code of this account as hex ( if required) - codeHash :
string
- the codeHash of this account as hex - nonce :
string
- the nonce of this account as hex - storageHash :
string
- the storageHash of this account as hex - storageProof :[] - proof for requested storage-data
Type AuraValidatoryProof¶
a Object holding proofs for validator logs. The key is the blockNumber as hex
Source: types/types.ts
- block :
string
- the serialized blockheader example: 0x72804cfa0179d648ccbe6a65b01a6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b86d8f42c92bbda6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b - finalityBlocks :
any
[] (optional) - the serialized blockheader as hex, required in case of finality asked example: 0x72804cfa0179d648ccbe6a65b01a6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b86d8f42c92bbda6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b - logIndex :
number
- the transaction log index - proof :
string
[] - the merkleProof - txIndex :
number
- the transactionIndex within the block
Type ChainSpec¶
describes the chainspecific consensus params
Source: types/types.ts
- block :
number
(optional) - the blocknumnber when this configuration should apply - bypassFinality :
number
(optional) - Bypass finality check for transition to contract based Aura Engines example: bypassFinality = 10960502 -> will skip the finality check and add the list at block 10960502 - contract :
string
(optional) - The validator contract at the block - engine :
'ethHash'
|'authorityRound'
|'clique'
(optional) - the engine type (like Ethhash, authorityRound, … ) - list :
string
[] (optional) - The list of validators at the particular block - requiresFinality :
boolean
(optional) - indicates whether the transition requires a finality check example: true
Type IN3Config¶
the iguration of the IN3-Client. This can be paritally overriden for every request.
Source: types/types.ts
- autoConfig :
boolean
(optional) - if true the config will be adjusted depending on the request - autoUpdateList :
boolean
(optional) - if true the nodelist will be automaticly updated if the lastBlock is newer example: true - cacheStorage :
any
(optional) - a cache handler offering 2 functions ( setItem(string,string), getItem(string) ) - cacheTimeout :
number
(optional) - number of seconds requests can be cached. - chainId :
string
- servers to filter for the given chain. The chain-id based on EIP-155. example: 0x1 - chainRegistry :
string
(optional) - main chain-registry contract example: 0xe36179e2286ef405e929C90ad3E70E649B22a945 - finality :
number
(optional) - the number in percent needed in order reach finality (% of signature of the validators) example: 50 - format :
'json'
|'jsonRef'
|'cbor'
(optional) - the format for sending the data to the client. Default is json, but using cbor means using only 30-40% of the payload since it is using binary encoding example: json - includeCode :
boolean
(optional) - if true, the request should include the codes of all accounts. otherwise only the the codeHash is returned. In this case the client may ask by calling eth_getCode() afterwards example: true - keepIn3 :
boolean
(optional) - if true, the in3-section of thr response will be kept. Otherwise it will be removed after validating the data. This is useful for debugging or if the proof should be used afterwards. - key :
any
(optional) - the client key to sign requests example: 0x387a8233c96e1fc0ad5e284353276177af2186e7afa85296f106336e376669f7 - loggerUrl :
string
(optional) - a url of RES-Endpoint, the client will log all errors to. The client will post to this endpoint JSON like { id?, level, message, meta? } - mainChain :
string
(optional) - main chain-id, where the chain registry is running. example: 0x1 - maxAttempts :
number
(optional) - max number of attempts in case a response is rejected example: 10 - maxBlockCache :
number
(optional) - number of number of blocks cached in memory example: 100 - maxCodeCache :
number
(optional) - number of max bytes used to cache the code in memory example: 100000 - minDeposit :
number
- min stake of the server. Only nodes owning at least this amount will be chosen. - nodeLimit :
number
(optional) - the limit of nodes to store in the client. example: 150 - proof :
'none'
|'standard'
|'full'
(optional) - if true the nodes should send a proof of the response example: true - replaceLatestBlock :
number
(optional) - if specified, the blocknumber latest will be replaced by blockNumber- specified value example: 6 - requestCount :
number
- the number of request send when getting a first answer example: 3 - retryWithoutProof :
boolean
(optional) - if true the the request may be handled without proof in case of an error. (use with care!) - rpc :
string
(optional) - url of one or more rpc-endpoints to use. (list can be comma seperated) - servers (optional) - the nodelist per chain
- signatureCount :
number
(optional) - number of signatures requested example: 2 - timeout :
number
(optional) - specifies the number of milliseconds before the request times out. increasing may be helpful if the device uses a slow connection. example: 3000 - verifiedHashes :
string
[] (optional) - if the client sends a array of blockhashes the server will not deliver any signatures or blockheaders for these blocks, but only return a string with a number. This is automaticly updated by the cache, but can be overriden per request.
Type IN3NodeConfig¶
a configuration of a in3-server.
Source: types/types.ts
- address :
string
- the address of the node, which is the public address it iis signing with. example: 0x6C1a01C2aB554930A937B0a2E8105fB47946c679 - capacity :
number
(optional) - the capacity of the node. example: 100 - chainIds :
string
[] - the list of supported chains example: 0x1 - deposit :
number
- the deposit of the node in wei example: 12350000 - index :
number
(optional) - the index within the contract example: 13 - props :
number
(optional) - the properties of the node. example: 3 - registerTime :
number
(optional) - the UNIX-timestamp when the node was registered example: 1563279168 - timeout :
number
(optional) - the time (in seconds) until an owner is able to receive his deposit back after he unregisters himself example: 3600 - unregisterTime :
number
(optional) - the UNIX-timestamp when the node is allowed to be deregister example: 1563279168 - url :
string
- the endpoint to post to example: https://in3.slock.it
Type IN3NodeWeight¶
a local weight of a n3-node. (This is used internally to weight the requests)
Source: types/types.ts
- avgResponseTime :
number
(optional) - average time of a response in ms example: 240 - blacklistedUntil :
number
(optional) - blacklisted because of failed requests until the timestamp example: 1529074639623 - lastRequest :
number
(optional) - timestamp of the last request in ms example: 1529074632623 - pricePerRequest :
number
(optional) - last price - responseCount :
number
(optional) - number of uses. example: 147 - weight :
number
(optional) - factor the weight this noe (default 1.0) example: 0.5
Type IN3RPCConfig¶
the configuration for the rpc-handler
Source: types/types.ts
- chains (optional) - a definition of the Handler per chain
- db (optional)
- defaultChain :
string
(optional) - the default chainId in case the request does not contain one. - id :
string
(optional) - a identifier used in logfiles as also for reading the config from the database - logging (optional) - logger config
- colors :
boolean
(optional) - if true colors will be used - file :
string
(optional) - the path to the logile - host :
string
(optional) - the host for custom logging - level :
string
(optional) - Loglevel - name :
string
(optional) - the name of the provider - port :
number
(optional) - the port for custom logging - type :
string
(optional) - the module of the provider
- colors :
- port :
number
(optional) - the listeneing port for the server - profile (optional)
- comment :
string
(optional) - comments for the node - icon :
string
(optional) - url to a icon or logo of company offering this node - name :
string
(optional) - name of the node or company - noStats :
boolean
(optional) - if active the stats will not be shown (default:false) - url :
string
(optional) - url of the website of the company
- comment :
Type IN3RPCHandlerConfig¶
the configuration for the rpc-handler
Source: types/types.ts
- autoRegistry (optional)
- capabilities (optional)
- multiChain :
boolean
(optional) - if true, this node is able to deliver multiple chains - proof :
boolean
(optional) - if true, this node is able to deliver proofs
- multiChain :
- capacity :
number
(optional) - max number of parallel requests - deposit :
number
- the deposit you want ot store - depositUnit :
'ether'
|'finney'
|'szabo'
|'wei'
(optional) - unit of the deposit value - url :
string
- the public url to reach this node
- capabilities (optional)
- clientKeys :
string
(optional) - a comma sepearted list of client keys to use for simulating clients for the watchdog - freeScore :
number
(optional) - the score for requests without a valid signature - handler :
'eth'
|'ipfs'
|'btc'
(optional) - the impl used to handle the calls - ipfsUrl :
string
(optional) - the url of the ipfs-client - maxThreads :
number
(optional) - the maximal number of threads ofr running parallel processes - minBlockHeight :
number
(optional) - the minimal blockheight in order to sign - persistentFile :
string
(optional) - the filename of the file keeping track of the last handled blocknumber - privateKey :
string
- the private key used to sign blockhashes. this can be either a 0x-prefixed string with the raw private key or the path to a key-file. - privateKeyPassphrase :
string
(optional) - the password used to decrpyt the private key - registry :
string
- the address of the server registry used in order to update the nodeList - registryRPC :
string
(optional) - the url of the client in case the registry is not on the same chain. - rpcUrl :
string
- the url of the client - startBlock :
number
(optional) - blocknumber to start watching the registry - timeout :
number
(optional) - number of milliseconds to wait before a request gets a timeout - watchInterval :
number
(optional) - the number of seconds of the interval for checking for new events - watchdogInterval :
number
(optional) - average time between sending requests to the same node. 0 turns it off (default)
Type IN3RPCRequestConfig¶
additional config for a IN3 RPC-Request
Source: types/types.ts
- chainId :
string
- the requested chainId example: 0x1 - clientSignature :
any
(optional) - the signature of the client - finality :
number
(optional) - if given the server will deliver the blockheaders of the following blocks until at least the number in percent of the validators is reached. - includeCode :
boolean
(optional) - if true, the request should include the codes of all accounts. otherwise only the the codeHash is returned. In this case the client may ask by calling eth_getCode() afterwards example: true - latestBlock :
number
(optional) - if specified, the blocknumber latest will be replaced by blockNumber- specified value example: 6 - signatures :
string
[] (optional) - a list of addresses requested to sign the blockhash example: 0x6C1a01C2aB554930A937B0a2E8105fB47946c679 - useBinary :
boolean
(optional) - if true binary-data will be used. - useFullProof :
boolean
(optional) - if true all data in the response will be proven, which leads to a higher payload. - useRef :
boolean
(optional) - if true binary-data (starting with a 0x) will be refered if occuring again. - verification :
'never'
|'proof'
|'proofWithSignature'
(optional) - defines the kind of proof the client is asking for example: proof - verifiedHashes :
string
[] (optional) - if the client sends a array of blockhashes the server will not deliver any signatures or blockheaders for these blocks, but only return a string with a number.
Type IN3ResponseConfig¶
additional data returned from a IN3 Server
Source: types/types.ts
- currentBlock :
number
(optional) - the current blocknumber. example: 320126478 - lastNodeList :
number
(optional) - the blocknumber for the last block updating the nodelist. If the client has a smaller blocknumber he should update the nodeList. example: 326478 - lastValidatorChange :
number
(optional) - the blocknumber of gthe last change of the validatorList - proof :
Proof
(optional) - the Proof-data
Type LogProof¶
a Object holding proofs for event logs. The key is the blockNumber as hex
Source: types/types.ts
Type Proof¶
the Proof-data as part of the in3-section
Source: types/types.ts
- accounts (optional) - a map of addresses and their AccountProof
- block :
string
(optional) - the serialized blockheader as hex, required in most proofs example: 0x72804cfa0179d648ccbe6a65b01a6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b86d8f42c92bbda6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b - finalityBlocks :
any
[] (optional) - the serialized blockheader as hex, required in case of finality asked example: 0x72804cfa0179d648ccbe6a65b01a6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b86d8f42c92bbda6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b - logProof :
LogProof
(optional) - the Log Proof in case of a Log-Request - merkleProof :
string
[] (optional) - the serialized merle-noodes beginning with the root-node - merkleProofPrev :
string
[] (optional) - the serialized merkle-noodes beginning with the root-node of the previous entry (only for full proof of receipts) - signatures :
Signature
[] (optional) - requested signatures - transactions :
any
[] (optional) - the list of transactions of the block example: - txIndex :
number
(optional) - the transactionIndex within the block example: 4 - txProof :
string
[] (optional) - the serialized merkle-nodes beginning with the root-node in order to prrof the transactionIndex - type :
'transactionProof'
|'receiptProof'
|'blockProof'
|'accountProof'
|'callProof'
|'logProof'
- the type of the proof example: accountProof - uncles :
any
[] (optional) - the list of uncle-headers of the block example:
Type RPCRequest¶
a JSONRPC-Request with N3-Extension
Source: types/types.ts
- id :
number
|string
(optional) - the identifier of the request example: 2 - in3 :
IN3RPCRequestConfig
(optional) - the IN3-Config - jsonrpc :
'2.0'
- the version - method :
string
- the method to call example: eth_getBalance - params :
any
[] (optional) - the params example: 0xe36179e2286ef405e929C90ad3E70E649B22a945,latest
Type RPCResponse¶
a JSONRPC-Responset with N3-Extension
Source: types/types.ts
- error :
string
(optional) - in case of an error this needs to be set - id :
string
|number
- the id matching the request example: 2 - in3 :
IN3ResponseConfig
(optional) - the IN3-Result - in3Node :
IN3NodeConfig
(optional) - the node handling this response (internal only) - jsonrpc :
'2.0'
- the version - result :
any
(optional) - the params example: 0xa35bc
Type ServerList¶
a List of nodes
Source: types/types.ts
- contract :
string
(optional) - IN3 Registry - lastBlockNumber :
number
(optional) - last Block number - nodes :
IN3NodeConfig
[] - the list of nodes - proof :
Proof
(optional) - the Proof-data as part of the in3-section - registryId :
string
(optional) - registry id of the contract - totalServers :
number
(optional) - number of servers
Type Signature¶
Verified ECDSA Signature. Signatures are a pair (r, s). Where r is computed as the X coordinate of a point R, modulo the curve order n.
Source: types/types.ts
- address :
string
(optional) - the address of the signing node example: 0x6C1a01C2aB554930A937B0a2E8105fB47946c679 - block :
number
- the blocknumber example: 3123874 - blockHash :
string
- the hash of the block example: 0x6C1a01C2aB554930A937B0a212346037E8105fB47946c679 - msgHash :
string
- hash of the message example: 0x9C1a01C2aB554930A937B0a212346037E8105fB47946AB5D - r :
string
- Positive non-zero Integer signature.r example: 0x72804cfa0179d648ccbe6a65b01a6463a8f1ebb14f3aff6b19cb91acf2b8ec1f - s :
string
- Positive non-zero Integer signature.s example: 0x6d17b34aeaf95fee98c0437b4ac839d8a2ece1b18166da704b86d8f42c92bbda - v :
number
- Calculated curve point, or identity element O. example: 28
Common Module¶
The common module (in3-common) contains all the typedefs used in the node and server.
- BlockData :
interface
- Block as returned by eth_getBlockByNumber - LogData :
interface
- LogData as part of the TransactionReceipt - Receipt :
_serialize.Receipt
- ReceiptData :
interface
- TransactionReceipt as returned by eth_getTransactionReceipt - Transaction :
_serialize.Transaction
- TransactionData :
interface
- Transaction as returned by eth_getTransactionByHash - Transport :
interface
- A Transport-object responsible to transport the message to the handler. - AxiosTransport :
class
- Default Transport impl sending http-requests. - Block :
class
- encodes and decodes the blockheader - blockFromHex(hex :
string
) :Block
- converts a hexstring to a block-object - cbor
- createRefs(val :
T
, cache :string
[] = []) :T
- decodeRequests(request :
Buffer
) :RPCRequest
[] - decodeResponses(responses :
Buffer
) :RPCResponse
[] - encodeRequests(requests :
RPCRequest
[]) :Buffer
- turn - encodeResponses(responses :
RPCResponse
[]) :Buffer
- resolveRefs(val :
T
, cache :string
[] = []) :T
- createRefs(val :
- chainAliases
- createRandomIndexes(len :
number
, limit :number
, seed :Buffer
, result :number
[] = []) :number
[] - createTx(transaction :
any
) :any
- creates a Transaction-object from the rpc-transaction-data - getSigner(data :
Block
) :Buffer
- rlp
- serialize
- Block :
class
- encodes and decodes the blockheader - AccountData :
interface
- Account-Object - BlockData :
interface
- Block as returned by eth_getBlockByNumber - LogData :
interface
- LogData as part of the TransactionReceipt - ReceiptData :
interface
- TransactionReceipt as returned by eth_getTransactionReceipt - TransactionData :
interface
- Transaction as returned by eth_getTransactionByHash - Account :
Buffer
[] - Buffer[] of the Account - BlockHeader :
Buffer
[] - Buffer[] of the header - Receipt : - Buffer[] of the Receipt
- Transaction :
Buffer
[] - Buffer[] of the transaction - rlp - RLP-functions
- address(val :
any
) :any
- converts it to a Buffer with 20 bytes length - blockFromHex(hex :
string
) :Block
- converts a hexstring to a block-object - blockToHex(block :
any
) :string
- converts blockdata to a hexstring - bytes(val :
any
) :any
- converts it to a Buffer - bytes256(val :
any
) :any
- converts it to a Buffer with 256 bytes length - bytes32(val :
any
) :any
- converts it to a Buffer with 32 bytes length - bytes8(val :
any
) :any
- converts it to a Buffer with 8 bytes length - createTx(transaction :
any
) :any
- creates a Transaction-object from the rpc-transaction-data - hash(val :
Block
|Transaction
|Receipt
|Account
|Buffer
) :Buffer
- returns the hash of the object - serialize(val :
Block
|Transaction
|Receipt
|Account
|any
) :Buffer
- serialize the data - toAccount(account :
AccountData
) :Buffer
[] - toBlockHeader(block :
BlockData
) :Buffer
[] - create a Buffer[] from RPC-Response - toReceipt(r :
ReceiptData
) :Object
- create a Buffer[] from RPC-Response - toTransaction(tx :
TransactionData
) :Buffer
[] - create a Buffer[] from RPC-Response - uint(val :
any
) :any
- converts it to a Buffer with a variable length. 0 = length 0 - uint128(val :
any
) :any
- uint64(val :
any
) :any
- Block :
- storage
- getStorageArrayKey(pos :
number
, arrayIndex :number
, structSize :number
= 1, structPos :number
= 0) :any
- calc the storrage array key - getStorageMapKey(pos :
number
, key :string
, structPos :number
= 0) :any
- calcs the storage Map key. - getStorageValue(rpc :
string
, contract :string
, pos :number
, type :'address'
|'bytes32'
|'bytes16'
|'bytes4'
|'int'
|'string'
, keyOrIndex :number
|string
, structSize :number
, structPos :number
) :Promise<any>
- get a storage value from the server - getStringValue(data :
Buffer
, storageKey :Buffer
) :string
| - creates a string from storage. - getStringValueFromList(values :
Buffer
[], len :number
) :string
- concats the storage values to a string. - toBN(val :
any
) :any
- converts any value to BN
- getStorageArrayKey(pos :
- transport
- AxiosTransport :
class
- Default Transport impl sending http-requests. - Transport :
interface
- A Transport-object responsible to transport the message to the handler.
- AxiosTransport :
- util
- checkForError(res :
T
) :T
- check a RPC-Response for errors and rejects the promise if found - createRandomIndexes(len :
number
, limit :number
, seed :Buffer
, result :number
[] = []) :number
[] - getAddress(pk :
string
) :string
- returns a address from a private key - getSigner(data :
Block
) :Buffer
- padEnd(val :
string
, minLength :number
, fill :string
= “ “) :string
- padEnd for legacy - padStart(val :
string
, minLength :number
, fill :string
= “ “) :string
- padStart for legacy - promisify(self :
any
, fn :any
, args :any
[]) :Promise<any>
- simple promisy-function - toBN(val :
any
) :any
- convert to BigNumber - toBuffer(val :
any
, len :number
= -1) :any
- converts any value as Buffer if len === 0 it will return an empty Buffer if the value is 0 or ‘0x00’, since this is the way rlpencode works wit 0-values. - toHex(val :
any
, bytes :number
) :string
- converts any value as hex-string - toMinHex(key :
string
|Buffer
|number
) :string
- removes all leading 0 in the hexstring - toNumber(val :
any
) :number
- converts to a js-number - toSimpleHex(val :
string
) :string
- removes all leading 0 in a hex-string - toUtf8(val :
any
) :string
- aliases :
Object
- checkForError(res :
- validate
- ajv :
Ajv
- the ajv instance with custom formatters and keywords - validate(ob :
any
, def :any
) :void
- validateAndThrow(fn :
Ajv.ValidateFunction
, ob :any
) :void
- validates the data and throws an error in case they are not valid.
- ajv :
Package modules/eth¶
Type BlockData¶
Block as returned by eth_getBlockByNumber
Source: modules/eth/serialize.ts
- coinbase :
string
(optional) - difficulty :
string
|number
- extraData :
string
- gasLimit :
string
|number
- gasUsed :
string
|number
- hash :
string
- logsBloom :
string
- miner :
string
- mixHash :
string
(optional) - nonce :
string
|number
(optional) - number :
string
|number
- parentHash :
string
- receiptRoot :
string
(optional) - receiptsRoot :
string
- sealFields :
string
[] (optional) - sha3Uncles :
string
- stateRoot :
string
- timestamp :
string
|number
- transactions :
any
[] (optional) - transactionsRoot :
string
- uncles :
string
[] (optional)
Type LogData¶
LogData as part of the TransactionReceipt
Source: modules/eth/serialize.ts
- address :
string
- blockHash :
string
- blockNumber :
string
- data :
string
- logIndex :
string
- removed :
boolean
- topics :
string
[] - transactionHash :
string
- transactionIndex :
string
- transactionLogIndex :
string
Type ReceiptData¶
TransactionReceipt as returned by eth_getTransactionReceipt
Source: modules/eth/serialize.ts
- blockHash :
string
(optional) - blockNumber :
string
|number
(optional) - cumulativeGasUsed :
string
|number
(optional) - gasUsed :
string
|number
(optional) - logs :
LogData
[] - logsBloom :
string
(optional) - root :
string
(optional) - status :
string
|boolean
(optional) - transactionHash :
string
(optional) - transactionIndex :
number
(optional)
Type TransactionData¶
Transaction as returned by eth_getTransactionByHash
Source: modules/eth/serialize.ts
- blockHash :
string
(optional) - blockNumber :
number
|string
(optional) - chainId :
number
|string
(optional) - condition :
string
(optional) - creates :
string
(optional) - data :
string
(optional) - from :
string
(optional) - gas :
number
|string
(optional) - gasLimit :
number
|string
(optional) - gasPrice :
number
|string
(optional) - hash :
string
- input :
string
- nonce :
number
|string
- publicKey :
string
(optional) - r :
string
(optional) - raw :
string
(optional) - s :
string
(optional) - standardV :
string
(optional) - to :
string
- transactionIndex :
number
- v :
string
(optional) - value :
number
|string
Type Block¶
encodes and decodes the blockheader
Source: modules/eth/serialize.ts
constructor
constructor(data :Buffer
|string
|BlockData
) :Block
- creates a Block-Onject from either the block-data as returned from rpc, a buffer or a hex-string of the encoded blockheader- raw :
BlockHeader
- the raw Buffer fields of the BlockHeader - transactions :
Tx
[] - the transaction-Object (if given) - bloom()
- coinbase()
- difficulty()
- extra()
- gasLimit()
- gasUsed()
- number()
- parentHash()
- receiptTrie()
- sealedFields()
- stateRoot()
- timestamp()
- transactionsTrie()
- uncleHash()
- bareHash() :
Buffer
- the blockhash as buffer without the seal fields - hash() :
Buffer
- the blockhash as buffer - serializeHeader() :
Buffer
- the serialized header as buffer
Type AccountData¶
Account-Object
Source: modules/eth/serialize.ts
- balance :
string
- code :
string
(optional) - codeHash :
string
- nonce :
string
- storageHash :
string
Type Transaction¶
Buffer[] of the transaction
Source: modules/eth/serialize.ts
- Transaction :
Buffer
[] - Buffer[] of the transaction
Type Receipt¶
Buffer[] of the Receipt
Source: modules/eth/serialize.ts
- Receipt : - Buffer[] of the Receipt
Type BlockHeader¶
Buffer[] of the header
Source: modules/eth/serialize.ts
- BlockHeader :
Buffer
[] - Buffer[] of the header
Package types¶
Type RPCRequest¶
a JSONRPC-Request with N3-Extension
Source: types/types.ts
- id :
number
|string
(optional) - the identifier of the request example: 2 - in3 :
IN3RPCRequestConfig
(optional) - the IN3-Config - jsonrpc :
'2.0'
- the version - method :
string
- the method to call example: eth_getBalance - params :
any
[] (optional) - the params example: 0xe36179e2286ef405e929C90ad3E70E649B22a945,latest
Type RPCResponse¶
a JSONRPC-Responset with N3-Extension
Source: types/types.ts
- error :
string
(optional) - in case of an error this needs to be set - id :
string
|number
- the id matching the request example: 2 - in3 :
IN3ResponseConfig
(optional) - the IN3-Result - in3Node :
IN3NodeConfig
(optional) - the node handling this response (internal only) - jsonrpc :
'2.0'
- the version - result :
any
(optional) - the params example: 0xa35bc
Type IN3RPCRequestConfig¶
additional config for a IN3 RPC-Request
Source: types/types.ts
- chainId :
string
- the requested chainId example: 0x1 - clientSignature :
any
(optional) - the signature of the client - finality :
number
(optional) - if given the server will deliver the blockheaders of the following blocks until at least the number in percent of the validators is reached. - includeCode :
boolean
(optional) - if true, the request should include the codes of all accounts. otherwise only the the codeHash is returned. In this case the client may ask by calling eth_getCode() afterwards example: true - latestBlock :
number
(optional) - if specified, the blocknumber latest will be replaced by blockNumber- specified value example: 6 - signatures :
string
[] (optional) - a list of addresses requested to sign the blockhash example: 0x6C1a01C2aB554930A937B0a2E8105fB47946c679 - useBinary :
boolean
(optional) - if true binary-data will be used. - useFullProof :
boolean
(optional) - if true all data in the response will be proven, which leads to a higher payload. - useRef :
boolean
(optional) - if true binary-data (starting with a 0x) will be refered if occuring again. - verification :
'never'
|'proof'
|'proofWithSignature'
(optional) - defines the kind of proof the client is asking for example: proof - verifiedHashes :
string
[] (optional) - if the client sends a array of blockhashes the server will not deliver any signatures or blockheaders for these blocks, but only return a string with a number.
Type IN3ResponseConfig¶
additional data returned from a IN3 Server
Source: types/types.ts
- currentBlock :
number
(optional) - the current blocknumber. example: 320126478 - lastNodeList :
number
(optional) - the blocknumber for the last block updating the nodelist. If the client has a smaller blocknumber he should update the nodeList. example: 326478 - lastValidatorChange :
number
(optional) - the blocknumber of gthe last change of the validatorList - proof :
Proof
(optional) - the Proof-data
Type IN3NodeConfig¶
a configuration of a in3-server.
Source: types/types.ts
- address :
string
- the address of the node, which is the public address it iis signing with. example: 0x6C1a01C2aB554930A937B0a2E8105fB47946c679 - capacity :
number
(optional) - the capacity of the node. example: 100 - chainIds :
string
[] - the list of supported chains example: 0x1 - deposit :
number
- the deposit of the node in wei example: 12350000 - index :
number
(optional) - the index within the contract example: 13 - props :
number
(optional) - the properties of the node. example: 3 - registerTime :
number
(optional) - the UNIX-timestamp when the node was registered example: 1563279168 - timeout :
number
(optional) - the time (in seconds) until an owner is able to receive his deposit back after he unregisters himself example: 3600 - unregisterTime :
number
(optional) - the UNIX-timestamp when the node is allowed to be deregister example: 1563279168 - url :
string
- the endpoint to post to example: https://in3.slock.it
Type Proof¶
the Proof-data as part of the in3-section
Source: types/types.ts
- accounts (optional) - a map of addresses and their AccountProof
- block :
string
(optional) - the serialized blockheader as hex, required in most proofs example: 0x72804cfa0179d648ccbe6a65b01a6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b86d8f42c92bbda6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b - finalityBlocks :
any
[] (optional) - the serialized blockheader as hex, required in case of finality asked example: 0x72804cfa0179d648ccbe6a65b01a6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b86d8f42c92bbda6463a8f1ebb14f3aff6b19cb91acf2b8ec1ffee98c0437b4ac839d8a2ece1b18166da704b - logProof :
LogProof
(optional) - the Log Proof in case of a Log-Request - merkleProof :
string
[] (optional) - the serialized merle-noodes beginning with the root-node - merkleProofPrev :
string
[] (optional) - the serialized merkle-noodes beginning with the root-node of the previous entry (only for full proof of receipts) - signatures :
Signature
[] (optional) - requested signatures - transactions :
any
[] (optional) - the list of transactions of the block example: - txIndex :
number
(optional) - the transactionIndex within the block example: 4 - txProof :
string
[] (optional) - the serialized merkle-nodes beginning with the root-node in order to prrof the transactionIndex - type :
'transactionProof'
|'receiptProof'
|'blockProof'
|'accountProof'
|'callProof'
|'logProof'
- the type of the proof example: accountProof - uncles :
any
[] (optional) - the list of uncle-headers of the block example:
Type LogProof¶
a Object holding proofs for event logs. The key is the blockNumber as hex
Source: types/types.ts
Type Signature¶
Verified ECDSA Signature. Signatures are a pair (r, s). Where r is computed as the X coordinate of a point R, modulo the curve order n.
Source: types/types.ts
- address :
string
(optional) - the address of the signing node example: 0x6C1a01C2aB554930A937B0a2E8105fB47946c679 - block :
number
- the blocknumber example: 3123874 - blockHash :
string
- the hash of the block example: 0x6C1a01C2aB554930A937B0a212346037E8105fB47946c679 - msgHash :
string
- hash of the message example: 0x9C1a01C2aB554930A937B0a212346037E8105fB47946AB5D - r :
string
- Positive non-zero Integer signature.r example: 0x72804cfa0179d648ccbe6a65b01a6463a8f1ebb14f3aff6b19cb91acf2b8ec1f - s :
string
- Positive non-zero Integer signature.s example: 0x6d17b34aeaf95fee98c0437b4ac839d8a2ece1b18166da704b86d8f42c92bbda - v :
number
- Calculated curve point, or identity element O. example: 28
Package util¶
Type Transport¶
A Transport-object responsible to transport the message to the handler.
Source: util/transport.ts
- handle(url :
string
, data :RPCRequest
|RPCRequest
[], timeout :number
) :Promise<>
- handles a request by passing the data to the handler - isOnline() :
Promise<boolean>
- check whether the handler is onlne. - random(count :
number
) :number
[] - generates random numbers (between 0-1)
Type AxiosTransport¶
Default Transport impl sending http-requests.
Source: util/transport.ts
constructor
constructor(format :'json'
|'cbor'
|'jsonRef'
= “json”) :AxiosTransport
- format :
'json'
|'cbor'
|'jsonRef'
- handle(url :
string
, data :RPCRequest
|RPCRequest
[], timeout :number
) :Promise<>
- isOnline() :
Promise<boolean>
- random(count :
number
) :number
[]