quantumswap 0.0.6 → 0.0.8

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 (38) hide show
  1. package/README.md +307 -307
  2. package/examples/README.md +46 -46
  3. package/examples/package-lock.json +12 -12
  4. package/examples/package.json +1 -1
  5. package/index.d.ts +1 -1
  6. package/index.js +45 -45
  7. package/package.json +32 -32
  8. package/src/IERC20.d.ts +24 -24
  9. package/src/IERC20.js +348 -348
  10. package/src/IERC20__factory.d.ts +10 -10
  11. package/src/IERC20__factory.js +29 -29
  12. package/src/QuantumSwapV2ERC20.d.ts +24 -24
  13. package/src/QuantumSwapV2ERC20.js +353 -353
  14. package/src/QuantumSwapV2ERC20__factory.d.ts +10 -10
  15. package/src/QuantumSwapV2ERC20__factory.js +29 -29
  16. package/src/QuantumSwapV2Factory.d.ts +24 -24
  17. package/src/QuantumSwapV2Factory.js +310 -310
  18. package/src/QuantumSwapV2Factory__factory.d.ts +10 -10
  19. package/src/QuantumSwapV2Factory__factory.js +29 -29
  20. package/src/QuantumSwapV2Pair.d.ts +44 -44
  21. package/src/QuantumSwapV2Pair.js +847 -847
  22. package/src/QuantumSwapV2Pair__factory.d.ts +10 -10
  23. package/src/QuantumSwapV2Pair__factory.js +29 -29
  24. package/src/QuantumSwapV2Router02.d.ts +47 -47
  25. package/src/QuantumSwapV2Router02.js +1109 -1109
  26. package/src/QuantumSwapV2Router02__factory.d.ts +10 -10
  27. package/src/QuantumSwapV2Router02__factory.js +29 -29
  28. package/src/WQ.d.ts +28 -28
  29. package/src/WQ.js +435 -435
  30. package/src/WQ__factory.d.ts +10 -10
  31. package/src/WQ__factory.js +29 -29
  32. package/src/index.d.ts +14 -14
  33. package/src/index.js +15 -15
  34. package/src/quantumcoin-shims.d.ts +25 -25
  35. package/src/types.d.ts +3 -3
  36. package/src/types.js +3 -3
  37. package/test/e2e/IERC20.e2e.test.js +8 -13
  38. package/test/e2e/all-contracts.e2e.test.js +10 -5
