@boostxyz/sdk 6.1.3 → 7.0.0-canary.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.
Files changed (186) hide show
  1. package/README.md +1 -1
  2. package/dist/Actions/Action.cjs +1 -1
  3. package/dist/Actions/Action.js +7 -7
  4. package/dist/Actions/EventAction.cjs +1 -1
  5. package/dist/Actions/EventAction.cjs.map +1 -1
  6. package/dist/Actions/EventAction.d.ts +10 -0
  7. package/dist/Actions/EventAction.d.ts.map +1 -1
  8. package/dist/Actions/EventAction.js +77 -76
  9. package/dist/Actions/EventAction.js.map +1 -1
  10. package/dist/AllowLists/AllowList.cjs +1 -1
  11. package/dist/AllowLists/AllowList.js +5 -5
  12. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  13. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
  14. package/dist/AllowLists/SimpleAllowList.js +17 -17
  15. package/dist/AllowLists/SimpleAllowList.js.map +1 -1
  16. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  17. package/dist/AllowLists/SimpleDenyList.js +3 -3
  18. package/dist/Auth/PassthroughAuth.cjs +1 -1
  19. package/dist/Auth/PassthroughAuth.js +1 -1
  20. package/dist/BoostCore.cjs +2 -2
  21. package/dist/BoostCore.cjs.map +1 -1
  22. package/dist/BoostCore.d.ts +1894 -267
  23. package/dist/BoostCore.d.ts.map +1 -1
  24. package/dist/BoostCore.js +831 -520
  25. package/dist/BoostCore.js.map +1 -1
  26. package/dist/BoostRegistry.cjs +1 -1
  27. package/dist/BoostRegistry.js +48 -48
  28. package/dist/Budget-BgGihcwx.js +1124 -0
  29. package/dist/Budget-BgGihcwx.js.map +1 -0
  30. package/dist/Budget-DYlTLLwg.cjs +2 -0
  31. package/dist/Budget-DYlTLLwg.cjs.map +1 -0
  32. package/dist/Budgets/Budget.cjs +1 -1
  33. package/dist/Budgets/Budget.d.ts +5 -4
  34. package/dist/Budgets/Budget.d.ts.map +1 -1
  35. package/dist/Budgets/Budget.js +9 -6
  36. package/dist/Budgets/ManagedBudget.cjs +1 -1
  37. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  38. package/dist/Budgets/ManagedBudget.d.ts +4 -0
  39. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  40. package/dist/Budgets/ManagedBudget.js +22 -22
  41. package/dist/Budgets/ManagedBudgetWithFees.d.ts +4 -0
  42. package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -1
  43. package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts +4 -0
  44. package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts.map +1 -1
  45. package/dist/Budgets/TransparentBudget.d.ts +944 -0
  46. package/dist/Budgets/TransparentBudget.d.ts.map +1 -0
  47. package/dist/Budgets/VestingBudget.d.ts +4 -0
  48. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  49. package/dist/Deployable/Deployable.cjs.map +1 -1
  50. package/dist/Deployable/Deployable.d.ts +1 -1
  51. package/dist/Deployable/Deployable.d.ts.map +1 -1
  52. package/dist/Deployable/Deployable.js.map +1 -1
  53. package/dist/Deployable/DeployableTarget.cjs +1 -1
  54. package/dist/Deployable/DeployableTarget.js +1 -1
  55. package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
  56. package/dist/Deployable/DeployableTargetWithRBAC.js +20 -20
  57. package/dist/Incentive-BDqkFt0J.cjs +2 -0
  58. package/dist/Incentive-BDqkFt0J.cjs.map +1 -0
  59. package/dist/Incentive-DPOADY1f.js +449 -0
  60. package/dist/Incentive-DPOADY1f.js.map +1 -0
  61. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  62. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  63. package/dist/Incentives/AllowListIncentive.js +14 -14
  64. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  65. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  66. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  67. package/dist/Incentives/CGDAIncentive.js +11 -11
  68. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  69. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  70. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  71. package/dist/Incentives/ERC20Incentive.js +14 -14
  72. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  73. package/dist/Incentives/ERC20PeggedIncentive.d.ts +1 -1
  74. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs +2 -0
  75. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs.map +1 -0
  76. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +3 -1
  77. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -1
  78. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js +604 -0
  79. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js.map +1 -0
  80. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs +2 -0
  81. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs.map +1 -0
  82. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts +1103 -0
  83. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts.map +1 -0
  84. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js +625 -0
  85. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js.map +1 -0
  86. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
  87. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
  88. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +11 -1
  89. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
  90. package/dist/Incentives/ERC20VariableCriteriaIncentive.js +112 -80
  91. package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
  92. package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs +2 -0
  93. package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs.map +1 -0
  94. package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts +903 -0
  95. package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts.map +1 -0
  96. package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js +242 -0
  97. package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js.map +1 -0
  98. package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
  99. package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
  100. package/dist/Incentives/ERC20VariableIncentive.d.ts +3 -3
  101. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  102. package/dist/Incentives/ERC20VariableIncentive.js +22 -22
  103. package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
  104. package/dist/Incentives/Incentive.cjs +1 -1
  105. package/dist/Incentives/Incentive.d.ts +8 -6
  106. package/dist/Incentives/Incentive.d.ts.map +1 -1
  107. package/dist/Incentives/Incentive.js +19 -14
  108. package/dist/Incentives/Incentive.js.map +1 -1
  109. package/dist/Incentives/PointsIncentive.cjs +1 -1
  110. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  111. package/dist/Incentives/PointsIncentive.js +9 -9
  112. package/dist/Incentives/PointsIncentive.js.map +1 -1
  113. package/dist/SimpleDenyList-B_AcmgYq.cjs +2 -0
  114. package/dist/{SimpleDenyList-DgjVf7FK.cjs.map → SimpleDenyList-B_AcmgYq.cjs.map} +1 -1
  115. package/dist/SimpleDenyList-BbDLzRw7.js +133 -0
  116. package/dist/{SimpleDenyList-BKfPoTo1.js.map → SimpleDenyList-BbDLzRw7.js.map} +1 -1
  117. package/dist/Validators/LimitedSignerValidator.cjs +1 -1
  118. package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
  119. package/dist/Validators/LimitedSignerValidator.js +13 -13
  120. package/dist/Validators/LimitedSignerValidator.js.map +1 -1
  121. package/dist/Validators/SignerValidator.cjs +1 -1
  122. package/dist/Validators/SignerValidator.cjs.map +1 -1
  123. package/dist/Validators/SignerValidator.js +52 -52
  124. package/dist/Validators/SignerValidator.js.map +1 -1
  125. package/dist/Validators/Validator.cjs +1 -1
  126. package/dist/Validators/Validator.js +2 -2
  127. package/dist/componentInterfaces-C5ig8mCK.cjs +2 -0
  128. package/dist/componentInterfaces-C5ig8mCK.cjs.map +1 -0
  129. package/dist/componentInterfaces-Ddus5rIA.js +23 -0
  130. package/dist/componentInterfaces-Ddus5rIA.js.map +1 -0
  131. package/dist/deployments-C17nvui-.cjs +2 -0
  132. package/dist/deployments-C17nvui-.cjs.map +1 -0
  133. package/dist/deployments-CH4Xmkbv.js +132 -0
  134. package/dist/{deployments-W_LUj833.js.map → deployments-CH4Xmkbv.js.map} +1 -1
  135. package/dist/deployments.json +63 -48
  136. package/dist/{generated-CElkFqkY.js → generated-CINzoGbl.js} +2611 -955
  137. package/dist/generated-CINzoGbl.js.map +1 -0
  138. package/dist/generated-C_JEoLDO.cjs +3 -0
  139. package/dist/generated-C_JEoLDO.cjs.map +1 -0
  140. package/dist/index.cjs +1 -1
  141. package/dist/index.d.ts +3 -0
  142. package/dist/index.d.ts.map +1 -1
  143. package/dist/index.js +167 -154
  144. package/dist/index.js.map +1 -1
  145. package/dist/utils.cjs.map +1 -1
  146. package/dist/utils.js.map +1 -1
  147. package/package.json +20 -2
  148. package/src/Actions/EventAction.ts +11 -0
  149. package/src/BoostCore.test.ts +14 -9
  150. package/src/BoostCore.ts +428 -26
  151. package/src/Budgets/Budget.ts +8 -1
  152. package/src/Budgets/TransparentBudget.test.ts +70 -0
  153. package/src/Budgets/TransparentBudget.ts +334 -0
  154. package/src/Deployable/Deployable.ts +1 -1
  155. package/src/Incentives/ERC20PeggedIncentive.ts +1 -1
  156. package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +3 -1
  157. package/src/Incentives/{ERC20PeggedVariableCriteriaIncentive.test.ts → ERC20PeggedVariableCriteriaIncentiveV2.test.ts} +20 -16
  158. package/src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts +872 -0
  159. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +50 -1
  160. package/src/Incentives/{ERC20VariableCriteriaIncentive.test.ts → ERC20VariableCriteriaIncentiveV2.test.ts} +24 -19
  161. package/src/Incentives/ERC20VariableCriteriaIncentiveV2.ts +447 -0
  162. package/src/Incentives/ERC20VariableIncentive.ts +4 -2
  163. package/src/Incentives/Incentive.ts +13 -2
  164. package/src/index.test.ts +2 -2
  165. package/src/index.ts +3 -0
  166. package/src/utils.ts +1 -1
  167. package/dist/Budget-BjfL8dVX.cjs +0 -2
  168. package/dist/Budget-BjfL8dVX.cjs.map +0 -1
  169. package/dist/Budget-DD7IPuDx.js +0 -922
  170. package/dist/Budget-DD7IPuDx.js.map +0 -1
  171. package/dist/Incentive-V1RjH38L.js +0 -1036
  172. package/dist/Incentive-V1RjH38L.js.map +0 -1
  173. package/dist/Incentive-gVTfsnMB.cjs +0 -2
  174. package/dist/Incentive-gVTfsnMB.cjs.map +0 -1
  175. package/dist/SimpleDenyList-BKfPoTo1.js +0 -133
  176. package/dist/SimpleDenyList-DgjVf7FK.cjs +0 -2
  177. package/dist/componentInterfaces-CA1UIqWL.js +0 -20
  178. package/dist/componentInterfaces-CA1UIqWL.js.map +0 -1
  179. package/dist/componentInterfaces-aBgBbB7r.cjs +0 -2
  180. package/dist/componentInterfaces-aBgBbB7r.cjs.map +0 -1
  181. package/dist/deployments-CwTZr-cK.cjs +0 -2
  182. package/dist/deployments-CwTZr-cK.cjs.map +0 -1
  183. package/dist/deployments-W_LUj833.js +0 -117
  184. package/dist/generated-BPiHi7W2.cjs +0 -3
  185. package/dist/generated-BPiHi7W2.cjs.map +0 -1
  186. package/dist/generated-CElkFqkY.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ERC20PeggedVariableCriteriaIncentiveV2.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20PeggedVariableCrite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U,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU;IAI7C;;;;;;;OAOG;IACU,0BAA0B,CAAC,MAAM,CAAC,EAAE,UAAU;IAQ3D;;OAEG;IAEH;;;;;;OAMG;IACU,oBAAoB,CAC/B,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,mBAAmB,CAAC;IAiB/B;;;;;;;;OAQG;IACU,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAkB7D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,6CAA6C,EACxD,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;IAa1B;;;;;;OAMG;IACI,iBAAiB,CAAC,MAAM,EAAE,MAAM;IAIvC;;;;;;;OAOG;IACI,cAAc,CAAC,YAAY,EAAE,MAAM;IAO1C;;;;;;;OAOG;IACU,eAAe,CAAC,SAAS,EAAE,GAAG;IAqC3C;;;;;;;;;;OAUG;IACI,gCAAgC,CACrC,SAAS,EAAE,GAAG,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM;CAiCpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oDAAoD,CAAC,EACnE,KAAK,EACL,GAAG,EACH,MAAM,EACN,KAAK,EACL,SAAc,EACd,OAAqB,EACrB,QAAQ,GACT,EAAE,6CAA6C,iBA6C/C"}
@@ -0,0 +1,625 @@
1
+ import { d as y, bC as D, bD as x, bE as I, bF as R, bG as V, bH as _, bI as E, bJ as P, bK as N, bL as O, bM as $, bN as B, bO as F, bP as G, bQ as M, bR as U, bS as k } from "../generated-CINzoGbl.js";
2
+ import { getTransactionReceipt as H, getTransaction as L } from "@wagmi/core";
3
+ import { parseEventLogs as S, decodeFunctionData as q, zeroAddress as n, zeroHash as z, encodeAbiParameters as g, decodeAbiParameters as o, parseEther as h } from "viem";
4
+ import { f as J } from "../deployments-CH4Xmkbv.js";
5
+ import { SignatureType as p } from "../Actions/EventAction.js";
6
+ import { DeployableTarget as K } from "../Deployable/DeployableTarget.js";
7
+ import { prepareClaimPayload as w } from "../claiming.js";
8
+ import { NoMatchingLogsError as C, DecodedArgsError as l, InvalidCriteriaTypeError as j, IncentiveCriteriaNotFoundError as Q } from "../errors.js";
9
+ import { RegistryType as W, CheatCodes as X } from "../utils.js";
10
+ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6122ba806100895f395ff3fe6080604052600436106102ab575f3560e01c8063715018a611610165578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b146107a9578063fe9fbb80146107bc578063fee81cf4146107db575f80fd5b8063ec87621c14610782578063f04e283e14610796575f80fd5b8063db09da12116100ac578063db09da121461072f578063dcc213611461074e578063dcc59b6f1461076d575f80fd5b8063c884ef83146106ec578063d54ad2a11461071a575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf1461069a578063be4994f8146106b9578063c213f3f9146106d8575f80fd5b8063a4d66daf14610664578063a871ced214610679575f80fd5b8063775486871161014b57806377548687146105b45780638da5cb5b146106225780639214fa4d1461063a575f80fd5b8063715018a61461059857806375b238fc146105a0575f80fd5b806330db555f1161020f5780634a4ee7b1116101c5578063514e62fc116101ab578063514e62fc14610546578063547d18641461057b57806354d1f13d14610590575f80fd5b80634a4ee7b1146105075780634e7165a21461051a575f80fd5b80634359d28a116101f55780634359d28a14610480578063439fab911461049f578063474f5a44146104be575f80fd5b806330db555f1461043557806338d52e0f14610454575f80fd5b80631f1cb62b11610264578063256929621161024a57806325692962146103c257806328d6183b146103ca5780632de9480714610404575f80fd5b80631f1cb62b1461035d578063228cb733146103ae575f80fd5b8063183a4f6e11610294578063183a4f6e146103005780631c10893f146103155780631cd64df414610328575f80fd5b806301ffc9a7146102af57806307621eca146102e3575b5f80fd5b3480156102ba575f80fd5b506102ce6102c93660046119c5565b61080c565b60405190151581526020015b60405180910390f35b3480156102ee575f80fd5b505f545b6040519081526020016102da565b61031361030e366004611a0b565b610867565b005b610313610323366004611a4a565b610874565b348015610333575f80fd5b506102ce610342366004611a4a565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610368575f80fd5b50600a546103899073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102da565b3480156103b9575f80fd5b506102f25f5481565b61031361088a565b3480156103d5575f80fd5b506040517ff60c99c90000000000000000000000000000000000000000000000000000000081526020016102da565b34801561040f575f80fd5b506102f261041e366004611a72565b638b78c6d8600c9081525f91909152602090205490565b348015610440575f80fd5b5061031361044f366004611a0b565b6108d7565b34801561045f575f80fd5b506006546103899073ffffffffffffffffffffffffffffffffffffffff1681565b34801561048b575f80fd5b5061031361049a366004611ad3565b610993565b3480156104aa575f80fd5b506103136104b9366004611b7d565b610a8d565b3480156104c9575f80fd5b506104dd6104d8366004611b7d565b610e1c565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102da565b610313610515366004611a4a565b610f7e565b348015610525575f80fd5b50610539610534366004611b7d565b610f90565b6040516102da9190611c08565b348015610551575f80fd5b506102ce610560366004611a4a565b638b78c6d8600c9081525f9290925260209091205416151590565b348015610586575f80fd5b506102f260025481565b61031361102a565b610313611063565b3480156105ab575f80fd5b506102f2600281565b3480156105bf575f80fd5b506003546004546005546106119260ff90811692918082169173ffffffffffffffffffffffffffffffffffffffff61010083041691750100000000000000000000000000000000000000000090041685565b6040516102da959493929190611c57565b34801561062d575f80fd5b50638b78c6d81954610389565b348015610645575f80fd5b50600a5473ffffffffffffffffffffffffffffffffffffffff16610389565b34801561066f575f80fd5b506102f260085481565b348015610684575f80fd5b5061068d611076565b6040516102da9190611d0a565b3480156106a5575f80fd5b506102ce6106b4366004611d18565b61115c565b3480156106c4575f80fd5b506103136106d3366004611ad3565b611389565b3480156106e3575f80fd5b50600b546102f2565b3480156106f7575f80fd5b506102ce610706366004611a72565b60016020525f908152604090205460ff1681565b348015610725575f80fd5b506102f260095481565b34801561073a575f80fd5b506102ce610749366004611d18565b611427565b348015610759575f80fd5b50610313610768366004611ad3565b61149a565b348015610778575f80fd5b506102f260075481565b34801561078d575f80fd5b506102f2600181565b6103136107a4366004611a72565b611538565b6103136107b7366004611a72565b611572565b3480156107c7575f80fd5b506102ce6107d6366004611a72565b611598565b3480156107e6575f80fd5b506102f26107f5366004611a72565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167ff60c99c90000000000000000000000000000000000000000000000000000000014806108615750610861826115f7565b92915050565b610871338261164c565b50565b61087c611657565b6108868282611671565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60016108e28161167d565b815f0361091b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546109409073ffffffffffffffffffffffffffffffffffffffff163330856116ae565b8160085f8282546109519190611d94565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b600261099e8161167d565b8382146109d7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85575f8484838181106109f4576109f4611da7565b9050602002016020810190610a099190611dd4565b9050801515600103610a4b57610a46878784818110610a2a57610a2a611da7565b9050602002016020810190610a3f9190611a72565b6001611671565b610a7c565b610a7c878784818110610a6057610a60611da7565b9050602002016020810190610a759190611a72565b600161164c565b506001016109d9565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610ade5760018160011c14303b10610ad55763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610aec83850185611e9b565b905080606001515f03610b2b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015181515f90610b549073ffffffffffffffffffffffffffffffffffffffff1630611710565b905081811015610bbd5782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b60c083015183516006805473ffffffffffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556020860151600a805491909316911617905560408401515f55606084015160085560a0840151600b5580516003805483929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610c7157610c71611c1a565b021790555060208201516001808301919091556040830151600283018054606086015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090911660ff90931692909217919091178082556080850151927fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909116907501000000000000000000000000000000000000000000908490811115610d3657610d36611c1a565b0217905550905050610d4733611743565b610d568460800151600161178b565b836020015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff167f2610f3b22dbb1fc9e125919ede742dad90b4f3dd49ce0c10118c6ef34410e3c98660400151876060015188608001518960a001518a60c00151604051610dd6959493929190611fa1565b60405180910390a3505050508015610e17576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610e298161167d565b5f610e3685870187612093565b90505f8160200151806020019051810190610e519190612110565b90508060085f828254610e649190612127565b90915550508151600654610e919173ffffffffffffffffffffffffffffffffffffffff90911690836117cc565b81516006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610f4f91611c08565b60405180910390a260065490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610f86611657565b610886828261164c565b60605f610f9f83850185611e9b565b6060818101516040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184529482019490945290519394509092611011920161213a565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61106b611657565b6110745f61181f565b565b6040805160a0810182525f808252602082018190529181018290526060810182905260808101919091526040805160a0810190915260038054829060ff1660018111156110c5576110c5611c1a565b60018111156110d6576110d6611c1a565b81526001828101546020830152600283015460ff808216604085015273ffffffffffffffffffffffffffffffffffffffff61010083041660608501526080909301927501000000000000000000000000000000000000000000909104169081111561114357611143611c1a565b600181111561115457611154611c1a565b905250919050565b5f611165611657565b5f611172838501856121b8565b90505f816020015180602001905181019061118d9190612110565b90505f80545f0361119f5750806111c2565b670de0b6b3a7640000825f546111b59190612235565b6111bf919061224c565b90505b600b54158015906111d45750600b5481115b156111de5750600b545b6111e781611869565b61121d576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008548160095461122e9190611d94565b1115611266576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060095f8282546112779190611d94565b92505081905550600160075f8282546112909190611d94565b90915550506006546112b99073ffffffffffffffffffffffffffffffffffffffff1688836117cc565b6006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261137491611c08565b60405180910390a25060019695505050505050565b60026113948161167d565b8382146113cd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a855761141f8686838181106113ec576113ec611da7565b90506020020160208101906114019190611a72565b85858481811061141357611413611da7565b90506020020135611671565b6001016113cf565b5f8080611436848601866121b8565b90505f81602001518060200190518101906114519190612110565b90505f545f0361146357809250611486565b670de0b6b3a7640000815f546114799190612235565b611483919061224c565b92505b61148f83611869565b979650505050505050565b60026114a58161167d565b8382146114de576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85576115308686838181106114fd576114fd611da7565b90506020020160208101906115129190611a72565b85858481811061152457611524611da7565b9050602002013561164c565b6001016114e0565b611540611657565b63389a75e1600c52805f526020600c20805442111561156657636f5e88185f526004601cfd5b5f90556108718161181f565b61157a611657565b8060601b61158f57637448fbae5f526004601cfd5b6108718161181f565b5f8173ffffffffffffffffffffffffffffffffffffffff166115bd638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806108615750638b78c6d8600c9081525f83905260209020546003161515610861565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f56586338000000000000000000000000000000000000000000000000000000001480610861575061086182611883565b61088682825f6118d8565b638b78c6d819543314611074576382b429005f526004601cfd5b610886828260016118d8565b638b78c6d81954331461087157638b78c6d8600c52335f52806020600c205416610871576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f51141661170257803d873b15171061170257637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661181557803d853b151710611815576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f6008548260095461187b9190611d94565b111592915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa921670500000000000000000000000000000000000000000000000000000000148061086157506108618261192f565b638b78c6d8600c52825f526020600c208054838117836118f9575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061086157507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610861565b5f602082840312156119d5575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611a04575f80fd5b9392505050565b5f60208284031215611a1b575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611a45575f80fd5b919050565b5f8060408385031215611a5b575f80fd5b611a6483611a22565b946020939093013593505050565b5f60208284031215611a82575f80fd5b611a0482611a22565b5f8083601f840112611a9b575f80fd5b50813567ffffffffffffffff811115611ab2575f80fd5b6020830191508360208260051b8501011115611acc575f80fd5b9250929050565b5f805f8060408587031215611ae6575f80fd5b843567ffffffffffffffff811115611afc575f80fd5b611b0887828801611a8b565b909550935050602085013567ffffffffffffffff811115611b27575f80fd5b611b3387828801611a8b565b95989497509550505050565b5f8083601f840112611b4f575f80fd5b50813567ffffffffffffffff811115611b66575f80fd5b602083019150836020828501011115611acc575f80fd5b5f8060208385031215611b8e575f80fd5b823567ffffffffffffffff811115611ba4575f80fd5b611bb085828601611b3f565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f611a046020830184611bbc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061087157610871611c1a565b60a08101611c6487611c47565b86825285602083015260ff8516604083015273ffffffffffffffffffffffffffffffffffffffff84166060830152611c9b83611c47565b8260808301529695505050505050565b8051611cb681611c47565b808352506020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301526080810151611cff81611c47565b806080840152505050565b60a081016108618284611cab565b5f805f60408486031215611d2a575f80fd5b611d3384611a22565b9250602084013567ffffffffffffffff811115611d4e575f80fd5b611d5a86828701611b3f565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561086157610861611d67565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611de4575f80fd5b81358015158114611a04575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160e0810167ffffffffffffffff81118282101715611e4357611e43611df3565b60405290565b60405160a0810167ffffffffffffffff81118282101715611e4357611e43611df3565b6040805190810167ffffffffffffffff81118282101715611e4357611e43611df3565b60028110610871575f80fd5b5f81830361016081128015611eae575f80fd5b50611eb7611e20565b611ec084611a22565b8152611ece60208501611a22565b60208201526040848101359082015260608085013590820152611ef360808501611a22565b608082015260a084810135818301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4083011215611f2f575f80fd5b611f37611e49565b915060c0840135611f4781611e8f565b825260e0840135602083015261010084013560ff81168114611f67575f80fd5b6040830152611f796101208501611a22565b6060830152610140840135611f8d81611e8f565b608083015260c08101919091529392505050565b8581526020810185905273ffffffffffffffffffffffffffffffffffffffff84166040820152606081018390526101208101611fe06080830184611cab565b9695505050505050565b5f82601f830112611ff9575f80fd5b813567ffffffffffffffff81111561201357612013611df3565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff8111828210171561206057612060611df3565b604052818152838201602001851015612077575f80fd5b816020850160208301375f918101602001919091529392505050565b5f602082840312156120a3575f80fd5b813567ffffffffffffffff8111156120b9575f80fd5b8201604081850312156120ca575f80fd5b6120d2611e6c565b6120db82611a22565b8152602082013567ffffffffffffffff8111156120f6575f80fd5b61210286828501611fea565b602083015250949350505050565b5f60208284031215612120575f80fd5b5051919050565b8181038181111561086157610861611d67565b602081525f82516003811061215157612151611c1a565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526121b060a0840182611bbc565b949350505050565b5f602082840312156121c8575f80fd5b813567ffffffffffffffff8111156121de575f80fd5b8201604081850312156121ef575f80fd5b6121f7611e6c565b813567ffffffffffffffff81111561220d575f80fd5b61221986828501611fea565b825250602082013567ffffffffffffffff8111156120f6575f80fd5b808202811582820484141761086157610861611d67565b5f8261227f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea26469706673582212204e4cf647127c9375d9d4d84240a56dd4ae0f1f1727bcc814e7c0f19d99a9cc9664736f6c634300081a0033", u = class u extends K {
11
+ constructor() {
12
+ super(...arguments), this.abi = y;
13
+ }
14
+ /**
15
+ * The owner of the incentive
16
+ *
17
+ * @public
18
+ * @async
19
+ * @param {?ReadParams} [params]
20
+ * @returns {Promise<Address>}
21
+ */
22
+ async owner(f) {
23
+ return await D(this._config, {
24
+ address: this.assertValidAddress(),
25
+ args: [],
26
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
27
+ ...f
28
+ });
29
+ }
30
+ /**
31
+ * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`
32
+ *
33
+ * @public
34
+ * @async
35
+ * @param {?ReadParams} [params]
36
+ * @returns {Promise<bigint>} - The current reward
37
+ */
38
+ async currentReward(f) {
39
+ return await x(
40
+ this._config,
41
+ {
42
+ address: this.assertValidAddress(),
43
+ args: [],
44
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
45
+ ...f
46
+ }
47
+ );
48
+ }
49
+ /**
50
+ * Retrieves the maximum reward amount per claim.
51
+ *
52
+ * @public
53
+ * @async
54
+ * @param {?ReadParams} [params]
55
+ * @returns {Promise<bigint>} The maximum reward amount per claim
56
+ */
57
+ async getMaxReward(f) {
58
+ return await I(
59
+ this._config,
60
+ {
61
+ ...f,
62
+ address: this.assertValidAddress()
63
+ }
64
+ );
65
+ }
66
+ /**
67
+ * Fetches the incentive scalar from a transaction hash
68
+ *
69
+ * @param {GetIncentiveScalarParams} params
70
+ * @param {?ReadParams} [params]
71
+ * @returns {Promise<bigint>}
72
+ * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}
73
+ */
74
+ async getIncentiveScalar({ chainId: f, hash: a, knownSignatures: b }, t) {
75
+ var d;
76
+ const e = await this.getIncentiveCriteria(t);
77
+ if (e.criteriaType === p.EVENT) {
78
+ const c = await H(this._config, {
79
+ chainId: f,
80
+ hash: a
81
+ });
82
+ if (e.fieldIndex === X.GAS_REBATE_INCENTIVE)
83
+ return c.gasUsed * c.effectiveGasPrice + // Normal gas cost
84
+ (c.blobGasUsed ?? 0n) * (c.blobGasPrice ?? 0n);
85
+ const i = c.logs;
86
+ if (i.length === 0)
87
+ throw new C(
88
+ `No logs found for event signature ${e.signature}`
89
+ );
90
+ try {
91
+ const r = b[e.signature], s = S({
92
+ abi: [r],
93
+ logs: i
94
+ });
95
+ if (s == null || s.length === 0)
96
+ throw new C(
97
+ `No logs found for event signature ${e.signature}`
98
+ );
99
+ const m = ((d = s[0]) == null ? void 0 : d.args)[e.fieldIndex];
100
+ if (m === void 0)
101
+ throw new l(
102
+ `Decoded argument at index ${e.fieldIndex} is undefined`
103
+ );
104
+ return BigInt(m);
105
+ } catch (r) {
106
+ throw new l(
107
+ `Failed to decode event log for signature ${e.signature}: ${r.message}`
108
+ );
109
+ }
110
+ } else if (e.criteriaType === p.FUNC) {
111
+ const c = await L(this._config, {
112
+ chainId: f,
113
+ hash: a
114
+ });
115
+ try {
116
+ const i = b[e.signature], s = q({
117
+ abi: [i],
118
+ data: c.input
119
+ }).args[e.fieldIndex];
120
+ if (s == null)
121
+ throw new l(
122
+ `Decoded argument at index ${e.fieldIndex} is undefined`
123
+ );
124
+ return BigInt(s);
125
+ } catch (i) {
126
+ throw new l(
127
+ `Failed to decode function data for signature ${e.signature}: ${i.message}`
128
+ );
129
+ }
130
+ } else
131
+ throw new j(
132
+ `Invalid criteria type ${e.criteriaType}`
133
+ );
134
+ }
135
+ /**
136
+ * The number of claims that have been made
137
+ *
138
+ * @public
139
+ * @async
140
+ * @param {?ReadParams} [params]
141
+ * @returns {Promise<bigint>}
142
+ */
143
+ async claims(f) {
144
+ return await R(
145
+ this._config,
146
+ {
147
+ address: this.assertValidAddress(),
148
+ args: [],
149
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
150
+ ...f
151
+ }
152
+ );
153
+ }
154
+ /**
155
+ * The total amount of rewards claimed
156
+ *
157
+ * @public
158
+ * @async
159
+ * @param {?ReadParams} [params]
160
+ * @returns {Promise<bigint>}
161
+ */
162
+ async totalClaimed(f) {
163
+ return await V(
164
+ this._config,
165
+ {
166
+ address: this.assertValidAddress(),
167
+ args: [],
168
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
169
+ ...f
170
+ }
171
+ );
172
+ }
173
+ /**
174
+ * A mapping of address to claim status
175
+ *
176
+ * @public
177
+ * @async
178
+ * @param {Address} address
179
+ * @param {?ReadParams} [params]
180
+ * @returns {Promise<boolean>}
181
+ */
182
+ async claimed(f, a) {
183
+ return await _(
184
+ this._config,
185
+ {
186
+ address: this.assertValidAddress(),
187
+ args: [f],
188
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
189
+ ...a
190
+ }
191
+ );
192
+ }
193
+ /**
194
+ * The address of the ERC20-like token
195
+ *
196
+ * @public
197
+ * @async
198
+ * @param {?ReadParams} [params]
199
+ * @returns {Promise<Address>}
200
+ */
201
+ async asset(f) {
202
+ return await E(this._config, {
203
+ address: this.assertValidAddress(),
204
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
205
+ ...f
206
+ });
207
+ }
208
+ /**
209
+ * The address of the pegged ERC20-like token
210
+ *
211
+ * @public
212
+ * @async
213
+ * @param {?ReadParams} [params]
214
+ * @returns {Promise<Address>}
215
+ */
216
+ async peg(f) {
217
+ return await P(this._config, {
218
+ address: this.assertValidAddress(),
219
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
220
+ ...f
221
+ });
222
+ }
223
+ /**
224
+ * The reward amount issued for each claim
225
+ *
226
+ * @public
227
+ * @async
228
+ * @param {?ReadParams} [params]
229
+ * @returns {Promise<bigint>}
230
+ */
231
+ async reward(f) {
232
+ return await N(
233
+ this._config,
234
+ {
235
+ address: this.assertValidAddress(),
236
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
237
+ ...f
238
+ }
239
+ );
240
+ }
241
+ /**
242
+ * The limit (max possible rewards payout in reward token)
243
+ *
244
+ * @public
245
+ * @async
246
+ * @param {?ReadParams} [params]
247
+ * @returns {Promise<bigint>}
248
+ */
249
+ async limit(f) {
250
+ return await O(this._config, {
251
+ address: this.assertValidAddress(),
252
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
253
+ ...f
254
+ });
255
+ }
256
+ /**
257
+ * Claim the incentive
258
+ *
259
+ * @public
260
+ * @async
261
+ * @param {ClaimPayload} payload
262
+ * @param {?WriteParams} [params]
263
+ * @returns {Promise<boolean>} - Returns true if successfully claimed
264
+ */
265
+ async claim(f, a) {
266
+ return await this.awaitResult(this.claimRaw(f, a));
267
+ }
268
+ /**
269
+ * Claim the incentive
270
+ *
271
+ * @public
272
+ * @async
273
+ * @param {ClaimPayload} payload
274
+ * @param {?WriteParams} [params]
275
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
276
+ */
277
+ async claimRaw(f, a) {
278
+ const { request: b, result: t } = await $(this._config, {
279
+ address: this.assertValidAddress(),
280
+ args: [w(f)],
281
+ ...this.optionallyAttachAccount(),
282
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
283
+ ...a
284
+ });
285
+ return { hash: await B(
286
+ this._config,
287
+ b
288
+ ), result: t };
289
+ }
290
+ /**
291
+ * Clawback assets from the incentive
292
+ *
293
+ * @public
294
+ * @async
295
+ * @param {ClaimPayload} payload
296
+ * @param {?WriteParams} [params]
297
+ * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
298
+ */
299
+ async clawback(f, a) {
300
+ return await this.awaitResult(this.clawbackRaw(f, a));
301
+ }
302
+ /**
303
+ * Clawback assets from the incentive
304
+ *
305
+ * @public
306
+ * @async
307
+ * @param {ClaimPayload} payload
308
+ * @param {?WriteParams} [params]
309
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
310
+ */
311
+ async clawbackRaw(f, a) {
312
+ const { request: b, result: t } = await F(
313
+ this._config,
314
+ {
315
+ address: this.assertValidAddress(),
316
+ args: [w(f)],
317
+ ...this.optionallyAttachAccount(),
318
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
319
+ ...a
320
+ }
321
+ );
322
+ return { hash: await G(
323
+ this._config,
324
+ b
325
+ ), result: t };
326
+ }
327
+ /**
328
+ * Check if an incentive is claimable.
329
+ *
330
+ * @public
331
+ * @async
332
+ * @param {ClaimPayload} payload
333
+ * @param {?ReadParams} [params]
334
+ * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
335
+ */
336
+ async isClaimable(f, a) {
337
+ return await M(
338
+ this._config,
339
+ {
340
+ address: this.assertValidAddress(),
341
+ args: [f.target, f.data],
342
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
343
+ ...a
344
+ }
345
+ );
346
+ }
347
+ /**
348
+ * read the peg token for the incentive.
349
+ *
350
+ * @public
351
+ * @async
352
+ * @param {?ReadParams} [params]
353
+ * @returns {Promise<Address>} = The address of the token the reward is pegged to
354
+ */
355
+ async getPeg(f) {
356
+ return await U(
357
+ this._config,
358
+ {
359
+ address: this.assertValidAddress(),
360
+ args: [],
361
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
362
+ ...f
363
+ }
364
+ );
365
+ }
366
+ /**
367
+ * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`
368
+ *
369
+ * @public
370
+ * @async
371
+ * @param {?ReadParams} [params]
372
+ * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.
373
+ */
374
+ async getTotalBudget(f) {
375
+ return await this.limit(f);
376
+ }
377
+ /**
378
+ * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
379
+ *
380
+ * @public
381
+ * @async
382
+ * @param {?ReadParams} [params]
383
+ * @returns {Promise<boolean>} - True if total claims is less than limit
384
+ */
385
+ async canBeClaimed(f) {
386
+ return await this.getRemainingClaimPotential(f) > 0n;
387
+ }
388
+ /**
389
+ * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
390
+ *
391
+ * @public
392
+ * @async
393
+ * @param {?ReadParams} [params]
394
+ * @returns {Promise<bigint>} - True if total claims is less than limit
395
+ */
396
+ async getRemainingClaimPotential(f) {
397
+ const [a, b] = await Promise.all([
398
+ this.totalClaimed(f),
399
+ this.limit(f)
400
+ ]);
401
+ return b - a;
402
+ }
403
+ /**
404
+ *Functions from the ERC20VariableIncentive contract
405
+ */
406
+ /**
407
+ * Fetches the IncentiveCriteria struct from the contract
408
+ *
409
+ * @param {?ReadParams} [params]
410
+ * @returns {Promise<IncentiveCriteria>} Incentive criteria structure
411
+ * @throws {IncentiveCriteriaNotFoundError}
412
+ */
413
+ async getIncentiveCriteria(f) {
414
+ try {
415
+ return await k(
416
+ this._config,
417
+ {
418
+ ...f,
419
+ address: this.assertValidAddress()
420
+ }
421
+ );
422
+ } catch (a) {
423
+ throw new Q(a);
424
+ }
425
+ }
426
+ /**
427
+ * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing
428
+ * the existing `limit` field by `netAmount`. The entire payload is then re-encoded
429
+ * via `prepareERC20PeggedIncentivePayload(...)`.
430
+ *
431
+ * @public
432
+ * @param {bigint} netAmount - The additional limit to add to this incentive.
433
+ * @returns {Hex} The ABI-encoded payload with the updated `limit`.
434
+ */
435
+ async getTopupPayload(f) {
436
+ var a, b, t, e, d;
437
+ return v({
438
+ asset: await this.asset() ?? n,
439
+ peg: ((a = this.payload) == null ? void 0 : a.peg) ?? n,
440
+ reward: ((b = this.payload) == null ? void 0 : b.reward) ?? 0n,
441
+ limit: f,
442
+ maxReward: ((t = this.payload) == null ? void 0 : t.maxReward) ?? 0n,
443
+ manager: ((e = this.payload) == null ? void 0 : e.manager) ?? n,
444
+ criteria: ((d = this.payload) == null ? void 0 : d.criteria) ?? {
445
+ criteriaType: 0,
446
+ signature: z,
447
+ fieldIndex: 0,
448
+ targetContract: n,
449
+ valueType: 0
450
+ }
451
+ });
452
+ }
453
+ /**
454
+ * @inheritdoc
455
+ *
456
+ * @public
457
+ * @param {?ERC20PeggedVariableCriteriaIncentiveV2Payload} [_payload]
458
+ * @param {?DeployableOptions} [_options]
459
+ * @returns {GenericDeployableParams}
460
+ */
461
+ buildParameters(f, a) {
462
+ const [b, t] = this.validateDeploymentConfig(
463
+ f,
464
+ a
465
+ );
466
+ return {
467
+ abi: y,
468
+ bytecode: Z,
469
+ args: [v(b)],
470
+ ...this.optionallyAttachAccount(t.account)
471
+ };
472
+ }
473
+ /**
474
+ * Encodes an amount to clawback from the incentive
475
+ *
476
+ * @public
477
+ * @param {bigint} amount - How much of the asset to clawback
478
+ * @returns {Hex} - Returns an encoded uint256
479
+ */
480
+ buildClawbackData(f) {
481
+ return g([{ type: "uint256" }], [f]);
482
+ }
483
+ /**
484
+ * Builds the claim data for the ERC20PeggedVariableCriteriaIncentivePayload.
485
+ *
486
+ * @public
487
+ * @param {bigint} signedAmount
488
+ * @returns {Hash} Returns the encoded claim data
489
+ * @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentiveV2Payload.
490
+ */
491
+ buildClaimData(f) {
492
+ return g(
493
+ [{ type: "uint256", name: "signedAmount" }],
494
+ [f]
495
+ );
496
+ }
497
+ /**
498
+ * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.
499
+ * Useful when deriving amount claimed from logs.
500
+ *
501
+ * @public
502
+ * @param {Hex} claimData
503
+ * @returns {Promise<bigint>} Returns the reward amount from a claim data payload
504
+ */
505
+ async decodeClaimData(f) {
506
+ const a = o(
507
+ [
508
+ {
509
+ type: "tuple",
510
+ name: "BoostClaimData",
511
+ components: [
512
+ { type: "bytes", name: "validatorData" },
513
+ { type: "bytes", name: "incentiveData" }
514
+ ]
515
+ }
516
+ ],
517
+ f
518
+ ), b = o(
519
+ [{ type: "uint256" }],
520
+ a[0].incentiveData
521
+ )[0];
522
+ let t = b;
523
+ const [e, d] = await Promise.all([
524
+ this.reward(),
525
+ this.getMaxReward()
526
+ ]);
527
+ return e === 0n || (t = e * b / h("1"), d !== 0n && t > d && (t = d)), t;
528
+ }
529
+ /**
530
+ * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.
531
+ * Useful when deriving amount claimed from logs.
532
+ * Use this function instead of `decodeClaimData` if you have reward details.
533
+ *
534
+ * @public
535
+ * @param {Hex} claimData
536
+ * @param {bigint} [reward]
537
+ * @param {bigint} [maxReward]
538
+ * @returns {BigInt} Returns the reward amount from a claim data payload
539
+ */
540
+ decodeClaimDataWithRewardDetails(f, a, b) {
541
+ const t = o(
542
+ [
543
+ {
544
+ type: "tuple",
545
+ name: "BoostClaimData",
546
+ components: [
547
+ { type: "bytes", name: "validatorData" },
548
+ { type: "bytes", name: "incentiveData" }
549
+ ]
550
+ }
551
+ ],
552
+ f
553
+ ), e = o(
554
+ [{ type: "uint256" }],
555
+ t[0].incentiveData
556
+ )[0];
557
+ let d = e;
558
+ return a === 0n || (d = a * e / h("1"), b !== 0n && d > b && (d = b)), d;
559
+ }
560
+ };
561
+ u.bases = {
562
+ 31337: void 0,
563
+ ...J
564
+ }, u.registryType = W.INCENTIVE;
565
+ let A = u;
566
+ function v({
567
+ asset: T,
568
+ peg: f,
569
+ reward: a,
570
+ limit: b,
571
+ maxReward: t = 0n,
572
+ manager: e = n,
573
+ criteria: d
574
+ }) {
575
+ return g(
576
+ [
577
+ {
578
+ type: "tuple",
579
+ name: "initPayloadExtended",
580
+ components: [
581
+ { type: "address", name: "asset" },
582
+ { type: "address", name: "peg" },
583
+ { type: "uint256", name: "reward" },
584
+ { type: "uint256", name: "limit" },
585
+ { type: "address", name: "manager" },
586
+ { type: "uint256", name: "maxReward" },
587
+ {
588
+ type: "tuple",
589
+ name: "criteria",
590
+ components: [
591
+ { type: "uint8", name: "criteriaType" },
592
+ { type: "bytes32", name: "signature" },
593
+ { type: "uint8", name: "fieldIndex" },
594
+ { type: "address", name: "targetContract" },
595
+ { type: "uint8", name: "valueType" }
596
+ ]
597
+ }
598
+ ]
599
+ }
600
+ ],
601
+ [
602
+ {
603
+ asset: T,
604
+ peg: f,
605
+ reward: a,
606
+ limit: b,
607
+ manager: e,
608
+ maxReward: t,
609
+ criteria: {
610
+ criteriaType: d.criteriaType,
611
+ signature: d.signature,
612
+ fieldIndex: d.fieldIndex,
613
+ targetContract: d.targetContract,
614
+ valueType: d.valueType
615
+ }
616
+ }
617
+ ]
618
+ );
619
+ }
620
+ export {
621
+ A as ERC20PeggedVariableCriteriaIncentiveV2,
622
+ y as erc20PeggedVariableCriteriaIncentiveV2Abi,
623
+ v as prepareERC20PeggedVariableCriteriaIncentiveV2Payload
624
+ };
625
+ //# sourceMappingURL=ERC20PeggedVariableCriteriaIncentiveV2.js.map