@layerzerolabs/common-chain-model 0.0.45 → 0.0.47

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.
@@ -10,37 +10,37 @@
10
10
  CLI Cleaning output folder
11
11
  CJS Build start
12
12
  ESM Build start
13
- ESM dist/address.js 284.00 B
14
- ESM dist/bigint.js 194.00 B
15
- ESM dist/index.js 627.00 B
16
- ESM dist/CIKWECQO.js 1.44 KB
17
- ESM dist/RINNGVQR.js 585.00 B
13
+ CJS dist/address.cjs 702.00 B
14
+ CJS dist/bigint.cjs 441.00 B
15
+ CJS dist/index.cjs 2.26 KB
16
+ CJS dist/OBNNMNND.cjs 1.18 KB
17
+ CJS dist/transaction.cjs 1.38 KB
18
+ CJS dist/F6WBSSER.cjs 2.53 KB
19
+ CJS dist/YJF4D23A.cjs 245.00 B
20
+ CJS dist/2J25PZ2O.cjs 1.31 KB
21
+ CJS dist/address.cjs.map 72.00 B
22
+ CJS dist/bigint.cjs.map 71.00 B
23
+ CJS dist/index.cjs.map 70.00 B
24
+ CJS dist/OBNNMNND.cjs.map 2.66 KB
25
+ CJS dist/YJF4D23A.cjs.map 73.00 B
26
+ CJS dist/transaction.cjs.map 76.00 B
27
+ CJS dist/2J25PZ2O.cjs.map 2.47 KB
28
+ CJS dist/F6WBSSER.cjs.map 4.41 KB
29
+ CJS ⚡️ Build success in 128ms
30
+ ESM dist/address.js 192.00 B
31
+ ESM dist/bigint.js 161.00 B
32
+ ESM dist/DOZD76P7.js 916.00 B
33
+ ESM dist/index.js 502.00 B
34
+ ESM dist/4K6BY5DZ.js 1.07 KB
18
35
  ESM dist/transaction.js 349.00 B
19
- ESM dist/VUOMXK5T.js 222.00 B
20
36
  ESM dist/3YWFRX2K.js 1.65 KB
37
+ ESM dist/VUOMXK5T.js 222.00 B
38
+ ESM dist/address.js.map 71.00 B
21
39
  ESM dist/bigint.js.map 70.00 B
40
+ ESM dist/DOZD76P7.js.map 2.66 KB
22
41
  ESM dist/index.js.map 69.00 B
23
- ESM dist/address.js.map 71.00 B
24
- ESM dist/CIKWECQO.js.map 3.82 KB
25
- ESM dist/RINNGVQR.js.map 1.13 KB
42
+ ESM dist/4K6BY5DZ.js.map 2.46 KB
26
43
  ESM dist/transaction.js.map 75.00 B
27
- ESM dist/VUOMXK5T.js.map 72.00 B
28
44
  ESM dist/3YWFRX2K.js.map 4.38 KB
