byreal-test 1.3.2 → 1.3.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/cli.js +1 -31
- package/package.json +1 -1
- package/src/swap-runner.js +1 -1
package/cli.js
CHANGED
|
@@ -6,8 +6,6 @@ const chalk = require('chalk');
|
|
|
6
6
|
const path = require('path');
|
|
7
7
|
const { runSuites, listTests } = require('./src/runner');
|
|
8
8
|
const { printReport, saveReport } = require('./src/reporter');
|
|
9
|
-
const { runSwap } = require('./src/swap-runner');
|
|
10
|
-
const { runSetup } = require('./src/setup');
|
|
11
9
|
const allSuites = require('./src/suites');
|
|
12
10
|
|
|
13
11
|
const program = new Command();
|
|
@@ -15,7 +13,7 @@ const program = new Command();
|
|
|
15
13
|
program
|
|
16
14
|
.name('byreal-test')
|
|
17
15
|
.description('Byreal CLI test suite — validates byreal-cli commands and generates reports')
|
|
18
|
-
.version(
|
|
16
|
+
.version('1.0.0');
|
|
19
17
|
|
|
20
18
|
program
|
|
21
19
|
.command('run')
|
|
@@ -73,32 +71,4 @@ program
|
|
|
73
71
|
listTests(allSuites, opts);
|
|
74
72
|
});
|
|
75
73
|
|
|
76
|
-
program
|
|
77
|
-
.command('setup')
|
|
78
|
-
.description('Configure wallet from a base58 private key (interactive)')
|
|
79
|
-
.action(async () => {
|
|
80
|
-
await runSetup();
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
program
|
|
84
|
-
.command('run_swap')
|
|
85
|
-
.description('Execute a random swap (USDC→random token) then verify order & kline APIs')
|
|
86
|
-
.option('--order-api <url>', 'Order query API URL', 'https://api2.byreal.io/byreal/api/dex/v2/order/list?page=1&pageSize=5&userAddress=H8TjiJ8QTEXjDkCz763g5xWD6Du8FLmyb8ApxehddbvY')
|
|
87
|
-
.option('--kline-api <url>', 'Kline query API base URL', 'https://api2.byreal.io/byreal/api/dex/v2/chart/k-line-ui')
|
|
88
|
-
.option('--lark-webhook <url>', 'Lark bot webhook URL', 'https://open.larksuite.com/open-apis/bot/v2/hook/f6c4f3a5-cf66-4ce2-8f37-7960919b44d0')
|
|
89
|
-
.option('--dry-run', 'Preview swap without executing on-chain')
|
|
90
|
-
.option('--window1 <ms>', 'First polling window in ms (default 10000)', '10000')
|
|
91
|
-
.option('--window2 <ms>', 'Second polling window in ms (default 30000)', '30000')
|
|
92
|
-
.action(async (opts) => {
|
|
93
|
-
const result = await runSwap({
|
|
94
|
-
orderApiUrl: opts.orderApi,
|
|
95
|
-
klineApiUrl: opts.klineApi,
|
|
96
|
-
larkWebhook: opts.larkWebhook,
|
|
97
|
-
dryRun: !!opts.dryRun,
|
|
98
|
-
window1Ms: parseInt(opts.window1, 10),
|
|
99
|
-
window2Ms: parseInt(opts.window2, 10),
|
|
100
|
-
});
|
|
101
|
-
process.exit(result.hasAlert ? 1 : 0);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
74
|
program.parse(process.argv);
|
package/package.json
CHANGED
package/src/swap-runner.js
CHANGED