solforge 0.2.11 → 0.2.13

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.
Files changed (175) hide show
  1. package/package.json +4 -8
  2. package/docs/API.md +0 -379
  3. package/docs/CONFIGURATION.md +0 -407
  4. package/docs/bun-single-file-executable.md +0 -585
  5. package/docs/cli-plan.md +0 -154
  6. package/docs/data-indexing-plan.md +0 -214
  7. package/docs/gui-roadmap.md +0 -202
  8. package/scripts/decode-b58.ts +0 -10
  9. package/scripts/install.sh +0 -112
  10. package/server/index.ts +0 -5
  11. package/server/lib/base58.ts +0 -33
  12. package/server/lib/faucet.ts +0 -110
  13. package/server/lib/instruction-parser.ts +0 -328
  14. package/server/lib/parsers/spl-associated-token-account.ts +0 -50
  15. package/server/lib/parsers/spl-token.ts +0 -340
  16. package/server/lib/spl-token.ts +0 -57
  17. package/server/methods/TEMPLATE.md +0 -117
  18. package/server/methods/account/get-account-info.ts +0 -86
  19. package/server/methods/account/get-balance.ts +0 -23
  20. package/server/methods/account/get-multiple-accounts.ts +0 -84
  21. package/server/methods/account/get-parsed-account-info.ts +0 -17
  22. package/server/methods/account/index.ts +0 -12
  23. package/server/methods/account/parsers/index.ts +0 -52
  24. package/server/methods/account/parsers/loader-upgradeable.ts +0 -79
  25. package/server/methods/account/parsers/spl-token.ts +0 -256
  26. package/server/methods/account/parsers/system.ts +0 -4
  27. package/server/methods/account/request-airdrop.ts +0 -271
  28. package/server/methods/admin/adopt-mint-authority.ts +0 -94
  29. package/server/methods/admin/clone-program-accounts.ts +0 -55
  30. package/server/methods/admin/clone-program.ts +0 -152
  31. package/server/methods/admin/clone-token-accounts.ts +0 -117
  32. package/server/methods/admin/clone-token-mint.ts +0 -82
  33. package/server/methods/admin/create-mint.ts +0 -114
  34. package/server/methods/admin/create-token-account.ts +0 -137
  35. package/server/methods/admin/helpers.ts +0 -70
  36. package/server/methods/admin/index.ts +0 -10
  37. package/server/methods/admin/list-mints.ts +0 -21
  38. package/server/methods/admin/load-program.ts +0 -52
  39. package/server/methods/admin/mint-to.ts +0 -266
  40. package/server/methods/block/get-block-height.ts +0 -5
  41. package/server/methods/block/get-block.ts +0 -31
  42. package/server/methods/block/get-blocks-with-limit.ts +0 -19
  43. package/server/methods/block/get-latest-blockhash.ts +0 -12
  44. package/server/methods/block/get-slot.ts +0 -5
  45. package/server/methods/block/index.ts +0 -6
  46. package/server/methods/block/is-blockhash-valid.ts +0 -19
  47. package/server/methods/epoch/get-cluster-nodes.ts +0 -17
  48. package/server/methods/epoch/get-epoch-info.ts +0 -16
  49. package/server/methods/epoch/get-epoch-schedule.ts +0 -15
  50. package/server/methods/epoch/get-highest-snapshot-slot.ts +0 -9
  51. package/server/methods/epoch/get-leader-schedule.ts +0 -8
  52. package/server/methods/epoch/get-max-retransmit-slot.ts +0 -9
  53. package/server/methods/epoch/get-max-shred-insert-slot.ts +0 -9
  54. package/server/methods/epoch/get-slot-leader.ts +0 -6
  55. package/server/methods/epoch/get-slot-leaders.ts +0 -9
  56. package/server/methods/epoch/get-stake-activation.ts +0 -9
  57. package/server/methods/epoch/get-stake-minimum-delegation.ts +0 -9
  58. package/server/methods/epoch/get-vote-accounts.ts +0 -19
  59. package/server/methods/epoch/index.ts +0 -13
  60. package/server/methods/epoch/minimum-ledger-slot.ts +0 -5
  61. package/server/methods/fee/get-fee-calculator-for-blockhash.ts +0 -12
  62. package/server/methods/fee/get-fee-for-message.ts +0 -8
  63. package/server/methods/fee/get-fee-rate-governor.ts +0 -16
  64. package/server/methods/fee/get-fees.ts +0 -14
  65. package/server/methods/fee/get-recent-prioritization-fees.ts +0 -22
  66. package/server/methods/fee/index.ts +0 -5
  67. package/server/methods/get-address-lookup-table.ts +0 -27
  68. package/server/methods/index.ts +0 -265
  69. package/server/methods/performance/get-recent-performance-samples.ts +0 -25
  70. package/server/methods/performance/get-transaction-count.ts +0 -5
  71. package/server/methods/performance/index.ts +0 -2
  72. package/server/methods/program/get-block-commitment.ts +0 -9
  73. package/server/methods/program/get-block-production.ts +0 -14
  74. package/server/methods/program/get-block-time.ts +0 -21
  75. package/server/methods/program/get-blocks.ts +0 -11
  76. package/server/methods/program/get-first-available-block.ts +0 -9
  77. package/server/methods/program/get-genesis-hash.ts +0 -6
  78. package/server/methods/program/get-identity.ts +0 -6
  79. package/server/methods/program/get-inflation-governor.ts +0 -15
  80. package/server/methods/program/get-inflation-rate.ts +0 -10
  81. package/server/methods/program/get-inflation-reward.ts +0 -12
  82. package/server/methods/program/get-largest-accounts.ts +0 -8
  83. package/server/methods/program/get-parsed-program-accounts.ts +0 -12
  84. package/server/methods/program/get-parsed-token-accounts-by-delegate.ts +0 -12
  85. package/server/methods/program/get-parsed-token-accounts-by-owner.ts +0 -12
  86. package/server/methods/program/get-program-accounts.ts +0 -221
  87. package/server/methods/program/get-supply.ts +0 -13
  88. package/server/methods/program/get-token-account-balance.ts +0 -60
  89. package/server/methods/program/get-token-accounts-by-delegate.ts +0 -82
  90. package/server/methods/program/get-token-accounts-by-owner.ts +0 -416
  91. package/server/methods/program/get-token-largest-accounts.ts +0 -81
  92. package/server/methods/program/get-token-supply.ts +0 -39
  93. package/server/methods/program/index.ts +0 -21
  94. package/server/methods/solforge/index.ts +0 -158
  95. package/server/methods/system/get-health.ts +0 -5
  96. package/server/methods/system/get-minimum-balance-for-rent-exemption.ts +0 -13
  97. package/server/methods/system/get-version.ts +0 -9
  98. package/server/methods/system/index.ts +0 -3
  99. package/server/methods/transaction/get-confirmed-transaction.ts +0 -11
  100. package/server/methods/transaction/get-parsed-transaction.ts +0 -17
  101. package/server/methods/transaction/get-signature-statuses.ts +0 -79
  102. package/server/methods/transaction/get-signatures-for-address.ts +0 -41
  103. package/server/methods/transaction/get-transaction.ts +0 -639
  104. package/server/methods/transaction/index.ts +0 -7
  105. package/server/methods/transaction/inner-instructions.test.ts +0 -104
  106. package/server/methods/transaction/send-transaction.ts +0 -469
  107. package/server/methods/transaction/simulate-transaction.ts +0 -57
  108. package/server/rpc-server.ts +0 -521
  109. package/server/types.ts +0 -109
  110. package/server/ws-server.ts +0 -178
  111. package/src/api-server-entry.ts +0 -109
  112. package/src/cli/bootstrap.ts +0 -67
  113. package/src/cli/commands/airdrop.ts +0 -37
  114. package/src/cli/commands/config.ts +0 -39
  115. package/src/cli/commands/mint.ts +0 -187
  116. package/src/cli/commands/program-clone.ts +0 -122
  117. package/src/cli/commands/program-load.ts +0 -64
  118. package/src/cli/commands/rpc-start.ts +0 -49
  119. package/src/cli/commands/token-adopt-authority.ts +0 -37
  120. package/src/cli/commands/token-clone.ts +0 -112
  121. package/src/cli/commands/token-create.ts +0 -81
  122. package/src/cli/main.ts +0 -152
  123. package/src/cli/run-solforge.ts +0 -112
  124. package/src/cli/setup-utils.ts +0 -54
  125. package/src/cli/setup-wizard.ts +0 -258
  126. package/src/cli/utils/args.ts +0 -15
  127. package/src/commands/add-program.ts +0 -333
  128. package/src/commands/init.ts +0 -122
  129. package/src/commands/list.ts +0 -136
  130. package/src/commands/mint.ts +0 -287
  131. package/src/commands/start.ts +0 -881
  132. package/src/commands/status.ts +0 -99
  133. package/src/commands/stop.ts +0 -405
  134. package/src/config/index.ts +0 -146
  135. package/src/config/manager.ts +0 -157
  136. package/src/db/index.ts +0 -83
  137. package/src/db/schema/accounts.ts +0 -23
  138. package/src/db/schema/address-signatures.ts +0 -31
  139. package/src/db/schema/index.ts +0 -6
  140. package/src/db/schema/meta-kv.ts +0 -9
  141. package/src/db/schema/transactions.ts +0 -36
  142. package/src/db/schema/tx-account-states.ts +0 -23
  143. package/src/db/schema/tx-accounts.ts +0 -33
  144. package/src/db/tx-store.ts +0 -264
  145. package/src/gui/public/app.css +0 -1556
  146. package/src/gui/public/build/main.css +0 -1569
  147. package/src/gui/public/build/main.js +0 -303
  148. package/src/gui/public/build/main.js.txt +0 -231
  149. package/src/gui/public/index.html +0 -19
  150. package/src/gui/server.ts +0 -296
  151. package/src/gui/src/api.ts +0 -127
  152. package/src/gui/src/app.tsx +0 -441
  153. package/src/gui/src/components/airdrop-mint-form.tsx +0 -246
  154. package/src/gui/src/components/clone-program-modal.tsx +0 -202
  155. package/src/gui/src/components/clone-token-modal.tsx +0 -230
  156. package/src/gui/src/components/modal.tsx +0 -134
  157. package/src/gui/src/components/programs-panel.tsx +0 -124
  158. package/src/gui/src/components/status-panel.tsx +0 -136
  159. package/src/gui/src/components/tokens-panel.tsx +0 -122
  160. package/src/gui/src/hooks/use-interval.ts +0 -17
  161. package/src/gui/src/index.css +0 -557
  162. package/src/gui/src/main.tsx +0 -17
  163. package/src/index.ts +0 -216
  164. package/src/migrations-bundled.ts +0 -23
  165. package/src/rpc/start.ts +0 -44
  166. package/src/services/api-server.ts +0 -504
  167. package/src/services/port-manager.ts +0 -174
  168. package/src/services/process-registry.ts +0 -153
  169. package/src/services/program-cloner.ts +0 -317
  170. package/src/services/token-cloner.ts +0 -811
  171. package/src/services/validator.ts +0 -293
  172. package/src/types/config.ts +0 -110
  173. package/src/utils/shell.ts +0 -110
  174. package/src/utils/token-loader.ts +0 -115
  175. /package/{start.js → start.cjs} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solforge",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "private": false,
@@ -13,14 +13,10 @@
13
13
  "url": "https://github.com/nitishxyz/solforge/issues"
14
14
  },
15
15
  "bin": {
16
- "solforge": "start.js"
16
+ "solforge": "start.cjs"
17
17
  },
18
18
  "files": [
19
- "start.js",
20
- "scripts",
21
- "src",
22
- "server",
23
- "docs",
19
+ "start.cjs",
24
20
  "README.md",
25
21
  "LICENSE"
26
22
  ],
@@ -37,7 +33,7 @@
37
33
  "build:gui": "bun build src/gui/src/main.tsx --outdir src/gui/public/build --target=browser --minify",
38
34
  "cli": "bun src/cli/main.ts",
39
35
  "lint": "biome check",
40
- "prepack": "chmod +x start.js || true"
36
+ "prepack": "chmod +x start.cjs || true"
41
37
  },
42
38
  "devDependencies": {
43
39
  "@biomejs/biome": "2.2.4",
package/docs/API.md DELETED
@@ -1,379 +0,0 @@
1
- # SolForge API Documentation
2
-
3
- SolForge includes a REST API server that runs alongside your local validator, providing programmatic access to validator operations and token management.
4
-
5
- ## Getting Started
6
-
7
- The API server starts automatically when you run `solforge start` and is available at:
8
-
9
- ```
10
- http://127.0.0.1:3000/api
11
- ```
12
-
13
- For network access from other devices, use the `--network` flag:
14
-
15
- ```bash
16
- solforge start --network
17
- ```
18
-
19
- This makes the API server accessible at:
20
-
21
- ```
22
- http://0.0.0.0:3000/api
23
- ```
24
-
25
- The API server will:
26
-
27
- - Start in the background when you run `solforge start`
28
- - Stop automatically when you run `solforge stop`
29
- - Use port 3000 by default (configurable)
30
- - Bind to localhost by default (use `--network` for network access)
31
-
32
- You can also run the API server standalone (without a validator):
33
-
34
- ```bash
35
- solforge api-server --port 8080 --host 0.0.0.0
36
- ```
37
-
38
- ## Base URL
39
-
40
- All API endpoints are prefixed with `/api`:
41
-
42
- ```
43
- Base URL: http://127.0.0.1:3000/api
44
- ```
45
-
46
- ## Authentication
47
-
48
- Currently, no authentication is required. The API server is intended for local development use only.
49
-
50
- ## Endpoints
51
-
52
- ### Health Check
53
-
54
- Check if the API server is running.
55
-
56
- ```http
57
- GET /api/health
58
- ```
59
-
60
- **Response:**
61
-
62
- ```json
63
- {
64
- "status": "ok",
65
- "timestamp": "2024-01-15T10:30:00.000Z"
66
- }
67
- ```
68
-
69
- ### Validator Information
70
-
71
- Get information about the running validator.
72
-
73
- ```http
74
- GET /api/validator/info
75
- ```
76
-
77
- **Response:**
78
-
79
- ```json
80
- {
81
- "version": {
82
- "solana-core": "1.17.0"
83
- },
84
- "blockHeight": 12345,
85
- "slotLeader": "11111111111111111111111111111111",
86
- "rpcUrl": "http://127.0.0.1:8899",
87
- "faucetUrl": "http://127.0.0.1:9900"
88
- }
89
- ```
90
-
91
- ### List Tokens
92
-
93
- Get all cloned tokens available on the validator.
94
-
95
- ```http
96
- GET /api/tokens
97
- ```
98
-
99
- **Response:**
100
-
101
- ```json
102
- {
103
- "tokens": [
104
- {
105
- "symbol": "USDC",
106
- "mainnetMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
107
- "mintAuthority": "HpHke1uSs4VzA8m76Uy2aDfnhDg2Dw2vJMQvpBVU5mTJ",
108
- "recipients": [
109
- {
110
- "wallet": "YourWalletPublicKeyHere",
111
- "amount": 1000000000
112
- }
113
- ],
114
- "cloneMetadata": true
115
- }
116
- ],
117
- "count": 1
118
- }
119
- ```
120
-
121
- ### List Programs
122
-
123
- Get all cloned programs available on the validator.
124
-
125
- ```http
126
- GET /api/programs
127
- ```
128
-
129
- **Response:**
130
-
131
- ```json
132
- {
133
- "programs": [
134
- {
135
- "name": "Token Metadata",
136
- "programId": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s",
137
- "filePath": "/path/to/program.so"
138
- }
139
- ],
140
- "count": 1
141
- }
142
- ```
143
-
144
- ### Mint Tokens
145
-
146
- Mint tokens to a specific wallet address.
147
-
148
- ```http
149
- POST /api/tokens/:mintAddress/mint
150
- ```
151
-
152
- **Parameters:**
153
-
154
- - `mintAddress` (path parameter) - Token mint address (e.g., "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v")
155
-
156
- **Request Body:**
157
-
158
- ```json
159
- {
160
- "walletAddress": "HpHke1uSs4VzA8m76Uy2aDfnhDg2Dw2vJMQvpBVU5mTJ",
161
- "amount": 1000
162
- }
163
- ```
164
-
165
- **Response:**
166
-
167
- ```json
168
- {
169
- "success": true,
170
- "symbol": "USDC",
171
- "amount": 1000,
172
- "walletAddress": "HpHke1uSs4VzA8m76Uy2aDfnhDg2Dw2vJMQvpBVU5mTJ",
173
- "mintAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
174
- }
175
- ```
176
-
177
- **Error Response:**
178
-
179
- ```json
180
- {
181
- "error": "Token with mint address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v not found in cloned tokens"
182
- }
183
- ```
184
-
185
- ### Get Wallet Balances
186
-
187
- Get SOL and token balances for a specific wallet.
188
-
189
- ```http
190
- GET /api/wallet/:address/balances
191
- ```
192
-
193
- **Parameters:**
194
-
195
- - `address` (path parameter) - Wallet public key
196
-
197
- **Response:**
198
-
199
- ```json
200
- {
201
- "walletAddress": "HpHke1uSs4VzA8m76Uy2aDfnhDg2Dw2vJMQvpBVU5mTJ",
202
- "solBalance": {
203
- "lamports": 1000000000,
204
- "sol": 1.0
205
- },
206
- "tokenBalances": [
207
- {
208
- "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
209
- "symbol": "USDC",
210
- "balance": "1000000000",
211
- "decimals": 6,
212
- "uiAmount": 1000
213
- }
214
- ],
215
- "timestamp": "2024-01-15T10:30:00.000Z"
216
- }
217
- ```
218
-
219
- ### Airdrop SOL
220
-
221
- Airdrop SOL to a wallet address.
222
-
223
- ```http
224
- POST /api/airdrop
225
- ```
226
-
227
- **Request Body:**
228
-
229
- ```json
230
- {
231
- "walletAddress": "HpHke1uSs4VzA8m76Uy2aDfnhDg2Dw2vJMQvpBVU5mTJ",
232
- "amount": 1
233
- }
234
- ```
235
-
236
- **Response:**
237
-
238
- ```json
239
- {
240
- "success": true,
241
- "amount": 1,
242
- "walletAddress": "HpHke1uSs4VzA8m76Uy2aDfnhDg2Dw2vJMQvpBVU5mTJ",
243
- "signature": "5j7s8K9mN2pQ3rT4uV5wX6yZ7a8B9c0D1e2F3g4H5i6J7k8L9m0N1o2P3q4R5s6T7u8V9w0X1y2Z3a4B5c6D7e8F"
244
- }
245
- ```
246
-
247
- ### Get Recent Transactions
248
-
249
- Get recent transactions from the validator.
250
-
251
- ```http
252
- GET /api/transactions/recent?limit=10
253
- ```
254
-
255
- **Query Parameters:**
256
-
257
- - `limit` (optional) - Number of transactions to return (max 100, default 10)
258
-
259
- **Response:**
260
-
261
- ```json
262
- {
263
- "transactions": [
264
- {
265
- "signature": "5j7s8K9mN2pQ3rT4uV5wX6yZ7a8B9c0D1e2F3g4H5i6J7k8L9m0N1o2P3q4R5s6T7u8V9w0X1y2Z3a4B5c6D7e8F",
266
- "slot": 12345,
267
- "blockTime": 1642234567,
268
- "confirmationStatus": "finalized"
269
- }
270
- ],
271
- "count": 1
272
- }
273
- ```
274
-
275
- ## Error Handling
276
-
277
- All endpoints return appropriate HTTP status codes:
278
-
279
- - `200` - Success
280
- - `400` - Bad Request (invalid parameters)
281
- - `404` - Not Found (endpoint doesn't exist)
282
- - `500` - Internal Server Error
283
-
284
- Error responses include details:
285
-
286
- ```json
287
- {
288
- "error": "Error message",
289
- "details": "Additional error details"
290
- }
291
- ```
292
-
293
- ## Examples
294
-
295
- ### Using curl
296
-
297
- **Mint tokens:**
298
-
299
- ```bash
300
- curl -X POST http://127.0.0.1:3000/api/tokens/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/mint \
301
- -H "Content-Type: application/json" \
302
- -d '{
303
- "walletAddress": "HpHke1uSs4VzA8m76Uy2aDfnhDg2Dw2vJMQvpBVU5mTJ",
304
- "amount": 1000
305
- }'
306
- ```
307
-
308
- **Get wallet balances:**
309
-
310
- ```bash
311
- curl http://127.0.0.1:3000/api/wallet/HpHke1uSs4VzA8m76Uy2aDfnhDg2Dw2vJMQvpBVU5mTJ/balances
312
- ```
313
-
314
- **Airdrop SOL:**
315
-
316
- ```bash
317
- curl -X POST http://127.0.0.1:3000/api/airdrop \
318
- -H "Content-Type: application/json" \
319
- -d '{
320
- "walletAddress": "HpHke1uSs4VzA8m76Uy2aDfnhDg2Dw2vJMQvpBVU5mTJ",
321
- "amount": 1
322
- }'
323
- ```
324
-
325
- ### Using JavaScript/TypeScript
326
-
327
- ```typescript
328
- const API_BASE = "http://127.0.0.1:3000/api";
329
-
330
- // Mint tokens
331
- async function mintTokens(
332
- symbol: string,
333
- walletAddress: string,
334
- amount: number
335
- ) {
336
- const response = await fetch(`${API_BASE}/tokens/${symbol}/mint`, {
337
- method: "POST",
338
- headers: {
339
- "Content-Type": "application/json",
340
- },
341
- body: JSON.stringify({
342
- walletAddress,
343
- amount,
344
- }),
345
- });
346
-
347
- return response.json();
348
- }
349
-
350
- // Get wallet balances
351
- async function getWalletBalances(address: string) {
352
- const response = await fetch(`${API_BASE}/wallet/${address}/balances`);
353
- return response.json();
354
- }
355
-
356
- // Usage
357
- const result = await mintTokens(
358
- "USDC",
359
- "HpHke1uSs4VzA8m76Uy2aDfnhDg2Dw2vJMQvpBVU5mTJ",
360
- 1000
361
- );
362
- console.log(result);
363
- ```
364
-
365
- ## Configuration
366
-
367
- The API server port can be configured by setting the `API_PORT` environment variable or by modifying the start command configuration.
368
-
369
- ## CORS
370
-
371
- CORS is enabled for all origins to facilitate local web development. In production, you should configure appropriate CORS settings.
372
-
373
- ## Rate Limiting
374
-
375
- Currently, no rate limiting is implemented. The API is intended for local development use only.
376
-
377
- ## WebSocket Support
378
-
379
- WebSocket support is not currently implemented but may be added in future versions for real-time updates.