defi-kit 1.15.2 → 2.0.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/arb1.mjs CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  arb12,
4
4
  createApply,
5
5
  createExportToSafeTransactionBuilder
6
- } from "./chunk-5S7EGMF3.mjs";
7
- import "./chunk-PPWDBQS4.mjs";
6
+ } from "./chunk-QN7LFK2K.mjs";
7
+ import "./chunk-E7RA4BMW.mjs";
8
8
 
9
9
  // src/arb1.ts
10
10
  var apply = createApply(42161);
@@ -0,0 +1,47 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/errors.ts
8
+ var NotFoundError = class extends Error {
9
+ };
10
+ var MintPaused = class extends Error {
11
+ };
12
+
13
+ // src/types.ts
14
+ var Chain = /* @__PURE__ */ ((Chain2) => {
15
+ Chain2["eth"] = "eth";
16
+ Chain2["gno"] = "gno";
17
+ Chain2["arb1"] = "arb1";
18
+ return Chain2;
19
+ })(Chain || {});
20
+
21
+ // src/zx.ts
22
+ import { getAddress } from "ethers";
23
+ import { z } from "zod";
24
+ import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
25
+ extendZodWithOpenApi(z);
26
+ var zx = {
27
+ address: () => z.string().regex(/0x[a-fA-F0-9]{40}/).transform((val, ctx) => {
28
+ try {
29
+ return getAddress(val);
30
+ } catch (e) {
31
+ ctx.addIssue({
32
+ code: z.ZodIssueCode.custom,
33
+ message: "Address checksum is invalid"
34
+ });
35
+ return z.NEVER;
36
+ }
37
+ })
38
+ };
39
+
40
+ export {
41
+ __export,
42
+ NotFoundError,
43
+ MintPaused,
44
+ Chain,
45
+ zx
46
+ };
47
+ //# sourceMappingURL=chunk-E7RA4BMW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/errors.ts","../src/types.ts","../src/zx.ts"],"sourcesContent":["export class NotFoundError extends Error {}\nexport class MintPaused extends Error {}\n","import { SomeZodObject } from \"zod\"\nimport { Permission } from \"zodiac-roles-sdk\"\n\nexport enum Chain {\n eth = \"eth\",\n gno = \"gno\",\n arb1 = \"arb1\",\n}\n\nexport type ActionFunction = (options: any) => Promise<Permission[]>\n\nexport type ProtocolActions = {\n deposit?: ActionFunction\n\n borrow?: ActionFunction\n\n stake?: ActionFunction\n\n claim?: ActionFunction\n\n swap?: ActionFunction\n\n lock?: ActionFunction\n\n delegate?: ActionFunction\n}\n\nexport type ActionName = keyof ProtocolActions\n\n// For registering protocols in the REST API we need zod schemas for the specific parameters of each action\nexport type ProtocolSchemas = { [key in ActionName]?: SomeZodObject }\n","import { getAddress } from \"ethers\"\nimport { z } from \"zod\"\nimport { extendZodWithOpenApi } from \"@asteasolutions/zod-to-openapi\"\n\n// zx = \"zod extension\", providing custom zod types\n\nextendZodWithOpenApi(z)\n\nexport const zx = {\n address: () =>\n z\n .string()\n .regex(/0x[a-fA-F0-9]{40}/)\n .transform((val, ctx) => {\n try {\n return getAddress(val) as `0x${string}`\n } catch (e) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"Address checksum is invalid\",\n })\n return z.NEVER\n }\n }),\n}\n"],"mappings":";;;;;;;AAAO,IAAM,gBAAN,cAA4B,MAAM;AAAC;AACnC,IAAM,aAAN,cAAyB,MAAM;AAAC;;;ACEhC,IAAK,QAAL,kBAAKA,WAAL;AACL,EAAAA,OAAA,SAAM;AACN,EAAAA,OAAA,SAAM;AACN,EAAAA,OAAA,UAAO;AAHG,SAAAA;AAAA,GAAA;;;ACHZ,SAAS,kBAAkB;AAC3B,SAAS,SAAS;AAClB,SAAS,4BAA4B;AAIrC,qBAAqB,CAAC;AAEf,IAAM,KAAK;AAAA,EAChB,SAAS,MACP,EACG,OAAO,EACP,MAAM,mBAAmB,EACzB,UAAU,CAAC,KAAK,QAAQ;AACvB,QAAI;AACF,aAAO,WAAW,GAAG;AAAA,IACvB,SAAS,GAAG;AACV,UAAI,SAAS;AAAA,QACX,MAAM,EAAE,aAAa;AAAA,QACrB,SAAS;AAAA,MACX,CAAC;AACD,aAAO,EAAE;AAAA,IACX;AAAA,EACF,CAAC;AACP;","names":["Chain"]}