@boostxyz/sdk 0.0.0-alpha.9 → 1.1.0-alpha.23

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 (254) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.cjs.map +1 -1
  3. package/dist/Actions/Action.js +2 -2
  4. package/dist/Actions/ContractAction.d.ts +11 -11
  5. package/dist/Actions/ContractAction.d.ts.map +1 -1
  6. package/dist/Actions/ERC721MintAction.d.ts +14 -14
  7. package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
  8. package/dist/Actions/EventAction.cjs +1 -1
  9. package/dist/Actions/EventAction.cjs.map +1 -1
  10. package/dist/Actions/EventAction.d.ts +174 -41
  11. package/dist/Actions/EventAction.d.ts.map +1 -1
  12. package/dist/Actions/EventAction.js +557 -129
  13. package/dist/Actions/EventAction.js.map +1 -1
  14. package/dist/AllowLists/AllowList.cjs +1 -1
  15. package/dist/AllowLists/AllowList.cjs.map +1 -1
  16. package/dist/AllowLists/AllowList.d.ts +6 -4
  17. package/dist/AllowLists/AllowList.d.ts.map +1 -1
  18. package/dist/AllowLists/AllowList.js +45 -23
  19. package/dist/AllowLists/AllowList.js.map +1 -1
  20. package/dist/AllowLists/OpenAllowList.d.ts +423 -0
  21. package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
  22. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  23. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
  24. package/dist/AllowLists/SimpleAllowList.d.ts +92 -37
  25. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
  26. package/dist/AllowLists/SimpleAllowList.js +60 -75
  27. package/dist/AllowLists/SimpleAllowList.js.map +1 -1
  28. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  29. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -1
  30. package/dist/AllowLists/SimpleDenyList.d.ts +203 -11
  31. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  32. package/dist/AllowLists/SimpleDenyList.js +11 -112
  33. package/dist/AllowLists/SimpleDenyList.js.map +1 -1
  34. package/dist/Auth/PassthroughAuth.cjs +1 -1
  35. package/dist/Auth/PassthroughAuth.js +1 -1
  36. package/dist/Boost.cjs +1 -1
  37. package/dist/Boost.cjs.map +1 -1
  38. package/dist/Boost.d.ts +20 -21
  39. package/dist/Boost.d.ts.map +1 -1
  40. package/dist/Boost.js +43 -57
  41. package/dist/Boost.js.map +1 -1
  42. package/dist/BoostCore-Btl5BdAs.cjs +3 -0
  43. package/dist/BoostCore-Btl5BdAs.cjs.map +1 -0
  44. package/dist/BoostCore-CD56zbYX.js +2641 -0
  45. package/dist/BoostCore-CD56zbYX.js.map +1 -0
  46. package/dist/BoostCore.cjs +1 -2
  47. package/dist/BoostCore.cjs.map +1 -1
  48. package/dist/BoostCore.d.ts +749 -78
  49. package/dist/BoostCore.d.ts.map +1 -1
  50. package/dist/BoostCore.js +29 -1150
  51. package/dist/BoostCore.js.map +1 -1
  52. package/dist/BoostRegistry.cjs +1 -1
  53. package/dist/BoostRegistry.cjs.map +1 -1
  54. package/dist/BoostRegistry.d.ts +80 -25
  55. package/dist/BoostRegistry.d.ts.map +1 -1
  56. package/dist/BoostRegistry.js +164 -82
  57. package/dist/BoostRegistry.js.map +1 -1
  58. package/dist/Budgets/Budget.cjs +1 -1
  59. package/dist/Budgets/Budget.cjs.map +1 -1
  60. package/dist/Budgets/Budget.d.ts.map +1 -1
  61. package/dist/Budgets/Budget.js +2 -2
  62. package/dist/Budgets/Budget.js.map +1 -1
  63. package/dist/Budgets/ManagedBudget.cjs +1 -1
  64. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  65. package/dist/Budgets/ManagedBudget.d.ts +103 -221
  66. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  67. package/dist/Budgets/ManagedBudget.js +81 -298
  68. package/dist/Budgets/ManagedBudget.js.map +1 -1
  69. package/dist/Budgets/VestingBudget.d.ts +223 -89
  70. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  71. package/dist/Deployable/Contract.cjs +1 -1
  72. package/dist/Deployable/Contract.cjs.map +1 -1
  73. package/dist/Deployable/Contract.d.ts +4 -5
  74. package/dist/Deployable/Contract.d.ts.map +1 -1
  75. package/dist/Deployable/Contract.js +5 -7
  76. package/dist/Deployable/Contract.js.map +1 -1
  77. package/dist/Deployable/Deployable.cjs.map +1 -1
  78. package/dist/Deployable/Deployable.d.ts +1 -1
  79. package/dist/Deployable/Deployable.d.ts.map +1 -1
  80. package/dist/Deployable/Deployable.js +3 -5
  81. package/dist/Deployable/Deployable.js.map +1 -1
  82. package/dist/Deployable/DeployableTarget.cjs +1 -1
  83. package/dist/Deployable/DeployableTarget.cjs.map +1 -1
  84. package/dist/Deployable/DeployableTarget.d.ts +13 -13
  85. package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
  86. package/dist/Deployable/DeployableTarget.js +28 -25
  87. package/dist/Deployable/DeployableTarget.js.map +1 -1
  88. package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
  89. package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
  90. package/dist/Deployable/DeployableTargetWithRBAC.d.ts +248 -0
  91. package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
  92. package/dist/Deployable/DeployableTargetWithRBAC.js +320 -0
  93. package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
  94. package/dist/Incentive-CcnOIc8L.cjs +2 -0
  95. package/dist/Incentive-CcnOIc8L.cjs.map +1 -0
  96. package/dist/Incentive-rM5nKznp.js +313 -0
  97. package/dist/Incentive-rM5nKznp.js.map +1 -0
  98. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  99. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  100. package/dist/Incentives/AllowListIncentive.d.ts +38 -16
  101. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  102. package/dist/Incentives/AllowListIncentive.js +43 -29
  103. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  104. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  105. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  106. package/dist/Incentives/CGDAIncentive.d.ts +234 -21
  107. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  108. package/dist/Incentives/CGDAIncentive.js +46 -32
  109. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  110. package/dist/Incentives/ERC1155Incentive.d.ts +224 -37
  111. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  112. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  113. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  114. package/dist/Incentives/ERC20Incentive.d.ts +234 -30
  115. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  116. package/dist/Incentives/ERC20Incentive.js +62 -46
  117. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  118. package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +333 -438
  119. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
  120. package/dist/Incentives/ERC20VariableIncentive.d.ts +231 -29
  121. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  122. package/dist/Incentives/Incentive.cjs +1 -1
  123. package/dist/Incentives/Incentive.cjs.map +1 -1
  124. package/dist/Incentives/Incentive.d.ts +4 -4
  125. package/dist/Incentives/Incentive.d.ts.map +1 -1
  126. package/dist/Incentives/Incentive.js +16 -296
  127. package/dist/Incentives/Incentive.js.map +1 -1
  128. package/dist/Incentives/PointsIncentive.cjs +1 -1
  129. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  130. package/dist/Incentives/PointsIncentive.d.ts +40 -18
  131. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  132. package/dist/Incentives/PointsIncentive.js +38 -24
  133. package/dist/Incentives/PointsIncentive.js.map +1 -1
  134. package/dist/SimpleDenyList-BDXpY74P.js +133 -0
  135. package/dist/SimpleDenyList-BDXpY74P.js.map +1 -0
  136. package/dist/SimpleDenyList-DNj5qDWM.cjs +2 -0
  137. package/dist/SimpleDenyList-DNj5qDWM.cjs.map +1 -0
  138. package/dist/Validators/SignerValidator.cjs +1 -1
  139. package/dist/Validators/SignerValidator.cjs.map +1 -1
  140. package/dist/Validators/SignerValidator.d.ts +16 -16
  141. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  142. package/dist/Validators/SignerValidator.js +32 -28
  143. package/dist/Validators/SignerValidator.js.map +1 -1
  144. package/dist/Validators/Validator.cjs +1 -1
  145. package/dist/Validators/Validator.cjs.map +1 -1
  146. package/dist/Validators/Validator.d.ts +1 -1
  147. package/dist/Validators/Validator.js +2 -2
  148. package/dist/Validators/Validator.js.map +1 -1
  149. package/dist/claiming.cjs.map +1 -1
  150. package/dist/claiming.d.ts +1 -1
  151. package/dist/claiming.js.map +1 -1
  152. package/dist/componentInterfaces-BBCFkrZv.js +14 -0
  153. package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
  154. package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
  155. package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
  156. package/dist/deployments-DF_6-7hH.cjs +2 -0
  157. package/dist/deployments-DF_6-7hH.cjs.map +1 -0
  158. package/dist/deployments-fJsWblwS.js +56 -0
  159. package/dist/deployments-fJsWblwS.js.map +1 -0
  160. package/dist/deployments.json +58 -0
  161. package/dist/errors.cjs +1 -1
  162. package/dist/errors.cjs.map +1 -1
  163. package/dist/errors.d.ts +256 -20
  164. package/dist/errors.d.ts.map +1 -1
  165. package/dist/errors.js +183 -26
  166. package/dist/errors.js.map +1 -1
  167. package/dist/{generated-57_Kffpz.js → generated-CsNyWPKA.js} +3843 -2084
  168. package/dist/generated-CsNyWPKA.js.map +1 -0
  169. package/dist/generated-DHerxf1y.cjs +3 -0
  170. package/dist/generated-DHerxf1y.cjs.map +1 -0
  171. package/dist/index.cjs +1 -1
  172. package/dist/index.d.ts +5 -0
  173. package/dist/index.d.ts.map +1 -1
  174. package/dist/index.js +142 -108
  175. package/dist/index.js.map +1 -1
  176. package/dist/transfers.cjs.map +1 -1
  177. package/dist/transfers.d.ts +1 -1
  178. package/dist/transfers.js.map +1 -1
  179. package/dist/utils.cjs +1 -1
  180. package/dist/utils.cjs.map +1 -1
  181. package/dist/utils.d.ts +26 -12
  182. package/dist/utils.d.ts.map +1 -1
  183. package/dist/utils.js +38 -23
  184. package/dist/utils.js.map +1 -1
  185. package/package.json +20 -10
  186. package/src/Actions/Action.test.ts +14 -13
  187. package/src/Actions/ContractAction.test.ts +10 -10
  188. package/src/Actions/ContractAction.ts +11 -12
  189. package/src/Actions/ERC721MintAction.test.ts +6 -6
  190. package/src/Actions/ERC721MintAction.ts +14 -15
  191. package/src/Actions/EventAction.test.ts +735 -109
  192. package/src/Actions/EventAction.ts +527 -88
  193. package/src/AllowLists/AllowList.test.ts +7 -7
  194. package/src/AllowLists/AllowList.ts +5 -3
  195. package/src/AllowLists/OpenAllowList.test.ts +40 -0
  196. package/src/AllowLists/OpenAllowList.ts +45 -0
  197. package/src/AllowLists/SimpleAllowList.test.ts +4 -4
  198. package/src/AllowLists/SimpleAllowList.ts +40 -61
  199. package/src/AllowLists/SimpleDenyList.test.ts +4 -4
  200. package/src/AllowLists/SimpleDenyList.ts +41 -17
  201. package/src/Auth/PassthroughAuth.test.ts +1 -1
  202. package/src/Boost.ts +21 -24
  203. package/src/BoostCore.test.ts +361 -306
  204. package/src/BoostCore.ts +403 -220
  205. package/src/BoostRegistry.test.ts +53 -0
  206. package/src/BoostRegistry.ts +161 -40
  207. package/src/Budgets/Budget.test.ts +2 -2
  208. package/src/Budgets/Budget.ts +1 -2
  209. package/src/Budgets/ManagedBudget.test.ts +106 -19
  210. package/src/Budgets/ManagedBudget.ts +49 -321
  211. package/src/Budgets/VestingBudget.test.ts +7 -7
  212. package/src/Budgets/VestingBudget.ts +36 -106
  213. package/src/Deployable/Contract.ts +4 -5
  214. package/src/Deployable/Deployable.ts +1 -1
  215. package/src/Deployable/DeployableTarget.ts +30 -19
  216. package/src/Deployable/DeployableTargetWithRBAC.test.ts +103 -0
  217. package/src/Deployable/DeployableTargetWithRBAC.ts +447 -0
  218. package/src/Incentives/AllowListIncentive.test.ts +12 -12
  219. package/src/Incentives/AllowListIncentive.ts +30 -15
  220. package/src/Incentives/CGDAIncentive.test.ts +9 -6
  221. package/src/Incentives/CGDAIncentive.ts +39 -18
  222. package/src/Incentives/ERC1155Incentive.test.ts +3 -3
  223. package/src/Incentives/ERC1155Incentive.ts +30 -29
  224. package/src/Incentives/ERC20Incentive.test.ts +9 -6
  225. package/src/Incentives/ERC20Incentive.ts +54 -27
  226. package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
  227. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +325 -0
  228. package/src/Incentives/ERC20VariableIncentive.test.ts +8 -11
  229. package/src/Incentives/ERC20VariableIncentive.ts +50 -26
  230. package/src/Incentives/Incentive.test.ts +4 -1
  231. package/src/Incentives/Incentive.ts +7 -6
  232. package/src/Incentives/PointsIncentive.test.ts +24 -25
  233. package/src/Incentives/PointsIncentive.ts +32 -17
  234. package/src/Validators/SignerValidator.test.ts +6 -6
  235. package/src/Validators/SignerValidator.ts +20 -17
  236. package/src/Validators/Validator.test.ts +2 -2
  237. package/src/Validators/Validator.ts +1 -1
  238. package/src/claiming.ts +1 -1
  239. package/src/errors.ts +345 -21
  240. package/src/index.test.ts +118 -36
  241. package/src/index.ts +5 -0
  242. package/src/transfers.ts +1 -1
  243. package/src/utils.test.ts +2 -2
  244. package/src/utils.ts +61 -12
  245. package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
  246. package/dist/componentInterfaces-CKCBwG16.cjs +0 -2
  247. package/dist/componentInterfaces-CKCBwG16.cjs.map +0 -1
  248. package/dist/componentInterfaces-DYkaxBda.js +0 -13
  249. package/dist/componentInterfaces-DYkaxBda.js.map +0 -1
  250. package/dist/generated-57_Kffpz.js.map +0 -1
  251. package/dist/generated-wKBNvm48.cjs +0 -3
  252. package/dist/generated-wKBNvm48.cjs.map +0 -1
  253. package/src/Budgets/SimpleBudget.test.ts +0 -152
  254. package/src/Budgets/SimpleBudget.ts +0 -564
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./BoostRegistry.cjs"),a=require("./BoostCore.cjs"),p=require("./Boost.cjs"),c=require("./Actions/Action.cjs"),o=require("./Actions/EventAction.cjs"),y=require("./AllowLists/AllowList.cjs"),l=require("./AllowLists/SimpleAllowList.cjs"),u=require("./AllowLists/SimpleDenyList.cjs"),A=require("./Budgets/Budget.cjs"),t=require("./Budgets/ManagedBudget.cjs"),m=require("./Deployable/Deployable.cjs"),P=require("./Deployable/Contract.cjs"),S=require("./Deployable/DeployableTarget.cjs"),E=require("./Incentives/AllowListIncentive.cjs"),g=require("./Incentives/CGDAIncentive.cjs"),v=require("./Incentives/ERC20Incentive.cjs"),s=require("./Incentives/Incentive.cjs"),C=require("./Incentives/PointsIncentive.cjs"),n=require("./Validators/SignerValidator.cjs"),I=require("./Validators/Validator.cjs"),e=require("./errors.cjs"),i=require("./utils.cjs"),B=require("./Auth/PassthroughAuth.cjs"),r=require("./generated-wKBNvm48.cjs");exports.BOOST_REGISTRY_ADDRESS=d.BOOST_REGISTRY_ADDRESS;exports.BoostRegistry=d.BoostRegistry;exports.BOOST_CORE_ADDRESS=a.BOOST_CORE_ADDRESS;exports.BOOST_CORE_CLAIM_FEE=a.BOOST_CORE_CLAIM_FEE;exports.BoostCore=a.BoostCore;exports.Boost=p.Boost;exports.prepareBoostPayload=p.prepareBoostPayload;exports.ActionByComponentInterface=c.ActionByComponentInterface;exports.actionFromAddress=c.actionFromAddress;exports.EventAction=o.EventAction;exports.FilterType=o.FilterType;exports.PrimitiveType=o.PrimitiveType;exports.SignatureType=o.SignatureType;exports.isEventActionPayloadSimple=o.isEventActionPayloadSimple;exports.prepareEventActionPayload=o.prepareEventActionPayload;exports.AllowListByComponentInterface=y.AllowListByComponentInterface;exports.allowListFromAddress=y.allowListFromAddress;exports.LIST_MANAGER_ROLE=l.LIST_MANAGER_ROLE;exports.SimpleAllowList=l.SimpleAllowList;exports.prepareSimpleAllowListPayload=l.prepareSimpleAllowListPayload;exports.SimpleDenyList=u.SimpleDenyList;exports.prepareSimpleDenyListPayload=u.prepareSimpleDenyListPayload;exports.BudgetByComponentInterface=A.BudgetByComponentInterface;exports.budgetFromAddress=A.budgetFromAddress;exports.ManagedBudget=t.ManagedBudget;exports.ManagedBudgetRoles=t.ManagedBudgetRoles;exports.isERC1155TransferPayload=t.isERC1155TransferPayload;exports.isFungibleTransfer=t.isFungibleTransfer;exports.prepareManagedBudgetPayload=t.prepareManagedBudgetPayload;exports.prepareTransfer=t.prepareTransfer;exports.Deployable=m.Deployable;exports.Contract=P.Contract;exports.DeployableTarget=S.DeployableTarget;exports.AllowListIncentive=E.AllowListIncentive;exports.prepareAllowListIncentivePayload=E.prepareAllowListIncentivePayload;exports.CGDAIncentive=g.CGDAIncentive;exports.prepareCGDAIncentivePayload=g.prepareCGDAIncentivePayload;exports.ERC20Incentive=v.ERC20Incentive;exports.prepareERC20IncentivePayload=v.prepareERC20IncentivePayload;exports.ERC20VariableIncentive=s.ERC20VariableIncentive;exports.IncentiveByComponentInterface=s.IncentiveByComponentInterface;exports.incentiveFromAddress=s.incentiveFromAddress;exports.PointsIncentive=C.PointsIncentive;exports.preparePointsIncentivePayload=C.preparePointsIncentivePayload;exports.SignerValidator=n.SignerValidator;exports.prepareSignerValidatorClaimDataPayload=n.prepareSignerValidatorClaimDataPayload;exports.prepareSignerValidatorInputParams=n.prepareSignerValidatorInputParams;exports.prepareSignerValidatorPayload=n.prepareSignerValidatorPayload;exports.ValidatorByComponentInterface=I.ValidatorByComponentInterface;exports.validatorFromAddress=I.validatorFromAddress;exports.BoostCoreNoIdentifierEmitted=e.BoostCoreNoIdentifierEmitted;exports.BudgetMustAuthorizeBoostCore=e.BudgetMustAuthorizeBoostCore;exports.ContractAddressRequiredError=e.ContractAddressRequiredError;exports.DeployableAlreadyDeployedError=e.DeployableAlreadyDeployedError;exports.DeployableBuildParametersUnspecifiedError=e.DeployableBuildParametersUnspecifiedError;exports.DeployableMissingPayloadError=e.DeployableMissingPayloadError;exports.DeployableUnknownOwnerProvidedError=e.DeployableUnknownOwnerProvidedError;exports.DeployableWagmiConfigurationRequiredError=e.DeployableWagmiConfigurationRequiredError;exports.EventActionValidationError=e.EventActionValidationError;exports.FieldValueNotComparableError=e.FieldValueNotComparableError;exports.FieldValueUndefinedError=e.FieldValueUndefinedError;exports.IncentiveNotCloneableError=e.IncentiveNotCloneableError;exports.InvalidComponentInterfaceError=e.InvalidComponentInterfaceError;exports.InvalidNumericalCriteriaError=e.InvalidNumericalCriteriaError;exports.MustInitializeBudgetError=e.MustInitializeBudgetError;exports.NoContractAddressUponReceiptError=e.NoContractAddressUponReceiptError;exports.NoEventActionStepsProvidedError=e.NoEventActionStepsProvidedError;exports.TooManyEventActionStepsProvidedError=e.TooManyEventActionStepsProvidedError;exports.UnknownTransferPayloadSupplied=e.UnknownTransferPayloadSupplied;exports.UnrecognizedFilterTypeError=e.UnrecognizedFilterTypeError;exports.RegistryType=i.RegistryType;exports.awaitResult=i.awaitResult;exports.bytes4=i.bytes4;exports.getDeployedContractAddress=i.getDeployedContractAddress;exports.PassthroughAuth=B.PassthroughAuth;exports.allowListIncentiveAbi=r.A;exports.boostCoreAbi=r.c;exports.boostRegistryAbi=r.ee;exports.cgdaIncentiveAbi=r.v;exports.erc20IncentiveAbi=r.f;exports.managedBudgetAbi=r.p;exports.passthroughAuthAbi=r.ze;exports.pointsIncentiveAbi=r.l;exports.signerValidatorAbi=r.M;exports.simpleAllowListAbi=r.T;exports.simpleDenyListAbi=r.S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./BoostRegistry.cjs"),a=require("./BoostCore-Btl5BdAs.cjs"),y=require("./Boost.cjs"),E=require("./Actions/Action.cjs"),o=require("./Actions/EventAction.cjs"),p=require("./AllowLists/AllowList.cjs"),c=require("./AllowLists/SimpleAllowList.cjs"),A=require("./SimpleDenyList-DNj5qDWM.cjs"),u=require("./Budgets/Budget.cjs"),t=require("./Budgets/ManagedBudget.cjs"),R=require("./Deployable/Deployable.cjs"),m=require("./Deployable/Contract.cjs"),B=require("./Deployable/DeployableTarget.cjs"),C=require("./Deployable/DeployableTargetWithRBAC.cjs"),g=require("./Incentives/AllowListIncentive.cjs"),I=require("./Incentives/CGDAIncentive.cjs"),v=require("./Incentives/ERC20Incentive.cjs"),l=require("./Incentive-CcnOIc8L.cjs"),P=require("./Incentives/PointsIncentive.cjs"),d=require("./Validators/SignerValidator.cjs"),S=require("./Validators/Validator.cjs"),e=require("./errors.cjs"),n=require("./utils.cjs"),b=require("./claiming.cjs"),i=require("./transfers.cjs"),D=require("./Auth/PassthroughAuth.cjs"),r=require("./generated-DHerxf1y.cjs");exports.BOOST_REGISTRY_ADDRESS=s.BOOST_REGISTRY_ADDRESS;exports.BOOST_REGISTRY_ADDRESSES=s.BOOST_REGISTRY_ADDRESSES;exports.BoostRegistry=s.BoostRegistry;exports.BOOST_CORE_ADDRESS=a.BOOST_CORE_ADDRESS;exports.BOOST_CORE_ADDRESSES=a.BOOST_CORE_ADDRESSES;exports.BOOST_CORE_CLAIM_FEE=a.BOOST_CORE_CLAIM_FEE;exports.BoostCore=a.BoostCore;exports.ERC20VariableCriteriaIncentive=a.ERC20VariableCriteriaIncentive;exports.prepareERC20VariableCriteriaIncentivePayload=a.prepareERC20VariableCriteriaIncentivePayload;exports.Boost=y.Boost;exports.prepareBoostPayload=y.prepareBoostPayload;exports.ActionByComponentInterface=E.ActionByComponentInterface;exports.actionFromAddress=E.actionFromAddress;exports.EventAction=o.EventAction;exports.FilterType=o.FilterType;exports.PrimitiveType=o.PrimitiveType;exports.SignatureType=o.SignatureType;exports.anyActionParameter=o.anyActionParameter;exports.isEventActionPayloadSimple=o.isEventActionPayloadSimple;exports.prepareEventActionPayload=o.prepareEventActionPayload;exports.AllowListByComponentInterface=p.AllowListByComponentInterface;exports.OpenAllowList=p.OpenAllowList;exports.allowListFromAddress=p.allowListFromAddress;exports.LIST_MANAGER_ROLE=c.LIST_MANAGER_ROLE;exports.SimpleAllowList=c.SimpleAllowList;exports.prepareSimpleAllowListPayload=c.prepareSimpleAllowListPayload;exports.SimpleDenyList=A.SimpleDenyList;exports.prepareSimpleDenyListPayload=A.prepareSimpleDenyListPayload;exports.BudgetByComponentInterface=u.BudgetByComponentInterface;exports.budgetFromAddress=u.budgetFromAddress;exports.ManagedBudget=t.ManagedBudget;exports.ManagedBudgetRoles=t.ManagedBudgetRoles;exports.isERC1155TransferPayload=t.isERC1155TransferPayload;exports.isFungibleTransfer=t.isFungibleTransfer;exports.prepareManagedBudgetPayload=t.prepareManagedBudgetPayload;exports.prepareTransfer=t.prepareTransfer;exports.Deployable=R.Deployable;exports.Contract=m.Contract;exports.DeployableTarget=B.DeployableTarget;exports.DeployableTargetWithRBAC=C.DeployableTargetWithRBAC;exports.Roles=C.Roles;exports.AllowListIncentive=g.AllowListIncentive;exports.prepareAllowListIncentivePayload=g.prepareAllowListIncentivePayload;exports.CGDAIncentive=I.CGDAIncentive;exports.prepareCGDAIncentivePayload=I.prepareCGDAIncentivePayload;exports.ERC20Incentive=v.ERC20Incentive;exports.prepareERC20IncentivePayload=v.prepareERC20IncentivePayload;exports.ERC20VariableIncentive=l.ERC20VariableIncentive;exports.IncentiveByComponentInterface=l.IncentiveByComponentInterface;exports.incentiveFromAddress=l.incentiveFromAddress;exports.prepareERC20VariableIncentivePayload=l.prepareERC20VariableIncentivePayload;exports.PointsIncentive=P.PointsIncentive;exports.preparePointsIncentivePayload=P.preparePointsIncentivePayload;exports.SignerValidator=d.SignerValidator;exports.prepareSignerValidatorClaimDataPayload=d.prepareSignerValidatorClaimDataPayload;exports.prepareSignerValidatorInputParams=d.prepareSignerValidatorInputParams;exports.prepareSignerValidatorPayload=d.prepareSignerValidatorPayload;exports.ValidatorByComponentInterface=S.ValidatorByComponentInterface;exports.validatorFromAddress=S.validatorFromAddress;exports.BoostCoreNoIdentifierEmitted=e.BoostCoreNoIdentifierEmitted;exports.BoostNotFoundError=e.BoostNotFoundError;exports.BudgetMustAuthorizeBoostCore=e.BudgetMustAuthorizeBoostCore;exports.ContractAddressRequiredError=e.ContractAddressRequiredError;exports.DecodedArgsError=e.DecodedArgsError;exports.DecodedArgsMalformedError=e.DecodedArgsMalformedError;exports.DeployableAlreadyDeployedError=e.DeployableAlreadyDeployedError;exports.DeployableBuildParametersUnspecifiedError=e.DeployableBuildParametersUnspecifiedError;exports.DeployableMissingPayloadError=e.DeployableMissingPayloadError;exports.DeployableUnknownOwnerProvidedError=e.DeployableUnknownOwnerProvidedError;exports.DeployableWagmiConfigurationRequiredError=e.DeployableWagmiConfigurationRequiredError;exports.FieldActionValidationError=e.FieldActionValidationError;exports.FieldValueNotComparableError=e.FieldValueNotComparableError;exports.FieldValueUndefinedError=e.FieldValueUndefinedError;exports.FunctionDataDecodeError=e.FunctionDataDecodeError;exports.IncentiveCriteriaNotFoundError=e.IncentiveCriteriaNotFoundError;exports.IncentiveNotCloneableError=e.IncentiveNotCloneableError;exports.InvalidComponentInterfaceError=e.InvalidComponentInterfaceError;exports.InvalidCriteriaTypeError=e.InvalidCriteriaTypeError;exports.InvalidNumericalCriteriaError=e.InvalidNumericalCriteriaError;exports.InvalidProtocolChainIdError=e.InvalidProtocolChainIdError;exports.MustInitializeBudgetError=e.MustInitializeBudgetError;exports.NoConnectedChainIdError=e.NoConnectedChainIdError;exports.NoContractAddressUponReceiptError=e.NoContractAddressUponReceiptError;exports.NoEventActionStepsProvidedError=e.NoEventActionStepsProvidedError;exports.NoMatchingLogsError=e.NoMatchingLogsError;exports.TooManyEventActionStepsProvidedError=e.TooManyEventActionStepsProvidedError;exports.UnknownTransferPayloadSupplied=e.UnknownTransferPayloadSupplied;exports.UnparseableAbiParamError=e.UnparseableAbiParamError;exports.UnrecognizedFilterTypeError=e.UnrecognizedFilterTypeError;exports.ValidationAbiMissingError=e.ValidationAbiMissingError;exports.RegistryType=n.RegistryType;exports.assertValidAddressByChainId=n.assertValidAddressByChainId;exports.awaitResult=n.awaitResult;exports.bytes4=n.bytes4;exports.getDeployedContractAddress=n.getDeployedContractAddress;exports.StrategyType=b.StrategyType;exports.prepareClaimPayload=b.prepareClaimPayload;exports.AssetType=i.AssetType;exports.prepareERC1155Payload=i.prepareERC1155Payload;exports.prepareERC1155Transfer=i.prepareERC1155Transfer;exports.prepareFungiblePayload=i.prepareFungiblePayload;exports.prepareFungibleTransfer=i.prepareFungibleTransfer;exports.prepareTransferPayload=i.prepareTransferPayload;exports.PassthroughAuth=D.PassthroughAuth;exports.allowListIncentiveAbi=r.O;exports.boostCoreAbi=r.T;exports.boostRegistryAbi=r.ie;exports.cgdaIncentiveAbi=r.b;exports.erc20IncentiveAbi=r.y;exports.erc20VariableIncentiveAbi=r.f;exports.managedBudgetAbi=r.d;exports.passthroughAuthAbi=r.Be;exports.pointsIncentiveAbi=r.w;exports.rbacAbi=r.R;exports.signerValidatorAbi=r.B;exports.simpleAllowListAbi=r.h;exports.simpleDenyListAbi=r.g;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.ts CHANGED
@@ -11,15 +11,20 @@ export * from './Budgets/ManagedBudget';
11
11
  export * from './Deployable/Deployable';
12
12
  export * from './Deployable/Contract';
13
13
  export * from './Deployable/DeployableTarget';
14
+ export * from './Deployable/DeployableTargetWithRBAC';
14
15
  export * from './Incentives/AllowListIncentive';
15
16
  export * from './Incentives/CGDAIncentive';
16
17
  export * from './Incentives/ERC20Incentive';
18
+ export * from './Incentives/ERC20VariableIncentive';
19
+ export * from './Incentives/ERC20VariableCriteriaIncentive';
17
20
  export * from './Incentives/Incentive';
18
21
  export * from './Incentives/PointsIncentive';
19
22
  export * from './Validators/SignerValidator';
20
23
  export * from './Validators/Validator';
21
24
  export * from './errors';
22
25
  export * from './utils';
26
+ export * from './claiming';
27
+ export * from './transfers';
23
28
  export * from './Auth/Auth';
24
29
  export * from './Auth/PassthroughAuth';
25
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAIxB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,uBAAuB,CAAC;AAItC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAI5C,cAAc,kBAAkB,CAAC;AAGjC,cAAc,yBAAyB,CAAC;AAIxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAI9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAI7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AAIvC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAIxB,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAIxB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,uBAAuB,CAAC;AAItC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAI5C,cAAc,kBAAkB,CAAC;AAGjC,cAAc,yBAAyB,CAAC;AAIxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AAItD,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6CAA6C,CAAC;AAE5D,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAI7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AAIvC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAI5B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -1,113 +1,147 @@
1
- import { BOOST_REGISTRY_ADDRESS as o, BoostRegistry as t } from "./BoostRegistry.js";
2
- import { BOOST_CORE_ADDRESS as i, BOOST_CORE_CLAIM_FEE as n, BoostCore as p } from "./BoostCore.js";
3
- import { Boost as s, prepareBoostPayload as d } from "./Boost.js";
4
- import { ActionByComponentInterface as A, actionFromAddress as y } from "./Actions/Action.js";
5
- import { EventAction as f, FilterType as E, PrimitiveType as g, SignatureType as v, isEventActionPayloadSimple as I, prepareEventActionPayload as C } from "./Actions/EventAction.js";
6
- import { AllowListByComponentInterface as b, allowListFromAddress as x } from "./AllowLists/AllowList.js";
7
- import { LIST_MANAGER_ROLE as S, SimpleAllowList as B, prepareSimpleAllowListPayload as R } from "./AllowLists/SimpleAllowList.js";
8
- import { SimpleDenyList as T, prepareSimpleDenyListPayload as L } from "./AllowLists/SimpleDenyList.js";
9
- import { BudgetByComponentInterface as F, budgetFromAddress as M } from "./Budgets/Budget.js";
10
- import { ManagedBudget as V, ManagedBudgetRoles as _, isERC1155TransferPayload as h, isFungibleTransfer as N, prepareManagedBudgetPayload as U, prepareTransfer as z } from "./Budgets/ManagedBudget.js";
11
- import { Deployable as k } from "./Deployable/Deployable.js";
12
- import { Contract as W } from "./Deployable/Contract.js";
13
- import { DeployableTarget as j } from "./Deployable/DeployableTarget.js";
14
- import { AllowListIncentive as J, prepareAllowListIncentivePayload as K } from "./Incentives/AllowListIncentive.js";
15
- import { CGDAIncentive as X, prepareCGDAIncentivePayload as Z } from "./Incentives/CGDAIncentive.js";
16
- import { ERC20Incentive as ee, prepareERC20IncentivePayload as re } from "./Incentives/ERC20Incentive.js";
17
- import { ERC20VariableIncentive as te, IncentiveByComponentInterface as ae, incentiveFromAddress as ie } from "./Incentives/Incentive.js";
18
- import { PointsIncentive as pe, preparePointsIncentivePayload as le } from "./Incentives/PointsIncentive.js";
19
- import { SignerValidator as de, prepareSignerValidatorClaimDataPayload as me, prepareSignerValidatorInputParams as Ae, prepareSignerValidatorPayload as ye } from "./Validators/SignerValidator.js";
20
- import { ValidatorByComponentInterface as fe, validatorFromAddress as Ee } from "./Validators/Validator.js";
21
- import { BoostCoreNoIdentifierEmitted as ve, BudgetMustAuthorizeBoostCore as Ie, ContractAddressRequiredError as Ce, DeployableAlreadyDeployedError as ue, DeployableBuildParametersUnspecifiedError as be, DeployableMissingPayloadError as xe, DeployableUnknownOwnerProvidedError as Pe, DeployableWagmiConfigurationRequiredError as Se, EventActionValidationError as Be, FieldValueNotComparableError as Re, FieldValueUndefinedError as De, IncentiveNotCloneableError as Te, InvalidComponentInterfaceError as Le, InvalidNumericalCriteriaError as we, MustInitializeBudgetError as Fe, NoContractAddressUponReceiptError as Me, NoEventActionStepsProvidedError as Oe, TooManyEventActionStepsProvidedError as Ve, UnknownTransferPayloadSupplied as _e, UnrecognizedFilterTypeError as he } from "./errors.js";
22
- import { RegistryType as Ue, awaitResult as ze, bytes4 as Ge, getDeployedContractAddress as ke } from "./utils.js";
23
- import { PassthroughAuth as We } from "./Auth/PassthroughAuth.js";
24
- import { A as je, c as He, e as Je, v as Ke, f as Qe, p as Xe, z as Ze, l as $e, M as er, T as rr, S as or } from "./generated-57_Kffpz.js";
1
+ import { BOOST_REGISTRY_ADDRESS as o, BOOST_REGISTRY_ADDRESSES as a, BoostRegistry as t } from "./BoostRegistry.js";
2
+ import { b as n, a as p, B as s, c as l, E as d, p as E } from "./BoostCore-CD56zbYX.js";
3
+ import { Boost as y, prepareBoostPayload as c } from "./Boost.js";
4
+ import { ActionByComponentInterface as f, actionFromAddress as C } from "./Actions/Action.js";
5
+ import { EventAction as g, FilterType as I, PrimitiveType as v, SignatureType as P, anyActionParameter as R, isEventActionPayloadSimple as S, prepareEventActionPayload as u } from "./Actions/EventAction.js";
6
+ import { AllowListByComponentInterface as D, OpenAllowList as x, allowListFromAddress as T } from "./AllowLists/AllowList.js";
7
+ import { LIST_MANAGER_ROLE as O, SimpleAllowList as L, prepareSimpleAllowListPayload as V } from "./AllowLists/SimpleAllowList.js";
8
+ import { S as h, p as _ } from "./SimpleDenyList-BDXpY74P.js";
9
+ import { BudgetByComponentInterface as N, budgetFromAddress as U } from "./Budgets/Budget.js";
10
+ import { ManagedBudget as z, ManagedBudgetRoles as k, isERC1155TransferPayload as q, isFungibleTransfer as W, prepareManagedBudgetPayload as Y, prepareTransfer as j } from "./Budgets/ManagedBudget.js";
11
+ import { Deployable as J } from "./Deployable/Deployable.js";
12
+ import { Contract as Q } from "./Deployable/Contract.js";
13
+ import { DeployableTarget as Z } from "./Deployable/DeployableTarget.js";
14
+ import { DeployableTargetWithRBAC as ee, Roles as re } from "./Deployable/DeployableTargetWithRBAC.js";
15
+ import { AllowListIncentive as ae, prepareAllowListIncentivePayload as te } from "./Incentives/AllowListIncentive.js";
16
+ import { CGDAIncentive as ne, prepareCGDAIncentivePayload as pe } from "./Incentives/CGDAIncentive.js";
17
+ import { ERC20Incentive as le, prepareERC20IncentivePayload as de } from "./Incentives/ERC20Incentive.js";
18
+ import { E as me, I as ye, i as ce, p as Ae } from "./Incentive-rM5nKznp.js";
19
+ import { PointsIncentive as Ce, preparePointsIncentivePayload as be } from "./Incentives/PointsIncentive.js";
20
+ import { SignerValidator as Ie, prepareSignerValidatorClaimDataPayload as ve, prepareSignerValidatorInputParams as Pe, prepareSignerValidatorPayload as Re } from "./Validators/SignerValidator.js";
21
+ import { ValidatorByComponentInterface as ue, validatorFromAddress as Be } from "./Validators/Validator.js";
22
+ import { BoostCoreNoIdentifierEmitted as xe, BoostNotFoundError as Te, BudgetMustAuthorizeBoostCore as Fe, ContractAddressRequiredError as Oe, DecodedArgsError as Le, DecodedArgsMalformedError as Ve, DeployableAlreadyDeployedError as we, DeployableBuildParametersUnspecifiedError as he, DeployableMissingPayloadError as _e, DeployableUnknownOwnerProvidedError as Me, DeployableWagmiConfigurationRequiredError as Ne, FieldActionValidationError as Ue, FieldValueNotComparableError as Ge, FieldValueUndefinedError as ze, FunctionDataDecodeError as ke, IncentiveCriteriaNotFoundError as qe, IncentiveNotCloneableError as We, InvalidComponentInterfaceError as Ye, InvalidCriteriaTypeError as je, InvalidNumericalCriteriaError as He, InvalidProtocolChainIdError as Je, MustInitializeBudgetError as Ke, NoConnectedChainIdError as Qe, NoContractAddressUponReceiptError as Xe, NoEventActionStepsProvidedError as Ze, NoMatchingLogsError as $e, TooManyEventActionStepsProvidedError as er, UnknownTransferPayloadSupplied as rr, UnparseableAbiParamError as or, UnrecognizedFilterTypeError as ar, ValidationAbiMissingError as tr } from "./errors.js";
23
+ import { RegistryType as nr, assertValidAddressByChainId as pr, awaitResult as sr, bytes4 as lr, getDeployedContractAddress as dr } from "./utils.js";
24
+ import { StrategyType as mr, prepareClaimPayload as yr } from "./claiming.js";
25
+ import { AssetType as Ar, prepareERC1155Payload as fr, prepareERC1155Transfer as Cr, prepareFungiblePayload as br, prepareFungibleTransfer as gr, prepareTransferPayload as Ir } from "./transfers.js";
26
+ import { PassthroughAuth as Pr } from "./Auth/PassthroughAuth.js";
27
+ import { O as Sr, T as ur, i as Br, b as Dr, y as xr, f as Tr, d as Fr, a as Or, w as Lr, R as Vr, B as wr, h as hr, g as _r } from "./generated-CsNyWPKA.js";
25
28
  export {
26
- A as ActionByComponentInterface,
27
- b as AllowListByComponentInterface,
28
- J as AllowListIncentive,
29
- i as BOOST_CORE_ADDRESS,
30
- n as BOOST_CORE_CLAIM_FEE,
29
+ f as ActionByComponentInterface,
30
+ D as AllowListByComponentInterface,
31
+ ae as AllowListIncentive,
32
+ Ar as AssetType,
33
+ n as BOOST_CORE_ADDRESS,
34
+ p as BOOST_CORE_ADDRESSES,
35
+ s as BOOST_CORE_CLAIM_FEE,
31
36
  o as BOOST_REGISTRY_ADDRESS,
32
- s as Boost,
33
- p as BoostCore,
34
- ve as BoostCoreNoIdentifierEmitted,
37
+ a as BOOST_REGISTRY_ADDRESSES,
38
+ y as Boost,
39
+ l as BoostCore,
40
+ xe as BoostCoreNoIdentifierEmitted,
41
+ Te as BoostNotFoundError,
35
42
  t as BoostRegistry,
36
- F as BudgetByComponentInterface,
37
- Ie as BudgetMustAuthorizeBoostCore,
38
- X as CGDAIncentive,
39
- W as Contract,
40
- Ce as ContractAddressRequiredError,
41
- k as Deployable,
42
- ue as DeployableAlreadyDeployedError,
43
- be as DeployableBuildParametersUnspecifiedError,
44
- xe as DeployableMissingPayloadError,
45
- j as DeployableTarget,
46
- Pe as DeployableUnknownOwnerProvidedError,
47
- Se as DeployableWagmiConfigurationRequiredError,
48
- ee as ERC20Incentive,
49
- te as ERC20VariableIncentive,
50
- f as EventAction,
51
- Be as EventActionValidationError,
52
- Re as FieldValueNotComparableError,
53
- De as FieldValueUndefinedError,
54
- E as FilterType,
55
- ae as IncentiveByComponentInterface,
56
- Te as IncentiveNotCloneableError,
57
- Le as InvalidComponentInterfaceError,
58
- we as InvalidNumericalCriteriaError,
59
- S as LIST_MANAGER_ROLE,
60
- V as ManagedBudget,
61
- _ as ManagedBudgetRoles,
62
- Fe as MustInitializeBudgetError,
63
- Me as NoContractAddressUponReceiptError,
64
- Oe as NoEventActionStepsProvidedError,
65
- We as PassthroughAuth,
66
- pe as PointsIncentive,
67
- g as PrimitiveType,
68
- Ue as RegistryType,
69
- v as SignatureType,
70
- de as SignerValidator,
71
- B as SimpleAllowList,
72
- T as SimpleDenyList,
73
- Ve as TooManyEventActionStepsProvidedError,
74
- _e as UnknownTransferPayloadSupplied,
75
- he as UnrecognizedFilterTypeError,
76
- fe as ValidatorByComponentInterface,
77
- y as actionFromAddress,
78
- x as allowListFromAddress,
79
- je as allowListIncentiveAbi,
80
- ze as awaitResult,
81
- He as boostCoreAbi,
82
- Je as boostRegistryAbi,
83
- M as budgetFromAddress,
84
- Ge as bytes4,
85
- Ke as cgdaIncentiveAbi,
86
- Qe as erc20IncentiveAbi,
87
- ke as getDeployedContractAddress,
88
- ie as incentiveFromAddress,
89
- h as isERC1155TransferPayload,
90
- I as isEventActionPayloadSimple,
91
- N as isFungibleTransfer,
92
- Xe as managedBudgetAbi,
93
- Ze as passthroughAuthAbi,
94
- $e as pointsIncentiveAbi,
95
- K as prepareAllowListIncentivePayload,
96
- d as prepareBoostPayload,
97
- Z as prepareCGDAIncentivePayload,
98
- re as prepareERC20IncentivePayload,
99
- C as prepareEventActionPayload,
100
- U as prepareManagedBudgetPayload,
101
- le as preparePointsIncentivePayload,
102
- me as prepareSignerValidatorClaimDataPayload,
103
- Ae as prepareSignerValidatorInputParams,
104
- ye as prepareSignerValidatorPayload,
105
- R as prepareSimpleAllowListPayload,
106
- L as prepareSimpleDenyListPayload,
107
- z as prepareTransfer,
108
- er as signerValidatorAbi,
109
- rr as simpleAllowListAbi,
110
- or as simpleDenyListAbi,
111
- Ee as validatorFromAddress
43
+ N as BudgetByComponentInterface,
44
+ Fe as BudgetMustAuthorizeBoostCore,
45
+ ne as CGDAIncentive,
46
+ Q as Contract,
47
+ Oe as ContractAddressRequiredError,
48
+ Le as DecodedArgsError,
49
+ Ve as DecodedArgsMalformedError,
50
+ J as Deployable,
51
+ we as DeployableAlreadyDeployedError,
52
+ he as DeployableBuildParametersUnspecifiedError,
53
+ _e as DeployableMissingPayloadError,
54
+ Z as DeployableTarget,
55
+ ee as DeployableTargetWithRBAC,
56
+ Me as DeployableUnknownOwnerProvidedError,
57
+ Ne as DeployableWagmiConfigurationRequiredError,
58
+ le as ERC20Incentive,
59
+ d as ERC20VariableCriteriaIncentive,
60
+ me as ERC20VariableIncentive,
61
+ g as EventAction,
62
+ Ue as FieldActionValidationError,
63
+ Ge as FieldValueNotComparableError,
64
+ ze as FieldValueUndefinedError,
65
+ I as FilterType,
66
+ ke as FunctionDataDecodeError,
67
+ ye as IncentiveByComponentInterface,
68
+ qe as IncentiveCriteriaNotFoundError,
69
+ We as IncentiveNotCloneableError,
70
+ Ye as InvalidComponentInterfaceError,
71
+ je as InvalidCriteriaTypeError,
72
+ He as InvalidNumericalCriteriaError,
73
+ Je as InvalidProtocolChainIdError,
74
+ O as LIST_MANAGER_ROLE,
75
+ z as ManagedBudget,
76
+ k as ManagedBudgetRoles,
77
+ Ke as MustInitializeBudgetError,
78
+ Qe as NoConnectedChainIdError,
79
+ Xe as NoContractAddressUponReceiptError,
80
+ Ze as NoEventActionStepsProvidedError,
81
+ $e as NoMatchingLogsError,
82
+ x as OpenAllowList,
83
+ Pr as PassthroughAuth,
84
+ Ce as PointsIncentive,
85
+ v as PrimitiveType,
86
+ nr as RegistryType,
87
+ re as Roles,
88
+ P as SignatureType,
89
+ Ie as SignerValidator,
90
+ L as SimpleAllowList,
91
+ h as SimpleDenyList,
92
+ mr as StrategyType,
93
+ er as TooManyEventActionStepsProvidedError,
94
+ rr as UnknownTransferPayloadSupplied,
95
+ or as UnparseableAbiParamError,
96
+ ar as UnrecognizedFilterTypeError,
97
+ tr as ValidationAbiMissingError,
98
+ ue as ValidatorByComponentInterface,
99
+ C as actionFromAddress,
100
+ T as allowListFromAddress,
101
+ Sr as allowListIncentiveAbi,
102
+ R as anyActionParameter,
103
+ pr as assertValidAddressByChainId,
104
+ sr as awaitResult,
105
+ ur as boostCoreAbi,
106
+ Br as boostRegistryAbi,
107
+ U as budgetFromAddress,
108
+ lr as bytes4,
109
+ Dr as cgdaIncentiveAbi,
110
+ xr as erc20IncentiveAbi,
111
+ Tr as erc20VariableIncentiveAbi,
112
+ dr as getDeployedContractAddress,
113
+ ce as incentiveFromAddress,
114
+ q as isERC1155TransferPayload,
115
+ S as isEventActionPayloadSimple,
116
+ W as isFungibleTransfer,
117
+ Fr as managedBudgetAbi,
118
+ Or as passthroughAuthAbi,
119
+ Lr as pointsIncentiveAbi,
120
+ te as prepareAllowListIncentivePayload,
121
+ c as prepareBoostPayload,
122
+ pe as prepareCGDAIncentivePayload,
123
+ yr as prepareClaimPayload,
124
+ fr as prepareERC1155Payload,
125
+ Cr as prepareERC1155Transfer,
126
+ de as prepareERC20IncentivePayload,
127
+ E as prepareERC20VariableCriteriaIncentivePayload,
128
+ Ae as prepareERC20VariableIncentivePayload,
129
+ u as prepareEventActionPayload,
130
+ br as prepareFungiblePayload,
131
+ gr as prepareFungibleTransfer,
132
+ Y as prepareManagedBudgetPayload,
133
+ be as preparePointsIncentivePayload,
134
+ ve as prepareSignerValidatorClaimDataPayload,
135
+ Pe as prepareSignerValidatorInputParams,
136
+ Re as prepareSignerValidatorPayload,
137
+ V as prepareSimpleAllowListPayload,
138
+ _ as prepareSimpleDenyListPayload,
139
+ j as prepareTransfer,
140
+ Ir as prepareTransferPayload,
141
+ Vr as rbacAbi,
142
+ wr as signerValidatorAbi,
143
+ hr as simpleAllowListAbi,
144
+ _r as simpleDenyListAbi,
145
+ Be as validatorFromAddress
112
146
  };
