@temporalabs/treasury 0.1.1 → 0.1.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.
Files changed (103) hide show
  1. package/NOTICE +4 -2
  2. package/README.md +100 -44
  3. package/THIRD_PARTY_NOTICES.connect-page.md +7836 -0
  4. package/THIRD_PARTY_NOTICES.md +543 -162
  5. package/dist/cli.d.ts +6 -0
  6. package/dist/cli.js +243 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/client.d.ts +366 -239
  9. package/dist/client.js +202 -25
  10. package/dist/client.js.map +1 -1
  11. package/dist/config/earn.d.ts +48 -12
  12. package/dist/config/earn.js +48 -12
  13. package/dist/config/earn.js.map +1 -1
  14. package/dist/connect/ack.d.ts +76 -0
  15. package/dist/connect/ack.js +147 -0
  16. package/dist/connect/ack.js.map +1 -0
  17. package/dist/connect/commands.d.ts +81 -0
  18. package/dist/connect/commands.js +555 -0
  19. package/dist/connect/commands.js.map +1 -0
  20. package/dist/connect/config.d.ts +24 -0
  21. package/dist/connect/config.js +35 -0
  22. package/dist/connect/config.js.map +1 -0
  23. package/dist/connect/gate-solana.d.ts +8 -0
  24. package/dist/connect/gate-solana.js +147 -0
  25. package/dist/connect/gate-solana.js.map +1 -0
  26. package/dist/connect/gate.d.ts +37 -0
  27. package/dist/connect/gate.js +115 -0
  28. package/dist/connect/gate.js.map +1 -0
  29. package/dist/connect/http.d.ts +60 -0
  30. package/dist/connect/http.js +235 -0
  31. package/dist/connect/http.js.map +1 -0
  32. package/dist/connect/open.d.ts +2 -0
  33. package/dist/connect/open.js +35 -0
  34. package/dist/connect/open.js.map +1 -0
  35. package/dist/connect/page.d.ts +5 -0
  36. package/dist/connect/page.js +69 -0
  37. package/dist/connect/page.js.map +1 -0
  38. package/dist/connect/session.d.ts +39 -0
  39. package/dist/connect/session.js +198 -0
  40. package/dist/connect/session.js.map +1 -0
  41. package/dist/connect/solana.d.ts +73 -0
  42. package/dist/connect/solana.js +267 -0
  43. package/dist/connect/solana.js.map +1 -0
  44. package/dist/connect/verify.d.ts +37 -0
  45. package/dist/connect/verify.js +89 -0
  46. package/dist/connect/verify.js.map +1 -0
  47. package/dist/connect-page.js +5143 -0
  48. package/dist/disclosures.d.ts +22 -6
  49. package/dist/disclosures.js +34 -8
  50. package/dist/disclosures.js.map +1 -1
  51. package/dist/earn/commands.d.ts +46 -0
  52. package/dist/earn/commands.js +556 -0
  53. package/dist/earn/commands.js.map +1 -0
  54. package/dist/earn/solana.d.ts +278 -0
  55. package/dist/earn/solana.js +302 -0
  56. package/dist/earn/solana.js.map +1 -0
  57. package/dist/guide.d.ts +15 -0
  58. package/dist/guide.js +50 -0
  59. package/dist/guide.js.map +1 -0
  60. package/dist/links.d.ts +2 -0
  61. package/dist/links.js +40 -14
  62. package/dist/links.js.map +1 -1
  63. package/dist/position.d.ts +9 -6
  64. package/dist/position.js +39 -19
  65. package/dist/position.js.map +1 -1
  66. package/dist/preflight.d.ts +9 -0
  67. package/dist/preflight.js +14 -3
  68. package/dist/preflight.js.map +1 -1
  69. package/dist/quote.js +24 -7
  70. package/dist/quote.js.map +1 -1
  71. package/dist/redact.d.ts +3 -3
  72. package/dist/redact.js +3 -3
  73. package/dist/redact.js.map +1 -1
  74. package/dist/registry-schema.d.ts +82 -5
  75. package/dist/registry-schema.js +105 -15
  76. package/dist/registry-schema.js.map +1 -1
  77. package/dist/registry.d.ts +50 -7
  78. package/dist/registry.js +122 -21
  79. package/dist/registry.js.map +1 -1
  80. package/dist/solana/constants.d.ts +49 -0
  81. package/dist/solana/constants.js +50 -0
  82. package/dist/solana/constants.js.map +1 -0
  83. package/dist/solana/kvault.d.ts +99 -0
  84. package/dist/solana/kvault.js +192 -0
  85. package/dist/solana/kvault.js.map +1 -0
  86. package/dist/solana/layout.d.ts +143 -0
  87. package/dist/solana/layout.js +209 -0
  88. package/dist/solana/layout.js.map +1 -0
  89. package/dist/solana/rpc.d.ts +24 -0
  90. package/dist/solana/rpc.js +66 -0
  91. package/dist/solana/rpc.js.map +1 -0
  92. package/dist/solana/vault.d.ts +153 -0
  93. package/dist/solana/vault.js +324 -0
  94. package/dist/solana/vault.js.map +1 -0
  95. package/dist/{mcp-server.mjs → treasury.mjs} +41101 -49486
  96. package/dist/version.js +5 -10
  97. package/dist/version.js.map +1 -1
  98. package/llms.txt +621 -0
  99. package/package.json +12 -9
  100. package/registry/vaults.json +218 -4
  101. package/dist/mcp/server.d.ts +0 -8
  102. package/dist/mcp/server.js +0 -368
  103. package/dist/mcp/server.js.map +0 -1
