quantumswap 0.0.2 → 0.0.3
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/examples/_test-wallet.js +1 -3
- package/examples/deploy-IERC20.js +3 -4
- package/examples/deploy-QuantumSwapV2ERC20.js +3 -4
- package/examples/deploy-QuantumSwapV2Factory.js +3 -4
- package/examples/deploy-QuantumSwapV2Pair.js +3 -4
- package/examples/deploy-QuantumSwapV2Router02.js +3 -4
- package/examples/deploy-WQ.js +3 -4
- package/examples/events-IERC20.js +3 -4
- package/examples/events-QuantumSwapV2ERC20.js +3 -4
- package/examples/events-QuantumSwapV2Factory.js +3 -4
- package/examples/events-QuantumSwapV2Pair.js +3 -4
- package/examples/events-QuantumSwapV2Router02.js +3 -4
- package/examples/events-WQ.js +3 -4
- package/examples/offline-signing-IERC20.js +3 -4
- package/examples/offline-signing-QuantumSwapV2ERC20.js +3 -4
- package/examples/offline-signing-QuantumSwapV2Factory.js +3 -4
- package/examples/offline-signing-QuantumSwapV2Pair.js +3 -4
- package/examples/offline-signing-QuantumSwapV2Router02.js +3 -4
- package/examples/offline-signing-WQ.js +3 -4
- package/examples/package-lock.json +11 -20
- package/examples/package.json +1 -1
- package/examples/read-operations-IERC20.js +3 -4
- package/examples/read-operations-QuantumSwapV2ERC20.js +3 -4
- package/examples/read-operations-QuantumSwapV2Factory.js +3 -4
- package/examples/read-operations-QuantumSwapV2Pair.js +3 -4
- package/examples/read-operations-QuantumSwapV2Router02.js +3 -4
- package/examples/read-operations-WQ.js +3 -4
- package/examples/run-dex-flow-custom.js +22 -13
- package/examples/run-dex-flow-custom.ts +23 -13
- package/examples/write-operations-IERC20.js +3 -4
- package/examples/write-operations-QuantumSwapV2ERC20.js +3 -4
- package/examples/write-operations-QuantumSwapV2Factory.js +3 -4
- package/examples/write-operations-QuantumSwapV2Pair.js +3 -4
- package/examples/write-operations-QuantumSwapV2Router02.js +3 -4
- package/examples/write-operations-WQ.js +3 -4
- package/package.json +3 -4
- package/test/e2e/IERC20.e2e.test.js +2 -2
- package/test/e2e/QuantumSwapV2ERC20.e2e.test.js +2 -2
- package/test/e2e/QuantumSwapV2Factory.e2e.test.js +2 -2
- package/test/e2e/QuantumSwapV2Pair.e2e.test.js +2 -2
- package/test/e2e/QuantumSwapV2Router02.e2e.test.js +2 -2
- package/test/e2e/WQ.e2e.test.js +2 -2
- package/test/e2e/all-contracts.e2e.test.js +103 -72
- package/test/e2e/dex-full-flow.e2e.test.js +59 -26
package/examples/_test-wallet.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
const
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
14
|
+
const provider = getProvider(rpcUrl, chainId);
|
|
16
15
|
const wallet = createTestWallet(provider);
|
|
17
16
|
|
|
18
17
|
const factory = new QuantumSwapV2Router02__factory(wallet);
|
package/examples/deploy-WQ.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const path = require("node:path");
|
|
2
|
-
const
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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");
|
package/examples/events-WQ.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const path = require("node:path");
|
|
2
|
-
const
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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.
|
|
11
|
+
"quantumcoin": "7.0.4",
|
|
12
12
|
"quantumswap": "file:.."
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"..": {
|
|
16
16
|
"name": "quantumswap",
|
|
17
|
-
"version": "0.0.
|
|
17
|
+
"version": "0.0.3",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"quantum-coin-js-sdk": "^1.0.
|
|
21
|
-
"
|
|
22
|
-
"quantumcoin": "^7.0.3",
|
|
20
|
+
"quantum-coin-js-sdk": "^1.0.31",
|
|
21
|
+
"quantumcoin": "^7.0.4",
|
|
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.
|
|
32
|
-
"resolved": "https://registry.npmjs.org/quantum-coin-js-sdk/-/quantum-coin-js-sdk-1.0.
|
|
33
|
-
"integrity": "sha512-
|
|
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.
|
|
48
|
-
"resolved": "https://registry.npmjs.org/quantumcoin/-/quantumcoin-7.0.
|
|
49
|
-
"integrity": "sha512-
|
|
39
|
+
"version": "7.0.4",
|
|
40
|
+
"resolved": "https://registry.npmjs.org/quantumcoin/-/quantumcoin-7.0.4.tgz",
|
|
41
|
+
"integrity": "sha512-pQvdnzDKqIxaB4EalILgga5FZxxliV9VedR33eNIB6iAnzqeJPARt4b78Zwe8yN5ZNQDfRJ41SyXpZJjW1lXNA==",
|
|
50
42
|
"license": "MIT",
|
|
51
43
|
"dependencies": {
|
|
52
|
-
"quantum-coin-js-sdk": "
|
|
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": {
|
package/examples/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const path = require("node:path");
|
|
2
|
-
const
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
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
|
|
3
|
-
const {
|
|
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 =
|
|
15
|
+
const provider = getProvider(rpcUrl, chainId);
|
|
17
16
|
const contract = WQ.connect(address, provider);
|
|
18
17
|
|
|
19
18
|
console.log("WQ:", contract.target);
|