Blockchain

Note zachys (atomic units) are 10^6 in X-Cash

Stats

This method gets the stats

URL: https://api.xcash.foundation/v1/xcash/blockchain/unauthorized/stats

Method: GET

Inputs: None.

Results:

  • height - unsigned int; The current block height.

  • hash - string; The current block hash.

  • reward - unsigned long long; The current block reward in zachys (atomic units).

  • size - unsigned long long; The size of the blockchain in bytes.

  • version - unsigned int; The hard fork version.

  • versionBlockHeight - unsigned int; The block height the hard fork version started on.

  • nextVersionBlockHeight - unsigned int; The block height of the next hard fork version.

  • totalPublicTx - unsigned int; The total public tx.

  • totalPrivateTx - unsigned int; The total private tx.

  • circulatingSupply - unsigned long long; The circulating supply in zachys (atomic units).

  • generatedSupply - unsigned long long; The generated supply in zachys (atomic units).

  • totalSupply - unsigned long long; The total supply in zachys (atomic units).

  • emissionReward - unsigned long long; The estimated constant block reward in zachys (atomic units).

  • emissionHeight - unsigned int; The estimated block height that will start the emission (when the constant block reward is hit).

  • emissionTime - unsigned int; The estimated time when the emission will start (when the constant block reward is hit).

  • inflationHeight - unsigned int; The estimated block height that will start the inflation (when the total supply increases).

  • inflationTime - unsigned int; The estimated time when the inflation will start (when the total supply increases).

Block Data

This method gets the block data

URL: https://api.xcash.foundation/v1/xcash/blockchain/unauthorized/blocks/{blockHeight}

Method: GET

Resources:

  • blockHeight - Not required - The block height (default is current block height).

Inputs: None.

Results:

  • height - unsigned int; The block height.

  • hash - string; The block hash.

  • reward - unsigned long long; The block reward in zachys (atomic units).

  • time - unsigned int; The time the block was produced.

  • xcashDPOPS - bool;

  • delegateName - string; The delegate name who produced the block.

  • tx - an array of transactions; The list of all transactions included in the block.

Transaction Data

This method gets the transaction data

URL: https://api.xcash.foundation/v1/xcash/blockchain/unauthorized/tx/{txHash}

Method: GET

Resources:

  • tx - Required - The tx hash.

Inputs: None.

Results:

  • height - unsigned int; The block height (0 if not added to a block).

  • confirmations - unsigned int; The block confirmations.

  • time - unsigned int; The time.

  • type - string; "private | public".

  • sender - string; The sender, if public.

  • receiver - string; The receiver, if public.

  • amount - unsigned long long; The amount, if public.

Prove Transaction

This method proves a tx and its amount

URL: https://api.xcash.foundation/v1/xcash/blockchain/unauthorized/tx/prove/

Method: POST

Inputs (All are required):

  • tx - The tx hash.

  • address - The destination public address.

  • key - The tx key or tx proof.

Results:

  • valid - bool; Confirms that some amount was sent to the destination public address in this tx.

  • amount - unsigned long long; The amount sent to the destination public address.

Prove Balance

This method proves that a wallet has at least a certain balance

URL: https://api.xcash.foundation/v1/xcash/blockchain/unauthorized/address/prove/

Method: POST

Inputs (All are required):

  • address - The public address to prove has a certain balance.

  • signature - The signature.

Results:

  • amount - unsigned long long; The amount that the address has proven that it holds. Note the address can hold more than this amount, but not less than this amount.

Transaction History

This method gets the public transaction history of an address

URL: https://api.xcash.foundation/v1/xcash/blockchain/unauthorized/address/history/{type}/{address}

Method: GET

Resources:

  • type - Required - "sender | receiver".

  • address - Required - The address.

Inputs: None.

Results:

An array of objects with the following structure:

  • tx - string; The tx.

  • key - string; The tx key.

  • sender - string; The sender.

  • receiver - string; The receiver.

  • amount - unsigned long long; The amount.

  • height - unsigned int; The block height.

  • time - unsigned int; The block timestamp.

Validate Address

This method validates an address

URL: https://api.xcash.foundation/v1/xcash/blockchain/unauthorized/address/validate/{address}

Method: GET

Resources:

  • address - Required - The address.

Inputs: None.

Results:

An array of objects with the following structure:

  • valid - bool; The validation status.

Create Integrated Address

This method creates an integrated address

URL: https://api.xcash.foundation/v1/xcash/blockchain/unauthorized/address/createIntegrated/

Method: POST

Inputs:

  • address - Required - The public address.

  • paymentId - Not required - The payment id (either encrypted or long format).

Results:

  • integratedAddress - string; The integrated address

  • paymentId - string; The payment id

Last updated