@boostxyz/sdk 0.0.0-alpha.2 → 0.0.0-alpha.21

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 (271) hide show
  1. package/dist/Actions/Action.cjs +2 -1
  2. package/dist/Actions/Action.cjs.map +1 -0
  3. package/dist/Actions/Action.d.ts +1 -1
  4. package/dist/Actions/Action.d.ts.map +1 -1
  5. package/dist/Actions/Action.js +14 -12
  6. package/dist/Actions/Action.js.map +1 -0
  7. package/dist/Actions/ContractAction.d.ts +57 -14
  8. package/dist/Actions/ContractAction.d.ts.map +1 -1
  9. package/dist/Actions/ERC721MintAction.d.ts +50 -23
  10. package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
  11. package/dist/Actions/EventAction.cjs +2 -1
  12. package/dist/Actions/EventAction.cjs.map +1 -0
  13. package/dist/Actions/EventAction.d.ts +405 -36
  14. package/dist/Actions/EventAction.d.ts.map +1 -1
  15. package/dist/Actions/EventAction.js +15 -209
  16. package/dist/Actions/EventAction.js.map +1 -0
  17. package/dist/AllowLists/AllowList.cjs +2 -1
  18. package/dist/AllowLists/AllowList.cjs.map +1 -0
  19. package/dist/AllowLists/AllowList.d.ts +6 -5
  20. package/dist/AllowLists/AllowList.d.ts.map +1 -1
  21. package/dist/AllowLists/AllowList.js +46 -22
  22. package/dist/AllowLists/AllowList.js.map +1 -0
  23. package/dist/AllowLists/OpenAllowList.d.ts +423 -0
  24. package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
  25. package/dist/AllowLists/SimpleAllowList.cjs +2 -1
  26. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
  27. package/dist/AllowLists/SimpleAllowList.d.ts +124 -40
  28. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
  29. package/dist/AllowLists/SimpleAllowList.js +76 -76
  30. package/dist/AllowLists/SimpleAllowList.js.map +1 -0
  31. package/dist/AllowLists/SimpleDenyList.cjs +2 -1
  32. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
  33. package/dist/AllowLists/SimpleDenyList.d.ts +234 -13
  34. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  35. package/dist/AllowLists/SimpleDenyList.js +12 -200
  36. package/dist/AllowLists/SimpleDenyList.js.map +1 -0
  37. package/dist/Auth/Auth.cjs +1 -0
  38. package/dist/Auth/Auth.cjs.map +1 -0
  39. package/dist/Auth/Auth.js +1 -0
  40. package/dist/Auth/Auth.js.map +1 -0
  41. package/dist/Auth/PassthroughAuth.cjs +2 -1
  42. package/dist/Auth/PassthroughAuth.cjs.map +1 -0
  43. package/dist/Auth/PassthroughAuth.js +5 -4
  44. package/dist/Auth/PassthroughAuth.js.map +1 -0
  45. package/dist/Boost.cjs +2 -1
  46. package/dist/Boost.cjs.map +1 -0
  47. package/dist/Boost.d.ts +105 -14
  48. package/dist/Boost.d.ts.map +1 -1
  49. package/dist/Boost.js +138 -5
  50. package/dist/Boost.js.map +1 -0
  51. package/dist/BoostCore-DolmDuXW.cjs +3 -0
  52. package/dist/BoostCore-DolmDuXW.cjs.map +1 -0
  53. package/dist/BoostCore-Z97KVu4V.js +1448 -0
  54. package/dist/BoostCore-Z97KVu4V.js.map +1 -0
  55. package/dist/BoostCore.cjs +2 -2
  56. package/dist/BoostCore.cjs.map +1 -0
  57. package/dist/BoostCore.d.ts +788 -79
  58. package/dist/BoostCore.d.ts.map +1 -1
  59. package/dist/BoostCore.js +30 -1103
  60. package/dist/BoostCore.js.map +1 -0
  61. package/dist/BoostRegistry.cjs +2 -1
  62. package/dist/BoostRegistry.cjs.map +1 -0
  63. package/dist/BoostRegistry.d.ts +95 -26
  64. package/dist/BoostRegistry.d.ts.map +1 -1
  65. package/dist/BoostRegistry.js +183 -89
  66. package/dist/BoostRegistry.js.map +1 -0
  67. package/dist/Budgets/Budget.cjs +2 -1
  68. package/dist/Budgets/Budget.cjs.map +1 -0
  69. package/dist/Budgets/Budget.d.ts +1 -1
  70. package/dist/Budgets/Budget.d.ts.map +1 -1
  71. package/dist/Budgets/Budget.js +15 -13
  72. package/dist/Budgets/Budget.js.map +1 -0
  73. package/dist/Budgets/ManagedBudget.cjs +2 -1
  74. package/dist/Budgets/ManagedBudget.cjs.map +1 -0
  75. package/dist/Budgets/ManagedBudget.d.ts +112 -192
  76. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  77. package/dist/Budgets/ManagedBudget.js +91 -291
  78. package/dist/Budgets/ManagedBudget.js.map +1 -0
  79. package/dist/Budgets/VestingBudget.d.ts +277 -91
  80. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  81. package/dist/Deployable/Contract.cjs +2 -1
  82. package/dist/Deployable/Contract.cjs.map +1 -0
  83. package/dist/Deployable/Contract.d.ts +4 -5
  84. package/dist/Deployable/Contract.d.ts.map +1 -1
  85. package/dist/Deployable/Contract.js +7 -8
  86. package/dist/Deployable/Contract.js.map +1 -0
  87. package/dist/Deployable/Deployable.cjs +1 -0
  88. package/dist/Deployable/Deployable.cjs.map +1 -0
  89. package/dist/Deployable/Deployable.d.ts +9 -3
  90. package/dist/Deployable/Deployable.d.ts.map +1 -1
  91. package/dist/Deployable/Deployable.js +10 -5
  92. package/dist/Deployable/Deployable.js.map +1 -0
  93. package/dist/Deployable/DeployableTarget.cjs +2 -1
  94. package/dist/Deployable/DeployableTarget.cjs.map +1 -0
  95. package/dist/Deployable/DeployableTarget.d.ts +16 -15
  96. package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
  97. package/dist/Deployable/DeployableTarget.js +49 -42
  98. package/dist/Deployable/DeployableTarget.js.map +1 -0
  99. package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
  100. package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
  101. package/dist/Deployable/DeployableTargetWithRBAC.d.ts +179 -0
  102. package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
  103. package/dist/Deployable/DeployableTargetWithRBAC.js +222 -0
  104. package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
  105. package/dist/EventAction-CBKzuNoN.cjs +2 -0
  106. package/dist/EventAction-CBKzuNoN.cjs.map +1 -0
  107. package/dist/EventAction-DWuuc_Qy.js +1528 -0
  108. package/dist/EventAction-DWuuc_Qy.js.map +1 -0
  109. package/dist/Incentive-BxzEtN26.js +298 -0
  110. package/dist/Incentive-BxzEtN26.js.map +1 -0
  111. package/dist/Incentive-CrF3-ayL.cjs +2 -0
  112. package/dist/Incentive-CrF3-ayL.cjs.map +1 -0
  113. package/dist/Incentives/AllowListIncentive.cjs +2 -1
  114. package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
  115. package/dist/Incentives/AllowListIncentive.d.ts +65 -21
  116. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  117. package/dist/Incentives/AllowListIncentive.js +52 -36
  118. package/dist/Incentives/AllowListIncentive.js.map +1 -0
  119. package/dist/Incentives/CGDAIncentive.cjs +2 -1
  120. package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
  121. package/dist/Incentives/CGDAIncentive.d.ts +315 -26
  122. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  123. package/dist/Incentives/CGDAIncentive.js +64 -39
  124. package/dist/Incentives/CGDAIncentive.js.map +1 -0
  125. package/dist/Incentives/ERC1155Incentive.d.ts +291 -43
  126. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  127. package/dist/Incentives/ERC20Incentive.cjs +2 -1
  128. package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
  129. package/dist/Incentives/ERC20Incentive.d.ts +270 -33
  130. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  131. package/dist/Incentives/ERC20Incentive.js +69 -46
  132. package/dist/Incentives/ERC20Incentive.js.map +1 -0
  133. package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +338 -421
  134. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
  135. package/dist/Incentives/ERC20VariableIncentive.d.ts +262 -32
  136. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  137. package/dist/Incentives/Incentive.cjs +2 -1
  138. package/dist/Incentives/Incentive.cjs.map +1 -0
  139. package/dist/Incentives/Incentive.d.ts +5 -8
  140. package/dist/Incentives/Incentive.d.ts.map +1 -1
  141. package/dist/Incentives/Incentive.js +17 -278
  142. package/dist/Incentives/Incentive.js.map +1 -0
  143. package/dist/Incentives/PointsIncentive.cjs +2 -1
  144. package/dist/Incentives/PointsIncentive.cjs.map +1 -0
  145. package/dist/Incentives/PointsIncentive.d.ts +81 -23
  146. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  147. package/dist/Incentives/PointsIncentive.js +57 -36
  148. package/dist/Incentives/PointsIncentive.js.map +1 -0
  149. package/dist/SimpleDenyList-BUR17Tt1.cjs +2 -0
  150. package/dist/SimpleDenyList-BUR17Tt1.cjs.map +1 -0
  151. package/dist/SimpleDenyList-CGaWjuld.js +132 -0
  152. package/dist/SimpleDenyList-CGaWjuld.js.map +1 -0
  153. package/dist/Validators/SignerValidator.cjs +2 -1
  154. package/dist/Validators/SignerValidator.cjs.map +1 -0
  155. package/dist/Validators/SignerValidator.d.ts +310 -17
  156. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  157. package/dist/Validators/SignerValidator.js +165 -36
  158. package/dist/Validators/SignerValidator.js.map +1 -0
  159. package/dist/Validators/Validator.cjs +2 -1
  160. package/dist/Validators/Validator.cjs.map +1 -0
  161. package/dist/Validators/Validator.d.ts +2 -2
  162. package/dist/Validators/Validator.d.ts.map +1 -1
  163. package/dist/Validators/Validator.js +10 -8
  164. package/dist/Validators/Validator.js.map +1 -0
  165. package/dist/claiming.cjs +2 -0
  166. package/dist/claiming.cjs.map +1 -0
  167. package/dist/claiming.d.ts +43 -0
  168. package/dist/claiming.d.ts.map +1 -0
  169. package/dist/claiming.js +17 -0
  170. package/dist/claiming.js.map +1 -0
  171. package/dist/componentInterfaces-BBCFkrZv.js +14 -0
  172. package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
  173. package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
  174. package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
  175. package/dist/deployments-DVXioW2i.cjs +2 -0
  176. package/dist/deployments-DVXioW2i.cjs.map +1 -0
  177. package/dist/deployments-oykLv3_Z.js +43 -0
  178. package/dist/deployments-oykLv3_Z.js.map +1 -0
  179. package/dist/deployments.json +44 -0
  180. package/dist/errors.cjs +2 -1
  181. package/dist/errors.cjs.map +1 -0
  182. package/dist/errors.d.ts +421 -1
  183. package/dist/errors.d.ts.map +1 -1
  184. package/dist/errors.js +297 -39
  185. package/dist/errors.js.map +1 -0
  186. package/dist/{generated-x_abr3Yv.js → generated-CKt2yCQd.js} +3143 -3002
  187. package/dist/generated-CKt2yCQd.js.map +1 -0
  188. package/dist/generated-CyTNlOwM.cjs +3 -0
  189. package/dist/generated-CyTNlOwM.cjs.map +1 -0
  190. package/dist/index.cjs +2 -1
  191. package/dist/index.cjs.map +1 -0
  192. package/dist/index.d.ts +10 -9
  193. package/dist/index.d.ts.map +1 -1
  194. package/dist/index.js +144 -1353
  195. package/dist/index.js.map +1 -0
  196. package/dist/transfers.cjs +2 -0
  197. package/dist/transfers.cjs.map +1 -0
  198. package/dist/transfers.d.ts +198 -0
  199. package/dist/transfers.d.ts.map +1 -0
  200. package/dist/transfers.js +84 -0
  201. package/dist/transfers.js.map +1 -0
  202. package/dist/utils.cjs +2 -1
  203. package/dist/utils.cjs.map +1 -0
  204. package/dist/utils.d.ts +26 -1350
  205. package/dist/utils.d.ts.map +1 -1
  206. package/dist/utils.js +38 -636
  207. package/dist/utils.js.map +1 -0
  208. package/package.json +37 -11
  209. package/src/Actions/Action.test.ts +79 -0
  210. package/src/Actions/Action.ts +61 -0
  211. package/src/Actions/ContractAction.test.ts +197 -0
  212. package/src/Actions/ContractAction.ts +300 -0
  213. package/src/Actions/ERC721MintAction.test.ts +112 -0
  214. package/src/Actions/ERC721MintAction.ts +291 -0
  215. package/src/Actions/EventAction.test.ts +787 -0
  216. package/src/Actions/EventAction.ts +1218 -0
  217. package/src/AllowLists/AllowList.test.ts +64 -0
  218. package/src/AllowLists/AllowList.ts +62 -0
  219. package/src/AllowLists/OpenAllowList.test.ts +40 -0
  220. package/src/AllowLists/OpenAllowList.ts +45 -0
  221. package/src/AllowLists/SimpleAllowList.test.ts +52 -0
  222. package/src/AllowLists/SimpleAllowList.ts +262 -0
  223. package/src/AllowLists/SimpleDenyList.test.ts +52 -0
  224. package/src/AllowLists/SimpleDenyList.ts +250 -0
  225. package/src/Auth/Auth.ts +11 -0
  226. package/src/Auth/PassthroughAuth.test.ts +12 -0
  227. package/src/Auth/PassthroughAuth.ts +80 -0
  228. package/src/Boost.ts +287 -0
  229. package/src/BoostCore.test.ts +894 -0
  230. package/src/BoostCore.ts +1438 -0
  231. package/src/BoostRegistry.test.ts +53 -0
  232. package/src/BoostRegistry.ts +588 -0
  233. package/src/Budgets/Budget.test.ts +27 -0
  234. package/src/Budgets/Budget.ts +60 -0
  235. package/src/Budgets/ManagedBudget.test.ts +217 -0
  236. package/src/Budgets/ManagedBudget.ts +534 -0
  237. package/src/Budgets/VestingBudget.test.ts +123 -0
  238. package/src/Budgets/VestingBudget.ts +530 -0
  239. package/src/Deployable/Contract.ts +228 -0
  240. package/src/Deployable/Deployable.ts +250 -0
  241. package/src/Deployable/DeployableTarget.ts +234 -0
  242. package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
  243. package/src/Incentives/AllowListIncentive.test.ts +143 -0
  244. package/src/Incentives/AllowListIncentive.ts +336 -0
  245. package/src/Incentives/CGDAIncentive.test.ts +135 -0
  246. package/src/Incentives/CGDAIncentive.ts +476 -0
  247. package/src/Incentives/ERC1155Incentive.test.ts +87 -0
  248. package/src/Incentives/ERC1155Incentive.ts +465 -0
  249. package/src/Incentives/ERC20Incentive.test.ts +133 -0
  250. package/src/Incentives/ERC20Incentive.ts +490 -0
  251. package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
  252. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +309 -0
  253. package/src/Incentives/ERC20VariableIncentive.test.ts +139 -0
  254. package/src/Incentives/ERC20VariableIncentive.ts +428 -0
  255. package/src/Incentives/Incentive.test.ts +95 -0
  256. package/src/Incentives/Incentive.ts +86 -0
  257. package/src/Incentives/PointsIncentive.test.ts +138 -0
  258. package/src/Incentives/PointsIncentive.ts +367 -0
  259. package/src/Validators/SignerValidator.test.ts +159 -0
  260. package/src/Validators/SignerValidator.ts +683 -0
  261. package/src/Validators/Validator.test.ts +21 -0
  262. package/src/Validators/Validator.ts +55 -0
  263. package/src/claiming.ts +56 -0
  264. package/src/errors.ts +866 -0
  265. package/src/index.test.ts +122 -0
  266. package/src/index.ts +58 -0
  267. package/src/transfers.ts +284 -0
  268. package/src/utils.test.ts +44 -0
  269. package/src/utils.ts +247 -0
  270. package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
  271. package/dist/generated-BaaleHW-.cjs +0 -2