package/src/IERC20.js CHANGED
@@ -1,348 +1,348 @@
1
- // Auto-generated by sdkgen
2
- const { Contract } = require("quantumcoin");
3
-
4
- /**
5
- * IERC20 - A typed contract interface for IERC20
6
- */
7
- class IERC20 extends Contract {
8
- static abi = [
9
- {
10
- "anonymous": false,
11
- "inputs": [
12
- {
13
- "indexed": true,
14
- "internalType": "address",
15
- "name": "owner",
16
- "type": "address"
17
- },
18
- {
19
- "indexed": true,
20
- "internalType": "address",
21
- "name": "spender",
22
- "type": "address"
23
- },
24
- {
25
- "indexed": false,
26
- "internalType": "uint256",
27
- "name": "value",
28
- "type": "uint256"
29
- }
30
- ],
31
- "name": "Approval",
32
- "type": "event"
33
- },
34
- {
35
- "anonymous": false,
36
- "inputs": [
37
- {
38
- "indexed": true,
39
- "internalType": "address",
40
- "name": "from",
41
- "type": "address"
42
- },
43
- {
44
- "indexed": true,
45
- "internalType": "address",
46
- "name": "to",
47
- "type": "address"
48
- },
49
- {
50
- "indexed": false,
51
- "internalType": "uint256",
52
- "name": "value",
53
- "type": "uint256"
54
- }
55
- ],
56
- "name": "Transfer",
57
- "type": "event"
58
- },
59
- {
60
- "inputs": [
61
- {
62
- "internalType": "address",
63
- "name": "owner",
64
- "type": "address"
65
- },
66
- {
67
- "internalType": "address",
68
- "name": "spender",
69
- "type": "address"
70
- }
71
- ],
72
- "name": "allowance",
73
- "outputs": [
74
- {
75
- "internalType": "uint256",
76
- "name": "",
77
- "type": "uint256"
78
- }
79
- ],
80
- "stateMutability": "view",
81
- "type": "function"
82
- },
83
- {
84
- "inputs": [
85
- {
86
- "internalType": "address",
87
- "name": "spender",
88
- "type": "address"
89
- },
90
- {
91
- "internalType": "uint256",
92
- "name": "value",
93
- "type": "uint256"
94
- }
95
- ],
96
- "name": "approve",
97
- "outputs": [
98
- {
99
- "internalType": "bool",
100
- "name": "",
101
- "type": "bool"
102
- }
103
- ],
104
- "stateMutability": "nonpayable",
105
- "type": "function"
106
- },
107
- {
108
- "inputs": [
109
- {
110
- "internalType": "address",
111
- "name": "owner",
112
- "type": "address"
113
- }
114
- ],
115
- "name": "balanceOf",
116
- "outputs": [
117
- {
118
- "internalType": "uint256",
119
- "name": "",
120
- "type": "uint256"
121
- }
122
- ],
123
- "stateMutability": "view",
124
- "type": "function"
125
- },
126
- {
127
- "inputs": [],
128
- "name": "decimals",
129
- "outputs": [
130
- {
131
- "internalType": "uint8",
132
- "name": "",
133
- "type": "uint8"
134
- }
135
- ],
136
- "stateMutability": "view",
137
- "type": "function"
138
- },
139
- {
140
- "inputs": [],
141
- "name": "name",
142
- "outputs": [
143
- {
144
- "internalType": "string",
145
- "name": "",
146
- "type": "string"
147
- }
148
- ],
149
- "stateMutability": "view",
150
- "type": "function"
151
- },
152
- {
153
- "inputs": [],
154
- "name": "symbol",
155
- "outputs": [
156
- {
157
- "internalType": "string",
158
- "name": "",
159
- "type": "string"
160
- }
161
- ],
162
- "stateMutability": "view",
163
- "type": "function"
164
- },
165
- {
166
- "inputs": [],
167
- "name": "totalSupply",
168
- "outputs": [
169
- {
170
- "internalType": "uint256",
171
- "name": "",
172
- "type": "uint256"
173
- }
174
- ],
175
- "stateMutability": "view",
176
- "type": "function"
177
- },
178
- {
179
- "inputs": [
180
- {
181
- "internalType": "address",
182
- "name": "to",
183
- "type": "address"
184
- },
185
- {
186
- "internalType": "uint256",
187
- "name": "value",
188
- "type": "uint256"
189
- }
190
- ],
191
- "name": "transfer",
192
- "outputs": [
193
- {
194
- "internalType": "bool",
195
- "name": "",
196
- "type": "bool"
197
- }
198
- ],
199
- "stateMutability": "nonpayable",
200
- "type": "function"
201
- },
202
- {
203
- "inputs": [
204
- {
205
- "internalType": "address",
206
- "name": "from",
207
- "type": "address"
208
- },
209
- {
210
- "internalType": "address",
211
- "name": "to",
212
- "type": "address"
213
- },
214
- {
215
- "internalType": "uint256",
216
- "name": "value",
217
- "type": "uint256"
218
- }
219
- ],
220
- "name": "transferFrom",
221
- "outputs": [
222
- {
223
- "internalType": "bool",
224
- "name": "",
225
- "type": "bool"
226
- }
227
- ],
228
- "stateMutability": "nonpayable",
229
- "type": "function"
230
- }
231
- ];
232
- static bytecode = "0x";
233
-
234
- static connect(address, runner) {
235
- return new IERC20(address, runner);
236
- }
237
-
238
- constructor(address, runner, _deployTx) {
239
- super(address, IERC20.abi, runner, IERC20.bytecode);
240
- this._deployTx = _deployTx;
241
-
242
- // Typed populateTransaction helpers (offline signing / sendRawTransaction flows)
243
- this.populateTransaction = {
244
- approve: async (spender, value, overrides) => {
245
- const data = this.interface.encodeFunctionData("approve", [spender, value]);
246
- return { to: this.address, data, ...(overrides || {}) };
247
- },
248
- transfer: async (to, value, overrides) => {
249
- const data = this.interface.encodeFunctionData("transfer", [to, value]);
250
- return { to: this.address, data, ...(overrides || {}) };
251
- },
252
- transferFrom: async (from, to, value, overrides) => {
253
- const data = this.interface.encodeFunctionData("transferFrom", [from, to, value]);
254
- return { to: this.address, data, ...(overrides || {}) };
255
- },
256
- };
257
- }
258
-
259
- /**
260
- * allowance
261
- * @param {import("quantumcoin/types").AddressLike} owner
262
- * @param {import("quantumcoin/types").AddressLike} spender
263
- * @returns {Promise<import("quantumcoin/types").Uint256>}
264
- */
265
- async allowance(owner, spender) {
266
- const res = await this.call("allowance", [owner, spender]);
267
- return Array.isArray(res) ? res[0] : res;
268
- }
269
-
270
- /**
271
- * approve
272
- * @param {import("quantumcoin/types").AddressLike} spender
273
- * @param {import("quantumcoin/types").Uint256Like} value
274
- * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
275
- */
276
- async approve(spender, value, overrides) {
277
- return this.send("approve", [spender, value], overrides);
278
- }
279
-
280
- /**
281
- * balanceOf
282
- * @param {import("quantumcoin/types").AddressLike} owner
283
- * @returns {Promise<import("quantumcoin/types").Uint256>}
284
- */
285
- async balanceOf(owner) {
286
- const res = await this.call("balanceOf", [owner]);
287
- return Array.isArray(res) ? res[0] : res;
288
- }
289
-
290
- /**
291
- * decimals
292
- * @returns {Promise<import("quantumcoin/types").Uint8>}
293
- */
294
- async decimals() {
295
- const res = await this.call("decimals", []);
296
- return Array.isArray(res) ? res[0] : res;
297
- }
298
-
299
- /**
300
- * name
301
- * @returns {Promise<string>}
302
- */
303
- async name() {
304
- const res = await this.call("name", []);
305
- return Array.isArray(res) ? res[0] : res;
306
- }
307
-
308
- /**
309
- * symbol
310
- * @returns {Promise<string>}
311
- */
312
- async symbol() {
313
- const res = await this.call("symbol", []);
314
- return Array.isArray(res) ? res[0] : res;
315
- }
316
-
317
- /**
318
- * totalSupply
319
- * @returns {Promise<import("quantumcoin/types").Uint256>}
320
- */
321
- async totalSupply() {
322
- const res = await this.call("totalSupply", []);
323
- return Array.isArray(res) ? res[0] : res;
324
- }
325
-
326
- /**
327
- * transfer
328
- * @param {import("quantumcoin/types").AddressLike} to
329
- * @param {import("quantumcoin/types").Uint256Like} value
330
- * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
331
- */
332
- async transfer(to, value, overrides) {
333
- return this.send("transfer", [to, value], overrides);
334
- }
335
-
336
- /**
337
- * transferFrom
338
- * @param {import("quantumcoin/types").AddressLike} from
339
- * @param {import("quantumcoin/types").AddressLike} to
340
- * @param {import("quantumcoin/types").Uint256Like} value
341
- * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
342
- */
343
- async transferFrom(from, to, value, overrides) {
344
- return this.send("transferFrom", [from, to, value], overrides);
345
- }
346
- }
347
-
348
- module.exports = { IERC20 };
1
+ // Auto-generated by sdkgen
2
+ const { Contract } = require("quantumcoin");
3
+
4
+ /**
5
+ * IERC20 - A typed contract interface for IERC20
6
+ */
7
+ class IERC20 extends Contract {
8
+ static abi = [
9
+ {
10
+ "anonymous": false,
11
+ "inputs": [
12
+ {
13
+ "indexed": true,
14
+ "internalType": "address",
15
+ "name": "owner",
16
+ "type": "address"
17
+ },
18
+ {
19
+ "indexed": true,
20
+ "internalType": "address",
21
+ "name": "spender",
22
+ "type": "address"
23
+ },
24
+ {
25
+ "indexed": false,
26
+ "internalType": "uint256",
27
+ "name": "value",
28
+ "type": "uint256"
29
+ }
30
+ ],
31
+ "name": "Approval",
32
+ "type": "event"
33
+ },
34
+ {
35
+ "anonymous": false,
36
+ "inputs": [
37
+ {
38
+ "indexed": true,
39
+ "internalType": "address",
40
+ "name": "from",
41
+ "type": "address"
42
+ },
43
+ {
44
+ "indexed": true,
45
+ "internalType": "address",
46
+ "name": "to",
47
+ "type": "address"
48
+ },
49
+ {
50
+ "indexed": false,
51
+ "internalType": "uint256",
52
+ "name": "value",
53
+ "type": "uint256"
54
+ }
55
+ ],
56
+ "name": "Transfer",
57
+ "type": "event"
58
+ },
59
+ {
60
+ "inputs": [
61
+ {
62
+ "internalType": "address",
63
+ "name": "owner",
64
+ "type": "address"
65
+ },
66
+ {
67
+ "internalType": "address",
68
+ "name": "spender",
69
+ "type": "address"
70
+ }
71
+ ],
72
+ "name": "allowance",
73
+ "outputs": [
74
+ {
75
+ "internalType": "uint256",
76
+ "name": "",
77
+ "type": "uint256"
78
+ }
79
+ ],
80
+ "stateMutability": "view",
81
+ "type": "function"
82
+ },
83
+ {
84
+ "inputs": [
85
+ {
86
+ "internalType": "address",
87
+ "name": "spender",
88
+ "type": "address"
89
+ },
90
+ {
91
+ "internalType": "uint256",
92
+ "name": "value",
93
+ "type": "uint256"
94
+ }
95
+ ],
96
+ "name": "approve",
97
+ "outputs": [
98
+ {
99
+ "internalType": "bool",
100
+ "name": "",
101
+ "type": "bool"
102
+ }
103
+ ],
104
+ "stateMutability": "nonpayable",
105
+ "type": "function"
106
+ },
107
+ {
108
+ "inputs": [
109
+ {
110
+ "internalType": "address",
111
+ "name": "owner",
112
+ "type": "address"
113
+ }
114
+ ],
115
+ "name": "balanceOf",
116
+ "outputs": [
117
+ {
118
+ "internalType": "uint256",
119
+ "name": "",
120
+ "type": "uint256"
121
+ }
122
+ ],
123
+ "stateMutability": "view",
124
+ "type": "function"
125
+ },
126
+ {
127
+ "inputs": [],
128
+ "name": "decimals",
129
+ "outputs": [
130
+ {
131
+ "internalType": "uint8",
132
+ "name": "",
133
+ "type": "uint8"
134
+ }
135
+ ],
136
+ "stateMutability": "view",
137
+ "type": "function"
138
+ },
139
+ {
140
+ "inputs": [],
141
+ "name": "name",
142
+ "outputs": [
143
+ {
144
+ "internalType": "string",
145
+ "name": "",
146
+ "type": "string"
147
+ }
148
+ ],
149
+ "stateMutability": "view",
150
+ "type": "function"
151
+ },
152
+ {
153
+ "inputs": [],
154
+ "name": "symbol",
155
+ "outputs": [
156
+ {
157
+ "internalType": "string",
158
+ "name": "",
159
+ "type": "string"
160
+ }
161
+ ],
162
+ "stateMutability": "view",
163
+ "type": "function"
164
+ },
165
+ {
166
+ "inputs": [],
167
+ "name": "totalSupply",
168
+ "outputs": [
169
+ {
170
+ "internalType": "uint256",
171
+ "name": "",
172
+ "type": "uint256"
173
+ }
174
+ ],
175
+ "stateMutability": "view",
176
+ "type": "function"
177
+ },
178
+ {
179
+ "inputs": [
180
+ {
181
+ "internalType": "address",
182
+ "name": "to",
183
+ "type": "address"
184
+ },
185
+ {
186
+ "internalType": "uint256",
187
+ "name": "value",
188
+ "type": "uint256"
189
+ }
190
+ ],
191
+ "name": "transfer",
192
+ "outputs": [
193
+ {
194
+ "internalType": "bool",
195
+ "name": "",
196
+ "type": "bool"
197
+ }
198
+ ],
199
+ "stateMutability": "nonpayable",
200
+ "type": "function"
201
+ },
202
+ {
203
+ "inputs": [
204
+ {
205
+ "internalType": "address",
206
+ "name": "from",
207
+ "type": "address"
208
+ },
209
+ {
210
+ "internalType": "address",
211
+ "name": "to",
212
+ "type": "address"
213
+ },
214
+ {
215
+ "internalType": "uint256",
216
+ "name": "value",
217
+ "type": "uint256"
218
+ }
219
+ ],
220
+ "name": "transferFrom",
221
+ "outputs": [
222
+ {
223
+ "internalType": "bool",
224
+ "name": "",
225
+ "type": "bool"
226
+ }
227
+ ],
228
+ "stateMutability": "nonpayable",
229
+ "type": "function"
230
+ }
231
+ ];
232
+ static bytecode = "0x";
233
+
234
+ static connect(address, runner) {
235
+ return new IERC20(address, runner);
236
+ }
237
+
238
+ constructor(address, runner, _deployTx) {
239
+ super(address, IERC20.abi, runner, IERC20.bytecode);
240
+ this._deployTx = _deployTx;
241
+
242
+ // Typed populateTransaction helpers (offline signing / sendRawTransaction flows)
243
+ this.populateTransaction = {
244
+ approve: async (spender, value, overrides) => {
245
+ const data = this.interface.encodeFunctionData("approve", [spender, value]);
246
+ return { to: this.address, data, ...(overrides || {}) };
247
+ },
248
+ transfer: async (to, value, overrides) => {
249
+ const data = this.interface.encodeFunctionData("transfer", [to, value]);
250
+ return { to: this.address, data, ...(overrides || {}) };
251
+ },
252
+ transferFrom: async (from, to, value, overrides) => {
253
+ const data = this.interface.encodeFunctionData("transferFrom", [from, to, value]);
254
+ return { to: this.address, data, ...(overrides || {}) };
255
+ },
256
+ };
257
+ }
258
+
259
+ /**
260
+ * allowance
261
+ * @param {import("quantumcoin/types").AddressLike} owner
262
+ * @param {import("quantumcoin/types").AddressLike} spender
263
+ * @returns {Promise<import("quantumcoin/types").Uint256>}
264
+ */
265
+ async allowance(owner, spender) {
266
+ const res = await this.call("allowance", [owner, spender]);
267
+ return Array.isArray(res) ? res[0] : res;
268
+ }
269
+
270
+ /**
271
+ * approve
272
+ * @param {import("quantumcoin/types").AddressLike} spender
273
+ * @param {import("quantumcoin/types").Uint256Like} value
274
+ * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
275
+ */
276
+ async approve(spender, value, overrides) {
277
+ return this.send("approve", [spender, value], overrides);
278
+ }
279
+
280
+ /**
281
+ * balanceOf
282
+ * @param {import("quantumcoin/types").AddressLike} owner
283
+ * @returns {Promise<import("quantumcoin/types").Uint256>}
284
+ */
285
+ async balanceOf(owner) {
286
+ const res = await this.call("balanceOf", [owner]);
287
+ return Array.isArray(res) ? res[0] : res;
288
+ }
289
+
290
+ /**
291
+ * decimals
292
+ * @returns {Promise<import("quantumcoin/types").Uint8>}
293
+ */
294
+ async decimals() {
295
+ const res = await this.call("decimals", []);
296
+ return Array.isArray(res) ? res[0] : res;
297
+ }
298
+
299
+ /**
300
+ * name
301
+ * @returns {Promise<string>}
302
+ */
303
+ async name() {
304
+ const res = await this.call("name", []);
305
+ return Array.isArray(res) ? res[0] : res;
306
+ }
307
+
308
+ /**
309
+ * symbol
310
+ * @returns {Promise<string>}
311
+ */
312
+ async symbol() {
313
+ const res = await this.call("symbol", []);
314
+ return Array.isArray(res) ? res[0] : res;
315
+ }
316
+
317
+ /**
318
+ * totalSupply
319
+ * @returns {Promise<import("quantumcoin/types").Uint256>}
320
+ */
321
+ async totalSupply() {
322
+ const res = await this.call("totalSupply", []);
323
+ return Array.isArray(res) ? res[0] : res;
324
+ }
325
+
326
+ /**
327
+ * transfer
328
+ * @param {import("quantumcoin/types").AddressLike} to
329
+ * @param {import("quantumcoin/types").Uint256Like} value
330
+ * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
331
+ */
332
+ async transfer(to, value, overrides) {
333
+ return this.send("transfer", [to, value], overrides);
334
+ }
335
+
336
+ /**
337
+ * transferFrom
338
+ * @param {import("quantumcoin/types").AddressLike} from
339
+ * @param {import("quantumcoin/types").AddressLike} to
340
+ * @param {import("quantumcoin/types").Uint256Like} value
341
+ * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
342
+ */
343
+ async transferFrom(from, to, value, overrides) {
344
+ return this.send("transferFrom", [from, to, value], overrides);
345
+ }
346
+ }
347
+
348
+ module.exports = { IERC20 };