@boostxyz/sdk 0.0.0-alpha.2 → 0.0.0-alpha.21
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 +2 -1
- package/dist/Actions/Action.cjs.map +1 -0
- package/dist/Actions/Action.d.ts +1 -1
- package/dist/Actions/Action.d.ts.map +1 -1
- package/dist/Actions/Action.js +14 -12
- package/dist/Actions/Action.js.map +1 -0
- package/dist/Actions/ContractAction.d.ts +57 -14
- package/dist/Actions/ContractAction.d.ts.map +1 -1
- package/dist/Actions/ERC721MintAction.d.ts +50 -23
- package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.cjs +2 -1
- package/dist/Actions/EventAction.cjs.map +1 -0
- package/dist/Actions/EventAction.d.ts +405 -36
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +15 -209
- package/dist/Actions/EventAction.js.map +1 -0
- package/dist/AllowLists/AllowList.cjs +2 -1
- package/dist/AllowLists/AllowList.cjs.map +1 -0
- package/dist/AllowLists/AllowList.d.ts +6 -5
- package/dist/AllowLists/AllowList.d.ts.map +1 -1
- package/dist/AllowLists/AllowList.js +46 -22
- package/dist/AllowLists/AllowList.js.map +1 -0
- package/dist/AllowLists/OpenAllowList.d.ts +423 -0
- package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleAllowList.cjs +2 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
- package/dist/AllowLists/SimpleAllowList.d.ts +124 -40
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +76 -76
- package/dist/AllowLists/SimpleAllowList.js.map +1 -0
- package/dist/AllowLists/SimpleDenyList.cjs +2 -1
- package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
- package/dist/AllowLists/SimpleDenyList.d.ts +234 -13
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +12 -200
- package/dist/AllowLists/SimpleDenyList.js.map +1 -0
- package/dist/Auth/Auth.cjs +1 -0
- package/dist/Auth/Auth.cjs.map +1 -0
- package/dist/Auth/Auth.js +1 -0
- package/dist/Auth/Auth.js.map +1 -0
- package/dist/Auth/PassthroughAuth.cjs +2 -1
- package/dist/Auth/PassthroughAuth.cjs.map +1 -0
- package/dist/Auth/PassthroughAuth.js +5 -4
- package/dist/Auth/PassthroughAuth.js.map +1 -0
- package/dist/Boost.cjs +2 -1
- package/dist/Boost.cjs.map +1 -0
- package/dist/Boost.d.ts +105 -14
- package/dist/Boost.d.ts.map +1 -1
- package/dist/Boost.js +138 -5
- package/dist/Boost.js.map +1 -0
- package/dist/BoostCore-DolmDuXW.cjs +3 -0
- package/dist/BoostCore-DolmDuXW.cjs.map +1 -0
- package/dist/BoostCore-Z97KVu4V.js +1448 -0
- package/dist/BoostCore-Z97KVu4V.js.map +1 -0
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -0
- package/dist/BoostCore.d.ts +788 -79
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +30 -1103
- package/dist/BoostCore.js.map +1 -0
- package/dist/BoostRegistry.cjs +2 -1
- package/dist/BoostRegistry.cjs.map +1 -0
- package/dist/BoostRegistry.d.ts +95 -26
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +183 -89
- package/dist/BoostRegistry.js.map +1 -0
- package/dist/Budgets/Budget.cjs +2 -1
- package/dist/Budgets/Budget.cjs.map +1 -0
- package/dist/Budgets/Budget.d.ts +1 -1
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +15 -13
- package/dist/Budgets/Budget.js.map +1 -0
- package/dist/Budgets/ManagedBudget.cjs +2 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -0
- package/dist/Budgets/ManagedBudget.d.ts +112 -192
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +91 -291
- package/dist/Budgets/ManagedBudget.js.map +1 -0
- package/dist/Budgets/VestingBudget.d.ts +277 -91
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Contract.cjs +2 -1
- package/dist/Deployable/Contract.cjs.map +1 -0
- package/dist/Deployable/Contract.d.ts +4 -5
- package/dist/Deployable/Contract.d.ts.map +1 -1
- package/dist/Deployable/Contract.js +7 -8
- package/dist/Deployable/Contract.js.map +1 -0
- package/dist/Deployable/Deployable.cjs +1 -0
- package/dist/Deployable/Deployable.cjs.map +1 -0
- package/dist/Deployable/Deployable.d.ts +9 -3
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +10 -5
- package/dist/Deployable/Deployable.js.map +1 -0
- package/dist/Deployable/DeployableTarget.cjs +2 -1
- package/dist/Deployable/DeployableTarget.cjs.map +1 -0
- package/dist/Deployable/DeployableTarget.d.ts +16 -15
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +49 -42
- package/dist/Deployable/DeployableTarget.js.map +1 -0
- 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-CBKzuNoN.cjs +2 -0
- package/dist/EventAction-CBKzuNoN.cjs.map +1 -0
- package/dist/EventAction-DWuuc_Qy.js +1528 -0
- package/dist/EventAction-DWuuc_Qy.js.map +1 -0
- package/dist/Incentive-BxzEtN26.js +298 -0
- package/dist/Incentive-BxzEtN26.js.map +1 -0
- package/dist/Incentive-CrF3-ayL.cjs +2 -0
- package/dist/Incentive-CrF3-ayL.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +2 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.d.ts +65 -21
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +52 -36
- package/dist/Incentives/AllowListIncentive.js.map +1 -0
- package/dist/Incentives/CGDAIncentive.cjs +2 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
- package/dist/Incentives/CGDAIncentive.d.ts +315 -26
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +64 -39
- package/dist/Incentives/CGDAIncentive.js.map +1 -0
- package/dist/Incentives/ERC1155Incentive.d.ts +291 -43
- package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +2 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
- package/dist/Incentives/ERC20Incentive.d.ts +270 -33
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +69 -46
- package/dist/Incentives/ERC20Incentive.js.map +1 -0
- package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +338 -421
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +262 -32
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.cjs +2 -1
- package/dist/Incentives/Incentive.cjs.map +1 -0
- package/dist/Incentives/Incentive.d.ts +5 -8
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +17 -278
- package/dist/Incentives/Incentive.js.map +1 -0
- package/dist/Incentives/PointsIncentive.cjs +2 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -0
- package/dist/Incentives/PointsIncentive.d.ts +81 -23
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +57 -36
- package/dist/Incentives/PointsIncentive.js.map +1 -0
- 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 +2 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -0
- package/dist/Validators/SignerValidator.d.ts +310 -17
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +165 -36
- package/dist/Validators/SignerValidator.js.map +1 -0
- package/dist/Validators/Validator.cjs +2 -1
- package/dist/Validators/Validator.cjs.map +1 -0
- package/dist/Validators/Validator.d.ts +2 -2
- package/dist/Validators/Validator.d.ts.map +1 -1
- package/dist/Validators/Validator.js +10 -8
- package/dist/Validators/Validator.js.map +1 -0
- package/dist/claiming.cjs +2 -0
- package/dist/claiming.cjs.map +1 -0
- package/dist/claiming.d.ts +43 -0
- package/dist/claiming.d.ts.map +1 -0
- package/dist/claiming.js +17 -0
- package/dist/claiming.js.map +1 -0
- package/dist/componentInterfaces-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 +2 -1
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.ts +421 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +297 -39
- package/dist/errors.js.map +1 -0
- package/dist/{generated-x_abr3Yv.js → generated-CKt2yCQd.js} +3143 -3002
- 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 +2 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +10 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +144 -1353
- package/dist/index.js.map +1 -0
- package/dist/transfers.cjs +2 -0
- package/dist/transfers.cjs.map +1 -0
- package/dist/transfers.d.ts +198 -0
- package/dist/transfers.d.ts.map +1 -0
- package/dist/transfers.js +84 -0
- package/dist/transfers.js.map +1 -0
- package/dist/utils.cjs +2 -1
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.ts +26 -1350
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +38 -636
- package/dist/utils.js.map +1 -0
- package/package.json +37 -11
- package/src/Actions/Action.test.ts +79 -0
- package/src/Actions/Action.ts +61 -0
- package/src/Actions/ContractAction.test.ts +197 -0
- package/src/Actions/ContractAction.ts +300 -0
- package/src/Actions/ERC721MintAction.test.ts +112 -0
- package/src/Actions/ERC721MintAction.ts +291 -0
- package/src/Actions/EventAction.test.ts +787 -0
- package/src/Actions/EventAction.ts +1218 -0
- package/src/AllowLists/AllowList.test.ts +64 -0
- package/src/AllowLists/AllowList.ts +62 -0
- package/src/AllowLists/OpenAllowList.test.ts +40 -0
- package/src/AllowLists/OpenAllowList.ts +45 -0
- package/src/AllowLists/SimpleAllowList.test.ts +52 -0
- package/src/AllowLists/SimpleAllowList.ts +262 -0
- package/src/AllowLists/SimpleDenyList.test.ts +52 -0
- package/src/AllowLists/SimpleDenyList.ts +250 -0
- package/src/Auth/Auth.ts +11 -0
- package/src/Auth/PassthroughAuth.test.ts +12 -0
- package/src/Auth/PassthroughAuth.ts +80 -0
- package/src/Boost.ts +287 -0
- package/src/BoostCore.test.ts +894 -0
- package/src/BoostCore.ts +1438 -0
- package/src/BoostRegistry.test.ts +53 -0
- package/src/BoostRegistry.ts +588 -0
- package/src/Budgets/Budget.test.ts +27 -0
- package/src/Budgets/Budget.ts +60 -0
- package/src/Budgets/ManagedBudget.test.ts +217 -0
- package/src/Budgets/ManagedBudget.ts +534 -0
- package/src/Budgets/VestingBudget.test.ts +123 -0
- package/src/Budgets/VestingBudget.ts +530 -0
- package/src/Deployable/Contract.ts +228 -0
- package/src/Deployable/Deployable.ts +250 -0
- package/src/Deployable/DeployableTarget.ts +234 -0
- package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
- package/src/Incentives/AllowListIncentive.test.ts +143 -0
- package/src/Incentives/AllowListIncentive.ts +336 -0
- package/src/Incentives/CGDAIncentive.test.ts +135 -0
- package/src/Incentives/CGDAIncentive.ts +476 -0
- package/src/Incentives/ERC1155Incentive.test.ts +87 -0
- package/src/Incentives/ERC1155Incentive.ts +465 -0
- package/src/Incentives/ERC20Incentive.test.ts +133 -0
- package/src/Incentives/ERC20Incentive.ts +490 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.ts +309 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +139 -0
- package/src/Incentives/ERC20VariableIncentive.ts +428 -0
- package/src/Incentives/Incentive.test.ts +95 -0
- package/src/Incentives/Incentive.ts +86 -0
- package/src/Incentives/PointsIncentive.test.ts +138 -0
- package/src/Incentives/PointsIncentive.ts +367 -0
- package/src/Validators/SignerValidator.test.ts +159 -0
- package/src/Validators/SignerValidator.ts +683 -0
- package/src/Validators/Validator.test.ts +21 -0
- package/src/Validators/Validator.ts +55 -0
- package/src/claiming.ts +56 -0
- package/src/errors.ts +866 -0
- package/src/index.test.ts +122 -0
- package/src/index.ts +58 -0
- package/src/transfers.ts +284 -0
- package/src/utils.test.ts +44 -0
- package/src/utils.ts +247 -0
- package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
- package/dist/generated-BaaleHW-.cjs +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManagedBudget.js","sources":["../../src/Budgets/ManagedBudget.ts"],"sourcesContent":["import {\n managedBudgetAbi,\n readManagedBudgetAvailable,\n readManagedBudgetDistributed,\n readManagedBudgetHasAllRoles,\n readManagedBudgetHasAnyRole,\n readManagedBudgetIsAuthorized,\n readManagedBudgetOwner,\n readManagedBudgetRolesOf,\n readManagedBudgetTotal,\n simulateManagedBudgetAllocate,\n simulateManagedBudgetClawback,\n simulateManagedBudgetDisburse,\n simulateManagedBudgetDisburseBatch,\n simulateManagedBudgetGrantRoles,\n simulateManagedBudgetRevokeRoles,\n simulateManagedBudgetSetAuthorized,\n writeManagedBudgetAllocate,\n writeManagedBudgetClawback,\n writeManagedBudgetDisburse,\n writeManagedBudgetDisburseBatch,\n writeManagedBudgetGrantRoles,\n writeManagedBudgetRevokeRoles,\n writeManagedBudgetSetAuthorized,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/budgets/ManagedBudget.sol/ManagedBudget.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\nimport { ManagedBudget as ManagedBudgetBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { DeployableTargetWithRBAC } from '../Deployable/DeployableTargetWithRBAC';\nimport {\n DeployableUnknownOwnerProvidedError,\n UnknownTransferPayloadSupplied,\n} from '../errors';\nimport {\n type ERC1155TransferPayload,\n type FungibleTransferPayload,\n prepareERC1155Transfer,\n prepareFungibleTransfer,\n} from '../transfers';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\nexport { managedBudgetAbi };\nexport type { ERC1155TransferPayload, FungibleTransferPayload };\n\n/**\n * The object representation of a `ManagedBudgetPayload.InitPayload`\n *\n * @export\n * @interface ManagedBudgetPayload\n * @typedef {ManagedBudgetPayload}\n */\nexport interface ManagedBudgetPayload {\n /**\n * The budget's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n *\n * @type {Address[]}\n */\n authorized: Address[];\n /**\n * List of roles to assign to the corresponding account by index.\n *\n * @type {ManagedBudgetRoles[]}\n */\n roles: ManagedBudgetRoles[];\n}\n\n/**\n * Enum representing available roles for use in the `ManagedBudget`.\n * `MANAGER` can disburse funds.\n * `ADMIN` can additionally manage authorized users on the budget.\n *\n * @export\n * @type {{ readonly MANAGER: 1n; readonly ADMIN_ROLE: 2n; }}\n * @enum {bigint}\n */\nexport enum ManagedBudgetRoles {\n //@ts-expect-error ts doesn't like bigint enum values\n MANAGER = 1n,\n //@ts-expect-error ts doesn't like bigint enum values\n ADMIN = 2n,\n}\n\n/**\n * A generic `viem.Log` event with support for `ManagedBudget` event types.\n *\n * @export\n * @typedef {ManagedBudgetLog}\n * @template {ContractEventName<typeof managedBudgetAbi>} [event=ContractEventName<\n * typeof managedBudgetAbi\n * >]\n */\nexport type ManagedBudgetLog<\n event extends ContractEventName<typeof managedBudgetAbi> = ContractEventName<\n typeof managedBudgetAbi\n >,\n> = GenericLog<typeof managedBudgetAbi, event>;\n\n/**\n * Typeguard to determine if a transfer payload is a Fungible Transfer\n *\n * @export\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @returns {transfer is FungibleTransferPayload}\n */\nexport function isFungibleTransfer(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n): transfer is FungibleTransferPayload {\n return (transfer as ERC1155TransferPayload).tokenId === undefined;\n}\n\n/**\n * Typeguard to determine if a transfer payload is an ERC1155 Transfer\n *\n * @export\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @returns {transfer is ERC1155TransferPayload}\n */\nexport function isERC1155TransferPayload(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n): transfer is ERC1155TransferPayload {\n return (transfer as ERC1155TransferPayload).tokenId !== undefined;\n}\n\n/**\n * Given either a Fungible transfer, or ERC1155 transfer, will properly encode parameters for transfers, claims, disbursements, allocations, etc.\n *\n * @export\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @returns {Hex}\n * @throws {@link UnknownTransferPayloadSupplied}\n */\nexport function prepareTransfer(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n) {\n if (isFungibleTransfer(transfer)) {\n return prepareFungibleTransfer(transfer);\n }\n if (isERC1155TransferPayload(transfer)) {\n return prepareERC1155Transfer(transfer);\n }\n throw new UnknownTransferPayloadSupplied(transfer);\n}\n\n/**\n * A minimal budget implementation that simply holds and distributes tokens (ERC20-like and native)\n * This type of budget supports ETH, ERC20, and ERC1155 assets only\n *\n * @export\n * @class ManagedBudget\n * @typedef {ManagedBudget}\n * @extends {DeployableTargetWithRBAC<ManagedBudgetPayload>}\n */\nexport class ManagedBudget extends DeployableTargetWithRBAC<\n ManagedBudgetPayload,\n typeof managedBudgetAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = managedBudgetAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n ...(ManagedBudgetBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.BUDGET;\n\n /**\n * Allocates assets to the budget.\n * The caller must have already approved the contract to transfer the asset\n * If the asset transfer fails, the allocation will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the allocation was successful\n */\n public async allocate(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'allocate'>,\n ) {\n return await this.awaitResult(this.allocateRaw(transfer, params));\n }\n\n /**\n * Allocates assets to the budget.\n * The caller must have already approved the contract to transfer the asset\n * If the asset transfer fails, the allocation will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the allocation was successful\n */\n public async allocateRaw(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'allocate'>,\n ) {\n const { request, result } = await simulateManagedBudgetAllocate(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareTransfer(transfer)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeManagedBudgetAllocate(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawbacks assets from the budget.\n * Only the owner can directly clawback assets from the budget\n * If the amount is zero, the entire balance of the asset will be transferred to the receiver\n * If the asset transfer fails, the reclamation will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the request was successful\n */\n public async clawback(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'clawback'>,\n ) {\n return await this.awaitResult(this.clawbackRaw(transfer, params));\n }\n\n /**\n * Clawbacks assets from the budget.\n * Only the owner can directly clawback assets from the budget\n * If the amount is zero, the entire balance of the asset will be transferred to the receiver\n * If the asset transfer fails, the reclamation will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the request was successful\n */\n public async clawbackRaw(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'clawback'>,\n ) {\n const { request, result } = await simulateManagedBudgetClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareTransfer(transfer)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeManagedBudgetClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Disburses assets from the budget to a single recipient\n * If the asset transfer fails, the disbursement will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the disbursement was successful\n */\n public async disburse(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'disburse'>,\n ) {\n return await this.awaitResult(this.disburseRaw(transfer, params));\n }\n\n /**\n * Disburses assets from the budget to a single recipient\n * If the asset transfer fails, the disbursement will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the disbursement was successful\n */\n public async disburseRaw(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'disburse'>,\n ) {\n const { request, result } = await simulateManagedBudgetDisburse(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareTransfer(transfer)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeManagedBudgetDisburse(this._config, request);\n return { hash, result };\n }\n\n /**\n * Disburses assets from the budget to multiple recipients\n *\n * @public\n * @async\n * @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if all disbursements were successful\n */\n public async disburseBatch(\n transfers: Array<FungibleTransferPayload | ERC1155TransferPayload>,\n params?: WriteParams<typeof managedBudgetAbi, 'disburseBatch'>,\n ) {\n return await this.awaitResult(this.disburseBatchRaw(transfers, params));\n }\n\n /**\n * Disburses assets from the budget to multiple recipients\n *\n * @public\n * @async\n * @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if all disbursements were successful\n */\n public async disburseBatchRaw(\n transfers: Array<FungibleTransferPayload | ERC1155TransferPayload>,\n params?: WriteParams<typeof managedBudgetAbi, 'disburseBatch'>,\n ) {\n const { request, result } = await simulateManagedBudgetDisburseBatch(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [transfers.map(prepareTransfer)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeManagedBudgetDisburseBatch(this._config, request);\n return { hash, result };\n }\n\n /**\n * Get the owner of the budget\n *\n * @public\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public owner(params?: ReadParams<typeof managedBudgetAbi, 'owner'>) {\n return readManagedBudgetOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the total amount of assets allocated to the budget, including any that have been distributed\n * If a tokenId is provided, get the total amount of ERC1155 assets allocated to the budget, including any that have been distributed\n *\n * @public\n * @param {Address} [asset=\"0x0000000000000000000000000000000000000000\"] - The address of the asset\n * @param {?(bigint | undefined)} [tokenId] - The ID of the token\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The total amount of assets\n */\n public total(\n asset: Address = zeroAddress,\n tokenId?: bigint | undefined,\n params?: ReadParams<typeof managedBudgetAbi, 'total'>,\n ) {\n return readManagedBudgetTotal(this._config, {\n address: this.assertValidAddress(),\n args: tokenId ? [asset, tokenId] : [asset],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the amount of assets available for distribution from the budget.\n * If a tokenId is provided, get the amount of ERC1155 assets available for distribution from the budget\n *\n * @public\n * @param {Address} [asset=\"0x0000000000000000000000000000000000000000\"]\n * @param {?(bigint | undefined)} [tokenId]\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The amount of assets available\n */\n public available(\n asset: Address = zeroAddress,\n tokenId?: bigint | undefined,\n params?: ReadParams<typeof managedBudgetAbi, 'available'>,\n ) {\n return readManagedBudgetAvailable(this._config, {\n address: this.assertValidAddress(),\n args: tokenId ? [asset, tokenId] : [asset],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the amount of assets that have been distributed from the budget.\n * If a tokenId is provided, get the amount of ERC1155 assets that have been distributed from the budget\n *\n * @public\n * @param {Address} [asset=\"0x0000000000000000000000000000000000000000\"]\n * @param {?(bigint | undefined)} [tokenId]\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The amount of assets distributed\n */\n public distributed(\n asset: Address = zeroAddress,\n tokenId?: bigint | undefined,\n params?: ReadParams<typeof managedBudgetAbi, 'distributed'>,\n ) {\n return readManagedBudgetDistributed(this._config, {\n address: this.assertValidAddress(),\n args: tokenId ? [asset, tokenId] : [asset],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ManagedBudgetPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ManagedBudgetPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: managedBudgetAbi,\n bytecode: bytecode as Hex,\n args: [prepareManagedBudgetPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link ManagedBudgetPayload}, properly encode a `ManagedBudget.InitPayload` for use with {@link ManagedBudget} initialization.\n *\n * @param {ManagedBudgetPayload} param0\n * @param {Address} param0.owner - The budget's owner\n * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n * @param {{}} param0.roles - List of roles to assign to the corresponding account by index.\n * @returns {Hex}\n */\nexport const prepareManagedBudgetPayload = ({\n owner,\n authorized,\n roles,\n}: ManagedBudgetPayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ManagedBudgetPayload payload',\n 'struct ManagedBudgetPayload { address owner; address[] authorized; uint256[] roles; }',\n ]),\n [{ owner, authorized, roles: roles as unknown as Array<bigint> }],\n );\n};\n"],"names":["ManagedBudgetRoles","isFungibleTransfer","transfer","isERC1155TransferPayload","prepareTransfer","prepareFungibleTransfer","prepareERC1155Transfer","UnknownTransferPayloadSupplied","_ManagedBudget","DeployableTargetWithRBAC","managedBudgetAbi","params","request","result","simulateManagedBudgetAllocate","writeManagedBudgetAllocate","simulateManagedBudgetClawback","writeManagedBudgetClawback","simulateManagedBudgetDisburse","writeManagedBudgetDisburse","transfers","simulateManagedBudgetDisburseBatch","writeManagedBudgetDisburseBatch","readManagedBudgetOwner","asset","zeroAddress","tokenId","readManagedBudgetTotal","readManagedBudgetAvailable","readManagedBudgetDistributed","_payload","_options","payload","options","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareManagedBudgetPayload","ManagedBudgetBases","RegistryType","ManagedBudget","authorized","roles","encodeAbiParameters","parse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AAAS,GAAY,OAAAC,GAA0C;AAAA;"}
|
|
@@ -1,10 +1,50 @@
|
|
|
1
1
|
import { vestingBudgetAbi } from '@boostxyz/evm';
|
|
2
2
|
import { type Address, type ContractEventName } from 'viem';
|
|
3
3
|
import type { DeployableOptions, GenericDeployableParams } from '../Deployable/Deployable';
|
|
4
|
-
import {
|
|
5
|
-
import { type FungibleTransferPayload
|
|
4
|
+
import { DeployableTargetWithRBAC } from '../Deployable/DeployableTargetWithRBAC';
|
|
5
|
+
import { type FungibleTransferPayload } from '../transfers';
|
|
6
|
+
import { type GenericLog, type ReadParams, RegistryType, type WriteParams } from '../utils';
|
|
6
7
|
export { vestingBudgetAbi };
|
|
7
|
-
export type {
|
|
8
|
+
export type { FungibleTransferPayload };
|
|
9
|
+
/**
|
|
10
|
+
* The object representation of a `VestingBudget.InitPayload`
|
|
11
|
+
*
|
|
12
|
+
* @export
|
|
13
|
+
* @interface VestingBudgetPayload
|
|
14
|
+
* @typedef {VestingBudgetPayload}
|
|
15
|
+
*/
|
|
16
|
+
export interface VestingBudgetPayload {
|
|
17
|
+
/**
|
|
18
|
+
* The budget's owner.
|
|
19
|
+
*
|
|
20
|
+
* @type {Address}
|
|
21
|
+
*/
|
|
22
|
+
owner: Address;
|
|
23
|
+
/**
|
|
24
|
+
* List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
|
|
25
|
+
*
|
|
26
|
+
* @type {Address[]}
|
|
27
|
+
*/
|
|
28
|
+
authorized: Address[];
|
|
29
|
+
/**
|
|
30
|
+
* The timestamp at which the vesting schedule begins
|
|
31
|
+
*
|
|
32
|
+
* @type {bigint}
|
|
33
|
+
*/
|
|
34
|
+
start: bigint;
|
|
35
|
+
/**
|
|
36
|
+
* The duration of the vesting schedule (in seconds)
|
|
37
|
+
*
|
|
38
|
+
* @type {bigint}
|
|
39
|
+
*/
|
|
40
|
+
duration: bigint;
|
|
41
|
+
/**
|
|
42
|
+
* The duration of the cliff period (in seconds)
|
|
43
|
+
*
|
|
44
|
+
* @type {bigint}
|
|
45
|
+
*/
|
|
46
|
+
cliff: bigint;
|
|
47
|
+
}
|
|
8
48
|
/**
|
|
9
49
|
* A generic `viem.Log` event with support for `VestingBudget` event types.
|
|
10
50
|
*
|
|
@@ -26,9 +66,9 @@ export type VestingBudgetLog<event extends ContractEventName<typeof vestingBudge
|
|
|
26
66
|
* @export
|
|
27
67
|
* @class VestingBudget
|
|
28
68
|
* @typedef {VestingBudget}
|
|
29
|
-
* @extends {
|
|
69
|
+
* @extends {DeployableTargetWithRBAC<VestingBudgetPayload>}
|
|
30
70
|
*/
|
|
31
|
-
export declare class VestingBudget extends
|
|
71
|
+
export declare class VestingBudget extends DeployableTargetWithRBAC<VestingBudgetPayload, typeof vestingBudgetAbi> {
|
|
32
72
|
readonly abi: readonly [{
|
|
33
73
|
readonly type: "constructor";
|
|
34
74
|
readonly inputs: readonly [];
|
|
@@ -126,20 +166,9 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
126
166
|
readonly inputs: readonly [];
|
|
127
167
|
readonly name: "Unauthorized";
|
|
128
168
|
}, {
|
|
129
|
-
readonly type: "
|
|
130
|
-
readonly
|
|
131
|
-
readonly
|
|
132
|
-
readonly name: "account";
|
|
133
|
-
readonly internalType: "address";
|
|
134
|
-
readonly type: "address";
|
|
135
|
-
readonly indexed: true;
|
|
136
|
-
}, {
|
|
137
|
-
readonly name: "isAuthorized";
|
|
138
|
-
readonly internalType: "bool";
|
|
139
|
-
readonly type: "bool";
|
|
140
|
-
readonly indexed: false;
|
|
141
|
-
}];
|
|
142
|
-
readonly name: "Authorized";
|
|
169
|
+
readonly type: "error";
|
|
170
|
+
readonly inputs: readonly [];
|
|
171
|
+
readonly name: "Unauthorized";
|
|
143
172
|
}, {
|
|
144
173
|
readonly type: "event";
|
|
145
174
|
readonly anonymous: false;
|
|
@@ -205,9 +234,44 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
205
234
|
readonly indexed: true;
|
|
206
235
|
}];
|
|
207
236
|
readonly name: "OwnershipTransferred";
|
|
237
|
+
}, {
|
|
238
|
+
readonly type: "event";
|
|
239
|
+
readonly anonymous: false;
|
|
240
|
+
readonly inputs: readonly [{
|
|
241
|
+
readonly name: "user";
|
|
242
|
+
readonly internalType: "address";
|
|
243
|
+
readonly type: "address";
|
|
244
|
+
readonly indexed: true;
|
|
245
|
+
}, {
|
|
246
|
+
readonly name: "roles";
|
|
247
|
+
readonly internalType: "uint256";
|
|
248
|
+
readonly type: "uint256";
|
|
249
|
+
readonly indexed: true;
|
|
250
|
+
}];
|
|
251
|
+
readonly name: "RolesUpdated";
|
|
208
252
|
}, {
|
|
209
253
|
readonly type: "fallback";
|
|
210
254
|
readonly stateMutability: "payable";
|
|
255
|
+
}, {
|
|
256
|
+
readonly type: "function";
|
|
257
|
+
readonly inputs: readonly [];
|
|
258
|
+
readonly name: "ADMIN_ROLE";
|
|
259
|
+
readonly outputs: readonly [{
|
|
260
|
+
readonly name: "";
|
|
261
|
+
readonly internalType: "uint256";
|
|
262
|
+
readonly type: "uint256";
|
|
263
|
+
}];
|
|
264
|
+
readonly stateMutability: "view";
|
|
265
|
+
}, {
|
|
266
|
+
readonly type: "function";
|
|
267
|
+
readonly inputs: readonly [];
|
|
268
|
+
readonly name: "MANAGER_ROLE";
|
|
269
|
+
readonly outputs: readonly [{
|
|
270
|
+
readonly name: "";
|
|
271
|
+
readonly internalType: "uint256";
|
|
272
|
+
readonly type: "uint256";
|
|
273
|
+
}];
|
|
274
|
+
readonly stateMutability: "view";
|
|
211
275
|
}, {
|
|
212
276
|
readonly type: "function";
|
|
213
277
|
readonly inputs: readonly [{
|
|
@@ -252,8 +316,38 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
252
316
|
readonly name: "clawback";
|
|
253
317
|
readonly outputs: readonly [{
|
|
254
318
|
readonly name: "";
|
|
255
|
-
readonly internalType: "
|
|
256
|
-
readonly type: "
|
|
319
|
+
readonly internalType: "uint256";
|
|
320
|
+
readonly type: "uint256";
|
|
321
|
+
}];
|
|
322
|
+
readonly stateMutability: "nonpayable";
|
|
323
|
+
}, {
|
|
324
|
+
readonly type: "function";
|
|
325
|
+
readonly inputs: readonly [{
|
|
326
|
+
readonly name: "target";
|
|
327
|
+
readonly internalType: "address";
|
|
328
|
+
readonly type: "address";
|
|
329
|
+
}, {
|
|
330
|
+
readonly name: "data_";
|
|
331
|
+
readonly internalType: "bytes";
|
|
332
|
+
readonly type: "bytes";
|
|
333
|
+
}, {
|
|
334
|
+
readonly name: "boostId";
|
|
335
|
+
readonly internalType: "uint256";
|
|
336
|
+
readonly type: "uint256";
|
|
337
|
+
}, {
|
|
338
|
+
readonly name: "incentiveId";
|
|
339
|
+
readonly internalType: "uint256";
|
|
340
|
+
readonly type: "uint256";
|
|
341
|
+
}];
|
|
342
|
+
readonly name: "clawbackFromTarget";
|
|
343
|
+
readonly outputs: readonly [{
|
|
344
|
+
readonly name: "";
|
|
345
|
+
readonly internalType: "uint256";
|
|
346
|
+
readonly type: "uint256";
|
|
347
|
+
}, {
|
|
348
|
+
readonly name: "";
|
|
349
|
+
readonly internalType: "address";
|
|
350
|
+
readonly type: "address";
|
|
257
351
|
}];
|
|
258
352
|
readonly stateMutability: "nonpayable";
|
|
259
353
|
}, {
|
|
@@ -348,6 +442,70 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
348
442
|
readonly type: "bytes4";
|
|
349
443
|
}];
|
|
350
444
|
readonly stateMutability: "pure";
|
|
445
|
+
}, {
|
|
446
|
+
readonly type: "function";
|
|
447
|
+
readonly inputs: readonly [{
|
|
448
|
+
readonly name: "user";
|
|
449
|
+
readonly internalType: "address";
|
|
450
|
+
readonly type: "address";
|
|
451
|
+
}, {
|
|
452
|
+
readonly name: "roles";
|
|
453
|
+
readonly internalType: "uint256";
|
|
454
|
+
readonly type: "uint256";
|
|
455
|
+
}];
|
|
456
|
+
readonly name: "grantRoles";
|
|
457
|
+
readonly outputs: readonly [];
|
|
458
|
+
readonly stateMutability: "payable";
|
|
459
|
+
}, {
|
|
460
|
+
readonly type: "function";
|
|
461
|
+
readonly inputs: readonly [{
|
|
462
|
+
readonly name: "accounts_";
|
|
463
|
+
readonly internalType: "address[]";
|
|
464
|
+
readonly type: "address[]";
|
|
465
|
+
}, {
|
|
466
|
+
readonly name: "roles_";
|
|
467
|
+
readonly internalType: "uint256[]";
|
|
468
|
+
readonly type: "uint256[]";
|
|
469
|
+
}];
|
|
470
|
+
readonly name: "grantRoles";
|
|
471
|
+
readonly outputs: readonly [];
|
|
472
|
+
readonly stateMutability: "nonpayable";
|
|
473
|
+
}, {
|
|
474
|
+
readonly type: "function";
|
|
475
|
+
readonly inputs: readonly [{
|
|
476
|
+
readonly name: "user";
|
|
477
|
+
readonly internalType: "address";
|
|
478
|
+
readonly type: "address";
|
|
479
|
+
}, {
|
|
480
|
+
readonly name: "roles";
|
|
481
|
+
readonly internalType: "uint256";
|
|
482
|
+
readonly type: "uint256";
|
|
483
|
+
}];
|
|
484
|
+
readonly name: "hasAllRoles";
|
|
485
|
+
readonly outputs: readonly [{
|
|
486
|
+
readonly name: "";
|
|
487
|
+
readonly internalType: "bool";
|
|
488
|
+
readonly type: "bool";
|
|
489
|
+
}];
|
|
490
|
+
readonly stateMutability: "view";
|
|
491
|
+
}, {
|
|
492
|
+
readonly type: "function";
|
|
493
|
+
readonly inputs: readonly [{
|
|
494
|
+
readonly name: "user";
|
|
495
|
+
readonly internalType: "address";
|
|
496
|
+
readonly type: "address";
|
|
497
|
+
}, {
|
|
498
|
+
readonly name: "roles";
|
|
499
|
+
readonly internalType: "uint256";
|
|
500
|
+
readonly type: "uint256";
|
|
501
|
+
}];
|
|
502
|
+
readonly name: "hasAnyRole";
|
|
503
|
+
readonly outputs: readonly [{
|
|
504
|
+
readonly name: "";
|
|
505
|
+
readonly internalType: "bool";
|
|
506
|
+
readonly type: "bool";
|
|
507
|
+
}];
|
|
508
|
+
readonly stateMutability: "view";
|
|
351
509
|
}, {
|
|
352
510
|
readonly type: "function";
|
|
353
511
|
readonly inputs: readonly [{
|
|
@@ -416,6 +574,16 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
416
574
|
readonly name: "renounceOwnership";
|
|
417
575
|
readonly outputs: readonly [];
|
|
418
576
|
readonly stateMutability: "payable";
|
|
577
|
+
}, {
|
|
578
|
+
readonly type: "function";
|
|
579
|
+
readonly inputs: readonly [{
|
|
580
|
+
readonly name: "roles";
|
|
581
|
+
readonly internalType: "uint256";
|
|
582
|
+
readonly type: "uint256";
|
|
583
|
+
}];
|
|
584
|
+
readonly name: "renounceRoles";
|
|
585
|
+
readonly outputs: readonly [];
|
|
586
|
+
readonly stateMutability: "payable";
|
|
419
587
|
}, {
|
|
420
588
|
readonly type: "function";
|
|
421
589
|
readonly inputs: readonly [];
|
|
@@ -425,7 +593,49 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
425
593
|
}, {
|
|
426
594
|
readonly type: "function";
|
|
427
595
|
readonly inputs: readonly [{
|
|
428
|
-
readonly name: "
|
|
596
|
+
readonly name: "user";
|
|
597
|
+
readonly internalType: "address";
|
|
598
|
+
readonly type: "address";
|
|
599
|
+
}, {
|
|
600
|
+
readonly name: "roles";
|
|
601
|
+
readonly internalType: "uint256";
|
|
602
|
+
readonly type: "uint256";
|
|
603
|
+
}];
|
|
604
|
+
readonly name: "revokeRoles";
|
|
605
|
+
readonly outputs: readonly [];
|
|
606
|
+
readonly stateMutability: "payable";
|
|
607
|
+
}, {
|
|
608
|
+
readonly type: "function";
|
|
609
|
+
readonly inputs: readonly [{
|
|
610
|
+
readonly name: "accounts_";
|
|
611
|
+
readonly internalType: "address[]";
|
|
612
|
+
readonly type: "address[]";
|
|
613
|
+
}, {
|
|
614
|
+
readonly name: "roles_";
|
|
615
|
+
readonly internalType: "uint256[]";
|
|
616
|
+
readonly type: "uint256[]";
|
|
617
|
+
}];
|
|
618
|
+
readonly name: "revokeRoles";
|
|
619
|
+
readonly outputs: readonly [];
|
|
620
|
+
readonly stateMutability: "nonpayable";
|
|
621
|
+
}, {
|
|
622
|
+
readonly type: "function";
|
|
623
|
+
readonly inputs: readonly [{
|
|
624
|
+
readonly name: "user";
|
|
625
|
+
readonly internalType: "address";
|
|
626
|
+
readonly type: "address";
|
|
627
|
+
}];
|
|
628
|
+
readonly name: "rolesOf";
|
|
629
|
+
readonly outputs: readonly [{
|
|
630
|
+
readonly name: "roles";
|
|
631
|
+
readonly internalType: "uint256";
|
|
632
|
+
readonly type: "uint256";
|
|
633
|
+
}];
|
|
634
|
+
readonly stateMutability: "view";
|
|
635
|
+
}, {
|
|
636
|
+
readonly type: "function";
|
|
637
|
+
readonly inputs: readonly [{
|
|
638
|
+
readonly name: "accounts_";
|
|
429
639
|
readonly internalType: "address[]";
|
|
430
640
|
readonly type: "address[]";
|
|
431
641
|
}, {
|
|
@@ -493,9 +703,9 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
493
703
|
*
|
|
494
704
|
* @public
|
|
495
705
|
* @static
|
|
496
|
-
* @type {Address}
|
|
706
|
+
* @type {Record<number, Address>}
|
|
497
707
|
*/
|
|
498
|
-
static
|
|
708
|
+
static bases: Record<number, Address>;
|
|
499
709
|
/**
|
|
500
710
|
* @inheritdoc
|
|
501
711
|
*
|
|
@@ -508,7 +718,7 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
508
718
|
* Get the owner of the budget
|
|
509
719
|
*
|
|
510
720
|
* @public
|
|
511
|
-
* @param {?ReadParams
|
|
721
|
+
* @param {?ReadParams} [params]
|
|
512
722
|
* @returns {Promise<Address>}
|
|
513
723
|
*/
|
|
514
724
|
owner(params?: ReadParams<typeof vestingBudgetAbi, 'owner'>): Promise<`0x${string}`>;
|
|
@@ -516,24 +726,24 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
516
726
|
* The timestamp at which the vesting schedule begins
|
|
517
727
|
*
|
|
518
728
|
* @public
|
|
519
|
-
* @param {?ReadParams
|
|
520
|
-
* @returns {
|
|
729
|
+
* @param {?ReadParams} [params]
|
|
730
|
+
* @returns {Promise<bigint>}
|
|
521
731
|
*/
|
|
522
732
|
start(params?: ReadParams<typeof vestingBudgetAbi, 'start'>): Promise<bigint>;
|
|
523
733
|
/**
|
|
524
734
|
* The duration of the vesting schedule (in seconds)
|
|
525
735
|
*
|
|
526
736
|
* @public
|
|
527
|
-
* @param {?ReadParams
|
|
528
|
-
* @returns {
|
|
737
|
+
* @param {?ReadParams} [params]
|
|
738
|
+
* @returns {Promise<bigint>}
|
|
529
739
|
*/
|
|
530
740
|
duration(params?: ReadParams<typeof vestingBudgetAbi, 'duration'>): Promise<bigint>;
|
|
531
741
|
/**
|
|
532
742
|
* The duration of the cliff period (in seconds)
|
|
533
743
|
*
|
|
534
744
|
* @public
|
|
535
|
-
* @param {?ReadParams
|
|
536
|
-
* @returns {
|
|
745
|
+
* @param {?ReadParams} [params]
|
|
746
|
+
* @returns {Promise<bigint>}
|
|
537
747
|
*/
|
|
538
748
|
cliff(params?: ReadParams<typeof vestingBudgetAbi, 'cliff'>): Promise<bigint>;
|
|
539
749
|
/**
|
|
@@ -544,7 +754,7 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
544
754
|
* @public
|
|
545
755
|
* @async
|
|
546
756
|
* @param {(FungibleTransferPayload)} transfer
|
|
547
|
-
* @param {?WriteParams
|
|
757
|
+
* @param {?WriteParams} [params]
|
|
548
758
|
* @returns {Promise<boolean>} - True if the allocation was successful
|
|
549
759
|
*/
|
|
550
760
|
allocate(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'allocate'>): Promise<boolean>;
|
|
@@ -556,8 +766,8 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
556
766
|
* @public
|
|
557
767
|
* @async
|
|
558
768
|
* @param {(FungibleTransferPayload)} transfer
|
|
559
|
-
* @param {?WriteParams
|
|
560
|
-
* @returns {Promise<boolean>} - True if the allocation was successful
|
|
769
|
+
* @param {?WriteParams} [params]
|
|
770
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the allocation was successful
|
|
561
771
|
*/
|
|
562
772
|
allocateRaw(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'allocate'>): Promise<{
|
|
563
773
|
hash: `0x${string}`;
|
|
@@ -572,10 +782,10 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
572
782
|
* @public
|
|
573
783
|
* @async
|
|
574
784
|
* @param {(FungibleTransferPayload)} transfer
|
|
575
|
-
* @param {?WriteParams
|
|
785
|
+
* @param {?WriteParams} [params]
|
|
576
786
|
* @returns {Promise<boolean>} - True if the request was successful
|
|
577
787
|
*/
|
|
578
|
-
clawback(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'clawback'>): Promise<
|
|
788
|
+
clawback(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'clawback'>): Promise<bigint>;
|
|
579
789
|
/**
|
|
580
790
|
* Clawbacks assets from the budget.
|
|
581
791
|
* Only the owner can directly clawback assets from the budget
|
|
@@ -585,12 +795,12 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
585
795
|
* @public
|
|
586
796
|
* @async
|
|
587
797
|
* @param {(FungibleTransferPayload)} transfer
|
|
588
|
-
* @param {?WriteParams
|
|
589
|
-
* @returns {Promise<boolean>} - True if the request was successful
|
|
798
|
+
* @param {?WriteParams} [params]
|
|
799
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the request was successful
|
|
590
800
|
*/
|
|
591
801
|
clawbackRaw(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'clawback'>): Promise<{
|
|
592
802
|
hash: `0x${string}`;
|
|
593
|
-
result:
|
|
803
|
+
result: bigint;
|
|
594
804
|
}>;
|
|
595
805
|
/**
|
|
596
806
|
* Disburses assets from the budget to a single recipient
|
|
@@ -599,7 +809,7 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
599
809
|
* @public
|
|
600
810
|
* @async
|
|
601
811
|
* @param {(FungibleTransferPayload)} transfer
|
|
602
|
-
* @param {?WriteParams
|
|
812
|
+
* @param {?WriteParams} [params]
|
|
603
813
|
* @returns {Promise<boolean>} - True if the disbursement was successful
|
|
604
814
|
*/
|
|
605
815
|
disburse(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'disburse'>): Promise<boolean>;
|
|
@@ -610,8 +820,8 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
610
820
|
* @public
|
|
611
821
|
* @async
|
|
612
822
|
* @param {(FungibleTransferPayload)} transfer
|
|
613
|
-
* @param {?WriteParams
|
|
614
|
-
* @returns {Promise<boolean>} - True if the disbursement was successful
|
|
823
|
+
* @param {?WriteParams} [params]
|
|
824
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the disbursement was successful
|
|
615
825
|
*/
|
|
616
826
|
disburseRaw(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'disburse'>): Promise<{
|
|
617
827
|
hash: `0x${string}`;
|
|
@@ -623,7 +833,7 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
623
833
|
* @public
|
|
624
834
|
* @async
|
|
625
835
|
* @param {Array<FungibleTransferPayload>} transfers
|
|
626
|
-
* @param {?WriteParams
|
|
836
|
+
* @param {?WriteParams} [params]
|
|
627
837
|
* @returns {Promise<boolean>} - True if all disbursements were successful
|
|
628
838
|
*/
|
|
629
839
|
disburseBatch(transfers: FungibleTransferPayload[], params?: WriteParams<typeof vestingBudgetAbi, 'disburseBatch'>): Promise<boolean>;
|
|
@@ -633,54 +843,18 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
633
843
|
* @public
|
|
634
844
|
* @async
|
|
635
845
|
* @param {Array<FungibleTransferPayload>} transfers
|
|
636
|
-
* @param {?WriteParams
|
|
637
|
-
* @returns {Promise<boolean>} - True if all disbursements were successful
|
|
846
|
+
* @param {?WriteParams} [params]
|
|
847
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if all disbursements were successful
|
|
638
848
|
*/
|
|
639
849
|
disburseBatchRaw(transfers: FungibleTransferPayload[], params?: WriteParams<typeof vestingBudgetAbi, 'disburseBatch'>): Promise<{
|
|
640
850
|
hash: `0x${string}`;
|
|
641
851
|
result: boolean;
|
|
642
852
|
}>;
|
|
643
|
-
/**
|
|
644
|
-
* Set the authorized status of the given accounts
|
|
645
|
-
* The mechanism for managing authorization is left to the implementing contract
|
|
646
|
-
*
|
|
647
|
-
* @public
|
|
648
|
-
* @async
|
|
649
|
-
* @param {Address[]} addresses - The accounts to authorize or deauthorize
|
|
650
|
-
* @param {boolean[]} allowed - The authorization status for the given accounts
|
|
651
|
-
* @param {?WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>} [params]
|
|
652
|
-
* @returns {Promise<void>}
|
|
653
|
-
*/
|
|
654
|
-
setAuthorized(addresses: Address[], allowed: boolean[], params?: WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>): Promise<void>;
|
|
655
|
-
/**
|
|
656
|
-
* Set the authorized status of the given accounts
|
|
657
|
-
* The mechanism for managing authorization is left to the implementing contract
|
|
658
|
-
*
|
|
659
|
-
* @public
|
|
660
|
-
* @async
|
|
661
|
-
* @param {Address[]} addresses - The accounts to authorize or deauthorize
|
|
662
|
-
* @param {boolean[]} allowed - The authorization status for the given accounts
|
|
663
|
-
* @param {?WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>} [params]
|
|
664
|
-
* @returns {Promise<void>}
|
|
665
|
-
*/
|
|
666
|
-
setAuthorizedRaw(addresses: Address[], allowed: boolean[], params?: WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>): Promise<{
|
|
667
|
-
hash: `0x${string}`;
|
|
668
|
-
result: void;
|
|
669
|
-
}>;
|
|
670
|
-
/**
|
|
671
|
-
* Check if the given account is authorized to use the budget
|
|
672
|
-
*
|
|
673
|
-
* @public
|
|
674
|
-
* @param {Address} account
|
|
675
|
-
* @param {?ReadParams<typeof vestingBudgetAbi, 'isAuthorized'>} [params]
|
|
676
|
-
* @returns {Promise<boolean>} - True if the account is authorized
|
|
677
|
-
*/
|
|
678
|
-
isAuthorized(account: Address, params?: ReadParams<typeof vestingBudgetAbi, 'isAuthorized'>): Promise<boolean>;
|
|
679
853
|
/**
|
|
680
854
|
* Get the end time of the vesting schedule
|
|
681
855
|
*
|
|
682
856
|
* @public
|
|
683
|
-
* @param {?ReadParams
|
|
857
|
+
* @param {?ReadParams} [params]
|
|
684
858
|
* @returns {Promise<bigint>}
|
|
685
859
|
*/
|
|
686
860
|
end(params?: ReadParams<typeof vestingBudgetAbi, 'end'>): Promise<bigint>;
|
|
@@ -689,30 +863,30 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
689
863
|
* This is equal to the sum of the total current balance and the total distributed amount
|
|
690
864
|
*
|
|
691
865
|
* @public
|
|
692
|
-
* @param {Address} asset - The address of the asset (or the zero address for native assets)
|
|
693
|
-
* @param {?ReadParams
|
|
866
|
+
* @param {Address} [asset="0x0000000000000000000000000000000000000000"] - The address of the asset (or the zero address for native assets)
|
|
867
|
+
* @param {?ReadParams} [params]
|
|
694
868
|
* @returns {Promise<bigint>}
|
|
695
869
|
*/
|
|
696
|
-
total(asset
|
|
870
|
+
total(asset?: Address, params?: ReadParams<typeof vestingBudgetAbi, 'total'>): Promise<bigint>;
|
|
697
871
|
/**
|
|
698
872
|
* Get the amount of assets available for distribution from the budget as of the current block timestamp
|
|
699
873
|
* This is equal to the total vested amount minus any already distributed
|
|
700
874
|
*
|
|
701
875
|
* @public
|
|
702
|
-
* @param {Address} asset - The address of the asset (or the zero address for native assets)
|
|
703
|
-
* @param {?ReadParams
|
|
876
|
+
* @param {Address} [asset="0x0000000000000000000000000000000000000000"] - The address of the asset (or the zero address for native assets)
|
|
877
|
+
* @param {?ReadParams} [params]
|
|
704
878
|
* @returns {Promise<bigint>} - The amount of assets currently available for distribution
|
|
705
879
|
*/
|
|
706
|
-
available(asset
|
|
880
|
+
available(asset?: Address, params?: ReadParams<typeof vestingBudgetAbi, 'available'>): Promise<bigint>;
|
|
707
881
|
/**
|
|
708
882
|
* Get the amount of assets that have been distributed from the budget
|
|
709
883
|
*
|
|
710
884
|
* @public
|
|
711
|
-
* @param {Address} asset
|
|
712
|
-
* @param {?ReadParams
|
|
885
|
+
* @param {Address} [asset="0x0000000000000000000000000000000000000000"]
|
|
886
|
+
* @param {?ReadParams} [params]
|
|
713
887
|
* @returns {Promise<bigint>} - The amount of assets distributed
|
|
714
888
|
*/
|
|
715
|
-
distributed(asset
|
|
889
|
+
distributed(asset?: Address, params?: ReadParams<typeof vestingBudgetAbi, 'distributed'>): Promise<bigint>;
|
|
716
890
|
/**
|
|
717
891
|
* @inheritdoc
|
|
718
892
|
*
|
|
@@ -723,4 +897,16 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
|
|
|
723
897
|
*/
|
|
724
898
|
buildParameters(_payload?: VestingBudgetPayload, _options?: DeployableOptions): GenericDeployableParams;
|
|
725
899
|
}
|
|
900
|
+
/**
|
|
901
|
+
* Given a {@link VestingBudgetPayload}, properly encode a `VestingBudget.InitPayload` for use with {@link VestingBudget} initialization.
|
|
902
|
+
*
|
|
903
|
+
* @param {VestingBudgetPayload} param0
|
|
904
|
+
* @param {Address} param0.owner - The budget's owner.
|
|
905
|
+
* @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
|
|
906
|
+
* @param {bigint} param0.start - The timestamp at which the vesting schedule begins
|
|
907
|
+
* @param {bigint} param0.duration - The duration of the vesting schedule (in seconds)
|
|
908
|
+
* @param {bigint} param0.cliff - The duration of the cliff period (in seconds)
|
|
909
|
+
* @returns {Hex}
|
|
910
|
+
*/
|
|
911
|
+
export declare function prepareVestingBudgetPayload({ owner, authorized, start, duration, cliff, }: VestingBudgetPayload): `0x${string}`;
|
|
726
912
|
//# sourceMappingURL=VestingBudget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VestingBudget.d.ts","sourceRoot":"","sources":["../../src/Budgets/VestingBudget.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,gBAAgB,EAMjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"VestingBudget.d.ts","sourceRoot":"","sources":["../../src/Budgets/VestingBudget.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,gBAAgB,EAMjB,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,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAElF,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,uBAAuB,EAAE,CAAC;AACxC;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;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E,EACpC,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,gBAAgB,EAAE,eAAe,CAAC;IAKhE;;;;;;;;OAQG;IACU,gBAAgB,CAC3B,SAAS,EAAE,uBAAuB,EAAE,EACpC,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,gBAAgB,EAAE,eAAe,CAAC;;;;IAgBhE;;;;;;OAMG;IACI,GAAG,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,KAAK,CAAC;IAS9D;;;;;;;;OAQG;IACI,KAAK,CACV,KAAK,GAAE,OAAqB,EAC5B,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,OAAO,CAAC;IAUvD;;;;;;;;OAQG;IACI,SAAS,CACd,KAAK,GAAE,OAAqB,EAC5B,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,WAAW,CAAC;IAU3D;;;;;;;OAOG;IACI,WAAW,CAChB,KAAK,GAAE,OAAqB,EAC5B,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,aAAa,CAAC;IAU7D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,oBAAoB,EAC/B,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;CAwB3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,KAAK,EACL,UAAU,EACV,KAAK,EACL,QAAQ,EACR,KAAK,GACN,EAAE,oBAAoB,iBAQtB"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@wagmi/core"),i=require("viem"),o=require("viem/actions"),d=require("../errors.cjs"),c=require("../utils.cjs");class h{constructor(e,t){this._config=e,this._address=t}get address(){return this._address}at(e){return this._address=e,this}withConfig(e){return this._config=e,this}assertValidAddress(){const e=this.address;if(!e)throw new d.ContractAddressRequiredError;return e}async getLogs(e){return o.getLogs(this._config.getClient({chainId:e==null?void 0:e.chainId}),{...e,...e!=null&&e.eventName?{event:i.getAbiItem({abi:this.abi,name:e.eventName})}:{},...e!=null&&e.eventNames?{events:e.eventNames.map(t=>i.getAbiItem({abi:this.abi,name:t}))}:{},address:this.assertValidAddress()})}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@wagmi/core"),i=require("viem"),o=require("viem/actions"),d=require("../errors.cjs"),c=require("../utils.cjs");class h{constructor(e,t){this._config=e,this._address=t}get address(){return this._address}at(e){return this._address=e,this}withConfig(e){return this._config=e,this}assertValidAddress(){const e=this.address;if(!e)throw new d.ContractAddressRequiredError;return e}async getLogs(e){return o.getLogs(this._config.getClient({chainId:e==null?void 0:e.chainId}),{...e,...e!=null&&e.eventName?{event:i.getAbiItem({abi:this.abi,name:e.eventName})}:{},...e!=null&&e.eventNames?{events:e.eventNames.map(t=>i.getAbiItem({abi:this.abi,name:t}))}:{},address:this.assertValidAddress()})}subscribe(e,t){return r.watchContractEvent(this._config,{...t,eventName:t==null?void 0:t.eventName,abi:this.abi,address:this.assertValidAddress(),onLogs:s=>{for(let n of s)e(n)}})}async awaitResult(e,t){return await c.awaitResult(this._config,e,t)}}exports.Contract=h;
|
|
2
|
+
//# sourceMappingURL=Contract.cjs.map
|