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:

`

Package client

Type Client

Client for N3.

Source: client/Client.ts

Type ChainContext

Context for a specific chain including cache and chainSpecs.

Source: client/ChainContext.ts

Type Module

Source: client/modules.ts

Package modules/eth

Type EthAPI

Source: modules/eth/api.ts

Type AuthSpec

Authority specification for proof of authority chains

Source: modules/eth/header.ts

Type Block

Source: modules/eth/api.ts

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 BlockType

Source: modules/eth/api.ts

  • BlockType :number|'latest'|'earliest'|'pending'

Type Address

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

Type Hash

Source: modules/eth/api.ts

Type Quantity

Source: modules/eth/api.ts

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.

Type TransactionDetail

Source: modules/eth/api.ts

Type TransactionReceipt

Source: modules/eth/api.ts

Type Data

Source: modules/eth/api.ts

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

Type Hex

Source: modules/eth/api.ts

Type ABIField

Source: modules/eth/api.ts

Package modules/ipfs

Type IpfsAPI

simple API for IPFS

Source: modules/ipfs/api.ts

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)
    • database :string (optional) - name of the database
    • host :string (optional) - db-host (default = localhost)
    • password :string (optional) - password for db-access
    • port :number (optional) - the database port
    • user :string (optional) - username for the db
  • 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
  • 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

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
    • 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
  • 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

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.

Package modules/eth

Type BlockData

Block as returned by eth_getBlockByNumber

Source: modules/eth/serialize.ts

Type LogData

LogData as part of the TransactionReceipt

Source: modules/eth/serialize.ts

Type ReceiptData

TransactionReceipt as returned by eth_getTransactionReceipt

Source: modules/eth/serialize.ts

Type TransactionData

Transaction as returned by eth_getTransactionByHash

Source: modules/eth/serialize.ts

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

Type Transaction

Buffer[] of the transaction

Source: modules/eth/serialize.ts

Type Receipt

Buffer[] of the Receipt

Source: modules/eth/serialize.ts

  • Receipt : - Buffer[] of the Receipt

Type Account

Buffer[] of the Account

Source: modules/eth/serialize.ts

Type BlockHeader

Buffer[] of the header

Source: modules/eth/serialize.ts

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