Skip to content

Conversation

@dadamu
Copy link
Contributor

@dadamu dadamu commented Mar 31, 2025

Pull Request Checklist

Before Submission


Description


Additional Notes


By submitting this pull request, I confirm that:

  • My contribution is made under the Business Source License
  • I grant Forbole Technology Limited a perpetual, worldwide, non-exclusive license to use my contribution under the
    project's
    license terms
  • I have the authority to make this contribution and license it appropriately

@dadamu dadamu requested a review from a user March 31, 2025 04:10
@dadamu dadamu force-pushed the feat/sign-message branch from 4dfac53 to c3060f8 Compare March 31, 2025 04:46
ghost
ghost previously approved these changes Mar 31, 2025
!rpcClient || !wallet || !walletInfo || !account || !rpcNetworkId;

useEffect(() => {
if (!rpcClient || !walletInfo || !rpcNetworkId || !account) return;
Copy link

Choose a reason for hiding this comment

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

Why is account missing here? can do !loading?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you are mentioning wallet.
It is for setting IWallet, so unluckily, so we can't check wallet here, or the wallet would never be initialized.

}

getWalletSecret({ walletId: walletInfo.id }).then(({ walletSecret }) => {
const factory = new AccountFactory(rpcClient, rpcNetworkId);
Copy link

Choose a reason for hiding this comment

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

I really think we should try to bubble up this wallet instantiation in the WalletManagerContext. Despite the complexity, it will remove code outside and inside the context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Due to compatibility issues between Ledger and EVM-compatible features, we've decided to postpone this improvement for now.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

We need to start shaping wallet API like so kaspanet/kips#21

I also tested zod instead of arktype. Let's define our DTOs very tightly.

@dadamu dadamu dismissed ghost ’s stale review via 8f09c9f April 14, 2025 04:46
ghost
ghost previously approved these changes Apr 14, 2025
api/message.ts Outdated

// ================================================================================================

export const SignMessagePayloadSchema = z.object({
Copy link

Choose a reason for hiding this comment

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

This file is growing with schema. Maybe we can put them in the handlers directly.

You can also have schema directly inside a function (scope).

@dadamu dadamu dismissed ghost ’s stale review via b67f93e April 14, 2025 10:03
@dadamu dadamu merged commit 067baae into main Apr 14, 2025
1 check passed
@ghost ghost mentioned this pull request Apr 14, 2025
@dadamu dadamu deleted the feat/sign-message branch August 29, 2025 13:42
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