quantumswap 0.0.2 → 0.0.4

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 (44) hide show
  1. package/examples/_test-wallet.js +1 -3
  2. package/examples/deploy-IERC20.js +3 -4
  3. package/examples/deploy-QuantumSwapV2ERC20.js +3 -4
  4. package/examples/deploy-QuantumSwapV2Factory.js +3 -4
  5. package/examples/deploy-QuantumSwapV2Pair.js +3 -4
  6. package/examples/deploy-QuantumSwapV2Router02.js +3 -4
  7. package/examples/deploy-WQ.js +3 -4
  8. package/examples/events-IERC20.js +3 -4
  9. package/examples/events-QuantumSwapV2ERC20.js +3 -4
  10. package/examples/events-QuantumSwapV2Factory.js +3 -4
  11. package/examples/events-QuantumSwapV2Pair.js +3 -4
  12. package/examples/events-QuantumSwapV2Router02.js +3 -4
  13. package/examples/events-WQ.js +3 -4
  14. package/examples/offline-signing-IERC20.js +3 -4
  15. package/examples/offline-signing-QuantumSwapV2ERC20.js +3 -4
  16. package/examples/offline-signing-QuantumSwapV2Factory.js +3 -4
  17. package/examples/offline-signing-QuantumSwapV2Pair.js +3 -4
  18. package/examples/offline-signing-QuantumSwapV2Router02.js +3 -4
  19. package/examples/offline-signing-WQ.js +3 -4
  20. package/examples/package-lock.json +11 -20
  21. package/examples/package.json +1 -1
  22. package/examples/read-operations-IERC20.js +3 -4
  23. package/examples/read-operations-QuantumSwapV2ERC20.js +3 -4
  24. package/examples/read-operations-QuantumSwapV2Factory.js +3 -4
  25. package/examples/read-operations-QuantumSwapV2Pair.js +3 -4
  26. package/examples/read-operations-QuantumSwapV2Router02.js +3 -4
  27. package/examples/read-operations-WQ.js +3 -4
  28. package/examples/run-dex-flow-custom.js +22 -13
  29. package/examples/run-dex-flow-custom.ts +23 -13
  30. package/examples/write-operations-IERC20.js +3 -4
  31. package/examples/write-operations-QuantumSwapV2ERC20.js +3 -4
  32. package/examples/write-operations-QuantumSwapV2Factory.js +3 -4
  33. package/examples/write-operations-QuantumSwapV2Pair.js +3 -4
  34. package/examples/write-operations-QuantumSwapV2Router02.js +3 -4
  35. package/examples/write-operations-WQ.js +3 -4
  36. package/package.json +3 -4
  37. package/test/e2e/IERC20.e2e.test.js +2 -2
  38. package/test/e2e/QuantumSwapV2ERC20.e2e.test.js +2 -2
  39. package/test/e2e/QuantumSwapV2Factory.e2e.test.js +2 -2
  40. package/test/e2e/QuantumSwapV2Pair.e2e.test.js +2 -2
  41. package/test/e2e/QuantumSwapV2Router02.e2e.test.js +2 -2
  42. package/test/e2e/WQ.e2e.test.js +2 -2
  43. package/test/e2e/all-contracts.e2e.test.js +103 -72
  44. package/test/e2e/dex-full-flow.e2e.test.js +59 -26
@@ -1,6 +1,4 @@
1
- const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Wallet } = require(parentQcPath);
1
+ const { Wallet } = require("quantumcoin");
4
2
 
5
3
  // Hardcoded test wallet (test-only; never use for real funds)
6
4
  const TEST_WALLET_ENCRYPTED_JSON =
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const { createTestWallet } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { IERC20__factory } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = createTestWallet(provider);
17
16
 
18
17
  const factory = new IERC20__factory(wallet);
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const { createTestWallet } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { QuantumSwapV2ERC20__factory } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = createTestWallet(provider);
17
16
 
18
17
  const factory = new QuantumSwapV2ERC20__factory(wallet);
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const { createTestWallet } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { QuantumSwapV2Factory__factory } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = createTestWallet(provider);
17
16
 
18
17
  const factory = new QuantumSwapV2Factory__factory(wallet);
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const { createTestWallet } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { QuantumSwapV2Pair__factory } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = createTestWallet(provider);
17
16
 
18
17
  const factory = new QuantumSwapV2Pair__factory(wallet);
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const { createTestWallet } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { QuantumSwapV2Router02__factory } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = createTestWallet(provider);
17
16
 
18
17
  const factory = new QuantumSwapV2Router02__factory(wallet);
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const { createTestWallet } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { WQ__factory } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = createTestWallet(provider);
17
16
 
