@fastxyz/cli 1.0.1 → 1.0.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.
File without changes
File without changes
@@ -1,20 +1,94 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/services/config/app.ts
4
- import { Context, Layer, Schema as Schema2 } from "effect";
4
+ import { Context, Layer } from "effect";
5
5
 
6
- // src/config/app.json
7
- var app_default = {
8
- name: "fast",
9
- version: "1.0.0"
6
+ // package.json
7
+ var package_default = {
8
+ name: "@fastxyz/cli",
9
+ description: "Fast CLI - Account, network, and transaction management",
10
+ version: "1.0.3",
11
+ repository: {
12
+ type: "git",
13
+ url: "https://github.com/fastxyz/fast-sdk",
14
+ directory: "app/cli"
15
+ },
16
+ bin: {
17
+ fast: "./dist/main.js"
18
+ },
19
+ type: "module",
20
+ files: [
21
+ "dist",
22
+ "drizzle",
23
+ "README.md"
24
+ ],
25
+ scripts: {
26
+ build: "tsup",
27
+ prepack: "tsup",
28
+ dev: "tsup --watch"
29
+ },
30
+ dependencies: {
31
+ "@clack/core": "^1.2.0",
32
+ "@effect/platform": "^0.96.0",
33
+ "@effect/platform-node": "^0.106.0",
34
+ "@effect/printer": "^0.49.0",
35
+ "@effect/printer-ansi": "^0.49.0",
36
+ "@effect/typeclass": "^0.40.0",
37
+ "@optique/core": "^0.10.7",
38
+ bech32: "^2.0.0",
39
+ "better-sqlite3": "^12.8.0",
40
+ "cli-table3": "^0.6.5",
41
+ "drizzle-orm": "^0.45.2",
42
+ effect: "^3.21.0",
43
+ uuid: "^11.1.0"
44
+ },
45
+ devDependencies: {
46
+ "@fastxyz/allset-sdk": "workspace:*",
47
+ "@fastxyz/schema": "workspace:*",
48
+ "@fastxyz/sdk": "workspace:*",
49
+ "@fastxyz/x402-client": "workspace:*",
50
+ "@noble/ciphers": "^1.3.0",
51
+ "@noble/curves": "^2.0.1",
52
+ "@noble/hashes": "^2.0.1",
53
+ "@types/better-sqlite3": "^7.6.13",
54
+ "@types/node": "^25.5.0",
55
+ "@types/uuid": "^10.0.0",
56
+ "drizzle-kit": "^0.31.10"
57
+ },
58
+ publishConfig: {
59
+ access: "public",
60
+ provenance: true
61
+ }
10
62
  };
11
63
 
12
- // src/config/networks.json
13
- var networks_default = {
64
+ // ../../packages/fast-sdk/dist/networks/index.js
65
+ var mainnet = {
66
+ url: "https://api.fast.xyz/proxy-rest",
67
+ explorerUrl: "https://explorer.fast.xyz",
68
+ networkId: "fast:mainnet",
69
+ defaultToken: {
70
+ tokenId: "0x125b60bb2e805336f0934077d4f9fdb36f45bec9ded8d7b0e637516cc43a86eb",
71
+ symbol: "fastUSD",
72
+ decimals: 6
73
+ }
74
+ };
75
+ var testnet = {
76
+ url: "https://testnet.api.fast.xyz/proxy-rest",
77
+ explorerUrl: "https://testnet.explorer.fast.xyz",
78
+ networkId: "fast:testnet",
79
+ defaultToken: {
80
+ tokenId: "0xd73a0679a2be46981e2a8aedecd951c8b6690e7d5f8502b34ed3ff4cc2163b46",
81
+ symbol: "testUSDC",
82
+ decimals: 6
83
+ }
84
+ };
85
+
86
+ // src/config/networks.ts
87
+ var bundledNetworks = {
14
88
  testnet: {
15
- rpcUrl: "https://testnet.api.fast.xyz/proxy",
16
- explorerUrl: "https://testnet.explorer.fast.xyz",
17
- networkId: "fast:testnet",
89
+ url: testnet.url,
90
+ explorerUrl: testnet.explorerUrl,
91
+ networkId: testnet.networkId,
18
92
  allSet: {
19
93
  crossSignUrl: "https://testnet.cross-sign.allset.fast.xyz",
20
94
  portalApiUrl: "https://testnet.allset.fast.xyz/api",
@@ -53,9 +127,9 @@ var networks_default = {
53
127
  }
54
128
  },
55
129
  mainnet: {
56
- rpcUrl: "https://api.fast.xyz/proxy",
57
- explorerUrl: "https://explorer.fast.xyz",
58
- networkId: "fast:mainnet",
130
+ url: mainnet.url,
131
+ explorerUrl: mainnet.explorerUrl,
132
+ networkId: mainnet.networkId,
59
133
  allSet: {
60
134
  crossSignUrl: "https://cross-sign.allset.fast.xyz",
61
135
  portalApiUrl: "https://allset.fast.xyz/api",
@@ -110,44 +184,10 @@ var networks_default = {
110
184
  }
111
185
  };
112
186
 
113
- // src/schemas/networks.ts
114
- import { Schema } from "effect";
115
- var AllSetChainTokenSchema = Schema.Struct({
116
- evmAddress: Schema.String,
117
- fastTokenId: Schema.String,
118
- decimals: Schema.Number
119
- });
120
- var AllSetChainSchema = Schema.Struct({
121
- chainId: Schema.Number,
122
- bridgeContract: Schema.String,
123
- fastBridgeAddress: Schema.String,
124
- relayerUrl: Schema.String,
125
- evmRpcUrl: Schema.String,
126
- evmExplorerUrl: Schema.String,
127
- tokens: Schema.Record({ key: Schema.String, value: AllSetChainTokenSchema })
128
- });
129
- var AllSetConfigSchema = Schema.Struct({
130
- crossSignUrl: Schema.String,
131
- portalApiUrl: Schema.String,
132
- chains: Schema.Record({ key: Schema.String, value: AllSetChainSchema })
133
- });
134
- var NetworkConfigSchema = Schema.Struct({
135
- rpcUrl: Schema.String,
136
- explorerUrl: Schema.String,
137
- networkId: Schema.String,
138
- allSet: Schema.optional(AllSetConfigSchema)
139
- });
140
- var BundledNetworksSchema = Schema.Record({
141
- key: Schema.String,
142
- value: NetworkConfigSchema
143
- });
144
-
145
187
  // src/services/config/app.ts
146
- var bundledNetworks = Schema2.decodeUnknownSync(
147
- BundledNetworksSchema
148
- )(networks_default);
149
- var getAppName = () => app_default.name;
150
- var getVersion = () => app_default.version;
188
+ var appName = Object.keys(package_default.bin)[0] ?? "fast";
189
+ var getAppName = () => appName;
190
+ var getVersion = () => package_default.version;
151
191
  var getBundledNetworks = () => bundledNetworks;
152
192
  var isBundledNetwork = (name) => Object.hasOwn(bundledNetworks, name);
153
193
  var getBundledNetwork = (name) => bundledNetworks[name];
@@ -162,7 +202,6 @@ var AppConfigLive = Layer.sync(AppConfig, () => ({
162
202
  }));
163
203
 
164
204
  export {
165
- NetworkConfigSchema,
166
205
  getAppName,
167
206
  getVersion,
168
207
  getBundledNetworks,
File without changes
File without changes