npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

quantum-coin-js-sdk

v1.0.26

Published

Quantum Coin - Q SDK in JavaScript

Downloads

474

Readme

quantum-coin-js-sdk

Quantum Coin JS SDK provides functionality to interact with the Quantum Coin Blockchain using the Relay APIs. Example Project

Example

Requires Node.js version v20.18.1 or higher

Installation:
npm install quantum-coin-js-sdk --save

//Adding reference:
var qcsdk = require('quantum-coin-js-sdk');

//Initialize the SDK first before invoking any other function
var clientConfigVal = new qcsdk.Config("https://sdk.readrelay.quantumcoinapi.com", "https://sdk.writerelay.quantumcoinapi.com", 123123, "", ""); //TMainnet Block Explorer: https://QuantumScan.com
 
qcsdk.initialize(clientConfigVal).then((initResult) => {
  
}

Example Project: https://github.com/quantumcoinproject/quantum-coin-js-sdk/tree/main/example

quantum-coin-js-sdk~Config

This is the configuration class required to initialize and interact with Quantum Coin blockchain

Kind: inner class of quantum-coin-js-sdk
Access: public

new Config(readUrl, writeUrl, chainId, readApiKey, writeApiKey)

Creates a config class

| Param | Type | Description | | --- | --- | --- | | readUrl | string | The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/dogep/relay. The following URLs are community maintained. Please use your own relay service. Mainnet: https://sdk.readrelay.quantumcoinapi.com | | writeUrl | string | The Write API URL pointing to a write relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/dogep/relay. The following URLs are community maintained. Please use your own relay service. Mainnet: https://sdk.writerelay.quantumcoinapi.com | | chainId | number | The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324. | | readApiKey | string | Optional parameter if authorization is enabled for the relay service. API Key for authorization. Defaults to null which indicates no authorization. | | writeApiKey | string | Optional parameter if authorization is enabled for the relay service. API Key for authorization. Defaults to null which indicates no authorization. |

config.readUrl : string

The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/dogep/relay

Kind: instance property of Config
Access: public

config.writeUrl : string

The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/dogep/relay

Kind: instance property of Config
Access: public

config.chainId : number

The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324.

Kind: instance property of Config
Access: public

config.readApiKey : string

API Key for authorization if authorization is enabled for the relay service. Defaults to null which indicates no authorization.

Kind: instance property of Config
Access: public

config.writeApiKey : string

API Key for authorization if authorization is enabled for the relay service. Defaults to null which indicates no authorization.

Kind: instance property of Config
Access: public

quantum-coin-js-sdk~Wallet

This class represents a Wallet. Use the verifyWallet function to verify if a wallet is valid. Verifying the wallet is highly recommended, especially if it comes from an untrusted source. For more details on the underlying cryptography of the Wallet, see https://github.com/QuantumCoinProject/hybrid-pqc

Kind: inner class of quantum-coin-js-sdk
Access: public

new Wallet(address, privateKey, publicKey)

Creates a Wallet class. The constructor does not verify the wallet. To verify a wallet, call the verifyWallet function explicitly.

| Param | Type | Description | | --- | --- | --- | | address | string | Address of the wallet | | privateKey | Array.<number> | Private Key byte array of the wallet | | publicKey | Array.<number> | The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324. |

wallet.address : string

Address of the wallet. Is 66 bytes in length including 0x (if the wallet is valid).

Kind: instance property of Wallet
Access: public

wallet.privateKey : Array.<number>

Private Key byte array of the wallet. Is 4064 bytes in length (if the wallet is valid).

Kind: instance property of Wallet
Access: public

wallet.publicKey : Array.<number>

Public Key byte array of the wallet. Is 1408 bytes in length (if the wallet is valid).

Kind: instance property of Wallet
Access: public

quantum-coin-js-sdk~BlockDetails

This class represents a Block.

Kind: inner class of quantum-coin-js-sdk
Access: public

blockDetails.blockNumber : number

Block Number of the block

Kind: instance property of BlockDetails
Access: public

quantum-coin-js-sdk~LatestBlockDetailsResult

This class represents a result from invoking the getLatestBlock function.

Kind: inner class of quantum-coin-js-sdk
Access: public

latestBlockDetailsResult.resultCode : number

Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.

Kind: instance property of LatestBlockDetailsResult
Access: public

latestBlockDetailsResult.blockDetails : BlockDetails

An object of type BlockDetails representing the block. This value is null if the value of resultCode is not 0.

Kind: instance property of LatestBlockDetailsResult
Access: public

latestBlockDetailsResult.response : Object

An object of representing the raw Response returned by the service. For details, see https://developer.mozilla.org/en-US/docs/Web/API/Response. This value can be null if the value of resultCode is not 0.

Kind: instance property of LatestBlockDetailsResult
Access: public

latestBlockDetailsResult.requestId : string

An unique id to represent the request. This can be null if request failed before it could be sent.

Kind: instance property of LatestBlockDetailsResult
Access: public

latestBlockDetailsResult.err : Error

An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.

Kind: instance property of LatestBlockDetailsResult
Access: public

quantum-coin-js-sdk~AccountDetails

This class represents an Account.

Kind: inner class of quantum-coin-js-sdk
Access: public

accountDetails.address : string

Address of the wallet. Is 66 bytes in length including 0x.

Kind: instance property of AccountDetails
Access: public

accountDetails.balance : string

Balance of the account in wei. To convert this to ethers, see https://docs.ethers.org/v4/api-utils.html#ether-strings-and-wei

Kind: instance property of AccountDetails
Access: public

accountDetails.nonce : number

A monotonically increasing number representing the nonce of the account. After each transaction from the account that gets registered in the blockchain, the nonce increases by 1.

Kind: instance property of AccountDetails
Access: public

accountDetails.blockNumber : number

The block number as of which the Account details was retrieved.

Kind: instance property of AccountDetails
Access: public

quantum-coin-js-sdk~AccountDetailsResult

This class represents a result from invoking the getAccountDetails function.

Kind: inner class of quantum-coin-js-sdk
Access: public

accountDetailsResult.resultCode : number

Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.

Kind: instance property of AccountDetailsResult
Access: public

accountDetailsResult.accountDetails : AccountDetails

An object of type AccountDetails representing the block. This value is null if the value of resultCode is not 0.

Kind: instance property of AccountDetailsResult
Access: public

accountDetailsResult.response : Object

An object of representing the raw Response returned by the service. For details, see https://developer.mozilla.org/en-US/docs/Web/API/Response. This value can be null if the value of resultCode is not 0.

Kind: instance property of AccountDetailsResult
Access: public

accountDetailsResult.requestId : string

An unique id to represent the request. This can be null if request failed before it could be sent.

Kind: instance property of AccountDetailsResult
Access: public

accountDetailsResult.err : Error

An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.

Kind: instance property of AccountDetailsResult
Access: public

quantum-coin-js-sdk~SignResult

This class represents a result from invoking the signSendCoinTransaction function.

Kind: inner class of quantum-coin-js-sdk
Access: public

signResult.resultCode : number

Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.

Kind: instance property of SignResult
Access: public

signResult.txnHash : string

Hash of the Transaction, to uniquely identify it. Is 66 bytes in length including 0x. This value is null if the value of resultCode is not 0.

Kind: instance property of SignResult
Access: public

signResult.txnData : string

A payload representing the signed transaction. To actually send a transaction, this payload can then be taken to to a different device that is connected to the blockchain relay and then sent using the postTransaction function. This value is null if the value of resultCode is not 0.

Kind: instance property of SignResult
Access: public

quantum-coin-js-sdk~SendResult

This class represents a result from invoking the sendCoins function.

Kind: inner class of quantum-coin-js-sdk
Access: public

sendResult.resultCode : number

Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.

Kind: instance property of SendResult
Access: public

sendResult.txnHash : string

Hash of the Transaction, to uniquely identify it. Is 66 bytes in length including 0x. This value is null if the value of resultCode is not 0.

Kind: instance property of SendResult
Access: public

sendResult.response : Object

An object of representing the raw Response returned by the service. For details, see https://developer.mozilla.org/en-US/docs/Web/API/Response. This value can be null if the value of resultCode is not 0.

Kind: instance property of SendResult
Access: public

sendResult.requestId : string

An unique id to represent the request. This can be null if request failed before it could be sent.

Kind: instance property of SendResult
Access: public

sendResult.err : Error

An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.

Kind: instance property of SendResult
Access: public

quantum-coin-js-sdk~TransactionReceipt

This class represents a Receipt of a transaction that is registered in the blockchain. The transactionReceipt field can be null unless the transaction is registered with the blockchain. While the transaction is pending, this field will be null. You should consider the transaction as succeeded only if the status field's value is 0x1 (success).

Kind: inner class of quantum-coin-js-sdk
Access: public

transactionReceipt.cumulativeGasUsed : string

A hexadecimal string representing the total amount of gas used when this transaction was executed in the block.

Kind: instance property of TransactionReceipt
Access: public

transactionReceipt.effectiveGasPrice : string

A hexadecimal string representing the sum of the base fee and tip paid per unit of gas.

Kind: instance property of TransactionReceipt
Access: public

transactionReceipt.gasUsed : string

A hexadecimal string representing the amount of gas used by this specific transaction alone.

Kind: instance property of TransactionReceipt
Access: public

transactionReceipt.status : string

A hexadecimal string representing either 0x1 (success) or 0x0 (failure). Failed transactions can also incur gas fee. You should consider the transaction as succeeded only if the status value is 0x1 (success).

Kind: instance property of TransactionReceipt
Access: public

transactionReceipt.hash : string

Hash of the Transaction, to uniquely identify it. Is 66 bytes in length including 0x.

Kind: instance property of TransactionReceipt
Access: public

transactionReceipt.type : string

A hexadecimal string representing the transaction type. 0x0 is DefaultFeeTxType.

Kind: instance property of TransactionReceipt
Access: public

quantum-coin-js-sdk~TransactionDetails

This class represents details of a transaction. You should consider the transaction as succeeded only if the status field of the receipt object is 0x1 (success).

Kind: inner class of quantum-coin-js-sdk
Access: public

transactionDetails.blockHash : string

A hexadecimal string representing the hash of the block that registered the transaction. This field can be null if the transaction was not registered in the blockchain.

Kind: instance property of TransactionDetails
Access: public

transactionDetails.blockNumber : number

The number of the block that registered the transaction. This field can be null if the transaction was not registered in the blockchain.

Kind: instance property of TransactionDetails
Access: public

transactionDetails.from : string

A 66 character hexadecimal string representing the address the transaction is sent from.

Kind: instance property of TransactionDetails
Access: public

transactionDetails.gas : string

A hexadecimal string representing the gas provided for the transaction execution.

Kind: instance property of TransactionDetails
Access: public

transactionDetails.gasPrice : string

A hexadecimal string representing the gasPrice used for each paid gas, in Wei.

Kind: instance property of TransactionDetails
Access: public

transactionDetails.hash : string

A 66 character hexadecimal string representing the hash of the transaction.

Kind: instance property of TransactionDetails
Access: public

transactionDetails.input : string

A hexadecimal string representing the compiled code of a contract OR the hash of the invoked method signature and encoded parameters.

Kind: instance property of TransactionDetails
Access: public

transactionDetails.nonce : number

A monotonically increasing number representing the nonce of the account. After each transaction from the account that gets registered in the blockchain, the nonce increases by 1.

Kind: instance property of TransactionDetails
Access: public

transactionDetails.to : string

A 66 character hexadecimal string representing address the transaction is directed to.

Kind: instance property of TransactionDetails
Access: public

transactionDetails.value : string

A hexadecimal string representing the value sent with this transaction. The value can be 0 for smart contract transactions, since it only represents the number of coins sent.

Kind: instance property of TransactionDetails
Access: public

transactionDetails.receipt : TransactionReceipt

The receipt of the transaction. This field will be null while the transaction is pending (not yet registered in the blockchain).

Kind: instance property of TransactionDetails
Access: public

quantum-coin-js-sdk~TransactionDetailsResult

This class represents a result from invoking the getTransactionDetails function. If transactions get discarded by the blockchain, for reasons such as due to lower than minimum gas fees or invalid nonce, the resultCode will always contain a non-zero value (failure).

Kind: inner class of quantum-coin-js-sdk
Access: public

transactionDetailsResult.resultCode : number

Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.

Kind: instance property of TransactionDetailsResult
Access: public

transactionDetailsResult.transactionDetails : TransactionDetails

An object of type TransactionDetails representing the transaction. This value is null if the value of resultCode is not 0.

Kind: instance property of TransactionDetailsResult
Access: public

transactionDetailsResult.response : Object

An object of representing the raw Response returned by the service. For details, see https://developer.mozilla.org/en-US/docs/Web/API/Response. This value can be null if the value of resultCode is not 0.

Kind: instance property of TransactionDetailsResult
Access: public

transactionDetailsResult.requestId : string

An unique id to represent the request. This can be null if request failed before it could be sent.

Kind: instance property of TransactionDetailsResult
Access: public

transactionDetailsResult.err : Error

An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.

Kind: instance property of TransactionDetailsResult
Access: public

quantum-coin-js-sdk~AccountTransactionCompact

This class represents a transaction of an account. You should consider the transaction as succeeded only if the status field is 0x1 (success).

Kind: inner class of quantum-coin-js-sdk
Access: public

accountTransactionCompact.blockNumber : number

The number of the block that registered the transaction. This field can be null if the transaction was not registered in the blockchain.

Kind: instance property of AccountTransactionCompact
Access: public

accountTransactionCompact.from : string

A 66 character hexadecimal string representing the address the transaction is sent from.

Kind: instance property of AccountTransactionCompact
Access: public

accountTransactionCompact.hash : string

A 66 character hexadecimal string representing the hash of the transaction.

Kind: instance property of AccountTransactionCompact
Access: public

accountTransactionCompact.to : string

A 66 character hexadecimal string representing address the transaction is directed to.

Kind: instance property of AccountTransactionCompact
Access: public

accountTransactionCompact.value : string

A hexadecimal string representing the value sent with this transaction. The value can be 0 for smart contract transactions, since it only represents the number of coins sent.

Kind: instance property of AccountTransactionCompact
Access: public

accountTransactionCompact.status : string

A hexadecimal string representing either 0x1 (success) or 0x0 (failure). Failed transactions can also incur gas fee. You should consider the transaction as succeeded only if the status value is 0x1 (success).

Kind: instance property of AccountTransactionCompact
Access: public

quantum-coin-js-sdk~ListAccountTransactionsResponse

This class represents a list of account transactions returned by the listAccountTransactionDetails function.

Kind: inner class of quantum-coin-js-sdk
Access: public

listAccountTransactionsResponse.pageCount : number

The number of pages available for listing.

Kind: instance property of ListAccountTransactionsResponse
Access: public

listAccountTransactionsResponse.items : AccountTransactionCompact | Array

An array of type AccountTransactionCompact, containing the list of transactions. Can be null if no items are available.

Kind: instance property of ListAccountTransactionsResponse
Access: public

quantum-coin-js-sdk~AccountTransactionsResult

This class represents a result from invoking the listAccountTransactionDetails function.

Kind: inner class of quantum-coin-js-sdk
Access: public

accountTransactionsResult.resultCode : number

Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.

Kind: instance property of AccountTransactionsResult
Access: public

accountTransactionsResult.listAccountTransactionsResponse : ListAccountTransactionsResponse

An object of type ListAccountTransactionsResponse representing the list of transactions along with metadata. This value is null if the value of resultCode is not 0.

Kind: instance property of AccountTransactionsResult
Access: public

accountTransactionsResult.response : Object

An object of representing the raw Response returned by the service. For details, see https://developer.mozilla.org/en-US/docs/Web/API/Response. This value can be null if the value of resultCode is not 0.

Kind: instance property of AccountTransactionsResult
Access: public

accountTransactionsResult.requestId : string

An unique id to represent the request. This can be null if request failed before it could be sent.

Kind: instance property of AccountTransactionsResult
Access: public

accountTransactionsResult.err : Error

An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.

Kind: instance property of AccountTransactionsResult
Access: public

quantum-coin-js-sdk~TransactionSigningRequest

This class represents a signing request that can be passed to signTransaction.

Kind: inner class of quantum-coin-js-sdk
Access: public

new TransactionSigningRequest(wallet, toAddress, valueInWei, nonce, data, gasLimit, remarks)

Creates a TransactionSigningRequest class.

| Param | Type | Description | | --- | --- | --- | | wallet | Wallet | The wallet with which the transaction has to be signed. The constructor does not verify the wallet. To verify a wallet, call the verifyWallet function explicitly. | | toAddress | string | The address to which the transaction request is made. Can be null (for example, for contract creation). | | valueInWei | string | BigInt | The value in wei-units. Can be provided as either a hex string (including 0x prefix) or a BigInt. For example, to represent 1 coin, which is 1000000000000000000 in wei-units, set the value to "0xDE0B6B3A7640000" or BigInt("1000000000000000000"). Conversion Examples | | nonce | number | A monotonically increasing number representing the nonce of the account signing the transaction. After each transaction from the account that gets registered in the blockchain, the nonce increases by 1. | | data | string | An optional hex string (including 0x) that represents the contract data. Can be null if not invoking or creating a contract. | | gasLimit | number | A limit of gas to be used. Set 21000 for basic non smart contract transactions. | | remarks | string | An optional hex string (including 0x) that represents a remark (such as a comment). Maximum 32 bytes length (in bytes). Warning, do not store any sensitive information in this field. |

transactionSigningRequest.wallet : Wallet

The wallet that should be used to sign the transaction.

Kind: instance property of TransactionSigningRequest
Access: public

transactionSigningRequest.toAddress : string

The address to which the transaction request is made. Can be null (for example, for contract creation).

Kind: instance property of TransactionSigningRequest
Access: public

transactionSigningRequest.valueInWei : string | BigInt

The value in wei-units. Can be provided as either a hex string (including 0x prefix) or a BigInt. For example, to represent 1 coin, which is 1000000000000000000 in wei-units, set the value to "0xDE0B6B3A7640000" or BigInt("1000000000000000000"). Conversion Examples

Kind: instance property of TransactionSigningRequest
Access: public

transactionSigningRequest.nonce : number

A monotonically increasing number representing the nonce of the account signing the transaction. After each transaction from the account that gets registered in the blockchain, the nonce increases by 1.

Kind: instance property of TransactionSigningRequest
Access: public

transactionSigningRequest.data : string

An optional hex string (including 0x) that represents the contract data. Can be null if not invoking or creating a contract.

Kind: instance property of TransactionSigningRequest
Access: public

transactionSigningRequest.gasLimit : number

A limit of gas to be used. Set 21000 for basic non smart contract transactions.

Kind: instance property of TransactionSigningRequest
Access: public

transactionSigningRequest.remarks : string

An optional hex string (including 0x) that represents a remark (such as a comment). Maximum 32 bytes length (in bytes). Warning, do not store any sensitive information in this field.

Kind: instance property of TransactionSigningRequest
Access: public

quantum-coin-js-sdk~PackUnpackResult

This class represents a result from invoking the packMethodData or unpackMethodData functions.

Kind: inner class of quantum-coin-js-sdk
Access: public

new PackUnpackResult(error, result)

Creates a PackUnpackResult class.

| Param | Type | Description | | --- | --- | --- | | error | string | Error message if any. Empty string if no error. | | result | string | The actual result as a string. Empty string if there was an error. |

packUnpackResult.error : string

Error message if any. Empty string if no error.

Kind: instance property of PackUnpackResult
Access: public

packUnpackResult.result : string

The actual result as a string. Empty string if there was an error.

Kind: instance property of PackUnpackResult
Access: public

quantum-coin-js-sdk~initialize(clientConfig) ⇒ Promise.<boolean>

The initialize function has to be called before attempting to invoke any other function. This function should be called only once.

Kind: inner method of quantum-coin-js-sdk
Returns: Promise.<boolean> - Returns a promise of type boolean; true if the initialization succeeded, else false.

| Param | Type | Description | | --- | --- | --- | | clientConfig | Config | undefined | A configuration represented by the Config class. A default configuration is used, if not specified. |

quantum-coin-js-sdk~isAddressValid(address) ⇒ boolean

The isAddressValid function validates whether an address is valid or not. An address is of length 66 characters including 0x.

Kind: inner method of quantum-coin-js-sdk
Returns: boolean - Returns true if the address validation succeeded, else returns false.

| Param | Type | Description | | --- | --- | --- | | address | string | A string representing the address to validate. |

quantum-coin-js-sdk~newWallet() ⇒ Wallet

The newWallet function creates a new Wallet.

Kind: inner method of quantum-coin-js-sdk
Returns: Wallet - Returns a Wallet object.

quantum-coin-js-sdk~newWalletSeed() ⇒ array

The newWalletSeed function creates a new Wallet seed word list. The return array can then be passed to the openWa