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/gno.mjs CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  createExportToSafeTransactionBuilder,
4
4
  gno,
5
5
  gno2
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/gno.ts
10
10
  var apply = createApply(100);
package/dist/index.js CHANGED
@@ -36,19 +36,19 @@ var MintPaused = class extends Error {
36
36
  };
37
37
 
38
38
  // src/encode.ts
39
- var import_utils = require("ethers/lib/utils");
40
- var encodeBytes32String = import_utils.formatBytes32String;
41
- var decodeBytes32String = import_utils.parseBytes32String;
39
+ var import_ethers = require("ethers");
40
+ var encodeBytes32String = import_ethers.encodeBytes32String;
41
+ var decodeBytes32String = import_ethers.decodeBytes32String;
42
42
 
43
43
  // src/zx.ts
44
- var import_utils2 = require("ethers/lib/utils");
44
+ var import_ethers2 = require("ethers");
45
45
  var import_zod = require("zod");
46
46
  var import_zod_to_openapi = require("@asteasolutions/zod-to-openapi");
47
47
  (0, import_zod_to_openapi.extendZodWithOpenApi)(import_zod.z);
48
48
  var zx = {
49
49
  address: () => import_zod.z.string().regex(/0x[a-fA-F0-9]{40}/).transform((val, ctx) => {
50
50
  try {
51
- return (0, import_utils2.getAddress)(val);
51
+ return (0, import_ethers2.getAddress)(val);
52
52
  } catch (e) {
53
53
  ctx.addIssue({
54
54
  code: import_zod.z.ZodIssueCode.custom,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/errors.ts","../src/encode.ts","../src/zx.ts","../src/types.ts"],"sourcesContent":["export * from \"./errors\"\nexport * from \"./encode\"\nexport * from \"./zx\"\nexport * from \"./types\"\n","export class NotFoundError extends Error {}\nexport class MintPaused extends Error {}\n","import { formatBytes32String, parseBytes32String } from \"ethers/lib/utils\"\n\nexport const encodeBytes32String = formatBytes32String as (\n text: string\n) => `0x${string}`\n\nexport const decodeBytes32String = parseBytes32String as (\n bytes: `0x${string}`\n) => string\n","import { getAddress } from \"ethers/lib/utils\"\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","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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,gBAAN,cAA4B,MAAM;AAAC;AACnC,IAAM,aAAN,cAAyB,MAAM;AAAC;;;ACDvC,mBAAwD;AAEjD,IAAM,sBAAsB;AAI5B,IAAM,sBAAsB;;;ACNnC,IAAAA,gBAA2B;AAC3B,iBAAkB;AAClB,4BAAqC;AAAA,IAIrC,4CAAqB,YAAC;AAEf,IAAM,KAAK;AAAA,EAChB,SAAS,MACP,aACG,OAAO,EACP,MAAM,mBAAmB,EACzB,UAAU,CAAC,KAAK,QAAQ;AACvB,QAAI;AACF,iBAAO,0BAAW,GAAG;AAAA,IACvB,SAAS,GAAG;AACV,UAAI,SAAS;AAAA,QACX,MAAM,aAAE,aAAa;AAAA,QACrB,SAAS;AAAA,MACX,CAAC;AACD,aAAO,aAAE;AAAA,IACX;AAAA,EACF,CAAC;AACP;;;ACrBO,IAAK,QAAL,kBAAKC,WAAL;AACL,EAAAA,OAAA,SAAM;AACN,EAAAA,OAAA,SAAM;AACN,EAAAA,OAAA,UAAO;AAHG,SAAAA;AAAA,GAAA;","names":["import_utils","Chain"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/errors.ts","../src/encode.ts","../src/zx.ts","../src/types.ts"],"sourcesContent":["export * from \"./errors\"\nexport * from \"./encode\"\nexport * from \"./zx\"\nexport * from \"./types\"\n","export class NotFoundError extends Error {}\nexport class MintPaused extends Error {}\n","import {\n encodeBytes32String as encodeBytes32StringBase,\n decodeBytes32String as decodeBytes32StringBase,\n} from \"ethers\"\n\nexport const encodeBytes32String = encodeBytes32StringBase as (\n text: string\n) => `0x${string}`\n\nexport const decodeBytes32String = decodeBytes32StringBase as (\n bytes: `0x${string}`\n) => string\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","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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,gBAAN,cAA4B,MAAM;AAAC;AACnC,IAAM,aAAN,cAAyB,MAAM;AAAC;;;ACDvC,oBAGO;AAEA,IAAM,sBAAsB,cAAAA;AAI5B,IAAM,sBAAsB,cAAAC;;;ACTnC,IAAAC,iBAA2B;AAC3B,iBAAkB;AAClB,4BAAqC;AAAA,IAIrC,4CAAqB,YAAC;AAEf,IAAM,KAAK;AAAA,EAChB,SAAS,MACP,aACG,OAAO,EACP,MAAM,mBAAmB,EACzB,UAAU,CAAC,KAAK,QAAQ;AACvB,QAAI;AACF,iBAAO,2BAAW,GAAG;AAAA,IACvB,SAAS,GAAG;AACV,UAAI,SAAS;AAAA,QACX,MAAM,aAAE,aAAa;AAAA,QACrB,SAAS;AAAA,MACX,CAAC;AACD,aAAO,aAAE;AAAA,IACX;AAAA,EACF,CAAC;AACP;;;ACrBO,IAAK,QAAL,kBAAKC,WAAL;AACL,EAAAA,OAAA,SAAM;AACN,EAAAA,OAAA,SAAM;AACN,EAAAA,OAAA,UAAO;AAHG,SAAAA;AAAA,GAAA;","names":["encodeBytes32StringBase","decodeBytes32StringBase","import_ethers","Chain"]}
package/dist/index.mjs CHANGED
@@ -3,12 +3,15 @@ import {
3
3
  MintPaused,
4
4
  NotFoundError,
5
5
  zx
6
- } from "./chunk-PPWDBQS4.mjs";
6
+ } from "./chunk-E7RA4BMW.mjs";
7
7
 
8
8
  // src/encode.ts
9
- import { formatBytes32String, parseBytes32String } from "ethers/lib/utils";
10
- var encodeBytes32String = formatBytes32String;
11
- var decodeBytes32String = parseBytes32String;
9
+ import {
10
+ encodeBytes32String as encodeBytes32StringBase,
11
+ decodeBytes32String as decodeBytes32StringBase
12
+ } from "ethers";
13
+ var encodeBytes32String = encodeBytes32StringBase;
14
+ var decodeBytes32String = decodeBytes32StringBase;
12
15
  export {
13
16
  Chain,
14
17
  MintPaused,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/encode.ts"],"sourcesContent":["import { formatBytes32String, parseBytes32String } from \"ethers/lib/utils\"\n\nexport const encodeBytes32String = formatBytes32String as (\n text: string\n) => `0x${string}`\n\nexport const decodeBytes32String = parseBytes32String as (\n bytes: `0x${string}`\n) => string\n"],"mappings":";;;;;;;;AAAA,SAAS,qBAAqB,0BAA0B;AAEjD,IAAM,sBAAsB;AAI5B,IAAM,sBAAsB;","names":[]}
1
+ {"version":3,"sources":["../src/encode.ts"],"sourcesContent":["import {\n encodeBytes32String as encodeBytes32StringBase,\n decodeBytes32String as decodeBytes32StringBase,\n} from \"ethers\"\n\nexport const encodeBytes32String = encodeBytes32StringBase as (\n text: string\n) => `0x${string}`\n\nexport const decodeBytes32String = decodeBytes32StringBase as (\n bytes: `0x${string}`\n) => string\n"],"mappings":";;;;;;;;AAAA;AAAA,EACE,uBAAuB;AAAA,EACvB,uBAAuB;AAAA,OAClB;AAEA,IAAM,sBAAsB;AAI5B,IAAM,sBAAsB;","names":[]}