Skip to content

Commit 5fb1752

Browse files
committed
chore: update workspace configuration and fix package dependencies
1 parent 974ccb2 commit 5fb1752

8 files changed

Lines changed: 4123 additions & 3476 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ apps/your-guide-name/
3939

4040
1. **Dependencies**
4141

42-
- Use `@branch/berachain-config` for network configuration
42+
- Use `@branch/rpc-config` for network configuration
4343
- Keep dependencies up to date
4444
- Document any special requirements
4545

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A collection of [Berachain](https://docs.berachain.com/learn/) EVM examples: cod
1212
```
1313
📚 Berachain Guides
1414
├── 📦 Core Packages
15-
│ ├── 📄 berachain-config/ # Network & RPC configurations
15+
│ ├── 📄 rpc-config/ # Network & RPC configurations
1616
│ │ ├── 📄 README.md # Integration patterns & security
1717
│ │ ├── 📄 viem/ # Viem integration utilities
1818
│ │ └── 📄 ethers/ # Ethers integration utilities
@@ -87,7 +87,7 @@ A collection of [Berachain](https://docs.berachain.com/learn/) EVM examples: cod
8787

8888
1. **Core Concepts**
8989

90-
- Start with `berachain-config` to understand network integration
90+
- Start with `rpc-config` to understand network integration
9191
- Review basic contract deployment examples
9292

9393
2. **Choose Your Path**

apps/hardhat-viem-helloworld/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
"devDependencies": {
1818
"@berachain/eslint-config": "workspace:*",
1919
"@berachain/typescript-config": "workspace:*",
20+
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
21+
"@nomicfoundation/hardhat-toolbox-viem": "^3.0.0",
2022
"@types/node": "^20.0.0",
23+
"hardhat": "^2.19.4",
2124
"prettier": "^3.0.0",
2225
"typescript": "^5.0.0",
23-
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
24-
"hardhat": "^2.19.4",
2526
"viem": "^2.7.9"
2627
}
2728
}

apps/viem-solc-helloworld/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The contract is deployed to Berachain Bepolia testnet with the following configu
109109
- [Viem Documentation](https://viem.sh)
110110
- [Solc-js Documentation](https://github.com/ethereum/solc-js#readme)
111111
- [Berachain Documentation](https://docs.berachain.com/)
112-
- [@branch/berachain-config Package](../../packages/berachain-config/README.md)
112+
- [@branch/rpc-config Package](../../packages/rpc-config/README.md)
113113

114114
## Detailed Walkthrough
115115

lerna.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
33
"version": "0.0.0",
4-
"npmClient": "pnpm"
4+
"npmClient": "pnpm",
5+
"packages": ["packages/*", "apps/*"]
56
}

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@
2424
"format:check": "prettier --check \"**/*.{ts,tsx,md}\"",
2525
"with-env": "dotenv -e ./.env --",
2626
"deploy:berachain": "pnpm with-env turbo run deploy:berachain",
27-
"verify": "pnpm with-env turbo run verify",
28-
"postinstall": "cd apps/walletconnect-expo; pnpm install --ignore-workspace;"
27+
"verify": "pnpm with-env turbo run verify"
2928
},
3029
"devDependencies": {
3130
"@biomejs/biome": "^1.5.3",
3231
"@berachain/eslint-config": "workspace:*",
3332
"@berachain/typescript-config": "workspace:*",
34-
"@berachain/berachain-config": "workspace:*",
33+
"@berachain/rpc-config": "workspace:*",
3534
"prettier": "^3.1.0",
3635
"prettier-plugin-solidity": "^1.4.2",
3736
"turbo": "latest"

packages/rpc-config/README.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# @branch/berachain-config
1+
# @branch/rpc-config
22

33
A centralized configuration package for Berachain networks, providing chain configurations, RPC URLs, and utility functions for both browser and Node.js environments.
44

55
## Installation
66

77
```bash
88
# Core package
9-
pnpm add @branch/berachain-config
9+
pnpm add @branch/rpc-config
1010

1111
# With viem support
1212
pnpm add viem
@@ -22,14 +22,16 @@ pnpm add ethers
2222
```typescript
2323
import {
2424
berachainMainnet,
25-
berachainBepolia,
25+
berachainTestnet,
26+
berachainLocalnet,
2627
getChainById,
2728
getChainByName,
28-
} from "@branch/berachain-config";
29+
} from "@branch/rpc-config";
2930

3031
// Use predefined chains
3132
const mainnet = berachainMainnet;
32-
const testnet = berachainBepolia;
33+
const testnet = berachainTestnet;
34+
const localnet = berachainLocalnet;
3335

3436
// Get chain by ID
3537
const chain = getChainById(80085); // Returns berachainMainnet
@@ -46,16 +48,22 @@ For browser-based applications, you can use either Viem or Ethers to create wall
4648

4749
```typescript
4850
// Using Viem
49-
import { createBrowserWalletClient } from "@branch/berachain-config/viem";
50-
import { berachainMainnet } from "@branch/berachain-config";
51+
import { createBrowserWalletClient } from "@branch/rpc-config/viem";
52+
import { berachainMainnet } from "@branch/rpc-config";
5153

52-
const browserWallet = createBrowserWalletClient(berachainMainnet);
54+
const browserWallet = createBrowserWalletClient({
55+
chain: berachainMainnet,
56+
// ... other options
57+
});
5358

5459
// Using Ethers
55-
import { createBrowserEthersSigner } from "@branch/berachain-config/ethers";
56-
import { berachainMainnet } from "@branch/berachain-config";
60+
import { createBrowserEthersSigner } from "@branch/rpc-config/ethers";
61+
import { berachainMainnet } from "@branch/rpc-config";
5762

58-
const browserSigner = createBrowserEthersSigner(berachainMainnet);
63+
const browserSigner = createBrowserEthersSigner({
64+
chain: berachainMainnet,
65+
// ... other options
66+
});
5967
```
6068

6169
Security considerations for browser integration:
@@ -72,19 +80,22 @@ For scripts and backend services, you can use private key-based authentication:
7280

7381
```typescript
7482
// Using Viem
75-
import { createBerachainWalletClient } from "@branch/berachain-config/viem";
76-
import { berachainMainnet } from "@branch/berachain-config";
83+
import { createBerachainWalletClient } from "@branch/rpc-config/viem";
84+
import { berachainMainnet } from "@branch/rpc-config";
7785

78-
const walletClient = createBerachainWalletClient(http(), berachainMainnet);
86+
const walletClient = createBerachainWalletClient({
87+
chain: berachainMainnet,
88+
// ... other options
89+
});
7990

8091
// Using Ethers
81-
import { createBerachainEthersSigner } from "@branch/berachain-config/ethers";
82-
import { berachainMainnet } from "@branch/berachain-config";
92+
import { createBerachainEthersSigner } from "@branch/rpc-config/ethers";
93+
import { berachainMainnet } from "@branch/rpc-config";
8394

84-
const signer = createBerachainEthersSigner(
85-
"your-private-key",
86-
berachainMainnet,
87-
);
95+
const signer = createBerachainEthersSigner({
96+
chain: berachainMainnet,
97+
// ... other options
98+
});
8899
```
89100

90101
Security considerations for Node.js scripts:

0 commit comments

Comments
 (0)