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
@@ -1,16 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getEpochInfo: RpcMethodHandler = (id, _params, context) => {
4
- const slotsPerEpoch = 432000;
5
- const currentSlot = Number(context.slot);
6
- const epoch = Math.floor(currentSlot / slotsPerEpoch);
7
- const slotIndex = currentSlot % slotsPerEpoch;
8
- return context.createSuccessResponse(id, {
9
- absoluteSlot: currentSlot,
10
- blockHeight: currentSlot,
11
- epoch,
12
- slotIndex,
13
- slotsInEpoch: slotsPerEpoch,
14
- transactionCount: currentSlot * 100,
15
- });
16
- };
@@ -1,15 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getEpochSchedule: RpcMethodHandler = (id, _params, _context) => {
4
- return {
5
- jsonrpc: "2.0",
6
- id,
7
- result: {
8
- slotsPerEpoch: 432000,
9
- leaderScheduleSlotOffset: 432000,
10
- warmup: false,
11
- firstNormalEpoch: 0,
12
- firstNormalSlot: 0,
13
- },
14
- };
15
- };
@@ -1,9 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getHighestSnapshotSlot: RpcMethodHandler = (
4
- id,
5
- _params,
6
- _context,
7
- ) => {
8
- return { jsonrpc: "2.0", id, result: { full: 0, incremental: null } };
9
- };
@@ -1,8 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getLeaderSchedule: RpcMethodHandler = (id, _params, _context) => {
4
- const identity = "11111111111111111111111111111111";
5
- const schedule: Record<string, number[]> = {};
6
- schedule[identity] = Array.from({ length: 100 }, (_, i) => i);
7
- return { jsonrpc: "2.0", id, result: schedule };
8
- };
@@ -1,9 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getMaxRetransmitSlot: RpcMethodHandler = (
4
- id,
5
- _params,
6
- context,
7
- ) => {
8
- return context.createSuccessResponse(id, Number(context.slot));
9
- };
@@ -1,9 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getMaxShredInsertSlot: RpcMethodHandler = (
4
- id,
5
- _params,
6
- context,
7
- ) => {
8
- return context.createSuccessResponse(id, Number(context.slot));
9
- };
@@ -1,6 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getSlotLeader: RpcMethodHandler = (id, _params, _context) => {
4
- const LEADER_PUBKEY = "11111111111111111111111111111111";
5
- return { jsonrpc: "2.0", id, result: LEADER_PUBKEY };
6
- };
@@ -1,9 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getSlotLeaders: RpcMethodHandler = (id, params, _context) => {
4
- const [_startSlot, limit] = params || [];
5
- const LEADER_PUBKEY = "11111111111111111111111111111111";
6
- const count = Math.min(Number(limit || 100), 5000);
7
- const leaders = Array(count).fill(LEADER_PUBKEY);
8
- return { jsonrpc: "2.0", id, result: leaders };
9
- };
@@ -1,9 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getStakeActivation: RpcMethodHandler = (id, _params, _context) => {
4
- return {
5
- jsonrpc: "2.0",
6
- id,
7
- result: { state: "active", active: 1000000000, inactive: 0 },
8
- };
9
- };
@@ -1,9 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getStakeMinimumDelegation: RpcMethodHandler = (
4
- id,
5
- _params,
6
- context,
7
- ) => {
8
- return context.createSuccessResponse(id, 1_000_000_000);
9
- };
@@ -1,19 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getVoteAccounts: RpcMethodHandler = (id, _params, context) => {
4
- return context.createSuccessResponse(id, {
5
- current: [
6
- {
7
- votePubkey: "11111111111111111111111111111111",
8
- nodePubkey: "11111111111111111111111111111111",
9
- activatedStake: 1000000000,
10
- epochVoteAccount: true,
11
- commission: 0,
12
- lastVote: Number(context.slot),
13
- epochCredits: [[0, 1000, 0]],
14
- rootSlot: Number(context.slot) - 1,
15
- },
16
- ],
17
- delinquent: [],
18
- });
19
- };
@@ -1,13 +0,0 @@
1
- export { getClusterNodes } from "./get-cluster-nodes";
2
- export { getEpochInfo } from "./get-epoch-info";
3
- export { getEpochSchedule } from "./get-epoch-schedule";
4
- export { getHighestSnapshotSlot } from "./get-highest-snapshot-slot";
5
- export { getLeaderSchedule } from "./get-leader-schedule";
6
- export { getMaxRetransmitSlot } from "./get-max-retransmit-slot";
7
- export { getMaxShredInsertSlot } from "./get-max-shred-insert-slot";
8
- export { getSlotLeader } from "./get-slot-leader";
9
- export { getSlotLeaders } from "./get-slot-leaders";
10
- export { getStakeActivation } from "./get-stake-activation";
11
- export { getStakeMinimumDelegation } from "./get-stake-minimum-delegation";
12
- export { getVoteAccounts } from "./get-vote-accounts";
13
- export { minimumLedgerSlot } from "./minimum-ledger-slot";
@@ -1,5 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const minimumLedgerSlot: RpcMethodHandler = (id, _params, _context) => {
4
- return { jsonrpc: "2.0", id, result: 0 };
5
- };
@@ -1,12 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getFeeCalculatorForBlockhash: RpcMethodHandler = (
4
- id,
5
- _params,
6
- context,
7
- ) => {
8
- return context.createSuccessResponse(id, {
9
- context: { slot: Number(context.slot) },
10
- value: { feeCalculator: { lamportsPerSignature: 5000 } },
11
- });
12
- };
@@ -1,8 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getFeeForMessage: RpcMethodHandler = (id, _params, context) => {
4
- return context.createSuccessResponse(id, {
5
- context: { slot: Number(context.slot), apiVersion: "1.17.9" },
6
- value: 5000,
7
- });
8
- };
@@ -1,16 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getFeeRateGovernor: RpcMethodHandler = (id, _params, context) => {
4
- return context.createSuccessResponse(id, {
5
- context: { slot: Number(context.slot) },
6
- value: {
7
- feeRateGovernor: {
8
- burnPercent: 50,
9
- maxLamportsPerSignature: 100000,
10
- minLamportsPerSignature: 5000,
11
- targetLamportsPerSignature: 10000,
12
- targetSignaturesPerSlot: 20000,
13
- },
14
- },
15
- });
16
- };
@@ -1,14 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getFees: RpcMethodHandler = (id, _params, context) => {
4
- const blockhash = context.svm.latestBlockhash();
5
- return context.createSuccessResponse(id, {
6
- context: { slot: Number(context.slot) },
7
- value: {
8
- blockhash,
9
- feeCalculator: { lamportsPerSignature: 5000 },
10
- lastValidSlot: Number(context.slot) + 150,
11
- lastValidBlockHeight: Number(context.slot) + 150,
12
- },
13
- });
14
- };
@@ -1,22 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getRecentPrioritizationFees: RpcMethodHandler = (
4
- id,
5
- params,
6
- context,
7
- ) => {
8
- const addresses = params?.[0] || [];
9
- const fees =
10
- addresses.length > 0
11
- ? addresses.map(() => ({
12
- slot: Number(context.slot),
13
- prioritizationFee: 0,
14
- }))
15
- : Array(150)
16
- .fill(null)
17
- .map((_, i) => ({
18
- slot: Math.max(0, Number(context.slot) - i),
19
- prioritizationFee: 0,
20
- }));
21
- return context.createSuccessResponse(id, fees);
22
- };
@@ -1,5 +0,0 @@
1
- export { getFeeCalculatorForBlockhash } from "./get-fee-calculator-for-blockhash";
2
- export { getFeeForMessage } from "./get-fee-for-message";
3
- export { getFeeRateGovernor } from "./get-fee-rate-governor";
4
- export { getFees } from "./get-fees";
5
- export { getRecentPrioritizationFees } from "./get-recent-prioritization-fees";
@@ -1,27 +0,0 @@
1
- import type { RpcMethodHandler } from "../types";
2
-
3
- export const getAddressLookupTable: RpcMethodHandler = (
4
- id,
5
- params,
6
- context,
7
- ) => {
8
- try {
9
- const [arg] = params || [];
10
- const address: string =
11
- typeof arg === "string" ? arg : arg?.accountKey || arg?.address;
12
- if (!address || typeof address !== "string") {
13
- throw new Error("Missing address");
14
- }
15
- const bytes = context.decodeBase58(address);
16
- if (!(bytes instanceof Uint8Array) || bytes.length !== 32) {
17
- throw new Error("Invalid address length");
18
- }
19
- return context.createSuccessResponse(id, {
20
- context: { slot: Number(context.slot) },
21
- value: null,
22
- });
23
- } catch (error: unknown) {
24
- const message = error instanceof Error ? error.message : String(error);
25
- return context.createErrorResponse(id, -32602, "Invalid params", message);
26
- }
27
- };
@@ -1,265 +0,0 @@
1
- import type { RpcMethodHandler } from "../types";
2
-
3
- // Account methods are now in a subdirectory for better organization
4
- import {
5
- getAccountInfo,
6
- getBalance,
7
- getMultipleAccounts,
8
- getParsedAccountInfo,
9
- requestAirdrop,
10
- } from "./account";
11
- import {
12
- solforgeAdminCloneProgram,
13
- solforgeAdminCloneProgramAccounts,
14
- solforgeAdminCloneTokenAccounts,
15
- solforgeAdminCloneTokenMint,
16
- solforgeAdoptMintAuthority,
17
- solforgeCreateMint,
18
- solforgeCreateTokenAccount,
19
- solforgeListMints,
20
- solforgeLoadProgram,
21
- solforgeMintTo,
22
- } from "./admin";
23
-
24
- import {
25
- getBlock,
26
- getBlockHeight,
27
- getBlocksWithLimit,
28
- getLatestBlockhash,
29
- getSlot,
30
- isBlockhashValid,
31
- } from "./block";
32
- import {
33
- getClusterNodes,
34
- getEpochInfo,
35
- getEpochSchedule,
36
- getHighestSnapshotSlot,
37
- getLeaderSchedule,
38
- getMaxRetransmitSlot,
39
- getMaxShredInsertSlot,
40
- getSlotLeader,
41
- getSlotLeaders,
42
- getStakeActivation,
43
- getStakeMinimumDelegation,
44
- getVoteAccounts,
45
- minimumLedgerSlot,
46
- } from "./epoch";
47
- import {
48
- getFeeCalculatorForBlockhash,
49
- getFeeForMessage,
50
- getFeeRateGovernor,
51
- getFees,
52
- getRecentPrioritizationFees,
53
- } from "./fee";
54
- import { getAddressLookupTable } from "./get-address-lookup-table";
55
- import {
56
- getRecentPerformanceSamples,
57
- getTransactionCount,
58
- } from "./performance";
59
- import {
60
- getBlockCommitment,
61
- getBlockProduction,
62
- getBlocks,
63
- getBlockTime,
64
- getFirstAvailableBlock,
65
- getGenesisHash,
66
- getIdentity,
67
- getInflationGovernor,
68
- getInflationRate,
69
- getInflationReward,
70
- getLargestAccounts,
71
- getParsedProgramAccounts,
72
- getParsedTokenAccountsByDelegate,
73
- getParsedTokenAccountsByOwner,
74
- getProgramAccounts,
75
- getSupply,
76
- getTokenAccountBalance,
77
- getTokenAccountsByDelegate,
78
- getTokenAccountsByOwner,
79
- getTokenLargestAccounts,
80
- getTokenSupply,
81
- } from "./program";
82
- import {
83
- solforgeGetStatus,
84
- solforgeListPrograms,
85
- solforgeListTokensDetailed,
86
- } from "./solforge";
87
- import {
88
- getHealth,
89
- getMinimumBalanceForRentExemption,
90
- getVersion,
91
- } from "./system";
92
- import {
93
- getConfirmedTransaction,
94
- getParsedTransaction,
95
- getSignatureStatuses,
96
- getSignaturesForAddress,
97
- getTransaction,
98
- sendTransaction,
99
- simulateTransaction,
100
- } from "./transaction";
101
-
102
- export const rpcMethods: Record<string, RpcMethodHandler> = {
103
- // Account methods
104
- getAccountInfo,
105
- getBalance,
106
- getMultipleAccounts,
107
- requestAirdrop,
108
- getParsedAccountInfo,
109
-
110
- // Transaction methods
111
- sendTransaction,
112
- simulateTransaction,
113
- getTransaction,
114
- getParsedTransaction,
115
- getSignatureStatuses,
116
- getSignaturesForAddress,
117
- getConfirmedTransaction,
118
-
119
- // Block methods
120
- getLatestBlockhash,
121
- getSlot,
122
- getBlockHeight,
123
- isBlockhashValid,
124
- getBlock,
125
- getBlocksWithLimit,
126
-
127
- // System methods
128
- getMinimumBalanceForRentExemption,
129
- getHealth,
130
- getVersion,
131
- // Program/network info methods
132
- getBlockTime,
133
- getBlocks,
134
- getFirstAvailableBlock,
135
- getGenesisHash,
136
- getIdentity,
137
- getInflationGovernor,
138
- getInflationRate,
139
- getInflationReward,
140
- getSupply,
141
- getBlockProduction,
142
- getParsedProgramAccounts,
143
- getProgramAccounts,
144
- getTokenAccountBalance,
145
- getTokenAccountsByOwner,
146
- getTokenAccountsByDelegate,
147
- getParsedTokenAccountsByOwner,
148
- getParsedTokenAccountsByDelegate,
149
- getTokenLargestAccounts,
150
- getTokenSupply,
151
- getBlockCommitment,
152
- getLargestAccounts,
153
-
154
- // Epoch/cluster methods
155
- getEpochSchedule,
156
- getEpochInfo,
157
- getLeaderSchedule,
158
- getSlotLeader,
159
- getSlotLeaders,
160
- getVoteAccounts,
161
- getClusterNodes,
162
- getStakeActivation,
163
- getMaxRetransmitSlot,
164
- getHighestSnapshotSlot,
165
- minimumLedgerSlot,
166
- getStakeMinimumDelegation,
167
- getMaxShredInsertSlot,
168
- // Performance metrics
169
- getRecentPerformanceSamples,
170
- getTransactionCount,
171
- getAddressLookupTable,
172
-
173
- // Fee methods
174
- getRecentPrioritizationFees,
175
- getFeeForMessage,
176
- getFees,
177
- getFeeCalculatorForBlockhash,
178
- getFeeRateGovernor,
179
-
180
- // Solforge helpers
181
- solforgeGetStatus,
182
- solforgeListPrograms,
183
- solforgeListTokensDetailed,
184
- };
185
-
186
- // Admin methods (gated by SOLFORGE_ADMIN=1)
187
- export const adminMethods: Record<string, RpcMethodHandler> = {
188
- solforgeAdminCloneProgram,
189
- solforgeAdminCloneProgramAccounts,
190
- solforgeAdminCloneTokenMint,
191
- solforgeAdminCloneTokenAccounts,
192
- solforgeCreateTokenAccount,
193
- solforgeLoadProgram,
194
- solforgeCreateMint,
195
- solforgeListMints,
196
- solforgeMintTo,
197
- solforgeAdoptMintAuthority,
198
- };
199
-
200
- Object.assign(rpcMethods, adminMethods);
201
-
202
- export {
203
- getAccountInfo,
204
- getBalance,
205
- getMultipleAccounts,
206
- requestAirdrop,
207
- sendTransaction,
208
- simulateTransaction,
209
- getTransaction,
210
- getSignatureStatuses,
211
- getSignaturesForAddress,
212
- getConfirmedTransaction,
213
- getLatestBlockhash,
214
- getSlot,
215
- getBlockHeight,
216
- isBlockhashValid,
217
- getBlock,
218
- getBlocksWithLimit,
219
- getMinimumBalanceForRentExemption,
220
- getHealth,
221
- getVersion,
222
- getBlockTime,
223
- getBlocks,
224
- getFirstAvailableBlock,
225
- getGenesisHash,
226
- getIdentity,
227
- getInflationGovernor,
228
- getInflationRate,
229
- getInflationReward,
230
- getSupply,
231
- getBlockProduction,
232
- getParsedProgramAccounts,
233
- getProgramAccounts,
234
- getTokenAccountBalance,
235
- getTokenAccountsByOwner,
236
- getTokenAccountsByDelegate,
237
- getTokenLargestAccounts,
238
- getTokenSupply,
239
- getBlockCommitment,
240
- getLargestAccounts,
241
- getEpochSchedule,
242
- getEpochInfo,
243
- getLeaderSchedule,
244
- getSlotLeader,
245
- getSlotLeaders,
246
- getVoteAccounts,
247
- getClusterNodes,
248
- getStakeActivation,
249
- getMaxRetransmitSlot,
250
- getHighestSnapshotSlot,
251
- minimumLedgerSlot,
252
- getStakeMinimumDelegation,
253
- getMaxShredInsertSlot,
254
- getRecentPerformanceSamples,
255
- getTransactionCount,
256
- getAddressLookupTable,
257
- solforgeGetStatus,
258
- solforgeListPrograms,
259
- solforgeListTokensDetailed,
260
- getRecentPrioritizationFees,
261
- getFeeForMessage,
262
- getFees,
263
- getFeeCalculatorForBlockhash,
264
- getFeeRateGovernor,
265
- };
@@ -1,25 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- const SLOTS_PER_60S_SAMPLE = 150;
4
-
5
- export const getRecentPerformanceSamples: RpcMethodHandler = (
6
- id,
7
- params,
8
- context,
9
- ) => {
10
- const [limitRaw] = params || [];
11
- const limit = Math.max(1, Math.min(Number(limitRaw ?? 1), 720));
12
- const samples = Array.from({ length: limit }, (_v, i) => {
13
- const slot = Math.max(0, Number(context.slot) - i * SLOTS_PER_60S_SAMPLE);
14
- const numSlots = SLOTS_PER_60S_SAMPLE;
15
- const totalTx = Number(context.getTxCount());
16
- const estPerSample = Math.max(0, Math.min(totalTx, 5000));
17
- return {
18
- numSlots,
19
- numTransactions: estPerSample,
20
- samplePeriodSecs: 60,
21
- slot,
22
- };
23
- });
24
- return context.createSuccessResponse(id, samples);
25
- };
@@ -1,5 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getTransactionCount: RpcMethodHandler = (id, _params, context) => {
4
- return context.createSuccessResponse(id, Number(context.getTxCount()));
5
- };
@@ -1,2 +0,0 @@
1
- export { getRecentPerformanceSamples } from "./get-recent-performance-samples";
2
- export { getTransactionCount } from "./get-transaction-count";
@@ -1,9 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getBlockCommitment: RpcMethodHandler = (id, params, context) => {
4
- const [_slot] = params || [];
5
- return context.createSuccessResponse(id, {
6
- commitment: [Number(context.slot), 0],
7
- totalStake: 1000000000,
8
- });
9
- };
@@ -1,14 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getBlockProduction: RpcMethodHandler = (id, _params, context) => {
4
- return context.createSuccessResponse(id, {
5
- context: { slot: Number(context.slot) },
6
- value: {
7
- byIdentity: {},
8
- range: {
9
- firstSlot: 0,
10
- lastSlot: Number(context.slot),
11
- },
12
- },
13
- });
14
- };
@@ -1,21 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getBlockTime: RpcMethodHandler = async (id, params, context) => {
4
- const [slot] = params || [];
5
- // Prefer persisted time if available
6
- try {
7
- const fromDb = await context.store?.getBlockTimeForSlot(Number(slot));
8
- if (typeof fromDb === "number") {
9
- return context.createSuccessResponse(id, fromDb);
10
- }
11
- } catch {}
12
-
13
- if (Number(slot) > Number(context.slot)) {
14
- return context.createSuccessResponse(id, null);
15
- }
16
- const SLOT_TIME_MS = 400;
17
- const currentTime = Math.floor(Date.now() / 1000);
18
- const slotDiff = Number(context.slot) - Number(slot);
19
- const blockTime = currentTime - Math.floor((slotDiff * SLOT_TIME_MS) / 1000);
20
- return context.createSuccessResponse(id, blockTime);
21
- };
@@ -1,11 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getBlocks: RpcMethodHandler = (id, params, context) => {
4
- const [startSlot, endSlot] = params || [];
5
- const start = Number(startSlot || 0);
6
- const end = Number(endSlot || context.slot);
7
- const blocks: number[] = [];
8
- for (let i = start; i <= end && i <= Number(context.slot); i++)
9
- blocks.push(i);
10
- return context.createSuccessResponse(id, blocks);
11
- };
@@ -1,9 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getFirstAvailableBlock: RpcMethodHandler = (
4
- id,
5
- _params,
6
- _context,
7
- ) => {
8
- return { jsonrpc: "2.0", id, result: 0 };
9
- };
@@ -1,6 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getGenesisHash: RpcMethodHandler = (id, _params, _context) => {
4
- const GENESIS_HASH = "11111111111111111111111111111111";
5
- return { jsonrpc: "2.0", id, result: GENESIS_HASH };
6
- };
@@ -1,6 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getIdentity: RpcMethodHandler = (id, _params, _context) => {
4
- const IDENTITY_PUBKEY = "11111111111111111111111111111111";
5
- return { jsonrpc: "2.0", id, result: { identity: IDENTITY_PUBKEY } };
6
- };
@@ -1,15 +0,0 @@
1
- import type { RpcMethodHandler } from "../../types";
2
-
3
- export const getInflationGovernor: RpcMethodHandler = (
4
- id,
5
- _params,
6
- context,
7
- ) => {
8
- return context.createSuccessResponse(id, {
9
- foundation: 0.05,
10
- foundationTerm: 7,
11
- initial: 0.15,
12
- taper: 0.15,
13
- terminal: 0.015,
14
- });
15
- };