-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
435 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
## [4.2.37] - 2024.7.23 | ||
|
||
### Added | ||
|
||
- Support for zkSync mainnet & testnet | ||
|
||
## [4.2.36] - 2024.7.18 | ||
|
||
### Added | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
|
||
import { EvmBasedRpcInterface, TxPayload } from './EvmBasedRpcInterface' | ||
import { JsonRpcResponse } from '../JsonRpcResponse.dto' | ||
import { BigNumber } from 'bignumber.js' | ||
import { AbstractRpcInterface } from './AbstractJsonRpcInterface' | ||
|
||
export interface BridgeContracts { | ||
l1Erc20DefaultBridge: string | ||
l2Erc20DefaultBridge: string | ||
l1WethBridge: string | ||
l2WethBridge: string | ||
} | ||
|
||
export interface TokenDetails { | ||
l1Address: string | ||
l2Address: string | ||
name: string | ||
symbol: string | ||
decimals: number | ||
} | ||
|
||
export interface TokenMapping { | ||
[key: string]: string | ||
} | ||
|
||
export interface ZksGetL2ToL1MsgProofParams { | ||
block: number | ||
sender: string | ||
msg: string | ||
l2_log_position?: string | ||
} | ||
|
||
export interface ZksGetL2ToL1ProofResponse { | ||
id: string | ||
proof: string[] | ||
root: string | ||
} | ||
|
||
export interface GetProofParams { | ||
data: string | ||
arrayOfData: string[] | ||
timePoint: number | ||
} | ||
|
||
export interface StorageProof { | ||
key: string; | ||
value: string; | ||
index: number; | ||
proof: string[]; | ||
} | ||
|
||
export interface GetProofResponse { | ||
address: string; | ||
storageProof: StorageProof[]; | ||
} | ||
|
||
export interface ZkSyncRpcSuite extends ZkSyncRpcInterface, AbstractRpcInterface {} | ||
|
||
export interface ZkSyncRpcInterface extends EvmBasedRpcInterface { | ||
zksEstimateFee(payload: TxPayload): Promise<JsonRpcResponse<any>> | ||
zksEstimateGasL1ToL2(payload: TxPayload): Promise<JsonRpcResponse<BigNumber>> | ||
zksGetBridgeHubContract(): Promise<JsonRpcResponse<string>> | ||
zksGetMinContract(): Promise<JsonRpcResponse<string>> | ||
zksGetBridgeContracts(): Promise<JsonRpcResponse<BridgeContracts>> | ||
zksL1ChainId(): Promise<JsonRpcResponse<BigNumber>> | ||
zksGetBaseTokenL1Address(): Promise<JsonRpcResponse<string>> | ||
zksGetConfirmedTokens(tokenIdToStart: number, maxTokens: number): Promise<JsonRpcResponse<TokenDetails[]>> | ||
zksGetAllAccountBalances(address: string): Promise<JsonRpcResponse<TokenMapping>> | ||
zksGetL2ToL1MsgProof(payload: ZksGetL2ToL1MsgProofParams): Promise<JsonRpcResponse<ZksGetL2ToL1ProofResponse>> | ||
zksGetL2ToL1LogProof(txHash: string, logIndex?: number): Promise<JsonRpcResponse<ZksGetL2ToL1ProofResponse>> | ||
zksL1BatchNumber(): Promise<JsonRpcResponse<BigNumber>> | ||
zksGetBlockDetails(blockNumber: number): Promise<JsonRpcResponse<any>> | ||
zksGetTransactionDetails(txHash: string): Promise<JsonRpcResponse<any>> | ||
zksGetRawBlockTransactions(blockNumber: number): Promise<JsonRpcResponse<any>> | ||
zksGetL1BatchDetails(batchNumber: number): Promise<JsonRpcResponse<any>> | ||
zksGetBytecodeByHash(txHash: string): Promise<JsonRpcResponse<number[]>> | ||
zksGetL1BatchBlockRange(batchNumber: number): Promise<JsonRpcResponse<string[]>> | ||
zksGetL1GasPrice(): Promise<JsonRpcResponse<BigNumber>> | ||
zksGetFeeParams(): Promise<JsonRpcResponse<any>> | ||
zksGetProtocolVersion(versionId?: number): Promise<JsonRpcResponse<any>> | ||
zksGetProof(payload: GetProofParams): Promise<JsonRpcResponse<GetProofResponse>> | ||
zksSendRawTransactionWithDetailedOutput(data: string): Promise<JsonRpcResponse<any>> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Network, ZkSync } from '../../../service' | ||
import { EvmE2eUtils } from './evm.e2e.utils' | ||
|
||
const run = async (network: Network, url: string) => { | ||
it('zks_getL1GasPrice', async () => { | ||
const tatum = await EvmE2eUtils.initTatum<ZkSync>(network, undefined, url) | ||
const { result } = await tatum.rpc.zksGetL1GasPrice() | ||
|
||
await tatum.destroy() | ||
expect(result).toBeDefined() | ||
}) | ||
|
||
it('zks_getBlockDetails', async () => { | ||
const tatum = await EvmE2eUtils.initTatum<ZkSync>(network, undefined, url) | ||
const { result } = await tatum.rpc.zksGetBlockDetails(39830202) | ||
|
||
await tatum.destroy() | ||
expect(result).toBeDefined() | ||
}) | ||
|
||
it('zks_getBaseTokenL1Address', async () => { | ||
const tatum = await EvmE2eUtils.initTatum<ZkSync>(network, undefined, url) | ||
const { result } = await tatum.rpc.zksGetBaseTokenL1Address() | ||
|
||
await tatum.destroy() | ||
expect(result).toBeDefined() | ||
}) | ||
|
||
it('zks_getFeeParams', async () => { | ||
const tatum = await EvmE2eUtils.initTatum<ZkSync>(network, undefined, url) | ||
const { result } = await tatum.rpc.zksGetFeeParams() | ||
|
||
await tatum.destroy() | ||
expect(result).toBeDefined() | ||
|
||
}) | ||
} | ||
|
||
describe.each([ | ||
{ network: Network.ZK_SYNC, url: 'https://mainnet.era.zksync.io' }, | ||
{ network: Network.ZK_SYNC_TESTNET, url: 'https://sepolia.era.zksync.dev'}, | ||
])('RPC ZkSync', (network) => { | ||
const { network: networkName, url } = network | ||
describe(networkName, () => { | ||
run(networkName, url) | ||
}) | ||
}) |
Oops, something went wrong.