@evergonlabs/tmi-protocol-utils 0.10.1 → 0.11.0-rc.1

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/zod.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";var D=Object.create;var o=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var L=(r,e)=>{for(var t in e)o(r,t,{get:e[t],enumerable:!0})},f=(r,e,t,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _(e))!$.call(r,i)&&i!==t&&o(r,i,{get:()=>e[i],enumerable:!(c=P(e,i))||c.enumerable});return r};var a=(r,e,t)=>(t=r!=null?D(M(r)):{},f(e||!r||!r.__esModule?o(t,"default",{value:r,enumerable:!0}):t,r)),C=r=>f(o({},"__esModule",{value:!0}),r);var sr={};L(sr,{AbiSchema:()=>Y,AddressSchema:()=>Q,HashSchema:()=>X,HexStringSchema:()=>V,HttpsUrlSchema:()=>or,ISODate:()=>er,ISOJson:()=>A,Int256BigInt:()=>nr,IpfsUrlSchema:()=>ir,PercentageSchema:()=>ar,toISOJson:()=>rr,z:()=>m.z});module.exports=C(sr);var dr=require("@hono/zod-openapi"),m=require("zod");var g=a(require("zod"),1),s=require("zod"),R=a(require("zod"),1),p=a(require("zod"),1),n=require("zod"),u=require("zod"),k=a(require("zod"),1),F=a(require("zod"),1),b=a(require("zod"),1),l=require("zod"),x=require("zod"),v=require("zod"),y=require("viem"),w=require("zod"),T=require("viem"),J=require("zod"),G=require("viem"),K=require("zod"),B=require("viem"),E=require("zod"),pr=g.default.number().int().transform(r=>r);var cr=s.z.object({name:s.z.string(),message:s.z.string()});var Z=n.z.union([n.z.string(),n.z.number(),n.z.bigint()]),fr=n.z.union([n.z.string(),n.z.number()]),j=n.z.string().transform(r=>r.replace(",",".")).refine(r=>!isNaN(Number(r)),{message:"Invalid number format"}).transform(r=>Number(r)),gr=h(r=>r),hr=h(r=>r.min(BigInt(0)));function h(r){return Z.pipe(r(p.default.coerce.bigint()))}var S=p.default.string().brand("Int256");var d=u.z.string().refine(r=>!Number.isNaN(new Date(r).getTime()),{message:"Invalid ISO 8601 date string"}).brand();var W=b.default.number().refine(r=>Math.abs(Math.round(r*100)-r*100)<1e-9,{message:"Percentage can have at most 2 decimal places"}).transform(r=>r),I=j.pipe(W),q=new RegExp(/^\+?(?:[0-9]{1,3})?[-. (]*[0-9]{1,4}[-. )]*(?:[0-9]{1,4}[-. ]*){1,3}[0-9]{1,4}$/),Sr=l.z.string().min(7).regex(q,"Invalid phone number"),z=x.z.string().url().refine(r=>r.startsWith("https://"),{message:"URL must start with https://"}),N=v.z.string().regex(/^ipfs:\/\S+$/,{message:"Must start with ipfs://"}),H=w.z.string().refine(r=>(0,y.isAddress)(r),{message:"Not a valid address string"}).transform(r=>r),O=J.z.string().refine(r=>(0,T.isHex)(r),{message:"Not a valid Hexademical string"}).transform(r=>r);var U=E.z.string().refine(r=>(0,B.isHash)(r),{message:"Not a valid transaction hash string"}).transform(r=>r);var Q=H.openapi({type:"string",example:"0x0000000000000000000000000000000000000000"}),V=O.openapi({type:"string",example:"0x"}),X=U.openapi({type:"string",minLength:66,maxLength:66,example:"0x02dfb1fcdb76a64b88e5b31ab393bf3302e2fade282123bd9ca473d0e26a25df",description:"Transaction hash"}),Y=m.z.array(m.z.any()).openapi({description:"ABI of a contract. Can be used for contract output decode.",type:"array"}),A=d.openapi({description:"Date in ISO format"});function rr(r){return r.toISOString()}function er(r){return A.transform(e=>{let t=new Date(e);return r&&r.parse(t),t})}var tr=S.openapi({description:"Big integer 256 bit"});function nr(r){return tr.transform(e=>{let t=BigInt(e);return r&&r.parse(t),t}).openapi({example:"42",type:"integer"})}var ar=I.openapi({description:"Percentage in basis points, i.e. 10000bp = 100%"}),ir=N.openapi({type:"string",example:"ipfs://"}),or=z.openapi({type:"string",example:"https://example.com"});0&&(module.exports={AbiSchema,AddressSchema,HashSchema,HexStringSchema,HttpsUrlSchema,ISODate,ISOJson,Int256BigInt,IpfsUrlSchema,PercentageSchema,toISOJson,z});
2
+ //# sourceMappingURL=zod.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/zod/index.ts","../../../node_modules/.pnpm/@evergonlabs+tmi-utils@0.7.1_type-fest@5.4.4_typescript@5.7.3_viem@2.46.2_bufferutil@4._7cc02ca7e0d8885e3df3e197a75c1444/node_modules/@evergonlabs/tmi-utils/dist/models.js"],"sourcesContent":["// eslint-disable-next-line simple-import-sort/imports\nimport \"@hono/zod-openapi\";\nimport { z } from \"zod\";\nimport {\n AddressSchema as _AddressSchema,\n HexStringSchema as _HexStringSchema,\n HttpsUrlSchema as _HttpsUrlSchema,\n Int256Json as _Int256Json,\n IpfsUrlSchema as _IpfsUrlSchema,\n ISODateString,\n PercentageSchema as _PercentageSchema,\n TransactionHashSchema as _TransactionHashSchema,\n} from \"@evergonlabs/tmi-utils/models\";\n\nexport const AddressSchema = _AddressSchema.openapi({\n type: \"string\",\n example: \"0x0000000000000000000000000000000000000000\",\n});\n\nexport const HexStringSchema = _HexStringSchema.openapi({\n type: \"string\",\n example: \"0x\",\n});\n\nexport const HashSchema = _TransactionHashSchema.openapi({\n type: \"string\",\n minLength: 66,\n maxLength: 66,\n example: \"0x02dfb1fcdb76a64b88e5b31ab393bf3302e2fade282123bd9ca473d0e26a25df\",\n description: \"Transaction hash\",\n});\n\nexport const AbiSchema = z.array(z.any()).openapi({\n description: \"ABI of a contract. Can be used for contract output decode.\",\n type: \"array\",\n});\n\nexport const ISOJson = ISODateString.openapi({\n description: \"Date in ISO format\",\n});\n\nexport type IISOJson = z.output<typeof ISOJson>;\n\nexport function toISOJson(date: Date): IISOJson {\n return date.toISOString() as IISOJson;\n}\n\nexport function ISODate(validator?: z.ZodDate) {\n return ISOJson.transform((x) => {\n const val = new Date(x);\n if (validator) validator.parse(val);\n return val;\n });\n}\n\nconst Int256Json = _Int256Json.openapi({\n description: \"Big integer 256 bit\",\n});\n\nexport function Int256BigInt(validator?: z.ZodBigInt) {\n return Int256Json.transform((x) => {\n const val = BigInt(x);\n if (validator) validator.parse(val);\n return val;\n }).openapi({\n example: \"42\",\n type: \"integer\",\n });\n}\n\nexport const PercentageSchema = _PercentageSchema.openapi({\n description: \"Percentage in basis points, i.e. 10000bp = 100%\",\n});\n\nexport const IpfsUrlSchema = _IpfsUrlSchema.openapi({\n type: \"string\",\n example: \"ipfs://\",\n});\n\nexport const HttpsUrlSchema = _HttpsUrlSchema.openapi({\n type: \"string\",\n example: \"https://example.com\",\n});\n\nexport { z };\n","// src/models/basisPoints/basisPoints.ts\nimport z from \"zod\";\nvar BasisPointsSchema = z.number().int().transform((x) => x);\nfunction bpToFixedPercentage(basisPoints) {\n if (!Number.isInteger(basisPoints)) {\n throw new Error(`Basis points must be an integer, got ${basisPoints}`);\n }\n if (basisPoints < 0 || basisPoints > 1e4) {\n throw new Error(`Basis points must be in [0, 10000], got ${basisPoints}`);\n }\n return BigInt(basisPoints) * 100n;\n}\n\n// src/models/errorLike.ts\nimport { z as z2 } from \"zod\";\nvar ErrorLikeSchema = z2.object({\n name: z2.string(),\n message: z2.string()\n});\n\n// src/models/htmlString.ts\nvar HtmlString = (schema) => schema.refine((data) => HTML_PATTERN.test(data), {\n message: \"Invalid HTML format\"\n});\nvar HTML_PATTERN = /<\\/?[a-z][\\s\\S]*>/i;\n\n// src/models/id.ts\nimport z3 from \"zod\";\nfunction IdSchema(brandName) {\n return z3.string().brand(brandName);\n}\n\n// src/models/int256.ts\nimport z5 from \"zod\";\n\n// src/models/numberish/numberish.ts\nimport { z as z4 } from \"zod\";\nvar NumberishSchema = z4.union([z4.string(), z4.number(), z4.bigint()]);\nvar NumberishJsonSchema = z4.union([z4.string(), z4.number()]);\nvar StringNumberSchema = z4.string().transform((x) => x.replace(\",\", \".\")).refine((x) => !isNaN(Number(x)), { message: \"Invalid number format\" }).transform((x) => Number(x));\n\n// src/models/int256.ts\nvar Int256 = createInt256((x) => x);\nvar Int256Positive = createInt256((x) => x.min(BigInt(0)));\nfunction createInt256(corce) {\n return NumberishSchema.pipe(corce(z5.coerce.bigint()));\n}\nvar Int256Json = z5.string().brand(\"Int256\");\nfunction toInt256Json(value) {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n if (typeof value === \"number\") {\n if (!Number.isSafeInteger(value)) {\n throw new Error(`Number ${value} is not a safe integer and cannot be converted to bigint`);\n }\n return value.toString();\n }\n if (typeof value === \"string\") {\n if (value.trim().length === 0) {\n throw new Error(\"String cannot be empty\");\n }\n try {\n return value.trim();\n } catch {\n throw new Error(`String \"${value}\" is not a valid bigint`);\n }\n }\n throw new Error(`Invalid type: ${typeof value}`);\n}\n\n// src/models/isoString/isoString.ts\nimport { z as z6 } from \"zod\";\nvar ISODateString = z6.string().refine((value) => !Number.isNaN(new Date(value).getTime()), {\n message: \"Invalid ISO 8601 date string\"\n}).brand();\n\n// src/models/nullableInput.ts\nimport z7 from \"zod\";\nfunction NullableInput(schema) {\n return z7.nullable(schema).pipe(schema);\n}\n\n// src/models/nullableString.ts\nimport z8 from \"zod\";\nfunction NullableString(base) {\n return z8.nullable(base ?? z8.string()).transform((x) => x === \"\" ? null : x);\n}\n\n// src/models/percentage/percentage.ts\nimport z9 from \"zod\";\nfunction percentageToBp(percentage) {\n const basis = Math.round(percentage * 100);\n if (Math.abs(basis - percentage * 100) > 1e-9) {\n throw new Error(\"Too many decimals, expected 2\");\n }\n return basis;\n}\nfunction bpToPercentage(bps) {\n return bps / 100;\n}\nvar PercentageNumber = z9.number().refine((val) => Math.abs(Math.round(val * 100) - val * 100) < 1e-9, {\n message: \"Percentage can have at most 2 decimal places\"\n}).transform((x) => x);\nvar PercentageSchema = StringNumberSchema.pipe(PercentageNumber);\n\n// src/models/phoneNumber/phoneNumber.ts\nimport { z as z10 } from \"zod\";\nvar phoneRegex = new RegExp(/^\\+?(?:[0-9]{1,3})?[-. (]*[0-9]{1,4}[-. )]*(?:[0-9]{1,4}[-. ]*){1,3}[0-9]{1,4}$/);\nvar PhoneNumberSchema = z10.string().min(7).regex(phoneRegex, \"Invalid phone number\");\n\n// src/models/uri/https.ts\nimport { z as z11 } from \"zod\";\nvar HttpsUrlSchema = z11.string().url().refine((val) => val.startsWith(\"https://\"), {\n message: \"URL must start with https://\"\n});\n\n// src/models/uri/ipfs.ts\nimport { z as z12 } from \"zod\";\nvar IpfsUrlSchema = z12.string().regex(/^ipfs:\\/\\S+$/, {\n message: \"Must start with ipfs://\"\n});\n\n// src/models/viem/address.ts\nimport { isAddress } from \"viem\";\nimport { z as z13 } from \"zod\";\nvar AddressSchema = z13.string().refine((x) => isAddress(x), { message: \"Not a valid address string\" }).transform((x) => x);\n\n// src/models/viem/hex.ts\nimport { isHex } from \"viem\";\nimport { z as z14 } from \"zod\";\nvar HexStringSchema = z14.string().refine((x) => isHex(x), { message: \"Not a valid Hexademical string\" }).transform((x) => x);\n\n// src/models/viem/supportedChainId.ts\nimport { extractChain } from \"viem\";\nimport { z as z15 } from \"zod\";\nfunction SupportedChainIds(chains) {\n const literals = chains.map((chain) => z15.literal(chain.id));\n return z15.union(literals);\n}\nfunction createSupportedChains(chains) {\n const Schema = SupportedChainIds(chains);\n return {\n Schema,\n chains,\n chainIds: chains.map((x) => x.id),\n isSupported: (chainId) => !!chains.find((x) => x.id === chainId),\n get: (chainId) => extractChain({ chains, id: chainId })\n };\n}\n\n// src/models/viem/transactionHash.ts\nimport { isHash } from \"viem\";\nimport { z as z16 } from \"zod\";\nvar TransactionHashSchema = z16.string().refine((x) => isHash(x), { message: \"Not a valid transaction hash string\" }).transform((x) => x);\nexport {\n AddressSchema,\n BasisPointsSchema,\n ErrorLikeSchema,\n HexStringSchema,\n HtmlString,\n HttpsUrlSchema,\n ISODateString,\n IdSchema,\n Int256,\n Int256Json,\n Int256Positive,\n IpfsUrlSchema,\n NullableInput,\n NullableString,\n NumberishJsonSchema,\n NumberishSchema,\n PercentageNumber,\n PercentageSchema,\n PhoneNumberSchema,\n StringNumberSchema,\n SupportedChainIds,\n TransactionHashSchema,\n bpToFixedPercentage,\n bpToPercentage,\n createInt256,\n createSupportedChains,\n percentageToBp,\n toInt256Json\n};\n"],"mappings":"0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,eAAAE,EAAA,kBAAAC,EAAA,eAAAC,EAAA,oBAAAC,EAAA,mBAAAC,GAAA,YAAAC,GAAA,YAAAC,EAAA,iBAAAC,GAAA,kBAAAC,GAAA,qBAAAC,GAAA,cAAAC,GAAA,2BAAAC,EAAAb,IACA,IAAAc,GAAO,6BACPC,EAAkB,eCDlB,IAAAC,EAAc,oBAadA,EAAwB,eAaxBA,EAAe,oBAMfA,EAAe,oBAGfA,EAAwB,eAoCxBA,EAAwB,eAMxBA,EAAe,oBAMfA,EAAe,oBAMfA,EAAe,oBAiBfA,EAAyB,eAKzBA,EAAyB,eAMzBA,EAAyB,eAMzBC,EAA0B,gBAC1BD,EAAyB,eAIzBC,EAAsB,gBACtBD,EAAyB,eAIzBC,EAA6B,gBAC7BD,EAAyB,eAiBzBC,EAAuB,gBACvBD,EAAyB,eAvJrBE,GAAoB,EAAAC,QAAE,OAAO,EAAE,IAAI,EAAE,UAAWC,GAAMA,CAAC,EAa3D,IAAIC,GAAkB,EAAAC,EAAG,OAAO,CAC9B,KAAM,EAAAA,EAAG,OAAO,EAChB,QAAS,EAAAA,EAAG,OAAO,CACrB,CAAC,EAmBD,IAAIC,EAAkB,EAAAC,EAAG,MAAM,CAAC,EAAAA,EAAG,OAAO,EAAG,EAAAA,EAAG,OAAO,EAAG,EAAAA,EAAG,OAAO,CAAC,CAAC,EAClEC,GAAsB,EAAAD,EAAG,MAAM,CAAC,EAAAA,EAAG,OAAO,EAAG,EAAAA,EAAG,OAAO,CAAC,CAAC,EACzDE,EAAqB,EAAAF,EAAG,OAAO,EAAE,UAAWG,GAAMA,EAAE,QAAQ,IAAK,GAAG,CAAC,EAAE,OAAQA,GAAM,CA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AS,qBACX,CAAC","names":["zod_exports","__export","AbiSchema","AddressSchema","HashSchema","HexStringSchema","HttpsUrlSchema","ISODate","ISOJson","Int256BigInt","IpfsUrlSchema","PercentageSchema","toISOJson","__toCommonJS","import_zod_openapi","import_zod","import_zod","import_viem","BasisPointsSchema","z","x","ErrorLikeSchema","z2","NumberishSchema","z4","NumberishJsonSchema","StringNumberSchema","x","Int256","createInt256","Int256Positive","corce","z5","Int256Json","ISODateString","z6","value","PercentageNumber","z9","val","x","PercentageSchema","StringNumberSchema","phoneRegex","PhoneNumberSchema","z10","HttpsUrlSchema","z11","IpfsUrlSchema","z12","AddressSchema","z13","HexStringSchema","z14","TransactionHashSchema","z16","x","AddressSchema","HexStringSchema","HashSchema","TransactionHashSchema","AbiSchema","ISOJson","ISODateString","toISOJson","date","ISODate","validator","x","val","Int256Json","Int256BigInt","PercentageSchema","IpfsUrlSchema","HttpsUrlSchema"]}
package/dist/zod.d.cts ADDED
@@ -0,0 +1,18 @@
1
+ import * as _evergonlabs_tmi_utils_models from '@evergonlabs/tmi-utils/models';
2
+ import { z } from 'zod';
3
+ export { z } from 'zod';
4
+
5
+ declare const AddressSchema: z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>;
6
+ declare const HexStringSchema: z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>;
7
+ declare const HashSchema: z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>;
8
+ declare const AbiSchema: z.ZodArray<z.ZodAny>;
9
+ declare const ISOJson: z.core.$ZodBranded<z.ZodString, "IsoDateString", "out">;
10
+ type IISOJson = z.output<typeof ISOJson>;
11
+ declare function toISOJson(date: Date): IISOJson;
12
+ declare function ISODate(validator?: z.ZodDate): z.ZodPipe<z.core.$ZodBranded<z.ZodString, "IsoDateString", "out">, z.ZodTransform<Date, string & z.core.$brand<"IsoDateString">>>;
13
+ declare function Int256BigInt(validator?: z.ZodBigInt): z.ZodPipe<z.core.$ZodBranded<z.ZodString, "Int256", "out">, z.ZodTransform<bigint, string & z.core.$brand<"Int256">>>;
14
+ declare const PercentageSchema: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<_evergonlabs_tmi_utils_models.IPercentageValue, number>>>;
15
+ declare const IpfsUrlSchema: z.ZodString;
16
+ declare const HttpsUrlSchema: z.ZodString;
17
+
18
+ export { AbiSchema, AddressSchema, HashSchema, HexStringSchema, HttpsUrlSchema, type IISOJson, ISODate, ISOJson, Int256BigInt, IpfsUrlSchema, PercentageSchema, toISOJson };
package/dist/zod.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ import * as _evergonlabs_tmi_utils_models from '@evergonlabs/tmi-utils/models';
2
+ import { z } from 'zod';
3
+ export { z } from 'zod';
4
+
5
+ declare const AddressSchema: z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>;
6
+ declare const HexStringSchema: z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>;
7
+ declare const HashSchema: z.ZodPipe<z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>, z.ZodTransform<`0x${string}`, `0x${string}`>>;
8
+ declare const AbiSchema: z.ZodArray<z.ZodAny>;
9
+ declare const ISOJson: z.core.$ZodBranded<z.ZodString, "IsoDateString", "out">;
10
+ type IISOJson = z.output<typeof ISOJson>;
11
+ declare function toISOJson(date: Date): IISOJson;
12
+ declare function ISODate(validator?: z.ZodDate): z.ZodPipe<z.core.$ZodBranded<z.ZodString, "IsoDateString", "out">, z.ZodTransform<Date, string & z.core.$brand<"IsoDateString">>>;
13
+ declare function Int256BigInt(validator?: z.ZodBigInt): z.ZodPipe<z.core.$ZodBranded<z.ZodString, "Int256", "out">, z.ZodTransform<bigint, string & z.core.$brand<"Int256">>>;
14
+ declare const PercentageSchema: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<_evergonlabs_tmi_utils_models.IPercentageValue, number>>>;
15
+ declare const IpfsUrlSchema: z.ZodString;
16
+ declare const HttpsUrlSchema: z.ZodString;
17
+
18
+ export { AbiSchema, AddressSchema, HashSchema, HexStringSchema, HttpsUrlSchema, type IISOJson, ISODate, ISOJson, Int256BigInt, IpfsUrlSchema, PercentageSchema, toISOJson };
package/dist/zod.js ADDED
@@ -0,0 +1,2 @@
1
+ import"@hono/zod-openapi";import{z as u}from"zod";import d from"zod";import{z as a}from"zod";import L from"zod";import i from"zod";import{z as e}from"zod";import{z as l}from"zod";import q from"zod";import K from"zod";import x from"zod";import{z as v}from"zod";import{z as y}from"zod";import{z as w}from"zod";import{isAddress as H}from"viem";import{z as T}from"zod";import{isHex as J}from"viem";import{z as O}from"zod";import{extractChain as or}from"viem";import{z as mr}from"zod";import{isHash as B}from"viem";import{z as E}from"zod";var P=d.number().int().transform(r=>r);var M=a.object({name:a.string(),message:a.string()});var b=e.union([e.string(),e.number(),e.bigint()]),Z=e.union([e.string(),e.number()]),I=e.string().transform(r=>r.replace(",",".")).refine(r=>!isNaN(Number(r)),{message:"Invalid number format"}).transform(r=>Number(r)),j=o(r=>r),k=o(r=>r.min(BigInt(0)));function o(r){return b.pipe(r(i.coerce.bigint()))}var s=i.string().brand("Int256");var m=l.string().refine(r=>!Number.isNaN(new Date(r).getTime()),{message:"Invalid ISO 8601 date string"}).brand();var z=x.number().refine(r=>Math.abs(Math.round(r*100)-r*100)<1e-9,{message:"Percentage can have at most 2 decimal places"}).transform(r=>r),p=I.pipe(z),N=new RegExp(/^\+?(?:[0-9]{1,3})?[-. (]*[0-9]{1,4}[-. )]*(?:[0-9]{1,4}[-. ]*){1,3}[0-9]{1,4}$/),X=v.string().min(7).regex(N,"Invalid phone number"),c=y.string().url().refine(r=>r.startsWith("https://"),{message:"URL must start with https://"}),f=w.string().regex(/^ipfs:\/\S+$/,{message:"Must start with ipfs://"}),g=T.string().refine(r=>H(r),{message:"Not a valid address string"}).transform(r=>r),h=O.string().refine(r=>J(r),{message:"Not a valid Hexademical string"}).transform(r=>r);var S=E.string().refine(r=>B(r),{message:"Not a valid transaction hash string"}).transform(r=>r);var ur=g.openapi({type:"string",example:"0x0000000000000000000000000000000000000000"}),dr=h.openapi({type:"string",example:"0x"}),br=S.openapi({type:"string",minLength:66,maxLength:66,example:"0x02dfb1fcdb76a64b88e5b31ab393bf3302e2fade282123bd9ca473d0e26a25df",description:"Transaction hash"}),Ir=u.array(u.any()).openapi({description:"ABI of a contract. Can be used for contract output decode.",type:"array"}),U=m.openapi({description:"Date in ISO format"});function lr(r){return r.toISOString()}function xr(r){return U.transform(n=>{let t=new Date(n);return r&&r.parse(t),t})}var A=s.openapi({description:"Big integer 256 bit"});function zr(r){return A.transform(n=>{let t=BigInt(n);return r&&r.parse(t),t}).openapi({example:"42",type:"integer"})}var vr=p.openapi({description:"Percentage in basis points, i.e. 10000bp = 100%"}),Nr=f.openapi({type:"string",example:"ipfs://"}),yr=c.openapi({type:"string",example:"https://example.com"});export{Ir as AbiSchema,ur as AddressSchema,br as HashSchema,dr as HexStringSchema,yr as HttpsUrlSchema,xr as ISODate,U as ISOJson,zr as Int256BigInt,Nr as IpfsUrlSchema,vr as PercentageSchema,lr as toISOJson,u as z};
2
+ //# sourceMappingURL=zod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/zod/index.ts","../../../node_modules/.pnpm/@evergonlabs+tmi-utils@0.7.1_type-fest@5.4.4_typescript@5.7.3_viem@2.46.2_bufferutil@4._7cc02ca7e0d8885e3df3e197a75c1444/node_modules/@evergonlabs/tmi-utils/dist/models.js"],"sourcesContent":["// eslint-disable-next-line simple-import-sort/imports\nimport \"@hono/zod-openapi\";\nimport { z } from \"zod\";\nimport {\n AddressSchema as _AddressSchema,\n HexStringSchema as _HexStringSchema,\n HttpsUrlSchema as _HttpsUrlSchema,\n Int256Json as _Int256Json,\n IpfsUrlSchema as _IpfsUrlSchema,\n ISODateString,\n PercentageSchema as _PercentageSchema,\n TransactionHashSchema as _TransactionHashSchema,\n} from \"@evergonlabs/tmi-utils/models\";\n\nexport const AddressSchema = _AddressSchema.openapi({\n type: \"string\",\n example: \"0x0000000000000000000000000000000000000000\",\n});\n\nexport const HexStringSchema = _HexStringSchema.openapi({\n type: \"string\",\n example: \"0x\",\n});\n\nexport const HashSchema = _TransactionHashSchema.openapi({\n type: \"string\",\n minLength: 66,\n maxLength: 66,\n example: \"0x02dfb1fcdb76a64b88e5b31ab393bf3302e2fade282123bd9ca473d0e26a25df\",\n description: \"Transaction hash\",\n});\n\nexport const AbiSchema = z.array(z.any()).openapi({\n description: \"ABI of a contract. Can be used for contract output decode.\",\n type: \"array\",\n});\n\nexport const ISOJson = ISODateString.openapi({\n description: \"Date in ISO format\",\n});\n\nexport type IISOJson = z.output<typeof ISOJson>;\n\nexport function toISOJson(date: Date): IISOJson {\n return date.toISOString() as IISOJson;\n}\n\nexport function ISODate(validator?: z.ZodDate) {\n return ISOJson.transform((x) => {\n const val = new Date(x);\n if (validator) validator.parse(val);\n return val;\n });\n}\n\nconst Int256Json = _Int256Json.openapi({\n description: \"Big integer 256 bit\",\n});\n\nexport function Int256BigInt(validator?: z.ZodBigInt) {\n return Int256Json.transform((x) => {\n const val = BigInt(x);\n if (validator) validator.parse(val);\n return val;\n }).openapi({\n example: \"42\",\n type: \"integer\",\n });\n}\n\nexport const PercentageSchema = _PercentageSchema.openapi({\n description: \"Percentage in basis points, i.e. 10000bp = 100%\",\n});\n\nexport const IpfsUrlSchema = _IpfsUrlSchema.openapi({\n type: \"string\",\n example: \"ipfs://\",\n});\n\nexport const HttpsUrlSchema = _HttpsUrlSchema.openapi({\n type: \"string\",\n example: \"https://example.com\",\n});\n\nexport { z };\n","// src/models/basisPoints/basisPoints.ts\nimport z from \"zod\";\nvar BasisPointsSchema = z.number().int().transform((x) => x);\nfunction bpToFixedPercentage(basisPoints) {\n if (!Number.isInteger(basisPoints)) {\n throw new Error(`Basis points must be an integer, got ${basisPoints}`);\n }\n if (basisPoints < 0 || basisPoints > 1e4) {\n throw new Error(`Basis points must be in [0, 10000], got ${basisPoints}`);\n }\n return BigInt(basisPoints) * 100n;\n}\n\n// src/models/errorLike.ts\nimport { z as z2 } from \"zod\";\nvar ErrorLikeSchema = z2.object({\n name: z2.string(),\n message: z2.string()\n});\n\n// src/models/htmlString.ts\nvar HtmlString = (schema) => schema.refine((data) => HTML_PATTERN.test(data), {\n message: \"Invalid HTML format\"\n});\nvar HTML_PATTERN = /<\\/?[a-z][\\s\\S]*>/i;\n\n// src/models/id.ts\nimport z3 from \"zod\";\nfunction IdSchema(brandName) {\n return z3.string().brand(brandName);\n}\n\n// src/models/int256.ts\nimport z5 from \"zod\";\n\n// src/models/numberish/numberish.ts\nimport { z as z4 } from \"zod\";\nvar NumberishSchema = z4.union([z4.string(), z4.number(), z4.bigint()]);\nvar NumberishJsonSchema = z4.union([z4.string(), z4.number()]);\nvar StringNumberSchema = z4.string().transform((x) => x.replace(\",\", \".\")).refine((x) => !isNaN(Number(x)), { message: \"Invalid number format\" }).transform((x) => Number(x));\n\n// src/models/int256.ts\nvar Int256 = createInt256((x) => x);\nvar Int256Positive = createInt256((x) => x.min(BigInt(0)));\nfunction createInt256(corce) {\n return NumberishSchema.pipe(corce(z5.coerce.bigint()));\n}\nvar Int256Json = z5.string().brand(\"Int256\");\nfunction toInt256Json(value) {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n if (typeof value === \"number\") {\n if (!Number.isSafeInteger(value)) {\n throw new Error(`Number ${value} is not a safe integer and cannot be converted to bigint`);\n }\n return value.toString();\n }\n if (typeof value === \"string\") {\n if (value.trim().length === 0) {\n throw new Error(\"String cannot be empty\");\n }\n try {\n return value.trim();\n } catch {\n throw new Error(`String \"${value}\" is not a valid bigint`);\n }\n }\n throw new Error(`Invalid type: ${typeof value}`);\n}\n\n// src/models/isoString/isoString.ts\nimport { z as z6 } from \"zod\";\nvar ISODateString = z6.string().refine((value) => !Number.isNaN(new Date(value).getTime()), {\n message: \"Invalid ISO 8601 date string\"\n}).brand();\n\n// src/models/nullableInput.ts\nimport z7 from \"zod\";\nfunction NullableInput(schema) {\n return z7.nullable(schema).pipe(schema);\n}\n\n// src/models/nullableString.ts\nimport z8 from \"zod\";\nfunction NullableString(base) {\n return z8.nullable(base ?? z8.string()).transform((x) => x === \"\" ? null : x);\n}\n\n// src/models/percentage/percentage.ts\nimport z9 from \"zod\";\nfunction percentageToBp(percentage) {\n const basis = Math.round(percentage * 100);\n if (Math.abs(basis - percentage * 100) > 1e-9) {\n throw new Error(\"Too many decimals, expected 2\");\n }\n return basis;\n}\nfunction bpToPercentage(bps) {\n return bps / 100;\n}\nvar PercentageNumber = z9.number().refine((val) => Math.abs(Math.round(val * 100) - val * 100) < 1e-9, {\n message: \"Percentage can have at most 2 decimal places\"\n}).transform((x) => x);\nvar PercentageSchema = StringNumberSchema.pipe(PercentageNumber);\n\n// src/models/phoneNumber/phoneNumber.ts\nimport { z as z10 } from \"zod\";\nvar phoneRegex = new RegExp(/^\\+?(?:[0-9]{1,3})?[-. (]*[0-9]{1,4}[-. )]*(?:[0-9]{1,4}[-. ]*){1,3}[0-9]{1,4}$/);\nvar PhoneNumberSchema = z10.string().min(7).regex(phoneRegex, \"Invalid phone number\");\n\n// src/models/uri/https.ts\nimport { z as z11 } from \"zod\";\nvar HttpsUrlSchema = z11.string().url().refine((val) => val.startsWith(\"https://\"), {\n message: \"URL must start with https://\"\n});\n\n// src/models/uri/ipfs.ts\nimport { z as z12 } from \"zod\";\nvar IpfsUrlSchema = z12.string().regex(/^ipfs:\\/\\S+$/, {\n message: \"Must start with ipfs://\"\n});\n\n// src/models/viem/address.ts\nimport { isAddress } from \"viem\";\nimport { z as z13 } from \"zod\";\nvar AddressSchema = z13.string().refine((x) => isAddress(x), { message: \"Not a valid address string\" }).transform((x) => x);\n\n// src/models/viem/hex.ts\nimport { isHex } from \"viem\";\nimport { z as z14 } from \"zod\";\nvar HexStringSchema = z14.string().refine((x) => isHex(x), { message: \"Not a valid Hexademical string\" }).transform((x) => x);\n\n// src/models/viem/supportedChainId.ts\nimport { extractChain } from \"viem\";\nimport { z as z15 } from \"zod\";\nfunction SupportedChainIds(chains) {\n const literals = chains.map((chain) => z15.literal(chain.id));\n return z15.union(literals);\n}\nfunction createSupportedChains(chains) {\n const Schema = SupportedChainIds(chains);\n return {\n Schema,\n chains,\n chainIds: chains.map((x) => x.id),\n isSupported: (chainId) => !!chains.find((x) => x.id === chainId),\n get: (chainId) => extractChain({ chains, id: chainId })\n };\n}\n\n// src/models/viem/transactionHash.ts\nimport { isHash } from \"viem\";\nimport { z as z16 } from \"zod\";\nvar TransactionHashSchema = z16.string().refine((x) => isHash(x), { message: \"Not a valid transaction hash string\" }).transform((x) => x);\nexport {\n AddressSchema,\n BasisPointsSchema,\n ErrorLikeSchema,\n HexStringSchema,\n HtmlString,\n HttpsUrlSchema,\n ISODateString,\n IdSchema,\n Int256,\n Int256Json,\n Int256Positive,\n IpfsUrlSchema,\n NullableInput,\n NullableString,\n NumberishJsonSchema,\n NumberishSchema,\n PercentageNumber,\n PercentageSchema,\n PhoneNumberSchema,\n StringNumberSchema,\n SupportedChainIds,\n TransactionHashSchema,\n bpToFixedPercentage,\n bpToPercentage,\n createInt256,\n createSupportedChains,\n percentageToBp,\n toInt256Json\n};\n"],"mappings":"AACA,MAAO,oBACP,OAAS,KAAAA,MAAS,MCDlB,O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,GAAaC,EAAuB,QAAQ,CACvD,KAAM,SACN,UAAW,GACX,UAAW,GACX,QAAS,qEACT,YAAa,kBACf,CAAC,EAEYC,GAAYC,EAAE,MAAMA,EAAE,IAAI,CAAC,EAAE,QAAQ,CAChD,YAAa,6DACb,KAAM,OACR,CAAC,EAEYC,EAAUC,EAAc,QAAQ,CAC3C,YAAa,oBACf,CAAC,EAIM,SAASC,GAAUC,EAAsB,CAC9C,OAAOA,EAAK,YAAY,CAC1B,CAEO,SAASC,GAAQC,EAAuB,CAC7C,OAAOL,EAAQ,UAAWM,GAAM,CAC9B,IAAMC,EAAM,IAAI,KAAKD,CAAC,EACtB,OAAID,GAAWA,EAAU,MAAME,CAAG,EAC3BA,CACT,CAAC,CACH,CAEA,IAAMC,EAAaA,EAAY,QAAQ,CACrC,YAAa,qBACf,CAAC,EAEM,SAASC,GAAaJ,EAAyB,CACpD,OAAOG,EAAW,UAAWF,GAAM,CACjC,IAAMC,EAAM,OAAOD,CAAC,EACpB,OAAID,GAAWA,EAAU,MAAME,CAAG,EAC3BA,CACT,CAAC,EAAE,QAAQ,CACT,QAAS,KACT,KAAM,SACR,CAAC,CACH,CAEO,IAAMG,GAAmBA,EAAkB,QAAQ,CACxD,YAAa,iDACf,CAAC,EAEYC,GAAgBA,EAAe,QAAQ,CAClD,KAAM,SACN,QAAS,SACX,CAAC,EAEYC,GAAiBA,EAAgB,QAAQ,CACpD,KAAM,SACN,QAAS,qBACX,CAAC","names":["z","z","z2","z3","z5","z4","z6","z7","z8","z9","z10","z11","z12","isAddress","z13","isHex","z14","extractChain","z15","isHash","z16","BasisPointsSchema","x","ErrorLikeSchema","z2","NumberishSchema","z4","NumberishJsonSchema","StringNumberSchema","x","Int256","createInt256","Int256Positive","corce","z5","Int256Json","ISODateString","z6","value","PercentageNumber","z9","val","x","PercentageSchema","StringNumberSchema","phoneRegex","PhoneNumberSchema","z10","HttpsUrlSchema","z11","IpfsUrlSchema","z12","AddressSchema","z13","isAddress","HexStringSchema","z14","isHex","TransactionHashSchema","z16","x","isHash","AddressSchema","HexStringSchema","HashSchema","TransactionHashSchema","AbiSchema","z","ISOJson","ISODateString","toISOJson","date","ISODate","validator","x","val","Int256Json","Int256BigInt","PercentageSchema","IpfsUrlSchema","HttpsUrlSchema"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evergonlabs/tmi-protocol-utils",
3
- "version": "0.10.1",
3
+ "version": "0.11.0-rc.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -23,17 +23,25 @@
23
23
  "import": "./dist/typeUtils.js",
