@trustwallet/cli 0.19.1 → 0.20.0
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/dist/commands/alert.d.ts.map +1 -1
- package/dist/commands/compete.d.ts.map +1 -1
- package/dist/commands/erc20.d.ts.map +1 -1
- package/dist/commands/erc8004.d.ts.map +1 -1
- package/dist/commands/erc8183.d.ts.map +1 -1
- package/dist/commands/onramp.d.ts.map +1 -1
- package/dist/commands/query.d.ts.map +1 -1
- package/dist/commands/swap.d.ts.map +1 -1
- package/dist/commands/transfer.d.ts +0 -8
- package/dist/commands/transfer.d.ts.map +1 -1
- package/dist/commands/wallet.d.ts.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/index.js +6297 -5901
- package/dist/paymaster-option.d.ts +21 -0
- package/dist/paymaster-option.d.ts.map +1 -0
- package/package.json +14 -13
- package/dist/automation-runner.d.ts +0 -38
- package/dist/automation-runner.d.ts.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Validate a `--paymaster-url` value: a well-formed http(s) base URL with no
|
|
4
|
+
* query, fragment, or credentials. The URL is used verbatim as the paymaster
|
|
5
|
+
* JSON-RPC endpoint, so it must be a plain base URL (undici rejects
|
|
6
|
+
* credentialed URLs outright).
|
|
7
|
+
* Returns the parsed URL's normalized string (lowercased scheme/host) with
|
|
8
|
+
* trailing slashes stripped.
|
|
9
|
+
* Throwing commander's `InvalidArgumentError` routes bad input through the
|
|
10
|
+
* CLI's standard VALIDATION_ERROR path (see index.ts) before any send runs.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parsePaymasterUrl(value: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Add `--paymaster-url` and a preAction hook that bridges the flag into the
|
|
15
|
+
* env var the BSC gas-sponsorship path already reads. Attached to the
|
|
16
|
+
* broadcasting leaf commands of the transfer, swap, erc20, compete, onramp,
|
|
17
|
+
* erc8004, and erc8183 families (x402/serve/watch stay flag-free by design);
|
|
18
|
+
* returns the command for chaining.
|
|
19
|
+
*/
|
|
20
|
+
export declare function attachPaymasterOption(cmd: Command): Command;
|
|
21
|
+
//# sourceMappingURL=paymaster-option.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paymaster-option.d.ts","sourceRoot":"","sources":["../src/paymaster-option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAwB,MAAM,WAAW,CAAC;AAO1D;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAkBvD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAgB3D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustwallet/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "TWAK CLI — command-line interface for Trust Wallet Agent Kit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,18 +33,19 @@
|
|
|
33
33
|
"tsup": "8.5.1",
|
|
34
34
|
"typescript": "5.7.3",
|
|
35
35
|
"vitest": "4.1.2",
|
|
36
|
-
"@twak/actions": "0.
|
|
37
|
-
"@twak/contracts": "0.
|
|
38
|
-
"@twak/core": "0.
|
|
39
|
-
"@twak/
|
|
40
|
-
"@twak/
|
|
41
|
-
"@twak/
|
|
42
|
-
"@twak/
|
|
43
|
-
"@twak/
|
|
44
|
-
"@twak/
|
|
45
|
-
"@twak/wallet
|
|
46
|
-
"@twak/
|
|
47
|
-
"@twak/
|
|
36
|
+
"@twak/actions": "0.20.0",
|
|
37
|
+
"@twak/contracts": "0.20.0",
|
|
38
|
+
"@twak/core": "0.20.0",
|
|
39
|
+
"@twak/mcp": "0.20.0",
|
|
40
|
+
"@twak/operations": "0.20.0",
|
|
41
|
+
"@twak/security": "0.20.0",
|
|
42
|
+
"@twak/storage": "0.20.0",
|
|
43
|
+
"@twak/swap": "0.20.0",
|
|
44
|
+
"@twak/transactions": "0.20.0",
|
|
45
|
+
"@twak/wallet": "0.20.0",
|
|
46
|
+
"@twak/wallet-core": "0.20.0",
|
|
47
|
+
"@twak/walletconnect": "0.20.0",
|
|
48
|
+
"@twak/x402": "0.20.0"
|
|
48
49
|
},
|
|
49
50
|
"publishConfig": {
|
|
50
51
|
"access": "public"
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type TwakHttpClient } from '@twak/core';
|
|
2
|
-
import { type SwapClient } from '@twak/swap';
|
|
3
|
-
import type { AutomationStore } from '@twak/storage';
|
|
4
|
-
import type { BlockchainClient, WalletContext } from '@twak/wallet-core';
|
|
5
|
-
/** Parse a duration string (`30s`, `5m`, `1h`, `1d`, or plain seconds) to seconds. */
|
|
6
|
-
export declare function parseInterval(value: string): number | null;
|
|
7
|
-
export type LogLevel = 'info' | 'warn' | 'error';
|
|
8
|
-
export interface AutomationRunnerDeps {
|
|
9
|
-
automationStore: AutomationStore;
|
|
10
|
-
walletContext: WalletContext;
|
|
11
|
-
swapClient: SwapClient;
|
|
12
|
-
/** HTTP client used to batch-fetch spot prices for limit orders. */
|
|
13
|
-
client: TwakHttpClient;
|
|
14
|
-
blockchainClient?: BlockchainClient;
|
|
15
|
-
/** Receives meaningful events only (executions, deactivations, failures); idle ticks log nothing. */
|
|
16
|
-
log?: (level: LogLevel, message: string) => void;
|
|
17
|
-
}
|
|
18
|
-
export interface TickResult {
|
|
19
|
-
executed: Array<{
|
|
20
|
-
id: string;
|
|
21
|
-
type: 'dca' | 'limit';
|
|
22
|
-
hash?: string;
|
|
23
|
-
}>;
|
|
24
|
-
skipped: number;
|
|
25
|
-
errors: number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Evaluate all active automations once and execute those whose conditions are
|
|
29
|
-
* met. Designed to be called on an interval by both `twak watch` and the
|
|
30
|
-
* `twak serve` background watcher.
|
|
31
|
-
*
|
|
32
|
-
* Automations run unattended, so they only fire against the local agent wallet
|
|
33
|
-
* (`walletContext.state === 'local'`). In WalletConnect mode each swap needs
|
|
34
|
-
* interactive device approval, which a background loop can't obtain — so the
|
|
35
|
-
* whole tick is skipped until a local wallet is active.
|
|
36
|
-
*/
|
|
37
|
-
export declare function runAutomationsTick(deps: AutomationRunnerDeps): Promise<TickResult>;
|
|
38
|
-
//# sourceMappingURL=automation-runner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automation-runner.d.ts","sourceRoot":"","sources":["../src/automation-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEzE,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAU1D;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,eAAe,CAAC;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,oEAAoE;IACpE,MAAM,EAAE,cAAc,CAAC;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,qGAAqG;IACrG,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,CAiKxF"}
|