Skip to content

Commit

Permalink
Prepare for v2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
fracek committed Nov 16, 2023
1 parent c1776a3 commit 2701e3c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"mode": "pre",
"mode": "exit",
"tag": "next",
"initialVersions": {
"@starknet-react/chains": "0.0.0",
Expand Down
36 changes: 27 additions & 9 deletions website/content/docs/upgrading.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ First, update all dependencies and double check that the installed version of

<CH.Code>
```console npm
npm install @starknet-react/chains@next @starknet-react/core@next starknet get-starknet-core
npm install @starknet-react/chains @starknet-react/core starknet get-starknet-core
```
```console pnpm
pnpm add @starknet-react/chains@next @starknet-react/core@next starknet get-starknet-core
pnpm add @starknet-react/chains @starknet-react/core starknet get-starknet-core
```
```console yarn
yarn add @starknet-react/chains@next @starknet-react/core@next starknet get-starknet-core
yarn add @starknet-react/chains @starknet-react/core starknet get-starknet-core
```
</CH.Code>

Expand All @@ -36,23 +36,33 @@ options. You also need to update the `connectors` passed to it.
for the most popular wallets.

```tsx components/starknet-provider.tsx
import { goerli } from "@starknet-react/chains";
import { goerli, mainnet } from "@starknet-react/chains";
import {
StarknetConfig,
publicProvider,
useInjectedConnectors,
argent,
braavos,
} from "@starknet-react/core";

export function StarknetProvider({ children }: { children: React.ReactNode }) {
const chains = [goerli];
const provider = publicProvider();
const connectors = [argent(), braavos()];
const { connectors } = useInjectedConnectors({
// Show these connectors if the user has no connector installed.
recommended: [
argent(),
braavos(),
],
// Hide recommended connectors if the user has any connector installed.
includeRecommended: "onlyIfNoConnectors",
// Randomize the order of the connectors.
order: "random"
});


return (
<StarknetConfig
chains={chains}
provider={provider}
chains={[mainnet, goerli]}
provider={publicProvider()}
connectors={connectors}
>
{children}
Expand All @@ -61,6 +71,14 @@ export function StarknetProvider({ children }: { children: React.ReactNode }) {
}
```

## Update hooks

You should review the hooks documentation to see what changed. Generally
speaking:

- `useContractWrite` and `useSignTypedData` return values changed.
Specifically, `isLoading` is now `isPending`.

## Transaction manager

The transaction manager is now gone 💀
Expand Down

0 comments on commit 2701e3c

Please sign in to comment.