@vtx-labs/solana-explain 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +328 -0
- package/dist/cli/index.d.ts +14 -0
- package/dist/cli/index.js +3317 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +116 -0
- package/dist/index.js +3130 -0
- package/dist/index.js.map +1 -0
- package/dist/programs.d.ts +42 -0
- package/dist/programs.js +919 -0
- package/dist/programs.js.map +1 -0
- package/dist/render.d.ts +59 -0
- package/dist/render.js +300 -0
- package/dist/render.js.map +1 -0
- package/dist/types-MSKEy1VA.d.ts +482 -0
- package/package.json +83 -0
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The RpcClient interface + raw RPC response shapes.
|
|
3
|
+
*
|
|
4
|
+
* The library only ever talks to {@link RpcClient}, which makes it
|
|
5
|
+
* network-source-agnostic and keeps `@solana/web3.js` an optional peer dep.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
interface GetTransactionOpts {
|
|
9
|
+
commitment?: Commitment;
|
|
10
|
+
maxSupportedTransactionVersion?: number;
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
}
|
|
13
|
+
interface SimulateOpts {
|
|
14
|
+
commitment?: Commitment;
|
|
15
|
+
sigVerify?: boolean;
|
|
16
|
+
replaceRecentBlockhash?: boolean;
|
|
17
|
+
/** Accounts to return post-state for (jsonParsed). */
|
|
18
|
+
accounts?: {
|
|
19
|
+
addresses: string[];
|
|
20
|
+
encoding?: 'jsonParsed' | 'base64';
|
|
21
|
+
};
|
|
22
|
+
innerInstructions?: boolean;
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
}
|
|
25
|
+
interface GetAccountsOpts {
|
|
26
|
+
commitment?: Commitment;
|
|
27
|
+
encoding?: 'jsonParsed' | 'base64';
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
}
|
|
30
|
+
interface RpcClient {
|
|
31
|
+
getTransaction(sig: string, opts: GetTransactionOpts): Promise<RawTransactionResponse | null>;
|
|
32
|
+
simulateTransaction(txBase64: string, opts: SimulateOpts): Promise<RawSimulateResponse>;
|
|
33
|
+
getMultipleAccounts(addresses: string[], opts: GetAccountsOpts): Promise<(RawAccount | null)[]>;
|
|
34
|
+
getLatestBlockhash(opts?: {
|
|
35
|
+
commitment?: Commitment;
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
}): Promise<{
|
|
38
|
+
blockhash: string;
|
|
39
|
+
lastValidBlockHeight: number;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
interface RawTokenAmount {
|
|
43
|
+
amount: string;
|
|
44
|
+
decimals: number;
|
|
45
|
+
uiAmount: number | null;
|
|
46
|
+
uiAmountString?: string;
|
|
47
|
+
}
|
|
48
|
+
interface RawTokenBalance {
|
|
49
|
+
accountIndex: number;
|
|
50
|
+
mint: string;
|
|
51
|
+
owner?: string;
|
|
52
|
+
programId?: string;
|
|
53
|
+
uiTokenAmount: RawTokenAmount;
|
|
54
|
+
}
|
|
55
|
+
interface RawInstructionCompiled {
|
|
56
|
+
programIdIndex: number;
|
|
57
|
+
accounts: number[];
|
|
58
|
+
data: string;
|
|
59
|
+
}
|
|
60
|
+
interface RawInnerInstructions {
|
|
61
|
+
index: number;
|
|
62
|
+
instructions: RawInstructionCompiled[];
|
|
63
|
+
}
|
|
64
|
+
interface RawLoadedAddresses {
|
|
65
|
+
writable: string[];
|
|
66
|
+
readonly: string[];
|
|
67
|
+
}
|
|
68
|
+
interface RawTransactionMeta {
|
|
69
|
+
err: unknown;
|
|
70
|
+
fee: number;
|
|
71
|
+
preBalances: number[];
|
|
72
|
+
postBalances: number[];
|
|
73
|
+
preTokenBalances?: RawTokenBalance[];
|
|
74
|
+
postTokenBalances?: RawTokenBalance[];
|
|
75
|
+
innerInstructions?: RawInnerInstructions[];
|
|
76
|
+
loadedAddresses?: RawLoadedAddresses;
|
|
77
|
+
computeUnitsConsumed?: number;
|
|
78
|
+
logMessages?: string[];
|
|
79
|
+
}
|
|
80
|
+
interface RawTransactionResponse {
|
|
81
|
+
slot: number;
|
|
82
|
+
blockTime: number | null;
|
|
83
|
+
version?: number | 'legacy';
|
|
84
|
+
meta: RawTransactionMeta | null;
|
|
85
|
+
transaction: {
|
|
86
|
+
signatures: string[];
|
|
87
|
+
/** We request base64 message encoding so we can decode roles ourselves. */
|
|
88
|
+
message: string | unknown;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
interface RawSimulateValue {
|
|
92
|
+
err: unknown;
|
|
93
|
+
logs: string[] | null;
|
|
94
|
+
unitsConsumed?: number;
|
|
95
|
+
accounts?: (RawAccount | null)[];
|
|
96
|
+
innerInstructions?: RawInnerInstructions[];
|
|
97
|
+
returnData?: unknown;
|
|
98
|
+
}
|
|
99
|
+
interface RawSimulateResponse {
|
|
100
|
+
context: {
|
|
101
|
+
slot: number;
|
|
102
|
+
};
|
|
103
|
+
value: RawSimulateValue;
|
|
104
|
+
}
|
|
105
|
+
interface RawAccount {
|
|
106
|
+
lamports: number;
|
|
107
|
+
owner: string;
|
|
108
|
+
data: unknown;
|
|
109
|
+
executable: boolean;
|
|
110
|
+
rentEpoch?: number | string;
|
|
111
|
+
space?: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* All shared public types & interfaces for solana-explain.
|
|
116
|
+
*
|
|
117
|
+
* All numeric on-chain quantities are `bigint`; `ui*` string fields carry
|
|
118
|
+
* human/decimal formatting so callers never lose precision.
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
type Commitment = 'processed' | 'confirmed' | 'finalized';
|
|
122
|
+
interface ExplainOptions {
|
|
123
|
+
/** RPC URL string OR a pre-built {@link RpcClient}. Required (no default endpoint, to avoid abuse). */
|
|
124
|
+
rpc: string | RpcClient;
|
|
125
|
+
/** Commitment level for reads/sim. Default `'confirmed'`. */
|
|
126
|
+
commitment?: Commitment;
|
|
127
|
+
/** Extra/override program decoders. Merged over {@link defaultRegistry}. */
|
|
128
|
+
registry?: ProgramRegistry;
|
|
129
|
+
/** AbortSignal for cancellation; all RPC calls honor it. */
|
|
130
|
+
signal?: AbortSignal;
|
|
131
|
+
/** Per-call timeout in ms. Default `30_000`. */
|
|
132
|
+
timeoutMs?: number;
|
|
133
|
+
/** "Whose view" to phrase deltas from. Highlights this account in output. */
|
|
134
|
+
focusAccount?: string;
|
|
135
|
+
/** Attach the raw RPC payload under {@link ExplainResult.raw}. */
|
|
136
|
+
includeRaw?: boolean;
|
|
137
|
+
}
|
|
138
|
+
interface ExplainSignatureOptions extends ExplainOptions {
|
|
139
|
+
/** Max supported tx version for `getTransaction`. Default `0` (versioned txs). */
|
|
140
|
+
maxSupportedTransactionVersion?: number;
|
|
141
|
+
}
|
|
142
|
+
interface ExplainTransactionOptions extends ExplainOptions {
|
|
143
|
+
/** Input encoding. Default `'auto'`. */
|
|
144
|
+
encoding?: 'base64' | 'base58' | 'auto';
|
|
145
|
+
/** Let simulation run unsigned. Default `true`. */
|
|
146
|
+
replaceRecentBlockhash?: boolean;
|
|
147
|
+
/** Verify signatures during simulation. Default `false`. */
|
|
148
|
+
sigVerify?: boolean;
|
|
149
|
+
}
|
|
150
|
+
interface ExplainInstructionsOptions extends ExplainOptions {
|
|
151
|
+
/** Required to assemble a simulatable message. */
|
|
152
|
+
feePayer: string;
|
|
153
|
+
}
|
|
154
|
+
interface ExplainInstructionAccount {
|
|
155
|
+
pubkey: string;
|
|
156
|
+
isSigner: boolean;
|
|
157
|
+
isWritable: boolean;
|
|
158
|
+
}
|
|
159
|
+
interface ExplainInstruction {
|
|
160
|
+
programId: string;
|
|
161
|
+
accounts: ExplainInstructionAccount[];
|
|
162
|
+
/** Base64 or base58 encoded instruction data, OR a raw byte array. */
|
|
163
|
+
data: string | Uint8Array | number[];
|
|
164
|
+
}
|
|
165
|
+
interface ExplainResult {
|
|
166
|
+
source: 'signature' | 'simulation';
|
|
167
|
+
signature?: string;
|
|
168
|
+
/** Commitment level the result was read at (signature source only). */
|
|
169
|
+
commitment?: Commitment;
|
|
170
|
+
/** `false` if on-chain err or sim err. */
|
|
171
|
+
success: boolean;
|
|
172
|
+
error?: {
|
|
173
|
+
raw: unknown;
|
|
174
|
+
human: string;
|
|
175
|
+
};
|
|
176
|
+
slot?: number;
|
|
177
|
+
blockTime?: number | null;
|
|
178
|
+
feeLamports: bigint;
|
|
179
|
+
computeUnits?: number;
|
|
180
|
+
feePayer: string;
|
|
181
|
+
/** One-line plain-English headline. */
|
|
182
|
+
summary: string;
|
|
183
|
+
actions: Action[];
|
|
184
|
+
balanceChanges: BalanceDelta[];
|
|
185
|
+
instructions: DecodedInstruction[];
|
|
186
|
+
accountsCreated: AccountCreation[];
|
|
187
|
+
approvals: Approval[];
|
|
188
|
+
programsInvoked: ProgramInvocation[];
|
|
189
|
+
warnings: Warning[];
|
|
190
|
+
/** Attached only when {@link ExplainOptions.includeRaw}. */
|
|
191
|
+
raw?: unknown;
|
|
192
|
+
}
|
|
193
|
+
type Action = {
|
|
194
|
+
kind: 'sol-transfer';
|
|
195
|
+
from: string;
|
|
196
|
+
to: string;
|
|
197
|
+
lamports: bigint;
|
|
198
|
+
sol: string;
|
|
199
|
+
} | {
|
|
200
|
+
kind: 'token-transfer';
|
|
201
|
+
from: string;
|
|
202
|
+
to: string;
|
|
203
|
+
mint: string;
|
|
204
|
+
amount: bigint;
|
|
205
|
+
uiAmount: string;
|
|
206
|
+
decimals: number;
|
|
207
|
+
symbol?: string;
|
|
208
|
+
tokenProgram: 'spl-token' | 'token-2022';
|
|
209
|
+
} | {
|
|
210
|
+
kind: 'mint';
|
|
211
|
+
mint: string;
|
|
212
|
+
to: string;
|
|
213
|
+
amount: bigint;
|
|
214
|
+
uiAmount: string;
|
|
215
|
+
} | {
|
|
216
|
+
kind: 'burn';
|
|
217
|
+
mint: string;
|
|
218
|
+
from: string;
|
|
219
|
+
amount: bigint;
|
|
220
|
+
uiAmount: string;
|
|
221
|
+
} | {
|
|
222
|
+
kind: 'account-created';
|
|
223
|
+
address: string;
|
|
224
|
+
owner: string;
|
|
225
|
+
lamports: bigint;
|
|
226
|
+
space?: number;
|
|
227
|
+
as?: 'token-account' | 'mint' | 'ata' | 'system';
|
|
228
|
+
} | {
|
|
229
|
+
kind: 'approval';
|
|
230
|
+
owner: string;
|
|
231
|
+
delegate: string;
|
|
232
|
+
mint: string;
|
|
233
|
+
amount: bigint | 'unlimited';
|
|
234
|
+
revoke?: boolean;
|
|
235
|
+
} | {
|
|
236
|
+
kind: 'close-account';
|
|
237
|
+
account: string;
|
|
238
|
+
destination: string;
|
|
239
|
+
reclaimedLamports: bigint;
|
|
240
|
+
} | {
|
|
241
|
+
kind: 'memo';
|
|
242
|
+
text: string;
|
|
243
|
+
} | {
|
|
244
|
+
kind: 'compute-budget';
|
|
245
|
+
unitLimit?: number;
|
|
246
|
+
unitPriceMicroLamports?: bigint;
|
|
247
|
+
} | {
|
|
248
|
+
kind: 'program-call';
|
|
249
|
+
programId: string;
|
|
250
|
+
program?: string;
|
|
251
|
+
instruction?: string;
|
|
252
|
+
note?: string;
|
|
253
|
+
};
|
|
254
|
+
interface BalanceDelta {
|
|
255
|
+
account: string;
|
|
256
|
+
asset: {
|
|
257
|
+
kind: 'SOL';
|
|
258
|
+
} | {
|
|
259
|
+
kind: 'token';
|
|
260
|
+
mint: string;
|
|
261
|
+
decimals: number;
|
|
262
|
+
symbol?: string;
|
|
263
|
+
tokenProgram: string;
|
|
264
|
+
};
|
|
265
|
+
pre: bigint;
|
|
266
|
+
post: bigint;
|
|
267
|
+
/** Signed: `post - pre`. */
|
|
268
|
+
delta: bigint;
|
|
269
|
+
/** Human, e.g. `"-1.5 SOL"`, `"+250 USDC"`. */
|
|
270
|
+
uiDelta: string;
|
|
271
|
+
/** For token accounts. */
|
|
272
|
+
owner?: string;
|
|
273
|
+
}
|
|
274
|
+
interface DecodedInstruction {
|
|
275
|
+
index: number;
|
|
276
|
+
programId: string;
|
|
277
|
+
/** Recognized program name (e.g. `"SPL Token"`). */
|
|
278
|
+
program?: string;
|
|
279
|
+
/** Recognized instruction name (e.g. `"transferChecked"`). */
|
|
280
|
+
type?: string;
|
|
281
|
+
/** `false` => only programId recognized, or fully unknown. */
|
|
282
|
+
decoded: boolean;
|
|
283
|
+
accounts: {
|
|
284
|
+
pubkey: string;
|
|
285
|
+
name?: string;
|
|
286
|
+
isSigner: boolean;
|
|
287
|
+
isWritable: boolean;
|
|
288
|
+
}[];
|
|
289
|
+
/** Stringified bigints to keep the structure JSON-safe. */
|
|
290
|
+
args?: Record<string, string | number | boolean>;
|
|
291
|
+
/** CPI tree when meta.innerInstructions present. */
|
|
292
|
+
inner?: DecodedInstruction[];
|
|
293
|
+
warning?: string;
|
|
294
|
+
}
|
|
295
|
+
interface AccountCreation {
|
|
296
|
+
address: string;
|
|
297
|
+
owner: string;
|
|
298
|
+
lamports: bigint;
|
|
299
|
+
space?: number;
|
|
300
|
+
as?: 'token-account' | 'mint' | 'ata' | 'system';
|
|
301
|
+
}
|
|
302
|
+
interface Approval {
|
|
303
|
+
owner: string;
|
|
304
|
+
delegate: string;
|
|
305
|
+
mint: string;
|
|
306
|
+
amount: bigint | 'unlimited';
|
|
307
|
+
revoke?: boolean;
|
|
308
|
+
}
|
|
309
|
+
interface ProgramInvocation {
|
|
310
|
+
programId: string;
|
|
311
|
+
/** Recognized name (e.g. `"Jupiter v6"`). */
|
|
312
|
+
name?: string;
|
|
313
|
+
count: number;
|
|
314
|
+
}
|
|
315
|
+
interface Warning {
|
|
316
|
+
code: WarningCode;
|
|
317
|
+
message: string;
|
|
318
|
+
instructionIndex?: number;
|
|
319
|
+
}
|
|
320
|
+
type WarningCode = 'unknown-program' | 'partial-decode' | 'ambiguous-amount' | 'token-2022-extension-unparsed' | 'lut-unresolved' | 'simulation-failed' | 'version-skew' | 'inner-instructions-missing';
|
|
321
|
+
/** One instruction as resolved from a wire message, with per-account roles. */
|
|
322
|
+
interface CompiledInstructionView {
|
|
323
|
+
index: number;
|
|
324
|
+
programId: string;
|
|
325
|
+
accounts: {
|
|
326
|
+
pubkey: string;
|
|
327
|
+
isSigner: boolean;
|
|
328
|
+
isWritable: boolean;
|
|
329
|
+
}[];
|
|
330
|
+
data: Uint8Array;
|
|
331
|
+
}
|
|
332
|
+
type ProgramKind = 'system' | 'token' | 'token-2022' | 'ata' | 'memo' | 'compute-budget' | 'stake' | 'vote' | 'loader' | 'amm' | 'aggregator' | 'nft' | 'other';
|
|
333
|
+
interface KnownProgramInfo {
|
|
334
|
+
name: string;
|
|
335
|
+
kind: ProgramKind;
|
|
336
|
+
}
|
|
337
|
+
/** Result of decoding a single instruction. */
|
|
338
|
+
interface DecodeOutput {
|
|
339
|
+
program?: string;
|
|
340
|
+
type?: string;
|
|
341
|
+
decoded: boolean;
|
|
342
|
+
/** Stringified bigints / scalars. */
|
|
343
|
+
args?: Record<string, string | number | boolean>;
|
|
344
|
+
/** Optional friendly names for the instruction's accounts, by index. */
|
|
345
|
+
accountNames?: (string | undefined)[];
|
|
346
|
+
warning?: string;
|
|
347
|
+
warningCode?: WarningCode;
|
|
348
|
+
/**
|
|
349
|
+
* Structured side-effects this decoder is *certain* about (e.g. a decoded
|
|
350
|
+
* `transferChecked` knows the exact mint and amount). The correlation layer
|
|
351
|
+
* fuses these with the balance diff.
|
|
352
|
+
*/
|
|
353
|
+
effects?: DecoderEffect[];
|
|
354
|
+
}
|
|
355
|
+
/** Certain, structured effects emitted by a decoder, consumed by `correlate()`. */
|
|
356
|
+
type DecoderEffect = {
|
|
357
|
+
kind: 'sol-transfer';
|
|
358
|
+
from: string;
|
|
359
|
+
to: string;
|
|
360
|
+
lamports: bigint;
|
|
361
|
+
} | {
|
|
362
|
+
kind: 'token-transfer';
|
|
363
|
+
from: string;
|
|
364
|
+
to: string;
|
|
365
|
+
mint?: string;
|
|
366
|
+
amount: bigint;
|
|
367
|
+
decimals?: number;
|
|
368
|
+
tokenProgram: 'spl-token' | 'token-2022';
|
|
369
|
+
} | {
|
|
370
|
+
kind: 'mint';
|
|
371
|
+
mint: string;
|
|
372
|
+
to: string;
|
|
373
|
+
amount: bigint;
|
|
374
|
+
decimals?: number;
|
|
375
|
+
} | {
|
|
376
|
+
kind: 'burn';
|
|
377
|
+
mint: string;
|
|
378
|
+
from: string;
|
|
379
|
+
amount: bigint;
|
|
380
|
+
decimals?: number;
|
|
381
|
+
} | {
|
|
382
|
+
kind: 'approval';
|
|
383
|
+
owner: string;
|
|
384
|
+
delegate: string;
|
|
385
|
+
mint: string;
|
|
386
|
+
amount: bigint | 'unlimited';
|
|
387
|
+
revoke?: boolean;
|
|
388
|
+
} | {
|
|
389
|
+
kind: 'close-account';
|
|
390
|
+
account: string;
|
|
391
|
+
destination: string;
|
|
392
|
+
} | {
|
|
393
|
+
kind: 'account-created';
|
|
394
|
+
address: string;
|
|
395
|
+
owner: string;
|
|
396
|
+
lamports?: bigint;
|
|
397
|
+
space?: number;
|
|
398
|
+
as?: 'token-account' | 'mint' | 'ata' | 'system';
|
|
399
|
+
} | {
|
|
400
|
+
kind: 'memo';
|
|
401
|
+
text: string;
|
|
402
|
+
} | {
|
|
403
|
+
kind: 'compute-budget';
|
|
404
|
+
unitLimit?: number;
|
|
405
|
+
unitPriceMicroLamports?: bigint;
|
|
406
|
+
} | {
|
|
407
|
+
kind: 'sync-native';
|
|
408
|
+
account: string;
|
|
409
|
+
};
|
|
410
|
+
interface ProgramDecoder {
|
|
411
|
+
/** Program ID(s) this decoder handles. */
|
|
412
|
+
programId: string;
|
|
413
|
+
/** Friendly program name. */
|
|
414
|
+
name: string;
|
|
415
|
+
kind: ProgramKind;
|
|
416
|
+
/** Decode an instruction. MUST NOT throw; return `{ decoded: false }` on failure. */
|
|
417
|
+
decode(ix: CompiledInstructionView): DecodeOutput;
|
|
418
|
+
}
|
|
419
|
+
interface ProgramRegistry {
|
|
420
|
+
get(programId: string): ProgramDecoder | undefined;
|
|
421
|
+
has(programId: string): boolean;
|
|
422
|
+
/** All registered decoders. */
|
|
423
|
+
list(): ProgramDecoder[];
|
|
424
|
+
/** Return a new registry with `decoders` merged over this one. */
|
|
425
|
+
merge(decoders: ProgramDecoder[]): ProgramRegistry;
|
|
426
|
+
}
|
|
427
|
+
interface BalanceSnapshot {
|
|
428
|
+
/** Account keys in message order. */
|
|
429
|
+
accountKeys: string[];
|
|
430
|
+
/** Lamport balance per account key index. */
|
|
431
|
+
lamports: bigint[];
|
|
432
|
+
/** Token balances keyed loosely; matched by account address + mint. */
|
|
433
|
+
tokenBalances: TokenBalanceEntry[];
|
|
434
|
+
}
|
|
435
|
+
interface TokenBalanceEntry {
|
|
436
|
+
/** Token account address. */
|
|
437
|
+
account: string;
|
|
438
|
+
mint: string;
|
|
439
|
+
owner?: string;
|
|
440
|
+
amount: bigint;
|
|
441
|
+
decimals: number;
|
|
442
|
+
/** Owning token program ('spl-token' | 'token-2022' | raw id). */
|
|
443
|
+
tokenProgram: string;
|
|
444
|
+
symbol?: string;
|
|
445
|
+
}
|
|
446
|
+
interface ExplainInput {
|
|
447
|
+
source: 'signature' | 'simulation';
|
|
448
|
+
signature?: string;
|
|
449
|
+
feePayer: string;
|
|
450
|
+
success: boolean;
|
|
451
|
+
error?: {
|
|
452
|
+
raw: unknown;
|
|
453
|
+
human: string;
|
|
454
|
+
};
|
|
455
|
+
slot?: number;
|
|
456
|
+
blockTime?: number | null;
|
|
457
|
+
feeLamports: bigint;
|
|
458
|
+
computeUnits?: number;
|
|
459
|
+
pre: BalanceSnapshot;
|
|
460
|
+
post: BalanceSnapshot;
|
|
461
|
+
instructions: CompiledInstructionView[];
|
|
462
|
+
/** Inner instructions per top-level index, when available. */
|
|
463
|
+
innerInstructions?: {
|
|
464
|
+
index: number;
|
|
465
|
+
instructions: CompiledInstructionView[];
|
|
466
|
+
}[];
|
|
467
|
+
registry: ProgramRegistry;
|
|
468
|
+
focusAccount?: string;
|
|
469
|
+
warnings?: Warning[];
|
|
470
|
+
raw?: unknown;
|
|
471
|
+
includeRaw?: boolean;
|
|
472
|
+
}
|
|
473
|
+
interface RenderOptions {
|
|
474
|
+
/** Force-enable ANSI color. When omitted, the renderer leaves output plain. */
|
|
475
|
+
color?: boolean;
|
|
476
|
+
/** Show every instruction including the inner/CPI tree + raw args. */
|
|
477
|
+
verbose?: boolean;
|
|
478
|
+
/** Only print the summary line. */
|
|
479
|
+
quiet?: boolean;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export type { AccountCreation as A, BalanceSnapshot as B, Commitment as C, DecodeOutput as D, ExplainInput as E, GetAccountsOpts as G, KnownProgramInfo as K, ProgramDecoder as P, RpcClient as R, SimulateOpts as S, TokenBalanceEntry as T, Warning as W, ExplainResult as a, ExplainInstruction as b, ExplainOptions as c, ExplainInstructionsOptions as d, ExplainSignatureOptions as e, ExplainTransactionOptions as f, BalanceDelta as g, Action as h, Approval as i, CompiledInstructionView as j, DecodedInstruction as k, DecoderEffect as l, ExplainInstructionAccount as m, GetTransactionOpts as n, ProgramInvocation as o, ProgramKind as p, ProgramRegistry as q, RawAccount as r, RawSimulateResponse as s, RawTransactionResponse as t, RenderOptions as u, WarningCode as v };
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vtx-labs/solana-explain",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Turn any Solana transaction signature, raw/base64 transaction, or unsigned instruction set into a plain-English \"what this actually does\" report — net balance deltas, transfers, account creations, approvals, and program invocations. No IDLs required.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "VTX Labs (https://vtxlabs.dev)",
|
|
8
|
+
"homepage": "https://github.com/VTX-Labs/solana-explain#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/VTX-Labs/solana-explain.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/VTX-Labs/solana-explain/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"solana",
|
|
18
|
+
"transaction",
|
|
19
|
+
"explain",
|
|
20
|
+
"decode",
|
|
21
|
+
"spl-token",
|
|
22
|
+
"token-2022",
|
|
23
|
+
"simulate",
|
|
24
|
+
"balance-diff",
|
|
25
|
+
"web3",
|
|
26
|
+
"cli",
|
|
27
|
+
"typescript"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18"
|
|
31
|
+
},
|
|
32
|
+
"bin": {
|
|
33
|
+
"solana-explain": "dist/cli/index.js",
|
|
34
|
+
"sx": "dist/cli/index.js"
|
|
35
|
+
},
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"import": "./dist/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./programs": {
|
|
42
|
+
"types": "./dist/programs.d.ts",
|
|
43
|
+
"import": "./dist/programs.js"
|
|
44
|
+
},
|
|
45
|
+
"./render": {
|
|
46
|
+
"types": "./dist/render.d.ts",
|
|
47
|
+
"import": "./dist/render.js"
|
|
48
|
+
},
|
|
49
|
+
"./package.json": "./package.json"
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"dist",
|
|
53
|
+
"README.md",
|
|
54
|
+
"LICENSE"
|
|
55
|
+
],
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsup",
|
|
58
|
+
"dev": "tsx src/cli/index.ts",
|
|
59
|
+
"typecheck": "tsc --noEmit",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"test:watch": "vitest",
|
|
62
|
+
"prepublishOnly": "pnpm typecheck && pnpm test && pnpm build"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"bs58": "^6.0.0"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"@solana/web3.js": "^1.95.0 || ^2.0.0"
|
|
69
|
+
},
|
|
70
|
+
"peerDependenciesMeta": {
|
|
71
|
+
"@solana/web3.js": {
|
|
72
|
+
"optional": true
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@types/node": "^20.14.0",
|
|
77
|
+
"tsup": "^8.2.0",
|
|
78
|
+
"tsx": "^4.16.0",
|
|
79
|
+
"typescript": "^5.5.0",
|
|
80
|
+
"vitest": "^2.0.0"
|
|
81
|
+
},
|
|
82
|
+
"packageManager": "pnpm@10.6.5"
|
|
83
|
+
}
|