package/dist/client.d.ts CHANGED
@@ -78,240 +78,17 @@ export declare const chains: {
78
78
  formatters: {
79
79
  readonly block: {
80
80
  exclude: [] | undefined;
81
- format: (args: import("viem/chains").OpStackRpcBlock, action?: string | undefined) => {
82
- baseFeePerGas: bigint | null;
83
- blobGasUsed: bigint;
84
- difficulty: bigint;
85
- excessBlobGas: bigint;
86
- extraData: import("viem").Hex;
87
- gasLimit: bigint;
88
- gasUsed: bigint;
89
- hash: `0x${string}` | null;
90
- logsBloom: `0x${string}` | null;
91
- miner: import("viem").Address;
92
- mixHash: import("viem").Hash;
93
- nonce: `0x${string}` | null;
94
- number: bigint | null;
95
- parentBeaconBlockRoot?: `0x${string}` | undefined;
96
- parentHash: import("viem").Hash;
97
- receiptsRoot: import("viem").Hex;
98
- sealFields: import("viem").Hex[];
99
- sha3Uncles: import("viem").Hash;
100
- size: bigint;
101
- stateRoot: import("viem").Hash;
102
- timestamp: bigint;
103
- totalDifficulty: bigint | null;
104
- transactions: `0x${string}`[] | import("viem/chains").OpStackTransaction<boolean>[];
105
- transactionsRoot: import("viem").Hash;
106
- uncles: import("viem").Hash[];
107
- withdrawals?: import("viem").Withdrawal[] | undefined | undefined;
108
- withdrawalsRoot?: `0x${string}` | undefined;
109
- } & {};
81
+ format: (args: import("viem/chains").OpStackRpcBlock, action?: string | undefined) => import("viem/chains").OpStackBlock;
110
82
  type: "block";
111
83
  };
112
84
  readonly transaction: {
113
85
  exclude: [] | undefined;
114
- format: (args: import("viem/chains").OpStackRpcTransaction, action?: string | undefined) => ({
115
- blockHash: `0x${string}` | null;
116
- blockNumber: bigint | null;
117
- blockTimestamp?: bigint | undefined;
118
- from: import("viem").Address;
119
- gas: bigint;
120
- hash: import("viem").Hash;
121
- input: import("viem").Hex;
122
- nonce: number;
123
- r: import("viem").Hex;
124
- s: import("viem").Hex;
125
- to: import("viem").Address | null;
126
- transactionIndex: number | null;
127
- typeHex: import("viem").Hex | null;
128
- v: bigint;
129
- value: bigint;
130
- yParity: number;
131
- gasPrice?: undefined | undefined;
132
- maxFeePerBlobGas?: undefined | undefined;
133
- maxFeePerGas: bigint;
134
- maxPriorityFeePerGas: bigint;
135
- isSystemTx?: boolean;
136
- mint?: bigint | undefined | undefined;
137
- sourceHash: import("viem").Hex;
138
- type: "deposit";
139
- } | {
140
- r: import("viem").Hex;
141
- s: import("viem").Hex;
142
- v: bigint;
143
- to: import("viem").Address | null;
144
- from: import("viem").Address;
145
- gas: bigint;
146
- nonce: number;
147
- value: bigint;
148
- blockHash: `0x${string}` | null;
149
- blockNumber: bigint | null;
150
- blockTimestamp?: bigint | undefined;
151
- hash: import("viem").Hash;
152
- input: import("viem").Hex;
153
- transactionIndex: number | null;
154
- typeHex: import("viem").Hex | null;
155
- accessList?: undefined | undefined;
156
- authorizationList?: undefined | undefined;
157
- blobVersionedHashes?: undefined | undefined;
158
- chainId?: number | undefined;
159
- yParity?: undefined | undefined;
160
- type: "legacy";
161
- gasPrice: bigint;
162
- maxFeePerBlobGas?: undefined | undefined;
163
- maxFeePerGas?: undefined | undefined;
164
- maxPriorityFeePerGas?: undefined | undefined;
165
- isSystemTx?: undefined | undefined;
166
- mint?: undefined | undefined;
167
- sourceHash?: undefined | undefined;
168
- } | {
169
- blockHash: `0x${string}` | null;
170
- blockNumber: bigint | null;
171
- blockTimestamp?: bigint | undefined;
172
- from: import("viem").Address;
173
- gas: bigint;
174
- hash: import("viem").Hash;
175
- input: import("viem").Hex;
176
- nonce: number;
177
- r: import("viem").Hex;
178
- s: import("viem").Hex;
179
- to: import("viem").Address | null;
180
- transactionIndex: number | null;
181
- typeHex: import("viem").Hex | null;
182
- v: bigint;
183
- value: bigint;
184
- yParity: number;
185
- accessList: import("viem").AccessList;
186
- authorizationList?: undefined | undefined;
187
- blobVersionedHashes?: undefined | undefined;
188
- chainId: number;
189
- type: "eip2930";
190
- gasPrice: bigint;
191
- maxFeePerBlobGas?: undefined | undefined;
192
- maxFeePerGas?: undefined | undefined;
193
- maxPriorityFeePerGas?: undefined | undefined;
194
- isSystemTx?: undefined | undefined;
195
- mint?: undefined | undefined;
196
- sourceHash?: undefined | undefined;
197
- } | {
198
- blockHash: `0x${string}` | null;
199
- blockNumber: bigint | null;
200
- blockTimestamp?: bigint | undefined;
201
- from: import("viem").Address;
202
- gas: bigint;
203
- hash: import("viem").Hash;
204
- input: import("viem").Hex;
205
- nonce: number;
206
- r: import("viem").Hex;
207
- s: import("viem").Hex;
208
- to: import("viem").Address | null;
209
- transactionIndex: number | null;
210
- typeHex: import("viem").Hex | null;
211
- v: bigint;
212
- value: bigint;
213
- yParity: number;
214
- accessList: import("viem").AccessList;
215
- authorizationList?: undefined | undefined;
216
- blobVersionedHashes?: undefined | undefined;
217
- chainId: number;
218
- type: "eip1559";
219
- gasPrice?: undefined | undefined;
220
- maxFeePerBlobGas?: undefined | undefined;
221
- maxFeePerGas: bigint;
222
- maxPriorityFeePerGas: bigint;
223
- isSystemTx?: undefined | undefined;
224
- mint?: undefined | undefined;
225
- sourceHash?: undefined | undefined;
226
- } | {
227
- blockHash: `0x${string}` | null;
228
- blockNumber: bigint | null;
229
- blockTimestamp?: bigint | undefined;
230
- from: import("viem").Address;
231
- gas: bigint;
232
- hash: import("viem").Hash;
233
- input: import("viem").Hex;
234
- nonce: number;
235
- r: import("viem").Hex;
236
- s: import("viem").Hex;
237
- to: import("viem").Address | null;
238
- transactionIndex: number | null;
239
- typeHex: import("viem").Hex | null;
240
- v: bigint;
241
- value: bigint;
242
- yParity: number;
243
- accessList: import("viem").AccessList;
244
- authorizationList?: undefined | undefined;
245
- blobVersionedHashes: readonly import("viem").Hex[];
246
- chainId: number;
247
- type: "eip4844";
248
- gasPrice?: undefined | undefined;
249
- maxFeePerBlobGas: bigint;
250
- maxFeePerGas: bigint;
251
- maxPriorityFeePerGas: bigint;
252
- isSystemTx?: undefined | undefined;
253
- mint?: undefined | undefined;
254
- sourceHash?: undefined | undefined;
255
- } | {
256
- blockHash: `0x${string}` | null;
257
- blockNumber: bigint | null;
258
- blockTimestamp?: bigint | undefined;
259
- from: import("viem").Address;
260
- gas: bigint;
261
- hash: import("viem").Hash;
262
- input: import("viem").Hex;
263
- nonce: number;
264
- r: import("viem").Hex;
265
- s: import("viem").Hex;
266
- to: import("viem").Address | null;
267
- transactionIndex: number | null;
268
- typeHex: import("viem").Hex | null;
269
- v: bigint;
270
- value: bigint;
271
- yParity: number;
272
- accessList: import("viem").AccessList;
273
- authorizationList: import("viem").SignedAuthorizationList;
274
- blobVersionedHashes?: undefined | undefined;
275
- chainId: number;
276
- type: "eip7702";
277
- gasPrice?: undefined | undefined;
278
- maxFeePerBlobGas?: undefined | undefined;
279
- maxFeePerGas: bigint;
280
- maxPriorityFeePerGas: bigint;
281
- isSystemTx?: undefined | undefined;
282
- mint?: undefined | undefined;
283
- sourceHash?: undefined | undefined;
284
- }) & {};
86
+ format: (args: import("viem/chains").OpStackRpcTransaction, action?: string | undefined) => import("viem/chains").OpStackTransaction;
285
87
  type: "transaction";
286
88
  };
287
89
  readonly transactionReceipt: {
288
90
  exclude: [] | undefined;
289
- format: (args: import("viem/chains").OpStackRpcTransactionReceipt, action?: string | undefined) => {
290
- blobGasPrice?: bigint | undefined;
291
- blobGasUsed?: bigint | undefined;
292
- blockHash: import("viem").Hash;
293
- blockNumber: bigint;
294
- blockTimestamp?: bigint | undefined;
295
- contractAddress: import("viem").Address | null | undefined;
296
- cumulativeGasUsed: bigint;
297
- effectiveGasPrice: bigint;
298
- from: import("viem").Address;
299
- gasUsed: bigint;
300
- logs: import("viem").Log<bigint, number, false>[];
301
- logsBloom: import("viem").Hex;
302
- root?: `0x${string}` | undefined;
303
- status: "success" | "reverted";
304
- to: import("viem").Address | null;
305
- transactionHash: import("viem").Hash;
306
- transactionIndex: number;
307
- type: import("viem").TransactionType;
308
- depositNonce?: bigint | undefined | undefined;
309
- depositReceiptVersion?: number | undefined | undefined;
310
- l1GasPrice: bigint | null;
311
- l1GasUsed: bigint | null;
312
- l1Fee: bigint | null;
313
- l1FeeScalar: number | null;
314
- } & {};
91
+ format: (args: import("viem/chains").OpStackRpcTransactionReceipt, action?: string | undefined) => import("viem/chains").OpStackTransactionReceipt;
315
92
  type: "transactionReceipt";
316
93
  };
317
94
  };
@@ -329,9 +106,300 @@ export declare const chains: {
329
106
  };
330
107
  verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
331
108
  };
