anza-xyz / anza-xyz/kit-plugins

Wallet plugin: migrate to key by `Wallet` instead of name

Đang mở
#311 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
20
Fork
14
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
54

Mô tả

Currently the wallet plugin is keyed in all its internal stores by wallet name, and will behave weirdly if you end up with two wallets with the same name registered.

We could instead key most of the internal stores by `Wallet`, which stays stable (unlike `UiWallet` and some other identifiers) and will be reliably unique.

The only place where we would probably still use name is where we store a connection (eg in `localStorage`). But in this case we could fetch all wallets with the matching name, and select the one that has the given account authorized. If there are multiple of those then it's fine to just connect to one arbitrarily.

Low priority because it's not a common case, but would add a bit of resilience. Should be an internals-only change.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.