diff --git a/apps/demo-react/package.json b/apps/demo-react/package.json index 562a01e6..94707d32 100644 --- a/apps/demo-react/package.json +++ b/apps/demo-react/package.json @@ -17,7 +17,7 @@ "@lido-sdk/constants": "^3.2.1", "@lido-sdk/providers": "^1.4.14", "@lido-sdk/react": "2.0.2", - "@lidofinance/lido-ethereum-sdk": "^3.1.1", + "@lidofinance/lido-ethereum-sdk": "3.5.0-alpha.3", "@lidofinance/lido-ui": "^3.18.0", "@svgr/webpack": "^8.0.1", "@tanstack/react-query": "^5.29.0", diff --git a/packages/connectors/ledger-connector/CHANGELOG.md b/packages/connectors/ledger-connector/CHANGELOG.md index 521b50ac..8306a2fa 100644 --- a/packages/connectors/ledger-connector/CHANGELOG.md +++ b/packages/connectors/ledger-connector/CHANGELOG.md @@ -1,5 +1,11 @@ # @reef-knot/ledger-connector +## 4.1.2 + +### Patch Changes + +- Fix: onAccountsChanged, onChainChanged methods for ledgerLiveConnector + ## 4.1.1 ### Patch Changes diff --git a/packages/connectors/ledger-connector/package.json b/packages/connectors/ledger-connector/package.json index 4a306556..0882b229 100644 --- a/packages/connectors/ledger-connector/package.json +++ b/packages/connectors/ledger-connector/package.json @@ -1,6 +1,6 @@ { "name": "@reef-knot/ledger-connector", - "version": "4.1.1", + "version": "4.1.2", "main": "dist/index.js", "types": "dist/index.d.ts", "exports": { diff --git a/packages/connectors/ledger-connector/src/iframe/connector.ts b/packages/connectors/ledger-connector/src/iframe/connector.ts index 0d861dca..196ee7fd 100644 --- a/packages/connectors/ledger-connector/src/iframe/connector.ts +++ b/packages/connectors/ledger-connector/src/iframe/connector.ts @@ -49,6 +49,7 @@ export function ledgerLiveConnector({ try { const provider = await this.getProvider(); + // works without bind because it's an obj created(scoped) in a function provider.on('accountsChanged', this.onAccountsChanged); provider.on('chainChanged', this.onChainChanged); @@ -142,15 +143,16 @@ export function ledgerLiveConnector({ } }, - AccountsChanged(accounts: Address[]) { + onAccountsChanged(accounts: Address[]) { if (accounts.length === 0 || !accounts[0]) { emitter.emit('disconnect'); + this.disconnect(); } else { emitter.emit('change', { accounts }); } }, - ChainChanged(chainId: number | string) { + onChainChanged(chainId: number | string) { emitter.emit('change', { chainId: Number(chainId) }); }, @@ -163,13 +165,5 @@ export function ledgerLiveConnector({ onDisconnect() { emitter.emit('disconnect'); }, - - onAccountsChanged() { - // NOOP - }, - - onChainChanged() { - // NOOP - }, })); } diff --git a/packages/reef-knot/CHANGELOG.md b/packages/reef-knot/CHANGELOG.md index 4cbeb0d1..c922f886 100644 --- a/packages/reef-knot/CHANGELOG.md +++ b/packages/reef-knot/CHANGELOG.md @@ -1,5 +1,13 @@ # reef-knot +## 5.7.2 + +### Patch Changes + +- Fix: onAccountsChanged, onChainChanged methods for ledgerLiveConnector +- Updated dependencies + - @reef-knot/ledger-connector@4.1.2 + ## 5.7.1 ### Patch Changes diff --git a/packages/reef-knot/package.json b/packages/reef-knot/package.json index 1809201e..7668f694 100644 --- a/packages/reef-knot/package.json +++ b/packages/reef-knot/package.json @@ -1,6 +1,6 @@ { "name": "reef-knot", - "version": "5.7.1", + "version": "5.7.2", "main": "dist/index.js", "types": "dist/index.d.ts", "exports": { @@ -48,7 +48,7 @@ "@reef-knot/wallets-list": "2.3.0", "@reef-knot/wallets-helpers": "2.1.0", "@reef-knot/types": "2.1.0", - "@reef-knot/ledger-connector": "4.1.1" + "@reef-knot/ledger-connector": "4.1.2" }, "peerDependencies": { "@lidofinance/lido-ui": "^3.18.0", diff --git a/yarn.lock b/yarn.lock index 5af9e395..fcde1e2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2673,15 +2673,14 @@ dependencies: typescript "^4.7" -"@lidofinance/lido-ethereum-sdk@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@lidofinance/lido-ethereum-sdk/-/lido-ethereum-sdk-3.1.1.tgz#7903ea512eed6d6658ab2a2d6731e41329e300bf" - integrity sha512-niZciaZTq8Lr3+U6Y61anVBnRSCWu0DCQKT9oJqPXP0MUBkqKsrFKYIV5BHXlEGHj5Z8UQbIm9fRm7iL7YZefw== +"@lidofinance/lido-ethereum-sdk@3.5.0-alpha.3": + version "3.5.0-alpha.3" + resolved "https://registry.yarnpkg.com/@lidofinance/lido-ethereum-sdk/-/lido-ethereum-sdk-3.5.0-alpha.3.tgz#a503a0686f8e4e5438995149d1316b0c98d09cfe" + integrity sha512-FvrW7Dk5n802qES5F5nZo5NzTw+pWBh3jSMJltOYCtsaIO97bUXkqm6p4cfURnvj1coI5MH00BqJuUj7yDI2NQ== dependencies: "@ethersproject/bytes" "^5.7.0" graphql "^16.8.1" graphql-request "^6.1.0" - viem "^2.0.6" "@lidofinance/lido-ui@^3.18.0": version "3.18.2" @@ -8292,11 +8291,6 @@ isomorphic-unfetch@3.1.0: node-fetch "^2.6.1" unfetch "^4.2.0" -isows@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/isows/-/isows-1.0.3.tgz#93c1cf0575daf56e7120bab5c8c448b0809d0d74" - integrity sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg== - isows@1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/isows/-/isows-1.0.4.tgz#810cd0d90cc4995c26395d2aa4cfa4037ebdf061" @@ -11880,20 +11874,6 @@ viem@2.13.3: isows "1.0.4" ws "8.13.0" -viem@^2.0.6: - version "2.7.11" - resolved "https://registry.yarnpkg.com/viem/-/viem-2.7.11.tgz#e432885f412c6faf2772a1e0569e8269b6ad93cb" - integrity sha512-qlEPF9YOgPVqjTyom73TVAekAYrIe68megO07u55p7pKWgLt0i9KD6Mrmiw7pd7oHh86vIppcygwQMDNGX1YAw== - dependencies: - "@adraffy/ens-normalize" "1.10.0" - "@noble/curves" "1.2.0" - "@noble/hashes" "1.3.2" - "@scure/bip32" "1.3.2" - "@scure/bip39" "1.2.1" - abitype "1.0.0" - isows "1.0.3" - ws "8.13.0" - viem@^2.1.1: version "2.18.5" resolved "https://registry.yarnpkg.com/viem/-/viem-2.18.5.tgz#6b29c2b30c8c01de4f4c5a3cc99b8e30ae942df8"