@boostxyz/sdk 6.1.2 → 7.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/README.md +1 -1
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +4 -4
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +10 -0
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +84 -83
- package/dist/Actions/EventAction.js.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.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +14 -14
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- 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 +1894 -267
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +808 -497
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +47 -47
- package/dist/Budget-B_kgJGDu.cjs +2 -0
- package/dist/Budget-B_kgJGDu.cjs.map +1 -0
- package/dist/Budget-Bvi5Qjqp.js +1124 -0
- package/dist/Budget-Bvi5Qjqp.js.map +1 -0
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.d.ts +5 -4
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +9 -6
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +4 -0
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +25 -25
- package/dist/Budgets/ManagedBudgetWithFees.d.ts +4 -0
- package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts +4 -0
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts.map +1 -1
- package/dist/Budgets/TransparentBudget.d.ts +944 -0
- package/dist/Budgets/TransparentBudget.d.ts.map +1 -0
- package/dist/Budgets/VestingBudget.d.ts +4 -0
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +1 -1
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +19 -19
- package/dist/Incentive-CLKutfnD.js +445 -0
- package/dist/Incentive-CLKutfnD.js.map +1 -0
- package/dist/Incentive-CLSVNxDz.cjs +2 -0
- package/dist/Incentive-CLSVNxDz.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +9 -9
- package/dist/Incentives/AllowListIncentive.js.map +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +5 -5
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +17 -17
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedIncentive.d.ts +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs +2 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs.map +1 -0
- package/dist/Incentives/{ERC20PeggedVariableCriteriaIncentive.d.ts → ERC20PeggedVariableCriteriaIncentiveV2.d.ts} +39 -27
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js +625 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs +2 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs.map +1 -0
- package/dist/Incentives/{ERC20VariableCriteriaIncentive.d.ts → ERC20VariableCriteriaIncentiveV2.d.ts} +42 -13
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js +242 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +3 -3
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +22 -22
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +8 -8
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +13 -12
- package/dist/Incentives/Incentive.js.map +1 -1
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.js +13 -13
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-C1C_BHkY.js +133 -0
- package/dist/{SimpleDenyList-BKfPoTo1.js.map → SimpleDenyList-C1C_BHkY.js.map} +1 -1
- package/dist/SimpleDenyList-CWthbyj7.cjs +2 -0
- package/dist/{SimpleDenyList-DgjVf7FK.cjs.map → SimpleDenyList-CWthbyj7.cjs.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
- package/dist/Validators/LimitedSignerValidator.d.ts.map +1 -1
- package/dist/Validators/LimitedSignerValidator.js +48 -52
- package/dist/Validators/LimitedSignerValidator.js.map +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.js +54 -54
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/componentInterfaces-BVHB4Fjw.js +21 -0
- package/dist/componentInterfaces-BVHB4Fjw.js.map +1 -0
- package/dist/componentInterfaces-BqhL-meV.cjs +2 -0
- package/dist/componentInterfaces-BqhL-meV.cjs.map +1 -0
- package/dist/deployments-D9QxJGrC.cjs +2 -0
- package/dist/deployments-D9QxJGrC.cjs.map +1 -0
- package/dist/deployments-De8_J7SS.js +120 -0
- package/dist/{deployments-W_LUj833.js.map → deployments-De8_J7SS.js.map} +1 -1
- package/dist/deployments.json +63 -48
- package/dist/{generated-CElkFqkY.js → generated-BJfQ-EBO.js} +1268 -737
- package/dist/generated-BJfQ-EBO.js.map +1 -0
- package/dist/generated-mJJNq-xb.cjs +3 -0
- package/dist/generated-mJJNq-xb.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +162 -158
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +13 -7
- package/src/Actions/EventAction.ts +11 -0
- package/src/BoostCore.test.ts +14 -9
- package/src/BoostCore.ts +428 -26
- package/src/Budgets/Budget.ts +8 -1
- package/src/Budgets/TransparentBudget.test.ts +70 -0
- package/src/Budgets/TransparentBudget.ts +334 -0
- package/src/Deployable/Deployable.ts +1 -1
- package/src/Incentives/ERC20PeggedIncentive.ts +1 -1
- package/src/Incentives/{ERC20PeggedVariableCriteriaIncentive.test.ts → ERC20PeggedVariableCriteriaIncentiveV2.test.ts} +14 -10
- package/src/Incentives/{ERC20PeggedVariableCriteriaIncentive.ts → ERC20PeggedVariableCriteriaIncentiveV2.ts} +122 -100
- package/src/Incentives/{ERC20VariableCriteriaIncentive.test.ts → ERC20VariableCriteriaIncentiveV2.test.ts} +18 -13
- package/src/Incentives/{ERC20VariableCriteriaIncentive.ts → ERC20VariableCriteriaIncentiveV2.ts} +83 -24
- package/src/Incentives/ERC20VariableIncentive.ts +4 -2
- package/src/Incentives/Incentive.ts +12 -12
- package/src/Validators/LimitedSignerValidator.ts +1 -4
- package/src/index.test.ts +2 -2
- package/src/index.ts +3 -2
- package/src/utils.ts +1 -1
- package/dist/Budget-BjfL8dVX.cjs +0 -2
- package/dist/Budget-BjfL8dVX.cjs.map +0 -1
- package/dist/Budget-DD7IPuDx.js +0 -922
- package/dist/Budget-DD7IPuDx.js.map +0 -1
- package/dist/Incentive-V1RjH38L.js +0 -1036
- package/dist/Incentive-V1RjH38L.js.map +0 -1
- package/dist/Incentive-gVTfsnMB.cjs +0 -2
- package/dist/Incentive-gVTfsnMB.cjs.map +0 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +0 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +0 -2
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +0 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +0 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +0 -207
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +0 -1
- package/dist/SimpleDenyList-BKfPoTo1.js +0 -133
- package/dist/SimpleDenyList-DgjVf7FK.cjs +0 -2
- package/dist/componentInterfaces-CA1UIqWL.js +0 -20
- package/dist/componentInterfaces-CA1UIqWL.js.map +0 -1
- package/dist/componentInterfaces-aBgBbB7r.cjs +0 -2
- package/dist/componentInterfaces-aBgBbB7r.cjs.map +0 -1
- package/dist/deployments-CwTZr-cK.cjs +0 -2
- package/dist/deployments-CwTZr-cK.cjs.map +0 -1
- package/dist/deployments-W_LUj833.js +0 -117
- package/dist/generated-BPiHi7W2.cjs +0 -3
- package/dist/generated-BPiHi7W2.cjs.map +0 -1
- package/dist/generated-CElkFqkY.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransparentBudget.d.ts","sourceRoot":"","sources":["../../src/Budgets/TransparentBudget.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,oBAAoB,EAIrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EAGT,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAChC,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,CAAC;AAEhE;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,CAC9B,KAAK,SAAS,iBAAiB,CAC7B,OAAO,oBAAoB,CAC5B,GAAG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,QAAQ,CAAC,EAAE,KAAK,EAChB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;CAS3B"}
|
|
@@ -81,6 +81,10 @@ export declare class VestingBudget extends DeployableTargetWithRBAC<VestingBudge
|
|
|
81
81
|
readonly type: "error";
|
|
82
82
|
readonly inputs: readonly [];
|
|
83
83
|
readonly name: "CloneAlreadyInitialized";
|
|
84
|
+
}, {
|
|
85
|
+
readonly type: "error";
|
|
86
|
+
readonly inputs: readonly [];
|
|
87
|
+
readonly name: "FnSelectorNotRecognized";
|
|
84
88
|
}, {
|
|
85
89
|
readonly type: "error";
|
|
86
90
|
readonly inputs: readonly [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VestingBudget.d.ts","sourceRoot":"","sources":["../../src/Budgets/VestingBudget.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,gBAAgB,EAMjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAKvB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAElF,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,uBAAuB,EAAE,CAAC;AACxC;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC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OG;IACI,WAAW,CAAC,KAAK,GAAE,OAAqB,EAAE,MAAM,CAAC,EAAE,UAAU;IASpE;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,oBAAoB,EAC/B,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;CAwB3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,KAAK,EACL,UAAU,EACV,KAAK,EACL,QAAQ,EACR,KAAK,GACN,EAAE,oBAAoB,iBAQtB"}
|
|
@@ -1 +1 @@
|
|
|
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 * 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"}
|
|
@@ -8,7 +8,7 @@ import { Contract } from './Contract';
|
|
|
8
8
|
* @typedef {GenericDeployableParams}
|
|
9
9
|
*/
|
|
10
10
|
export type GenericDeployableParams = Omit<Parameters<typeof deployContract>[1], 'args' | 'account'> & {
|
|
11
|
-
args: [Hex, ...Array<Hex>];
|
|
11
|
+
args: [Hex, ...Array<Hex>] | [];
|
|
12
12
|
account?: Account;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
@@ -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,S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,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 +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,GAA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AAIO,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 * 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,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-mJJNq-xb.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=>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.Yi(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...s,args:[e]})}async getComponentInterface(e){return await c.Xi(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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as d, X as c } from "../generated-BJfQ-EBO.js";
|
|
2
2
|
import { deployContract as h } from "@wagmi/core";
|
|
3
3
|
import { isAddress as u, zeroAddress as l, isAddressEqual as a } from "viem";
|
|
4
4
|
import { DeployableAlreadyDeployedError as y, DeployableMissingPayloadError as f } from "../errors.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../generated-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../generated-mJJNq-xb.cjs"),c=require("./DeployableTarget.cjs");var o=(n=>(n[n.MANAGER=1n]="MANAGER",n[n.ADMIN=2n]="ADMIN",n))(o||{});class l extends c.DeployableTarget{async setAuthorized(s,t,a){return await this.awaitResult(this.setAuthorizedRaw(s,t,a))}async setAuthorizedRaw(s,t,a){const{request:i,result:r}=await e.T0(this._config,{address:this.assertValidAddress(),args:[s,t],...this.optionallyAttachAccount(),...a});return{hash:await e.r0(this._config,i),result:r}}async grantRoles(s,t,a){return await this.awaitResult(this.grantRolesRaw(s,t,a))}async grantRolesRaw(s,t,a){const{request:i,result:r}=await e.d0(this._config,{address:this.assertValidAddress(),args:[s,t],...this.optionallyAttachAccount(),...a});return{hash:await e.e0(this._config,i),result:r}}async revokeRoles(s,t,a){return await this.awaitResult(this.revokeRolesRaw(s,t,a))}async revokeRolesRaw(s,t,a){const{request:i,result:r}=await e.v0(this._config,{address:this.assertValidAddress(),args:[s,t],...this.optionallyAttachAccount(),...a});return{hash:await e.s0(this._config,i),result:r}}async grantManyRoles(s,t,a){return await this.awaitResult(this.grantManyRolesRaw(s,t,a))}async grantManyRolesRaw(s,t,a){const{request:i,result:r}=await e.y0(this._config,{address:this.assertValidAddress(),args:[s,t],...this.optionallyAttachAccount(),...a});return{hash:await e.YP(this._config,i),result:r}}async revokeManyRoles(s,t,a){return await this.awaitResult(this.revokeManyRolesRaw(s,t,a))}async revokeManyRolesRaw(s,t,a){const{request:i,result:r}=await e.f0(this._config,{address:this.assertValidAddress(),args:[s,t],...this.optionallyAttachAccount(),...a});return{hash:await e.i0(this._config,i),result:r}}async rolesOf(s,t){const a=await e.QP(this._config,{address:this.assertValidAddress(),args:[s],...this.optionallyAttachAccount(),...t});return[o.MANAGER,o.ADMIN].filter(i=>(a&i)===i)}hasAnyRole(s,t,a){return e.UP(this._config,{address:this.assertValidAddress(),args:[s,t],...this.optionallyAttachAccount(),...a})}hasAllRoles(s,t,a){return e.GP(this._config,{address:this.assertValidAddress(),args:[s,t],...this.optionallyAttachAccount(),...a})}isAuthorized(s,t){return e.ZP(this._config,{address:this.assertValidAddress(),args:[s],...this.optionallyAttachAccount(),...t})}async transferOwnership(s,t){return await this.awaitResult(this.transferOwnershipRaw(s,t))}async transferOwnershipRaw(s,t){const{request:a,result:i}=await e.Pk(this._config,{address:this.assertValidAddress(),args:[s],...this.optionallyAttachAccount(),...t});return{hash:await e.Bk(this._config,a),result:i}}async renounceOwnership(s){return await this.awaitResult(this.renounceOwnershipRaw(s))}async renounceOwnershipRaw(s){const{request:t,result:a}=await e.xk(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...s});return{hash:await e.Rk(this._config,t),result:a}}async requestOwnershipHandover(s){return await this.awaitResult(this.requestOwnershipHandoverRaw(s))}async requestOwnershipHandoverRaw(s){const{request:t,result:a}=await e.kk(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...s});return{hash:await e.Ck(this._config,t),result:a}}async completeOwnershipHandover(s,t){return await this.awaitResult(this.completeOwnershipHandoverRaw(s,t))}async completeOwnershipHandoverRaw(s,t){const{request:a,result:i}=await e.Fk(this._config,{address:this.assertValidAddress(),args:[s],...this.optionallyAttachAccount(),...t});return{hash:await e.Nk(this._config,a),result:i}}async cancelOwnershipHandover(s){return await this.awaitResult(this.cancelOwnershipHandoverRaw(s))}async cancelOwnershipHandoverRaw(s){const{request:t,result:a}=await e.zk(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...s});return{hash:await e.Ik(this._config,t),result:a}}ownershipHandoverExpiresAt(s,t){return e.gk(this._config,{address:this.assertValidAddress(),args:[s],...this.optionallyAttachAccount(),...t})}async renounceRoles(s,t){return await this.awaitResult(this.renounceRolesRaw(s,t))}async renounceRolesRaw(s,t){const{request:a,result:i}=await e.Sk(this._config,{address:this.assertValidAddress(),args:[s],...this.optionallyAttachAccount(),...t});return{hash:await e.Ok(this._config,a),result:i}}}exports.rbacAbi=e.x;exports.DeployableTargetWithRBAC=l;exports.Roles=o;
|
|
2
2
|
//# sourceMappingURL=DeployableTargetWithRBAC.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { DeployableTarget as
|
|
1
|
+
import { e as o, f as c, g as l, i as d, j as u, s as w, k as A, l as R, m as g, n as y, Q as p, U as f, G as _, Z as k, P as v, B as O, o as V, q, t as M, u as H, w as m, A as N, E as P, H as x, J as z, K as D, O as E } from "../generated-BJfQ-EBO.js";
|
|
2
|
+
import { x as Q } from "../generated-BJfQ-EBO.js";
|
|
3
|
+
import { DeployableTarget as G } from "./DeployableTarget.js";
|
|
4
4
|
var h = /* @__PURE__ */ ((r) => (r[r.MANAGER = 1n] = "MANAGER", r[r.ADMIN = 2n] = "ADMIN", r))(h || {});
|
|
5
|
-
class
|
|
5
|
+
class B extends G {
|
|
6
6
|
/**
|
|
7
7
|
* Set the authorized status of the given accounts
|
|
8
8
|
* The mechanism for managing authorization is left to the implementing contract
|
|
@@ -211,7 +211,7 @@ class C extends b {
|
|
|
211
211
|
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
212
212
|
*/
|
|
213
213
|
async revokeManyRolesRaw(s, t, a) {
|
|
214
|
-
const { request: e, result: i } = await
|
|
214
|
+
const { request: e, result: i } = await g(
|
|
215
215
|
this._config,
|
|
216
216
|
{
|
|
217
217
|
address: this.assertValidAddress(),
|
|
@@ -221,7 +221,7 @@ class C extends b {
|
|
|
221
221
|
...a
|
|
222
222
|
}
|
|
223
223
|
);
|
|
224
|
-
return { hash: await
|
|
224
|
+
return { hash: await y(
|
|
225
225
|
this._config,
|
|
226
226
|
// biome-ignore lint/suspicious/noExplicitAny: negligible low level lack of type intersection
|
|
227
227
|
e
|
|
@@ -303,7 +303,7 @@ class C extends b {
|
|
|
303
303
|
* @returns {Promise<boolean>} - True if the account is authorized
|
|
304
304
|
*/
|
|
305
305
|
isAuthorized(s, t) {
|
|
306
|
-
return
|
|
306
|
+
return k(this._config, {
|
|
307
307
|
address: this.assertValidAddress(),
|
|
308
308
|
args: [s],
|
|
309
309
|
...this.optionallyAttachAccount(),
|
|
@@ -333,7 +333,7 @@ class C extends b {
|
|
|
333
333
|
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
334
334
|
*/
|
|
335
335
|
async transferOwnershipRaw(s, t) {
|
|
336
|
-
const { request: a, result: e } = await
|
|
336
|
+
const { request: a, result: e } = await v(
|
|
337
337
|
this._config,
|
|
338
338
|
{
|
|
339
339
|
address: this.assertValidAddress(),
|
|
@@ -343,7 +343,7 @@ class C extends b {
|
|
|
343
343
|
...t
|
|
344
344
|
}
|
|
345
345
|
);
|
|
346
|
-
return { hash: await
|
|
346
|
+
return { hash: await O(
|
|
347
347
|
this._config,
|
|
348
348
|
a
|
|
349
349
|
), result: e };
|
|
@@ -368,7 +368,7 @@ class C extends b {
|
|
|
368
368
|
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
369
369
|
*/
|
|
370
370
|
async renounceOwnershipRaw(s) {
|
|
371
|
-
const { request: t, result: a } = await
|
|
371
|
+
const { request: t, result: a } = await V(
|
|
372
372
|
this._config,
|
|
373
373
|
{
|
|
374
374
|
address: this.assertValidAddress(),
|
|
@@ -377,7 +377,7 @@ class C extends b {
|
|
|
377
377
|
...s
|
|
378
378
|
}
|
|
379
379
|
);
|
|
380
|
-
return { hash: await
|
|
380
|
+
return { hash: await q(
|
|
381
381
|
this._config,
|
|
382
382
|
t
|
|
383
383
|
), result: a };
|
|
@@ -456,7 +456,7 @@ class C extends b {
|
|
|
456
456
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
457
457
|
...t
|
|
458
458
|
});
|
|
459
|
-
return { hash: await
|
|
459
|
+
return { hash: await N(
|
|
460
460
|
this._config,
|
|
461
461
|
a
|
|
462
462
|
), result: e };
|
|
@@ -483,13 +483,13 @@ class C extends b {
|
|
|
483
483
|
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
484
484
|
*/
|
|
485
485
|
async cancelOwnershipHandoverRaw(s) {
|
|
486
|
-
const { request: t, result: a } = await
|
|
486
|
+
const { request: t, result: a } = await P(this._config, {
|
|
487
487
|
address: this.assertValidAddress(),
|
|
488
488
|
...this.optionallyAttachAccount(),
|
|
489
489
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
490
490
|
...s
|
|
491
491
|
});
|
|
492
|
-
return { hash: await
|
|
492
|
+
return { hash: await x(
|
|
493
493
|
this._config,
|
|
494
494
|
t
|
|
495
495
|
), result: a };
|
|
@@ -504,7 +504,7 @@ class C extends b {
|
|
|
504
504
|
* @returns {Promise<bigint>} - The timestamp when the handover request expires, or 0 if no request exists
|
|
505
505
|
*/
|
|
506
506
|
ownershipHandoverExpiresAt(s, t) {
|
|
507
|
-
return
|
|
507
|
+
return z(this._config, {
|
|
508
508
|
address: this.assertValidAddress(),
|
|
509
509
|
args: [s],
|
|
510
510
|
...this.optionallyAttachAccount(),
|
|
@@ -536,7 +536,7 @@ class C extends b {
|
|
|
536
536
|
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
537
537
|
*/
|
|
538
538
|
async renounceRolesRaw(s, t) {
|
|
539
|
-
const { request: a, result: e } = await
|
|
539
|
+
const { request: a, result: e } = await D(
|
|
540
540
|
this._config,
|
|
541
541
|
{
|
|
542
542
|
address: this.assertValidAddress(),
|
|
@@ -546,12 +546,12 @@ class C extends b {
|
|
|
546
546
|
...t
|
|
547
547
|
}
|
|
548
548
|
);
|
|
549
|
-
return { hash: await
|
|
549
|
+
return { hash: await E(this._config, a), result: e };
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
export {
|
|
553
|
-
|
|
553
|
+
B as DeployableTargetWithRBAC,
|
|
554
554
|
h as Roles,
|
|
555
|
-
|
|
555
|
+
Q as rbacAbi
|
|
556
556
|
};
|
|
557
557
|
//# sourceMappingURL=DeployableTargetWithRBAC.js.map
|