From 62426464abbce555914e1dadcb68ee7804d39c5e Mon Sep 17 00:00:00 2001 From: Nur Fikri Date: Wed, 20 Nov 2024 14:40:13 +0700 Subject: [PATCH] chore(docs): update documentation --- docs/docs/change-log.md | 5 +++++ docs/docs/migration-guide.md | 18 ++++++++++++++++++ docs/docs/types/WalletConnectStore.md | 2 +- docs/docs/utilities/getAvailableWallets.md | 2 +- docs/docs/wallet-connect.md | 2 +- .../src/actions/wallet/wallet-connect/index.ts | 10 +++++----- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/docs/docs/change-log.md b/docs/docs/change-log.md index 5eb02969..759a383a 100644 --- a/docs/docs/change-log.md +++ b/docs/docs/change-log.md @@ -4,6 +4,11 @@ sidebar_position: 8 # Changelog +## Version 0.1.26 + +- Wallet connect modal uses `@walletconnect/modal` instead of deprecated `web3modal` +- Renamed prop `walletConnect.web3Modal` to `walletConnect.walletConnectModal` + ## Version 0.1.19 - Added Compass wallet integration diff --git a/docs/docs/migration-guide.md b/docs/docs/migration-guide.md index 519e7508..2849af1c 100644 --- a/docs/docs/migration-guide.md +++ b/docs/docs/migration-guide.md @@ -4,6 +4,24 @@ sidebar_position: 3 # Migration Guide +## 0.1.26 Breaking Changes + +### WalletConnect + +Wallet connect modal uses `@walletconnect/modal` instead of deprecated `web3modal` +Renamed prop `walletConnect.web3Modal` to `walletConnect.walletConnectModal` + +```diff + +``` + ## 0.1.18 Breaking Changes ### Signing client hooks diff --git a/docs/docs/types/WalletConnectStore.md b/docs/docs/types/WalletConnectStore.md index 80596e50..57b6946f 100644 --- a/docs/docs/types/WalletConnectStore.md +++ b/docs/docs/types/WalletConnectStore.md @@ -9,7 +9,7 @@ interface WalletConnectStore { name?: string; ...SignClientTypes.Options } | null; - web3Modal?: { + walletConnectModal?: { themeMode?: 'dark' | 'light' privacyPolicyUrl?: string termsOfServiceUrl?: string diff --git a/docs/docs/utilities/getAvailableWallets.md b/docs/docs/utilities/getAvailableWallets.md index 97d8957c..22e010e8 100644 --- a/docs/docs/utilities/getAvailableWallets.md +++ b/docs/docs/utilities/getAvailableWallets.md @@ -38,7 +38,7 @@ export const AvailableWallets = () => { #### Note: - if `walletConnect.options.projectId` not provided `WalletType.WALLETCONNECT` | `WalletType.WC_KEPLR_MOBILE` | `WalletType.WC_LEAP_MOBILE`| `WalletType.WC_COSMOSTATION_MOBILE` will return false -- `wallet.WalletType.WALLETCONNECT` is using `web3modal` for the modal, it will only shows the qr code. To connect and have deep linking to wallet mobile apps, use `WalletType.WC_KEPLR_MOBILE` | +- `wallet.WalletType.WALLETCONNECT` is using `@walletconnect/modal` for the modal, it will only shows the qr code. To connect and have deep linking to wallet mobile apps, use `WalletType.WC_KEPLR_MOBILE` | `WalletType.WC_LEAP_MOBILE`| `WalletType.WC_COSMOSTATION_MOBILE` - `WalletType.WC_KEPLR_MOBILE` | diff --git a/docs/docs/wallet-connect.md b/docs/docs/wallet-connect.md index d4f865d0..6f279e73 100644 --- a/docs/docs/wallet-connect.md +++ b/docs/docs/wallet-connect.md @@ -65,7 +65,7 @@ export const AvailableWallets = () => { #### Note: - if `walletConnect.options.projectId` not provided on `GrazProvider`, `WalletType.WALLETCONNECT` | `WalletType.WC_KEPLR_MOBILE` | `WalletType.WC_LEAP_MOBILE`| `WalletType.WC_COSMOSTATION_MOBILE` will return false -- `WalletType.WALLETCONNECT` is using `web3modal` for the modal, it will only shows the qr code. To connect and have deep linking to wallet mobile apps, use `WalletType.WC_KEPLR_MOBILE` | +- `WalletType.WALLETCONNECT` is using `@walletconnect/modal` for the modal, it will only shows the qr code. To connect and have deep linking to wallet mobile apps, use `WalletType.WC_KEPLR_MOBILE` | `WalletType.WC_LEAP_MOBILE`| `WalletType.WC_COSMOSTATION_MOBILE` - `WalletType.WC_KEPLR_MOBILE` | diff --git a/packages/graz/src/actions/wallet/wallet-connect/index.ts b/packages/graz/src/actions/wallet/wallet-connect/index.ts index 924841e7..450138b0 100644 --- a/packages/graz/src/actions/wallet/wallet-connect/index.ts +++ b/packages/graz/src/actions/wallet/wallet-connect/index.ts @@ -194,7 +194,7 @@ export const getWalletConnect = (params?: GetWalletConnectParams): Wallet => { const { walletConnect, chains } = useGrazInternalStore.getState(); if (!walletConnect?.options?.projectId) throw new Error("walletConnect.options.projectId is not defined"); - const web3Modal = new WalletConnectModal({ + const walletConnectModal = new WalletConnectModal({ projectId: walletConnect.options.projectId, enableExplorer: false, explorerRecommendedWalletIds: "NONE", @@ -230,7 +230,7 @@ export const getWalletConnect = (params?: GetWalletConnectParams): Wallet => { ); if (!uri) throw new Error("No wallet connect uri"); if (!params) { - await web3Modal.openModal({ uri }); + await walletConnectModal.openModal({ uri }); } else { redirectToApp(uri); } @@ -277,18 +277,18 @@ export const getWalletConnect = (params?: GetWalletConnectParams): Wallet => { try { const controller = new AbortController(); const signal = controller.signal; - web3Modal.subscribeModal((state) => { + walletConnectModal.subscribeModal((state) => { if (!state.open) { controller.abort(); } }); await approving(signal); } catch (error) { - web3Modal.closeModal(); + walletConnectModal.closeModal(); if (!(error as Error).message.toLowerCase().includes("no matching key")) return Promise.reject(error); } if (!params) { - web3Modal.closeModal(); + walletConnectModal.closeModal(); } return Promise.resolve(); }