Conversation
4dfac53 to
c3060f8
Compare
| !rpcClient || !wallet || !walletInfo || !account || !rpcNetworkId; | ||
|
|
||
| useEffect(() => { | ||
| if (!rpcClient || !walletInfo || !rpcNetworkId || !account) return; |
There was a problem hiding this comment.
Why is account missing here? can do !loading?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Due to compatibility issues between Ledger and EVM-compatible features, we've decided to postpone this improvement for now.
ghost
left a comment
There was a problem hiding this comment.
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.
api/message.ts
Outdated
|
|
||
| // ================================================================================================ | ||
|
|
||
| export const SignMessagePayloadSchema = z.object({ |
There was a problem hiding this comment.
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).
Pull Request Checklist
Before Submission
Description
Additional Notes
By submitting this pull request, I confirm that:
project's
license terms