Skip to content

Commit 944a60b

Browse files
authored
Promote Credit Wallet in WalletConnect for all Creditcoin chains (#3166)
Resolves #3162
1 parent be1c030 commit 944a60b

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

configs/app/features/blockchainInteraction.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import type { Feature } from './types';
22

33
import chain from '../chain';
4-
import { getEnvValue } from '../utils';
4+
import { getEnvValue, parseEnvJson } from '../utils';
55
import opSuperchain from './opSuperchain';
66

77
const walletConnectProjectId = getEnvValue('NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID');
88

99
const title = 'Blockchain interaction (writing to contract, etc.)';
1010

11-
const config: Feature<{ walletConnect: { projectId: string } }> = (() => {
11+
const config: Feature<{ walletConnect: { projectId: string; featuredWalletIds: Array<string> } }> = (() => {
1212

1313
// all chain parameters are required for wagmi provider
1414
// @wagmi/chains/dist/index.d.ts
@@ -32,6 +32,7 @@ const config: Feature<{ walletConnect: { projectId: string } }> = (() => {
3232
isEnabled: true,
3333
walletConnect: {
3434
projectId: walletConnectProjectId,
35+
featuredWalletIds: parseEnvJson<Array<string>>(getEnvValue('NEXT_PUBLIC_WALLET_CONNECT_FEATURED_WALLET_IDS')) ?? [],
3536
},
3637
});
3738
}

deploy/tools/envs-validator/schemas/services.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import * as yup from 'yup';
44
// External services envs
55
export default yup.object({
66
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: yup.string(),
7+
NEXT_PUBLIC_WALLET_CONNECT_FEATURED_WALLET_IDS: yup.array().transform(replaceQuotes).json().of(yup.string()),
8+
79
NEXT_PUBLIC_RE_CAPTCHA_APP_SITE_KEY: yup.string(),
810
NEXT_PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: yup.string(),
911
NEXT_PUBLIC_GROWTH_BOOK_CLIENT_KEY: yup.string(),

deploy/tools/envs-validator/test/.env.base

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
NEXT_PUBLIC_ROLLBAR_CLIENT_TOKEN=https://rollbar.com
22
NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true
33
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=xxx
4+
NEXT_PUBLIC_WALLET_CONNECT_FEATURED_WALLET_IDS=['xxx']
45
NEXT_PUBLIC_RE_CAPTCHA_APP_SITE_KEY=xxx
56
NEXT_PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID=UA-XXXXXX-X
67
NEXT_PUBLIC_MIXPANEL_PROJECT_TOKEN=xxx

docs/ENVS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The app instance can be customized by passing the following variables to the Nod
88
Please note that in the tables below, the "Compulsoriness" column indicates whether the variable is required for starting up the application, except for the "App Features" section. All features are optional by definition; therefore, the "Compulsoriness" column indicates whether a certain variable is required or optional only within the context of that feature, not for the entire application.
99

1010
### Disclaimer about using variables
11-
Please be aware that all environment variables prefixed with `NEXT_PUBLIC_` will be exposed to the browser. So any user can obtain its values. Make sure that for all 3rd-party services keys (e.g., Auth0, WalletConnect, etc.) in the services administration panel you have created a whitelist of allowed origins and have added your app domain into it. That will help you prevent using your key by unauthorized app, if someone gets its value.
11+
Please be aware that all environment variables prefixed with `NEXT_PUBLIC_` will be exposed to the browser. So any user can obtain its values. Make sure that for all 3rd-party services keys (e.g., Auth0, Reown, etc.) in the services administration panel you have created a whitelist of allowed origins and have added your app domain into it. That will help you prevent using your key by unauthorized app, if someone gets its value.
1212

1313
### Note about escaping variables values
1414
All json-like values should be single-quoted. If it contains a hash (`#`) or a dollar-sign (`$`) the whole value should be wrapped in single quotes as well (see `dotenv` [readme](https://github.com/bkeepers/dotenv#variable-substitution) for the reference)
@@ -449,7 +449,8 @@ This feature is **enabled by default**. To switch it off pass `NEXT_PUBLIC_ADVAN
449449

450450
| Variable | Type| Description | Compulsoriness | Default value | Example value | Version |
451451
| --- | --- | --- | --- | --- | --- | --- |
452-
| NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID | `string` | Project id for [WalletConnect](https://cloud.walletconnect.com/) integration | Required | - | `<your-secret>` | v1.0.x+ |
452+
| NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID | `string` | Project id for [Reown AppKit](https://cloud.reown.com//) integration | Required | - | `<your-secret>` | v1.0.x+ |
453+
| NEXT_PUBLIC_WALLET_CONNECT_FEATURED_WALLET_IDS | `Array<string>` | List of [featured wallet IDs](https://docs.reown.com/appkit/react/core/options#featuredwalletids) in the "Connect your wallet" modal. To obtain the wallet ID, please use [WalletGuild](https://walletguide.walletconnect.network). | - | - | `['c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576']` | upcoming |
453454
| NEXT_PUBLIC_NETWORK_RPC_URL | `string` | See in [Blockchain parameters](#blockchain-parameters) section | Required | - | `https://core.poa.network` | v1.0.x+ |
454455
| NEXT_PUBLIC_NETWORK_NAME | `string` | See in [Blockchain parameters](#blockchain-parameters) section | Required | - | `Gnosis Chain` | v1.0.x+ |
455456
| NEXT_PUBLIC_NETWORK_ID | `number` | See in [Blockchain parameters](#blockchain-parameters) section | Required | - | `99` | v1.0.x+ |

ui/shared/Web3ModalProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const init = () => {
4343
'--w3m-border-radius-master': '2px',
4444
'--w3m-z-index': zIndex?.modal2?.value,
4545
},
46-
featuredWalletIds: [],
46+
featuredWalletIds: feature.walletConnect.featuredWalletIds,
4747
allowUnsupportedChain: true,
4848
});
4949
} catch (error) {}

0 commit comments

Comments
 (0)