Skip to content

Conversation

@netbonus
Copy link
Contributor

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.

📝 Summary

🔧 Context / Implementation

🧪 Test Plan

  1. First step
  2. Second step
  3. Expected result

🖼️ Screenshots (if applicable)

Before After

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.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines +62 to +64
export interface RequestParams {
url: string;
payload: unknown;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

2 participants