Skip to content

Commit 0a44aa5

Browse files
authored
Merge pull request WalletConnect#1650 from WalletConnect/feat/add-enableSwaps-flag
refactor: add enableSwaps flag
2 parents 2cd2428 + cd4c972 commit 0a44aa5

File tree

12 files changed

+53
-21
lines changed

12 files changed

+53
-21
lines changed

docs/appkit/javascript/ethers/about/implementation.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ const modal = createWeb3Modal({
4444
ethersConfig,
4545
chains: [mainnet],
4646
projectId,
47-
enableAnalytics: true, // Optional - defaults to your Cloud configuration
48-
enableOnramp: true // Optional - false as default
47+
enableAnalytics: true // Optional - defaults to your Cloud configuration
4948
})
5049
```
5150

docs/appkit/javascript/ethers5/implementation.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ const modal = createWeb3Modal({
4444
ethersConfig,
4545
chains: [mainnet],
4646
projectId,
47-
enableAnalytics: true, // Optional - defaults to your Cloud configuration
48-
enableOnramp: true // Optional - false as default
47+
enableAnalytics: true // Optional - defaults to your Cloud configuration
4948
})
5049
```
5150

docs/appkit/next/ethers/about/implementation.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ createWeb3Modal({
4545
ethersConfig,
4646
chains: [mainnet],
4747
projectId,
48-
enableAnalytics: true, // Optional - defaults to your Cloud configuration
49-
enableOnramp: true // Optional - false as default
48+
enableAnalytics: true // Optional - defaults to your Cloud configuration
5049
})
5150

5251
export function Web3Modal({ children }) {

docs/appkit/next/ethers5/implementation.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ createWeb3Modal({
4646
ethersConfig,
4747
chains: [mainnet],
4848
projectId,
49-
enableAnalytics: true, // Optional - defaults to your Cloud configuration
50-
enableOnramp: true // Optional - false as default
49+
enableAnalytics: true // Optional - defaults to your Cloud configuration
5150
})
5251

5352
export function Web3Modal({ children }) {

docs/appkit/next/wagmi/about/implementation.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ if (!projectId) throw new Error('Project ID is not defined')
7474
createWeb3Modal({
7575
wagmiConfig: config,
7676
projectId,
77-
enableAnalytics: true, // Optional - defaults to your Cloud configuration
78-
enableOnramp: true // Optional - false as default
77+
enableAnalytics: true // Optional - defaults to your Cloud configuration
7978
})
8079

8180
export default function Web3ModalProvider({

docs/appkit/react/wagmi/about/implementation.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ const config = defaultWagmiConfig({
3636
createWeb3Modal({
3737
wagmiConfig: config,
3838
projectId,
39-
enableAnalytics: true, // Optional - defaults to your Cloud configuration
40-
enableOnramp: true // Optional - false as default
39+
enableAnalytics: true // Optional - defaults to your Cloud configuration
4140
})
4241

4342
export function Web3ModalProvider({ children }) {

docs/appkit/shared/onramp.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ On-Ramp is supported in the latest version of Web3Modal. If you are using an old
1010

1111
## Integration
1212

13-
In order to enable On-Ramp on Web3Modal add the `enableOnramp` flag set to `true` in the `createWeb3Modal` function configuration.
13+
The On-Ramp feature is enabled by default, so no additional configuration is required.
14+
15+
If you prefer to disable it, set the `enableOnramp` flag to `false` in the configuration of the `createWeb3Modal` function.
1416

1517
```ts
1618
const modal = createWeb3Modal({
1719
//...
1820
chains: [mainnet],
1921
projectId,
2022
/* highlight-add-start */
21-
enableOnramp: true // Optional - false as default
23+
enableOnramp: false // Optional - true by default
2224
/* highlight-add-end */
2325
})
2426
```

docs/appkit/shared/options.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,28 @@ createWeb3Modal({
206206
})
207207
```
208208

209+
## enableSwaps
210+
211+
Enable or disable the swap feature in your AppKit. [Swaps](/appkit/react/transactions/swaps) feature is enabled by default.
212+
213+
```ts
214+
createWeb3Modal({
215+
//...
216+
enableSwaps: false
217+
})
218+
```
219+
220+
## enableOnramp
221+
222+
Enable or disable the onramp feature in your AppKit. [Onramp](/appkit/react/transactions/onramp) feature is enabled by default.
223+
224+
```ts
225+
createWeb3Modal({
226+
//...
227+
enableOnramp: false
228+
})
229+
```
230+
209231
<Button name="Learn More" url="/cloud/analytics" />
210232

211233
## customWallets

docs/appkit/shared/swaps.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,21 @@ Swaps is currently in Beta. Users may experience changes or improvements in the
1919
3. **Select Tokens**: Choose the tokens you wish to swap from the available options.
2020
4. **Type amount**: Enter your desired swap values. You can use the Max button to swap your all tokens or enter any specific number.
2121
5. **See swap details**: Once you type amount value. You'll see the available quote details as received amount, network fee, maximum slippage, or price impact.
22-
6. **Confirm Swap**: Review the swap details, including the transaction fee, and confirm the swap.
22+
6. **Confirm Swap**: Review the swap details, including the transaction fee, and confirm the swap.
23+
24+
## Integration
25+
26+
The Swaps feature is enabled by default, so no additional configuration is required.
27+
28+
If you prefer to disable it, set the `enableSwaps` flag to `false` in the configuration of the `createWeb3Modal` function.
29+
30+
```ts
31+
const modal = createWeb3Modal({
32+
//...
33+
chains: [mainnet],
34+
projectId,
35+
/* highlight-add-start */
36+
enableSwaps: false // Optional - true by default
37+
/* highlight-add-end */
38+
})
39+
```

docs/appkit/vue/ethers/about/implementation.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ In your `App.vue` file set up the following configuration.
4545
ethersConfig,
4646
chains: [mainnet],
4747
projectId,
48-
enableAnalytics: true, // Optional - defaults to your Cloud configuration
49-
enableOnramp: true // Optional - false as default
48+
enableAnalytics: true // Optional - defaults to your Cloud configuration
5049
})
5150
</script>
5251

0 commit comments

Comments
 (0)