Skip to content

Commit 9847523

Browse files
mattschochclaude
andauthored
feat: add Narval wallet connector (#2998)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 96d23db commit 9847523

8 files changed

Lines changed: 58 additions & 1 deletion

File tree

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ NEXT_PUBLIC_FIAT_ON_RAMP=false
55
#NEXT_PUBLIC_FORK_CHAIN_ID=1
66
#NEXT_PUBLIC_FORK_URL_RPC="https://rpc.tenderly.co/fork/1234567"
77
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
8+
NEXT_PUBLIC_NARVAL_CLIENT_ID=
89
NEXT_PUBLIC_ENABLE_STAKING=true
910
NEXT_PUBLIC_ENABLE_GOVERNANCE=true
1011
NEXT_PUBLIC_API_BASEURL=https://aave-api-v2.aave.com

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ NEXT_PUBLIC_FORK_BASE_CHAIN_ID=
1515
NEXT_PUBLIC_FORK_CHAIN_ID=
1616
NEXT_PUBLIC_FORK_URL_RPC=
1717
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
18+
NEXT_PUBLIC_NARVAL_CLIENT_ID=
1819
NEXT_PUBLIC_MIXPANEL=
1920
NEXT_PUBLIC_FIAT_ON_RAMP=true
2021
NEXT_PUBLIC_IS_CYPRESS_ENABLED=false

.github/actions/build/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ inputs:
3737
description: wallet connect project id
3838
required: false
3939
default: ''
40+
NEXT_PUBLIC_NARVAL_CLIENT_ID:
41+
description: narval client id
42+
required: false
43+
default: ''
4044
NEXT_PUBLIC_IS_CYPRESS_ENABLED:
4145
description: enables cypress
4246
required: false
@@ -83,4 +87,5 @@ runs:
8387
NEXT_PUBLIC_MIXPANEL: '${{ inputs.NEXT_PUBLIC_MIXPANEL }}'
8488
NEXT_PUBLIC_FIAT_ON_RAMP: 'false'
8589
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: '${{ inputs.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID }}'
90+
NEXT_PUBLIC_NARVAL_CLIENT_ID: '${{ inputs.NEXT_PUBLIC_NARVAL_CLIENT_ID }}'
8691
NEXT_PUBLIC_IS_CYPRESS_ENABLED: '${{ inputs.NEXT_PUBLIC_IS_CYPRESS_ENABLED }}'

.github/workflows/build-test-deploy-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
NEXT_PUBLIC_MIXPANEL: ${{ secrets.NEXT_PUBLIC_MIXPANEL }}
3838
NEXT_PUBLIC_FIAT_ON_RAMP: 'false'
3939
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
40+
NEXT_PUBLIC_NARVAL_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_NARVAL_CLIENT_ID }}
4041
NEXT_PUBLIC_IS_CYPRESS_ENABLED: ${{ matrix.build.cypress_enabled }}
4142

4243
- name: Upload artifacts

.github/workflows/build-test-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
NEXT_PUBLIC_MIXPANEL: ${{ secrets.NEXT_PUBLIC_MIXPANEL }}
3838
NEXT_PUBLIC_FIAT_ON_RAMP: 'false'
3939
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
40+
NEXT_PUBLIC_NARVAL_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_NARVAL_CLIENT_ID }}
4041
NEXT_PUBLIC_IS_CYPRESS_ENABLED: ${{ matrix.build.cypress_enabled }}
4142

4243
- name: Upload artifacts

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"@mui/icons-material": "^5.10.14",
5555
"@mui/lab": "5.0.0-alpha.103",
5656
"@mui/material": "^5.10.9",
57+
"@narval-xyz/connect": "1.0.1",
5758
"@number-flow/react": "^0.5.10",
5859
"@paraswap/sdk": "6.10.0",
5960
"@safe-global/safe-apps-provider": "^0.18.4",

src/ui-config/wagmiConfig.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { narval } from '@narval-xyz/connect/wagmi';
12
import { Emitter } from '@wagmi/core/internal';
23
import { getDefaultConfig } from 'connectkit';
34
import {
@@ -80,7 +81,7 @@ const connectorConfig = {
8081
emitter: new Emitter(''),
8182
};
8283

83-
const connectors = prodCkConfig.connectors
84+
const baseConnectors = prodCkConfig.connectors
8485
?.map((connector) => {
8586
// initialize the connector with the emitter so we can access the id
8687
const c = connector(connectorConfig);
@@ -104,6 +105,20 @@ const connectors = prodCkConfig.connectors
104105
return 0;
105106
});
106107

108+
const narvalConnector = process.env.NEXT_PUBLIC_NARVAL_CLIENT_ID
109+
? narval({
110+
config: {
111+
clientId: process.env.NEXT_PUBLIC_NARVAL_CLIENT_ID,
112+
},
113+
// Must be injected, otherwise ConnectKit(v1.9.0) shows a "not installed" error message.
114+
// Remove this once ConnectKit has a fix applied.
115+
overrides: {
116+
type: 'injected',
117+
},
118+
})
119+
: undefined;
120+
const connectors = narvalConnector ? [...(baseConnectors ?? []), narvalConnector] : baseConnectors;
121+
107122
const prodConfig = createConfig({
108123
...prodCkConfig,
109124
connectors,

yarn.lock

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,6 +2978,14 @@
29782978
resolved "https://registry.yarnpkg.com/@multiformats/base-x/-/base-x-4.0.1.tgz#95ff0fa58711789d53aefb2590a8b7a4e715d121"
29792979
integrity sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw==
29802980

2981+
"@narval-xyz/connect@1.0.1":
2982+
version "1.0.1"
2983+
resolved "https://registry.yarnpkg.com/@narval-xyz/connect/-/connect-1.0.1.tgz#1ed281d6eb3a68dafb32de819ee71ae5059430ad"
2984+
integrity sha512-inXus1eycMjw2o+SkPIkyYC3Hi4OIlx25SMldx1Uof9vuzXx2tqW01t7cp0CAIkZRkHOsW2DolCMY+TiYi2r+g==
2985+
dependencies:
2986+
ox "^0.9.12"
2987+
zod "^4.3.6"
2988+
29812989
"@next/bundle-analyzer@^12.1.0":
29822990
version "12.3.4"
29832991
resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-12.3.4.tgz#37c587525288a3dea64213c991590532246e8bb8"
@@ -5024,6 +5032,11 @@ abitype@1.2.3, abitype@^1.2.3:
50245032
resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.2.3.tgz#bec3e09dea97d99ef6c719140bee663a329ad1f4"
50255033
integrity sha512-Ofer5QUnuUdTFsBRwARMoWKOH1ND5ehwYhJ3OJ/BQO+StkwQjHw0XyVh4vDttzHB7QOFhPHa/o413PJ82gU/Tg==
50265034

5035+
abitype@^1.0.9:
5036+
version "1.2.4"
5037+
resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.2.4.tgz#8aab72949bcad4107031862ae998e5bd20eec76e"
5038+
integrity sha512-dpKH+N27vRjarMVTFFkeY445VTKftzGWpL0FiT7xmVmzQRKazZexzC5uHG0f6XKsVLAuUlndnbGau6lRejClxg==
5039+
50275040
abort-controller@^3.0.0:
50285041
version "3.0.0"
50295042
resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
@@ -10987,6 +11000,20 @@ ox@0.6.9:
1098711000
abitype "^1.0.6"
1098811001
eventemitter3 "5.0.1"
1098911002

11003+
ox@^0.9.12:
11004+
version "0.9.17"
11005+
resolved "https://registry.yarnpkg.com/ox/-/ox-0.9.17.tgz#2397301db419664602853ca292524805ec0df5c3"
11006+
integrity sha512-rKAnhzhRU3Xh3hiko+i1ZxywZ55eWQzeS/Q4HRKLx2PqfHOolisZHErSsJVipGlmQKHW5qwOED/GighEw9dbLg==
11007+
dependencies:
11008+
"@adraffy/ens-normalize" "^1.11.0"
11009+
"@noble/ciphers" "^1.3.0"
11010+
"@noble/curves" "1.9.1"
11011+
"@noble/hashes" "^1.8.0"
11012+
"@scure/bip32" "^1.7.0"
11013+
"@scure/bip39" "^1.6.0"
11014+
abitype "^1.0.9"
11015+
eventemitter3 "5.0.1"
11016+
1099011017
p-limit@^2.0.0, p-limit@^2.2.0:
1099111018
version "2.3.0"
1099211019
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1"
@@ -13691,6 +13718,11 @@ zod@3.22.4:
1369113718
resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff"
1369213719
integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==
1369313720

13721+
zod@^4.3.6:
13722+
version "4.4.3"
13723+
resolved "https://registry.yarnpkg.com/zod/-/zod-4.4.3.tgz#b680f172885d18bbebf21a834ea25e55a1bbf356"
13724+
integrity sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==
13725+
1369413726
zustand@5.0.0:
1369513727
version "5.0.0"
1369613728
resolved "https://registry.yarnpkg.com/zustand/-/zustand-5.0.0.tgz#71f8aaecf185592a3ba2743d7516607361899da9"

0 commit comments

Comments
 (0)