@matterlabs/zksync-js 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/ethers/client.cjs.map +1 -1
- package/dist/adapters/ethers/client.js +1 -1
- package/dist/adapters/ethers/index.cjs +391 -170
- package/dist/adapters/ethers/index.cjs.map +1 -1
- package/dist/adapters/ethers/index.d.ts +1 -0
- package/dist/adapters/ethers/index.js +4 -4
- package/dist/adapters/ethers/resources/contracts/contracts.d.ts +9 -0
- package/dist/adapters/ethers/resources/contracts/index.d.ts +2 -0
- package/dist/adapters/ethers/resources/contracts/types.d.ts +60 -0
- package/dist/adapters/ethers/resources/deposits/context.d.ts +16 -2
- package/dist/adapters/ethers/resources/deposits/index.d.ts +3 -1
- package/dist/adapters/ethers/resources/deposits/services/gas.d.ts +3 -2
- package/dist/adapters/ethers/resources/tokens/index.d.ts +1 -0
- package/dist/adapters/ethers/resources/tokens/tokens.d.ts +10 -0
- package/dist/adapters/ethers/resources/utils.d.ts +0 -3
- package/dist/adapters/ethers/resources/withdrawals/context.d.ts +11 -3
- package/dist/adapters/ethers/resources/withdrawals/index.d.ts +3 -1
- package/dist/adapters/ethers/sdk.cjs +386 -154
- package/dist/adapters/ethers/sdk.cjs.map +1 -1
- package/dist/adapters/ethers/sdk.d.ts +5 -22
- package/dist/adapters/ethers/sdk.js +3 -3
- package/dist/adapters/viem/client.cjs.map +1 -1
- package/dist/adapters/viem/index.cjs +383 -176
- package/dist/adapters/viem/index.cjs.map +1 -1
- package/dist/adapters/viem/index.d.ts +3 -0
- package/dist/adapters/viem/index.js +4 -4
- package/dist/adapters/viem/resources/contracts/contracts.d.ts +9 -0
- package/dist/adapters/viem/resources/contracts/index.d.ts +2 -0
- package/dist/adapters/viem/resources/contracts/types.d.ts +61 -0
- package/dist/adapters/viem/resources/deposits/context.d.ts +16 -2
- package/dist/adapters/viem/resources/deposits/index.d.ts +3 -1
- package/dist/adapters/viem/resources/deposits/services/gas.d.ts +2 -1
- package/dist/adapters/viem/resources/tokens/index.d.ts +1 -0
- package/dist/adapters/viem/resources/tokens/tokens.d.ts +3 -0
- package/dist/adapters/viem/resources/utils.d.ts +0 -3
- package/dist/adapters/viem/resources/withdrawals/context.d.ts +11 -3
- package/dist/adapters/viem/resources/withdrawals/index.d.ts +3 -1
- package/dist/adapters/viem/sdk.cjs +401 -189
- package/dist/adapters/viem/sdk.cjs.map +1 -1
- package/dist/adapters/viem/sdk.d.ts +5 -25
- package/dist/adapters/viem/sdk.js +3 -3
- package/dist/{chunk-BCCKWWOX.js → chunk-5YWP4CZP.js} +373 -158
- package/dist/{chunk-OC6ZVLSP.js → chunk-JXUFGIJG.js} +348 -150
- package/dist/{chunk-QJS6ETEE.js → chunk-LL3WKCFJ.js} +15 -1
- package/dist/{chunk-HLUANWGN.js → chunk-NEC2ZKHI.js} +4 -12
- package/dist/chunk-NTEIA5KA.js +13 -0
- package/dist/core/codec/ntv.d.ts +48 -0
- package/dist/core/index.cjs +4 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +2 -1
- package/dist/core/types/errors.d.ts +1 -1
- package/dist/core/types/flows/token.d.ts +192 -0
- package/dist/core/utils/addr.d.ts +2 -0
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/package.json +1 -1
- package/dist/adapters/ethers/resources/token-info.d.ts +0 -31
- package/dist/adapters/viem/resources/token-info.d.ts +0 -34
package/dist/index.d.ts
CHANGED
|
@@ -16,4 +16,5 @@ export type * from './core/types/flows/base';
|
|
|
16
16
|
export type * from './core/types/flows/deposits';
|
|
17
17
|
export type * from './core/types/flows/withdrawals';
|
|
18
18
|
export type * from './core/types/flows/route';
|
|
19
|
+
export type * from './core/types/flows/token';
|
|
19
20
|
export type * from './core/types/primitives';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { pickDepositRoute } from './chunk-NTEIA5KA.js';
|
|
2
|
+
export { findL1MessageSentLog, hexEq, isAddressEq, isETH, isHash66, messengerLogIndex, normalizeAddrEq, normalizeL1Token, pickWithdrawRoute } from './chunk-NEC2ZKHI.js';
|
|
2
3
|
export { makeTransportFromEthers, makeTransportFromViem, zks_exports as zksRpc } from './chunk-6K6VJQAL.js';
|
|
3
4
|
export { abi_exports as abi, factory_exports as errors, formatEnvelopePretty } from './chunk-M5J2MM2U.js';
|
|
4
5
|
export { constants_exports as constants } from './chunk-F2ENUV3A.js';
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type Provider } from 'ethers';
|
|
2
|
-
import type { Address } from '../../../core/types/primitives';
|
|
3
|
-
/**
|
|
4
|
-
* Read the `BASE_TOKEN_ASSET_ID` from the L2 NativeTokenVault.
|
|
5
|
-
* This is the encoded assetId of the chain’s base token.
|
|
6
|
-
*/
|
|
7
|
-
export declare function ntvBaseAssetId(l2: Provider, ntv: Address): Promise<`0x${string}`>;
|
|
8
|
-
/**
|
|
9
|
-
* Read the `L1_CHAIN_ID` that the L2 NativeTokenVault is anchored to.
|
|
10
|
-
* Needed when encoding asset IDs.
|
|
11
|
-
*/
|
|
12
|
-
export declare function ntvL1ChainId(l2: Provider, ntv: Address): Promise<bigint>;
|
|
13
|
-
/**
|
|
14
|
-
* Ensure a token is registered in the L2 NativeTokenVault and return its assetId.
|
|
15
|
-
* (Will register on-chain if not yet registered.)
|
|
16
|
-
*/
|
|
17
|
-
export declare function ntvAssetIdForToken(l2: Provider, ntv: Address, token: Address): Promise<`0x${string}`>;
|
|
18
|
-
/**
|
|
19
|
-
* Check if the chain is ETH-based (i.e. base token == ETH).
|
|
20
|
-
*/
|
|
21
|
-
export declare function isEthBasedChain(l2: Provider, ntv: Address): Promise<boolean>;
|
|
22
|
-
/**
|
|
23
|
-
* Check if a given token address is the chain’s base token.
|
|
24
|
-
*/
|
|
25
|
-
export declare function isBaseToken(l2: Provider, ntv: Address, token: Address): Promise<boolean>;
|
|
26
|
-
/**
|
|
27
|
-
* Check if the token should be treated as "ETH" on this L2.
|
|
28
|
-
* - If it equals the universal ETH alias (0x…800A), return true immediately.
|
|
29
|
-
* - Else compare the token’s assetId to the ETH sentinel assetId via the NTV.
|
|
30
|
-
*/
|
|
31
|
-
export declare function isEthTokenOnThisChain(l2: Provider, ntv: Address, token: Address): Promise<boolean>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { PublicClient } from 'viem';
|
|
2
|
-
export type L2Reader = {
|
|
3
|
-
readContract: PublicClient['readContract'];
|
|
4
|
-
};
|
|
5
|
-
import type { Address } from '../../../core/types/primitives';
|
|
6
|
-
/**
|
|
7
|
-
* Read the `BASE_TOKEN_ASSET_ID` from the L2 NativeTokenVault.
|
|
8
|
-
* This is the encoded assetId of the chain’s base token.
|
|
9
|
-
*/
|
|
10
|
-
export declare function ntvBaseAssetId(l2: L2Reader, ntv: Address): Promise<`0x${string}`>;
|
|
11
|
-
/**
|
|
12
|
-
* Read the `L1_CHAIN_ID` that the L2 NativeTokenVault is anchored to.
|
|
13
|
-
* Needed when encoding asset IDs.
|
|
14
|
-
*/
|
|
15
|
-
export declare function ntvL1ChainId(l2: L2Reader, ntv: Address): Promise<bigint>;
|
|
16
|
-
/**
|
|
17
|
-
* Ensure a token is registered in the L2 NativeTokenVault and return its assetId.
|
|
18
|
-
* (Will register on-chain if not yet registered.)
|
|
19
|
-
*/
|
|
20
|
-
export declare function ntvAssetIdForToken(l2: L2Reader, ntv: Address, token: Address): Promise<`0x${string}`>;
|
|
21
|
-
/**
|
|
22
|
-
* Check if the chain is ETH-based (i.e. base token == ETH).
|
|
23
|
-
*/
|
|
24
|
-
export declare function isEthBasedChain(l2: L2Reader, ntv: Address): Promise<boolean>;
|
|
25
|
-
/**
|
|
26
|
-
* Check if a given token address is the chain’s base token.
|
|
27
|
-
*/
|
|
28
|
-
export declare function isBaseToken(l2: L2Reader, ntv: Address, token: Address): Promise<boolean>;
|
|
29
|
-
/**
|
|
30
|
-
* Check if the token should be treated as "ETH" on this L2.
|
|
31
|
-
* - If it equals the universal ETH alias (0x…800A), return true immediately.
|
|
32
|
-
* - Else compare the token’s assetId to the ETH sentinel assetId via the NTV.
|
|
33
|
-
*/
|
|
34
|
-
export declare function isEthTokenOnThisChain(l2: L2Reader, ntv: Address, token: Address): Promise<boolean>;
|