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.
- package/README.md +307 -307
- package/examples/README.md +46 -46
- package/examples/package-lock.json +12 -12
- package/examples/package.json +1 -1
- package/index.d.ts +1 -1
- package/index.js +45 -45
- package/package.json +32 -32
- package/src/IERC20.d.ts +24 -24
- package/src/IERC20.js +348 -348
- package/src/IERC20__factory.d.ts +10 -10
- package/src/IERC20__factory.js +29 -29
- package/src/QuantumSwapV2ERC20.d.ts +24 -24
- package/src/QuantumSwapV2ERC20.js +353 -353
- package/src/QuantumSwapV2ERC20__factory.d.ts +10 -10
- package/src/QuantumSwapV2ERC20__factory.js +29 -29
- package/src/QuantumSwapV2Factory.d.ts +24 -24
- package/src/QuantumSwapV2Factory.js +310 -310
- package/src/QuantumSwapV2Factory__factory.d.ts +10 -10
- package/src/QuantumSwapV2Factory__factory.js +29 -29
- package/src/QuantumSwapV2Pair.d.ts +44 -44
- package/src/QuantumSwapV2Pair.js +847 -847
- package/src/QuantumSwapV2Pair__factory.d.ts +10 -10
- package/src/QuantumSwapV2Pair__factory.js +29 -29
- package/src/QuantumSwapV2Router02.d.ts +47 -47
- package/src/QuantumSwapV2Router02.js +1109 -1109
- package/src/QuantumSwapV2Router02__factory.d.ts +10 -10
- package/src/QuantumSwapV2Router02__factory.js +29 -29
- package/src/WQ.d.ts +28 -28
- package/src/WQ.js +435 -435
- package/src/WQ__factory.d.ts +10 -10
- package/src/WQ__factory.js +29 -29
- package/src/index.d.ts +14 -14
- package/src/index.js +15 -15
- package/src/quantumcoin-shims.d.ts +25 -25
- package/src/types.d.ts +3 -3
- package/src/types.js +3 -3
- package/test/e2e/IERC20.e2e.test.js +8 -13
- package/test/e2e/all-contracts.e2e.test.js +10 -5
package/examples/README.md
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
# QuantumSwap SDK Examples
|
|
2
|
-
|
|
3
|
-
This folder is a **standalone package** that depends on the QuantumSwap SDK. Examples use `quantumswap` as a dependency instead of the parent repo.
|
|
4
|
-
|
|
5
|
-
## Setup
|
|
6
|
-
|
|
7
|
-
From this directory:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
cd examples
|
|
11
|
-
npm install
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
This installs `quantumswap` (from the parent via `file:..`) and `quantumcoin`. You can run any example from the `examples/` folder.
|
|
15
|
-
|
|
16
|
-
## Running examples
|
|
17
|
-
|
|
18
|
-
- **Full DEX flow (pre-deployed WQ/Factory/Router, deploy tokens, pair, liquidity, swap):**
|
|
19
|
-
`npm run run-dex-flow` or `node run-dex-flow-custom.js` (JS) / `npx ts-node run-dex-flow-custom.ts` (TS).
|
|
20
|
-
Set `QC_RPC_URL` (default `http://127.0.0.1:8545`), optionally `QC_CHAIN_ID`, `QC_WALLET_JSON`, `QC_WALLET_PASSPHRASE`.
|
|
21
|
-
|
|
22
|
-
- **Contract-specific examples:**
|
|
23
|
-
Deploy: `node deploy-WQ.js`, `node deploy-QuantumSwapV2Factory.js`, etc.
|
|
24
|
-
Read/events/write/offline-signing: `node read-operations-WQ.js`, `node events-WQ.js`, etc.
|
|
25
|
-
|
|
26
|
-
## Package layout
|
|
27
|
-
|
|
28
|
-
- **package.json** — `quantumswap-examples` with dependency `quantumswap` (`file:..`) and `quantumcoin`.
|
|
29
|
-
- **\_test-wallet.js** — Default test wallet helper used by examples (requires `quantumcoin`).
|
|
30
|
-
- All example scripts `require("quantumswap")` for SDK types and factories.
|
|
31
|
-
|
|
32
|
-
## Using a published SDK
|
|
33
|
-
|
|
34
|
-
To use the published npm package instead of the local repo, in `examples/package.json` change:
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
"quantumswap": "file:.."
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
to:
|
|
41
|
-
|
|
42
|
-
```json
|
|
43
|
-
"quantumswap": "^0.0.1"
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Then run `npm install` in `examples/`.
|
|
1
|
+
# QuantumSwap SDK Examples
|
|
2
|
+
|
|
3
|
+
This folder is a **standalone package** that depends on the QuantumSwap SDK. Examples use `quantumswap` as a dependency instead of the parent repo.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
From this directory:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cd examples
|
|
11
|
+
npm install
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This installs `quantumswap` (from the parent via `file:..`) and `quantumcoin`. You can run any example from the `examples/` folder.
|
|
15
|
+
|
|
16
|
+
## Running examples
|
|
17
|
+
|
|
18
|
+
- **Full DEX flow (pre-deployed WQ/Factory/Router, deploy tokens, pair, liquidity, swap):**
|
|
19
|
+
`npm run run-dex-flow` or `node run-dex-flow-custom.js` (JS) / `npx ts-node run-dex-flow-custom.ts` (TS).
|
|
20
|
+
Set `QC_RPC_URL` (default `http://127.0.0.1:8545`), optionally `QC_CHAIN_ID`, `QC_WALLET_JSON`, `QC_WALLET_PASSPHRASE`.
|
|
21
|
+
|
|
22
|
+
- **Contract-specific examples:**
|
|
23
|
+
Deploy: `node deploy-WQ.js`, `node deploy-QuantumSwapV2Factory.js`, etc.
|
|
24
|
+
Read/events/write/offline-signing: `node read-operations-WQ.js`, `node events-WQ.js`, etc.
|
|
25
|
+
|
|
26
|
+
## Package layout
|
|
27
|
+
|
|
28
|
+
- **package.json** — `quantumswap-examples` with dependency `quantumswap` (`file:..`) and `quantumcoin`.
|
|
29
|
+
- **\_test-wallet.js** — Default test wallet helper used by examples (requires `quantumcoin`).
|
|
30
|
+
- All example scripts `require("quantumswap")` for SDK types and factories.
|
|
31
|
+
|
|
32
|
+
## Using a published SDK
|
|
33
|
+
|
|
34
|
+
To use the published npm package instead of the local repo, in `examples/package.json` change:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
"quantumswap": "file:.."
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
to:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
"quantumswap": "^0.0.1"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Then run `npm install` in `examples/`.
|
|
@@ -8,38 +8,38 @@
|
|
|
8
8
|
"name": "quantumswap-examples",
|
|
9
9
|
"version": "0.0.1",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"quantumcoin": "7.0.
|
|
11
|
+
"quantumcoin": "7.0.13",
|
|
12
12
|
"quantumswap": "file:.."
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"..": {
|
|
16
16
|
"name": "quantumswap",
|
|
17
|
-
"version": "0.0.
|
|
17
|
+
"version": "0.0.8",
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"quantumcoin": "^7.0.10"
|
|
21
|
-
},
|
|
22
19
|
"devDependencies": {
|
|
23
20
|
"ts-node": "^10.9.2",
|
|
24
21
|
"typescript": "^5.0.0"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"quantumcoin": "^7.0.13"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"node_modules/quantum-coin-js-sdk": {
|
|
28
|
-
"version": "1.0.
|
|
29
|
-
"resolved": "https://registry.npmjs.org/quantum-coin-js-sdk/-/quantum-coin-js-sdk-1.0.
|
|
30
|
-
"integrity": "sha512-
|
|
28
|
+
"version": "1.0.35",
|
|
29
|
+
"resolved": "https://registry.npmjs.org/quantum-coin-js-sdk/-/quantum-coin-js-sdk-1.0.35.tgz",
|
|
30
|
+
"integrity": "sha512-hJWYxPT5x+us/61hciuW5Ky9b0cRVStBRpKniFiz/usQJkM/Pw/8dNlgdBLU2H8ZvSuBp930Y+eRp9dpYRcYNA==",
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"seed-words": "1.0.2"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"node_modules/quantumcoin": {
|
|
37
|
-
"version": "7.0.
|
|
38
|
-
"resolved": "https://registry.npmjs.org/quantumcoin/-/quantumcoin-7.0.
|
|
39
|
-
"integrity": "sha512-
|
|
37
|
+
"version": "7.0.13",
|
|
38
|
+
"resolved": "https://registry.npmjs.org/quantumcoin/-/quantumcoin-7.0.13.tgz",
|
|
39
|
+
"integrity": "sha512-tf3czEL8Xf5FpWojSOgn7RWGwsX2YdunPvjsV4NJyF8thFXOikoZRfJ0p0o4J1KOrKWf0Br95pIXQgZTkhh2cA==",
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"quantum-coin-js-sdk": "1.0.
|
|
42
|
+
"quantum-coin-js-sdk": "1.0.35",
|
|
43
43
|
"seed-words": "^1.0.2"
|
|
44
44
|
},
|
|
45
45
|
"bin": {
|
package/examples/package.json
CHANGED
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./src";
|
|
1
|
+
export * from "./src";
|
package/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-generated typed contract package.
|
|
3
|
-
*
|
|
4
|
-
* This file re-exports the package entry bundle in `src/`.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const entry = require("./src");
|
|
8
|
-
Object.assign(exports, entry);
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* IERC20
|
|
12
|
-
*/
|
|
13
|
-
exports.IERC20 = entry.IERC20;
|
|
14
|
-
exports.IERC20__factory = entry.IERC20__factory;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* QuantumSwapV2ERC20
|
|
18
|
-
*/
|
|
19
|
-
exports.QuantumSwapV2ERC20 = entry.QuantumSwapV2ERC20;
|
|
20
|
-
exports.QuantumSwapV2ERC20__factory = entry.QuantumSwapV2ERC20__factory;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* QuantumSwapV2Factory
|
|
24
|
-
*/
|
|
25
|
-
exports.QuantumSwapV2Factory = entry.QuantumSwapV2Factory;
|
|
26
|
-
exports.QuantumSwapV2Factory__factory = entry.QuantumSwapV2Factory__factory;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* QuantumSwapV2Pair
|
|
30
|
-
*/
|
|
31
|
-
exports.QuantumSwapV2Pair = entry.QuantumSwapV2Pair;
|
|
32
|
-
exports.QuantumSwapV2Pair__factory = entry.QuantumSwapV2Pair__factory;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* QuantumSwapV2Router02
|
|
36
|
-
*/
|
|
37
|
-
exports.QuantumSwapV2Router02 = entry.QuantumSwapV2Router02;
|
|
38
|
-
exports.QuantumSwapV2Router02__factory = entry.QuantumSwapV2Router02__factory;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* WQ
|
|
42
|
-
*/
|
|
43
|
-
exports.WQ = entry.WQ;
|
|
44
|
-
exports.WQ__factory = entry.WQ__factory;
|
|
45
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated typed contract package.
|
|
3
|
+
*
|
|
4
|
+
* This file re-exports the package entry bundle in `src/`.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const entry = require("./src");
|
|
8
|
+
Object.assign(exports, entry);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* IERC20
|
|
12
|
+
*/
|
|
13
|
+
exports.IERC20 = entry.IERC20;
|
|
14
|
+
exports.IERC20__factory = entry.IERC20__factory;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* QuantumSwapV2ERC20
|
|
18
|
+
*/
|
|
19
|
+
exports.QuantumSwapV2ERC20 = entry.QuantumSwapV2ERC20;
|
|
20
|
+
exports.QuantumSwapV2ERC20__factory = entry.QuantumSwapV2ERC20__factory;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* QuantumSwapV2Factory
|
|
24
|
+
*/
|
|
25
|
+
exports.QuantumSwapV2Factory = entry.QuantumSwapV2Factory;
|
|
26
|
+
exports.QuantumSwapV2Factory__factory = entry.QuantumSwapV2Factory__factory;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* QuantumSwapV2Pair
|
|
30
|
+
*/
|
|
31
|
+
exports.QuantumSwapV2Pair = entry.QuantumSwapV2Pair;
|
|
32
|
+
exports.QuantumSwapV2Pair__factory = entry.QuantumSwapV2Pair__factory;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* QuantumSwapV2Router02
|
|
36
|
+
*/
|
|
37
|
+
exports.QuantumSwapV2Router02 = entry.QuantumSwapV2Router02;
|
|
38
|
+
exports.QuantumSwapV2Router02__factory = entry.QuantumSwapV2Router02__factory;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* WQ
|
|
42
|
+
*/
|
|
43
|
+
exports.WQ = entry.WQ;
|
|
44
|
+
exports.WQ__factory = entry.WQ__factory;
|
|
45
|
+
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "quantumswap",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "QuantumSwap.js SDK for DEX functionality in QuantumCoin blockchain",
|
|
5
|
-
"author": "QuantumSwap Community",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "src/index.js",
|
|
8
|
-
"types": "src/index.d.ts",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"build": "node -e \"console.log('JS package: no build step required')\"",
|
|
11
|
-
"build-powershell": "node -e \"console.log('JS package: no build step required')\"",
|
|
12
|
-
"test": "node --test --test-concurrency=1 \"test/**/*.test.js\"",
|
|
13
|
-
"test:e2e": "node --test --test-concurrency=1 \"test/e2e/**/*.test.js\""
|
|
14
|
-
},
|
|
15
|
-
"
|
|
16
|
-
"quantumcoin": "^7.0.
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"ts-node": "^10.9.2",
|
|
20
|
-
"typescript": "^5.0.0"
|
|
21
|
-
},
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/quantumswapdex/QuantumSwap.js/issues"
|
|
24
|
-
},
|
|
25
|
-
"homepage": "https://github.com/quantumswapdex/QuantumSwap.js#readme",
|
|
26
|
-
"keywords": [
|
|
27
|
-
"quantumswap",
|
|
28
|
-
"quantum coin",
|
|
29
|
-
"quantumcoin",
|
|
30
|
-
"dex"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "quantumswap",
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"description": "QuantumSwap.js SDK for DEX functionality in QuantumCoin blockchain",
|
|
5
|
+
"author": "QuantumSwap Community",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "src/index.js",
|
|
8
|
+
"types": "src/index.d.ts",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "node -e \"console.log('JS package: no build step required')\"",
|
|
11
|
+
"build-powershell": "node -e \"console.log('JS package: no build step required')\"",
|
|
12
|
+
"test": "node --test --test-concurrency=1 \"test/**/*.test.js\"",
|
|
13
|
+
"test:e2e": "node --test --test-concurrency=1 \"test/e2e/**/*.test.js\""
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"quantumcoin": "^7.0.13"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"ts-node": "^10.9.2",
|
|
20
|
+
"typescript": "^5.0.0"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/quantumswapdex/QuantumSwap.js/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/quantumswapdex/QuantumSwap.js#readme",
|
|
26
|
+
"keywords": [
|
|
27
|
+
"quantumswap",
|
|
28
|
+
"quantum coin",
|
|
29
|
+
"quantumcoin",
|
|
30
|
+
"dex"
|
|
31
|
+
]
|
|
32
|
+
}
|
package/src/IERC20.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
// Auto-generated by sdkgen
|
|
2
|
-
import { Contract, ContractRunner, ContractTransactionResponse, TransactionResponse } from "quantumcoin";
|
|
3
|
-
import type * as Types from "./types";
|
|
4
|
-
|
|
5
|
-
export declare class IERC20 extends Contract {
|
|
6
|
-
static readonly abi: readonly any[];
|
|
7
|
-
static readonly bytecode: string;
|
|
8
|
-
static connect(address: string, runner?: ContractRunner): IERC20;
|
|
9
|
-
constructor(address: string, runner?: ContractRunner, _deployTx?: TransactionResponse);
|
|
10
|
-
readonly populateTransaction: {
|
|
11
|
-
approve(spender: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
|
|
12
|
-
transfer(to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
|
|
13
|
-
transferFrom(from: Types.AddressLike, to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
|
|
14
|
-
};
|
|
15
|
-
allowance(owner: Types.AddressLike, spender: Types.AddressLike): Promise<Types.Uint256>;
|
|
16
|
-
approve(spender: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<ContractTransactionResponse>;
|
|
17
|
-
balanceOf(owner: Types.AddressLike): Promise<Types.Uint256>;
|
|
18
|
-
decimals(): Promise<Types.Uint8>;
|
|
19
|
-
name(): Promise<string>;
|
|
20
|
-
symbol(): Promise<string>;
|
|
21
|
-
totalSupply(): Promise<Types.Uint256>;
|
|
22
|
-
transfer(to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<ContractTransactionResponse>;
|
|
23
|
-
transferFrom(from: Types.AddressLike, to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<ContractTransactionResponse>;
|
|
24
|
-
}
|
|
1
|
+
// Auto-generated by sdkgen
|
|
2
|
+
import { Contract, ContractRunner, ContractTransactionResponse, TransactionResponse } from "quantumcoin";
|
|
3
|
+
import type * as Types from "./types";
|
|
4
|
+
|
|
5
|
+
export declare class IERC20 extends Contract {
|
|
6
|
+
static readonly abi: readonly any[];
|
|
7
|
+
static readonly bytecode: string;
|
|
8
|
+
static connect(address: string, runner?: ContractRunner): IERC20;
|
|
9
|
+
constructor(address: string, runner?: ContractRunner, _deployTx?: TransactionResponse);
|
|
10
|
+
readonly populateTransaction: {
|
|
11
|
+
approve(spender: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
|
|
12
|
+
transfer(to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
|
|
13
|
+
transferFrom(from: Types.AddressLike, to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
|
|
14
|
+
};
|
|
15
|
+
allowance(owner: Types.AddressLike, spender: Types.AddressLike): Promise<Types.Uint256>;
|
|
16
|
+
approve(spender: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<ContractTransactionResponse>;
|
|
17
|
+
balanceOf(owner: Types.AddressLike): Promise<Types.Uint256>;
|
|
18
|
+
decimals(): Promise<Types.Uint8>;
|
|
19
|
+
name(): Promise<string>;
|
|
20
|
+
symbol(): Promise<string>;
|
|
21
|
+
totalSupply(): Promise<Types.Uint256>;
|
|
22
|
+
transfer(to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<ContractTransactionResponse>;
|
|
23
|
+
transferFrom(from: Types.AddressLike, to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<ContractTransactionResponse>;
|
|
24
|
+
}
|