package/dist/utils.js CHANGED
@@ -1,643 +1,45 @@
1
- import { waitForTransactionReceipt as M } from "@wagmi/core";
2
- import { slice as G, isHex as _, keccak256 as H, toHex as z, encodeAbiParameters as u, parseAbiParameters as b, zeroHash as k, zeroAddress as Q } from "viem";
3
- import { signTypedData as Z } from "viem/accounts";
4
- import { NoContractAddressUponReceiptError as j } from "./errors.js";
5
- var q = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, B = { exports: {} };
6
- (function(e, t) {
7
- (function(n, o) {
8
- e.exports = o(n, 1), t.LibZip = e.exports.LibZip, t.ERC1967Factory = e.exports.ERC1967Factory;
9
- })(typeof window < "u" ? window : q, function(n, o) {
10
- var y = {}, C = {};
11
- y.LibZip = C;
12
- function E(r) {
13
- if ((typeof r == "string" || r instanceof String) && (r = r.match(/^[\s\uFEFF\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\s\uFEFF\xA0]*$/))) {
14
- if (r[2].length % 2)
15
- throw new Error("Hex string length must be a multiple of 2.");
16
- return r[2];
17
- }
18
- throw new Error("Data must be a hex string.");
19
- }
20
- function h(r) {
21
- return (r | 256).toString(16).slice(1);
22
- }
23
- function w(r, i) {
24
- return parseInt(r.substr(i, 2), 16);
25
- }
26
- function x(r) {
27
- for (var i = [], a = 0; a < r.length; a += 2)
28
- i.push(w(r, a));
29
- return i;
30
- }
31
- function A(r) {
32
- for (var i = "0x", a = 0; a < r.length; i += h(r[a++]))
33
- ;
34
- return i;
35
- }
36
- C.flzCompress = function(r) {
37
- var i = x(E(r)), a = i.length - 4, d = [], s = [], c = 0, p = 2, l = 0, m, I, O, P, R, f, T, F, N, L;
38
- function v(g) {
39
- return i[g] | i[++g] << 8 | i[++g] << 16;
40
- }
41
- function S(g) {
42
- return 2654435769 * g >> 19 & 8191;
43
- }
44
- function V(g, U) {
45
- for (; g >= 32; )
46
- for (s[l++] = 31, m = 32; m--; g--)
47
- s[l++] = i[U++];
48
- if (g)
49
- for (s[l++] = g - 1; g--; )
50
- s[l++] = i[U++];
51
- }
52
- for (; p < a - 9; ) {
53
- do
54
- T = d[O = S(I = v(p))] || 0, R = (P = (d[O] = p) - T) < 8192 ? v(T) : 16777216;
55
- while (p < a - 9 && p++ && I != R);
56
- if (p >= a - 9)
57
- break;
58
- for (--p > c && V(p - c, c), f = 0, F = T + 3, N = p + 3, L = a - N; f < L; f++)
59
- L *= i[F + f] === i[N + f];
60
- for (p += f, --P; f > 262; f -= 262)
61
- s[l++] = 224 + (P >> 8), s[l++] = 253, s[l++] = P & 255;
62
- f < 7 ? (s[l++] = (f << 5) + (P >> 8), s[l++] = P & 255) : (s[l++] = 224 + (P >> 8), s[l++] = f - 7, s[l++] = P & 255), d[S(v(p))] = p++, d[S(v(p))] = p++, c = p;
63
- }
64
- return V(a + 4 - c, c), A(s);
65
- }, C.flzDecompress = function(r) {
66
- for (var i = x(E(r)), a = 0, d = 0, s, c, p, l, m = []; a < i.length; )
67
- if (p = i[a] >> 5)
68
- for (c = 256 * (i[a] & 31) + i[a + 2 - (p = p < 7)], s = p ? 2 + (i[a] >> 5) : 9 + i[a + 1], a = a + 3 - p, l = d - c - 1; s--; )
69
- m[d++] = m[l++];
70
- else
71
- for (s = 1 + i[a++]; s--; )
72
- m[d++] = i[a++];
73
- return A(m);
74
- }, C.cdCompress = function(r) {
75
- r = E(r);
76
- var i = "0x", a = 0, d = 0, s = 0, c;
77
- function p(m) {
78
- i += h((i.length < 4 * 2 + 2) * 255 ^ m);
79
- }
80
- function l(m, I) {
81
- p(0), p(I - 1 + m * 128);
82
- }
83
- for (; s < r.length; s += 2) {
84
- if (c = w(r, s), !c) {
85
- d && (l(1, d), d = 0), ++a === 128 && (l(0, 128), a = 0);
86
- continue;
87
- }
88
- if (c === 255) {
89
- a && (l(0, a), a = 0), ++d === 32 && (l(1, 32), d = 0);
90
- continue;
91
- }
92
- d && (l(1, d), d = 0), a && (l(0, a), a = 0), p(c);
93
- }
94
- return d && (l(1, d), d = 0), a && (l(0, a), a = 0), i;
95
- }, C.cdDecompress = function(r) {
96
- r = E(r);
97
- for (var i = "0x", a = 0, d, s, c; a < r.length; ) {
98
- if (s = (a < 4 * 2) * 255 ^ w(r, a), a += 2, !s) {
99
- for (s = (a < 4 * 2) * 255 ^ w(r, a), c = (s & 127) + 1, a += 2, d = 0; d < c; ++d)
100
- i += h((s >> 7 && d < 32) * 255);
101
- continue;
102
- }
103
- i += h(s);
104
- }
105
- return i;
106
- };
107
- var D = {};
108
- return y.ERC1967Factory = D, D.address = "0x0000000000006396FF2a80c067f99B3d2Ab4Df24", D.abi = JSON.parse('[{0:[],1:"DeploymentFailed"96"SaltDoesNotStartWithCaller"96"Unauthorized"96"UpgradeFailed",2:3959790,9791],1:"AdminChanged",2:10959790,9792,9791],1:"Deployed",2:10959790,9792],1:"Upgraded",2:10},{0:[{90],1:"adminOf",12:[{9199{0:[{90,{91],1:"changeAdmin",12:[],13:"nonpayable",2:15},{0:[{92,{91],1:"deploy",12:[{9098,{0:[{92,{91,{94],1:"deployAndCall",12:[{9098,{0:[{92,{91,{93],1:"deployDeterministic",12:[{9098,{0:[{92,{91,{93,{94],1:"deployDeterministicAndCall",12:[{9098,{0:[],1:"initCodeHash",12:[{6:19,1:"result",2:19}99{0:[{93],1:"predictDeterministicAddress",12:[{6:7,1:"predicted",2:7}99{0:[{90,{92],1:"upgrade",12:[98,{0:[{90,{92,{94],1:"upgradeAndCall",12:[98]'.replace(/9\d/g, function(r) {
109
- return ["6:7,1:8,2:7}", "6:7,1:9,2:7}", "6:7,1:11,2:7}", "6:19,1:20,2:19}", "6:17,1:18,2:17}", "},{4:false,0:[", ",2:3},{0:[],1:", "{5:true,", "],13:16,2:15}", "],13:14,2:15},"][r - 90];
110
- }).replace(/\d+/g, function(r) {
111
- return '"' + "inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt".split(",")[r] + '"';
112
- })), o || (n.solady = y), y;
113
- });
114
- })(B, B.exports);
115
- var W = B.exports;
116
- function ue(e) {
117
- return G(_(e) ? H(e) : H(z(e)), 0, 4);
118
- }
119
- async function le(e, t, n) {
120
- const o = await M(e, {
1
+ import { waitForTransactionReceipt as f, getAccount as A, getClient as u } from "@wagmi/core";
2
+ import { slice as e, isHex as w, keccak256 as i, toHex as m } from "viem";
3
+ import { NoContractAddressUponReceiptError as I, InvalidProtocolChainIdError as s } from "./errors.js";
4
+ var N = /* @__PURE__ */ ((o) => (o[o.ACTION = 0] = "ACTION", o[o.ALLOW_LIST = 1] = "ALLOW_LIST", o[o.BUDGET = 2] = "BUDGET", o[o.INCENTIVE = 3] = "INCENTIVE", o[o.VALIDATOR = 4] = "VALIDATOR", o))(N || {});
5
+ function L(o) {
6
+ return e(w(o) ? i(o) : i(m(o)), 0, 4);
7
+ }
8
+ async function l(o, c, n) {
9
+ const t = await f(o, {
121
10
  ...n,
122
- hash: await t
11
+ hash: await c
123
12
  });
124
- if (!o.contractAddress)
125
- throw new j(o);
126
- return o.contractAddress;
13
+ if (!t.contractAddress)
14
+ throw new I(t);
15
+ return t.contractAddress;
127
16
  }
128
- async function ye(e, t, n) {
129
- const { hash: o, result: y } = await t;
130
- return await M(e, {
17
+ async function v(o, c, n) {
18
+ const { hash: t, result: a } = await c;
19
+ return await f(o, {
131
20
  ...n,
132
- hash: o
133
- }), y;
134
- }
135
- var Y = /* @__PURE__ */ ((e) => (e[e.ACTION = 0] = "ACTION", e[e.ALLOW_LIST = 1] = "ALLOW_LIST", e[e.BUDGET = 2] = "BUDGET", e[e.INCENTIVE = 3] = "INCENTIVE", e[e.VALIDATOR = 4] = "VALIDATOR", e))(Y || {}), J = /* @__PURE__ */ ((e) => (e[e.POOL = 0] = "POOL", e[e.MINT = 1] = "MINT", e[e.RAFFLE = 2] = "RAFFLE", e))(J || {}), K = /* @__PURE__ */ ((e) => (e[e.POOL = 0] = "POOL", e[e.MINT = 1] = "MINT", e))(K || {}), X = /* @__PURE__ */ ((e) => (e[e.EQUAL = 0] = "EQUAL", e[e.NOT_EQUAL = 1] = "NOT_EQUAL", e[e.GREATER_THAN = 2] = "GREATER_THAN", e[e.LESS_THAN = 3] = "LESS_THAN", e[e.CONTAINS = 4] = "CONTAINS", e))(X || {}), $ = /* @__PURE__ */ ((e) => (e[e.UINT = 0] = "UINT", e[e.ADDRESS = 1] = "ADDRESS", e[e.BYTES = 2] = "BYTES", e[e.STRING = 3] = "STRING", e))($ || {}), ee = /* @__PURE__ */ ((e) => (e[e.EVENT = 0] = "EVENT", e[e.FUNC = 1] = "FUNC", e))(ee || {});
136
- const ce = ({
137
- actionClaimant: e,
138
- actionStepOne: t,
139
- actionStepTwo: n,
140
- actionStepThree: o,
141
- actionStepFour: y
142
- }) => u(
143
- [
144
- {
145
- type: "tuple",
146
- name: "initPayload",
147
- components: [
148
- {
149
- type: "tuple",
150
- name: "actionClaimant",
151
- components: [
152
- { type: "uint8", name: "signatureType" },
153
- { type: "bytes4", name: "signature" },
154
- { type: "uint8", name: "fieldIndex" },
155
- { type: "address", name: "targetContract" }
156
- ]
157
- },
158
- {
159
- type: "tuple",
160
- name: "actionStepOne",
161
- components: [
162
- { type: "bytes4", name: "signature" },
163
- { type: "uint8", name: "signatureType" },
164
- { type: "uint8", name: "actionType" },
165
- { type: "address", name: "targetContract" },
166
- {
167
- type: "tuple",
168
- name: "actionParameter",
169
- components: [
170
- { type: "uint8", name: "filterType" },
171
- { type: "uint8", name: "fieldType" },
172
- { type: "uint8", name: "fieldIndex" },
173
- { type: "bytes", name: "filterData" }
174
- ]
175
- }
176
- ]
177
- },
178
- {
179
- type: "tuple",
180
- name: "actionStepTwo",
181
- components: [
182
- { type: "bytes4", name: "signature" },
183
- { type: "uint8", name: "signatureType" },
184
- { type: "uint8", name: "actionType" },
185
- { type: "address", name: "targetContract" },
186
- {
187
- type: "tuple",
188
- name: "actionParameter",
189
- components: [
190
- { type: "uint8", name: "filterType" },
191
- { type: "uint8", name: "fieldType" },
192
- { type: "uint8", name: "fieldIndex" },
193
- { type: "bytes", name: "filterData" }
194
- ]
195
- }
196
- ]
197
- },
198
- {
199
- type: "tuple",
200
- name: "actionStepThree",
201
- components: [
202
- { type: "bytes4", name: "signature" },
203
- { type: "uint8", name: "signatureType" },
204
- { type: "uint8", name: "actionType" },
205
- { type: "address", name: "targetContract" },
206
- {
207
- type: "tuple",
208
- name: "actionParameter",
209
- components: [
210
- { type: "uint8", name: "filterType" },
211
- { type: "uint8", name: "fieldType" },
212
- { type: "uint8", name: "fieldIndex" },
213
- { type: "bytes", name: "filterData" }
214
- ]
215
- }
216
- ]
217
- },
218
- {
219
- type: "tuple",
220
- name: "actionStepFour",
221
- components: [
222
- { type: "bytes4", name: "signature" },
223
- { type: "uint8", name: "signatureType" },
224
- { type: "uint8", name: "actionType" },
225
- { type: "address", name: "targetContract" },
226
- {
227
- type: "tuple",
228
- name: "actionParameter",
229
- components: [
230
- { type: "uint8", name: "filterType" },
231
- { type: "uint8", name: "fieldType" },
232
- { type: "uint8", name: "fieldIndex" },
233
- { type: "bytes", name: "filterData" }
234
- ]
235
- }
236
- ]
237
- }
238
- ]
239
- }
240
- ],
241
- [
242
- {
243
- actionClaimant: e,
244
- actionStepOne: t,
245
- actionStepTwo: n,
246
- actionStepThree: o,
247
- actionStepFour: y
248
- }
249
- ]
250
- ), me = ({
251
- signers: e,
252
- validatorCaller: t
253
- }) => u(
254
- [
255
- { type: "address[]", name: "signers" },
256
- { type: "address", name: "validatorCaller" }
257
- ],
258
- [e, t]
259
- ), fe = ({
260
- validatorData: e,
261
- incentiveData: t
262
- }) => u(
263
- [
264
- { type: "bytes", name: "validatorData" },
265
- { type: "bytes", name: "incentiveData" }
266
- ],
267
- [e, t]
268
- ), te = ({
269
- signer: e,
270
- signature: t,
271
- incentiveQuantity: n
272
- }) => u(
273
- [
274
- {
275
- type: "tuple",
276
- name: "SignerValidatorInputParams",
277
- components: [
278
- { type: "address", name: "signer" },
279
- { type: "bytes", name: "signature" },
280
- { type: "uint8", name: "incentiveQuantity" }
281
- ]
282
- }
283
- ],
284
- [{ signer: e, signature: t, incentiveQuantity: n }]
285
- );
286
- async function ge({
287
- signer: e,
288
- incentiveData: t,
289
- chainId: n,
290
- validator: o,
291
- incentiveQuantity: y,
292
- claimant: C,
293
- boostId: E
294
- }) {
295
- const x = await Z({
296
- ...{
297
- domain: {
298
- name: "SignerValidator",
299
- version: "1",
300
- chainId: n,
301
- verifyingContract: o
302
- },
303
- types: {
304
- SignerValidatorData: [
305
- { name: "boostId", type: "uint256" },
306
- { name: "incentiveQuantity", type: "uint8" },
307
- { name: "claimant", type: "address" },
308
- { name: "incentiveData", type: "bytes" }
309
- ]
310
- },
311
- primaryType: "SignerValidatorData",
312
- message: {
313
- boostId: E,
314
- incentiveQuantity: y,
315
- claimant: C,
316
- incentiveData: t
317
- }
318
- },
319
- privateKey: e.key
320
- }), A = te({
321
- signer: e.account,
322
- signature: x,
323
- incentiveQuantity: y
324
- // Adjust incentive quantity as necessary
325
- });
326
- return u(
327
- [
328
- {
329
- type: "tuple",
330
- name: "BoostClaimData",
331
- components: [
332
- { type: "bytes", name: "validatorData" },
333
- { type: "bytes", name: "incentiveData" }
334
- ]
335
- }
336
- ],
337
- [{ validatorData: A, incentiveData: t }]
338
- );
339
- }
340
- const be = ({
341
- owner: e,
342
- allowed: t
343
- }) => u(
344
- [
345
- { type: "address", name: "owner" },
346
- { type: "address[]", name: "allowed" }
347
- ],
348
- [e, t]
349
- ), Ce = ({
350
- owner: e,
351
- denied: t
352
- }) => u(
353
- [
354
- { type: "address", name: "owner" },
355
- { type: "address[]", name: "denied" }
356
- ],
357
- [e, t]
358
- );
359
- function Ee({
360
- budget: e,
361
- action: t,
362
- validator: n,
363
- allowList: o,
364
- incentives: y,
365
- protocolFee: C = 0n,
366
- referralFee: E = 0n,
367
- maxParticipants: h = 0n,
368
- owner: w
369
- }) {
370
- return W.LibZip.cdCompress(
371
- u(
372
- b([
373
- "BoostPayload payload",
374
- "struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint64 referralFee; uint256 maxParticipants; address owner; }",
375
- "struct Target { bool isBase; address instance; bytes parameters; }"
376
- ]),
377
- [
378
- {
379
- budget: e,
380
- action: t,
381
- validator: n,
382
- allowList: o,
383
- incentives: y,
384
- protocolFee: C,
385
- referralFee: E,
386
- maxParticipants: h,
387
- owner: w
388
- }
389
- ]
390
- )
391
- );
392
- }
393
- function ae({ tokenId: e, amount: t }) {
394
- return u(
395
- b([
396
- "ERC1155Payload payload",
397
- "struct ERC1155Payload { uint256 tokenId; uint256 amount; bytes data; }"
398
- ]),
399
- [{ tokenId: e, amount: t, data: "0x" }]
400
- );
401
- }
402
- const Pe = ({
403
- venue: e,
404
- selector: t,
405
- reward: n,
406
- limit: o
407
- }) => u(
408
- [
409
- { type: "address", name: "venue" },
410
- { type: "bytes4", name: "selector" },
411
- { type: "uint256", name: "reward" },
412
- { type: "uint256", name: "limit" }
413
- ],
414
- [e, t, n, o]
415
- ), he = ({
416
- asset: e,
417
- initialReward: t,
418
- rewardDecay: n,
419
- rewardBoost: o,
420
- totalBudget: y
421
- }) => u(
422
- [
423
- { type: "address", name: "asset" },
424
- { type: "uint256", name: "initialReward" },
425
- { type: "uint256", name: "rewardDecay" },
426
- { type: "uint256", name: "rewardBoost" },
427
- { type: "uint256", name: "totalBudget" }
428
- ],
429
- [e, t, n, o, y]
430
- ), we = ({
431
- asset: e,
432
- strategy: t,
433
- tokenId: n,
434
- limit: o,
435
- extraData: y
436
- }) => u(
437
- b([
438
- "InitPayload payload",
439
- "struct InitPayload { address asset; uint8 strategy; uint256 tokenId; uint256 limit; bytes extraData; }"
440
- ]),
441
- [{ asset: e, strategy: t, tokenId: n, limit: o, extraData: y }]
442
- ), xe = ({
443
- allowList: e,
444
- limit: t
445
- }) => u(
446
- [
447
- { type: "address", name: "allowList" },
448
- { type: "uint256", name: "limit" }
449
- ],
450
- [e, t]
451
- ), Ae = ({
452
- asset: e,
453
- strategy: t,
454
- reward: n,
455
- limit: o
456
- }) => u(
457
- [
458
- { type: "address", name: "asset" },
459
- { type: "uint8", name: "strategy" },
460
- { type: "uint256", name: "reward" },
461
- { type: "uint256", name: "limit" }
462
- ],
463
- [e, t, n, o]
464
- ), De = ({
465
- asset: e,
466
- reward: t,
467
- limit: n
468
- }) => u(
469
- [
470
- { type: "address", name: "asset" },
471
- { type: "uint256", name: "reward" },
472
- { type: "uint256", name: "limit" }
473
- ],
474
- [e, t, n]
475
- ), Ie = ({
476
- owner: e,
477
- authorized: t
478
- }) => u(
479
- b([
480
- "SimpleBudgetPayload payload",
481
- "struct SimpleBudgetPayload { address owner; address[] authorized; }"
482
- ]),
483
- [{ owner: e, authorized: t }]
484
- ), Te = ({
485
- owner: e,
486
- authorized: t,
487
- roles: n
488
- }) => u(
489
- b([
490
- "ManagedBudgetPayload payload",
491
- "struct ManagedBudgetPayload { address owner; address[] authorized; uint256[] roles; }"
492
- ]),
493
- [{ owner: e, authorized: t, roles: n }]
494
- ), ve = ({
495
- owner: e,
496
- authorized: t,
497
- start: n,
498
- duration: o,
499
- cliff: y
500
- }) => u(
501
- b([
502
- "VestingBudgetPayload payload",
503
- "struct VestingBudgetPayload { address owner; address[] authorized; uint64 start; uint64 duration; uint64 cliff; }"
504
- ]),
505
- [{ owner: e, authorized: t, start: n, duration: o, cliff: y }]
506
- ), ne = ({
507
- chainId: e,
508
- target: t,
509
- selector: n,
510
- value: o
511
- }) => u(
512
- b([
513
- "ContractActionPayload payload",
514
- "struct ContractActionPayload { uint256 chainId; address target; bytes4 selector; uint256 value; }"
515
- ]),
516
- [{ chainId: e, target: t, selector: n, value: o }]
517
- ), Ne = ({
518
- chainId: e,
519
- target: t,
520
- selector: n,
521
- value: o
522
- }) => ne({ chainId: e, target: t, selector: n, value: o }), Le = ({
523
- target: e,
524
- data: t = k
525
- }) => u(
526
- [
527
- { type: "address", name: "target" },
528
- { type: "bytes", name: "data" }
529
- ],
530
- [e, t]
531
- );
532
- var re = /* @__PURE__ */ ((e) => (e[e.ETH = 0] = "ETH", e[e.ERC20 = 1] = "ERC20", e[e.ERC1155 = 2] = "ERC1155", e))(re || {});
533
- const Se = ({
534
- assetType: e,
535
- address: t,
536
- target: n,
537
- data: o
538
- }) => u(
539
- [
540
- { type: "uint8", name: "assetType" },
541
- { type: "address", name: "asset" },
542
- { type: "address", name: "target" },
543
- { type: "bytes", name: "data" }
544
- ],
545
- [e, t, n, o]
546
- );
547
- function Be({
548
- tokenId: e,
549
- amount: t,
550
- asset: n,
551
- target: o
552
- }) {
553
- return u(
554
- b([
555
- "Transfer request",
556
- "struct Transfer { uint8 assetType; address asset; address target; bytes data; }"
557
- ]),
558
- [
559
- {
560
- assetType: 2,
561
- asset: n,
562
- data: ae({ tokenId: e, amount: t }),
563
- target: o
564
- }
565
- ]
566
- );
567
- }
568
- function oe({ amount: e }) {
569
- return u(
570
- b([
571
- "FungiblePayload payload",
572
- "struct FungiblePayload { uint256 amount; }"
573
- ]),
574
- [{ amount: e }]
575
- );
576
- }
577
- function Oe({
578
- amount: e,
579
- asset: t,
580
- target: n
581
- }) {
582
- return u(
583
- b([
584
- "Transfer request",
585
- "struct Transfer { uint8 assetType; address asset; address target; bytes data; }"
586
- ]),
587
- [
588
- {
589
- assetType: t == Q ? 0 : 1,
590
- asset: t,
591
- data: oe({ amount: e }),
592
- target: n
593
- }
594
- ]
595
- );
596
- }
597
- function Re(e, t) {
598
- return u(
599
- [
600
- { type: "address", name: "holder" },
601
- { type: "bytes", name: "payload" }
602
- ],
603
- [e, z(t)]
604
- );
21
+ hash: t
22
+ }), a;
23
+ }
24
+ function O(o, c, n) {
25
+ let t;
26
+ const a = A(o);
27
+ if (n !== void 0 ? c[n] && (t = n) : a.chainId !== void 0 && c[a.chainId] && (t = a.chainId), t === void 0) {
28
+ const r = u(o);
29
+ r != null && r.chain.id && c[r == null ? void 0 : r.chain.id] && (t = r.chain.id);
30
+ }
31
+ if (t === void 0 && (t = 11155111), !c[t])
32
+ throw new s(
33
+ t,
34
+ Object.keys(c).map(Number)
35
+ );
36
+ return { chainId: t, address: c[t] };
605
37
  }
606
38
  export {
607
- re as AssetType,
608
- K as ERC1155StrategyType,
609
- X as FilterType,
610
- $ as PrimitiveType,
611
- Y as RegistryType,
612
- ee as SignatureType,
613
- J as StrategyType,
614
- ye as awaitResult,
615
- ue as bytes4,
616
- le as getDeployedContractAddress,
617
- xe as prepareAllowListIncentivePayload,
618
- fe as prepareBoostClaimData,
619
- Ee as prepareBoostPayload,
620
- he as prepareCGDAIncentivePayload,
621
- Le as prepareClaimPayload,
622
- ne as prepareContractActionPayload,
623
- we as prepareERC1155IncentivePayload,
624
- ae as prepareERC1155Payload,
625
- Be as prepareERC1155Transfer,
626
- Ae as prepareERC20IncentivePayload,
627
- De as prepareERC20VariableIncentivePayload,
628
- Ne as prepareERC721MintActionPayload,
629
- Re as prepareERC721MintActionValidate,
630
- ce as prepareEventActionPayload,
631
- oe as prepareFungiblePayload,
632
- Oe as prepareFungibleTransfer,
633
- Te as prepareManagedBudgetPayload,
634
- Pe as preparePointsIncentivePayload,
635
- ge as prepareSignerValidatorClaimDataPayload,
636
- te as prepareSignerValidatorInputParams,
637
- me as prepareSignerValidatorPayload,
638
- be as prepareSimpleAllowListPayload,
639
- Ie as prepareSimpleBudgetPayload,
640
- Ce as prepareSimpleDenyListPayload,
641
- Se as prepareTransferPayload,
642
- ve as prepareVestingBudgetPayload
39
+ N as RegistryType,
40
+ O as assertValidAddressByChainId,
41
+ v as awaitResult,
42
+ L as bytes4,
43
+ l as getDeployedContractAddress
643
44
  };
45
+ //# sourceMappingURL=utils.js.map