18
17
  const factory = new WQ__factory(wallet);
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { IERC20 } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = IERC20.connect(address, provider);
18
17
 
19
18
  const logs = await contract.queryFilter("Transfer", "latest", "latest");
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { QuantumSwapV2ERC20 } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = QuantumSwapV2ERC20.connect(address, provider);
18
17
 
19
18
  const logs = await contract.queryFilter("Transfer", "latest", "latest");
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { QuantumSwapV2Factory } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = QuantumSwapV2Factory.connect(address, provider);
18
17
 
19
18
  const logs = await contract.queryFilter("Transfer", "latest", "latest");
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { QuantumSwapV2Pair } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = QuantumSwapV2Pair.connect(address, provider);
18
17
 
19
18
  const logs = await contract.queryFilter("Transfer", "latest", "latest");
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { QuantumSwapV2Router02 } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = QuantumSwapV2Router02.connect(address, provider);
18
17
 
19
18
  const logs = await contract.queryFilter("Transfer", "latest", "latest");
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { WQ } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = WQ.connect(address, provider);
18
17
 
19
18
  const logs = await contract.queryFilter("Transfer", "latest", "latest");
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider, Wallet, getCreateAddress } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider, Wallet, getCreateAddress } = require("quantumcoin");
5
4
  const { TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { IERC20__factory, IERC20 } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = Wallet.fromEncryptedJsonSync(TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE);
17
16
  const from = wallet.address;
18
17
 
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider, Wallet, getCreateAddress } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider, Wallet, getCreateAddress } = require("quantumcoin");
5
4
  const { TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { QuantumSwapV2ERC20__factory, QuantumSwapV2ERC20 } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = Wallet.fromEncryptedJsonSync(TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE);
17
16
  const from = wallet.address;
18
17
 
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider, Wallet, getCreateAddress } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider, Wallet, getCreateAddress } = require("quantumcoin");
5
4
  const { TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { QuantumSwapV2Factory__factory, QuantumSwapV2Factory } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = Wallet.fromEncryptedJsonSync(TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE);
17
16
  const from = wallet.address;
18
17
 
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider, Wallet, getCreateAddress } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider, Wallet, getCreateAddress } = require("quantumcoin");
5
4
  const { TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { QuantumSwapV2Pair__factory, QuantumSwapV2Pair } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = Wallet.fromEncryptedJsonSync(TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE);
17
16
  const from = wallet.address;
18
17
 
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider, Wallet, getCreateAddress } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider, Wallet, getCreateAddress } = require("quantumcoin");
5
4
  const { TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { QuantumSwapV2Router02__factory, QuantumSwapV2Router02 } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = Wallet.fromEncryptedJsonSync(TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE);
17
16
  const from = wallet.address;
18
17
 
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider, Wallet, getCreateAddress } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider, Wallet, getCreateAddress } = require("quantumcoin");
5
4
  const { TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE } = require("./_test-wallet");
6
5
  const parentQswapPath = path.join(__dirname, "..");
7
6
  const { WQ__factory, WQ } = require(parentQswapPath);
@@ -12,7 +11,7 @@ async function main() {
12
11
  const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
13
12
  await Initialize(null);
14
13
 
15
- const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const provider = getProvider(rpcUrl, chainId);
16
15
  const wallet = Wallet.fromEncryptedJsonSync(TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE);
17
16
  const from = wallet.address;
18
17
 
@@ -8,18 +8,17 @@
8
8
  "name": "quantumswap-examples",
9
9
  "version": "0.0.1",
10
10
  "dependencies": {
11
- "quantumcoin": "7.0.3",
11
+ "quantumcoin": "7.0.5",
12
12
  "quantumswap": "file:.."
13
13
  }
14
14
  },
15
15
  "..": {
16
16
  "name": "quantumswap",
17
- "version": "0.0.2",
17
+ "version": "0.0.4",
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
- "quantum-coin-js-sdk": "^1.0.28",
21
- "quantum-coin-pqc-js-sdk": "^1.0.5",
22
- "quantumcoin": "^7.0.3",
20
+ "quantum-coin-js-sdk": "^1.0.31",
21
+ "quantumcoin": "^7.0.5",
23
22
  "seed-words": "^1.0.2"
24
23
  },
25
24
  "devDependencies": {
@@ -28,29 +27,21 @@
28
27
  }
29
28
  },
