@boostxyz/sdk 0.0.0-alpha.8 → 0.0.0-alpha.9

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