@boostxyz/sdk 0.0.0-alpha.7 → 0.0.0-alpha.8
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 +3 -2
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +10 -10
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.d.ts +2 -2
- package/dist/AllowLists/AllowList.js +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +3 -3
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +1 -1
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +1 -1
- 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 +33 -1
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +286 -241
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.cjs.map +1 -1
- package/dist/BoostRegistry.d.ts +14 -0
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +21 -5
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.js +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +8 -2
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +6 -0
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.cjs.map +1 -1
- package/dist/Deployable/DeployableTarget.d.ts +4 -3
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +30 -27
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.js +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.js +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.js +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.js +1 -1
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.js +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.js +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +1 -1
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +14 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +30 -21
- package/dist/errors.js.map +1 -1
- package/dist/{generated-Cd-Fe7W7.cjs → generated-BzszviNp.cjs} +3 -3
- package/dist/{generated-Cd-Fe7W7.cjs.map → generated-BzszviNp.cjs.map} +1 -1
- package/dist/{generated-DGpIVcv5.js → generated-Cbv8zFkf.js} +286 -278
- package/dist/{generated-DGpIVcv5.js.map → generated-Cbv8zFkf.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +105 -104
- package/package.json +1 -1
- package/src/Actions/EventAction.ts +10 -2
- package/src/AllowLists/SimpleAllowList.ts +3 -2
- package/src/BoostCore.ts +76 -13
- package/src/BoostRegistry.ts +21 -0
- package/src/Deployable/Deployable.ts +8 -2
- package/src/Deployable/DeployableTarget.ts +17 -4
- package/src/errors.ts +18 -0
package/dist/Actions/Action.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../generated-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../generated-BzszviNp.cjs"),a=require("../componentInterfaces-CKCBwG16.cjs"),s=require("@wagmi/core"),f=require("../errors.cjs"),c=require("./EventAction.cjs"),e={[a.AEventAction]:c.EventAction};async function u(n,t){const o=await s.readContract(n.config,{abi:i.X,functionName:"getComponentInterface",address:t}),r=e[o];if(!r)throw new f.InvalidComponentInterfaceError(Object.keys(e),o);return new r(n,t)}exports.EventAction=c.EventAction;exports.ActionByComponentInterface=e;exports.actionFromAddress=u;
|
|
2
2
|
//# sourceMappingURL=Action.cjs.map
|
package/dist/Actions/Action.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { X as c } from "../generated-
|
|
1
|
+
import { X as c } from "../generated-Cbv8zFkf.js";
|
|
2
2
|
import { A as i } from "../componentInterfaces-DYkaxBda.js";
|
|
3
3
|
import { readContract as m } from "@wagmi/core";
|
|
4
4
|
import { InvalidComponentInterfaceError as a } from "../errors.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../generated-Cd-Fe7W7.cjs"),h=require("@boostxyz/signatures/events"),y=require("viem"),g=require("viem/actions"),p=require("../Deployable/DeployableTarget.cjs"),i=require("../errors.cjs"),a=require("../utils.cjs"),A="0x60a0604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b60805161239f6100c85f395f61034a015261239f5ff3fe608060405260043610610090575f3560e01c80639bc1cf81116100585780639bc1cf811461017d578063c26624e8146101a7578063d7768c47146101e3578063dbdf21101461021f578063ddd6ab081461024957610090565b806301ffc9a71461009457806309c5eabe146100d057806328d6183b14610101578063393df8cb1461012b578063439fab9114610155575b5f80fd5b34801561009f575f80fd5b506100ba60048036038101906100b5919061145c565b610273565b6040516100c791906114a1565b60405180910390f35b6100ea60048036038101906100e5919061151b565b6102ec565b6040516100f89291906115d6565b60405180910390f35b34801561010c575f80fd5b50610115610321565b6040516101229190611613565b60405180910390f35b348015610136575f80fd5b5061013f610348565b60405161014c91906116a6565b60405180910390f35b348015610160575f80fd5b5061017b6004803603810190610176919061151b565b61036c565b005b348015610188575f80fd5b506101916103f9565b60405161019e91906119de565b60405180910390f35b3480156101b2575f80fd5b506101cd60048036038101906101c89190611a31565b610686565b6040516101da9190611acf565b60405180910390f35b3480156101ee575f80fd5b506102096004803603810190610204919061151b565b6108f1565b6040516102169190611aef565b60405180910390f35b34801561022a575f80fd5b50610233610925565b6040516102409190611b62565b60405180910390f35b348015610254575f80fd5b5061025d610a3c565b60405161026a9190611b8a565b60405180910390f35b5f7f7687b0ed000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806102e557506102e482610a48565b5b9050919050565b5f60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f7687b0ed00000000000000000000000000000000000000000000000000000000905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f610375610ac1565b905080546003825580156103a75760018160011c14303b1061039e5763f92ee8a95f526004601cfd5b818160ff1b1b91505b506103bf83838101906103ba9190612035565b610aea565b80156103f4576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b60606001805480602002602001604051908101604052809291908181526020015f905b8282101561067d578382905f5260205f2090600302016040518060a00160405290815f82015f9054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160049054906101000a900460ff1660018111156104b4576104b36116f7565b5b60018111156104c6576104c56116f7565b5b81526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182016040518060800160405290815f82015f9054906101000a900460ff16600481111561056e5761056d6116f7565b5b60048111156105805761057f6116f7565b5b81526020015f820160019054906101000a900460ff1660038111156105a8576105a76116f7565b5b60038111156105ba576105b96116f7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff1681526020016001820180546105ea906120a9565b80601f0160208091040260200160405190810160405280929190818152602001828054610616906120a9565b80156106615780601f1061063857610100808354040283529160200191610661565b820191905f5260205f20905b81548152906001019060200180831161064457829003601f168201915b505050505081525050815250508152602001906001019061041c565b50505050905090565b61068e6112c1565b600182815481106106a2576106a16120d9565b5b905f5260205f2090600302016040518060a00160405290815f82015f9054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160049054906101000a900460ff1660018111156107305761072f6116f7565b5b6001811115610742576107416116f7565b5b81526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182016040518060800160405290815f82015f9054906101000a900460ff1660048111156107ea576107e96116f7565b5b60048111156107fc576107fb6116f7565b5b81526020015f820160019054906101000a900460ff166003811115610824576108236116f7565b5b6003811115610836576108356116f7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff168152602001600182018054610866906120a9565b80601f0160208091040260200160405190810160405280929190818152602001828054610892906120a9565b80156108dd5780601f106108b4576101008083540402835291602001916108dd565b820191905f5260205f20905b8154815290600101906020018083116108c057829003601f168201915b505050505081525050815250509050919050565b60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61092d61133c565b5f6040518060800160405290815f82015f9054906101000a900460ff16600181111561095c5761095b6116f7565b5b600181111561096e5761096d6116f7565b5b81526020015f820160019054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f600180549050905090565b5f7fe6715795000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610aba5750610ab9826111bb565b5b9050919050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610af2611234565b805f01515f80820151815f015f6101000a81548160ff02191690836001811115610b1f57610b1e6116f7565b5b02179055506020820151815f0160016101000a81548163ffffffff021916908360e01c02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090505060018160200151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610c2857610c276116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610cc457610cc36116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610cf357610cf26116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610d2d919061229a565b505050505060018160400151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610daa57610da96116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610e4657610e456116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610e7557610e746116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610eaf919061229a565b505050505060018160600151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610f2c57610f2b6116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610fc857610fc76116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610ff757610ff66116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081611031919061229a565b505050505060018160800151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff021916908360018111156110ae576110ad6116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff0219169083600481111561114a576111496116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115611179576111786116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff16021790555060608201518160010190816111b3919061229a565b505050505050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061122d575061122c82611258565b5b9050919050565b5f61123d610ac1565b905080546001166112555763d7e6bcf85f526004601cfd5b50565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6040518060a001604052805f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f6001811115611304576113036116f7565b5b81526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020016113366113aa565b81525090565b60405180608001604052805f600181111561135a576113596116f7565b5b81526020015f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b60405180608001604052805f60048111156113c8576113c76116f7565b5b81526020015f60038111156113e0576113df6116f7565b5b81526020015f60ff168152602001606081525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61143b81611407565b8114611445575f80fd5b50565b5f8135905061145681611432565b92915050565b5f60208284031215611471576114706113ff565b5b5f61147e84828501611448565b91505092915050565b5f8115159050919050565b61149b81611487565b82525050565b5f6020820190506114b45f830184611492565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126114db576114da6114ba565b5b8235905067ffffffffffffffff8111156114f8576114f76114be565b5b602083019150836001820283011115611514576115136114c2565b5b9250929050565b5f8060208385031215611531576115306113ff565b5b5f83013567ffffffffffffffff81111561154e5761154d611403565b5b61155a858286016114c6565b92509250509250929050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6115a882611566565b6115b28185611570565b93506115c2818560208601611580565b6115cb8161158e565b840191505092915050565b5f6040820190506115e95f830185611492565b81810360208301526115fb818461159e565b90509392505050565b61160d81611407565b82525050565b5f6020820190506116265f830184611604565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f61166e6116696116648461162c565b61164b565b61162c565b9050919050565b5f61167f82611654565b9050919050565b5f61169082611675565b9050919050565b6116a081611686565b82525050565b5f6020820190506116b95f830184611697565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6116f181611407565b82525050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611735576117346116f7565b5b50565b5f81905061174582611724565b919050565b5f61175482611738565b9050919050565b6117648161174a565b82525050565b5f60ff82169050919050565b61177f8161176a565b82525050565b5f61178f8261162c565b9050919050565b61179f81611785565b82525050565b600581106117b6576117b56116f7565b5b50565b5f8190506117c6826117a5565b919050565b5f6117d5826117b9565b9050919050565b6117e5816117cb565b82525050565b600481106117fc576117fb6116f7565b5b50565b5f81905061180c826117eb565b919050565b5f61181b826117ff565b9050919050565b61182b81611811565b82525050565b5f82825260208201905092915050565b5f61184b82611566565b6118558185611831565b9350611865818560208601611580565b61186e8161158e565b840191505092915050565b5f608083015f83015161188e5f8601826117dc565b5060208301516118a16020860182611822565b5060408301516118b46040860182611776565b50606083015184820360608601526118cc8282611841565b9150508091505092915050565b5f60a083015f8301516118ee5f8601826116e8565b506020830151611901602086018261175b565b5060408301516119146040860182611776565b5060608301516119276060860182611796565b506080830151848203608086015261193f8282611879565b9150508091505092915050565b5f61195783836118d9565b905092915050565b5f602082019050919050565b5f611975826116bf565b61197f81856116c9565b935083602082028501611991856116d9565b805f5b858110156119cc57848403895281516119ad858261194c565b94506119b88361195f565b925060208a01995050600181019050611994565b50829750879550505050505092915050565b5f6020820190508181035f8301526119f6818461196b565b905092915050565b5f819050919050565b611a10816119fe565b8114611a1a575f80fd5b50565b5f81359050611a2b81611a07565b92915050565b5f60208284031215611a4657611a456113ff565b5b5f611a5384828501611a1d565b91505092915050565b5f60a083015f830151611a715f8601826116e8565b506020830151611a84602086018261175b565b506040830151611a976040860182611776565b506060830151611aaa6060860182611796565b5060808301518482036080860152611ac28282611879565b9150508091505092915050565b5f6020820190508181035f830152611ae78184611a5c565b905092915050565b5f6020820190508181035f830152611b07818461159e565b905092915050565b608082015f820151611b235f85018261175b565b506020820151611b3660208501826116e8565b506040820151611b496040850182611776565b506060820151611b5c6060850182611796565b50505050565b5f608082019050611b755f830184611b0f565b92915050565b611b84816119fe565b82525050565b5f602082019050611b9d5f830184611b7b565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611bdd8261158e565b810181811067ffffffffffffffff82111715611bfc57611bfb611ba7565b5b80604052505050565b5f611c0e6113f6565b9050611c1a8282611bd4565b919050565b5f80fd5b60028110611c2f575f80fd5b50565b5f81359050611c4081611c23565b92915050565b611c4f8161176a565b8114611c59575f80fd5b50565b5f81359050611c6a81611c46565b92915050565b611c7981611785565b8114611c83575f80fd5b50565b5f81359050611c9481611c70565b92915050565b5f60808284031215611caf57611cae611ba3565b5b611cb96080611c05565b90505f611cc884828501611c32565b5f830152506020611cdb84828501611448565b6020830152506040611cef84828501611c5c565b6040830152506060611d0384828501611c86565b60608301525092915050565b60058110611d1b575f80fd5b50565b5f81359050611d2c81611d0f565b92915050565b60048110611d3e575f80fd5b50565b5f81359050611d4f81611d32565b92915050565b5f80fd5b5f67ffffffffffffffff821115611d7357611d72611ba7565b5b611d7c8261158e565b9050602081019050919050565b828183375f83830152505050565b5f611da9611da484611d59565b611c05565b905082815260208101848484011115611dc557611dc4611d55565b5b611dd0848285611d89565b509392505050565b5f82601f830112611dec57611deb6114ba565b5b8135611dfc848260208601611d97565b91505092915050565b5f60808284031215611e1a57611e19611ba3565b5b611e246080611c05565b90505f611e3384828501611d1e565b5f830152506020611e4684828501611d41565b6020830152506040611e5a84828501611c5c565b604083015250606082013567ffffffffffffffff811115611e7e57611e7d611c1f565b5b611e8a84828501611dd8565b60608301525092915050565b5f60a08284031215611eab57611eaa611ba3565b5b611eb560a0611c05565b90505f611ec484828501611448565b5f830152506020611ed784828501611c32565b6020830152506040611eeb84828501611c5c565b6040830152506060611eff84828501611c86565b606083015250608082013567ffffffffffffffff811115611f2357611f22611c1f565b5b611f2f84828501611e05565b60808301525092915050565b5f6101008284031215611f5157611f50611ba3565b5b611f5b60a0611c05565b90505f611f6a84828501611c9a565b5f83015250608082013567ffffffffffffffff811115611f8d57611f8c611c1f565b5b611f9984828501611e96565b60208301525060a082013567ffffffffffffffff811115611fbd57611fbc611c1f565b5b611fc984828501611e96565b60408301525060c082013567ffffffffffffffff811115611fed57611fec611c1f565b5b611ff984828501611e96565b60608301525060e082013567ffffffffffffffff81111561201d5761201c611c1f565b5b61202984828501611e96565b60808301525092915050565b5f6020828403121561204a576120496113ff565b5b5f82013567ffffffffffffffff81111561206757612066611403565b5b61207384828501611f3b565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806120c057607f821691505b6020821081036120d3576120d261207c565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026121627fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612127565b61216c8683612127565b95508019841693508086168417925050509392505050565b5f61219e612199612194846119fe565b61164b565b6119fe565b9050919050565b5f819050919050565b6121b783612184565b6121cb6121c3826121a5565b848454612133565b825550505050565b5f90565b6121df6121d3565b6121ea8184846121ae565b505050565b5b8181101561220d576122025f826121d7565b6001810190506121f0565b5050565b601f8211156122525761222381612106565b61222c84612118565b8101602085101561223b578190505b61224f61224785612118565b8301826121ef565b50505b505050565b5f82821c905092915050565b5f6122725f1984600802612257565b1980831691505092915050565b5f61228a8383612263565b9150826002028217905092915050565b6122a382611566565b67ffffffffffffffff8111156122bc576122bb611ba7565b5b6122c682546120a9565b6122d1828285612211565b5f60209050601f831160018114612302575f84156122f0578287015190505b6122fa858261227f565b865550612361565b601f19841661231086612106565b5f5b8281101561233757848901518255600182019150602085019450602081019050612312565b868310156123545784890151612350601f891682612263565b8355505b6001600288020188555050505b50505050505056fea2646970667358221220232ad425d6a3fa9ff7de7b59ca0cdff9b09b560e5493bdfd8320e53da80c045964736f6c634300081a0033",o=class o extends p.DeployableTarget{constructor(){super(...arguments),this.abi=s.W}async getActionStep(f,b){return(await this.getActionSteps(b)).at(f)}async getActionSteps(f){const b=await s.$f(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f});return a.dedupeActionSteps(b)}async getActionStepsCount(f){return(await this.getActionSteps(f)).length}async getActionClaimant(f){return s.Gf(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f})}async execute(f,b){return this.awaitResult(this.executeRaw(f,b))}async executeRaw(f,b){const{request:e,result:c}=await s.tv(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...b,args:[f]});return{hash:await s.Xf(this._config,e),result:c}}async validateActionSteps(f){const b=await this.getActionSteps(f);for(const e of b)if(!await this.isActionStepValid(e,f))return!1;return!0}async isActionStepValid(f,b){const e=f.actionParameter,c=f.signature;let t;if(b!=null&&b.knownEvents?t=b.knownEvents[c]:t=h.abi[c],!t)throw new Error(`No known ABI for given event signature: ${c}`);const n=f.targetContract,d=(b==null?void 0:b.logs)||await g.getLogs(this._config.getClient({chainId:b==null?void 0:b.chainId}),{...b,address:n,event:t});if(!d.length)return!1;for(let r of d)if(!this.validateLogAgainstCriteria(e,r))return!1;return!0}async validateLogAgainstCriteria(f,b){const e=b.topics.at(f.fieldIndex);if(e===void 0)throw new i.FieldValueUndefinedError({log:b,criteria:f,fieldValue:e});switch(f.filterType){case a.FilterType.EQUAL:return f.fieldType===a.PrimitiveType.ADDRESS?y.isAddressEqual(f.filterData,`0x${e.slice(-40)}`):e===f.filterData;case a.FilterType.NOT_EQUAL:return e!==f.filterData;case a.FilterType.GREATER_THAN:if(f.fieldType===a.PrimitiveType.UINT)return BigInt(e)>BigInt(f.filterData);throw new i.InvalidNumericalCriteriaError({log:b,criteria:f,fieldValue:e});case a.FilterType.LESS_THAN:if(f.fieldType===a.PrimitiveType.UINT)return BigInt(e)<BigInt(f.filterData);throw new i.InvalidNumericalCriteriaError({log:b,criteria:f,fieldValue:e});case a.FilterType.CONTAINS:if(f.fieldType===a.PrimitiveType.BYTES||f.fieldType===a.PrimitiveType.STRING)return e.includes(f.filterData);throw new i.FieldValueNotComparableError({log:b,criteria:f,fieldValue:e});default:throw new i.UnrecognizedFilterTypeError({log:b,criteria:f,fieldValue:e})}}buildParameters(f,b){const[e,c]=this.validateDeploymentConfig(f,b);let t;if(a.isEventActionPayloadSimple(e)){let n=e.actionSteps.filter(r=>!!r);if(n.length===0)throw new i.NoEventActionStepsProvidedError;if(n.length>4)throw new i.TooManyEventActionStepsProvidedError;let d=Array.from({length:4},(r,u)=>n.at(u)||n.slice(0,u).at(-1));t={actionClaimant:e.actionClaimant,actionStepOne:d.at(0),actionStepTwo:d.at(1),actionStepThree:d.at(2),actionStepFour:d.at(3)}}else t=e;return{abi:s.W,bytecode:A,args:[a.prepareEventActionPayload(t)],...this.optionallyAttachAccount(c.account)}}};o.base="0x1dC0C2B7D910a3D053cab3c5aB8a131d04332Cde",o.registryType=a.RegistryType.ACTION;let l=o;exports.EventAction=l;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../generated-BzszviNp.cjs"),h=require("@boostxyz/signatures/events"),y=require("viem"),g=require("viem/actions"),p=require("../Deployable/DeployableTarget.cjs"),i=require("../errors.cjs"),a=require("../utils.cjs"),A="0x60a0604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b60805161239f6100c85f395f61034a015261239f5ff3fe608060405260043610610090575f3560e01c80639bc1cf81116100585780639bc1cf811461017d578063c26624e8146101a7578063d7768c47146101e3578063dbdf21101461021f578063ddd6ab081461024957610090565b806301ffc9a71461009457806309c5eabe146100d057806328d6183b14610101578063393df8cb1461012b578063439fab9114610155575b5f80fd5b34801561009f575f80fd5b506100ba60048036038101906100b5919061145c565b610273565b6040516100c791906114a1565b60405180910390f35b6100ea60048036038101906100e5919061151b565b6102ec565b6040516100f89291906115d6565b60405180910390f35b34801561010c575f80fd5b50610115610321565b6040516101229190611613565b60405180910390f35b348015610136575f80fd5b5061013f610348565b60405161014c91906116a6565b60405180910390f35b348015610160575f80fd5b5061017b6004803603810190610176919061151b565b61036c565b005b348015610188575f80fd5b506101916103f9565b60405161019e91906119de565b60405180910390f35b3480156101b2575f80fd5b506101cd60048036038101906101c89190611a31565b610686565b6040516101da9190611acf565b60405180910390f35b3480156101ee575f80fd5b506102096004803603810190610204919061151b565b6108f1565b6040516102169190611aef565b60405180910390f35b34801561022a575f80fd5b50610233610925565b6040516102409190611b62565b60405180910390f35b348015610254575f80fd5b5061025d610a3c565b60405161026a9190611b8a565b60405180910390f35b5f7f7687b0ed000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806102e557506102e482610a48565b5b9050919050565b5f60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f7687b0ed00000000000000000000000000000000000000000000000000000000905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f610375610ac1565b905080546003825580156103a75760018160011c14303b1061039e5763f92ee8a95f526004601cfd5b818160ff1b1b91505b506103bf83838101906103ba9190612035565b610aea565b80156103f4576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b60606001805480602002602001604051908101604052809291908181526020015f905b8282101561067d578382905f5260205f2090600302016040518060a00160405290815f82015f9054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160049054906101000a900460ff1660018111156104b4576104b36116f7565b5b60018111156104c6576104c56116f7565b5b81526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182016040518060800160405290815f82015f9054906101000a900460ff16600481111561056e5761056d6116f7565b5b60048111156105805761057f6116f7565b5b81526020015f820160019054906101000a900460ff1660038111156105a8576105a76116f7565b5b60038111156105ba576105b96116f7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff1681526020016001820180546105ea906120a9565b80601f0160208091040260200160405190810160405280929190818152602001828054610616906120a9565b80156106615780601f1061063857610100808354040283529160200191610661565b820191905f5260205f20905b81548152906001019060200180831161064457829003601f168201915b505050505081525050815250508152602001906001019061041c565b50505050905090565b61068e6112c1565b600182815481106106a2576106a16120d9565b5b905f5260205f2090600302016040518060a00160405290815f82015f9054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160049054906101000a900460ff1660018111156107305761072f6116f7565b5b6001811115610742576107416116f7565b5b81526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182016040518060800160405290815f82015f9054906101000a900460ff1660048111156107ea576107e96116f7565b5b60048111156107fc576107fb6116f7565b5b81526020015f820160019054906101000a900460ff166003811115610824576108236116f7565b5b6003811115610836576108356116f7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff168152602001600182018054610866906120a9565b80601f0160208091040260200160405190810160405280929190818152602001828054610892906120a9565b80156108dd5780601f106108b4576101008083540402835291602001916108dd565b820191905f5260205f20905b8154815290600101906020018083116108c057829003601f168201915b505050505081525050815250509050919050565b60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61092d61133c565b5f6040518060800160405290815f82015f9054906101000a900460ff16600181111561095c5761095b6116f7565b5b600181111561096e5761096d6116f7565b5b81526020015f820160019054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f600180549050905090565b5f7fe6715795000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610aba5750610ab9826111bb565b5b9050919050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610af2611234565b805f01515f80820151815f015f6101000a81548160ff02191690836001811115610b1f57610b1e6116f7565b5b02179055506020820151815f0160016101000a81548163ffffffff021916908360e01c02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090505060018160200151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610c2857610c276116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610cc457610cc36116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610cf357610cf26116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610d2d919061229a565b505050505060018160400151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610daa57610da96116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610e4657610e456116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610e7557610e746116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610eaf919061229a565b505050505060018160600151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610f2c57610f2b6116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610fc857610fc76116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610ff757610ff66116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081611031919061229a565b505050505060018160800151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff021916908360018111156110ae576110ad6116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff0219169083600481111561114a576111496116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115611179576111786116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff16021790555060608201518160010190816111b3919061229a565b505050505050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061122d575061122c82611258565b5b9050919050565b5f61123d610ac1565b905080546001166112555763d7e6bcf85f526004601cfd5b50565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6040518060a001604052805f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f6001811115611304576113036116f7565b5b81526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020016113366113aa565b81525090565b60405180608001604052805f600181111561135a576113596116f7565b5b81526020015f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b60405180608001604052805f60048111156113c8576113c76116f7565b5b81526020015f60038111156113e0576113df6116f7565b5b81526020015f60ff168152602001606081525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61143b81611407565b8114611445575f80fd5b50565b5f8135905061145681611432565b92915050565b5f60208284031215611471576114706113ff565b5b5f61147e84828501611448565b91505092915050565b5f8115159050919050565b61149b81611487565b82525050565b5f6020820190506114b45f830184611492565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126114db576114da6114ba565b5b8235905067ffffffffffffffff8111156114f8576114f76114be565b5b602083019150836001820283011115611514576115136114c2565b5b9250929050565b5f8060208385031215611531576115306113ff565b5b5f83013567ffffffffffffffff81111561154e5761154d611403565b5b61155a858286016114c6565b92509250509250929050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6115a882611566565b6115b28185611570565b93506115c2818560208601611580565b6115cb8161158e565b840191505092915050565b5f6040820190506115e95f830185611492565b81810360208301526115fb818461159e565b90509392505050565b61160d81611407565b82525050565b5f6020820190506116265f830184611604565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f61166e6116696116648461162c565b61164b565b61162c565b9050919050565b5f61167f82611654565b9050919050565b5f61169082611675565b9050919050565b6116a081611686565b82525050565b5f6020820190506116b95f830184611697565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6116f181611407565b82525050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611735576117346116f7565b5b50565b5f81905061174582611724565b919050565b5f61175482611738565b9050919050565b6117648161174a565b82525050565b5f60ff82169050919050565b61177f8161176a565b82525050565b5f61178f8261162c565b9050919050565b61179f81611785565b82525050565b600581106117b6576117b56116f7565b5b50565b5f8190506117c6826117a5565b919050565b5f6117d5826117b9565b9050919050565b6117e5816117cb565b82525050565b600481106117fc576117fb6116f7565b5b50565b5f81905061180c826117eb565b919050565b5f61181b826117ff565b9050919050565b61182b81611811565b82525050565b5f82825260208201905092915050565b5f61184b82611566565b6118558185611831565b9350611865818560208601611580565b61186e8161158e565b840191505092915050565b5f608083015f83015161188e5f8601826117dc565b5060208301516118a16020860182611822565b5060408301516118b46040860182611776565b50606083015184820360608601526118cc8282611841565b9150508091505092915050565b5f60a083015f8301516118ee5f8601826116e8565b506020830151611901602086018261175b565b5060408301516119146040860182611776565b5060608301516119276060860182611796565b506080830151848203608086015261193f8282611879565b9150508091505092915050565b5f61195783836118d9565b905092915050565b5f602082019050919050565b5f611975826116bf565b61197f81856116c9565b935083602082028501611991856116d9565b805f5b858110156119cc57848403895281516119ad858261194c565b94506119b88361195f565b925060208a01995050600181019050611994565b50829750879550505050505092915050565b5f6020820190508181035f8301526119f6818461196b565b905092915050565b5f819050919050565b611a10816119fe565b8114611a1a575f80fd5b50565b5f81359050611a2b81611a07565b92915050565b5f60208284031215611a4657611a456113ff565b5b5f611a5384828501611a1d565b91505092915050565b5f60a083015f830151611a715f8601826116e8565b506020830151611a84602086018261175b565b506040830151611a976040860182611776565b506060830151611aaa6060860182611796565b5060808301518482036080860152611ac28282611879565b9150508091505092915050565b5f6020820190508181035f830152611ae78184611a5c565b905092915050565b5f6020820190508181035f830152611b07818461159e565b905092915050565b608082015f820151611b235f85018261175b565b506020820151611b3660208501826116e8565b506040820151611b496040850182611776565b506060820151611b5c6060850182611796565b50505050565b5f608082019050611b755f830184611b0f565b92915050565b611b84816119fe565b82525050565b5f602082019050611b9d5f830184611b7b565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611bdd8261158e565b810181811067ffffffffffffffff82111715611bfc57611bfb611ba7565b5b80604052505050565b5f611c0e6113f6565b9050611c1a8282611bd4565b919050565b5f80fd5b60028110611c2f575f80fd5b50565b5f81359050611c4081611c23565b92915050565b611c4f8161176a565b8114611c59575f80fd5b50565b5f81359050611c6a81611c46565b92915050565b611c7981611785565b8114611c83575f80fd5b50565b5f81359050611c9481611c70565b92915050565b5f60808284031215611caf57611cae611ba3565b5b611cb96080611c05565b90505f611cc884828501611c32565b5f830152506020611cdb84828501611448565b6020830152506040611cef84828501611c5c565b6040830152506060611d0384828501611c86565b60608301525092915050565b60058110611d1b575f80fd5b50565b5f81359050611d2c81611d0f565b92915050565b60048110611d3e575f80fd5b50565b5f81359050611d4f81611d32565b92915050565b5f80fd5b5f67ffffffffffffffff821115611d7357611d72611ba7565b5b611d7c8261158e565b9050602081019050919050565b828183375f83830152505050565b5f611da9611da484611d59565b611c05565b905082815260208101848484011115611dc557611dc4611d55565b5b611dd0848285611d89565b509392505050565b5f82601f830112611dec57611deb6114ba565b5b8135611dfc848260208601611d97565b91505092915050565b5f60808284031215611e1a57611e19611ba3565b5b611e246080611c05565b90505f611e3384828501611d1e565b5f830152506020611e4684828501611d41565b6020830152506040611e5a84828501611c5c565b604083015250606082013567ffffffffffffffff811115611e7e57611e7d611c1f565b5b611e8a84828501611dd8565b60608301525092915050565b5f60a08284031215611eab57611eaa611ba3565b5b611eb560a0611c05565b90505f611ec484828501611448565b5f830152506020611ed784828501611c32565b6020830152506040611eeb84828501611c5c565b6040830152506060611eff84828501611c86565b606083015250608082013567ffffffffffffffff811115611f2357611f22611c1f565b5b611f2f84828501611e05565b60808301525092915050565b5f6101008284031215611f5157611f50611ba3565b5b611f5b60a0611c05565b90505f611f6a84828501611c9a565b5f83015250608082013567ffffffffffffffff811115611f8d57611f8c611c1f565b5b611f9984828501611e96565b60208301525060a082013567ffffffffffffffff811115611fbd57611fbc611c1f565b5b611fc984828501611e96565b60408301525060c082013567ffffffffffffffff811115611fed57611fec611c1f565b5b611ff984828501611e96565b60608301525060e082013567ffffffffffffffff81111561201d5761201c611c1f565b5b61202984828501611e96565b60808301525092915050565b5f6020828403121561204a576120496113ff565b5b5f82013567ffffffffffffffff81111561206757612066611403565b5b61207384828501611f3b565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806120c057607f821691505b6020821081036120d3576120d261207c565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026121627fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612127565b61216c8683612127565b95508019841693508086168417925050509392505050565b5f61219e612199612194846119fe565b61164b565b6119fe565b9050919050565b5f819050919050565b6121b783612184565b6121cb6121c3826121a5565b848454612133565b825550505050565b5f90565b6121df6121d3565b6121ea8184846121ae565b505050565b5b8181101561220d576122025f826121d7565b6001810190506121f0565b5050565b601f8211156122525761222381612106565b61222c84612118565b8101602085101561223b578190505b61224f61224785612118565b8301826121ef565b50505b505050565b5f82821c905092915050565b5f6122725f1984600802612257565b1980831691505092915050565b5f61228a8383612263565b9150826002028217905092915050565b6122a382611566565b67ffffffffffffffff8111156122bc576122bb611ba7565b5b6122c682546120a9565b6122d1828285612211565b5f60209050601f831160018114612302575f84156122f0578287015190505b6122fa858261227f565b865550612361565b601f19841661231086612106565b5f5b8281101561233757848901518255600182019150602085019450602081019050612312565b868310156123545784890151612350601f891682612263565b8355505b6001600288020188555050505b50505050505056fea2646970667358221220232ad425d6a3fa9ff7de7b59ca0cdff9b09b560e5493bdfd8320e53da80c045964736f6c634300081a0033",o=class o extends p.DeployableTarget{constructor(){super(...arguments),this.abi=s.W}async getActionStep(f,b){return(await this.getActionSteps(b)).at(f)}async getActionSteps(f){const b=await s.$f(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f});return a.dedupeActionSteps(b)}async getActionStepsCount(f){return(await this.getActionSteps(f)).length}async getActionClaimant(f){return s.Gf(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f})}async execute(f,b){return this.awaitResult(this.executeRaw(f,b))}async executeRaw(f,b){const{request:e,result:c}=await s.tv(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...b,args:[f]});return{hash:await s.Xf(this._config,e),result:c}}async validateActionSteps(f){const b=await this.getActionSteps(f);for(const e of b)if(!await this.isActionStepValid(e,f))return!1;return!0}async isActionStepValid(f,b){const e=f.actionParameter,c=f.signature;let t;if(b!=null&&b.knownEvents?t=b.knownEvents[c]:t=h.abi[c],!t)throw new Error(`No known ABI for given event signature: ${c}`);const n=f.targetContract,d=(b==null?void 0:b.logs)||await g.getLogs(this._config.getClient({chainId:b==null?void 0:b.chainId}),{...b,address:n,event:t});if(!d.length)return!1;for(let r of d)if(!await this.validateLogAgainstCriteria(e,r))return!1;return!0}async validateLogAgainstCriteria(f,b){const e=b.topics.at(f.fieldIndex);if(e===void 0)throw new i.FieldValueUndefinedError({log:b,criteria:f,fieldValue:e});switch(f.filterType){case a.FilterType.EQUAL:return f.fieldType===a.PrimitiveType.ADDRESS?y.isAddressEqual(f.filterData,`0x${e.slice(-40)}`):e===f.filterData;case a.FilterType.NOT_EQUAL:return e!==f.filterData;case a.FilterType.GREATER_THAN:if(f.fieldType===a.PrimitiveType.UINT)return BigInt(e)>BigInt(f.filterData);throw new i.InvalidNumericalCriteriaError({log:b,criteria:f,fieldValue:e});case a.FilterType.LESS_THAN:if(f.fieldType===a.PrimitiveType.UINT)return BigInt(e)<BigInt(f.filterData);throw new i.InvalidNumericalCriteriaError({log:b,criteria:f,fieldValue:e});case a.FilterType.CONTAINS:if(f.fieldType===a.PrimitiveType.BYTES||f.fieldType===a.PrimitiveType.STRING)return e.includes(f.filterData);throw new i.FieldValueNotComparableError({log:b,criteria:f,fieldValue:e});default:throw new i.UnrecognizedFilterTypeError({log:b,criteria:f,fieldValue:e})}}buildParameters(f,b){const[e,c]=this.validateDeploymentConfig(f,b);let t;if(a.isEventActionPayloadSimple(e)){let n=e.actionSteps.filter(r=>!!r);if(n.length===0)throw new i.NoEventActionStepsProvidedError;if(n.length>4)throw new i.TooManyEventActionStepsProvidedError;let d=Array.from({length:4},(r,u)=>n.at(u)||n.slice(0,u).at(-1));t={actionClaimant:e.actionClaimant,actionStepOne:d.at(0),actionStepTwo:d.at(1),actionStepThree:d.at(2),actionStepFour:d.at(3)}}else t=e;return{abi:s.W,bytecode:A,args:[a.prepareEventActionPayload(t)],...this.optionallyAttachAccount(c.account)}}};o.base="0x1dC0C2B7D910a3D053cab3c5aB8a131d04332Cde",o.registryType=a.RegistryType.ACTION;let l=o;exports.EventAction=l;
|
|
2
2
|
//# sourceMappingURL=EventAction.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventAction.cjs","sources":["../../src/Actions/EventAction.ts"],"sourcesContent":["import {\n eventActionAbi,\n readEventActionGetActionClaimant,\n readEventActionGetActionSteps,\n simulateEventActionExecute,\n writeEventActionExecute,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/actions/EventAction.sol/EventAction.json';\nimport events from '@boostxyz/signatures/events';\nimport {\n type Abi,\n type AbiEvent,\n type Address,\n type ContractEventName,\n type Hex,\n type Log,\n isAddressEqual,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n FieldValueNotComparableError,\n FieldValueUndefinedError,\n InvalidNumericalCriteriaError,\n NoEventActionStepsProvidedError,\n TooManyEventActionStepsProvidedError,\n UnrecognizedFilterTypeError,\n} from '../errors';\nimport {\n type ActionClaimant,\n type ActionStep,\n type Criteria,\n type EventActionPayload,\n type EventActionPayloadRaw,\n FilterType,\n type GetLogsParams,\n PrimitiveType,\n type ReadParams,\n RegistryType,\n type WriteParams,\n dedupeActionSteps,\n isEventActionPayloadSimple,\n prepareEventActionPayload,\n} from '../utils';\n\nexport type { EventActionPayload };\n\n/**\n * A generic event action\n *\n * @export\n * @class EventAction\n * @typedef {EventAction}\n * @extends {DeployableTarget<EventActionPayload>}\n */\nexport class EventAction extends DeployableTarget<\n EventActionPayload,\n typeof eventActionAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = eventActionAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env.VITE_EVENT_ACTION_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ACTION;\n\n /**\n * Gets a specific action event by index\n *\n * @public\n * @async\n * @param {number} index The index of the action event to retrieve\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStep'>} [params]\n * @returns {Promise<ActionStep>}\n */\n public async getActionStep(\n index: number,\n params?: ReadParams<typeof eventActionAbi, 'getActionStep'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.at(index);\n }\n\n /**\n * Gets all action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'>} [params]\n * @returns {Promise<ActionStep[]>}\n */\n public async getActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'>,\n ) {\n const steps = (await readEventActionGetActionSteps(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n })) as ActionStep[];\n return dedupeActionSteps(steps);\n }\n\n /**\n * Gets the count of action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStepsCount'>} [params]\n * @returns {Promise<bigint>}\n */\n public async getActionStepsCount(\n params?: ReadParams<typeof eventActionAbi, 'getActionStepsCount'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.length;\n }\n\n /**\n * Retrieves the payload describing how claimants can be identified from logs or function calls.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionClaimant'>} [params]\n * @returns {Promise<ActionClaimant>}\n */\n public async getActionClaimant(\n params?: ReadParams<typeof eventActionAbi, 'getActionClaimant'>,\n ) {\n return readEventActionGetActionClaimant(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<ActionClaimant>;\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {Promise<readonly [boolean, `0x${string}`]>}\n */\n public async execute(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n return this.awaitResult(this.executeRaw(data, params));\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {unknown}\n */\n public async executeRaw(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n const { request, result } = await simulateEventActionExecute(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n args: [data],\n });\n const hash = await writeEventActionExecute(this._config, request);\n return { hash, result };\n }\n\n /**\n * Retrieves action steps, and uses them to validate against, and optionally fetch logs that match the step's signature.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n * GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async validateActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const actionSteps = await this.getActionSteps(params);\n for (const actionStep of actionSteps) {\n if (!(await this.isActionStepValid(actionStep, params))) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a single action step with a given criteria against logs.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {ActionStep} actionStep\n * @param {?GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async isActionStepValid(\n actionStep: ActionStep,\n params?: GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const criteria = actionStep.actionParameter;\n const signature = actionStep.signature;\n let event: AbiEvent;\n // Lookup ABI based on event signature\n if (params?.knownEvents) {\n event = params.knownEvents[signature] as AbiEvent;\n } else {\n event = (events.abi as Record<Hex, AbiEvent>)[signature] as AbiEvent;\n }\n if (!event) {\n throw new Error(`No known ABI for given event signature: ${signature}`);\n }\n const targetContract = actionStep.targetContract;\n // Get all logs matching the event signature from the target contract\n const logs =\n params?.logs ||\n (await getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n ...(params as any),\n address: targetContract,\n event,\n }));\n if (!logs.length) return false;\n for (let log of logs) {\n if (!this.validateLogAgainstCriteria(criteria, log)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a {@link Log} against a given criteria.\n *\n * @param {Criteria} criteria - The criteria to validate against.\n * @param {Log} log - The Viem event log.\n * @returns {Promise<boolean>} - Returns true if the log passes the criteria, false otherwise.\n */\n public async validateLogAgainstCriteria(criteria: Criteria, log: Log) {\n const fieldValue = log.topics.at(criteria.fieldIndex);\n if (fieldValue === undefined) {\n throw new FieldValueUndefinedError({ log, criteria, fieldValue });\n }\n // Type narrow based on criteria.filterType\n switch (criteria.filterType) {\n case FilterType.EQUAL:\n if (criteria.fieldType === PrimitiveType.ADDRESS) {\n return isAddressEqual(\n criteria.filterData,\n `0x${fieldValue.slice(-40)}`,\n );\n }\n return fieldValue === criteria.filterData;\n\n case FilterType.NOT_EQUAL:\n return fieldValue !== criteria.filterData;\n\n case FilterType.GREATER_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) > BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.LESS_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) < BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.CONTAINS:\n if (\n criteria.fieldType === PrimitiveType.BYTES ||\n criteria.fieldType === PrimitiveType.STRING\n ) {\n return fieldValue.includes(criteria.filterData);\n }\n throw new FieldValueNotComparableError({ log, criteria, fieldValue });\n\n default:\n throw new UnrecognizedFilterTypeError({ log, criteria, fieldValue });\n }\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?EventActionPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: EventActionPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n let rawPayload: EventActionPayloadRaw;\n if (isEventActionPayloadSimple(payload)) {\n // filter out any falsy potential values\n let tmpSteps = payload.actionSteps.filter((step) => !!step);\n if (tmpSteps.length === 0) {\n throw new NoEventActionStepsProvidedError();\n }\n if (tmpSteps.length > 4) {\n throw new TooManyEventActionStepsProvidedError();\n }\n let steps: ActionStep[] = Array.from({ length: 4 }, (_, i) => {\n // use either the provided step at the given index, or reuse the previous step\n // should aways exist\n return tmpSteps.at(i)! || tmpSteps.slice(0, i).at(-1)!;\n });\n rawPayload = {\n actionClaimant: payload.actionClaimant,\n actionStepOne: steps.at(0)!,\n actionStepTwo: steps.at(1)!,\n actionStepThree: steps.at(2)!,\n actionStepFour: steps.at(3)!,\n };\n } else {\n rawPayload = payload;\n }\n return {\n abi: eventActionAbi,\n bytecode: bytecode as Hex,\n args: [prepareEventActionPayload(rawPayload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["_EventAction","DeployableTarget","eventActionAbi","index","params","steps","readEventActionGetActionSteps","dedupeActionSteps","readEventActionGetActionClaimant","data","request","result","simulateEventActionExecute","writeEventActionExecute","actionSteps","actionStep","criteria","signature","event","events","targetContract","logs","getLogs","log","fieldValue","FieldValueUndefinedError","FilterType","PrimitiveType","isAddressEqual","InvalidNumericalCriteriaError","FieldValueNotComparableError","UnrecognizedFilterTypeError","_payload","_options","payload","options","rawPayload","isEventActionPayloadSimple","tmpSteps","step","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","_","i","bytecode","prepareEventActionPayload","RegistryType","EventAction"],"mappings":"4glBA2DaA,EAAN,MAAMA,UAAoBC,EAAAA,gBAG/B,CAHK,aAAA,CAAA,MA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,aAAA,OA3B5D,IAAMC,EAAN/C"}
|
|
1
|
+
{"version":3,"file":"EventAction.cjs","sources":["../../src/Actions/EventAction.ts"],"sourcesContent":["import {\n eventActionAbi,\n readEventActionGetActionClaimant,\n readEventActionGetActionSteps,\n simulateEventActionExecute,\n writeEventActionExecute,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/actions/EventAction.sol/EventAction.json';\nimport events from '@boostxyz/signatures/events';\nimport {\n type Abi,\n type AbiEvent,\n type Address,\n type ContractEventName,\n type Hex,\n type Log,\n isAddressEqual,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n FieldValueNotComparableError,\n FieldValueUndefinedError,\n InvalidNumericalCriteriaError,\n NoEventActionStepsProvidedError,\n TooManyEventActionStepsProvidedError,\n UnrecognizedFilterTypeError,\n} from '../errors';\nimport {\n type ActionClaimant,\n type ActionStep,\n type Criteria,\n type EventActionPayload,\n type EventActionPayloadRaw,\n FilterType,\n type GetLogsParams,\n PrimitiveType,\n type ReadParams,\n RegistryType,\n type WriteParams,\n dedupeActionSteps,\n isEventActionPayloadSimple,\n prepareEventActionPayload,\n} from '../utils';\nimport type { SignatureType } from './../utils';\n\nexport type {\n EventActionPayload,\n ActionStep,\n ActionClaimant,\n SignatureType,\n FilterType,\n PrimitiveType,\n};\n\n/**\n * A generic event action\n *\n * @export\n * @class EventAction\n * @typedef {EventAction}\n * @extends {DeployableTarget<EventActionPayload>}\n */\nexport class EventAction extends DeployableTarget<\n EventActionPayload,\n typeof eventActionAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = eventActionAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env.VITE_EVENT_ACTION_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ACTION;\n\n /**\n * Gets a specific action event by index\n *\n * @public\n * @async\n * @param {number} index The index of the action event to retrieve\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStep'>} [params]\n * @returns {Promise<ActionStep>}\n */\n public async getActionStep(\n index: number,\n params?: ReadParams<typeof eventActionAbi, 'getActionStep'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.at(index);\n }\n\n /**\n * Gets all action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'>} [params]\n * @returns {Promise<ActionStep[]>}\n */\n public async getActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'>,\n ) {\n const steps = (await readEventActionGetActionSteps(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n })) as ActionStep[];\n return dedupeActionSteps(steps);\n }\n\n /**\n * Gets the count of action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStepsCount'>} [params]\n * @returns {Promise<bigint>}\n */\n public async getActionStepsCount(\n params?: ReadParams<typeof eventActionAbi, 'getActionStepsCount'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.length;\n }\n\n /**\n * Retrieves the payload describing how claimants can be identified from logs or function calls.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionClaimant'>} [params]\n * @returns {Promise<ActionClaimant>}\n */\n public async getActionClaimant(\n params?: ReadParams<typeof eventActionAbi, 'getActionClaimant'>,\n ) {\n return readEventActionGetActionClaimant(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<ActionClaimant>;\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {Promise<readonly [boolean, `0x${string}`]>}\n */\n public async execute(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n return this.awaitResult(this.executeRaw(data, params));\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {unknown}\n */\n public async executeRaw(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n const { request, result } = await simulateEventActionExecute(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n args: [data],\n });\n const hash = await writeEventActionExecute(this._config, request);\n return { hash, result };\n }\n\n /**\n * Retrieves action steps, and uses them to validate against, and optionally fetch logs that match the step's signature.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n * GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async validateActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const actionSteps = await this.getActionSteps(params);\n for (const actionStep of actionSteps) {\n if (!(await this.isActionStepValid(actionStep, params))) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a single action step with a given criteria against logs.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {ActionStep} actionStep\n * @param {?GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async isActionStepValid(\n actionStep: ActionStep,\n params?: GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const criteria = actionStep.actionParameter;\n const signature = actionStep.signature;\n let event: AbiEvent;\n // Lookup ABI based on event signature\n if (params?.knownEvents) {\n event = params.knownEvents[signature] as AbiEvent;\n } else {\n event = (events.abi as Record<Hex, AbiEvent>)[signature] as AbiEvent;\n }\n if (!event) {\n throw new Error(`No known ABI for given event signature: ${signature}`);\n }\n const targetContract = actionStep.targetContract;\n // Get all logs matching the event signature from the target contract\n const logs =\n params?.logs ||\n (await getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n ...(params as any),\n address: targetContract,\n event,\n }));\n if (!logs.length) return false;\n for (let log of logs) {\n if (!(await this.validateLogAgainstCriteria(criteria, log))) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a {@link Log} against a given criteria.\n *\n * @param {Criteria} criteria - The criteria to validate against.\n * @param {Log} log - The Viem event log.\n * @returns {Promise<boolean>} - Returns true if the log passes the criteria, false otherwise.\n */\n public async validateLogAgainstCriteria(criteria: Criteria, log: Log) {\n const fieldValue = log.topics.at(criteria.fieldIndex);\n if (fieldValue === undefined) {\n throw new FieldValueUndefinedError({ log, criteria, fieldValue });\n }\n // Type narrow based on criteria.filterType\n switch (criteria.filterType) {\n case FilterType.EQUAL:\n if (criteria.fieldType === PrimitiveType.ADDRESS) {\n return isAddressEqual(\n criteria.filterData,\n `0x${fieldValue.slice(-40)}`,\n );\n }\n return fieldValue === criteria.filterData;\n\n case FilterType.NOT_EQUAL:\n return fieldValue !== criteria.filterData;\n\n case FilterType.GREATER_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) > BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.LESS_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) < BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.CONTAINS:\n if (\n criteria.fieldType === PrimitiveType.BYTES ||\n criteria.fieldType === PrimitiveType.STRING\n ) {\n return fieldValue.includes(criteria.filterData);\n }\n throw new FieldValueNotComparableError({ log, criteria, fieldValue });\n\n default:\n throw new UnrecognizedFilterTypeError({ log, criteria, fieldValue });\n }\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?EventActionPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: EventActionPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n let rawPayload: EventActionPayloadRaw;\n if (isEventActionPayloadSimple(payload)) {\n // filter out any falsy potential values\n let tmpSteps = payload.actionSteps.filter((step) => !!step);\n if (tmpSteps.length === 0) {\n throw new NoEventActionStepsProvidedError();\n }\n if (tmpSteps.length > 4) {\n throw new TooManyEventActionStepsProvidedError();\n }\n let steps: ActionStep[] = Array.from({ length: 4 }, (_, i) => {\n // use either the provided step at the given index, or reuse the previous step\n // should aways exist\n return tmpSteps.at(i)! || tmpSteps.slice(0, i).at(-1)!;\n });\n rawPayload = {\n actionClaimant: payload.actionClaimant,\n actionStepOne: steps.at(0)!,\n actionStepTwo: steps.at(1)!,\n actionStepThree: steps.at(2)!,\n actionStepFour: steps.at(3)!,\n };\n } else {\n rawPayload = payload;\n }\n return {\n abi: eventActionAbi,\n bytecode: bytecode as Hex,\n args: [prepareEventActionPayload(rawPayload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["_EventAction","DeployableTarget","eventActionAbi","index","params","steps","readEventActionGetActionSteps","dedupeActionSteps","readEventActionGetActionClaimant","data","request","result","simulateEventActionExecute","writeEventActionExecute","actionSteps","actionStep","criteria","signature","event","events","targetContract","logs","getLogs","log","fieldValue","FieldValueUndefinedError","FilterType","PrimitiveType","isAddressEqual","InvalidNumericalCriteriaError","FieldValueNotComparableError","UnrecognizedFilterTypeError","_payload","_options","payload","options","rawPayload","isEventActionPayloadSimple","tmpSteps","step","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","_","i","bytecode","prepareEventActionPayload","RegistryType","EventAction"],"mappings":"4glBAmEaA,EAAN,MAAMA,UAAoBC,EAAAA,gBAG/B,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAWL,KAAyB,IAAMC,GAAA,CA2B/B,MAAa,cACXC,EACAC,EACA,CAEO,OADO,MAAM,KAAK,eAAeA,CAAM,GACjC,GAAGD,CAAK,CACvB,CAUA,MAAa,eACXC,EACA,CACA,MAAMC,EAAS,MAAMC,KAA8B,KAAK,QAAS,CAC/D,QAAS,KAAK,mBAAmB,EACjC,GAAG,KAAK,wBAAwB,EAEhC,GAAIF,CAAA,CACL,EACD,OAAOG,EAAAA,kBAAkBF,CAAK,CAChC,CAUA,MAAa,oBACXD,EACA,CAEA,OADc,MAAM,KAAK,eAAeA,CAAM,GACjC,MACf,CAUA,MAAa,kBACXA,EACA,CACO,OAAAI,EAAA,GAAiC,KAAK,QAAS,CACpD,QAAS,KAAK,mBAAmB,EACjC,GAAG,KAAK,wBAAwB,EAEhC,GAAIJ,CAAA,CACL,CACH,CAWA,MAAa,QACXK,EACAL,EACA,CACA,OAAO,KAAK,YAAY,KAAK,WAAWK,EAAML,CAAM,CAAC,CACvD,CAWA,MAAa,WACXK,EACAL,EACA,CACA,KAAM,CAAE,QAAAM,EAAS,OAAAC,CAAA,EAAW,MAAMC,EAAA,GAA2B,KAAK,QAAS,CACzE,QAAS,KAAK,mBAAmB,EACjC,GAAG,KAAK,wBAAwB,EAEhC,GAAIR,EACJ,KAAM,CAACK,CAAI,CAAA,CAC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AE,CACrD,EACYP,EAAA,CACX,eAAgBF,EAAQ,eACxB,cAAe7B,EAAM,GAAG,CAAC,EACzB,cAAeA,EAAM,GAAG,CAAC,EACzB,gBAAiBA,EAAM,GAAG,CAAC,EAC3B,eAAgBA,EAAM,GAAG,CAAC,CAAA,CAC5B,MAEa+B,EAAAF,EAER,MAAA,CACL,IAAKhC,EAAA,EACL,SAAA0C,EACA,KAAM,CAACC,4BAA0BT,CAAU,CAAC,EAC5C,GAAG,KAAK,wBAAwBD,EAAQ,OAAO,CAAA,CAEnD,CACF,EA7SyBnC,EAAA,KAAgB,6CAQvCA,EAAuB,aAA6B8C,EAAa,aAAA,OA3B5D,IAAMC,EAAN/C"}
|
|
@@ -2,8 +2,9 @@ import { eventActionAbi } from '@boostxyz/evm';
|
|
|
2
2
|
import { type Abi, type AbiEvent, type Address, type ContractEventName, type Hex, type Log } from 'viem';
|
|
3
3
|
import type { DeployableOptions, GenericDeployableParams } from '../Deployable/Deployable';
|
|
4
4
|
import { DeployableTarget } from '../Deployable/DeployableTarget';
|
|
5
|
-
import { type ActionClaimant, type ActionStep, type Criteria, type EventActionPayload, type GetLogsParams, type ReadParams, RegistryType, type WriteParams } from '../utils';
|
|
6
|
-
|
|
5
|
+
import { type ActionClaimant, type ActionStep, type Criteria, type EventActionPayload, FilterType, type GetLogsParams, PrimitiveType, type ReadParams, RegistryType, type WriteParams } from '../utils';
|
|
6
|
+
import type { SignatureType } from './../utils';
|
|
7
|
+
export type { EventActionPayload, ActionStep, ActionClaimant, SignatureType, FilterType, PrimitiveType, };
|
|
7
8
|
/**
|
|
8
9
|
* A generic event action
|
|
9
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventAction.d.ts","sourceRoot":"","sources":["../../src/Actions/EventAction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAKf,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,GAAG,EACR,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EACR,KAAK,GAAG,EAET,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AASlE,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"EventAction.d.ts","sourceRoot":"","sources":["../../src/Actions/EventAction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAKf,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,GAAG,EACR,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EACR,KAAK,GAAG,EAET,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AASlE,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAEvB,UAAU,EACV,KAAK,aAAa,EAClB,aAAa,EACb,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EAIjB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,YAAY,EACV,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,GACd,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,WAAY,SAAQ,gBAAgB,CAC/C,kBAAkB,EAClB,OAAO,cAAc,CACtB;IACC;;;;;;OAMG;IACH,SAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC,GAAG,CAAC,CAAC,GAAG;QAC3C,WAAW,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;KACd;IAWL;;;;;;;;;;;;OAYG;IACU,iBAAiB,CAC5B,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,aAAa,CAAC,GAAG,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG;QACpD,WAAW,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;KACd;IAiCH;;;;;;OAMG;IACU,0BAA0B,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG;IA6CpE;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,kBAAkB,EAC7B,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;CAqC3B"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { W as l, $ as p, G as g, t as A, k as y } from "../generated-
|
|
1
|
+
import { W as l, $ as p, G as g, t as A, k as y } from "../generated-Cbv8zFkf.js";
|
|
2
2
|
import w from "@boostxyz/signatures/events";
|
|
3
3
|
import { isAddressEqual as S } from "viem";
|
|
4
4
|
import { getLogs as T } from "viem/actions";
|
|
5
5
|
import { DeployableTarget as E } from "../Deployable/DeployableTarget.js";
|
|
6
6
|
import { FieldValueUndefinedError as v, UnrecognizedFilterTypeError as C, FieldValueNotComparableError as I, InvalidNumericalCriteriaError as u, NoEventActionStepsProvidedError as N, TooManyEventActionStepsProvidedError as D } from "../errors.js";
|
|
7
|
-
import { RegistryType as m, dedupeActionSteps as x, FilterType as n, PrimitiveType as
|
|
7
|
+
import { RegistryType as m, dedupeActionSteps as x, FilterType as n, PrimitiveType as i, isEventActionPayloadSimple as B, prepareEventActionPayload as P } from "../utils.js";
|
|
8
8
|
const R = "0x60a0604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b60805161239f6100c85f395f61034a015261239f5ff3fe608060405260043610610090575f3560e01c80639bc1cf81116100585780639bc1cf811461017d578063c26624e8146101a7578063d7768c47146101e3578063dbdf21101461021f578063ddd6ab081461024957610090565b806301ffc9a71461009457806309c5eabe146100d057806328d6183b14610101578063393df8cb1461012b578063439fab9114610155575b5f80fd5b34801561009f575f80fd5b506100ba60048036038101906100b5919061145c565b610273565b6040516100c791906114a1565b60405180910390f35b6100ea60048036038101906100e5919061151b565b6102ec565b6040516100f89291906115d6565b60405180910390f35b34801561010c575f80fd5b50610115610321565b6040516101229190611613565b60405180910390f35b348015610136575f80fd5b5061013f610348565b60405161014c91906116a6565b60405180910390f35b348015610160575f80fd5b5061017b6004803603810190610176919061151b565b61036c565b005b348015610188575f80fd5b506101916103f9565b60405161019e91906119de565b60405180910390f35b3480156101b2575f80fd5b506101cd60048036038101906101c89190611a31565b610686565b6040516101da9190611acf565b60405180910390f35b3480156101ee575f80fd5b506102096004803603810190610204919061151b565b6108f1565b6040516102169190611aef565b60405180910390f35b34801561022a575f80fd5b50610233610925565b6040516102409190611b62565b60405180910390f35b348015610254575f80fd5b5061025d610a3c565b60405161026a9190611b8a565b60405180910390f35b5f7f7687b0ed000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806102e557506102e482610a48565b5b9050919050565b5f60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f7687b0ed00000000000000000000000000000000000000000000000000000000905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f610375610ac1565b905080546003825580156103a75760018160011c14303b1061039e5763f92ee8a95f526004601cfd5b818160ff1b1b91505b506103bf83838101906103ba9190612035565b610aea565b80156103f4576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b60606001805480602002602001604051908101604052809291908181526020015f905b8282101561067d578382905f5260205f2090600302016040518060a00160405290815f82015f9054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160049054906101000a900460ff1660018111156104b4576104b36116f7565b5b60018111156104c6576104c56116f7565b5b81526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182016040518060800160405290815f82015f9054906101000a900460ff16600481111561056e5761056d6116f7565b5b60048111156105805761057f6116f7565b5b81526020015f820160019054906101000a900460ff1660038111156105a8576105a76116f7565b5b60038111156105ba576105b96116f7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff1681526020016001820180546105ea906120a9565b80601f0160208091040260200160405190810160405280929190818152602001828054610616906120a9565b80156106615780601f1061063857610100808354040283529160200191610661565b820191905f5260205f20905b81548152906001019060200180831161064457829003601f168201915b505050505081525050815250508152602001906001019061041c565b50505050905090565b61068e6112c1565b600182815481106106a2576106a16120d9565b5b905f5260205f2090600302016040518060a00160405290815f82015f9054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160049054906101000a900460ff1660018111156107305761072f6116f7565b5b6001811115610742576107416116f7565b5b81526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182016040518060800160405290815f82015f9054906101000a900460ff1660048111156107ea576107e96116f7565b5b60048111156107fc576107fb6116f7565b5b81526020015f820160019054906101000a900460ff166003811115610824576108236116f7565b5b6003811115610836576108356116f7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff168152602001600182018054610866906120a9565b80601f0160208091040260200160405190810160405280929190818152602001828054610892906120a9565b80156108dd5780601f106108b4576101008083540402835291602001916108dd565b820191905f5260205f20905b8154815290600101906020018083116108c057829003601f168201915b505050505081525050815250509050919050565b60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61092d61133c565b5f6040518060800160405290815f82015f9054906101000a900460ff16600181111561095c5761095b6116f7565b5b600181111561096e5761096d6116f7565b5b81526020015f820160019054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f600180549050905090565b5f7fe6715795000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610aba5750610ab9826111bb565b5b9050919050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610af2611234565b805f01515f80820151815f015f6101000a81548160ff02191690836001811115610b1f57610b1e6116f7565b5b02179055506020820151815f0160016101000a81548163ffffffff021916908360e01c02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090505060018160200151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610c2857610c276116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610cc457610cc36116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610cf357610cf26116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610d2d919061229a565b505050505060018160400151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610daa57610da96116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610e4657610e456116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610e7557610e746116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610eaf919061229a565b505050505060018160600151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610f2c57610f2b6116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610fc857610fc76116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610ff757610ff66116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081611031919061229a565b505050505060018160800151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff021916908360018111156110ae576110ad6116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff0219169083600481111561114a576111496116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115611179576111786116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff16021790555060608201518160010190816111b3919061229a565b505050505050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061122d575061122c82611258565b5b9050919050565b5f61123d610ac1565b905080546001166112555763d7e6bcf85f526004601cfd5b50565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6040518060a001604052805f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f6001811115611304576113036116f7565b5b81526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020016113366113aa565b81525090565b60405180608001604052805f600181111561135a576113596116f7565b5b81526020015f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b60405180608001604052805f60048111156113c8576113c76116f7565b5b81526020015f60038111156113e0576113df6116f7565b5b81526020015f60ff168152602001606081525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61143b81611407565b8114611445575f80fd5b50565b5f8135905061145681611432565b92915050565b5f60208284031215611471576114706113ff565b5b5f61147e84828501611448565b91505092915050565b5f8115159050919050565b61149b81611487565b82525050565b5f6020820190506114b45f830184611492565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126114db576114da6114ba565b5b8235905067ffffffffffffffff8111156114f8576114f76114be565b5b602083019150836001820283011115611514576115136114c2565b5b9250929050565b5f8060208385031215611531576115306113ff565b5b5f83013567ffffffffffffffff81111561154e5761154d611403565b5b61155a858286016114c6565b92509250509250929050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6115a882611566565b6115b28185611570565b93506115c2818560208601611580565b6115cb8161158e565b840191505092915050565b5f6040820190506115e95f830185611492565b81810360208301526115fb818461159e565b90509392505050565b61160d81611407565b82525050565b5f6020820190506116265f830184611604565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f61166e6116696116648461162c565b61164b565b61162c565b9050919050565b5f61167f82611654565b9050919050565b5f61169082611675565b9050919050565b6116a081611686565b82525050565b5f6020820190506116b95f830184611697565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6116f181611407565b82525050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611735576117346116f7565b5b50565b5f81905061174582611724565b919050565b5f61175482611738565b9050919050565b6117648161174a565b82525050565b5f60ff82169050919050565b61177f8161176a565b82525050565b5f61178f8261162c565b9050919050565b61179f81611785565b82525050565b600581106117b6576117b56116f7565b5b50565b5f8190506117c6826117a5565b919050565b5f6117d5826117b9565b9050919050565b6117e5816117cb565b82525050565b600481106117fc576117fb6116f7565b5b50565b5f81905061180c826117eb565b919050565b5f61181b826117ff565b9050919050565b61182b81611811565b82525050565b5f82825260208201905092915050565b5f61184b82611566565b6118558185611831565b9350611865818560208601611580565b61186e8161158e565b840191505092915050565b5f608083015f83015161188e5f8601826117dc565b5060208301516118a16020860182611822565b5060408301516118b46040860182611776565b50606083015184820360608601526118cc8282611841565b9150508091505092915050565b5f60a083015f8301516118ee5f8601826116e8565b506020830151611901602086018261175b565b5060408301516119146040860182611776565b5060608301516119276060860182611796565b506080830151848203608086015261193f8282611879565b9150508091505092915050565b5f61195783836118d9565b905092915050565b5f602082019050919050565b5f611975826116bf565b61197f81856116c9565b935083602082028501611991856116d9565b805f5b858110156119cc57848403895281516119ad858261194c565b94506119b88361195f565b925060208a01995050600181019050611994565b50829750879550505050505092915050565b5f6020820190508181035f8301526119f6818461196b565b905092915050565b5f819050919050565b611a10816119fe565b8114611a1a575f80fd5b50565b5f81359050611a2b81611a07565b92915050565b5f60208284031215611a4657611a456113ff565b5b5f611a5384828501611a1d565b91505092915050565b5f60a083015f830151611a715f8601826116e8565b506020830151611a84602086018261175b565b506040830151611a976040860182611776565b506060830151611aaa6060860182611796565b5060808301518482036080860152611ac28282611879565b9150508091505092915050565b5f6020820190508181035f830152611ae78184611a5c565b905092915050565b5f6020820190508181035f830152611b07818461159e565b905092915050565b608082015f820151611b235f85018261175b565b506020820151611b3660208501826116e8565b506040820151611b496040850182611776565b506060820151611b5c6060850182611796565b50505050565b5f608082019050611b755f830184611b0f565b92915050565b611b84816119fe565b82525050565b5f602082019050611b9d5f830184611b7b565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611bdd8261158e565b810181811067ffffffffffffffff82111715611bfc57611bfb611ba7565b5b80604052505050565b5f611c0e6113f6565b9050611c1a8282611bd4565b919050565b5f80fd5b60028110611c2f575f80fd5b50565b5f81359050611c4081611c23565b92915050565b611c4f8161176a565b8114611c59575f80fd5b50565b5f81359050611c6a81611c46565b92915050565b611c7981611785565b8114611c83575f80fd5b50565b5f81359050611c9481611c70565b92915050565b5f60808284031215611caf57611cae611ba3565b5b611cb96080611c05565b90505f611cc884828501611c32565b5f830152506020611cdb84828501611448565b6020830152506040611cef84828501611c5c565b6040830152506060611d0384828501611c86565b60608301525092915050565b60058110611d1b575f80fd5b50565b5f81359050611d2c81611d0f565b92915050565b60048110611d3e575f80fd5b50565b5f81359050611d4f81611d32565b92915050565b5f80fd5b5f67ffffffffffffffff821115611d7357611d72611ba7565b5b611d7c8261158e565b9050602081019050919050565b828183375f83830152505050565b5f611da9611da484611d59565b611c05565b905082815260208101848484011115611dc557611dc4611d55565b5b611dd0848285611d89565b509392505050565b5f82601f830112611dec57611deb6114ba565b5b8135611dfc848260208601611d97565b91505092915050565b5f60808284031215611e1a57611e19611ba3565b5b611e246080611c05565b90505f611e3384828501611d1e565b5f830152506020611e4684828501611d41565b6020830152506040611e5a84828501611c5c565b604083015250606082013567ffffffffffffffff811115611e7e57611e7d611c1f565b5b611e8a84828501611dd8565b60608301525092915050565b5f60a08284031215611eab57611eaa611ba3565b5b611eb560a0611c05565b90505f611ec484828501611448565b5f830152506020611ed784828501611c32565b6020830152506040611eeb84828501611c5c565b6040830152506060611eff84828501611c86565b606083015250608082013567ffffffffffffffff811115611f2357611f22611c1f565b5b611f2f84828501611e05565b60808301525092915050565b5f6101008284031215611f5157611f50611ba3565b5b611f5b60a0611c05565b90505f611f6a84828501611c9a565b5f83015250608082013567ffffffffffffffff811115611f8d57611f8c611c1f565b5b611f9984828501611e96565b60208301525060a082013567ffffffffffffffff811115611fbd57611fbc611c1f565b5b611fc984828501611e96565b60408301525060c082013567ffffffffffffffff811115611fed57611fec611c1f565b5b611ff984828501611e96565b60608301525060e082013567ffffffffffffffff81111561201d5761201c611c1f565b5b61202984828501611e96565b60808301525092915050565b5f6020828403121561204a576120496113ff565b5b5f82013567ffffffffffffffff81111561206757612066611403565b5b61207384828501611f3b565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806120c057607f821691505b6020821081036120d3576120d261207c565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026121627fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612127565b61216c8683612127565b95508019841693508086168417925050509392505050565b5f61219e612199612194846119fe565b61164b565b6119fe565b9050919050565b5f819050919050565b6121b783612184565b6121cb6121c3826121a5565b848454612133565b825550505050565b5f90565b6121df6121d3565b6121ea8184846121ae565b505050565b5b8181101561220d576122025f826121d7565b6001810190506121f0565b5050565b601f8211156122525761222381612106565b61222c84612118565b8101602085101561223b578190505b61224f61224785612118565b8301826121ef565b50505b505050565b5f82821c905092915050565b5f6122725f1984600802612257565b1980831691505092915050565b5f61228a8383612263565b9150826002028217905092915050565b6122a382611566565b67ffffffffffffffff8111156122bc576122bb611ba7565b5b6122c682546120a9565b6122d1828285612211565b5f60209050601f831160018114612302575f84156122f0578287015190505b6122fa858261227f565b865550612361565b601f19841661231086612106565b5f5b8281101561233757848901518255600182019150602085019450602081019050612312565b868310156123545784890151612350601f891682612263565b8355505b6001600288020188555050505b50505050505056fea2646970667358221220232ad425d6a3fa9ff7de7b59ca0cdff9b09b560e5493bdfd8320e53da80c045964736f6c634300081a0033", o = class o extends E {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.abi = l;
|
|
@@ -142,8 +142,8 @@ const R = "0x60a0604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
142
142
|
});
|
|
143
143
|
if (!c.length)
|
|
144
144
|
return !1;
|
|
145
|
-
for (let
|
|
146
|
-
if (!this.validateLogAgainstCriteria(e,
|
|
145
|
+
for (let s of c)
|
|
146
|
+
if (!await this.validateLogAgainstCriteria(e, s))
|
|
147
147
|
return !1;
|
|
148
148
|
return !0;
|
|
149
149
|
}
|
|
@@ -160,22 +160,22 @@ const R = "0x60a0604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
160
160
|
throw new v({ log: b, criteria: f, fieldValue: e });
|
|
161
161
|
switch (f.filterType) {
|
|
162
162
|
case n.EQUAL:
|
|
163
|
-
return f.fieldType ===
|
|
163
|
+
return f.fieldType === i.ADDRESS ? S(
|
|
164
164
|
f.filterData,
|
|
165
165
|
`0x${e.slice(-40)}`
|
|
166
166
|
) : e === f.filterData;
|
|
167
167
|
case n.NOT_EQUAL:
|
|
168
168
|
return e !== f.filterData;
|
|
169
169
|
case n.GREATER_THAN:
|
|
170
|
-
if (f.fieldType ===
|
|
170
|
+
if (f.fieldType === i.UINT)
|
|
171
171
|
return BigInt(e) > BigInt(f.filterData);
|
|
172
172
|
throw new u({ log: b, criteria: f, fieldValue: e });
|
|
173
173
|
case n.LESS_THAN:
|
|
174
|
-
if (f.fieldType ===
|
|
174
|
+
if (f.fieldType === i.UINT)
|
|
175
175
|
return BigInt(e) < BigInt(f.filterData);
|
|
176
176
|
throw new u({ log: b, criteria: f, fieldValue: e });
|
|
177
177
|
case n.CONTAINS:
|
|
178
|
-
if (f.fieldType ===
|
|
178
|
+
if (f.fieldType === i.BYTES || f.fieldType === i.STRING)
|
|
179
179
|
return e.includes(f.filterData);
|
|
180
180
|
throw new I({ log: b, criteria: f, fieldValue: e });
|
|
181
181
|
default:
|
|
@@ -197,12 +197,12 @@ const R = "0x60a0604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
197
197
|
);
|
|
198
198
|
let a;
|
|
199
199
|
if (B(e)) {
|
|
200
|
-
let d = e.actionSteps.filter((
|
|
200
|
+
let d = e.actionSteps.filter((s) => !!s);
|
|
201
201
|
if (d.length === 0)
|
|
202
202
|
throw new N();
|
|
203
203
|
if (d.length > 4)
|
|
204
204
|
throw new D();
|
|
205
|
-
let c = Array.from({ length: 4 }, (
|
|
205
|
+
let c = Array.from({ length: 4 }, (s, r) => d.at(r) || d.slice(0, r).at(-1));
|
|
206
206
|
a = {
|
|
207
207
|
actionClaimant: e.actionClaimant,
|
|
208
208
|
actionStepOne: c.at(0),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventAction.js","sources":["../../src/Actions/EventAction.ts"],"sourcesContent":["import {\n eventActionAbi,\n readEventActionGetActionClaimant,\n readEventActionGetActionSteps,\n simulateEventActionExecute,\n writeEventActionExecute,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/actions/EventAction.sol/EventAction.json';\nimport events from '@boostxyz/signatures/events';\nimport {\n type Abi,\n type AbiEvent,\n type Address,\n type ContractEventName,\n type Hex,\n type Log,\n isAddressEqual,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n FieldValueNotComparableError,\n FieldValueUndefinedError,\n InvalidNumericalCriteriaError,\n NoEventActionStepsProvidedError,\n TooManyEventActionStepsProvidedError,\n UnrecognizedFilterTypeError,\n} from '../errors';\nimport {\n type ActionClaimant,\n type ActionStep,\n type Criteria,\n type EventActionPayload,\n type EventActionPayloadRaw,\n FilterType,\n type GetLogsParams,\n PrimitiveType,\n type ReadParams,\n RegistryType,\n type WriteParams,\n dedupeActionSteps,\n isEventActionPayloadSimple,\n prepareEventActionPayload,\n} from '../utils';\n\nexport type { EventActionPayload };\n\n/**\n * A generic event action\n *\n * @export\n * @class EventAction\n * @typedef {EventAction}\n * @extends {DeployableTarget<EventActionPayload>}\n */\nexport class EventAction extends DeployableTarget<\n EventActionPayload,\n typeof eventActionAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = eventActionAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env.VITE_EVENT_ACTION_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ACTION;\n\n /**\n * Gets a specific action event by index\n *\n * @public\n * @async\n * @param {number} index The index of the action event to retrieve\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStep'>} [params]\n * @returns {Promise<ActionStep>}\n */\n public async getActionStep(\n index: number,\n params?: ReadParams<typeof eventActionAbi, 'getActionStep'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.at(index);\n }\n\n /**\n * Gets all action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'>} [params]\n * @returns {Promise<ActionStep[]>}\n */\n public async getActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'>,\n ) {\n const steps = (await readEventActionGetActionSteps(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n })) as ActionStep[];\n return dedupeActionSteps(steps);\n }\n\n /**\n * Gets the count of action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStepsCount'>} [params]\n * @returns {Promise<bigint>}\n */\n public async getActionStepsCount(\n params?: ReadParams<typeof eventActionAbi, 'getActionStepsCount'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.length;\n }\n\n /**\n * Retrieves the payload describing how claimants can be identified from logs or function calls.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionClaimant'>} [params]\n * @returns {Promise<ActionClaimant>}\n */\n public async getActionClaimant(\n params?: ReadParams<typeof eventActionAbi, 'getActionClaimant'>,\n ) {\n return readEventActionGetActionClaimant(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<ActionClaimant>;\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {Promise<readonly [boolean, `0x${string}`]>}\n */\n public async execute(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n return this.awaitResult(this.executeRaw(data, params));\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {unknown}\n */\n public async executeRaw(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n const { request, result } = await simulateEventActionExecute(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n args: [data],\n });\n const hash = await writeEventActionExecute(this._config, request);\n return { hash, result };\n }\n\n /**\n * Retrieves action steps, and uses them to validate against, and optionally fetch logs that match the step's signature.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n * GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async validateActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const actionSteps = await this.getActionSteps(params);\n for (const actionStep of actionSteps) {\n if (!(await this.isActionStepValid(actionStep, params))) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a single action step with a given criteria against logs.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {ActionStep} actionStep\n * @param {?GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async isActionStepValid(\n actionStep: ActionStep,\n params?: GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const criteria = actionStep.actionParameter;\n const signature = actionStep.signature;\n let event: AbiEvent;\n // Lookup ABI based on event signature\n if (params?.knownEvents) {\n event = params.knownEvents[signature] as AbiEvent;\n } else {\n event = (events.abi as Record<Hex, AbiEvent>)[signature] as AbiEvent;\n }\n if (!event) {\n throw new Error(`No known ABI for given event signature: ${signature}`);\n }\n const targetContract = actionStep.targetContract;\n // Get all logs matching the event signature from the target contract\n const logs =\n params?.logs ||\n (await getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n ...(params as any),\n address: targetContract,\n event,\n }));\n if (!logs.length) return false;\n for (let log of logs) {\n if (!this.validateLogAgainstCriteria(criteria, log)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a {@link Log} against a given criteria.\n *\n * @param {Criteria} criteria - The criteria to validate against.\n * @param {Log} log - The Viem event log.\n * @returns {Promise<boolean>} - Returns true if the log passes the criteria, false otherwise.\n */\n public async validateLogAgainstCriteria(criteria: Criteria, log: Log) {\n const fieldValue = log.topics.at(criteria.fieldIndex);\n if (fieldValue === undefined) {\n throw new FieldValueUndefinedError({ log, criteria, fieldValue });\n }\n // Type narrow based on criteria.filterType\n switch (criteria.filterType) {\n case FilterType.EQUAL:\n if (criteria.fieldType === PrimitiveType.ADDRESS) {\n return isAddressEqual(\n criteria.filterData,\n `0x${fieldValue.slice(-40)}`,\n );\n }\n return fieldValue === criteria.filterData;\n\n case FilterType.NOT_EQUAL:\n return fieldValue !== criteria.filterData;\n\n case FilterType.GREATER_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) > BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.LESS_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) < BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.CONTAINS:\n if (\n criteria.fieldType === PrimitiveType.BYTES ||\n criteria.fieldType === PrimitiveType.STRING\n ) {\n return fieldValue.includes(criteria.filterData);\n }\n throw new FieldValueNotComparableError({ log, criteria, fieldValue });\n\n default:\n throw new UnrecognizedFilterTypeError({ log, criteria, fieldValue });\n }\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?EventActionPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: EventActionPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n let rawPayload: EventActionPayloadRaw;\n if (isEventActionPayloadSimple(payload)) {\n // filter out any falsy potential values\n let tmpSteps = payload.actionSteps.filter((step) => !!step);\n if (tmpSteps.length === 0) {\n throw new NoEventActionStepsProvidedError();\n }\n if (tmpSteps.length > 4) {\n throw new TooManyEventActionStepsProvidedError();\n }\n let steps: ActionStep[] = Array.from({ length: 4 }, (_, i) => {\n // use either the provided step at the given index, or reuse the previous step\n // should aways exist\n return tmpSteps.at(i)! || tmpSteps.slice(0, i).at(-1)!;\n });\n rawPayload = {\n actionClaimant: payload.actionClaimant,\n actionStepOne: steps.at(0)!,\n actionStepTwo: steps.at(1)!,\n actionStepThree: steps.at(2)!,\n actionStepFour: steps.at(3)!,\n };\n } else {\n rawPayload = payload;\n }\n return {\n abi: eventActionAbi,\n bytecode: bytecode as Hex,\n args: [prepareEventActionPayload(rawPayload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["_EventAction","DeployableTarget","eventActionAbi","index","params","steps","readEventActionGetActionSteps","dedupeActionSteps","readEventActionGetActionClaimant","data","request","result","simulateEventActionExecute","writeEventActionExecute","actionSteps","actionStep","criteria","signature","event","events","targetContract","logs","getLogs","log","fieldValue","FieldValueUndefinedError","FilterType","PrimitiveType","isAddressEqual","InvalidNumericalCriteriaError","FieldValueNotComparableError","UnrecognizedFilterTypeError","_payload","_options","payload","options","rawPayload","isEventActionPayloadSimple","tmpSteps","step","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","_","i","bytecode","prepareEventActionPayload","RegistryType","EventAction"],"mappings":";;;;;;;8tkBA2DaA,IAAN,MAAMA,UAAoBC,EAG/B;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAWL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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,CAACA,CAAI;AACtD,UAAAD,EAAS,WAAW;AACtB,cAAM,IAAIE,EAAgC;AAExC,UAAAF,EAAS,SAAS;AACpB,cAAM,IAAIG,EAAqC;AAE7C,UAAApC,IAAsB,MAAM,KAAK,EAAE,QAAQ,EAAE,GAAG,CAACqC,GAAGC,MAG/CL,EAAS,GAAGK,CAAC,KAAML,EAAS,MAAM,GAAGK,CAAC,EAAE,GAAG,EAAE,CACrD;AACY,MAAAP,IAAA;AAAA,QACX,gBAAgBF,EAAQ;AAAA,QACxB,eAAe7B,EAAM,GAAG,CAAC;AAAA,QACzB,eAAeA,EAAM,GAAG,CAAC;AAAA,QACzB,iBAAiBA,EAAM,GAAG,CAAC;AAAA,QAC3B,gBAAgBA,EAAM,GAAG,CAAC;AAAA,MAAA;AAAA,IAC5B;AAEa,MAAA+B,IAAAF;AAER,WAAA;AAAA,MACL,KAAKhC;AAAAA,MACL,UAAA0C;AAAA,MACA,MAAM,CAACC,EAA0BT,CAAU,CAAC;AAAA,MAC5C,GAAG,KAAK,wBAAwBD,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;AA7SyBnC,EAAA,OAAgB,8CAQvCA,EAAuB,eAA6B8C,EAAa;AA3B5D,IAAMC,IAAN/C;"}
|
|
1
|
+
{"version":3,"file":"EventAction.js","sources":["../../src/Actions/EventAction.ts"],"sourcesContent":["import {\n eventActionAbi,\n readEventActionGetActionClaimant,\n readEventActionGetActionSteps,\n simulateEventActionExecute,\n writeEventActionExecute,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/actions/EventAction.sol/EventAction.json';\nimport events from '@boostxyz/signatures/events';\nimport {\n type Abi,\n type AbiEvent,\n type Address,\n type ContractEventName,\n type Hex,\n type Log,\n isAddressEqual,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n FieldValueNotComparableError,\n FieldValueUndefinedError,\n InvalidNumericalCriteriaError,\n NoEventActionStepsProvidedError,\n TooManyEventActionStepsProvidedError,\n UnrecognizedFilterTypeError,\n} from '../errors';\nimport {\n type ActionClaimant,\n type ActionStep,\n type Criteria,\n type EventActionPayload,\n type EventActionPayloadRaw,\n FilterType,\n type GetLogsParams,\n PrimitiveType,\n type ReadParams,\n RegistryType,\n type WriteParams,\n dedupeActionSteps,\n isEventActionPayloadSimple,\n prepareEventActionPayload,\n} from '../utils';\nimport type { SignatureType } from './../utils';\n\nexport type {\n EventActionPayload,\n ActionStep,\n ActionClaimant,\n SignatureType,\n FilterType,\n PrimitiveType,\n};\n\n/**\n * A generic event action\n *\n * @export\n * @class EventAction\n * @typedef {EventAction}\n * @extends {DeployableTarget<EventActionPayload>}\n */\nexport class EventAction extends DeployableTarget<\n EventActionPayload,\n typeof eventActionAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = eventActionAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env.VITE_EVENT_ACTION_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ACTION;\n\n /**\n * Gets a specific action event by index\n *\n * @public\n * @async\n * @param {number} index The index of the action event to retrieve\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStep'>} [params]\n * @returns {Promise<ActionStep>}\n */\n public async getActionStep(\n index: number,\n params?: ReadParams<typeof eventActionAbi, 'getActionStep'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.at(index);\n }\n\n /**\n * Gets all action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'>} [params]\n * @returns {Promise<ActionStep[]>}\n */\n public async getActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'>,\n ) {\n const steps = (await readEventActionGetActionSteps(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n })) as ActionStep[];\n return dedupeActionSteps(steps);\n }\n\n /**\n * Gets the count of action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStepsCount'>} [params]\n * @returns {Promise<bigint>}\n */\n public async getActionStepsCount(\n params?: ReadParams<typeof eventActionAbi, 'getActionStepsCount'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.length;\n }\n\n /**\n * Retrieves the payload describing how claimants can be identified from logs or function calls.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionClaimant'>} [params]\n * @returns {Promise<ActionClaimant>}\n */\n public async getActionClaimant(\n params?: ReadParams<typeof eventActionAbi, 'getActionClaimant'>,\n ) {\n return readEventActionGetActionClaimant(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<ActionClaimant>;\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {Promise<readonly [boolean, `0x${string}`]>}\n */\n public async execute(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n return this.awaitResult(this.executeRaw(data, params));\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {unknown}\n */\n public async executeRaw(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n const { request, result } = await simulateEventActionExecute(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n args: [data],\n });\n const hash = await writeEventActionExecute(this._config, request);\n return { hash, result };\n }\n\n /**\n * Retrieves action steps, and uses them to validate against, and optionally fetch logs that match the step's signature.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n * GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async validateActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const actionSteps = await this.getActionSteps(params);\n for (const actionStep of actionSteps) {\n if (!(await this.isActionStepValid(actionStep, params))) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a single action step with a given criteria against logs.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {ActionStep} actionStep\n * @param {?GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async isActionStepValid(\n actionStep: ActionStep,\n params?: GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const criteria = actionStep.actionParameter;\n const signature = actionStep.signature;\n let event: AbiEvent;\n // Lookup ABI based on event signature\n if (params?.knownEvents) {\n event = params.knownEvents[signature] as AbiEvent;\n } else {\n event = (events.abi as Record<Hex, AbiEvent>)[signature] as AbiEvent;\n }\n if (!event) {\n throw new Error(`No known ABI for given event signature: ${signature}`);\n }\n const targetContract = actionStep.targetContract;\n // Get all logs matching the event signature from the target contract\n const logs =\n params?.logs ||\n (await getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n ...(params as any),\n address: targetContract,\n event,\n }));\n if (!logs.length) return false;\n for (let log of logs) {\n if (!(await this.validateLogAgainstCriteria(criteria, log))) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a {@link Log} against a given criteria.\n *\n * @param {Criteria} criteria - The criteria to validate against.\n * @param {Log} log - The Viem event log.\n * @returns {Promise<boolean>} - Returns true if the log passes the criteria, false otherwise.\n */\n public async validateLogAgainstCriteria(criteria: Criteria, log: Log) {\n const fieldValue = log.topics.at(criteria.fieldIndex);\n if (fieldValue === undefined) {\n throw new FieldValueUndefinedError({ log, criteria, fieldValue });\n }\n // Type narrow based on criteria.filterType\n switch (criteria.filterType) {\n case FilterType.EQUAL:\n if (criteria.fieldType === PrimitiveType.ADDRESS) {\n return isAddressEqual(\n criteria.filterData,\n `0x${fieldValue.slice(-40)}`,\n );\n }\n return fieldValue === criteria.filterData;\n\n case FilterType.NOT_EQUAL:\n return fieldValue !== criteria.filterData;\n\n case FilterType.GREATER_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) > BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.LESS_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) < BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.CONTAINS:\n if (\n criteria.fieldType === PrimitiveType.BYTES ||\n criteria.fieldType === PrimitiveType.STRING\n ) {\n return fieldValue.includes(criteria.filterData);\n }\n throw new FieldValueNotComparableError({ log, criteria, fieldValue });\n\n default:\n throw new UnrecognizedFilterTypeError({ log, criteria, fieldValue });\n }\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?EventActionPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: EventActionPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n let rawPayload: EventActionPayloadRaw;\n if (isEventActionPayloadSimple(payload)) {\n // filter out any falsy potential values\n let tmpSteps = payload.actionSteps.filter((step) => !!step);\n if (tmpSteps.length === 0) {\n throw new NoEventActionStepsProvidedError();\n }\n if (tmpSteps.length > 4) {\n throw new TooManyEventActionStepsProvidedError();\n }\n let steps: ActionStep[] = Array.from({ length: 4 }, (_, i) => {\n // use either the provided step at the given index, or reuse the previous step\n // should aways exist\n return tmpSteps.at(i)! || tmpSteps.slice(0, i).at(-1)!;\n });\n rawPayload = {\n actionClaimant: payload.actionClaimant,\n actionStepOne: steps.at(0)!,\n actionStepTwo: steps.at(1)!,\n actionStepThree: steps.at(2)!,\n actionStepFour: steps.at(3)!,\n };\n } else {\n rawPayload = payload;\n }\n return {\n abi: eventActionAbi,\n bytecode: bytecode as Hex,\n args: [prepareEventActionPayload(rawPayload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["_EventAction","DeployableTarget","eventActionAbi","index","params","steps","readEventActionGetActionSteps","dedupeActionSteps","readEventActionGetActionClaimant","data","request","result","simulateEventActionExecute","writeEventActionExecute","actionSteps","actionStep","criteria","signature","event","events","targetContract","logs","getLogs","log","fieldValue","FieldValueUndefinedError","FilterType","PrimitiveType","isAddressEqual","InvalidNumericalCriteriaError","FieldValueNotComparableError","UnrecognizedFilterTypeError","_payload","_options","payload","options","rawPayload","isEventActionPayloadSimple","tmpSteps","step","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","_","i","bytecode","prepareEventActionPayload","RegistryType","EventAction"],"mappings":";;;;;;;8tkBAmEaA,IAAN,MAAMA,UAAoBC,EAG/B;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAWL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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C,CAACA,CAAI;AACtD,UAAAD,EAAS,WAAW;AACtB,cAAM,IAAIE,EAAgC;AAExC,UAAAF,EAAS,SAAS;AACpB,cAAM,IAAIG,EAAqC;AAE7C,UAAApC,IAAsB,MAAM,KAAK,EAAE,QAAQ,EAAE,GAAG,CAACqC,GAAGC,MAG/CL,EAAS,GAAGK,CAAC,KAAML,EAAS,MAAM,GAAGK,CAAC,EAAE,GAAG,EAAE,CACrD;AACY,MAAAP,IAAA;AAAA,QACX,gBAAgBF,EAAQ;AAAA,QACxB,eAAe7B,EAAM,GAAG,CAAC;AAAA,QACzB,eAAeA,EAAM,GAAG,CAAC;AAAA,QACzB,iBAAiBA,EAAM,GAAG,CAAC;AAAA,QAC3B,gBAAgBA,EAAM,GAAG,CAAC;AAAA,MAAA;AAAA,IAC5B;AAEa,MAAA+B,IAAAF;AAER,WAAA;AAAA,MACL,KAAKhC;AAAAA,MACL,UAAA0C;AAAA,MACA,MAAM,CAACC,EAA0BT,CAAU,CAAC;AAAA,MAC5C,GAAG,KAAK,wBAAwBD,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;AA7SyBnC,EAAA,OAAgB,8CAQvCA,EAAuB,eAA6B8C,EAAa;AA3B5D,IAAMC,IAAN/C;"}
|
|
@@ -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-BzszviNp.cjs"),r=require("../componentInterfaces-CKCBwG16.cjs"),m=require("@wagmi/core"),a=require("../errors.cjs"),l=require("./SimpleAllowList.cjs"),s=require("./SimpleDenyList.cjs"),e={[r.ASimpleAllowList]:l.SimpleAllowList,[r.ASimpleDenyList]:s.SimpleDenyList};async function p(t,n){const o=await m.readContract(t.config,{abi:c.oe,functionName:"getComponentInterface",address:n}),i=e[o];if(!i)throw new a.InvalidComponentInterfaceError(Object.keys(e),o);return new i(t,n)}exports.SimpleAllowList=l.SimpleAllowList;exports.SimpleDenyList=s.SimpleDenyList;exports.AllowListByComponentInterface=e;exports.allowListFromAddress=p;
|
|
2
2
|
//# sourceMappingURL=AllowList.cjs.map
|
|
@@ -16,7 +16,7 @@ export type AllowList = SimpleAllowList | SimpleDenyList;
|
|
|
16
16
|
* @type {{ "0x2bc9016b": SimpleAllowList; "0x9d585f63": SimpleDenyList; }}
|
|
17
17
|
*/
|
|
18
18
|
export declare const AllowListByComponentInterface: {
|
|
19
|
-
[x: string]: typeof
|
|
19
|
+
[x: string]: typeof SimpleAllowList | typeof SimpleDenyList;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.
|
|
@@ -28,5 +28,5 @@ export declare const AllowListByComponentInterface: {
|
|
|
28
28
|
* @returns {Promise<SimpleAllowList | SimpleDenyList>}
|
|
29
29
|
* @throws {@link InvalidComponentInterfaceError}
|
|
30
30
|
*/
|
|
31
|
-
export declare function allowListFromAddress(options: DeployableOptions, address: Address): Promise<
|
|
31
|
+
export declare function allowListFromAddress(options: DeployableOptions, address: Address): Promise<SimpleAllowList | SimpleDenyList>;
|
|
32
32
|
//# sourceMappingURL=AllowList.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as i } from "../generated-
|
|
1
|
+
import { o as i } from "../generated-Cbv8zFkf.js";
|
|
2
2
|
import { a as m, b as a } from "../componentInterfaces-DYkaxBda.js";
|
|
3
3
|
import { readContract as f } from "@wagmi/core";
|
|
4
4
|
import { InvalidComponentInterfaceError as c } from "../errors.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../generated-Cd-Fe7W7.cjs"),n=require("@wagmi/core"),o=require("viem"),l=require("../Deployable/DeployableTarget.cjs"),h=require("../errors.cjs"),i=require("../utils.cjs"),u="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61140e806100bd5f395ff3fe608060405260043610610113575f3560e01c80634a4ee7b11161009f57806398332bbc1161006357806398332bbc1461031d578063e3f756de14610347578063f04e283e14610383578063f2fde38b1461039f578063fee81cf4146103bb57610113565b80634a4ee7b114610287578063514e62fc146102a357806354d1f13d146102df578063715018a6146102e95780638da5cb5b146102f357610113565b806325692962116100e657806325692962146101c757806328d6183b146101d15780632de94807146101fb5780633abb060414610237578063439fab911461025f57610113565b806301ffc9a714610117578063183a4f6e146101535780631c10893f1461016f5780631cd64df41461018b575b5f80fd5b348015610122575f80fd5b5061013d60048036038101906101389190610d51565b6103f7565b60405161014a9190610d96565b60405180910390f35b61016d60048036038101906101689190610de2565b610470565b005b61018960048036038101906101849190610e67565b61047d565b005b348015610196575f80fd5b506101b160048036038101906101ac9190610e67565b610493565b6040516101be9190610d96565b60405180910390f35b6101cf6104a9565b005b3480156101dc575f80fd5b506101e56104fa565b6040516101f29190610eb4565b60405180910390f35b348015610206575f80fd5b50610221600480360381019061021c9190610ecd565b610521565b60405161022e9190610f07565b60405180910390f35b348015610242575f80fd5b5061025d60048036038101906102589190610fd6565b61053a565b005b34801561026a575f80fd5b50610285600480360381019061028091906110a9565b610647565b005b6102a1600480360381019061029c9190610e67565b61076f565b005b3480156102ae575f80fd5b506102c960048036038101906102c49190610e67565b610785565b6040516102d69190610d96565b60405180910390f35b6102e761079c565b005b6102f16107d5565b005b3480156102fe575f80fd5b506103076107e8565b6040516103149190611103565b60405180910390f35b348015610328575f80fd5b50610331610810565b60405161033e9190610f07565b60405180910390f35b348015610352575f80fd5b5061036d6004803603810190610368919061111c565b610815565b60405161037a9190610d96565b60405180910390f35b61039d60048036038101906103989190610ecd565b610868565b005b6103b960048036038101906103b49190610ecd565b6108a6565b005b3480156103c6575f80fd5b506103e160048036038101906103dc9190610ecd565b6108cf565b6040516103ee9190610f07565b60405180910390f35b5f7f8ba1fc24000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806104695750610468826108e8565b5b9050919050565b61047a3382610961565b50565b610485610970565b61048f82826109a7565b5050565b5f818261049f85610521565b1614905092915050565b5f6104b26109b7565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f8ba1fc2400000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b6002610545816109c1565b828290508585905014610584576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561063f578383828181106105a4576105a3611179565b5b90506020020160208101906105b991906111d0565b5f808888858181106105ce576105cd611179565b5b90506020020160208101906105e39190610ecd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050610586565b505050505050565b5f6106506109e8565b905080546003825580156106825760018160011c14303b106106795763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f808484810190610694919061137e565b915091506106a182610a11565b6106ac8260026109a7565b5f5b81518110156107325760015f808484815181106106ce576106cd611179565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506106ae565b505050801561076a576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b610777610970565b6107818282610961565b5050565b5f808261079185610521565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b6107dd610970565b6107e65f610ae7565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b600281565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1690509392505050565b610870610970565b63389a75e1600c52805f526020600c20805442111561089657636f5e88185f526004601cfd5b5f8155506108a381610ae7565b50565b6108ae610970565b8060601b6108c357637448fbae5f526004601cfd5b6108cc81610ae7565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fe2089f79000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061095a575061095982610bad565b5b9050919050565b61096c82825f610c26565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146109a5576382b429005f526004601cfd5b565b6109b382826001610c26565b5050565b5f6202a300905090565b638b78c6d8600c52335f52806020600c2054166109e5576382b429005f526004601cfd5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610a19610c7e565b15610a91577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415610a5357630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350610ae4565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b610aef610c7e565b15610b54577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610baa565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610c1f5750610c1e82610c82565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783610c4857848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610d3081610cfc565b8114610d3a575f80fd5b50565b5f81359050610d4b81610d27565b92915050565b5f60208284031215610d6657610d65610cf4565b5b5f610d7384828501610d3d565b91505092915050565b5f8115159050919050565b610d9081610d7c565b82525050565b5f602082019050610da95f830184610d87565b92915050565b5f819050919050565b610dc181610daf565b8114610dcb575f80fd5b50565b5f81359050610ddc81610db8565b92915050565b5f60208284031215610df757610df6610cf4565b5b5f610e0484828501610dce565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610e3682610e0d565b9050919050565b610e4681610e2c565b8114610e50575f80fd5b50565b5f81359050610e6181610e3d565b92915050565b5f8060408385031215610e7d57610e7c610cf4565b5b5f610e8a85828601610e53565b9250506020610e9b85828601610dce565b9150509250929050565b610eae81610cfc565b82525050565b5f602082019050610ec75f830184610ea5565b92915050565b5f60208284031215610ee257610ee1610cf4565b5b5f610eef84828501610e53565b91505092915050565b610f0181610daf565b82525050565b5f602082019050610f1a5f830184610ef8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112610f4157610f40610f20565b5b8235905067ffffffffffffffff811115610f5e57610f5d610f24565b5b602083019150836020820283011115610f7a57610f79610f28565b5b9250929050565b5f8083601f840112610f9657610f95610f20565b5b8235905067ffffffffffffffff811115610fb357610fb2610f24565b5b602083019150836020820283011115610fcf57610fce610f28565b5b9250929050565b5f805f8060408587031215610fee57610fed610cf4565b5b5f85013567ffffffffffffffff81111561100b5761100a610cf8565b5b61101787828801610f2c565b9450945050602085013567ffffffffffffffff81111561103a57611039610cf8565b5b61104687828801610f81565b925092505092959194509250565b5f8083601f84011261106957611068610f20565b5b8235905067ffffffffffffffff81111561108657611085610f24565b5b6020830191508360018202830111156110a2576110a1610f28565b5b9250929050565b5f80602083850312156110bf576110be610cf4565b5b5f83013567ffffffffffffffff8111156110dc576110db610cf8565b5b6110e885828601611054565b92509250509250929050565b6110fd81610e2c565b82525050565b5f6020820190506111165f8301846110f4565b92915050565b5f805f6040848603121561113357611132610cf4565b5b5f61114086828701610e53565b935050602084013567ffffffffffffffff81111561116157611160610cf8565b5b61116d86828701611054565b92509250509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6111af81610d7c565b81146111b9575f80fd5b50565b5f813590506111ca816111a6565b92915050565b5f602082840312156111e5576111e4610cf4565b5b5f6111f2848285016111bc565b91505092915050565b5f61120582610e0d565b9050919050565b611215816111fb565b811461121f575f80fd5b50565b5f813590506112308161120c565b92915050565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61127c82611236565b810181811067ffffffffffffffff8211171561129b5761129a611246565b5b80604052505050565b5f6112ad610ceb565b90506112b98282611273565b919050565b5f67ffffffffffffffff8211156112d8576112d7611246565b5b602082029050602081019050919050565b5f6112fb6112f6846112be565b6112a4565b9050808382526020820190506020840283018581111561131e5761131d610f28565b5b835b8181101561134757806113338882610e53565b845260208401935050602081019050611320565b5050509392505050565b5f82601f83011261136557611364610f20565b5b81356113758482602086016112e9565b91505092915050565b5f806040838503121561139457611393610cf4565b5b5f6113a185828601611222565b925050602083013567ffffffffffffffff8111156113c2576113c1610cf8565b5b6113ce85828601611351565b915050925092905056fea264697066735822122094368c65f566939d0b9827de55e44a26c567f89bc0bf24103275890d9278dc0164736f6c634300081a0033",A=2n,s=class s extends l.DeployableTarget{constructor(){super(...arguments),this.abi=c.T}async isAllowed(b,e){return await c.JN(this._config,{address:this.assertValidAddress(),args:[b,o.zeroHash],...this.optionallyAttachAccount(),...e})}async setAllowed(b,e,f){return this.awaitResult(this.setAllowedRaw(b,e,f))}async setAllowedRaw(b,e,f){const{request:a,result:d}=await c.Ah(this._config,{address:this.assertValidAddress(),args:[b,e],...this.optionallyAttachAccount(),...f});return{hash:await c.lh(this._config,a),result:d}}async grantRoles(b,e,f){return this.awaitResult(this.grantRolesRaw(b,e,f))}async grantRolesRaw(b,e,f){const{request:a,result:d}=await c.bh(this._config,{address:this.assertValidAddress(),args:[b,e],...this.optionallyAttachAccount(),...f});return{hash:await c.ih(this._config,a),result:d}}buildParameters(b,e){var d;const[f,a]=this.validateDeploymentConfig(b,e);if(!f.owner||f.owner===o.zeroAddress){const t=a.account?a.account.address:a.config?n.getAccount(a.config).address:(d=this._account)==null?void 0:d.address;if(t)f.owner=t;else throw new h.DeployableUnknownOwnerProvidedError}return{abi:c.T,bytecode:u,args:[i.prepareSimpleAllowListPayload(f)],...this.optionallyAttachAccount(a.account)}}};s.base="0x11556926AaA421e96e06a7A679C680813122db7D",s.registryType=i.RegistryType.ALLOW_LIST;let r=s;exports.simpleAllowListAbi=c.T;exports.LIST_MANAGER_ROLE=A;exports.SimpleAllowList=r;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../generated-BzszviNp.cjs"),n=require("@wagmi/core"),o=require("viem"),l=require("../Deployable/DeployableTarget.cjs"),h=require("../errors.cjs"),i=require("../utils.cjs"),u="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61140e806100bd5f395ff3fe608060405260043610610113575f3560e01c80634a4ee7b11161009f57806398332bbc1161006357806398332bbc1461031d578063e3f756de14610347578063f04e283e14610383578063f2fde38b1461039f578063fee81cf4146103bb57610113565b80634a4ee7b114610287578063514e62fc146102a357806354d1f13d146102df578063715018a6146102e95780638da5cb5b146102f357610113565b806325692962116100e657806325692962146101c757806328d6183b146101d15780632de94807146101fb5780633abb060414610237578063439fab911461025f57610113565b806301ffc9a714610117578063183a4f6e146101535780631c10893f1461016f5780631cd64df41461018b575b5f80fd5b348015610122575f80fd5b5061013d60048036038101906101389190610d51565b6103f7565b60405161014a9190610d96565b60405180910390f35b61016d60048036038101906101689190610de2565b610470565b005b61018960048036038101906101849190610e67565b61047d565b005b348015610196575f80fd5b506101b160048036038101906101ac9190610e67565b610493565b6040516101be9190610d96565b60405180910390f35b6101cf6104a9565b005b3480156101dc575f80fd5b506101e56104fa565b6040516101f29190610eb4565b60405180910390f35b348015610206575f80fd5b50610221600480360381019061021c9190610ecd565b610521565b60405161022e9190610f07565b60405180910390f35b348015610242575f80fd5b5061025d60048036038101906102589190610fd6565b61053a565b005b34801561026a575f80fd5b50610285600480360381019061028091906110a9565b610647565b005b6102a1600480360381019061029c9190610e67565b61076f565b005b3480156102ae575f80fd5b506102c960048036038101906102c49190610e67565b610785565b6040516102d69190610d96565b60405180910390f35b6102e761079c565b005b6102f16107d5565b005b3480156102fe575f80fd5b506103076107e8565b6040516103149190611103565b60405180910390f35b348015610328575f80fd5b50610331610810565b60405161033e9190610f07565b60405180910390f35b348015610352575f80fd5b5061036d6004803603810190610368919061111c565b610815565b60405161037a9190610d96565b60405180910390f35b61039d60048036038101906103989190610ecd565b610868565b005b6103b960048036038101906103b49190610ecd565b6108a6565b005b3480156103c6575f80fd5b506103e160048036038101906103dc9190610ecd565b6108cf565b6040516103ee9190610f07565b60405180910390f35b5f7f8ba1fc24000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806104695750610468826108e8565b5b9050919050565b61047a3382610961565b50565b610485610970565b61048f82826109a7565b5050565b5f818261049f85610521565b1614905092915050565b5f6104b26109b7565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f8ba1fc2400000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b6002610545816109c1565b828290508585905014610584576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561063f578383828181106105a4576105a3611179565b5b90506020020160208101906105b991906111d0565b5f808888858181106105ce576105cd611179565b5b90506020020160208101906105e39190610ecd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050610586565b505050505050565b5f6106506109e8565b905080546003825580156106825760018160011c14303b106106795763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f808484810190610694919061137e565b915091506106a182610a11565b6106ac8260026109a7565b5f5b81518110156107325760015f808484815181106106ce576106cd611179565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506106ae565b505050801561076a576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b610777610970565b6107818282610961565b5050565b5f808261079185610521565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b6107dd610970565b6107e65f610ae7565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b600281565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1690509392505050565b610870610970565b63389a75e1600c52805f526020600c20805442111561089657636f5e88185f526004601cfd5b5f8155506108a381610ae7565b50565b6108ae610970565b8060601b6108c357637448fbae5f526004601cfd5b6108cc81610ae7565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fe2089f79000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061095a575061095982610bad565b5b9050919050565b61096c82825f610c26565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146109a5576382b429005f526004601cfd5b565b6109b382826001610c26565b5050565b5f6202a300905090565b638b78c6d8600c52335f52806020600c2054166109e5576382b429005f526004601cfd5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610a19610c7e565b15610a91577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415610a5357630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350610ae4565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b610aef610c7e565b15610b54577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610baa565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610c1f5750610c1e82610c82565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783610c4857848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610d3081610cfc565b8114610d3a575f80fd5b50565b5f81359050610d4b81610d27565b92915050565b5f60208284031215610d6657610d65610cf4565b5b5f610d7384828501610d3d565b91505092915050565b5f8115159050919050565b610d9081610d7c565b82525050565b5f602082019050610da95f830184610d87565b92915050565b5f819050919050565b610dc181610daf565b8114610dcb575f80fd5b50565b5f81359050610ddc81610db8565b92915050565b5f60208284031215610df757610df6610cf4565b5b5f610e0484828501610dce565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610e3682610e0d565b9050919050565b610e4681610e2c565b8114610e50575f80fd5b50565b5f81359050610e6181610e3d565b92915050565b5f8060408385031215610e7d57610e7c610cf4565b5b5f610e8a85828601610e53565b9250506020610e9b85828601610dce565b9150509250929050565b610eae81610cfc565b82525050565b5f602082019050610ec75f830184610ea5565b92915050565b5f60208284031215610ee257610ee1610cf4565b5b5f610eef84828501610e53565b91505092915050565b610f0181610daf565b82525050565b5f602082019050610f1a5f830184610ef8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112610f4157610f40610f20565b5b8235905067ffffffffffffffff811115610f5e57610f5d610f24565b5b602083019150836020820283011115610f7a57610f79610f28565b5b9250929050565b5f8083601f840112610f9657610f95610f20565b5b8235905067ffffffffffffffff811115610fb357610fb2610f24565b5b602083019150836020820283011115610fcf57610fce610f28565b5b9250929050565b5f805f8060408587031215610fee57610fed610cf4565b5b5f85013567ffffffffffffffff81111561100b5761100a610cf8565b5b61101787828801610f2c565b9450945050602085013567ffffffffffffffff81111561103a57611039610cf8565b5b61104687828801610f81565b925092505092959194509250565b5f8083601f84011261106957611068610f20565b5b8235905067ffffffffffffffff81111561108657611085610f24565b5b6020830191508360018202830111156110a2576110a1610f28565b5b9250929050565b5f80602083850312156110bf576110be610cf4565b5b5f83013567ffffffffffffffff8111156110dc576110db610cf8565b5b6110e885828601611054565b92509250509250929050565b6110fd81610e2c565b82525050565b5f6020820190506111165f8301846110f4565b92915050565b5f805f6040848603121561113357611132610cf4565b5b5f61114086828701610e53565b935050602084013567ffffffffffffffff81111561116157611160610cf8565b5b61116d86828701611054565b92509250509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6111af81610d7c565b81146111b9575f80fd5b50565b5f813590506111ca816111a6565b92915050565b5f602082840312156111e5576111e4610cf4565b5b5f6111f2848285016111bc565b91505092915050565b5f61120582610e0d565b9050919050565b611215816111fb565b811461121f575f80fd5b50565b5f813590506112308161120c565b92915050565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61127c82611236565b810181811067ffffffffffffffff8211171561129b5761129a611246565b5b80604052505050565b5f6112ad610ceb565b90506112b98282611273565b919050565b5f67ffffffffffffffff8211156112d8576112d7611246565b5b602082029050602081019050919050565b5f6112fb6112f6846112be565b6112a4565b9050808382526020820190506020840283018581111561131e5761131d610f28565b5b835b8181101561134757806113338882610e53565b845260208401935050602081019050611320565b5050509392505050565b5f82601f83011261136557611364610f20565b5b81356113758482602086016112e9565b91505092915050565b5f806040838503121561139457611393610cf4565b5b5f6113a185828601611222565b925050602083013567ffffffffffffffff8111156113c2576113c1610cf8565b5b6113ce85828601611351565b915050925092905056fea264697066735822122094368c65f566939d0b9827de55e44a26c567f89bc0bf24103275890d9278dc0164736f6c634300081a0033",A=2n,s=class s extends l.DeployableTarget{constructor(){super(...arguments),this.abi=c.T}async isAllowed(b,e){return await c.JN(this._config,{address:this.assertValidAddress(),args:[b,o.zeroHash],...this.optionallyAttachAccount(),...e})}async setAllowed(b,e,f){return this.awaitResult(this.setAllowedRaw(b,e,f))}async setAllowedRaw(b,e,f){const{request:a,result:d}=await c.Ah(this._config,{address:this.assertValidAddress(),args:[b,e],...this.optionallyAttachAccount(),...f});return{hash:await c.lh(this._config,a),result:d}}async grantRoles(b,e,f){return this.awaitResult(this.grantRolesRaw(b,e,f))}async grantRolesRaw(b,e,f){const{request:a,result:d}=await c.bh(this._config,{address:this.assertValidAddress(),args:[b,e],...this.optionallyAttachAccount(),...f});return{hash:await c.ih(this._config,a),result:d}}buildParameters(b,e){var d;const[f,a]=this.validateDeploymentConfig(b,e);if(!f.owner||f.owner===o.zeroAddress){const t=a.account?a.account.address:a.config?n.getAccount(a.config).address:(d=this._account)==null?void 0:d.address;if(t)f.owner=t;else throw new h.DeployableUnknownOwnerProvidedError}return{abi:c.T,bytecode:u,args:[i.prepareSimpleAllowListPayload(f)],...this.optionallyAttachAccount(a.account)}}};s.base="0x11556926AaA421e96e06a7A679C680813122db7D",s.registryType=i.RegistryType.ALLOW_LIST;let r=s;exports.simpleAllowListAbi=c.T;exports.LIST_MANAGER_ROLE=A;exports.SimpleAllowList=r;
|
|
2
2
|
//# sourceMappingURL=SimpleAllowList.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleAllowList.cjs","sources":["../../src/AllowLists/SimpleAllowList.ts"],"sourcesContent":["import {\n readSimpleAllowListIsAllowed,\n simpleAllowListAbi,\n simulateSimpleAllowListGrantRoles,\n simulateSimpleAllowListSetAllowed,\n writeSimpleAllowListGrantRoles,\n writeSimpleAllowListSetAllowed,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleAllowList.sol/SimpleAllowList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type SimpleAllowListPayload,\n prepareSimpleAllowListPayload,\n} from '../utils';\n\nexport { simpleAllowListAbi };\nexport type { SimpleAllowListPayload };\n\n/**\n * A generic `viem.Log` event with support for `SimpleAllowList` event types.\n *\n * @export\n * @typedef {SimpleAllowListLog}\n * @template {ContractEventName<\n * typeof simpleAllowListAbi\n * >} [event=ContractEventName<typeof simpleAllowListAbi>]\n */\nexport type SimpleAllowListLog<\n event extends ContractEventName<\n typeof simpleAllowListAbi\n > = ContractEventName<typeof simpleAllowListAbi>,\n> = GenericLog<typeof simpleAllowListAbi, event>;\n\n/**\n * A constant representing the list manager's role\n *\n * @type {2n}\n */\nexport const LIST_MANAGER_ROLE = 2n;\n/**\n * A simple implementation of an AllowList that checks if a user is authorized based on a list of allowed addresses\n *\n * @export\n * @class SimpleAllowList\n * @typedef {SimpleAllowList}\n * @extends {DeployableTarget<SimpleAllowListPayload>}\n */\nexport class SimpleAllowList extends DeployableTarget<\n SimpleAllowListPayload,\n typeof simpleAllowListAbi\n> {\n public override readonly abi = simpleAllowListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_SIMPLE_ALLOWLIST_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Check if a user is authorized.\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ): Promise<boolean> {\n return await readSimpleAllowListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<void>}\n */\n public async setAllowed(\n addresses: Address[],\n allowed: boolean[],\n params?:
|
|
1
|
+
{"version":3,"file":"SimpleAllowList.cjs","sources":["../../src/AllowLists/SimpleAllowList.ts"],"sourcesContent":["import {\n readSimpleAllowListIsAllowed,\n simpleAllowListAbi,\n simulateSimpleAllowListGrantRoles,\n simulateSimpleAllowListSetAllowed,\n writeSimpleAllowListGrantRoles,\n writeSimpleAllowListSetAllowed,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleAllowList.sol/SimpleAllowList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type SimpleAllowListPayload,\n type WriteParams,\n prepareSimpleAllowListPayload,\n} from '../utils';\n\nexport { simpleAllowListAbi };\nexport type { SimpleAllowListPayload };\n\n/**\n * A generic `viem.Log` event with support for `SimpleAllowList` event types.\n *\n * @export\n * @typedef {SimpleAllowListLog}\n * @template {ContractEventName<\n * typeof simpleAllowListAbi\n * >} [event=ContractEventName<typeof simpleAllowListAbi>]\n */\nexport type SimpleAllowListLog<\n event extends ContractEventName<\n typeof simpleAllowListAbi\n > = ContractEventName<typeof simpleAllowListAbi>,\n> = GenericLog<typeof simpleAllowListAbi, event>;\n\n/**\n * A constant representing the list manager's role\n *\n * @type {2n}\n */\nexport const LIST_MANAGER_ROLE = 2n;\n/**\n * A simple implementation of an AllowList that checks if a user is authorized based on a list of allowed addresses\n *\n * @export\n * @class SimpleAllowList\n * @typedef {SimpleAllowList}\n * @extends {DeployableTarget<SimpleAllowListPayload>}\n */\nexport class SimpleAllowList extends DeployableTarget<\n SimpleAllowListPayload,\n typeof simpleAllowListAbi\n> {\n public override readonly abi = simpleAllowListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_SIMPLE_ALLOWLIST_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Check if a user is authorized.\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ): Promise<boolean> {\n return await readSimpleAllowListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<void>}\n */\n public async setAllowed(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ) {\n return this.awaitResult(this.setAllowedRaw(addresses, allowed, params));\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<void>}\n */\n public async setAllowedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: ReadParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ) {\n const { request, result } = await simulateSimpleAllowListSetAllowed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleAllowListSetAllowed(this._config, request);\n return { hash, result };\n }\n\n /**\n * Allows the owner to grant `user` `roles`.\n *\n * @public\n * @async\n * @param {Address} address\n * @param {bigint} role\n * @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]\n * @returns {Promise<void>}\n */\n public async grantRoles(\n address: Address,\n role: bigint,\n params?: WriteParams<typeof simpleAllowListAbi, 'grantRoles'>,\n ) {\n return this.awaitResult(this.grantRolesRaw(address, role, params));\n }\n\n /**\n * Allows the owner to grant `user` `roles`.\n *\n * @public\n * @async\n * @param {Address} address\n * @param {bigint} role\n * @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]\n * @returns {Promise<void>}\n */\n public async grantRolesRaw(\n address: Address,\n role: bigint,\n params?: ReadParams<typeof simpleAllowListAbi, 'grantRoles'>,\n ) {\n const { request, result } = await simulateSimpleAllowListGrantRoles(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [address, role],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleAllowListGrantRoles(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleAllowListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SimpleAllowListPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleAllowListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleAllowListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["LIST_MANAGER_ROLE","_SimpleAllowList","DeployableTarget","simpleAllowListAbi","address","params","readSimpleAllowListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleAllowListSetAllowed","writeSimpleAllowListSetAllowed","role","simulateSimpleAllowListGrantRoles","writeSimpleAllowListGrantRoles","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleAllowListPayload","RegistryType","SimpleAllowList"],"mappings":"0qVAuDaA,EAAoB,GASpBC,EAAN,MAAMA,UAAwBC,EAAAA,gBAGnC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA4B/B,MAAa,UACXC,EACAC,EACkB,CACX,OAAA,MAAMC,EAAAA,GAA6B,KAAK,QAAS,CACtD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACF,EAASG,UAAQ,EACxB,GAAG,KAAK,wBAAwB,EAEhC,GAAIF,CAAA,CACL,CACH,CAaA,MAAa,WACXG,EACAC,EACAJ,EACA,CACA,OAAO,KAAK,YAAY,KAAK,cAAcG,EAAWC,EAASJ,CAAM,CAAC,CACxE,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