@fastxyz/cli 1.0.3 → 1.1.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.
- package/README.md +179 -21
- package/dist/{app-ZXKQBKVM.js → app-OXURVZBK.js} +1 -1
- package/dist/{chunk-UZZ2O26Y.js → chunk-CPDXMZPW.js} +6 -3
- package/dist/{chunk-DITXH2ZY.js → chunk-NUQ2N6AG.js} +8 -2
- package/dist/{chunk-T7HRTMD7.js → chunk-WXSBQOV4.js} +83 -26
- package/dist/{database-NXA7GQKE.js → database-CKOZYRD7.js} +1 -1
- package/dist/main.js +4019 -1175
- package/dist/{network-GHRVPGMD.js → network-GWVH6WUL.js} +3 -3
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -32,11 +32,18 @@ fast account create
|
|
|
32
32
|
# Check balances
|
|
33
33
|
fast info balance
|
|
34
34
|
|
|
35
|
-
# Send
|
|
35
|
+
# Send the network's default token (fastUSD on mainnet) — Fast → Fast
|
|
36
36
|
fast send fast1abc...xyz 10
|
|
37
37
|
|
|
38
|
-
#
|
|
39
|
-
fast
|
|
38
|
+
# Send a specific token explicitly
|
|
39
|
+
fast send fast1abc...xyz 10 --token USDC
|
|
40
|
+
|
|
41
|
+
# Bridge USDC from Arbitrum Sepolia to Fast (--token USDC is required on
|
|
42
|
+
# mainnet because the network default — fastUSD — is not on EVM chains)
|
|
43
|
+
fast fund usdc crypto 50 --chain arbitrum-sepolia --token USDC
|
|
44
|
+
|
|
45
|
+
# Or get a unified Fast web-app URL to fund fastUSD (mainnet only)
|
|
46
|
+
fast fund fastusd --amount 50
|
|
40
47
|
|
|
41
48
|
# Pay an x402-protected API
|
|
42
49
|
fast pay https://api.example.com/resource
|
|
@@ -73,6 +80,32 @@ These options work with every command:
|
|
|
73
80
|
| `--non-interactive` | Auto-confirm confirmations and fail when required input is missing |
|
|
74
81
|
| `--debug` | Enable verbose debug logging to stderr |
|
|
75
82
|
|
|
83
|
+
### Default token
|
|
84
|
+
|
|
85
|
+
Commands that accept `--token` (currently `fast send` and `fast fund usdc
|
|
86
|
+
crypto`) default to the active network's `defaultToken.symbol` when the flag
|
|
87
|
+
is omitted: `fastUSD` on mainnet, `testUSDC` on testnet. Bridge routes
|
|
88
|
+
additionally require the resolved token to exist on the target chain — on
|
|
89
|
+
mainnet bridges you must pass `--token USDC` explicitly because `fastUSD` does
|
|
90
|
+
not exist on EVM chains.
|
|
91
|
+
|
|
92
|
+
To customize the default, register a network with `fast network add <name>
|
|
93
|
+
--config <path>` where the JSON config includes a `defaultToken` field, for
|
|
94
|
+
example:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"defaultToken": {
|
|
99
|
+
"symbol": "USDC",
|
|
100
|
+
"tokenId": "0x...",
|
|
101
|
+
"decimals": 6
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
If a custom network omits `defaultToken`, callers must pass `--token`
|
|
107
|
+
explicitly; otherwise the command errors with `INVALID_USAGE`.
|
|
108
|
+
|
|
76
109
|
## Commands
|
|
77
110
|
|
|
78
111
|
### `fast account create`
|
|
@@ -98,6 +131,7 @@ fast account import --name my-imported-account --private-key 0x...
|
|
|
98
131
|
```
|
|
99
132
|
|
|
100
133
|
**Options:**
|
|
134
|
+
|
|
101
135
|
- `--name <alias>` — Optional human-readable alias for the imported account
|
|
102
136
|
- `--private-key <hex>` — Hex-encoded 32-byte private key
|
|
103
137
|
- `--key-file <path>` — Path to a JSON file containing a `privateKey` field
|
|
@@ -157,13 +191,15 @@ fast send fast1recipient... 10.5 --token USDC
|
|
|
157
191
|
```
|
|
158
192
|
|
|
159
193
|
**Positional arguments:**
|
|
194
|
+
|
|
160
195
|
- `<address>` — Recipient address (`fast1...` for Fast, `0x...` for EVM)
|
|
161
196
|
- `<amount>` — Human-readable amount (for example, `10` or `1.5`)
|
|
162
197
|
|
|
163
198
|
**Options:**
|
|
199
|
+
|
|
164
200
|
- `--from-chain <chain>` — Source EVM chain for EVM → Fast transfers
|
|
165
201
|
- `--to-chain <chain>` — Destination EVM chain for Fast → EVM transfers
|
|
166
|
-
- `--token <token>` — Token symbol or token ID
|
|
202
|
+
- `--token <token>` — Token symbol or token ID. Defaults to the network's `defaultToken.symbol` (`fastUSD` on mainnet, `testUSDC` on testnet). Bridge routes require the resolved token to be available on the target chain; otherwise the command errors with `CommandUnsupportedForTokenError`.
|
|
167
203
|
- `--eip-7702` — Use the smart deposit flow for EVM → Fast transfers
|
|
168
204
|
- `--account <name>` — Sender account (defaults to the configured default)
|
|
169
205
|
|
|
@@ -212,6 +248,7 @@ fast info history --from fast1... --limit 20
|
|
|
212
248
|
```
|
|
213
249
|
|
|
214
250
|
**Options:**
|
|
251
|
+
|
|
215
252
|
- `--from <address>` — Filter by sender address
|
|
216
253
|
- `--to <address>` — Filter by recipient address
|
|
217
254
|
- `--token <token>` — Filter by token name or token ID
|
|
@@ -240,39 +277,152 @@ fast info bridge-tokens
|
|
|
240
277
|
|
|
241
278
|
---
|
|
242
279
|
|
|
243
|
-
### `fast fund fiat`
|
|
280
|
+
### `fast fund usdc fiat`
|
|
244
281
|
|
|
245
|
-
Get a fiat on-ramp URL for funding a Fast address.
|
|
282
|
+
Get a fiat on-ramp URL for funding a Fast address with USDC. The URL targets
|
|
283
|
+
[ramp.fast.xyz](https://ramp.fast.xyz); the deposit lands on Fast as bridged
|
|
284
|
+
USDC, distinct from the Fast-native `fastUSD`.
|
|
246
285
|
|
|
247
286
|
```bash
|
|
248
|
-
fast fund fiat --network mainnet
|
|
287
|
+
fast fund usdc fiat --network mainnet
|
|
249
288
|
```
|
|
250
289
|
|
|
251
290
|
**Requirements:**
|
|
252
|
-
- Only available on `mainnet`
|
|
253
|
-
- Prints a funding URL for you to open in your browser
|
|
254
291
|
|
|
255
|
-
|
|
256
|
-
-
|
|
257
|
-
- `--network <name>` — Must be `mainnet`
|
|
292
|
+
- Mainnet only (Ramp does not support testnet).
|
|
293
|
+
- Active account or `--address <fast1...>`.
|
|
258
294
|
|
|
259
295
|
---
|
|
260
296
|
|
|
261
|
-
### `fast fund crypto <amount>`
|
|
297
|
+
### `fast fund usdc crypto <amount>`
|
|
262
298
|
|
|
263
|
-
Bridge
|
|
299
|
+
Bridge USDC from an EVM chain to the Fast network. The deposit lands as
|
|
300
|
+
bridged USDC on Fast (distinct from `fastUSD`).
|
|
264
301
|
|
|
265
302
|
```bash
|
|
266
|
-
fast fund crypto 10.5 --chain arbitrum-sepolia --token USDC
|
|
303
|
+
fast fund usdc crypto 10.5 --chain arbitrum-sepolia --token USDC
|
|
267
304
|
```
|
|
268
305
|
|
|
269
306
|
**Positional arguments:**
|
|
270
|
-
|
|
307
|
+
|
|
308
|
+
- `<amount>` — Human-readable amount to bridge (e.g., `10.5`).
|
|
309
|
+
|
|
310
|
+
**Options:**
|
|
311
|
+
|
|
312
|
+
- `--chain <chain>` — Source EVM chain (required).
|
|
313
|
+
- `--token <token>` — Token symbol or token ID. Defaults to the network's `defaultToken.symbol`. On mainnet that's `fastUSD`, which is **not** on EVM chains — pass `--token USDC` explicitly for the bridge case, or the command errors with `CommandUnsupportedForTokenError`.
|
|
314
|
+
- `--eip-7702` — Use the smart deposit flow (gas paid in USDC via paymaster).
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
### `fast fund fastusd`
|
|
319
|
+
|
|
320
|
+
Print an `app.fast.xyz/send` URL that opens the unified Fast web app to fund
|
|
321
|
+
your account with **fastUSD** (a Fast-native token, separate from bridged USDC).
|
|
322
|
+
The web app handles fiat-onramp, crypto-bridge, and wallet-to-wallet funding
|
|
323
|
+
under the hood; the CLI's job is just to produce the URL.
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
fast fund fastusd
|
|
327
|
+
# → https://app.fast.xyz/send?to=fast1...
|
|
328
|
+
|
|
329
|
+
fast fund fastusd --amount 25
|
|
330
|
+
# → https://app.fast.xyz/send?to=fast1...&amount=25
|
|
331
|
+
|
|
332
|
+
fast fund fastusd --to fast1someoneelse --amount 10
|
|
333
|
+
# → https://app.fast.xyz/send?to=fast1someoneelse&amount=10
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
**Options:**
|
|
337
|
+
|
|
338
|
+
- `--to <fast1...>` — Recipient Fast address (default: active account).
|
|
339
|
+
- `--amount <decimal>` — Optional amount; if omitted, the web app prompts.
|
|
340
|
+
|
|
341
|
+
**Requirements:**
|
|
342
|
+
|
|
343
|
+
- Mainnet only.
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
### `fast authorize request`
|
|
348
|
+
|
|
349
|
+
Generate a one-time HPKE authorization request. The command creates a URL for the wallet user to open, and stores a short-lived key in `~/.fast/handover-pending.json` (mode 0600, up to 5 minutes).
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
fast authorize request [--requester NAME] [--url URL]
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
**Options:**
|
|
356
|
+
|
|
357
|
+
- `--requester <name>` — Optional label shown to the wallet user to identify who is requesting
|
|
358
|
+
- `--url <url>` — Override the wallet base URL the auth link points to (default: `https://app.fast.xyz/authorize`). Useful for local dev against a non-production wallet, e.g. `--url http://localhost:3000/authorize`.
|
|
359
|
+
|
|
360
|
+
**Output (human):**
|
|
361
|
+
|
|
362
|
+
```
|
|
363
|
+
Authorization URL:
|
|
364
|
+
https://app.fast.xyz/authorize?data=eyJ...
|
|
365
|
+
|
|
366
|
+
Fingerprint: 123456
|
|
367
|
+
Expires at: 2026-05-25T12:05:00Z
|
|
368
|
+
|
|
369
|
+
Show the URL to the wallet user. Once they paste back the handover
|
|
370
|
+
code, run:
|
|
371
|
+
fast authorize complete --message '<paste here>'
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
**Output (`--json`):**
|
|
375
|
+
|
|
376
|
+
```json
|
|
377
|
+
{
|
|
378
|
+
"auth_url": "...",
|
|
379
|
+
"request_fingerprint": "123456",
|
|
380
|
+
"request_expires_at": "2026-05-25T12:05:00Z"
|
|
381
|
+
}
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**Security note:** `~/.fast/handover-pending.json` contains the HPKE one-time private key — not the account seed. An attacker who steals only this file cannot derive the account key; they would also need to intercept the handover code the wallet user pastes back. The file expires within 5 minutes and is deleted after a successful `authorize complete`.
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
### `fast authorize complete`
|
|
389
|
+
|
|
390
|
+
Decrypt a handover code returned by the wallet user and print the account private key to stdout.
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
fast authorize complete [--message TEXT | --stdin] [--print-account] [--json]
|
|
394
|
+
```
|
|
271
395
|
|
|
272
396
|
**Options:**
|
|
273
|
-
|
|
274
|
-
- `--
|
|
275
|
-
- `--
|
|
397
|
+
|
|
398
|
+
- `--message <text>` — Handover code or chat message containing it (bare base64url or quoted)
|
|
399
|
+
- `--stdin` — Read the handover code from stdin (e.g., `cat code.txt | fast authorize complete --stdin`)
|
|
400
|
+
- `--print-account` — Also print the derived Fast address and public key
|
|
401
|
+
- `--json` — Emit JSON output
|
|
402
|
+
|
|
403
|
+
If neither `--message` nor `--stdin` is provided, the CLI prompts interactively. With `--non-interactive`, absence of both flags is an error.
|
|
404
|
+
|
|
405
|
+
**Output (human, default):**
|
|
406
|
+
|
|
407
|
+
```
|
|
408
|
+
0x1313131313131313131313131313131313131313131313131313131313131313
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
**Output (human, `--print-account`):**
|
|
412
|
+
|
|
413
|
+
```
|
|
414
|
+
Private key: 0x1313...
|
|
415
|
+
Address: fast1abc...xyz
|
|
416
|
+
Public key: 0xdead...beef
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
**Output (`--json`):**
|
|
420
|
+
|
|
421
|
+
```json
|
|
422
|
+
{ "private_key": "0x1313..." }
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
After a successful decryption, `~/.fast/handover-pending.json` is deleted. On decryption failures, the state file is updated (or deleted after 3 attempts) so the same request may be retried.
|
|
276
426
|
|
|
277
427
|
---
|
|
278
428
|
|
|
@@ -285,9 +435,11 @@ fast pay https://api.example.com/premium
|
|
|
285
435
|
```
|
|
286
436
|
|
|
287
437
|
**Positional arguments:**
|
|
438
|
+
|
|
288
439
|
- `<url>` — URL of the x402-protected resource (required)
|
|
289
440
|
|
|
290
441
|
**Options:**
|
|
442
|
+
|
|
291
443
|
- `--dry-run` — Show payment details without actually paying
|
|
292
444
|
- `--method <GET|POST|...>` — HTTP method (default: GET)
|
|
293
445
|
- `--header <key:value>` — Custom request header (can be repeated)
|
|
@@ -324,12 +476,15 @@ fast network add my-custom-net --config ./network-config.json
|
|
|
324
476
|
```
|
|
325
477
|
|
|
326
478
|
**Positional arguments:**
|
|
479
|
+
|
|
327
480
|
- `<name>` — Unique name for the network
|
|
328
481
|
|
|
329
482
|
**Options:**
|
|
483
|
+
|
|
330
484
|
- `--config <path>` — Path to a JSON file with the network configuration (required)
|
|
331
485
|
|
|
332
486
|
**Example JSON config (`network-config.json`):**
|
|
487
|
+
|
|
333
488
|
```json
|
|
334
489
|
{
|
|
335
490
|
"url": "https://api.fast.xyz/proxy-rest",
|
|
@@ -383,8 +538,11 @@ The CLI stores data in `~/.fast/`:
|
|
|
383
538
|
# 1. Create an account
|
|
384
539
|
fast account create --name my-account
|
|
385
540
|
|
|
386
|
-
# 2. Get a fiat on-ramp URL
|
|
387
|
-
fast fund fiat --network mainnet --address fast1...
|
|
541
|
+
# 2. Get a fiat on-ramp URL (delivers USDC to your Fast account)
|
|
542
|
+
fast fund usdc fiat --network mainnet --address fast1...
|
|
543
|
+
|
|
544
|
+
# 2b. Or open the unified Fast web app to fund fastUSD
|
|
545
|
+
fast fund fastusd --network mainnet
|
|
388
546
|
|
|
389
547
|
# 3. Check your balance
|
|
390
548
|
fast info balance --account my-account
|
|
@@ -7,7 +7,7 @@ import { Context, Layer } from "effect";
|
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@fastxyz/cli",
|
|
9
9
|
description: "Fast CLI - Account, network, and transaction management",
|
|
10
|
-
version: "1.
|
|
10
|
+
version: "1.1.1",
|
|
11
11
|
repository: {
|
|
12
12
|
type: "git",
|
|
13
13
|
url: "https://github.com/fastxyz/fast-sdk",
|
|
@@ -25,7 +25,8 @@ var package_default = {
|
|
|
25
25
|
scripts: {
|
|
26
26
|
build: "tsup",
|
|
27
27
|
prepack: "tsup",
|
|
28
|
-
dev: "tsup --watch"
|
|
28
|
+
dev: "tsup --watch",
|
|
29
|
+
test: "vitest run"
|
|
29
30
|
},
|
|
30
31
|
dependencies: {
|
|
31
32
|
"@clack/core": "^1.2.0",
|
|
@@ -67,7 +68,7 @@ var mainnet = {
|
|
|
67
68
|
explorerUrl: "https://explorer.fast.xyz",
|
|
68
69
|
networkId: "fast:mainnet",
|
|
69
70
|
defaultToken: {
|
|
70
|
-
tokenId: "
|
|
71
|
+
tokenId: "0xc655a12330da6af361d281b197996d2bc135aaed3b66278e729c2222291e9130",
|
|
71
72
|
symbol: "fastUSD",
|
|
72
73
|
decimals: 6
|
|
73
74
|
}
|
|
@@ -89,6 +90,7 @@ var bundledNetworks = {
|
|
|
89
90
|
url: testnet.url,
|
|
90
91
|
explorerUrl: testnet.explorerUrl,
|
|
91
92
|
networkId: testnet.networkId,
|
|
93
|
+
defaultToken: testnet.defaultToken,
|
|
92
94
|
allSet: {
|
|
93
95
|
crossSignUrl: "https://testnet.cross-sign.allset.fast.xyz",
|
|
94
96
|
portalApiUrl: "https://testnet.allset.fast.xyz/api",
|
|
@@ -130,6 +132,7 @@ var bundledNetworks = {
|
|
|
130
132
|
url: mainnet.url,
|
|
131
133
|
explorerUrl: mainnet.explorerUrl,
|
|
132
134
|
networkId: mainnet.networkId,
|
|
135
|
+
defaultToken: mainnet.defaultToken,
|
|
133
136
|
allSet: {
|
|
134
137
|
crossSignUrl: "https://cross-sign.allset.fast.xyz",
|
|
135
138
|
portalApiUrl: "https://allset.fast.xyz/api",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
AppConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CPDXMZPW.js";
|
|
5
5
|
import {
|
|
6
6
|
DatabaseService,
|
|
7
7
|
DefaultNetworkError,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
ReservedNameError,
|
|
14
14
|
customNetworks,
|
|
15
15
|
metadata
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WXSBQOV4.js";
|
|
17
17
|
|
|
18
18
|
// src/services/storage/network.ts
|
|
19
19
|
import { readFileSync } from "fs";
|
|
@@ -2310,10 +2310,16 @@ var AllSetConfigSchema = Schema19.Struct({
|
|
|
2310
2310
|
portalApiUrl: Schema19.String,
|
|
2311
2311
|
chains: Schema19.Record({ key: Schema19.String, value: AllSetChainSchema })
|
|
2312
2312
|
});
|
|
2313
|
+
var FastTokenSchema = Schema19.Struct({
|
|
2314
|
+
tokenId: Schema19.String,
|
|
2315
|
+
symbol: Schema19.String,
|
|
2316
|
+
decimals: Schema19.Number
|
|
2317
|
+
});
|
|
2313
2318
|
var NetworkConfigSchema = Schema19.Struct({
|
|
2314
2319
|
url: Schema19.String,
|
|
2315
2320
|
explorerUrl: Schema19.String,
|
|
2316
2321
|
networkId: NetworkId,
|
|
2322
|
+
defaultToken: Schema19.optional(FastTokenSchema),
|
|
2317
2323
|
allSet: Schema19.optional(AllSetConfigSchema)
|
|
2318
2324
|
});
|
|
2319
2325
|
var BundledNetworksSchema = Schema19.Record({
|
|
@@ -140,16 +140,57 @@ var FastSdkError = class extends Data2.TaggedError("FastSdkError") {
|
|
|
140
140
|
errorCode = "FAST_SDK_ERROR";
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
-
// src/errors/
|
|
143
|
+
// src/errors/key-handover.ts
|
|
144
144
|
import { Data as Data3 } from "effect";
|
|
145
|
-
var
|
|
145
|
+
var PendingAlreadyExistsError = class extends Data3.TaggedError(
|
|
146
|
+
"PendingAlreadyExistsError"
|
|
147
|
+
) {
|
|
148
|
+
exitCode = 1;
|
|
149
|
+
errorCode = "PENDING_ALREADY_EXISTS";
|
|
150
|
+
get message() {
|
|
151
|
+
return `Already have a pending authorization request (fingerprint ${this.fingerprint}, expires ${this.expiresAt}). Run 'fast authorize complete' to finish it, or wait until it expires.`;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
var NoPendingRequestError = class extends Data3.TaggedError(
|
|
155
|
+
"NoPendingRequestError"
|
|
156
|
+
) {
|
|
157
|
+
exitCode = 1;
|
|
158
|
+
errorCode = "NO_PENDING_REQUEST";
|
|
159
|
+
message = "No pending authorization request. Run 'fast authorize request' first.";
|
|
160
|
+
};
|
|
161
|
+
var CorruptPendingStateError = class extends Data3.TaggedError(
|
|
162
|
+
"CorruptPendingStateError"
|
|
163
|
+
) {
|
|
164
|
+
exitCode = 1;
|
|
165
|
+
errorCode = "CORRUPT_PENDING_STATE";
|
|
166
|
+
get message() {
|
|
167
|
+
return `Corrupt pending state file (${this.reason}). Delete ~/.fast/handover-pending.json and run 'request' again.`;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
var MissingHandoverMessageError = class extends Data3.TaggedError(
|
|
171
|
+
"MissingHandoverMessageError"
|
|
172
|
+
) {
|
|
173
|
+
exitCode = 2;
|
|
174
|
+
errorCode = "MISSING_HANDOVER_MESSAGE";
|
|
175
|
+
message = "Missing handover code. Provide --message <code> or --stdin, or run without --non-interactive.";
|
|
176
|
+
};
|
|
177
|
+
var KeyHandoverProtocolError = class extends Data3.TaggedError(
|
|
178
|
+
"KeyHandoverProtocolError"
|
|
179
|
+
) {
|
|
180
|
+
exitCode = 1;
|
|
181
|
+
errorCode = "KEY_HANDOVER_PROTOCOL_ERROR";
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// src/errors/network.ts
|
|
185
|
+
import { Data as Data4 } from "effect";
|
|
186
|
+
var NetworkExistsError = class extends Data4.TaggedError("NetworkExistsError") {
|
|
146
187
|
exitCode = 2;
|
|
147
188
|
errorCode = "NETWORK_EXISTS";
|
|
148
189
|
get message() {
|
|
149
190
|
return `Network "${this.name}" already exists`;
|
|
150
191
|
}
|
|
151
192
|
};
|
|
152
|
-
var NetworkNotFoundError = class extends
|
|
193
|
+
var NetworkNotFoundError = class extends Data4.TaggedError(
|
|
153
194
|
"NetworkNotFoundError"
|
|
154
195
|
) {
|
|
155
196
|
exitCode = 2;
|
|
@@ -158,7 +199,7 @@ var NetworkNotFoundError = class extends Data3.TaggedError(
|
|
|
158
199
|
return `Network "${this.name}" not found`;
|
|
159
200
|
}
|
|
160
201
|
};
|
|
161
|
-
var DefaultNetworkError = class extends
|
|
202
|
+
var DefaultNetworkError = class extends Data4.TaggedError(
|
|
162
203
|
"DefaultNetworkError"
|
|
163
204
|
) {
|
|
164
205
|
exitCode = 2;
|
|
@@ -167,7 +208,7 @@ var DefaultNetworkError = class extends Data3.TaggedError(
|
|
|
167
208
|
return `Cannot remove "${this.name}" because it is the default network. Use \`fast network set-default\` first.`;
|
|
168
209
|
}
|
|
169
210
|
};
|
|
170
|
-
var NoDefaultNetworkError = class extends
|
|
211
|
+
var NoDefaultNetworkError = class extends Data4.TaggedError(
|
|
171
212
|
"NoDefaultNetworkError"
|
|
172
213
|
) {
|
|
173
214
|
exitCode = 2;
|
|
@@ -176,14 +217,14 @@ var NoDefaultNetworkError = class extends Data3.TaggedError(
|
|
|
176
217
|
return "No default network set. Use `fast network set-default <name>` to set one.";
|
|
177
218
|
}
|
|
178
219
|
};
|
|
179
|
-
var ReservedNameError = class extends
|
|
220
|
+
var ReservedNameError = class extends Data4.TaggedError("ReservedNameError") {
|
|
180
221
|
exitCode = 2;
|
|
181
222
|
errorCode = "RESERVED_NAME";
|
|
182
223
|
get message() {
|
|
183
224
|
return `"${this.name}" is a reserved name and cannot be modified`;
|
|
184
225
|
}
|
|
185
226
|
};
|
|
186
|
-
var InvalidNetworkConfigError = class extends
|
|
227
|
+
var InvalidNetworkConfigError = class extends Data4.TaggedError(
|
|
187
228
|
"InvalidNetworkConfigError"
|
|
188
229
|
) {
|
|
189
230
|
exitCode = 2;
|
|
@@ -192,7 +233,7 @@ var InvalidNetworkConfigError = class extends Data3.TaggedError(
|
|
|
192
233
|
return `Invalid network config for "${this.name}"`;
|
|
193
234
|
}
|
|
194
235
|
};
|
|
195
|
-
var UnsupportedChainError = class extends
|
|
236
|
+
var UnsupportedChainError = class extends Data4.TaggedError(
|
|
196
237
|
"UnsupportedChainError"
|
|
197
238
|
) {
|
|
198
239
|
exitCode = 2;
|
|
@@ -203,26 +244,26 @@ var UnsupportedChainError = class extends Data3.TaggedError(
|
|
|
203
244
|
};
|
|
204
245
|
|
|
205
246
|
// src/errors/payment.ts
|
|
206
|
-
import { Data as
|
|
207
|
-
var PaymentRejectedError = class extends
|
|
247
|
+
import { Data as Data5 } from "effect";
|
|
248
|
+
var PaymentRejectedError = class extends Data5.TaggedError(
|
|
208
249
|
"PaymentRejectedError"
|
|
209
250
|
) {
|
|
210
251
|
exitCode = 6;
|
|
211
252
|
errorCode = "PAYMENT_REJECTED";
|
|
212
253
|
};
|
|
213
|
-
var PaymentFailedError = class extends
|
|
254
|
+
var PaymentFailedError = class extends Data5.TaggedError(
|
|
214
255
|
"PaymentFailedError"
|
|
215
256
|
) {
|
|
216
257
|
exitCode = 1;
|
|
217
258
|
errorCode = "PAYMENT_FAILED";
|
|
218
259
|
};
|
|
219
|
-
var InvalidPaymentLinkError = class extends
|
|
260
|
+
var InvalidPaymentLinkError = class extends Data5.TaggedError(
|
|
220
261
|
"InvalidPaymentLinkError"
|
|
221
262
|
) {
|
|
222
263
|
exitCode = 2;
|
|
223
264
|
errorCode = "INVALID_PAYMENT_LINK";
|
|
224
265
|
};
|
|
225
|
-
var InsufficientPaymentBalanceError = class extends
|
|
266
|
+
var InsufficientPaymentBalanceError = class extends Data5.TaggedError(
|
|
226
267
|
"InsufficientPaymentBalanceError"
|
|
227
268
|
) {
|
|
228
269
|
exitCode = 4;
|
|
@@ -230,69 +271,79 @@ var InsufficientPaymentBalanceError = class extends Data4.TaggedError(
|
|
|
230
271
|
};
|
|
231
272
|
|
|
232
273
|
// src/errors/transaction.ts
|
|
233
|
-
import { Data as
|
|
234
|
-
var TxNotFoundError = class extends
|
|
274
|
+
import { Data as Data6 } from "effect";
|
|
275
|
+
var TxNotFoundError = class extends Data6.TaggedError("TxNotFoundError") {
|
|
235
276
|
exitCode = 1;
|
|
236
277
|
errorCode = "TX_NOT_FOUND";
|
|
237
278
|
get message() {
|
|
238
279
|
return `Transaction not found: ${this.hash}`;
|
|
239
280
|
}
|
|
240
281
|
};
|
|
241
|
-
var TransactionFailedError = class extends
|
|
282
|
+
var TransactionFailedError = class extends Data6.TaggedError(
|
|
242
283
|
"TransactionFailedError"
|
|
243
284
|
) {
|
|
244
285
|
exitCode = 2;
|
|
245
286
|
errorCode = "TX_FAILED";
|
|
246
287
|
};
|
|
247
|
-
var InvalidAddressError = class extends
|
|
288
|
+
var InvalidAddressError = class extends Data6.TaggedError(
|
|
248
289
|
"InvalidAddressError"
|
|
249
290
|
) {
|
|
250
291
|
exitCode = 2;
|
|
251
292
|
errorCode = "INVALID_ADDRESS";
|
|
252
293
|
};
|
|
253
|
-
var InvalidAmountError = class extends
|
|
294
|
+
var InvalidAmountError = class extends Data6.TaggedError("InvalidAmountError") {
|
|
254
295
|
exitCode = 2;
|
|
255
296
|
errorCode = "INVALID_AMOUNT";
|
|
256
297
|
};
|
|
257
|
-
var InsufficientBalanceError = class extends
|
|
298
|
+
var InsufficientBalanceError = class extends Data6.TaggedError(
|
|
258
299
|
"InsufficientBalanceError"
|
|
259
300
|
) {
|
|
260
301
|
exitCode = 2;
|
|
261
302
|
errorCode = "INSUFFICIENT_BALANCE";
|
|
262
303
|
};
|
|
263
|
-
var InsufficientGasError = class extends
|
|
304
|
+
var InsufficientGasError = class extends Data6.TaggedError(
|
|
264
305
|
"InsufficientGasError"
|
|
265
306
|
) {
|
|
266
307
|
exitCode = 2;
|
|
267
308
|
errorCode = "INSUFFICIENT_GAS";
|
|
268
309
|
};
|
|
269
|
-
var TokenNotFoundError = class extends
|
|
310
|
+
var TokenNotFoundError = class extends Data6.TaggedError("TokenNotFoundError") {
|
|
270
311
|
exitCode = 2;
|
|
271
312
|
errorCode = "TOKEN_NOT_FOUND";
|
|
272
313
|
get message() {
|
|
273
314
|
return `Unknown token "${this.token}". Run \`fast info bridge-tokens\` to list supported tokens.`;
|
|
274
315
|
}
|
|
275
316
|
};
|
|
276
|
-
var FundingRequiredError = class extends
|
|
317
|
+
var FundingRequiredError = class extends Data6.TaggedError(
|
|
277
318
|
"FundingRequiredError"
|
|
278
319
|
) {
|
|
279
320
|
exitCode = 4;
|
|
280
321
|
errorCode = "FUNDING_REQUIRED";
|
|
281
322
|
};
|
|
323
|
+
var CommandUnsupportedForTokenError = class extends Data6.TaggedError(
|
|
324
|
+
"CommandUnsupportedForTokenError"
|
|
325
|
+
) {
|
|
326
|
+
exitCode = 2;
|
|
327
|
+
errorCode = "COMMAND_UNSUPPORTED_FOR_TOKEN";
|
|
328
|
+
get message() {
|
|
329
|
+
const base = `${this.command} is not supported for ${this.token} on ${this.network}.`;
|
|
330
|
+
return this.suggestion ? `${base} ${this.suggestion}` : base;
|
|
331
|
+
}
|
|
332
|
+
};
|
|
282
333
|
|
|
283
334
|
// src/errors/usage.ts
|
|
284
|
-
import { Data as
|
|
285
|
-
var InvalidUsageError = class extends
|
|
335
|
+
import { Data as Data7 } from "effect";
|
|
336
|
+
var InvalidUsageError = class extends Data7.TaggedError("InvalidUsageError") {
|
|
286
337
|
exitCode = 2;
|
|
287
338
|
errorCode = "INVALID_USAGE";
|
|
288
339
|
};
|
|
289
|
-
var NotImplementedError = class extends
|
|
340
|
+
var NotImplementedError = class extends Data7.TaggedError(
|
|
290
341
|
"NotImplementedError"
|
|
291
342
|
) {
|
|
292
343
|
exitCode = 2;
|
|
293
344
|
errorCode = "NOT_IMPLEMENTED";
|
|
294
345
|
};
|
|
295
|
-
var UserCancelledError = class extends
|
|
346
|
+
var UserCancelledError = class extends Data7.TaggedError("UserCancelledError") {
|
|
296
347
|
exitCode = 2;
|
|
297
348
|
errorCode = "USER_CANCELLED";
|
|
298
349
|
get message() {
|
|
@@ -343,6 +394,11 @@ export {
|
|
|
343
394
|
FileIOError,
|
|
344
395
|
InternalError,
|
|
345
396
|
FastSdkError,
|
|
397
|
+
PendingAlreadyExistsError,
|
|
398
|
+
NoPendingRequestError,
|
|
399
|
+
CorruptPendingStateError,
|
|
400
|
+
MissingHandoverMessageError,
|
|
401
|
+
KeyHandoverProtocolError,
|
|
346
402
|
NetworkExistsError,
|
|
347
403
|
NetworkNotFoundError,
|
|
348
404
|
DefaultNetworkError,
|
|
@@ -359,6 +415,7 @@ export {
|
|
|
359
415
|
InvalidAmountError,
|
|
360
416
|
TokenNotFoundError,
|
|
361
417
|
FundingRequiredError,
|
|
418
|
+
CommandUnsupportedForTokenError,
|
|
362
419
|
InvalidUsageError,
|
|
363
420
|
UserCancelledError,
|
|
364
421
|
accounts,
|