109
+ readonly 42161: {
110
+ blockExplorers: {
111
+ readonly default: {
112
+ readonly name: "Arbiscan";
113
+ readonly url: "https://arbiscan.io";
114
+ readonly apiUrl: "https://api.arbiscan.io/api";
115
+ };
116
+ };
117
+ blockTime: 250;
118
+ contracts: {
119
+ readonly multicall3: {
120
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
121
+ readonly blockCreated: 7654707;
122
+ };
123
+ };
124
+ ensTlds?: readonly string[] | undefined;
125
+ id: 42161;
126
+ name: "Arbitrum One";
127
+ nativeCurrency: {
128
+ readonly name: "Ether";
129
+ readonly symbol: "ETH";
130
+ readonly decimals: 18;
131
+ };
132
+ experimental_preconfirmationTime?: number | undefined | undefined;
133
+ rpcUrls: {
134
+ readonly default: {
135
+ readonly http: readonly ["https://arb1.arbitrum.io/rpc"];
136
+ };
137
+ };
138
+ sourceId?: number | undefined | undefined;
139
+ supportsTransactionReplacementDetection?: boolean | undefined | undefined;
140
+ testnet?: boolean | undefined | undefined;
141
+ custom?: Record<string, unknown> | undefined;
142
+ extendSchema?: Record<string, unknown> | undefined;
143
+ fees?: import("viem").ChainFees<undefined> | undefined;
144
+ formatters?: undefined;
145
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
146
+ client: import("viem").Client;
147
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
148
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
149
+ client: import("viem").Client;
150
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
151
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
152
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
153
+ }] | undefined;
154
+ serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
155
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
156
+ };
157
+ readonly 4663: {
158
+ blockExplorers: {
159
+ readonly default: {
160
+ readonly name: "Blockscout";
161
+ readonly url: "https://robinhoodchain.blockscout.com";
162
+ readonly apiUrl: "https://robinhoodchain.blockscout.com/api";
163
+ };
164
+ };
165
+ blockTime: 100;
166
+ contracts: {
167
+ readonly multicall3: {
168
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
169
+ };
170
+ };
171
+ ensTlds?: readonly string[] | undefined;
172
+ id: 4663;
173
+ name: "Robinhood Chain";
174
+ nativeCurrency: {
175
+ readonly name: "Ether";
176
+ readonly symbol: "ETH";
177
+ readonly decimals: 18;
178
+ };
179
+ experimental_preconfirmationTime?: number | undefined | undefined;
180
+ rpcUrls: {
181
+ readonly default: {
182
+ readonly http: readonly ["https://rpc.mainnet.chain.robinhood.com", "https://rpc.ordofi.network"];
183
+ readonly webSocket: readonly ["wss://rpc.ordofi.network"];
184
+ };
185
+ };
186
+ sourceId?: number | undefined | undefined;
187
+ supportsTransactionReplacementDetection?: boolean | undefined | undefined;
188
+ testnet?: boolean | undefined | undefined;
189
+ custom?: Record<string, unknown> | undefined;
190
+ extendSchema?: Record<string, unknown> | undefined;
191
+ fees?: import("viem").ChainFees<undefined> | undefined;
192
+ formatters?: undefined;
193
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
194
+ client: import("viem").Client;
195
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
196
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
197
+ client: import("viem").Client;
198
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
199
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
200
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
201
+ }] | undefined;
202
+ serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
203
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
204
+ };
205
+ readonly 1: {
206
+ blockExplorers: {
207
+ readonly default: {
208
+ readonly name: "Etherscan";
209
+ readonly url: "https://etherscan.io";
210
+ readonly apiUrl: "https://api.etherscan.io/api";
211
+ };
212
+ };
213
+ blockTime: 12000;
214
+ contracts: {
215
+ readonly ensUniversalResolver: {
216
+ readonly address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee";
217
+ readonly blockCreated: 23085558;
218
+ };
219
+ readonly multicall3: {
220
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
221
+ readonly blockCreated: 14353601;
222
+ };
223
+ };
224
+ ensTlds?: readonly string[] | undefined;
225
+ id: 1;
226
+ name: "Ethereum";
227
+ nativeCurrency: {
228
+ readonly name: "Ether";
229
+ readonly symbol: "ETH";
230
+ readonly decimals: 18;
231
+ };
232
+ experimental_preconfirmationTime?: number | undefined | undefined;
233
+ rpcUrls: {
234
+ readonly default: {
235
+ readonly http: readonly ["https://ethereum.reth.rs/rpc"];
236
+ };
237
+ };
238
+ sourceId?: number | undefined | undefined;
239
+ supportsTransactionReplacementDetection?: boolean | undefined | undefined;
240
+ testnet?: boolean | undefined | undefined;
241
+ custom?: Record<string, unknown> | undefined;
242
+ extendSchema?: Record<string, unknown> | undefined;
243
+ fees?: import("viem").ChainFees<undefined> | undefined;
244
+ formatters?: undefined;
245
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
246
+ client: import("viem").Client;
247
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
248
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
249
+ client: import("viem").Client;
250
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
251
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
252
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
253
+ }] | undefined;
254
+ serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
255
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
256
+ };
257
+ readonly 143: {
258
+ blockExplorers: {
259
+ readonly default: {
260
+ readonly name: "Monadscan";
261
+ readonly url: "https://monadscan.com";
262
+ readonly apiUrl: "https://api.etherscan.io/v2/api?chainid=143";
263
+ };
264
+ readonly monadvision: {
265
+ readonly name: "MonadVision";
266
+ readonly url: "https://monadvision.com";
267
+ };
268
+ };
269
+ blockTime: 400;
270
+ contracts: {
271
+ readonly multicall3: {
272
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
273
+ readonly blockCreated: 9248132;
274
+ };
275
+ };
276
+ ensTlds?: readonly string[] | undefined;
277
+ id: 143;
278
+ name: "Monad";
279
+ nativeCurrency: {
280
+ readonly name: "Monad";
281
+ readonly symbol: "MON";
282
+ readonly decimals: 18;
283
+ };
284
+ experimental_preconfirmationTime?: number | undefined | undefined;
285
+ rpcUrls: {
286
+ readonly default: {
287
+ readonly http: readonly ["https://rpc.monad.xyz", "https://rpc1.monad.xyz"];
288
+ readonly webSocket: readonly ["wss://rpc.monad.xyz", "wss://rpc1.monad.xyz"];
289
+ };
290
+ };
291
+ sourceId?: number | undefined | undefined;
292
+ supportsTransactionReplacementDetection?: boolean | undefined | undefined;
293
+ testnet: false;
294
+ custom?: Record<string, unknown> | undefined;
295
+ extendSchema?: Record<string, unknown> | undefined;
296
+ fees?: import("viem").ChainFees<undefined> | undefined;
297
+ formatters?: undefined;
298
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
299
+ client: import("viem").Client;
300
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
301
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
302
+ client: import("viem").Client;
303
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
304
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
305
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
306
+ }] | undefined;
307
+ serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
308
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
309
+ };
332
310
  };
