Skip to content

Commit

Permalink
feat(docs): add migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
codingki committed Sep 13, 2023
1 parent 96ce7b0 commit f0f076c
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ sidebar_position: 15
walletType: WalletType;
}
```
- Removed `signerOpts` param in `connect` and `connectAsync` from `useConnect`
- Removed `signerOpts` param in `suggestChainAndConnect` and `suggestChainAndConnectAsync` from `useSuggestChainAndConnect`

## Version 0.0.49

Expand Down
1 change: 0 additions & 1 deletion docs/docs/hooks/useSuggestChainAndConnect.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function App() {
```tsx
{
chainInfo: ChainInfo;
signerOpts?: SigningCosmWasmClientOptions;
walletType?: WalletType;
gas?: {
price: string;
Expand Down
139 changes: 139 additions & 0 deletions docs/docs/migration-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
sidebar_position: 3
---

# Migration Guide

## 0.0.50 Breaking Changes

[Full changelog](/docs/change-log/#version-0045)

### `useSuggestChain`

`suggestChain` and `suggestChainAsync` param to object param

```ts
interface SuggestChainArgs {
chainInfo: ChainInfo;
walletType: WalletType;
}
```

```diff
- suggestChain(chainInfo)
+ suggestChain({ chainInfo, walletType }: SuggestChainArgs)
```

### `useConnect`

We remove `signerOpts` param from `connect` and `connectAsync` in `useConnect`

```diff
connect({
chain: chain,
walletType: walletType,
- signerOpts: signerOpts
})
```

### `useSuggestChainAndConnect`

We remove `signerOpts` param from `suggestAndConnect` and `suggestAndConnectAsync` in `useSuggestChainAndConnect`

```diff
suggestAndConnect({
chain: chain,
walletType: walletType,
- signerOpts: signerOpts
})
```

## 0.0.45 Breaking Changes

[Full changelog](/docs/change-log/#version-0045)

### Reworked connect

connect not creating offline signers, clients and signing clients

### Removed Actions:

- `createClients`
- `createSigningClients`
- `createQueryClient`
- `getBalances`
- `getBalanceStaked`

### Removed `useClients`

Use these hooks instead:

- `useStargateClient`
- `useCosmwasmClient`
- `useTendermintClient`

### Removed `useSigningClients`

Use these hooks instead:

- `useStargateSigningClient`
- `useStargateTmSigningClient`
- `useCosmWasmSigningClient`
- `useCosmwasmTmSigningClient`

### `useSendTokens`

added mutation param `signingClient?: SigningStargateClient | SigningCosmWasmClient`

```diff
+ const { data: signingClient } = useStargateSigningClient()
const { sendTokens } = useSendTokens();
sendTokens({
+ signingClient,
recipientAddress: "cosmos1g3jjhgkyf36pjhe7u5cw8j9u6cgl8x929ej430";
// ...
})
```

### `useSendIbcTokens`

added mutation param `signingClient?: SigningStargateClient`

```diff
+ const { data: signingClient } = useStargateSigningClient()
const { sendIbcTokens } = useSendIbcTokens();
sendIbcTokens({
+ signingClient,
recipientAddress: "cosmos1g3jjhgkyf36pjhe7u5cw8j9u6cgl8x929ej430";
// ...
})
```

### `useInstantiateContract`

added mutation param `signingClient?: SigningCosmWasmClient`

```diff
+ const { data: signingClient } = useCosmwasmSigningClient()
const { instantiateContract } = useInstantiateContract();
instantiateContract({
+ signingClient,
msg: instatiateMessage,
label: "test"
});
```

### `useExecuteContract`

added mutation param `signingClient?: SigningCosmWasmClient`

```diff
+ const { data: signingClient } = useCosmwasmSigningClient()
const { executeContract } = useExecuteContract();
executeContract({
+ signingClient,
msg: {
foo: "bar"
}
});
```

0 comments on commit f0f076c

Please sign in to comment.