@boostxyz/sdk 6.1.2 → 7.0.0-canary.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/README.md +1 -1
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +4 -4
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +10 -0
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +84 -83
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +3 -3
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +14 -14
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +1894 -267
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +808 -497
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +47 -47
- package/dist/Budget-B_kgJGDu.cjs +2 -0
- package/dist/Budget-B_kgJGDu.cjs.map +1 -0
- package/dist/Budget-Bvi5Qjqp.js +1124 -0
- package/dist/Budget-Bvi5Qjqp.js.map +1 -0
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.d.ts +5 -4
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +9 -6
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +4 -0
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +25 -25
- package/dist/Budgets/ManagedBudgetWithFees.d.ts +4 -0
- package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts +4 -0
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts.map +1 -1
- package/dist/Budgets/TransparentBudget.d.ts +944 -0
- package/dist/Budgets/TransparentBudget.d.ts.map +1 -0
- package/dist/Budgets/VestingBudget.d.ts +4 -0
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +1 -1
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +19 -19
- package/dist/Incentive-CLKutfnD.js +445 -0
- package/dist/Incentive-CLKutfnD.js.map +1 -0
- package/dist/Incentive-CLSVNxDz.cjs +2 -0
- package/dist/Incentive-CLSVNxDz.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +9 -9
- package/dist/Incentives/AllowListIncentive.js.map +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +5 -5
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +17 -17
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedIncentive.d.ts +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs +2 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs.map +1 -0
- package/dist/Incentives/{ERC20PeggedVariableCriteriaIncentive.d.ts → ERC20PeggedVariableCriteriaIncentiveV2.d.ts} +39 -27
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js +625 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs +2 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs.map +1 -0
- package/dist/Incentives/{ERC20VariableCriteriaIncentive.d.ts → ERC20VariableCriteriaIncentiveV2.d.ts} +42 -13
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js +242 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +3 -3
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +22 -22
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +8 -8
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +13 -12
- package/dist/Incentives/Incentive.js.map +1 -1
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.js +13 -13
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-C1C_BHkY.js +133 -0
- package/dist/{SimpleDenyList-BKfPoTo1.js.map → SimpleDenyList-C1C_BHkY.js.map} +1 -1
- package/dist/SimpleDenyList-CWthbyj7.cjs +2 -0
- package/dist/{SimpleDenyList-DgjVf7FK.cjs.map → SimpleDenyList-CWthbyj7.cjs.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
- package/dist/Validators/LimitedSignerValidator.d.ts.map +1 -1
- package/dist/Validators/LimitedSignerValidator.js +48 -52
- package/dist/Validators/LimitedSignerValidator.js.map +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.js +54 -54
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/componentInterfaces-BVHB4Fjw.js +21 -0
- package/dist/componentInterfaces-BVHB4Fjw.js.map +1 -0
- package/dist/componentInterfaces-BqhL-meV.cjs +2 -0
- package/dist/componentInterfaces-BqhL-meV.cjs.map +1 -0
- package/dist/deployments-D9QxJGrC.cjs +2 -0
- package/dist/deployments-D9QxJGrC.cjs.map +1 -0
- package/dist/deployments-De8_J7SS.js +120 -0
- package/dist/{deployments-W_LUj833.js.map → deployments-De8_J7SS.js.map} +1 -1
- package/dist/deployments.json +63 -48
- package/dist/{generated-CElkFqkY.js → generated-BJfQ-EBO.js} +1268 -737
- package/dist/generated-BJfQ-EBO.js.map +1 -0
- package/dist/generated-mJJNq-xb.cjs +3 -0
- package/dist/generated-mJJNq-xb.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +162 -158
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +13 -7
- package/src/Actions/EventAction.ts +11 -0
- package/src/BoostCore.test.ts +14 -9
- package/src/BoostCore.ts +428 -26
- package/src/Budgets/Budget.ts +8 -1
- package/src/Budgets/TransparentBudget.test.ts +70 -0
- package/src/Budgets/TransparentBudget.ts +334 -0
- package/src/Deployable/Deployable.ts +1 -1
- package/src/Incentives/ERC20PeggedIncentive.ts +1 -1
- package/src/Incentives/{ERC20PeggedVariableCriteriaIncentive.test.ts → ERC20PeggedVariableCriteriaIncentiveV2.test.ts} +14 -10
- package/src/Incentives/{ERC20PeggedVariableCriteriaIncentive.ts → ERC20PeggedVariableCriteriaIncentiveV2.ts} +122 -100
- package/src/Incentives/{ERC20VariableCriteriaIncentive.test.ts → ERC20VariableCriteriaIncentiveV2.test.ts} +18 -13
- package/src/Incentives/{ERC20VariableCriteriaIncentive.ts → ERC20VariableCriteriaIncentiveV2.ts} +83 -24
- package/src/Incentives/ERC20VariableIncentive.ts +4 -2
- package/src/Incentives/Incentive.ts +12 -12
- package/src/Validators/LimitedSignerValidator.ts +1 -4
- package/src/index.test.ts +2 -2
- package/src/index.ts +3 -2
- package/src/utils.ts +1 -1
- package/dist/Budget-BjfL8dVX.cjs +0 -2
- package/dist/Budget-BjfL8dVX.cjs.map +0 -1
- package/dist/Budget-DD7IPuDx.js +0 -922
- package/dist/Budget-DD7IPuDx.js.map +0 -1
- package/dist/Incentive-V1RjH38L.js +0 -1036
- package/dist/Incentive-V1RjH38L.js.map +0 -1
- package/dist/Incentive-gVTfsnMB.cjs +0 -2
- package/dist/Incentive-gVTfsnMB.cjs.map +0 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +0 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +0 -2
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +0 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +0 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +0 -207
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +0 -1
- package/dist/SimpleDenyList-BKfPoTo1.js +0 -133
- package/dist/SimpleDenyList-DgjVf7FK.cjs +0 -2
- package/dist/componentInterfaces-CA1UIqWL.js +0 -20
- package/dist/componentInterfaces-CA1UIqWL.js.map +0 -1
- package/dist/componentInterfaces-aBgBbB7r.cjs +0 -2
- package/dist/componentInterfaces-aBgBbB7r.cjs.map +0 -1
- package/dist/deployments-CwTZr-cK.cjs +0 -2
- package/dist/deployments-CwTZr-cK.cjs.map +0 -1
- package/dist/deployments-W_LUj833.js +0 -117
- package/dist/generated-BPiHi7W2.cjs +0 -3
- package/dist/generated-BPiHi7W2.cjs.map +0 -1
- package/dist/generated-CElkFqkY.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boostxyz/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-canary.0",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -175,11 +175,17 @@
|
|
|
175
175
|
"node": "./dist/Incentives/ERC20VariableIncentive.js",
|
|
176
176
|
"types": "./dist/Incentives/ERC20VariableIncentive.d.ts"
|
|
177
177
|
},
|
|
178
|
-
"./Incentives/
|
|
179
|
-
"require": "./dist/Incentives/
|
|
180
|
-
"import": "./dist/Incentives/
|
|
181
|
-
"node": "./dist/Incentives/
|
|
182
|
-
"types": "./dist/Incentives/
|
|
178
|
+
"./Incentives/ERC20VariableCriteriaIncentiveV2": {
|
|
179
|
+
"require": "./dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs",
|
|
180
|
+
"import": "./dist/Incentives/ERC20VariableCriteriaIncentiveV2.js",
|
|
181
|
+
"node": "./dist/Incentives/ERC20VariableCriteriaIncentiveV2.js",
|
|
182
|
+
"types": "./dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts"
|
|
183
|
+
},
|
|
184
|
+
"./Incentives/ERC20PeggedVariableCriteriaIncentiveV2": {
|
|
185
|
+
"require": "./dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs",
|
|
186
|
+
"import": "./dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js",
|
|
187
|
+
"node": "./dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js",
|
|
188
|
+
"types": "./dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts"
|
|
183
189
|
},
|
|
184
190
|
"./Incentives/Incentive": {
|
|
185
191
|
"require": "./dist/Incentives/Incentive.cjs",
|
|
@@ -221,7 +227,7 @@
|
|
|
221
227
|
"viem": "2.x"
|
|
222
228
|
},
|
|
223
229
|
"scripts": {
|
|
224
|
-
"build": "mkdir -p dist && vite build && tsc -p ./tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap",
|
|
230
|
+
"build": "mkdir -p dist && vite build && npx tsc -p ./tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap",
|
|
225
231
|
"typecheck": "tsc -p ./tsconfig.build.json --noEmit",
|
|
226
232
|
"lint:ci": "npx biome ci",
|
|
227
233
|
"lint": "npx biome check",
|
|
@@ -146,6 +146,17 @@ export enum SignatureType {
|
|
|
146
146
|
FUNC = 1,
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
/**
|
|
150
|
+
* The type of value used for the scalar value (RAW or WAD).
|
|
151
|
+
*
|
|
152
|
+
* @export
|
|
153
|
+
* @enum {number}
|
|
154
|
+
*/
|
|
155
|
+
export enum ValueType {
|
|
156
|
+
RAW = 0,
|
|
157
|
+
WAD = 1,
|
|
158
|
+
}
|
|
159
|
+
|
|
149
160
|
/**
|
|
150
161
|
* The payload describing how claimants are identified
|
|
151
162
|
*
|
package/src/BoostCore.test.ts
CHANGED
|
@@ -20,7 +20,8 @@ import { bytes4 } from "./utils";
|
|
|
20
20
|
import { BoostValidatorEOA } from './Validators/Validator';
|
|
21
21
|
import { AssetType } from "./transfers";
|
|
22
22
|
import { waitForTransactionReceipt } from "@wagmi/core";
|
|
23
|
-
import { SignatureType } from "./Actions/EventAction";
|
|
23
|
+
import { SignatureType, ValueType } from "./Actions/EventAction";
|
|
24
|
+
import { MockERC721 } from "@boostxyz/test/MockERC721";
|
|
24
25
|
|
|
25
26
|
let fixtures: Fixtures, budgets: BudgetFixtures;
|
|
26
27
|
|
|
@@ -958,12 +959,12 @@ describe("BoostCore", () => {
|
|
|
958
959
|
test("can create a boost with a pegged variable criteria incentive", async () => {
|
|
959
960
|
const { core } = fixtures;
|
|
960
961
|
const { budget, erc20 } = budgets;
|
|
961
|
-
|
|
962
|
+
|
|
962
963
|
// Create a new MockERC721 instance
|
|
963
964
|
const erc721 = await loadFixture(fundErc721(defaultOptions));
|
|
964
965
|
|
|
965
966
|
// Create the pegged variable criteria incentive
|
|
966
|
-
const peggedVariableCriteriaIncentive = core.
|
|
967
|
+
const peggedVariableCriteriaIncentive = core.ERC20PeggedVariableCriteriaIncentiveV2({
|
|
967
968
|
asset: erc20.assertValidAddress(),
|
|
968
969
|
peg: erc20.assertValidAddress(), // Using same token as peg for simplicity
|
|
969
970
|
reward: parseEther("1"),
|
|
@@ -975,6 +976,7 @@ describe("BoostCore", () => {
|
|
|
975
976
|
signature: pad(bytes4("transferFrom(address,address,uint256)")),
|
|
976
977
|
fieldIndex: 2,
|
|
977
978
|
targetContract: erc721.assertValidAddress(),
|
|
979
|
+
valueType: ValueType.WAD,
|
|
978
980
|
},
|
|
979
981
|
});
|
|
980
982
|
|
|
@@ -1021,6 +1023,7 @@ describe("BoostCore", () => {
|
|
|
1021
1023
|
expect(criteria.targetContract.toLowerCase()).toBe(
|
|
1022
1024
|
erc721.address?.toLowerCase(),
|
|
1023
1025
|
);
|
|
1026
|
+
expect(criteria.valueType).toBe(ValueType.WAD);
|
|
1024
1027
|
});
|
|
1025
1028
|
});
|
|
1026
1029
|
|
|
@@ -1046,7 +1049,7 @@ describe("Top-Up Incentives", () => {
|
|
|
1046
1049
|
asset: erc20.assertValidAddress(),
|
|
1047
1050
|
target: defaultOptions.account.address,
|
|
1048
1051
|
});
|
|
1049
|
-
|
|
1052
|
+
|
|
1050
1053
|
|
|
1051
1054
|
const createdBoost = await core.createBoost({
|
|
1052
1055
|
protocolFee: 0n,
|
|
@@ -1147,9 +1150,9 @@ describe("Top-Up Incentives", () => {
|
|
|
1147
1150
|
});
|
|
1148
1151
|
|
|
1149
1152
|
describe("ERC20PeggedVariableCriteriaIncentive Top-Ups", () => {
|
|
1150
|
-
let incentive: ReturnType<typeof fixtures.core.
|
|
1153
|
+
let incentive: ReturnType<typeof fixtures.core.ERC20PeggedVariableCriteriaIncentiveV2>;
|
|
1151
1154
|
let boostId: bigint;
|
|
1152
|
-
let erc721:
|
|
1155
|
+
let erc721: MockERC721;
|
|
1153
1156
|
|
|
1154
1157
|
beforeAll(async () => {
|
|
1155
1158
|
const { core } = fixtures;
|
|
@@ -1158,7 +1161,7 @@ describe("ERC20PeggedVariableCriteriaIncentive Top-Ups", () => {
|
|
|
1158
1161
|
// Create a new MockERC721 instance
|
|
1159
1162
|
erc721 = await loadFixture(fundErc721(defaultOptions));
|
|
1160
1163
|
|
|
1161
|
-
incentive = core.
|
|
1164
|
+
incentive = core.ERC20PeggedVariableCriteriaIncentiveV2({
|
|
1162
1165
|
asset: erc20.assertValidAddress(),
|
|
1163
1166
|
peg: erc20.assertValidAddress(),
|
|
1164
1167
|
reward: parseEther("1"),
|
|
@@ -1170,6 +1173,7 @@ describe("ERC20PeggedVariableCriteriaIncentive Top-Ups", () => {
|
|
|
1170
1173
|
signature: pad(bytes4("transferFrom(address,address,uint256)")),
|
|
1171
1174
|
fieldIndex: 2,
|
|
1172
1175
|
targetContract: erc721.assertValidAddress(),
|
|
1176
|
+
valueType: ValueType.WAD,
|
|
1173
1177
|
},
|
|
1174
1178
|
});
|
|
1175
1179
|
|
|
@@ -1288,11 +1292,11 @@ describe("ERC20PeggedVariableCriteriaIncentive with LimitedSignerValidator", ()
|
|
|
1288
1292
|
const { budget, erc20 } = budgets;
|
|
1289
1293
|
|
|
1290
1294
|
const erc721 = await loadFixture(fundErc721(defaultOptions));
|
|
1291
|
-
const incentive = core.
|
|
1295
|
+
const incentive = core.ERC20PeggedVariableCriteriaIncentiveV2({
|
|
1292
1296
|
asset: erc20.assertValidAddress(),
|
|
1293
1297
|
peg: erc20.assertValidAddress(),
|
|
1294
1298
|
reward: parseEther("1"),
|
|
1295
|
-
limit: parseEther("10"),
|
|
1299
|
+
limit: parseEther("10"),
|
|
1296
1300
|
maxReward: parseEther("2"),
|
|
1297
1301
|
manager: budget.assertValidAddress(),
|
|
1298
1302
|
criteria: {
|
|
@@ -1300,6 +1304,7 @@ describe("ERC20PeggedVariableCriteriaIncentive with LimitedSignerValidator", ()
|
|
|
1300
1304
|
signature: pad(bytes4("transferFrom(address,address,uint256)")),
|
|
1301
1305
|
fieldIndex: 2,
|
|
1302
1306
|
targetContract: erc721.assertValidAddress(),
|
|
1307
|
+
valueType: ValueType.WAD,
|
|
1303
1308
|
},
|
|
1304
1309
|
});
|
|
1305
1310
|
await erc20.mint(defaultOptions.account.address, parseEther("110"));
|