Skip to content
JinGyeong Jeong edited this page Apr 27, 2018 · 24 revisions

Basic Types

  • U256
  • H160, H256, H512
  • Block
  • Transaction (nonce, fee, action, networkId)
  • SignedTransaction (Transaction, r, s, v)
  • Action (type, data)
  • AssetScheme

Supported Methods

Basic Methods

  • ping () => Promise<string>

Send a ping to codechain RPC server.

Returns a Promise that resolves with a string “pong”.

Chain Methods

  • getBlockNumber () => Promise<number>

Get latest block number.

Returns a Promise that resolves with a number.

  • getBlockhash (number) => Promise<H256>

Get the hash of the block of given number.

Returns a Promise that resolves with a H256.

  • getBlock (number) => Promise<Block>

  • getTransaction (txhash: H256) => Promise<Transaction>

  • getTransactions (blockhash: H256) => Promise<Transaction[]>

  • getTransactionInvoice (H256) => Promise<Invoice>

  • getAssetScheme (address: H256) => Promise<AssetScheme>

  • sendSignedTransaction (SignedTransaction) => Promise<number>

  • getBalance (address: H160) => Promise<U256>

  • getNonce (address: H160) => Promise<U256>

Network Methods

  • connectTo (SocketAddr) => Promise<?>

  • exchangeKey (SocketAddr) => Promise<?>

Local Methods (Offline)

  • sign (H256) => ?

  • blake256 () => H256

Clone this wiki locally