333
311
  export type SupportedChainId = keyof typeof chains;
334
312
  export declare function isSupportedChainId(id: number): id is SupportedChainId;
313
+ /**
314
+ * Everything this client knows about a chain besides viem's own definition: the name a tool caller
315
+ * uses for it (`chain: "arbitrum"`), the name shown to an operator, the environment variables that
316
+ * configure its RPC, and the public endpoint used when none is set.
317
+ *
318
+ * ONE TABLE, so a chain cannot be half-added: `rpcUrlFromEnv`, `logsRpcUrlFromEnv`,
319
+ * `rpcSourceForEnv`, `resolvedRpcSecrets` and `publicRpcHint` all read it, and `Record<
320
+ * SupportedChainId, …>` makes a chain present in `chains` and absent here a compile error.
321
+ * `links.ts` holds the explorer map and is the one place this table does not reach; it fails loudly
322
+ * on a chain it does not know.
323
+ *
324
+ * `rpcEnv` is tried in order. The second name of each pair is the conventional one an operator may
325
+ * already have set. The CLI reads the whole environment it was started in, so both names reach it.
326
+ */
327
+ export interface ChainInfo {
328
+ key: string;
329
+ name: string;
330
+ rpcEnv: readonly string[];
331
+ logsRpcEnv: string;
332
+ publicRpc: string;
333
+ }
334
+ export declare const CHAIN_INFO: {
335
+ readonly 8453: {
336
+ readonly key: "base";
337
+ readonly name: "Base";
338
+ readonly rpcEnv: readonly ["TREASURY_RPC_BASE", "BASE_RPC_URL"];
339
+ readonly logsRpcEnv: "TREASURY_LOGS_RPC_BASE";
340
+ readonly publicRpc: "https://mainnet.base.org";
341
+ };
342
+ readonly 42161: {
343
+ readonly key: "arbitrum";
344
+ readonly name: "Arbitrum One";
345
+ readonly rpcEnv: readonly ["TREASURY_RPC_ARBITRUM", "ARBITRUM_RPC_URL"];
346
+ readonly logsRpcEnv: "TREASURY_LOGS_RPC_ARBITRUM";
347
+ readonly publicRpc: "https://arb1.arbitrum.io/rpc";
348
+ };
349
+ readonly 4663: {
350
+ readonly key: "robinhood";
351
+ readonly name: "Robinhood Chain";
352
+ readonly rpcEnv: readonly ["TREASURY_RPC_ROBINHOOD", "ROBINHOOD_RPC_URL"];
353
+ readonly logsRpcEnv: "TREASURY_LOGS_RPC_ROBINHOOD";
354
+ readonly publicRpc: "https://rpc.mainnet.chain.robinhood.com";
355
+ };
356
+ readonly 1: {
357
+ readonly key: "ethereum";
358
+ readonly name: "Ethereum";
359
+ readonly rpcEnv: readonly ["TREASURY_RPC_ETHEREUM", "ETHEREUM_RPC_URL"];
360
+ readonly logsRpcEnv: "TREASURY_LOGS_RPC_ETHEREUM";
361
+ readonly publicRpc: "https://ethereum.reth.rs/rpc";
362
+ };
363
+ readonly 143: {
364
+ readonly key: "monad";
365
+ readonly name: "Monad";
366
+ readonly rpcEnv: readonly ["TREASURY_RPC_MONAD", "MONAD_RPC_URL"];
367
+ readonly logsRpcEnv: "TREASURY_LOGS_RPC_MONAD";
368
+ readonly publicRpc: "https://rpc.monad.xyz";
369
+ };
370
+ };
371
+ /**
372
+ * Solana — the one chain here that is not an EVM chain. It has no chain id, no `viem` chain and no
373
+ * `eth_getLogs`, so it is not a row of `CHAIN_INFO`; everything else about it follows the same rules:
374
+ * its own variables only, then its public endpoint. An endpoint is checked for the right cluster by its
375
+ * genesis hash (`src/solana/rpc.ts`), the counterpart of an EVM endpoint's chain id.
376
+ */
377
+ export declare const SOLANA_INFO: {
378
+ readonly key: "solana";
379
+ readonly name: "Solana";
380
+ readonly rpcEnv: readonly ["TREASURY_RPC_SOLANA", "SOLANA_RPC_URL"];
381
+ readonly publicRpc: "https://api.mainnet-beta.solana.com";
382
+ };
383
+ /** The Solana RPC URL: `TREASURY_RPC_SOLANA`, then `SOLANA_RPC_URL`, then the public mainnet endpoint. */
384
+ export declare function solanaRpcUrlFromEnv(): string;
385
+ /** Which variable supplied the Solana RPC URL — the NAME only, never the value. */
386
+ export declare function solanaRpcSourceForEnv(): {
387
+ source: string;
388
+ configured: boolean;
389
+ };
390
+ /** `publicRpcHint` for Solana: the sentence for a failure on the unconfigured public endpoint. */
391
+ export declare function solanaPublicRpcHint(): string | undefined;
392
+ /** The name a tool caller uses for a chain: `"base"`, `"arbitrum"`, `"robinhood"`, `"ethereum"`, `"monad"`. */
393
+ export type ChainKey = (typeof CHAIN_INFO)[SupportedChainId]["key"];
394
+ /**
395
+ * Every supported chain, in the order chains were added: Base first, then Arbitrum One, Robinhood
396
+ * Chain, Ethereum and Monad. Listed rather than read from `Object.keys(chains)`, whose integer keys
397
+ * enumerate in numeric order and would put Ethereum (1) ahead of Base everywhere a list of chains is shown.
398
+ * `client.unit.test.ts` holds this list equal to the keys of `chains`.
399
+ */
400
+ export declare const supportedChainIds: SupportedChainId[];
401
+ /** `"arbitrum"` → 42161. `undefined` for a name this client does not know — the caller says so. */
402
+ export declare function chainIdForKey(key: string): SupportedChainId | undefined;
335
403
  /**
336
404
  * Read-only client. This module constructs exactly one kind of thing — a public (unsigned)
337
405
  * client from an RPC URL. It never constructs a wallet client: the signer is the consumer's,
@@ -372,29 +440,45 @@ export declare function makePublicClient(chainId: SupportedChainId, rpcUrl: stri
372
440
  /**
373
441
  * An env value counts as an RPC URL only if it parses as one with an http(s) scheme. Anything else —
374
442
  * empty, whitespace, a non-URL, and in particular an UNEXPANDED placeholder like `${TREASURY_RPC_BASE}` —
375
- * is treated as unset. Measured 2026-09-12: Claude Code forwards the plugin's `.mcp.json` value
376
- * `${TREASURY_RPC_BASE}` verbatim when the host variable is unset, and with the old `if (v)` test every
377
- * RPC-touching tool died on "Failed to parse URL from ${TREASURY_RPC_BASE}". `.mcp.json` now also uses
378
- * `${VAR:-}`, but this guard is what makes the server independent of any host's expansion rules.
443
+ * is treated as unset. Measured 2026-09-12, when the plugin still declared an MCP server: Claude Code
444
+ * forwarded the server declaration's value `${TREASURY_RPC_BASE}` verbatim when the host variable was
445
+ * unset, and with the old `if (v)` test every RPC-touching tool died on "Failed to parse URL from
446
+ * ${TREASURY_RPC_BASE}". The plugin now runs the CLI through the shell and declares nothing, but any
447
+ * host or wrapper can still pass a placeholder through, and this guard is what makes the client
448
+ * independent of anyone's expansion rules.
379
449
  */