113
147
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"transfers.cjs","sources":["../src/transfers.ts"],"sourcesContent":["import {\n type Address,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\n\n/**\n * The various types of assets supported in Budgets and Incentives.\n *\n * @export\n * @enum {number}\n */\nexport enum AssetType {\n ETH,\n ERC20,\n ERC1155,\n}\n\n/**\n * Object representation of a generic `Transfer` struct.\n *\n * @export\n * @interface TransferPayload\n * @typedef {TransferPayload}\n */\nexport interface TransferPayload {\n /**\n * The type of the asset being transferred.\n *\n * @type {AssetType}\n */\n assetType: AssetType;\n /**\n * The address of the asset to transfer, zero address for ETH.\n *\n * @type {Address}\n */\n address: Address;\n /**\n * The account from which to transfer the assets.\n *\n * @type {Address}\n */\n target: Address;\n /**\n * An encoded {@link FungiblePayload}, use {@link prepareFungiblePayload} to construct.\n *\n * @type {Hex}\n */\n data: Hex;\n}\n\n/**\n * Encodes parameters for transferring the transfer of Fungible and ERC1155 assets, used for {@link Budget} operations.\n * Typically you'd use {@link prepareFungibleTransfer} or {@link prepareERC1155Transfer}\n *\n * @param {TransferPayload} param0\n * @param {AssetType} param0.assetType - The asset type being transferred.\n * @param {Address} param0.address - The address of the asset, use zero address for ETH transfers.\n * @param {Address} param0.target - The address of the account being transferred from\n * @param {Hex} param0.data - Use {@link prepareFungiblePayload} to properly encode an amount to transfer\n * @returns {Hex}\n */\nexport const prepareTransferPayload = ({\n assetType,\n address,\n target,\n data,\n}: TransferPayload) => {\n return encodeAbiParameters(\n [\n { type: 'uint8', name: 'assetType' },\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'target' },\n { type: 'bytes', name: 'data' },\n ],\n [assetType, address, target, data],\n );\n};\n\n/**\n * Object representation of\n *\n * @export\n * @interface ERC1155Payload\n * @typedef {ERC1155Payload}\n */\nexport interface ERC1155Payload {\n /**\n * The ERC1155 token ID for the incentive\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Given a token ID and amount, properly encode a `ERC1155Incentive.ERC1155Payload` for use with {@link ERC1155Incentive} initialization.\n *\n * @export\n * @param {ERC1155Payload} param0\n * @param {bigint} param0.tokenId - The ERC1155 token ID for the incentive\n * @param {bigint} param0.amount - The amount to transfer\n * @returns {Hex}\n */\nexport function prepareERC1155Payload({ tokenId, amount }: ERC1155Payload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ERC1155Payload payload',\n 'struct ERC1155Payload { uint256 tokenId; uint256 amount; bytes data; }',\n ]),\n [{ tokenId, amount, data: '0x' }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of ERC1155 assets.\n *\n * @export\n * @interface ERC1155TransferPayload\n * @typedef {ERC1155TransferPayload}\n */\nexport interface ERC1155TransferPayload {\n /**\n * The token ID to transfer\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset to target\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for transferring the transfer of ERC1155 assets, used for {@link Budget} operations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {ERC1155TransferPayload} param0\n * @param {bigint} param0.tokenId - The token ID to transfer\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset to target\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareERC1155Transfer({\n tokenId,\n amount,\n asset,\n target,\n}: ERC1155TransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: AssetType.ERC1155,\n asset,\n data: prepareERC1155Payload({ tokenId, amount }),\n target,\n },\n ],\n );\n}\n\n/**\n * An object representation of the `FungiblePayload` struct\n *\n * @export\n * @interface FungiblePayload\n * @typedef {FungiblePayload}\n */\nexport interface FungiblePayload {\n /**\n * The amount being transferred\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Encodes an amount for the `FungiblePayload` struct\n *\n * @export\n * @param {FungiblePayload} param0\n * @param {bigint} param0.amount - The amount being transferred\n * @returns {*}\n */\nexport function prepareFungiblePayload({ amount }: FungiblePayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'FungiblePayload payload',\n 'struct FungiblePayload { uint256 amount; }',\n ]),\n [{ amount }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of fungible assets.\n *\n * @export\n * @interface FungibleTransferPayload\n * @typedef {FungibleTransferPayload}\n */\nexport interface FungibleTransferPayload {\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset. Use zero address for ETH transfers.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for a Fungible transfer, used for Budget allocations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {FungibleTransferPayload} param0\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset. Use zero address for ETH transfers.\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareFungibleTransfer({\n amount,\n asset,\n target,\n}: FungibleTransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: asset == zeroAddress ? AssetType.ETH : AssetType.ERC20,\n asset,\n data: prepareFungiblePayload({ amount }),\n target,\n },\n ],\n );\n}\n"],"names":["AssetType","AssetType2","prepareTransferPayload","assetType","address","target","data","encodeAbiParameters","prepareERC1155Payload","tokenId","amount","parseAbiParameters","prepareERC1155Transfer","asset","prepareFungiblePayload","prepareFungibleTransfer","zeroAddress"],"mappings":"wGAcY,IAAAA,GAAAA,IACVA,EAAAC,EAAA,IAAA,CAAA,EAA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,OAAAL,CACF,CACF,CAAA,CAEJ"}
1
+ {"version":3,"file":"transfers.cjs","sources":["../src/transfers.ts"],"sourcesContent":["import {\n type Address,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\n\n/**\n * The various types of assets supported in Budgets and Incentives.\n *\n * @export\n * @enum {number}\n */\nexport enum AssetType {\n ETH,\n ERC20,\n ERC1155,\n}\n\n/**\n * Object representation of a generic `Transfer` struct.\n *\n * @export\n * @interface TransferPayload\n * @typedef {TransferPayload}\n */\nexport interface TransferPayload {\n /**\n * The type of the asset being transferred.\n *\n * @type {AssetType}\n */\n assetType: AssetType;\n /**\n * The address of the asset to transfer, zero address for ETH.\n *\n * @type {Address}\n */\n address: Address;\n /**\n * The account from which to transfer the assets.\n *\n * @type {Address}\n */\n target: Address;\n /**\n * An encoded {@link FungiblePayload}, use {@link prepareFungiblePayload} to construct.\n *\n * @type {Hex}\n */\n data: Hex;\n}\n\n/**\n * Encodes parameters for transferring the transfer of Fungible and ERC1155 assets, used for {@link Budget} operations.\n * Typically you'd use {@link prepareFungibleTransfer} or {@link prepareERC1155Transfer}\n *\n * @param {TransferPayload} param0\n * @param {AssetType} param0.assetType - The asset type being transferred.\n * @param {Address} param0.address - The address of the asset, use zero address for ETH transfers.\n * @param {Address} param0.target - The address of the account being transferred from\n * @param {Hex} param0.data - Use {@link prepareFungiblePayload} to properly encode an amount to transfer\n * @returns {Hex}\n */\nexport const prepareTransferPayload = ({\n assetType,\n address,\n target,\n data,\n}: TransferPayload) => {\n return encodeAbiParameters(\n [\n { type: 'uint8', name: 'assetType' },\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'target' },\n { type: 'bytes', name: 'data' },\n ],\n [assetType, address, target, data],\n );\n};\n\n/**\n * Object representation of\n *\n * @export\n * @interface ERC1155Payload\n * @typedef {ERC1155Payload}\n */\nexport interface ERC1155Payload {\n /**\n * The ERC1155 token ID for the incentive\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Given a token ID and amount, properly encode a `ERC1155Incentive.ERC1155Payload` for use with {@link ERC1155Incentive} initialization.\n *\n * @export\n * @param {ERC1155Payload} param0\n * @param {bigint} param0.tokenId - The ERC1155 token ID for the incentive\n * @param {bigint} param0.amount - The amount to transfer\n * @returns {Hex}\n */\nexport function prepareERC1155Payload({ tokenId, amount }: ERC1155Payload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ERC1155Payload payload',\n 'struct ERC1155Payload { uint256 tokenId; uint256 amount; bytes data; }',\n ]),\n [{ tokenId, amount, data: '0x' }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of ERC1155 assets.\n *\n * @export\n * @interface ERC1155TransferPayload\n * @typedef {ERC1155TransferPayload}\n */\nexport interface ERC1155TransferPayload {\n /**\n * The token ID to transfer\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset to target\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for transferring the transfer of ERC1155 assets, used for {@link Budget} operations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {ERC1155TransferPayload} param0\n * @param {bigint} param0.tokenId - The token ID to transfer\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset to target\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareERC1155Transfer({\n tokenId,\n amount,\n asset,\n target,\n}: ERC1155TransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: AssetType.ERC1155,\n asset,\n data: prepareERC1155Payload({ tokenId, amount }),\n target,\n },\n ],\n );\n}\n\n/**\n * An object representation of the `FungiblePayload` struct\n *\n * @export\n * @interface FungiblePayload\n * @typedef {FungiblePayload}\n */\nexport interface FungiblePayload {\n /**\n * The amount being transferred\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Encodes an amount for the `FungiblePayload` struct\n *\n * @export\n * @param {FungiblePayload} param0\n * @param {bigint} param0.amount - The amount being transferred\n * @returns {Hex}\n */\nexport function prepareFungiblePayload({ amount }: FungiblePayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'FungiblePayload payload',\n 'struct FungiblePayload { uint256 amount; }',\n ]),\n [{ amount }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of fungible assets.\n *\n * @export\n * @interface FungibleTransferPayload\n * @typedef {FungibleTransferPayload}\n */\nexport interface FungibleTransferPayload {\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset. Use zero address for ETH transfers.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for a Fungible transfer, used for Budget allocations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {FungibleTransferPayload} param0\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset. Use zero address for ETH transfers.\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareFungibleTransfer({\n amount,\n asset,\n target,\n}: FungibleTransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: asset == zeroAddress ? AssetType.ETH : AssetType.ERC20,\n asset,\n data: prepareFungiblePayload({ amount }),\n target,\n },\n ],\n );\n}\n"],"names":["AssetType","AssetType2","prepareTransferPayload","assetType","address","target","data","encodeAbiParameters","prepareERC1155Payload","tokenId","amount","parseAbiParameters","prepareERC1155Transfer","asset","prepareFungiblePayload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ACE,UAAWE,GAASG,cAAc,EAAgB,EAClD,MAAAH,EACA,KAAMC,EAAuB,CAAE,OAAAJ,EAAQ,EACvC,OAAAL,CACF,CACF,CAAA,CAEJ"}
@@ -153,7 +153,7 @@ export interface FungiblePayload {
153
153
  * @export
154
154
  * @param {FungiblePayload} param0
155
155
  * @param {bigint} param0.amount - The amount being transferred
156
- * @returns {*}
156
+ * @returns {Hex}
157
157
  */
158
158
  export declare function prepareFungiblePayload({ amount }: FungiblePayload): `0x${string}`;
159
159
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"transfers.js","sources":["../src/transfers.ts"],"sourcesContent":["import {\n type Address,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\n\n/**\n * The various types of assets supported in Budgets and Incentives.\n *\n * @export\n * @enum {number}\n */\nexport enum AssetType {\n ETH,\n ERC20,\n ERC1155,\n}\n\n/**\n * Object representation of a generic `Transfer` struct.\n *\n * @export\n * @interface TransferPayload\n * @typedef {TransferPayload}\n */\nexport interface TransferPayload {\n /**\n * The type of the asset being transferred.\n *\n * @type {AssetType}\n */\n assetType: AssetType;\n /**\n * The address of the asset to transfer, zero address for ETH.\n *\n * @type {Address}\n */\n address: Address;\n /**\n * The account from which to transfer the assets.\n *\n * @type {Address}\n */\n target: Address;\n /**\n * An encoded {@link FungiblePayload}, use {@link prepareFungiblePayload} to construct.\n *\n * @type {Hex}\n */\n data: Hex;\n}\n\n/**\n * Encodes parameters for transferring the transfer of Fungible and ERC1155 assets, used for {@link Budget} operations.\n * Typically you'd use {@link prepareFungibleTransfer} or {@link prepareERC1155Transfer}\n *\n * @param {TransferPayload} param0\n * @param {AssetType} param0.assetType - The asset type being transferred.\n * @param {Address} param0.address - The address of the asset, use zero address for ETH transfers.\n * @param {Address} param0.target - The address of the account being transferred from\n * @param {Hex} param0.data - Use {@link prepareFungiblePayload} to properly encode an amount to transfer\n * @returns {Hex}\n */\nexport const prepareTransferPayload = ({\n assetType,\n address,\n target,\n data,\n}: TransferPayload) => {\n return encodeAbiParameters(\n [\n { type: 'uint8', name: 'assetType' },\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'target' },\n { type: 'bytes', name: 'data' },\n ],\n [assetType, address, target, data],\n );\n};\n\n/**\n * Object representation of\n *\n * @export\n * @interface ERC1155Payload\n * @typedef {ERC1155Payload}\n */\nexport interface ERC1155Payload {\n /**\n * The ERC1155 token ID for the incentive\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Given a token ID and amount, properly encode a `ERC1155Incentive.ERC1155Payload` for use with {@link ERC1155Incentive} initialization.\n *\n * @export\n * @param {ERC1155Payload} param0\n * @param {bigint} param0.tokenId - The ERC1155 token ID for the incentive\n * @param {bigint} param0.amount - The amount to transfer\n * @returns {Hex}\n */\nexport function prepareERC1155Payload({ tokenId, amount }: ERC1155Payload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ERC1155Payload payload',\n 'struct ERC1155Payload { uint256 tokenId; uint256 amount; bytes data; }',\n ]),\n [{ tokenId, amount, data: '0x' }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of ERC1155 assets.\n *\n * @export\n * @interface ERC1155TransferPayload\n * @typedef {ERC1155TransferPayload}\n */\nexport interface ERC1155TransferPayload {\n /**\n * The token ID to transfer\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset to target\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for transferring the transfer of ERC1155 assets, used for {@link Budget} operations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {ERC1155TransferPayload} param0\n * @param {bigint} param0.tokenId - The token ID to transfer\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset to target\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareERC1155Transfer({\n tokenId,\n amount,\n asset,\n target,\n}: ERC1155TransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: AssetType.ERC1155,\n asset,\n data: prepareERC1155Payload({ tokenId, amount }),\n target,\n },\n ],\n );\n}\n\n/**\n * An object representation of the `FungiblePayload` struct\n *\n * @export\n * @interface FungiblePayload\n * @typedef {FungiblePayload}\n */\nexport interface FungiblePayload {\n /**\n * The amount being transferred\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Encodes an amount for the `FungiblePayload` struct\n *\n * @export\n * @param {FungiblePayload} param0\n * @param {bigint} param0.amount - The amount being transferred\n * @returns {*}\n */\nexport function prepareFungiblePayload({ amount }: FungiblePayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'FungiblePayload payload',\n 'struct FungiblePayload { uint256 amount; }',\n ]),\n [{ amount }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of fungible assets.\n *\n * @export\n * @interface FungibleTransferPayload\n * @typedef {FungibleTransferPayload}\n */\nexport interface FungibleTransferPayload {\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset. Use zero address for ETH transfers.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for a Fungible transfer, used for Budget allocations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {FungibleTransferPayload} param0\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset. Use zero address for ETH transfers.\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareFungibleTransfer({\n amount,\n asset,\n target,\n}: FungibleTransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: asset == zeroAddress ? AssetType.ETH : AssetType.ERC20,\n asset,\n data: prepareFungiblePayload({ amount }),\n target,\n },\n ],\n );\n}\n"],"names":["AssetType","AssetType2","prepareTransferPayload","assetType","address","target","data","encodeAbiParameters","prepareERC1155Payload","tokenId","amount","parseAbiParameters","prepareERC1155Transfer","asset","prepareFungiblePayload","prepareFungibleTransfer","zeroAddress"],"mappings":";AAcY,IAAAA,sBAAAA,OACVA,EAAAC,EAAA,MAAA,CAAA,IAAA,OACAD,EAAAC,EAAA,QAAA,CAAA,IAAA,SACAD,EAAAC,EAAA,UAAA,CAAA,IAAA,WAHUD,IAAAA,KAAA,CAAA,CAAA;AAmDL,MAAME,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AACF,MACSC;AAAA,EACL;AAAA,IACE,EAAE,MAAM,SAAS,MAAM,YAAY;AAAA,IACnC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,IACjC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,IAClC,EAAE,MAAM,SAAS,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,CAACJ,GAAWC,GAASC,GAAQC,CAAI;AAAA;AAmC9B,SAASE,EAAsB,EAAE,SAAAC,GAAS,QAAAC,KAA0B;AAClE,SAAAH;AAAA,IACLI,EAAmB;AAAA,MACjB;AAAA,MACA;AAAA,IAAA,CACD;AAAA,IACD,CAAC,EAAE,SAAAF,GAAS,QAAAC,GAAQ,MAAM,MAAM;AAAA,EAAA;AAEpC;AAgDO,SAASE,EAAuB;AAAA,EACrC,SAAAH;AAAA,EACA,QAAAC;AAAA,EACA,OAAAG;AAAA,EACA,QAAAR;AACF,GAA2B;AAClB,SAAAE;AAAA,IACLI,EAAmB;AAAA,MACjB;AAAA,MACA;AAAA,IAAA,CACD;AAAA,IACD;AAAA,MACE;AAAA,QACE,WAAW;AAAA,QACX,OAAAE;AAAA,QACA,MAAML,EAAsB,EAAE,SAAAC,GAAS,QAAAC,GAAQ;AAAA,QAC/C,QAAAL;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;AA0BgB,SAAAS,EAAuB,EAAE,QAAAJ,KAA2B;AAC3D,SAAAH;AAAA,IACLI,EAAmB;AAAA,MACjB;AAAA,MACA;AAAA,IAAA,CACD;AAAA,IACD,CAAC,EAAE,QAAAD,EAAA,CAAQ;AAAA,EAAA;AAEf;AAyCO,SAASK,EAAwB;AAAA,EACtC,QAAAL;AAAA,EACA,OAAAG;AAAA,EACA,QAAAR;AACF,GAA4B;AACnB,SAAAE;AAAA,IACLI,EAAmB;AAAA,MACjB;AAAA,MACA;AAAA,IAAA,CACD;AAAA,IACD;AAAA,MACE;AAAA,QACE,WAAWE,KAASG,IAAc,IAAgB;AAAA,QAClD,OAAAH;AAAA,QACA,MAAMC,EAAuB,EAAE,QAAAJ,GAAQ;AAAA,QACvC,QAAAL;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"transfers.js","sources":["../src/transfers.ts"],"sourcesContent":["import {\n type Address,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\n\n/**\n * The various types of assets supported in Budgets and Incentives.\n *\n * @export\n * @enum {number}\n */\nexport enum AssetType {\n ETH,\n ERC20,\n ERC1155,\n}\n\n/**\n * Object representation of a generic `Transfer` struct.\n *\n * @export\n * @interface TransferPayload\n * @typedef {TransferPayload}\n */\nexport interface TransferPayload {\n /**\n * The type of the asset being transferred.\n *\n * @type {AssetType}\n */\n assetType: AssetType;\n /**\n * The address of the asset to transfer, zero address for ETH.\n *\n * @type {Address}\n */\n address: Address;\n /**\n * The account from which to transfer the assets.\n *\n * @type {Address}\n */\n target: Address;\n /**\n * An encoded {@link FungiblePayload}, use {@link prepareFungiblePayload} to construct.\n *\n * @type {Hex}\n */\n data: Hex;\n}\n\n/**\n * Encodes parameters for transferring the transfer of Fungible and ERC1155 assets, used for {@link Budget} operations.\n * Typically you'd use {@link prepareFungibleTransfer} or {@link prepareERC1155Transfer}\n *\n * @param {TransferPayload} param0\n * @param {AssetType} param0.assetType - The asset type being transferred.\n * @param {Address} param0.address - The address of the asset, use zero address for ETH transfers.\n * @param {Address} param0.target - The address of the account being transferred from\n * @param {Hex} param0.data - Use {@link prepareFungiblePayload} to properly encode an amount to transfer\n * @returns {Hex}\n */\nexport const prepareTransferPayload = ({\n assetType,\n address,\n target,\n data,\n}: TransferPayload) => {\n return encodeAbiParameters(\n [\n { type: 'uint8', name: 'assetType' },\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'target' },\n { type: 'bytes', name: 'data' },\n ],\n [assetType, address, target, data],\n );\n};\n\n/**\n * Object representation of\n *\n * @export\n * @interface ERC1155Payload\n * @typedef {ERC1155Payload}\n */\nexport interface ERC1155Payload {\n /**\n * The ERC1155 token ID for the incentive\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Given a token ID and amount, properly encode a `ERC1155Incentive.ERC1155Payload` for use with {@link ERC1155Incentive} initialization.\n *\n * @export\n * @param {ERC1155Payload} param0\n * @param {bigint} param0.tokenId - The ERC1155 token ID for the incentive\n * @param {bigint} param0.amount - The amount to transfer\n * @returns {Hex}\n */\nexport function prepareERC1155Payload({ tokenId, amount }: ERC1155Payload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ERC1155Payload payload',\n 'struct ERC1155Payload { uint256 tokenId; uint256 amount; bytes data; }',\n ]),\n [{ tokenId, amount, data: '0x' }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of ERC1155 assets.\n *\n * @export\n * @interface ERC1155TransferPayload\n * @typedef {ERC1155TransferPayload}\n */\nexport interface ERC1155TransferPayload {\n /**\n * The token ID to transfer\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset to target\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for transferring the transfer of ERC1155 assets, used for {@link Budget} operations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {ERC1155TransferPayload} param0\n * @param {bigint} param0.tokenId - The token ID to transfer\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset to target\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareERC1155Transfer({\n tokenId,\n amount,\n asset,\n target,\n}: ERC1155TransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: AssetType.ERC1155,\n asset,\n data: prepareERC1155Payload({ tokenId, amount }),\n target,\n },\n ],\n );\n}\n\n/**\n * An object representation of the `FungiblePayload` struct\n *\n * @export\n * @interface FungiblePayload\n * @typedef {FungiblePayload}\n */\nexport interface FungiblePayload {\n /**\n * The amount being transferred\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Encodes an amount for the `FungiblePayload` struct\n *\n * @export\n * @param {FungiblePayload} param0\n * @param {bigint} param0.amount - The amount being transferred\n * @returns {Hex}\n */\nexport function prepareFungiblePayload({ amount }: FungiblePayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'FungiblePayload payload',\n 'struct FungiblePayload { uint256 amount; }',\n ]),\n [{ amount }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of fungible assets.\n *\n * @export\n * @interface FungibleTransferPayload\n * @typedef {FungibleTransferPayload}\n */\nexport interface FungibleTransferPayload {\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset. Use zero address for ETH transfers.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for a Fungible transfer, used for Budget allocations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {FungibleTransferPayload} param0\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset. Use zero address for ETH transfers.\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareFungibleTransfer({\n amount,\n asset,\n target,\n}: FungibleTransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: asset == zeroAddress ? AssetType.ETH : AssetType.ERC20,\n asset,\n data: prepareFungiblePayload({ amount }),\n target,\n },\n ],\n );\n}\n"],"names":["AssetType","AssetType2","prepareTransferPayload","assetType","address","target","data","encodeAbiParameters","prepareERC1155Payload","tokenId","amount","parseAbiParameters","prepareERC1155Transfer","asset","prepareFungiblePayload","prepareFungibleTransfer","zeroAddress"],"mappings":";AAcY,IAAAA,sBAAAA,OACVA,EAAAC,EAAA,MAAA,CAAA,IAAA,OACAD,EAAAC,EAAA,QAAA,CAAA,IAAA,SACAD,EAAAC,EAAA,UAAA,CAAA,IAAA,WAHUD,IAAAA,KAAA,CAAA,CAAA;AAmDL,MAAME,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AACF,MACSC;AAAA,EACL;AAAA,IACE,EAAE,MAAM,SAAS,MAAM,YAAY;AAAA,IACnC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,IACjC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,IAClC,EAAE,MAAM,SAAS,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,CAACJ,GAAWC,GAASC,GAAQC,CAAI;AAAA;AAmC9B,SAASE,EAAsB,EAAE,SAAAC,GAAS,QAAAC,KAA0B;AAClE,SAAAH;AAAA,IACLI,EAAmB;AAAA,MACjB;AAAA,MACA;AAAA,IAAA,CACD;AAAA,IACD,CAAC,EAAE,SAAAF,GAAS,QAAAC,GAAQ,MAAM,MAAM;AAAA,EAAA;AAEpC;AAgDO,SAASE,EAAuB;AAAA,EACrC,SAAAH;AAAA,EACA,QAAAC;AAAA,EACA,OAAAG;AAAA,EACA,QAAAR;AACF,GAA2B;AAClB,SAAAE;AAAA,IACLI,EAAmB;AAAA,MACjB;AAAA,MACA;AAAA,IAAA,CACD;AAAA,IACD;AAAA,MACE;AAAA,QACE,WAAW;AAAA,QACX,OAAAE;AAAA,QACA,MAAML,EAAsB,EAAE,SAAAC,GAAS,QAAAC,GAAQ;AAAA,QAC/C,QAAAL;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;AA0BgB,SAAAS,EAAuB,EAAE,QAAAJ,KAA2B;AAC3D,SAAAH;AAAA,IACLI,EAAmB;AAAA,MACjB;AAAA,MACA;AAAA,IAAA,CACD;AAAA,IACD,CAAC,EAAE,QAAAD,EAAA,CAAQ;AAAA,EAAA;AAEf;AAyCO,SAASK,EAAwB;AAAA,EACtC,QAAAL;AAAA,EACA,OAAAG;AAAA,EACA,QAAAR;AACF,GAA4B;AACnB,SAAAE;AAAA,IACLI,EAAmB;AAAA,MACjB;AAAA,MACA;AAAA,IAAA,CACD;AAAA,IACD;AAAA,MACE;AAAA,QACE,WAAWE,KAASG,IAAc,IAAgB;AAAA,QAClD,OAAAH;AAAA,QACA,MAAMC,EAAuB,EAAE,QAAAJ,GAAQ;AAAA,QACvC,QAAAL;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;"}
package/dist/utils.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@wagmi/core"),e=require("viem"),i=require("./errors.cjs");function d(t){return e.slice(e.isHex(t)?e.keccak256(t):e.keccak256(e.toHex(t)),0,4)}async function u(t,a,c){const r=await o.waitForTransactionReceipt(t,{...c,hash:await a});if(!r.contractAddress)throw new i.NoContractAddressUponReceiptError(r);return r.contractAddress}async function A(t,a,c){const{hash:r,result:s}=await a;return await o.waitForTransactionReceipt(t,{...c,hash:r}),s}var n=(t=>(t[t.ACTION=0]="ACTION",t[t.ALLOW_LIST=1]="ALLOW_LIST",t[t.BUDGET=2]="BUDGET",t[t.INCENTIVE=3]="INCENTIVE",t[t.VALIDATOR=4]="VALIDATOR",t))(n||{});exports.RegistryType=n;exports.awaitResult=A;exports.bytes4=d;exports.getDeployedContractAddress=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@wagmi/core"),n=require("viem"),s=require("./errors.cjs");var u=(t=>(t[t.ACTION=0]="ACTION",t[t.ALLOW_LIST=1]="ALLOW_LIST",t[t.BUDGET=2]="BUDGET",t[t.INCENTIVE=3]="INCENTIVE",t[t.VALIDATOR=4]="VALIDATOR",t))(u||{});function d(t){return n.slice(n.isHex(t)?n.keccak256(t):n.keccak256(n.toHex(t)),0,4)}async function A(t,c,r){const o=await i.waitForTransactionReceipt(t,{...r,hash:await c});if(!o.contractAddress)throw new s.NoContractAddressUponReceiptError(o);return o.contractAddress}async function f(t,c,r){const{hash:o,result:a}=await c;return await i.waitForTransactionReceipt(t,{...r,hash:o}),a}function l(t,c,r){let o;const a=i.getAccount(t);if(r!==void 0?c[r]&&(o=r):a.chainId!==void 0&&c[a.chainId]&&(o=a.chainId),o===void 0){const e=i.getClient(t);e!=null&&e.chain.id&&c[e==null?void 0:e.chain.id]&&(o=e.chain.id)}if(o===void 0&&(o=11155111),!c[o])throw new s.InvalidProtocolChainIdError(o,Object.keys(c).map(Number));return{chainId:o,address:c[o]}}exports.RegistryType=u;exports.assertValidAddressByChainId=l;exports.awaitResult=f;exports.bytes4=d;exports.getDeployedContractAddress=A;
2
2
  //# sourceMappingURL=utils.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","sources":["../src/utils.ts"],"sourcesContent":["import {\n type Config,\n type ReadContractParameters,\n type WatchContractEventParameters,\n type WriteContractParameters,\n waitForTransactionReceipt,\n} from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport type {\n Abi,\n AbiEvent,\n ContractEventName,\n ContractFunctionName,\n GetLogsParameters,\n Hash,\n Hex,\n Log,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport { isHex, keccak256, slice, toHex } from 'viem';\nimport { NoContractAddressUponReceiptError } from './errors';\n\nexport type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;\n\n/**\n * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (writeContract)[https://viem.sh/docs/contract/writeContract]\n *\n * @export\n * @typedef {WriteParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type WriteParams<\n abi extends Abi,\n functionName extends ContractFunctionName<abi>,\n> = Partial<\n Omit<\n WriteContractParameters<abi, functionName>,\n 'address' | 'args' | 'functionName' | 'abi'\n >\n>;\n\n/**\n * Helper type that encapsulates common readContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (readContract)[https://viem.sh/docs/contract/readContract]\n *\n * @export\n * @typedef {ReadParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type ReadParams<\n abi extends Abi,\n functionName extends ContractFunctionName<abi>,\n> = Partial<\n Omit<\n ReadContractParameters<abi, functionName>,\n 'address' | 'args' | 'functionName' | 'abi'\n >\n>;\n\n/**\n * Helper type that encapsulates common `watchContractEvent` parameters without fields like `address`, and `abi` that are expected to be provided the SDK.\n * See (watchContractEvent)[https://wagmi.sh/core/api/actions/watchContractEvent]\n *\n * @export\n * @typedef {WatchParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi> | undefined} [eventName=undefined]\n */\nexport type WatchParams<\n abi extends Abi,\n eventName extends ContractEventName<abi> | undefined = undefined,\n> = Partial<\n Omit<WatchContractEventParameters<abi, eventName>, 'address' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `getLogs` parameters without fields like `address` that are expected to be provided the SDK.\n * See (getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs]\n *\n * @export\n * @typedef {GetLogsParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} event\n * @template {ExtractAbiEvent<abi, event>} [abiEvent=ExtractAbiEvent<abi, event>]\n * @template {| readonly AbiEvent[]\n * | readonly unknown[]\n * | undefined} [abiEvents=abiEvent extends AbiEvent ? [abiEvent] : undefined]\n */\nexport type GetLogsParams<\n abi extends Abi,\n event extends ContractEventName<abi>,\n abiEvent extends ExtractAbiEvent<abi, event> = ExtractAbiEvent<abi, event>,\n abiEvents extends\n | readonly AbiEvent[]\n | readonly unknown[]\n | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined,\n> = Partial<Omit<GetLogsParameters<abiEvent, abiEvents>, 'address'>> & {\n chainId?: number | undefined;\n};\n\n/**\n * A generic `viem.Log` event with typed `args` support via a given `Abi` and `ContractEventName`\n *\n * @export\n * @typedef {GenericLog}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} [event=ContractEventName<abi>]\n */\nexport type GenericLog<\n abi extends Abi,\n event extends ContractEventName<abi> = ContractEventName<abi>,\n> = Log<bigint, number, false, ExtractAbiEvent<abi, event>, false>;\n\n/**\n * Helper utility to convert a string to a `bytes4` type\n *\n * @export\n * @param {string} input\n * @returns {Hex}\n */\nexport function bytes4(input: string) {\n return slice(isHex(input) ? keccak256(input) : keccak256(toHex(input)), 0, 4);\n}\n\n/**\n * Utility function to wait for a transaction receipt, and extract the contractAddress\n *\n * @export\n * @async\n * @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @param {Promise<Hash>} hash - A transaction hash promise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}\n * @returns {unknown}\n * @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received\n */\nexport async function getDeployedContractAddress(\n config: Config,\n hash: Promise<Hash>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n) {\n const receipt = await waitForTransactionReceipt(config, {\n ...waitParams,\n hash: await hash,\n });\n if (!receipt.contractAddress)\n throw new NoContractAddressUponReceiptError(receipt);\n return receipt.contractAddress;\n}\n\n/**\n * Utility type to encapsulate a transaction hash, and the simulated result prior to submitting the transaction.\n *\n * @export\n * @typedef {HashAndSimulatedResult}\n * @template [T=unknown]\n */\nexport type HashAndSimulatedResult<T = unknown> = { hash: Hash; result: T };\n\n/**\n * Helper function to wait for a transaction receipt given a hash promise.\n *\n * @export\n * @async\n * @template [Result=unknown]\n * @param {WagmiConfig} config\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\nexport async function awaitResult<Result = unknown>(\n config: Config,\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n): Promise<Result> {\n const { hash, result } = await hashPromise;\n await waitForTransactionReceipt(config, {\n ...waitParams,\n hash,\n });\n return result;\n}\n\n/**\n * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.\n *\n * @export\n * @enum {number}\n */\nexport enum RegistryType {\n ACTION = 0,\n ALLOW_LIST = 1,\n BUDGET = 2,\n INCENTIVE = 3,\n VALIDATOR = 4,\n}\n"],"names":["bytes4","input","slice","isHex","keccak256","toHex","getDeployedContractAddress","config","hash","waitParams","receipt","waitForTransactionReceipt","NoContractAddressUponReceiptError","awaitResult","hashPromise","result","RegistryType"],"mappings":"2JA2HO,SAASA,EAAOC,EAAe,CACpC,OAAOC,EAAM,MAAAC,EAAA,MAAMF,CAAK,EAAIG,EAAU,UAAAH,CAAK,EAAIG,EAAA,UAAUC,EAAM,MAAAJ,CAAK,CAAC,EAAG,EAAG,CAAC,CAC9E,CAasB,eAAAK,EACpBC,EACAC,EACAC,EACA,CACM,MAAAC,EAAU,MAAMC,EAAA,0BAA0BJ,EAAQ,CACtD,GAAGE,EACH,KAAM,MAAMD,CAAA,CACb,EACD,GAAI,CAACE,EAAQ,gBACL,MAAA,IAAIE,EAAAA,kCAAkCF,CAAO,EACrD,OAAOA,EAAQ,eACjB,CAsBsB,eAAAG,EACpBN,EACAO,EACAL,EACiB,CACjB,KAAM,CAAE,KAAAD,EAAM,OAAAO,CAAO,EAAI,MAAMD,EAC/B,aAAMH,EAAAA,0BAA0BJ,EAAQ,CACtC,GAAGE,EACH,KAAAD,CAAA,CACD,EACMO,CACT,CAQY,IAAAC,GAAAA,IACVA,EAAAA,EAAA,OAAS,CAAT,EAAA,SACAA,EAAAA,EAAA,WAAa,CAAb,EAAA,aACAA,EAAAA,EAAA,OAAS,CAAT,EAAA,SACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YALUA,IAAAA,GAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"utils.cjs","sources":["../src/utils.ts"],"sourcesContent":["import {\n type Config,\n type ReadContractParameters,\n type WatchContractEventParameters,\n type WriteContractParameters,\n getAccount,\n getClient,\n waitForTransactionReceipt,\n} from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport type {\n Abi,\n AbiEvent,\n Address,\n ContractEventName,\n ContractFunctionName,\n GetLogsParameters,\n Hash,\n Hex,\n Log,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport { isHex, keccak256, slice, toHex } from 'viem';\nimport {\n InvalidProtocolChainIdError,\n NoConnectedChainIdError,\n NoContractAddressUponReceiptError,\n} from './errors';\n\nexport type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;\n\n/**\n * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.\n *\n * @export\n * @enum {number}\n */\nexport enum RegistryType {\n ACTION = 0,\n ALLOW_LIST = 1,\n BUDGET = 2,\n INCENTIVE = 3,\n VALIDATOR = 4,\n}\n\n/**\n * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (writeContract)[https://viem.sh/docs/contract/writeContract]\n *\n * @export\n * @typedef {WriteParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type WriteParams<\n abi extends Abi = Abi,\n functionName extends ContractFunctionName<abi> = ContractFunctionName<abi>,\n> = Partial<\n Omit<\n WriteContractParameters<abi, functionName>,\n 'address' | 'args' | 'functionName' | 'abi'\n >\n>;\n\n/**\n * Helper type that encapsulates common readContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (readContract)[https://viem.sh/docs/contract/readContract]\n *\n * @export\n * @typedef {ReadParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type ReadParams<\n abi extends Abi,\n functionName extends ContractFunctionName<abi>,\n> = Partial<\n Omit<\n ReadContractParameters<abi, functionName>,\n 'address' | 'args' | 'functionName' | 'abi'\n >\n>;\n\n/**\n * Helper type that encapsulates common `watchContractEvent` parameters without fields like `address`, and `abi` that are expected to be provided the SDK.\n * See (watchContractEvent)[https://wagmi.sh/core/api/actions/watchContractEvent]\n *\n * @export\n * @typedef {WatchParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi> | undefined} [eventName=undefined]\n */\nexport type WatchParams<\n abi extends Abi,\n eventName extends ContractEventName<abi> | undefined = undefined,\n> = Partial<\n Omit<WatchContractEventParameters<abi, eventName>, 'address' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `getLogs` parameters without fields like `address` that are expected to be provided the SDK.\n * See (getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs]\n *\n * @export\n * @typedef {GetLogsParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} event\n * @template {ExtractAbiEvent<abi, event>} [abiEvent=ExtractAbiEvent<abi, event>]\n * @template {| readonly AbiEvent[]\n * | readonly unknown[]\n * | undefined} [abiEvents=abiEvent extends AbiEvent ? [abiEvent] : undefined]\n */\nexport type GetLogsParams<\n abi extends Abi,\n event extends ContractEventName<abi>,\n abiEvent extends ExtractAbiEvent<abi, event> = ExtractAbiEvent<abi, event>,\n abiEvents extends\n | readonly AbiEvent[]\n | readonly unknown[]\n | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined,\n> = Partial<Omit<GetLogsParameters<abiEvent, abiEvents>, 'address'>> & {\n chainId?: number | undefined;\n};\n\n/**\n * A generic `viem.Log` event with typed `args` support via a given `Abi` and `ContractEventName`\n *\n * @export\n * @typedef {GenericLog}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} [event=ContractEventName<abi>]\n */\nexport type GenericLog<\n abi extends Abi,\n event extends ContractEventName<abi> = ContractEventName<abi>,\n> = Log<bigint, number, false, ExtractAbiEvent<abi, event>, false>;\n\n/**\n * Helper utility to convert a string to a `bytes4` type\n *\n * @export\n * @param {string} input\n * @returns {Hex}\n */\nexport function bytes4(input: string) {\n return slice(isHex(input) ? keccak256(input) : keccak256(toHex(input)), 0, 4);\n}\n\n/**\n * Utility function to wait for a transaction receipt, and extract the contractAddress\n *\n * @export\n * @async\n * @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @param {Promise<Hash>} hash - A transaction hash promise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}\n * @returns {Promise<Address>}\n * @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received\n */\nexport async function getDeployedContractAddress(\n config: Config,\n hash: Promise<Hash>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n) {\n const receipt = await waitForTransactionReceipt(config, {\n ...waitParams,\n hash: await hash,\n });\n if (!receipt.contractAddress)\n throw new NoContractAddressUponReceiptError(receipt);\n return receipt.contractAddress;\n}\n\n/**\n * Utility type to encapsulate a transaction hash, and the simulated result prior to submitting the transaction.\n *\n * @export\n * @typedef {HashAndSimulatedResult}\n * @template [T=unknown]\n */\nexport type HashAndSimulatedResult<T = unknown> = { hash: Hash; result: T };\n\n/**\n * Helper function to wait for a transaction receipt given a hash promise.\n *\n * @export\n * @async\n * @template [Result=unknown]\n * @param {WagmiConfig} config\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\nexport async function awaitResult<Result = unknown>(\n config: Config,\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n): Promise<Result> {\n const { hash, result } = await hashPromise;\n await waitForTransactionReceipt(config, {\n ...waitParams,\n hash,\n });\n return result;\n}\n\n/**\n * Given a wagmi config and a map of chain id's to addresses, determine an address/chainId combo that maps to the currently connected chain id, or throw a typed error.\n *\n * @export\n * @param {Config} config\n * @param {Record<string, Address>} addressByChainId\n * @param {number} desiredChainId\n * @returns {{ chainId: number, address: Address }}\n * @throws {@link InvalidProtocolChainIdError}\n */\nexport function assertValidAddressByChainId(\n config: Config,\n addressByChainId: Record<number, Address>,\n desiredChainId?: number,\n): { chainId: number; address: Address } {\n let chainId: number | undefined = undefined;\n const wagmiAccount = getAccount(config);\n // if manually providing a chain id for some contract operation, try to use it\n if (desiredChainId !== undefined) {\n if (addressByChainId[desiredChainId]) chainId = desiredChainId;\n } else if (wagmiAccount.chainId !== undefined) {\n // otherwise if we can get the current chain id off the connected account and it matches one of ours, use it\n if (addressByChainId[wagmiAccount.chainId]) chainId = wagmiAccount.chainId;\n }\n // chainId is still undefined, try to get chain id off viem client\n if (chainId === undefined) {\n const client = getClient(config);\n if (client?.chain.id && addressByChainId[client?.chain.id])\n chainId = client.chain.id;\n }\n // if chainId is STILL undefined, use our default addresses\n // TODO: update this when on prod network\n if (chainId === undefined) chainId = Number(__DEFAULT_CHAIN_ID__);\n if (!addressByChainId[chainId])\n throw new InvalidProtocolChainIdError(\n chainId,\n Object.keys(addressByChainId).map(Number),\n );\n // biome-ignore lint/style/noNonNullAssertion: this type should be narrowed by the above statement but isn't?\n return { chainId, address: addressByChainId[chainId]! };\n}\n"],"names":["RegistryType","bytes4","input","slice","isHex","keccak256","toHex","getDeployedContractAddress","config","hash","waitParams","receipt","waitForTransactionReceipt","NoContractAddressUponReceiptError","awaitResult","hashPromise","result","assertValidAddressByChainId","addressByChainId","desiredChainId","chainId","wagmiAccount","getAccount","client","getClient","InvalidProtocolChainIdError"],"mappings":"2JAqCY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,OAAS,CAAT,EAAA,SACAA,EAAAA,EAAA,WAAa,CAAb,EAAA,aACAA,EAAAA,EAAA,OAAS,CAAT,EAAA,SACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YALUA,IAAAA,GAAA,CAAA,CAAA,EA2GL,SAASC,EAAOC,EAAe,CACpC,OAAOC,EAAM,MAAAC,EAAA,MAAMF,CAAK,EAAIG,EAAU,UAAAH,CAAK,EAAIG,EAAA,UAAUC,EAAM,MAAAJ,CAAK,CAAC,EAAG,EAAG,CAAC,CAC9E,CAasB,eAAAK,EACpBC,EACAC,EACAC,EACA,CACM,MAAAC,EAAU,MAAMC,EAAA,0BAA0BJ,EAAQ,CACtD,GAAGE,EACH,KAAM,MAAMD,CAAA,CACb,EACD,GAAI,CAACE,EAAQ,gBACL,MAAA,IAAIE,EAAAA,kCAAkCF,CAAO,EACrD,OAAOA,EAAQ,eACjB,CAsBsB,eAAAG,EACpBN,EACAO,EACAL,EACiB,CACjB,KAAM,CAAE,KAAAD,EAAM,OAAAO,CAAO,EAAI,MAAMD,EAC/B,aAAMH,EAAAA,0BAA0BJ,EAAQ,CACtC,GAAGE,EACH,KAAAD,CAAA,CACD,EACMO,CACT,CAYgB,SAAAC,EACdT,EACAU,EACAC,EACuC,CACvC,IAAIC,EACE,MAAAC,EAAeC,aAAWd,CAAM,EAStC,GAPIW,IAAmB,OACjBD,EAAiBC,CAAc,IAAaC,EAAAD,GACvCE,EAAa,UAAY,QAE9BH,EAAiBG,EAAa,OAAO,MAAaA,EAAa,SAGjED,IAAY,OAAW,CACnB,MAAAG,EAASC,YAAUhB,CAAM,EAC3Be,GAAA,MAAAA,EAAQ,MAAM,IAAML,EAAiBK,GAAA,YAAAA,EAAQ,MAAM,EAAE,IACvDH,EAAUG,EAAO,MAAM,GAC3B,CAII,GADAH,IAAY,SAAqBA,EAAO,UACxC,CAACF,EAAiBE,CAAO,EAC3B,MAAM,IAAIK,EAAA,4BACRL,EACA,OAAO,KAAKF,CAAgB,EAAE,IAAI,MAAM,CAAA,EAG5C,MAAO,CAAE,QAAAE,EAAS,QAASF,EAAiBE,CAAO,CAAG,CACxD"}
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,20 @@
1
1
  import { type Config, type ReadContractParameters, type WatchContractEventParameters, type WriteContractParameters } from '@wagmi/core';
2
2
  import type { ExtractAbiEvent } from 'abitype';
3
- import type { Abi, AbiEvent, ContractEventName, ContractFunctionName, GetLogsParameters, Hash, Log, WaitForTransactionReceiptParameters } from 'viem';
3
+ import type { Abi, AbiEvent, Address, ContractEventName, ContractFunctionName, GetLogsParameters, Hash, Log, WaitForTransactionReceiptParameters } from 'viem';
4
4
  export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
5
+ /**
6
+ * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.
7
+ *
8
+ * @export
9
+ * @enum {number}
10
+ */
11
+ export declare enum RegistryType {
12
+ ACTION = 0,
13
+ ALLOW_LIST = 1,
14
+ BUDGET = 2,
15
+ INCENTIVE = 3,
16
+ VALIDATOR = 4
17
+ }
5
18
  /**
6
19
  * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.
7
20
  * See (writeContract)[https://viem.sh/docs/contract/writeContract]
@@ -11,7 +24,7 @@ export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
11
24
  * @template {Abi} abi
12
25
  * @template {ContractFunctionName<abi>} functionName
13
26
  */
14
- export type WriteParams<abi extends Abi, functionName extends ContractFunctionName<abi>> = Partial<Omit<WriteContractParameters<abi, functionName>, 'address' | 'args' | 'functionName' | 'abi'>>;
27
+ export type WriteParams<abi extends Abi = Abi, functionName extends ContractFunctionName<abi> = ContractFunctionName<abi>> = Partial<Omit<WriteContractParameters<abi, functionName>, 'address' | 'args' | 'functionName' | 'abi'>>;
15
28
  /**
16
29
  * Helper type that encapsulates common readContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.
17
30
  * See (readContract)[https://viem.sh/docs/contract/readContract]
@@ -73,7 +86,7 @@ export declare function bytes4(input: string): `0x${string}`;
73
86
  * @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)
74
87
  * @param {Promise<Hash>} hash - A transaction hash promise
75
88
  * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}
76
- * @returns {unknown}
89
+ * @returns {Promise<Address>}
77
90
  * @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received
78
91
  */
79
92
  export declare function getDeployedContractAddress(config: Config, hash: Promise<Hash>, waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>): Promise<`0x${string}`>;
@@ -101,16 +114,17 @@ export type HashAndSimulatedResult<T = unknown> = {
101
114
  */
102
115
  export declare function awaitResult<Result = unknown>(config: Config, hashPromise: Promise<HashAndSimulatedResult<Result>>, waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>): Promise<Result>;
103
116
  /**
104
- * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.
117
+ * Given a wagmi config and a map of chain id's to addresses, determine an address/chainId combo that maps to the currently connected chain id, or throw a typed error.
105
118
  *
106
119
  * @export
107
- * @enum {number}
120
+ * @param {Config} config
121
+ * @param {Record<string, Address>} addressByChainId
122
+ * @param {number} desiredChainId
123
+ * @returns {{ chainId: number, address: Address }}
124
+ * @throws {@link InvalidProtocolChainIdError}
108
125
  */
109
- export declare enum RegistryType {
110
- ACTION = 0,
111
- ALLOW_LIST = 1,
112
- BUDGET = 2,
113
- INCENTIVE = 3,
114
- VALIDATOR = 4
115
- }
126
+ export declare function assertValidAddressByChainId(config: Config, addressByChainId: Record<number, Address>, desiredChainId?: number): {
127
+ chainId: number;
128
+ address: Address;
129
+ };
116
130
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAE7B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EACV,GAAG,EACH,QAAQ,EACR,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,IAAI,EAEJ,GAAG,EACH,mCAAmC,EACpC,MAAM,MAAM,CAAC;AAId,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAErE;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,CACrB,GAAG,SAAS,GAAG,EACf,YAAY,SAAS,oBAAoB,CAAC,GAAG,CAAC,IAC5C,OAAO,CACT,IAAI,CACF,uBAAuB,CAAC,GAAG,EAAE,YAAY,CAAC,EAC1C,SAAS,GAAG,MAAM,GAAG,cAAc,GAAG,KAAK,CAC5C,CACF,CAAC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