Skip to content

refactor(types): extract security + config + tx-core type clusters - #840

Draft
graciangabriel8 wants to merge 4 commits into
refactor/717-1-chains-devicesfrom
refactor/717-2-security-config-txcore
Draft

refactor(types): extract security + config + tx-core type clusters#840
graciangabriel8 wants to merge 4 commits into
refactor/717-1-chains-devicesfrom
refactor/717-2-security-config-txcore

Conversation

@graciangabriel8

@graciangabriel8 graciangabriel8 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Cuts security (PrivilegedRole/SecurityReport, 2 exports) and config (UserConfig, 1 export) byte-identically into src/types/security.ts and src/types/config.ts. Also creates src/types/tx.ts with the tx-core subset (DecodedArg, HumanDecode, TxVerification) of the plan's 8-export tx cluster.

Placement judgment: the plan splits tx's 8 exports across 5 sub-PRs (core here, Tron/Solana/EVM/BTC-LTC later, all appended to this same tx.ts). TxVerification is referenced by UnsignedTronTx, UnsignedSolanaTx, and UnsignedTx (each has a verification?: TxVerification field), so per the acyclicity rule it must extract before all three — hence "tx-core" here is the 3 shared verification/decode types, not the file's first 3 tx-prefixed exports in original line order.

Part of #717

Note: export * from "./x.js" re-exports but does not locally bind names, so index.ts also carries import type { ... } from "./x.js" for every moved name its own remaining declarations still reference by bare identifier — scope-plumbing that vanishes once the last domain leaves the file.

Part of #717. Cuts security (PrivilegedRole/SecurityReport, 2 exports)
and config (UserConfig, 1 export) byte-identically into
src/types/security.ts and src/types/config.ts.

Also creates src/types/tx.ts with the tx-core subset (DecodedArg,
HumanDecode, TxVerification) of the plan's 8-export `tx` cluster —
these three are shared verification/decode building blocks referenced
by every chain's unsigned-tx type (UnsignedTronTx.verification,
UnsignedSolanaTx.verification, UnsignedTx.verification all point at
TxVerification), so they extract first per the acyclicity rule; the
remaining tx-Tron/Solana/EVM/BTC-LTC slices land in later PRs appended
to this same file.

index.ts re-exports all three new files via export * so all existing
import specifiers stay byte-identical.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drops RpcProvider and the devices.js import (their only referencer,
UserConfig, already left index.ts on this branch) and adds
TxVerification from ./tx.js (still referenced by the inline
UnsignedTronTx/UnsignedSolanaTx/UnsignedTx declarations).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant