Skip to content

Commit 8ba4b2a

Browse files
authored
Merge pull request #957 from LIT-Protocol/feature/jss-83-naga-bug-viem-type-mismatch
fix(auth,auth-helpers,lit-client,networks): set viem as a peer depend…
2 parents a62ed39 + fb9a132 commit 8ba4b2a

File tree

16 files changed

+108
-345
lines changed

16 files changed

+108
-345
lines changed

.changeset/quiet-times-pay.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@lit-protocol/auth-helpers': minor
3+
'@lit-protocol/lit-client': minor
4+
'@lit-protocol/contracts': minor
5+
'@lit-protocol/networks': minor
6+
'@lit-protocol/auth': minor
7+
---
8+
9+
Converted viem from a bundled dependency to a peer dependency to avoid build errors from version conflicts (e.g., missing exports like sendCallsSync) and improve compatibility by reducing dependency lock-in. Consumers must now install compatible versions manually.

docs/sdk/getting-started/auth-manager.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,31 @@ This method caches two components:
2525
<Steps>
2626
<Step title="Install the SDK">
2727

28-
Run the following command to install the SDK:
28+
Run the following command to install the SDK and the required <code>viem</code> peer dependency:
2929

3030
<CodeGroup>
3131

3232
```bash npm
33-
npm i @lit-protocol/auth
33+
npm i @lit-protocol/auth viem
3434
```
3535

3636
```bash yarn
37-
yarn add @lit-protocol/auth
37+
yarn add @lit-protocol/auth viem
3838
```
3939

4040
```bash pnpm
41-
pnpm add @lit-protocol/auth
41+
pnpm add @lit-protocol/auth viem
4242
```
4343

4444
```bash bun
45-
bun add @lit-protocol/auth
45+
bun add @lit-protocol/auth viem
4646
```
4747

4848
</CodeGroup>
49+
50+
<Note>
51+
<code>viem</code> must be installed in your application because the SDK no longer bundles it.
52+
</Note>
4953
</Step>
5054
<Step title="Choose Storage Plugin">
5155
Choose the appropriate network based on your development stage and requirements, then create your Lit Client instance.

docs/sdk/getting-started/lit-client.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,31 @@ The Lit Client is the core interface for interacting with the Lit Protocol netwo
1313

1414
<Steps>
1515
<Step title="Install the SDK">
16-
Run the following command to install the SDK:
16+
Run the following command to install the SDK and the required <code>viem</code> peer dependency:
1717

1818
<CodeGroup>
1919

2020
```bash npm
21-
npm i @lit-protocol/lit-client @lit-protocol/networks
21+
npm i @lit-protocol/lit-client @lit-protocol/networks viem
2222
```
2323

2424
```bash yarn
25-
yarn add @lit-protocol/lit-client @lit-protocol/networks
25+
yarn add @lit-protocol/lit-client @lit-protocol/networks viem
2626
```
2727

2828
```bash pnpm
29-
pnpm add @lit-protocol/lit-client @lit-protocol/networks
29+
pnpm add @lit-protocol/lit-client @lit-protocol/networks viem
3030
```
3131

3232
```bash bun
33-
bun add @lit-protocol/lit-client @lit-protocol/networks
33+
bun add @lit-protocol/lit-client @lit-protocol/networks viem
3434
```
3535

3636
</CodeGroup>
3737

38+
<Note>
39+
<code>viem</code> is not bundled with the SDK. Ensure your application supplies a compatible version.
40+
</Note>
3841
</Step>
3942

4043
<Step title="Network Configuration & Client Creation">

docs/sdk/getting-started/payment-manager-setup.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ The Payment Manager demonstrates Lit Protocol's payment system - a billing syste
2626
- Encryption/Decryption - Secure data with programmable access control
2727
- PKP Signing - Cryptographic keys that can sign transactions based on conditions
2828
- Lit Actions - Serverless functions with cryptographic capabilities
29-
3029
Similar to how you pay AWS for cloud computing, this\system ensures the decentralised network can sustain itself and pay node operators. You can deposit funds, request withdrawals with security delays, and manage balances for yourself or other users (enabling applications to sponsor their users' costs for better UX).
3130

3231
<Steps>

docs/sdk/introduction.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ The Lit JS SDK provides a comprehensive toolkit for integrating Lit Protocol's d
1717

1818
- **[Lit Client Setup](/sdk/getting-started/lit-client)**: Configure the Lit Protocol client
1919
- **[Auth Manager Setup](/sdk/getting-started/auth-manager)**: Set up authentication management with configurable storage options
20-
- **[Payment Manager Setup](/sdk/getting-started/payment-setup)**: Configure payment processing capabilities
20+
- **[Payment Manager Setup](/sdk/getting-started/payment-manager-setup)**: Configure payment processing capabilities
2121
- **[Auth Services Setup](/sdk/getting-started/auth-services)**: Configure auth services
2222

2323
### 2. Authentication Options
2424

2525
- **[PKP Native Authentication](/sdk/auth/pkp-native-auth)**: Programmable Key Pair native authentication options
2626
- **[PKP Custom Authentication](/sdk/auth/pkp-custom-auth)**: Custom PKP authentication implementations
27-
- **[EOA Authentication](/sdk/auth/eoa-auth)**: Externally Owned Account authentication
27+
- **[EOA Authentication](/sdk/auth/eoa/eoa-auth)**: Externally Owned Account authentication
2828

2929
### 3. Auth Context Consumption / Core API Methods
3030

@@ -40,4 +40,4 @@ The Lit JS SDK provides a comprehensive toolkit for integrating Lit Protocol's d
4040

4141
### 5. Network Status & Monitoring
4242

43-
- **[Network Status](/sdk/resources/network-status)**: - Monitor real-time uptime and performance of Lit Protocol networks
43+
- **[Network Status](/sdk/resources/network-status)**: - Monitor real-time uptime and performance of Lit Protocol networks

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"stytch": "^12.4.0",
5252
"tslib": "^2.8.1",
5353
"uint8arrays": "^4.0.3",
54-
"viem": "2.29.4",
54+
"viem": "2.38.x",
5555
"wagmi": "^2.15.4",
5656
"zod": "3.24.3",
5757
"zod-validation-error": "3.4.0",

packages/auth-helpers/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333
"ethers": "^5.7.1",
3434
"siwe": "^2.3.2",
3535
"siwe-recap": "0.0.2-alpha.0",
36-
"viem": "2.29.4",
3736
"zod": "3.24.3",
3837
"@ethersproject/transactions": "5.7.0"
38+
},
39+
"peerDependencies": {
40+
"viem": "2.38.x"
3941
}
4042
}

packages/auth-services/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"redis": "^4.6.13",
3030
"stytch": "^12.4.0",
3131
"tslib": "^2.8.1",
32-
"viem": "2.29.4",
32+
"viem": "2.38.x",
3333
"wagmi": "^2.14.11",
3434
"zod": "^3.24.3",
3535
"zod-validation-error": "3.4.0"

packages/auth/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
"jose": "^4.14.4",
3535
"siwe": "^2.3.2",
3636
"stytch": "^12.4.0",
37-
"viem": "2.29.4",
3837
"zod": "3.24.3"
3938
},
4039
"peerDependencies": {
41-
"tslib": "^2.3.0"
40+
"tslib": "^2.3.0",
41+
"viem": "2.38.x"
4242
},
4343
"browser": {
4444
"crypto": false,

packages/contracts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
"tsx": "^4.20.5",
161161
"typechain": "^8.3.2",
162162
"typescript": "^5.8.3",
163-
"viem": "^2.29.4",
163+
"viem": "2.38.x",
164164
"zod": "^3.24.3"
165165
},
166166
"peerDependencies": {

0 commit comments

Comments
 (0)