quantum-coin-js-sdk 1.0.39 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitignore +2 -1
- package/README.md +109 -768
- package/index.d.ts +76 -545
- package/index.js +319 -1194
- package/package.json +20 -5
- package/wasmBase64.js +7 -16
- package/wasm_exec.js +575 -587
- package/.idea/.name +0 -1
- package/.idea/modules.xml +0 -8
- package/.idea/quantum-coin-js-sdk.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/.vs/ProjectSettings.json +0 -3
- package/.vs/VSWorkspaceState.json +0 -8
- package/.vs/quantum-coin-js-sdk/FileContentIndex/a9d6de82-cfc3-4c22-ac38-06d706ff3673.vsidx +0 -0
- package/.vs/quantum-coin-js-sdk/FileContentIndex/fdc816df-1898-4153-99f2-c69ef4c2283b.vsidx +0 -0
- package/.vs/quantum-coin-js-sdk/config/applicationhost.config +0 -1011
- package/.vs/quantum-coin-js-sdk/v17/.wsuo +0 -0
- package/.vs/quantum-coin-js-sdk/v17/DocumentLayout.backup.json +0 -39
- package/.vs/quantum-coin-js-sdk/v17/DocumentLayout.json +0 -57
- package/.vs/slnx.sqlite +0 -0
- package/example/README.md +0 -14
- package/example/conversion-example.js +0 -19
- package/example/example-create-contract.js +0 -396
- package/example/example-encode-decode-rlp.js +0 -225
- package/example/example-event-pack-unpack.js +0 -391
- package/example/example-misc.js +0 -100
- package/example/example-rpc-send-signRawTransaction.js +0 -318
- package/example/example-rpc-send.js +0 -115
- package/example/example-send.js +0 -69
- package/example/example-token-pack-unpack.js +0 -960
- package/example/example-wallet-version4.js +0 -34
- package/example/example-wallet.js +0 -43
- package/example/example.js +0 -405
- package/example/node_modules/.bin/sdkgen +0 -16
- package/example/node_modules/.bin/sdkgen.cmd +0 -17
- package/example/node_modules/.bin/sdkgen.ps1 +0 -28
- package/example/node_modules/.package-lock.json +0 -47
- package/example/node_modules/quantumcoin/.github/workflows/publish-npmjs.yaml +0 -22
- package/example/node_modules/quantumcoin/LICENSE +0 -21
- package/example/node_modules/quantumcoin/README-SDK.md +0 -828
- package/example/node_modules/quantumcoin/README.md +0 -197
- package/example/node_modules/quantumcoin/config.d.ts +0 -50
- package/example/node_modules/quantumcoin/config.js +0 -123
- package/example/node_modules/quantumcoin/examples/AllSolidityTypes.sol +0 -184
- package/example/node_modules/quantumcoin/examples/SimpleIERC20.sol +0 -74
- package/example/node_modules/quantumcoin/examples/events.js +0 -41
- package/example/node_modules/quantumcoin/examples/events.ts +0 -35
- package/example/node_modules/quantumcoin/examples/example-generator-sdk-js.js +0 -100
- package/example/node_modules/quantumcoin/examples/example-generator-sdk-js.ts +0 -77
- package/example/node_modules/quantumcoin/examples/example-generator-sdk-ts.js +0 -100
- package/example/node_modules/quantumcoin/examples/example-generator-sdk-ts.ts +0 -77
- package/example/node_modules/quantumcoin/examples/example.js +0 -67
- package/example/node_modules/quantumcoin/examples/example.ts +0 -56
- package/example/node_modules/quantumcoin/examples/offline-signing.js +0 -77
- package/example/node_modules/quantumcoin/examples/offline-signing.ts +0 -65
- package/example/node_modules/quantumcoin/examples/package-lock.json +0 -596
- package/example/node_modules/quantumcoin/examples/package.json +0 -32
- package/example/node_modules/quantumcoin/examples/read-operations.js +0 -32
- package/example/node_modules/quantumcoin/examples/read-operations.ts +0 -31
- package/example/node_modules/quantumcoin/examples/sdk-generator-erc20.inline.json +0 -251
- package/example/node_modules/quantumcoin/examples/solidity-types.ts +0 -43
- package/example/node_modules/quantumcoin/examples/wallet-offline.js +0 -36
- package/example/node_modules/quantumcoin/examples/wallet-offline.ts +0 -26
- package/example/node_modules/quantumcoin/generate-sdk.js +0 -1846
- package/example/node_modules/quantumcoin/index.js +0 -12
- package/example/node_modules/quantumcoin/package.json +0 -95
- package/example/node_modules/quantumcoin/scripts/copy-declarations.js +0 -31
- package/example/node_modules/quantumcoin/scripts/run-all-one-by-one.js +0 -151
- package/example/node_modules/quantumcoin/src/abi/fragments.d.ts +0 -42
- package/example/node_modules/quantumcoin/src/abi/fragments.js +0 -63
- package/example/node_modules/quantumcoin/src/abi/index.d.ts +0 -13
- package/example/node_modules/quantumcoin/src/abi/index.js +0 -9
- package/example/node_modules/quantumcoin/src/abi/interface.d.ts +0 -128
- package/example/node_modules/quantumcoin/src/abi/interface.js +0 -605
- package/example/node_modules/quantumcoin/src/abi/js-abi-coder.d.ts +0 -8
- package/example/node_modules/quantumcoin/src/abi/js-abi-coder.js +0 -538
- package/example/node_modules/quantumcoin/src/constants.d.ts +0 -61
- package/example/node_modules/quantumcoin/src/constants.js +0 -94
- package/example/node_modules/quantumcoin/src/contract/contract-factory.d.ts +0 -28
- package/example/node_modules/quantumcoin/src/contract/contract-factory.js +0 -111
- package/example/node_modules/quantumcoin/src/contract/contract.d.ts +0 -113
- package/example/node_modules/quantumcoin/src/contract/contract.js +0 -408
- package/example/node_modules/quantumcoin/src/contract/index.d.ts +0 -9
- package/example/node_modules/quantumcoin/src/contract/index.js +0 -9
- package/example/node_modules/quantumcoin/src/errors/index.d.ts +0 -92
- package/example/node_modules/quantumcoin/src/errors/index.js +0 -200
- package/example/node_modules/quantumcoin/src/generator/index.d.ts +0 -81
- package/example/node_modules/quantumcoin/src/generator/index.js +0 -1571
- package/example/node_modules/quantumcoin/src/index.d.ts +0 -122
- package/example/node_modules/quantumcoin/src/index.js +0 -41
- package/example/node_modules/quantumcoin/src/internal/hex.d.ts +0 -68
- package/example/node_modules/quantumcoin/src/internal/hex.js +0 -180
- package/example/node_modules/quantumcoin/src/providers/extra-providers.d.ts +0 -139
- package/example/node_modules/quantumcoin/src/providers/extra-providers.js +0 -614
- package/example/node_modules/quantumcoin/src/providers/index.d.ts +0 -17
- package/example/node_modules/quantumcoin/src/providers/index.js +0 -10
- package/example/node_modules/quantumcoin/src/providers/json-rpc-provider.d.ts +0 -12
- package/example/node_modules/quantumcoin/src/providers/json-rpc-provider.js +0 -89
- package/example/node_modules/quantumcoin/src/providers/provider.d.ts +0 -206
- package/example/node_modules/quantumcoin/src/providers/provider.js +0 -524
- package/example/node_modules/quantumcoin/src/types/index.d.ts +0 -214
- package/example/node_modules/quantumcoin/src/types/index.js +0 -9
- package/example/node_modules/quantumcoin/src/utils/address.d.ts +0 -58
- package/example/node_modules/quantumcoin/src/utils/address.js +0 -144
- package/example/node_modules/quantumcoin/src/utils/encoding.d.ts +0 -120
- package/example/node_modules/quantumcoin/src/utils/encoding.js +0 -306
- package/example/node_modules/quantumcoin/src/utils/fixednumber.d.ts +0 -57
- package/example/node_modules/quantumcoin/src/utils/fixednumber.js +0 -366
- package/example/node_modules/quantumcoin/src/utils/hashing.d.ts +0 -76
- package/example/node_modules/quantumcoin/src/utils/hashing.js +0 -298
- package/example/node_modules/quantumcoin/src/utils/index.d.ts +0 -63
- package/example/node_modules/quantumcoin/src/utils/index.js +0 -14
- package/example/node_modules/quantumcoin/src/utils/result.d.ts +0 -57
- package/example/node_modules/quantumcoin/src/utils/result.js +0 -128
- package/example/node_modules/quantumcoin/src/utils/rlp.d.ts +0 -12
- package/example/node_modules/quantumcoin/src/utils/rlp.js +0 -215
- package/example/node_modules/quantumcoin/src/utils/units.d.ts +0 -29
- package/example/node_modules/quantumcoin/src/utils/units.js +0 -107
- package/example/node_modules/quantumcoin/src/wallet/index.d.ts +0 -10
- package/example/node_modules/quantumcoin/src/wallet/index.js +0 -8
- package/example/node_modules/quantumcoin/src/wallet/wallet.d.ts +0 -192
- package/example/node_modules/quantumcoin/src/wallet/wallet.js +0 -713
- package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.dynamic.test.js +0 -207
- package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.dynamic.test.ts +0 -191
- package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.fixtures.js +0 -231
- package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.generated-sdks.e2e.test.js +0 -387
- package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.generated-sdks.e2e.test.ts +0 -350
- package/example/node_modules/quantumcoin/test/e2e/generator-interface.e2e.test.js +0 -165
- package/example/node_modules/quantumcoin/test/e2e/generator-interface.e2e.test.ts +0 -160
- package/example/node_modules/quantumcoin/test/e2e/helpers.js +0 -59
- package/example/node_modules/quantumcoin/test/e2e/signing-context-and-fee.e2e.test.js +0 -141
- package/example/node_modules/quantumcoin/test/e2e/signing-context-and-fee.e2e.test.ts +0 -128
- package/example/node_modules/quantumcoin/test/e2e/simple-erc20.generated-sdks.e2e.test.js +0 -168
- package/example/node_modules/quantumcoin/test/e2e/simple-erc20.generated-sdks.e2e.test.ts +0 -141
- package/example/node_modules/quantumcoin/test/e2e/transactional.test.js +0 -245
- package/example/node_modules/quantumcoin/test/e2e/transactional.test.ts +0 -208
- package/example/node_modules/quantumcoin/test/e2e/typed-generator.e2e.test.js +0 -407
- package/example/node_modules/quantumcoin/test/e2e/typed-generator.e2e.test.ts +0 -337
- package/example/node_modules/quantumcoin/test/fixtures/ConstructorParam.sol +0 -23
- package/example/node_modules/quantumcoin/test/fixtures/MultiContracts.sol +0 -37
- package/example/node_modules/quantumcoin/test/fixtures/SimpleStorage.sol +0 -18
- package/example/node_modules/quantumcoin/test/fixtures/StakingContract.abi.json +0 -1
- package/example/node_modules/quantumcoin/test/integration/ipc-provider.test.js +0 -49
- package/example/node_modules/quantumcoin/test/integration/ipc-provider.test.ts +0 -44
- package/example/node_modules/quantumcoin/test/integration/provider.test.js +0 -88
- package/example/node_modules/quantumcoin/test/integration/provider.test.ts +0 -85
- package/example/node_modules/quantumcoin/test/integration/ws-provider.test.js +0 -41
- package/example/node_modules/quantumcoin/test/integration/ws-provider.test.ts +0 -38
- package/example/node_modules/quantumcoin/test/security/abi-decoder-bounds.test.js +0 -122
- package/example/node_modules/quantumcoin/test/security/contract-overrides.test.js +0 -112
- package/example/node_modules/quantumcoin/test/security/generator-injection.test.js +0 -195
- package/example/node_modules/quantumcoin/test/security/malformed-input.test.js +0 -330
- package/example/node_modules/quantumcoin/test/security/malformed-input.test.ts +0 -35
- package/example/node_modules/quantumcoin/test/security/rpc-numeric-bounds.test.js +0 -81
- package/example/node_modules/quantumcoin/test/security/rpc-trust.test.js +0 -202
- package/example/node_modules/quantumcoin/test/unit/_encrypted-output.txt +0 -6
- package/example/node_modules/quantumcoin/test/unit/_log-encrypted-jsons.js +0 -45
- package/example/node_modules/quantumcoin/test/unit/_write-keystore-fixture.js +0 -16
- package/example/node_modules/quantumcoin/test/unit/abi-interface.test.js +0 -110
- package/example/node_modules/quantumcoin/test/unit/abi-interface.test.ts +0 -109
- package/example/node_modules/quantumcoin/test/unit/address-wallet.test.js +0 -923
- package/example/node_modules/quantumcoin/test/unit/address-wallet.test.ts +0 -877
- package/example/node_modules/quantumcoin/test/unit/browser-provider.test.js +0 -85
- package/example/node_modules/quantumcoin/test/unit/browser-provider.test.ts +0 -79
- package/example/node_modules/quantumcoin/test/unit/contract.test.js +0 -85
- package/example/node_modules/quantumcoin/test/unit/contract.test.ts +0 -83
- package/example/node_modules/quantumcoin/test/unit/encoding-units-rlp.test.js +0 -127
- package/example/node_modules/quantumcoin/test/unit/encoding-units-rlp.test.ts +0 -91
- package/example/node_modules/quantumcoin/test/unit/errors.test.js +0 -77
- package/example/node_modules/quantumcoin/test/unit/errors.test.ts +0 -76
- package/example/node_modules/quantumcoin/test/unit/filter-by-blockhash.test.js +0 -55
- package/example/node_modules/quantumcoin/test/unit/filter-by-blockhash.test.ts +0 -54
- package/example/node_modules/quantumcoin/test/unit/fixednumber.test.js +0 -656
- package/example/node_modules/quantumcoin/test/unit/fixednumber.test.ts +0 -660
- package/example/node_modules/quantumcoin/test/unit/fixtures/encrypted-keystores-48-32-36.js +0 -9
- package/example/node_modules/quantumcoin/test/unit/generate-contract-cli.test.js +0 -42
- package/example/node_modules/quantumcoin/test/unit/generate-contract-cli.test.ts +0 -41
- package/example/node_modules/quantumcoin/test/unit/generate-sdk-artifacts-json.test.js +0 -113
- package/example/node_modules/quantumcoin/test/unit/generate-sdk-artifacts-json.test.ts +0 -110
- package/example/node_modules/quantumcoin/test/unit/generator.test.js +0 -149
- package/example/node_modules/quantumcoin/test/unit/generator.test.ts +0 -148
- package/example/node_modules/quantumcoin/test/unit/hashing.test.js +0 -64
- package/example/node_modules/quantumcoin/test/unit/hashing.test.ts +0 -63
- package/example/node_modules/quantumcoin/test/unit/init.test.js +0 -39
- package/example/node_modules/quantumcoin/test/unit/init.test.ts +0 -38
- package/example/node_modules/quantumcoin/test/unit/interface.test.js +0 -56
- package/example/node_modules/quantumcoin/test/unit/interface.test.ts +0 -54
- package/example/node_modules/quantumcoin/test/unit/internal-hex.test.js +0 -81
- package/example/node_modules/quantumcoin/test/unit/internal-hex.test.ts +0 -80
- package/example/node_modules/quantumcoin/test/unit/populate-transaction.test.js +0 -98
- package/example/node_modules/quantumcoin/test/unit/populate-transaction.test.ts +0 -64
- package/example/node_modules/quantumcoin/test/unit/providers.test.js +0 -252
- package/example/node_modules/quantumcoin/test/unit/providers.test.ts +0 -251
- package/example/node_modules/quantumcoin/test/unit/result.test.js +0 -80
- package/example/node_modules/quantumcoin/test/unit/result.test.ts +0 -79
- package/example/node_modules/quantumcoin/test/unit/solidity-types.test.js +0 -49
- package/example/node_modules/quantumcoin/test/unit/solidity-types.test.ts +0 -39
- package/example/node_modules/quantumcoin/test/unit/utils.test.js +0 -57
- package/example/node_modules/quantumcoin/test/unit/utils.test.ts +0 -56
- package/example/node_modules/quantumcoin/test/verbose-logger.js +0 -74
- package/example/node_modules/quantumcoin/tsconfig.build.json +0 -14
- package/example/node_modules/seed-words/.github/workflows/publish-npmjs.yaml +0 -22
- package/example/node_modules/seed-words/BUILD.md +0 -7
- package/example/node_modules/seed-words/LICENSE +0 -121
- package/example/node_modules/seed-words/README.md +0 -67
- package/example/node_modules/seed-words/dist/seedwords.d.ts +0 -39
- package/example/node_modules/seed-words/package.json +0 -27
- package/example/node_modules/seed-words/seedwords.js +0 -315
- package/example/node_modules/seed-words/seedwords.txt +0 -65536
- package/example/node_modules/seed-words/tsconfig.json +0 -21
- package/example/package-lock.json +0 -56
- package/example/package.json +0 -15
- package/tests/encrypted-32.json +0 -1
- package/tests/encrypted-36.json +0 -1
- package/tests/encrypted-48.json +0 -1
- package/tests/generate-verify-vectors.js +0 -91
- package/tests/get-gas-price.test.js +0 -59
- package/tests/non-transactional.preinit.test.js +0 -41
- package/tests/non-transactional.test.js +0 -1389
- package/tests/scrypt.test.js +0 -128
- package/tests/sign-raw-keytype5-context-null.test.js +0 -107
- package/tests/sign-raw-transaction.test.js +0 -196
- package/tests/sign-verify.test.js +0 -311
- package/tests/transactional.relay.test.js +0 -131
- package/tests/transactional.rpc.test.js +0 -103
- package/tests/verify-vectors.json +0 -95035
package/README.md
CHANGED
|
@@ -22,97 +22,31 @@ qcsdk.initialize(null).then((initResult) => {
|
|
|
22
22
|
|
|
23
23
|
//Example initialization with specific values
|
|
24
24
|
//Initialize the SDK first before invoking any other function
|
|
25
|
-
var clientConfigVal = new qcsdk.Config(
|
|
25
|
+
var clientConfigVal = new qcsdk.Config(123123); //Initialization with Mainnet Config (Block Explorer: https://QuantumScan.com)
|
|
26
26
|
qcsdk.initialize(clientConfigVal).then((initResult) => {
|
|
27
27
|
|
|
28
28
|
}
|
|
29
29
|
Example Project: https://github.com/quantumcoinproject/quantum-coin-js-sdk/tree/main/example
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
## Browser usage
|
|
33
|
+
|
|
34
|
+
The SDK runs in modern browsers as well as Node.js (Node 16+ / a browser with WebAssembly and the Web Crypto API). Load `wasm_exec.js` before `index.js` (or bundle them together) and call `initialize()` as usual.
|
|
35
|
+
|
|
32
36
|
* [quantum-coin-js-sdk](#module_quantum-coin-js-sdk)
|
|
33
37
|
* [~Config](#module_quantum-coin-js-sdk..Config)
|
|
34
|
-
* [new Config(
|
|
35
|
-
* [.readUrl](#module_quantum-coin-js-sdk..Config+readUrl) : <code>string</code>
|
|
36
|
-
* [.writeUrl](#module_quantum-coin-js-sdk..Config+writeUrl) : <code>string</code>
|
|
38
|
+
* [new Config(chainId)](#new_module_quantum-coin-js-sdk..Config_new)
|
|
37
39
|
* [.chainId](#module_quantum-coin-js-sdk..Config+chainId) : <code>number</code>
|
|
38
|
-
* [.readApiKey](#module_quantum-coin-js-sdk..Config+readApiKey) : <code>string</code>
|
|
39
|
-
* [.writeApiKey](#module_quantum-coin-js-sdk..Config+writeApiKey) : <code>string</code>
|
|
40
40
|
* [~Wallet](#module_quantum-coin-js-sdk..Wallet)
|
|
41
41
|
* [new Wallet(address, privateKey, publicKey, [preExpansionSeed])](#new_module_quantum-coin-js-sdk..Wallet_new)
|
|
42
42
|
* [.address](#module_quantum-coin-js-sdk..Wallet+address) : <code>string</code>
|
|
43
43
|
* [.privateKey](#module_quantum-coin-js-sdk..Wallet+privateKey) : <code>Array.<number></code>
|
|
44
44
|
* [.publicKey](#module_quantum-coin-js-sdk..Wallet+publicKey) : <code>Array.<number></code>
|
|
45
45
|
* [.preExpansionSeed](#module_quantum-coin-js-sdk..Wallet+preExpansionSeed) : <code>Uint8Array</code> \| <code>Array.<number></code> \| <code>null</code>
|
|
46
|
-
* [~BlockDetails](#module_quantum-coin-js-sdk..BlockDetails)
|
|
47
|
-
* [.blockNumber](#module_quantum-coin-js-sdk..BlockDetails+blockNumber) : <code>number</code>
|
|
48
|
-
* [~LatestBlockDetailsResult](#module_quantum-coin-js-sdk..LatestBlockDetailsResult)
|
|
49
|
-
* [.resultCode](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+resultCode) : <code>number</code>
|
|
50
|
-
* [.blockDetails](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+blockDetails) : <code>BlockDetails</code>
|
|
51
|
-
* [.response](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+response) : <code>Object</code>
|
|
52
|
-
* [.requestId](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+requestId) : <code>string</code>
|
|
53
|
-
* [.err](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+err) : <code>Error</code>
|
|
54
|
-
* [~AccountDetails](#module_quantum-coin-js-sdk..AccountDetails)
|
|
55
|
-
* [.address](#module_quantum-coin-js-sdk..AccountDetails+address) : <code>string</code>
|
|
56
|
-
* [.balance](#module_quantum-coin-js-sdk..AccountDetails+balance) : <code>string</code>
|
|
57
|
-
* [.nonce](#module_quantum-coin-js-sdk..AccountDetails+nonce) : <code>number</code>
|
|
58
|
-
* [.blockNumber](#module_quantum-coin-js-sdk..AccountDetails+blockNumber) : <code>number</code>
|
|
59
|
-
* [~AccountDetailsResult](#module_quantum-coin-js-sdk..AccountDetailsResult)
|
|
60
|
-
* [.resultCode](#module_quantum-coin-js-sdk..AccountDetailsResult+resultCode) : <code>number</code>
|
|
61
|
-
* [.accountDetails](#module_quantum-coin-js-sdk..AccountDetailsResult+accountDetails) : <code>AccountDetails</code>
|
|
62
|
-
* [.response](#module_quantum-coin-js-sdk..AccountDetailsResult+response) : <code>Object</code>
|
|
63
|
-
* [.requestId](#module_quantum-coin-js-sdk..AccountDetailsResult+requestId) : <code>string</code>
|
|
64
|
-
* [.err](#module_quantum-coin-js-sdk..AccountDetailsResult+err) : <code>Error</code>
|
|
65
46
|
* [~SignResult](#module_quantum-coin-js-sdk..SignResult)
|
|
66
47
|
* [.resultCode](#module_quantum-coin-js-sdk..SignResult+resultCode) : <code>number</code>
|
|
67
48
|
* [.txnHash](#module_quantum-coin-js-sdk..SignResult+txnHash) : <code>string</code>
|
|
68
49
|
* [.txnData](#module_quantum-coin-js-sdk..SignResult+txnData) : <code>string</code>
|
|
69
|
-
* [~SendResult](#module_quantum-coin-js-sdk..SendResult)
|
|
70
|
-
* [.resultCode](#module_quantum-coin-js-sdk..SendResult+resultCode) : <code>number</code>
|
|
71
|
-
* [.txnHash](#module_quantum-coin-js-sdk..SendResult+txnHash) : <code>string</code>
|
|
72
|
-
* [.response](#module_quantum-coin-js-sdk..SendResult+response) : <code>Object</code>
|
|
73
|
-
* [.requestId](#module_quantum-coin-js-sdk..SendResult+requestId) : <code>string</code>
|
|
74
|
-
* [.err](#module_quantum-coin-js-sdk..SendResult+err) : <code>Error</code>
|
|
75
|
-
* [~TransactionReceipt](#module_quantum-coin-js-sdk..TransactionReceipt)
|
|
76
|
-
* [.cumulativeGasUsed](#module_quantum-coin-js-sdk..TransactionReceipt+cumulativeGasUsed) : <code>string</code>
|
|
77
|
-
* [.effectiveGasPrice](#module_quantum-coin-js-sdk..TransactionReceipt+effectiveGasPrice) : <code>string</code>
|
|
78
|
-
* [.gasUsed](#module_quantum-coin-js-sdk..TransactionReceipt+gasUsed) : <code>string</code>
|
|
79
|
-
* [.status](#module_quantum-coin-js-sdk..TransactionReceipt+status) : <code>string</code>
|
|
80
|
-
* [.hash](#module_quantum-coin-js-sdk..TransactionReceipt+hash) : <code>string</code>
|
|
81
|
-
* [.type](#module_quantum-coin-js-sdk..TransactionReceipt+type) : <code>string</code>
|
|
82
|
-
* [~TransactionDetails](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
83
|
-
* [.blockHash](#module_quantum-coin-js-sdk..TransactionDetails+blockHash) : <code>string</code>
|
|
84
|
-
* [.blockNumber](#module_quantum-coin-js-sdk..TransactionDetails+blockNumber) : <code>number</code>
|
|
85
|
-
* [.from](#module_quantum-coin-js-sdk..TransactionDetails+from) : <code>string</code>
|
|
86
|
-
* [.gas](#module_quantum-coin-js-sdk..TransactionDetails+gas) : <code>string</code>
|
|
87
|
-
* [.gasPrice](#module_quantum-coin-js-sdk..TransactionDetails+gasPrice) : <code>string</code>
|
|
88
|
-
* [.hash](#module_quantum-coin-js-sdk..TransactionDetails+hash) : <code>string</code>
|
|
89
|
-
* [.input](#module_quantum-coin-js-sdk..TransactionDetails+input) : <code>string</code>
|
|
90
|
-
* [.nonce](#module_quantum-coin-js-sdk..TransactionDetails+nonce) : <code>number</code>
|
|
91
|
-
* [.to](#module_quantum-coin-js-sdk..TransactionDetails+to) : <code>string</code>
|
|
92
|
-
* [.value](#module_quantum-coin-js-sdk..TransactionDetails+value) : <code>string</code>
|
|
93
|
-
* [.receipt](#module_quantum-coin-js-sdk..TransactionDetails+receipt) : <code>TransactionReceipt</code>
|
|
94
|
-
* [~TransactionDetailsResult](#module_quantum-coin-js-sdk..TransactionDetailsResult)
|
|
95
|
-
* [.resultCode](#module_quantum-coin-js-sdk..TransactionDetailsResult+resultCode) : <code>number</code>
|
|
96
|
-
* [.transactionDetails](#module_quantum-coin-js-sdk..TransactionDetailsResult+transactionDetails) : <code>TransactionDetails</code>
|
|
97
|
-
* [.response](#module_quantum-coin-js-sdk..TransactionDetailsResult+response) : <code>Object</code>
|
|
98
|
-
* [.requestId](#module_quantum-coin-js-sdk..TransactionDetailsResult+requestId) : <code>string</code>
|
|
99
|
-
* [.err](#module_quantum-coin-js-sdk..TransactionDetailsResult+err) : <code>Error</code>
|
|
100
|
-
* [~AccountTransactionCompact](#module_quantum-coin-js-sdk..AccountTransactionCompact)
|
|
101
|
-
* [.blockNumber](#module_quantum-coin-js-sdk..AccountTransactionCompact+blockNumber) : <code>number</code>
|
|
102
|
-
* [.from](#module_quantum-coin-js-sdk..AccountTransactionCompact+from) : <code>string</code>
|
|
103
|
-
* [.hash](#module_quantum-coin-js-sdk..AccountTransactionCompact+hash) : <code>string</code>
|
|
104
|
-
* [.to](#module_quantum-coin-js-sdk..AccountTransactionCompact+to) : <code>string</code>
|
|
105
|
-
* [.value](#module_quantum-coin-js-sdk..AccountTransactionCompact+value) : <code>string</code>
|
|
106
|
-
* [.status](#module_quantum-coin-js-sdk..AccountTransactionCompact+status) : <code>string</code>
|
|
107
|
-
* [~ListAccountTransactionsResponse](#module_quantum-coin-js-sdk..ListAccountTransactionsResponse)
|
|
108
|
-
* [.pageCount](#module_quantum-coin-js-sdk..ListAccountTransactionsResponse+pageCount) : <code>number</code>
|
|
109
|
-
* [.items](#module_quantum-coin-js-sdk..ListAccountTransactionsResponse+items) : <code>AccountTransactionCompact</code> \| <code>Array</code>
|
|
110
|
-
* [~AccountTransactionsResult](#module_quantum-coin-js-sdk..AccountTransactionsResult)
|
|
111
|
-
* [.resultCode](#module_quantum-coin-js-sdk..AccountTransactionsResult+resultCode) : <code>number</code>
|
|
112
|
-
* [.listAccountTransactionsResponse](#module_quantum-coin-js-sdk..AccountTransactionsResult+listAccountTransactionsResponse) : <code>ListAccountTransactionsResponse</code>
|
|
113
|
-
* [.response](#module_quantum-coin-js-sdk..AccountTransactionsResult+response) : <code>Object</code>
|
|
114
|
-
* [.requestId](#module_quantum-coin-js-sdk..AccountTransactionsResult+requestId) : <code>string</code>
|
|
115
|
-
* [.err](#module_quantum-coin-js-sdk..AccountTransactionsResult+err) : <code>Error</code>
|
|
116
50
|
* [~TransactionSigningRequest](#module_quantum-coin-js-sdk..TransactionSigningRequest)
|
|
117
51
|
* [new TransactionSigningRequest(wallet, toAddress, valueInWei, nonce, data, gasLimit, remarks, chainId, signingContext)](#new_module_quantum-coin-js-sdk..TransactionSigningRequest_new)
|
|
118
52
|
* [.wallet](#module_quantum-coin-js-sdk..TransactionSigningRequest+wallet) : <code>Wallet</code>
|
|
@@ -152,11 +86,6 @@ Example Project: https://github.com/quantumcoinproject/quantum-coin-js-sdk/tree/
|
|
|
152
86
|
* [~verifyWallet(wallet)](#module_quantum-coin-js-sdk..verifyWallet) ⇒ <code>boolean</code>
|
|
153
87
|
* [~serializeWallet(wallet)](#module_quantum-coin-js-sdk..serializeWallet) ⇒ <code>string</code>
|
|
154
88
|
* [~deserializeWallet(walletJson)](#module_quantum-coin-js-sdk..deserializeWallet) ⇒ <code>Wallet</code> \| <code>null</code>
|
|
155
|
-
* [~postTransaction(txnData)](#module_quantum-coin-js-sdk..postTransaction) ⇒ <code>Promise.<SendResult></code>
|
|
156
|
-
* [~getLatestBlockDetails()](#module_quantum-coin-js-sdk..getLatestBlockDetails) ⇒ <code>Promise.<LatestBlockDetailsResult></code>
|
|
157
|
-
* [~getAccountDetails(address)](#module_quantum-coin-js-sdk..getAccountDetails) ⇒ <code>Promise.<AccountDetailsResult></code>
|
|
158
|
-
* [~getTransactionDetails(txnHash)](#module_quantum-coin-js-sdk..getTransactionDetails) ⇒ <code>Promise.<TransactionDetailsResult></code>
|
|
159
|
-
* [~listAccountTransactions(address, pageNumber)](#module_quantum-coin-js-sdk..listAccountTransactions) ⇒ <code>Promise.<AccountTransactionsResult></code>
|
|
160
89
|
* ~~[~signSendCoinTransaction(wallet, toAddress, coins, nonce)](#module_quantum-coin-js-sdk..signSendCoinTransaction) ⇒ <code>Promise.<SignResult></code>~~
|
|
161
90
|
* ~~[~signTransaction(wallet, toAddress, coins, nonce, data)](#module_quantum-coin-js-sdk..signTransaction) ⇒ <code>Promise.<SignResult></code>~~
|
|
162
91
|
* [~hexStringToUint8Array(hex)](#module_quantum-coin-js-sdk..hexStringToUint8Array) ⇒ <code>Uint8Array</code>
|
|
@@ -164,11 +93,16 @@ Example Project: https://github.com/quantumcoinproject/quantum-coin-js-sdk/tree/
|
|
|
164
93
|
* [~getGasPrice(keyType, [fullSign])](#module_quantum-coin-js-sdk..getGasPrice) ⇒ <code>Object</code>
|
|
165
94
|
* [~sign(privateKey, message, [signingContext])](#module_quantum-coin-js-sdk..sign) ⇒ <code>Object</code>
|
|
166
95
|
* [~verify(publicKey, signature, message)](#module_quantum-coin-js-sdk..verify) ⇒ <code>Object</code>
|
|
167
|
-
* ~~[~sendCoins(wallet, toAddress, coins, nonce)](#module_quantum-coin-js-sdk..sendCoins) ⇒ <code>Promise.<SendResult></code>~~
|
|
168
96
|
* [~publicKeyFromSignature(digest, signature)](#module_quantum-coin-js-sdk..publicKeyFromSignature) ⇒ <code>string</code>
|
|
169
97
|
* [~publicKeyFromPrivateKey(privateKey)](#module_quantum-coin-js-sdk..publicKeyFromPrivateKey) ⇒ <code>string</code>
|
|
170
98
|
* [~addressFromPublicKey(publicKey)](#module_quantum-coin-js-sdk..addressFromPublicKey) ⇒ <code>string</code>
|
|
171
99
|
* [~scryptDeriveKey(secret, salt, N, r, p, dkLen)](#module_quantum-coin-js-sdk..scryptDeriveKey) ⇒ <code>Array.<number></code>
|
|
100
|
+
* [~sha256(data)](#module_quantum-coin-js-sdk..sha256) ⇒ <code>Array.<number></code>
|
|
101
|
+
* [~sha512(data)](#module_quantum-coin-js-sdk..sha512) ⇒ <code>Array.<number></code>
|
|
102
|
+
* [~keccak256(data)](#module_quantum-coin-js-sdk..keccak256) ⇒ <code>Array.<number></code>
|
|
103
|
+
* [~ripemd160(data)](#module_quantum-coin-js-sdk..ripemd160) ⇒ <code>Array.<number></code>
|
|
104
|
+
* [~computeHmac(algorithm, key, data)](#module_quantum-coin-js-sdk..computeHmac) ⇒ <code>Array.<number></code>
|
|
105
|
+
* [~pbkdf2(password, salt, iterations, keylen, algorithm)](#module_quantum-coin-js-sdk..pbkdf2) ⇒ <code>Array.<number></code>
|
|
172
106
|
* [~combinePublicKeySignature(publicKey, signature)](#module_quantum-coin-js-sdk..combinePublicKeySignature) ⇒ <code>string</code>
|
|
173
107
|
* [~packMethodData(abiJSON, methodName, ...args)](#module_quantum-coin-js-sdk..packMethodData) ⇒ <code>PackUnpackResult</code>
|
|
174
108
|
* [~unpackMethodData(abiJSON, methodName, hexData)](#module_quantum-coin-js-sdk..unpackMethodData) ⇒ <code>PackUnpackResult</code>
|
|
@@ -183,66 +117,30 @@ Example Project: https://github.com/quantumcoinproject/quantum-coin-js-sdk/tree/
|
|
|
183
117
|
<a name="module_quantum-coin-js-sdk..Config"></a>
|
|
184
118
|
|
|
185
119
|
### quantum-coin-js-sdk~Config
|
|
186
|
-
This is the configuration class required to initialize
|
|
120
|
+
This is the configuration class required to initialize the Quantum Coin SDK for offline operations such as wallet management and transaction signing.
|
|
187
121
|
|
|
188
122
|
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
189
123
|
**Access**: public
|
|
190
124
|
|
|
191
125
|
* [~Config](#module_quantum-coin-js-sdk..Config)
|
|
192
|
-
* [new Config(
|
|
193
|
-
* [.readUrl](#module_quantum-coin-js-sdk..Config+readUrl) : <code>string</code>
|
|
194
|
-
* [.writeUrl](#module_quantum-coin-js-sdk..Config+writeUrl) : <code>string</code>
|
|
126
|
+
* [new Config(chainId)](#new_module_quantum-coin-js-sdk..Config_new)
|
|
195
127
|
* [.chainId](#module_quantum-coin-js-sdk..Config+chainId) : <code>number</code>
|
|
196
|
-
* [.readApiKey](#module_quantum-coin-js-sdk..Config+readApiKey) : <code>string</code>
|
|
197
|
-
* [.writeApiKey](#module_quantum-coin-js-sdk..Config+writeApiKey) : <code>string</code>
|
|
198
128
|
|
|
199
129
|
<a name="new_module_quantum-coin-js-sdk..Config_new"></a>
|
|
200
130
|
|
|
201
|
-
#### new Config(
|
|
131
|
+
#### new Config(chainId)
|
|
202
132
|
Creates a config class
|
|
203
133
|
|
|
204
134
|
|
|
205
135
|
| Param | Type | Description |
|
|
206
136
|
| --- | --- | --- |
|
|
207
|
-
| readUrl | <code>string</code> | The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/main/relay. The following URLs are community maintained. Please use your own relay service. Mainnet: https://sdk.readrelay.quantumcoinapi.com |
|
|
208
|
-
| writeUrl | <code>string</code> | The Write API URL pointing to a write relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/main/relay. The following URLs are community maintained. Please use your own relay service. Mainnet: https://sdk.writerelay.quantumcoinapi.com |
|
|
209
137
|
| chainId | <code>number</code> | The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324. |
|
|
210
|
-
| readApiKey | <code>string</code> | Optional parameter if authorization is enabled for the relay service. API Key for authorization. Defaults to null which indicates no authorization. |
|
|
211
|
-
| writeApiKey | <code>string</code> | Optional parameter if authorization is enabled for the relay service. API Key for authorization. Defaults to null which indicates no authorization. |
|
|
212
|
-
|
|
213
|
-
<a name="module_quantum-coin-js-sdk..Config+readUrl"></a>
|
|
214
138
|
|
|
215
|
-
#### config.readUrl : <code>string</code>
|
|
216
|
-
The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/main/relay
|
|
217
|
-
|
|
218
|
-
**Kind**: instance property of [<code>Config</code>](#module_quantum-coin-js-sdk..Config)
|
|
219
|
-
**Access**: public
|
|
220
|
-
<a name="module_quantum-coin-js-sdk..Config+writeUrl"></a>
|
|
221
|
-
|
|
222
|
-
#### config.writeUrl : <code>string</code>
|
|
223
|
-
The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/main/relay
|
|
224
|
-
|
|
225
|
-
**Kind**: instance property of [<code>Config</code>](#module_quantum-coin-js-sdk..Config)
|
|
226
|
-
**Access**: public
|
|
227
139
|
<a name="module_quantum-coin-js-sdk..Config+chainId"></a>
|
|
228
140
|
|
|
229
141
|
#### config.chainId : <code>number</code>
|
|
230
142
|
The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324.
|
|
231
143
|
|
|
232
|
-
**Kind**: instance property of [<code>Config</code>](#module_quantum-coin-js-sdk..Config)
|
|
233
|
-
**Access**: public
|
|
234
|
-
<a name="module_quantum-coin-js-sdk..Config+readApiKey"></a>
|
|
235
|
-
|
|
236
|
-
#### config.readApiKey : <code>string</code>
|
|
237
|
-
API Key for authorization if authorization is enabled for the relay service. Defaults to null which indicates no authorization.
|
|
238
|
-
|
|
239
|
-
**Kind**: instance property of [<code>Config</code>](#module_quantum-coin-js-sdk..Config)
|
|
240
|
-
**Access**: public
|
|
241
|
-
<a name="module_quantum-coin-js-sdk..Config+writeApiKey"></a>
|
|
242
|
-
|
|
243
|
-
#### config.writeApiKey : <code>string</code>
|
|
244
|
-
API Key for authorization if authorization is enabled for the relay service. Defaults to null which indicates no authorization.
|
|
245
|
-
|
|
246
144
|
**Kind**: instance property of [<code>Config</code>](#module_quantum-coin-js-sdk..Config)
|
|
247
145
|
**Access**: public
|
|
248
146
|
<a name="module_quantum-coin-js-sdk..Wallet"></a>
|
|
@@ -301,162 +199,6 @@ Pre-expansion seed bytes. Can be null if the wallet was not created from a seed.
|
|
|
301
199
|
|
|
302
200
|
**Kind**: instance property of [<code>Wallet</code>](#module_quantum-coin-js-sdk..Wallet)
|
|
303
201
|
**Access**: public
|
|
304
|
-
<a name="module_quantum-coin-js-sdk..BlockDetails"></a>
|
|
305
|
-
|
|
306
|
-
### quantum-coin-js-sdk~BlockDetails
|
|
307
|
-
This class represents a Block.
|
|
308
|
-
|
|
309
|
-
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
310
|
-
**Access**: public
|
|
311
|
-
<a name="module_quantum-coin-js-sdk..BlockDetails+blockNumber"></a>
|
|
312
|
-
|
|
313
|
-
#### blockDetails.blockNumber : <code>number</code>
|
|
314
|
-
Block Number of the block
|
|
315
|
-
|
|
316
|
-
**Kind**: instance property of [<code>BlockDetails</code>](#module_quantum-coin-js-sdk..BlockDetails)
|
|
317
|
-
**Access**: public
|
|
318
|
-
<a name="module_quantum-coin-js-sdk..LatestBlockDetailsResult"></a>
|
|
319
|
-
|
|
320
|
-
### quantum-coin-js-sdk~LatestBlockDetailsResult
|
|
321
|
-
This class represents a result from invoking the getLatestBlock function.
|
|
322
|
-
|
|
323
|
-
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
324
|
-
**Access**: public
|
|
325
|
-
|
|
326
|
-
* [~LatestBlockDetailsResult](#module_quantum-coin-js-sdk..LatestBlockDetailsResult)
|
|
327
|
-
* [.resultCode](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+resultCode) : <code>number</code>
|
|
328
|
-
* [.blockDetails](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+blockDetails) : <code>BlockDetails</code>
|
|
329
|
-
* [.response](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+response) : <code>Object</code>
|
|
330
|
-
* [.requestId](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+requestId) : <code>string</code>
|
|
331
|
-
* [.err](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+err) : <code>Error</code>
|
|
332
|
-
|
|
333
|
-
<a name="module_quantum-coin-js-sdk..LatestBlockDetailsResult+resultCode"></a>
|
|
334
|
-
|
|
335
|
-
#### latestBlockDetailsResult.resultCode : <code>number</code>
|
|
336
|
-
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.
|
|
337
|
-
|
|
338
|
-
**Kind**: instance property of [<code>LatestBlockDetailsResult</code>](#module_quantum-coin-js-sdk..LatestBlockDetailsResult)
|
|
339
|
-
**Access**: public
|
|
340
|
-
<a name="module_quantum-coin-js-sdk..LatestBlockDetailsResult+blockDetails"></a>
|
|
341
|
-
|
|
342
|
-
#### latestBlockDetailsResult.blockDetails : <code>BlockDetails</code>
|
|
343
|
-
An object of type BlockDetails representing the block. This value is null if the value of resultCode is not 0.
|
|
344
|
-
|
|
345
|
-
**Kind**: instance property of [<code>LatestBlockDetailsResult</code>](#module_quantum-coin-js-sdk..LatestBlockDetailsResult)
|
|
346
|
-
**Access**: public
|
|
347
|
-
<a name="module_quantum-coin-js-sdk..LatestBlockDetailsResult+response"></a>
|
|
348
|
-
|
|
349
|
-
#### latestBlockDetailsResult.response : <code>Object</code>
|
|
350
|
-
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.
|
|
351
|
-
|
|
352
|
-
**Kind**: instance property of [<code>LatestBlockDetailsResult</code>](#module_quantum-coin-js-sdk..LatestBlockDetailsResult)
|
|
353
|
-
**Access**: public
|
|
354
|
-
<a name="module_quantum-coin-js-sdk..LatestBlockDetailsResult+requestId"></a>
|
|
355
|
-
|
|
356
|
-
#### latestBlockDetailsResult.requestId : <code>string</code>
|
|
357
|
-
An unique id to represent the request. This can be null if request failed before it could be sent.
|
|
358
|
-
|
|
359
|
-
**Kind**: instance property of [<code>LatestBlockDetailsResult</code>](#module_quantum-coin-js-sdk..LatestBlockDetailsResult)
|
|
360
|
-
**Access**: public
|
|
361
|
-
<a name="module_quantum-coin-js-sdk..LatestBlockDetailsResult+err"></a>
|
|
362
|
-
|
|
363
|
-
#### latestBlockDetailsResult.err : <code>Error</code>
|
|
364
|
-
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.
|
|
365
|
-
|
|
366
|
-
**Kind**: instance property of [<code>LatestBlockDetailsResult</code>](#module_quantum-coin-js-sdk..LatestBlockDetailsResult)
|
|
367
|
-
**Access**: public
|
|
368
|
-
<a name="module_quantum-coin-js-sdk..AccountDetails"></a>
|
|
369
|
-
|
|
370
|
-
### quantum-coin-js-sdk~AccountDetails
|
|
371
|
-
This class represents an Account.
|
|
372
|
-
|
|
373
|
-
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
374
|
-
**Access**: public
|
|
375
|
-
|
|
376
|
-
* [~AccountDetails](#module_quantum-coin-js-sdk..AccountDetails)
|
|
377
|
-
* [.address](#module_quantum-coin-js-sdk..AccountDetails+address) : <code>string</code>
|
|
378
|
-
* [.balance](#module_quantum-coin-js-sdk..AccountDetails+balance) : <code>string</code>
|
|
379
|
-
* [.nonce](#module_quantum-coin-js-sdk..AccountDetails+nonce) : <code>number</code>
|
|
380
|
-
* [.blockNumber](#module_quantum-coin-js-sdk..AccountDetails+blockNumber) : <code>number</code>
|
|
381
|
-
|
|
382
|
-
<a name="module_quantum-coin-js-sdk..AccountDetails+address"></a>
|
|
383
|
-
|
|
384
|
-
#### accountDetails.address : <code>string</code>
|
|
385
|
-
Address of the wallet. Is 66 bytes in length including 0x.
|
|
386
|
-
|
|
387
|
-
**Kind**: instance property of [<code>AccountDetails</code>](#module_quantum-coin-js-sdk..AccountDetails)
|
|
388
|
-
**Access**: public
|
|
389
|
-
<a name="module_quantum-coin-js-sdk..AccountDetails+balance"></a>
|
|
390
|
-
|
|
391
|
-
#### accountDetails.balance : <code>string</code>
|
|
392
|
-
Balance of the account in wei. To convert this to ethers, see https://docs.ethers.org/v4/api-utils.html#ether-strings-and-wei
|
|
393
|
-
|
|
394
|
-
**Kind**: instance property of [<code>AccountDetails</code>](#module_quantum-coin-js-sdk..AccountDetails)
|
|
395
|
-
**Access**: public
|
|
396
|
-
<a name="module_quantum-coin-js-sdk..AccountDetails+nonce"></a>
|
|
397
|
-
|
|
398
|
-
#### accountDetails.nonce : <code>number</code>
|
|
399
|
-
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.
|
|
400
|
-
|
|
401
|
-
**Kind**: instance property of [<code>AccountDetails</code>](#module_quantum-coin-js-sdk..AccountDetails)
|
|
402
|
-
**Access**: public
|
|
403
|
-
<a name="module_quantum-coin-js-sdk..AccountDetails+blockNumber"></a>
|
|
404
|
-
|
|
405
|
-
#### accountDetails.blockNumber : <code>number</code>
|
|
406
|
-
The block number as of which the Account details was retrieved.
|
|
407
|
-
|
|
408
|
-
**Kind**: instance property of [<code>AccountDetails</code>](#module_quantum-coin-js-sdk..AccountDetails)
|
|
409
|
-
**Access**: public
|
|
410
|
-
<a name="module_quantum-coin-js-sdk..AccountDetailsResult"></a>
|
|
411
|
-
|
|
412
|
-
### quantum-coin-js-sdk~AccountDetailsResult
|
|
413
|
-
This class represents a result from invoking the getAccountDetails function.
|
|
414
|
-
|
|
415
|
-
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
416
|
-
**Access**: public
|
|
417
|
-
|
|
418
|
-
* [~AccountDetailsResult](#module_quantum-coin-js-sdk..AccountDetailsResult)
|
|
419
|
-
* [.resultCode](#module_quantum-coin-js-sdk..AccountDetailsResult+resultCode) : <code>number</code>
|
|
420
|
-
* [.accountDetails](#module_quantum-coin-js-sdk..AccountDetailsResult+accountDetails) : <code>AccountDetails</code>
|
|
421
|
-
* [.response](#module_quantum-coin-js-sdk..AccountDetailsResult+response) : <code>Object</code>
|
|
422
|
-
* [.requestId](#module_quantum-coin-js-sdk..AccountDetailsResult+requestId) : <code>string</code>
|
|
423
|
-
* [.err](#module_quantum-coin-js-sdk..AccountDetailsResult+err) : <code>Error</code>
|
|
424
|
-
|
|
425
|
-
<a name="module_quantum-coin-js-sdk..AccountDetailsResult+resultCode"></a>
|
|
426
|
-
|
|
427
|
-
#### accountDetailsResult.resultCode : <code>number</code>
|
|
428
|
-
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.
|
|
429
|
-
|
|
430
|
-
**Kind**: instance property of [<code>AccountDetailsResult</code>](#module_quantum-coin-js-sdk..AccountDetailsResult)
|
|
431
|
-
**Access**: public
|
|
432
|
-
<a name="module_quantum-coin-js-sdk..AccountDetailsResult+accountDetails"></a>
|
|
433
|
-
|
|
434
|
-
#### accountDetailsResult.accountDetails : <code>AccountDetails</code>
|
|
435
|
-
An object of type AccountDetails representing the block. This value is null if the value of resultCode is not 0.
|
|
436
|
-
|
|
437
|
-
**Kind**: instance property of [<code>AccountDetailsResult</code>](#module_quantum-coin-js-sdk..AccountDetailsResult)
|
|
438
|
-
**Access**: public
|
|
439
|
-
<a name="module_quantum-coin-js-sdk..AccountDetailsResult+response"></a>
|
|
440
|
-
|
|
441
|
-
#### accountDetailsResult.response : <code>Object</code>
|
|
442
|
-
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.
|
|
443
|
-
|
|
444
|
-
**Kind**: instance property of [<code>AccountDetailsResult</code>](#module_quantum-coin-js-sdk..AccountDetailsResult)
|
|
445
|
-
**Access**: public
|
|
446
|
-
<a name="module_quantum-coin-js-sdk..AccountDetailsResult+requestId"></a>
|
|
447
|
-
|
|
448
|
-
#### accountDetailsResult.requestId : <code>string</code>
|
|
449
|
-
An unique id to represent the request. This can be null if request failed before it could be sent.
|
|
450
|
-
|
|
451
|
-
**Kind**: instance property of [<code>AccountDetailsResult</code>](#module_quantum-coin-js-sdk..AccountDetailsResult)
|
|
452
|
-
**Access**: public
|
|
453
|
-
<a name="module_quantum-coin-js-sdk..AccountDetailsResult+err"></a>
|
|
454
|
-
|
|
455
|
-
#### accountDetailsResult.err : <code>Error</code>
|
|
456
|
-
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.
|
|
457
|
-
|
|
458
|
-
**Kind**: instance property of [<code>AccountDetailsResult</code>](#module_quantum-coin-js-sdk..AccountDetailsResult)
|
|
459
|
-
**Access**: public
|
|
460
202
|
<a name="module_quantum-coin-js-sdk..SignResult"></a>
|
|
461
203
|
|
|
462
204
|
### quantum-coin-js-sdk~SignResult
|
|
@@ -488,402 +230,11 @@ Hash of the Transaction, to uniquely identify it. Is 66 bytes in length includin
|
|
|
488
230
|
|
|
489
231
|
#### signResult.txnData : <code>string</code>
|
|
490
232
|
A payload representing the signed transaction.
|
|
491
|
-
To actually send a transaction, this payload can then be
|
|
233
|
+
To actually send a transaction, this payload can then be broadcast to the blockchain from a connected device (for example, via a relay or RPC endpoint).
|
|
492
234
|
This value is null if the value of resultCode is not 0.
|
|
493
235
|
|
|
494
236
|
**Kind**: instance property of [<code>SignResult</code>](#module_quantum-coin-js-sdk..SignResult)
|
|
495
237
|
**Access**: public
|
|
496
|
-
<a name="module_quantum-coin-js-sdk..SendResult"></a>
|
|
497
|
-
|
|
498
|
-
### quantum-coin-js-sdk~SendResult
|
|
499
|
-
This class represents a result from invoking the sendCoins function.
|
|
500
|
-
|
|
501
|
-
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
502
|
-
**Access**: public
|
|
503
|
-
|
|
504
|
-
* [~SendResult](#module_quantum-coin-js-sdk..SendResult)
|
|
505
|
-
* [.resultCode](#module_quantum-coin-js-sdk..SendResult+resultCode) : <code>number</code>
|
|
506
|
-
* [.txnHash](#module_quantum-coin-js-sdk..SendResult+txnHash) : <code>string</code>
|
|
507
|
-
* [.response](#module_quantum-coin-js-sdk..SendResult+response) : <code>Object</code>
|
|
508
|
-
* [.requestId](#module_quantum-coin-js-sdk..SendResult+requestId) : <code>string</code>
|
|
509
|
-
* [.err](#module_quantum-coin-js-sdk..SendResult+err) : <code>Error</code>
|
|
510
|
-
|
|
511
|
-
<a name="module_quantum-coin-js-sdk..SendResult+resultCode"></a>
|
|
512
|
-
|
|
513
|
-
#### sendResult.resultCode : <code>number</code>
|
|
514
|
-
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.
|
|
515
|
-
|
|
516
|
-
**Kind**: instance property of [<code>SendResult</code>](#module_quantum-coin-js-sdk..SendResult)
|
|
517
|
-
**Access**: public
|
|
518
|
-
<a name="module_quantum-coin-js-sdk..SendResult+txnHash"></a>
|
|
519
|
-
|
|
520
|
-
#### sendResult.txnHash : <code>string</code>
|
|
521
|
-
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.
|
|
522
|
-
|
|
523
|
-
**Kind**: instance property of [<code>SendResult</code>](#module_quantum-coin-js-sdk..SendResult)
|
|
524
|
-
**Access**: public
|
|
525
|
-
<a name="module_quantum-coin-js-sdk..SendResult+response"></a>
|
|
526
|
-
|
|
527
|
-
#### sendResult.response : <code>Object</code>
|
|
528
|
-
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.
|
|
529
|
-
|
|
530
|
-
**Kind**: instance property of [<code>SendResult</code>](#module_quantum-coin-js-sdk..SendResult)
|
|
531
|
-
**Access**: public
|
|
532
|
-
<a name="module_quantum-coin-js-sdk..SendResult+requestId"></a>
|
|
533
|
-
|
|
534
|
-
#### sendResult.requestId : <code>string</code>
|
|
535
|
-
An unique id to represent the request. This can be null if request failed before it could be sent.
|
|
536
|
-
|
|
537
|
-
**Kind**: instance property of [<code>SendResult</code>](#module_quantum-coin-js-sdk..SendResult)
|
|
538
|
-
**Access**: public
|
|
539
|
-
<a name="module_quantum-coin-js-sdk..SendResult+err"></a>
|
|
540
|
-
|
|
541
|
-
#### sendResult.err : <code>Error</code>
|
|
542
|
-
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.
|
|
543
|
-
|
|
544
|
-
**Kind**: instance property of [<code>SendResult</code>](#module_quantum-coin-js-sdk..SendResult)
|
|
545
|
-
**Access**: public
|
|
546
|
-
<a name="module_quantum-coin-js-sdk..TransactionReceipt"></a>
|
|
547
|
-
|
|
548
|
-
### quantum-coin-js-sdk~TransactionReceipt
|
|
549
|
-
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.
|
|
550
|
-
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).
|
|
551
|
-
|
|
552
|
-
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
553
|
-
**Access**: public
|
|
554
|
-
|
|
555
|
-
* [~TransactionReceipt](#module_quantum-coin-js-sdk..TransactionReceipt)
|
|
556
|
-
* [.cumulativeGasUsed](#module_quantum-coin-js-sdk..TransactionReceipt+cumulativeGasUsed) : <code>string</code>
|
|
557
|
-
* [.effectiveGasPrice](#module_quantum-coin-js-sdk..TransactionReceipt+effectiveGasPrice) : <code>string</code>
|
|
558
|
-
* [.gasUsed](#module_quantum-coin-js-sdk..TransactionReceipt+gasUsed) : <code>string</code>
|
|
559
|
-
* [.status](#module_quantum-coin-js-sdk..TransactionReceipt+status) : <code>string</code>
|
|
560
|
-
* [.hash](#module_quantum-coin-js-sdk..TransactionReceipt+hash) : <code>string</code>
|
|
561
|
-
* [.type](#module_quantum-coin-js-sdk..TransactionReceipt+type) : <code>string</code>
|
|
562
|
-
|
|
563
|
-
<a name="module_quantum-coin-js-sdk..TransactionReceipt+cumulativeGasUsed"></a>
|
|
564
|
-
|
|
565
|
-
#### transactionReceipt.cumulativeGasUsed : <code>string</code>
|
|
566
|
-
A hexadecimal string representing the total amount of gas used when this transaction was executed in the block.
|
|
567
|
-
|
|
568
|
-
**Kind**: instance property of [<code>TransactionReceipt</code>](#module_quantum-coin-js-sdk..TransactionReceipt)
|
|
569
|
-
**Access**: public
|
|
570
|
-
<a name="module_quantum-coin-js-sdk..TransactionReceipt+effectiveGasPrice"></a>
|
|
571
|
-
|
|
572
|
-
#### transactionReceipt.effectiveGasPrice : <code>string</code>
|
|
573
|
-
A hexadecimal string representing the sum of the base fee and tip paid per unit of gas.
|
|
574
|
-
|
|
575
|
-
**Kind**: instance property of [<code>TransactionReceipt</code>](#module_quantum-coin-js-sdk..TransactionReceipt)
|
|
576
|
-
**Access**: public
|
|
577
|
-
<a name="module_quantum-coin-js-sdk..TransactionReceipt+gasUsed"></a>
|
|
578
|
-
|
|
579
|
-
#### transactionReceipt.gasUsed : <code>string</code>
|
|
580
|
-
A hexadecimal string representing the amount of gas used by this specific transaction alone.
|
|
581
|
-
|
|
582
|
-
**Kind**: instance property of [<code>TransactionReceipt</code>](#module_quantum-coin-js-sdk..TransactionReceipt)
|
|
583
|
-
**Access**: public
|
|
584
|
-
<a name="module_quantum-coin-js-sdk..TransactionReceipt+status"></a>
|
|
585
|
-
|
|
586
|
-
#### transactionReceipt.status : <code>string</code>
|
|
587
|
-
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).
|
|
588
|
-
|
|
589
|
-
**Kind**: instance property of [<code>TransactionReceipt</code>](#module_quantum-coin-js-sdk..TransactionReceipt)
|
|
590
|
-
**Access**: public
|
|
591
|
-
<a name="module_quantum-coin-js-sdk..TransactionReceipt+hash"></a>
|
|
592
|
-
|
|
593
|
-
#### transactionReceipt.hash : <code>string</code>
|
|
594
|
-
Hash of the Transaction, to uniquely identify it. Is 66 bytes in length including 0x.
|
|
595
|
-
|
|
596
|
-
**Kind**: instance property of [<code>TransactionReceipt</code>](#module_quantum-coin-js-sdk..TransactionReceipt)
|
|
597
|
-
**Access**: public
|
|
598
|
-
<a name="module_quantum-coin-js-sdk..TransactionReceipt+type"></a>
|
|
599
|
-
|
|
600
|
-
#### transactionReceipt.type : <code>string</code>
|
|
601
|
-
A hexadecimal string representing the transaction type. 0x0 is DefaultFeeTxType.
|
|
602
|
-
|
|
603
|
-
**Kind**: instance property of [<code>TransactionReceipt</code>](#module_quantum-coin-js-sdk..TransactionReceipt)
|
|
604
|
-
**Access**: public
|
|
605
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails"></a>
|
|
606
|
-
|
|
607
|
-
### quantum-coin-js-sdk~TransactionDetails
|
|
608
|
-
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).
|
|
609
|
-
|
|
610
|
-
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
611
|
-
**Access**: public
|
|
612
|
-
|
|
613
|
-
* [~TransactionDetails](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
614
|
-
* [.blockHash](#module_quantum-coin-js-sdk..TransactionDetails+blockHash) : <code>string</code>
|
|
615
|
-
* [.blockNumber](#module_quantum-coin-js-sdk..TransactionDetails+blockNumber) : <code>number</code>
|
|
616
|
-
* [.from](#module_quantum-coin-js-sdk..TransactionDetails+from) : <code>string</code>
|
|
617
|
-
* [.gas](#module_quantum-coin-js-sdk..TransactionDetails+gas) : <code>string</code>
|
|
618
|
-
* [.gasPrice](#module_quantum-coin-js-sdk..TransactionDetails+gasPrice) : <code>string</code>
|
|
619
|
-
* [.hash](#module_quantum-coin-js-sdk..TransactionDetails+hash) : <code>string</code>
|
|
620
|
-
* [.input](#module_quantum-coin-js-sdk..TransactionDetails+input) : <code>string</code>
|
|
621
|
-
* [.nonce](#module_quantum-coin-js-sdk..TransactionDetails+nonce) : <code>number</code>
|
|
622
|
-
* [.to](#module_quantum-coin-js-sdk..TransactionDetails+to) : <code>string</code>
|
|
623
|
-
* [.value](#module_quantum-coin-js-sdk..TransactionDetails+value) : <code>string</code>
|
|
624
|
-
* [.receipt](#module_quantum-coin-js-sdk..TransactionDetails+receipt) : <code>TransactionReceipt</code>
|
|
625
|
-
|
|
626
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails+blockHash"></a>
|
|
627
|
-
|
|
628
|
-
#### transactionDetails.blockHash : <code>string</code>
|
|
629
|
-
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.
|
|
630
|
-
|
|
631
|
-
**Kind**: instance property of [<code>TransactionDetails</code>](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
632
|
-
**Access**: public
|
|
633
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails+blockNumber"></a>
|
|
634
|
-
|
|
635
|
-
#### transactionDetails.blockNumber : <code>number</code>
|
|
636
|
-
The number of the block that registered the transaction. This field can be null if the transaction was not registered in the blockchain.
|
|
637
|
-
|
|
638
|
-
**Kind**: instance property of [<code>TransactionDetails</code>](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
639
|
-
**Access**: public
|
|
640
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails+from"></a>
|
|
641
|
-
|
|
642
|
-
#### transactionDetails.from : <code>string</code>
|
|
643
|
-
A 66 character hexadecimal string representing the address the transaction is sent from.
|
|
644
|
-
|
|
645
|
-
**Kind**: instance property of [<code>TransactionDetails</code>](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
646
|
-
**Access**: public
|
|
647
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails+gas"></a>
|
|
648
|
-
|
|
649
|
-
#### transactionDetails.gas : <code>string</code>
|
|
650
|
-
A hexadecimal string representing the gas provided for the transaction execution.
|
|
651
|
-
|
|
652
|
-
**Kind**: instance property of [<code>TransactionDetails</code>](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
653
|
-
**Access**: public
|
|
654
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails+gasPrice"></a>
|
|
655
|
-
|
|
656
|
-
#### transactionDetails.gasPrice : <code>string</code>
|
|
657
|
-
A hexadecimal string representing the gasPrice used for each paid gas, in Wei.
|
|
658
|
-
|
|
659
|
-
**Kind**: instance property of [<code>TransactionDetails</code>](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
660
|
-
**Access**: public
|
|
661
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails+hash"></a>
|
|
662
|
-
|
|
663
|
-
#### transactionDetails.hash : <code>string</code>
|
|
664
|
-
A 66 character hexadecimal string representing the hash of the transaction.
|
|
665
|
-
|
|
666
|
-
**Kind**: instance property of [<code>TransactionDetails</code>](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
667
|
-
**Access**: public
|
|
668
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails+input"></a>
|
|
669
|
-
|
|
670
|
-
#### transactionDetails.input : <code>string</code>
|
|
671
|
-
A hexadecimal string representing the compiled code of a contract OR the hash of the invoked method signature and encoded parameters.
|
|
672
|
-
|
|
673
|
-
**Kind**: instance property of [<code>TransactionDetails</code>](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
674
|
-
**Access**: public
|
|
675
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails+nonce"></a>
|
|
676
|
-
|
|
677
|
-
#### transactionDetails.nonce : <code>number</code>
|
|
678
|
-
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.
|
|
679
|
-
|
|
680
|
-
**Kind**: instance property of [<code>TransactionDetails</code>](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
681
|
-
**Access**: public
|
|
682
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails+to"></a>
|
|
683
|
-
|
|
684
|
-
#### transactionDetails.to : <code>string</code>
|
|
685
|
-
A 66 character hexadecimal string representing address the transaction is directed to.
|
|
686
|
-
|
|
687
|
-
**Kind**: instance property of [<code>TransactionDetails</code>](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
688
|
-
**Access**: public
|
|
689
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails+value"></a>
|
|
690
|
-
|
|
691
|
-
#### transactionDetails.value : <code>string</code>
|
|
692
|
-
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.
|
|
693
|
-
|
|
694
|
-
**Kind**: instance property of [<code>TransactionDetails</code>](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
695
|
-
**Access**: public
|
|
696
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetails+receipt"></a>
|
|
697
|
-
|
|
698
|
-
#### transactionDetails.receipt : <code>TransactionReceipt</code>
|
|
699
|
-
The receipt of the transaction. This field will be null while the transaction is pending (not yet registered in the blockchain).
|
|
700
|
-
|
|
701
|
-
**Kind**: instance property of [<code>TransactionDetails</code>](#module_quantum-coin-js-sdk..TransactionDetails)
|
|
702
|
-
**Access**: public
|
|
703
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetailsResult"></a>
|
|
704
|
-
|
|
705
|
-
### quantum-coin-js-sdk~TransactionDetailsResult
|
|
706
|
-
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).
|
|
707
|
-
|
|
708
|
-
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
709
|
-
**Access**: public
|
|
710
|
-
|
|
711
|
-
* [~TransactionDetailsResult](#module_quantum-coin-js-sdk..TransactionDetailsResult)
|
|
712
|
-
* [.resultCode](#module_quantum-coin-js-sdk..TransactionDetailsResult+resultCode) : <code>number</code>
|
|
713
|
-
* [.transactionDetails](#module_quantum-coin-js-sdk..TransactionDetailsResult+transactionDetails) : <code>TransactionDetails</code>
|
|
714
|
-
* [.response](#module_quantum-coin-js-sdk..TransactionDetailsResult+response) : <code>Object</code>
|
|
715
|
-
* [.requestId](#module_quantum-coin-js-sdk..TransactionDetailsResult+requestId) : <code>string</code>
|
|
716
|
-
* [.err](#module_quantum-coin-js-sdk..TransactionDetailsResult+err) : <code>Error</code>
|
|
717
|
-
|
|
718
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetailsResult+resultCode"></a>
|
|
719
|
-
|
|
720
|
-
#### transactionDetailsResult.resultCode : <code>number</code>
|
|
721
|
-
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.
|
|
722
|
-
|
|
723
|
-
**Kind**: instance property of [<code>TransactionDetailsResult</code>](#module_quantum-coin-js-sdk..TransactionDetailsResult)
|
|
724
|
-
**Access**: public
|
|
725
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetailsResult+transactionDetails"></a>
|
|
726
|
-
|
|
727
|
-
#### transactionDetailsResult.transactionDetails : <code>TransactionDetails</code>
|
|
728
|
-
An object of type TransactionDetails representing the transaction. This value is null if the value of resultCode is not 0.
|
|
729
|
-
|
|
730
|
-
**Kind**: instance property of [<code>TransactionDetailsResult</code>](#module_quantum-coin-js-sdk..TransactionDetailsResult)
|
|
731
|
-
**Access**: public
|
|
732
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetailsResult+response"></a>
|
|
733
|
-
|
|
734
|
-
#### transactionDetailsResult.response : <code>Object</code>
|
|
735
|
-
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.
|
|
736
|
-
|
|
737
|
-
**Kind**: instance property of [<code>TransactionDetailsResult</code>](#module_quantum-coin-js-sdk..TransactionDetailsResult)
|
|
738
|
-
**Access**: public
|
|
739
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetailsResult+requestId"></a>
|
|
740
|
-
|
|
741
|
-
#### transactionDetailsResult.requestId : <code>string</code>
|
|
742
|
-
An unique id to represent the request. This can be null if request failed before it could be sent.
|
|
743
|
-
|
|
744
|
-
**Kind**: instance property of [<code>TransactionDetailsResult</code>](#module_quantum-coin-js-sdk..TransactionDetailsResult)
|
|
745
|
-
**Access**: public
|
|
746
|
-
<a name="module_quantum-coin-js-sdk..TransactionDetailsResult+err"></a>
|
|
747
|
-
|
|
748
|
-
#### transactionDetailsResult.err : <code>Error</code>
|
|
749
|
-
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.
|
|
750
|
-
|
|
751
|
-
**Kind**: instance property of [<code>TransactionDetailsResult</code>](#module_quantum-coin-js-sdk..TransactionDetailsResult)
|
|
752
|
-
**Access**: public
|
|
753
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionCompact"></a>
|
|
754
|
-
|
|
755
|
-
### quantum-coin-js-sdk~AccountTransactionCompact
|
|
756
|
-
This class represents a transaction of an account. You should consider the transaction as succeeded only if the status field is 0x1 (success).
|
|
757
|
-
|
|
758
|
-
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
759
|
-
**Access**: public
|
|
760
|
-
|
|
761
|
-
* [~AccountTransactionCompact](#module_quantum-coin-js-sdk..AccountTransactionCompact)
|
|
762
|
-
* [.blockNumber](#module_quantum-coin-js-sdk..AccountTransactionCompact+blockNumber) : <code>number</code>
|
|
763
|
-
* [.from](#module_quantum-coin-js-sdk..AccountTransactionCompact+from) : <code>string</code>
|
|
764
|
-
* [.hash](#module_quantum-coin-js-sdk..AccountTransactionCompact+hash) : <code>string</code>
|
|
765
|
-
* [.to](#module_quantum-coin-js-sdk..AccountTransactionCompact+to) : <code>string</code>
|
|
766
|
-
* [.value](#module_quantum-coin-js-sdk..AccountTransactionCompact+value) : <code>string</code>
|
|
767
|
-
* [.status](#module_quantum-coin-js-sdk..AccountTransactionCompact+status) : <code>string</code>
|
|
768
|
-
|
|
769
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionCompact+blockNumber"></a>
|
|
770
|
-
|
|
771
|
-
#### accountTransactionCompact.blockNumber : <code>number</code>
|
|
772
|
-
The number of the block that registered the transaction. This field can be null if the transaction was not registered in the blockchain.
|
|
773
|
-
|
|
774
|
-
**Kind**: instance property of [<code>AccountTransactionCompact</code>](#module_quantum-coin-js-sdk..AccountTransactionCompact)
|
|
775
|
-
**Access**: public
|
|
776
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionCompact+from"></a>
|
|
777
|
-
|
|
778
|
-
#### accountTransactionCompact.from : <code>string</code>
|
|
779
|
-
A 66 character hexadecimal string representing the address the transaction is sent from.
|
|
780
|
-
|
|
781
|
-
**Kind**: instance property of [<code>AccountTransactionCompact</code>](#module_quantum-coin-js-sdk..AccountTransactionCompact)
|
|
782
|
-
**Access**: public
|
|
783
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionCompact+hash"></a>
|
|
784
|
-
|
|
785
|
-
#### accountTransactionCompact.hash : <code>string</code>
|
|
786
|
-
A 66 character hexadecimal string representing the hash of the transaction.
|
|
787
|
-
|
|
788
|
-
**Kind**: instance property of [<code>AccountTransactionCompact</code>](#module_quantum-coin-js-sdk..AccountTransactionCompact)
|
|
789
|
-
**Access**: public
|
|
790
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionCompact+to"></a>
|
|
791
|
-
|
|
792
|
-
#### accountTransactionCompact.to : <code>string</code>
|
|
793
|
-
A 66 character hexadecimal string representing address the transaction is directed to.
|
|
794
|
-
|
|
795
|
-
**Kind**: instance property of [<code>AccountTransactionCompact</code>](#module_quantum-coin-js-sdk..AccountTransactionCompact)
|
|
796
|
-
**Access**: public
|
|
797
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionCompact+value"></a>
|
|
798
|
-
|
|
799
|
-
#### accountTransactionCompact.value : <code>string</code>
|
|
800
|
-
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.
|
|
801
|
-
|
|
802
|
-
**Kind**: instance property of [<code>AccountTransactionCompact</code>](#module_quantum-coin-js-sdk..AccountTransactionCompact)
|
|
803
|
-
**Access**: public
|
|
804
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionCompact+status"></a>
|
|
805
|
-
|
|
806
|
-
#### accountTransactionCompact.status : <code>string</code>
|
|
807
|
-
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).
|
|
808
|
-
|
|
809
|
-
**Kind**: instance property of [<code>AccountTransactionCompact</code>](#module_quantum-coin-js-sdk..AccountTransactionCompact)
|
|
810
|
-
**Access**: public
|
|
811
|
-
<a name="module_quantum-coin-js-sdk..ListAccountTransactionsResponse"></a>
|
|
812
|
-
|
|
813
|
-
### quantum-coin-js-sdk~ListAccountTransactionsResponse
|
|
814
|
-
This class represents a list of account transactions returned by the listAccountTransactionDetails function.
|
|
815
|
-
|
|
816
|
-
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
817
|
-
**Access**: public
|
|
818
|
-
|
|
819
|
-
* [~ListAccountTransactionsResponse](#module_quantum-coin-js-sdk..ListAccountTransactionsResponse)
|
|
820
|
-
* [.pageCount](#module_quantum-coin-js-sdk..ListAccountTransactionsResponse+pageCount) : <code>number</code>
|
|
821
|
-
* [.items](#module_quantum-coin-js-sdk..ListAccountTransactionsResponse+items) : <code>AccountTransactionCompact</code> \| <code>Array</code>
|
|
822
|
-
|
|
823
|
-
<a name="module_quantum-coin-js-sdk..ListAccountTransactionsResponse+pageCount"></a>
|
|
824
|
-
|
|
825
|
-
#### listAccountTransactionsResponse.pageCount : <code>number</code>
|
|
826
|
-
The number of pages available for listing.
|
|
827
|
-
|
|
828
|
-
**Kind**: instance property of [<code>ListAccountTransactionsResponse</code>](#module_quantum-coin-js-sdk..ListAccountTransactionsResponse)
|
|
829
|
-
**Access**: public
|
|
830
|
-
<a name="module_quantum-coin-js-sdk..ListAccountTransactionsResponse+items"></a>
|
|
831
|
-
|
|
832
|
-
#### listAccountTransactionsResponse.items : <code>AccountTransactionCompact</code> \| <code>Array</code>
|
|
833
|
-
An array of type AccountTransactionCompact, containing the list of transactions. Can be null if no items are available.
|
|
834
|
-
|
|
835
|
-
**Kind**: instance property of [<code>ListAccountTransactionsResponse</code>](#module_quantum-coin-js-sdk..ListAccountTransactionsResponse)
|
|
836
|
-
**Access**: public
|
|
837
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionsResult"></a>
|
|
838
|
-
|
|
839
|
-
### quantum-coin-js-sdk~AccountTransactionsResult
|
|
840
|
-
This class represents a result from invoking the listAccountTransactionDetails function.
|
|
841
|
-
|
|
842
|
-
**Kind**: inner class of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
843
|
-
**Access**: public
|
|
844
|
-
|
|
845
|
-
* [~AccountTransactionsResult](#module_quantum-coin-js-sdk..AccountTransactionsResult)
|
|
846
|
-
* [.resultCode](#module_quantum-coin-js-sdk..AccountTransactionsResult+resultCode) : <code>number</code>
|
|
847
|
-
* [.listAccountTransactionsResponse](#module_quantum-coin-js-sdk..AccountTransactionsResult+listAccountTransactionsResponse) : <code>ListAccountTransactionsResponse</code>
|
|
848
|
-
* [.response](#module_quantum-coin-js-sdk..AccountTransactionsResult+response) : <code>Object</code>
|
|
849
|
-
* [.requestId](#module_quantum-coin-js-sdk..AccountTransactionsResult+requestId) : <code>string</code>
|
|
850
|
-
* [.err](#module_quantum-coin-js-sdk..AccountTransactionsResult+err) : <code>Error</code>
|
|
851
|
-
|
|
852
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionsResult+resultCode"></a>
|
|
853
|
-
|
|
854
|
-
#### accountTransactionsResult.resultCode : <code>number</code>
|
|
855
|
-
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.
|
|
856
|
-
|
|
857
|
-
**Kind**: instance property of [<code>AccountTransactionsResult</code>](#module_quantum-coin-js-sdk..AccountTransactionsResult)
|
|
858
|
-
**Access**: public
|
|
859
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionsResult+listAccountTransactionsResponse"></a>
|
|
860
|
-
|
|
861
|
-
#### accountTransactionsResult.listAccountTransactionsResponse : <code>ListAccountTransactionsResponse</code>
|
|
862
|
-
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.
|
|
863
|
-
|
|
864
|
-
**Kind**: instance property of [<code>AccountTransactionsResult</code>](#module_quantum-coin-js-sdk..AccountTransactionsResult)
|
|
865
|
-
**Access**: public
|
|
866
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionsResult+response"></a>
|
|
867
|
-
|
|
868
|
-
#### accountTransactionsResult.response : <code>Object</code>
|
|
869
|
-
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.
|
|
870
|
-
|
|
871
|
-
**Kind**: instance property of [<code>AccountTransactionsResult</code>](#module_quantum-coin-js-sdk..AccountTransactionsResult)
|
|
872
|
-
**Access**: public
|
|
873
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionsResult+requestId"></a>
|
|
874
|
-
|
|
875
|
-
#### accountTransactionsResult.requestId : <code>string</code>
|
|
876
|
-
An unique id to represent the request. This can be null if request failed before it could be sent.
|
|
877
|
-
|
|
878
|
-
**Kind**: instance property of [<code>AccountTransactionsResult</code>](#module_quantum-coin-js-sdk..AccountTransactionsResult)
|
|
879
|
-
**Access**: public
|
|
880
|
-
<a name="module_quantum-coin-js-sdk..AccountTransactionsResult+err"></a>
|
|
881
|
-
|
|
882
|
-
#### accountTransactionsResult.err : <code>Error</code>
|
|
883
|
-
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.
|
|
884
|
-
|
|
885
|
-
**Kind**: instance property of [<code>AccountTransactionsResult</code>](#module_quantum-coin-js-sdk..AccountTransactionsResult)
|
|
886
|
-
**Access**: public
|
|
887
238
|
<a name="module_quantum-coin-js-sdk..TransactionSigningRequest"></a>
|
|
888
239
|
|
|
889
240
|
### quantum-coin-js-sdk~TransactionSigningRequest
|
|
@@ -1306,74 +657,6 @@ The deserializeWallet function creates a Wallet object from a JSON string.
|
|
|
1306
657
|
| --- | --- | --- |
|
|
1307
658
|
| walletJson | <code>string</code> | A JSON string representing the wallet to deserialize. |
|
|
1308
659
|
|
|
1309
|
-
<a name="module_quantum-coin-js-sdk..postTransaction"></a>
|
|
1310
|
-
|
|
1311
|
-
### quantum-coin-js-sdk~postTransaction(txnData) ⇒ <code>Promise.<SendResult></code>
|
|
1312
|
-
The postTransaction function posts a signed transaction to the blockchain.
|
|
1313
|
-
This method can be used in conjunction with the signSendCoinTransaction method to submit a transaction that was signed using a cold wallet (offline or disconnected or air-gapped wallet).
|
|
1314
|
-
|
|
1315
|
-
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
1316
|
-
**Returns**: <code>Promise.<SendResult></code> - Returns a promise of type SendResult. txnHash will be null in SendResult.
|
|
1317
|
-
|
|
1318
|
-
| Param | Type | Description |
|
|
1319
|
-
| --- | --- | --- |
|
|
1320
|
-
| txnData | <code>string</code> | A signed transaction string returned by the signSendCoinTransaction function. |
|
|
1321
|
-
|
|
1322
|
-
<a name="module_quantum-coin-js-sdk..getLatestBlockDetails"></a>
|
|
1323
|
-
|
|
1324
|
-
### quantum-coin-js-sdk~getLatestBlockDetails() ⇒ <code>Promise.<LatestBlockDetailsResult></code>
|
|
1325
|
-
The getLatestBlockDetails function returns details of the latest block of the blockchain.
|
|
1326
|
-
|
|
1327
|
-
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
1328
|
-
**Returns**: <code>Promise.<LatestBlockDetailsResult></code> - Returns a promise of an object of type LatestBlockDetailsResult.
|
|
1329
|
-
<a name="module_quantum-coin-js-sdk..getAccountDetails"></a>
|
|
1330
|
-
|
|
1331
|
-
### quantum-coin-js-sdk~getAccountDetails(address) ⇒ <code>Promise.<AccountDetailsResult></code>
|
|
1332
|
-
The getAccountDetails function returns details of an account corresponding to the address.
|
|
1333
|
-
|
|
1334
|
-
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
1335
|
-
**Returns**: <code>Promise.<AccountDetailsResult></code> - Returns a promise of type AccountDetailsResult.
|
|
1336
|
-
|
|
1337
|
-
| Param | Type | Description |
|
|
1338
|
-
| --- | --- | --- |
|
|
1339
|
-
| address | <code>string</code> | The address of the account of which the details have to be retrieved. |
|
|
1340
|
-
|
|
1341
|
-
<a name="module_quantum-coin-js-sdk..getTransactionDetails"></a>
|
|
1342
|
-
|
|
1343
|
-
### quantum-coin-js-sdk~getTransactionDetails(txnHash) ⇒ <code>Promise.<TransactionDetailsResult></code>
|
|
1344
|
-
The getTransactionDetails function returns details of a transaction posted to the blockchain.
|
|
1345
|
-
Transactions may take a while to get registered in the blockchain. After a transaction is submitted, it may take a while before it is available for reading.
|
|
1346
|
-
Some transactions that have lower balance than the minimum required for gas fees may be discarded.
|
|
1347
|
-
In these cases, the transactions may not be returned when invoking the getTransactionDetails function.
|
|
1348
|
-
You should consider the transaction as succeeded only if the status field of the transactionReceipt object is 0x1 (success).
|
|
1349
|
-
The transactionReceipt field can be null unless the transaction is registered with the blockchain.
|
|
1350
|
-
|
|
1351
|
-
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
1352
|
-
**Returns**: <code>Promise.<TransactionDetailsResult></code> - Returns a promise of type TransactionDetailsResult.
|
|
1353
|
-
|
|
1354
|
-
| Param | Type | Description |
|
|
1355
|
-
| --- | --- | --- |
|
|
1356
|
-
| txnHash | <code>string</code> | The hash of the transaction to retrieve. |
|
|
1357
|
-
|
|
1358
|
-
<a name="module_quantum-coin-js-sdk..listAccountTransactions"></a>
|
|
1359
|
-
|
|
1360
|
-
### quantum-coin-js-sdk~listAccountTransactions(address, pageNumber) ⇒ <code>Promise.<AccountTransactionsResult></code>
|
|
1361
|
-
The listAccountTransactions function returns a list of transactions for a specific account.
|
|
1362
|
-
Transactions may take a while to get registered in the blockchain. After a transaction is submitted, it may take a while before it is available for listing.
|
|
1363
|
-
Some transactions that have lower balance than the minimum required for gas fees may be discarded.
|
|
1364
|
-
In these cases, the transactions may not be returned when invoking the listAccountTransactions function.
|
|
1365
|
-
You should consider the transaction as succeeded only if the status field of the AccountTransactionCompact object is 0x1 (success).
|
|
1366
|
-
Both transactions from and transactions to the address will be returned in the list.
|
|
1367
|
-
Use the getTransactionDetails function, passing the hash of the transaction to get detailed information about the transaction.
|
|
1368
|
-
|
|
1369
|
-
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
1370
|
-
**Returns**: <code>Promise.<AccountTransactionsResult></code> - Returns a promise of type AccountTransactionsResult.
|
|
1371
|
-
|
|
1372
|
-
| Param | Type | Description |
|
|
1373
|
-
| --- | --- | --- |
|
|
1374
|
-
| address | <code>string</code> | The address for which the transactions have to be listed. |
|
|
1375
|
-
| pageNumber | <code>number</code> | The page number for which the transactions has to be listed for the account. Pass 0 to list the latest page. Pass 1 to list the oldest page. A maximum of 20 transactions are returned in each page. The response of this API includes a field that shows the pageCount (total number of pages available). You can pass any number between 1 to pageCount to get the corresponding page. |
|
|
1376
|
-
|
|
1377
660
|
<a name="module_quantum-coin-js-sdk..signSendCoinTransaction"></a>
|
|
1378
661
|
|
|
1379
662
|
### ~~quantum-coin-js-sdk~signSendCoinTransaction(wallet, toAddress, coins, nonce) ⇒ <code>Promise.<SignResult></code>~~
|
|
@@ -1381,8 +664,8 @@ Use the getTransactionDetails function, passing the hash of the transaction to g
|
|
|
1381
664
|
|
|
1382
665
|
The signSendCoinTransaction function returns a signed transaction. The chainId used for signing should be provided in the initialize() function.
|
|
1383
666
|
Since the gas fee for sending coins is fixed at 1000 coins, there is no option to set the gas fee explicitly.
|
|
1384
|
-
This function is useful for offline (cold storage) wallets, where you can sign a transaction offline and then
|
|
1385
|
-
Another usecase for this function is when you want to first store a signed transaction to a database, then queue it and finally
|
|
667
|
+
This function is useful for offline (cold storage) wallets, where you can sign a transaction offline and then broadcast it from a connected device (for example, via a relay or RPC endpoint).
|
|
668
|
+
Another usecase for this function is when you want to first store a signed transaction to a database, then queue it and finally broadcast the transaction from a connected device.
|
|
1386
669
|
|
|
1387
670
|
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
1388
671
|
**Returns**: <code>Promise.<SignResult></code> - Returns a promise of type SignResult.
|
|
@@ -1392,7 +675,7 @@ Another usecase for this function is when you want to first store a signed trans
|
|
|
1392
675
|
| wallet | <code>Wallet</code> | A Wallet object from which the transaction has to be sent. The address corresponding to the Wallet should have enough coins to cover gas fees as well. A minimum of 1000 coins (1000000000000000000000 wei) are required for gas fees. |
|
|
1393
676
|
| toAddress | <code>string</code> | The address to which the coins should be sent. |
|
|
1394
677
|
| coins | <code>string</code> | The string representing the number of coins (in ether) to send. To convert between ethers and wei, see https://docs.ethers.org/v4/api-utils.html#ether-strings-and-wei |
|
|
1395
|
-
| nonce | <code>number</code> |
|
|
678
|
+
| nonce | <code>number</code> | A monotonically increasing number representing the nonce of the account. You have to carefully manage the state of the nonce to avoid sending the coins multiple times, such as when retrying after an error. |
|
|
1396
679
|
|
|
1397
680
|
<a name="module_quantum-coin-js-sdk..signTransaction"></a>
|
|
1398
681
|
|
|
@@ -1401,8 +684,8 @@ Another usecase for this function is when you want to first store a signed trans
|
|
|
1401
684
|
|
|
1402
685
|
The signTransaction function returns a signed transaction. The chainId used for signing should be provided in the initialize() function.
|
|
1403
686
|
Since the gas fee for sending coins is fixed at 1000 coins, there is no option to set the gas fee explicitly.
|
|
1404
|
-
This function is useful for offline (cold storage) wallets, where you can sign a transaction offline and then
|
|
1405
|
-
Another usecase for this function is when you want to first store a signed transaction to a database, then queue it and finally
|
|
687
|
+
This function is useful for offline (cold storage) wallets, where you can sign a transaction offline and then broadcast it from a connected device (for example, via a relay or RPC endpoint).
|
|
688
|
+
Another usecase for this function is when you want to first store a signed transaction to a database, then queue it and finally broadcast the transaction from a connected device.
|
|
1406
689
|
|
|
1407
690
|
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
1408
691
|
**Returns**: <code>Promise.<SignResult></code> - Returns a promise of type SignResult.
|
|
@@ -1412,7 +695,7 @@ Another usecase for this function is when you want to first store a signed trans
|
|
|
1412
695
|
| wallet | <code>Wallet</code> | A Wallet object from which the transaction has to be sent. The address corresponding to the Wallet should have enough coins to cover gas fees as well. A minimum of 1000 coins (1000000000000000000000 wei) are required for gas fees. |
|
|
1413
696
|
| toAddress | <code>string</code> | The address to which the coins should be sent. |
|
|
1414
697
|
| coins | <code>string</code> | The string representing the number of coins (in ether) to send. To convert between ethers and wei, see https://docs.ethers.org/v4/api-utils.html#ether-strings-and-wei |
|
|
1415
|
-
| nonce | <code>number</code> |
|
|
698
|
+
| nonce | <code>number</code> | A monotonically increasing number representing the nonce of the account. You have to carefully manage the state of the nonce to avoid sending the coins multiple times, such as when retrying after an error. |
|
|
1416
699
|
| data | <code>string</code> | Ignored. This parameter is accepted but not used. Use signRawTransaction to pass contract data. |
|
|
1417
700
|
|
|
1418
701
|
<a name="module_quantum-coin-js-sdk..hexStringToUint8Array"></a>
|
|
@@ -1434,8 +717,8 @@ The signRawTransaction function returns a signed transaction. The chainId used f
|
|
|
1434
717
|
With this function, you can set the gasLimit explicitly compared to signTransaction.
|
|
1435
718
|
You can also pass data to be signed, such as when creating or invoking a smart contract.
|
|
1436
719
|
Since the gas fee is fixed at 1000 coins for 21000 units of gas, there is no option to set the gas fee explicitly.
|
|
1437
|
-
This function is useful for offline (cold storage) wallets, where you can sign a transaction offline and then
|
|
1438
|
-
Another usecase for this function is when you want to first store a signed transaction to a database, then queue it and finally
|
|
720
|
+
This function is useful for offline (cold storage) wallets, where you can sign a transaction offline and then broadcast it from a connected device (for example, via a relay or RPC endpoint).
|
|
721
|
+
Another usecase for this function is when you want to first store a signed transaction to a database, then queue it and finally broadcast the transaction from a connected device.
|
|
1439
722
|
|
|
1440
723
|
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
1441
724
|
**Returns**: <code>SignResult</code> - Returns a promise of type SignResult.
|
|
@@ -1485,26 +768,6 @@ Verify a signature over a message with a public key. Algorithm is determined by
|
|
|
1485
768
|
| signature | <code>Array.<number></code> \| <code>Uint8Array</code> | Signature bytes from sign(); first byte selects verify function (1-5). |
|
|
1486
769
|
| message | <code>Array.<number></code> \| <code>Uint8Array</code> | Message bytes (same as passed to sign). |
|
|
1487
770
|
|
|
1488
|
-
<a name="module_quantum-coin-js-sdk..sendCoins"></a>
|
|
1489
|
-
|
|
1490
|
-
### ~~quantum-coin-js-sdk~sendCoins(wallet, toAddress, coins, nonce) ⇒ <code>Promise.<SendResult></code>~~
|
|
1491
|
-
***Use signRawTransaction and postTransaction instead.***
|
|
1492
|
-
|
|
1493
|
-
The sendCoins function posts a send-coin transaction to the blockchain. The chainId used for signing should be provided in the initialize() function.
|
|
1494
|
-
Since the gas fee for sending coins is fixed at 1000 coins, there is no option to set the gas fee explicitly.
|
|
1495
|
-
It may take many seconds after submitting a transaction before the transaction is returned by the getTransactionDetails function.
|
|
1496
|
-
Transactions are usually committed in less than 30 seconds.
|
|
1497
|
-
|
|
1498
|
-
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
1499
|
-
**Returns**: <code>Promise.<SendResult></code> - Returns a promise of type SendResult.
|
|
1500
|
-
|
|
1501
|
-
| Param | Type | Description |
|
|
1502
|
-
| --- | --- | --- |
|
|
1503
|
-
| wallet | <code>Wallet</code> | A Wallet object from which the transaction has to be sent. The address corresponding to the Wallet should have enough coins to cover gas fees as well. A minimum of 1000 coins (1000000000000000000000 wei) are required for gas fees. |
|
|
1504
|
-
| toAddress | <code>string</code> | The address to which the coins should be sent. |
|
|
1505
|
-
| coins | <code>string</code> | The string representing the number of coins (in ether) to send. To convert between ethers and wei, see https://docs.ethers.org/v4/api-utils.html#ether-strings-and-wei |
|
|
1506
|
-
| nonce | <code>number</code> | The nonce of the account retrieved by invoking the getAccountDetails function. You have to carefully manage state of the nonce to avoid sending the coins multiple times, such as when retrying sendCoins after a network error. |
|
|
1507
|
-
|
|
1508
771
|
<a name="module_quantum-coin-js-sdk..publicKeyFromSignature"></a>
|
|
1509
772
|
|
|
1510
773
|
### quantum-coin-js-sdk~publicKeyFromSignature(digest, signature) ⇒ <code>string</code>
|
|
@@ -1547,19 +810,97 @@ The addressFromPublicKey returns the address corresponding to the public key.
|
|
|
1547
810
|
### quantum-coin-js-sdk~scryptDeriveKey(secret, salt, N, r, p, dkLen) ⇒ <code>Array.<number></code>
|
|
1548
811
|
The scryptDeriveKey function derives a key from a secret and salt using the scrypt KDF.
|
|
1549
812
|
|
|
1550
|
-
|
|
813
|
+
Arbitrary scrypt parameters are supported. The classic set N=262144, r=8, p=1, dkLen=32 remains fully supported and byte-for-byte compatible with previous versions.
|
|
814
|
+
|
|
815
|
+
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
816
|
+
**Returns**: <code>Array.<number></code> - - Returns the derived key as a byte array. Returns -1000 before initialize(), or null if the operation failed or the parameters are invalid.
|
|
817
|
+
|
|
818
|
+
| Param | Type | Description |
|
|
819
|
+
| --- | --- | --- |
|
|
820
|
+
| secret | <code>string</code> \| <code>Uint8Array</code> \| <code>Array.<number></code> | The secret/passphrase. A string is encoded as UTF-8 bytes. |
|
|
821
|
+
| salt | <code>Uint8Array</code> \| <code>Array.<number></code> | The salt as a byte array. |
|
|
822
|
+
| N | <code>number</code> | The scrypt CPU/memory cost parameter (power of two, > 1). |
|
|
823
|
+
| r | <code>number</code> | The scrypt block size parameter. |
|
|
824
|
+
| p | <code>number</code> | The scrypt parallelization parameter. |
|
|
825
|
+
| dkLen | <code>number</code> | The derived key length in bytes. |
|
|
826
|
+
|
|
827
|
+
<a name="module_quantum-coin-js-sdk..sha256"></a>
|
|
828
|
+
|
|
829
|
+
### quantum-coin-js-sdk~sha256(data) ⇒ <code>Array.<number></code>
|
|
830
|
+
The sha256 function computes the SHA-256 digest of the input.
|
|
831
|
+
|
|
832
|
+
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
833
|
+
**Returns**: <code>Array.<number></code> - - The 32-byte digest as a byte array. Returns -1000 before initialize(), or null on invalid input.
|
|
834
|
+
|
|
835
|
+
| Param | Type | Description |
|
|
836
|
+
| --- | --- | --- |
|
|
837
|
+
| data | <code>string</code> \| <code>Uint8Array</code> \| <code>Array.<number></code> | The data to hash (string -> UTF-8 bytes). |
|
|
838
|
+
|
|
839
|
+
<a name="module_quantum-coin-js-sdk..sha512"></a>
|
|
840
|
+
|
|
841
|
+
### quantum-coin-js-sdk~sha512(data) ⇒ <code>Array.<number></code>
|
|
842
|
+
The sha512 function computes the SHA-512 digest of the input.
|
|
843
|
+
|
|
844
|
+
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
845
|
+
**Returns**: <code>Array.<number></code> - - The 64-byte digest as a byte array. Returns -1000 before initialize(), or null on invalid input.
|
|
846
|
+
|
|
847
|
+
| Param | Type | Description |
|
|
848
|
+
| --- | --- | --- |
|
|
849
|
+
| data | <code>string</code> \| <code>Uint8Array</code> \| <code>Array.<number></code> | The data to hash (string -> UTF-8 bytes). |
|
|
850
|
+
|
|
851
|
+
<a name="module_quantum-coin-js-sdk..keccak256"></a>
|
|
852
|
+
|
|
853
|
+
### quantum-coin-js-sdk~keccak256(data) ⇒ <code>Array.<number></code>
|
|
854
|
+
The keccak256 function computes the Keccak-256 digest of the input. This is the Ethereum-style Keccak-256 (legacy padding), not SHA3-256.
|
|
855
|
+
|
|
856
|
+
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
857
|
+
**Returns**: <code>Array.<number></code> - - The 32-byte digest as a byte array. Returns -1000 before initialize(), or null on invalid input.
|
|
858
|
+
|
|
859
|
+
| Param | Type | Description |
|
|
860
|
+
| --- | --- | --- |
|
|
861
|
+
| data | <code>string</code> \| <code>Uint8Array</code> \| <code>Array.<number></code> | The data to hash (string -> UTF-8 bytes). |
|
|
862
|
+
|
|
863
|
+
<a name="module_quantum-coin-js-sdk..ripemd160"></a>
|
|
864
|
+
|
|
865
|
+
### quantum-coin-js-sdk~ripemd160(data) ⇒ <code>Array.<number></code>
|
|
866
|
+
The ripemd160 function computes the RIPEMD-160 digest of the input.
|
|
867
|
+
|
|
868
|
+
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
869
|
+
**Returns**: <code>Array.<number></code> - - The 20-byte digest as a byte array. Returns -1000 before initialize(), or null on invalid input.
|
|
870
|
+
|
|
871
|
+
| Param | Type | Description |
|
|
872
|
+
| --- | --- | --- |
|
|
873
|
+
| data | <code>string</code> \| <code>Uint8Array</code> \| <code>Array.<number></code> | The data to hash (string -> UTF-8 bytes). |
|
|
874
|
+
|
|
875
|
+
<a name="module_quantum-coin-js-sdk..computeHmac"></a>
|
|
876
|
+
|
|
877
|
+
### quantum-coin-js-sdk~computeHmac(algorithm, key, data) ⇒ <code>Array.<number></code>
|
|
878
|
+
The computeHmac function computes an HMAC over the data using the given key.
|
|
879
|
+
|
|
880
|
+
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
881
|
+
**Returns**: <code>Array.<number></code> - - The HMAC as a byte array. Returns -1000 before initialize(), or null on invalid input.
|
|
882
|
+
|
|
883
|
+
| Param | Type | Description |
|
|
884
|
+
| --- | --- | --- |
|
|
885
|
+
| algorithm | <code>string</code> | The hash algorithm: "sha256" or "sha512". |
|
|
886
|
+
| key | <code>string</code> \| <code>Uint8Array</code> \| <code>Array.<number></code> | The HMAC key (string -> UTF-8 bytes). |
|
|
887
|
+
| data | <code>string</code> \| <code>Uint8Array</code> \| <code>Array.<number></code> | The data to authenticate (string -> UTF-8 bytes). |
|
|
888
|
+
|
|
889
|
+
<a name="module_quantum-coin-js-sdk..pbkdf2"></a>
|
|
890
|
+
|
|
891
|
+
### quantum-coin-js-sdk~pbkdf2(password, salt, iterations, keylen, algorithm) ⇒ <code>Array.<number></code>
|
|
892
|
+
The pbkdf2 function derives a key using PBKDF2.
|
|
1551
893
|
|
|
1552
894
|
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
1553
|
-
**Returns**: <code>Array.<number></code> - -
|
|
895
|
+
**Returns**: <code>Array.<number></code> - - The derived key as a byte array. Returns -1000 before initialize(), or null on invalid input.
|
|
1554
896
|
|
|
1555
897
|
| Param | Type | Description |
|
|
1556
898
|
| --- | --- | --- |
|
|
1557
|
-
|
|
|
899
|
+
| password | <code>string</code> \| <code>Uint8Array</code> \| <code>Array.<number></code> | The password (string -> UTF-8 bytes). |
|
|
1558
900
|
| salt | <code>Uint8Array</code> \| <code>Array.<number></code> | The salt as a byte array. |
|
|
1559
|
-
|
|
|
1560
|
-
|
|
|
1561
|
-
|
|
|
1562
|
-
| dkLen | <code>number</code> | The derived key length in bytes. Must be 32. |
|
|
901
|
+
| iterations | <code>number</code> | The iteration count (positive integer). |
|
|
902
|
+
| keylen | <code>number</code> | The derived key length in bytes (positive integer). |
|
|
903
|
+
| algorithm | <code>string</code> | The PRF hash algorithm: "sha256" or "sha512". |
|
|
1563
904
|
|
|
1564
905
|
<a name="module_quantum-coin-js-sdk..combinePublicKeySignature"></a>
|
|
1565
906
|
|