Skip to content

Commit

Permalink
chore(docs): update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
codingki committed Nov 20, 2024
1 parent f66efcd commit 6242646
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
5 changes: 5 additions & 0 deletions docs/docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions docs/docs/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<GrazProvider
grazOptions={{
walletConnect: {
- web3Modal: web3ModalOptions
+ walletConnectModal: walletConnectModalOptions
}
}}
>
```

## 0.1.18 Breaking Changes

### Signing client hooks
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/types/WalletConnectStore.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface WalletConnectStore {
name?: string;
...SignClientTypes.Options
} | null;
web3Modal?: {
walletConnectModal?: {
themeMode?: 'dark' | 'light'
privacyPolicyUrl?: string
termsOfServiceUrl?: string
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/utilities/getAvailableWallets.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/wallet-connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
10 changes: 5 additions & 5 deletions packages/graz/src/actions/wallet/wallet-connect/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 6242646

Please sign in to comment.