@boostxyz/sdk 0.0.0-alpha.10
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.
- package/LICENSE +674 -0
- package/README.md +7 -0
- package/dist/Actions/Action.cjs +2 -0
- package/dist/Actions/Action.cjs.map +1 -0
- package/dist/Actions/Action.d.ts +31 -0
- package/dist/Actions/Action.d.ts.map +1 -0
- package/dist/Actions/Action.js +29 -0
- package/dist/Actions/Action.js.map +1 -0
- package/dist/Actions/ContractAction.d.ts +370 -0
- package/dist/Actions/ContractAction.d.ts.map +1 -0
- package/dist/Actions/ERC721MintAction.d.ts +513 -0
- package/dist/Actions/ERC721MintAction.d.ts.map +1 -0
- package/dist/Actions/EventAction.cjs +2 -0
- package/dist/Actions/EventAction.cjs.map +1 -0
- package/dist/Actions/EventAction.d.ts +694 -0
- package/dist/Actions/EventAction.d.ts.map +1 -0
- package/dist/Actions/EventAction.js +491 -0
- package/dist/Actions/EventAction.js.map +1 -0
- package/dist/AllowLists/AllowList.cjs +2 -0
- package/dist/AllowLists/AllowList.cjs.map +1 -0
- package/dist/AllowLists/AllowList.d.ts +32 -0
- package/dist/AllowLists/AllowList.d.ts.map +1 -0
- package/dist/AllowLists/AllowList.js +30 -0
- package/dist/AllowLists/AllowList.js.map +1 -0
- package/dist/AllowLists/SimpleAllowList.cjs +2 -0
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
- package/dist/AllowLists/SimpleAllowList.d.ts +481 -0
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleAllowList.js +154 -0
- package/dist/AllowLists/SimpleAllowList.js.map +1 -0
- package/dist/AllowLists/SimpleDenyList.cjs +2 -0
- package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
- package/dist/AllowLists/SimpleDenyList.d.ts +335 -0
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleDenyList.js +115 -0
- package/dist/AllowLists/SimpleDenyList.js.map +1 -0
- package/dist/Auth/Auth.cjs +2 -0
- package/dist/Auth/Auth.cjs.map +1 -0
- package/dist/Auth/Auth.d.ts +10 -0
- package/dist/Auth/Auth.d.ts.map +1 -0
- package/dist/Auth/Auth.js +5 -0
- package/dist/Auth/Auth.js.map +1 -0
- package/dist/Auth/PassthroughAuth.cjs +2 -0
- package/dist/Auth/PassthroughAuth.cjs.map +1 -0
- package/dist/Auth/PassthroughAuth.d.ts +51 -0
- package/dist/Auth/PassthroughAuth.d.ts.map +1 -0
- package/dist/Auth/PassthroughAuth.js +39 -0
- package/dist/Auth/PassthroughAuth.js.map +1 -0
- package/dist/Boost.cjs +2 -0
- package/dist/Boost.cjs.map +1 -0
- package/dist/Boost.d.ts +234 -0
- package/dist/Boost.d.ts.map +1 -0
- package/dist/Boost.js +162 -0
- package/dist/Boost.js.map +1 -0
- package/dist/BoostCore.cjs +3 -0
- package/dist/BoostCore.cjs.map +1 -0
- package/dist/BoostCore.d.ts +498 -0
- package/dist/BoostCore.d.ts.map +1 -0
- package/dist/BoostCore.js +1153 -0
- package/dist/BoostCore.js.map +1 -0
- package/dist/BoostRegistry.cjs +2 -0
- package/dist/BoostRegistry.cjs.map +1 -0
- package/dist/BoostRegistry.d.ts +243 -0
- package/dist/BoostRegistry.d.ts.map +1 -0
- package/dist/BoostRegistry.js +262 -0
- package/dist/BoostRegistry.js.map +1 -0
- package/dist/Budgets/Budget.cjs +2 -0
- package/dist/Budgets/Budget.cjs.map +1 -0
- package/dist/Budgets/Budget.d.ts +31 -0
- package/dist/Budgets/Budget.d.ts.map +1 -0
- package/dist/Budgets/Budget.js +29 -0
- package/dist/Budgets/Budget.js.map +1 -0
- package/dist/Budgets/ManagedBudget.cjs +2 -0
- package/dist/Budgets/ManagedBudget.cjs.map +1 -0
- package/dist/Budgets/ManagedBudget.d.ts +1103 -0
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -0
- package/dist/Budgets/ManagedBudget.js +516 -0
- package/dist/Budgets/ManagedBudget.js.map +1 -0
- package/dist/Budgets/SimpleBudget.d.ts +824 -0
- package/dist/Budgets/SimpleBudget.d.ts.map +1 -0
- package/dist/Budgets/VestingBudget.d.ts +778 -0
- package/dist/Budgets/VestingBudget.d.ts.map +1 -0
- package/dist/Deployable/Contract.cjs +2 -0
- package/dist/Deployable/Contract.cjs.map +1 -0
- package/dist/Deployable/Contract.d.ts +125 -0
- package/dist/Deployable/Contract.d.ts.map +1 -0
- package/dist/Deployable/Contract.js +150 -0
- package/dist/Deployable/Contract.js.map +1 -0
- package/dist/Deployable/Deployable.cjs +2 -0
- package/dist/Deployable/Deployable.cjs.map +1 -0
- package/dist/Deployable/Deployable.d.ts +161 -0
- package/dist/Deployable/Deployable.d.ts.map +1 -0
- package/dist/Deployable/Deployable.js +131 -0
- package/dist/Deployable/Deployable.js.map +1 -0
- package/dist/Deployable/DeployableTarget.cjs +2 -0
- package/dist/Deployable/DeployableTarget.cjs.map +1 -0
- package/dist/Deployable/DeployableTarget.d.ts +116 -0
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -0
- package/dist/Deployable/DeployableTarget.js +132 -0
- package/dist/Deployable/DeployableTarget.js.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +2 -0
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.d.ts +513 -0
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -0
- package/dist/Incentives/AllowListIncentive.js +201 -0
- package/dist/Incentives/AllowListIncentive.js.map +1 -0
- package/dist/Incentives/CGDAIncentive.cjs +2 -0
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
- package/dist/Incentives/CGDAIncentive.d.ts +644 -0
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -0
- package/dist/Incentives/CGDAIncentive.js +271 -0
- package/dist/Incentives/CGDAIncentive.js.map +1 -0
- package/dist/Incentives/ERC1155Incentive.d.ts +713 -0
- package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20Incentive.cjs +2 -0
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
- package/dist/Incentives/ERC20Incentive.d.ts +666 -0
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20Incentive.js +312 -0
- package/dist/Incentives/ERC20Incentive.js.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +582 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -0
- package/dist/Incentives/Incentive.cjs +2 -0
- package/dist/Incentives/Incentive.cjs.map +1 -0
- package/dist/Incentives/Incentive.d.ts +36 -0
- package/dist/Incentives/Incentive.d.ts.map +1 -0
- package/dist/Incentives/Incentive.js +299 -0
- package/dist/Incentives/Incentive.js.map +1 -0
- package/dist/Incentives/PointsIncentive.cjs +2 -0
- package/dist/Incentives/PointsIncentive.cjs.map +1 -0
- package/dist/Incentives/PointsIncentive.d.ts +659 -0
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -0
- package/dist/Incentives/PointsIncentive.js +215 -0
- package/dist/Incentives/PointsIncentive.js.map +1 -0
- package/dist/Validators/SignerValidator.cjs +2 -0
- package/dist/Validators/SignerValidator.cjs.map +1 -0
- package/dist/Validators/SignerValidator.d.ts +745 -0
- package/dist/Validators/SignerValidator.d.ts.map +1 -0
- package/dist/Validators/SignerValidator.js +293 -0
- package/dist/Validators/SignerValidator.js.map +1 -0
- package/dist/Validators/Validator.cjs +2 -0
- package/dist/Validators/Validator.cjs.map +1 -0
- package/dist/Validators/Validator.d.ts +31 -0
- package/dist/Validators/Validator.d.ts.map +1 -0
- package/dist/Validators/Validator.js +27 -0
- package/dist/Validators/Validator.js.map +1 -0
- package/dist/claiming.cjs +2 -0
- package/dist/claiming.cjs.map +1 -0
- package/dist/claiming.d.ts +43 -0
- package/dist/claiming.d.ts.map +1 -0
- package/dist/claiming.js +17 -0
- package/dist/claiming.js.map +1 -0
- package/dist/componentInterfaces-CKCBwG16.cjs +2 -0
- package/dist/componentInterfaces-CKCBwG16.cjs.map +1 -0
- package/dist/componentInterfaces-DYkaxBda.js +13 -0
- package/dist/componentInterfaces-DYkaxBda.js.map +1 -0
- package/dist/errors.cjs +2 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.ts +441 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +262 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated-BDeDiaCK.js +4625 -0
- package/dist/generated-BDeDiaCK.js.map +1 -0
- package/dist/generated-wKBNvm48.cjs +3 -0
- package/dist/generated-wKBNvm48.cjs.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +113 -0
- package/dist/index.js.map +1 -0
- package/dist/transfers.cjs +2 -0
- package/dist/transfers.cjs.map +1 -0
- package/dist/transfers.d.ts +198 -0
- package/dist/transfers.d.ts.map +1 -0
- package/dist/transfers.js +84 -0
- package/dist/transfers.js.map +1 -0
- package/dist/utils.cjs +2 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.ts +116 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +30 -0
- package/dist/utils.js.map +1 -0
- package/package.json +211 -0
- package/src/Actions/Action.test.ts +75 -0
- package/src/Actions/Action.ts +61 -0
- package/src/Actions/ContractAction.test.ts +197 -0
- package/src/Actions/ContractAction.ts +301 -0
- package/src/Actions/ERC721MintAction.test.ts +112 -0
- package/src/Actions/ERC721MintAction.ts +292 -0
- package/src/Actions/EventAction.test.ts +205 -0
- package/src/Actions/EventAction.ts +811 -0
- package/src/AllowLists/AllowList.test.ts +64 -0
- package/src/AllowLists/AllowList.ts +60 -0
- package/src/AllowLists/SimpleAllowList.test.ts +52 -0
- package/src/AllowLists/SimpleAllowList.ts +284 -0
- package/src/AllowLists/SimpleDenyList.test.ts +52 -0
- package/src/AllowLists/SimpleDenyList.ts +227 -0
- package/src/Auth/Auth.ts +11 -0
- package/src/Auth/PassthroughAuth.test.ts +12 -0
- package/src/Auth/PassthroughAuth.ts +80 -0
- package/src/Boost.ts +290 -0
- package/src/BoostCore.test.ts +773 -0
- package/src/BoostCore.ts +1261 -0
- package/src/BoostRegistry.ts +467 -0
- package/src/Budgets/Budget.test.ts +27 -0
- package/src/Budgets/Budget.ts +61 -0
- package/src/Budgets/ManagedBudget.test.ts +154 -0
- package/src/Budgets/ManagedBudget.ts +796 -0
- package/src/Budgets/SimpleBudget.test.ts +152 -0
- package/src/Budgets/SimpleBudget.ts +564 -0
- package/src/Budgets/VestingBudget.test.ts +123 -0
- package/src/Budgets/VestingBudget.ts +602 -0
- package/src/Deployable/Contract.ts +229 -0
- package/src/Deployable/Deployable.ts +250 -0
- package/src/Deployable/DeployableTarget.ts +223 -0
- package/src/Incentives/AllowListIncentive.test.ts +143 -0
- package/src/Incentives/AllowListIncentive.ts +334 -0
- package/src/Incentives/CGDAIncentive.test.ts +132 -0
- package/src/Incentives/CGDAIncentive.ts +468 -0
- package/src/Incentives/ERC1155Incentive.test.ts +87 -0
- package/src/Incentives/ERC1155Incentive.ts +466 -0
- package/src/Incentives/ERC20Incentive.test.ts +130 -0
- package/src/Incentives/ERC20Incentive.ts +482 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +136 -0
- package/src/Incentives/ERC20VariableIncentive.ts +420 -0
- package/src/Incentives/Incentive.test.ts +92 -0
- package/src/Incentives/Incentive.ts +85 -0
- package/src/Incentives/PointsIncentive.test.ts +139 -0
- package/src/Incentives/PointsIncentive.ts +365 -0
- package/src/Validators/SignerValidator.test.ts +159 -0
- package/src/Validators/SignerValidator.ts +681 -0
- package/src/Validators/Validator.test.ts +21 -0
- package/src/Validators/Validator.ts +55 -0
- package/src/claiming.ts +56 -0
- package/src/errors.ts +542 -0
- package/src/index.test.ts +40 -0
- package/src/index.ts +53 -0
- package/src/transfers.ts +284 -0
- package/src/utils.test.ts +44 -0
- package/src/utils.ts +198 -0
package/dist/errors.js
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { zeroHash as a } from "viem";
|
|
2
|
+
class c extends Error {
|
|
3
|
+
/**
|
|
4
|
+
* Creates an instance of BoostCoreNoIdentifierEmitted.
|
|
5
|
+
*
|
|
6
|
+
* @constructor
|
|
7
|
+
*/
|
|
8
|
+
constructor() {
|
|
9
|
+
super('No "BoostCreated" log was emitted from which to extract boostId');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
class d extends Error {
|
|
13
|
+
/**
|
|
14
|
+
* Creates an instance of ContractAddressRequiredError.
|
|
15
|
+
*
|
|
16
|
+
* @constructor
|
|
17
|
+
*/
|
|
18
|
+
constructor() {
|
|
19
|
+
super("Attempted to call contract method without providing an address");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class l extends Error {
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of DeployableAlreadyDeployedError.
|
|
25
|
+
*
|
|
26
|
+
* @constructor
|
|
27
|
+
* @param {string} address
|
|
28
|
+
*/
|
|
29
|
+
constructor(r) {
|
|
30
|
+
super(
|
|
31
|
+
"Attempted to deploy a contract that already has an address configured"
|
|
32
|
+
), this.address = r;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
class u extends Error {
|
|
36
|
+
/**
|
|
37
|
+
* Creates an instance of DeployableBuildParametersUnspecifiedError.
|
|
38
|
+
*
|
|
39
|
+
* @constructor
|
|
40
|
+
*/
|
|
41
|
+
constructor() {
|
|
42
|
+
super(
|
|
43
|
+
"Implementing class did not properly override the `buildParameters` method"
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
class p extends Error {
|
|
48
|
+
/**
|
|
49
|
+
* Creates an instance of DeployableUnknownOwnerProvidedError.
|
|
50
|
+
*
|
|
51
|
+
* @constructor
|
|
52
|
+
*/
|
|
53
|
+
constructor() {
|
|
54
|
+
super(
|
|
55
|
+
"Expected an an owner to be provided in configuration or an account to exist on Wagmi config."
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
class E extends Error {
|
|
60
|
+
/**
|
|
61
|
+
* Creates an instance of DeployableWagmiConfigurationRequiredError.
|
|
62
|
+
*
|
|
63
|
+
* @constructor
|
|
64
|
+
*/
|
|
65
|
+
constructor() {
|
|
66
|
+
super(
|
|
67
|
+
"Expected a valid Wagmi configuration to be available either on Deployable, or as argument to deploy."
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
class x extends Error {
|
|
72
|
+
/**
|
|
73
|
+
* Creates an instance of DeployableMissingPayloadError.
|
|
74
|
+
*
|
|
75
|
+
* @constructor
|
|
76
|
+
*/
|
|
77
|
+
constructor() {
|
|
78
|
+
super(
|
|
79
|
+
"Expected a valid payload to be available either on Deployable or as argument to deploy."
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
class h extends Error {
|
|
84
|
+
/**
|
|
85
|
+
* Creates an instance of NoContractAddressUponReceiptError.
|
|
86
|
+
*
|
|
87
|
+
* @constructor
|
|
88
|
+
* @param {WaitForTransactionReceiptReturnType} receipt
|
|
89
|
+
*/
|
|
90
|
+
constructor(r) {
|
|
91
|
+
super("Expected a contract address to exist on receipt.", {
|
|
92
|
+
cause: r
|
|
93
|
+
}), this.receipt = r;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
class m extends Error {
|
|
97
|
+
/**
|
|
98
|
+
* Creates an instance of InvalidComponentInterfaceError.
|
|
99
|
+
*
|
|
100
|
+
* @constructor
|
|
101
|
+
* @param {Hex[]} expected
|
|
102
|
+
* @param {Hex} received
|
|
103
|
+
*/
|
|
104
|
+
constructor(r, o) {
|
|
105
|
+
super("Address provided does not match any expected protocol interface", {
|
|
106
|
+
cause: { expected: r, received: o }
|
|
107
|
+
}), this.expected = [], this.received = a, this.expected = r, this.received = o;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
class y extends Error {
|
|
111
|
+
/**
|
|
112
|
+
* Creates an instance of UnknownTransferPayloadSupplied.
|
|
113
|
+
*
|
|
114
|
+
* @constructor
|
|
115
|
+
* @param {unknown} received
|
|
116
|
+
*/
|
|
117
|
+
constructor(r) {
|
|
118
|
+
super(
|
|
119
|
+
"Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.",
|
|
120
|
+
{ cause: r }
|
|
121
|
+
), this.received = r;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
class v extends Error {
|
|
125
|
+
/**
|
|
126
|
+
* Creates an instance of BudgetMustAuthorizeBoostCore.
|
|
127
|
+
*
|
|
128
|
+
* @constructor
|
|
129
|
+
* @param {string} boostCoreAddress
|
|
130
|
+
*/
|
|
131
|
+
constructor(r) {
|
|
132
|
+
super(
|
|
133
|
+
`Budget needs to explicitly authorize ${r}. You can retrieve this value from BoostCore.address`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
class b extends Error {
|
|
138
|
+
/**
|
|
139
|
+
* Creates an instance of MustInitializeBudgetError.
|
|
140
|
+
*/
|
|
141
|
+
constructor() {
|
|
142
|
+
super("Budgets must be preinitialized before being used with a new Boost");
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
class g extends Error {
|
|
146
|
+
/**
|
|
147
|
+
* Creates an instance of IncentiveNotCloneableError.
|
|
148
|
+
*
|
|
149
|
+
* @constructor
|
|
150
|
+
* @param {Incentive} incentive
|
|
151
|
+
*/
|
|
152
|
+
constructor(r) {
|
|
153
|
+
super(`Incentive not cloneable: ${r.constructor.name}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
class f extends Error {
|
|
157
|
+
/**
|
|
158
|
+
* Creates an instance of NoEventActionStepsProvidedError.
|
|
159
|
+
*
|
|
160
|
+
* @constructor
|
|
161
|
+
*/
|
|
162
|
+
constructor() {
|
|
163
|
+
super("Must supply at least one action step");
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
class C extends Error {
|
|
167
|
+
/**
|
|
168
|
+
* Creates an instance of TooManyEventActionStepsProvidedError.
|
|
169
|
+
*
|
|
170
|
+
* @constructor
|
|
171
|
+
*/
|
|
172
|
+
constructor() {
|
|
173
|
+
super(
|
|
174
|
+
"Cannot supply more than 4 action steps with current protocol version"
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
class t extends Error {
|
|
179
|
+
/**
|
|
180
|
+
* Creates an instance of EventActionValidationError.
|
|
181
|
+
*
|
|
182
|
+
* @constructor
|
|
183
|
+
* @param {string} message
|
|
184
|
+
* @param {EventActionValidationMeta} param0
|
|
185
|
+
* @param {*} param0.fieldValue
|
|
186
|
+
* @param {Criteria} param0.criteria
|
|
187
|
+
* @param {Log} param0.log
|
|
188
|
+
*/
|
|
189
|
+
constructor(r, { fieldValue: o, criteria: s, log: n }) {
|
|
190
|
+
super(r), this.fieldValue = o, this.criteria = s, this.log = n;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
class w extends t {
|
|
194
|
+
/**
|
|
195
|
+
* Creates an instance of FieldValueUndefinedError.
|
|
196
|
+
*
|
|
197
|
+
* @constructor
|
|
198
|
+
* @param {EventActionValidationMeta} metadata
|
|
199
|
+
*/
|
|
200
|
+
constructor(r) {
|
|
201
|
+
super("Field value is undefined", r);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
class A extends t {
|
|
205
|
+
/**
|
|
206
|
+
* Creates an instance of InvalidNumericalCriteria.
|
|
207
|
+
*
|
|
208
|
+
* @constructor
|
|
209
|
+
* @param {EventActionValidationMeta} metadata
|
|
210
|
+
*/
|
|
211
|
+
constructor(r) {
|
|
212
|
+
super(
|
|
213
|
+
"Numerical comparisons cannot be used with non-numerical criteria",
|
|
214
|
+
r
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
class B extends t {
|
|
219
|
+
/**
|
|
220
|
+
* Creates an instance of FieldValueNotComparableError.
|
|
221
|
+
*
|
|
222
|
+
* @constructor
|
|
223
|
+
* @param {EventActionValidationMeta} metadata
|
|
224
|
+
*/
|
|
225
|
+
constructor(r) {
|
|
226
|
+
super("Filter can only be used with bytes or string field type", r);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
class I extends t {
|
|
230
|
+
/**
|
|
231
|
+
* Creates an instance of UnrecognizedFilterTypeError.
|
|
232
|
+
*
|
|
233
|
+
* @constructor
|
|
234
|
+
* @param {EventActionValidationMeta} metadata
|
|
235
|
+
*/
|
|
236
|
+
constructor(r) {
|
|
237
|
+
super("Invalid FilterType provided", r);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
export {
|
|
241
|
+
c as BoostCoreNoIdentifierEmitted,
|
|
242
|
+
v as BudgetMustAuthorizeBoostCore,
|
|
243
|
+
d as ContractAddressRequiredError,
|
|
244
|
+
l as DeployableAlreadyDeployedError,
|
|
245
|
+
u as DeployableBuildParametersUnspecifiedError,
|
|
246
|
+
x as DeployableMissingPayloadError,
|
|
247
|
+
p as DeployableUnknownOwnerProvidedError,
|
|
248
|
+
E as DeployableWagmiConfigurationRequiredError,
|
|
249
|
+
t as EventActionValidationError,
|
|
250
|
+
B as FieldValueNotComparableError,
|
|
251
|
+
w as FieldValueUndefinedError,
|
|
252
|
+
g as IncentiveNotCloneableError,
|
|
253
|
+
m as InvalidComponentInterfaceError,
|
|
254
|
+
A as InvalidNumericalCriteriaError,
|
|
255
|
+
b as MustInitializeBudgetError,
|
|
256
|
+
h as NoContractAddressUponReceiptError,
|
|
257
|
+
f as NoEventActionStepsProvidedError,
|
|
258
|
+
C as TooManyEventActionStepsProvidedError,
|
|
259
|
+
y as UnknownTransferPayloadSupplied,
|
|
260
|
+
I as UnrecognizedFilterTypeError
|
|
261
|
+
};
|
|
262
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../src/errors.ts"],"sourcesContent":["import {\n type Hex,\n type Log,\n type WaitForTransactionReceiptReturnType,\n zeroHash,\n} from 'viem';\nimport type { Criteria } from './Actions/EventAction';\nimport type { BoostRegistry } from './BoostRegistry';\nimport type { Incentive } from './Incentives/Incentive';\n\n/**\n * This error is thrown during Boost creation if no `BoostCreated` event was emitted.\n *\n * @export\n * @class BoostCoreNoIdentifierEmitted\n * @typedef {BoostCoreNoIdentifierEmitted}\n * @extends {Error}\n * @example\n * ```ts\n * try {\n * await boostCore.createBoost(...)\n * } catch(e) {\n * if(e instanceof BoostCoreNoIdentifierEmitted) {}\n * }\n * ```\n */\nexport class BoostCoreNoIdentifierEmitted extends Error {\n /**\n * Creates an instance of BoostCoreNoIdentifierEmitted.\n *\n * @constructor\n */\n constructor() {\n super(`No \"BoostCreated\" log was emitted from which to extract boostId`);\n }\n}\n\n/**\n * This error is thrown when `assertValidAddress` is called, usually because a contract call expects the class to have a valid address attached.\n *\n * @export\n * @class ContractAddressRequiredError\n * @typedef {ContractAddressRequiredError}\n * @extends {Error}\n * @example\n * ```ts\n * try {\n * target.assertValidAddress()\n * } catch(e) {\n * if(e instanceof ContractAddressRequiredError) {}\n * }\n */\nexport class ContractAddressRequiredError extends Error {\n /**\n * Creates an instance of ContractAddressRequiredError.\n *\n * @constructor\n */\n constructor() {\n super('Attempted to call contract method without providing an address');\n }\n}\n\n/**\n * This error is thrown when attempting to deploy a contract that has already been deployed, or has an address attached.\n *\n * @export\n * @class DeployableAlreadyDeployedError\n * @typedef {DeployableAlreadyDeployedError}\n * @extends {Error}\n */\nexport class DeployableAlreadyDeployedError extends Error {\n /**\n * The address already attached to the target.\n *\n * @type {string}\n */\n address: string;\n /**\n * Creates an instance of DeployableAlreadyDeployedError.\n *\n * @constructor\n * @param {string} address\n */\n constructor(address: string) {\n super(\n `Attempted to deploy a contract that already has an address configured`,\n );\n this.address = address;\n }\n}\n\n/**\n * You should never see this error if we did our jobs and every target overrides the `buildParameters` method.\n *\n * @export\n * @class DeployableBuildParametersUnspecifiedError\n * @typedef {DeployableBuildParametersUnspecifiedError}\n * @extends {Error}\n */\nexport class DeployableBuildParametersUnspecifiedError extends Error {\n /**\n * Creates an instance of DeployableBuildParametersUnspecifiedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Implementing class did not properly override the `buildParameters` method',\n );\n }\n}\n\n/**\n * This error is thrown when attempting to deploy an `ownable` contract and the owner cannot be ascertained from the initialization payload or configured account.\n *\n * @export\n * @class DeployableUnknownOwnerProvidedError\n * @typedef {DeployableUnknownOwnerProvidedError}\n * @extends {Error}\n */\nexport class DeployableUnknownOwnerProvidedError extends Error {\n /**\n * Creates an instance of DeployableUnknownOwnerProvidedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected an an owner to be provided in configuration or an account to exist on Wagmi config.',\n );\n }\n}\n\n/**\n * This error is thrown when deploying a contract with no valid Wagmi configuration on the instance.\n *\n * @export\n * @class DeployableWagmiConfigurationRequiredError\n * @typedef {DeployableWagmiConfigurationRequiredError}\n * @extends {Error}\n */\nexport class DeployableWagmiConfigurationRequiredError extends Error {\n /**\n * Creates an instance of DeployableWagmiConfigurationRequiredError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected a valid Wagmi configuration to be available either on Deployable, or as argument to deploy.',\n );\n }\n}\n\n/**\n * This error is thrown when deploying a contract with no valid initialization payload.\n *\n * @export\n * @class DeployableMissingPayloadError\n * @typedef {DeployableMissingPayloadError}\n * @extends {Error}\n */\nexport class DeployableMissingPayloadError extends Error {\n /**\n * Creates an instance of DeployableMissingPayloadError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected a valid payload to be available either on Deployable or as argument to deploy.',\n );\n }\n}\n\n/**\n * This error is thrown when we receive a transaction receipt for a contract deployment without a contract address on it.\n *\n * @export\n * @class NoContractAddressUponReceiptError\n * @typedef {NoContractAddressUponReceiptError}\n * @extends {Error}\n */\nexport class NoContractAddressUponReceiptError extends Error {\n /**\n * The raw receipt we receive from [waitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n *\n * @public\n * @readonly\n * @type {WaitForTransactionReceiptReturnType}\n */\n public readonly receipt: WaitForTransactionReceiptReturnType;\n /**\n * Creates an instance of NoContractAddressUponReceiptError.\n *\n * @constructor\n * @param {WaitForTransactionReceiptReturnType} receipt\n */\n constructor(receipt: WaitForTransactionReceiptReturnType) {\n super(`Expected a contract address to exist on receipt.`, {\n cause: receipt,\n });\n this.receipt = receipt;\n }\n}\n\n/**\n * This error is thrown when a target address was provided that doesn't match any supported interface for the given registry type.\n * For example, if you try to do `incentiveFromAddress()` with the address of a deployed `SimpleBudget`\n *\n * @export\n * @class InvalidComponentInterfaceError\n * @typedef {InvalidComponentInterfaceError}\n * @extends {Error}\n */\nexport class InvalidComponentInterfaceError extends Error {\n /**\n * Expected interface hashes.\n *\n * @public\n * @readonly\n * @type {Hex[]}\n */\n public readonly expected: Hex[] = [];\n /**\n * The actual interface hash.\n *\n * @public\n * @readonly\n * @type {Hex}\n */\n public readonly received: Hex = zeroHash;\n\n /**\n * Creates an instance of InvalidComponentInterfaceError.\n *\n * @constructor\n * @param {Hex[]} expected\n * @param {Hex} received\n */\n constructor(expected: Hex[], received: Hex) {\n super(`Address provided does not match any expected protocol interface`, {\n cause: { expected, received },\n });\n this.expected = expected;\n this.received = received;\n }\n}\n\n/**\n * This error is thrown when attempting a Budget transfer and arguments aren't of the type `FungibleTransferPayload` or `ERC1155TransferPayload`\n *\n * @see {@link FungibleTransferPayload}\n * @see {@link ERC1155TransferPayload}\n * @export\n * @class UnknownTransferPayloadSupplied\n * @typedef {UnknownTransferPayloadSupplied}\n * @extends {Error}\n */\nexport class UnknownTransferPayloadSupplied extends Error {\n /**\n * The given payload that does not conform to the correct payload shape.\n *\n * @type {unknown}\n */\n received: unknown;\n /**\n * Creates an instance of UnknownTransferPayloadSupplied.\n *\n * @constructor\n * @param {unknown} received\n */\n constructor(received: unknown) {\n super(\n `Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.`,\n { cause: received },\n );\n this.received = received;\n }\n}\n\n/**\n * This error is thrown during Boost creation when the budget doesn't authorize the Boost Core address.\n *\n * @export\n * @class BudgetMustAuthorizeBoostCore\n * @typedef {BudgetMustAuthorizeBoostCore}\n * @extends {Error}\n */\nexport class BudgetMustAuthorizeBoostCore extends Error {\n /**\n * Creates an instance of BudgetMustAuthorizeBoostCore.\n *\n * @constructor\n * @param {string} boostCoreAddress\n */\n constructor(boostCoreAddress: string) {\n super(\n `Budget needs to explicitly authorize ${boostCoreAddress}. You can retrieve this value from BoostCore.address`,\n );\n }\n}\n\n/**\n * Because this contract is a base implementation, it should not be initialized through the constructor. Instead, it should be cloned and initialized using the {@link BoostRegistry}\n *\n * @export\n * @class MustInitializeBudgetError\n * @typedef {MustInitializeBudgetError}\n * @extends {Error}\n */\nexport class MustInitializeBudgetError extends Error {\n /**\n * Creates an instance of MustInitializeBudgetError.\n */\n constructor() {\n super(`Budgets must be preinitialized before being used with a new Boost`);\n }\n}\n\n/**\n * The error is thrown when trying to reuse an existing deployed Incentive that isn't a base implementation.\n * The protocol doesn't allow this.\n *\n * @export\n * @class IncentiveNotCloneableError\n * @typedef {IncentiveNotCloneableError}\n * @extends {Error}\n */\nexport class IncentiveNotCloneableError extends Error {\n /**\n * Creates an instance of IncentiveNotCloneableError.\n *\n * @constructor\n * @param {Incentive} incentive\n */\n constructor(incentive: Incentive) {\n super(`Incentive not cloneable: ${incentive.constructor.name}`);\n }\n}\n\n/**\n * Thrown when encoding an EventAction payload and no action steps are provided\n *\n * @export\n * @class NoEventActionStepsProvidedError\n * @typedef {NoEventActionStepsProvidedError}\n * @extends {Error}\n */\nexport class NoEventActionStepsProvidedError extends Error {\n /**\n * Creates an instance of NoEventActionStepsProvidedError.\n *\n * @constructor\n */\n constructor() {\n super('Must supply at least one action step');\n }\n}\n\n/**\n * Thrown when encoding an EventAction payload and > 4 steps are provided\n *\n * @export\n * @class TooManyEventActionStepsProvidedError\n * @typedef {TooManyEventActionStepsProvidedError}\n * @extends {Error}\n */\nexport class TooManyEventActionStepsProvidedError extends Error {\n /**\n * Creates an instance of TooManyEventActionStepsProvidedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Cannot supply more than 4 action steps with current protocol version',\n );\n }\n}\n\n/**\n * Event action validation context to help debug other validation errors\n *\n * @interface EventActionValidationMeta\n * @typedef {EventActionValidationMeta}\n */\ninterface EventActionValidationMeta {\n /**\n * The viem log being validated against\n *\n * @type {Log}\n */\n log: Log;\n /**\n * The value pulled off the log being validated against\n *\n * @type {*}\n * biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits\n */\n fieldValue: any;\n /**\n * The criteria being used to compare during validation\n *\n * @type {Criteria}\n */\n criteria: Criteria;\n}\n\n/**\n * The base error thrown during event action validation extended by more specific validation errors.\n * Instantiated with relevent context data for more in depth debugging.\n *\n * @export\n * @class EventActionValidationError\n * @typedef {EventActionValidationError}\n * @extends {Error}\n */\nexport class EventActionValidationError extends Error {\n /**\n * The viem log being validated against\n *\n * @type {Log}\n */\n log: Log;\n /**\n * The value pulled off the log being validated against\n *\n * @type {*}\n * biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits\n */\n fieldValue: any;\n /**\n * The criteria being used to compare during validation\n *\n * @type {Criteria}\n */\n criteria: Criteria;\n /**\n * Creates an instance of EventActionValidationError.\n *\n * @constructor\n * @param {string} message\n * @param {EventActionValidationMeta} param0\n * @param {*} param0.fieldValue\n * @param {Criteria} param0.criteria\n * @param {Log} param0.log\n */\n constructor(\n message: string,\n { fieldValue, criteria, log }: EventActionValidationMeta,\n ) {\n super(message);\n this.fieldValue = fieldValue;\n this.criteria = criteria;\n this.log = log;\n }\n}\n\n/**\n * Thrown when field value on log is undefined\n *\n * @export\n * @class FieldValueUndefinedError\n * @typedef {FieldValueUndefinedError}\n * @extends {EventActionValidationError}\n */\nexport class FieldValueUndefinedError extends EventActionValidationError {\n /**\n * Creates an instance of FieldValueUndefinedError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Field value is undefined', metadata);\n }\n}\n\n/**\n * Thrown when a filter type is using a numerical operator but field type is not numerical\n *\n * @export\n * @class InvalidNumericalCriteriaError\n * @typedef {InvalidNumericalCriteriaError}\n * @extends {EventActionValidationError}\n */\nexport class InvalidNumericalCriteriaError extends EventActionValidationError {\n /**\n * Creates an instance of InvalidNumericalCriteria.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super(\n 'Numerical comparisons cannot be used with non-numerical criteria',\n metadata,\n );\n }\n}\n\n/**\n * Thrown when an the log's field value is being compared a field type that isn't bytes or string during event action validation\n *\n * @export\n * @class FieldValueNotComparableError\n * @typedef {FieldValueNotComparableError}\n * @extends {EventActionValidationError}\n */\nexport class FieldValueNotComparableError extends EventActionValidationError {\n /**\n * Creates an instance of FieldValueNotComparableError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Filter can only be used with bytes or string field type', metadata);\n }\n}\n\n/**\n * Thrown when an invalid filter type enum was provided event action validation.\n *\n * @export\n * @class UnrecognizedFilterTypeError\n * @typedef {UnrecognizedFilterTypeError}\n * @extends {EventActionValidationError}\n */\nexport class UnrecognizedFilterTypeError extends EventActionValidationError {\n /**\n * Creates an instance of UnrecognizedFilterTypeError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Invalid FilterType provided', metadata);\n }\n}\n"],"names":["BoostCoreNoIdentifierEmitted","ContractAddressRequiredError","DeployableAlreadyDeployedError","address","DeployableBuildParametersUnspecifiedError","DeployableUnknownOwnerProvidedError","DeployableWagmiConfigurationRequiredError","DeployableMissingPayloadError","NoContractAddressUponReceiptError","receipt","InvalidComponentInterfaceError","expected","received","zeroHash","UnknownTransferPayloadSupplied","BudgetMustAuthorizeBoostCore","boostCoreAddress","MustInitializeBudgetError","IncentiveNotCloneableError","incentive","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","EventActionValidationError","message","fieldValue","criteria","log","FieldValueUndefinedError","metadata","InvalidNumericalCriteriaError","FieldValueNotComparableError","UnrecognizedFilterTypeError"],"mappings":"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"}
|