defi-kit 0.1.18 → 0.1.20

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.
@@ -61,4 +61,4 @@ export {
61
61
  MintPaused,
62
62
  zx
63
63
  };
64
- //# sourceMappingURL=chunk-CS4FH2KK.mjs.map
64
+ //# sourceMappingURL=chunk-44B6IDEW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/errors.ts","../src/zx.ts"],"sourcesContent":["export class NotFoundError extends Error {}\nexport class MintPaused extends Error {}\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.string().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;;;ACDvC,SAAS,kBAAkB;AAC3B,SAAS,SAAS;AAClB,SAAS,4BAA4B;AAIrC,qBAAqB,CAAC;AAEf,IAAM,KAAK;AAAA,EAChB,SAAS,MACP,EAAE,OAAO,EAAE,UAAU,CAAC,KAAK,QAAQ;AACjC,QAAI;AACF,aAAO,WAAW,GAAG;AAAA,IACvB,SAAS,GAAP;AACA,UAAI,SAAS;AAAA,QACX,MAAM,EAAE,aAAa;AAAA,QACrB,SAAS;AAAA,MACX,CAAC;AACD,aAAO,EAAE;AAAA,IACX;AAAA,EACF,CAAC;AACL;","names":[]}
@@ -5,7 +5,7 @@ import {
5
5
  __export,
6
6
  __toESM,
7
7
  zx
8
- } from "./chunk-CS4FH2KK.mjs";
8
+ } from "./chunk-44B6IDEW.mjs";
9
9
 
10
10
  // node_modules/@dethcrypto/eth-sdk/dist/index.js
11
11
  var require_dist = __commonJS({
@@ -3373,7 +3373,7 @@ var info_default2 = [
3373
3373
  borrowingEnabled: true,
3374
3374
  stableBorrowRateEnabled: false,
3375
3375
  isActive: true,
3376
- isFrozen: true,
3376
+ isFrozen: false,
3377
3377
  aTokenAddress: "0x00907f9921424583e7ffBfEdf84F92B7B2Be4977",
3378
3378
  stableDebtTokenAddress: "0x3f3DF7266dA30102344A813F1a3D07f5F041B5AC",
3379
3379
  variableDebtTokenAddress: "0x786dBff3f1292ae8F92ea68Cf93c30b34B1ed04B"
@@ -3515,7 +3515,7 @@ var eth2 = {
3515
3515
  stake: () => {
3516
3516
  return stake();
3517
3517
  }
3518
- // governance: ({
3518
+ // delegate: ({
3519
3519
  // targets,
3520
3520
  // delegatee,
3521
3521
  // }: {
@@ -3523,7 +3523,7 @@ var eth2 = {
3523
3523
  // delegatee: string
3524
3524
  // }) => {
3525
3525
  // return targets.flatMap((target) =>
3526
- // governance(findDelegateToken(target), delegatee)
3526
+ // delegate(findDelegateToken(target), delegatee)
3527
3527
  // )
3528
3528
  // },
3529
3529
  };
@@ -4697,6 +4697,50 @@ var info_default3 = [
4697
4697
  }
4698
4698
  ],
4699
4699
  rewarder: "0x646E272dA2766Bdfd8079643Ffbb30830Fb87303"
4700
+ },
4701
+ {
4702
+ name: "GHO/USDT/USDC",
4703
+ id: "157",
4704
+ bpt: "0x8353157092ED8Be69a9DF8F95af097bbF33Cb2aF",
4705
+ tokens: [
4706
+ {
4707
+ address: "0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f",
4708
+ symbol: "GHO"
4709
+ },
4710
+ {
4711
+ address: "0x8353157092ED8Be69a9DF8F95af097bbF33Cb2aF",
4712
+ symbol: "GHO/USDT/USDC"
4713
+ },
4714
+ {
4715
+ address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
4716
+ symbol: "USDC"
4717
+ },
4718
+ {
4719
+ address: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
4720
+ symbol: "USDT"
4721
+ }
4722
+ ],
4723
+ rewarder: "0xBDD6984C3179B099E9D383ee2F44F3A57764BF7d"
4724
+ },
4725
+ {
4726
+ name: "50KNC-25WETH-25USDC-BPT",
4727
+ id: "158",
4728
+ bpt: "0x6f0ed6f346007563D3266DE350d174a831bDE0ca",
4729
+ tokens: [
4730
+ {
4731
+ address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
4732
+ symbol: "USDC"
4733
+ },
4734
+ {
4735
+ address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
4736
+ symbol: "WETH"
4737
+ },
4738
+ {
4739
+ address: "0xdeFA4e8a7bcBA345F687a2f1456F5Edd9CE97202",
4740
+ symbol: "KNC"
4741
+ }
4742
+ ],
4743
+ rewarder: "0xDC71AFe0F4B04d8780bFdf048378C0c6DfD3a19A"
4700
4744
  }
4701
4745
  ];
4702
4746
 
@@ -5331,25 +5375,6 @@ var info_default4 = [
5331
5375
  }
5332
5376
  ]
5333
5377
  },
5334
- {
5335
- bpt: "0x25Accb7943Fd73Dda5E23bA6329085a3C24bfb6a",
5336
- id: "0x25accb7943fd73dda5e23ba6329085a3c24bfb6a000200000000000000000387",
5337
- name: "50wstETH-50bb-a-USD",
5338
- type: "Weighted",
5339
- gauge: null,
5340
- tokens: [
5341
- {
5342
- address: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
5343
- symbol: "wstETH",
5344
- id: "0x"
5345
- },
5346
- {
5347
- address: "0xA13a9247ea42D743238089903570127DdA72fE44",
5348
- symbol: "bb-a-USD",
5349
- id: "0xa13a9247ea42d743238089903570127dda72fe4400000000000000000000035d"
5350
- }
5351
- ]
5352
- },
5353
5378
  {
5354
5379
  bpt: "0x26Cc136e9b8FD65466F193a8e5710661Ed9A9827",
5355
5380
  id: "0x26cc136e9b8fd65466f193a8e5710661ed9a98270002000000000000000005ad",
@@ -5874,6 +5899,25 @@ var info_default4 = [
5874
5899
  }
5875
5900
  ]
5876
5901
  },
5902
+ {
5903
+ bpt: "0x47E1Cf97A0586367349A14306A65F54Ba0b8f1B6",
5904
+ id: "0x47e1cf97a0586367349a14306a65f54ba0b8f1b60002000000000000000005cd",
5905
+ name: "20WETH-80ALTR",
5906
+ type: "Weighted",
5907
+ gauge: null,
5908
+ tokens: [
5909
+ {
5910
+ address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
5911
+ symbol: "WETH",
5912
+ id: "0x"
5913
+ },
5914
+ {
5915
+ address: "0xD1ffCacFc630CE68d3cd3369F5db829a3ed01fE2",
5916
+ symbol: "ALTR",
5917
+ id: "0x"
5918
+ }
5919
+ ]
5920
+ },
5877
5921
  {
5878
5922
  bpt: "0x48607651416A943bF5AC71C41BE1420538e78f87",
5879
5923
  id: "0x48607651416a943bf5ac71c41be1420538e78f87000200000000000000000327",
@@ -8735,6 +8779,7 @@ var B_80BAL_20WETH_PID = "0x5c6ee304399dbdb9c8ef030ab642b10820db8f56000200000000
8735
8779
  var bb_a_USD_v1 = "0x7B50775383d3D6f0215A8F290f2C9e2eEBBEceb2";
8736
8780
  var bb_a_USD_v2 = "0xA13a9247ea42D743238089903570127DdA72fE44";
8737
8781
  var bb_a_USD_v3 = "0xfeBb0bbf162E64fb9D0dfe186E517d84C395f016";
8782
+ var USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
8738
8783
  var deposit = (pool, tokens = pool.tokens) => {
8739
8784
  const tokenAddresses = pool.tokens.map((token) => token.address).filter((address) => tokens.some((token) => token.address === address));
8740
8785
  const tokenPoolIds = pool.tokens.filter(
@@ -8863,13 +8908,14 @@ var lock = () => {
8863
8908
  allow.mainnet.balancer.vebal.withdraw(),
8864
8909
  allow.mainnet.balancer.fee_distributor.claimToken(
8865
8910
  c5.avatar,
8866
- c5.or(BAL, bb_a_USD_v1, bb_a_USD_v2, bb_a_USD_v3)
8911
+ c5.or(BAL, bb_a_USD_v1, bb_a_USD_v2, bb_a_USD_v3, USDC)
8867
8912
  ),
8868
8913
  allow.mainnet.balancer.fee_distributor.claimTokens(c5.avatar, [
8869
8914
  BAL,
8870
8915
  bb_a_USD_v1,
8871
8916
  bb_a_USD_v2,
8872
- bb_a_USD_v3
8917
+ bb_a_USD_v3,
8918
+ USDC
8873
8919
  ])
8874
8920
  ];
8875
8921
  };
@@ -15571,50 +15617,39 @@ var filterPoolsByTokens2 = (sell, buy, pools) => {
15571
15617
  // src/protocols/lido/index.ts
15572
15618
  import { c as c11 } from "zodiac-roles-sdk";
15573
15619
  var eth9 = {
15574
- deposit: () => Object.assign(
15575
- [
15576
- ...allowErc20Approve(
15577
- [contracts.mainnet.lido.steth],
15578
- [contracts.mainnet.lido.wsteth]
15579
- ),
15580
- ...allowErc20Approve(
15581
- [contracts.mainnet.lido.steth, contracts.mainnet.lido.wsteth],
15582
- [contracts.mainnet.lido.unsteth]
15583
- ),
15584
- allow.mainnet.lido.wsteth.wrap(),
15585
- allow.mainnet.lido.wsteth.unwrap(),
15586
- allow.mainnet.lido.steth.submit(void 0, { send: true }),
15587
- // Request stETH Withdrawal - Locks your stETH in the queue. In exchange you receive an NFT, that represents your position
15588
- // in the queue
15589
- allow.mainnet.lido.unsteth.requestWithdrawals(void 0, c11.avatar),
15590
- // When the unstETH has no allowance over the owner's stETH
15591
- allow.mainnet.lido.unsteth.requestWithdrawalsWithPermit(
15592
- void 0,
15593
- c11.avatar
15594
- ),
15595
- // Request wstETH Withdrawal - Transfers the wstETH to the unstETH to be burned in exchange for stETH. Then it locks your stETH
15596
- // in the queue. In exchange you receive an NFT, that represents your position in the queue
15597
- allow.mainnet.lido.unsteth.requestWithdrawalsWstETH(
15598
- void 0,
15599
- c11.avatar
15600
- ),
15601
- // When the unstETH has no allowance over the owner's wstETH
15602
- allow.mainnet.lido.unsteth.requestWithdrawalsWstETHWithPermit(
15603
- void 0,
15604
- c11.avatar
15605
- ),
15606
- // Claim ETH - Once the request is finalized by the oracle report and becomes claimable,
15607
- // this function claims your ether and burns the NFT
15608
- allow.mainnet.lido.unsteth.claimWithdrawal(),
15609
- allow.mainnet.lido.unsteth.claimWithdrawals()
15610
- ],
15611
- {
15612
- annotation: {
15613
- uri: "https://kit.karpatkey.com/permissions/eth/lido/deposit",
15614
- schema: "https://kit.karpatkey.com/api/v1/openapi.json"
15615
- }
15616
- }
15617
- )
15620
+ deposit: () => [
15621
+ ...allowErc20Approve(
15622
+ [contracts.mainnet.lido.steth],
15623
+ [contracts.mainnet.lido.wsteth]
15624
+ ),
15625
+ ...allowErc20Approve(
15626
+ [contracts.mainnet.lido.steth, contracts.mainnet.lido.wsteth],
15627
+ [contracts.mainnet.lido.unsteth]
15628
+ ),
15629
+ allow.mainnet.lido.wsteth.wrap(),
15630
+ allow.mainnet.lido.wsteth.unwrap(),
15631
+ allow.mainnet.lido.steth.submit(void 0, { send: true }),
15632
+ // Request stETH Withdrawal - Locks your stETH in the queue. In exchange you receive an NFT, that represents your position
15633
+ // in the queue
15634
+ allow.mainnet.lido.unsteth.requestWithdrawals(void 0, c11.avatar),
15635
+ // When the unstETH has no allowance over the owner's stETH
15636
+ allow.mainnet.lido.unsteth.requestWithdrawalsWithPermit(
15637
+ void 0,
15638
+ c11.avatar
15639
+ ),
15640
+ // Request wstETH Withdrawal - Transfers the wstETH to the unstETH to be burned in exchange for stETH. Then it locks your stETH
15641
+ // in the queue. In exchange you receive an NFT, that represents your position in the queue
15642
+ allow.mainnet.lido.unsteth.requestWithdrawalsWstETH(void 0, c11.avatar),
15643
+ // When the unstETH has no allowance over the owner's wstETH
15644
+ allow.mainnet.lido.unsteth.requestWithdrawalsWstETHWithPermit(
15645
+ void 0,
15646
+ c11.avatar
15647
+ ),
15648
+ // Claim ETH - Once the request is finalized by the oracle report and becomes claimable,
15649
+ // this function claims your ether and burns the NFT
15650
+ allow.mainnet.lido.unsteth.claimWithdrawal(),
15651
+ allow.mainnet.lido.unsteth.claimWithdrawals()
15652
+ ]
15618
15653
  };
15619
15654
 
15620
15655
  // src/protocols/spark/_info.ts
@@ -15846,7 +15881,7 @@ var annotate = (actionFunction, path) => {
15846
15881
  const joinedPath = path.join("/");
15847
15882
  Object.assign(result, {
15848
15883
  annotation: {
15849
- uri: `https://kit.karpatkey.com/permissions/${joinedPath}?${queryString}`,
15884
+ uri: `https://kit.karpatkey.com/api/v1/permissions/${joinedPath}?${queryString}`,
15850
15885
  schema: "https://kit.karpatkey.com/api/v1/openapi.json"
15851
15886
  }
15852
15887
  });
@@ -16167,7 +16202,7 @@ var createApply = (chainId) => {
16167
16202
  }
16168
16203
  throw e;
16169
16204
  }
16170
- const value = 0n;
16205
+ const value = "0";
16171
16206
  return [
16172
16207
  ...rolesModCalls.map((data) => ({
16173
16208
  to: options.address,
@@ -16198,15 +16233,11 @@ var createExportToSafeTransactionBuilder = (chainId) => {
16198
16233
  description: (meta == null ? void 0 : meta.description) || "",
16199
16234
  txBuilderVersion: "1.16.2"
16200
16235
  },
16201
- transactions: transactions.map((tx) => ({
16202
- ...tx,
16203
- value: tx.value.toString(10),
16204
- ...getAbiInfo(tx)
16205
- }))
16236
+ transactions: transactions.map(decode)
16206
16237
  };
16207
16238
  };
16208
16239
  };
16209
- var getAbiInfo = (transaction) => {
16240
+ var decode = (transaction) => {
16210
16241
  const abi = transaction.to === POSTER_ADDRESS ? posterAbi : rolesAbi;
16211
16242
  const iface = new Interface(abi);
16212
16243
  const selector = transaction.data.slice(0, 10);
@@ -16226,16 +16257,30 @@ var getAbiInfo = (transaction) => {
16226
16257
  iface.decodeFunctionData(functionFragment, transaction.data)
16227
16258
  );
16228
16259
  return {
16229
- contractMethod,
16260
+ to: transaction.to,
16261
+ value: transaction.value,
16262
+ contractMethod: {
16263
+ inputs: mapInputs(contractMethod.inputs) || [],
16264
+ name: contractMethod.name || "",
16265
+ payable: !!contractMethod.payable
16266
+ },
16230
16267
  contractInputsValues
16231
16268
  };
16232
16269
  };
16270
+ var mapInputs = (inputs) => {
16271
+ return inputs == null ? void 0 : inputs.map((input) => ({
16272
+ internalType: input.internalType || "",
16273
+ name: input.name || "",
16274
+ type: input.type || "",
16275
+ components: mapInputs(input.components)
16276
+ }));
16277
+ };
16233
16278
  var asObject = (result) => {
16234
16279
  const object = {};
16235
16280
  for (const key of Object.keys(result)) {
16236
- if (isNaN(Number(key)))
16237
- continue;
16238
- object[key] = result[key];
16281
+ if (isNaN(Number(key))) {
16282
+ object[key] = result[key];
16283
+ }
16239
16284
  }
16240
16285
  return object;
16241
16286
  };
@@ -16248,4 +16293,4 @@ export {
16248
16293
  createApply,
16249
16294
  createExportToSafeTransactionBuilder
16250
16295
  };
16251
- //# sourceMappingURL=chunk-JT3ITIHS.mjs.map
16296
+ //# sourceMappingURL=chunk-XGPW27P7.mjs.map