29
- ESM ⚡️ Build success in 177ms
30
- CJS dist/address.cjs 1.26 KB
31
- CJS dist/index.cjs 3.00 KB
32
- CJS dist/bigint.cjs 606.00 B
33
- CJS dist/transaction.cjs 1.38 KB
34
- CJS dist/QYHNWZK7.cjs 1.91 KB
35
- CJS dist/DTYQULT4.cjs 871.00 B
36
- CJS dist/YJF4D23A.cjs 245.00 B
37
- CJS dist/F6WBSSER.cjs 2.53 KB
38
- CJS dist/transaction.cjs.map 76.00 B
39
- CJS dist/index.cjs.map 70.00 B
40
- CJS dist/QYHNWZK7.cjs.map 3.84 KB
41
- CJS dist/YJF4D23A.cjs.map 73.00 B
42
- CJS dist/DTYQULT4.cjs.map 1.14 KB
43
- CJS dist/bigint.cjs.map 71.00 B
44
- CJS dist/F6WBSSER.cjs.map 4.41 KB
45
- CJS dist/address.cjs.map 72.00 B
46
- CJS ⚡️ Build success in 179ms
45
+ ESM dist/VUOMXK5T.js.map 72.00 B
46
+ ESM ⚡️ Build success in 128ms
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ var YJF4D23A_cjs = require('./YJF4D23A.cjs');
4
+ var z = require('zod/v4');
5
+
6
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
+
8
+ var z__default = /*#__PURE__*/_interopDefault(z);
9
+
10
+ var decimalStringSchema = z__default.default.string().refine((data) => {
11
+ return (
12
+ // must be string
13
+ typeof data === "string" && // must contain only digits, non-empty, can be negative
14
+ data.match(/^-?\d+$/) !== null && // must not start with 0 unless it's 0
15
+ !(data[0] === "0" && data.length > 1) && // allow -0, but still cant have multiple leading 0s
16
+ !(data.startsWith("-0") && data.length > 2)
17
+ );
18
+ });
19
+ var decimalString = {
20
+ parse: /* @__PURE__ */ YJF4D23A_cjs.__name((data) => {
21
+ if (typeof data === "bigint") {
22
+ return data.toString();
23
+ }
24
+ if (typeof data === "string") {
25
+ if (data.match(/^\d+$/) === null) {
26
+ throw new Error(`decimalString doesn't contain only digits: ${data}`);
27
+ }
28
+ return BigInt(data).toString();
29
+ }
30
+ throw new Error(`Invalid data: ${data}`);
31
+ }, "parse"),
32
+ toBigInt: /* @__PURE__ */ YJF4D23A_cjs.__name((data) => {
33
+ return BigInt(data);
34
+ }, "toBigInt")
35
+ };
36
+
37
+ exports.decimalString = decimalString;
38
+ exports.decimalStringSchema = decimalStringSchema;
39
+ //# sourceMappingURL=2J25PZ2O.cjs.map
40
+ //# sourceMappingURL=2J25PZ2O.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/bigint.ts"],"names":["decimalStringSchema","z","string","refine","data","match","length","startsWith","decimalString","parse","toString","Error","BigInt","toBigInt"],"mappings":";;;;;;;;;AAMO,IAAMA,sBAAsBC,kBAAAA,CAAEC,MAAAA,EAAM,CAAGC,MAAAA,CAAO,CAACC,IAAAA,KAAAA;AAClD,EAAA;;AAEI,IAAA,OAAOA,IAAAA,KAAS,QAAA;IAEhBA,IAAAA,CAAKC,KAAAA,CAAM,SAAA,CAAA,KAAe,IAAA;AAE1B,IAAA,EAAED,IAAAA,CAAK,CAAA,CAAA,KAAO,GAAA,IAAOA,KAAKE,MAAAA,GAAS,CAAA,CAAA;AAEnC,IAAA,EAAEF,IAAAA,CAAKG,UAAAA,CAAW,IAAA,CAAA,IAASH,KAAKE,MAAAA,GAAS,CAAA;;AAEjD,CAAA;AAEO,IAAME,aAAAA,GAAgB;AACzBC,EAAAA,KAAAA,uCAAQL,IAAAA,KAAAA;AACJ,IAAA,IAAI,OAAOA,SAAS,QAAA,EAAU;AAC1B,MAAA,OAAOA,KAAKM,QAAAA,EAAQ;AACxB,IAAA;AACA,IAAA,IAAI,OAAON,SAAS,QAAA,EAAU;AAC1B,MAAA,IAAIA,IAAAA,CAAKC,KAAAA,CAAM,OAAA,CAAA,KAAa,IAAA,EAAM;AAC9B,QAAA,MAAM,IAAIM,KAAAA,CAAM,CAAA,2CAAA,EAA8CP,IAAAA,CAAAA,CAAM,CAAA;AACxE,MAAA;AAEA,MAAA,OAAOQ,MAAAA,CAAOR,IAAAA,CAAAA,CAAMM,QAAAA,EAAQ;AAChC,IAAA;AACA,IAAA,MAAM,IAAIC,KAAAA,CAAM,CAAA,cAAA,EAAiBP,IAAAA,CAAAA,CAAM,CAAA;EAC3C,CAAA,EAZO,OAAA,CAAA;AAcPS,EAAAA,QAAAA,uCAAWT,IAAAA,KAAAA;AACP,IAAA,OAAOQ,OAAOR,IAAAA,CAAAA;EAClB,CAAA,EAFU,UAAA;AAGd","file":"2J25PZ2O.cjs","sourcesContent":["import z from 'zod/v4';\n\nimport { type DecimalString } from '@layerzerolabs/typescript-utils';\n\nexport type { DecimalString };\n\nexport const decimalStringSchema = z.string().refine((data) => {\n return (\n // must be string\n typeof data === 'string' &&\n // must contain only digits, non-empty, can be negative\n data.match(/^-?\\d+$/) !== null &&\n // must not start with 0 unless it's 0\n !(data[0] === '0' && data.length > 1) &&\n // allow -0, but still cant have multiple leading 0s\n !(data.startsWith('-0') && data.length > 2)\n );\n}) as any as z.ZodType<DecimalString>;\n\nexport const decimalString = {\n parse: (data: string | bigint) => {\n if (typeof data === 'bigint') {\n return data.toString() as any as DecimalString;\n }\n if (typeof data === 'string') {\n if (data.match(/^\\d+$/) === null) {\n throw new Error(`decimalString doesn't contain only digits: ${data}`);\n }\n // Normalize it as well to not have many surprises\n return BigInt(data).toString() as any as DecimalString;\n }\n throw new Error(`Invalid data: ${data}`);\n },\n\n toBigInt: (data: DecimalString) => {\n return BigInt(data as any as string);\n },\n};\n"]}
@@ -0,0 +1,33 @@
1
+ import { __name } from './VUOMXK5T.js';
2
+ import z from 'zod/v4';
3
+
4
+ var decimalStringSchema = z.string().refine((data) => {
5
+ return (
6
+ // must be string
7
+ typeof data === "string" && // must contain only digits, non-empty, can be negative
8
+ data.match(/^-?\d+$/) !== null && // must not start with 0 unless it's 0
9
+ !(data[0] === "0" && data.length > 1) && // allow -0, but still cant have multiple leading 0s
10
+ !(data.startsWith("-0") && data.length > 2)
11
+ );
12
+ });
13
+ var decimalString = {
14
+ parse: /* @__PURE__ */ __name((data) => {
15
+ if (typeof data === "bigint") {
16
+ return data.toString();
17
+ }
18
+ if (typeof data === "string") {
19
+ if (data.match(/^\d+$/) === null) {
20
+ throw new Error(`decimalString doesn't contain only digits: ${data}`);
21
+ }
22
+ return BigInt(data).toString();
23
+ }
24
+ throw new Error(`Invalid data: ${data}`);
25
+ }, "parse"),
26
+ toBigInt: /* @__PURE__ */ __name((data) => {
27
+ return BigInt(data);
28
+ }, "toBigInt")
29
+ };
30
+
31
+ export { decimalString, decimalStringSchema };
32
+ //# sourceMappingURL=4K6BY5DZ.js.map
33
+ //# sourceMappingURL=4K6BY5DZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/bigint.ts"],"names":["decimalStringSchema","z","string","refine","data","match","length","startsWith","decimalString","parse","toString","Error","BigInt","toBigInt"],"mappings":";;;AAMO,IAAMA,sBAAsBC,CAAAA,CAAEC,MAAAA,EAAM,CAAGC,MAAAA,CAAO,CAACC,IAAAA,KAAAA;AAClD,EAAA;;AAEI,IAAA,OAAOA,IAAAA,KAAS,QAAA;IAEhBA,IAAAA,CAAKC,KAAAA,CAAM,SAAA,CAAA,KAAe,IAAA;AAE1B,IAAA,EAAED,IAAAA,CAAK,CAAA,CAAA,KAAO,GAAA,IAAOA,KAAKE,MAAAA,GAAS,CAAA,CAAA;AAEnC,IAAA,EAAEF,IAAAA,CAAKG,UAAAA,CAAW,IAAA,CAAA,IAASH,KAAKE,MAAAA,GAAS,CAAA;;AAEjD,CAAA;AAEO,IAAME,aAAAA,GAAgB;AACzBC,EAAAA,KAAAA,0BAAQL,IAAAA,KAAAA;AACJ,IAAA,IAAI,OAAOA,SAAS,QAAA,EAAU;AAC1B,MAAA,OAAOA,KAAKM,QAAAA,EAAQ;AACxB,IAAA;AACA,IAAA,IAAI,OAAON,SAAS,QAAA,EAAU;AAC1B,MAAA,IAAIA,IAAAA,CAAKC,KAAAA,CAAM,OAAA,CAAA,KAAa,IAAA,EAAM;AAC9B,QAAA,MAAM,IAAIM,KAAAA,CAAM,CAAA,2CAAA,EAA8CP,IAAAA,CAAAA,CAAM,CAAA;AACxE,MAAA;AAEA,MAAA,OAAOQ,MAAAA,CAAOR,IAAAA,CAAAA,CAAMM,QAAAA,EAAQ;AAChC,IAAA;AACA,IAAA,MAAM,IAAIC,KAAAA,CAAM,CAAA,cAAA,EAAiBP,IAAAA,CAAAA,CAAM,CAAA;EAC3C,CAAA,EAZO,OAAA,CAAA;AAcPS,EAAAA,QAAAA,0BAAWT,IAAAA,KAAAA;AACP,IAAA,OAAOQ,OAAOR,IAAAA,CAAAA;EAClB,CAAA,EAFU,UAAA;AAGd","file":"4K6BY5DZ.js","sourcesContent":["import z from 'zod/v4';\n\nimport { type DecimalString } from '@layerzerolabs/typescript-utils';\n\nexport type { DecimalString };\n\nexport const decimalStringSchema = z.string().refine((data) => {\n return (\n // must be string\n typeof data === 'string' &&\n // must contain only digits, non-empty, can be negative\n data.match(/^-?\\d+$/) !== null &&\n // must not start with 0 unless it's 0\n !(data[0] === '0' && data.length > 1) &&\n // allow -0, but still cant have multiple leading 0s\n !(data.startsWith('-0') && data.length > 2)\n );\n}) as any as z.ZodType<DecimalString>;\n\nexport const decimalString = {\n parse: (data: string | bigint) => {\n if (typeof data === 'bigint') {\n return data.toString() as any as DecimalString;\n }\n if (typeof data === 'string') {\n if (data.match(/^\\d+$/) === null) {\n throw new Error(`decimalString doesn't contain only digits: ${data}`);\n }\n // Normalize it as well to not have many surprises\n return BigInt(data).toString() as any as DecimalString;\n }\n throw new Error(`Invalid data: ${data}`);\n },\n\n toBigInt: (data: DecimalString) => {\n return BigInt(data as any as string);\n },\n};\n"]}
@@ -0,0 +1,32 @@
1
+ import { __name } from './VUOMXK5T.js';
2
+ import z from 'zod/v4';
3
+
4
+ var hexSchema = z.string().refine((data) => typeof data === "string" && data.startsWith("0x"));
5
+ var normalizedHexSchema = z.string().refine((data) => {
6
+ if (typeof data !== "string") {
7
+ return false;
8
+ }
9
+ if (!data.startsWith("0x")) {
10
+ return false;
11
+ }
12
+ if (data.length <= 2) {
13
+ return false;
14
+ }
15
+ if (data.length >= 4 && data[2] === "0") {
16
+ return false;
17
+ }
18
+ if (data.toLowerCase() !== data) {
19
+ return false;
20
+ }
21
+ return true;
22
+ });
23
+ var normalizeHex = /* @__PURE__ */ __name((address) => {
24
+ const body = address.slice(2).replace(/^0+/, "");
25
+ const trimmed = "0x" + (body || "0");
26
+ return trimmed.toLowerCase();
27
+ }, "normalizeHex");
28
+ var zeroNormalizedHex = normalizeHex("0x0");
29
+
30
+ export { hexSchema, normalizeHex, normalizedHexSchema, zeroNormalizedHex };
31
+ //# sourceMappingURL=DOZD76P7.js.map
32
+ //# sourceMappingURL=DOZD76P7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/address.ts"],"names":["hexSchema","z","string","refine","data","startsWith","normalizedHexSchema","length","toLowerCase","normalizeHex","address","body","slice","replace","trimmed","zeroNormalizedHex"],"mappings":";;;AAMO,IAAMA,SAAAA,GAAYC,CAAAA,CACpBC,MAAAA,EAAM,CACNC,MAAAA,CAAO,CAACC,IAAAA,KAAS,OAAOA,IAAAA,KAAS,QAAA,IAAYA,IAAAA,CAAKC,UAAAA,CAAW,IAAA,CAAA;AAE3D,IAAMC,sBAAsBL,CAAAA,CAAEC,MAAAA,EAAM,CAAGC,MAAAA,CAAO,CAACC,IAAAA,KAAAA;AAElD,EAAA,IAAI,OAAOA,SAAS,QAAA,EAAU;AAC1B,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAI,CAACA,IAAAA,CAAKC,UAAAA,CAAW,IAAA,CAAA,EAAO;AACxB,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAID,IAAAA,CAAKG,UAAU,CAAA,EAAG;AAClB,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAIH,KAAKG,MAAAA,IAAU,CAAA,IAAKH,IAAAA,CAAK,CAAA,MAAO,GAAA,EAAK;AACrC,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAIA,IAAAA,CAAKI,WAAAA,EAAW,KAAOJ,IAAAA,EAAM;AAC7B,IAAA,OAAO,KAAA;AACX,EAAA;AACA,EAAA,OAAO,IAAA;AACX,CAAA;AAEO,IAAMK,YAAAA,2BAAgBC,OAAAA,KAAAA;AAEzB,EAAA,MAAMC,OAAOD,OAAAA,CAAQE,KAAAA,CAAM,CAAA,CAAA,CAAGC,OAAAA,CAAQ,OAAO,EAAA,CAAA;AAE7C,EAAA,MAAMC,OAAAA,GAAU,QAAQH,IAAAA,IAAQ,GAAA,CAAA;AAChC,EAAA,OAAOG,QAAQN,WAAAA,EAAW;AAC9B,CAAA,EAN4B,cAAA;AAQrB,IAAMO,iBAAAA,GAAoBN,aAAa,KAAA","file":"DOZD76P7.js","sourcesContent":["import z from 'zod/v4';\n\nimport type { HexString, NormalizedHexString } from '@layerzerolabs/typescript-utils';\n\nexport type { HexString, NormalizedHexString };\n\nexport const hexSchema = z\n .string()\n .refine((data) => typeof data === 'string' && data.startsWith('0x')) as z.ZodType<HexString>;\n\nexport const normalizedHexSchema = z.string().refine((data) => {\n // normalized hex strings are strings\n if (typeof data !== 'string') {\n return false;\n }\n // normalized hex strings start with 0x\n if (!data.startsWith('0x')) {\n return false;\n }\n // '0x' is not a valid normalized address (expect 0x0)\n if (data.length <= 2) {\n return false;\n }\n // normalized hex strings have no leading 0s (except for edge case (0x0)\n if (data.length >= 4 && data[2] === '0') {\n return false;\n }\n // normalized hex strings are always lowercase\n if (data.toLowerCase() !== data) {\n return false;\n }\n return true;\n}) as any as z.ZodType<NormalizedHexString>;\n\nexport const normalizeHex = (address: HexString): NormalizedHexString => {\n // take the bytes part, remove all 0s\n const body = address.slice(2).replace(/^0+/, '');\n // if the string was e.g., `0x000`, append one 0 so that we have `0x0\n const trimmed = '0x' + (body || '0');\n return trimmed.toLowerCase() as any as NormalizedHexString;\n};\n\nexport const zeroNormalizedHex = normalizeHex('0x0');\n"]}
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ var YJF4D23A_cjs = require('./YJF4D23A.cjs');
4
+ var z = require('zod/v4');
5
+
6
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
+
8
+ var z__default = /*#__PURE__*/_interopDefault(z);
9
+
10
+ var hexSchema = z__default.default.string().refine((data) => typeof data === "string" && data.startsWith("0x"));
11
+ var normalizedHexSchema = z__default.default.string().refine((data) => {
12
+ if (typeof data !== "string") {
13
+ return false;
14
+ }
15
+ if (!data.startsWith("0x")) {
16
+ return false;
17
+ }
18
+ if (data.length <= 2) {
19
+ return false;
20
+ }
21
+ if (data.length >= 4 && data[2] === "0") {
22
+ return false;
23
+ }
24
+ if (data.toLowerCase() !== data) {
25
+ return false;
26
+ }
27
+ return true;
28
+ });
29
+ var normalizeHex = /* @__PURE__ */ YJF4D23A_cjs.__name((address) => {
30
+ const body = address.slice(2).replace(/^0+/, "");
31
+ const trimmed = "0x" + (body || "0");
32
+ return trimmed.toLowerCase();
33
+ }, "normalizeHex");
34
+ var zeroNormalizedHex = normalizeHex("0x0");
35
+
36
+ exports.hexSchema = hexSchema;
37
+ exports.normalizeHex = normalizeHex;
38
+ exports.normalizedHexSchema = normalizedHexSchema;
39
+ exports.zeroNormalizedHex = zeroNormalizedHex;
40
+ //# sourceMappingURL=OBNNMNND.cjs.map
41
+ //# sourceMappingURL=OBNNMNND.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/address.ts"],"names":["hexSchema","z","string","refine","data","startsWith","normalizedHexSchema","length","toLowerCase","normalizeHex","address","body","slice","replace","trimmed","zeroNormalizedHex"],"mappings":";;;;;;;;;AAMO,IAAMA,SAAAA,GAAYC,kBAAAA,CACpBC,MAAAA,EAAM,CACNC,MAAAA,CAAO,CAACC,IAAAA,KAAS,OAAOA,IAAAA,KAAS,QAAA,IAAYA,IAAAA,CAAKC,UAAAA,CAAW,IAAA,CAAA;AAE3D,IAAMC,sBAAsBL,kBAAAA,CAAEC,MAAAA,EAAM,CAAGC,MAAAA,CAAO,CAACC,IAAAA,KAAAA;AAElD,EAAA,IAAI,OAAOA,SAAS,QAAA,EAAU;AAC1B,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAI,CAACA,IAAAA,CAAKC,UAAAA,CAAW,IAAA,CAAA,EAAO;AACxB,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAID,IAAAA,CAAKG,UAAU,CAAA,EAAG;AAClB,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAIH,KAAKG,MAAAA,IAAU,CAAA,IAAKH,IAAAA,CAAK,CAAA,MAAO,GAAA,EAAK;AACrC,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAIA,IAAAA,CAAKI,WAAAA,EAAW,KAAOJ,IAAAA,EAAM;AAC7B,IAAA,OAAO,KAAA;AACX,EAAA;AACA,EAAA,OAAO,IAAA;AACX,CAAA;AAEO,IAAMK,YAAAA,wCAAgBC,OAAAA,KAAAA;AAEzB,EAAA,MAAMC,OAAOD,OAAAA,CAAQE,KAAAA,CAAM,CAAA,CAAA,CAAGC,OAAAA,CAAQ,OAAO,EAAA,CAAA;AAE7C,EAAA,MAAMC,OAAAA,GAAU,QAAQH,IAAAA,IAAQ,GAAA,CAAA;AAChC,EAAA,OAAOG,QAAQN,WAAAA,EAAW;AAC9B,CAAA,EAN4B,cAAA;AAQrB,IAAMO,iBAAAA,GAAoBN,aAAa,KAAA","file":"OBNNMNND.cjs","sourcesContent":["import z from 'zod/v4';\n\nimport type { HexString, NormalizedHexString } from '@layerzerolabs/typescript-utils';\n\nexport type { HexString, NormalizedHexString };\n\nexport const hexSchema = z\n .string()\n .refine((data) => typeof data === 'string' && data.startsWith('0x')) as z.ZodType<HexString>;\n\nexport const normalizedHexSchema = z.string().refine((data) => {\n // normalized hex strings are strings\n if (typeof data !== 'string') {\n return false;\n }\n // normalized hex strings start with 0x\n if (!data.startsWith('0x')) {\n return false;\n }\n // '0x' is not a valid normalized address (expect 0x0)\n if (data.length <= 2) {\n return false;\n }\n // normalized hex strings have no leading 0s (except for edge case (0x0)\n if (data.length >= 4 && data[2] === '0') {\n return false;\n }\n // normalized hex strings are always lowercase\n if (data.toLowerCase() !== data) {\n return false;\n }\n return true;\n}) as any as z.ZodType<NormalizedHexString>;\n\nexport const normalizeHex = (address: HexString): NormalizedHexString => {\n // take the bytes part, remove all 0s\n const body = address.slice(2).replace(/^0+/, '');\n // if the string was e.g., `0x000`, append one 0 so that we have `0x0\n const trimmed = '0x' + (body || '0');\n return trimmed.toLowerCase() as any as NormalizedHexString;\n};\n\nexport const zeroNormalizedHex = normalizeHex('0x0');\n"]}
package/dist/address.cjs CHANGED
@@ -1,41 +1,25 @@
1
1
  'use strict';
