@boostxyz/sdk 0.0.0-alpha.2
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/LICENSE +674 -0
- package/README.md +7 -0
- package/dist/Actions/Action.cjs +1 -0
- package/dist/Actions/Action.d.ts +31 -0
- package/dist/Actions/Action.d.ts.map +1 -0
- package/dist/Actions/Action.js +27 -0
- package/dist/Actions/ContractAction.d.ts +327 -0
- package/dist/Actions/ContractAction.d.ts.map +1 -0
- package/dist/Actions/ERC721MintAction.d.ts +486 -0
- package/dist/Actions/ERC721MintAction.d.ts.map +1 -0
- package/dist/Actions/EventAction.cjs +1 -0
- package/dist/Actions/EventAction.d.ts +433 -0
- package/dist/Actions/EventAction.d.ts.map +1 -0
- package/dist/Actions/EventAction.js +211 -0
- package/dist/AllowLists/AllowList.cjs +1 -0
- package/dist/AllowLists/AllowList.d.ts +33 -0
- package/dist/AllowLists/AllowList.d.ts.map +1 -0
- package/dist/AllowLists/AllowList.js +28 -0
- package/dist/AllowLists/SimpleAllowList.cjs +1 -0
- package/dist/AllowLists/SimpleAllowList.d.ts +452 -0
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleAllowList.js +138 -0
- package/dist/AllowLists/SimpleDenyList.cjs +1 -0
- package/dist/AllowLists/SimpleDenyList.d.ts +306 -0
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleDenyList.js +202 -0
- package/dist/Auth/Auth.cjs +1 -0
- package/dist/Auth/Auth.d.ts +10 -0
- package/dist/Auth/Auth.d.ts.map +1 -0
- package/dist/Auth/Auth.js +4 -0
- package/dist/Auth/PassthroughAuth.cjs +1 -0
- package/dist/Auth/PassthroughAuth.d.ts +51 -0
- package/dist/Auth/PassthroughAuth.d.ts.map +1 -0
- package/dist/Auth/PassthroughAuth.js +38 -0
- package/dist/Boost.cjs +1 -0
- package/dist/Boost.d.ts +142 -0
- package/dist/Boost.d.ts.map +1 -0
- package/dist/Boost.js +15 -0
- package/dist/BoostCore.cjs +2 -0
- package/dist/BoostCore.d.ts +460 -0
- package/dist/BoostCore.d.ts.map +1 -0
- package/dist/BoostCore.js +1105 -0
- package/dist/BoostRegistry.cjs +1 -0
- package/dist/BoostRegistry.d.ts +229 -0
- package/dist/BoostRegistry.d.ts.map +1 -0
- package/dist/BoostRegistry.js +250 -0
- package/dist/Budgets/Budget.cjs +1 -0
- package/dist/Budgets/Budget.d.ts +31 -0
- package/dist/Budgets/Budget.d.ts.map +1 -0
- package/dist/Budgets/Budget.js +27 -0
- package/dist/Budgets/ManagedBudget.cjs +1 -0
- package/dist/Budgets/ManagedBudget.d.ts +1065 -0
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -0
- package/dist/Budgets/ManagedBudget.js +498 -0
- package/dist/Budgets/SimpleBudget.d.ts +793 -0
- package/dist/Budgets/SimpleBudget.d.ts.map +1 -0
- package/dist/Budgets/VestingBudget.d.ts +726 -0
- package/dist/Budgets/VestingBudget.d.ts.map +1 -0
- package/dist/Deployable/Contract.cjs +1 -0
- package/dist/Deployable/Contract.d.ts +125 -0
- package/dist/Deployable/Contract.d.ts.map +1 -0
- package/dist/Deployable/Contract.js +149 -0
- package/dist/Deployable/Deployable.cjs +1 -0
- package/dist/Deployable/Deployable.d.ts +155 -0
- package/dist/Deployable/Deployable.d.ts.map +1 -0
- package/dist/Deployable/Deployable.js +124 -0
- package/dist/Deployable/DeployableTarget.cjs +1 -0
- package/dist/Deployable/DeployableTarget.d.ts +115 -0
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -0
- package/dist/Deployable/DeployableTarget.js +128 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -0
- package/dist/Incentives/AllowListIncentive.d.ts +483 -0
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -0
- package/dist/Incentives/AllowListIncentive.js +188 -0
- package/dist/Incentives/CGDAIncentive.cjs +1 -0
- package/dist/Incentives/CGDAIncentive.d.ts +560 -0
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -0
- package/dist/Incentives/CGDAIncentive.js +249 -0
- package/dist/Incentives/ERC1155Incentive.d.ts +652 -0
- package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20Incentive.cjs +1 -0
- package/dist/Incentives/ERC20Incentive.d.ts +622 -0
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20Incentive.js +292 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +545 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -0
- package/dist/Incentives/Incentive.cjs +1 -0
- package/dist/Incentives/Incentive.d.ts +39 -0
- package/dist/Incentives/Incentive.d.ts.map +1 -0
- package/dist/Incentives/Incentive.js +280 -0
- package/dist/Incentives/PointsIncentive.cjs +1 -0
- package/dist/Incentives/PointsIncentive.d.ts +615 -0
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -0
- package/dist/Incentives/PointsIncentive.js +197 -0
- package/dist/Validators/SignerValidator.cjs +1 -0
- package/dist/Validators/SignerValidator.d.ts +452 -0
- package/dist/Validators/SignerValidator.d.ts.map +1 -0
- package/dist/Validators/SignerValidator.js +167 -0
- package/dist/Validators/Validator.cjs +1 -0
- package/dist/Validators/Validator.d.ts +31 -0
- package/dist/Validators/Validator.d.ts.map +1 -0
- package/dist/Validators/Validator.js +25 -0
- package/dist/errors.cjs +1 -0
- package/dist/errors.d.ts +257 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +161 -0
- package/dist/generated-BaaleHW-.cjs +2 -0
- package/dist/generated-x_abr3Yv.js +6228 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1355 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +1454 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +643 -0
- package/package.json +197 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./generated-BaaleHW-.cjs"),n=require("viem"),o=require("./Deployable/Deployable.cjs"),l=require("./utils.cjs"),y="0x6080604052348015600e575f80fd5b50611b4e8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610086575f3560e01c8063acc83fc811610059578063acc83fc81461014a578063d12dd4811461017a578063f166879214610196578063fd97064b146101c657610086565b806301ffc9a71461008a5780633aaf1626146100ba578063792aa01c146100ea57806383f388591461011a575b5f80fd5b6100a4600480360381019061009f9190610e0e565b6101f6565b6040516100b19190610e53565b60405180910390f35b6100d460048036038101906100cf9190610e9f565b61025f565b6040516100e191906110a7565b60405180910390f35b61010460048036038101906100ff91906110f1565b610471565b60405161011191906111d3565b60405180910390f35b610134600480360381019061012f9190610e9f565b610504565b6040516101419190611202565b60405180910390f35b610164600480360381019061015f919061129f565b6105ac565b6040516101719190611332565b60405180910390f35b610194600480360381019061018f919061134b565b6105ee565b005b6101b060048036038101906101ab91906113bc565b610818565b6040516101bd9190611332565b60405180910390f35b6101e060048036038101906101db919061146e565b610854565b6040516101ed9190611202565b60405180910390f35b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b610267610d4e565b60015f8381526020019081526020015f206040518060800160405290815f82015f9054906101000a900460ff1660048111156102a6576102a5610eca565b5b60048111156102b8576102b7610eca565b5b81526020015f820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820180546103769061153e565b80601f01602080910402602001604051908101604052809291908181526020018280546103a29061153e565b80156103ed5780601f106103c4576101008083540402835291602001916103ed565b820191905f5260205f20905b8154815290600101906020018083116103d057829003601f168201915b50505050508152505090505f73ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff160361046c57816040517f8cc00d160000000000000000000000000000000000000000000000000000000081526004016104639190611332565b60405180910390fd5b919050565b606060025f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208054806020026020016040519081016040528092919081815260200182805480156104f857602002820191905f5260205f20905b8154815260200190600101908083116104e4575b50505050509050919050565b5f805f8381526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036105a757816040517f8cc00d1600000000000000000000000000000000000000000000000000000000815260040161059e9190611332565b60405180910390fd5b919050565b5f6105e386868686866040516020016105c894939291906115ef565b60405160208183030381529060405280519060200120610c1c565b905095945050505050565b808073ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f6ab67a0d000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b81526004016106489190611638565b602060405180830381865afa158015610663573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610687919061167b565b6106c857806040517f903b13fd0000000000000000000000000000000000000000000000000000000081526004016106bf91906116b5565b60405180910390fd5b5f6106d4868686610818565b90505f73ffffffffffffffffffffffffffffffffffffffff165f808381526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107775785816040517f96b5684c00000000000000000000000000000000000000000000000000000000815260040161076e9291906116dd565b60405180910390fd5b825f808381526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808660048111156107d9576107d8610eca565b5b7f660d31df25c96b8a337fcf12a56b7363e5a997639db853d5dbaec7c01f31bd808560405161080891906116b5565b60405180910390a3505050505050565b5f61084b848484604051602001610830929190611704565b60405160208183030381529060405280519060200120610c1c565b90509392505050565b5f3068929eee149b4bd2126854036108735763ab143c065f526004601cfd5b3068929eee149b4bd212685561091b878787873360405160200161089b959493929190611750565b6040516020818303038152906040528051906020012084848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f820116905080830192505050505050508873ffffffffffffffffffffffffffffffffffffffff16610c4e9092919063ffffffff16565b90505f61092b88883389896105ac565b90505f73ffffffffffffffffffffffffffffffffffffffff1660015f8381526020019081526020015f205f0160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109d25787816040517f96b5684c0000000000000000000000000000000000000000000000000000000081526004016109c99291906116dd565b60405180910390fd5b60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081908060018154018082558091505060019003905f5260205f20015f90919091909150556040518060800160405280896004811115610a5157610a50610eca565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505081525060015f8381526020019081526020015f205f820151815f015f6101000a81548160ff02191690836004811115610b0e57610b0d610eca565b5b02179055506020820151815f0160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506060820151816002019081610bb49190611965565b5090505080886004811115610bcc57610bcb610eca565b5b7f2348fcdb9847b17a183e53aa32c0c5c76afdef8fcb14bb51f216c6611701ab1a8985604051610bfd929190611a34565b60405180910390a3503868929eee149b4bd21268559695505050505050565b5f8282604051602001610c30929190611a7b565b60405160208183030381529060405280519060200120905092915050565b5f610c78838573ffffffffffffffffffffffffffffffffffffffff16610ce790919063ffffffff16565b90508073ffffffffffffffffffffffffffffffffffffffff1663439fab91836040518263ffffffff1660e01b8152600401610cb39190611af8565b5f604051808303815f87803b158015610cca575f80fd5b505af1158015610cdc573d5f803e3d5ffd5b505050509392505050565b5f610cf35f8484610cfb565b905092915050565b5f6c5af43d3d93803e602a57fd5bf36021528260145273602c3d8160093d39f33d3d3d3d363d3d37363d735f52816035600c86f5905080610d435763301164255f526004601cfd5b5f6021529392505050565b60405180608001604052805f6004811115610d6c57610d6b610eca565b5b81526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff168152602001606081525090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610ded81610db9565b8114610df7575f80fd5b50565b5f81359050610e0881610de4565b92915050565b5f60208284031215610e2357610e22610db1565b5b5f610e3084828501610dfa565b91505092915050565b5f8115159050919050565b610e4d81610e39565b82525050565b5f602082019050610e665f830184610e44565b92915050565b5f819050919050565b610e7e81610e6c565b8114610e88575f80fd5b50565b5f81359050610e9981610e75565b92915050565b5f60208284031215610eb457610eb3610db1565b5b5f610ec184828501610e8b565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60058110610f0857610f07610eca565b5b50565b5f819050610f1882610ef7565b919050565b5f610f2782610f0b565b9050919050565b610f3781610f1d565b82525050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f610f7f610f7a610f7584610f3d565b610f5c565b610f3d565b9050919050565b5f610f9082610f65565b9050919050565b5f610fa182610f86565b9050919050565b610fb181610f97565b82525050565b5f610fc182610f3d565b9050919050565b610fd181610fb7565b82525050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61101982610fd7565b6110238185610fe1565b9350611033818560208601610ff1565b61103c81610fff565b840191505092915050565b5f608083015f83015161105c5f860182610f2e565b50602083015161106f6020860182610fa8565b5060408301516110826040860182610fc8565b506060830151848203606086015261109a828261100f565b9150508091505092915050565b5f6020820190508181035f8301526110bf8184611047565b905092915050565b6110d081610fb7565b81146110da575f80fd5b50565b5f813590506110eb816110c7565b92915050565b5f6020828403121561110657611105610db1565b5b5f611113848285016110dd565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b61114e81610e6c565b82525050565b5f61115f8383611145565b60208301905092915050565b5f602082019050919050565b5f6111818261111c565b61118b8185611126565b935061119683611136565b805f5b838110156111c65781516111ad8882611154565b97506111b88361116b565b925050600181019050611199565b5085935050505092915050565b5f6020820190508181035f8301526111eb8184611177565b905092915050565b6111fc81610f97565b82525050565b5f6020820190506112155f8301846111f3565b92915050565b60058110611227575f80fd5b50565b5f813590506112388161121b565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261125f5761125e61123e565b5b8235905067ffffffffffffffff81111561127c5761127b611242565b5b60208301915083600182028301111561129857611297611246565b5b9250929050565b5f805f805f608086880312156112b8576112b7610db1565b5b5f6112c58882890161122a565b95505060206112d6888289016110dd565b94505060406112e7888289016110dd565b935050606086013567ffffffffffffffff81111561130857611307610db5565b5b6113148882890161124a565b92509250509295509295909350565b61132c81610e6c565b82525050565b5f6020820190506113455f830184611323565b92915050565b5f805f806060858703121561136357611362610db1565b5b5f6113708782880161122a565b945050602085013567ffffffffffffffff81111561139157611390610db5565b5b61139d8782880161124a565b935093505060406113b0878288016110dd565b91505092959194509250565b5f805f604084860312156113d3576113d2610db1565b5b5f6113e08682870161122a565b935050602084013567ffffffffffffffff81111561140157611400610db5565b5b61140d8682870161124a565b92509250509250925092565b5f8083601f84011261142e5761142d61123e565b5b8235905067ffffffffffffffff81111561144b5761144a611242565b5b60208301915083600182028301111561146757611466611246565b5b9250929050565b5f805f805f806080878903121561148857611487610db1565b5b5f61149589828a0161122a565b96505060206114a689828a016110dd565b955050604087013567ffffffffffffffff8111156114c7576114c6610db5565b5b6114d389828a0161124a565b9450945050606087013567ffffffffffffffff8111156114f6576114f5610db5565b5b61150289828a01611419565b92509250509295509295509295565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061155557607f821691505b60208210810361156857611567611511565b5b50919050565b5f8160601b9050919050565b5f6115848261156e565b9050919050565b5f6115958261157a565b9050919050565b6115ad6115a882610fb7565b61158b565b82525050565b5f81905092915050565b828183375f83830152505050565b5f6115d683856115b3565b93506115e38385846115bd565b82840190509392505050565b5f6115fa828761159c565b60148201915061160a828661159c565b60148201915061161b8284866115cb565b915081905095945050505050565b61163281610db9565b82525050565b5f60208201905061164b5f830184611629565b92915050565b61165a81610e39565b8114611664575f80fd5b50565b5f8151905061167581611651565b92915050565b5f602082840312156116905761168f610db1565b5b5f61169d84828501611667565b91505092915050565b6116af81610fb7565b82525050565b5f6020820190506116c85f8301846116a6565b92915050565b6116d781610f1d565b82525050565b5f6040820190506116f05f8301856116ce565b6116fd6020830184611323565b9392505050565b5f6117108284866115cb565b91508190509392505050565b5f8160f81b9050919050565b5f6117328261171c565b9050919050565b61174a61174582610f1d565b611728565b82525050565b5f61175b8288611739565b60018201915061176b828761159c565b60148201915061177c8285876115cb565b9150611788828461159c565b6014820191508190509695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026118247fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826117e9565b61182e86836117e9565b95508019841693508086168417925050509392505050565b5f819050919050565b5f61186961186461185f84611846565b610f5c565b611846565b9050919050565b5f819050919050565b6118828361184f565b61189661188e82611870565b8484546117f5565b825550505050565b5f90565b6118aa61189e565b6118b5818484611879565b505050565b5b818110156118d8576118cd5f826118a2565b6001810190506118bb565b5050565b601f82111561191d576118ee816117c8565b6118f7846117da565b81016020851015611906578190505b61191a611912856117da565b8301826118ba565b50505b505050565b5f82821c905092915050565b5f61193d5f1984600802611922565b1980831691505092915050565b5f611955838361192e565b9150826002028217905092915050565b61196e82610fd7565b67ffffffffffffffff8111156119875761198661179b565b5b611991825461153e565b61199c8282856118dc565b5f60209050601f8311600181146119cd575f84156119bb578287015190505b6119c5858261194a565b865550611a2c565b601f1984166119db866117c8565b5f5b82811015611a02578489015182556001820191506020850194506020810190506119dd565b86831015611a1f5784890151611a1b601f89168261192e565b8355505b6001600288020188555050505b505050505050565b5f604082019050611a475f8301856116a6565b611a5460208301846111f3565b9392505050565b5f819050919050565b611a75611a7082610e6c565b611a5b565b82525050565b5f611a868285611739565b600182019150611a968284611a64565b6020820191508190509392505050565b5f81519050919050565b5f82825260208201905092915050565b5f611aca82611aa6565b611ad48185611ab0565b9350611ae4818560208601610ff1565b611aed81610fff565b840191505092915050565b5f6020820190508181035f830152611b108184611ac0565b90509291505056fea264697066735822122031d8b5092c0648488ea4f8c739d0ff5d8c5debf32ebfcd2f52c823a98c8a410064736f6c634300081a0033",r="0x5cb8D869f2EE4e3D987Ac7bEB37D6812f5346DFC";function h(c){return c.address&&n.isAddress(c.address)}function u(c){return c.address===null}class g extends o.Deployable{constructor({config:b,account:f,...e}){h(e)&&e.address?super({account:f,config:b},e.address):u(e)?super({account:f,config:b},[]):super({account:f,config:b},r)}async register(b,f,e,d){return this.awaitResult(this.registerRaw(b,f,e,d))}async registerRaw(b,f,e,d){const{request:s,result:t}=await a.hy(this._config,{address:this.assertValidAddress(),args:[b,f,e],...this.optionallyAttachAccount(),...d});return{hash:await a.Iy(this._config,s),result:t}}async clone(b,f,e){const d=await this.deployClone(b,f,e);return f.at(d)}async deployClone(b,f,e){return this.awaitResult(this.deployCloneRaw(b,f,e))}async deployCloneRaw(b,f,e){const d=f.buildParameters(void 0,{config:this._config,account:this._account}),{request:s,result:t}=await a.Ny(this._config,{address:this.assertValidAddress(),args:[f.registryType,f.base,b,d.args.at(0)],...this.optionallyAttachAccount(),...e});return{hash:await a.Ty(this._config,s),result:t}}async getBaseImplementation(b,f){return a.dy(this._config,{address:this.assertValidAddress(),args:[b],...this.optionallyAttachAccount(),...f})}async getClone(b,f){return a.dy(this._config,{address:this.assertValidAddress(),args:[b],...this.optionallyAttachAccount(),...f})}async getClones(b,f){return a.by(this._config,{address:this.assertValidAddress(),args:[b],...this.optionallyAttachAccount(),...f})}async getCloneIdentifier(b,f,e,d,s){return a.my(this._config,{address:this.assertValidAddress(),args:[b,f,e,d],...this.optionallyAttachAccount(),...s})}async getIdentifier(b,f,e){return a.my(this._config,{address:this.assertValidAddress(),args:[b,f],...this.optionallyAttachAccount(),...e})}buildParameters(b,f){const[,e]=this.validateDeploymentConfig([],f);return{abi:a.ee,bytecode:y,args:[],...this.optionallyAttachAccount(e.account)}}}exports.boostRegistryAbi=a.ee;exports.RegistryType=l.RegistryType;exports.BOOST_REGISTRY_ADDRESS=r;exports.BoostRegistry=g;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { boostRegistryAbi } from '@boostxyz/evm';
|
|
2
|
+
import { type Address, type ContractEventName, type Hex } from 'viem';
|
|
3
|
+
import { Deployable, type DeployableOptions, type GenericDeployableParams } from './Deployable/Deployable';
|
|
4
|
+
import type { DeployableTarget } from './Deployable/DeployableTarget';
|
|
5
|
+
import { type GenericLog, type HashAndSimulatedResult, type ReadParams, RegistryType, type WriteParams } from './utils';
|
|
6
|
+
export { RegistryType, boostRegistryAbi };
|
|
7
|
+
/**
|
|
8
|
+
* The fixed address for the Boost Registry.
|
|
9
|
+
* By default, `new BoostRegistry` will use this address if not otherwise provided.
|
|
10
|
+
*
|
|
11
|
+
* @type {Address}
|
|
12
|
+
*/
|
|
13
|
+
export declare const BOOST_REGISTRY_ADDRESS: Address;
|
|
14
|
+
/**
|
|
15
|
+
* A record of `BoostRegistry` event names to `AbiEvent` objects for use with `getLogs`
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
* @typedef {BoostRegistryLog}
|
|
19
|
+
* @template {ContractEventName<typeof boostRegistryAbi>} [event=ContractEventName<
|
|
20
|
+
* typeof boostRegistryAbi
|
|
21
|
+
* >]
|
|
22
|
+
*/
|
|
23
|
+
export type BoostRegistryLog<event extends ContractEventName<typeof boostRegistryAbi> = ContractEventName<typeof boostRegistryAbi>> = GenericLog<typeof boostRegistryAbi, event>;
|
|
24
|
+
/**
|
|
25
|
+
* Instantiation options for a previously deployed Boost Registry
|
|
26
|
+
*
|
|
27
|
+
* @export
|
|
28
|
+
* @interface BoostRegistryDeployedOptions
|
|
29
|
+
* @typedef {BoostRegistryDeployedOptions}
|
|
30
|
+
* @extends {DeployableOptions}
|
|
31
|
+
*/
|
|
32
|
+
export interface BoostRegistryDeployedOptions extends DeployableOptions {
|
|
33
|
+
/**
|
|
34
|
+
* The address for a Boost Registry, if different than `BOOST_REGISTRY_ADDRESS`
|
|
35
|
+
*
|
|
36
|
+
* @type {?Address}
|
|
37
|
+
*/
|
|
38
|
+
address?: Address;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The Boost Registry does not take any construction arguments, so if you'd like to deploy a new Boost Registry, pass an explicit null to the `address` field.
|
|
42
|
+
*
|
|
43
|
+
* @export
|
|
44
|
+
* @interface BoostRegistryOptionsWithPayload
|
|
45
|
+
* @typedef {BoostRegistryOptionsWithPayload}
|
|
46
|
+
* @extends {DeployableOptions}
|
|
47
|
+
*/
|
|
48
|
+
export interface BoostRegistryOptionsWithPayload extends DeployableOptions {
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @type {null}
|
|
52
|
+
*/
|
|
53
|
+
address: null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Instantiation options for a Boost Registry.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* To target Boost's Registry, omit the address field.
|
|
60
|
+
* Otherwise, supply a custom address to a previously deployed custom Boost Registry.
|
|
61
|
+
* You can also pass `{ address: null }` if you are intending to deploy a new Boost Registry.
|
|
62
|
+
* ```ts
|
|
63
|
+
* let registry = new BoostRegistry({ config, account })
|
|
64
|
+
* // or
|
|
65
|
+
* registry = new BoostRegistry({ config, account, address: CUSTOM_ADDRESS })
|
|
66
|
+
* // or
|
|
67
|
+
* registry = new BoostRegistry({ config, account, address: null })
|
|
68
|
+
* await registry.deploy()
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @export
|
|
72
|
+
* @typedef {BoostRegistryConfig}
|
|
73
|
+
*/
|
|
74
|
+
export type BoostRegistryConfig = BoostRegistryDeployedOptions | BoostRegistryOptionsWithPayload;
|
|
75
|
+
/**
|
|
76
|
+
* Constructs a new Boost Registry. A registry for base implementations and cloned instances.
|
|
77
|
+
* This contract is used to register base implementations and deploy new instances of those implementations for use within the Boost protocol.
|
|
78
|
+
*
|
|
79
|
+
* @see {@link BoostRegistryConfig}
|
|
80
|
+
* @export
|
|
81
|
+
* @class BoostRegistry
|
|
82
|
+
* @typedef {BoostRegistry}
|
|
83
|
+
* @extends {Deployable<never[]>}
|
|
84
|
+
*/
|
|
85
|
+
export declare class BoostRegistry extends Deployable<never[], typeof boostRegistryAbi> {
|
|
86
|
+
/**
|
|
87
|
+
* Creates an instance of BoostRegistry.
|
|
88
|
+
*
|
|
89
|
+
* @see {@link BoostRegistryConfig}
|
|
90
|
+
* @constructor
|
|
91
|
+
* @param {BoostRegistryConfig} param0
|
|
92
|
+
* @param {Config} param0.config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)
|
|
93
|
+
* @param {?Account} [param0.account] - [Viem Local Account](https://viem.sh/docs/accounts/local)
|
|
94
|
+
* @param {({ address?: Address; } | {})} param0....options
|
|
95
|
+
*/
|
|
96
|
+
constructor({ config, account, ...options }: BoostRegistryConfig);
|
|
97
|
+
/**
|
|
98
|
+
* Register a new base implementation of a given type
|
|
99
|
+
*
|
|
100
|
+
* @public
|
|
101
|
+
* @async
|
|
102
|
+
* @param {RegistryType} registryType - The base type for the implementation
|
|
103
|
+
* @param {string} name - A name for the implementation (must be unique within the given type)
|
|
104
|
+
* @param {Address} implementation - The address of the implementation contract
|
|
105
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params] - Optional params to provide the underlying Viem contract call
|
|
106
|
+
* @returns {unknown}
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* await registry.register(ContractAction.registryType, 'ContractAction', ContractAction.base)
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
register(registryType: RegistryType, name: string, implementation: Address, params?: WriteParams<typeof boostRegistryAbi, 'register'>): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* @see {@link register}
|
|
115
|
+
* @public
|
|
116
|
+
* @async
|
|
117
|
+
* @param {RegistryType} registryType
|
|
118
|
+
* @param {string} name
|
|
119
|
+
* @param {Address} implementation
|
|
120
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params]
|
|
121
|
+
* @returns {unknown}
|
|
122
|
+
*/
|
|
123
|
+
registerRaw(registryType: RegistryType, name: string, implementation: Address, params?: WriteParams<typeof boostRegistryAbi, 'register'>): Promise<{
|
|
124
|
+
hash: `0x${string}`;
|
|
125
|
+
result: void;
|
|
126
|
+
}>;
|
|
127
|
+
/**
|
|
128
|
+
* Deploy a new instance of a registered base implementation, returning the provided target with a new address set on it.
|
|
129
|
+
*
|
|
130
|
+
* @public
|
|
131
|
+
* @async
|
|
132
|
+
* @template {DeployableTarget} Target
|
|
133
|
+
* @param {string} displayName - The display name for the clone
|
|
134
|
+
* @param {Target} target - An instance of a target contract to clone and initialize
|
|
135
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
|
|
136
|
+
* @returns {Target} - The provided instance, but with a new address attached.
|
|
137
|
+
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
138
|
+
*/
|
|
139
|
+
clone<Target extends DeployableTarget<any, any>>(displayName: string, target: Target, params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>): Promise<Target>;
|
|
140
|
+
/**
|
|
141
|
+
*
|
|
142
|
+
* @see {@link clone}
|
|
143
|
+
* @public
|
|
144
|
+
* @async
|
|
145
|
+
* @template {DeployableTarget} Target
|
|
146
|
+
* @param {string} displayName
|
|
147
|
+
* @param {Target} target
|
|
148
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
|
|
149
|
+
* @returns {Target}
|
|
150
|
+
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
151
|
+
*/
|
|
152
|
+
deployClone<Target extends DeployableTarget<any, any>>(displayName: string, target: Target, params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>): Promise<Address>;
|
|
153
|
+
/**
|
|
154
|
+
* @see {@link clone}
|
|
155
|
+
* @public
|
|
156
|
+
* @async
|
|
157
|
+
* @param {string} displayName
|
|
158
|
+
* @param {DeployableTarget} target
|
|
159
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
|
|
160
|
+
* @returns {unknown} - The transaction hash
|
|
161
|
+
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
162
|
+
*/
|
|
163
|
+
deployCloneRaw<Target extends DeployableTarget<any, any>>(displayName: string, target: Target, params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>): Promise<HashAndSimulatedResult<Address>>;
|
|
164
|
+
/**
|
|
165
|
+
* Get the address of a registered base implementation.
|
|
166
|
+
* This function will revert if the implementation is not registered
|
|
167
|
+
*
|
|
168
|
+
* @public
|
|
169
|
+
* @async
|
|
170
|
+
* @param {Hex} identifier - The unique identifier for the implementation (see {getIdentifier})
|
|
171
|
+
* @param {?ReadParams<typeof boostRegistryAbi, 'getBaseImplementation'>} [params]
|
|
172
|
+
* @returns {unknown} - The address of the implementation
|
|
173
|
+
*/
|
|
174
|
+
getBaseImplementation(identifier: Hex, params?: ReadParams<typeof boostRegistryAbi, 'getBaseImplementation'>): Promise<`0x${string}`>;
|
|
175
|
+
/**
|
|
176
|
+
* Get the address of a deployed clone by its identifier (index in incentives array)
|
|
177
|
+
*
|
|
178
|
+
* @public
|
|
179
|
+
* @async
|
|
180
|
+
* @param {Hex} identifier - The unique identifier for the deployed clone (see {getCloneIdentifier})
|
|
181
|
+
* @param {?ReadParams<typeof boostRegistryAbi, 'getClone'>} [params]
|
|
182
|
+
* @returns {Promise<Address>} - The address of the deployed clone
|
|
183
|
+
*/
|
|
184
|
+
getClone(identifier: Hex, params?: ReadParams<typeof boostRegistryAbi, 'getClone'>): Promise<`0x${string}`>;
|
|
185
|
+
/**
|
|
186
|
+
* Get the list of identifiers of deployed clones for a given deployer
|
|
187
|
+
*
|
|
188
|
+
* @public
|
|
189
|
+
* @async
|
|
190
|
+
* @param {Address} deployer - The address of the deployer
|
|
191
|
+
* @param {?ReadParams<typeof boostRegistryAbi, 'getClones'>} [params]
|
|
192
|
+
* @returns {Promise<Address[]>} - The list of deployed clones for the given deployer
|
|
193
|
+
*/
|
|
194
|
+
getClones(deployer: Address, params?: ReadParams<typeof boostRegistryAbi, 'getClones'>): Promise<readonly `0x${string}`[]>;
|
|
195
|
+
/**
|
|
196
|
+
* Build the identifier for a clone of a base implementation
|
|
197
|
+
*
|
|
198
|
+
* @public
|
|
199
|
+
* @async
|
|
200
|
+
* @param {RegistryType} registryType - The base type for the implementation
|
|
201
|
+
* @param {Address} base - The address of the base implementation
|
|
202
|
+
* @param {Address} deployer - The address of the deployer
|
|
203
|
+
* @param {string} displayName - The display name of the clone
|
|
204
|
+
* @param {?ReadParams<typeof boostRegistryAbi, 'getCloneIdentifier'>} [params]
|
|
205
|
+
* @returns {Promise<Hex>} - The unique identifier for the clone
|
|
206
|
+
*/
|
|
207
|
+
getCloneIdentifier(registryType: RegistryType, base: Address, deployer: Address, displayName: string, params?: ReadParams<typeof boostRegistryAbi, 'getCloneIdentifier'>): Promise<`0x${string}`>;
|
|
208
|
+
/**
|
|
209
|
+
* Build the identifier for a base implementation
|
|
210
|
+
*
|
|
211
|
+
* @public
|
|
212
|
+
* @async
|
|
213
|
+
* @param {RegistryType} registryType - The base type for the implementation
|
|
214
|
+
* @param {string} displayName - The name of the implementation
|
|
215
|
+
* @param {?ReadParams<typeof boostRegistryAbi, 'getIdentifier'>} [params]
|
|
216
|
+
* @returns {Promise<Hex>} - The unique identifier for the implementation
|
|
217
|
+
*/
|
|
218
|
+
getIdentifier(registryType: RegistryType, displayName: string, params?: ReadParams<typeof boostRegistryAbi, 'getIdentifier'>): Promise<`0x${string}`>;
|
|
219
|
+
/**
|
|
220
|
+
* @inheritdoc
|
|
221
|
+
*
|
|
222
|
+
* @public
|
|
223
|
+
* @param {?never[]} [_payload]
|
|
224
|
+
* @param {?DeployableOptions} [_options]
|
|
225
|
+
* @returns {GenericDeployableParams}
|
|
226
|
+
*/
|
|
227
|
+
buildParameters(_payload?: never[], _options?: DeployableOptions): GenericDeployableParams;
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=BoostRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BoostRegistry.d.ts","sourceRoot":"","sources":["../src/BoostRegistry.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { h as o, I as n, N as l, T as h, d as t, b as y, m as r, e as u } from "./generated-x_abr3Yv.js";
|
|
2
|
+
import { isAddress as g } from "viem";
|
|
3
|
+
import { Deployable as A } from "./Deployable/Deployable.js";
|
|
4
|
+
import { RegistryType as T } from "./utils.js";
|
|
5
|
+
const p = "0x6080604052348015600e575f80fd5b50611b4e8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610086575f3560e01c8063acc83fc811610059578063acc83fc81461014a578063d12dd4811461017a578063f166879214610196578063fd97064b146101c657610086565b806301ffc9a71461008a5780633aaf1626146100ba578063792aa01c146100ea57806383f388591461011a575b5f80fd5b6100a4600480360381019061009f9190610e0e565b6101f6565b6040516100b19190610e53565b60405180910390f35b6100d460048036038101906100cf9190610e9f565b61025f565b6040516100e191906110a7565b60405180910390f35b61010460048036038101906100ff91906110f1565b610471565b60405161011191906111d3565b60405180910390f35b610134600480360381019061012f9190610e9f565b610504565b6040516101419190611202565b60405180910390f35b610164600480360381019061015f919061129f565b6105ac565b6040516101719190611332565b60405180910390f35b610194600480360381019061018f919061134b565b6105ee565b005b6101b060048036038101906101ab91906113bc565b610818565b6040516101bd9190611332565b60405180910390f35b6101e060048036038101906101db919061146e565b610854565b6040516101ed9190611202565b60405180910390f35b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b610267610d4e565b60015f8381526020019081526020015f206040518060800160405290815f82015f9054906101000a900460ff1660048111156102a6576102a5610eca565b5b60048111156102b8576102b7610eca565b5b81526020015f820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820180546103769061153e565b80601f01602080910402602001604051908101604052809291908181526020018280546103a29061153e565b80156103ed5780601f106103c4576101008083540402835291602001916103ed565b820191905f5260205f20905b8154815290600101906020018083116103d057829003601f168201915b50505050508152505090505f73ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff160361046c57816040517f8cc00d160000000000000000000000000000000000000000000000000000000081526004016104639190611332565b60405180910390fd5b919050565b606060025f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208054806020026020016040519081016040528092919081815260200182805480156104f857602002820191905f5260205f20905b8154815260200190600101908083116104e4575b50505050509050919050565b5f805f8381526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036105a757816040517f8cc00d1600000000000000000000000000000000000000000000000000000000815260040161059e9190611332565b60405180910390fd5b919050565b5f6105e386868686866040516020016105c894939291906115ef565b60405160208183030381529060405280519060200120610c1c565b905095945050505050565b808073ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f6ab67a0d000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b81526004016106489190611638565b602060405180830381865afa158015610663573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610687919061167b565b6106c857806040517f903b13fd0000000000000000000000000000000000000000000000000000000081526004016106bf91906116b5565b60405180910390fd5b5f6106d4868686610818565b90505f73ffffffffffffffffffffffffffffffffffffffff165f808381526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107775785816040517f96b5684c00000000000000000000000000000000000000000000000000000000815260040161076e9291906116dd565b60405180910390fd5b825f808381526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808660048111156107d9576107d8610eca565b5b7f660d31df25c96b8a337fcf12a56b7363e5a997639db853d5dbaec7c01f31bd808560405161080891906116b5565b60405180910390a3505050505050565b5f61084b848484604051602001610830929190611704565b60405160208183030381529060405280519060200120610c1c565b90509392505050565b5f3068929eee149b4bd2126854036108735763ab143c065f526004601cfd5b3068929eee149b4bd212685561091b878787873360405160200161089b959493929190611750565b6040516020818303038152906040528051906020012084848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f820116905080830192505050505050508873ffffffffffffffffffffffffffffffffffffffff16610c4e9092919063ffffffff16565b90505f61092b88883389896105ac565b90505f73ffffffffffffffffffffffffffffffffffffffff1660015f8381526020019081526020015f205f0160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109d25787816040517f96b5684c0000000000000000000000000000000000000000000000000000000081526004016109c99291906116dd565b60405180910390fd5b60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081908060018154018082558091505060019003905f5260205f20015f90919091909150556040518060800160405280896004811115610a5157610a50610eca565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505081525060015f8381526020019081526020015f205f820151815f015f6101000a81548160ff02191690836004811115610b0e57610b0d610eca565b5b02179055506020820151815f0160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506060820151816002019081610bb49190611965565b5090505080886004811115610bcc57610bcb610eca565b5b7f2348fcdb9847b17a183e53aa32c0c5c76afdef8fcb14bb51f216c6611701ab1a8985604051610bfd929190611a34565b60405180910390a3503868929eee149b4bd21268559695505050505050565b5f8282604051602001610c30929190611a7b565b60405160208183030381529060405280519060200120905092915050565b5f610c78838573ffffffffffffffffffffffffffffffffffffffff16610ce790919063ffffffff16565b90508073ffffffffffffffffffffffffffffffffffffffff1663439fab91836040518263ffffffff1660e01b8152600401610cb39190611af8565b5f604051808303815f87803b158015610cca575f80fd5b505af1158015610cdc573d5f803e3d5ffd5b505050509392505050565b5f610cf35f8484610cfb565b905092915050565b5f6c5af43d3d93803e602a57fd5bf36021528260145273602c3d8160093d39f33d3d3d3d363d3d37363d735f52816035600c86f5905080610d435763301164255f526004601cfd5b5f6021529392505050565b60405180608001604052805f6004811115610d6c57610d6b610eca565b5b81526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff168152602001606081525090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610ded81610db9565b8114610df7575f80fd5b50565b5f81359050610e0881610de4565b92915050565b5f60208284031215610e2357610e22610db1565b5b5f610e3084828501610dfa565b91505092915050565b5f8115159050919050565b610e4d81610e39565b82525050565b5f602082019050610e665f830184610e44565b92915050565b5f819050919050565b610e7e81610e6c565b8114610e88575f80fd5b50565b5f81359050610e9981610e75565b92915050565b5f60208284031215610eb457610eb3610db1565b5b5f610ec184828501610e8b565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60058110610f0857610f07610eca565b5b50565b5f819050610f1882610ef7565b919050565b5f610f2782610f0b565b9050919050565b610f3781610f1d565b82525050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f610f7f610f7a610f7584610f3d565b610f5c565b610f3d565b9050919050565b5f610f9082610f65565b9050919050565b5f610fa182610f86565b9050919050565b610fb181610f97565b82525050565b5f610fc182610f3d565b9050919050565b610fd181610fb7565b82525050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61101982610fd7565b6110238185610fe1565b9350611033818560208601610ff1565b61103c81610fff565b840191505092915050565b5f608083015f83015161105c5f860182610f2e565b50602083015161106f6020860182610fa8565b5060408301516110826040860182610fc8565b506060830151848203606086015261109a828261100f565b9150508091505092915050565b5f6020820190508181035f8301526110bf8184611047565b905092915050565b6110d081610fb7565b81146110da575f80fd5b50565b5f813590506110eb816110c7565b92915050565b5f6020828403121561110657611105610db1565b5b5f611113848285016110dd565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b61114e81610e6c565b82525050565b5f61115f8383611145565b60208301905092915050565b5f602082019050919050565b5f6111818261111c565b61118b8185611126565b935061119683611136565b805f5b838110156111c65781516111ad8882611154565b97506111b88361116b565b925050600181019050611199565b5085935050505092915050565b5f6020820190508181035f8301526111eb8184611177565b905092915050565b6111fc81610f97565b82525050565b5f6020820190506112155f8301846111f3565b92915050565b60058110611227575f80fd5b50565b5f813590506112388161121b565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261125f5761125e61123e565b5b8235905067ffffffffffffffff81111561127c5761127b611242565b5b60208301915083600182028301111561129857611297611246565b5b9250929050565b5f805f805f608086880312156112b8576112b7610db1565b5b5f6112c58882890161122a565b95505060206112d6888289016110dd565b94505060406112e7888289016110dd565b935050606086013567ffffffffffffffff81111561130857611307610db5565b5b6113148882890161124a565b92509250509295509295909350565b61132c81610e6c565b82525050565b5f6020820190506113455f830184611323565b92915050565b5f805f806060858703121561136357611362610db1565b5b5f6113708782880161122a565b945050602085013567ffffffffffffffff81111561139157611390610db5565b5b61139d8782880161124a565b935093505060406113b0878288016110dd565b91505092959194509250565b5f805f604084860312156113d3576113d2610db1565b5b5f6113e08682870161122a565b935050602084013567ffffffffffffffff81111561140157611400610db5565b5b61140d8682870161124a565b92509250509250925092565b5f8083601f84011261142e5761142d61123e565b5b8235905067ffffffffffffffff81111561144b5761144a611242565b5b60208301915083600182028301111561146757611466611246565b5b9250929050565b5f805f805f806080878903121561148857611487610db1565b5b5f61149589828a0161122a565b96505060206114a689828a016110dd565b955050604087013567ffffffffffffffff8111156114c7576114c6610db5565b5b6114d389828a0161124a565b9450945050606087013567ffffffffffffffff8111156114f6576114f5610db5565b5b61150289828a01611419565b92509250509295509295509295565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061155557607f821691505b60208210810361156857611567611511565b5b50919050565b5f8160601b9050919050565b5f6115848261156e565b9050919050565b5f6115958261157a565b9050919050565b6115ad6115a882610fb7565b61158b565b82525050565b5f81905092915050565b828183375f83830152505050565b5f6115d683856115b3565b93506115e38385846115bd565b82840190509392505050565b5f6115fa828761159c565b60148201915061160a828661159c565b60148201915061161b8284866115cb565b915081905095945050505050565b61163281610db9565b82525050565b5f60208201905061164b5f830184611629565b92915050565b61165a81610e39565b8114611664575f80fd5b50565b5f8151905061167581611651565b92915050565b5f602082840312156116905761168f610db1565b5b5f61169d84828501611667565b91505092915050565b6116af81610fb7565b82525050565b5f6020820190506116c85f8301846116a6565b92915050565b6116d781610f1d565b82525050565b5f6040820190506116f05f8301856116ce565b6116fd6020830184611323565b9392505050565b5f6117108284866115cb565b91508190509392505050565b5f8160f81b9050919050565b5f6117328261171c565b9050919050565b61174a61174582610f1d565b611728565b82525050565b5f61175b8288611739565b60018201915061176b828761159c565b60148201915061177c8285876115cb565b9150611788828461159c565b6014820191508190509695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026118247fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826117e9565b61182e86836117e9565b95508019841693508086168417925050509392505050565b5f819050919050565b5f61186961186461185f84611846565b610f5c565b611846565b9050919050565b5f819050919050565b6118828361184f565b61189661188e82611870565b8484546117f5565b825550505050565b5f90565b6118aa61189e565b6118b5818484611879565b505050565b5b818110156118d8576118cd5f826118a2565b6001810190506118bb565b5050565b601f82111561191d576118ee816117c8565b6118f7846117da565b81016020851015611906578190505b61191a611912856117da565b8301826118ba565b50505b505050565b5f82821c905092915050565b5f61193d5f1984600802611922565b1980831691505092915050565b5f611955838361192e565b9150826002028217905092915050565b61196e82610fd7565b67ffffffffffffffff8111156119875761198661179b565b5b611991825461153e565b61199c8282856118dc565b5f60209050601f8311600181146119cd575f84156119bb578287015190505b6119c5858261194a565b865550611a2c565b601f1984166119db866117c8565b5f5b82811015611a02578489015182556001820191506020850194506020810190506119dd565b86831015611a1f5784890151611a1b601f89168261192e565b8355505b6001600288020188555050505b505050505050565b5f604082019050611a475f8301856116a6565b611a5460208301846111f3565b9392505050565b5f819050919050565b611a75611a7082610e6c565b611a5b565b82525050565b5f611a868285611739565b600182019150611a968284611a64565b6020820191508190509392505050565b5f81519050919050565b5f82825260208201905092915050565b5f611aca82611aa6565b611ad48185611ab0565b9350611ae4818560208601610ff1565b611aed81610fff565b840191505092915050565b5f6020820190508181035f830152611b108184611ac0565b90509291505056fea264697066735822122031d8b5092c0648488ea4f8c739d0ff5d8c5debf32ebfcd2f52c823a98c8a410064736f6c634300081a0033", m = "0x5cb8D869f2EE4e3D987Ac7bEB37D6812f5346DFC";
|
|
6
|
+
function R(d) {
|
|
7
|
+
return d.address && g(d.address);
|
|
8
|
+
}
|
|
9
|
+
function _(d) {
|
|
10
|
+
return d.address === null;
|
|
11
|
+
}
|
|
12
|
+
class V extends A {
|
|
13
|
+
/**
|
|
14
|
+
* Creates an instance of BoostRegistry.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link BoostRegistryConfig}
|
|
17
|
+
* @constructor
|
|
18
|
+
* @param {BoostRegistryConfig} param0
|
|
19
|
+
* @param {Config} param0.config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)
|
|
20
|
+
* @param {?Account} [param0.account] - [Viem Local Account](https://viem.sh/docs/accounts/local)
|
|
21
|
+
* @param {({ address?: Address; } | {})} param0....options
|
|
22
|
+
*/
|
|
23
|
+
constructor({ config: b, account: f, ...a }) {
|
|
24
|
+
R(a) && a.address ? super({ account: f, config: b }, a.address) : _(a) ? super({ account: f, config: b }, []) : super({ account: f, config: b }, m);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Register a new base implementation of a given type
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
* @async
|
|
31
|
+
* @param {RegistryType} registryType - The base type for the implementation
|
|
32
|
+
* @param {string} name - A name for the implementation (must be unique within the given type)
|
|
33
|
+
* @param {Address} implementation - The address of the implementation contract
|
|
34
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params] - Optional params to provide the underlying Viem contract call
|
|
35
|
+
* @returns {unknown}
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* await registry.register(ContractAction.registryType, 'ContractAction', ContractAction.base)
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
async register(b, f, a, e) {
|
|
42
|
+
return this.awaitResult(
|
|
43
|
+
this.registerRaw(b, f, a, e)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @see {@link register}
|
|
48
|
+
* @public
|
|
49
|
+
* @async
|
|
50
|
+
* @param {RegistryType} registryType
|
|
51
|
+
* @param {string} name
|
|
52
|
+
* @param {Address} implementation
|
|
53
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params]
|
|
54
|
+
* @returns {unknown}
|
|
55
|
+
*/
|
|
56
|
+
async registerRaw(b, f, a, e) {
|
|
57
|
+
const { request: c, result: s } = await o(
|
|
58
|
+
this._config,
|
|
59
|
+
{
|
|
60
|
+
address: this.assertValidAddress(),
|
|
61
|
+
args: [b, f, a],
|
|
62
|
+
...this.optionallyAttachAccount(),
|
|
63
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
64
|
+
...e
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
return { hash: await n(this._config, c), result: s };
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Deploy a new instance of a registered base implementation, returning the provided target with a new address set on it.
|
|
71
|
+
*
|
|
72
|
+
* @public
|
|
73
|
+
* @async
|
|
74
|
+
* @template {DeployableTarget} Target
|
|
75
|
+
* @param {string} displayName - The display name for the clone
|
|
76
|
+
* @param {Target} target - An instance of a target contract to clone and initialize
|
|
77
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
|
|
78
|
+
* @returns {Target} - The provided instance, but with a new address attached.
|
|
79
|
+
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
80
|
+
*/
|
|
81
|
+
async clone(b, f, a) {
|
|
82
|
+
const e = await this.deployClone(b, f, a);
|
|
83
|
+
return f.at(e);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @see {@link clone}
|
|
88
|
+
* @public
|
|
89
|
+
* @async
|
|
90
|
+
* @template {DeployableTarget} Target
|
|
91
|
+
* @param {string} displayName
|
|
92
|
+
* @param {Target} target
|
|
93
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
|
|
94
|
+
* @returns {Target}
|
|
95
|
+
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
96
|
+
*/
|
|
97
|
+
async deployClone(b, f, a) {
|
|
98
|
+
return this.awaitResult(this.deployCloneRaw(b, f, a));
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* @see {@link clone}
|
|
102
|
+
* @public
|
|
103
|
+
* @async
|
|
104
|
+
* @param {string} displayName
|
|
105
|
+
* @param {DeployableTarget} target
|
|
106
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
|
|
107
|
+
* @returns {unknown} - The transaction hash
|
|
108
|
+
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
109
|
+
*/
|
|
110
|
+
async deployCloneRaw(b, f, a) {
|
|
111
|
+
const e = f.buildParameters(void 0, {
|
|
112
|
+
config: this._config,
|
|
113
|
+
account: this._account
|
|
114
|
+
}), { request: c, result: s } = await l(
|
|
115
|
+
this._config,
|
|
116
|
+
{
|
|
117
|
+
address: this.assertValidAddress(),
|
|
118
|
+
args: [
|
|
119
|
+
f.registryType,
|
|
120
|
+
f.base,
|
|
121
|
+
b,
|
|
122
|
+
e.args.at(0)
|
|
123
|
+
],
|
|
124
|
+
...this.optionallyAttachAccount(),
|
|
125
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
126
|
+
...a
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
return { hash: await h(this._config, c), result: s };
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get the address of a registered base implementation.
|
|
133
|
+
* This function will revert if the implementation is not registered
|
|
134
|
+
*
|
|
135
|
+
* @public
|
|
136
|
+
* @async
|
|
137
|
+
* @param {Hex} identifier - The unique identifier for the implementation (see {getIdentifier})
|
|
138
|
+
* @param {?ReadParams<typeof boostRegistryAbi, 'getBaseImplementation'>} [params]
|
|
139
|
+
* @returns {unknown} - The address of the implementation
|
|
140
|
+
*/
|
|
141
|
+
async getBaseImplementation(b, f) {
|
|
142
|
+
return t(this._config, {
|
|
143
|
+
address: this.assertValidAddress(),
|
|
144
|
+
args: [b],
|
|
145
|
+
...this.optionallyAttachAccount(),
|
|
146
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
147
|
+
...f
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get the address of a deployed clone by its identifier (index in incentives array)
|
|
152
|
+
*
|
|
153
|
+
* @public
|
|
154
|
+
* @async
|
|
155
|
+
* @param {Hex} identifier - The unique identifier for the deployed clone (see {getCloneIdentifier})
|
|
156
|
+
* @param {?ReadParams<typeof boostRegistryAbi, 'getClone'>} [params]
|
|
157
|
+
* @returns {Promise<Address>} - The address of the deployed clone
|
|
158
|
+
*/
|
|
159
|
+
async getClone(b, f) {
|
|
160
|
+
return t(this._config, {
|
|
161
|
+
address: this.assertValidAddress(),
|
|
162
|
+
args: [b],
|
|
163
|
+
...this.optionallyAttachAccount(),
|
|
164
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
165
|
+
...f
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Get the list of identifiers of deployed clones for a given deployer
|
|
170
|
+
*
|
|
171
|
+
* @public
|
|
172
|
+
* @async
|
|
173
|
+
* @param {Address} deployer - The address of the deployer
|
|
174
|
+
* @param {?ReadParams<typeof boostRegistryAbi, 'getClones'>} [params]
|
|
175
|
+
* @returns {Promise<Address[]>} - The list of deployed clones for the given deployer
|
|
176
|
+
*/
|
|
177
|
+
async getClones(b, f) {
|
|
178
|
+
return y(this._config, {
|
|
179
|
+
address: this.assertValidAddress(),
|
|
180
|
+
args: [b],
|
|
181
|
+
...this.optionallyAttachAccount(),
|
|
182
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
183
|
+
...f
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Build the identifier for a clone of a base implementation
|
|
188
|
+
*
|
|
189
|
+
* @public
|
|
190
|
+
* @async
|
|
191
|
+
* @param {RegistryType} registryType - The base type for the implementation
|
|
192
|
+
* @param {Address} base - The address of the base implementation
|
|
193
|
+
* @param {Address} deployer - The address of the deployer
|
|
194
|
+
* @param {string} displayName - The display name of the clone
|
|
195
|
+
* @param {?ReadParams<typeof boostRegistryAbi, 'getCloneIdentifier'>} [params]
|
|
196
|
+
* @returns {Promise<Hex>} - The unique identifier for the clone
|
|
197
|
+
*/
|
|
198
|
+
async getCloneIdentifier(b, f, a, e, c) {
|
|
199
|
+
return r(this._config, {
|
|
200
|
+
address: this.assertValidAddress(),
|
|
201
|
+
args: [b, f, a, e],
|
|
202
|
+
...this.optionallyAttachAccount(),
|
|
203
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
204
|
+
...c
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Build the identifier for a base implementation
|
|
209
|
+
*
|
|
210
|
+
* @public
|
|
211
|
+
* @async
|
|
212
|
+
* @param {RegistryType} registryType - The base type for the implementation
|
|
213
|
+
* @param {string} displayName - The name of the implementation
|
|
214
|
+
* @param {?ReadParams<typeof boostRegistryAbi, 'getIdentifier'>} [params]
|
|
215
|
+
* @returns {Promise<Hex>} - The unique identifier for the implementation
|
|
216
|
+
*/
|
|
217
|
+
async getIdentifier(b, f, a) {
|
|
218
|
+
return r(this._config, {
|
|
219
|
+
address: this.assertValidAddress(),
|
|
220
|
+
args: [b, f],
|
|
221
|
+
...this.optionallyAttachAccount(),
|
|
222
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
223
|
+
...a
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @inheritdoc
|
|
228
|
+
*
|
|
229
|
+
* @public
|
|
230
|
+
* @param {?never[]} [_payload]
|
|
231
|
+
* @param {?DeployableOptions} [_options]
|
|
232
|
+
* @returns {GenericDeployableParams}
|
|
233
|
+
*/
|
|
234
|
+
buildParameters(b, f) {
|
|
235
|
+
const [, a] = this.validateDeploymentConfig([], f);
|
|
236
|
+
return {
|
|
237
|
+
abi: u,
|
|
238
|
+
bytecode: p,
|
|
239
|
+
// biome-ignore lint/suspicious/noExplicitAny: Registry doesn't construct or initialize
|
|
240
|
+
args: [],
|
|
241
|
+
...this.optionallyAttachAccount(a.account)
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
export {
|
|
246
|
+
m as BOOST_REGISTRY_ADDRESS,
|
|
247
|
+
V as BoostRegistry,
|
|
248
|
+
T as RegistryType,
|
|
249
|
+
u as boostRegistryAbi
|
|
250
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../generated-BaaleHW-.cjs"),d=require("@wagmi/core"),u=require("../errors.cjs"),a=require("./ManagedBudget.cjs"),e={"0xa0109882":a.ManagedBudget};async function g(t,n){const r=await d.readContract(t.config,{abi:c.z,functionName:"getComponentInterface",address:n}),o=e[r];if(!o)throw new u.InvalidComponentInterfaceError(Object.keys(e),r);return new o(t,n)}exports.ManagedBudget=a.ManagedBudget;exports.BudgetByComponentInterface=e;exports.budgetFromAddress=g;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import type { DeployableOptions } from '../Deployable/Deployable';
|
|
3
|
+
import { ManagedBudget } from './ManagedBudget';
|
|
4
|
+
export { ManagedBudget, };
|
|
5
|
+
/**
|
|
6
|
+
* A union type representing all valid protocol Budget implementations
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @typedef {Budget}
|
|
10
|
+
*/
|
|
11
|
+
export type Budget = ManagedBudget;
|
|
12
|
+
/**
|
|
13
|
+
* A map of Budget component interfaces to their constructors.
|
|
14
|
+
*
|
|
15
|
+
* @type {{ "0xa0109882": typeof ManagedBudget; }}
|
|
16
|
+
*/
|
|
17
|
+
export declare const BudgetByComponentInterface: {
|
|
18
|
+
"0xa0109882": typeof ManagedBudget;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.
|
|
22
|
+
*
|
|
23
|
+
* @export
|
|
24
|
+
* @async
|
|
25
|
+
* @param {DeployableOptions} options
|
|
26
|
+
* @param {Address} address
|
|
27
|
+
* @returns {Promise<ManagedBudget>}
|
|
28
|
+
* @throws {@link InvalidComponentInterfaceError}
|
|
29
|
+
*/
|
|
30
|
+
export declare function budgetFromAddress(options: DeployableOptions, address: Address): Promise<ManagedBudget>;
|
|
31
|
+
//# sourceMappingURL=Budget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Budget.d.ts","sourceRoot":"","sources":["../../src/Budgets/Budget.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAGL,aAAa,GACd,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,aAAa,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;;CAItC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,OAAO,0BAejB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z as a } from "../generated-x_abr3Yv.js";
|
|
2
|
+
import { readContract as c } from "@wagmi/core";
|
|
3
|
+
import { InvalidComponentInterfaceError as m } from "../errors.js";
|
|
4
|
+
import { ManagedBudget as f } from "./ManagedBudget.js";
|
|
5
|
+
const r = {
|
|
6
|
+
// ['0x64683da1']: VestingBudget,
|
|
7
|
+
// ['0x2929d19c']: SimpleBudget,
|
|
8
|
+
"0xa0109882": f
|
|
9
|
+
};
|
|
10
|
+
async function u(t, e) {
|
|
11
|
+
const n = await c(t.config, {
|
|
12
|
+
abi: a,
|
|
13
|
+
functionName: "getComponentInterface",
|
|
14
|
+
address: e
|
|
15
|
+
}), o = r[n];
|
|
16
|
+
if (!o)
|
|
17
|
+
throw new m(
|
|
18
|
+
Object.keys(r),
|
|
19
|
+
n
|
|
20
|
+
);
|
|
21
|
+
return new o(t, e);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
r as BudgetByComponentInterface,
|
|
25
|
+
f as ManagedBudget,
|
|
26
|
+
u as budgetFromAddress
|
|
27
|
+
};
|