@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,604 @@
1
+ import { y as h, bl as x, bm as D, bn as I, bo as T, bp as V, bq as _, br as E, bs as P, bt as $, bu as N, bv as B, bw as F, bx as G, by as U, bz as k, bA as q, bB as z } from "../generated-CINzoGbl.js";
2
+ import { getTransactionReceipt as M, getTransaction as S } from "@wagmi/core";
3
+ import { parseEventLogs as H, decodeFunctionData as L, zeroAddress as n, zeroHash as J, encodeAbiParameters as g, decodeAbiParameters as o, parseEther as y } from "viem";
4
+ import { e as W } from "../deployments-CH4Xmkbv.js";
5
+ import { SignatureType as p } from "../Actions/EventAction.js";
6
+ import { DeployableTarget as Z } 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 K } from "../errors.js";
9
+ import { RegistryType as O, CheatCodes as Q } from "../utils.js";
10
+ const X = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6121b3806100895f395ff3fe6080604052600436106102ab575f3560e01c8063715018a611610165578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b1461078d578063fe9fbb80146107a0578063fee81cf4146107bf575f80fd5b8063ec87621c14610766578063f04e283e1461077a575f80fd5b8063db09da12116100ac578063db09da1214610713578063dcc2136114610732578063dcc59b6f14610751575f80fd5b8063c884ef83146106d0578063d54ad2a1146106fe575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf1461067e578063be4994f81461069d578063c213f3f9146106bc575f80fd5b8063a4d66daf14610648578063a871ced21461065d575f80fd5b8063775486871161014b57806377548687146105b45780638da5cb5b146106065780639214fa4d1461061e575f80fd5b8063715018a61461059857806375b238fc146105a0575f80fd5b806330db555f1161020f5780634a4ee7b1116101c5578063514e62fc116101ab578063514e62fc14610546578063547d18641461057b57806354d1f13d14610590575f80fd5b80634a4ee7b1146105075780634e7165a21461051a575f80fd5b80634359d28a116101f55780634359d28a14610480578063439fab911461049f578063474f5a44146104be575f80fd5b806330db555f1461043557806338d52e0f14610454575f80fd5b80631f1cb62b11610264578063256929621161024a57806325692962146103c257806328d6183b146103ca5780632de9480714610404575f80fd5b80631f1cb62b1461035d578063228cb733146103ae575f80fd5b8063183a4f6e11610294578063183a4f6e146103005780631c10893f146103155780631cd64df414610328575f80fd5b806301ffc9a7146102af57806307621eca146102e3575b5f80fd5b3480156102ba575f80fd5b506102ce6102c93660046118fe565b6107f0565b60405190151581526020015b60405180910390f35b3480156102ee575f80fd5b505f545b6040519081526020016102da565b61031361030e366004611944565b61084b565b005b610313610323366004611983565b610858565b348015610333575f80fd5b506102ce610342366004611983565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610368575f80fd5b50600a546103899073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102da565b3480156103b9575f80fd5b506102f25f5481565b61031361086e565b3480156103d5575f80fd5b506040517ff60c99c90000000000000000000000000000000000000000000000000000000081526020016102da565b34801561040f575f80fd5b506102f261041e3660046119ab565b638b78c6d8600c9081525f91909152602090205490565b348015610440575f80fd5b5061031361044f366004611944565b6108bb565b34801561045f575f80fd5b506006546103899073ffffffffffffffffffffffffffffffffffffffff1681565b34801561048b575f80fd5b5061031361049a366004611a0c565b610977565b3480156104aa575f80fd5b506103136104b9366004611ab6565b610a71565b3480156104c9575f80fd5b506104dd6104d8366004611ab6565b610da1565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102da565b610313610515366004611983565b610f03565b348015610525575f80fd5b50610539610534366004611ab6565b610f15565b6040516102da9190611b41565b348015610551575f80fd5b506102ce610560366004611983565b638b78c6d8600c9081525f9290925260209091205416151590565b348015610586575f80fd5b506102f260025481565b610313610faf565b610313610fe8565b3480156105ab575f80fd5b506102f2600281565b3480156105bf575f80fd5b506003546004546005546105f69260ff908116929190811690610100900473ffffffffffffffffffffffffffffffffffffffff1684565b6040516102da9493929190611b94565b348015610611575f80fd5b50638b78c6d81954610389565b348015610629575f80fd5b50600a5473ffffffffffffffffffffffffffffffffffffffff16610389565b348015610653575f80fd5b506102f260085481565b348015610668575f80fd5b50610671610ffb565b6040516102da9190611c1c565b348015610689575f80fd5b506102ce610698366004611c2a565b611095565b3480156106a8575f80fd5b506103136106b7366004611a0c565b6112c2565b3480156106c7575f80fd5b50600b546102f2565b3480156106db575f80fd5b506102ce6106ea3660046119ab565b60016020525f908152604090205460ff1681565b348015610709575f80fd5b506102f260095481565b34801561071e575f80fd5b506102ce61072d366004611c2a565b611360565b34801561073d575f80fd5b5061031361074c366004611a0c565b6113d3565b34801561075c575f80fd5b506102f260075481565b348015610771575f80fd5b506102f2600181565b6103136107883660046119ab565b611471565b61031361079b3660046119ab565b6114ab565b3480156107ab575f80fd5b506102ce6107ba3660046119ab565b6114d1565b3480156107ca575f80fd5b506102f26107d93660046119ab565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167ff60c99c9000000000000000000000000000000000000000000000000000000001480610845575061084582611530565b92915050565b6108553382611585565b50565b610860611590565b61086a82826115aa565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60016108c6816115b6565b815f036108ff576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546109249073ffffffffffffffffffffffffffffffffffffffff163330856115e7565b8160085f8282546109359190611ca6565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b6002610982816115b6565b8382146109bb576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a69575f8484838181106109d8576109d8611cb9565b90506020020160208101906109ed9190611ce6565b9050801515600103610a2f57610a2a878784818110610a0e57610a0e611cb9565b9050602002016020810190610a2391906119ab565b60016115aa565b610a60565b610a60878784818110610a4457610a44611cb9565b9050602002016020810190610a5991906119ab565b6001611585565b506001016109bd565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610ac25760018160011c14303b10610ab95763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610ad083850185611da1565b905080606001515f03610b0f576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015181515f90610b389073ffffffffffffffffffffffffffffffffffffffff1630611649565b905081811015610ba15782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b60c083015183516006805473ffffffffffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556020860151600a805491909316911617905560408401515f55606084015160085560a0840151600b5580516003805483929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610c5557610c55611b53565b02179055506020820151600182015560408201516002909101805460609093015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090931660ff90921691909117919091179055610ccc3361167c565b610cdb846080015160016116c4565b836020015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff167fdc505a50c6f2c816d981a377c8177e2604d8302821a502bc9f742e0748f338428660400151876060015188608001518960a001518a60c00151604051610d5b959493929190611e9a565b60405180910390a3505050508015610d9c576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610dae816115b6565b5f610dbb85870187611f8c565b90505f8160200151806020019051810190610dd69190612009565b90508060085f828254610de99190612020565b90915550508151600654610e169173ffffffffffffffffffffffffffffffffffffffff9091169083611705565b81516006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610ed491611b41565b60405180910390a260065490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610f0b611590565b61086a8282611585565b60605f610f2483850185611da1565b6060818101516040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184529482019490945290519394509092610f969201612033565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610ff0611590565b610ff95f611758565b565b604080516080810182525f808252602082018190529181018290526060810191909152604080516080810190915260038054829060ff16600181111561104357611043611b53565b600181111561105457611054611b53565b81526001820154602082015260029091015460ff81166040830152610100900473ffffffffffffffffffffffffffffffffffffffff16606090910152919050565b5f61109e611590565b5f6110ab838501856120b1565b90505f81602001518060200190518101906110c69190612009565b90505f80545f036110d85750806110fb565b670de0b6b3a7640000825f546110ee919061212e565b6110f89190612145565b90505b600b541580159061110d5750600b5481115b156111175750600b545b611120816117a2565b611156576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600854816009546111679190611ca6565b111561119f576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060095f8282546111b09190611ca6565b92505081905550600160075f8282546111c99190611ca6565b90915550506006546111f29073ffffffffffffffffffffffffffffffffffffffff168883611705565b6006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526112ad91611b41565b60405180910390a25060019695505050505050565b60026112cd816115b6565b838214611306576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a695761135886868381811061132557611325611cb9565b905060200201602081019061133a91906119ab565b85858481811061134c5761134c611cb9565b905060200201356115aa565b600101611308565b5f808061136f848601866120b1565b90505f816020015180602001905181019061138a9190612009565b90505f545f0361139c578092506113bf565b670de0b6b3a7640000815f546113b2919061212e565b6113bc9190612145565b92505b6113c8836117a2565b979650505050505050565b60026113de816115b6565b838214611417576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a695761146986868381811061143657611436611cb9565b905060200201602081019061144b91906119ab565b85858481811061145d5761145d611cb9565b90506020020135611585565b600101611419565b611479611590565b63389a75e1600c52805f526020600c20805442111561149f57636f5e88185f526004601cfd5b5f905561085581611758565b6114b3611590565b8060601b6114c857637448fbae5f526004601cfd5b61085581611758565b5f8173ffffffffffffffffffffffffffffffffffffffff166114f6638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806108455750638b78c6d8600c9081525f83905260209020546003161515610845565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f565863380000000000000000000000000000000000000000000000000000000014806108455750610845826117bc565b61086a82825f611811565b638b78c6d819543314610ff9576382b429005f526004601cfd5b61086a82826001611811565b638b78c6d81954331461085557638b78c6d8600c52335f52806020600c205416610855576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f51141661163b57803d873b15171061163b57637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661174e57803d853b15171061174e576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f600854826009546117b49190611ca6565b111592915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa9216705000000000000000000000000000000000000000000000000000000001480610845575061084582611868565b638b78c6d8600c52825f526020600c20805483811783611832575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061084557507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610845565b5f6020828403121561190e575f80fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461193d575f80fd5b9392505050565b5f60208284031215611954575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461197e575f80fd5b919050565b5f8060408385031215611994575f80fd5b61199d8361195b565b946020939093013593505050565b5f602082840312156119bb575f80fd5b61193d8261195b565b5f8083601f8401126119d4575f80fd5b50813567ffffffffffffffff8111156119eb575f80fd5b6020830191508360208260051b8501011115611a05575f80fd5b9250929050565b5f805f8060408587031215611a1f575f80fd5b843567ffffffffffffffff811115611a35575f80fd5b611a41878288016119c4565b909550935050602085013567ffffffffffffffff811115611a60575f80fd5b611a6c878288016119c4565b95989497509550505050565b5f8083601f840112611a88575f80fd5b50813567ffffffffffffffff811115611a9f575f80fd5b602083019150836020828501011115611a05575f80fd5b5f8060208385031215611ac7575f80fd5b823567ffffffffffffffff811115611add575f80fd5b611ae985828601611a78565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f61193d6020830184611af5565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611b9057611b90611b53565b9052565b60808101611ba28287611b80565b84602083015260ff8416604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b611be1828251611b80565b6020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301525050565b608081016108458284611bd6565b5f805f60408486031215611c3c575f80fd5b611c458461195b565b9250602084013567ffffffffffffffff811115611c60575f80fd5b611c6c86828701611a78565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561084557610845611c79565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611cf6575f80fd5b8135801515811461193d575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160e0810167ffffffffffffffff81118282101715611d5557611d55611d05565b60405290565b6040516080810167ffffffffffffffff81118282101715611d5557611d55611d05565b6040805190810167ffffffffffffffff81118282101715611d5557611d55611d05565b5f81830361014081128015611db4575f80fd5b50611dbd611d32565b611dc68461195b565b8152611dd46020850161195b565b60208201526040848101359082015260608085013590820152611df96080850161195b565b60808281019190915260a085810135908301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4083011215611e39575f80fd5b611e41611d5b565b915060c084013560028110611e54575f80fd5b825260e0840135602083015261010084013560ff81168114611e74575f80fd5b6040830152611e86610120850161195b565b606083015260c08101919091529392505050565b8581526020810185905273ffffffffffffffffffffffffffffffffffffffff84166040820152606081018390526101008101611ed96080830184611bd6565b9695505050505050565b5f82601f830112611ef2575f80fd5b813567ffffffffffffffff811115611f0c57611f0c611d05565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff81118282101715611f5957611f59611d05565b604052818152838201602001851015611f70575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215611f9c575f80fd5b813567ffffffffffffffff811115611fb2575f80fd5b820160408185031215611fc3575f80fd5b611fcb611d7e565b611fd48261195b565b8152602082013567ffffffffffffffff811115611fef575f80fd5b611ffb86828501611ee3565b602083015250949350505050565b5f60208284031215612019575f80fd5b5051919050565b8181038181111561084557610845611c79565b602081525f82516003811061204a5761204a611b53565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526120a960a0840182611af5565b949350505050565b5f602082840312156120c1575f80fd5b813567ffffffffffffffff8111156120d7575f80fd5b8201604081850312156120e8575f80fd5b6120f0611d7e565b813567ffffffffffffffff811115612106575f80fd5b61211286828501611ee3565b825250602082013567ffffffffffffffff811115611fef575f80fd5b808202811582820484141761084557610845611c79565b5f82612178577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea264697066735822122098c803dd4f42edf25288bd3c5b3e7bf9935c3d848f118a09f85d1ebc21194d1164736f6c634300081a0033", u = class u extends Z {
11
+ constructor() {
12
+ super(...arguments), this.abi = h;
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 x(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 D(
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(this._config, {
59
+ ...f,
60
+ address: this.assertValidAddress()
61
+ });
62
+ }
63
+ /**
64
+ * Fetches the incentive scalar from a transaction hash
65
+ *
66
+ * @param {GetIncentiveScalarParams} params
67
+ * @param {?ReadParams} [params]
68
+ * @returns {Promise<bigint>}
69
+ * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}
70
+ */
71
+ async getIncentiveScalar({ chainId: f, hash: a, knownSignatures: e }, d) {
72
+ var t;
73
+ const b = await this.getIncentiveCriteria(d);
74
+ if (b.criteriaType === p.EVENT) {
75
+ const c = await M(this._config, {
76
+ chainId: f,
77
+ hash: a
78
+ });
79
+ if (b.fieldIndex === Q.GAS_REBATE_INCENTIVE)
80
+ return c.gasUsed * c.effectiveGasPrice + // Normal gas cost
81
+ (c.blobGasUsed ?? 0n) * (c.blobGasPrice ?? 0n);
82
+ const i = c.logs;
83
+ if (i.length === 0)
84
+ throw new C(
85
+ `No logs found for event signature ${b.signature}`
86
+ );
87
+ try {
88
+ const r = e[b.signature], s = H({
89
+ abi: [r],
90
+ logs: i
91
+ });
92
+ if (s == null || s.length === 0)
93
+ throw new C(
94
+ `No logs found for event signature ${b.signature}`
95
+ );
96
+ const m = ((t = s[0]) == null ? void 0 : t.args)[b.fieldIndex];
97
+ if (m === void 0)
98
+ throw new l(
99
+ `Decoded argument at index ${b.fieldIndex} is undefined`
100
+ );
101
+ return BigInt(m);
102
+ } catch (r) {
103
+ throw new l(
104
+ `Failed to decode event log for signature ${b.signature}: ${r.message}`
105
+ );
106
+ }
107
+ } else if (b.criteriaType === p.FUNC) {
108
+ const c = await S(this._config, {
109
+ chainId: f,
110
+ hash: a
111
+ });
112
+ try {
113
+ const i = e[b.signature], s = L({
114
+ abi: [i],
115
+ data: c.input
116
+ }).args[b.fieldIndex];
117
+ if (s == null)
118
+ throw new l(
119
+ `Decoded argument at index ${b.fieldIndex} is undefined`
120
+ );
121
+ return BigInt(s);
122
+ } catch (i) {
123
+ throw new l(
124
+ `Failed to decode function data for signature ${b.signature}: ${i.message}`
125
+ );
126
+ }
127
+ } else
128
+ throw new j(
129
+ `Invalid criteria type ${b.criteriaType}`
130
+ );
131
+ }
132
+ /**
133
+ * The number of claims that have been made
134
+ *
135
+ * @public
136
+ * @async
137
+ * @param {?ReadParams} [params]
138
+ * @returns {Promise<bigint>}
139
+ */
140
+ async claims(f) {
141
+ return await T(this._config, {
142
+ address: this.assertValidAddress(),
143
+ args: [],
144
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
145
+ ...f
146
+ });
147
+ }
148
+ /**
149
+ * The total amount of rewards claimed
150
+ *
151
+ * @public
152
+ * @async
153
+ * @param {?ReadParams} [params]
154
+ * @returns {Promise<bigint>}
155
+ */
156
+ async totalClaimed(f) {
157
+ return await V(
158
+ this._config,
159
+ {
160
+ address: this.assertValidAddress(),
161
+ args: [],
162
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
163
+ ...f
164
+ }
165
+ );
166
+ }
167
+ /**
168
+ * A mapping of address to claim status
169
+ *
170
+ * @public
171
+ * @async
172
+ * @param {Address} address
173
+ * @param {?ReadParams} [params]
174
+ * @returns {Promise<boolean>}
175
+ */
176
+ async claimed(f, a) {
177
+ return await _(this._config, {
178
+ address: this.assertValidAddress(),
179
+ args: [f],
180
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
181
+ ...a
182
+ });
183
+ }
184
+ /**
185
+ * The address of the ERC20-like token
186
+ *
187
+ * @public
188
+ * @async
189
+ * @param {?ReadParams} [params]
190
+ * @returns {Promise<Address>}
191
+ */
192
+ async asset(f) {
193
+ return await E(this._config, {
194
+ address: this.assertValidAddress(),
195
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
196
+ ...f
197
+ });
198
+ }
199
+ /**
200
+ * The address of the pegged ERC20-like token
201
+ *
202
+ * @public
203
+ * @async
204
+ * @param {?ReadParams} [params]
205
+ * @returns {Promise<Address>}
206
+ */
207
+ async peg(f) {
208
+ return await P(this._config, {
209
+ address: this.assertValidAddress(),
210
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
211
+ ...f
212
+ });
213
+ }
214
+ /**
215
+ * The reward amount issued for each claim
216
+ *
217
+ * @public
218
+ * @async
219
+ * @param {?ReadParams} [params]
220
+ * @returns {Promise<bigint>}
221
+ */
222
+ async reward(f) {
223
+ return await $(this._config, {
224
+ address: this.assertValidAddress(),
225
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
226
+ ...f
227
+ });
228
+ }
229
+ /**
230
+ * The limit (max possible rewards payout in reward token)
231
+ *
232
+ * @public
233
+ * @async
234
+ * @param {?ReadParams} [params]
235
+ * @returns {Promise<bigint>}
236
+ */
237
+ async limit(f) {
238
+ return await N(this._config, {
239
+ address: this.assertValidAddress(),
240
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
241
+ ...f
242
+ });
243
+ }
244
+ /**
245
+ * Claim the incentive
246
+ *
247
+ * @public
248
+ * @async
249
+ * @param {ClaimPayload} payload
250
+ * @param {?WriteParams} [params]
251
+ * @returns {Promise<boolean>} - Returns true if successfully claimed
252
+ */
253
+ async claim(f, a) {
254
+ return await this.awaitResult(this.claimRaw(f, a));
255
+ }
256
+ /**
257
+ * Claim the incentive
258
+ *
259
+ * @public
260
+ * @async
261
+ * @param {ClaimPayload} payload
262
+ * @param {?WriteParams} [params]
263
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
264
+ */
265
+ async claimRaw(f, a) {
266
+ const { request: e, result: d } = await B(this._config, {
267
+ address: this.assertValidAddress(),
268
+ args: [w(f)],
269
+ ...this.optionallyAttachAccount(),
270
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
271
+ ...a
272
+ });
273
+ return { hash: await F(
274
+ this._config,
275
+ e
276
+ ), result: d };
277
+ }
278
+ /**
279
+ * Clawback assets from the incentive
280
+ *
281
+ * @public
282
+ * @async
283
+ * @param {ClaimPayload} payload
284
+ * @param {?WriteParams} [params]
285
+ * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
286
+ */
287
+ async clawback(f, a) {
288
+ return await this.awaitResult(this.clawbackRaw(f, a));
289
+ }
290
+ /**
291
+ * Clawback assets from the incentive
292
+ *
293
+ * @public
294
+ * @async
295
+ * @param {ClaimPayload} payload
296
+ * @param {?WriteParams} [params]
297
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
298
+ */
299
+ async clawbackRaw(f, a) {
300
+ const { request: e, result: d } = await G(this._config, {
301
+ address: this.assertValidAddress(),
302
+ args: [w(f)],
303
+ ...this.optionallyAttachAccount(),
304
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
305
+ ...a
306
+ });
307
+ return { hash: await U(
308
+ this._config,
309
+ e
310
+ ), result: d };
311
+ }
312
+ /**
313
+ * Check if an incentive is claimable.
314
+ *
315
+ * @public
316
+ * @async
317
+ * @param {ClaimPayload} payload
318
+ * @param {?ReadParams} [params]
319
+ * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
320
+ */
321
+ async isClaimable(f, a) {
322
+ return await k(
323
+ this._config,
324
+ {
325
+ address: this.assertValidAddress(),
326
+ args: [f.target, f.data],
327
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
328
+ ...a
329
+ }
330
+ );
331
+ }
332
+ /**
333
+ * read the peg token for the incentive.
334
+ *
335
+ * @public
336
+ * @async
337
+ * @param {?ReadParams} [params]
338
+ * @returns {Promise<Address>} = The address of the token the reward is pegged to
339
+ */
340
+ async getPeg(f) {
341
+ return await q(this._config, {
342
+ address: this.assertValidAddress(),
343
+ args: [],
344
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
345
+ ...f
346
+ });
347
+ }
348
+ /**
349
+ * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`
350
+ *
351
+ * @public
352
+ * @async
353
+ * @param {?ReadParams} [params]
354
+ * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.
355
+ */
356
+ async getTotalBudget(f) {
357
+ return await this.limit(f);
358
+ }
359
+ /**
360
+ * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
361
+ *
362
+ * @public
363
+ * @async
364
+ * @param {?ReadParams} [params]
365
+ * @returns {Promise<boolean>} - True if total claims is less than limit
366
+ */
367
+ async canBeClaimed(f) {
368
+ return await this.getRemainingClaimPotential(f) > 0n;
369
+ }
370
+ /**
371
+ * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
372
+ *
373
+ * @public
374
+ * @async
375
+ * @param {?ReadParams} [params]
376
+ * @returns {Promise<bigint>} - True if total claims is less than limit
377
+ */
378
+ async getRemainingClaimPotential(f) {
379
+ const [a, e] = await Promise.all([
380
+ this.totalClaimed(f),
381
+ this.limit(f)
382
+ ]);
383
+ return e - a;
384
+ }
385
+ /**
386
+ *Functions from the ERC20VariableIncentive contract
387
+ */
388
+ /**
389
+ * Fetches the IncentiveCriteria struct from the contract
390
+ *
391
+ * @param {?ReadParams} [params]
392
+ * @returns {Promise<IncentiveCriteria>} Incentive criteria structure
393
+ * @throws {IncentiveCriteriaNotFoundError}
394
+ */
395
+ async getIncentiveCriteria(f) {
396
+ try {
397
+ return await z(
398
+ this._config,
399
+ {
400
+ ...f,
401
+ address: this.assertValidAddress()
402
+ }
403
+ );
404
+ } catch (a) {
405
+ throw new K(a);
406
+ }
407
+ }
408
+ /**
409
+ * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing
410
+ * the existing `limit` field by `netAmount`. The entire payload is then re-encoded
411
+ * via `prepareERC20PeggedIncentivePayload(...)`.
412
+ *
413
+ * @public
414
+ * @param {bigint} netAmount - The additional limit to add to this incentive.
415
+ * @returns {Hex} The ABI-encoded payload with the updated `limit`.
416
+ */
417
+ async getTopupPayload(f) {
418
+ var a, e, d, b, t;
419
+ return R({
420
+ asset: await this.asset() ?? n,
421
+ peg: ((a = this.payload) == null ? void 0 : a.peg) ?? n,
422
+ reward: ((e = this.payload) == null ? void 0 : e.reward) ?? 0n,
423
+ limit: f,
424
+ maxReward: ((d = this.payload) == null ? void 0 : d.maxReward) ?? 0n,
425
+ manager: ((b = this.payload) == null ? void 0 : b.manager) ?? n,
426
+ criteria: ((t = this.payload) == null ? void 0 : t.criteria) ?? {
427
+ criteriaType: 0,
428
+ signature: J,
429
+ fieldIndex: 0,
430
+ targetContract: n
431
+ }
432
+ });
433
+ }
434
+ /**
435
+ * @inheritdoc
436
+ *
437
+ * @public
438
+ * @param {?ERC20PeggedVariableCriteriaIncentivePayload} [_payload]
439
+ * @param {?DeployableOptions} [_options]
440
+ * @returns {GenericDeployableParams}
441
+ */
442
+ buildParameters(f, a) {
443
+ const [e, d] = this.validateDeploymentConfig(
444
+ f,
445
+ a
446
+ );
447
+ return {
448
+ abi: h,
449
+ bytecode: X,
450
+ args: [R(e)],
451
+ ...this.optionallyAttachAccount(d.account)
452
+ };
453
+ }
454
+ /**
455
+ * Encodes an amount to clawback from the incentive
456
+ *
457
+ * @public
458
+ * @param {bigint} amount - How much of the asset to clawback
459
+ * @returns {Hex} - Returns an encoded uint256
460
+ */
461
+ buildClawbackData(f) {
462
+ return g([{ type: "uint256" }], [f]);
463
+ }
464
+ /**
465
+ * Builds the claim data for the ERC20PeggedVariableCriteriaIncentivePayload.
466
+ *
467
+ * @public
468
+ * @param {bigint} signedAmount
469
+ * @returns {Hash} Returns the encoded claim data
470
+ * @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentivePayload.
471
+ */
472
+ buildClaimData(f) {
473
+ return g(
474
+ [{ type: "uint256", name: "signedAmount" }],
475
+ [f]
476
+ );
477
+ }
478
+ /**
479
+ * Decodes claim data for the ERC20PeggedVariableCriteriaIncentive, returning the claim amount.
480
+ * Useful when deriving amount claimed from logs.
481
+ *
482
+ * @public
483
+ * @param {Hex} claimData
484
+ * @returns {Promise<bigint>} Returns the reward amount from a claim data payload
485
+ */
486
+ async decodeClaimData(f) {
487
+ const a = o(
488
+ [
489
+ {
490
+ type: "tuple",
491
+ name: "BoostClaimData",
492
+ components: [
493
+ { type: "bytes", name: "validatorData" },
494
+ { type: "bytes", name: "incentiveData" }
495
+ ]
496
+ }
497
+ ],
498
+ f
499
+ ), e = o(
500
+ [{ type: "uint256" }],
501
+ a[0].incentiveData
502
+ )[0];
503
+ let d = e;
504
+ const [b, t] = await Promise.all([
505
+ this.reward(),
506
+ this.getMaxReward()
507
+ ]);
508
+ return b === 0n || (d = b * e / y("1"), t !== 0n && d > t && (d = t)), d;
509
+ }
510
+ /**
511
+ * Decodes claim data for the ERC20PeggedVariableCriteriaIncentive, returning the claim amount.
512
+ * Useful when deriving amount claimed from logs.
513
+ * Use this function instead of `decodeClaimData` if you have reward details.
514
+ *
515
+ * @public
516
+ * @param {Hex} claimData
517
+ * @param {bigint} [reward]
518
+ * @param {bigint} [maxReward]
519
+ * @returns {BigInt} Returns the reward amount from a claim data payload
520
+ */
521
+ decodeClaimDataWithRewardDetails(f, a, e) {
522
+ const d = o(
523
+ [
524
+ {
525
+ type: "tuple",
526
+ name: "BoostClaimData",
527
+ components: [
528
+ { type: "bytes", name: "validatorData" },
529
+ { type: "bytes", name: "incentiveData" }
530
+ ]
531
+ }
532
+ ],
533
+ f
534
+ ), b = o(
535
+ [{ type: "uint256" }],
536
+ d[0].incentiveData
537
+ )[0];
538
+ let t = b;
539
+ return a === 0n || (t = a * b / y("1"), e !== 0n && t > e && (t = e)), t;
540
+ }
541
+ };
542
+ u.bases = {
543
+ 31337: void 0,
544
+ ...W
545
+ }, u.registryType = O.INCENTIVE;
546
+ let A = u;
547
+ function R({
548
+ asset: v,
549
+ peg: f,
550
+ reward: a,
551
+ limit: e,
552
+ maxReward: d = 0n,
553
+ manager: b = n,
554
+ criteria: t
555
+ }) {
556
+ return g(
557
+ [
558
+ {
559
+ type: "tuple",
560
+ name: "initPayloadExtended",
561
+ components: [
562
+ { type: "address", name: "asset" },
563
+ { type: "address", name: "peg" },
564
+ { type: "uint256", name: "reward" },
565
+ { type: "uint256", name: "limit" },
566
+ { type: "address", name: "manager" },
567
+ { type: "uint256", name: "maxReward" },
568
+ {
569
+ type: "tuple",
570
+ name: "criteria",
571
+ components: [
572
+ { type: "uint8", name: "criteriaType" },
573
+ { type: "bytes32", name: "signature" },
574
+ { type: "uint8", name: "fieldIndex" },
575
+ { type: "address", name: "targetContract" }
576
+ ]
577
+ }
578
+ ]
579
+ }
580
+ ],
581
+ [
582
+ {
583
+ asset: v,
584
+ peg: f,
585
+ reward: a,
586
+ limit: e,
587
+ manager: b,
588
+ maxReward: d,
589
+ criteria: {
590
+ criteriaType: t.criteriaType,
591
+ signature: t.signature,
592
+ fieldIndex: t.fieldIndex,
593
+ targetContract: t.targetContract
594
+ }
595
+ }
596
+ ]
597
+ );
598
+ }
599
+ export {
600
+ A as ERC20PeggedVariableCriteriaIncentive,
601
+ h as erc20PeggedVariableCriteriaIncentiveAbi,
602
+ R as prepareERC20PeggedVariableCriteriaIncentivePayload
603
+ };
604
+ //# sourceMappingURL=ERC20PeggedVariableCriteriaIncentive.js.map