@layerzerolabs/chain-utils 0.2.46 → 0.2.48

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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var _6ZQQF5PQ_cjs = require('./6ZQQF5PQ.cjs');
3
+ var QNFJ2P5R_cjs = require('./QNFJ2P5R.cjs');
4
4
  var KHVGLVR5_cjs = require('./KHVGLVR5.cjs');
5
5
  var bs58 = require('bs58');
6
6
  var tty = require('tty');
@@ -18120,7 +18120,7 @@ describe("addressParser - hex/EVM chains", () => {
18120
18120
  ];
18121
18121
  evmChains.forEach((chain) => {
18122
18122
  describe(chain, () => {
18123
- const parser = _6ZQQF5PQ_cjs.addressParser(chain);
18123
+ const parser = QNFJ2P5R_cjs.addressParser(chain);
18124
18124
  it("maintains roundtrip invariant: hex -> native -> hex", () => {
18125
18125
  runPropertyTest(() => {
18126
18126
  const input = randomHex(20);
@@ -18153,13 +18153,13 @@ describe("addressParser - hex/EVM chains", () => {
18153
18153
  runPropertyTest(() => {
18154
18154
  const byteLength = Math.floor(Math.random() * 32) + 1;
18155
18155
  const input = randomHex(byteLength);
18156
- const padded = _6ZQQF5PQ_cjs.addressParser.normalizedToBytes32Hex(input);
18156
+ const padded = QNFJ2P5R_cjs.addressParser.normalizedToBytes32Hex(input);
18157
18157
  globalExpect(padded.length).toBe(66);
18158
18158
  globalExpect(padded).toBe(commonEncodingUtils.hexZeroPad(input, 32));
18159
18159
  });
18160
18160
  });
18161
18161
  it("handles edge cases", () => {
18162
- const parser = _6ZQQF5PQ_cjs.addressParser(layerzeroDefinitions.ChainName.ETHEREUM);
18162
+ const parser = QNFJ2P5R_cjs.addressParser(layerzeroDefinitions.ChainName.ETHEREUM);
18163
18163
  const empty = commonChainModel.normalizeHex("0x");
18164
18164
  globalExpect(parser.normalizedToNative(empty).nativeAddress.length).toBe(42);
18165
18165
  const max = commonChainModel.normalizeHex("0x" + "ff".repeat(20));
@@ -18169,7 +18169,7 @@ describe("addressParser - hex/EVM chains", () => {
18169
18169
  });
18170
18170
  });
18171
18171
  describe("addressParser - base58 chains (Solana)", () => {
18172
- const parser = _6ZQQF5PQ_cjs.addressParser(layerzeroDefinitions.ChainName.SOLANA);
18172
+ const parser = QNFJ2P5R_cjs.addressParser(layerzeroDefinitions.ChainName.SOLANA);
18173
18173
  it("maintains roundtrip invariant: hex -> base58 -> hex", () => {
18174
18174
  runPropertyTest(() => {
18175
18175
  const byteLength = Math.floor(Math.random() * 32) + 1;
@@ -18212,15 +18212,15 @@ describe("addressParser - base58 chains (Solana)", () => {
18212
18212
  });
18213
18213
  describe("addressParser - chain validation", () => {
18214
18214
  it("validates chain names for nativeToBytes32Hex", () => {
18215
- const evmParser = _6ZQQF5PQ_cjs.addressParser(layerzeroDefinitions.ChainName.ETHEREUM);
18216
- const solanaParser = _6ZQQF5PQ_cjs.addressParser(layerzeroDefinitions.ChainName.SOLANA);
18215
+ const evmParser = QNFJ2P5R_cjs.addressParser(layerzeroDefinitions.ChainName.ETHEREUM);
18216
+ const solanaParser = QNFJ2P5R_cjs.addressParser(layerzeroDefinitions.ChainName.SOLANA);
18217
18217
  const evmAddress = evmParser.normalizedToNative(randomHex(20));
18218
18218
  const solanaAddress = solanaParser.normalizedToNative(randomHex(32));
18219
18219
  globalExpect(() => solanaParser.nativeToBytes32Hex(evmAddress)).toThrow(/Cannot convert/);
18220
18220
  globalExpect(() => evmParser.nativeToBytes32Hex(solanaAddress)).toThrow(/Cannot convert/);
18221
18221
  });
18222
18222
  it("accepts string addresses without validation", () => {
18223
- const parser = _6ZQQF5PQ_cjs.addressParser(layerzeroDefinitions.ChainName.ETHEREUM);
18223
+ const parser = QNFJ2P5R_cjs.addressParser(layerzeroDefinitions.ChainName.ETHEREUM);
18224
18224
  const randomAddress = "0x" + "ab".repeat(20);
18225
18225
  const result = parser.nativeToNormalized(randomAddress);
18226
18226
  globalExpect(result).toBe(commonChainModel.normalizeHex(randomAddress));
@@ -18231,7 +18231,7 @@ describe("addressParser - chain validation", () => {
18231
18231
  });
18232
18232
  });
18233
18233
  describe("addressParser - TON", () => {
18234
- const parser = _6ZQQF5PQ_cjs.addressParser(layerzeroDefinitions.ChainName.TON);
18234
+ const parser = QNFJ2P5R_cjs.addressParser(layerzeroDefinitions.ChainName.TON);
18235
18235
  it("maintains roundtrip invariant: hex -> ton address -> hex", () => {
18236
18236
  runPropertyTest(() => {
18237
18237
  const byteLength = Math.floor(Math.random() * 32) + 1;
@@ -18292,7 +18292,7 @@ describe("addressParser - TON", () => {
18292
18292
  });
18293
18293
  });
18294
18294
  describe("addressParser - Stellar", () => {
18295
- const parser = _6ZQQF5PQ_cjs.addressParser(layerzeroDefinitions.ChainName.STELLAR);
18295
+ const parser = QNFJ2P5R_cjs.addressParser(layerzeroDefinitions.ChainName.STELLAR);
18296
18296
  const validTestAddresses = {
18297
18297
  // Account address (G...)
18298
18298
  account: "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ",