quantumswap 0.0.1

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 (77) hide show
  1. package/.github/workflows/publish-npmjs.yaml +22 -0
  2. package/LICENSE +21 -0
  3. package/README.md +287 -0
  4. package/examples/_test-wallet.js +17 -0
  5. package/examples/deploy-IERC20.js +23 -0
  6. package/examples/deploy-QuantumSwapV2ERC20.js +23 -0
  7. package/examples/deploy-QuantumSwapV2Factory.js +23 -0
  8. package/examples/deploy-QuantumSwapV2Pair.js +23 -0
  9. package/examples/deploy-QuantumSwapV2Router02.js +23 -0
  10. package/examples/deploy-WQ.js +23 -0
  11. package/examples/events-IERC20.js +20 -0
  12. package/examples/events-QuantumSwapV2ERC20.js +20 -0
  13. package/examples/events-QuantumSwapV2Factory.js +20 -0
  14. package/examples/events-QuantumSwapV2Pair.js +20 -0
  15. package/examples/events-QuantumSwapV2Router02.js +20 -0
  16. package/examples/events-WQ.js +20 -0
  17. package/examples/offline-signing-IERC20.js +29 -0
  18. package/examples/offline-signing-QuantumSwapV2ERC20.js +29 -0
  19. package/examples/offline-signing-QuantumSwapV2Factory.js +29 -0
  20. package/examples/offline-signing-QuantumSwapV2Pair.js +29 -0
  21. package/examples/offline-signing-QuantumSwapV2Router02.js +29 -0
  22. package/examples/offline-signing-WQ.js +29 -0
  23. package/examples/read-operations-IERC20.js +19 -0
  24. package/examples/read-operations-QuantumSwapV2ERC20.js +19 -0
  25. package/examples/read-operations-QuantumSwapV2Factory.js +19 -0
  26. package/examples/read-operations-QuantumSwapV2Pair.js +19 -0
  27. package/examples/read-operations-QuantumSwapV2Router02.js +19 -0
  28. package/examples/read-operations-WQ.js +19 -0
  29. package/examples/walkthrough-dex-full-flow.js +226 -0
  30. package/examples/walkthrough-dex-full-flow.ts +231 -0
  31. package/examples/write-operations-IERC20.js +22 -0
  32. package/examples/write-operations-QuantumSwapV2ERC20.js +22 -0
  33. package/examples/write-operations-QuantumSwapV2Factory.js +22 -0
  34. package/examples/write-operations-QuantumSwapV2Pair.js +22 -0
  35. package/examples/write-operations-QuantumSwapV2Router02.js +22 -0
  36. package/examples/write-operations-WQ.js +22 -0
  37. package/index.d.ts +1 -0
  38. package/index.js +45 -0
  39. package/package.json +35 -0
  40. package/src/IERC20.d.ts +24 -0
  41. package/src/IERC20.js +348 -0
  42. package/src/IERC20__factory.d.ts +10 -0
  43. package/src/IERC20__factory.js +29 -0
  44. package/src/QuantumSwapV2ERC20.d.ts +24 -0
  45. package/src/QuantumSwapV2ERC20.js +353 -0
  46. package/src/QuantumSwapV2ERC20__factory.d.ts +10 -0
  47. package/src/QuantumSwapV2ERC20__factory.js +29 -0
  48. package/src/QuantumSwapV2Factory.d.ts +24 -0
  49. package/src/QuantumSwapV2Factory.js +310 -0
  50. package/src/QuantumSwapV2Factory__factory.d.ts +10 -0
  51. package/src/QuantumSwapV2Factory__factory.js +29 -0
  52. package/src/QuantumSwapV2Pair.d.ts +44 -0
  53. package/src/QuantumSwapV2Pair.js +847 -0
  54. package/src/QuantumSwapV2Pair__factory.d.ts +10 -0
  55. package/src/QuantumSwapV2Pair__factory.js +29 -0
  56. package/src/QuantumSwapV2Router02.d.ts +47 -0
  57. package/src/QuantumSwapV2Router02.js +1109 -0
  58. package/src/QuantumSwapV2Router02__factory.d.ts +10 -0
  59. package/src/QuantumSwapV2Router02__factory.js +29 -0
  60. package/src/WQ.d.ts +28 -0
  61. package/src/WQ.js +435 -0
  62. package/src/WQ__factory.d.ts +10 -0
  63. package/src/WQ__factory.js +29 -0
  64. package/src/index.d.ts +14 -0
  65. package/src/index.js +15 -0
  66. package/src/quantumcoin-shims.d.ts +25 -0
  67. package/src/types.d.ts +3 -0
  68. package/src/types.js +3 -0
  69. package/test/e2e/IERC20.e2e.test.js +79 -0
  70. package/test/e2e/QuantumSwapV2ERC20.e2e.test.js +79 -0
  71. package/test/e2e/QuantumSwapV2Factory.e2e.test.js +79 -0
  72. package/test/e2e/QuantumSwapV2Pair.e2e.test.js +79 -0
  73. package/test/e2e/QuantumSwapV2Router02.e2e.test.js +79 -0
  74. package/test/e2e/WQ.e2e.test.js +79 -0
  75. package/test/e2e/all-contracts.e2e.test.js +103 -0
  76. package/test/e2e/dex-full-flow.e2e.test.js +353 -0
  77. package/tsconfig.json +14 -0
