/** * EIP-712 type definitions for the two **owner-signed BTC-custody** messages: * the withdrawal execute step and the stale-spend invalidate step * (`contracts/docs/EIP712_DOMAIN_SPEC.md` §3.8; plan * `docs/vigil/plans/2026-10-16-A2-eip712-withdrawal-authorization-plan.md`). * * **Single source of truth** for the verifier side. The SDK carries a copy * (`sdk/src/utils/btc-spend-request-712.ts`) until it depends on a * `dh-lit-actions` that exports this module; the golden vectors in * `tests/vectors/btc-spend-request.v1.json` keep the two byte-identical. * * ## Why a separate module from `borrower-authorization-types.ts` * * Different domain: these bind to the **BTCSpendAuthorizer** proxy, the * contract that holds the spend record the signature consumes, not to the * LoanOperationsManager. It is also deliberately kept out of the * `constants/index.ts` barrel that every action imports, so only the two * actions that verify these messages change bytes when it changes. * * ## Naming * * Owner-signed types are `*Request`. §3.4's `BtcSpendAuth` is the validator * PKP's attestation — a different signer over a different digest. */ /** One EIP-712 struct member. Shape is compatible with both ethers v5 and v6. */ export interface BtcSpendRequestField { readonly name: string; readonly type: string; } export declare const BTC_SPEND_REQUEST_PRIMARY_TYPES: { readonly EXECUTE: "ExecuteBtcWithdrawalRequest"; readonly INVALIDATE: "InvalidateStaleSpendRequest"; }; export type BtcSpendRequestPrimaryType = (typeof BTC_SPEND_REQUEST_PRIMARY_TYPES)[keyof typeof BTC_SPEND_REQUEST_PRIMARY_TYPES]; /** * Field lists per primary type. **Order is part of the digest** — appending, * reordering, or renaming a member changes every signature and invalidates * the ERC-7730 descriptor in the same step. * * Execute lists what the borrower judges first (destination, what arrives, * the fee, the total) ahead of protocol bookkeeping, so a device that * truncates still shows the decision-relevant fields. */ export declare const BTC_SPEND_REQUEST_FIELDS: Readonly>; /** * Frozen `encodeType` strings. Duplicated from the field lists on purpose: * they are the exact `display.formats` keys of the ERC-7730 descriptor, and * the unit suite asserts an encoder derives these same strings from * `BTC_SPEND_REQUEST_FIELDS`. */ export declare const BTC_SPEND_REQUEST_ENCODE_TYPES: Readonly>; /** EIP-712 domain for BTC-custody owner authorizations. */ export interface BtcSpendRequestDomain { readonly name: string; readonly version: string; readonly chainId: number; readonly verifyingContract: string; } /** * The `types` argument for `TypedDataEncoder.hash(domain, types, message)`. * Returns ONLY the requested primary type, so a message shaped like the other * type cannot encode without complaint. * * @throws if `primaryType` is not one of the two. */ export declare function btcSpendRequestTypes(primaryType: BtcSpendRequestPrimaryType): Record; /** * Build the EIP-712 domain for a chain. `verifyingContract` is the pinned * BTCSpendAuthorizer proxy. Same rule as `buildBorrowerAuthorizationDomain`: * on a pinned chain an override is CHECKED, never honoured, and a * contradicting value throws; on an unpinned chain (hardhat) the override * supplies the domain and its absence throws. */ export declare function buildBtcSpendRequestDomain(chainId: number, verifyingContractOverride?: string): BtcSpendRequestDomain; /** * Canonical Bitcoin txid for a typed message: lowercase, no `0x`, exactly 64 * hex characters. BTCSpendAuthorizer stores `txid` as an unvalidated string, * so anything else is refused here rather than encoded. * * @throws if the canonical form is not 64 hex characters. */ export declare function canonicalBtcTxid(txid: unknown): string; //# sourceMappingURL=btc-spend-request-types.d.ts.map