quantum-coin-js-sdk 1.0.28 → 1.0.29

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.
Files changed (37) hide show
  1. package/.github/workflows/publish-npmjs.yaml +22 -22
  2. package/.gitignore +2 -2
  3. package/LICENSE +21 -21
  4. package/LICENSE-wasm_exec.js.txt +30 -30
  5. package/README.md +0 -0
  6. package/example/conversion-example.js +19 -19
  7. package/example/example-create-contract.js +396 -396
  8. package/example/example-encode-decode-rlp.js +225 -225
  9. package/example/example-event-pack-unpack.js +391 -391
  10. package/example/example-misc.js +100 -96
  11. package/example/example-rpc-send-signRawTransaction.js +318 -318
  12. package/example/example-rpc-send.js +116 -116
  13. package/example/example-send.js +70 -70
  14. package/example/example-token-pack-unpack.js +961 -961
  15. package/example/example-wallet-version4.js +34 -34
  16. package/example/example-wallet.js +43 -43
  17. package/example/example.js +405 -405
  18. package/example/package-lock.json +142 -142
  19. package/example/package.json +15 -16
  20. package/index.d.ts +1003 -967
  21. package/index.js +3005 -2636
  22. package/package.json +34 -35
  23. package/tests/encrypted-32.json +1 -0
  24. package/tests/encrypted-36.json +1 -0
  25. package/tests/encrypted-48.json +1 -0
  26. package/tests/generate-verify-vectors.js +91 -0
  27. package/tests/non-transactional.preinit.test.js +41 -41
  28. package/tests/non-transactional.test.js +530 -426
  29. package/tests/sign-raw-keytype5-context-null.test.js +107 -0
  30. package/tests/sign-raw-transaction.test.js +196 -0
  31. package/tests/sign-verify.test.js +311 -0
  32. package/tests/transactional.relay.test.js +131 -80
  33. package/tests/transactional.rpc.test.js +103 -92
  34. package/tests/verify-vectors.json +95035 -0
  35. package/wasmBase64.d.ts +9 -0
  36. package/wasmBase64.js +16 -0
  37. package/wasm_exec.js +587 -587
@@ -1,22 +1,22 @@
1
- name: Publish Package to npmjs
2
- on:
3
- workflow_dispatch:
4
-
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- permissions:
9
- contents: read
10
- id-token: write
11
- steps:
12
- - uses: actions/checkout@v4
13
- # Setup .npmrc file to publish to npm
14
- - uses: actions/setup-node@v4
15
- with:
16
- node-version: '20.x'
17
- registry-url: 'https://registry.npmjs.org'
18
- - run: npm install
19
- - run: npm ci
20
- - run: npm publish --provenance --access public --otp=${{ secrets.OTP }}
21
- env:
22
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1
+ name: Publish Package to npmjs
2
+ on:
3
+ workflow_dispatch:
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ permissions:
9
+ contents: read
10
+ id-token: write
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ # Setup .npmrc file to publish to npm
14
+ - uses: actions/setup-node@v4
15
+ with:
16
+ node-version: '20.x'
17
+ registry-url: 'https://registry.npmjs.org'
18
+ - run: npm install
19
+ - run: npm ci
20
+ - run: npm publish --provenance --access public --otp=${{ secrets.OTP }}
21
+ env:
22
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.gitignore CHANGED
@@ -1,3 +1,3 @@
1
- .idea
2
- .vs/
1
+ .idea
2
+ .vs/
3
3
  node_modules/
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Quantum Coin Community
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Quantum Coin Community
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,30 +1,30 @@
1
- License for file wasm_exec.js
2
- https://github.com/golang/go/blob/master/LICENSE
3
-
4
- Copyright 2009 The Go Authors.
5
-
6
- Redistribution and use in source and binary forms, with or without
7
- modification, are permitted provided that the following conditions are
8
- met:
9
-
10
- * Redistributions of source code must retain the above copyright
11
- notice, this list of conditions and the following disclaimer.
12
- * Redistributions in binary form must reproduce the above
13
- copyright notice, this list of conditions and the following disclaimer
14
- in the documentation and/or other materials provided with the
15
- distribution.
16
- * Neither the name of Google LLC nor the names of its
17
- contributors may be used to endorse or promote products derived from
18
- this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ License for file wasm_exec.js
2
+ https://github.com/golang/go/blob/master/LICENSE
3
+
4
+ Copyright 2009 The Go Authors.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are
8
+ met:
9
+
10
+ * Redistributions of source code must retain the above copyright
11
+ notice, this list of conditions and the following disclaimer.
12
+ * Redistributions in binary form must reproduce the above
13
+ copyright notice, this list of conditions and the following disclaimer
14
+ in the documentation and/or other materials provided with the
15
+ distribution.
16
+ * Neither the name of Google LLC nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
Binary file
@@ -1,19 +1,19 @@
1
- const ethers = require('ethers');
2
-
3
- let hexValue = "0xDE0B6B3A7640000";
4
-
5
- //Convert hex to wei
6
- let weiValueExample = BigInt(hexValue).toString();
7
- console.log("hex to wei example: hex:" + hexValue + ", wei: " + weiValueExample);
8
-
9
- //Convert wei to eth
10
- let ethValueExample = ethers.formatEther(weiValueExample);
11
- console.log("wei to eth example: wei:" + weiValueExample + ", eth (coins): " + ethValueExample);
12
-
13
- //Convert eth to wei
14
- let weiValueExample2 = ethers.parseUnits(ethValueExample, "ether");
15
- console.log("eth to wei example: eth (coins):" + ethValueExample + ", wei: " + weiValueExample2);
16
-
17
- //Convert wei to hex
18
- let hexValue2 = ethers.toBeHex(weiValueExample2);
19
- console.log("wei to hex example : hex: " + hexValue2 + ", wei: " + weiValueExample2);
1
+ const ethers = require('ethers');
2
+
3
+ let hexValue = "0xDE0B6B3A7640000";
4
+
5
+ //Convert hex to wei
6
+ let weiValueExample = BigInt(hexValue).toString();
7
+ console.log("hex to wei example: hex:" + hexValue + ", wei: " + weiValueExample);
8
+
9
+ //Convert wei to eth
10
+ let ethValueExample = ethers.formatEther(weiValueExample);
11
+ console.log("wei to eth example: wei:" + weiValueExample + ", eth (coins): " + ethValueExample);
12
+
13
+ //Convert eth to wei
14
+ let weiValueExample2 = ethers.parseUnits(ethValueExample, "ether");
15
+ console.log("eth to wei example: eth (coins):" + ethValueExample + ", wei: " + weiValueExample2);
16
+
17
+ //Convert wei to hex
18
+ let hexValue2 = ethers.toBeHex(weiValueExample2);
19
+ console.log("wei to hex example : hex: " + hexValue2 + ", wei: " + weiValueExample2);