380
450
  export declare function rpcUrlFromEnvValue(v: string | undefined): string | undefined;
381
451
  /**
382
452
  * Resolves the RPC URL for a chain from the environment. ⚠️ A keyed provider URL IS a secret: it must
383
- * never appear in tool output — every error crossing the tool boundary goes through `describeError`
384
- * (`src/redact.ts`), which strips endpoints. Fallback names after `TREASURY_RPC_BASE`:
385
- * `BASE_RPC_URL`; the plugin's `.mcp.json` passes only the `TREASURY_*` pair through, so under the
386
- * packaged path the fallback is unreachable.
387
- * `TREASURY_LOGS_RPC_BASE`, if set, is preferred for log scans (providers cap eth_getLogs ranges very
388
- * differently: Alchemy free 10 blocks, Base public 2,000) — see `position.ts`.
453
+ * never appear in tool output — every error crossing the tool boundary goes through `redactEndpoints`
454
+ * (`src/redact.ts`), which strips endpoints. The names come from `CHAIN_INFO`: on Base,
455
+ * `TREASURY_RPC_BASE` then `BASE_RPC_URL`; on Arbitrum One, `TREASURY_RPC_ARBITRUM` then
456
+ * `ARBITRUM_RPC_URL`; on Robinhood Chain, `TREASURY_RPC_ROBINHOOD` then `ROBINHOOD_RPC_URL`; on Ethereum,
457
+ * `TREASURY_RPC_ETHEREUM` then `ETHEREUM_RPC_URL`; on Monad, `TREASURY_RPC_MONAD` then `MONAD_RPC_URL`.
458
+ * The CLI inherits its shell's whole environment, so on every path, the plugin's
459
+ * included, the second name of each pair is used when the first is unset.
460
+ * The chain's logs variable (`TREASURY_LOGS_RPC_<CHAIN>`: BASE, ARBITRUM, ROBINHOOD, ETHEREUM, MONAD), if set, is
461
+ * preferred for log scans (providers cap eth_getLogs ranges very differently: Alchemy free 10 blocks,
462
+ * Base public 2,000, Infura 10,000 on Arbitrum) — see `position.ts`.
463
+ *
464
+ * 🔴 A chain reads ONLY its own variables. An Arbitrum call never falls back to a Base endpoint: a
465
+ * vault's address has no contract on the other chain, so reads fail with "returned no data" — which
466
+ * reads as a broken vault rather than as a misconfiguration.
389
467
  */
390
468
  export declare function rpcUrlFromEnv(chainId: SupportedChainId): string;
391
469
  /**
392
470
  * The endpoint an event scan falls back to when the configured logs RPC cannot cover the range — and
393
- * the operator's opt-out from it. `TREASURY_LOGS_FALLBACK` unset ⇒ Base's public endpoint; an http(s)
394
- * URL ⇒ that endpoint; ANY other value — `off`, `none`, `disabled`, a typo — ⇒ no fallback at all, and
395
- * the scan degrades to a cut-short window as it did before the fallback existed. It exists because the fallback
471
+ * the operator's opt-out from it. `TREASURY_LOGS_FALLBACK` unset ⇒ the chain's public endpoint; an
472
+ * http(s) URL ⇒ that endpoint, ON BASE ONLY; ANY other value — `off`, `none`, `disabled`, a typo — ⇒ no
473
+ * fallback at all, and the scan degrades to a cut-short window as it did before the fallback existed. It exists because the fallback
396
474
  * otherwise sends a query to a third party the operator never named, which some
397
475
  * deployments cannot accept — and it fails CLOSED for the same reason.
476
+ *
477
+ * 🔴 The variable names ONE endpoint, and that endpoint is on Base. On any other chain a URL there
478
+ * cannot serve the scan — it would answer for the wrong chain — so a SET variable means no fallback
479
+ * on that chain, whatever it holds: either the operator opted out, or they named a Base endpoint and
480
+ * so constrained where this process talks. An operator who wants history on another chain points that
481
+ * chain's logs variable (`TREASURY_LOGS_RPC_ARBITRUM`, `TREASURY_LOGS_RPC_MONAD`, …) at a provider with a wide eth_getLogs range.
398
482
  */
