@boostxyz/sdk 0.0.0-alpha.9 → 1.1.0-alpha.22
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/Action.cjs +1 -1
- package/dist/Actions/Action.cjs.map +1 -1
- package/dist/Actions/Action.js +7 -7
- package/dist/Actions/ContractAction.d.ts +11 -11
- package/dist/Actions/ContractAction.d.ts.map +1 -1
- package/dist/Actions/ERC721MintAction.d.ts +14 -14
- package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +171 -41
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +15 -392
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.cjs.map +1 -1
- package/dist/AllowLists/AllowList.d.ts +6 -4
- package/dist/AllowLists/AllowList.d.ts.map +1 -1
- package/dist/AllowLists/AllowList.js +45 -23
- package/dist/AllowLists/AllowList.js.map +1 -1
- package/dist/AllowLists/OpenAllowList.d.ts +423 -0
- package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +92 -37
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +55 -71
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs.map +1 -1
- package/dist/AllowLists/SimpleDenyList.d.ts +203 -11
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +11 -112
- package/dist/AllowLists/SimpleDenyList.js.map +1 -1
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/Boost.cjs +1 -1
- package/dist/Boost.cjs.map +1 -1
- package/dist/Boost.d.ts +20 -21
- package/dist/Boost.d.ts.map +1 -1
- package/dist/Boost.js +43 -57
- package/dist/Boost.js.map +1 -1
- package/dist/BoostCore-BVZExPPu.js +1462 -0
- package/dist/BoostCore-BVZExPPu.js.map +1 -0
- package/dist/BoostCore-D-E-cnGI.cjs +3 -0
- package/dist/BoostCore-D-E-cnGI.cjs.map +1 -0
- package/dist/BoostCore.cjs +1 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +748 -77
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +29 -1150
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.cjs.map +1 -1
- package/dist/BoostRegistry.d.ts +80 -25
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +165 -83
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.cjs.map +1 -1
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/Budgets/Budget.js.map +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +75 -193
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +80 -298
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +223 -89
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Contract.cjs +1 -1
- package/dist/Deployable/Contract.cjs.map +1 -1
- package/dist/Deployable/Contract.d.ts +4 -5
- package/dist/Deployable/Contract.d.ts.map +1 -1
- package/dist/Deployable/Contract.js +5 -7
- package/dist/Deployable/Contract.js.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 +3 -5
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.cjs.map +1 -1
- package/dist/Deployable/DeployableTarget.d.ts +13 -13
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +28 -25
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
- package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts +179 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js +222 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
- package/dist/EventAction-BZt5cjbe.cjs +2 -0
- package/dist/EventAction-BZt5cjbe.cjs.map +1 -0
- package/dist/EventAction-C_-hJXWm.js +1541 -0
- package/dist/EventAction-C_-hJXWm.js.map +1 -0
- package/dist/Incentive-BhHaK3PZ.cjs +2 -0
- package/dist/Incentive-BhHaK3PZ.cjs.map +1 -0
- package/dist/Incentive-Cqg1w6wD.js +312 -0
- package/dist/Incentive-Cqg1w6wD.js.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +38 -16
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +42 -29
- 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.d.ts +234 -21
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +45 -32
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC1155Incentive.d.ts +224 -37
- package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.d.ts +230 -29
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +56 -43
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +335 -440
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +231 -29
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.cjs.map +1 -1
- package/dist/Incentives/Incentive.d.ts +4 -4
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +16 -296
- 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.d.ts +40 -18
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +37 -24
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-BUR17Tt1.cjs +2 -0
- package/dist/SimpleDenyList-BUR17Tt1.cjs.map +1 -0
- package/dist/SimpleDenyList-CGaWjuld.js +132 -0
- package/dist/SimpleDenyList-CGaWjuld.js.map +1 -0
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.d.ts +16 -16
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +30 -27
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.cjs.map +1 -1
- package/dist/Validators/Validator.d.ts +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/Validators/Validator.js.map +1 -1
- package/dist/claiming.cjs.map +1 -1
- package/dist/claiming.d.ts +1 -1
- package/dist/claiming.js.map +1 -1
- package/dist/componentInterfaces-BBCFkrZv.js +14 -0
- package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
- package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
- package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
- package/dist/deployments-DVXioW2i.cjs +2 -0
- package/dist/deployments-DVXioW2i.cjs.map +1 -0
- package/dist/deployments-oykLv3_Z.js +43 -0
- package/dist/deployments-oykLv3_Z.js.map +1 -0
- package/dist/deployments.json +44 -0
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +256 -20
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +183 -26
- package/dist/errors.js.map +1 -1
- package/dist/{generated-57_Kffpz.js → generated-CKt2yCQd.js} +3613 -1869
- package/dist/generated-CKt2yCQd.js.map +1 -0
- package/dist/generated-CyTNlOwM.cjs +3 -0
- package/dist/generated-CyTNlOwM.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +142 -108
- package/dist/index.js.map +1 -1
- package/dist/transfers.cjs.map +1 -1
- package/dist/transfers.d.ts +1 -1
- package/dist/transfers.js.map +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +26 -12
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +38 -23
- package/dist/utils.js.map +1 -1
- package/package.json +20 -10
- package/src/Actions/Action.test.ts +14 -13
- package/src/Actions/ContractAction.test.ts +10 -10
- package/src/Actions/ContractAction.ts +11 -12
- package/src/Actions/ERC721MintAction.test.ts +6 -6
- package/src/Actions/ERC721MintAction.ts +14 -15
- package/src/Actions/EventAction.test.ts +729 -109
- package/src/Actions/EventAction.ts +542 -84
- package/src/AllowLists/AllowList.test.ts +7 -7
- package/src/AllowLists/AllowList.ts +5 -3
- package/src/AllowLists/OpenAllowList.test.ts +40 -0
- package/src/AllowLists/OpenAllowList.ts +45 -0
- package/src/AllowLists/SimpleAllowList.test.ts +4 -4
- package/src/AllowLists/SimpleAllowList.ts +39 -61
- package/src/AllowLists/SimpleDenyList.test.ts +4 -4
- package/src/AllowLists/SimpleDenyList.ts +40 -17
- package/src/Auth/PassthroughAuth.test.ts +1 -1
- package/src/Boost.ts +21 -24
- package/src/BoostCore.test.ts +323 -268
- package/src/BoostCore.ts +396 -219
- package/src/BoostRegistry.test.ts +53 -0
- package/src/BoostRegistry.ts +161 -40
- package/src/Budgets/Budget.test.ts +2 -2
- package/src/Budgets/Budget.ts +1 -2
- package/src/Budgets/ManagedBudget.test.ts +82 -19
- package/src/Budgets/ManagedBudget.ts +48 -310
- package/src/Budgets/VestingBudget.test.ts +7 -7
- package/src/Budgets/VestingBudget.ts +34 -106
- package/src/Deployable/Contract.ts +4 -5
- package/src/Deployable/Deployable.ts +1 -1
- package/src/Deployable/DeployableTarget.ts +30 -19
- package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
- package/src/Incentives/AllowListIncentive.test.ts +5 -5
- package/src/Incentives/AllowListIncentive.ts +29 -15
- package/src/Incentives/CGDAIncentive.test.ts +9 -6
- package/src/Incentives/CGDAIncentive.ts +38 -18
- package/src/Incentives/ERC1155Incentive.test.ts +3 -3
- package/src/Incentives/ERC1155Incentive.ts +28 -29
- package/src/Incentives/ERC20Incentive.test.ts +9 -6
- package/src/Incentives/ERC20Incentive.ts +46 -26
- package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.ts +324 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +8 -11
- package/src/Incentives/ERC20VariableIncentive.ts +49 -26
- package/src/Incentives/Incentive.test.ts +4 -1
- package/src/Incentives/Incentive.ts +7 -6
- package/src/Incentives/PointsIncentive.test.ts +24 -25
- package/src/Incentives/PointsIncentive.ts +31 -17
- package/src/Validators/SignerValidator.test.ts +6 -6
- package/src/Validators/SignerValidator.ts +19 -17
- package/src/Validators/Validator.test.ts +2 -2
- package/src/Validators/Validator.ts +1 -1
- package/src/claiming.ts +1 -1
- package/src/errors.ts +345 -21
- package/src/index.test.ts +118 -36
- package/src/index.ts +5 -0
- package/src/transfers.ts +1 -1
- package/src/utils.test.ts +2 -2
- package/src/utils.ts +61 -12
- package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
- package/dist/componentInterfaces-CKCBwG16.cjs +0 -2
- package/dist/componentInterfaces-CKCBwG16.cjs.map +0 -1
- package/dist/componentInterfaces-DYkaxBda.js +0 -13
- package/dist/componentInterfaces-DYkaxBda.js.map +0 -1
- package/dist/generated-57_Kffpz.js.map +0 -1
- package/dist/generated-wKBNvm48.cjs +0 -3
- package/dist/generated-wKBNvm48.cjs.map +0 -1
- package/src/Budgets/SimpleBudget.test.ts +0 -152
- package/src/Budgets/SimpleBudget.ts +0 -564
package/src/index.test.ts
CHANGED
|
@@ -1,40 +1,122 @@
|
|
|
1
|
-
import { describe, expect, test } from
|
|
2
|
-
import * as SDK from
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import * as SDK from "./index";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
4
|
+
// Please add any public interface you'd like to verify exists on the root export here
|
|
5
|
+
// Types don't exist in .js so only list objects, constants, classes, etc, no interfaces
|
|
6
|
+
const allExports = [
|
|
7
|
+
"BoostRegistry",
|
|
8
|
+
"BoostCore",
|
|
9
|
+
"Boost",
|
|
10
|
+
"EventAction",
|
|
11
|
+
"OpenAllowList",
|
|
12
|
+
"SimpleAllowList",
|
|
13
|
+
"SimpleDenyList",
|
|
14
|
+
"ManagedBudget",
|
|
15
|
+
"Deployable",
|
|
16
|
+
"Contract",
|
|
17
|
+
"DeployableTarget",
|
|
18
|
+
"DeployableTargetWithRBAC",
|
|
19
|
+
"AllowListIncentive",
|
|
20
|
+
"CGDAIncentive",
|
|
21
|
+
"ERC20Incentive",
|
|
22
|
+
"ERC20VariableIncentive",
|
|
23
|
+
"ERC20VariableCriteriaIncentive",
|
|
24
|
+
"PointsIncentive",
|
|
25
|
+
"SignerValidator",
|
|
26
|
+
"BoostCoreNoIdentifierEmitted",
|
|
27
|
+
"ContractAddressRequiredError",
|
|
28
|
+
"DeployableAlreadyDeployedError",
|
|
29
|
+
"DeployableBuildParametersUnspecifiedError",
|
|
30
|
+
"DeployableUnknownOwnerProvidedError",
|
|
31
|
+
"DeployableWagmiConfigurationRequiredError",
|
|
32
|
+
"DeployableMissingPayloadError",
|
|
33
|
+
"NoContractAddressUponReceiptError",
|
|
34
|
+
"InvalidComponentInterfaceError",
|
|
35
|
+
"UnparseableAbiParamError",
|
|
36
|
+
"UnknownTransferPayloadSupplied",
|
|
37
|
+
"BudgetMustAuthorizeBoostCore",
|
|
38
|
+
"MustInitializeBudgetError",
|
|
39
|
+
"IncentiveNotCloneableError",
|
|
40
|
+
"NoEventActionStepsProvidedError",
|
|
41
|
+
"TooManyEventActionStepsProvidedError",
|
|
42
|
+
"ValidationAbiMissingError",
|
|
43
|
+
"FieldActionValidationError",
|
|
44
|
+
"DecodedArgsMalformedError",
|
|
45
|
+
"FieldValueUndefinedError",
|
|
46
|
+
"InvalidNumericalCriteriaError",
|
|
47
|
+
"FunctionDataDecodeError",
|
|
48
|
+
"FieldValueNotComparableError",
|
|
49
|
+
"UnrecognizedFilterTypeError",
|
|
50
|
+
"NoConnectedChainIdError",
|
|
51
|
+
"InvalidProtocolChainIdError",
|
|
52
|
+
"IncentiveCriteriaNotFoundError",
|
|
53
|
+
"NoMatchingLogsError",
|
|
54
|
+
"InvalidCriteriaTypeError",
|
|
55
|
+
"DecodedArgsError",
|
|
56
|
+
"PassthroughAuth",
|
|
57
|
+
"prepareBoostPayload",
|
|
58
|
+
"actionFromAddress",
|
|
59
|
+
"isEventActionPayloadSimple",
|
|
60
|
+
"prepareEventActionPayload",
|
|
61
|
+
"allowListFromAddress",
|
|
62
|
+
"prepareSimpleAllowListPayload",
|
|
63
|
+
"prepareSimpleDenyListPayload",
|
|
64
|
+
"budgetFromAddress",
|
|
65
|
+
"isFungibleTransfer",
|
|
66
|
+
"isERC1155TransferPayload",
|
|
67
|
+
"prepareTransfer",
|
|
68
|
+
"prepareManagedBudgetPayload",
|
|
69
|
+
"prepareAllowListIncentivePayload",
|
|
70
|
+
"prepareCGDAIncentivePayload",
|
|
71
|
+
"prepareERC20IncentivePayload",
|
|
72
|
+
"prepareERC20VariableIncentivePayload",
|
|
73
|
+
"prepareERC20VariableCriteriaIncentivePayload",
|
|
74
|
+
"incentiveFromAddress",
|
|
75
|
+
"preparePointsIncentivePayload",
|
|
76
|
+
"prepareSignerValidatorClaimDataPayload",
|
|
77
|
+
"prepareSignerValidatorInputParams",
|
|
78
|
+
"prepareSignerValidatorPayload",
|
|
79
|
+
"validatorFromAddress",
|
|
80
|
+
"bytes4",
|
|
81
|
+
"getDeployedContractAddress",
|
|
82
|
+
"awaitResult",
|
|
83
|
+
"assertValidAddressByChainId",
|
|
84
|
+
"prepareClaimPayload",
|
|
85
|
+
"prepareERC1155Payload",
|
|
86
|
+
"prepareERC1155Transfer",
|
|
87
|
+
"prepareFungiblePayload",
|
|
88
|
+
"prepareFungibleTransfer",
|
|
89
|
+
"prepareTransferPayload",
|
|
90
|
+
"BOOST_REGISTRY_ADDRESS",
|
|
91
|
+
"BOOST_REGISTRY_ADDRESSES",
|
|
92
|
+
"boostCoreAbi",
|
|
93
|
+
"boostRegistryAbi",
|
|
94
|
+
"BOOST_CORE_CLAIM_FEE",
|
|
95
|
+
"BOOST_CORE_ADDRESS",
|
|
96
|
+
"BOOST_CORE_ADDRESSES",
|
|
97
|
+
"ActionByComponentInterface",
|
|
98
|
+
"AllowListByComponentInterface",
|
|
99
|
+
"simpleAllowListAbi",
|
|
100
|
+
"LIST_MANAGER_ROLE",
|
|
101
|
+
"simpleDenyListAbi",
|
|
102
|
+
"BudgetByComponentInterface",
|
|
103
|
+
"managedBudgetAbi",
|
|
104
|
+
"rbacAbi",
|
|
105
|
+
"allowListIncentiveAbi",
|
|
106
|
+
"cgdaIncentiveAbi",
|
|
107
|
+
"erc20IncentiveAbi",
|
|
108
|
+
"erc20VariableIncentiveAbi",
|
|
109
|
+
"IncentiveByComponentInterface",
|
|
110
|
+
"pointsIncentiveAbi",
|
|
111
|
+
"signerValidatorAbi",
|
|
112
|
+
"ValidatorByComponentInterface",
|
|
113
|
+
"passthroughAuthAbi"
|
|
114
|
+
]
|
|
25
115
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
expect(SDK.DeployableUnknownOwnerProvidedError).toBeDefined();
|
|
32
|
-
expect(SDK.DeployableWagmiConfigurationRequiredError).toBeDefined();
|
|
33
|
-
expect(SDK.DeployableMissingPayloadError).toBeDefined();
|
|
34
|
-
expect(SDK.NoContractAddressUponReceiptError).toBeDefined();
|
|
35
|
-
expect(SDK.InvalidComponentInterfaceError).toBeDefined();
|
|
36
|
-
expect(SDK.UnknownTransferPayloadSupplied).toBeDefined();
|
|
37
|
-
expect(SDK.BudgetMustAuthorizeBoostCore).toBeDefined();
|
|
38
|
-
expect(SDK.IncentiveNotCloneableError).toBeDefined();
|
|
116
|
+
describe("SDK exports", () => {
|
|
117
|
+
test(`should export all public API`, () => {
|
|
118
|
+
for(let exp of allExports) {
|
|
119
|
+
expect((SDK as any)[exp]).toBeDefined()
|
|
120
|
+
}
|
|
39
121
|
});
|
|
40
122
|
});
|
package/src/index.ts
CHANGED
|
@@ -27,12 +27,15 @@ export * from './Budgets/ManagedBudget';
|
|
|
27
27
|
export * from './Deployable/Deployable';
|
|
28
28
|
export * from './Deployable/Contract';
|
|
29
29
|
export * from './Deployable/DeployableTarget';
|
|
30
|
+
export * from './Deployable/DeployableTargetWithRBAC';
|
|
30
31
|
|
|
31
32
|
// Incentives
|
|
32
33
|
|
|
33
34
|
export * from './Incentives/AllowListIncentive';
|
|
34
35
|
export * from './Incentives/CGDAIncentive';
|
|
35
36
|
export * from './Incentives/ERC20Incentive';
|
|
37
|
+
export * from './Incentives/ERC20VariableIncentive';
|
|
38
|
+
export * from './Incentives/ERC20VariableCriteriaIncentive';
|
|
36
39
|
// export * from './Incentives/ERC1155Incentive';
|
|
37
40
|
export * from './Incentives/Incentive';
|
|
38
41
|
export * from './Incentives/PointsIncentive';
|
|
@@ -46,6 +49,8 @@ export * from './Validators/Validator';
|
|
|
46
49
|
|
|
47
50
|
export * from './errors';
|
|
48
51
|
export * from './utils';
|
|
52
|
+
export * from './claiming';
|
|
53
|
+
export * from './transfers';
|
|
49
54
|
|
|
50
55
|
// Auth
|
|
51
56
|
|
package/src/transfers.ts
CHANGED
|
@@ -211,7 +211,7 @@ export interface FungiblePayload {
|
|
|
211
211
|
* @export
|
|
212
212
|
* @param {FungiblePayload} param0
|
|
213
213
|
* @param {bigint} param0.amount - The amount being transferred
|
|
214
|
-
* @returns {
|
|
214
|
+
* @returns {Hex}
|
|
215
215
|
*/
|
|
216
216
|
export function prepareFungiblePayload({ amount }: FungiblePayload) {
|
|
217
217
|
return encodeAbiParameters(
|
package/src/utils.test.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { simulateMockErc20Mint, writeMockErc20Mint } from '@boostxyz/evm';
|
|
2
2
|
import { isAddress } from 'viem';
|
|
3
3
|
import { describe, expect, test } from 'vitest';
|
|
4
|
-
import { MockERC20 } from '
|
|
5
|
-
import { defaultOptions } from '
|
|
4
|
+
import { MockERC20 } from '@boostxyz/test/MockERC20';
|
|
5
|
+
import { defaultOptions } from '@boostxyz/test/helpers';
|
|
6
6
|
import { awaitResult, bytes4, getDeployedContractAddress } from './utils';
|
|
7
7
|
|
|
8
8
|
describe('bytes4', () => {
|
package/src/utils.ts
CHANGED
|
@@ -3,12 +3,15 @@ import {
|
|
|
3
3
|
type ReadContractParameters,
|
|
4
4
|
type WatchContractEventParameters,
|
|
5
5
|
type WriteContractParameters,
|
|
6
|
+
getAccount,
|
|
7
|
+
getClient,
|
|
6
8
|
waitForTransactionReceipt,
|
|
7
9
|
} from '@wagmi/core';
|
|
8
10
|
import type { ExtractAbiEvent } from 'abitype';
|
|
9
11
|
import type {
|
|
10
12
|
Abi,
|
|
11
13
|
AbiEvent,
|
|
14
|
+
Address,
|
|
12
15
|
ContractEventName,
|
|
13
16
|
ContractFunctionName,
|
|
14
17
|
GetLogsParameters,
|
|
@@ -18,10 +21,28 @@ import type {
|
|
|
18
21
|
WaitForTransactionReceiptParameters,
|
|
19
22
|
} from 'viem';
|
|
20
23
|
import { isHex, keccak256, slice, toHex } from 'viem';
|
|
21
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
InvalidProtocolChainIdError,
|
|
26
|
+
NoConnectedChainIdError,
|
|
27
|
+
NoContractAddressUponReceiptError,
|
|
28
|
+
} from './errors';
|
|
22
29
|
|
|
23
30
|
export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
|
|
24
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Enum encapsulating all the different types of targets used in the Boost V2 Protocol.
|
|
34
|
+
*
|
|
35
|
+
* @export
|
|
36
|
+
* @enum {number}
|
|
37
|
+
*/
|
|
38
|
+
export enum RegistryType {
|
|
39
|
+
ACTION = 0,
|
|
40
|
+
ALLOW_LIST = 1,
|
|
41
|
+
BUDGET = 2,
|
|
42
|
+
INCENTIVE = 3,
|
|
43
|
+
VALIDATOR = 4,
|
|
44
|
+
}
|
|
45
|
+
|
|
25
46
|
/**
|
|
26
47
|
* Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.
|
|
27
48
|
* See (writeContract)[https://viem.sh/docs/contract/writeContract]
|
|
@@ -32,8 +53,8 @@ export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
|
|
|
32
53
|
* @template {ContractFunctionName<abi>} functionName
|
|
33
54
|
*/
|
|
34
55
|
export type WriteParams<
|
|
35
|
-
abi extends Abi,
|
|
36
|
-
functionName extends ContractFunctionName<abi>,
|
|
56
|
+
abi extends Abi = Abi,
|
|
57
|
+
functionName extends ContractFunctionName<abi> = ContractFunctionName<abi>,
|
|
37
58
|
> = Partial<
|
|
38
59
|
Omit<
|
|
39
60
|
WriteContractParameters<abi, functionName>,
|
|
@@ -133,7 +154,7 @@ export function bytes4(input: string) {
|
|
|
133
154
|
* @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)
|
|
134
155
|
* @param {Promise<Hash>} hash - A transaction hash promise
|
|
135
156
|
* @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}
|
|
136
|
-
* @returns {
|
|
157
|
+
* @returns {Promise<Address>}
|
|
137
158
|
* @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received
|
|
138
159
|
*/
|
|
139
160
|
export async function getDeployedContractAddress(
|
|
@@ -184,15 +205,43 @@ export async function awaitResult<Result = unknown>(
|
|
|
184
205
|
}
|
|
185
206
|
|
|
186
207
|
/**
|
|
187
|
-
*
|
|
208
|
+
* Given a wagmi config and a map of chain id's to addresses, determine an address/chainId combo that maps to the currently connected chain id, or throw a typed error.
|
|
188
209
|
*
|
|
189
210
|
* @export
|
|
190
|
-
* @
|
|
211
|
+
* @param {Config} config
|
|
212
|
+
* @param {Record<string, Address>} addressByChainId
|
|
213
|
+
* @param {number} desiredChainId
|
|
214
|
+
* @returns {{ chainId: number, address: Address }}
|
|
215
|
+
* @throws {@link InvalidProtocolChainIdError}
|
|
191
216
|
*/
|
|
192
|
-
export
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
217
|
+
export function assertValidAddressByChainId(
|
|
218
|
+
config: Config,
|
|
219
|
+
addressByChainId: Record<number, Address>,
|
|
220
|
+
desiredChainId?: number,
|
|
221
|
+
): { chainId: number; address: Address } {
|
|
222
|
+
let chainId: number | undefined = undefined;
|
|
223
|
+
const wagmiAccount = getAccount(config);
|
|
224
|
+
// if manually providing a chain id for some contract operation, try to use it
|
|
225
|
+
if (desiredChainId !== undefined) {
|
|
226
|
+
if (addressByChainId[desiredChainId]) chainId = desiredChainId;
|
|
227
|
+
} else if (wagmiAccount.chainId !== undefined) {
|
|
228
|
+
// otherwise if we can get the current chain id off the connected account and it matches one of ours, use it
|
|
229
|
+
if (addressByChainId[wagmiAccount.chainId]) chainId = wagmiAccount.chainId;
|
|
230
|
+
}
|
|
231
|
+
// chainId is still undefined, try to get chain id off viem client
|
|
232
|
+
if (chainId === undefined) {
|
|
233
|
+
const client = getClient(config);
|
|
234
|
+
if (client?.chain.id && addressByChainId[client?.chain.id])
|
|
235
|
+
chainId = client.chain.id;
|
|
236
|
+
}
|
|
237
|
+
// if chainId is STILL undefined, use our default addresses
|
|
238
|
+
// TODO: update this when on prod network
|
|
239
|
+
if (chainId === undefined) chainId = Number(__DEFAULT_CHAIN_ID__);
|
|
240
|
+
if (!addressByChainId[chainId])
|
|
241
|
+
throw new InvalidProtocolChainIdError(
|
|
242
|
+
chainId,
|
|
243
|
+
Object.keys(addressByChainId).map(Number),
|
|
244
|
+
);
|
|
245
|
+
// biome-ignore lint/style/noNonNullAssertion: this type should be narrowed by the above statement but isn't?
|
|
246
|
+
return { chainId, address: addressByChainId[chainId]! };
|
|
198
247
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleBudget.d.ts","sourceRoot":"","sources":["../../src/Budgets/SimpleBudget.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,eAAe,EAWhB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAKvB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAKlE,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAG7B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,UAAU,EAAE,OAAO,EAAE,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,CACzB,KAAK,SAAS,iBAAiB,CAAC,OAAO,eAAe,CAAC,GAAG,iBAAiB,CACzE,OAAO,eAAe,CACvB,IACC,UAAU,CAAC,OAAO,eAAe,EAAE,KAAK,CAAC,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,uBAAuB,GAAG,sBAAsB,GACzD,QAAQ,IAAI,uBA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DAIncentive=e;exports.AERC20Incentive=n;exports.AERC20VariableIncentive=t;exports.AEventAction=i;exports.AManagedBudget=c;exports.APointsIncentive=A;exports.ASignerValidator=o;exports.ASimpleAllowList=s;exports.ASimpleDenyList=a;
|
|
2
|
-
//# sourceMappingURL=componentInterfaces-CKCBwG16.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"componentInterfaces-CKCBwG16.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const n = "0xa39e44d9", e = "0x8c901437", s = "0x6060409d", t = "0x7687b0ed", a = "0xa0109882", c = "0xc5b24b8e", o = "0xb8ce7b22", i = "0x8ba1fc24", A = "0x3d30a22c";
|
|
2
|
-
export {
|
|
3
|
-
t as A,
|
|
4
|
-
i as a,
|
|
5
|
-
A as b,
|
|
6
|
-
a as c,
|
|
7
|
-
o as d,
|
|
8
|
-
c as e,
|
|
9
|
-
e as f,
|
|
10
|
-
n as g,
|
|
11
|
-
s as h
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=componentInterfaces-DYkaxBda.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"componentInterfaces-DYkaxBda.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|