Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Complete Core Types Package
Description
This PR completes the
@ancore/typespackage by implementing all missing types required by downstream packages (@ancore/core-sdk,@ancore/account-abstraction, and storage layer).The implementation adds four new type definitions with full Zod validation schemas and type guards:
All types include comprehensive JSDoc documentation, runtime validation via Zod schemas, and exhaustive type guards with full unit test coverage.
Type of Change
Security Impact
Security Considerations:
UserOperationinterface defines operations executed via smart contracts, so proper validation through Zod schemas is criticalStorageKeyenum ensures type-safe access to sensitive wallet state (password hash, session keys, accounts)Testing
Test Coverage
Test Summary:
guards.ts,user-operation.ts,wallet.tssession-key.ts,smart-account.tsTest Breakdown:
user-operation.test.ts: 33 tests covering schemas and type guardswallet.test.ts: 23 tests covering WalletState and StorageKeyguards.test.ts: Updated with new guard tests (all passing)schemas.test.ts: Existing schema tests (all passing)Manual Testing Steps
index.ts)Breaking Changes
Backward Compatibility:
@ancore/types@0.1.0package versionChecklist
For High-Security Changes
Security Review Notes:
Related Issues
Closes #27
Related to:
Files Changed
New Files (2)
packages/types/src/user-operation.ts- UserOperation and TransactionResult types with schemaspackages/types/src/wallet.ts- WalletState type and StorageKey enum with schemasUpdated Files (4)
packages/types/src/guards.ts- Added isUserOperation, isTransactionResult, isWalletState guardspackages/types/src/schemas.ts- Re-exported new schemaspackages/types/src/index.ts- Added re-exports for user-operation and wallet modulespackages/types/src/__tests__/user-operation.test.ts- New test file with 33 testspackages/types/src/__tests__/wallet.test.ts- New test file with 23 testsAdditional Context
Type Definitions Summary
UserOperation
TransactionResult
WalletState
StorageKey Enum
Implementation Notes
Zod Validation: All types have comprehensive Zod schemas that:
schemas.tsfor centralized managementType Guards: Runtime guards provide:
Exports: All types are exported from
index.tsalongside existing types:@ancore/typesdirectlyDocumentation: All exports include:
Reviewer Notes
This implementation follows the established patterns in the codebase:
The types are production-ready and can immediately unblock development of
@ancore/core-sdk,@ancore/account-abstraction, and storage layer implementation.Testing executed locally:
Thank you for reviewing this contribution to Ancore!
Have read: