@boostxyz/sdk 0.0.0-alpha.7 → 0.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +1 -1
- package/dist/Actions/ContractAction.d.ts +46 -3
- package/dist/Actions/ContractAction.d.ts.map +1 -1
- package/dist/Actions/ERC721MintAction.d.ts +37 -10
- 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 +257 -11
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +249 -82
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.d.ts +2 -2
- package/dist/AllowLists/AllowList.js +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +33 -4
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +52 -37
- 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 +31 -2
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +41 -129
- package/dist/AllowLists/SimpleDenyList.js.map +1 -1
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.cjs.map +1 -1
- package/dist/Auth/PassthroughAuth.js +4 -4
- package/dist/Auth/PassthroughAuth.js.map +1 -1
- package/dist/Boost.cjs +1 -1
- package/dist/Boost.cjs.map +1 -1
- package/dist/Boost.d.ts +93 -1
- package/dist/Boost.d.ts.map +1 -1
- package/dist/Boost.js +151 -5
- package/dist/Boost.js.map +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +45 -7
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +352 -305
- 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 +18 -4
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +36 -25
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +40 -2
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +53 -36
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/SimpleBudget.d.ts +33 -2
- package/dist/Budgets/SimpleBudget.d.ts.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +54 -2
- 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.js +1 -1
- package/dist/Deployable/Contract.js.map +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +8 -2
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +6 -0
- 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 +4 -3
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +31 -28
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +35 -5
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +33 -21
- 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 +89 -5
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +44 -23
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC1155Incentive.d.ts +67 -6
- 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 +49 -5
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +46 -27
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +42 -5
- 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.js +48 -32
- 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 +49 -5
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +38 -21
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.d.ts +298 -5
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +151 -26
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +1 -1
- 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/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +15 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +30 -21
- package/dist/errors.js.map +1 -1
- package/dist/{generated-DGpIVcv5.js → generated-57_Kffpz.js} +293 -282
- package/dist/generated-57_Kffpz.js.map +1 -0
- package/dist/{generated-Cd-Fe7W7.cjs → generated-wKBNvm48.cjs} +3 -3
- package/dist/generated-wKBNvm48.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +108 -124
- 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 +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +2 -1371
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +26 -653
- package/dist/utils.js.map +1 -1
- package/package.json +17 -3
- package/src/Actions/Action.test.ts +5 -4
- package/src/Actions/ContractAction.test.ts +4 -6
- package/src/Actions/ContractAction.ts +73 -10
- package/src/Actions/ERC721MintAction.test.ts +2 -2
- package/src/Actions/ERC721MintAction.ts +70 -16
- package/src/Actions/EventAction.test.ts +43 -17
- package/src/Actions/EventAction.ts +451 -26
- package/src/AllowLists/SimpleAllowList.ts +51 -7
- package/src/AllowLists/SimpleDenyList.ts +47 -109
- package/src/Auth/PassthroughAuth.ts +1 -1
- package/src/Boost.ts +136 -1
- package/src/BoostCore.test.ts +4 -11
- package/src/BoostCore.ts +114 -45
- package/src/BoostRegistry.ts +39 -21
- package/src/Budgets/ManagedBudget.ts +69 -16
- package/src/Budgets/SimpleBudget.ts +57 -14
- package/src/Budgets/VestingBudget.ts +79 -9
- package/src/Deployable/Contract.ts +1 -1
- package/src/Deployable/Deployable.ts +8 -2
- package/src/Deployable/DeployableTarget.ts +19 -6
- package/src/Incentives/AllowListIncentive.test.ts +2 -5
- package/src/Incentives/AllowListIncentive.ts +59 -15
- package/src/Incentives/CGDAIncentive.test.ts +3 -7
- package/src/Incentives/CGDAIncentive.ts +123 -19
- package/src/Incentives/ERC1155Incentive.test.ts +2 -13
- package/src/Incentives/ERC1155Incentive.ts +104 -22
- package/src/Incentives/ERC20Incentive.test.ts +6 -17
- package/src/Incentives/ERC20Incentive.ts +86 -21
- package/src/Incentives/ERC20VariableIncentive.test.ts +4 -24
- package/src/Incentives/ERC20VariableIncentive.ts +71 -19
- package/src/Incentives/Incentive.test.ts +1 -1
- package/src/Incentives/PointsIncentive.test.ts +3 -6
- package/src/Incentives/PointsIncentive.ts +79 -17
- package/src/Validators/SignerValidator.test.ts +3 -7
- package/src/Validators/SignerValidator.ts +422 -13
- package/src/claiming.ts +56 -0
- package/src/errors.ts +19 -1
- package/src/index.ts +10 -7
- package/src/transfers.ts +284 -0
- package/src/utils.ts +3 -2052
- package/dist/generated-Cd-Fe7W7.cjs.map +0 -1
- package/dist/generated-DGpIVcv5.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./BoostRegistry.cjs"),a=require("./BoostCore.cjs"),p=require("./Boost.cjs"),c=require("./Actions/Action.cjs"),o=require("./Actions/EventAction.cjs"),y=require("./AllowLists/AllowList.cjs"),l=require("./AllowLists/SimpleAllowList.cjs"),u=require("./AllowLists/SimpleDenyList.cjs"),A=require("./Budgets/Budget.cjs"),t=require("./Budgets/ManagedBudget.cjs"),m=require("./Deployable/Deployable.cjs"),P=require("./Deployable/Contract.cjs"),S=require("./Deployable/DeployableTarget.cjs"),E=require("./Incentives/AllowListIncentive.cjs"),g=require("./Incentives/CGDAIncentive.cjs"),v=require("./Incentives/ERC20Incentive.cjs"),s=require("./Incentives/Incentive.cjs"),C=require("./Incentives/PointsIncentive.cjs"),n=require("./Validators/SignerValidator.cjs"),I=require("./Validators/Validator.cjs"),e=require("./errors.cjs"),i=require("./utils.cjs"),B=require("./Auth/PassthroughAuth.cjs"),r=require("./generated-wKBNvm48.cjs");exports.BOOST_REGISTRY_ADDRESS=d.BOOST_REGISTRY_ADDRESS;exports.BoostRegistry=d.BoostRegistry;exports.BOOST_CORE_ADDRESS=a.BOOST_CORE_ADDRESS;exports.BOOST_CORE_CLAIM_FEE=a.BOOST_CORE_CLAIM_FEE;exports.BoostCore=a.BoostCore;exports.Boost=p.Boost;exports.prepareBoostPayload=p.prepareBoostPayload;exports.ActionByComponentInterface=c.ActionByComponentInterface;exports.actionFromAddress=c.actionFromAddress;exports.EventAction=o.EventAction;exports.FilterType=o.FilterType;exports.PrimitiveType=o.PrimitiveType;exports.SignatureType=o.SignatureType;exports.isEventActionPayloadSimple=o.isEventActionPayloadSimple;exports.prepareEventActionPayload=o.prepareEventActionPayload;exports.AllowListByComponentInterface=y.AllowListByComponentInterface;exports.allowListFromAddress=y.allowListFromAddress;exports.LIST_MANAGER_ROLE=l.LIST_MANAGER_ROLE;exports.SimpleAllowList=l.SimpleAllowList;exports.prepareSimpleAllowListPayload=l.prepareSimpleAllowListPayload;exports.SimpleDenyList=u.SimpleDenyList;exports.prepareSimpleDenyListPayload=u.prepareSimpleDenyListPayload;exports.BudgetByComponentInterface=A.BudgetByComponentInterface;exports.budgetFromAddress=A.budgetFromAddress;exports.ManagedBudget=t.ManagedBudget;exports.ManagedBudgetRoles=t.ManagedBudgetRoles;exports.isERC1155TransferPayload=t.isERC1155TransferPayload;exports.isFungibleTransfer=t.isFungibleTransfer;exports.prepareManagedBudgetPayload=t.prepareManagedBudgetPayload;exports.prepareTransfer=t.prepareTransfer;exports.Deployable=m.Deployable;exports.Contract=P.Contract;exports.DeployableTarget=S.DeployableTarget;exports.AllowListIncentive=E.AllowListIncentive;exports.prepareAllowListIncentivePayload=E.prepareAllowListIncentivePayload;exports.CGDAIncentive=g.CGDAIncentive;exports.prepareCGDAIncentivePayload=g.prepareCGDAIncentivePayload;exports.ERC20Incentive=v.ERC20Incentive;exports.prepareERC20IncentivePayload=v.prepareERC20IncentivePayload;exports.ERC20VariableIncentive=s.ERC20VariableIncentive;exports.IncentiveByComponentInterface=s.IncentiveByComponentInterface;exports.incentiveFromAddress=s.incentiveFromAddress;exports.PointsIncentive=C.PointsIncentive;exports.preparePointsIncentivePayload=C.preparePointsIncentivePayload;exports.SignerValidator=n.SignerValidator;exports.prepareSignerValidatorClaimDataPayload=n.prepareSignerValidatorClaimDataPayload;exports.prepareSignerValidatorInputParams=n.prepareSignerValidatorInputParams;exports.prepareSignerValidatorPayload=n.prepareSignerValidatorPayload;exports.ValidatorByComponentInterface=I.ValidatorByComponentInterface;exports.validatorFromAddress=I.validatorFromAddress;exports.BoostCoreNoIdentifierEmitted=e.BoostCoreNoIdentifierEmitted;exports.BudgetMustAuthorizeBoostCore=e.BudgetMustAuthorizeBoostCore;exports.ContractAddressRequiredError=e.ContractAddressRequiredError;exports.DeployableAlreadyDeployedError=e.DeployableAlreadyDeployedError;exports.DeployableBuildParametersUnspecifiedError=e.DeployableBuildParametersUnspecifiedError;exports.DeployableMissingPayloadError=e.DeployableMissingPayloadError;exports.DeployableUnknownOwnerProvidedError=e.DeployableUnknownOwnerProvidedError;exports.DeployableWagmiConfigurationRequiredError=e.DeployableWagmiConfigurationRequiredError;exports.EventActionValidationError=e.EventActionValidationError;exports.FieldValueNotComparableError=e.FieldValueNotComparableError;exports.FieldValueUndefinedError=e.FieldValueUndefinedError;exports.IncentiveNotCloneableError=e.IncentiveNotCloneableError;exports.InvalidComponentInterfaceError=e.InvalidComponentInterfaceError;exports.InvalidNumericalCriteriaError=e.InvalidNumericalCriteriaError;exports.MustInitializeBudgetError=e.MustInitializeBudgetError;exports.NoContractAddressUponReceiptError=e.NoContractAddressUponReceiptError;exports.NoEventActionStepsProvidedError=e.NoEventActionStepsProvidedError;exports.TooManyEventActionStepsProvidedError=e.TooManyEventActionStepsProvidedError;exports.UnknownTransferPayloadSupplied=e.UnknownTransferPayloadSupplied;exports.UnrecognizedFilterTypeError=e.UnrecognizedFilterTypeError;exports.RegistryType=i.RegistryType;exports.awaitResult=i.awaitResult;exports.bytes4=i.bytes4;exports.getDeployedContractAddress=i.getDeployedContractAddress;exports.PassthroughAuth=B.PassthroughAuth;exports.allowListIncentiveAbi=r.A;exports.boostCoreAbi=r.c;exports.boostRegistryAbi=r.ee;exports.cgdaIncentiveAbi=r.v;exports.erc20IncentiveAbi=r.f;exports.managedBudgetAbi=r.p;exports.passthroughAuthAbi=r.ze;exports.pointsIncentiveAbi=r.l;exports.signerValidatorAbi=r.M;exports.simpleAllowListAbi=r.T;exports.simpleDenyListAbi=r.S;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
export * from './BoostRegistry';
|
|
2
2
|
export * from './BoostCore';
|
|
3
3
|
export * from './Boost';
|
|
4
|
-
export * from './errors';
|
|
5
|
-
export * from './utils';
|
|
6
|
-
export * from './Auth/Auth';
|
|
7
|
-
export * from './Auth/PassthroughAuth';
|
|
8
4
|
export * from './Actions/Action';
|
|
9
5
|
export * from './Actions/EventAction';
|
|
10
6
|
export * from './AllowLists/AllowList';
|
|
@@ -22,4 +18,8 @@ export * from './Incentives/Incentive';
|
|
|
22
18
|
export * from './Incentives/PointsIncentive';
|
|
23
19
|
export * from './Validators/SignerValidator';
|
|
24
20
|
export * from './Validators/Validator';
|
|
21
|
+
export * from './errors';
|
|
22
|
+
export * from './utils';
|
|
23
|
+
export * from './Auth/Auth';
|
|
24
|
+
export * from './Auth/PassthroughAuth';
|
|
25
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAIxB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,uBAAuB,CAAC;AAItC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAI5C,cAAc,kBAAkB,CAAC;AAGjC,cAAc,yBAAyB,CAAC;AAIxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAI9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAI7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AAIvC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAIxB,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,129 +1,113 @@
|
|
|
1
|
-
import { BOOST_REGISTRY_ADDRESS as o, BoostRegistry as
|
|
2
|
-
import { BOOST_CORE_ADDRESS as i,
|
|
3
|
-
import { Boost as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { A as
|
|
1
|
+
import { BOOST_REGISTRY_ADDRESS as o, BoostRegistry as t } from "./BoostRegistry.js";
|
|
2
|
+
import { BOOST_CORE_ADDRESS as i, BOOST_CORE_CLAIM_FEE as n, BoostCore as p } from "./BoostCore.js";
|
|
3
|
+
import { Boost as s, prepareBoostPayload as d } from "./Boost.js";
|
|
4
|
+
import { ActionByComponentInterface as A, actionFromAddress as y } from "./Actions/Action.js";
|
|
5
|
+
import { EventAction as f, FilterType as E, PrimitiveType as g, SignatureType as v, isEventActionPayloadSimple as I, prepareEventActionPayload as C } from "./Actions/EventAction.js";
|
|
6
|
+
import { AllowListByComponentInterface as b, allowListFromAddress as x } from "./AllowLists/AllowList.js";
|
|
7
|
+
import { LIST_MANAGER_ROLE as S, SimpleAllowList as B, prepareSimpleAllowListPayload as R } from "./AllowLists/SimpleAllowList.js";
|
|
8
|
+
import { SimpleDenyList as T, prepareSimpleDenyListPayload as L } from "./AllowLists/SimpleDenyList.js";
|
|
9
|
+
import { BudgetByComponentInterface as F, budgetFromAddress as M } from "./Budgets/Budget.js";
|
|
10
|
+
import { ManagedBudget as V, ManagedBudgetRoles as _, isERC1155TransferPayload as h, isFungibleTransfer as N, prepareManagedBudgetPayload as U, prepareTransfer as z } from "./Budgets/ManagedBudget.js";
|
|
11
|
+
import { Deployable as k } from "./Deployable/Deployable.js";
|
|
12
|
+
import { Contract as W } from "./Deployable/Contract.js";
|
|
13
|
+
import { DeployableTarget as j } from "./Deployable/DeployableTarget.js";
|
|
14
|
+
import { AllowListIncentive as J, prepareAllowListIncentivePayload as K } from "./Incentives/AllowListIncentive.js";
|
|
15
|
+
import { CGDAIncentive as X, prepareCGDAIncentivePayload as Z } from "./Incentives/CGDAIncentive.js";
|
|
16
|
+
import { ERC20Incentive as ee, prepareERC20IncentivePayload as re } from "./Incentives/ERC20Incentive.js";
|
|
17
|
+
import { ERC20VariableIncentive as te, IncentiveByComponentInterface as ae, incentiveFromAddress as ie } from "./Incentives/Incentive.js";
|
|
18
|
+
import { PointsIncentive as pe, preparePointsIncentivePayload as le } from "./Incentives/PointsIncentive.js";
|
|
19
|
+
import { SignerValidator as de, prepareSignerValidatorClaimDataPayload as me, prepareSignerValidatorInputParams as Ae, prepareSignerValidatorPayload as ye } from "./Validators/SignerValidator.js";
|
|
20
|
+
import { ValidatorByComponentInterface as fe, validatorFromAddress as Ee } from "./Validators/Validator.js";
|
|
21
|
+
import { BoostCoreNoIdentifierEmitted as ve, BudgetMustAuthorizeBoostCore as Ie, ContractAddressRequiredError as Ce, DeployableAlreadyDeployedError as ue, DeployableBuildParametersUnspecifiedError as be, DeployableMissingPayloadError as xe, DeployableUnknownOwnerProvidedError as Pe, DeployableWagmiConfigurationRequiredError as Se, EventActionValidationError as Be, FieldValueNotComparableError as Re, FieldValueUndefinedError as De, IncentiveNotCloneableError as Te, InvalidComponentInterfaceError as Le, InvalidNumericalCriteriaError as we, MustInitializeBudgetError as Fe, NoContractAddressUponReceiptError as Me, NoEventActionStepsProvidedError as Oe, TooManyEventActionStepsProvidedError as Ve, UnknownTransferPayloadSupplied as _e, UnrecognizedFilterTypeError as he } from "./errors.js";
|
|
22
|
+
import { RegistryType as Ue, awaitResult as ze, bytes4 as Ge, getDeployedContractAddress as ke } from "./utils.js";
|
|
23
|
+
import { PassthroughAuth as We } from "./Auth/PassthroughAuth.js";
|
|
24
|
+
import { A as je, c as He, e as Je, v as Ke, f as Qe, p as Xe, z as Ze, l as $e, M as er, T as rr, S as or } from "./generated-57_Kffpz.js";
|
|
25
25
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
L as AssetType,
|
|
26
|
+
A as ActionByComponentInterface,
|
|
27
|
+
b as AllowListByComponentInterface,
|
|
28
|
+
J as AllowListIncentive,
|
|
30
29
|
i as BOOST_CORE_ADDRESS,
|
|
30
|
+
n as BOOST_CORE_CLAIM_FEE,
|
|
31
31
|
o as BOOST_REGISTRY_ADDRESS,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
ae as prepareFungibleTransfer,
|
|
113
|
-
te as prepareManagedBudgetPayload,
|
|
114
|
-
ie as preparePointsIncentivePayload,
|
|
115
|
-
ne as prepareSignerValidatorClaimDataPayload,
|
|
116
|
-
pe as prepareSignerValidatorInputParams,
|
|
117
|
-
le as prepareSignerValidatorPayload,
|
|
118
|
-
de as prepareSimpleAllowListPayload,
|
|
119
|
-
se as prepareSimpleBudgetPayload,
|
|
120
|
-
ye as prepareSimpleDenyListPayload,
|
|
121
|
-
Oe as prepareTransfer,
|
|
122
|
-
me as prepareTransferPayload,
|
|
123
|
-
ce as prepareVestingBudgetPayload,
|
|
124
|
-
Er as signerValidatorAbi,
|
|
125
|
-
gr as simpleAllowListAbi,
|
|
126
|
-
Cr as simpleDenyListAbi,
|
|
127
|
-
nr as validatorFromAddress
|
|
32
|
+
s as Boost,
|
|
33
|
+
p as BoostCore,
|
|
34
|
+
ve as BoostCoreNoIdentifierEmitted,
|
|
35
|
+
t as BoostRegistry,
|
|
36
|
+
F as BudgetByComponentInterface,
|
|
37
|
+
Ie as BudgetMustAuthorizeBoostCore,
|
|
38
|
+
X as CGDAIncentive,
|
|
39
|
+
W as Contract,
|
|
40
|
+
Ce as ContractAddressRequiredError,
|
|
41
|
+
k as Deployable,
|
|
42
|
+
ue as DeployableAlreadyDeployedError,
|
|
43
|
+
be as DeployableBuildParametersUnspecifiedError,
|
|
44
|
+
xe as DeployableMissingPayloadError,
|
|
45
|
+
j as DeployableTarget,
|
|
46
|
+
Pe as DeployableUnknownOwnerProvidedError,
|
|
47
|
+
Se as DeployableWagmiConfigurationRequiredError,
|
|
48
|
+
ee as ERC20Incentive,
|
|
49
|
+
te as ERC20VariableIncentive,
|
|
50
|
+
f as EventAction,
|
|
51
|
+
Be as EventActionValidationError,
|
|
52
|
+
Re as FieldValueNotComparableError,
|
|
53
|
+
De as FieldValueUndefinedError,
|
|
54
|
+
E as FilterType,
|
|
55
|
+
ae as IncentiveByComponentInterface,
|
|
56
|
+
Te as IncentiveNotCloneableError,
|
|
57
|
+
Le as InvalidComponentInterfaceError,
|
|
58
|
+
we as InvalidNumericalCriteriaError,
|
|
59
|
+
S as LIST_MANAGER_ROLE,
|
|
60
|
+
V as ManagedBudget,
|
|
61
|
+
_ as ManagedBudgetRoles,
|
|
62
|
+
Fe as MustInitializeBudgetError,
|
|
63
|
+
Me as NoContractAddressUponReceiptError,
|
|
64
|
+
Oe as NoEventActionStepsProvidedError,
|
|
65
|
+
We as PassthroughAuth,
|
|
66
|
+
pe as PointsIncentive,
|
|
67
|
+
g as PrimitiveType,
|
|
68
|
+
Ue as RegistryType,
|
|
69
|
+
v as SignatureType,
|
|
70
|
+
de as SignerValidator,
|
|
71
|
+
B as SimpleAllowList,
|
|
72
|
+
T as SimpleDenyList,
|
|
73
|
+
Ve as TooManyEventActionStepsProvidedError,
|
|
74
|
+
_e as UnknownTransferPayloadSupplied,
|
|
75
|
+
he as UnrecognizedFilterTypeError,
|
|
76
|
+
fe as ValidatorByComponentInterface,
|
|
77
|
+
y as actionFromAddress,
|
|
78
|
+
x as allowListFromAddress,
|
|
79
|
+
je as allowListIncentiveAbi,
|
|
80
|
+
ze as awaitResult,
|
|
81
|
+
He as boostCoreAbi,
|
|
82
|
+
Je as boostRegistryAbi,
|
|
83
|
+
M as budgetFromAddress,
|
|
84
|
+
Ge as bytes4,
|
|
85
|
+
Ke as cgdaIncentiveAbi,
|
|
86
|
+
Qe as erc20IncentiveAbi,
|
|
87
|
+
ke as getDeployedContractAddress,
|
|
88
|
+
ie as incentiveFromAddress,
|
|
89
|
+
h as isERC1155TransferPayload,
|
|
90
|
+
I as isEventActionPayloadSimple,
|
|
91
|
+
N as isFungibleTransfer,
|
|
92
|
+
Xe as managedBudgetAbi,
|
|
93
|
+
Ze as passthroughAuthAbi,
|
|
94
|
+
$e as pointsIncentiveAbi,
|
|
95
|
+
K as prepareAllowListIncentivePayload,
|
|
96
|
+
d as prepareBoostPayload,
|
|
97
|
+
Z as prepareCGDAIncentivePayload,
|
|
98
|
+
re as prepareERC20IncentivePayload,
|
|
99
|
+
C as prepareEventActionPayload,
|
|
100
|
+
U as prepareManagedBudgetPayload,
|
|
101
|
+
le as preparePointsIncentivePayload,
|
|
102
|
+
me as prepareSignerValidatorClaimDataPayload,
|
|
103
|
+
Ae as prepareSignerValidatorInputParams,
|
|
104
|
+
ye as prepareSignerValidatorPayload,
|
|
105
|
+
R as prepareSimpleAllowListPayload,
|
|
106
|
+
L as prepareSimpleDenyListPayload,
|
|
107
|
+
z as prepareTransfer,
|
|
108
|
+
er as signerValidatorAbi,
|
|
109
|
+
rr as simpleAllowListAbi,
|
|
110
|
+
or as simpleDenyListAbi,
|
|
111
|
+
Ee as validatorFromAddress
|
|
128
112
|
};
|
|
129
113
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("viem");var n=(e=>(e[e.ETH=0]="ETH",e[e.ERC20=1]="ERC20",e[e.ERC1155=2]="ERC1155",e))(n||{});const p=({assetType:e,address:r,target:t,data:s})=>a.encodeAbiParameters([{type:"uint8",name:"assetType"},{type:"address",name:"asset"},{type:"address",name:"target"},{type:"bytes",name:"data"}],[e,r,t,s]);function d({tokenId:e,amount:r}){return a.encodeAbiParameters(a.parseAbiParameters(["ERC1155Payload payload","struct ERC1155Payload { uint256 tokenId; uint256 amount; bytes data; }"]),[{tokenId:e,amount:r,data:"0x"}])}function o({tokenId:e,amount:r,asset:t,target:s}){return a.encodeAbiParameters(a.parseAbiParameters(["Transfer request","struct Transfer { uint8 assetType; address asset; address target; bytes data; }"]),[{assetType:2,asset:t,data:d({tokenId:e,amount:r}),target:s}])}function u({amount:e}){return a.encodeAbiParameters(a.parseAbiParameters(["FungiblePayload payload","struct FungiblePayload { uint256 amount; }"]),[{amount:e}])}function i({amount:e,asset:r,target:t}){return a.encodeAbiParameters(a.parseAbiParameters(["Transfer request","struct Transfer { uint8 assetType; address asset; address target; bytes data; }"]),[{assetType:r==a.zeroAddress?0:1,asset:r,data:u({amount:e}),target:t}])}exports.AssetType=n;exports.prepareERC1155Payload=d;exports.prepareERC1155Transfer=o;exports.prepareFungiblePayload=u;exports.prepareFungibleTransfer=i;exports.prepareTransferPayload=p;
|
|
2
|
+
//# sourceMappingURL=transfers.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transfers.cjs","sources":["../src/transfers.ts"],"sourcesContent":["import {\n type Address,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\n\n/**\n * The various types of assets supported in Budgets and Incentives.\n *\n * @export\n * @enum {number}\n */\nexport enum AssetType {\n ETH,\n ERC20,\n ERC1155,\n}\n\n/**\n * Object representation of a generic `Transfer` struct.\n *\n * @export\n * @interface TransferPayload\n * @typedef {TransferPayload}\n */\nexport interface TransferPayload {\n /**\n * The type of the asset being transferred.\n *\n * @type {AssetType}\n */\n assetType: AssetType;\n /**\n * The address of the asset to transfer, zero address for ETH.\n *\n * @type {Address}\n */\n address: Address;\n /**\n * The account from which to transfer the assets.\n *\n * @type {Address}\n */\n target: Address;\n /**\n * An encoded {@link FungiblePayload}, use {@link prepareFungiblePayload} to construct.\n *\n * @type {Hex}\n */\n data: Hex;\n}\n\n/**\n * Encodes parameters for transferring the transfer of Fungible and ERC1155 assets, used for {@link Budget} operations.\n * Typically you'd use {@link prepareFungibleTransfer} or {@link prepareERC1155Transfer}\n *\n * @param {TransferPayload} param0\n * @param {AssetType} param0.assetType - The asset type being transferred.\n * @param {Address} param0.address - The address of the asset, use zero address for ETH transfers.\n * @param {Address} param0.target - The address of the account being transferred from\n * @param {Hex} param0.data - Use {@link prepareFungiblePayload} to properly encode an amount to transfer\n * @returns {Hex}\n */\nexport const prepareTransferPayload = ({\n assetType,\n address,\n target,\n data,\n}: TransferPayload) => {\n return encodeAbiParameters(\n [\n { type: 'uint8', name: 'assetType' },\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'target' },\n { type: 'bytes', name: 'data' },\n ],\n [assetType, address, target, data],\n );\n};\n\n/**\n * Object representation of\n *\n * @export\n * @interface ERC1155Payload\n * @typedef {ERC1155Payload}\n */\nexport interface ERC1155Payload {\n /**\n * The ERC1155 token ID for the incentive\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Given a token ID and amount, properly encode a `ERC1155Incentive.ERC1155Payload` for use with {@link ERC1155Incentive} initialization.\n *\n * @export\n * @param {ERC1155Payload} param0\n * @param {bigint} param0.tokenId - The ERC1155 token ID for the incentive\n * @param {bigint} param0.amount - The amount to transfer\n * @returns {Hex}\n */\nexport function prepareERC1155Payload({ tokenId, amount }: ERC1155Payload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ERC1155Payload payload',\n 'struct ERC1155Payload { uint256 tokenId; uint256 amount; bytes data; }',\n ]),\n [{ tokenId, amount, data: '0x' }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of ERC1155 assets.\n *\n * @export\n * @interface ERC1155TransferPayload\n * @typedef {ERC1155TransferPayload}\n */\nexport interface ERC1155TransferPayload {\n /**\n * The token ID to transfer\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset to target\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for transferring the transfer of ERC1155 assets, used for {@link Budget} operations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {ERC1155TransferPayload} param0\n * @param {bigint} param0.tokenId - The token ID to transfer\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset to target\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareERC1155Transfer({\n tokenId,\n amount,\n asset,\n target,\n}: ERC1155TransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: AssetType.ERC1155,\n asset,\n data: prepareERC1155Payload({ tokenId, amount }),\n target,\n },\n ],\n );\n}\n\n/**\n * An object representation of the `FungiblePayload` struct\n *\n * @export\n * @interface FungiblePayload\n * @typedef {FungiblePayload}\n */\nexport interface FungiblePayload {\n /**\n * The amount being transferred\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Encodes an amount for the `FungiblePayload` struct\n *\n * @export\n * @param {FungiblePayload} param0\n * @param {bigint} param0.amount - The amount being transferred\n * @returns {*}\n */\nexport function prepareFungiblePayload({ amount }: FungiblePayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'FungiblePayload payload',\n 'struct FungiblePayload { uint256 amount; }',\n ]),\n [{ amount }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of fungible assets.\n *\n * @export\n * @interface FungibleTransferPayload\n * @typedef {FungibleTransferPayload}\n */\nexport interface FungibleTransferPayload {\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset. Use zero address for ETH transfers.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for a Fungible transfer, used for Budget allocations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {FungibleTransferPayload} param0\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset. Use zero address for ETH transfers.\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareFungibleTransfer({\n amount,\n asset,\n target,\n}: FungibleTransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: asset == zeroAddress ? AssetType.ETH : AssetType.ERC20,\n asset,\n data: prepareFungiblePayload({ amount }),\n target,\n },\n ],\n );\n}\n"],"names":["AssetType","AssetType2","prepareTransferPayload","assetType","address","target","data","encodeAbiParameters","prepareERC1155Payload","tokenId","amount","parseAbiParameters","prepareERC1155Transfer","asset","prepareFungiblePayload","prepareFungibleTransfer","zeroAddress"],"mappings":"wGAcY,IAAAA,GAAAA,IACVA,EAAAC,EAAA,IAAA,CAAA,EAAA,MACAD,EAAAC,EAAA,MAAA,CAAA,EAAA,QACAD,EAAAC,EAAA,QAAA,CAAA,EAAA,UAHUD,IAAAA,GAAA,CAAA,CAAA,EAmDL,MAAME,EAAyB,CAAC,CACrC,UAAAC,EACA,QAAAC,EACA,OAAAC,EACA,KAAAC,CACF,IACSC,EAAA,oBACL,CACE,CAAE,KAAM,QAAS,KAAM,WAAY,EACnC,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,QAAS,KAAM,MAAO,CAChC,EACA,CAACJ,EAAWC,EAASC,EAAQC,CAAI,CAAA,EAmC9B,SAASE,EAAsB,CAAE,QAAAC,EAAS,OAAAC,GAA0B,CAClE,OAAAH,EAAA,oBACLI,qBAAmB,CACjB,yBACA,wEAAA,CACD,EACD,CAAC,CAAE,QAAAF,EAAS,OAAAC,EAAQ,KAAM,KAAM,CAAA,CAEpC,CAgDO,SAASE,EAAuB,CACrC,QAAAH,EACA,OAAAC,EACA,MAAAG,EACA,OAAAR,CACF,EAA2B,CAClB,OAAAE,EAAA,oBACLI,qBAAmB,CACjB,mBACA,iFAAA,CACD,EACD,CACE,CACE,UAAW,EACX,MAAAE,EACA,KAAML,EAAsB,CAAE,QAAAC,EAAS,OAAAC,EAAQ,EAC/C,OAAAL,CACF,CACF,CAAA,CAEJ,CA0BgB,SAAAS,EAAuB,CAAE,OAAAJ,GAA2B,CAC3D,OAAAH,EAAA,oBACLI,qBAAmB,CACjB,0BACA,4CAAA,CACD,EACD,CAAC,CAAE,OAAAD,CAAA,CAAQ,CAAA,CAEf,CAyCO,SAASK,EAAwB,CACtC,OAAAL,EACA,MAAAG,EACA,OAAAR,CACF,EAA4B,CACnB,OAAAE,EAAA,oBACLI,qBAAmB,CACjB,mBACA,iFAAA,CACD,EACD,CACE,CACE,UAAWE,GAASG,cAAc,EAAgB,EAClD,MAAAH,EACA,KAAMC,EAAuB,CAAE,OAAAJ,EAAQ,EACvC,OAAAL,CACF,CACF,CAAA,CAEJ"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* The various types of assets supported in Budgets and Incentives.
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @enum {number}
|
|
7
|
+
*/
|
|
8
|
+
export declare enum AssetType {
|
|
9
|
+
ETH = 0,
|
|
10
|
+
ERC20 = 1,
|
|
11
|
+
ERC1155 = 2
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Object representation of a generic `Transfer` struct.
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @interface TransferPayload
|
|
18
|
+
* @typedef {TransferPayload}
|
|
19
|
+
*/
|
|
20
|
+
export interface TransferPayload {
|
|
21
|
+
/**
|
|
22
|
+
* The type of the asset being transferred.
|
|
23
|
+
*
|
|
24
|
+
* @type {AssetType}
|
|
25
|
+
*/
|
|
26
|
+
assetType: AssetType;
|
|
27
|
+
/**
|
|
28
|
+
* The address of the asset to transfer, zero address for ETH.
|
|
29
|
+
*
|
|
30
|
+
* @type {Address}
|
|
31
|
+
*/
|
|
32
|
+
address: Address;
|
|
33
|
+
/**
|
|
34
|
+
* The account from which to transfer the assets.
|
|
35
|
+
*
|
|
36
|
+
* @type {Address}
|
|
37
|
+
*/
|
|
38
|
+
target: Address;
|
|
39
|
+
/**
|
|
40
|
+
* An encoded {@link FungiblePayload}, use {@link prepareFungiblePayload} to construct.
|
|
41
|
+
*
|
|
42
|
+
* @type {Hex}
|
|
43
|
+
*/
|
|
44
|
+
data: Hex;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Encodes parameters for transferring the transfer of Fungible and ERC1155 assets, used for {@link Budget} operations.
|
|
48
|
+
* Typically you'd use {@link prepareFungibleTransfer} or {@link prepareERC1155Transfer}
|
|
49
|
+
*
|
|
50
|
+
* @param {TransferPayload} param0
|
|
51
|
+
* @param {AssetType} param0.assetType - The asset type being transferred.
|
|
52
|
+
* @param {Address} param0.address - The address of the asset, use zero address for ETH transfers.
|
|
53
|
+
* @param {Address} param0.target - The address of the account being transferred from
|
|
54
|
+
* @param {Hex} param0.data - Use {@link prepareFungiblePayload} to properly encode an amount to transfer
|
|
55
|
+
* @returns {Hex}
|
|
56
|
+
*/
|
|
57
|
+
export declare const prepareTransferPayload: ({ assetType, address, target, data, }: TransferPayload) => `0x${string}`;
|
|
58
|
+
/**
|
|
59
|
+
* Object representation of
|
|
60
|
+
*
|
|
61
|
+
* @export
|
|
62
|
+
* @interface ERC1155Payload
|
|
63
|
+
* @typedef {ERC1155Payload}
|
|
64
|
+
*/
|
|
65
|
+
export interface ERC1155Payload {
|
|
66
|
+
/**
|
|
67
|
+
* The ERC1155 token ID for the incentive
|
|
68
|
+
*
|
|
69
|
+
* @type {bigint}
|
|
70
|
+
*/
|
|
71
|
+
tokenId: bigint;
|
|
72
|
+
/**
|
|
73
|
+
* The amount to transfer
|
|
74
|
+
*
|
|
75
|
+
* @type {bigint}
|
|
76
|
+
*/
|
|
77
|
+
amount: bigint;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Given a token ID and amount, properly encode a `ERC1155Incentive.ERC1155Payload` for use with {@link ERC1155Incentive} initialization.
|
|
81
|
+
*
|
|
82
|
+
* @export
|
|
83
|
+
* @param {ERC1155Payload} param0
|
|
84
|
+
* @param {bigint} param0.tokenId - The ERC1155 token ID for the incentive
|
|
85
|
+
* @param {bigint} param0.amount - The amount to transfer
|
|
86
|
+
* @returns {Hex}
|
|
87
|
+
*/
|
|
88
|
+
export declare function prepareERC1155Payload({ tokenId, amount }: ERC1155Payload): `0x${string}`;
|
|
89
|
+
/**
|
|
90
|
+
* An object representation of the `Budget.Transfer` contract struct for transfers of ERC1155 assets.
|
|
91
|
+
*
|
|
92
|
+
* @export
|
|
93
|
+
* @interface ERC1155TransferPayload
|
|
94
|
+
* @typedef {ERC1155TransferPayload}
|
|
95
|
+
*/
|
|
96
|
+
export interface ERC1155TransferPayload {
|
|
97
|
+
/**
|
|
98
|
+
* The token ID to transfer
|
|
99
|
+
*
|
|
100
|
+
* @type {bigint}
|
|
101
|
+
*/
|
|
102
|
+
tokenId: bigint;
|
|
103
|
+
/**
|
|
104
|
+
* The amount to transfer
|
|
105
|
+
*
|
|
106
|
+
* @type {bigint}
|
|
107
|
+
*/
|
|
108
|
+
amount: bigint;
|
|
109
|
+
/**
|
|
110
|
+
* The address of the asset to target
|
|
111
|
+
*
|
|
112
|
+
* @type {Address}
|
|
113
|
+
*/
|
|
114
|
+
asset: Address;
|
|
115
|
+
/**
|
|
116
|
+
* The account to transfer from
|
|
117
|
+
*
|
|
118
|
+
* @type {Address}
|
|
119
|
+
*/
|
|
120
|
+
target: Address;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Encodes parameters for transferring the transfer of ERC1155 assets, used for {@link Budget} operations.
|
|
124
|
+
* The caller must have already approved the contract to transfer the asset.
|
|
125
|
+
*
|
|
126
|
+
* @export
|
|
127
|
+
* @param {ERC1155TransferPayload} param0
|
|
128
|
+
* @param {bigint} param0.tokenId - The token ID to transfer
|
|
129
|
+
* @param {bigint} param0.amount - The amount to transfer
|
|
130
|
+
* @param {Address} param0.asset - The address of the asset to target
|
|
131
|
+
* @param {Address} param0.target - The account to transfer from
|
|
132
|
+
* @returns {Hex}
|
|
133
|
+
*/
|
|
134
|
+
export declare function prepareERC1155Transfer({ tokenId, amount, asset, target, }: ERC1155TransferPayload): `0x${string}`;
|
|
135
|
+
/**
|
|
136
|
+
* An object representation of the `FungiblePayload` struct
|
|
137
|
+
*
|
|
138
|
+
* @export
|
|
139
|
+
* @interface FungiblePayload
|
|
140
|
+
* @typedef {FungiblePayload}
|
|
141
|
+
*/
|
|
142
|
+
export interface FungiblePayload {
|
|
143
|
+
/**
|
|
144
|
+
* The amount being transferred
|
|
145
|
+
*
|
|
146
|
+
* @type {bigint}
|
|
147
|
+
*/
|
|
148
|
+
amount: bigint;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Encodes an amount for the `FungiblePayload` struct
|
|
152
|
+
*
|
|
153
|
+
* @export
|
|
154
|
+
* @param {FungiblePayload} param0
|
|
155
|
+
* @param {bigint} param0.amount - The amount being transferred
|
|
156
|
+
* @returns {*}
|
|
157
|
+
*/
|
|
158
|
+
export declare function prepareFungiblePayload({ amount }: FungiblePayload): `0x${string}`;
|
|
159
|
+
/**
|
|
160
|
+
* An object representation of the `Budget.Transfer` contract struct for transfers of fungible assets.
|
|
161
|
+
*
|
|
162
|
+
* @export
|
|
163
|
+
* @interface FungibleTransferPayload
|
|
164
|
+
* @typedef {FungibleTransferPayload}
|
|
165
|
+
*/
|
|
166
|
+
export interface FungibleTransferPayload {
|
|
167
|
+
/**
|
|
168
|
+
* The amount to transfer
|
|
169
|
+
*
|
|
170
|
+
* @type {bigint}
|
|
171
|
+
*/
|
|
172
|
+
amount: bigint;
|
|
173
|
+
/**
|
|
174
|
+
* The address of the asset. Use zero address for ETH transfers.
|
|
175
|
+
*
|
|
176
|
+
* @type {Address}
|
|
177
|
+
*/
|
|
178
|
+
asset: Address;
|
|
179
|
+
/**
|
|
180
|
+
* The account to transfer from
|
|
181
|
+
*
|
|
182
|
+
* @type {Address}
|
|
183
|
+
*/
|
|
184
|
+
target: Address;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Encodes parameters for a Fungible transfer, used for Budget allocations.
|
|
188
|
+
* The caller must have already approved the contract to transfer the asset.
|
|
189
|
+
*
|
|
190
|
+
* @export
|
|
191
|
+
* @param {FungibleTransferPayload} param0
|
|
192
|
+
* @param {bigint} param0.amount - The amount to transfer
|
|
193
|
+
* @param {Address} param0.asset - The address of the asset. Use zero address for ETH transfers.
|
|
194
|
+
* @param {Address} param0.target - The account to transfer from
|
|
195
|
+
* @returns {Hex}
|
|
196
|
+
*/
|
|
197
|
+
export declare function prepareFungibleTransfer({ amount, asset, target, }: FungibleTransferPayload): `0x${string}`;
|
|
198
|
+
//# sourceMappingURL=transfers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transfers.d.ts","sourceRoot":"","sources":["../src/transfers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EAIT,MAAM,MAAM,CAAC;AAEd;;;;;GAKG;AACH,oBAAY,SAAS;IACnB,GAAG,IAAA;IACH,KAAK,IAAA;IACL,OAAO,IAAA;CACR;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,GAAG,CAAC;CACX;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,0CAKhC,eAAe,kBAUjB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,cAAc,iBAQxE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,EACP,MAAM,EACN,KAAK,EACL,MAAM,GACP,EAAE,sBAAsB,iBAexB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,MAAM,EAAE,EAAE,eAAe,iBAQjE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,KAAK,EACL,MAAM,GACP,EAAE,uBAAuB,iBAezB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { encodeAbiParameters as t, parseAbiParameters as n, zeroAddress as d } from "viem";
|
|
2
|
+
var u = /* @__PURE__ */ ((a) => (a[a.ETH = 0] = "ETH", a[a.ERC20 = 1] = "ERC20", a[a.ERC1155 = 2] = "ERC1155", a))(u || {});
|
|
3
|
+
const y = ({
|
|
4
|
+
assetType: a,
|
|
5
|
+
address: e,
|
|
6
|
+
target: r,
|
|
7
|
+
data: s
|
|
8
|
+
}) => t(
|
|
9
|
+
[
|
|
10
|
+
{ type: "uint8", name: "assetType" },
|
|
11
|
+
{ type: "address", name: "asset" },
|
|
12
|
+
{ type: "address", name: "target" },
|
|
13
|
+
{ type: "bytes", name: "data" }
|
|
14
|
+
],
|
|
15
|
+
[a, e, r, s]
|
|
16
|
+
);
|
|
17
|
+
function o({ tokenId: a, amount: e }) {
|
|
18
|
+
return t(
|
|
19
|
+
n([
|
|
20
|
+
"ERC1155Payload payload",
|
|
21
|
+
"struct ERC1155Payload { uint256 tokenId; uint256 amount; bytes data; }"
|
|
22
|
+
]),
|
|
23
|
+
[{ tokenId: a, amount: e, data: "0x" }]
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function l({
|
|
27
|
+
tokenId: a,
|
|
28
|
+
amount: e,
|
|
29
|
+
asset: r,
|
|
30
|
+
target: s
|
|
31
|
+
}) {
|
|
32
|
+
return t(
|
|
33
|
+
n([
|
|
34
|
+
"Transfer request",
|
|
35
|
+
"struct Transfer { uint8 assetType; address asset; address target; bytes data; }"
|
|
36
|
+
]),
|
|
37
|
+
[
|
|
38
|
+
{
|
|
39
|
+
assetType: 2,
|
|
40
|
+
asset: r,
|
|
41
|
+
data: o({ tokenId: a, amount: e }),
|
|
42
|
+
target: s
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function p({ amount: a }) {
|
|
48
|
+
return t(
|
|
49
|
+
n([
|
|
50
|
+
"FungiblePayload payload",
|
|
51
|
+
"struct FungiblePayload { uint256 amount; }"
|
|
52
|
+
]),
|
|
53
|
+
[{ amount: a }]
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function f({
|
|
57
|
+
amount: a,
|
|
58
|
+
asset: e,
|
|
59
|
+
target: r
|
|
60
|
+
}) {
|
|
61
|
+
return t(
|
|
62
|
+
n([
|
|
63
|
+
"Transfer request",
|
|
64
|
+
"struct Transfer { uint8 assetType; address asset; address target; bytes data; }"
|
|
65
|
+
]),
|
|
66
|
+
[
|
|
67
|
+
{
|
|
68
|
+
assetType: e == d ? 0 : 1,
|
|
69
|
+
asset: e,
|
|
70
|
+
data: p({ amount: a }),
|
|
71
|
+
target: r
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
u as AssetType,
|
|
78
|
+
o as prepareERC1155Payload,
|
|
79
|
+
l as prepareERC1155Transfer,
|
|
80
|
+
p as prepareFungiblePayload,
|
|
81
|
+
f as prepareFungibleTransfer,
|
|
82
|
+
y as prepareTransferPayload
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=transfers.js.map
|