-
Notifications
You must be signed in to change notification settings - Fork 27
feat: extract @gridplus/types package from SDK #699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Extract shared types and protocol constants into a new workspace package for better code organization and reusability. New package @gridplus/types includes: - Protocol enums (LatticeResponseCode, LatticeMsgType, etc.) - Protocol constants (ProtocolConstants) - SDK constants (CURRENCIES) - Shared types (KeyPair, KVRecords, WalletPath, etc.) - Client types (Wallet, ActiveWallets, SignData, etc.) - Firmware types (FirmwareConstants, FirmwareVersion) - Message types (LatticeMessageHeader, LatticeSecureRequest, etc.) - Sign types (TransactionRequest, SigningPayload, etc.) SDK now re-exports from @gridplus/types, maintaining API compatibility. SDK-specific types that reference the Client class remain in the SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 190b1976ac
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| export interface RequestParams { | ||
| url: string; | ||
| payload: unknown; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve RequestParams payload typing to avoid breaks
This extraction changes RequestParams.payload from any to unknown. TypeScript callers that previously passed arbitrary payload shapes (and relied on any) will now get type errors unless they add explicit narrowing/casts, which is a breaking change even though the runtime behavior is identical. If API compatibility is intended for this refactor, consider keeping any or making RequestParams generic so callers can specify their payload type.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@netbonus please consider changing it back to any
| TypedData, | ||
| TypedDataDefinition, | ||
| } from 'viem'; | ||
| import type { Currency, SigningPath } from './index'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importing from ./index within the same package can cause issues. Consider importing directly:
import type { Currency } from './constants';
import type { SigningPath } from './client';
Extract shared types and protocol constants into a new workspace package for better code organization and reusability.
New package @gridplus/types includes:
SDK now re-exports from @gridplus/types, maintaining API compatibility. SDK-specific types that reference the Client class remain in the SDK.
📝 Summary
🔧 Context / Implementation
🧪 Test Plan
🖼️ Screenshots (if applicable)