@boostxyz/sdk 7.7.0 → 8.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +1 -1
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +25 -4
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +208 -184
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/{AllowList-DiU7g4Hs.js → AllowList-CWqAYlwr.js} +28 -28
- package/dist/{AllowList-DiU7g4Hs.js.map → AllowList-CWqAYlwr.js.map} +1 -1
- package/dist/{AllowList-BJ9HQGFs.cjs → AllowList-Lpqz7tn9.cjs} +2 -2
- package/dist/{AllowList-BJ9HQGFs.cjs.map → AllowList-Lpqz7tn9.cjs.map} +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +3 -3
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.js +8 -8
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +106 -23
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +518 -451
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +46 -46
- package/dist/{Budget-YIhV65cc.js → Budget-BPPXnBAK.js} +36 -36
- package/dist/{Budget-YIhV65cc.js.map → Budget-BPPXnBAK.js.map} +1 -1
- package/dist/{Budget-D_zhh1rh.cjs → Budget-rZm-AY09.cjs} +2 -2
- package/dist/{Budget-D_zhh1rh.cjs.map → Budget-rZm-AY09.cjs.map} +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.js +24 -24
- package/dist/Deployable/Contract.cjs +1 -1
- package/dist/Deployable/Contract.cjs.map +1 -1
- package/dist/Deployable/Contract.d.ts +8 -0
- package/dist/Deployable/Contract.d.ts.map +1 -1
- package/dist/Deployable/Contract.js +14 -4
- package/dist/Deployable/Contract.js.map +1 -1
- package/dist/Deployable/Deployable.cjs +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +7 -0
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +13 -4
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +7 -7
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +16 -16
- package/dist/{Incentive-CrnbYN_a.cjs → Incentive-Bse5BKbF.cjs} +2 -2
- package/dist/{Incentive-CrnbYN_a.cjs.map → Incentive-Bse5BKbF.cjs.map} +1 -1
- package/dist/{Incentive-CeoEla-t.js → Incentive-D1sYPD0W.js} +23 -23
- package/dist/{Incentive-CeoEla-t.js.map → Incentive-D1sYPD0W.js.map} +1 -1
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.js +17 -17
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.js +38 -38
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.js +13 -13
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +6 -6
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js +22 -22
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts +6 -6
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js +91 -91
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +6 -6
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +9 -9
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts +6 -6
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js +9 -9
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +12 -12
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.js +2 -2
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.js +10 -10
- package/dist/{SimpleDenyList-Dr03aOeP.js → SimpleDenyList-BtEUdiAj.js} +14 -14
- package/dist/{SimpleDenyList-Dr03aOeP.js.map → SimpleDenyList-BtEUdiAj.js.map} +1 -1
- package/dist/{SimpleDenyList-7-VTqfsH.cjs → SimpleDenyList-DEoMIYhE.cjs} +2 -2
- package/dist/{SimpleDenyList-7-VTqfsH.cjs.map → SimpleDenyList-DEoMIYhE.cjs.map} +1 -1
- package/dist/{Validator-rYW7PMwW.cjs → Validator-DHS4vjSa.cjs} +2 -2
- package/dist/{Validator-rYW7PMwW.cjs.map → Validator-DHS4vjSa.cjs.map} +1 -1
- package/dist/{Validator-DgvB9wge.js → Validator-Kpvmj9Bs.js} +9 -9
- package/dist/{Validator-DgvB9wge.js.map → Validator-Kpvmj9Bs.js.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.js +17 -17
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.js +3 -3
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/{deployments-CHQ30INq.js → deployments-Coa8CGi2.js} +67 -67
- package/dist/{deployments-CHQ30INq.js.map → deployments-Coa8CGi2.js.map} +1 -1
- package/dist/{deployments-BjBgk03b.cjs → deployments-Dgzcz4Ev.cjs} +2 -2
- package/dist/deployments-Dgzcz4Ev.cjs.map +1 -0
- package/dist/deployments.json +46 -46
- package/dist/generated-BzLYuFx3.cjs +3 -0
- package/dist/generated-BzLYuFx3.cjs.map +1 -0
- package/dist/{generated-B6mEIx8i.js → generated-D6oDILUw.js} +250 -193
- package/dist/generated-D6oDILUw.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +185 -182
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/Actions/EventAction.test.ts +161 -1
- package/src/Actions/EventAction.ts +52 -5
- package/src/BoostCore.test.ts +34 -23
- package/src/BoostCore.ts +124 -26
- package/src/Deployable/Contract.ts +11 -0
- package/src/Deployable/Deployable.ts +10 -0
- package/src/utils.ts +0 -1
- package/dist/deployments-BjBgk03b.cjs.map +0 -1
- package/dist/generated-B6mEIx8i.js.map +0 -1
- package/dist/generated-dd4FN0Fo.cjs +0 -3
- package/dist/generated-dd4FN0Fo.cjs.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { C as o, a9 as l, aa as w, ab as A, ac as g, ad as p, ae as y, af as m, ag as E, ah as R, ai as T, aj as
|
|
2
|
-
import { getAccount as
|
|
3
|
-
import { zeroAddress as t, encodeAbiParameters as V, parseAbiParameters as
|
|
4
|
-
import { M as
|
|
1
|
+
import { C as o, a9 as l, aa as w, ab as A, ac as g, ad as p, ae as y, af as m, ag as E, ah as R, ai as T, aj as P, ak as _, al as B, am as S } from "../generated-D6oDILUw.js";
|
|
2
|
+
import { getAccount as D } from "@wagmi/core";
|
|
3
|
+
import { zeroAddress as t, encodeAbiParameters as V, parseAbiParameters as I } from "viem";
|
|
4
|
+
import { M as N } from "../deployments-Coa8CGi2.js";
|
|
5
5
|
import { DeployableTargetWithRBAC as k } from "../Deployable/DeployableTargetWithRBAC.js";
|
|
6
|
-
import { DeployableUnknownOwnerProvidedError as
|
|
6
|
+
import { DeployableUnknownOwnerProvidedError as O, UnknownTransferPayloadSupplied as C } from "../errors.js";
|
|
7
7
|
import { prepareFungibleTransfer as F, prepareERC1155Transfer as G } from "../transfers.js";
|
|
8
8
|
import { RegistryType as M } from "../utils.js";
|
|
9
|
-
const q = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b612bba806100895f395ff3fe608060405260043610610252575f3560e01c8063715018a611610137578063ec87621c116100af578063f8724aba1161007e578063fa4ca9b111610063578063fa4ca9b11461076e578063fe9fbb801461078d578063fee81cf4146107ac57610259565b8063f8724aba14610730578063f9a802c31461074f57610259565b8063ec87621c146106b1578063f04e283e146106c5578063f23a6e61146106d8578063f2fde38b1461071d57610259565b8063b300579311610106578063be4994f8116100eb578063be4994f814610654578063d2514e8414610673578063dcc213611461069257610259565b8063b3005793146105c4578063bc197c811461060d57610259565b8063715018a61461052257806375b238fc1461052a578063774c33ab1461053e5780638da5cb5b1461058c57610259565b8063439fab91116101ca578063514e62fc11610199578063578bcf351161017e578063578bcf35146104af5780635aef467a146104f057806361400c991461050357610259565b8063514e62fc1461047257806354d1f13d146104a757610259565b8063439fab9114610400578063451cc1911461041f578063474f5a44146104405780634a4ee7b11461045f57610259565b80631cd64df41161022157806328d6183b1161020657806328d6183b146103515780632de94807146103b05780634359d28a146103e157610259565b80631cd64df414610314578063256929621461034957610259565b806301ffc9a71461028b57806310098ad5146102bf578063183a4f6e146102ec5780631c10893f1461030157610259565b3661025957005b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b348015610296575f80fd5b506102aa6102a53660046120b8565b6107dd565b60405190151581526020015b60405180910390f35b3480156102ca575f80fd5b506102de6102d9366004612118565b6108d0565b6040519081526020016102b6565b6102ff6102fa366004612133565b610919565b005b6102ff61030f36600461214a565b610926565b34801561031f575f80fd5b506102aa61032e36600461214a565b638b78c6d8600c9081525f9290925260209091205481161490565b6102ff61093c565b34801561035c575f80fd5b507f5fbfaa4e000000000000000000000000000000000000000000000000000000005b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016102b6565b3480156103bb575f80fd5b506102de6103ca366004612118565b638b78c6d8600c9081525f91909152602090205490565b3480156103ec575f80fd5b506102ff6103fb3660046121bc565b610989565b34801561040b575f80fd5b506102ff61041a366004612266565b610a83565b34801561042a575f80fd5b506102de610439366004612266565b5f92915050565b34801561044b575f80fd5b506102de61045a366004612266565b610b87565b6102ff61046d36600461214a565b610d4a565b34801561047d575f80fd5b506102aa61048c36600461214a565b638b78c6d8600c9081525f9290925260209091205416151590565b6102ff610d5c565b3480156104ba575f80fd5b506102de6104c9366004612118565b73ffffffffffffffffffffffffffffffffffffffff165f9081526020819052604090205490565b6102aa6104fe366004612266565b610d95565b34801561050e575f80fd5b506102aa61051d3660046122a5565b6110f5565b6102ff61113c565b348015610535575f80fd5b506102de600281565b348015610549575f80fd5b506102de61055836600461214a565b73ffffffffffffffffffffffffffffffffffffffff919091165f908152600160209081526040808320938352929052205490565b348015610597575f80fd5b50638b78c6d8195460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102b6565b3480156105cf575f80fd5b506105e36105de3660046122d8565b61114f565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102b6565b348015610618575f80fd5b5061037f61062736600461233a565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561065f575f80fd5b506102ff61066e3660046121bc565b6112e4565b34801561067e575f80fd5b506102de61068d366004612118565b611382565b34801561069d575f80fd5b506102ff6106ac3660046121bc565b6113ba565b3480156106bc575f80fd5b506102de600181565b6102ff6106d3366004612118565b611458565b3480156106e3575f80fd5b5061037f6106f23660046123fd565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b6102ff61072b366004612118565b611492565b34801561073b575f80fd5b506102de61074a36600461214a565b6114b8565b34801561075a575f80fd5b506102de61076936600461214a565b611552565b348015610779575f80fd5b506102aa610788366004612266565b611609565b348015610798575f80fd5b506102aa6107a7366004612118565b6118e1565b3480156107b7575f80fd5b506102de6107c6366004612118565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f5fbfaa4e00000000000000000000000000000000000000000000000000000000148061086f57507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b806108bb57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b806108ca57506108ca82611940565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff8216156109125761090d73ffffffffffffffffffffffffffffffffffffffff831630611995565b6108ca565b4792915050565b61092333826119c8565b50565b61092e6119d3565b61093882826119ed565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b6002610994816119f9565b8382146109cd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a7b575f8484838181106109ea576109ea612474565b90506020020160208101906109ff91906124a1565b9050801515600103610a4157610a3c878784818110610a2057610a20612474565b9050602002016020810190610a359190612118565b60016119ed565b610a72565b610a72878784818110610a5657610a56612474565b9050602002016020810190610a6b9190612118565b60016119c8565b506001016109cf565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610ad45760018160011c14303b10610acb5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610ae283850185612615565b9050610af0815f0151611a2a565b5f5b816020015151811015610b4b57610b4382602001518281518110610b1857610b18612474565b602002602001015183604001518381518110610b3657610b36612474565b6020026020010151611a72565b600101610af2565b50508015610b82576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f6002610b93816119f9565b5f610ba084860186612764565b90505f8082516002811115610bb757610bb761284a565b1480610bd55750600182516002811115610bd357610bd361284a565b145b15610c2c575f8260600151806020019051810190610bf39190612877565b602084015160408501518251929350610c249215610c12578351611ab3565b610c1f86602001516108d0565b611ab3565b519050610d3f565b600282516002811115610c4157610c4161284a565b03610d36575f8260600151806020019051810190610c5f91906128b9565b9050610d2b83602001518460400151835f015184602001515f14610c87578460200151610d21565b602087015185516040517efdd58e000000000000000000000000000000000000000000000000000000008152306004820152602481019190915273ffffffffffffffffffffffffffffffffffffffff9091169062fdd58e90604401602060405180830381865afa158015610cfd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d219190612977565b8560400151611c71565b602001519050610d3f565b9250610d439050565b9250505b5092915050565b610d526119d3565b61093882826119c8565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f80610da383850185612764565b90505f81516002811115610db957610db961284a565b03610e44575f8160600151806020019051810190610dd79190612877565b80519091503414610e3e57602082015181516040517fcece04c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044015b60405180910390fd5b506110eb565b600181516002811115610e5957610e5961284a565b03610f2d575f8160600151806020019051810190610e779190612877565b604083015181516020850151929350610ea99273ffffffffffffffffffffffffffffffffffffffff1691903090611eb3565b80516020830151610ed09073ffffffffffffffffffffffffffffffffffffffff1630611995565b1015610e3e57602082015181516040517fcece04c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401610e35565b600281516002811115610f4257610f4261284a565b036110e2575f8160600151806020019051810190610f6091906128b9565b9050816020015173ffffffffffffffffffffffffffffffffffffffff1663f242432a836040015130845f0151856020015186604001516040518663ffffffff1660e01b8152600401610fb69594939291906129da565b5f604051808303815f87803b158015610fcd575f80fd5b505af1158015610fdf573d5f803e3d5ffd5b5050506020808301519084015183516040517efdd58e000000000000000000000000000000000000000000000000000000008152306004820152602481019190915291925073ffffffffffffffffffffffffffffffffffffffff169062fdd58e90604401602060405180830381865afa15801561105e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110829190612977565b1015610e3e57602080830151908201516040517fcece04c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401610e35565b5f9150506108ca565b5060019392505050565b5f805b828110156110eb5761112784848381811061111557611115612474565b90506020028101906107889190612a3b565b611134575f9150506108ca565b6001016110f8565b6111446119d3565b61114d5f611f15565b565b5f8061115a336118e1565b611190576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60405180604001604052803073ffffffffffffffffffffffffffffffffffffffff16815260200188888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201829052509390945250506040519293508a92909150819073ffffffffffffffffffffffffffffffffffffffff84169063dd98558c90611228908790602001612a9c565b6040516020818303038152906040528a8a6040518463ffffffff1660e01b815260040161125793929190612ade565b60408051808303815f875af1158015611272573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112969190612b02565b73ffffffffffffffffffffffffffffffffffffffff81165f908152602081905260408120805493955091935084926112cf908490612b5e565b90915550919b909a5098505050505050505050565b60026112ef816119f9565b838214611328576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a7b5761137a86868381811061134757611347612474565b905060200201602081019061135c9190612118565b85858481811061136e5761136e612474565b905060200201356119ed565b60010161132a565b73ffffffffffffffffffffffffffffffffffffffff81165f908152602081905260408120546113b0836108d0565b6108ca9190612b71565b60026113c5816119f9565b8382146113fe576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a7b5761145086868381811061141d5761141d612474565b90506020020160208101906114329190612118565b85858481811061144457611444612474565b905060200201356119c8565b600101611400565b6114606119d3565b63389a75e1600c52805f526020600c20805442111561148657636f5e88185f526004601cfd5b5f905561092381611f15565b61149a6119d3565b8060601b6114af57637448fbae5f526004601cfd5b61092381611f15565b6040517efdd58e000000000000000000000000000000000000000000000000000000008152306004820152602481018290525f9073ffffffffffffffffffffffffffffffffffffffff84169062fdd58e90604401602060405180830381865afa158015611527573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061154b9190612977565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82165f8181526001602090815260408083208584529091528082205490517efdd58e000000000000000000000000000000000000000000000000000000008152306004820152602481018590529192909162fdd58e90604401602060405180830381865afa1580156115db573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115ff9190612977565b61154b9190612b71565b5f611613336118e1565b611649576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61165683850185612764565b905060018151600281111561166d5761166d61284a565b148061168a57505f815160028111156116885761168861284a565b145b15611780575f81606001518060200190518101906116a89190612877565b90505f6116b883602001516108d0565b905080825f0151111561172357602083015182516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092166004830152602482018390526044820152606401610e35565b815160208085015173ffffffffffffffffffffffffffffffffffffffff165f9081529081905260408120805490919061175d908490612b71565b9091555050602083015160408401518351611779929190611ab3565b50506110eb565b6002815160028111156117955761179561284a565b036110e2575f81606001518060200190518101906117b391906128b9565b602083015181516040517efdd58e00000000000000000000000000000000000000000000000000000000815230600482015260248101919091529192505f9173ffffffffffffffffffffffffffffffffffffffff9091169062fdd58e90604401602060405180830381865afa15801561182e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118529190612977565b905080826020015111156118c157602080840151908301516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092166004830152602482018390526044820152606401610e35565b61177983602001518460400151845f015185602001518660400151611c71565b5f8173ffffffffffffffffffffffffffffffffffffffff16611906638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806108ca5750638b78c6d8600c9081525f839052602090205460031615156108ca565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fe49cedd70000000000000000000000000000000000000000000000000000000014806108ca57506108ca82611f5f565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b61093882825f611ff5565b638b78c6d81954331461114d576382b429005f526004601cfd5b61093882826001611ff5565b638b78c6d81954331461092357638b78c6d8600c52335f52806020600c205416610923576382b429005f526004601cfd5b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b3068929eee149b4bd212685403611ad15763ab143c065f526004601cfd5b3068929eee149b4bd212685573ffffffffffffffffffffffffffffffffffffffff8216611b51576040517fbf182be800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80851660048301528316602482015260448101829052606401610e35565b611b5a836108d0565b811115611bc25782611b6b846108d0565b6040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092166004830152602482015260448101829052606401610e35565b73ffffffffffffffffffffffffffffffffffffffff8316611bec57611be7828261204c565b611c0d565b611c0d73ffffffffffffffffffffffffffffffffffffffff84168383612065565b6040805173ffffffffffffffffffffffffffffffffffffffff8481168252602082018490528516917fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd43542910160405180910390a23868929eee149b4bd2126855505050565b3068929eee149b4bd212685403611c8f5763ab143c065f526004601cfd5b3068929eee149b4bd212685573ffffffffffffffffffffffffffffffffffffffff8416611d0f576040517fbf182be800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80871660048301528516602482015260448101839052606401610e35565b611d1985846114b8565b821115611d825784611d2b86856114b8565b6040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092166004830152602482015260448101839052606401610e35565b73ffffffffffffffffffffffffffffffffffffffff85165f90815260016020908152604080832086845290915281208054849290611dc1908490612b71565b90915550506040517ff242432a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86169063f242432a90611e2090309088908890889088906004016129da565b5f604051808303815f87803b158015611e37575f80fd5b505af1158015611e49573d5f803e3d5ffd5b50506040805173ffffffffffffffffffffffffffffffffffffffff888116825260208201879052891693507fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd4354292500160405180910390a23868929eee149b4bd21268555050505050565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f511416611f0757803d873b151710611f0757637939f4245f526004601cfd5b505f60605260405250505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806108ca57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146108ca565b638b78c6d8600c52825f526020600c20805483811783612016575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f385f3884865af16109385763b12d13eb5f526004601cfd5b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f5114166120ae57803d853b1517106120ae576390b8ec185f526004601cfd5b505f603452505050565b5f602082840312156120c8575f80fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461154b575f80fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610923575f80fd5b5f60208284031215612128575f80fd5b813561154b816120f7565b5f60208284031215612143575f80fd5b5035919050565b5f806040838503121561215b575f80fd5b8235612166816120f7565b946020939093013593505050565b5f8083601f840112612184575f80fd5b50813567ffffffffffffffff81111561219b575f80fd5b6020830191508360208260051b85010111156121b5575f80fd5b9250929050565b5f805f80604085870312156121cf575f80fd5b843567ffffffffffffffff8111156121e5575f80fd5b6121f187828801612174565b909550935050602085013567ffffffffffffffff811115612210575f80fd5b61221c87828801612174565b95989497509550505050565b5f8083601f840112612238575f80fd5b50813567ffffffffffffffff81111561224f575f80fd5b6020830191508360208285010111156121b5575f80fd5b5f8060208385031215612277575f80fd5b823567ffffffffffffffff81111561228d575f80fd5b61229985828601612228565b90969095509350505050565b5f80602083850312156122b6575f80fd5b823567ffffffffffffffff8111156122cc575f80fd5b61229985828601612174565b5f805f805f608086880312156122ec575f80fd5b85356122f7816120f7565b9450602086013567ffffffffffffffff811115612312575f80fd5b61231e88828901612228565b9699909850959660408101359660609091013595509350505050565b5f805f805f805f8060a0898b031215612351575f80fd5b883561235c816120f7565b9750602089013561236c816120f7565b9650604089013567ffffffffffffffff811115612387575f80fd5b6123938b828c01612174565b909750955050606089013567ffffffffffffffff8111156123b2575f80fd5b6123be8b828c01612174565b909550935050608089013567ffffffffffffffff8111156123dd575f80fd5b6123e98b828c01612228565b999c989b5096995094979396929594505050565b5f805f805f8060a08789031215612412575f80fd5b863561241d816120f7565b9550602087013561242d816120f7565b94506040870135935060608701359250608087013567ffffffffffffffff811115612456575f80fd5b61246289828a01612228565b979a9699509497509295939492505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f602082840312156124b1575f80fd5b8135801515811461154b575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516060810167ffffffffffffffff81118282101715612510576125106124c0565b60405290565b6040516080810167ffffffffffffffff81118282101715612510576125106124c0565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612580576125806124c0565b604052919050565b5f67ffffffffffffffff8211156125a1576125a16124c0565b5060051b60200190565b5f82601f8301126125ba575f80fd5b81356125cd6125c882612588565b612539565b8082825260208201915060208360051b8601019250858311156125ee575f80fd5b602085015b8381101561260b5780358352602092830192016125f3565b5095945050505050565b5f60208284031215612625575f80fd5b813567ffffffffffffffff81111561263b575f80fd5b82016060818503121561264c575f80fd5b6126546124ed565b813561265f816120f7565b8152602082013567ffffffffffffffff81111561267a575f80fd5b8201601f8101861361268a575f80fd5b80356126986125c882612588565b8082825260208201915060208360051b8501019250888311156126b9575f80fd5b6020840193505b828410156126e45783356126d3816120f7565b8252602093840193909101906126c0565b6020850152505050604082013567ffffffffffffffff811115612705575f80fd5b612711868285016125ab565b604083015250949350505050565b5f67ffffffffffffffff821115612738576127386124c0565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f60208284031215612774575f80fd5b813567ffffffffffffffff81111561278a575f80fd5b82016080818503121561279b575f80fd5b6127a3612516565b8135600381106127b1575f80fd5b815260208201356127c1816120f7565b602082015260408201356127d4816120f7565b6040820152606082013567ffffffffffffffff8111156127f2575f80fd5b80830192505084601f830112612806575f80fd5b81356128146125c88261271f565b818152866020838601011115612828575f80fd5b816020850160208301375f918101602001919091526060820152949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f6020828403128015612888575f80fd5b506040516020810167ffffffffffffffff811182821017156128ac576128ac6124c0565b6040529151825250919050565b5f602082840312156128c9575f80fd5b815167ffffffffffffffff8111156128df575f80fd5b8201606081850312156128f0575f80fd5b6128f86124ed565b8151815260208083015190820152604082015167ffffffffffffffff81111561291f575f80fd5b80830192505084601f830112612933575f80fd5b81516129416125c88261271f565b818152866020838601011115612955575f80fd5b8160208501602083015e5f918101602001919091526040820152949350505050565b5f60208284031215612987575f80fd5b5051919050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b73ffffffffffffffffffffffffffffffffffffffff8616815273ffffffffffffffffffffffffffffffffffffffff8516602082015283604082015282606082015260a060808201525f612a3060a083018461298e565b979650505050505050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612a6e575f80fd5b83018035915067ffffffffffffffff821115612a88575f80fd5b6020019150368190038213156121b5575f80fd5b6020815273ffffffffffffffffffffffffffffffffffffffff82511660208201525f6020830151604080840152612ad6606084018261298e565b949350505050565b606081525f612af0606083018661298e565b60208301949094525060400152919050565b5f8060408385031215612b13575f80fd5b82516020840151909250612b26816120f7565b809150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b818103818111156108ca576108ca612b31565b808201808211156108ca576108ca612b3156fea264697066735822122046c94008e6e9f40d780be9afd13f29f60c7d13d80bc5bdd187b40201a133d17164736f6c634300081a0033", n = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_BOOST_MAINNET_SIGNER_EOA: "0xCBD0C302040bC803B4B2EDaF21Be0e49Deff5480", VITE_BOOST_TESTNET_SIGNER_EOA: "0xd63167e9db11B108940b2E8236581F961f33f396" };
|
|
10
|
-
var
|
|
11
|
-
function
|
|
9
|
+
const q = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b612bba806100895f395ff3fe608060405260043610610252575f3560e01c8063715018a611610137578063ec87621c116100af578063f8724aba1161007e578063fa4ca9b111610063578063fa4ca9b11461076e578063fe9fbb801461078d578063fee81cf4146107ac57610259565b8063f8724aba14610730578063f9a802c31461074f57610259565b8063ec87621c146106b1578063f04e283e146106c5578063f23a6e61146106d8578063f2fde38b1461071d57610259565b8063b300579311610106578063be4994f8116100eb578063be4994f814610654578063d2514e8414610673578063dcc213611461069257610259565b8063b3005793146105c4578063bc197c811461060d57610259565b8063715018a61461052257806375b238fc1461052a578063774c33ab1461053e5780638da5cb5b1461058c57610259565b8063439fab91116101ca578063514e62fc11610199578063578bcf351161017e578063578bcf35146104af5780635aef467a146104f057806361400c991461050357610259565b8063514e62fc1461047257806354d1f13d146104a757610259565b8063439fab9114610400578063451cc1911461041f578063474f5a44146104405780634a4ee7b11461045f57610259565b80631cd64df41161022157806328d6183b1161020657806328d6183b146103515780632de94807146103b05780634359d28a146103e157610259565b80631cd64df414610314578063256929621461034957610259565b806301ffc9a71461028b57806310098ad5146102bf578063183a4f6e146102ec5780631c10893f1461030157610259565b3661025957005b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b348015610296575f80fd5b506102aa6102a53660046120b8565b6107dd565b60405190151581526020015b60405180910390f35b3480156102ca575f80fd5b506102de6102d9366004612118565b6108d0565b6040519081526020016102b6565b6102ff6102fa366004612133565b610919565b005b6102ff61030f36600461214a565b610926565b34801561031f575f80fd5b506102aa61032e36600461214a565b638b78c6d8600c9081525f9290925260209091205481161490565b6102ff61093c565b34801561035c575f80fd5b507f5fbfaa4e000000000000000000000000000000000000000000000000000000005b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016102b6565b3480156103bb575f80fd5b506102de6103ca366004612118565b638b78c6d8600c9081525f91909152602090205490565b3480156103ec575f80fd5b506102ff6103fb3660046121bc565b610989565b34801561040b575f80fd5b506102ff61041a366004612266565b610a83565b34801561042a575f80fd5b506102de610439366004612266565b5f92915050565b34801561044b575f80fd5b506102de61045a366004612266565b610b87565b6102ff61046d36600461214a565b610d4a565b34801561047d575f80fd5b506102aa61048c36600461214a565b638b78c6d8600c9081525f9290925260209091205416151590565b6102ff610d5c565b3480156104ba575f80fd5b506102de6104c9366004612118565b73ffffffffffffffffffffffffffffffffffffffff165f9081526020819052604090205490565b6102aa6104fe366004612266565b610d95565b34801561050e575f80fd5b506102aa61051d3660046122a5565b6110f5565b6102ff61113c565b348015610535575f80fd5b506102de600281565b348015610549575f80fd5b506102de61055836600461214a565b73ffffffffffffffffffffffffffffffffffffffff919091165f908152600160209081526040808320938352929052205490565b348015610597575f80fd5b50638b78c6d8195460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102b6565b3480156105cf575f80fd5b506105e36105de3660046122d8565b61114f565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102b6565b348015610618575f80fd5b5061037f61062736600461233a565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561065f575f80fd5b506102ff61066e3660046121bc565b6112e4565b34801561067e575f80fd5b506102de61068d366004612118565b611382565b34801561069d575f80fd5b506102ff6106ac3660046121bc565b6113ba565b3480156106bc575f80fd5b506102de600181565b6102ff6106d3366004612118565b611458565b3480156106e3575f80fd5b5061037f6106f23660046123fd565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b6102ff61072b366004612118565b611492565b34801561073b575f80fd5b506102de61074a36600461214a565b6114b8565b34801561075a575f80fd5b506102de61076936600461214a565b611552565b348015610779575f80fd5b506102aa610788366004612266565b611609565b348015610798575f80fd5b506102aa6107a7366004612118565b6118e1565b3480156107b7575f80fd5b506102de6107c6366004612118565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f5fbfaa4e00000000000000000000000000000000000000000000000000000000148061086f57507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b806108bb57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b806108ca57506108ca82611940565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff8216156109125761090d73ffffffffffffffffffffffffffffffffffffffff831630611995565b6108ca565b4792915050565b61092333826119c8565b50565b61092e6119d3565b61093882826119ed565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b6002610994816119f9565b8382146109cd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a7b575f8484838181106109ea576109ea612474565b90506020020160208101906109ff91906124a1565b9050801515600103610a4157610a3c878784818110610a2057610a20612474565b9050602002016020810190610a359190612118565b60016119ed565b610a72565b610a72878784818110610a5657610a56612474565b9050602002016020810190610a6b9190612118565b60016119c8565b506001016109cf565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610ad45760018160011c14303b10610acb5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610ae283850185612615565b9050610af0815f0151611a2a565b5f5b816020015151811015610b4b57610b4382602001518281518110610b1857610b18612474565b602002602001015183604001518381518110610b3657610b36612474565b6020026020010151611a72565b600101610af2565b50508015610b82576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f6002610b93816119f9565b5f610ba084860186612764565b90505f8082516002811115610bb757610bb761284a565b1480610bd55750600182516002811115610bd357610bd361284a565b145b15610c2c575f8260600151806020019051810190610bf39190612877565b602084015160408501518251929350610c249215610c12578351611ab3565b610c1f86602001516108d0565b611ab3565b519050610d3f565b600282516002811115610c4157610c4161284a565b03610d36575f8260600151806020019051810190610c5f91906128b9565b9050610d2b83602001518460400151835f015184602001515f14610c87578460200151610d21565b602087015185516040517efdd58e000000000000000000000000000000000000000000000000000000008152306004820152602481019190915273ffffffffffffffffffffffffffffffffffffffff9091169062fdd58e90604401602060405180830381865afa158015610cfd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d219190612977565b8560400151611c71565b602001519050610d3f565b9250610d439050565b9250505b5092915050565b610d526119d3565b61093882826119c8565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f80610da383850185612764565b90505f81516002811115610db957610db961284a565b03610e44575f8160600151806020019051810190610dd79190612877565b80519091503414610e3e57602082015181516040517fcece04c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044015b60405180910390fd5b506110eb565b600181516002811115610e5957610e5961284a565b03610f2d575f8160600151806020019051810190610e779190612877565b604083015181516020850151929350610ea99273ffffffffffffffffffffffffffffffffffffffff1691903090611eb3565b80516020830151610ed09073ffffffffffffffffffffffffffffffffffffffff1630611995565b1015610e3e57602082015181516040517fcece04c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401610e35565b600281516002811115610f4257610f4261284a565b036110e2575f8160600151806020019051810190610f6091906128b9565b9050816020015173ffffffffffffffffffffffffffffffffffffffff1663f242432a836040015130845f0151856020015186604001516040518663ffffffff1660e01b8152600401610fb69594939291906129da565b5f604051808303815f87803b158015610fcd575f80fd5b505af1158015610fdf573d5f803e3d5ffd5b5050506020808301519084015183516040517efdd58e000000000000000000000000000000000000000000000000000000008152306004820152602481019190915291925073ffffffffffffffffffffffffffffffffffffffff169062fdd58e90604401602060405180830381865afa15801561105e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110829190612977565b1015610e3e57602080830151908201516040517fcece04c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401610e35565b5f9150506108ca565b5060019392505050565b5f805b828110156110eb5761112784848381811061111557611115612474565b90506020028101906107889190612a3b565b611134575f9150506108ca565b6001016110f8565b6111446119d3565b61114d5f611f15565b565b5f8061115a336118e1565b611190576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60405180604001604052803073ffffffffffffffffffffffffffffffffffffffff16815260200188888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201829052509390945250506040519293508a92909150819073ffffffffffffffffffffffffffffffffffffffff84169063dd98558c90611228908790602001612a9c565b6040516020818303038152906040528a8a6040518463ffffffff1660e01b815260040161125793929190612ade565b60408051808303815f875af1158015611272573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112969190612b02565b73ffffffffffffffffffffffffffffffffffffffff81165f908152602081905260408120805493955091935084926112cf908490612b5e565b90915550919b909a5098505050505050505050565b60026112ef816119f9565b838214611328576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a7b5761137a86868381811061134757611347612474565b905060200201602081019061135c9190612118565b85858481811061136e5761136e612474565b905060200201356119ed565b60010161132a565b73ffffffffffffffffffffffffffffffffffffffff81165f908152602081905260408120546113b0836108d0565b6108ca9190612b71565b60026113c5816119f9565b8382146113fe576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a7b5761145086868381811061141d5761141d612474565b90506020020160208101906114329190612118565b85858481811061144457611444612474565b905060200201356119c8565b600101611400565b6114606119d3565b63389a75e1600c52805f526020600c20805442111561148657636f5e88185f526004601cfd5b5f905561092381611f15565b61149a6119d3565b8060601b6114af57637448fbae5f526004601cfd5b61092381611f15565b6040517efdd58e000000000000000000000000000000000000000000000000000000008152306004820152602481018290525f9073ffffffffffffffffffffffffffffffffffffffff84169062fdd58e90604401602060405180830381865afa158015611527573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061154b9190612977565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82165f8181526001602090815260408083208584529091528082205490517efdd58e000000000000000000000000000000000000000000000000000000008152306004820152602481018590529192909162fdd58e90604401602060405180830381865afa1580156115db573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115ff9190612977565b61154b9190612b71565b5f611613336118e1565b611649576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61165683850185612764565b905060018151600281111561166d5761166d61284a565b148061168a57505f815160028111156116885761168861284a565b145b15611780575f81606001518060200190518101906116a89190612877565b90505f6116b883602001516108d0565b905080825f0151111561172357602083015182516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092166004830152602482018390526044820152606401610e35565b815160208085015173ffffffffffffffffffffffffffffffffffffffff165f9081529081905260408120805490919061175d908490612b71565b9091555050602083015160408401518351611779929190611ab3565b50506110eb565b6002815160028111156117955761179561284a565b036110e2575f81606001518060200190518101906117b391906128b9565b602083015181516040517efdd58e00000000000000000000000000000000000000000000000000000000815230600482015260248101919091529192505f9173ffffffffffffffffffffffffffffffffffffffff9091169062fdd58e90604401602060405180830381865afa15801561182e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118529190612977565b905080826020015111156118c157602080840151908301516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092166004830152602482018390526044820152606401610e35565b61177983602001518460400151845f015185602001518660400151611c71565b5f8173ffffffffffffffffffffffffffffffffffffffff16611906638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806108ca5750638b78c6d8600c9081525f839052602090205460031615156108ca565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fe49cedd70000000000000000000000000000000000000000000000000000000014806108ca57506108ca82611f5f565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b61093882825f611ff5565b638b78c6d81954331461114d576382b429005f526004601cfd5b61093882826001611ff5565b638b78c6d81954331461092357638b78c6d8600c52335f52806020600c205416610923576382b429005f526004601cfd5b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b3068929eee149b4bd212685403611ad15763ab143c065f526004601cfd5b3068929eee149b4bd212685573ffffffffffffffffffffffffffffffffffffffff8216611b51576040517fbf182be800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80851660048301528316602482015260448101829052606401610e35565b611b5a836108d0565b811115611bc25782611b6b846108d0565b6040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092166004830152602482015260448101829052606401610e35565b73ffffffffffffffffffffffffffffffffffffffff8316611bec57611be7828261204c565b611c0d565b611c0d73ffffffffffffffffffffffffffffffffffffffff84168383612065565b6040805173ffffffffffffffffffffffffffffffffffffffff8481168252602082018490528516917fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd43542910160405180910390a23868929eee149b4bd2126855505050565b3068929eee149b4bd212685403611c8f5763ab143c065f526004601cfd5b3068929eee149b4bd212685573ffffffffffffffffffffffffffffffffffffffff8416611d0f576040517fbf182be800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80871660048301528516602482015260448101839052606401610e35565b611d1985846114b8565b821115611d825784611d2b86856114b8565b6040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092166004830152602482015260448101839052606401610e35565b73ffffffffffffffffffffffffffffffffffffffff85165f90815260016020908152604080832086845290915281208054849290611dc1908490612b71565b90915550506040517ff242432a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86169063f242432a90611e2090309088908890889088906004016129da565b5f604051808303815f87803b158015611e37575f80fd5b505af1158015611e49573d5f803e3d5ffd5b50506040805173ffffffffffffffffffffffffffffffffffffffff888116825260208201879052891693507fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd4354292500160405180910390a23868929eee149b4bd21268555050505050565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f511416611f0757803d873b151710611f0757637939f4245f526004601cfd5b505f60605260405250505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806108ca57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146108ca565b638b78c6d8600c52825f526020600c20805483811783612016575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f385f3884865af16109385763b12d13eb5f526004601cfd5b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f5114166120ae57803d853b1517106120ae576390b8ec185f526004601cfd5b505f603452505050565b5f602082840312156120c8575f80fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461154b575f80fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610923575f80fd5b5f60208284031215612128575f80fd5b813561154b816120f7565b5f60208284031215612143575f80fd5b5035919050565b5f806040838503121561215b575f80fd5b8235612166816120f7565b946020939093013593505050565b5f8083601f840112612184575f80fd5b50813567ffffffffffffffff81111561219b575f80fd5b6020830191508360208260051b85010111156121b5575f80fd5b9250929050565b5f805f80604085870312156121cf575f80fd5b843567ffffffffffffffff8111156121e5575f80fd5b6121f187828801612174565b909550935050602085013567ffffffffffffffff811115612210575f80fd5b61221c87828801612174565b95989497509550505050565b5f8083601f840112612238575f80fd5b50813567ffffffffffffffff81111561224f575f80fd5b6020830191508360208285010111156121b5575f80fd5b5f8060208385031215612277575f80fd5b823567ffffffffffffffff81111561228d575f80fd5b61229985828601612228565b90969095509350505050565b5f80602083850312156122b6575f80fd5b823567ffffffffffffffff8111156122cc575f80fd5b61229985828601612174565b5f805f805f608086880312156122ec575f80fd5b85356122f7816120f7565b9450602086013567ffffffffffffffff811115612312575f80fd5b61231e88828901612228565b9699909850959660408101359660609091013595509350505050565b5f805f805f805f8060a0898b031215612351575f80fd5b883561235c816120f7565b9750602089013561236c816120f7565b9650604089013567ffffffffffffffff811115612387575f80fd5b6123938b828c01612174565b909750955050606089013567ffffffffffffffff8111156123b2575f80fd5b6123be8b828c01612174565b909550935050608089013567ffffffffffffffff8111156123dd575f80fd5b6123e98b828c01612228565b999c989b5096995094979396929594505050565b5f805f805f8060a08789031215612412575f80fd5b863561241d816120f7565b9550602087013561242d816120f7565b94506040870135935060608701359250608087013567ffffffffffffffff811115612456575f80fd5b61246289828a01612228565b979a9699509497509295939492505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f602082840312156124b1575f80fd5b8135801515811461154b575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516060810167ffffffffffffffff81118282101715612510576125106124c0565b60405290565b6040516080810167ffffffffffffffff81118282101715612510576125106124c0565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612580576125806124c0565b604052919050565b5f67ffffffffffffffff8211156125a1576125a16124c0565b5060051b60200190565b5f82601f8301126125ba575f80fd5b81356125cd6125c882612588565b612539565b8082825260208201915060208360051b8601019250858311156125ee575f80fd5b602085015b8381101561260b5780358352602092830192016125f3565b5095945050505050565b5f60208284031215612625575f80fd5b813567ffffffffffffffff81111561263b575f80fd5b82016060818503121561264c575f80fd5b6126546124ed565b813561265f816120f7565b8152602082013567ffffffffffffffff81111561267a575f80fd5b8201601f8101861361268a575f80fd5b80356126986125c882612588565b8082825260208201915060208360051b8501019250888311156126b9575f80fd5b6020840193505b828410156126e45783356126d3816120f7565b8252602093840193909101906126c0565b6020850152505050604082013567ffffffffffffffff811115612705575f80fd5b612711868285016125ab565b604083015250949350505050565b5f67ffffffffffffffff821115612738576127386124c0565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f60208284031215612774575f80fd5b813567ffffffffffffffff81111561278a575f80fd5b82016080818503121561279b575f80fd5b6127a3612516565b8135600381106127b1575f80fd5b815260208201356127c1816120f7565b602082015260408201356127d4816120f7565b6040820152606082013567ffffffffffffffff8111156127f2575f80fd5b80830192505084601f830112612806575f80fd5b81356128146125c88261271f565b818152866020838601011115612828575f80fd5b816020850160208301375f918101602001919091526060820152949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f6020828403128015612888575f80fd5b506040516020810167ffffffffffffffff811182821017156128ac576128ac6124c0565b6040529151825250919050565b5f602082840312156128c9575f80fd5b815167ffffffffffffffff8111156128df575f80fd5b8201606081850312156128f0575f80fd5b6128f86124ed565b8151815260208083015190820152604082015167ffffffffffffffff81111561291f575f80fd5b80830192505084601f830112612933575f80fd5b81516129416125c88261271f565b818152866020838601011115612955575f80fd5b8160208501602083015e5f918101602001919091526040820152949350505050565b5f60208284031215612987575f80fd5b5051919050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b73ffffffffffffffffffffffffffffffffffffffff8616815273ffffffffffffffffffffffffffffffffffffffff8516602082015283604082015282606082015260a060808201525f612a3060a083018461298e565b979650505050505050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612a6e575f80fd5b83018035915067ffffffffffffffff821115612a88575f80fd5b6020019150368190038213156121b5575f80fd5b6020815273ffffffffffffffffffffffffffffffffffffffff82511660208201525f6020830151604080840152612ad6606084018261298e565b949350505050565b606081525f612af0606083018661298e565b60208301949094525060400152919050565b5f8060408385031215612b13575f80fd5b82516020840151909250612b26816120f7565b809150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b818103818111156108ca576108ca612b31565b808201808211156108ca576108ca612b3156fea2646970667358221220c4ceb61ae9b147f3db7bb6eeb085a96e57c86e7cb30da8dcd16fc766f3342fb164736f6c634300081a0033", n = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_BOOST_MAINNET_SIGNER_EOA: "0xCBD0C302040bC803B4B2EDaF21Be0e49Deff5480", VITE_BOOST_TESTNET_SIGNER_EOA: "0xd63167e9db11B108940b2E8236581F961f33f396" };
|
|
10
|
+
var v = /* @__PURE__ */ ((d) => (d[d.MANAGER = 1n] = "MANAGER", d[d.ADMIN = 2n] = "ADMIN", d))(v || {});
|
|
11
|
+
function x(d) {
|
|
12
12
|
return d.tokenId === void 0;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function U(d) {
|
|
15
15
|
return d.tokenId !== void 0;
|
|
16
16
|
}
|
|
17
17
|
function r(d) {
|
|
18
|
-
if (
|
|
18
|
+
if (x(d))
|
|
19
19
|
return F(d);
|
|
20
|
-
if (
|
|
20
|
+
if (U(d))
|
|
21
21
|
return G(d);
|
|
22
|
-
throw new
|
|
22
|
+
throw new C(d);
|
|
23
23
|
}
|
|
24
24
|
const i = class i extends k {
|
|
25
25
|
constructor() {
|
|
@@ -248,7 +248,7 @@ const i = class i extends k {
|
|
|
248
248
|
* @returns {Promise<Address>}
|
|
249
249
|
*/
|
|
250
250
|
owner(f) {
|
|
251
|
-
return
|
|
251
|
+
return P(this._config, {
|
|
252
252
|
address: this.assertValidAddress(),
|
|
253
253
|
args: [],
|
|
254
254
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -302,7 +302,7 @@ const i = class i extends k {
|
|
|
302
302
|
* @returns {Promise<bigint>} - The amount of assets distributed
|
|
303
303
|
*/
|
|
304
304
|
distributed(f = t, b, a) {
|
|
305
|
-
return
|
|
305
|
+
return S(this._config, {
|
|
306
306
|
address: this.assertValidAddress(),
|
|
307
307
|
args: b ? [f, b] : [f],
|
|
308
308
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -324,31 +324,31 @@ const i = class i extends k {
|
|
|
324
324
|
b
|
|
325
325
|
);
|
|
326
326
|
if (!a.owner || a.owner === t) {
|
|
327
|
-
const s = e.account ? e.account.address : e.config ?
|
|
327
|
+
const s = e.account ? e.account.address : e.config ? D(e.config).address : (c = this._account) == null ? void 0 : c.address;
|
|
328
328
|
if (s)
|
|
329
329
|
a.owner = s;
|
|
330
330
|
else
|
|
331
|
-
throw new
|
|
331
|
+
throw new O();
|
|
332
332
|
}
|
|
333
333
|
return {
|
|
334
334
|
abi: o,
|
|
335
335
|
bytecode: q,
|
|
336
|
-
args: [
|
|
336
|
+
args: [z(a)],
|
|
337
337
|
...this.optionallyAttachAccount(e.account)
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
340
|
};
|
|
341
341
|
i.bases = {
|
|
342
342
|
...n != null && n.VITE_MANAGED_BUDGET_BASE ? { 31337: void 0 } : {},
|
|
343
|
-
...
|
|
343
|
+
...N
|
|
344
344
|
}, i.registryType = M.BUDGET;
|
|
345
345
|
let h = i;
|
|
346
|
-
const
|
|
346
|
+
const z = ({
|
|
347
347
|
owner: d,
|
|
348
348
|
authorized: f,
|
|
349
349
|
roles: b
|
|
350
350
|
}) => V(
|
|
351
|
-
|
|
351
|
+
I([
|
|
352
352
|
"ManagedBudgetPayload payload",
|
|
353
353
|
"struct ManagedBudgetPayload { address owner; address[] authorized; uint256[] roles; }"
|
|
354
354
|
]),
|
|
@@ -356,11 +356,11 @@ const j = ({
|
|
|
356
356
|
);
|
|
357
357
|
export {
|
|
358
358
|
h as ManagedBudget,
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
v as ManagedBudgetRoles,
|
|
360
|
+
U as isERC1155TransferPayload,
|
|
361
|
+
x as isFungibleTransfer,
|
|
362
362
|
o as managedBudgetAbi,
|
|
363
|
-
|
|
363
|
+
z as prepareManagedBudgetPayload,
|
|
364
364
|
r as prepareTransfer
|
|
365
365
|
};
|
|
366
366
|
//# sourceMappingURL=ManagedBudget.js.map
|
|
@@ -1,2 +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()})}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;
|
|
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}get config(){return this._config}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
2
|
//# sourceMappingURL=Contract.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contract.cjs","sources":["../../src/Deployable/Contract.ts"],"sourcesContent":["import { type Config, watchContractEvent } from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type GetLogsReturnType,\n type WaitForTransactionReceiptParameters,\n type WatchContractEventOnLogsParameter,\n getAbiItem,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport { ContractAddressRequiredError } from '../errors';\nimport {\n type GetLogsParams,\n type HashAndSimulatedResult,\n type WatchParams,\n awaitResult,\n} from '../utils';\n\n/**\n * A basic Contract class to encapsulate configuration and a potential address\n *\n * @export\n * @class Contract\n * @typedef {Contract}\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=any]\n */\nexport class Contract<ContractAbi extends Abi> {\n //@ts-expect-error this should always be set by implementing contract\n public readonly abi: ContractAbi;\n /**\n * @see [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @protected\n * @type {WagmiConfig}\n */\n protected _config: Config;\n /**\n * The internally managed address for this contract\n *\n * @protected\n * @type {(Address | undefined)}\n */\n protected _address: Address | undefined;\n\n /**\n * Creates an instance of Contract.\n *\n * @constructor\n * @param {Config} config\n * @param {(Address | undefined)} address\n */\n constructor(config: Config, address: Address | undefined) {\n this._config = config;\n this._address = address;\n }\n\n /**\n * A getter returning this contract's deployed address, if it exists.\n *\n * @public\n * @readonly\n * @type {Address | undefined}\n */\n public get address() {\n return this._address;\n }\n\n /**\n * Will set this contract's address and return the instance for chaining. Does not verify that provided address is valid.\n *\n * @public\n * @param {Address} address\n * @returns {this}\n */\n public at(address: Address) {\n this._address = address;\n return this;\n }\n\n /**\n * Will set this contract's internal [Wagmi Configuration](https://en.wikipedia.org/wiki/Factorial) and return the instance for chaining.\n *\n * @public\n * @param {Config} config\n * @returns {this}\n */\n public withConfig(config: Config) {\n this._config = config;\n return this;\n }\n\n /**\n * Utility function to validate the existence of an address on this Contract.\n *\n * @public\n * @returns {Address}\n * @throws {@link ContractAddressRequiredError} if no address exists on this Contract instance\n */\n public assertValidAddress() {\n const address = this.address;\n if (!address) throw new ContractAddressRequiredError();\n return address;\n }\n\n /**\n * A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs].\n * Accepts `eventName` and `eventNames` as optional parameters to narrow the returned log types.\n * @example\n * ```ts\n * const logs = contract.getLogs({ eventName: 'EventName' })\n * const logs = contract.getLogs({ eventNames: ['EventName'] })\n *\n * @public\n * @async\n * @template {ContractEvent} event\n * @template {ExtractAbiEvent<\n * ContractAbi,\n * event\n * >} [abiEvent=ExtractAbiEvent<ContractAbi, event>]\n * @param {?Omit<\n * GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n * 'event' | 'events'\n * > & {\n * eventName?: event;\n * eventNames?: event[];\n * }} [params]\n * @returns {Promise<GetLogsReturnType<abiEvent, abiEvent[]>>}\n */\n public async getLogs<\n event extends ContractEventName<ContractAbi>,\n const abiEvent extends ExtractAbiEvent<\n ContractAbi,\n event\n > = ExtractAbiEvent<ContractAbi, event>,\n >(\n params?: Omit<\n GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n 'event' | 'events'\n > & {\n eventName?: event;\n eventNames?: event[];\n },\n ): Promise<GetLogsReturnType<abiEvent, abiEvent[]>> {\n return getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wag\n ...(params as any),\n ...(params?.eventName\n ? {\n event: getAbiItem({\n abi: this.abi,\n name: params.eventName,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n }\n : {}),\n ...(params?.eventNames\n ? {\n events: params.eventNames.map((name) =>\n getAbiItem({\n abi: this.abi,\n name,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n ),\n }\n : {}),\n address: this.assertValidAddress(),\n });\n }\n\n /**\n * A typed wrapper for `wagmi.watchContractEvent`\n *\n * @public\n * @template {ContractEvent} event\n * @param {(\n * log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n * ) => unknown} cb\n * @param {?WatchParams<ContractAbi, event> & {\n * eventName?: event;\n * }} [params]\n * @returns {() => void}\n */\n public subscribe<event extends ContractEventName<ContractAbi>>(\n cb: (\n log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n ) => unknown,\n params?: WatchParams<ContractAbi, event> & {\n eventName?: event;\n },\n ) {\n return watchContractEvent<\n typeof this._config,\n (typeof this._config)['chains'][number]['id'],\n ContractAbi,\n event\n >(this._config, {\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 eventName: params?.eventName,\n abi: this.abi,\n address: this.assertValidAddress(),\n onLogs: (logs) => {\n for (let l of logs) {\n cb(l);\n }\n },\n });\n }\n\n /**\n * @see {@link awaitResult}\n * @protected\n * @async\n * @template [Result=unknown]\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\n protected async awaitResult<Result = unknown>(\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n return await awaitResult(this._config, hashPromise, waitParams);\n }\n}\n"],"names":["Contract","config","address","ContractAddressRequiredError","params","getLogs","getAbiItem","name","cb","watchContractEvent","logs","l","hashPromise","waitParams","awaitResult"],"mappings":"gNA6BO,MAAMA,CAAkC,CAwB7C,YAAYC,EAAgBC,EAA8B,CACxD,KAAK,QAAUD,EACf,KAAK,SAAWC,CAClB,CASA,IAAW,SAAU,CACnB,OAAO,KAAK,QACd,CASO,GAAGA,EAAkB,CAC1B,YAAK,SAAWA,EACT,IACT,CASO,WAAWD,EAAgB,CAChC,YAAK,QAAUA,EACR,IACT,CASO,oBAAqB,CAC1B,MAAMC,EAAU,KAAK,QACrB,GAAI,CAACA,EAAe,MAAA,IAAIC,EAAAA,6BACjB,OAAAD,CACT,CA0BA,MAAa,QAOXE,EAOkD,CAC3C,OAAAC,EAAA,QAAQ,KAAK,QAAQ,UAAU,CAAE,QAASD,GAAA,YAAAA,EAAQ,OAAQ,CAAC,EAAG,CAEnE,GAAIA,EACJ,GAAIA,GAAA,MAAAA,EAAQ,UACR,CACE,MAAOE,EAAAA,WAAW,CAChB,IAAK,KAAK,IACV,KAAMF,EAAO,SAAA,CAEP,CAAA,EAEV,CAAC,EACL,GAAIA,GAAA,MAAAA,EAAQ,WACR,CACE,OAAQA,EAAO,WAAW,IAAKG,GAC7BD,EAAAA,WAAW,CACT,IAAK,KAAK,IACV,KAAAC,CAAA,CAEM,CACV,CAAA,EAEF,CAAC,EACL,QAAS,KAAK,mBAAmB,CAAA,CAClC,CACH,CAeO,UACLC,EAGAJ,EAGA,CACO,OAAAK,EAAA,mBAKL,KAAK,QAAS,CAEd,GAAIL,EACJ,UAAWA,GAAA,YAAAA,EAAQ,UACnB,IAAK,KAAK,IACV,QAAS,KAAK,mBAAmB,EACjC,OAASM,GAAS,CAChB,QAASC,KAAKD,EACZF,EAAGG,CAAC,CAER,CAAA,CACD,CACH,CAWA,MAAgB,YACdC,EACAC,EACA,CACA,OAAO,MAAMC,EAAA,YAAY,KAAK,QAASF,EAAaC,CAAU,CAChE,CACF"}
|
|
1
|
+
{"version":3,"file":"Contract.cjs","sources":["../../src/Deployable/Contract.ts"],"sourcesContent":["import { type Config, watchContractEvent } from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type GetLogsReturnType,\n type WaitForTransactionReceiptParameters,\n type WatchContractEventOnLogsParameter,\n getAbiItem,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport { ContractAddressRequiredError } from '../errors';\nimport {\n type GetLogsParams,\n type HashAndSimulatedResult,\n type WatchParams,\n awaitResult,\n} from '../utils';\n\n/**\n * A basic Contract class to encapsulate configuration and a potential address\n *\n * @export\n * @class Contract\n * @typedef {Contract}\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=any]\n */\nexport class Contract<ContractAbi extends Abi> {\n //@ts-expect-error this should always be set by implementing contract\n public readonly abi: ContractAbi;\n /**\n * @see [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @protected\n * @type {WagmiConfig}\n */\n protected _config: Config;\n /**\n * The internally managed address for this contract\n *\n * @protected\n * @type {(Address | undefined)}\n */\n protected _address: Address | undefined;\n\n /**\n * Creates an instance of Contract.\n *\n * @constructor\n * @param {Config} config\n * @param {(Address | undefined)} address\n */\n constructor(config: Config, address: Address | undefined) {\n this._config = config;\n this._address = address;\n }\n\n /**\n * A getter returning this contract's deployed address, if it exists.\n *\n * @public\n * @readonly\n * @type {Address | undefined}\n */\n public get address() {\n return this._address;\n }\n\n /**\n * A getter returning this contract's Wagmi configuration.\n *\n * @public\n * @readonly\n * @type {Config}\n */\n public get config() {\n return this._config;\n }\n\n /**\n * Will set this contract's address and return the instance for chaining. Does not verify that provided address is valid.\n *\n * @public\n * @param {Address} address\n * @returns {this}\n */\n public at(address: Address) {\n this._address = address;\n return this;\n }\n\n /**\n * Will set this contract's internal [Wagmi Configuration](https://en.wikipedia.org/wiki/Factorial) and return the instance for chaining.\n *\n * @public\n * @param {Config} config\n * @returns {this}\n */\n public withConfig(config: Config) {\n this._config = config;\n return this;\n }\n\n /**\n * Utility function to validate the existence of an address on this Contract.\n *\n * @public\n * @returns {Address}\n * @throws {@link ContractAddressRequiredError} if no address exists on this Contract instance\n */\n public assertValidAddress() {\n const address = this.address;\n if (!address) throw new ContractAddressRequiredError();\n return address;\n }\n\n /**\n * A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs].\n * Accepts `eventName` and `eventNames` as optional parameters to narrow the returned log types.\n * @example\n * ```ts\n * const logs = contract.getLogs({ eventName: 'EventName' })\n * const logs = contract.getLogs({ eventNames: ['EventName'] })\n *\n * @public\n * @async\n * @template {ContractEvent} event\n * @template {ExtractAbiEvent<\n * ContractAbi,\n * event\n * >} [abiEvent=ExtractAbiEvent<ContractAbi, event>]\n * @param {?Omit<\n * GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n * 'event' | 'events'\n * > & {\n * eventName?: event;\n * eventNames?: event[];\n * }} [params]\n * @returns {Promise<GetLogsReturnType<abiEvent, abiEvent[]>>}\n */\n public async getLogs<\n event extends ContractEventName<ContractAbi>,\n const abiEvent extends ExtractAbiEvent<\n ContractAbi,\n event\n > = ExtractAbiEvent<ContractAbi, event>,\n >(\n params?: Omit<\n GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n 'event' | 'events'\n > & {\n eventName?: event;\n eventNames?: event[];\n },\n ): Promise<GetLogsReturnType<abiEvent, abiEvent[]>> {\n return getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wag\n ...(params as any),\n ...(params?.eventName\n ? {\n event: getAbiItem({\n abi: this.abi,\n name: params.eventName,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n }\n : {}),\n ...(params?.eventNames\n ? {\n events: params.eventNames.map((name) =>\n getAbiItem({\n abi: this.abi,\n name,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n ),\n }\n : {}),\n address: this.assertValidAddress(),\n });\n }\n\n /**\n * A typed wrapper for `wagmi.watchContractEvent`\n *\n * @public\n * @template {ContractEvent} event\n * @param {(\n * log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n * ) => unknown} cb\n * @param {?WatchParams<ContractAbi, event> & {\n * eventName?: event;\n * }} [params]\n * @returns {() => void}\n */\n public subscribe<event extends ContractEventName<ContractAbi>>(\n cb: (\n log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n ) => unknown,\n params?: WatchParams<ContractAbi, event> & {\n eventName?: event;\n },\n ) {\n return watchContractEvent<\n typeof this._config,\n (typeof this._config)['chains'][number]['id'],\n ContractAbi,\n event\n >(this._config, {\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 eventName: params?.eventName,\n abi: this.abi,\n address: this.assertValidAddress(),\n onLogs: (logs) => {\n for (let l of logs) {\n cb(l);\n }\n },\n });\n }\n\n /**\n * @see {@link awaitResult}\n * @protected\n * @async\n * @template [Result=unknown]\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\n protected async awaitResult<Result = unknown>(\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n return await awaitResult(this._config, hashPromise, waitParams);\n }\n}\n"],"names":["Contract","config","address","ContractAddressRequiredError","params","getLogs","getAbiItem","name","cb","watchContractEvent","logs","l","hashPromise","waitParams","awaitResult"],"mappings":"gNA6BO,MAAMA,CAAkC,CAwB7C,YAAYC,EAAgBC,EAA8B,CACxD,KAAK,QAAUD,EACf,KAAK,SAAWC,CAClB,CASA,IAAW,SAAU,CACnB,OAAO,KAAK,QACd,CASA,IAAW,QAAS,CAClB,OAAO,KAAK,OACd,CASO,GAAGA,EAAkB,CAC1B,YAAK,SAAWA,EACT,IACT,CASO,WAAWD,EAAgB,CAChC,YAAK,QAAUA,EACR,IACT,CASO,oBAAqB,CAC1B,MAAMC,EAAU,KAAK,QACrB,GAAI,CAACA,EAAe,MAAA,IAAIC,EAAAA,6BACjB,OAAAD,CACT,CA0BA,MAAa,QAOXE,EAOkD,CAC3C,OAAAC,EAAA,QAAQ,KAAK,QAAQ,UAAU,CAAE,QAASD,GAAA,YAAAA,EAAQ,OAAQ,CAAC,EAAG,CAEnE,GAAIA,EACJ,GAAIA,GAAA,MAAAA,EAAQ,UACR,CACE,MAAOE,EAAAA,WAAW,CAChB,IAAK,KAAK,IACV,KAAMF,EAAO,SAAA,CAEP,CAAA,EAEV,CAAC,EACL,GAAIA,GAAA,MAAAA,EAAQ,WACR,CACE,OAAQA,EAAO,WAAW,IAAKG,GAC7BD,EAAAA,WAAW,CACT,IAAK,KAAK,IACV,KAAAC,CAAA,CAEM,CACV,CAAA,EAEF,CAAC,EACL,QAAS,KAAK,mBAAmB,CAAA,CAClC,CACH,CAeO,UACLC,EAGAJ,EAGA,CACO,OAAAK,EAAA,mBAKL,KAAK,QAAS,CAEd,GAAIL,EACJ,UAAWA,GAAA,YAAAA,EAAQ,UACnB,IAAK,KAAK,IACV,QAAS,KAAK,mBAAmB,EACjC,OAASM,GAAS,CAChB,QAASC,KAAKD,EACZF,EAAGG,CAAC,CAER,CAAA,CACD,CACH,CAWA,MAAgB,YACdC,EACAC,EACA,CACA,OAAO,MAAMC,EAAA,YAAY,KAAK,QAASF,EAAaC,CAAU,CAChE,CACF"}
|
|
@@ -42,6 +42,14 @@ export declare class Contract<ContractAbi extends Abi> {
|
|
|
42
42
|
* @type {Address | undefined}
|
|
43
43
|
*/
|
|
44
44
|
get address(): `0x${string}` | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* A getter returning this contract's Wagmi configuration.
|
|
47
|
+
*
|
|
48
|
+
* @public
|
|
49
|
+
* @readonly
|
|
50
|
+
* @type {Config}
|
|
51
|
+
*/
|
|
52
|
+
get config(): Config;
|
|
45
53
|
/**
|
|
46
54
|
* Will set this contract's address and return the instance for chaining. Does not verify that provided address is valid.
|
|
47
55
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contract.d.ts","sourceRoot":"","sources":["../../src/Deployable/Contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAsB,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,EAEvC,MAAM,MAAM,CAAC;AAGd,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAEjB,MAAM,UAAU,CAAC;AAElB;;;;;;;;GAQG;AACH,qBAAa,QAAQ,CAAC,WAAW,SAAS,GAAG;IAE3C,SAAgB,GAAG,EAAE,WAAW,CAAC;IACjC;;;;OAIG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAExC;;;;;;OAMG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS;IAKxD;;;;;;OAMG;IACH,IAAW,OAAO,8BAEjB;IAED;;;;;;OAMG;IACI,EAAE,CAAC,OAAO,EAAE,OAAO;IAK1B;;;;;;OAMG;IACI,UAAU,CAAC,MAAM,EAAE,MAAM;IAKhC;;;;;;OAMG;IACI,kBAAkB;IAMzB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACU,OAAO,CAClB,KAAK,SAAS,iBAAiB,CAAC,WAAW,CAAC,EAC5C,KAAK,CAAC,QAAQ,SAAS,eAAe,CACpC,WAAW,EACX,KAAK,CACN,GAAG,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,EAEvC,MAAM,CAAC,EAAE,IAAI,CACX,aAAa,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EACvD,OAAO,GAAG,QAAQ,CACnB,GAAG;QACF,SAAS,CAAC,EAAE,KAAK,CAAC;QAClB,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC;KACtB,GACA,OAAO,CAAC,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IA4BnD;;;;;;;;;;;;OAYG;IACI,SAAS,CAAC,KAAK,SAAS,iBAAiB,CAAC,WAAW,CAAC,EAC3D,EAAE,EAAE,CACF,GAAG,EAAE,iCAAiC,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,KACrE,OAAO,EACZ,MAAM,CAAC,EAAE,WAAW,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG;QACzC,SAAS,CAAC,EAAE,KAAK,CAAC;KACnB;IAqBH;;;;;;;;OAQG;cACa,WAAW,CAAC,MAAM,GAAG,OAAO,EAC1C,WAAW,EAAE,OAAO,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,EACpD,UAAU,CAAC,EAAE,IAAI,CAAC,mCAAmC,EAAE,MAAM,CAAC;CAIjE"}
|
|
1
|
+
{"version":3,"file":"Contract.d.ts","sourceRoot":"","sources":["../../src/Deployable/Contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAsB,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,EAEvC,MAAM,MAAM,CAAC;AAGd,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAEjB,MAAM,UAAU,CAAC;AAElB;;;;;;;;GAQG;AACH,qBAAa,QAAQ,CAAC,WAAW,SAAS,GAAG;IAE3C,SAAgB,GAAG,EAAE,WAAW,CAAC;IACjC;;;;OAIG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAExC;;;;;;OAMG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS;IAKxD;;;;;;OAMG;IACH,IAAW,OAAO,8BAEjB;IAED;;;;;;OAMG;IACH,IAAW,MAAM,WAEhB;IAED;;;;;;OAMG;IACI,EAAE,CAAC,OAAO,EAAE,OAAO;IAK1B;;;;;;OAMG;IACI,UAAU,CAAC,MAAM,EAAE,MAAM;IAKhC;;;;;;OAMG;IACI,kBAAkB;IAMzB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACU,OAAO,CAClB,KAAK,SAAS,iBAAiB,CAAC,WAAW,CAAC,EAC5C,KAAK,CAAC,QAAQ,SAAS,eAAe,CACpC,WAAW,EACX,KAAK,CACN,GAAG,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,EAEvC,MAAM,CAAC,EAAE,IAAI,CACX,aAAa,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EACvD,OAAO,GAAG,QAAQ,CACnB,GAAG;QACF,SAAS,CAAC,EAAE,KAAK,CAAC;QAClB,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC;KACtB,GACA,OAAO,CAAC,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IA4BnD;;;;;;;;;;;;OAYG;IACI,SAAS,CAAC,KAAK,SAAS,iBAAiB,CAAC,WAAW,CAAC,EAC3D,EAAE,EAAE,CACF,GAAG,EAAE,iCAAiC,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,KACrE,OAAO,EACZ,MAAM,CAAC,EAAE,WAAW,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG;QACzC,SAAS,CAAC,EAAE,KAAK,CAAC;KACnB;IAqBH;;;;;;;;OAQG;cACa,WAAW,CAAC,MAAM,GAAG,OAAO,EAC1C,WAAW,EAAE,OAAO,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,EACpD,UAAU,CAAC,EAAE,IAAI,CAAC,mCAAmC,EAAE,MAAM,CAAC;CAIjE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { watchContractEvent as o } from "@wagmi/core";
|
|
2
2
|
import { getAbiItem as i } from "viem";
|
|
3
|
-
import { getLogs as
|
|
4
|
-
import { ContractAddressRequiredError as
|
|
3
|
+
import { getLogs as r } from "viem/actions";
|
|
4
|
+
import { ContractAddressRequiredError as d } from "../errors.js";
|
|
5
5
|
import { awaitResult as h } from "../utils.js";
|
|
6
6
|
class v {
|
|
7
7
|
/**
|
|
@@ -24,6 +24,16 @@ class v {
|
|
|
24
24
|
get address() {
|
|
25
25
|
return this._address;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* A getter returning this contract's Wagmi configuration.
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
* @readonly
|
|
32
|
+
* @type {Config}
|
|
33
|
+
*/
|
|
34
|
+
get config() {
|
|
35
|
+
return this._config;
|
|
36
|
+
}
|
|
27
37
|
/**
|
|
28
38
|
* Will set this contract's address and return the instance for chaining. Does not verify that provided address is valid.
|
|
29
39
|
*
|
|
@@ -53,7 +63,7 @@ class v {
|
|
|
53
63
|
*/
|
|
54
64
|
assertValidAddress() {
|
|
55
65
|
const t = this.address;
|
|
56
|
-
if (!t) throw new
|
|
66
|
+
if (!t) throw new d();
|
|
57
67
|
return t;
|
|
58
68
|
}
|
|
59
69
|
/**
|
|
@@ -81,7 +91,7 @@ class v {
|
|
|
81
91
|
* @returns {Promise<GetLogsReturnType<abiEvent, abiEvent[]>>}
|
|
82
92
|
*/
|
|
83
93
|
async getLogs(t) {
|
|
84
|
-
return
|
|
94
|
+
return r(this._config.getClient({ chainId: t == null ? void 0 : t.chainId }), {
|
|
85
95
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wag
|
|
86
96
|
...t,
|
|
87
97
|
...t != null && t.eventName ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contract.js","sources":["../../src/Deployable/Contract.ts"],"sourcesContent":["import { type Config, watchContractEvent } from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type GetLogsReturnType,\n type WaitForTransactionReceiptParameters,\n type WatchContractEventOnLogsParameter,\n getAbiItem,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport { ContractAddressRequiredError } from '../errors';\nimport {\n type GetLogsParams,\n type HashAndSimulatedResult,\n type WatchParams,\n awaitResult,\n} from '../utils';\n\n/**\n * A basic Contract class to encapsulate configuration and a potential address\n *\n * @export\n * @class Contract\n * @typedef {Contract}\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=any]\n */\nexport class Contract<ContractAbi extends Abi> {\n //@ts-expect-error this should always be set by implementing contract\n public readonly abi: ContractAbi;\n /**\n * @see [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @protected\n * @type {WagmiConfig}\n */\n protected _config: Config;\n /**\n * The internally managed address for this contract\n *\n * @protected\n * @type {(Address | undefined)}\n */\n protected _address: Address | undefined;\n\n /**\n * Creates an instance of Contract.\n *\n * @constructor\n * @param {Config} config\n * @param {(Address | undefined)} address\n */\n constructor(config: Config, address: Address | undefined) {\n this._config = config;\n this._address = address;\n }\n\n /**\n * A getter returning this contract's deployed address, if it exists.\n *\n * @public\n * @readonly\n * @type {Address | undefined}\n */\n public get address() {\n return this._address;\n }\n\n /**\n * Will set this contract's address and return the instance for chaining. Does not verify that provided address is valid.\n *\n * @public\n * @param {Address} address\n * @returns {this}\n */\n public at(address: Address) {\n this._address = address;\n return this;\n }\n\n /**\n * Will set this contract's internal [Wagmi Configuration](https://en.wikipedia.org/wiki/Factorial) and return the instance for chaining.\n *\n * @public\n * @param {Config} config\n * @returns {this}\n */\n public withConfig(config: Config) {\n this._config = config;\n return this;\n }\n\n /**\n * Utility function to validate the existence of an address on this Contract.\n *\n * @public\n * @returns {Address}\n * @throws {@link ContractAddressRequiredError} if no address exists on this Contract instance\n */\n public assertValidAddress() {\n const address = this.address;\n if (!address) throw new ContractAddressRequiredError();\n return address;\n }\n\n /**\n * A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs].\n * Accepts `eventName` and `eventNames` as optional parameters to narrow the returned log types.\n * @example\n * ```ts\n * const logs = contract.getLogs({ eventName: 'EventName' })\n * const logs = contract.getLogs({ eventNames: ['EventName'] })\n *\n * @public\n * @async\n * @template {ContractEvent} event\n * @template {ExtractAbiEvent<\n * ContractAbi,\n * event\n * >} [abiEvent=ExtractAbiEvent<ContractAbi, event>]\n * @param {?Omit<\n * GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n * 'event' | 'events'\n * > & {\n * eventName?: event;\n * eventNames?: event[];\n * }} [params]\n * @returns {Promise<GetLogsReturnType<abiEvent, abiEvent[]>>}\n */\n public async getLogs<\n event extends ContractEventName<ContractAbi>,\n const abiEvent extends ExtractAbiEvent<\n ContractAbi,\n event\n > = ExtractAbiEvent<ContractAbi, event>,\n >(\n params?: Omit<\n GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n 'event' | 'events'\n > & {\n eventName?: event;\n eventNames?: event[];\n },\n ): Promise<GetLogsReturnType<abiEvent, abiEvent[]>> {\n return getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wag\n ...(params as any),\n ...(params?.eventName\n ? {\n event: getAbiItem({\n abi: this.abi,\n name: params.eventName,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n }\n : {}),\n ...(params?.eventNames\n ? {\n events: params.eventNames.map((name) =>\n getAbiItem({\n abi: this.abi,\n name,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n ),\n }\n : {}),\n address: this.assertValidAddress(),\n });\n }\n\n /**\n * A typed wrapper for `wagmi.watchContractEvent`\n *\n * @public\n * @template {ContractEvent} event\n * @param {(\n * log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n * ) => unknown} cb\n * @param {?WatchParams<ContractAbi, event> & {\n * eventName?: event;\n * }} [params]\n * @returns {() => void}\n */\n public subscribe<event extends ContractEventName<ContractAbi>>(\n cb: (\n log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n ) => unknown,\n params?: WatchParams<ContractAbi, event> & {\n eventName?: event;\n },\n ) {\n return watchContractEvent<\n typeof this._config,\n (typeof this._config)['chains'][number]['id'],\n ContractAbi,\n event\n >(this._config, {\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 eventName: params?.eventName,\n abi: this.abi,\n address: this.assertValidAddress(),\n onLogs: (logs) => {\n for (let l of logs) {\n cb(l);\n }\n },\n });\n }\n\n /**\n * @see {@link awaitResult}\n * @protected\n * @async\n * @template [Result=unknown]\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\n protected async awaitResult<Result = unknown>(\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n return await awaitResult(this._config, hashPromise, waitParams);\n }\n}\n"],"names":["Contract","config","address","ContractAddressRequiredError","params","getLogs","getAbiItem","name","cb","watchContractEvent","logs","l","hashPromise","waitParams","awaitResult"],"mappings":";;;;;AA6BO,MAAMA,EAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwB7C,YAAYC,GAAgBC,GAA8B;AACxD,SAAK,UAAUD,GACf,KAAK,WAAWC;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAW,UAAU;AACnB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,GAAGA,GAAkB;AAC1B,gBAAK,WAAWA,GACT;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,WAAWD,GAAgB;AAChC,gBAAK,UAAUA,GACR;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,qBAAqB;AAC1B,UAAMC,IAAU,KAAK;AACrB,QAAI,CAACA,EAAe,OAAA,IAAIC;AACjB,WAAAD;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BA,MAAa,QAOXE,GAOkD;AAC3C,WAAAC,EAAQ,KAAK,QAAQ,UAAU,EAAE,SAASD,KAAA,gBAAAA,EAAQ,QAAQ,CAAC,GAAG;AAAA;AAAA,MAEnE,GAAIA;AAAA,MACJ,GAAIA,KAAA,QAAAA,EAAQ,YACR;AAAA,QACE,OAAOE,EAAW;AAAA,UAChB,KAAK,KAAK;AAAA,UACV,MAAMF,EAAO;AAAA;AAAA,QAAA,CAEP;AAAA,MAAA,IAEV,CAAC;AAAA,MACL,GAAIA,KAAA,QAAAA,EAAQ,aACR;AAAA,QACE,QAAQA,EAAO,WAAW;AAAA,UAAI,CAACG,MAC7BD,EAAW;AAAA,YACT,KAAK,KAAK;AAAA,YACV,MAAAC;AAAA;AAAA,UAAA,CAEM;AAAA,QACV;AAAA,MAAA,IAEF,CAAC;AAAA,MACL,SAAS,KAAK,mBAAmB;AAAA,IAAA,CAClC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeO,UACLC,GAGAJ,GAGA;AACO,WAAAK,EAKL,KAAK,SAAS;AAAA;AAAA,MAEd,GAAIL;AAAA,MACJ,WAAWA,KAAA,gBAAAA,EAAQ;AAAA,MACnB,KAAK,KAAK;AAAA,MACV,SAAS,KAAK,mBAAmB;AAAA,MACjC,QAAQ,CAACM,MAAS;AAChB,iBAASC,KAAKD;AACZ,UAAAF,EAAGG,CAAC;AAAA,MAER;AAAA,IAAA,CACD;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAgB,YACdC,GACAC,GACA;AACA,WAAO,MAAMC,EAAY,KAAK,SAASF,GAAaC,CAAU;AAAA,EAChE;AACF;"}
|
|
1
|
+
{"version":3,"file":"Contract.js","sources":["../../src/Deployable/Contract.ts"],"sourcesContent":["import { type Config, watchContractEvent } from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type GetLogsReturnType,\n type WaitForTransactionReceiptParameters,\n type WatchContractEventOnLogsParameter,\n getAbiItem,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport { ContractAddressRequiredError } from '../errors';\nimport {\n type GetLogsParams,\n type HashAndSimulatedResult,\n type WatchParams,\n awaitResult,\n} from '../utils';\n\n/**\n * A basic Contract class to encapsulate configuration and a potential address\n *\n * @export\n * @class Contract\n * @typedef {Contract}\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=any]\n */\nexport class Contract<ContractAbi extends Abi> {\n //@ts-expect-error this should always be set by implementing contract\n public readonly abi: ContractAbi;\n /**\n * @see [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @protected\n * @type {WagmiConfig}\n */\n protected _config: Config;\n /**\n * The internally managed address for this contract\n *\n * @protected\n * @type {(Address | undefined)}\n */\n protected _address: Address | undefined;\n\n /**\n * Creates an instance of Contract.\n *\n * @constructor\n * @param {Config} config\n * @param {(Address | undefined)} address\n */\n constructor(config: Config, address: Address | undefined) {\n this._config = config;\n this._address = address;\n }\n\n /**\n * A getter returning this contract's deployed address, if it exists.\n *\n * @public\n * @readonly\n * @type {Address | undefined}\n */\n public get address() {\n return this._address;\n }\n\n /**\n * A getter returning this contract's Wagmi configuration.\n *\n * @public\n * @readonly\n * @type {Config}\n */\n public get config() {\n return this._config;\n }\n\n /**\n * Will set this contract's address and return the instance for chaining. Does not verify that provided address is valid.\n *\n * @public\n * @param {Address} address\n * @returns {this}\n */\n public at(address: Address) {\n this._address = address;\n return this;\n }\n\n /**\n * Will set this contract's internal [Wagmi Configuration](https://en.wikipedia.org/wiki/Factorial) and return the instance for chaining.\n *\n * @public\n * @param {Config} config\n * @returns {this}\n */\n public withConfig(config: Config) {\n this._config = config;\n return this;\n }\n\n /**\n * Utility function to validate the existence of an address on this Contract.\n *\n * @public\n * @returns {Address}\n * @throws {@link ContractAddressRequiredError} if no address exists on this Contract instance\n */\n public assertValidAddress() {\n const address = this.address;\n if (!address) throw new ContractAddressRequiredError();\n return address;\n }\n\n /**\n * A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs].\n * Accepts `eventName` and `eventNames` as optional parameters to narrow the returned log types.\n * @example\n * ```ts\n * const logs = contract.getLogs({ eventName: 'EventName' })\n * const logs = contract.getLogs({ eventNames: ['EventName'] })\n *\n * @public\n * @async\n * @template {ContractEvent} event\n * @template {ExtractAbiEvent<\n * ContractAbi,\n * event\n * >} [abiEvent=ExtractAbiEvent<ContractAbi, event>]\n * @param {?Omit<\n * GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n * 'event' | 'events'\n * > & {\n * eventName?: event;\n * eventNames?: event[];\n * }} [params]\n * @returns {Promise<GetLogsReturnType<abiEvent, abiEvent[]>>}\n */\n public async getLogs<\n event extends ContractEventName<ContractAbi>,\n const abiEvent extends ExtractAbiEvent<\n ContractAbi,\n event\n > = ExtractAbiEvent<ContractAbi, event>,\n >(\n params?: Omit<\n GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n 'event' | 'events'\n > & {\n eventName?: event;\n eventNames?: event[];\n },\n ): Promise<GetLogsReturnType<abiEvent, abiEvent[]>> {\n return getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wag\n ...(params as any),\n ...(params?.eventName\n ? {\n event: getAbiItem({\n abi: this.abi,\n name: params.eventName,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n }\n : {}),\n ...(params?.eventNames\n ? {\n events: params.eventNames.map((name) =>\n getAbiItem({\n abi: this.abi,\n name,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n ),\n }\n : {}),\n address: this.assertValidAddress(),\n });\n }\n\n /**\n * A typed wrapper for `wagmi.watchContractEvent`\n *\n * @public\n * @template {ContractEvent} event\n * @param {(\n * log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n * ) => unknown} cb\n * @param {?WatchParams<ContractAbi, event> & {\n * eventName?: event;\n * }} [params]\n * @returns {() => void}\n */\n public subscribe<event extends ContractEventName<ContractAbi>>(\n cb: (\n log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n ) => unknown,\n params?: WatchParams<ContractAbi, event> & {\n eventName?: event;\n },\n ) {\n return watchContractEvent<\n typeof this._config,\n (typeof this._config)['chains'][number]['id'],\n ContractAbi,\n event\n >(this._config, {\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 eventName: params?.eventName,\n abi: this.abi,\n address: this.assertValidAddress(),\n onLogs: (logs) => {\n for (let l of logs) {\n cb(l);\n }\n },\n });\n }\n\n /**\n * @see {@link awaitResult}\n * @protected\n * @async\n * @template [Result=unknown]\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\n protected async awaitResult<Result = unknown>(\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n return await awaitResult(this._config, hashPromise, waitParams);\n }\n}\n"],"names":["Contract","config","address","ContractAddressRequiredError","params","getLogs","getAbiItem","name","cb","watchContractEvent","logs","l","hashPromise","waitParams","awaitResult"],"mappings":";;;;;AA6BO,MAAMA,EAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwB7C,YAAYC,GAAgBC,GAA8B;AACxD,SAAK,UAAUD,GACf,KAAK,WAAWC;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAW,UAAU;AACnB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAW,SAAS;AAClB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,GAAGA,GAAkB;AAC1B,gBAAK,WAAWA,GACT;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,WAAWD,GAAgB;AAChC,gBAAK,UAAUA,GACR;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,qBAAqB;AAC1B,UAAMC,IAAU,KAAK;AACrB,QAAI,CAACA,EAAe,OAAA,IAAIC;AACjB,WAAAD;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BA,MAAa,QAOXE,GAOkD;AAC3C,WAAAC,EAAQ,KAAK,QAAQ,UAAU,EAAE,SAASD,KAAA,gBAAAA,EAAQ,QAAQ,CAAC,GAAG;AAAA;AAAA,MAEnE,GAAIA;AAAA,MACJ,GAAIA,KAAA,QAAAA,EAAQ,YACR;AAAA,QACE,OAAOE,EAAW;AAAA,UAChB,KAAK,KAAK;AAAA,UACV,MAAMF,EAAO;AAAA;AAAA,QAAA,CAEP;AAAA,MAAA,IAEV,CAAC;AAAA,MACL,GAAIA,KAAA,QAAAA,EAAQ,aACR;AAAA,QACE,QAAQA,EAAO,WAAW;AAAA,UAAI,CAACG,MAC7BD,EAAW;AAAA,YACT,KAAK,KAAK;AAAA,YACV,MAAAC;AAAA;AAAA,UAAA,CAEM;AAAA,QACV;AAAA,MAAA,IAEF,CAAC;AAAA,MACL,SAAS,KAAK,mBAAmB;AAAA,IAAA,CAClC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeO,UACLC,GAGAJ,GAGA;AACO,WAAAK,EAKL,KAAK,SAAS;AAAA;AAAA,MAEd,GAAIL;AAAA,MACJ,WAAWA,KAAA,gBAAAA,EAAQ;AAAA,MACnB,KAAK,KAAK;AAAA,MACV,SAAS,KAAK,mBAAmB;AAAA,MACjC,QAAQ,CAACM,MAAS;AAChB,iBAASC,KAAKD;AACZ,UAAAF,EAAGG,CAAC;AAAA,MAER;AAAA,IAAA,CACD;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAgB,YACdC,GACAC,GACA;AACA,WAAO,MAAMC,EAAY,KAAK,SAASF,GAAaC,CAAU;AAAA,EAChE;AACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@wagmi/core"),a=require("../errors.cjs"),n=require("../utils.cjs"),c=require("./Contract.cjs");class l extends c.Contract{constructor({account:t,config:e},o){typeof o=="string"?super(e,o):(super(e,void 0),this._payload=o),t&&(this._account=t)}get payload(){return this._payload}withPayload(t){return this._payload=t,this}async deploy(t,e,o){const r=(e==null?void 0:e.config)||this._config,i=await n.getDeployedContractAddress(r,this.deployRaw(t,e),o);return this._address=i,this}async deployRaw(t,e){if(this.address)throw new a.DeployableAlreadyDeployedError(this.address);const[o,r]=this.validateDeploymentConfig(t,e);return await s.deployContract(r.config,{...this.buildParameters(o),...this.optionallyAttachAccount(r.account)})}optionallyAttachAccount(t){return t?{account:t}:this._account?{account:this._account}:{}}buildParameters(t,e){throw new a.DeployableBuildParametersUnspecifiedError}validateDeploymentConfig(t,e){const o=e||{config:this._config,account:this._account};if(!o)throw new a.DeployableWagmiConfigurationRequiredError;return[t||this._payload,o]}}exports.Deployable=l;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@wagmi/core"),a=require("../errors.cjs"),n=require("../utils.cjs"),c=require("./Contract.cjs");class l extends c.Contract{constructor({account:t,config:e},o){typeof o=="string"?super(e,o):(super(e,void 0),this._payload=o),t&&(this._account=t)}get payload(){return this._payload}get account(){return this._account}withPayload(t){return this._payload=t,this}async deploy(t,e,o){const r=(e==null?void 0:e.config)||this._config,i=await n.getDeployedContractAddress(r,this.deployRaw(t,e),o);return this._address=i,this}async deployRaw(t,e){if(this.address)throw new a.DeployableAlreadyDeployedError(this.address);const[o,r]=this.validateDeploymentConfig(t,e);return await s.deployContract(r.config,{...this.buildParameters(o),...this.optionallyAttachAccount(r.account)})}optionallyAttachAccount(t){return t?{account:t}:this._account?{account:this._account}:{}}buildParameters(t,e){throw new a.DeployableBuildParametersUnspecifiedError}validateDeploymentConfig(t,e){const o=e||{config:this._config,account:this._account};if(!o)throw new a.DeployableWagmiConfigurationRequiredError;return[t||this._payload,o]}}exports.Deployable=l;
|
|
2
2
|
//# sourceMappingURL=Deployable.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deployable.cjs","sources":["../../src/Deployable/Deployable.ts"],"sourcesContent":["import { type Config, deployContract } from '@wagmi/core';\nimport type {\n Abi,\n Account,\n Address,\n ContractEventName,\n Hash,\n Hex,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableBuildParametersUnspecifiedError,\n DeployableMissingPayloadError,\n DeployableWagmiConfigurationRequiredError,\n} from '../errors';\nimport { getDeployedContractAddress } from '../utils';\nimport { Contract } from './Contract';\n\n/**\n * A base class representing a deployable contract, contains base implementations for deployment and initialization payload construction.\n *\n * @export\n * @typedef {GenericDeployableParams}\n */\nexport type GenericDeployableParams = Omit<\n Parameters<typeof deployContract>[1],\n 'args' | 'account'\n> & {\n args: [Hex, ...Array<Hex>] | [];\n account?: Account;\n};\n\n/**\n * A generic type that encapsulates either an initialization payload for a contract, or a valid address for a previously deployed contract.\n *\n * @export\n * @typedef {DeployablePayloadOrAddress}\n * @template [Payload=unknown]\n */\nexport type DeployablePayloadOrAddress<Payload = unknown> = Payload | Address;\n\n/**\n * Instantion options for the base deployable.\n *\n * @export\n * @interface DeployableOptions\n * @typedef {DeployableOptions}\n */\nexport interface DeployableOptions {\n /**\n * [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n *\n * @see {@link Config}\n * @type {Config}\n */\n config: Config;\n /**\n * [Viem Local Account](https://viem.sh/docs/accounts/local), required if in a Node environment\n *\n * @see {@link Account}\n * @type {?Account}\n */\n account?: Account;\n}\n\n/**\n * A generic deployable contract that encapsulates common operations related to contract deployment\n *\n * @export\n * @class Deployable\n * @typedef {Deployable}\n * @template [Payload=unknown]\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=ContractEventName<ContractAbi>]\n * @extends {Contract<ContractAbi, ContractEvent>}\n */\nexport class Deployable<\n Payload,\n ContractAbi extends Abi,\n> extends Contract<ContractAbi> {\n /**\n * The deployable payload used either for contract construction or initialization\n *\n * @protected\n * @type {(Payload | undefined)}\n */\n protected _payload: Payload | undefined;\n /**\n * If it exists, [Viem Local Account](https://viem.sh/docs/accounts/local), if in a Node environment\n *\n * @protected\n * @type {?Account}\n */\n protected _account?: Account;\n\n /**\n * Creates an instance of Deployable.\n *\n * @constructor\n * @param {DeployableOptions} param0\n * @param {?Account} [param0.account]\n * @param {Config} param0.config\n * @param {DeployablePayloadOrAddress<Payload>} payload\n */\n constructor(\n { account, config }: DeployableOptions,\n payload?: DeployablePayloadOrAddress<Payload>,\n ) {\n if (typeof payload === 'string') {\n super(config, payload as Address);\n } else {\n super(config, undefined);\n this._payload = payload as Payload;\n }\n if (account) this._account = account;\n }\n\n /**\n * Returns the attached deployable payload, if it exists\n *\n * @readonly\n * @type {Payload}\n */\n get payload() {\n return this._payload;\n }\n\n /**\n * Attaches a new payload for use with this deployable's initialization\n *\n * @public\n * @param {Payload} payload\n * @returns {this}\n */\n public withPayload(payload: Payload) {\n this._payload = payload;\n return this;\n }\n\n /**\n * High level deployment function to deploy and await the contract address.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n * @returns {Promise<this>}\n */\n protected async deploy(\n _payload?: Payload,\n _options?: DeployableOptions,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n const config = _options?.config || this._config;\n const address = await getDeployedContractAddress(\n config,\n this.deployRaw(_payload, _options),\n waitParams,\n );\n this._address = address;\n return this;\n }\n\n /**\n * The lower level contract deployment function that does not await for the transaction receipt.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {Promise<Hash>}\n * @throws {@link DeployableAlreadyDeployedError}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected async deployRaw(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): Promise<Hash> {\n if (this.address) throw new DeployableAlreadyDeployedError(this.address);\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return await deployContract(options.config, {\n ...this.buildParameters(payload),\n ...this.optionallyAttachAccount(options.account),\n });\n }\n\n /**\n * Internal function to attach the connected account to write methods to avoid manually passing in an account each call.\n *\n * @protected\n * @param {?Account} [account]\n * @returns {({ account: Account; } | { account?: undefined; })}\n */\n protected optionallyAttachAccount(account?: Account) {\n if (account) return { account };\n return this._account ? { account: this._account } : {};\n }\n\n /**\n * Base parameter constructor, should return a partial `viem.deployContract` parameters shape including abi, bytecode, and arguments, if any.\n * Expected to be overridden by protocol contracts.\n *\n * @public\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n throw new DeployableBuildParametersUnspecifiedError();\n }\n\n /**\n * Internal method used to ensure that a Wagmi configuration and payload are always present when deploying.\n *\n * @protected\n * @template [P=Payload]\n * @param {?P} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {[P, DeployableOptions]}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected validateDeploymentConfig<P = Payload>(\n _payload?: P,\n _options?: DeployableOptions,\n ) {\n const options = _options || {\n config: this._config,\n account: this._account,\n };\n if (!options) throw new DeployableWagmiConfigurationRequiredError();\n const payload = _payload || this._payload;\n return [payload, options] as [P, DeployableOptions];\n }\n}\n"],"names":["Deployable","Contract","account","config","payload","_payload","_options","waitParams","address","getDeployedContractAddress","DeployableAlreadyDeployedError","options","deployContract","DeployableBuildParametersUnspecifiedError","DeployableWagmiConfigurationRequiredError"],"mappings":"gMA6EO,MAAMA,UAGHC,EAAAA,QAAsB,CAyB9B,YACE,CAAE,QAAAC,EAAS,OAAAC,CAAA,EACXC,EACA,CACI,OAAOA,GAAY,SACrB,MAAMD,EAAQC,CAAkB,GAEhC,MAAMD,EAAQ,MAAS,EACvB,KAAK,SAAWC,GAEdF,SAAc,SAAWA,EAC/B,CAQA,IAAI,SAAU,CACZ,OAAO,KAAK,QACd,CASO,YAAYE,EAAkB,CACnC,YAAK,SAAWA,EACT,IACT,CAeA,MAAgB,OACdC,EACAC,EACAC,EACA,CACM,MAAAJ,GAASG,GAAA,YAAAA,EAAU,SAAU,KAAK,QAClCE,EAAU,MAAMC,EAAA,2BACpBN,EACA,KAAK,UAAUE,EAAUC,CAAQ,EACjCC,CAAA,EAEF,YAAK,SAAWC,EACT,IACT,CAiBA,MAAgB,UACdH,EACAC,EACe,CACf,GAAI,KAAK,QAAS,MAAM,IAAII,EAAAA,+BAA+B,KAAK,OAAO,EACvE,KAAM,CAACN,EAASO,CAAO,EAAI,KAAK,yBAC9BN,EACAC,CAAA,EAEK,OAAA,MAAMM,EAAAA,eAAeD,EAAQ,OAAQ,CAC1C,GAAG,KAAK,gBAAgBP,CAAO,EAC/B,GAAG,KAAK,wBAAwBO,EAAQ,OAAO,CAAA,CAChD,CACH,CASU,wBAAwBT,EAAmB,CAC/C,OAAAA,EAAgB,CAAE,QAAAA,GACf,KAAK,SAAW,CAAE,QAAS,KAAK,UAAa,EACtD,CAWO,gBACLG,EACAC,EACyB,CACzB,MAAM,IAAIO,EAA0C,yCACtD,CAaU,yBACRR,EACAC,EACA,CACA,MAAMK,EAAUL,GAAY,CAC1B,OAAQ,KAAK,QACb,QAAS,KAAK,QAAA,EAEhB,GAAI,CAACK,EAAe,MAAA,IAAIG,EAAAA,0CAEjB,MAAA,CADST,GAAY,KAAK,SAChBM,CAAO,CAC1B,CACF"}
|
|
1
|
+
{"version":3,"file":"Deployable.cjs","sources":["../../src/Deployable/Deployable.ts"],"sourcesContent":["import { type Config, deployContract } from '@wagmi/core';\nimport type {\n Abi,\n Account,\n Address,\n ContractEventName,\n Hash,\n Hex,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableBuildParametersUnspecifiedError,\n DeployableMissingPayloadError,\n DeployableWagmiConfigurationRequiredError,\n} from '../errors';\nimport { getDeployedContractAddress } from '../utils';\nimport { Contract } from './Contract';\n\n/**\n * A base class representing a deployable contract, contains base implementations for deployment and initialization payload construction.\n *\n * @export\n * @typedef {GenericDeployableParams}\n */\nexport type GenericDeployableParams = Omit<\n Parameters<typeof deployContract>[1],\n 'args' | 'account'\n> & {\n args: [Hex, ...Array<Hex>] | [];\n account?: Account;\n};\n\n/**\n * A generic type that encapsulates either an initialization payload for a contract, or a valid address for a previously deployed contract.\n *\n * @export\n * @typedef {DeployablePayloadOrAddress}\n * @template [Payload=unknown]\n */\nexport type DeployablePayloadOrAddress<Payload = unknown> = Payload | Address;\n\n/**\n * Instantion options for the base deployable.\n *\n * @export\n * @interface DeployableOptions\n * @typedef {DeployableOptions}\n */\nexport interface DeployableOptions {\n /**\n * [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n *\n * @see {@link Config}\n * @type {Config}\n */\n config: Config;\n /**\n * [Viem Local Account](https://viem.sh/docs/accounts/local), required if in a Node environment\n *\n * @see {@link Account}\n * @type {?Account}\n */\n account?: Account;\n}\n\n/**\n * A generic deployable contract that encapsulates common operations related to contract deployment\n *\n * @export\n * @class Deployable\n * @typedef {Deployable}\n * @template [Payload=unknown]\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=ContractEventName<ContractAbi>]\n * @extends {Contract<ContractAbi, ContractEvent>}\n */\nexport class Deployable<\n Payload,\n ContractAbi extends Abi,\n> extends Contract<ContractAbi> {\n /**\n * The deployable payload used either for contract construction or initialization\n *\n * @protected\n * @type {(Payload | undefined)}\n */\n protected _payload: Payload | undefined;\n /**\n * If it exists, [Viem Local Account](https://viem.sh/docs/accounts/local), if in a Node environment\n *\n * @protected\n * @type {?Account}\n */\n protected _account?: Account;\n\n /**\n * Creates an instance of Deployable.\n *\n * @constructor\n * @param {DeployableOptions} param0\n * @param {?Account} [param0.account]\n * @param {Config} param0.config\n * @param {DeployablePayloadOrAddress<Payload>} payload\n */\n constructor(\n { account, config }: DeployableOptions,\n payload?: DeployablePayloadOrAddress<Payload>,\n ) {\n if (typeof payload === 'string') {\n super(config, payload as Address);\n } else {\n super(config, undefined);\n this._payload = payload as Payload;\n }\n if (account) this._account = account;\n }\n\n /**\n * Returns the attached deployable payload, if it exists\n *\n * @readonly\n * @type {Payload}\n */\n get payload() {\n return this._payload;\n }\n\n /**\n * Returns the attached account, if it exists\n *\n * @readonly\n * @type {Account | undefined}\n */\n get account() {\n return this._account;\n }\n\n /**\n * Attaches a new payload for use with this deployable's initialization\n *\n * @public\n * @param {Payload} payload\n * @returns {this}\n */\n public withPayload(payload: Payload) {\n this._payload = payload;\n return this;\n }\n\n /**\n * High level deployment function to deploy and await the contract address.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n * @returns {Promise<this>}\n */\n protected async deploy(\n _payload?: Payload,\n _options?: DeployableOptions,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n const config = _options?.config || this._config;\n const address = await getDeployedContractAddress(\n config,\n this.deployRaw(_payload, _options),\n waitParams,\n );\n this._address = address;\n return this;\n }\n\n /**\n * The lower level contract deployment function that does not await for the transaction receipt.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {Promise<Hash>}\n * @throws {@link DeployableAlreadyDeployedError}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected async deployRaw(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): Promise<Hash> {\n if (this.address) throw new DeployableAlreadyDeployedError(this.address);\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return await deployContract(options.config, {\n ...this.buildParameters(payload),\n ...this.optionallyAttachAccount(options.account),\n });\n }\n\n /**\n * Internal function to attach the connected account to write methods to avoid manually passing in an account each call.\n *\n * @protected\n * @param {?Account} [account]\n * @returns {({ account: Account; } | { account?: undefined; })}\n */\n protected optionallyAttachAccount(account?: Account) {\n if (account) return { account };\n return this._account ? { account: this._account } : {};\n }\n\n /**\n * Base parameter constructor, should return a partial `viem.deployContract` parameters shape including abi, bytecode, and arguments, if any.\n * Expected to be overridden by protocol contracts.\n *\n * @public\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n throw new DeployableBuildParametersUnspecifiedError();\n }\n\n /**\n * Internal method used to ensure that a Wagmi configuration and payload are always present when deploying.\n *\n * @protected\n * @template [P=Payload]\n * @param {?P} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {[P, DeployableOptions]}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected validateDeploymentConfig<P = Payload>(\n _payload?: P,\n _options?: DeployableOptions,\n ) {\n const options = _options || {\n config: this._config,\n account: this._account,\n };\n if (!options) throw new DeployableWagmiConfigurationRequiredError();\n const payload = _payload || this._payload;\n return [payload, options] as [P, DeployableOptions];\n }\n}\n"],"names":["Deployable","Contract","account","config","payload","_payload","_options","waitParams","address","getDeployedContractAddress","DeployableAlreadyDeployedError","options","deployContract","DeployableBuildParametersUnspecifiedError","DeployableWagmiConfigurationRequiredError"],"mappings":"gMA6EO,MAAMA,UAGHC,EAAAA,QAAsB,CAyB9B,YACE,CAAE,QAAAC,EAAS,OAAAC,CAAA,EACXC,EACA,CACI,OAAOA,GAAY,SACrB,MAAMD,EAAQC,CAAkB,GAEhC,MAAMD,EAAQ,MAAS,EACvB,KAAK,SAAWC,GAEdF,SAAc,SAAWA,EAC/B,CAQA,IAAI,SAAU,CACZ,OAAO,KAAK,QACd,CAQA,IAAI,SAAU,CACZ,OAAO,KAAK,QACd,CASO,YAAYE,EAAkB,CACnC,YAAK,SAAWA,EACT,IACT,CAeA,MAAgB,OACdC,EACAC,EACAC,EACA,CACM,MAAAJ,GAASG,GAAA,YAAAA,EAAU,SAAU,KAAK,QAClCE,EAAU,MAAMC,EAAA,2BACpBN,EACA,KAAK,UAAUE,EAAUC,CAAQ,EACjCC,CAAA,EAEF,YAAK,SAAWC,EACT,IACT,CAiBA,MAAgB,UACdH,EACAC,EACe,CACf,GAAI,KAAK,QAAS,MAAM,IAAII,EAAAA,+BAA+B,KAAK,OAAO,EACvE,KAAM,CAACN,EAASO,CAAO,EAAI,KAAK,yBAC9BN,EACAC,CAAA,EAEK,OAAA,MAAMM,EAAAA,eAAeD,EAAQ,OAAQ,CAC1C,GAAG,KAAK,gBAAgBP,CAAO,EAC/B,GAAG,KAAK,wBAAwBO,EAAQ,OAAO,CAAA,CAChD,CACH,CASU,wBAAwBT,EAAmB,CAC/C,OAAAA,EAAgB,CAAE,QAAAA,GACf,KAAK,SAAW,CAAE,QAAS,KAAK,UAAa,EACtD,CAWO,gBACLG,EACAC,EACyB,CACzB,MAAM,IAAIO,EAA0C,yCACtD,CAaU,yBACRR,EACAC,EACA,CACA,MAAMK,EAAUL,GAAY,CAC1B,OAAQ,KAAK,QACb,QAAS,KAAK,QAAA,EAEhB,GAAI,CAACK,EAAe,MAAA,IAAIG,EAAAA,0CAEjB,MAAA,CADST,GAAY,KAAK,SAChBM,CAAO,CAC1B,CACF"}
|
|
@@ -85,6 +85,13 @@ export declare class Deployable<Payload, ContractAbi extends Abi> extends Contra
|
|
|
85
85
|
* @type {Payload}
|
|
86
86
|
*/
|
|
87
87
|
get payload(): Payload | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Returns the attached account, if it exists
|
|
90
|
+
*
|
|
91
|
+
* @readonly
|
|
92
|
+
* @type {Account | undefined}
|
|
93
|
+
*/
|
|
94
|
+
get account(): Account | undefined;
|
|
88
95
|
/**
|
|
89
96
|
* Attaches a new payload for use with this deployable's initialization
|
|
90
97
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deployable.d.ts","sourceRoot":"","sources":["../../src/Deployable/Deployable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EACV,GAAG,EACH,OAAO,EACP,OAAO,EAEP,IAAI,EACJ,GAAG,EACH,mCAAmC,EACpC,MAAM,MAAM,CAAC;AAQd,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,EACpC,MAAM,GAAG,SAAS,CACnB,GAAG;IACF,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,0BAA0B,CAAC,OAAO,GAAG,OAAO,IAAI,OAAO,GAAG,OAAO,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,UAAU,CACrB,OAAO,EACP,WAAW,SAAS,GAAG,CACvB,SAAQ,QAAQ,CAAC,WAAW,CAAC;IAC7B;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;;OAQG;gBAED,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,iBAAiB,EACtC,OAAO,CAAC,EAAE,0BAA0B,CAAC,OAAO,CAAC;IAW/C;;;;;OAKG;IACH,IAAI,OAAO,wBAEV;IAED;;;;;;OAMG;IACI,WAAW,CAAC,OAAO,EAAE,OAAO;IAKnC;;;;;;;;;;;;OAYG;cACa,MAAM,CACpB,QAAQ,CAAC,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,UAAU,CAAC,EAAE,IAAI,CAAC,mCAAmC,EAAE,MAAM,CAAC;IAYhE;;;;;;;;;;;;;;OAcG;cACa,SAAS,CACvB,QAAQ,CAAC,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,OAAO,CAAC,IAAI,CAAC;IAYhB;;;;;;OAMG;IACH,SAAS,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,OAAO;;;;;IAKnD;;;;;;;;OAQG;IACI,eAAe,CACpB,QAAQ,CAAC,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;IAI1B;;;;;;;;;;OAUG;IACH,SAAS,CAAC,wBAAwB,CAAC,CAAC,GAAG,OAAO,EAC5C,QAAQ,CAAC,EAAE,CAAC,EACZ,QAAQ,CAAC,EAAE,iBAAiB,GAQC,CAAC,CAAC,EAAE,iBAAiB,CAAC;CAEtD"}
|
|
1
|
+
{"version":3,"file":"Deployable.d.ts","sourceRoot":"","sources":["../../src/Deployable/Deployable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EACV,GAAG,EACH,OAAO,EACP,OAAO,EAEP,IAAI,EACJ,GAAG,EACH,mCAAmC,EACpC,MAAM,MAAM,CAAC;AAQd,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,EACpC,MAAM,GAAG,SAAS,CACnB,GAAG;IACF,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,0BAA0B,CAAC,OAAO,GAAG,OAAO,IAAI,OAAO,GAAG,OAAO,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,UAAU,CACrB,OAAO,EACP,WAAW,SAAS,GAAG,CACvB,SAAQ,QAAQ,CAAC,WAAW,CAAC;IAC7B;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;;OAQG;gBAED,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,iBAAiB,EACtC,OAAO,CAAC,EAAE,0BAA0B,CAAC,OAAO,CAAC;IAW/C;;;;;OAKG;IACH,IAAI,OAAO,wBAEV;IAED;;;;;OAKG;IACH,IAAI,OAAO,wBAEV;IAED;;;;;;OAMG;IACI,WAAW,CAAC,OAAO,EAAE,OAAO;IAKnC;;;;;;;;;;;;OAYG;cACa,MAAM,CACpB,QAAQ,CAAC,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,UAAU,CAAC,EAAE,IAAI,CAAC,mCAAmC,EAAE,MAAM,CAAC;IAYhE;;;;;;;;;;;;;;OAcG;cACa,SAAS,CACvB,QAAQ,CAAC,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,OAAO,CAAC,IAAI,CAAC;IAYhB;;;;;;OAMG;IACH,SAAS,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,OAAO;;;;;IAKnD;;;;;;;;OAQG;IACI,eAAe,CACpB,QAAQ,CAAC,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;IAI1B;;;;;;;;;;OAUG;IACH,SAAS,CAAC,wBAAwB,CAAC,CAAC,GAAG,OAAO,EAC5C,QAAQ,CAAC,EAAE,CAAC,EACZ,QAAQ,CAAC,EAAE,iBAAiB,GAQC,CAAC,CAAC,EAAE,iBAAiB,CAAC;CAEtD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { deployContract as i } from "@wagmi/core";
|
|
2
|
-
import { DeployableAlreadyDeployedError as s, DeployableBuildParametersUnspecifiedError as n, DeployableWagmiConfigurationRequiredError as
|
|
3
|
-
import { getDeployedContractAddress as
|
|
2
|
+
import { DeployableAlreadyDeployedError as s, DeployableBuildParametersUnspecifiedError as n, DeployableWagmiConfigurationRequiredError as c } from "../errors.js";
|
|
3
|
+
import { getDeployedContractAddress as l } from "../utils.js";
|
|
4
4
|
import { Contract as d } from "./Contract.js";
|
|
5
5
|
class m extends d {
|
|
6
6
|
/**
|
|
@@ -24,6 +24,15 @@ class m extends d {
|
|
|
24
24
|
get payload() {
|
|
25
25
|
return this._payload;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns the attached account, if it exists
|
|
29
|
+
*
|
|
30
|
+
* @readonly
|
|
31
|
+
* @type {Account | undefined}
|
|
32
|
+
*/
|
|
33
|
+
get account() {
|
|
34
|
+
return this._account;
|
|
35
|
+
}
|
|
27
36
|
/**
|
|
28
37
|
* Attaches a new payload for use with this deployable's initialization
|
|
29
38
|
*
|
|
@@ -48,7 +57,7 @@ class m extends d {
|
|
|
48
57
|
* @returns {Promise<this>}
|
|
49
58
|
*/
|
|
50
59
|
async deploy(t, o, a) {
|
|
51
|
-
const e = (o == null ? void 0 : o.config) || this._config, r = await
|
|
60
|
+
const e = (o == null ? void 0 : o.config) || this._config, r = await l(
|
|
52
61
|
e,
|
|
53
62
|
this.deployRaw(t, o),
|
|
54
63
|
a
|
|
@@ -119,7 +128,7 @@ class m extends d {
|
|
|
119
128
|
config: this._config,
|
|
120
129
|
account: this._account
|
|
121
130
|
};
|
|
122
|
-
if (!a) throw new
|
|
131
|
+
if (!a) throw new c();
|
|
123
132
|
return [t || this._payload, a];
|
|
124
133
|
}
|
|
125
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deployable.js","sources":["../../src/Deployable/Deployable.ts"],"sourcesContent":["import { type Config, deployContract } from '@wagmi/core';\nimport type {\n Abi,\n Account,\n Address,\n ContractEventName,\n Hash,\n Hex,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableBuildParametersUnspecifiedError,\n DeployableMissingPayloadError,\n DeployableWagmiConfigurationRequiredError,\n} from '../errors';\nimport { getDeployedContractAddress } from '../utils';\nimport { Contract } from './Contract';\n\n/**\n * A base class representing a deployable contract, contains base implementations for deployment and initialization payload construction.\n *\n * @export\n * @typedef {GenericDeployableParams}\n */\nexport type GenericDeployableParams = Omit<\n Parameters<typeof deployContract>[1],\n 'args' | 'account'\n> & {\n args: [Hex, ...Array<Hex>] | [];\n account?: Account;\n};\n\n/**\n * A generic type that encapsulates either an initialization payload for a contract, or a valid address for a previously deployed contract.\n *\n * @export\n * @typedef {DeployablePayloadOrAddress}\n * @template [Payload=unknown]\n */\nexport type DeployablePayloadOrAddress<Payload = unknown> = Payload | Address;\n\n/**\n * Instantion options for the base deployable.\n *\n * @export\n * @interface DeployableOptions\n * @typedef {DeployableOptions}\n */\nexport interface DeployableOptions {\n /**\n * [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n *\n * @see {@link Config}\n * @type {Config}\n */\n config: Config;\n /**\n * [Viem Local Account](https://viem.sh/docs/accounts/local), required if in a Node environment\n *\n * @see {@link Account}\n * @type {?Account}\n */\n account?: Account;\n}\n\n/**\n * A generic deployable contract that encapsulates common operations related to contract deployment\n *\n * @export\n * @class Deployable\n * @typedef {Deployable}\n * @template [Payload=unknown]\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=ContractEventName<ContractAbi>]\n * @extends {Contract<ContractAbi, ContractEvent>}\n */\nexport class Deployable<\n Payload,\n ContractAbi extends Abi,\n> extends Contract<ContractAbi> {\n /**\n * The deployable payload used either for contract construction or initialization\n *\n * @protected\n * @type {(Payload | undefined)}\n */\n protected _payload: Payload | undefined;\n /**\n * If it exists, [Viem Local Account](https://viem.sh/docs/accounts/local), if in a Node environment\n *\n * @protected\n * @type {?Account}\n */\n protected _account?: Account;\n\n /**\n * Creates an instance of Deployable.\n *\n * @constructor\n * @param {DeployableOptions} param0\n * @param {?Account} [param0.account]\n * @param {Config} param0.config\n * @param {DeployablePayloadOrAddress<Payload>} payload\n */\n constructor(\n { account, config }: DeployableOptions,\n payload?: DeployablePayloadOrAddress<Payload>,\n ) {\n if (typeof payload === 'string') {\n super(config, payload as Address);\n } else {\n super(config, undefined);\n this._payload = payload as Payload;\n }\n if (account) this._account = account;\n }\n\n /**\n * Returns the attached deployable payload, if it exists\n *\n * @readonly\n * @type {Payload}\n */\n get payload() {\n return this._payload;\n }\n\n /**\n * Attaches a new payload for use with this deployable's initialization\n *\n * @public\n * @param {Payload} payload\n * @returns {this}\n */\n public withPayload(payload: Payload) {\n this._payload = payload;\n return this;\n }\n\n /**\n * High level deployment function to deploy and await the contract address.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n * @returns {Promise<this>}\n */\n protected async deploy(\n _payload?: Payload,\n _options?: DeployableOptions,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n const config = _options?.config || this._config;\n const address = await getDeployedContractAddress(\n config,\n this.deployRaw(_payload, _options),\n waitParams,\n );\n this._address = address;\n return this;\n }\n\n /**\n * The lower level contract deployment function that does not await for the transaction receipt.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {Promise<Hash>}\n * @throws {@link DeployableAlreadyDeployedError}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected async deployRaw(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): Promise<Hash> {\n if (this.address) throw new DeployableAlreadyDeployedError(this.address);\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return await deployContract(options.config, {\n ...this.buildParameters(payload),\n ...this.optionallyAttachAccount(options.account),\n });\n }\n\n /**\n * Internal function to attach the connected account to write methods to avoid manually passing in an account each call.\n *\n * @protected\n * @param {?Account} [account]\n * @returns {({ account: Account; } | { account?: undefined; })}\n */\n protected optionallyAttachAccount(account?: Account) {\n if (account) return { account };\n return this._account ? { account: this._account } : {};\n }\n\n /**\n * Base parameter constructor, should return a partial `viem.deployContract` parameters shape including abi, bytecode, and arguments, if any.\n * Expected to be overridden by protocol contracts.\n *\n * @public\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n throw new DeployableBuildParametersUnspecifiedError();\n }\n\n /**\n * Internal method used to ensure that a Wagmi configuration and payload are always present when deploying.\n *\n * @protected\n * @template [P=Payload]\n * @param {?P} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {[P, DeployableOptions]}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected validateDeploymentConfig<P = Payload>(\n _payload?: P,\n _options?: DeployableOptions,\n ) {\n const options = _options || {\n config: this._config,\n account: this._account,\n };\n if (!options) throw new DeployableWagmiConfigurationRequiredError();\n const payload = _payload || this._payload;\n return [payload, options] as [P, DeployableOptions];\n }\n}\n"],"names":["Deployable","Contract","account","config","payload","_payload","_options","waitParams","address","getDeployedContractAddress","DeployableAlreadyDeployedError","options","deployContract","DeployableBuildParametersUnspecifiedError","DeployableWagmiConfigurationRequiredError"],"mappings":";;;;AA6EO,MAAMA,UAGHC,EAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyB9B,YACE,EAAE,SAAAC,GAAS,QAAAC,EAAA,GACXC,GACA;AACI,IAAA,OAAOA,KAAY,WACrB,MAAMD,GAAQC,CAAkB,KAEhC,MAAMD,GAAQ,MAAS,GACvB,KAAK,WAAWC,IAEdF,WAAc,WAAWA;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAI,UAAU;AACZ,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,YAAYE,GAAkB;AACnC,gBAAK,WAAWA,GACT;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeA,MAAgB,OACdC,GACAC,GACAC,GACA;AACM,UAAAJ,KAASG,KAAA,gBAAAA,EAAU,WAAU,KAAK,SAClCE,IAAU,MAAMC;AAAA,MACpBN;AAAA,MACA,KAAK,UAAUE,GAAUC,CAAQ;AAAA,MACjCC;AAAA,IAAA;AAEF,gBAAK,WAAWC,GACT;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBA,MAAgB,UACdH,GACAC,GACe;AACf,QAAI,KAAK,QAAS,OAAM,IAAII,EAA+B,KAAK,OAAO;AACvE,UAAM,CAACN,GAASO,CAAO,IAAI,KAAK;AAAA,MAC9BN;AAAA,MACAC;AAAA,IAAA;AAEK,WAAA,MAAMM,EAAeD,EAAQ,QAAQ;AAAA,MAC1C,GAAG,KAAK,gBAAgBP,CAAO;AAAA,MAC/B,GAAG,KAAK,wBAAwBO,EAAQ,OAAO;AAAA,IAAA,CAChD;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASU,wBAAwBT,GAAmB;AAC/C,WAAAA,IAAgB,EAAE,SAAAA,MACf,KAAK,WAAW,EAAE,SAAS,KAAK,aAAa;EACtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWO,gBACLG,GACAC,GACyB;AACzB,UAAM,IAAIO,EAA0C;AAAA,EACtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaU,yBACRR,GACAC,GACA;AACA,UAAMK,IAAUL,KAAY;AAAA,MAC1B,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK;AAAA,IAAA;AAEhB,QAAI,CAACK,EAAe,OAAA,IAAIG;AAEjB,WAAA,CADST,KAAY,KAAK,UAChBM,CAAO;AAAA,EAC1B;AACF;"}
|
|
1
|
+
{"version":3,"file":"Deployable.js","sources":["../../src/Deployable/Deployable.ts"],"sourcesContent":["import { type Config, deployContract } from '@wagmi/core';\nimport type {\n Abi,\n Account,\n Address,\n ContractEventName,\n Hash,\n Hex,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableBuildParametersUnspecifiedError,\n DeployableMissingPayloadError,\n DeployableWagmiConfigurationRequiredError,\n} from '../errors';\nimport { getDeployedContractAddress } from '../utils';\nimport { Contract } from './Contract';\n\n/**\n * A base class representing a deployable contract, contains base implementations for deployment and initialization payload construction.\n *\n * @export\n * @typedef {GenericDeployableParams}\n */\nexport type GenericDeployableParams = Omit<\n Parameters<typeof deployContract>[1],\n 'args' | 'account'\n> & {\n args: [Hex, ...Array<Hex>] | [];\n account?: Account;\n};\n\n/**\n * A generic type that encapsulates either an initialization payload for a contract, or a valid address for a previously deployed contract.\n *\n * @export\n * @typedef {DeployablePayloadOrAddress}\n * @template [Payload=unknown]\n */\nexport type DeployablePayloadOrAddress<Payload = unknown> = Payload | Address;\n\n/**\n * Instantion options for the base deployable.\n *\n * @export\n * @interface DeployableOptions\n * @typedef {DeployableOptions}\n */\nexport interface DeployableOptions {\n /**\n * [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n *\n * @see {@link Config}\n * @type {Config}\n */\n config: Config;\n /**\n * [Viem Local Account](https://viem.sh/docs/accounts/local), required if in a Node environment\n *\n * @see {@link Account}\n * @type {?Account}\n */\n account?: Account;\n}\n\n/**\n * A generic deployable contract that encapsulates common operations related to contract deployment\n *\n * @export\n * @class Deployable\n * @typedef {Deployable}\n * @template [Payload=unknown]\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=ContractEventName<ContractAbi>]\n * @extends {Contract<ContractAbi, ContractEvent>}\n */\nexport class Deployable<\n Payload,\n ContractAbi extends Abi,\n> extends Contract<ContractAbi> {\n /**\n * The deployable payload used either for contract construction or initialization\n *\n * @protected\n * @type {(Payload | undefined)}\n */\n protected _payload: Payload | undefined;\n /**\n * If it exists, [Viem Local Account](https://viem.sh/docs/accounts/local), if in a Node environment\n *\n * @protected\n * @type {?Account}\n */\n protected _account?: Account;\n\n /**\n * Creates an instance of Deployable.\n *\n * @constructor\n * @param {DeployableOptions} param0\n * @param {?Account} [param0.account]\n * @param {Config} param0.config\n * @param {DeployablePayloadOrAddress<Payload>} payload\n */\n constructor(\n { account, config }: DeployableOptions,\n payload?: DeployablePayloadOrAddress<Payload>,\n ) {\n if (typeof payload === 'string') {\n super(config, payload as Address);\n } else {\n super(config, undefined);\n this._payload = payload as Payload;\n }\n if (account) this._account = account;\n }\n\n /**\n * Returns the attached deployable payload, if it exists\n *\n * @readonly\n * @type {Payload}\n */\n get payload() {\n return this._payload;\n }\n\n /**\n * Returns the attached account, if it exists\n *\n * @readonly\n * @type {Account | undefined}\n */\n get account() {\n return this._account;\n }\n\n /**\n * Attaches a new payload for use with this deployable's initialization\n *\n * @public\n * @param {Payload} payload\n * @returns {this}\n */\n public withPayload(payload: Payload) {\n this._payload = payload;\n return this;\n }\n\n /**\n * High level deployment function to deploy and await the contract address.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n * @returns {Promise<this>}\n */\n protected async deploy(\n _payload?: Payload,\n _options?: DeployableOptions,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n const config = _options?.config || this._config;\n const address = await getDeployedContractAddress(\n config,\n this.deployRaw(_payload, _options),\n waitParams,\n );\n this._address = address;\n return this;\n }\n\n /**\n * The lower level contract deployment function that does not await for the transaction receipt.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {Promise<Hash>}\n * @throws {@link DeployableAlreadyDeployedError}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected async deployRaw(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): Promise<Hash> {\n if (this.address) throw new DeployableAlreadyDeployedError(this.address);\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return await deployContract(options.config, {\n ...this.buildParameters(payload),\n ...this.optionallyAttachAccount(options.account),\n });\n }\n\n /**\n * Internal function to attach the connected account to write methods to avoid manually passing in an account each call.\n *\n * @protected\n * @param {?Account} [account]\n * @returns {({ account: Account; } | { account?: undefined; })}\n */\n protected optionallyAttachAccount(account?: Account) {\n if (account) return { account };\n return this._account ? { account: this._account } : {};\n }\n\n /**\n * Base parameter constructor, should return a partial `viem.deployContract` parameters shape including abi, bytecode, and arguments, if any.\n * Expected to be overridden by protocol contracts.\n *\n * @public\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n throw new DeployableBuildParametersUnspecifiedError();\n }\n\n /**\n * Internal method used to ensure that a Wagmi configuration and payload are always present when deploying.\n *\n * @protected\n * @template [P=Payload]\n * @param {?P} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {[P, DeployableOptions]}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected validateDeploymentConfig<P = Payload>(\n _payload?: P,\n _options?: DeployableOptions,\n ) {\n const options = _options || {\n config: this._config,\n account: this._account,\n };\n if (!options) throw new DeployableWagmiConfigurationRequiredError();\n const payload = _payload || this._payload;\n return [payload, options] as [P, DeployableOptions];\n }\n}\n"],"names":["Deployable","Contract","account","config","payload","_payload","_options","waitParams","address","getDeployedContractAddress","DeployableAlreadyDeployedError","options","deployContract","DeployableBuildParametersUnspecifiedError","DeployableWagmiConfigurationRequiredError"],"mappings":";;;;AA6EO,MAAMA,UAGHC,EAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyB9B,YACE,EAAE,SAAAC,GAAS,QAAAC,EAAA,GACXC,GACA;AACI,IAAA,OAAOA,KAAY,WACrB,MAAMD,GAAQC,CAAkB,KAEhC,MAAMD,GAAQ,MAAS,GACvB,KAAK,WAAWC,IAEdF,WAAc,WAAWA;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAI,UAAU;AACZ,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAI,UAAU;AACZ,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,YAAYE,GAAkB;AACnC,gBAAK,WAAWA,GACT;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeA,MAAgB,OACdC,GACAC,GACAC,GACA;AACM,UAAAJ,KAASG,KAAA,gBAAAA,EAAU,WAAU,KAAK,SAClCE,IAAU,MAAMC;AAAA,MACpBN;AAAA,MACA,KAAK,UAAUE,GAAUC,CAAQ;AAAA,MACjCC;AAAA,IAAA;AAEF,gBAAK,WAAWC,GACT;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBA,MAAgB,UACdH,GACAC,GACe;AACf,QAAI,KAAK,QAAS,OAAM,IAAII,EAA+B,KAAK,OAAO;AACvE,UAAM,CAACN,GAASO,CAAO,IAAI,KAAK;AAAA,MAC9BN;AAAA,MACAC;AAAA,IAAA;AAEK,WAAA,MAAMM,EAAeD,EAAQ,QAAQ;AAAA,MAC1C,GAAG,KAAK,gBAAgBP,CAAO;AAAA,MAC/B,GAAG,KAAK,wBAAwBO,EAAQ,OAAO;AAAA,IAAA,CAChD;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASU,wBAAwBT,GAAmB;AAC/C,WAAAA,IAAgB,EAAE,SAAAA,MACf,KAAK,WAAW,EAAE,SAAS,KAAK,aAAa;EACtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWO,gBACLG,GACAC,GACyB;AACzB,UAAM,IAAIO,EAA0C;AAAA,EACtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaU,yBACRR,GACAC,GACA;AACA,UAAMK,IAAUL,KAAY;AAAA,MAC1B,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK;AAAA,IAAA;AAEhB,QAAI,CAACK,EAAe,OAAA,IAAIG;AAEjB,WAAA,CADST,KAAY,KAAK,UAChBM,CAAO;AAAA,EAC1B;AACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../generated-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../generated-BzLYuFx3.cjs"),u=require("@wagmi/core"),i=require("viem"),d=require("../errors.cjs"),l=require("../utils.cjs"),h=require("./Deployable.cjs"),a=class a extends h.Deployable{constructor(e,s,t){super(e,s),this._isBase=!0,typeof s=="string"&&i.isAddress(s)&&s!==i.zeroAddress&&!Object.values(this.bases).some(r=>!s||!r?!1:i.isAddressEqual(s,r))&&(t=!1),t!==void 0&&(this._isBase=t)}get isBase(){return this.address&&Object.values(this.bases).some(e=>e&&this.address&&i.isAddressEqual(this.address,e))?!0:this._isBase}get bases(){return this.constructor.bases}get registryType(){return this.constructor.registryType}async deploy(e,s,t){return await super.deploy(e,s,t),this.assertValidAddress(),this}async deployRaw(e,s){if(this.address)throw new d.DeployableAlreadyDeployedError(this.address);const t=e||this._payload,r=(s==null?void 0:s.config)||this._config,{args:y,...o}=this.buildParameters(t);return await u.deployContract(r,{...o,...this.optionallyAttachAccount(s==null?void 0:s.account),args:[]})}async supportsInterface(e,s){return await c.ys(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...s,args:[e]})}async getComponentInterface(e){return await c.ls(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...e,args:[]})}validateDeploymentConfig(e,s){const t=e||this._payload;if(!t)throw new d.DeployableMissingPayloadError;return super.validateDeploymentConfig(t,s)}};a.bases={},a.registryType=l.RegistryType.ACTION;let n=a;exports.DeployableTarget=n;
|
|
2
2
|
//# sourceMappingURL=DeployableTarget.cjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { V as n, Z as c } from "../generated-D6oDILUw.js";
|
|
2
2
|
import { deployContract as h } from "@wagmi/core";
|
|
3
|
-
import { isAddress as
|
|
3
|
+
import { isAddress as l, zeroAddress as u, isAddressEqual as a } from "viem";
|
|
4
4
|
import { DeployableAlreadyDeployedError as y, DeployableMissingPayloadError as f } from "../errors.js";
|
|
5
|
-
import { RegistryType as
|
|
6
|
-
import { Deployable as
|
|
7
|
-
const i = class i extends
|
|
5
|
+
import { RegistryType as m } from "../utils.js";
|
|
6
|
+
import { Deployable as p } from "./Deployable.js";
|
|
7
|
+
const i = class i extends p {
|
|
8
8
|
/**
|
|
9
9
|
* Creates an instance of DeployableTarget.
|
|
10
10
|
*
|
|
@@ -14,7 +14,7 @@ const i = class i extends m {
|
|
|
14
14
|
* @param {?boolean} [isBase] - A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.
|
|
15
15
|
*/
|
|
16
16
|
constructor(t, s, r) {
|
|
17
|
-
super(t, s), this._isBase = !0, typeof s == "string" &&
|
|
17
|
+
super(t, s), this._isBase = !0, typeof s == "string" && l(s) && s !== u && !Object.values(this.bases).some((e) => !s || !e ? !1 : a(s, e)) && (r = !1), r !== void 0 && (this._isBase = r);
|
|
18
18
|
}
|
|
19
19
|
get isBase() {
|
|
20
20
|
return this.address && Object.values(this.bases).some(
|
|
@@ -124,7 +124,7 @@ const i = class i extends m {
|
|
|
124
124
|
return super.validateDeploymentConfig(r, s);
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
-
i.bases = {}, i.registryType =
|
|
127
|
+
i.bases = {}, i.registryType = m.ACTION;
|
|
128
128
|
let o = i;
|
|
129
129
|
export {
|
|
130
130
|
o as DeployableTarget
|