@@ -0,0 +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 }}
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 QuantumSwap
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.
package/README.md ADDED
@@ -0,0 +1,287 @@
1
+ # QuantumSwap
2
+
3
+ QuantumSwap.js SDK for DEX functionality in QuantumCoin blockchain
4
+
5
+ > **Note:** This is an experimental SDK. Use at your own risk.
6
+
7
+ ## What’s in this package
8
+
9
+ - JavaScript contract wrappers and factories in `src/` (TypeScript types via `.d.ts`)
10
+ - Transactional tests in `test/e2e/`
11
+ - Example scripts in `examples/`
12
+
13
+ ## Install
14
+
15
+ - `npm install`
16
+
17
+ ## Build
18
+
19
+ - (no build step required)
20
+
21
+ ## Run tests
22
+
23
+ - `npm test`
24
+
25
+ Transactional tests require:
26
+ - `QC_RPC_URL` (required for transactional tests)
27
+ - `QC_CHAIN_ID` (optional; defaults are used if omitted)
28
+
29
+ ### Step by step walkthrough
30
+
31
+ This walkthrough uses **pre-deployed** WQ, V2 Factory, and Swap Router. Do **not** deploy these contracts; use the Test Release (Dec 2025) addresses below.
32
+
33
+ **Test Release (Dec 2025) Contracts**
34
+
35
+ | Variable | Address |
36
+ |----------|---------|
37
+ | `WQ_CONTRACT_ADDRESS` | `0x0E49c26cd1ca19bF8ddA2C8985B96783288458754757F4C9E00a5439A7291628` |
38
+ | `V2_CORE_FACTORY_CONTRACT_ADDRESS` | `0xbbF45a1B60044669793B444eD01Eb33e03Bb8cf3c5b6ae7887B218D05C5Cbf1d` |
39
+ | `SWAP_ROUTER_V2_CONTRACT_ADDRESS` | `0x41323EF72662185f44a03ea0ad8094a0C9e925aB1102679D8e957e838054aac5` |
40
+
41
+ **Steps**
42
+
43
+ 1. **Connect** — Initialize the SDK, create a `JsonRpcProvider` with your RPC URL and chain ID, load a `Wallet` (e.g. from encrypted JSON or private key). Attach the SDK contract wrappers to the deployed addresses:
44
+ - `WQ.connect(WQ_CONTRACT_ADDRESS, provider)` (or with signer for writes)
45
+ - `QuantumSwapV2Factory.connect(V2_CORE_FACTORY_CONTRACT_ADDRESS, provider)`
46
+ - `QuantumSwapV2Router02.connect(SWAP_ROUTER_V2_CONTRACT_ADDRESS, signer)` for router calls
47
+
48
+ 2. **Deploy two ERC20 tokens** — Deploy two tokens that have initial supply and mint to the deployer (e.g. a SimpleERC20-style contract: `constructor(name, symbol, initialSupply)`). Use `ContractFactory` with the token ABI and bytecode, then `getDeployTransaction(...)` and `sendTransaction({ ...tx, gasLimit })` so deployment has enough gas. Record `tokenA` and `tokenB` contract addresses.
49
+
50
+ 3. **Create a pair** — Call `factory.createPair(tokenAAddress, tokenBAddress)` (with a signer). Wait for the tx. Get the pair address with `factory.getPair(tokenAAddress, tokenBAddress)`.
51
+
52
+ 4. **Add liquidity** — Approve the router to spend tokenA and tokenB (e.g. `tokenA.approve(routerAddress, amountADesired)` and same for tokenB). Call `router.addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin, to, deadline)` with a signer. Optionally verify pair reserves with `pair.getReserves()`.
53
+
54
+ 5. **Swap token for token** — Approve the router to spend the input token. Call `router.swapExactTokensForTokens(amountIn, amountOutMin, [tokenIn, tokenOut], to, deadline)`. Check the recipient token balance before and after to confirm the swap.
55
+
56
+ 6. **Swap ETH for token (optional)** — Wrap native currency: `wq.deposit({ value: amount })`. If there is no WQ–token pair yet, create it with `factory.createPair(wqAddress, tokenAddress)` and add liquidity via `router.addLiquidityETH(token, amountTokenDesired, amountTokenMin, amountETHMin, to, deadline, { value: ethAmount })`. Then call `router.swapExactETHForTokens(amountOutMin, [wqAddress, tokenAddress], to, deadline, { value: ethValue })` to swap native ETH for the token.
57
+
58
+ Runnable scripts that perform all steps above:
59
+
60
+ - **JavaScript:** [examples/walkthrough-dex-full-flow.js](./examples/walkthrough-dex-full-flow.js)
61
+ - **TypeScript:** [examples/walkthrough-dex-full-flow.ts](./examples/walkthrough-dex-full-flow.ts)
62
+
63
+ Run with `QC_RPC_URL` set (and optionally `QC_CHAIN_ID`, or `QC_WALLET_JSON` + `QC_WALLET_PASSPHRASE` for your own wallet):
64
+
65
+ ```bash
66
+ # JavaScript
67
+ QC_RPC_URL=http://your-rpc:8545 node examples/walkthrough-dex-full-flow.js
68
+
69
+ # TypeScript (requires typescript and ts-node: npm install -D typescript ts-node)
70
+ QC_RPC_URL=http://your-rpc:8545 npx ts-node examples/walkthrough-dex-full-flow.ts
71
+ ```
72
+
73
+ The same flow is covered as an E2E test in [test/e2e/dex-full-flow.e2e.test.js](./test/e2e/dex-full-flow.e2e.test.js) (the test can optionally deploy WQ/Factory/Router when not using Test Release addresses).
74
+
75
+ ## Examples
76
+
77
+ Examples are generated per contract (e.g. `examples/deploy-<Contract>.js`).
78
+
79
+ ## Contracts
80
+
81
+ - [`IERC20`](#ierc20)
82
+ - [`QuantumSwapV2ERC20`](#quantumswapv2erc20)
83
+ - [`QuantumSwapV2Factory`](#quantumswapv2factory)
84
+ - [`QuantumSwapV2Pair`](#quantumswapv2pair)
85
+ - [`QuantumSwapV2Router02`](#quantumswapv2router02)
86
+ - [`WQ`](#wq)
87
+
88
+ ## IERC20
89
+ - **Exports**: `IERC20`, `IERC20__factory`
90
+ - **Constructor**: `constructor()`
91
+ ### Files
92
+ - [`src/IERC20.js`](./src/IERC20.js)
93
+ - [`src/IERC20__factory.js`](./src/IERC20__factory.js)
94
+ ### Examples
95
+ - [deploy](./examples/deploy-IERC20.js)
96
+ - [read operations](./examples/read-operations-IERC20.js)
97
+ - [write operations](./examples/write-operations-IERC20.js)
98
+ - [events](./examples/events-IERC20.js)
99
+ ### Tests
100
+ - [transactional test](./test/e2e/IERC20.e2e.test.js)
101
+ ### Functions
102
+ - `allowance(address owner, address spender) view returns (uint256)`
103
+ - `approve(address spender, uint256 value) returns (bool)`
104
+ - `balanceOf(address owner) view returns (uint256)`
105
+ - `decimals() view returns (uint8)`
106
+ - `name() view returns (string)`
107
+ - `symbol() view returns (string)`
108
+ - `totalSupply() view returns (uint256)`
109
+ - `transfer(address to, uint256 value) returns (bool)`
110
+ - `transferFrom(address from, address to, uint256 value) returns (bool)`
111
+ ### Events
112
+ - `Approval(address indexed owner, address indexed spender, uint256 value)`
113
+ - `Transfer(address indexed from, address indexed to, uint256 value)`
114
+ ### Errors
115
+ - (none)
116
+ ## QuantumSwapV2ERC20
117
+ - **Exports**: `QuantumSwapV2ERC20`, `QuantumSwapV2ERC20__factory`
118
+ - **Constructor**: `constructor()`
119
+ ### Files
120
+ - [`src/QuantumSwapV2ERC20.js`](./src/QuantumSwapV2ERC20.js)
121
+ - [`src/QuantumSwapV2ERC20__factory.js`](./src/QuantumSwapV2ERC20__factory.js)
122
+ ### Examples
123
+ - [deploy](./examples/deploy-QuantumSwapV2ERC20.js)
124
+ - [read operations](./examples/read-operations-QuantumSwapV2ERC20.js)
125
+ - [write operations](./examples/write-operations-QuantumSwapV2ERC20.js)
126
+ - [events](./examples/events-QuantumSwapV2ERC20.js)
127
+ ### Tests
128
+ - [transactional test](./test/e2e/QuantumSwapV2ERC20.e2e.test.js)
129
+ ### Functions
130
+ - `allowance(address, address) view returns (uint256)`
131
+ - `approve(address spender, uint256 value) returns (bool)`
132
+ - `balanceOf(address) view returns (uint256)`
133
+ - `decimals() view returns (uint8)`
134
+ - `name() view returns (string)`
135
+ - `symbol() view returns (string)`
136
+ - `totalSupply() view returns (uint256)`
137
+ - `transfer(address to, uint256 value) returns (bool)`
138
+ - `transferFrom(address from, address to, uint256 value) returns (bool)`
139
+ ### Events
140
+ - `Approval(address indexed owner, address indexed spender, uint256 value)`
141
+ - `Transfer(address indexed from, address indexed to, uint256 value)`
142
+ ### Errors
143
+ - (none)
144
+ ## QuantumSwapV2Factory
145
+ - **Exports**: `QuantumSwapV2Factory`, `QuantumSwapV2Factory__factory`
146
+ - **Constructor**: `constructor(address _feeToSetter)`
147
+ ### Files
148
+ - [`src/QuantumSwapV2Factory.js`](./src/QuantumSwapV2Factory.js)
149
+ - [`src/QuantumSwapV2Factory__factory.js`](./src/QuantumSwapV2Factory__factory.js)
150
+ ### Examples
151
+ - [deploy](./examples/deploy-QuantumSwapV2Factory.js)
152
+ - [read operations](./examples/read-operations-QuantumSwapV2Factory.js)
153
+ - [write operations](./examples/write-operations-QuantumSwapV2Factory.js)
154
+ - [events](./examples/events-QuantumSwapV2Factory.js)
155
+ ### Tests
156
+ - [transactional test](./test/e2e/QuantumSwapV2Factory.e2e.test.js)
157
+ ### Functions
158
+ - `allPairs(uint256) view returns (address)`
159
+ - `allPairsLength() view returns (uint256)`
160
+ - `createPair(address tokenA, address tokenB) returns (address)`
161
+ - `feeTo() view returns (address)`
162
+ - `feeToSetter() view returns (address)`
163
+ - `getPair(address, address) view returns (address)`
164
+ - `INIT_CODE_HASH() view returns (bytes32)`
165
+ - `setFeeTo(address _feeTo)`
166
+ - `setFeeToSetter(address _feeToSetter)`
167
+ ### Events
168
+ - `PairCreated(address indexed token0, address indexed token1, address pair, uint256)`
169
+ ### Errors
170
+ - (none)
171
+ ## QuantumSwapV2Pair
172
+ - **Exports**: `QuantumSwapV2Pair`, `QuantumSwapV2Pair__factory`
173
+ - **Constructor**: `constructor()`
174
+ ### Files
175
+ - [`src/QuantumSwapV2Pair.js`](./src/QuantumSwapV2Pair.js)
176
+ - [`src/QuantumSwapV2Pair__factory.js`](./src/QuantumSwapV2Pair__factory.js)
177
+ ### Examples
178
+ - [deploy](./examples/deploy-QuantumSwapV2Pair.js)
179
+ - [read operations](./examples/read-operations-QuantumSwapV2Pair.js)
180
+ - [write operations](./examples/write-operations-QuantumSwapV2Pair.js)
181
+ - [events](./examples/events-QuantumSwapV2Pair.js)
182
+ ### Tests
183
+ - [transactional test](./test/e2e/QuantumSwapV2Pair.e2e.test.js)
184
+ ### Functions
185
+ - `allowance(address, address) view returns (uint256)`
186
+ - `approve(address spender, uint256 value) returns (bool)`
187
+ - `balanceOf(address) view returns (uint256)`
188
+ - `burn(address to) returns (uint256, uint256)`
189
+ - `decimals() view returns (uint8)`
190
+ - `factory() view returns (address)`
191
+ - `getReserves() view returns (uint112, uint112, uint32)`
192
+ - `initialize(address _token0, address _token1)`
193
+ - `kLast() view returns (uint256)`
194
+ - `MINIMUM_LIQUIDITY() view returns (uint256)`
195
+ - `mint(address to) returns (uint256)`
196
+ - `name() view returns (string)`
197
+ - `price0CumulativeLast() view returns (uint256)`
198
+ - `price1CumulativeLast() view returns (uint256)`
199
+ - `skim(address to)`
200
+ - `swap(uint256 amount0Out, uint256 amount1Out, address to, bytes data)`
201
+ - `symbol() view returns (string)`
202
+ - `sync()`
203
+ - `token0() view returns (address)`
204
+ - `token1() view returns (address)`
205
+ - `totalSupply() view returns (uint256)`
206
+ - `transfer(address to, uint256 value) returns (bool)`
207
+ - `transferFrom(address from, address to, uint256 value) returns (bool)`
208
+ ### Events
209
+ - `Approval(address indexed owner, address indexed spender, uint256 value)`
210
+ - `Burn(address indexed sender, uint256 amount0, uint256 amount1, address indexed to)`
211
+ - `Mint(address indexed sender, uint256 amount0, uint256 amount1)`
212
+ - `Swap(address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to)`
213
+ - `Sync(uint112 reserve0, uint112 reserve1)`
214
+ - `Transfer(address indexed from, address indexed to, uint256 value)`
215
+ ### Errors
216
+ - (none)
217
+ ## QuantumSwapV2Router02
218
+ - **Exports**: `QuantumSwapV2Router02`, `QuantumSwapV2Router02__factory`
219
+ - **Constructor**: `constructor(address _factory, address _WETH)`
220
+ ### Files
221
+ - [`src/QuantumSwapV2Router02.js`](./src/QuantumSwapV2Router02.js)
222
+ - [`src/QuantumSwapV2Router02__factory.js`](./src/QuantumSwapV2Router02__factory.js)
223
+ ### Examples
224
+ - [deploy](./examples/deploy-QuantumSwapV2Router02.js)
225
+ - [read operations](./examples/read-operations-QuantumSwapV2Router02.js)
226
+ - [write operations](./examples/write-operations-QuantumSwapV2Router02.js)
227
+ - [events](./examples/events-QuantumSwapV2Router02.js)
228
+ ### Tests
229
+ - [transactional test](./test/e2e/QuantumSwapV2Router02.e2e.test.js)
230
+ ### Functions
231
+ - `addLiquidity(address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline) returns (uint256, uint256, uint256)`
232
+ - `addLiquidityETH(address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) payable returns (uint256, uint256, uint256)`
233
+ - `factory() view returns (address)`
234
+ - `getAmountIn(uint256 amountOut, uint256 reserveIn, uint256 reserveOut) pure returns (uint256)`
235
+ - `getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) pure returns (uint256)`
236
+ - `getAmountsIn(uint256 amountOut, address[] path) view returns (uint256[])`
237
+ - `getAmountsOut(uint256 amountIn, address[] path) view returns (uint256[])`
238
+ - `quote(uint256 amountA, uint256 reserveA, uint256 reserveB) pure returns (uint256)`
239
+ - `removeLiquidity(address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline) returns (uint256, uint256)`
240
+ - `removeLiquidityETH(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) returns (uint256, uint256)`
241
+ - `removeLiquidityETHSupportingFeeOnTransferTokens(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) returns (uint256)`
242
+ - `swapETHForExactTokens(uint256 amountOut, address[] path, address to, uint256 deadline) payable returns (uint256[])`
243
+ - `swapExactETHForTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline) payable returns (uint256[])`
244
+ - `swapExactETHForTokensSupportingFeeOnTransferTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline) payable`
245
+ - `swapExactTokensForETH(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns (uint256[])`
246
+ - `swapExactTokensForETHSupportingFeeOnTransferTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline)`
247
+ - `swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns (uint256[])`
248
+ - `swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline)`
249
+ - `swapTokensForExactETH(uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline) returns (uint256[])`
250
+ - `swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline) returns (uint256[])`
251
+ - `WETH() view returns (address)`
252
+ ### Events
253
+ - (none)
254
+ ### Errors
255
+ - (none)
256
+ ## WQ
257
+ - **Exports**: `WQ`, `WQ__factory`
258
+ - **Constructor**: `constructor()`
259
+ ### Files
260
+ - [`src/WQ.js`](./src/WQ.js)
261
+ - [`src/WQ__factory.js`](./src/WQ__factory.js)
262
+ ### Examples
263
+ - [deploy](./examples/deploy-WQ.js)
264
+ - [read operations](./examples/read-operations-WQ.js)
265
+ - [write operations](./examples/write-operations-WQ.js)
266
+ - [events](./examples/events-WQ.js)
267
+ ### Tests
268
+ - [transactional test](./test/e2e/WQ.e2e.test.js)
269
+ ### Functions
270
+ - `allowance(address, address) view returns (uint256)`
271
+ - `approve(address guy, uint256 wad) returns (bool)`
272
+ - `balanceOf(address) view returns (uint256)`
273
+ - `decimals() view returns (uint8)`
274
+ - `deposit() payable`
275
+ - `name() view returns (string)`
276
+ - `symbol() view returns (string)`
277
+ - `totalSupply() view returns (uint256)`
278
+ - `transfer(address dst, uint256 wad) returns (bool)`
279
+ - `transferFrom(address src, address dst, uint256 wad) returns (bool)`
280
+ - `withdraw(uint256 wad)`
281
+ ### Events
282
+ - `Approval(address indexed src, address indexed guy, uint256 wad)`
283
+ - `Deposit(address indexed dst, uint256 wad)`
284
+ - `Transfer(address indexed src, address indexed dst, uint256 wad)`
285
+ - `Withdrawal(address indexed src, uint256 wad)`
286
+ ### Errors
287
+ - (none)
@@ -0,0 +1,17 @@
1
+ const { Wallet } = require("quantumcoin");
2
+
3
+ // Hardcoded test wallet (test-only; never use for real funds)
4
+ const TEST_WALLET_ENCRYPTED_JSON =
5
+ "{\"address\":\"1a846abe71c8b989e8337c55d608be81c28ab3b2e40c83eaa2a68d516049aec6\",\"crypto\":{\"cipher\":\"aes-256-ctr\",\"ciphertext\":\"ab7e620dd66cb55ac201b9c6796de92bbb06f3681b5932eabe099871f1f7d79acabe30921a39ad13bfe74f42c515734882b6723760142aa3e26e011df514a534ae47bd15d86badd9c6f17c48d4c892711d54d441ee3a0ee0e5b060f816e79c7badd13ff4c235934b1986774223ecf6e8761388969bb239c759b54c8c70e6a2e27c93a4b70129c8159f461d271ae8f3573414c78b88e4d0abfa6365ed45456636d4ed971c7a0c6b84e6f0c2621e819268b135e2bcc169a54d1847b39e6ba2ae8ec969b69f330b7db9e785ed02204d5a1185915ae5338b0f40ef2a7f4d5aaf7563d502135e57f4eb89d5ec1efa5c77e374969d6cd85be625a2ed1225d68ecdd84067bfc69adb83ecd5c6050472eca28a5a646fcdd28077165c629975bec8a79fe1457cb53389b788b25e1f8eff8b2ca326d7dfcaba3f8839225a08057c018a458891fd2caa0d2b27632cffd80f592147ccec9a10dc8a08a48fb55047bff5cf85cda39eb089096bef63842fc3686412f298a54a9e4b0bf4ad36907ba373cbd6d32e7ac494af371da5aa9d38a3463220865114c4adc5e4ac258ba9c6af9fa2ddfd1aec2e16887e4b3977c69561df8599ac9d411c9dd2a4d57f92ea4e5c02aae3f49fb3bc83e16673e6c2dbe96bb181c8dfd0f9757ade2e4ff27215a836058c5ffeab042f6f97c7c02339f76a6284680e01b4bb733690eb3347fbfcc26614b8bf755f9dfce3fea9d4e4d15b164983201732c2e87593a86bca6da6972e128490338f76ae68135888070f4e59e90db54d23834769bdbda9769213faf5357f9167a224523975a946367b68f0cec98658575609f58bfd329e420a921c06713326e4cb20a0df1d77f37e78a320a637a96c604ca3fa89e24beb42313751b8f09b14f9c14c77e4fd13fc6382505d27c771bca0d821ec7c3765acffa99d83c50140a56b0b28101c762bd682fe55cb6f23cbeb3f421d7b36021010e45ac27160dd7ead99c864a1b550c7edb1246950fe32dcc049799f9085287f0a747a6ef7a023df46a23a22f3e833bbf8d404f84344870492658256ee1dfc40fda33bb8d48fc72d4520ba9fc820c9123104a045206809037709f2a5f6723fa77d6bac5a573823d4ec3a7f1cb786a52ee2697e622e5d75962fa554d1024a6c355e21f33a63b2b72e6c4742a8b1c373aa532b40518c38c90b5373c2eb8c9d7be2a9e16047a3ee09dc9a6849deac5183ace6cfe91a9bef2ffc0a7df6ccebfd4c858c84b0e0355650d7466971e66f1e3883013e5ad1be33199b1d110b79070ac1b745ccb14cf63a08f8cca3a21c9525e626ff5f0c34746e10750fb742ad51f11f2acae3676c2111853d7250d01b77821a6ba9e04400ba2c543ca9f2d701ae6f47bfad14ffe3039ee9e71f7b2401359ade9938750ddb9c5a8b018a7929ed8d0e717ff1861446ce17535e9b17c187711190aae3388bd9490837a636c25ed4d42d7079ad1a51e13292c683d5d012abcf46965c534b83ab53f2c1f0cf5830ef7582e06863a33c19a70511df632885d63245965047ea96b56f1af5b3b94a54999f784fb9574fdfcd7c1230e07a2aaa04acd3097b2b9f8ddba05ae9734491deb5c1a513c76ed276cb78bbf4839dae3156d76af444a5805129d5df791167a9c8576a1d7f760b2d2797c4658669608706fbd0ace1be2346f74862dfc9ef518e55632e43c043186e5d070deb34d12fb9e5aba84e5cb50213dc88efd39cc35bf42455aa82d5e3b707b3140be3b8623b34fdd81d08615c188ae8438a13881fdf6bf32f2cb9ff5fa625561040c6b71d4b8eccc90bc3b99650d28dd1ee63773e49664e3d48c484996b290943635a6f2eb1ce9796d3fa144a3f00ef82faaa32d6a413668f7b521517cb68b2b017fcf56c79326fa5e4060e643631ca3f0a0dc0ed718798b6f46b130d437c33f64039e887324b6f5e604b1669d613923794edbf04b1b3caea54793b52b44b170173a4f25c7ecef3b71e2aad76e556b1cb9f1d637ec52ececfa950dd31dbb6a60828a3ad34c1beffe09eb4785786d63bad10a0b0f66ea88c57380f38ea85f018dbd7f538cf1ee7624095b9a01ec5edd528f281168af020609e651ff316aa1320a710134ddfca600cc72174dcdb846d2aa29916488aa1b537b66da92e61af526debef4eb38c984569eaf549ff2129449269b492d030cd74d885f6f5785881cc4804b4a8a09ba4ff7aefe9074ac7d0c4f05d51fe4cc0ff7388a772092b9d02d70e5433a5cf3e02f46a6bd6b818d59a07ce3b9fbbf8b5faba74563bcc5240930c2d406c9aaee3e3ce0429bf68ac2b0a57adb09414cff50817d2a48fb9fa624ab863cb0c31a8b8dc5eaf6fa68cc1d7c6c685c5a33edd5c8933b9e8ab628ee428d0743699b2ff17f25586c7ce959280bb0b8c5342251f0a30b53dbc7bf1ee426ac9619c3560f811f2268ee37f189794e2e4b3db3a2fb2e34b649e504fb467438abfd1082619cc4a0b30d66beb831077812e418d2e2148db10cf4d4a29101ca52ec445b8d83519dd7de85a98e0beae9ee537096d3f1a55a7a80cdfa93d25f07c9f98e8af18cde19ec1f99c5dd4588b717a5039ddb7f177717caf0d0fd45420a70dbd6d3146890d9e450d5224146db4c33b779e3c3a04b976c052bad042ac57dd38be45407808c0fb0d7e2a8819e6cd53c6739e6612996ddaa6f066552590aa0343bc1e62b298ff2514a0cef8be21956c2e942816f7a3a3a0935eaf9b37251409ce444c986c3817e82835555fe18239f3ae33469d7965c2bde9991fde556bd07af01df52bbde0c35bb4ef48e3b5d0db53f8ca4ed35b83f760f0a1bc4ed9f86e85d6039a17df373c85402ef956f01db00eb39c4b74bd0660d29ee746714d9780d738e05c6cca414ce3d7b40dda8036a9eea9ab1388805f913eb19bdd3f09d9e161eaa50231bd9caba61971f194332dd28c696a60458c1c6c2cc5da8b1192611c7c553e9e12fe48ce46bbb891be8bb118721c86222e671ddd1da8f0ccb2b68e02f2014b4925e904e88369aaf7466bd7033a60c265d45955944916ecbdb84bf1b522b01b0149c632e04c568a7eb627c5bb90ece052ebcf79166c28b30d23fe52da0a5ab5dea83ca479a3e3b7a9cfbbfea04dbe6137c19d067317c2ec427a8c75a6b06bec6dcd5d5c0edc9aa80b9003b8e17c088b2f3db327d3e42630d82d20120240c3ba56232280787da4aabbf5bc95a864029f00710e195f2a76460a0317d10b552fe1bea097e41d49756c680a41d6ac186e62169b6b6cd7776ea84618b5b752328a5bacaa10aa122ff9b2698b43efe73d852a899db644863c8c9bc8068ea86ea843fd6fe36272b91cdc5d5317083ef3fd1e5462a0b0d0604dc57b3bbfceb0fca4cd349625dd7b25166af30efe5ee6a0af953a74d65f4736c59918ee55a3b0d9d9d42e04c7f8a77e479109f740e20c464d5d7e3d16805f47b61f403ff7f408c9e850d9baacd8067e544536a4953480b0f9ee9cd45f41ebd67b51f78788a6470cb1e5ca72ca346ce8a50d0ca0c921d5576a4455a1afb6d0bc688004712ee122cacdb29c51e84893324c27fa4a3f1917edf5352272b4c97579a6152e4b77663d0ab532915f2eeb6a862de8b696452321b660c3f2449673d086e95a7af28845a5259b763e0fcd09f72acf7b6c811066263060e5aa5b24658e880a01fd56bda4dad5ab604e129290f7d5489728f2a40968c6168b21cebbbcd11727cc9e9160c4e92e04387d3b0d62aab06a61f26daedd9fed11816ef2180172a47f47184ac4032b88758c98a2e0fb200f70e93ba695f5ebb7a1029610ad360d3b7fa1b4640b9dc674d3625eef786da93dff19bc7991b5d6193a3896664763fde479b5dfc04812111a80782854f2cf68ca7d82765cc9eb40fba4b44640710ed6e653abf9f07b466333f4fd22784d53cf40e17120f42caa841eaa24056b237827b0f47f7257c103c35027e9f503e5acfd023e7357b600d3084d361d5ee65ba319b45c153212a54e6fed85af7e43e0a926ebcbc2edf8de7e2ec9528f00bec262ad04d5c9dafccaea06a24748d28bf1799bae0e895543084539c50b5aaa4fb50d7431d6f0c8cee2a54aaf7ee7919b55bf40adb688632e5dbe273cea09e97b19c3d8e1f4de000deb66fa1942ad03a62d3252f51992244366c156000b49c297167a6cbdedea7ebae139d295f0ad298e0864249b905b7eb812886ec70ecdb286702274b5b8574149bf3866f9e46b997ff5ed622b169a0eb071347f18d530db1663906a28f4544ee4e004ab87b65476af30ede118052ff052b8dc986ca2c93dd5d4943266a579c7698ea014f688b3e8063a107feb162d392e2177b01bff77fb5abe5feebd0607158049a5a093325b7c9ee6b4dfa7a9f65c7c2fb628920d3603a1c2dad979eaa047cd661a268af1078c9788d720e64e4ce9d12e68de1e417ef2f293323681e1071f9220e1ee43d2e29d111b870ce3439f5100ecd4551ab65ee74aa1667e564957e9bc0ae1ea193980da2a0ec2698073388c85bec25ef447f0d5e93a5203fa44dff268e5cb799ed3b66e63d5e07b487e7534f24934c73a62a243e0151843a0fd3807711a101eaa7fc71f0ba68aebb9534d57cba41b094eebfb4c31cca8eddfa426f676aa347be8a7023a4e91ddb154b35cd4d5f7dbc2e5db491de99f33fc2cff2d57029ac950e1ccd681980af6a4e8969dfe39b3c7bfcbcf8fac92f1e6ec9fe572bfa6a7d65860eab2ed10ac01a71290b52e3148e84b7376a8605cd2bb0e8681ffc54691ce087685e33921bd44d36c78291713dce17569570f62137e6904f0d68cf53aa2ec395c389a75141f08114fb293ea63950e4ffee55ec6fc83cf44876b8e7f25cdd393ff87b9eda6eb746085b61a6900de191f0ce2cb388d61ece52e78bc47368194e8e00277e0d1631e6b9d4626ef76f8522582ccd5a40be3febc699bb510acc6271d55ff0f4cf3bb7669855a72efd9ca3e1056a2fe592a5bc877cce2b1f63b58383971da87873d2d1349cf5881242cdce4e7e2c5c514755746a0e0a7c2a6d9701cde005ae3420beb17c379a3516662253554f51f0423bb1844b0b90c54ed8177ceb0e1036a6609d836e748ca06c40ca64befadc6443ec286a0ce464678e8d11eb455f7bb305acebf6cb1f50e394a9bfeb752df1687831bac9cdd811f4f112ef6658d0f8799a866374ff96c5e2b79f30e7a74f8a2bc9ed1f88f01f30e30cb78ffb2bff10108f35e910ee3be4463e9e6f0ed910e8d598326e71dfa2277ffe5579d7fe9b6018bfe295b25219eae07b3b0270665c3fa00c3e0d180812b5cd62925585de84a7c48a9a86dba96544a251654d1966e082432dc85b6149cf21e91a46020ec32b66d28ba3b6a90c0617bc6fdd55aea819af2bcf84864ad60c28fe3c9f8339d0aee68b39d97f63b6e082835d86119cf9b9fdc8b827c847ce40aa10e1577a710132316845e825345e95bdf94d0c66ec65a6c4319fce4792313663b5f7a651a6710783e6ab71608ac6cbbf3af6911adf596ccf7c172b9bd5bceb6db379967b32b143bdd11d2ee12ddf64ecef6391e0f8570e6cddd3db95204919362b89b739fa94e7c1bfde799fd5e22aa25ca6ca42e30c08e23aae2385d99ebab441072a880dcefdab74a4c9bd39d363f6d1933d59400fca161d432aa00f23b1b1c19a154be8989699d549b66d44e39896f5523443bc6ddf4a65e91f1f3fb7b52318869a05856a4fc92f3694c81ed833c972fb918f7e5\",\"cipherparams\":{\"iv\":\"8c46d6162cd4c765759aedcbce2a5874\"},\"kdf\":\"scrypt\",\"kdfparams\":{\"dklen\":32,\"n\":262144,\"p\":1,\"r\":8,\"salt\":\"82fb6cdc6917609135277badacf15baa31899d08b71a5a0fa33167167c161537\"},\"mac\":\"9187b17f7eca48e6b8c586b0cd790dbe0feb876ac8385f93faa7d5e22a3c8fc7\"},\"id\":\"92caf6ee-2d43-48c0-859e-ffa1e0e23312\",\"version\":3}";
6
+ const TEST_WALLET_PASSPHRASE = "QuantumCoinExample123!";
7
+
8
+ function createTestWallet(provider) {
9
+ // Caller must have called Initialize() first.
10
+ return Wallet.fromEncryptedJsonSync(TEST_WALLET_ENCRYPTED_JSON, TEST_WALLET_PASSPHRASE, provider);
11
+ }
12
+
13
+ module.exports = {
14
+ TEST_WALLET_ENCRYPTED_JSON,
15
+ TEST_WALLET_PASSPHRASE,
16
+ createTestWallet,
17
+ };
@@ -0,0 +1,23 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { createTestWallet } = require("./_test-wallet");
4
+ const { IERC20__factory } = require("..");
5
+
6
+ async function main() {
7
+ const rpcUrl = process.env.QC_RPC_URL;
8
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
9
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
10
+ await Initialize(null);
11
+
12
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
13
+ const wallet = createTestWallet(provider);
14
+
15
+ const factory = new IERC20__factory(wallet);
16
+ const contract = await factory.deploy({ gasLimit: 600000 });
17
+ const tx = contract.deployTransaction();
18
+ if (tx) await tx.wait(1, 600_000);
19
+
20
+ console.log("Deployed IERC20 at:", contract.target);
21
+ }
22
+
23
+ main().catch((e) => { console.error(e); process.exitCode = 1; });
@@ -0,0 +1,23 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { createTestWallet } = require("./_test-wallet");
4
+ const { QuantumSwapV2ERC20__factory } = require("..");
5
+
6
+ async function main() {
7
+ const rpcUrl = process.env.QC_RPC_URL;
8
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
9
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
10
+ await Initialize(null);
11
+
12
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
13
+ const wallet = createTestWallet(provider);
14
+
15
+ const factory = new QuantumSwapV2ERC20__factory(wallet);
16
+ const contract = await factory.deploy({ gasLimit: 600000 });
17
+ const tx = contract.deployTransaction();
18
+ if (tx) await tx.wait(1, 600_000);
19
+
20
+ console.log("Deployed QuantumSwapV2ERC20 at:", contract.target);
21
+ }
22
+
23
+ main().catch((e) => { console.error(e); process.exitCode = 1; });
@@ -0,0 +1,23 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { createTestWallet } = require("./_test-wallet");
4
+ const { QuantumSwapV2Factory__factory } = require("..");
5
+
6
+ async function main() {
7
+ const rpcUrl = process.env.QC_RPC_URL;
8
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
9
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
10
+ await Initialize(null);
11
+
12
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
13
+ const wallet = createTestWallet(provider);
14
+
15
+ const factory = new QuantumSwapV2Factory__factory(wallet);
16
+ const contract = await factory.deploy(wallet.address, { gasLimit: 600000 });
17
+ const tx = contract.deployTransaction();
18
+ if (tx) await tx.wait(1, 600_000);
19
+
20
+ console.log("Deployed QuantumSwapV2Factory at:", contract.target);
21
+ }
22
+
23
+ main().catch((e) => { console.error(e); process.exitCode = 1; });
@@ -0,0 +1,23 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { createTestWallet } = require("./_test-wallet");
4
+ const { QuantumSwapV2Pair__factory } = require("..");
5
+
6
+ async function main() {
7
+ const rpcUrl = process.env.QC_RPC_URL;
8
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
9
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
10
+ await Initialize(null);
11
+
12
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
13
+ const wallet = createTestWallet(provider);
14
+
15
+ const factory = new QuantumSwapV2Pair__factory(wallet);
16
+ const contract = await factory.deploy({ gasLimit: 600000 });
17
+ const tx = contract.deployTransaction();
18
+ if (tx) await tx.wait(1, 600_000);
19
+
20
+ console.log("Deployed QuantumSwapV2Pair at:", contract.target);
21
+ }
22
+
23
+ main().catch((e) => { console.error(e); process.exitCode = 1; });
@@ -0,0 +1,23 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { createTestWallet } = require("./_test-wallet");
4
+ const { QuantumSwapV2Router02__factory } = require("..");
5
+
6
+ async function main() {
7
+ const rpcUrl = process.env.QC_RPC_URL;
8
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
9
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
10
+ await Initialize(null);
11
+
12
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
13
+ const wallet = createTestWallet(provider);
14
+
15
+ const factory = new QuantumSwapV2Router02__factory(wallet);
16
+ const contract = await factory.deploy(wallet.address, wallet.address, { gasLimit: 600000 });
17
+ const tx = contract.deployTransaction();
18
+ if (tx) await tx.wait(1, 600_000);
19
+
20
+ console.log("Deployed QuantumSwapV2Router02 at:", contract.target);
21
+ }
22
+
23
+ main().catch((e) => { console.error(e); process.exitCode = 1; });
@@ -0,0 +1,23 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { createTestWallet } = require("./_test-wallet");
4
+ const { WQ__factory } = require("..");
5
+
6
+ async function main() {
7
+ const rpcUrl = process.env.QC_RPC_URL;
8
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
9
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
10
+ await Initialize(null);
11
+
12
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
13
+ const wallet = createTestWallet(provider);
14
+
15
+ const factory = new WQ__factory(wallet);
16
+ const contract = await factory.deploy({ gasLimit: 600000 });
17
+ const tx = contract.deployTransaction();
18
+ if (tx) await tx.wait(1, 600_000);
19
+
20
+ console.log("Deployed WQ at:", contract.target);
21
+ }
22
+
23
+ main().catch((e) => { console.error(e); process.exitCode = 1; });
@@ -0,0 +1,20 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { IERC20 } = require("..");
4
+
5
+ async function main() {
6
+ const rpcUrl = process.env.QC_RPC_URL;
7
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
8
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
9
+ const address = process.env.CONTRACT_ADDRESS;
10
+ if (!address) throw new Error("CONTRACT_ADDRESS is required");
11
+ await Initialize(null);
12
+
13
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const contract = IERC20.connect(address, provider);
15
+
16
+ const logs = await contract.queryFilter("Transfer", "latest", "latest");
17
+ console.log("Logs:", logs.length);
18
+ }
19
+
20
+ main().catch((e) => { console.error(e); process.exitCode = 1; });
@@ -0,0 +1,20 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { QuantumSwapV2ERC20 } = require("..");
4
+
5
+ async function main() {
6
+ const rpcUrl = process.env.QC_RPC_URL;
7
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
8
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
9
+ const address = process.env.CONTRACT_ADDRESS;
10
+ if (!address) throw new Error("CONTRACT_ADDRESS is required");
11
+ await Initialize(null);
12
+
13
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const contract = QuantumSwapV2ERC20.connect(address, provider);
15
+
16
+ const logs = await contract.queryFilter("Transfer", "latest", "latest");
17
+ console.log("Logs:", logs.length);
18
+ }
19
+
20
+ main().catch((e) => { console.error(e); process.exitCode = 1; });
@@ -0,0 +1,20 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { QuantumSwapV2Factory } = require("..");
4
+
5
+ async function main() {
6
+ const rpcUrl = process.env.QC_RPC_URL;
7
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
8
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
9
+ const address = process.env.CONTRACT_ADDRESS;
10
+ if (!address) throw new Error("CONTRACT_ADDRESS is required");
11
+ await Initialize(null);
12
+
13
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const contract = QuantumSwapV2Factory.connect(address, provider);
15
+
16
+ const logs = await contract.queryFilter("Transfer", "latest", "latest");
17
+ console.log("Logs:", logs.length);
18
+ }
19
+
20
+ main().catch((e) => { console.error(e); process.exitCode = 1; });
@@ -0,0 +1,20 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { QuantumSwapV2Pair } = require("..");
4
+
5
+ async function main() {
6
+ const rpcUrl = process.env.QC_RPC_URL;
7
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
8
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
9
+ const address = process.env.CONTRACT_ADDRESS;
10
+ if (!address) throw new Error("CONTRACT_ADDRESS is required");
11
+ await Initialize(null);
12
+
13
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const contract = QuantumSwapV2Pair.connect(address, provider);
15
+
16
+ const logs = await contract.queryFilter("Transfer", "latest", "latest");
17
+ console.log("Logs:", logs.length);
18
+ }
19
+
20
+ main().catch((e) => { console.error(e); process.exitCode = 1; });
@@ -0,0 +1,20 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { QuantumSwapV2Router02 } = require("..");
4
+
5
+ async function main() {
6
+ const rpcUrl = process.env.QC_RPC_URL;
7
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
8
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
9
+ const address = process.env.CONTRACT_ADDRESS;
10
+ if (!address) throw new Error("CONTRACT_ADDRESS is required");
11
+ await Initialize(null);
12
+
13
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const contract = QuantumSwapV2Router02.connect(address, provider);
15
+
16
+ const logs = await contract.queryFilter("Transfer", "latest", "latest");
17
+ console.log("Logs:", logs.length);
18
+ }
19
+
20
+ main().catch((e) => { console.error(e); process.exitCode = 1; });
@@ -0,0 +1,20 @@
1
+ const { Initialize } = require("quantumcoin/config");
2
+ const { JsonRpcProvider } = require("quantumcoin");
3
+ const { WQ } = require("..");
4
+
5
+ async function main() {
6
+ const rpcUrl = process.env.QC_RPC_URL;
7
+ if (!rpcUrl) throw new Error("QC_RPC_URL is required");
8
+ const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;
9
+ const address = process.env.CONTRACT_ADDRESS;
10
+ if (!address) throw new Error("CONTRACT_ADDRESS is required");
11
+ await Initialize(null);
12
+
13
+ const provider = new JsonRpcProvider(rpcUrl, chainId);
14
+ const contract = WQ.connect(address, provider);
15
+
16
+ const logs = await contract.queryFilter("Transfer", "latest", "latest");
17
+ console.log("Logs:", logs.length);
18
+ }
19
+
20
+ main().catch((e) => { console.error(e); process.exitCode = 1; });