2
2
 
3
- var QYHNWZK7_cjs = require('./QYHNWZK7.cjs');
3
+ var OBNNMNND_cjs = require('./OBNNMNND.cjs');
4
4
  require('./YJF4D23A.cjs');
5
5
 
6
6
 
7
7
 
8
- Object.defineProperty(exports, "base58AddressSchema", {
9
- enumerable: true,
10
- get: function () { return QYHNWZK7_cjs.base58AddressSchema; }
11
- });
12
- Object.defineProperty(exports, "denormalizeHexAddress", {
13
- enumerable: true,
14
- get: function () { return QYHNWZK7_cjs.denormalizeHexAddress; }
15
- });
16
- Object.defineProperty(exports, "hexAddressSchema", {
17
- enumerable: true,
18
- get: function () { return QYHNWZK7_cjs.hexAddressSchema; }
19
- });
20
8
  Object.defineProperty(exports, "hexSchema", {
21
9
  enumerable: true,
22
- get: function () { return QYHNWZK7_cjs.hexSchema; }
23
- });
24
- Object.defineProperty(exports, "lowercaseHex", {
25
- enumerable: true,
26
- get: function () { return QYHNWZK7_cjs.lowercaseHex; }
10
+ get: function () { return OBNNMNND_cjs.hexSchema; }
27
11
  });
