Skip to content

Commit

Permalink
Use getOfflineSignerAuto when connecting wallet (#39)
Browse files Browse the repository at this point in the history
* Switch to getOfflineSignerAuto to support ledgers

* Add changeset

* Fix connect test
  • Loading branch information
besated authored May 13, 2023
1 parent 8c78da3 commit a8c06c0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-rabbits-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sei-js/core': patch
---

Use getOfflineSignerAuto when connecting wallet
2 changes: 1 addition & 1 deletion packages/core/src/lib/wallet/connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('connect', () => {
const accounts = await offlineSigner.getAccounts();
windowSpy.mockImplementation(() => ({
keplr: {
getOfflineSigner: () => offlineSigner,
getOfflineSignerAuto: () => offlineSigner,
experimentalSuggestChain: () => undefined,
enable: () => undefined,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/wallet/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const connect = async (
// Enable wallet before attempting to call any methods
await walletProvider.enable(chainId);

const offlineSigner = await walletProvider.getOfflineSigner(chainId);
const offlineSigner = await walletProvider.getOfflineSignerAuto(chainId);
const accounts = await offlineSigner.getAccounts();

return { offlineSigner, accounts };
Expand Down

0 comments on commit a8c06c0

Please sign in to comment.