/** * Kept in step with `inferPrimaryType` in @opensea/wallet-adapters * (`src/bridges/ethers.ts`). The two are deliberately separate copies: the sdk * does not depend on wallet-adapters, and adding that edge would couple the * sdk's release to it for one pure function. Change both together. */ /** * Infer the EIP-712 primary type: the struct that no other struct references, * which is the root of the type graph. * * Taking the first key in `types` instead is wrong whenever a dependency is * declared before the root, and it fails silently by signing the wrong struct. * ethers resolves this the same way. * * Refuses rather than guessing when the graph is circular or has more than one * root. Both are invalid EIP-712 and ethers rejects them itself ("circular type * reference", "ambiguous primary types or unused types"), so throwing costs * nothing where the signer validates and prevents a wrong signature where it * does not. */ export declare function inferPrimaryType(types: Record): string;