399
483
  export declare function logsFallbackUrlFromEnv(chainId: SupportedChainId, logsUrl: string): string | undefined;
400
484
  /** RPC to use for eth_getLogs scans: a dedicated one if configured, else the general one. */
@@ -427,3 +511,46 @@ export declare function resolvedRpcSecrets(): string[];
427
511
  * undefined when a keyed RPC resolved, so a real chain fault is never mislabelled as a setup problem.
428
512
  */
429
513
  export declare function publicRpcHint(chainId: SupportedChainId): string | undefined;
514
+ /** How long a chain-identity probe may take before the endpoint counts as "did not say". */
515
+ export declare const CHAIN_PROBE_MS = 3000;
516
+ /**
517
+ * Which chain does this endpoint say it is? `undefined` when it did not say within
518
+ * `CHAIN_PROBE_MS` — an error, a rate limit, a hang — which is NOT a statement about the chain: the
519
+ * caller reports that as "not verified", never as a match and never as a mismatch.
520
+ *
521
+ * It exists because two chains mean two RPC variables, and the likeliest mistake is one pointed at
522
+ * the other chain. Nothing then errors usefully: a vault's address has no code there, so reads fail
523
+ * with "returned no data" and the failure reads as a broken vault.
524
+ *
525
+ * Bounded on purpose. The transport's own deadline is 10 s and a rate-limited `eth_chainId` is waited
526
+ * out for all of it, which would make a health check that already has its answer wait ten seconds
527
+ * for a second one (measured in review). An answer is remembered per endpoint URL, so a process asks
528
+ * each endpoint once.
529
+ */
530
+ export declare function endpointChainId(client: ReadClient, rpcUrl: string, timeoutMs?: number): Promise<number | undefined>;
531
+ /** An endpoint a tool is about to read through, and the NAME of the variable that supplied it. */
532
+ export interface Endpoint {
533
+ client: ReadClient;
534
+ url: string;
535
+ source: string;
536
+ }
537
+ /**
538
+ * The first of these endpoints that answers for a chain other than `chainId`, or `undefined`.
539
+ * A chain's public endpoint is never asked: it is this client's own constant, so the question
540
+ * would be a request to a third party with a known answer. An endpoint that does not say is not a
541
+ * mismatch.
542
+ */
543
+ export declare function firstEndpointOnWrongChain(chainId: SupportedChainId, endpoints: Endpoint[]): Promise<{
544
+ source: string;
545
+ answersFor: number;
546
+ } | undefined>;
547
+ /** TEST SEAM — forgets what every endpoint said, so one test's mock port cannot answer for the next. NOT re-exported from index.ts. */
548
+ export declare function __forgetEndpointChainsForTests(): void;
549
+ /**
550
+ * Which variable supplied the endpoint `earn_balance` scans events through — the chain's logs
551
+ * variable when it resolves, otherwise whatever supplied the general RPC. The NAME only.
552
+ */
553
+ export declare function logsRpcSourceForEnv(chainId: SupportedChainId): {
554
+ source: string;
555
+ configured: boolean;
556
+ };