You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+66-7Lines changed: 66 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,20 +109,60 @@ Example usage:
109
109
110
110
```html
111
111
<script>
112
-
import { web3Modal } from'svelte-wagmi';
112
+
import { web3Modal } from'svelte-wagmi';
113
113
</script>
114
114
115
115
{#if $web3Modal}
116
-
<buttonon:click={() => $web3Modal.openModal()}>
117
-
Connect to Ethereum
118
-
</button>
116
+
<buttonon:click="{()" ="">$web3Modal.openModal()}> Connect to Ethereum</button>
119
117
{:else}
120
118
121
-
<p>Web3Modal not yet available</p>
119
+
<p>Web3Modal not yet available</p>
122
120
{/if}
123
121
```
124
122
125
-
### configureWagmi
123
+
### defaultConfig
124
+
125
+
The `defaultConfig` function is used to configure the `@wagmi/core` library and initialize the Svelte stores. It takes an optional options object that can be used to configure the behavior of the function.
126
+
127
+
-`autoConnect` (boolean, default: `true`): Specifies whether the Ethereum client should automatically connect to a provider upon initialization. If set to `true`, the client will attempt to connect automatically.
128
+
-`appName` (string, default: `'Erc.Kit'`): Specifies the name of the application using the Ethereum client.
129
+
-`appIcon` (string): Specifies the URL or path to an icon representing the application.
130
+
-`appDescription` (string): Specifies the description of the application.
131
+
-`appUrl` (string): Specifies the URL of the application.
132
+
-`chains` (array, default: `defaultChains`): An array of chain configurations to connect with. If not provided, the function will use default chain configurations.
133
+
-`alchemyId` (string): The API key for the Alchemy provider, used for connecting to the Alchemy service.
134
+
-`infuraId` (string): The API key for the Infura provider, used for connecting to the Infura service.
135
+
-`connectors` (object): An object containing customized connector configurations for the Ethereum client.
136
+
-`publicClient` (object): Specifies a pre-configured public client object.
137
+
-`stallTimeout` (number): Specifies the stall timeout value for the Ethereum client.
138
+
-`walletConnectProjectId` (string): The project ID used for the WalletConnect integration.
139
+
140
+
### Return Value:
141
+
142
+
The `defaultConfig` function returns an object with the following properties:
143
+
144
+
-`init`: A function that can be called to initialize the Ethereum client and set up the connections based on the provided configurations.
The `configureWagmi` function is used to configure the `@wagmi/core` library and initialize the Svelte stores. It takes an optional options object that can be used to configure the behavior of the function.
0 commit comments