30
29
  "node_modules/quantum-coin-js-sdk": {
31
- "version": "1.0.28",
32
- "resolved": "https://registry.npmjs.org/quantum-coin-js-sdk/-/quantum-coin-js-sdk-1.0.28.tgz",
33
- "integrity": "sha512-ok3kCoEecSWRLsFw285IDzz8Xvtc772BvBujeCasQ7G2f+Jwly6UFtjivyrh0gDPuZFwYU/hbaKvpb8OtkuM/Q==",
30
+ "version": "1.0.31",
31
+ "resolved": "https://registry.npmjs.org/quantum-coin-js-sdk/-/quantum-coin-js-sdk-1.0.31.tgz",
32
+ "integrity": "sha512-enXV7IrUSi8Rjxd4xkoTMmQ9C49ev75FPzu+UbJuzo7D4og/FpD7Ycu1xkLau9cQl/YJFzN9MV+F0/GIoPEG4Q==",
34
33
  "license": "MIT",
35
34
  "dependencies": {
36
- "quantum-coin-pqc-js-sdk": "1.0.5",
37
35
  "seed-words": "1.0.2"
38
36
  }
39
37
  },
40
- "node_modules/quantum-coin-pqc-js-sdk": {
41
- "version": "1.0.5",
42
- "resolved": "https://registry.npmjs.org/quantum-coin-pqc-js-sdk/-/quantum-coin-pqc-js-sdk-1.0.5.tgz",
43
- "integrity": "sha512-9P1YDkca5CqrO7++TnGJZzPvYlBjYARopHgxYbDcEHgPicP7+tA8zD+DE1BooHp7sLEWF9ObklMj6AdaDUjDVw==",
44
- "license": "MIT"
45
- },
46
38
  "node_modules/quantumcoin": {
47
- "version": "7.0.3",
48
- "resolved": "https://registry.npmjs.org/quantumcoin/-/quantumcoin-7.0.3.tgz",
49
- "integrity": "sha512-czclUCSuLicRIzJSL8KoRg7eB+pC0oi+9iTsaUghkEY8OIsiuY6aOTXzCJBmgyHkqAdaM7W4++dE1KKl5EVOTw==",
39
+ "version": "7.0.5",
40
+ "resolved": "https://registry.npmjs.org/quantumcoin/-/quantumcoin-7.0.5.tgz",
41
+ "integrity": "sha512-1qVbfsrV14QrFAQyk8l6NX7N8yAsaaFspICLlRThttO/o4fBxQDxSIua8hZJrUhoTzCdUYzLBt4XFSCW4MfT2Q==",
50
42
  "license": "MIT",
51
43
  "dependencies": {
52
- "quantum-coin-js-sdk": "^1.0.28",
53
- "quantum-coin-pqc-js-sdk": "^1.0.5",
44
+ "quantum-coin-js-sdk": "1.0.31",
54
45
  "seed-words": "^1.0.2"
55
46
  },
56
47
  "bin": {
@@ -9,6 +9,6 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "quantumswap": "file:..",
12
- "quantumcoin": "7.0.3"
12
+ "quantumcoin": "7.0.5"
13
13
  }
14
14
  }
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { IERC20 } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = IERC20.connect(address, provider);
18
17
 
19
18
  console.log("IERC20:", contract.target);
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { QuantumSwapV2ERC20 } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = QuantumSwapV2ERC20.connect(address, provider);
18
17
 
19
18
  console.log("QuantumSwapV2ERC20:", contract.target);
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { QuantumSwapV2Factory } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = QuantumSwapV2Factory.connect(address, provider);
18
17
 
19
18
  console.log("QuantumSwapV2Factory:", contract.target);
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { QuantumSwapV2Pair } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = QuantumSwapV2Pair.connect(address, provider);
18
17
 
19
18
  console.log("QuantumSwapV2Pair:", contract.target);
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { QuantumSwapV2Router02 } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = QuantumSwapV2Router02.connect(address, provider);
18
17
 
19
18
  console.log("QuantumSwapV2Router02:", contract.target);
@@ -1,7 +1,6 @@
1
1
  const path = require("node:path");
2
- const parentQcPath = path.join(__dirname, "..", "node_modules", "quantumcoin");
3
- const { Initialize } = require(path.join(parentQcPath, "config"));
4
- const { JsonRpcProvider } = require(parentQcPath);
2
+ const { Initialize } = require("quantumcoin/config");
3
+ const { getProvider } = require("quantumcoin");
5
4
  const parentQswapPath = path.join(__dirname, "..");
6
5
  const { WQ } = require(parentQswapPath);
7
6
 
@@ -13,7 +12,7 @@ async function main() {
13
12
  if (!address) throw new Error("CONTRACT_ADDRESS is required");
14
13
  await Initialize(null);
15
14
 
16
- const provider = new JsonRpcProvider(rpcUrl, chainId);
15
+ const provider = getProvider(rpcUrl, chainId);
17
16
  const contract = WQ.connect(address, provider);
18
17
 
19
18
  console.log("WQ:", contract.target);