Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ npm run test:watch # Watch mode

The SDK exports three entry points (see `package.json` exports):
- `genlayer-js` - Main: client, accounts, transaction decoders, staking utils
- `genlayer-js/chains` - Chain configs: `localnet`, `studionet`, `testnetAsimov`
- `genlayer-js/chains` - Chain configs: `localnet`, `studionet`, `testnetAsimov`, `testnetBradbury`
- `genlayer-js/types` - TypeScript types for all SDK entities

### Client Factory Pattern
Expand All @@ -45,7 +45,7 @@ Each action module (`src/<domain>/actions.ts`) returns an object of methods that
`GenLayerChain` extends viem's `Chain` with GenLayer-specific properties:
- `isStudio` - Whether using studio-based localnet
- `consensusMainContract` / `consensusDataContract` - On-chain consensus contracts
- `stakingContract` - Staking contract (testnet-asimov only)
- `stakingContract` - Staking contract (testnet-bradbury and testnet-asimov)
- `defaultNumberOfInitialValidators` / `defaultConsensusMaxRotations`

### Calldata Encoding
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ const receipt = await client.waitForTransactionReceipt({
```
### Staking Operations

The SDK provides staking functionality for validators and delegators on testnet-asimov.
The SDK provides staking functionality for validators and delegators on testnet-bradbury (and testnet-asimov).

```typescript
import { testnetAsimov } from 'genlayer-js/chains';
import { testnetBradbury } from 'genlayer-js/chains';
import { createClient, createAccount } from "genlayer-js";

const account = createAccount();
const client = createClient({
chain: testnetAsimov,
chain: testnetBradbury,
account,
});

Expand Down Expand Up @@ -160,7 +160,7 @@ const delegateResult = await client.delegatorJoin({

* **Client Creation**: Easily create and configure a client to connect to GenLayer's network.
* **Transaction Handling**: Send and manage transactions on the GenLayer network.
* **Staking**: Full staking support for validators and delegators on testnet-asimov.
* **Staking**: Full staking support for validators and delegators on testnet-bradbury and testnet-asimov.
* **Wallet Integration***: Seamless integration with MetaMask for managing user accounts.
* **Gas Estimation***: Estimate gas fees for executing transactions on GenLayer.

Expand Down
1 change: 1 addition & 0 deletions src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
export {localnet} from "./localnet";
export {studionet} from "./studionet";
export {testnetAsimov} from "./testnetAsimov";
export {testnetBradbury} from "./testnetBradbury";
5 changes: 2 additions & 3 deletions src/chains/testnetAsimov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {GenLayerChain} from "@/types";
import {STAKING_ABI} from "@/abi/staking";

// chains/localnet.ts
const TESTNET_JSON_RPC_URL = "https://zksync-os-testnet-genlayer.zksync.dev";
const TESTNET_WS_URL = "wss://zksync-os-testnet-genlayer.zksync.dev/ws";
const TESTNET_JSON_RPC_URL = "http://34.12.136.220:9151";
// WebSocket not available on testnet GenLayer RPC nodes
Comment on lines 5 to +7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Stale comment: file path reference is incorrect.

Line 5 contains // chains/localnet.ts but this file is testnetAsimov.ts. This appears to be a copy-paste artifact.

✏️ Proposed fix
-// chains/localnet.ts
 const TESTNET_JSON_RPC_URL = "http://34.12.136.220:9151";
 // WebSocket not available on testnet GenLayer RPC nodes
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// chains/localnet.ts
const TESTNET_JSON_RPC_URL = "https://zksync-os-testnet-genlayer.zksync.dev";
const TESTNET_WS_URL = "wss://zksync-os-testnet-genlayer.zksync.dev/ws";
const TESTNET_JSON_RPC_URL = "http://34.12.136.220:9151";
// WebSocket not available on testnet GenLayer RPC nodes
const TESTNET_JSON_RPC_URL = "http://34.12.136.220:9151";
// WebSocket not available on testnet GenLayer RPC nodes
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/chains/testnetAsimov.ts` around lines 5 - 7, The inline comment "//
chains/localnet.ts" at the top of this file is a stale copy-paste and should be
removed or replaced with an accurate note; locate the TESTNET_JSON_RPC_URL
constant and update or delete the incorrect comment so the header reflects that
this is testnetAsimov (or remove the file-path comment entirely) to avoid
confusion.


const STAKING_CONTRACT = {
address: "0x63Fa5E0bb10fb6fA98F44726C5518223F767687A" as Address,
Expand Down Expand Up @@ -3990,7 +3990,6 @@ export const testnetAsimov: GenLayerChain = defineChain({
rpcUrls: {
default: {
http: [TESTNET_JSON_RPC_URL],
webSocket: [TESTNET_WS_URL],
},
},
nativeCurrency: {
Expand Down
Loading