28
- Object.defineProperty(exports, "normalizeHexAddress", {
12
+ Object.defineProperty(exports, "normalizeHex", {
29
13
  enumerable: true,
30
- get: function () { return QYHNWZK7_cjs.normalizeHexAddress; }
14
+ get: function () { return OBNNMNND_cjs.normalizeHex; }
31
15
  });
32
- Object.defineProperty(exports, "normalizedHexAddressSchema", {
16
+ Object.defineProperty(exports, "normalizedHexSchema", {
33
17
  enumerable: true,
34
- get: function () { return QYHNWZK7_cjs.normalizedHexAddressSchema; }
18
+ get: function () { return OBNNMNND_cjs.normalizedHexSchema; }
35
19
  });
36
- Object.defineProperty(exports, "normalizedHexSchema", {
20
+ Object.defineProperty(exports, "zeroNormalizedHex", {
37
21
  enumerable: true,
38
- get: function () { return QYHNWZK7_cjs.normalizedHexSchema; }
22
+ get: function () { return OBNNMNND_cjs.zeroNormalizedHex; }
39
23
  });
40
24
  //# sourceMappingURL=address.cjs.map
41
25
  //# sourceMappingURL=address.cjs.map
package/dist/address.d.ts CHANGED
@@ -1,14 +1,8 @@
1
1
  import z from 'zod/v4';
2
2
  import type { HexString, NormalizedHexString } from '@layerzerolabs/typescript-utils';
3
+ export type { HexString, NormalizedHexString };
3
4
  export declare const hexSchema: z.ZodType<HexString>;
4
5
  export declare const normalizedHexSchema: z.ZodType<NormalizedHexString>;
5
- export declare const hexAddressSchema: z.ZodType<`0x${string}`, unknown, z.core.$ZodTypeInternals<`0x${string}`, unknown>>;
6
- export declare const normalizedHexAddressSchema: z.ZodType<NormalizedHexString, unknown, z.core.$ZodTypeInternals<NormalizedHexString, unknown>>;
7
- export type HexAddress = z.infer<typeof hexAddressSchema>;
8
- export type NormalizedHexAddress = z.infer<typeof normalizedHexSchema>;
9
- export declare const lowercaseHex: <T extends HexAddress | undefined>(address: T) => T;
10
- export declare const normalizeHexAddress: (address: HexAddress) => NormalizedHexAddress;
11
- export declare const denormalizeHexAddress: (address: NormalizedHexAddress, byteCount: number) => HexAddress;
12
- export declare const base58AddressSchema: z.ZodString;
13
- export type Base58AddressSchema = z.infer<typeof base58AddressSchema>;
6
+ export declare const normalizeHex: (address: HexString) => NormalizedHexString;
7
+ export declare const zeroNormalizedHex: NormalizedHexString;
14
8
  //# sourceMappingURL=address.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAGvB,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtF,eAAO,MAAM,SAAS,EAEsD,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAEjG,eAAO,MAAM,mBAAmB,EAsBnB,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE5C,eAAO,MAAM,gBAAgB,qFAAY,CAAC;AAC1C,eAAO,MAAM,0BAA0B,iGAAsB,CAAC;AAE9D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEvE,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,UAAU,GAAG,SAAS,EAAE,SAAS,CAAC,KAAG,CACjC,CAAC;AAE5C,eAAO,MAAM,mBAAmB,GAAI,SAAS,UAAU,KAAG,oBAMzD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAC9B,SAAS,oBAAoB,EAC7B,WAAW,MAAM,KAClB,UAA6D,CAAC;AAGjE,eAAO,MAAM,mBAAmB,aAE9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtF,YAAY,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;AAE/C,eAAO,MAAM,SAAS,EAEsD,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAEjG,eAAO,MAAM,mBAAmB,EAsBnB,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE5C,eAAO,MAAM,YAAY,GAAI,SAAS,SAAS,KAAG,mBAMjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,qBAAsB,CAAC"}
package/dist/address.js CHANGED
@@ -1,4 +1,4 @@
1
- export { base58AddressSchema, denormalizeHexAddress, hexAddressSchema, hexSchema, lowercaseHex, normalizeHexAddress, normalizedHexAddressSchema, normalizedHexSchema } from './CIKWECQO.js';
1
+ export { hexSchema, normalizeHex, normalizedHexSchema, zeroNormalizedHex } from './DOZD76P7.js';
2
2
  import './VUOMXK5T.js';
3
3
  //# sourceMappingURL=address.js.map
4
4
  //# sourceMappingURL=address.js.map
package/dist/bigint.cjs CHANGED
@@ -1,21 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var DTYQULT4_cjs = require('./DTYQULT4.cjs');
3
+ var _2J25PZ2O_cjs = require('./2J25PZ2O.cjs');
4
4
  require('./YJF4D23A.cjs');
5
5
 
6
6
 
7
7
 
8
- Object.defineProperty(exports, "decimalStringFromBigInt", {
8
+ Object.defineProperty(exports, "decimalString", {
9
9
  enumerable: true,
10
- get: function () { return DTYQULT4_cjs.decimalStringFromBigInt; }
10
+ get: function () { return _2J25PZ2O_cjs.decimalString; }
11
11
  });
12
12
  Object.defineProperty(exports, "decimalStringSchema", {
13
13
  enumerable: true,
14
- get: function () { return DTYQULT4_cjs.decimalStringSchema; }
15
- });
16
- Object.defineProperty(exports, "decimalStringToBigInt", {
17
- enumerable: true,
18
- get: function () { return DTYQULT4_cjs.decimalStringToBigInt; }
14
+ get: function () { return _2J25PZ2O_cjs.decimalStringSchema; }
19
15
  });
20
16
  //# sourceMappingURL=bigint.cjs.map
21
17
  //# sourceMappingURL=bigint.cjs.map
package/dist/bigint.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import z from 'zod/v4';
2
2
  import { type DecimalString } from '@layerzerolabs/typescript-utils';
3
- export declare const decimalStringFromBigInt: (bigInt: bigint) => DecimalString;
4
- export declare const decimalStringToBigInt: (hex: DecimalString) => bigint;
3
+ export type { DecimalString };
5
4
  export declare const decimalStringSchema: z.ZodType<DecimalString>;
5
+ export declare const decimalString: {
6
+ parse: (data: string | bigint) => DecimalString;
7
+ toBigInt: (data: DecimalString) => bigint;
8
+ };
6
9
  //# sourceMappingURL=bigint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../src/bigint.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,eAAO,MAAM,uBAAuB,GAAI,QAAQ,MAAM,KAAG,aAExD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,KAAK,aAAa,KAAG,MAE1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAEnB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC"}
1
+ {"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../src/bigint.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B,eAAO,MAAM,mBAAmB,EAWnB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AAEtC,eAAO,MAAM,aAAa;kBACR,MAAM,GAAG,MAAM;qBAcZ,aAAa;CAGjC,CAAC"}
package/dist/bigint.js CHANGED
@@ -1,4 +1,4 @@
1
- export { decimalStringFromBigInt, decimalStringSchema, decimalStringToBigInt } from './RINNGVQR.js';
1
+ export { decimalString, decimalStringSchema } from './4K6BY5DZ.js';
2
2
  import './VUOMXK5T.js';
3
3
  //# sourceMappingURL=bigint.js.map
4
4
  //# sourceMappingURL=bigint.js.map
package/dist/index.cjs CHANGED
@@ -1,55 +1,35 @@
1
1
  'use strict';
2
2
 
3
- var QYHNWZK7_cjs = require('./QYHNWZK7.cjs');
4
- var DTYQULT4_cjs = require('./DTYQULT4.cjs');
3
+ var OBNNMNND_cjs = require('./OBNNMNND.cjs');
4
+ var _2J25PZ2O_cjs = require('./2J25PZ2O.cjs');
5
5
  var F6WBSSER_cjs = require('./F6WBSSER.cjs');
6
6
  require('./YJF4D23A.cjs');
7
7
 
8
8
 
9
9
 
10
- Object.defineProperty(exports, "base58AddressSchema", {
11
- enumerable: true,
12
- get: function () { return QYHNWZK7_cjs.base58AddressSchema; }
13
- });
14
- Object.defineProperty(exports, "denormalizeHexAddress", {
15
- enumerable: true,
16
- get: function () { return QYHNWZK7_cjs.denormalizeHexAddress; }
17
- });
18
- Object.defineProperty(exports, "hexAddressSchema", {
19
- enumerable: true,
20
- get: function () { return QYHNWZK7_cjs.hexAddressSchema; }
21
- });
22
10
  Object.defineProperty(exports, "hexSchema", {
23
11
  enumerable: true,
24
- get: function () { return QYHNWZK7_cjs.hexSchema; }
12
+ get: function () { return OBNNMNND_cjs.hexSchema; }
25
13
  });
26
- Object.defineProperty(exports, "lowercaseHex", {
14
+ Object.defineProperty(exports, "normalizeHex", {
27
15
  enumerable: true,
28
- get: function () { return QYHNWZK7_cjs.lowercaseHex; }
29
- });
30
- Object.defineProperty(exports, "normalizeHexAddress", {
31
- enumerable: true,
32
- get: function () { return QYHNWZK7_cjs.normalizeHexAddress; }
33
- });
34
- Object.defineProperty(exports, "normalizedHexAddressSchema", {
35
- enumerable: true,
36
- get: function () { return QYHNWZK7_cjs.normalizedHexAddressSchema; }
16
+ get: function () { return OBNNMNND_cjs.normalizeHex; }
37
17
  });
38
18
  Object.defineProperty(exports, "normalizedHexSchema", {
39
19
  enumerable: true,
40
- get: function () { return QYHNWZK7_cjs.normalizedHexSchema; }
20
+ get: function () { return OBNNMNND_cjs.normalizedHexSchema; }
41
21
  });
42
- Object.defineProperty(exports, "decimalStringFromBigInt", {
22
+ Object.defineProperty(exports, "zeroNormalizedHex", {
43
23
  enumerable: true,
44
- get: function () { return DTYQULT4_cjs.decimalStringFromBigInt; }
24
+ get: function () { return OBNNMNND_cjs.zeroNormalizedHex; }
45
25
  });
46
- Object.defineProperty(exports, "decimalStringSchema", {
26
+ Object.defineProperty(exports, "decimalString", {
47
27
  enumerable: true,
48
- get: function () { return DTYQULT4_cjs.decimalStringSchema; }
28
+ get: function () { return _2J25PZ2O_cjs.decimalString; }
49
29
  });
50
- Object.defineProperty(exports, "decimalStringToBigInt", {
30
+ Object.defineProperty(exports, "decimalStringSchema", {
51
31
  enumerable: true,
52
- get: function () { return DTYQULT4_cjs.decimalStringToBigInt; }
32
+ get: function () { return _2J25PZ2O_cjs.decimalStringSchema; }
53
33
  });
54
34
  Object.defineProperty(exports, "assignedTransactionSchema", {
55
35
  enumerable: true,
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { base58AddressSchema, denormalizeHexAddress, hexAddressSchema, hexSchema, lowercaseHex, normalizeHexAddress, normalizedHexAddressSchema, normalizedHexSchema } from './CIKWECQO.js';
2
- export { decimalStringFromBigInt, decimalStringSchema, decimalStringToBigInt } from './RINNGVQR.js';
1
+ export { hexSchema, normalizeHex, normalizedHexSchema, zeroNormalizedHex } from './DOZD76P7.js';
2
+ export { decimalString, decimalStringSchema } from './4K6BY5DZ.js';
3
3
  export { assignedTransactionSchema, buildTransactionWithResultSchema, minedTransactionSchema, signedTransactionSchema, transactionMetadataTimestamps, transactionResultSchema, transactionSchema, transactionWithResultSchema } from './3YWFRX2K.js';
4
4
  import './VUOMXK5T.js';
5
5
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/common-chain-model",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -15,14 +15,13 @@
15
15
  "types": "./dist/index.d.ts",
16
16
  "dependencies": {
17
17
  "zod": "^3.23.8",
18
- "@layerzerolabs/common-utils": "0.0.45",
19
- "@layerzerolabs/typescript-utils": "0.0.45"
18
+ "@layerzerolabs/typescript-utils": "0.0.47"
20
19
  },
21
20
  "devDependencies": {
22
21
  "tsup": "^8.4.0",
23
22
  "vitest": "^3.2.3",
24
- "@layerzerolabs/typescript-configuration": "0.0.45",
25
- "@layerzerolabs/tsup-configuration": "0.0.45"
23
+ "@layerzerolabs/typescript-configuration": "0.0.47",
24
+ "@layerzerolabs/tsup-configuration": "0.0.47"
26
25
  },
27
26
  "publishConfig": {
28
27
  "access": "restricted",
package/src/address.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import z from 'zod/v4';
2
2
 
3
- import { hexZeroPad, isBase58 } from '@layerzerolabs/common-utils';
4
3
  import type { HexString, NormalizedHexString } from '@layerzerolabs/typescript-utils';
5
4
 
5
+ export type { HexString, NormalizedHexString };
6
+
6
7
  export const hexSchema = z
7
8
  .string()
8
9
  .refine((data) => typeof data === 'string' && data.startsWith('0x')) as z.ZodType<HexString>;
@@ -31,31 +32,12 @@ export const normalizedHexSchema = z.string().refine((data) => {
31
32
  return true;
32
33
  }) as any as z.ZodType<NormalizedHexString>;
33
34
 
34
- export const hexAddressSchema = hexSchema;
35
- export const normalizedHexAddressSchema = normalizedHexSchema;
36
-
37
- export type HexAddress = z.infer<typeof hexAddressSchema>;
38
- export type NormalizedHexAddress = z.infer<typeof normalizedHexSchema>;
39
-
40
- export const lowercaseHex = <T extends HexAddress | undefined>(address: T): T =>
41
- address && (address.toLowerCase() as T);
42
-
43
- export const normalizeHexAddress = (address: HexAddress): NormalizedHexAddress => {
35
+ export const normalizeHex = (address: HexString): NormalizedHexString => {
44
36
  // take the bytes part, remove all 0s
45
37
  const body = address.slice(2).replace(/^0+/, '');
46
38
  // if the string was e.g., `0x000`, append one 0 so that we have `0x0
47
39
  const trimmed = '0x' + (body || '0');
48
- return trimmed.toLowerCase() as any as NormalizedHexAddress;
40
+ return trimmed.toLowerCase() as any as NormalizedHexString;
49
41
  };
50
42
 
51
- export const denormalizeHexAddress = (
52
- address: NormalizedHexAddress,
53
- byteCount: number,
54
- ): HexAddress => hexZeroPad(address as any as string, byteCount);
55
-
56
- // Base58 schema for validation
57
- export const base58AddressSchema = z.string().refine(isBase58, {
58
- error: 'Invalid base58 address format',
59
- });
60
-
61
- export type Base58AddressSchema = z.infer<typeof base58AddressSchema>;
43
+ export const zeroNormalizedHex = normalizeHex('0x0');
package/src/bigint.ts CHANGED
@@ -2,14 +2,37 @@ import z from 'zod/v4';
2
2
 
3
3
  import { type DecimalString } from '@layerzerolabs/typescript-utils';
4
4
 
5
- export const decimalStringFromBigInt = (bigInt: bigint): DecimalString => {
6
- return bigInt.toString() as any as DecimalString;
7
- };
8
-
9
- export const decimalStringToBigInt = (hex: DecimalString): bigint => {
10
- return BigInt(hex as any as string);
11
- };
5
+ export type { DecimalString };
12
6
 
13
7
  export const decimalStringSchema = z.string().refine((data) => {
14
- return typeof data === 'string' && data.match(/^\d+$/) !== null;
8
+ return (
9
+ // must be string
10
+ typeof data === 'string' &&
11
+ // must contain only digits, non-empty, can be negative
12
+ data.match(/^-?\d+$/) !== null &&
13
+ // must not start with 0 unless it's 0
14
+ !(data[0] === '0' && data.length > 1) &&
15
+ // allow -0, but still cant have multiple leading 0s
16
+ !(data.startsWith('-0') && data.length > 2)
17
+ );
15
18
  }) as any as z.ZodType<DecimalString>;
19
+
20
+ export const decimalString = {
21
+ parse: (data: string | bigint) => {
22
+ if (typeof data === 'bigint') {
23
+ return data.toString() as any as DecimalString;
24
+ }
25
+ if (typeof data === 'string') {
26
+ if (data.match(/^\d+$/) === null) {
27
+ throw new Error(`decimalString doesn't contain only digits: ${data}`);
28
+ }
29
+ // Normalize it as well to not have many surprises
30
+ return BigInt(data).toString() as any as DecimalString;
31
+ }
32
+ throw new Error(`Invalid data: ${data}`);
33
+ },
34
+
35
+ toBigInt: (data: DecimalString) => {
36
+ return BigInt(data as any as string);
37
+ },
38
+ };
package/dist/CIKWECQO.js DELETED
@@ -1,39 +0,0 @@
1
- import { __name } from './VUOMXK5T.js';
2
- import z from 'zod/v4';
3
- import { isBase58, hexZeroPad } from '@layerzerolabs/common-utils';
4
-
5
- var hexSchema = z.string().refine((data) => typeof data === "string" && data.startsWith("0x"));
6
- var normalizedHexSchema = z.string().refine((data) => {
7
- if (typeof data !== "string") {
8
- return false;
9
- }
10
- if (!data.startsWith("0x")) {
11
- return false;
12
- }
13
- if (data.length <= 2) {
14
- return false;
15
- }
16
- if (data.length >= 4 && data[2] === "0") {
17
- return false;
18
- }
19
- if (data.toLowerCase() !== data) {
20
- return false;
21
- }
22
- return true;
23
- });
24
- var hexAddressSchema = hexSchema;
25
- var normalizedHexAddressSchema = normalizedHexSchema;
26
- var lowercaseHex = /* @__PURE__ */ __name((address) => address && address.toLowerCase(), "lowercaseHex");
27
- var normalizeHexAddress = /* @__PURE__ */ __name((address) => {
28
- const body = address.slice(2).replace(/^0+/, "");
29
- const trimmed = "0x" + (body || "0");
30
- return trimmed.toLowerCase();
31
- }, "normalizeHexAddress");
32
- var denormalizeHexAddress = /* @__PURE__ */ __name((address, byteCount) => hexZeroPad(address, byteCount), "denormalizeHexAddress");
33
- var base58AddressSchema = z.string().refine(isBase58, {
34
- error: "Invalid base58 address format"
35
- });
36
-
37
- export { base58AddressSchema, denormalizeHexAddress, hexAddressSchema, hexSchema, lowercaseHex, normalizeHexAddress, normalizedHexAddressSchema, normalizedHexSchema };
38
- //# sourceMappingURL=CIKWECQO.js.map
39
- //# sourceMappingURL=CIKWECQO.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/address.ts"],"names":["hexSchema","z","string","refine","data","startsWith","normalizedHexSchema","length","toLowerCase","hexAddressSchema","normalizedHexAddressSchema","lowercaseHex","address","normalizeHexAddress","body","slice","replace","trimmed","denormalizeHexAddress","byteCount","hexZeroPad","base58AddressSchema","isBase58","error"],"mappings":";;;;AAKO,IAAMA,SAAAA,GAAYC,CAAAA,CACpBC,MAAAA,EAAM,CACNC,MAAAA,CAAO,CAACC,IAAAA,KAAS,OAAOA,IAAAA,KAAS,QAAA,IAAYA,IAAAA,CAAKC,UAAAA,CAAW,IAAA,CAAA;AAE3D,IAAMC,sBAAsBL,CAAAA,CAAEC,MAAAA,EAAM,CAAGC,MAAAA,CAAO,CAACC,IAAAA,KAAAA;AAElD,EAAA,IAAI,OAAOA,SAAS,QAAA,EAAU;AAC1B,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAI,CAACA,IAAAA,CAAKC,UAAAA,CAAW,IAAA,CAAA,EAAO;AACxB,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAID,IAAAA,CAAKG,UAAU,CAAA,EAAG;AAClB,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAIH,KAAKG,MAAAA,IAAU,CAAA,IAAKH,IAAAA,CAAK,CAAA,MAAO,GAAA,EAAK;AACrC,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAIA,IAAAA,CAAKI,WAAAA,EAAW,KAAOJ,IAAAA,EAAM;AAC7B,IAAA,OAAO,KAAA;AACX,EAAA;AACA,EAAA,OAAO,IAAA;AACX,CAAA;AAEO,IAAMK,gBAAAA,GAAmBT;AACzB,IAAMU,0BAAAA,GAA6BJ;AAKnC,IAAMK,+BAAe,MAAA,CAAA,CAAmCC,OAAAA,KAC3DA,OAAAA,IAAYA,OAAAA,CAAQJ,aAAW,EADP,cAAA;AAGrB,IAAMK,mBAAAA,2BAAuBD,OAAAA,KAAAA;AAEhC,EAAA,MAAME,OAAOF,OAAAA,CAAQG,KAAAA,CAAM,CAAA,CAAA,CAAGC,OAAAA,CAAQ,OAAO,EAAA,CAAA;AAE7C,EAAA,MAAMC,OAAAA,GAAU,QAAQH,IAAAA,IAAQ,GAAA,CAAA;AAChC,EAAA,OAAOG,QAAQT,WAAAA,EAAW;AAC9B,CAAA,EANmC,qBAAA;AAQ5B,IAAMU,wCAAwB,MAAA,CAAA,CACjCN,OAAAA,EACAO,cACaC,UAAAA,CAAWR,OAAAA,EAA0BO,SAAAA,CAAAA,EAHjB,uBAAA;AAM9B,IAAME,mBAAAA,GAAsBpB,CAAAA,CAAEC,MAAAA,EAAM,CAAGC,OAAOmB,QAAAA,EAAU;EAC3DC,KAAAA,EAAO;AACX,CAAA","file":"CIKWECQO.js","sourcesContent":["import z from 'zod/v4';\n\nimport { hexZeroPad, isBase58 } from '@layerzerolabs/common-utils';\nimport type { HexString, NormalizedHexString } from '@layerzerolabs/typescript-utils';\n\nexport const hexSchema = z\n .string()\n .refine((data) => typeof data === 'string' && data.startsWith('0x')) as z.ZodType<HexString>;\n\nexport const normalizedHexSchema = z.string().refine((data) => {\n // normalized hex strings are strings\n if (typeof data !== 'string') {\n return false;\n }\n // normalized hex strings start with 0x\n if (!data.startsWith('0x')) {\n return false;\n }\n // '0x' is not a valid normalized address (expect 0x0)\n if (data.length <= 2) {\n return false;\n }\n // normalized hex strings have no leading 0s (except for edge case (0x0)\n if (data.length >= 4 && data[2] === '0') {\n return false;\n }\n // normalized hex strings are always lowercase\n if (data.toLowerCase() !== data) {\n return false;\n }\n return true;\n}) as any as z.ZodType<NormalizedHexString>;\n\nexport const hexAddressSchema = hexSchema;\nexport const normalizedHexAddressSchema = normalizedHexSchema;\n\nexport type HexAddress = z.infer<typeof hexAddressSchema>;\nexport type NormalizedHexAddress = z.infer<typeof normalizedHexSchema>;\n\nexport const lowercaseHex = <T extends HexAddress | undefined>(address: T): T =>\n address && (address.toLowerCase() as T);\n\nexport const normalizeHexAddress = (address: HexAddress): NormalizedHexAddress => {\n // take the bytes part, remove all 0s\n const body = address.slice(2).replace(/^0+/, '');\n // if the string was e.g., `0x000`, append one 0 so that we have `0x0\n const trimmed = '0x' + (body || '0');\n return trimmed.toLowerCase() as any as NormalizedHexAddress;\n};\n\nexport const denormalizeHexAddress = (\n address: NormalizedHexAddress,\n byteCount: number,\n): HexAddress => hexZeroPad(address as any as string, byteCount);\n\n// Base58 schema for validation\nexport const base58AddressSchema = z.string().refine(isBase58, {\n error: 'Invalid base58 address format',\n});\n\nexport type Base58AddressSchema = z.infer<typeof base58AddressSchema>;\n"]}
package/dist/DTYQULT4.cjs DELETED
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- var YJF4D23A_cjs = require('./YJF4D23A.cjs');
4
- var z = require('zod/v4');
5
-
6
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
-
8
- var z__default = /*#__PURE__*/_interopDefault(z);
9
-
10
- var decimalStringFromBigInt = /* @__PURE__ */ YJF4D23A_cjs.__name((bigInt) => {
11
- return bigInt.toString();
12
- }, "decimalStringFromBigInt");
13
- var decimalStringToBigInt = /* @__PURE__ */ YJF4D23A_cjs.__name((hex) => {
14
- return BigInt(hex);
15
- }, "decimalStringToBigInt");
16
- var decimalStringSchema = z__default.default.string().refine((data) => {
17
- return typeof data === "string" && data.match(/^\d+$/) !== null;
18
- });
19
-
20
- exports.decimalStringFromBigInt = decimalStringFromBigInt;
21
- exports.decimalStringSchema = decimalStringSchema;
22
- exports.decimalStringToBigInt = decimalStringToBigInt;
23
- //# sourceMappingURL=DTYQULT4.cjs.map
24
- //# sourceMappingURL=DTYQULT4.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/bigint.ts"],"names":["decimalStringFromBigInt","bigInt","toString","decimalStringToBigInt","hex","BigInt","decimalStringSchema","z","string","refine","data","match"],"mappings":";;;;;;;;;AAIO,IAAMA,uBAAAA,wCAA2BC,MAAAA,KAAAA;AACpC,EAAA,OAAOA,OAAOC,QAAAA,EAAQ;AAC1B,CAAA,EAFuC,yBAAA;AAIhC,IAAMC,qBAAAA,wCAAyBC,GAAAA,KAAAA;AAClC,EAAA,OAAOC,OAAOD,GAAAA,CAAAA;AAClB,CAAA,EAFqC,uBAAA;AAI9B,IAAME,sBAAsBC,kBAAAA,CAAEC,MAAAA,EAAM,CAAGC,MAAAA,CAAO,CAACC,IAAAA,KAAAA;AAClD,EAAA,OAAO,OAAOA,IAAAA,KAAS,QAAA,IAAYA,IAAAA,CAAKC,KAAAA,CAAM,OAAA,CAAA,KAAa,IAAA;AAC/D,CAAA","file":"DTYQULT4.cjs","sourcesContent":["import z from 'zod/v4';\n\nimport { type DecimalString } from '@layerzerolabs/typescript-utils';\n\nexport const decimalStringFromBigInt = (bigInt: bigint): DecimalString => {\n return bigInt.toString() as any as DecimalString;\n};\n\nexport const decimalStringToBigInt = (hex: DecimalString): bigint => {\n return BigInt(hex as any as string);\n};\n\nexport const decimalStringSchema = z.string().refine((data) => {\n return typeof data === 'string' && data.match(/^\\d+$/) !== null;\n}) as any as z.ZodType<DecimalString>;\n"]}
package/dist/QYHNWZK7.cjs DELETED
@@ -1,52 +0,0 @@
1
- 'use strict';
2
-
3
- var YJF4D23A_cjs = require('./YJF4D23A.cjs');
4
- var z = require('zod/v4');
5
- var commonUtils = require('@layerzerolabs/common-utils');
6
-
7
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
-
9
- var z__default = /*#__PURE__*/_interopDefault(z);
10
-
11
- var hexSchema = z__default.default.string().refine((data) => typeof data === "string" && data.startsWith("0x"));
12
- var normalizedHexSchema = z__default.default.string().refine((data) => {
13
- if (typeof data !== "string") {
14
- return false;
15
- }
16
- if (!data.startsWith("0x")) {
17
- return false;
18
- }
19
- if (data.length <= 2) {
20
- return false;
21
- }
22
- if (data.length >= 4 && data[2] === "0") {
23
- return false;
24
- }
25
- if (data.toLowerCase() !== data) {
26
- return false;
27
- }
28
- return true;
29
- });
30
- var hexAddressSchema = hexSchema;
31
- var normalizedHexAddressSchema = normalizedHexSchema;
32
- var lowercaseHex = /* @__PURE__ */ YJF4D23A_cjs.__name((address) => address && address.toLowerCase(), "lowercaseHex");
33
- var normalizeHexAddress = /* @__PURE__ */ YJF4D23A_cjs.__name((address) => {
34
- const body = address.slice(2).replace(/^0+/, "");
35
- const trimmed = "0x" + (body || "0");
36
- return trimmed.toLowerCase();
37
- }, "normalizeHexAddress");
38
- var denormalizeHexAddress = /* @__PURE__ */ YJF4D23A_cjs.__name((address, byteCount) => commonUtils.hexZeroPad(address, byteCount), "denormalizeHexAddress");
39
- var base58AddressSchema = z__default.default.string().refine(commonUtils.isBase58, {
40
- error: "Invalid base58 address format"
41
- });
42
-
43
- exports.base58AddressSchema = base58AddressSchema;
44
- exports.denormalizeHexAddress = denormalizeHexAddress;
45
- exports.hexAddressSchema = hexAddressSchema;
46
- exports.hexSchema = hexSchema;
47
- exports.lowercaseHex = lowercaseHex;
48
- exports.normalizeHexAddress = normalizeHexAddress;
49
- exports.normalizedHexAddressSchema = normalizedHexAddressSchema;
50
- exports.normalizedHexSchema = normalizedHexSchema;
51
- //# sourceMappingURL=QYHNWZK7.cjs.map
52
- //# sourceMappingURL=QYHNWZK7.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/address.ts"],"names":["hexSchema","z","string","refine","data","startsWith","normalizedHexSchema","length","toLowerCase","hexAddressSchema","normalizedHexAddressSchema","lowercaseHex","__name","address","normalizeHexAddress","body","slice","replace","trimmed","denormalizeHexAddress","byteCount","hexZeroPad","base58AddressSchema","isBase58","error"],"mappings":";;;;;;;;;;AAKO,IAAMA,SAAAA,GAAYC,kBAAAA,CACpBC,MAAAA,EAAM,CACNC,MAAAA,CAAO,CAACC,IAAAA,KAAS,OAAOA,IAAAA,KAAS,QAAA,IAAYA,IAAAA,CAAKC,UAAAA,CAAW,IAAA,CAAA;AAE3D,IAAMC,sBAAsBL,kBAAAA,CAAEC,MAAAA,EAAM,CAAGC,MAAAA,CAAO,CAACC,IAAAA,KAAAA;AAElD,EAAA,IAAI,OAAOA,SAAS,QAAA,EAAU;AAC1B,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAI,CAACA,IAAAA,CAAKC,UAAAA,CAAW,IAAA,CAAA,EAAO;AACxB,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAID,IAAAA,CAAKG,UAAU,CAAA,EAAG;AAClB,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAIH,KAAKG,MAAAA,IAAU,CAAA,IAAKH,IAAAA,CAAK,CAAA,MAAO,GAAA,EAAK;AACrC,IAAA,OAAO,KAAA;AACX,EAAA;AAEA,EAAA,IAAIA,IAAAA,CAAKI,WAAAA,EAAW,KAAOJ,IAAAA,EAAM;AAC7B,IAAA,OAAO,KAAA;AACX,EAAA;AACA,EAAA,OAAO,IAAA;AACX,CAAA;AAEO,IAAMK,gBAAAA,GAAmBT;AACzB,IAAMU,0BAAAA,GAA6BJ;AAKnC,IAAMK,+BAAeC,mBAAA,CAAA,CAAmCC,OAAAA,KAC3DA,OAAAA,IAAYA,OAAAA,CAAQL,aAAW,EADP,cAAA;AAGrB,IAAMM,mBAAAA,wCAAuBD,OAAAA,KAAAA;AAEhC,EAAA,MAAME,OAAOF,OAAAA,CAAQG,KAAAA,CAAM,CAAA,CAAA,CAAGC,OAAAA,CAAQ,OAAO,EAAA,CAAA;AAE7C,EAAA,MAAMC,OAAAA,GAAU,QAAQH,IAAAA,IAAQ,GAAA,CAAA;AAChC,EAAA,OAAOG,QAAQV,WAAAA,EAAW;AAC9B,CAAA,EANmC,qBAAA;AAQ5B,IAAMW,wCAAwBP,mBAAA,CAAA,CACjCC,OAAAA,EACAO,cACaC,sBAAAA,CAAWR,OAAAA,EAA0BO,SAAAA,CAAAA,EAHjB,uBAAA;AAM9B,IAAME,mBAAAA,GAAsBrB,kBAAAA,CAAEC,MAAAA,EAAM,CAAGC,OAAOoB,oBAAAA,EAAU;EAC3DC,KAAAA,EAAO;AACX,CAAA","file":"QYHNWZK7.cjs","sourcesContent":["import z from 'zod/v4';\n\nimport { hexZeroPad, isBase58 } from '@layerzerolabs/common-utils';\nimport type { HexString, NormalizedHexString } from '@layerzerolabs/typescript-utils';\n\nexport const hexSchema = z\n .string()\n .refine((data) => typeof data === 'string' && data.startsWith('0x')) as z.ZodType<HexString>;\n\nexport const normalizedHexSchema = z.string().refine((data) => {\n // normalized hex strings are strings\n if (typeof data !== 'string') {\n return false;\n }\n // normalized hex strings start with 0x\n if (!data.startsWith('0x')) {\n return false;\n }\n // '0x' is not a valid normalized address (expect 0x0)\n if (data.length <= 2) {\n return false;\n }\n // normalized hex strings have no leading 0s (except for edge case (0x0)\n if (data.length >= 4 && data[2] === '0') {\n return false;\n }\n // normalized hex strings are always lowercase\n if (data.toLowerCase() !== data) {\n return false;\n }\n return true;\n}) as any as z.ZodType<NormalizedHexString>;\n\nexport const hexAddressSchema = hexSchema;\nexport const normalizedHexAddressSchema = normalizedHexSchema;\n\nexport type HexAddress = z.infer<typeof hexAddressSchema>;\nexport type NormalizedHexAddress = z.infer<typeof normalizedHexSchema>;\n\nexport const lowercaseHex = <T extends HexAddress | undefined>(address: T): T =>\n address && (address.toLowerCase() as T);\n\nexport const normalizeHexAddress = (address: HexAddress): NormalizedHexAddress => {\n // take the bytes part, remove all 0s\n const body = address.slice(2).replace(/^0+/, '');\n // if the string was e.g., `0x000`, append one 0 so that we have `0x0\n const trimmed = '0x' + (body || '0');\n return trimmed.toLowerCase() as any as NormalizedHexAddress;\n};\n\nexport const denormalizeHexAddress = (\n address: NormalizedHexAddress,\n byteCount: number,\n): HexAddress => hexZeroPad(address as any as string, byteCount);\n\n// Base58 schema for validation\nexport const base58AddressSchema = z.string().refine(isBase58, {\n error: 'Invalid base58 address format',\n});\n\nexport type Base58AddressSchema = z.infer<typeof base58AddressSchema>;\n"]}
package/dist/RINNGVQR.js DELETED
@@ -1,16 +0,0 @@
1
- import { __name } from './VUOMXK5T.js';
2
- import z from 'zod/v4';
3
-
4
- var decimalStringFromBigInt = /* @__PURE__ */ __name((bigInt) => {
5
- return bigInt.toString();
6
- }, "decimalStringFromBigInt");
7
- var decimalStringToBigInt = /* @__PURE__ */ __name((hex) => {
8
- return BigInt(hex);
9
- }, "decimalStringToBigInt");
10
- var decimalStringSchema = z.string().refine((data) => {
11
- return typeof data === "string" && data.match(/^\d+$/) !== null;
12
- });
13
-
14
- export { decimalStringFromBigInt, decimalStringSchema, decimalStringToBigInt };
15
- //# sourceMappingURL=RINNGVQR.js.map
16
- //# sourceMappingURL=RINNGVQR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/bigint.ts"],"names":["decimalStringFromBigInt","bigInt","toString","decimalStringToBigInt","hex","BigInt","decimalStringSchema","z","string","refine","data","match"],"mappings":";;;AAIO,IAAMA,uBAAAA,2BAA2BC,MAAAA,KAAAA;AACpC,EAAA,OAAOA,OAAOC,QAAAA,EAAQ;AAC1B,CAAA,EAFuC,yBAAA;AAIhC,IAAMC,qBAAAA,2BAAyBC,GAAAA,KAAAA;AAClC,EAAA,OAAOC,OAAOD,GAAAA,CAAAA;AAClB,CAAA,EAFqC,uBAAA;AAI9B,IAAME,sBAAsBC,CAAAA,CAAEC,MAAAA,EAAM,CAAGC,MAAAA,CAAO,CAACC,IAAAA,KAAAA;AAClD,EAAA,OAAO,OAAOA,IAAAA,KAAS,QAAA,IAAYA,IAAAA,CAAKC,KAAAA,CAAM,OAAA,CAAA,KAAa,IAAA;AAC/D,CAAA","file":"RINNGVQR.js","sourcesContent":["import z from 'zod/v4';\n\nimport { type DecimalString } from '@layerzerolabs/typescript-utils';\n\nexport const decimalStringFromBigInt = (bigInt: bigint): DecimalString => {\n return bigInt.toString() as any as DecimalString;\n};\n\nexport const decimalStringToBigInt = (hex: DecimalString): bigint => {\n return BigInt(hex as any as string);\n};\n\nexport const decimalStringSchema = z.string().refine((data) => {\n return typeof data === 'string' && data.match(/^\\d+$/) !== null;\n}) as any as z.ZodType<DecimalString>;\n"]}