@venusprotocol/chains 0.14.0 → 0.16.0

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.
Files changed (2) hide show
  1. package/build/index.mjs +35 -35
  2. package/package.json +2 -2
package/build/index.mjs CHANGED
@@ -436,7 +436,7 @@ const encoder = /* @__PURE__ */ new TextEncoder();
436
436
  * const data = toBytes(420, { size: 4 })
437
437
  * // Uint8Array([0, 0, 1, 164])
438
438
  */
439
- function toBytes(value, opts = {}) {
439
+ function toBytes$1(value, opts = {}) {
440
440
  if (typeof value === "number" || typeof value === "bigint") return numberToBytes(value, opts);
441
441
  if (typeof value === "boolean") return boolToBytes(value, opts);
442
442
  if (isHex(value)) return hexToBytes(value, opts);
@@ -1501,7 +1501,7 @@ function utf8ToBytes(str) {
1501
1501
  * Warning: when Uint8Array is passed, it would NOT get copied.
1502
1502
  * Keep in mind for future mutable operations.
1503
1503
  */
1504
- function toBytes$1(data) {
1504
+ function toBytes(data) {
1505
1505
  if (typeof data === "string") data = utf8ToBytes(data);
1506
1506
  abytes(data);
1507
1507
  return data;
@@ -1510,7 +1510,7 @@ function toBytes$1(data) {
1510
1510
  var Hash = class {};
1511
1511
  /** Wraps hash function, creating an interface on top of it */
1512
1512
  function createHasher(hashCons) {
1513
- const hashC = (msg) => hashCons().update(toBytes$1(msg)).digest();
1513
+ const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
1514
1514
  const tmp = hashCons();
1515
1515
  hashC.outputLen = tmp.outputLen;
1516
1516
  hashC.blockLen = tmp.blockLen;
@@ -1564,7 +1564,7 @@ var HashMD = class extends Hash {
1564
1564
  }
1565
1565
  update(data) {
1566
1566
  aexists(this);
1567
- data = toBytes$1(data);
1567
+ data = toBytes(data);
1568
1568
  abytes(data);
1569
1569
  const { view, buffer, blockLen } = this;
1570
1570
  const len = data.length;
@@ -1866,7 +1866,7 @@ const sha256$1 = sha256$2;
1866
1866
  //#region ../../node_modules/viem/_esm/utils/hash/sha256.js
1867
1867
  function sha256(value, to_) {
1868
1868
  const to = to_ || "hex";
1869
- const bytes = sha256$1(isHex(value, { strict: false }) ? toBytes(value) : value);
1869
+ const bytes = sha256$1(isHex(value, { strict: false }) ? toBytes$1(value) : value);
1870
1870
  if (to === "bytes") return bytes;
1871
1871
  return toHex(bytes);
1872
1872
  }
@@ -2413,7 +2413,7 @@ var Keccak = class Keccak extends Hash {
2413
2413
  }
2414
2414
  update(data) {
2415
2415
  aexists(this);
2416
- data = toBytes$1(data);
2416
+ data = toBytes(data);
2417
2417
  abytes(data);
2418
2418
  const { blockLen, state } = this;
2419
2419
  const len = data.length;
@@ -2493,7 +2493,7 @@ const keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
2493
2493
  //#region ../../node_modules/viem/_esm/utils/hash/keccak256.js
2494
2494
  function keccak256(value, to_) {
2495
2495
  const to = to_ || "hex";
2496
- const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);
2496
+ const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes$1(value) : value);
2497
2497
  if (to === "bytes") return bytes;
2498
2498
  return toHex(bytes);
2499
2499
  }
@@ -2674,7 +2674,7 @@ function serializeAccessList(accessList) {
2674
2674
 
2675
2675
  //#endregion
2676
2676
  //#region ../../node_modules/viem/_esm/utils/transaction/serializeTransaction.js
2677
- function serializeTransaction(transaction, signature) {
2677
+ function serializeTransaction$2(transaction, signature) {
2678
2678
  const type = getTransactionType(transaction);
2679
2679
  if (type === "eip1559") return serializeTransactionEIP1559(transaction, signature);
2680
2680
  if (type === "eip2930") return serializeTransactionEIP2930(transaction, signature);
@@ -2883,11 +2883,11 @@ function assertEip712Transaction(transaction) {
2883
2883
 
2884
2884
  //#endregion
2885
2885
  //#region ../../node_modules/viem/_esm/zksync/serializers.js
2886
- function serializeTransaction$2(transaction, signature) {
2886
+ function serializeTransaction$1(transaction, signature) {
2887
2887
  if (isEIP712Transaction(transaction)) return serializeTransactionEIP712(transaction);
2888
- return serializeTransaction(transaction, signature);
2888
+ return serializeTransaction$2(transaction, signature);
2889
2889
  }
2890
- const serializers$1 = { transaction: serializeTransaction$2 };
2890
+ const serializers$1 = { transaction: serializeTransaction$1 };
2891
2891
  function serializeTransactionEIP712(transaction) {
2892
2892
  const { chainId, gas, nonce, to, from, value, maxFeePerGas, maxPriorityFeePerGas, customSignature, factoryDeps, paymaster, paymasterInput, gasPerPubdata, data } = transaction;
2893
2893
  assertEip712Transaction(transaction);
@@ -2932,16 +2932,16 @@ var BytecodeLengthMustBeDivisibleBy32Error = class extends BaseError {
2932
2932
  //#endregion
2933
2933
  //#region ../../node_modules/viem/_esm/zksync/utils/hashBytecode.js
2934
2934
  function hashBytecode(bytecode) {
2935
- const bytecodeBytes = toBytes(bytecode);
2935
+ const bytecodeBytes = toBytes$1(bytecode);
2936
2936
  if (bytecodeBytes.length % 32 !== 0) throw new BytecodeLengthMustBeDivisibleBy32Error({ givenLength: bytecodeBytes.length });
2937
2937
  if (bytecodeBytes.length > maxBytecodeSize) throw new BytecodeLengthExceedsMaxSizeError({
2938
2938
  givenLength: bytecodeBytes.length,
2939
2939
  maxBytecodeSize
2940
2940
  });
2941
- const hash = toBytes(sha256(bytecodeBytes));
2941
+ const hash = toBytes$1(sha256(bytecodeBytes));
2942
2942
  const bytecodeLengthInWords = bytecodeBytes.length / 32;
2943
2943
  if (bytecodeLengthInWords % 2 === 0) throw new BytecodeLengthInWordsMustBeOddError({ givenLengthInWords: bytecodeLengthInWords });
2944
- const bytecodeLengthPadded = pad(toBytes(bytecodeLengthInWords), { size: 2 });
2944
+ const bytecodeLengthPadded = pad(toBytes$1(bytecodeLengthInWords), { size: 2 });
2945
2945
  const codeHashVersion = new Uint8Array([1, 0]);
2946
2946
  hash.set(codeHashVersion, 0);
2947
2947
  hash.set(bytecodeLengthPadded, 2);
@@ -3038,7 +3038,7 @@ function transactionToMessage(transaction) {
3038
3038
 
3039
3039
  //#endregion
3040
3040
  //#region ../../node_modules/viem/_esm/zksync/chainConfig.js
3041
- const chainConfig = {
3041
+ const chainConfig$1 = {
3042
3042
  blockTime: 1e3,
3043
3043
  formatters: formatters$1,
3044
3044
  serializers: serializers$1,
@@ -3101,11 +3101,11 @@ const formatters = {
3101
3101
 
3102
3102
  //#endregion
3103
3103
  //#region ../../node_modules/viem/_esm/op-stack/serializers.js
3104
- function serializeTransaction$1(transaction, signature) {
3104
+ function serializeTransaction(transaction, signature) {
3105
3105
  if (isDeposit(transaction)) return serializeTransactionDeposit(transaction);
3106
- return serializeTransaction(transaction, signature);
3106
+ return serializeTransaction$2(transaction, signature);
3107
3107
  }
3108
- const serializers = { transaction: serializeTransaction$1 };
3108
+ const serializers = { transaction: serializeTransaction };
3109
3109
  function serializeTransactionDeposit(transaction) {
3110
3110
  assertTransactionDeposit(transaction);
3111
3111
  const { sourceHash, data, from, gas, isSystemTx, mint, to, value } = transaction;
@@ -3133,7 +3133,7 @@ function assertTransactionDeposit(transaction) {
3133
3133
 
3134
3134
  //#endregion
3135
3135
  //#region ../../node_modules/viem/_esm/op-stack/chainConfig.js
3136
- const chainConfig$1 = {
3136
+ const chainConfig = {
3137
3137
  blockTime: 2e3,
3138
3138
  contracts,
3139
3139
  formatters,
@@ -3191,7 +3191,7 @@ const arbitrumSepolia$2 = /* @__PURE__ */ defineChain({
3191
3191
  //#region ../../node_modules/viem/_esm/chains/definitions/base.js
3192
3192
  const sourceId$7 = 1;
3193
3193
  const base = /* @__PURE__ */ defineChain({
3194
- ...chainConfig$1,
3194
+ ...chainConfig,
3195
3195
  id: 8453,
3196
3196
  name: "Base",
3197
3197
  nativeCurrency: {
@@ -3206,7 +3206,7 @@ const base = /* @__PURE__ */ defineChain({
3206
3206
  apiUrl: "https://api.basescan.org/api"
3207
3207
  } },
3208
3208
  contracts: {
3209
- ...chainConfig$1.contracts,
3209
+ ...chainConfig.contracts,
3210
3210
  disputeGameFactory: { [sourceId$7]: { address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e" } },
3211
3211
  l2OutputOracle: { [sourceId$7]: { address: "0x56315b90c40730925ec5485cf004d835058518A0" } },
3212
3212
  multicall3: {
@@ -3234,7 +3234,7 @@ const basePreconf = /* @__PURE__ */ defineChain({
3234
3234
  //#region ../../node_modules/viem/_esm/chains/definitions/baseSepolia.js
3235
3235
  const sourceId$6 = 11155111;
3236
3236
  const baseSepolia$2 = /* @__PURE__ */ defineChain({
3237
- ...chainConfig$1,
3237
+ ...chainConfig,
3238
3238
  id: 84532,
3239
3239
  network: "base-sepolia",
3240
3240
  name: "Base Sepolia",
@@ -3250,7 +3250,7 @@ const baseSepolia$2 = /* @__PURE__ */ defineChain({
3250
3250
  apiUrl: "https://api-sepolia.basescan.org/api"
3251
3251
  } },
3252
3252
  contracts: {
3253
- ...chainConfig$1.contracts,
3253
+ ...chainConfig.contracts,
3254
3254
  disputeGameFactory: { [sourceId$6]: { address: "0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1" } },
3255
3255
  l2OutputOracle: { [sourceId$6]: { address: "0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254" } },
3256
3256
  portal: { [sourceId$6]: {
@@ -3368,7 +3368,7 @@ const opBNB = /* @__PURE__ */ defineChain({
3368
3368
  apiUrl: "https://api-opbnb.bscscan.com/api"
3369
3369
  } },
3370
3370
  contracts: {
3371
- ...chainConfig$1.contracts,
3371
+ ...chainConfig.contracts,
3372
3372
  multicall3: {
3373
3373
  address: "0xcA11bde05977b3631167028862bE2a173976CA11",
3374
3374
  blockCreated: 512881
@@ -3397,7 +3397,7 @@ const opBNBTestnet = /* @__PURE__ */ defineChain({
3397
3397
  url: "https://testnet.opbnbscan.com"
3398
3398
  } },
3399
3399
  contracts: {
3400
- ...chainConfig$1.contracts,
3400
+ ...chainConfig.contracts,
3401
3401
  multicall3: {
3402
3402
  address: "0xcA11bde05977b3631167028862bE2a173976CA11",
3403
3403
  blockCreated: 3705108
@@ -3414,7 +3414,7 @@ const opBNBTestnet = /* @__PURE__ */ defineChain({
3414
3414
  //#region ../../node_modules/viem/_esm/chains/definitions/optimism.js
3415
3415
  const sourceId$3 = 1;
3416
3416
  const optimism = /* @__PURE__ */ defineChain({
3417
- ...chainConfig$1,
3417
+ ...chainConfig,
3418
3418
  id: 10,
3419
3419
  name: "OP Mainnet",
3420
3420
  nativeCurrency: {
@@ -3429,7 +3429,7 @@ const optimism = /* @__PURE__ */ defineChain({
3429
3429
  apiUrl: "https://api-optimistic.etherscan.io/api"
3430
3430
  } },
3431
3431
  contracts: {
3432
- ...chainConfig$1.contracts,
3432
+ ...chainConfig.contracts,
3433
3433
  disputeGameFactory: { [sourceId$3]: { address: "0xe5965Ab5962eDc7477C8520243A95517CD252fA9" } },
3434
3434
  l2OutputOracle: { [sourceId$3]: { address: "0xdfe97868233d1aa22e815a266982f2cf17685a27" } },
3435
3435
  multicall3: {
@@ -3446,7 +3446,7 @@ const optimism = /* @__PURE__ */ defineChain({
3446
3446
  //#region ../../node_modules/viem/_esm/chains/definitions/optimismSepolia.js
3447
3447
  const sourceId$2 = 11155111;
3448
3448
  const optimismSepolia$2 = /* @__PURE__ */ defineChain({
3449
- ...chainConfig$1,
3449
+ ...chainConfig,
3450
3450
  id: 11155420,
3451
3451
  name: "OP Sepolia",
3452
3452
  nativeCurrency: {
@@ -3461,7 +3461,7 @@ const optimismSepolia$2 = /* @__PURE__ */ defineChain({
3461
3461
  apiUrl: "https://optimism-sepolia.blockscout.com/api"
3462
3462
  } },
3463
3463
  contracts: {
3464
- ...chainConfig$1.contracts,
3464
+ ...chainConfig.contracts,
3465
3465
  disputeGameFactory: { [sourceId$2]: { address: "0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1" } },
3466
3466
  l2OutputOracle: { [sourceId$2]: { address: "0x90E9c4f8a994a250F6aEfd61CAFb4F2e895D458F" } },
3467
3467
  multicall3: {
@@ -3508,7 +3508,7 @@ const sepolia$2 = /* @__PURE__ */ defineChain({
3508
3508
  //#region ../../node_modules/viem/_esm/chains/definitions/unichain.js
3509
3509
  const sourceId$1 = 1;
3510
3510
  const unichain = /* @__PURE__ */ defineChain({
3511
- ...chainConfig$1,
3511
+ ...chainConfig,
3512
3512
  id: 130,
3513
3513
  name: "Unichain",
3514
3514
  nativeCurrency: {
@@ -3524,7 +3524,7 @@ const unichain = /* @__PURE__ */ defineChain({
3524
3524
  apiUrl: "https://api.uniscan.xyz/api"
3525
3525
  } },
3526
3526
  contracts: {
3527
- ...chainConfig$1.contracts,
3527
+ ...chainConfig.contracts,
3528
3528
  multicall3: {
3529
3529
  address: "0xca11bde05977b3631167028862be2a173976ca11",
3530
3530
  blockCreated: 0
@@ -3540,7 +3540,7 @@ const unichain = /* @__PURE__ */ defineChain({
3540
3540
  //#region ../../node_modules/viem/_esm/chains/definitions/unichainSepolia.js
3541
3541
  const sourceId = 11155111;
3542
3542
  const unichainSepolia$2 = /* @__PURE__ */ defineChain({
3543
- ...chainConfig$1,
3543
+ ...chainConfig,
3544
3544
  id: 1301,
3545
3545
  name: "Unichain Sepolia",
3546
3546
  nativeCurrency: {
@@ -3556,7 +3556,7 @@ const unichainSepolia$2 = /* @__PURE__ */ defineChain({
3556
3556
  apiUrl: "https://api-sepolia.uniscan.xyz/api"
3557
3557
  } },
3558
3558
  contracts: {
3559
- ...chainConfig$1.contracts,
3559
+ ...chainConfig.contracts,
3560
3560
  multicall3: {
3561
3561
  address: "0xca11bde05977b3631167028862be2a173976ca11",
3562
3562
  blockCreated: 0
@@ -3572,7 +3572,7 @@ const unichainSepolia$2 = /* @__PURE__ */ defineChain({
3572
3572
  //#endregion
3573
3573
  //#region ../../node_modules/viem/_esm/chains/definitions/zksync.js
3574
3574
  const zksync = /* @__PURE__ */ defineChain({
3575
- ...chainConfig,
3575
+ ...chainConfig$1,
3576
3576
  blockTime: 200,
3577
3577
  id: 324,
3578
3578
  name: "ZKsync Era",
@@ -3610,7 +3610,7 @@ const zksync = /* @__PURE__ */ defineChain({
3610
3610
  //#endregion
3611
3611
  //#region ../../node_modules/viem/_esm/chains/definitions/zksyncSepoliaTestnet.js
3612
3612
  const zksyncSepoliaTestnet = /* @__PURE__ */ defineChain({
3613
- ...chainConfig,
3613
+ ...chainConfig$1,
3614
3614
  blockTime: 200,
3615
3615
  id: 300,
3616
3616
  name: "ZKsync Sepolia Testnet",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venusprotocol/chains",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -48,7 +48,7 @@
48
48
  "npm-run-all": "^4.1.5",
49
49
  "react": "^19.2.0",
50
50
  "rimraf": "^6.0.1",
51
- "tsdown": "^0.16.5",
51
+ "tsdown": "^0.18.0",
52
52
  "tsx": "^4.20.5",
53
53
  "viem": "^2.23.1",
54
54
  "vitest": "^3.2.4"