Add AGENTS, gitignore LLM files - #1737
Conversation
|
BundleMonUnchanged files (147)
No change in files bundle size Final result: ✅ View report in BundleMon website ➡️ |
|
Documentation Preview: https://kit-docs-96x843u8k-anza-tech.vercel.app |
efebc5b to
2980b1f
Compare
The changeset now includes a usage example and lists @solana/rpc-api (new named getTransaction response types) and @solana/errors (new error codes) as affected packages. The .gitignore entries for personal agent configs were moved to anza-xyz#1737.
The changeset now includes a usage example and lists @solana/rpc-api (new named getTransaction response types) and @solana/errors (new error codes) as affected packages. The .gitignore entries for personal agent configs were moved to anza-xyz#1737.
The changeset now includes a usage example and lists @solana/rpc-api (new named getTransaction response types) and @solana/errors (new error codes) as affected packages. The .gitignore entries for personal agent configs were moved to anza-xyz#1737.
…xyz#1611) * feat(transaction-introspection): add package for inspecting confirmed transactions Adds @solana/transaction-introspection, a new package that bridges a getTransaction response and the auto-generated @solana-program/* parseXInstruction clients. Decodes responses encoded as base64, base58, or json; resolves account indices against static and ALT-loaded addresses; normalizes inner instructions from meta.innerInstructions; and exposes walkInstructions and filterInstructionsForProgram for streaming traversal of every instruction (outer and inner). Re-exported from @solana/kit. Also hoists the inline GetTransactionApi response shapes in @solana/rpc-api into named exported types (Base64/Base58/Json/JsonParsed) so the new package can consume them directly. * refactor(transaction-introspection): tighten decode return type and trim public surface Drops the synthesized Transaction for json responses — the empty-messageBytes fake was a lie and required reconstructing signatures from a parallel array. Now DecodedRpcTransaction.transaction is optional, and the base64/base58 overloads narrow it to a guaranteed Transaction so callers using those encodings get static guarantees. Adds a typetest to lock the narrowing in. Restores lifetimeToken parity across all three encodings (the prior refactor silently dropped it from the json path), and asserts it on both the wire-decoder and json paths so the asymmetry can't regress. Trims the public API: switches src/index.ts from export * to explicit named exports, marks getInstructionsFromCompiledTransactionMessageWithMetas @internal, and updates the README for the walkInnerInstructionsFromMeta rename. docs(transaction-introspection): align decoder docs with optional `transaction` and widen `compiledMessage` to guarantee `lifetimeToken` Updates the docblocks on decodeTransactionFromRpcResponse and DecodedRpcTransaction (and the matching README sections) so they describe the post-refactor shape: `transaction` is omitted for json responses, not empty-bytes; base64/base58 overloads statically guarantee a re-encodable Transaction. Widens DecodedRpcTransaction.compiledMessage to `CompiledTransactionMessage & CompiledTransactionMessageWithLifetime` — every path now sets `lifetimeToken`, so callers can read `.lifetimeToken` without their own narrowing. Drops the corresponding cast in the tests. * refactor(transaction-introspection): flatten walk API, drop separate filter Address PR feedback by making `TracedInstruction` a `ResolvedInstruction<T> & { trace }` rather than a `{ instruction, trace }` wrapper. Each walked item is now itself an `IInstruction` and can be passed directly to `isInstructionForProgram` from `@solana/instructions` and to the auto-generated `identifyXInstruction` / `parseXInstruction` helpers, removing the need for our own `filterInstructionsForProgram` (deleted). `walkInstructions` and the renamed `getInnerInstructionsFromMeta` (was `walkInnerInstructionsFromMeta`) now return arrays rather than generators. A transaction is capped at 64 total instructions, so laziness wasn't buying anything, and arrays compose with native `.filter` / `.find` / `.map` for the common cases. The typetest is renamed to `traced-instruction-typetest.ts` and rewritten to exercise narrowing via `isInstructionForProgram`. * feat(transaction-introspection): add v1 transaction message support V1 is rolling out on testnet and the rest of Kit already supports it, so the introspection helpers shouldn't be the odd ones out. A new `normalizeCompiledInstructions` reduces `legacy`, `v0`, and `v1` to a single internal shape — for `v1` it zips `instructionHeaders` and `instructionPayloads` into the `{ programAddressIndex, accountIndices, data }` form the resolver already consumed. Inner instructions and ALT-loaded addresses are version-agnostic on the RPC side, so the rest of the package needed no change. The response-type generics widen from `0 | void` to `TransactionVersion | void` to match upstream `@solana/rpc-api`, and the README notes that callers still need to pass `maxSupportedTransactionVersion` on `getTransaction` to actually receive `v0` or `v1`. A `_exhaustiveCheck: never` assignment in `normalizeCompiledInstructions` ensures a future variant of `CompiledTransactionMessage` won't silently slip through the version check. * feat(errors): add dedicated codes for instruction account-index and unsupported getTransaction shapes Adds SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_ACCOUNT_INDEX_OUT_OF_RANGE so account-index lookups no longer reuse the program-address error code, and a new TRANSACTION_INTROSPECTION domain (5664xxx) with CANNOT_DECODE_JSON_PARSED_TRANSACTION and UNRECOGNIZED_GET_TRANSACTION_RESPONSE so decodeTransactionFromRpcResponse no longer throws MALFORMED_MESSAGE_BYTES with empty bytes for inputs that have no message bytes at all. jsonParsed responses are now detected explicitly and rejected with their own error. * fix(transaction-introspection): decode v1 JSON responses and reject unknown versions decodeFromJson previously collapsed every versioned response to v0 (rpcTx.version as 0), so a v1 'json' response silently produced a mis-shaped compiled message. The version dispatch is now an exhaustive switch: v1 responses synthesize a V1CompiledTransactionMessage (the 'json' encoding carries no v1 transaction config, so the config is reported empty), and any version outside TransactionVersion throws SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED — the same error surface as getInstructionsFromCompiledTransactionMessage. Also documents that message.recentBlockhash carries the nonce value for durable-nonce transactions, and aligns the JSON path with the wire decoder by omitting accountIndices/data when empty. * refactor(transaction-introspection): use rpc-api getTransaction response types directly Drops the Base64/Base58/JsonGetTransactionResponse aliases in favor of GetTransactionApiResponseBase64/Base58/Json from @solana/rpc-api. The aliases were pure renames, and their widened default type parameter (TransactionVersion | void vs rpc-api's void) meant an unparameterised alias was not the same type as its rpc-api counterpart. * refactor(transaction-introspection): drop getAllAddressesFromCompiledTransactionMessage The flat-address list is derivable from getAccountMetasFromCompiledTransactionMessage by mapping each meta to its address, so the standalone helper added no capability worth a public API surface. The LoadedAddresses type moves to its own module. * refactor(transaction-introspection): omit empty accounts and data from resolved instructions ResolvedInstruction no longer forces InstructionWithAccounts/InstructionWithData. Resolved outer and inner instructions now attach accounts and data only when non-empty, matching the kit Instruction conventions and the wire decoder's behavior, so isInstructionWithAccounts and isInstructionWithData from @solana/instructions behave as expected on the results. * feat(transaction-introspection): interleave inner instructions in walkInstructions output walkInstructions now returns instructions in display order — each outer instruction followed immediately by its inner instructions — instead of all outer instructions followed by all inner ones. This matches how explorers present a transaction and makes positional iteration line up with execution structure. * test(transaction-introspection): decode a real v0 wire transaction The base64 test that claimed v0 coverage only differed from the legacy one by a type cast. It now encodes an actual v0 message with addressTableLookups and asserts the decoded version and lookups. * chore: expand changeset and drop personal editor entries from .gitignore The changeset now includes a usage example and lists @solana/rpc-api (new named getTransaction response types) and @solana/errors (new error codes) as affected packages. The .gitignore entries for personal agent configs were moved to anza-xyz#1737. * fix(transaction-introspection): identify jsonParsed responses by missing message header The previous sniff inspected the first instruction, so a jsonParsed response for a transaction with no instructions (e.g. fee-only) passed as 'json' and crashed on the missing header with a raw TypeError. The 'json' encoding always carries the compiled-message header while jsonParsed never does, so the header is a reliable discriminator independent of instruction count. * fix(transaction-introspection): omit empty addressTableLookups from JSON-derived v0 messages The wire decoder drops the field when the message has no lookups, so the JSON path now does too — a lookup-free v0 transaction decodes to the same shape on both encodings. Also defers compiled-instruction construction into the legacy/v0 branches so the v1 path no longer base58-decodes every instruction's data twice. * docs(transaction-introspection): narrow accounts and data in examples before identify/parse The auto-generated identifyXInstruction / parseXInstruction helpers require data (and parse also accounts), which are optional on ResolvedInstruction, so every README and docblock example now narrows with isInstructionWithData / isInstructionWithAccounts first. The typetest also exercises those narrows over TracedInstruction so the examples' pattern is checked at compile time. * chore(transaction-introspection): align package version, deps, and TypeScript peer with the workspace Bumps the stale 6.8.0 to 6.9.0 to match the fixed changesets group, moves @solana/rpc-types to devDependencies since only tests import it, and raises the TypeScript peer to >=5.4.0 like every other package. * fix(transaction-introspection): harden v1 and inner-instruction edge cases normalizeCompiledInstructions now throws SOLANA_ERROR__TRANSACTION__INSTRUCTION_HEADERS_PAYLOADS_MISMATCH for v1 messages whose headers and payloads disagree in length, matching the transaction-messages decompile path, instead of failing with a raw TypeError. walkInstructions appends inner groups whose index matches no outer instruction instead of silently dropping them. Also adds wire-path (base64) coverage for v1 transaction decoding. * chore: expand null check * chore: add codama example to readme * test(transaction-introspection): address post-review nits Replace the custom `getThrownError` helper in `get-instructions-test.ts` with `expect(() => ...).toThrow(new SolanaError(...))`, matching the pattern in `get-inner-instructions-test.ts` and asserting error context alongside the code. Rename the shadowed `meta` locals to `accountMeta` in the account-index lookups, and document that `decodeTransactionFromRpcResponse` can throw `SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED`.
|
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
Small repo tidyups