24
24
  "types": "./dist/typeUtils.d.ts",
25
25
  "default": "./dist/typeUtils.cjs"
26
+ },
27
+ "./zod": {
28
+ "import": "./dist/zod.js",
29
+ "types": "./dist/zod.d.ts",
30
+ "default": "./dist/zod.cjs"
26
31
  }
27
32
  },
28
33
  "files": [
29
34
  "dist"
30
35
  ],
31
36
  "dependencies": {
32
- "@evergonlabs/tmi-protocol-types": "0.10.1"
37
+ "@hono/zod-openapi": "^1.2.1",
38
+ "zod": "^4.3.6",
39
+ "@evergonlabs/tmi-protocol-types": "0.11.0-rc.1"
33
40
  },
34
41
  "devDependencies": {
35
- "@evergonlabs/tmi-eslint-config": "0.3.0",
36
- "@evergonlabs/tmi-typescript-config": "0.2.1",
42
+ "@evergonlabs/tmi-eslint-config": "0.7.1",
43
+ "@evergonlabs/tmi-typescript-config": "0.7.1",
44
+ "@evergonlabs/tmi-utils": "0.7.1",
37
45
  "eslint": "^9.39.2",
38
46
  "jiti": "^2.4.2",
39
47
  "npm-run-all": "^4.1.5",