@boostxyz/sdk 7.1.0 → 7.3.0
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/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +75 -0
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +379 -245
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js +177 -142
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts +3 -2
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js +130 -95
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +179 -175
- package/package.json +1 -1
- package/src/Actions/EventAction.test.ts +90 -0
- package/src/Actions/EventAction.ts +263 -7
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts +71 -13
- package/src/Incentives/ERC20VariableCriteriaIncentiveV2.ts +74 -13
package/dist/index.js
CHANGED
|
@@ -1,194 +1,198 @@
|
|
|
1
|
-
import { BOOST_REGISTRY_ADDRESS as a, BOOST_REGISTRY_ADDRESSES as
|
|
1
|
+
import { BOOST_REGISTRY_ADDRESS as a, BOOST_REGISTRY_ADDRESSES as i, BoostRegistry as o } from "./BoostRegistry.js";
|
|
2
2
|
import { BOOST_CORE_ADDRESS as n, BOOST_CORE_ADDRESSES as d, BoostCore as p, FEE_DENOMINATOR as l } from "./BoostCore.js";
|
|
3
3
|
import { Boost as c, prepareBoostPayload as g } from "./Boost.js";
|
|
4
4
|
import { ActionByComponentInterface as E, actionFromAddress as A } from "./Actions/Action.js";
|
|
5
|
-
import { EventAction as y, FilterType as
|
|
6
|
-
import { AllowListByComponentInterface as
|
|
7
|
-
import { LIST_MANAGER_ROLE as
|
|
8
|
-
import { S as
|
|
9
|
-
import { B as
|
|
10
|
-
import { ManagedBudget as
|
|
11
|
-
import { Deployable as
|
|
12
|
-
import { Contract as
|
|
13
|
-
import { DeployableTarget as
|
|
14
|
-
import { DeployableTargetWithRBAC as
|
|
15
|
-
import { AllowListIncentive as
|
|
16
|
-
import { CGDAIncentive as
|
|
17
|
-
import { ERC20Incentive as
|
|
18
|
-
import { E as
|
|
19
|
-
import { ERC20VariableIncentive as
|
|
20
|
-
import { ERC20VariableCriteriaIncentive as
|
|
21
|
-
import { ERC20PeggedVariableCriteriaIncentive as
|
|
22
|
-
import { ERC20VariableCriteriaIncentiveV2 as
|
|
23
|
-
import { ERC20PeggedVariableCriteriaIncentiveV2 as
|
|
24
|
-
import { PointsIncentive as
|
|
25
|
-
import { SignerValidator as
|
|
26
|
-
import { LimitedSignerValidator as
|
|
27
|
-
import { BoostValidatorEOA as
|
|
28
|
-
import { BoostCoreNoIdentifierEmitted as
|
|
29
|
-
import { CheatCodes as
|
|
30
|
-
import { StrategyType as
|
|
31
|
-
import { AssetType as
|
|
32
|
-
import { PassthroughAuth as
|
|
33
|
-
import { _ as
|
|
5
|
+
import { EventAction as y, FilterType as I, PrimitiveType as b, SignatureType as v, ValueType as f, anyActionParameter as P, decodeAndReorderLogArgs as u, detectSignatureType as R, getScalarValueFromTuple as V, isCriteriaFieldIndexTuple as S, isEventActionPayloadSimple as x, packCriteriaFieldIndexes as B, packFieldIndexes as T, prepareEventActionPayload as D, transactionSenderClaimant as F, unpackCriteriaFieldIndexes as L, unpackFieldIndexes as h } from "./Actions/EventAction.js";
|
|
6
|
+
import { AllowListByComponentInterface as O, OpenAllowList as N, allowListFromAddress as w } from "./AllowLists/AllowList.js";
|
|
7
|
+
import { LIST_MANAGER_ROLE as U, SimpleAllowList as W, prepareSimpleAllowListPayload as k } from "./AllowLists/SimpleAllowList.js";
|
|
8
|
+
import { S as z, p as q } from "./SimpleDenyList-BlLgvhjE.js";
|
|
9
|
+
import { B as j, M as H, a as J, T as K, b as Q, p as X, c as Z } from "./Budget-B-grnRq9.js";
|
|
10
|
+
import { ManagedBudget as ee, ManagedBudgetRoles as re, isERC1155TransferPayload as ae, isFungibleTransfer as ie, prepareManagedBudgetPayload as oe, prepareTransfer as te } from "./Budgets/ManagedBudget.js";
|
|
11
|
+
import { Deployable as de } from "./Deployable/Deployable.js";
|
|
12
|
+
import { Contract as le } from "./Deployable/Contract.js";
|
|
13
|
+
import { DeployableTarget as ce } from "./Deployable/DeployableTarget.js";
|
|
14
|
+
import { DeployableTargetWithRBAC as me, Roles as Ee } from "./Deployable/DeployableTargetWithRBAC.js";
|
|
15
|
+
import { AllowListIncentive as Ce, prepareAllowListIncentivePayload as ye } from "./Incentives/AllowListIncentive.js";
|
|
16
|
+
import { CGDAIncentive as be, prepareCGDAIncentivePayload as ve } from "./Incentives/CGDAIncentive.js";
|
|
17
|
+
import { ERC20Incentive as Pe, prepareERC20IncentivePayload as ue } from "./Incentives/ERC20Incentive.js";
|
|
18
|
+
import { E as Ve, I as Se, i as xe, p as Be } from "./Incentive-Bz_g-nID.js";
|
|
19
|
+
import { ERC20VariableIncentive as De, prepareERC20VariableIncentivePayload as Fe } from "./Incentives/ERC20VariableIncentive.js";
|
|
20
|
+
import { ERC20VariableCriteriaIncentive as he, gasRebateIncentiveCriteria as Me, prepareERC20VariableCriteriaIncentivePayload as Oe } from "./Incentives/ERC20VariableCriteriaIncentive.js";
|
|
21
|
+
import { ERC20PeggedVariableCriteriaIncentive as we, prepareERC20PeggedVariableCriteriaIncentivePayload as _e } from "./Incentives/ERC20PeggedVariableCriteriaIncentive.js";
|
|
22
|
+
import { ERC20VariableCriteriaIncentiveV2 as We, gasRebateIncentiveCriteriaV2 as ke, prepareERC20VariableCriteriaIncentiveV2Payload as Ge } from "./Incentives/ERC20VariableCriteriaIncentiveV2.js";
|
|
23
|
+
import { ERC20PeggedVariableCriteriaIncentiveV2 as qe, prepareERC20PeggedVariableCriteriaIncentiveV2Payload as Ye } from "./Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js";
|
|
24
|
+
import { PointsIncentive as He, preparePointsIncentivePayload as Je } from "./Incentives/PointsIncentive.js";
|
|
25
|
+
import { SignerValidator as Qe, prepareSignerValidatorClaimDataPayload as Xe, prepareSignerValidatorInputParams as Ze, prepareSignerValidatorPayload as $e } from "./Validators/SignerValidator.js";
|
|
26
|
+
import { LimitedSignerValidator as rr, prepareLimitedSignerValidatorClaimDataPayload as ar, prepareLimitedSignerValidatorInputParams as ir, prepareLimitedSignerValidatorPayload as or } from "./Validators/LimitedSignerValidator.js";
|
|
27
|
+
import { BoostValidatorEOA as nr, ValidatorByComponentInterface as dr, decodeClaimData as pr, validatorFromAddress as lr } from "./Validators/Validator.js";
|
|
28
|
+
import { BoostCoreNoIdentifierEmitted as cr, BoostNotFoundError as gr, BudgetMustAuthorizeBoostCore as mr, ContractAddressRequiredError as Er, DecodedArgsError as Ar, DecodedArgsMalformedError as Cr, DeployableAlreadyDeployedError as yr, DeployableBuildParametersUnspecifiedError as Ir, DeployableMissingPayloadError as br, DeployableUnknownOwnerProvidedError as vr, DeployableWagmiConfigurationRequiredError as fr, FieldActionValidationError as Pr, FieldValueNotComparableError as ur, FieldValueUndefinedError as Rr, FunctionDataDecodeError as Vr, IncentiveCriteriaNotFoundError as Sr, IncentiveNotCloneableError as xr, InvalidComponentInterfaceError as Br, InvalidCriteriaTypeError as Tr, InvalidNumericalCriteriaError as Dr, InvalidProtocolChainIdError as Fr, InvalidTupleDecodingError as Lr, InvalidTupleEncodingError as hr, MustInitializeBudgetError as Mr, NoConnectedChainIdError as Or, NoContractAddressUponReceiptError as Nr, NoEventActionStepsProvidedError as wr, NoMatchingLogsError as _r, TooManyEventActionStepsProvidedError as Ur, UnknownTransferPayloadSupplied as Wr, UnparseableAbiParamError as kr, UnrecognizedFilterTypeError as Gr, ValidationAbiMissingError as zr } from "./errors.js";
|
|
29
|
+
import { CheatCodes as Yr, RegistryType as jr, TRANSFER_SIGNATURE as Hr, assertValidAddressByChainId as Jr, awaitResult as Kr, bytes4 as Qr, getDeployedContractAddress as Xr, getErc20Balance as Zr } from "./utils.js";
|
|
30
|
+
import { StrategyType as ea, prepareClaimPayload as ra } from "./claiming.js";
|
|
31
|
+
import { AssetType as ia, prepareERC1155Payload as oa, prepareERC1155Transfer as ta, prepareFungiblePayload as na, prepareFungibleTransfer as da, prepareTransferPayload as pa } from "./transfers.js";
|
|
32
|
+
import { PassthroughAuth as sa } from "./Auth/PassthroughAuth.js";
|
|
33
|
+
import { _ as ga, M as ma, A as Ea, E as Aa, T as Ca, g as ya, y as Ia, d as ba, c as va, m as fa, R as Pa, D as ua, C as Ra, p as Va, r as Sa, a as xa, z as Ba, S as Ta, G as Da, F as Fa, k as La, b as ha } from "./generated-CINzoGbl.js";
|
|
34
34
|
export {
|
|
35
35
|
E as ActionByComponentInterface,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
O as AllowListByComponentInterface,
|
|
37
|
+
Ce as AllowListIncentive,
|
|
38
|
+
ia as AssetType,
|
|
39
39
|
n as BOOST_CORE_ADDRESS,
|
|
40
40
|
d as BOOST_CORE_ADDRESSES,
|
|
41
41
|
a as BOOST_REGISTRY_ADDRESS,
|
|
42
|
-
|
|
42
|
+
i as BOOST_REGISTRY_ADDRESSES,
|
|
43
43
|
c as Boost,
|
|
44
44
|
p as BoostCore,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
45
|
+
cr as BoostCoreNoIdentifierEmitted,
|
|
46
|
+
gr as BoostNotFoundError,
|
|
47
|
+
o as BoostRegistry,
|
|
48
|
+
nr as BoostValidatorEOA,
|
|
49
|
+
j as BudgetByComponentInterface,
|
|
50
|
+
mr as BudgetMustAuthorizeBoostCore,
|
|
51
|
+
be as CGDAIncentive,
|
|
52
|
+
Yr as CheatCodes,
|
|
53
|
+
le as Contract,
|
|
54
|
+
Er as ContractAddressRequiredError,
|
|
55
|
+
Ar as DecodedArgsError,
|
|
56
|
+
Cr as DecodedArgsMalformedError,
|
|
57
|
+
de as Deployable,
|
|
58
|
+
yr as DeployableAlreadyDeployedError,
|
|
59
|
+
Ir as DeployableBuildParametersUnspecifiedError,
|
|
60
|
+
br as DeployableMissingPayloadError,
|
|
61
|
+
ce as DeployableTarget,
|
|
62
|
+
me as DeployableTargetWithRBAC,
|
|
63
|
+
vr as DeployableUnknownOwnerProvidedError,
|
|
64
|
+
fr as DeployableWagmiConfigurationRequiredError,
|
|
65
|
+
Pe as ERC20Incentive,
|
|
66
|
+
Ve as ERC20PeggedIncentive,
|
|
67
|
+
we as ERC20PeggedVariableCriteriaIncentive,
|
|
68
|
+
qe as ERC20PeggedVariableCriteriaIncentiveV2,
|
|
69
|
+
he as ERC20VariableCriteriaIncentive,
|
|
70
|
+
We as ERC20VariableCriteriaIncentiveV2,
|
|
71
|
+
De as ERC20VariableIncentive,
|
|
72
72
|
y as EventAction,
|
|
73
73
|
l as FEE_DENOMINATOR,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
74
|
+
Pr as FieldActionValidationError,
|
|
75
|
+
ur as FieldValueNotComparableError,
|
|
76
|
+
Rr as FieldValueUndefinedError,
|
|
77
|
+
I as FilterType,
|
|
78
|
+
Vr as FunctionDataDecodeError,
|
|
79
|
+
Se as IncentiveByComponentInterface,
|
|
80
|
+
Sr as IncentiveCriteriaNotFoundError,
|
|
81
|
+
xr as IncentiveNotCloneableError,
|
|
82
|
+
Br as InvalidComponentInterfaceError,
|
|
83
|
+
Tr as InvalidCriteriaTypeError,
|
|
84
|
+
Dr as InvalidNumericalCriteriaError,
|
|
85
|
+
Fr as InvalidProtocolChainIdError,
|
|
86
|
+
Lr as InvalidTupleDecodingError,
|
|
87
|
+
hr as InvalidTupleEncodingError,
|
|
88
|
+
U as LIST_MANAGER_ROLE,
|
|
89
|
+
rr as LimitedSignerValidator,
|
|
90
|
+
ee as ManagedBudget,
|
|
91
|
+
re as ManagedBudgetRoles,
|
|
92
|
+
H as ManagedBudgetWithFees,
|
|
93
|
+
J as ManagedBudgetWithFeesV2,
|
|
94
|
+
Mr as MustInitializeBudgetError,
|
|
95
|
+
Or as NoConnectedChainIdError,
|
|
96
|
+
Nr as NoContractAddressUponReceiptError,
|
|
97
|
+
wr as NoEventActionStepsProvidedError,
|
|
98
|
+
_r as NoMatchingLogsError,
|
|
99
|
+
N as OpenAllowList,
|
|
100
|
+
sa as PassthroughAuth,
|
|
101
|
+
He as PointsIncentive,
|
|
102
|
+
b as PrimitiveType,
|
|
103
|
+
jr as RegistryType,
|
|
104
|
+
Ee as Roles,
|
|
105
105
|
v as SignatureType,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
106
|
+
Qe as SignerValidator,
|
|
107
|
+
W as SimpleAllowList,
|
|
108
|
+
z as SimpleDenyList,
|
|
109
|
+
ea as StrategyType,
|
|
110
|
+
Hr as TRANSFER_SIGNATURE,
|
|
111
|
+
Ur as TooManyEventActionStepsProvidedError,
|
|
112
|
+
K as TransparentBudget,
|
|
113
|
+
Wr as UnknownTransferPayloadSupplied,
|
|
114
|
+
kr as UnparseableAbiParamError,
|
|
115
|
+
Gr as UnrecognizedFilterTypeError,
|
|
116
|
+
zr as ValidationAbiMissingError,
|
|
117
|
+
dr as ValidatorByComponentInterface,
|
|
118
118
|
f as ValueType,
|
|
119
119
|
A as actionFromAddress,
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
w as allowListFromAddress,
|
|
121
|
+
ga as allowListIncentiveAbi,
|
|
122
122
|
P as anyActionParameter,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
123
|
+
Jr as assertValidAddressByChainId,
|
|
124
|
+
Kr as awaitResult,
|
|
125
|
+
ma as boostCoreAbi,
|
|
126
|
+
Ea as boostRegistryAbi,
|
|
127
|
+
Q as budgetFromAddress,
|
|
128
|
+
Qr as bytes4,
|
|
129
|
+
Aa as cgdaIncentiveAbi,
|
|
130
|
+
u as decodeAndReorderLogArgs,
|
|
131
|
+
pr as decodeClaimData,
|
|
132
|
+
R as detectSignatureType,
|
|
133
|
+
Ca as erc20IncentiveAbi,
|
|
134
|
+
ya as erc20PeggedIncentiveAbi,
|
|
135
|
+
Ia as erc20PeggedVariableCriteriaIncentiveAbi,
|
|
136
|
+
ba as erc20PeggedVariableCriteriaIncentiveV2Abi,
|
|
137
|
+
va as erc20VariableCriteriaIncentiveAbi,
|
|
138
|
+
fa as erc20VariableCriteriaIncentiveV2Abi,
|
|
139
|
+
Pa as erc20VariableIncentiveAbi,
|
|
140
|
+
Me as gasRebateIncentiveCriteria,
|
|
141
|
+
ke as gasRebateIncentiveCriteriaV2,
|
|
142
|
+
Xr as getDeployedContractAddress,
|
|
143
|
+
Zr as getErc20Balance,
|
|
144
|
+
V as getScalarValueFromTuple,
|
|
145
|
+
xe as incentiveFromAddress,
|
|
146
|
+
S as isCriteriaFieldIndexTuple,
|
|
147
|
+
ae as isERC1155TransferPayload,
|
|
148
|
+
x as isEventActionPayloadSimple,
|
|
149
|
+
ie as isFungibleTransfer,
|
|
150
|
+
ua as limitedSignerValidatorAbi,
|
|
151
|
+
Ra as managedBudgetAbi,
|
|
152
|
+
Va as managedBudgetWithFeesAbi,
|
|
153
|
+
Sa as managedBudgetWithFeesV2Abi,
|
|
154
|
+
B as packCriteriaFieldIndexes,
|
|
155
|
+
T as packFieldIndexes,
|
|
156
|
+
xa as passthroughAuthAbi,
|
|
157
|
+
Ba as pointsIncentiveAbi,
|
|
158
|
+
ye as prepareAllowListIncentivePayload,
|
|
156
159
|
g as prepareBoostPayload,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
160
|
+
ve as prepareCGDAIncentivePayload,
|
|
161
|
+
ra as prepareClaimPayload,
|
|
162
|
+
oa as prepareERC1155Payload,
|
|
163
|
+
ta as prepareERC1155Transfer,
|
|
164
|
+
ue as prepareERC20IncentivePayload,
|
|
165
|
+
Be as prepareERC20PeggedIncentivePayload,
|
|
166
|
+
_e as prepareERC20PeggedVariableCriteriaIncentivePayload,
|
|
167
|
+
Ye as prepareERC20PeggedVariableCriteriaIncentiveV2Payload,
|
|
168
|
+
Oe as prepareERC20VariableCriteriaIncentivePayload,
|
|
169
|
+
Ge as prepareERC20VariableCriteriaIncentiveV2Payload,
|
|
170
|
+
Fe as prepareERC20VariableIncentivePayload,
|
|
171
|
+
D as prepareEventActionPayload,
|
|
172
|
+
na as prepareFungiblePayload,
|
|
173
|
+
da as prepareFungibleTransfer,
|
|
174
|
+
ar as prepareLimitedSignerValidatorClaimDataPayload,
|
|
175
|
+
ir as prepareLimitedSignerValidatorInputParams,
|
|
176
|
+
or as prepareLimitedSignerValidatorPayload,
|
|
177
|
+
oe as prepareManagedBudgetPayload,
|
|
178
|
+
X as prepareManagedBudgetWithFeesPayload,
|
|
179
|
+
Z as prepareManagedBudgetWithFeesV2Payload,
|
|
180
|
+
Je as preparePointsIncentivePayload,
|
|
181
|
+
Xe as prepareSignerValidatorClaimDataPayload,
|
|
182
|
+
Ze as prepareSignerValidatorInputParams,
|
|
183
|
+
$e as prepareSignerValidatorPayload,
|
|
184
|
+
k as prepareSimpleAllowListPayload,
|
|
185
|
+
q as prepareSimpleDenyListPayload,
|
|
186
|
+
te as prepareTransfer,
|
|
187
|
+
pa as prepareTransferPayload,
|
|
188
|
+
Ta as rbacAbi,
|
|
189
|
+
Da as signerValidatorAbi,
|
|
190
|
+
Fa as simpleAllowListAbi,
|
|
191
|
+
La as simpleDenyListAbi,
|
|
192
|
+
F as transactionSenderClaimant,
|
|
193
|
+
ha as transparentBudgetAbi,
|
|
194
|
+
L as unpackCriteriaFieldIndexes,
|
|
195
|
+
h as unpackFieldIndexes,
|
|
196
|
+
lr as validatorFromAddress
|
|
193
197
|
};
|
|
194
198
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -41,6 +41,9 @@ import {
|
|
|
41
41
|
transactionSenderClaimant,
|
|
42
42
|
packFieldIndexes,
|
|
43
43
|
unpackFieldIndexes,
|
|
44
|
+
packCriteriaFieldIndexes,
|
|
45
|
+
unpackCriteriaFieldIndexes,
|
|
46
|
+
isCriteriaFieldIndexTuple,
|
|
44
47
|
decodeAndReorderLogArgs
|
|
45
48
|
} from "./EventAction";
|
|
46
49
|
import { allKnownSignatures } from "@boostxyz/test/allKnownSignatures";
|
|
@@ -1512,3 +1515,90 @@ describe('decodeAndReorderLogArgs', () => {
|
|
|
1512
1515
|
expect(result.args[3]).toBe(5284n);
|
|
1513
1516
|
});
|
|
1514
1517
|
});
|
|
1518
|
+
|
|
1519
|
+
describe("criteria field index tuple support", () => {
|
|
1520
|
+
describe("packCriteriaFieldIndexes", () => {
|
|
1521
|
+
test("packs two indices into a single value", () => {
|
|
1522
|
+
const packed = packCriteriaFieldIndexes([3, 5])
|
|
1523
|
+
expect(packed).toBeGreaterThanOrEqual(32);
|
|
1524
|
+
expect(packed).toBeLessThanOrEqual(253);
|
|
1525
|
+
});
|
|
1526
|
+
|
|
1527
|
+
test("throws error if any index exceeds the allowed range (0-13)", () => {
|
|
1528
|
+
expect(() => packCriteriaFieldIndexes([14, 5])).toThrowError(
|
|
1529
|
+
"Tuple indices must be between 0-13"
|
|
1530
|
+
);
|
|
1531
|
+
|
|
1532
|
+
expect(() => packCriteriaFieldIndexes([5, 14])).toThrowError(
|
|
1533
|
+
"Tuple indices must be between 0-13"
|
|
1534
|
+
);
|
|
1535
|
+
|
|
1536
|
+
expect(() => packCriteriaFieldIndexes([-1, 5])).toThrowError(
|
|
1537
|
+
"Tuple indices must be between 0-13"
|
|
1538
|
+
);
|
|
1539
|
+
});
|
|
1540
|
+
|
|
1541
|
+
test("different input pairs result in different packed values", () => {
|
|
1542
|
+
const packed1 = packCriteriaFieldIndexes([1, 2]);
|
|
1543
|
+
const packed2 = packCriteriaFieldIndexes([2, 1]);
|
|
1544
|
+
const packed3 = packCriteriaFieldIndexes([1, 3]);
|
|
1545
|
+
|
|
1546
|
+
expect(packed1).not.toBe(packed2);
|
|
1547
|
+
expect(packed1).not.toBe(packed3);
|
|
1548
|
+
expect(packed2).not.toBe(packed3);
|
|
1549
|
+
});
|
|
1550
|
+
});
|
|
1551
|
+
|
|
1552
|
+
describe("unpackCriteriaFieldIndexes", () => {
|
|
1553
|
+
test("unpacks tuple index values (>= 32) correctly", () => {
|
|
1554
|
+
const packed = packCriteriaFieldIndexes([4, 7]);
|
|
1555
|
+
|
|
1556
|
+
const result = unpackCriteriaFieldIndexes(packed);
|
|
1557
|
+
expect(result.length).toBe(2);
|
|
1558
|
+
expect(result).toEqual([4, 7]);
|
|
1559
|
+
});
|
|
1560
|
+
|
|
1561
|
+
test("throws error if packed value is out of valid range", () => {
|
|
1562
|
+
expect(() => unpackCriteriaFieldIndexes(15)).toThrowError(
|
|
1563
|
+
"Field index must be between 32-253"
|
|
1564
|
+
);
|
|
1565
|
+
|
|
1566
|
+
expect(() => unpackCriteriaFieldIndexes(254)).toThrowError(
|
|
1567
|
+
"Field index must be between 32-253"
|
|
1568
|
+
);
|
|
1569
|
+
|
|
1570
|
+
expect(() => unpackCriteriaFieldIndexes(-1)).toThrowError(
|
|
1571
|
+
"Field index must be between 32-253"
|
|
1572
|
+
);
|
|
1573
|
+
});
|
|
1574
|
+
});
|
|
1575
|
+
|
|
1576
|
+
describe("isCriteriaFieldIndexTuple", () => {
|
|
1577
|
+
test("correctly identifies tuple indices vs simple indices", () => {
|
|
1578
|
+
// Test with simple index (< 32)
|
|
1579
|
+
expect(isCriteriaFieldIndexTuple(15)).toBe(false);
|
|
1580
|
+
|
|
1581
|
+
// Test with tuple index (>= 32)
|
|
1582
|
+
const packed = packCriteriaFieldIndexes([2, 3]);
|
|
1583
|
+
expect(isCriteriaFieldIndexTuple(packed)).toBe(true);
|
|
1584
|
+
|
|
1585
|
+
// Test edge cases
|
|
1586
|
+
expect(isCriteriaFieldIndexTuple(0)).toBe(false);
|
|
1587
|
+
expect(isCriteriaFieldIndexTuple(31)).toBe(false);
|
|
1588
|
+
expect(isCriteriaFieldIndexTuple(32)).toBe(true);
|
|
1589
|
+
});
|
|
1590
|
+
});
|
|
1591
|
+
|
|
1592
|
+
describe("criteria field index functions in practice", () => {
|
|
1593
|
+
test("round-trip packing and unpacking preserves the original values", () => {
|
|
1594
|
+
for (let i = 0; i <= 13; i++) {
|
|
1595
|
+
for (let j = 0; j <= 13; j++) {
|
|
1596
|
+
const original: [number, number] = [i, j];
|
|
1597
|
+
const packed = packCriteriaFieldIndexes(original);
|
|
1598
|
+
const unpacked = unpackCriteriaFieldIndexes(packed);
|
|
1599
|
+
expect(unpacked).toEqual(original);
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
});
|
|
1603
|
+
});
|
|
1604
|
+
});
|