@boostxyz/sdk 0.0.0-alpha.10 → 0.0.0-alpha.12

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.
Files changed (100) hide show
  1. package/dist/Actions/Action.js +2 -2
  2. package/dist/Actions/EventAction.cjs +1 -1
  3. package/dist/Actions/EventAction.cjs.map +1 -1
  4. package/dist/Actions/EventAction.d.ts +115 -31
  5. package/dist/Actions/EventAction.d.ts.map +1 -1
  6. package/dist/Actions/EventAction.js +306 -122
  7. package/dist/Actions/EventAction.js.map +1 -1
  8. package/dist/AllowLists/AllowList.cjs +1 -1
  9. package/dist/AllowLists/AllowList.cjs.map +1 -1
  10. package/dist/AllowLists/AllowList.d.ts +6 -4
  11. package/dist/AllowLists/AllowList.d.ts.map +1 -1
  12. package/dist/AllowLists/AllowList.js +45 -23
  13. package/dist/AllowLists/AllowList.js.map +1 -1
  14. package/dist/AllowLists/OpenAllowList.d.ts +240 -0
  15. package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
  16. package/dist/AllowLists/SimpleAllowList.js +1 -1
  17. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  18. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -1
  19. package/dist/AllowLists/SimpleDenyList.d.ts +2 -2
  20. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  21. package/dist/AllowLists/SimpleDenyList.js +9 -111
  22. package/dist/AllowLists/SimpleDenyList.js.map +1 -1
  23. package/dist/Auth/PassthroughAuth.js +1 -1
  24. package/dist/BoostCore.cjs +2 -2
  25. package/dist/BoostCore.cjs.map +1 -1
  26. package/dist/BoostCore.d.ts +14 -1
  27. package/dist/BoostCore.d.ts.map +1 -1
  28. package/dist/BoostCore.js +169 -151
  29. package/dist/BoostCore.js.map +1 -1
  30. package/dist/BoostRegistry.js +1 -1
  31. package/dist/Budgets/Budget.js +2 -2
  32. package/dist/Budgets/ManagedBudget.cjs +1 -1
  33. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  34. package/dist/Budgets/ManagedBudget.d.ts +29 -27
  35. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  36. package/dist/Budgets/ManagedBudget.js +78 -77
  37. package/dist/Budgets/ManagedBudget.js.map +1 -1
  38. package/dist/Budgets/SimpleBudget.d.ts +6 -6
  39. package/dist/Budgets/SimpleBudget.d.ts.map +1 -1
  40. package/dist/Budgets/VestingBudget.d.ts +6 -6
  41. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  42. package/dist/Deployable/DeployableTarget.cjs.map +1 -1
  43. package/dist/Deployable/DeployableTarget.d.ts +1 -1
  44. package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
  45. package/dist/Deployable/DeployableTarget.js +1 -1
  46. package/dist/Deployable/DeployableTarget.js.map +1 -1
  47. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  48. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  49. package/dist/Incentives/AllowListIncentive.js +2 -2
  50. package/dist/Incentives/CGDAIncentive.js +1 -1
  51. package/dist/Incentives/ERC20Incentive.js +1 -1
  52. package/dist/Incentives/ERC20VariableIncentive.d.ts +5 -5
  53. package/dist/Incentives/Incentive.cjs.map +1 -1
  54. package/dist/Incentives/Incentive.js +16 -16
  55. package/dist/Incentives/Incentive.js.map +1 -1
  56. package/dist/Incentives/PointsIncentive.js +1 -1
  57. package/dist/SimpleDenyList-CqT0BMP7.cjs +2 -0
  58. package/dist/SimpleDenyList-CqT0BMP7.cjs.map +1 -0
  59. package/dist/SimpleDenyList-IJ9Ipya7.js +112 -0
  60. package/dist/SimpleDenyList-IJ9Ipya7.js.map +1 -0
  61. package/dist/Validators/SignerValidator.js +1 -1
  62. package/dist/Validators/Validator.js +2 -2
  63. package/dist/{componentInterfaces-DYkaxBda.js → componentInterfaces-Cmg8tUxq.js} +5 -5
  64. package/dist/componentInterfaces-Cmg8tUxq.js.map +1 -0
  65. package/dist/errors.cjs +1 -1
  66. package/dist/errors.cjs.map +1 -1
  67. package/dist/errors.d.ts +116 -20
  68. package/dist/errors.d.ts.map +1 -1
  69. package/dist/errors.js +106 -52
  70. package/dist/errors.js.map +1 -1
  71. package/dist/{generated-BDeDiaCK.js → generated-HGddZXHJ.js} +21 -21
  72. package/dist/{generated-BDeDiaCK.js.map → generated-HGddZXHJ.js.map} +1 -1
  73. package/dist/index.cjs +1 -1
  74. package/dist/index.js +95 -91
  75. package/package.json +11 -7
  76. package/src/Actions/Action.test.ts +9 -5
  77. package/src/Actions/ContractAction.test.ts +3 -3
  78. package/src/Actions/ERC721MintAction.test.ts +1 -1
  79. package/src/Actions/EventAction.test.ts +527 -99
  80. package/src/Actions/EventAction.ts +296 -58
  81. package/src/AllowLists/AllowList.test.ts +2 -2
  82. package/src/AllowLists/AllowList.ts +5 -3
  83. package/src/AllowLists/OpenAllowList.test.ts +40 -0
  84. package/src/AllowLists/OpenAllowList.ts +45 -0
  85. package/src/AllowLists/SimpleAllowList.test.ts +1 -1
  86. package/src/AllowLists/SimpleDenyList.test.ts +1 -1
  87. package/src/AllowLists/SimpleDenyList.ts +6 -9
  88. package/src/BoostCore.ts +19 -0
  89. package/src/Budgets/ManagedBudget.test.ts +70 -7
  90. package/src/Budgets/ManagedBudget.ts +42 -31
  91. package/src/Budgets/SimpleBudget.test.ts +3 -3
  92. package/src/Budgets/SimpleBudget.ts +6 -6
  93. package/src/Budgets/VestingBudget.test.ts +3 -3
  94. package/src/Budgets/VestingBudget.ts +6 -6
  95. package/src/Deployable/DeployableTarget.ts +1 -1
  96. package/src/Incentives/AllowListIncentive.test.ts +1 -1
  97. package/src/Incentives/ERC20VariableIncentive.ts +5 -5
  98. package/src/Validators/SignerValidator.test.ts +1 -1
  99. package/src/errors.ts +160 -20
  100. package/dist/componentInterfaces-DYkaxBda.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { X as c } from "../generated-BDeDiaCK.js";
2
- import { A as i } from "../componentInterfaces-DYkaxBda.js";
1
+ import { X as c } from "../generated-HGddZXHJ.js";
2
+ import { A as i } from "../componentInterfaces-Cmg8tUxq.js";
3
3
  import { readContract as m } from "@wagmi/core";
4
4
  import { InvalidComponentInterfaceError as a } from "../errors.js";
5
5
  import { EventAction as f } from "./EventAction.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../generated-wKBNvm48.cjs"),u=require("viem"),w=require("viem/actions"),E=require("../Deployable/DeployableTarget.cjs"),c=require("../errors.cjs"),N=require("../utils.cjs"),C="0x60a0604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b60805161231a6100c85f395f61034a015261231a5ff3fe608060405260043610610090575f3560e01c80639bc1cf81116100585780639bc1cf811461017d578063c26624e8146101a7578063d7768c47146101e3578063dbdf21101461021f578063ddd6ab081461024957610090565b806301ffc9a71461009457806309c5eabe146100d057806328d6183b14610101578063393df8cb1461012b578063439fab9114610155575b5f80fd5b34801561009f575f80fd5b506100ba60048036038101906100b59190611333565b610273565b6040516100c79190611378565b60405180910390f35b6100ea60048036038101906100e591906113f2565b6102ec565b6040516100f89291906114ad565b60405180910390f35b34801561010c575f80fd5b50610115610321565b60405161012291906114ea565b60405180910390f35b348015610136575f80fd5b5061013f610348565b60405161014c919061157d565b60405180910390f35b348015610160575f80fd5b5061017b600480360381019061017691906113f2565b61036c565b005b348015610188575f80fd5b506101916103f9565b60405161019e91906118e9565b60405180910390f35b3480156101b2575f80fd5b506101cd60048036038101906101c89190611933565b610648565b6040516101da91906119e4565b60405180910390f35b3480156101ee575f80fd5b50610209600480360381019061020491906113f2565b610875565b6040516102169190611a04565b60405180910390f35b34801561022a575f80fd5b506102336108a9565b6040516102409190611a8a565b60405180910390f35b348015610254575f80fd5b5061025d610981565b60405161026a9190611ab2565b60405180910390f35b5f7f7687b0ed000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806102e557506102e48261098d565b5b9050919050565b5f60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f7687b0ed00000000000000000000000000000000000000000000000000000000905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f610375610a06565b905080546003825580156103a75760018160011c14303b1061039e5763f92ee8a95f526004601cfd5b818160ff1b1b91505b506103bf83838101906103ba9190611fb0565b610a2f565b80156103f4576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b60606004805480602002602001604051908101604052809291908181526020015f905b8282101561063f578382905f5260205f2090600502016040518060c00160405290815f8201548152602001600182015f9054906101000a900460ff16600181111561046a576104696115d7565b5b600181111561047c5761047b6115d7565b5b81526020016001820160019054906101000a900460ff1660ff1660ff1681526020016001820160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201548152602001600382016040518060800160405290815f82015f9054906101000a900460ff1660048111156105305761052f6115d7565b5b6004811115610542576105416115d7565b5b81526020015f820160019054906101000a900460ff16600381111561056a576105696115d7565b5b600381111561057c5761057b6115d7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff1681526020016001820180546105ac90612024565b80601f01602080910402602001604051908101604052809291908181526020018280546105d890612024565b80156106235780601f106105fa57610100808354040283529160200191610623565b820191905f5260205f20905b81548152906001019060200180831161060657829003601f168201915b505050505081525050815250508152602001906001019061041c565b50505050905090565b6106506111c4565b6004828154811061066457610663612054565b5b905f5260205f2090600502016040518060c00160405290815f8201548152602001600182015f9054906101000a900460ff1660018111156106a8576106a76115d7565b5b60018111156106ba576106b96115d7565b5b81526020016001820160019054906101000a900460ff1660ff1660ff1681526020016001820160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201548152602001600382016040518060800160405290815f82015f9054906101000a900460ff16600481111561076e5761076d6115d7565b5b60048111156107805761077f6115d7565b5b81526020015f820160019054906101000a900460ff1660038111156107a8576107a76115d7565b5b60038111156107ba576107b96115d7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff1681526020016001820180546107ea90612024565b80601f016020809104026020016040519081016040528092919081815260200182805461081690612024565b80156108615780601f1061083857610100808354040283529160200191610861565b820191905f5260205f20905b81548152906001019060200180831161084457829003601f168201915b505050505081525050815250509050919050565b60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108b1611229565b5f6040518060a00160405290815f82015f9054906101000a900460ff1660018111156108e0576108df6115d7565b5b60018111156108f2576108f16115d7565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600382015481525050905090565b5f600480549050905090565b5f7fe6715795000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806109ff57506109fe826110be565b5b9050919050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610a37611137565b805f01515f80820151815f015f6101000a81548160ff02191690836001811115610a6457610a636115d7565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816003015590505060048160200151908060018154018082558091505060019003905f5260205f2090600502015f909190919091505f820151815f01556020820151816001015f6101000a81548160ff02191690836001811115610b4657610b456115d7565b5b021790555060408201518160010160016101000a81548160ff021916908360ff16021790555060608201518160010160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816002015560a0820151816003015f820151815f015f6101000a81548160ff02191690836004811115610bee57610bed6115d7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610c1d57610c1c6115d7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610c579190612215565b505050505060048160400151908060018154018082558091505060019003905f5260205f2090600502015f909190919091505f820151815f01556020820151816001015f6101000a81548160ff02191690836001811115610cbb57610cba6115d7565b5b021790555060408201518160010160016101000a81548160ff021916908360ff16021790555060608201518160010160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816002015560a0820151816003015f820151815f015f6101000a81548160ff02191690836004811115610d6357610d626115d7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610d9257610d916115d7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610dcc9190612215565b505050505060048160600151908060018154018082558091505060019003905f5260205f2090600502015f909190919091505f820151815f01556020820151816001015f6101000a81548160ff02191690836001811115610e3057610e2f6115d7565b5b021790555060408201518160010160016101000a81548160ff021916908360ff16021790555060608201518160010160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816002015560a0820151816003015f820151815f015f6101000a81548160ff02191690836004811115610ed857610ed76115d7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610f0757610f066115d7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610f419190612215565b505050505060048160800151908060018154018082558091505060019003905f5260205f2090600502015f909190919091505f820151815f01556020820151816001015f6101000a81548160ff02191690836001811115610fa557610fa46115d7565b5b021790555060408201518160010160016101000a81548160ff021916908360ff16021790555060608201518160010160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816002015560a0820151816003015f820151815f015f6101000a81548160ff0219169083600481111561104d5761104c6115d7565b5b02179055506020820151815f0160016101000a81548160ff0219169083600381111561107c5761107b6115d7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff16021790555060608201518160010190816110b69190612215565b505050505050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611130575061112f8261115b565b5b9050919050565b5f611140610a06565b905080546001166111585763d7e6bcf85f526004601cfd5b50565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6040518060c001604052805f80191681526020015f60018111156111eb576111ea6115d7565b5b81526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f8152602001611223611281565b81525090565b6040518060a001604052805f6001811115611247576112466115d7565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81525090565b60405180608001604052805f600481111561129f5761129e6115d7565b5b81526020015f60038111156112b7576112b66115d7565b5b81526020015f60ff168152602001606081525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611312816112de565b811461131c575f80fd5b50565b5f8135905061132d81611309565b92915050565b5f60208284031215611348576113476112d6565b5b5f6113558482850161131f565b91505092915050565b5f8115159050919050565b6113728161135e565b82525050565b5f60208201905061138b5f830184611369565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126113b2576113b1611391565b5b8235905067ffffffffffffffff8111156113cf576113ce611395565b5b6020830191508360018202830111156113eb576113ea611399565b5b9250929050565b5f8060208385031215611408576114076112d6565b5b5f83013567ffffffffffffffff811115611425576114246112da565b5b6114318582860161139d565b92509250509250929050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61147f8261143d565b6114898185611447565b9350611499818560208601611457565b6114a281611465565b840191505092915050565b5f6040820190506114c05f830185611369565b81810360208301526114d28184611475565b90509392505050565b6114e4816112de565b82525050565b5f6020820190506114fd5f8301846114db565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f61154561154061153b84611503565b611522565b611503565b9050919050565b5f6115568261152b565b9050919050565b5f6115678261154c565b9050919050565b6115778161155d565b82525050565b5f6020820190506115905f83018461156e565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f819050919050565b6115d1816115bf565b82525050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611615576116146115d7565b5b50565b5f81905061162582611604565b919050565b5f61163482611618565b9050919050565b6116448161162a565b82525050565b5f60ff82169050919050565b61165f8161164a565b82525050565b5f61166f82611503565b9050919050565b61167f81611665565b82525050565b5f819050919050565b61169781611685565b82525050565b600581106116ae576116ad6115d7565b5b50565b5f8190506116be8261169d565b919050565b5f6116cd826116b1565b9050919050565b6116dd816116c3565b82525050565b600481106116f4576116f36115d7565b5b50565b5f819050611704826116e3565b919050565b5f611713826116f7565b9050919050565b61172381611709565b82525050565b5f82825260208201905092915050565b5f6117438261143d565b61174d8185611729565b935061175d818560208601611457565b61176681611465565b840191505092915050565b5f608083015f8301516117865f8601826116d4565b506020830151611799602086018261171a565b5060408301516117ac6040860182611656565b50606083015184820360608601526117c48282611739565b9150508091505092915050565b5f60c083015f8301516117e65f8601826115c8565b5060208301516117f9602086018261163b565b50604083015161180c6040860182611656565b50606083015161181f6060860182611676565b506080830151611832608086018261168e565b5060a083015184820360a086015261184a8282611771565b9150508091505092915050565b5f61186283836117d1565b905092915050565b5f602082019050919050565b5f61188082611596565b61188a81856115a0565b93508360208202850161189c856115b0565b805f5b858110156118d757848403895281516118b88582611857565b94506118c38361186a565b925060208a0199505060018101905061189f565b50829750879550505050505092915050565b5f6020820190508181035f8301526119018184611876565b905092915050565b61191281611685565b811461191c575f80fd5b50565b5f8135905061192d81611909565b92915050565b5f60208284031215611948576119476112d6565b5b5f6119558482850161191f565b91505092915050565b5f60c083015f8301516119735f8601826115c8565b506020830151611986602086018261163b565b5060408301516119996040860182611656565b5060608301516119ac6060860182611676565b5060808301516119bf608086018261168e565b5060a083015184820360a08601526119d78282611771565b9150508091505092915050565b5f6020820190508181035f8301526119fc818461195e565b905092915050565b5f6020820190508181035f830152611a1c8184611475565b905092915050565b60a082015f820151611a385f85018261163b565b506020820151611a4b60208501826115c8565b506040820151611a5e6040850182611656565b506060820151611a716060850182611676565b506080820151611a84608085018261168e565b50505050565b5f60a082019050611a9d5f830184611a24565b92915050565b611aac81611685565b82525050565b5f602082019050611ac55f830184611aa3565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611b0582611465565b810181811067ffffffffffffffff82111715611b2457611b23611acf565b5b80604052505050565b5f611b366112cd565b9050611b428282611afc565b919050565b5f80fd5b60028110611b57575f80fd5b50565b5f81359050611b6881611b4b565b92915050565b611b77816115bf565b8114611b81575f80fd5b50565b5f81359050611b9281611b6e565b92915050565b611ba18161164a565b8114611bab575f80fd5b50565b5f81359050611bbc81611b98565b92915050565b611bcb81611665565b8114611bd5575f80fd5b50565b5f81359050611be681611bc2565b92915050565b5f60a08284031215611c0157611c00611acb565b5b611c0b60a0611b2d565b90505f611c1a84828501611b5a565b5f830152506020611c2d84828501611b84565b6020830152506040611c4184828501611bae565b6040830152506060611c5584828501611bd8565b6060830152506080611c698482850161191f565b60808301525092915050565b60058110611c81575f80fd5b50565b5f81359050611c9281611c75565b92915050565b60048110611ca4575f80fd5b50565b5f81359050611cb581611c98565b92915050565b5f80fd5b5f67ffffffffffffffff821115611cd957611cd8611acf565b5b611ce282611465565b9050602081019050919050565b828183375f83830152505050565b5f611d0f611d0a84611cbf565b611b2d565b905082815260208101848484011115611d2b57611d2a611cbb565b5b611d36848285611cef565b509392505050565b5f82601f830112611d5257611d51611391565b5b8135611d62848260208601611cfd565b91505092915050565b5f60808284031215611d8057611d7f611acb565b5b611d8a6080611b2d565b90505f611d9984828501611c84565b5f830152506020611dac84828501611ca7565b6020830152506040611dc084828501611bae565b604083015250606082013567ffffffffffffffff811115611de457611de3611b47565b5b611df084828501611d3e565b60608301525092915050565b5f60c08284031215611e1157611e10611acb565b5b611e1b60c0611b2d565b90505f611e2a84828501611b84565b5f830152506020611e3d84828501611b5a565b6020830152506040611e5184828501611bae565b6040830152506060611e6584828501611bd8565b6060830152506080611e798482850161191f565b60808301525060a082013567ffffffffffffffff811115611e9d57611e9c611b47565b5b611ea984828501611d6b565b60a08301525092915050565b5f6101208284031215611ecb57611eca611acb565b5b611ed560a0611b2d565b90505f611ee484828501611bec565b5f8301525060a082013567ffffffffffffffff811115611f0757611f06611b47565b5b611f1384828501611dfc565b60208301525060c082013567ffffffffffffffff811115611f3757611f36611b47565b5b611f4384828501611dfc565b60408301525060e082013567ffffffffffffffff811115611f6757611f66611b47565b5b611f7384828501611dfc565b60608301525061010082013567ffffffffffffffff811115611f9857611f97611b47565b5b611fa484828501611dfc565b60808301525092915050565b5f60208284031215611fc557611fc46112d6565b5b5f82013567ffffffffffffffff811115611fe257611fe16112da565b5b611fee84828501611eb5565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061203b57607f821691505b60208210810361204e5761204d611ff7565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026120dd7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826120a2565b6120e786836120a2565b95508019841693508086168417925050509392505050565b5f61211961211461210f84611685565b611522565b611685565b9050919050565b5f819050919050565b612132836120ff565b61214661213e82612120565b8484546120ae565b825550505050565b5f90565b61215a61214e565b612165818484612129565b505050565b5b818110156121885761217d5f82612152565b60018101905061216b565b5050565b601f8211156121cd5761219e81612081565b6121a784612093565b810160208510156121b6578190505b6121ca6121c285612093565b83018261216a565b50505b505050565b5f82821c905092915050565b5f6121ed5f19846008026121d2565b1980831691505092915050565b5f61220583836121de565b9150826002028217905092915050565b61221e8261143d565b67ffffffffffffffff81111561223757612236611acf565b5b6122418254612024565b61224c82828561218c565b5f60209050601f83116001811461227d575f841561226b578287015190505b61227585826121fa565b8655506122dc565b601f19841661228b86612081565b5f5b828110156122b25784890151825560018201915060208501945060208101905061228d565b868310156122cf57848901516122cb601f8916826121de565b8355505b6001600288020188555050505b50505050505056fea2646970667358221220a8ee5f8b5a49a9c61c1747482b13d7b4617cfc02983722a0395994bf27c456a064736f6c634300081a0033",x={"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{name:"Transfer",type:"event",inputs:[{type:"address"},{type:"address"},{type:"uint256"}]},"0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e":{name:"Purchased",type:"event",inputs:[{type:"address"},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32"},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f":{name:"DelegateChanged",type:"event",inputs:[{type:"address"},{type:"address"},{type:"address"}]},"0x00cb39d6c2c520f0597db0021367767c48fef2964cf402d3c9e9d4df12e43964":{name:"Test",type:"event",inputs:[{type:"string"}]}},I={"Transfer(address,address,uint256)":"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","Purchased(address,address,uint256,uint256,uint256)":"0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e","NameRegistered(string,bytes32,address,uint256,uint256,uint256)":"0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27","DelegateChanged(address,address,address)":"0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f","Test(string)":"0x00cb39d6c2c520f0597db0021367767c48fef2964cf402d3c9e9d4df12e43964"},v={abi:x,selectors:I};var g=(b=>(b[b.EQUAL=0]="EQUAL",b[b.NOT_EQUAL=1]="NOT_EQUAL",b[b.GREATER_THAN=2]="GREATER_THAN",b[b.LESS_THAN=3]="LESS_THAN",b[b.CONTAINS=4]="CONTAINS",b))(g||{}),m=(b=>(b[b.UINT=0]="UINT",b[b.ADDRESS=1]="ADDRESS",b[b.BYTES=2]="BYTES",b[b.STRING=3]="STRING",b))(m||{}),h=(b=>(b[b.EVENT=0]="EVENT",b[b.FUNC=1]="FUNC",b))(h||{});function A(b){return Array.isArray(b.actionSteps)}const p=class p extends E.DeployableTarget{constructor(){super(...arguments),this.abi=s.W}async getActionStep(f,e){return(await this.getActionSteps(e)).at(f)}async getActionSteps(f){const e=await s.$f(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f});return D(e.map(l))}async getActionStepsCount(f){return(await this.getActionSteps(f)).length}async getActionClaimant(f){const e=await s.Gf(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f});return l(e)}async execute(f,e){return await this.awaitResult(this.executeRaw(f,e))}async executeRaw(f,e){const{request:t,result:a}=await s.tv(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...e,args:[f]});return{hash:await s.Xf(this._config,t),result:a}}async validateActionSteps(f){const e=await this.getActionSteps(f);for(const t of e)if(!await this.isActionStepValid(t,f))return!1;return!0}async isActionStepValid(f,e){const t=f.actionParameter,a=f.signature;let n;if(e!=null&&e.knownEvents?n=e.knownEvents[a]:n=v.abi[a],!n)throw new Error(`No known ABI for given event signature: ${a}`);const i=f.targetContract,d=(e==null?void 0:e.logs)||await w.getLogs(this._config.getClient({chainId:e==null?void 0:e.chainId}),{...e,address:i,event:n});if(!d.length)return!1;for(let o of d)if(!this.validateLogAgainstCriteria(t,o))return!1;return!0}validateLogAgainstCriteria(f,e){const t=e.topics.at(f.fieldIndex);if(t===void 0)throw new c.FieldValueUndefinedError({log:e,criteria:f,fieldValue:t});switch(f.filterType){case 0:return f.fieldType===1?u.isAddressEqual(f.filterData,`0x${t.slice(-40)}`):t===f.filterData;case 1:return f.fieldType===1?!u.isAddressEqual(f.filterData,`0x${t.slice(-40)}`):t!==f.filterData;case 2:if(f.fieldType===0)return BigInt(t)>BigInt(f.filterData);throw new c.InvalidNumericalCriteriaError({log:e,criteria:f,fieldValue:t});case 3:if(f.fieldType===0)return BigInt(t)<BigInt(f.filterData);throw new c.InvalidNumericalCriteriaError({log:e,criteria:f,fieldValue:t});case 4:if(f.fieldType===2||f.fieldType===3)return t.includes(f.filterData);throw new c.FieldValueNotComparableError({log:e,criteria:f,fieldValue:t});default:throw new c.UnrecognizedFilterTypeError({log:e,criteria:f,fieldValue:t})}}buildParameters(f,e){const[t,a]=this.validateDeploymentConfig(f,e);let n;if(A(t)){let i=t.actionSteps.filter(o=>!!o);if(i.length===0)throw new c.NoEventActionStepsProvidedError;if(i.length>4)throw new c.TooManyEventActionStepsProvidedError;let d=Array.from({length:4},(o,S)=>i.at(S)||i.at(-1));n={actionClaimant:t.actionClaimant,actionStepOne:d[0],actionStepTwo:d[1],actionStepThree:d[2],actionStepFour:d[3]}}else n=t;return{abi:s.W,bytecode:C,args:[T(n)],...this.optionallyAttachAccount(a.account)}}};p.base="0x2bD655240116b18f5b9F24E4b7b51B87B7b33D37",p.registryType=N.RegistryType.ACTION;let y=p;function D(b){const f=[],e={};for(let t of b){const a=JSON.stringify(t);e[a]||(f.push(t),e[a]=!0)}return f}function r(b){return{...b,chainid:BigInt(b.chainid)}}function l(b){if(b.chainid>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("Chain ID exceeds max safe integer");return{...b,chainid:Number(b.chainid)}}function T({actionClaimant:b,actionStepOne:f,actionStepTwo:e,actionStepThree:t,actionStepFour:a}){return u.encodeAbiParameters([{type:"tuple",name:"initPayload",components:[{type:"tuple",name:"actionClaimant",components:[{type:"uint8",name:"signatureType"},{type:"bytes32",name:"signature"},{type:"uint8",name:"fieldIndex"},{type:"address",name:"targetContract"},{type:"uint256",name:"chainid"}]},{type:"tuple",name:"actionStepOne",components:[{type:"bytes32",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"uint256",name:"chainid"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]},{type:"tuple",name:"actionStepTwo",components:[{type:"bytes32",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"uint256",name:"chainid"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]},{type:"tuple",name:"actionStepThree",components:[{type:"bytes32",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"uint256",name:"chainid"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]},{type:"tuple",name:"actionStepFour",components:[{type:"bytes32",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"uint256",name:"chainid"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]}]}],[{actionClaimant:r(b),actionStepOne:{...r(f),actionType:f.actionType||0},actionStepTwo:{...r(e),actionType:e.actionType||0},actionStepThree:{...r(t),actionType:t.actionType||0},actionStepFour:{...r(a),actionType:a.actionType||0}}])}exports.EventAction=y;exports.FilterType=g;exports.PrimitiveType=m;exports.SignatureType=h;exports.isEventActionPayloadSimple=A;exports.prepareEventActionPayload=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../generated-wKBNvm48.cjs"),o=require("viem"),E=require("viem/actions"),I=require("../Deployable/DeployableTarget.cjs"),d=require("../errors.cjs"),S=require("../utils.cjs"),v="0x60a0604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b60805161231a6100c85f395f61034a015261231a5ff3fe608060405260043610610090575f3560e01c80639bc1cf81116100585780639bc1cf811461017d578063c26624e8146101a7578063d7768c47146101e3578063dbdf21101461021f578063ddd6ab081461024957610090565b806301ffc9a71461009457806309c5eabe146100d057806328d6183b14610101578063393df8cb1461012b578063439fab9114610155575b5f80fd5b34801561009f575f80fd5b506100ba60048036038101906100b59190611333565b610273565b6040516100c79190611378565b60405180910390f35b6100ea60048036038101906100e591906113f2565b6102ec565b6040516100f89291906114ad565b60405180910390f35b34801561010c575f80fd5b50610115610321565b60405161012291906114ea565b60405180910390f35b348015610136575f80fd5b5061013f610348565b60405161014c919061157d565b60405180910390f35b348015610160575f80fd5b5061017b600480360381019061017691906113f2565b61036c565b005b348015610188575f80fd5b506101916103f9565b60405161019e91906118e9565b60405180910390f35b3480156101b2575f80fd5b506101cd60048036038101906101c89190611933565b610648565b6040516101da91906119e4565b60405180910390f35b3480156101ee575f80fd5b50610209600480360381019061020491906113f2565b610875565b6040516102169190611a04565b60405180910390f35b34801561022a575f80fd5b506102336108a9565b6040516102409190611a8a565b60405180910390f35b348015610254575f80fd5b5061025d610981565b60405161026a9190611ab2565b60405180910390f35b5f7f7687b0ed000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806102e557506102e48261098d565b5b9050919050565b5f60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f7687b0ed00000000000000000000000000000000000000000000000000000000905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f610375610a06565b905080546003825580156103a75760018160011c14303b1061039e5763f92ee8a95f526004601cfd5b818160ff1b1b91505b506103bf83838101906103ba9190611fb0565b610a2f565b80156103f4576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b60606004805480602002602001604051908101604052809291908181526020015f905b8282101561063f578382905f5260205f2090600502016040518060c00160405290815f8201548152602001600182015f9054906101000a900460ff16600181111561046a576104696115d7565b5b600181111561047c5761047b6115d7565b5b81526020016001820160019054906101000a900460ff1660ff1660ff1681526020016001820160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201548152602001600382016040518060800160405290815f82015f9054906101000a900460ff1660058111156105305761052f6115d7565b5b6005811115610542576105416115d7565b5b81526020015f820160019054906101000a900460ff16600381111561056a576105696115d7565b5b600381111561057c5761057b6115d7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff1681526020016001820180546105ac90612024565b80601f01602080910402602001604051908101604052809291908181526020018280546105d890612024565b80156106235780601f106105fa57610100808354040283529160200191610623565b820191905f5260205f20905b81548152906001019060200180831161060657829003601f168201915b505050505081525050815250508152602001906001019061041c565b50505050905090565b6106506111c4565b6004828154811061066457610663612054565b5b905f5260205f2090600502016040518060c00160405290815f8201548152602001600182015f9054906101000a900460ff1660018111156106a8576106a76115d7565b5b60018111156106ba576106b96115d7565b5b81526020016001820160019054906101000a900460ff1660ff1660ff1681526020016001820160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201548152602001600382016040518060800160405290815f82015f9054906101000a900460ff16600581111561076e5761076d6115d7565b5b60058111156107805761077f6115d7565b5b81526020015f820160019054906101000a900460ff1660038111156107a8576107a76115d7565b5b60038111156107ba576107b96115d7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff1681526020016001820180546107ea90612024565b80601f016020809104026020016040519081016040528092919081815260200182805461081690612024565b80156108615780601f1061083857610100808354040283529160200191610861565b820191905f5260205f20905b81548152906001019060200180831161084457829003601f168201915b505050505081525050815250509050919050565b60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108b1611229565b5f6040518060a00160405290815f82015f9054906101000a900460ff1660018111156108e0576108df6115d7565b5b60018111156108f2576108f16115d7565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600382015481525050905090565b5f600480549050905090565b5f7fe6715795000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806109ff57506109fe826110be565b5b9050919050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610a37611137565b805f01515f80820151815f015f6101000a81548160ff02191690836001811115610a6457610a636115d7565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816003015590505060048160200151908060018154018082558091505060019003905f5260205f2090600502015f909190919091505f820151815f01556020820151816001015f6101000a81548160ff02191690836001811115610b4657610b456115d7565b5b021790555060408201518160010160016101000a81548160ff021916908360ff16021790555060608201518160010160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816002015560a0820151816003015f820151815f015f6101000a81548160ff02191690836005811115610bee57610bed6115d7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610c1d57610c1c6115d7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610c579190612215565b505050505060048160400151908060018154018082558091505060019003905f5260205f2090600502015f909190919091505f820151815f01556020820151816001015f6101000a81548160ff02191690836001811115610cbb57610cba6115d7565b5b021790555060408201518160010160016101000a81548160ff021916908360ff16021790555060608201518160010160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816002015560a0820151816003015f820151815f015f6101000a81548160ff02191690836005811115610d6357610d626115d7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610d9257610d916115d7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610dcc9190612215565b505050505060048160600151908060018154018082558091505060019003905f5260205f2090600502015f909190919091505f820151815f01556020820151816001015f6101000a81548160ff02191690836001811115610e3057610e2f6115d7565b5b021790555060408201518160010160016101000a81548160ff021916908360ff16021790555060608201518160010160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816002015560a0820151816003015f820151815f015f6101000a81548160ff02191690836005811115610ed857610ed76115d7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610f0757610f066115d7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610f419190612215565b505050505060048160800151908060018154018082558091505060019003905f5260205f2090600502015f909190919091505f820151815f01556020820151816001015f6101000a81548160ff02191690836001811115610fa557610fa46115d7565b5b021790555060408201518160010160016101000a81548160ff021916908360ff16021790555060608201518160010160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816002015560a0820151816003015f820151815f015f6101000a81548160ff0219169083600581111561104d5761104c6115d7565b5b02179055506020820151815f0160016101000a81548160ff0219169083600381111561107c5761107b6115d7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff16021790555060608201518160010190816110b69190612215565b505050505050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611130575061112f8261115b565b5b9050919050565b5f611140610a06565b905080546001166111585763d7e6bcf85f526004601cfd5b50565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6040518060c001604052805f80191681526020015f60018111156111eb576111ea6115d7565b5b81526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f8152602001611223611281565b81525090565b6040518060a001604052805f6001811115611247576112466115d7565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81525090565b60405180608001604052805f600581111561129f5761129e6115d7565b5b81526020015f60038111156112b7576112b66115d7565b5b81526020015f60ff168152602001606081525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611312816112de565b811461131c575f80fd5b50565b5f8135905061132d81611309565b92915050565b5f60208284031215611348576113476112d6565b5b5f6113558482850161131f565b91505092915050565b5f8115159050919050565b6113728161135e565b82525050565b5f60208201905061138b5f830184611369565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126113b2576113b1611391565b5b8235905067ffffffffffffffff8111156113cf576113ce611395565b5b6020830191508360018202830111156113eb576113ea611399565b5b9250929050565b5f8060208385031215611408576114076112d6565b5b5f83013567ffffffffffffffff811115611425576114246112da565b5b6114318582860161139d565b92509250509250929050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61147f8261143d565b6114898185611447565b9350611499818560208601611457565b6114a281611465565b840191505092915050565b5f6040820190506114c05f830185611369565b81810360208301526114d28184611475565b90509392505050565b6114e4816112de565b82525050565b5f6020820190506114fd5f8301846114db565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f61154561154061153b84611503565b611522565b611503565b9050919050565b5f6115568261152b565b9050919050565b5f6115678261154c565b9050919050565b6115778161155d565b82525050565b5f6020820190506115905f83018461156e565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f819050919050565b6115d1816115bf565b82525050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611615576116146115d7565b5b50565b5f81905061162582611604565b919050565b5f61163482611618565b9050919050565b6116448161162a565b82525050565b5f60ff82169050919050565b61165f8161164a565b82525050565b5f61166f82611503565b9050919050565b61167f81611665565b82525050565b5f819050919050565b61169781611685565b82525050565b600681106116ae576116ad6115d7565b5b50565b5f8190506116be8261169d565b919050565b5f6116cd826116b1565b9050919050565b6116dd816116c3565b82525050565b600481106116f4576116f36115d7565b5b50565b5f819050611704826116e3565b919050565b5f611713826116f7565b9050919050565b61172381611709565b82525050565b5f82825260208201905092915050565b5f6117438261143d565b61174d8185611729565b935061175d818560208601611457565b61176681611465565b840191505092915050565b5f608083015f8301516117865f8601826116d4565b506020830151611799602086018261171a565b5060408301516117ac6040860182611656565b50606083015184820360608601526117c48282611739565b9150508091505092915050565b5f60c083015f8301516117e65f8601826115c8565b5060208301516117f9602086018261163b565b50604083015161180c6040860182611656565b50606083015161181f6060860182611676565b506080830151611832608086018261168e565b5060a083015184820360a086015261184a8282611771565b9150508091505092915050565b5f61186283836117d1565b905092915050565b5f602082019050919050565b5f61188082611596565b61188a81856115a0565b93508360208202850161189c856115b0565b805f5b858110156118d757848403895281516118b88582611857565b94506118c38361186a565b925060208a0199505060018101905061189f565b50829750879550505050505092915050565b5f6020820190508181035f8301526119018184611876565b905092915050565b61191281611685565b811461191c575f80fd5b50565b5f8135905061192d81611909565b92915050565b5f60208284031215611948576119476112d6565b5b5f6119558482850161191f565b91505092915050565b5f60c083015f8301516119735f8601826115c8565b506020830151611986602086018261163b565b5060408301516119996040860182611656565b5060608301516119ac6060860182611676565b5060808301516119bf608086018261168e565b5060a083015184820360a08601526119d78282611771565b9150508091505092915050565b5f6020820190508181035f8301526119fc818461195e565b905092915050565b5f6020820190508181035f830152611a1c8184611475565b905092915050565b60a082015f820151611a385f85018261163b565b506020820151611a4b60208501826115c8565b506040820151611a5e6040850182611656565b506060820151611a716060850182611676565b506080820151611a84608085018261168e565b50505050565b5f60a082019050611a9d5f830184611a24565b92915050565b611aac81611685565b82525050565b5f602082019050611ac55f830184611aa3565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611b0582611465565b810181811067ffffffffffffffff82111715611b2457611b23611acf565b5b80604052505050565b5f611b366112cd565b9050611b428282611afc565b919050565b5f80fd5b60028110611b57575f80fd5b50565b5f81359050611b6881611b4b565b92915050565b611b77816115bf565b8114611b81575f80fd5b50565b5f81359050611b9281611b6e565b92915050565b611ba18161164a565b8114611bab575f80fd5b50565b5f81359050611bbc81611b98565b92915050565b611bcb81611665565b8114611bd5575f80fd5b50565b5f81359050611be681611bc2565b92915050565b5f60a08284031215611c0157611c00611acb565b5b611c0b60a0611b2d565b90505f611c1a84828501611b5a565b5f830152506020611c2d84828501611b84565b6020830152506040611c4184828501611bae565b6040830152506060611c5584828501611bd8565b6060830152506080611c698482850161191f565b60808301525092915050565b60068110611c81575f80fd5b50565b5f81359050611c9281611c75565b92915050565b60048110611ca4575f80fd5b50565b5f81359050611cb581611c98565b92915050565b5f80fd5b5f67ffffffffffffffff821115611cd957611cd8611acf565b5b611ce282611465565b9050602081019050919050565b828183375f83830152505050565b5f611d0f611d0a84611cbf565b611b2d565b905082815260208101848484011115611d2b57611d2a611cbb565b5b611d36848285611cef565b509392505050565b5f82601f830112611d5257611d51611391565b5b8135611d62848260208601611cfd565b91505092915050565b5f60808284031215611d8057611d7f611acb565b5b611d8a6080611b2d565b90505f611d9984828501611c84565b5f830152506020611dac84828501611ca7565b6020830152506040611dc084828501611bae565b604083015250606082013567ffffffffffffffff811115611de457611de3611b47565b5b611df084828501611d3e565b60608301525092915050565b5f60c08284031215611e1157611e10611acb565b5b611e1b60c0611b2d565b90505f611e2a84828501611b84565b5f830152506020611e3d84828501611b5a565b6020830152506040611e5184828501611bae565b6040830152506060611e6584828501611bd8565b6060830152506080611e798482850161191f565b60808301525060a082013567ffffffffffffffff811115611e9d57611e9c611b47565b5b611ea984828501611d6b565b60a08301525092915050565b5f6101208284031215611ecb57611eca611acb565b5b611ed560a0611b2d565b90505f611ee484828501611bec565b5f8301525060a082013567ffffffffffffffff811115611f0757611f06611b47565b5b611f1384828501611dfc565b60208301525060c082013567ffffffffffffffff811115611f3757611f36611b47565b5b611f4384828501611dfc565b60408301525060e082013567ffffffffffffffff811115611f6757611f66611b47565b5b611f7384828501611dfc565b60608301525061010082013567ffffffffffffffff811115611f9857611f97611b47565b5b611fa484828501611dfc565b60808301525092915050565b5f60208284031215611fc557611fc46112d6565b5b5f82013567ffffffffffffffff811115611fe257611fe16112da565b5b611fee84828501611eb5565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061203b57607f821691505b60208210810361204e5761204d611ff7565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026120dd7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826120a2565b6120e786836120a2565b95508019841693508086168417925050509392505050565b5f61211961211461210f84611685565b611522565b611685565b9050919050565b5f819050919050565b612132836120ff565b61214661213e82612120565b8484546120ae565b825550505050565b5f90565b61215a61214e565b612165818484612129565b505050565b5b818110156121885761217d5f82612152565b60018101905061216b565b5050565b601f8211156121cd5761219e81612081565b6121a784612093565b810160208510156121b6578190505b6121ca6121c285612093565b83018261216a565b50505b505050565b5f82821c905092915050565b5f6121ed5f19846008026121d2565b1980831691505092915050565b5f61220583836121de565b9150826002028217905092915050565b61221e8261143d565b67ffffffffffffffff81111561223757612236611acf565b5b6122418254612024565b61224c82828561218c565b5f60209050601f83116001811461227d575f841561226b578287015190505b61227585826121fa565b8655506122dc565b601f19841661228b86612081565b5f5b828110156122b25784890151825560018201915060208501945060208101905061228d565b868310156122cf57848901516122cb601f8916826121de565b8355505b6001600288020188555050505b50505050505056fea2646970667358221220c0fb13f888b0a69e33db3d7586e65062d85bac26cd33b0773ccbf5249746b2b264736f6c634300081a0033",C={"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{name:"Transfer",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0}]},"0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e":{name:"Purchased",type:"event",inputs:[{type:"address"},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32"},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f":{name:"DelegateChanged",type:"event",inputs:[{type:"address"},{type:"address"},{type:"address"}]},"0x883a883a9ea847654d33471b1e5fb2dea76a2cfc86a6cc7da6c14102800e4d0b":{name:"InfoIndexed",type:"event",inputs:[{type:"address",indexed:!0},{type:"string",indexed:!0}]},"0xe46343e36b0721f173bdc76b8f25c08b04f417df09c27e1e83ba1980007fef8c":{name:"Info",type:"event",inputs:[{type:"address"},{type:"string"}]}},N={"Transfer(address indexed,address indexed,uint256 indexed)":"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","Purchased(address,address,uint256,uint256,uint256)":"0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e","NameRegistered(string,bytes32,address,uint256,uint256,uint256)":"0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27","DelegateChanged(address,address,address)":"0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f","InfoIndexed(address indexed,string indexed)":"0x883a883a9ea847654d33471b1e5fb2dea76a2cfc86a6cc7da6c14102800e4d0b","Info(address,string)":"0xe46343e36b0721f173bdc76b8f25c08b04f417df09c27e1e83ba1980007fef8c"},D={abi:C,selectors:N},P={"0x40c10f19":{name:"mint",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[]},"0x17d304b0":{name:"mintPayable",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[]},"0x6a627842":{name:"mint",type:"function",stateMutability:"nonpayable",inputs:[{type:"address"}],outputs:[]}},R={"mint(address to, uint256 amount)":"0x40c10f19","mintPayable(address to, uint256 amount)":"0x17d304b0","mint(address)":"0x6a627842"},_={abi:P,selectors:R};var h=(b=>(b[b.EQUAL=0]="EQUAL",b[b.NOT_EQUAL=1]="NOT_EQUAL",b[b.GREATER_THAN=2]="GREATER_THAN",b[b.LESS_THAN=3]="LESS_THAN",b[b.CONTAINS=4]="CONTAINS",b[b.REGEX=5]="REGEX",b))(h||{}),m=(b=>(b[b.UINT=0]="UINT",b[b.ADDRESS=1]="ADDRESS",b[b.BYTES=2]="BYTES",b[b.STRING=3]="STRING",b))(m||{}),A=(b=>(b[b.EVENT=0]="EVENT",b[b.FUNC=1]="FUNC",b))(A||{});function w(b){return Array.isArray(b.actionSteps)}const p=class p extends I.DeployableTarget{constructor(){super(...arguments),this.abi=r.W}async getActionStep(f,e){return(await this.getActionSteps(e)).at(f)}async getActionSteps(f){const e=await r.$f(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f});return B(e.map(g))}async getActionStepsCount(f){return(await this.getActionSteps(f)).length}async getActionClaimant(f){const e=await r.Gf(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f});return g(e)}async execute(f,e){return await this.awaitResult(this.executeRaw(f,e))}async executeRaw(f,e){const{request:t,result:a}=await r.tv(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...e,args:[f]});return{hash:await r.Xf(this._config,t),result:a}}async validateActionSteps(f){const e=await this.getActionSteps();for(const t of e)if(!await this.isActionStepValid(t,f))return!1;return!0}async isActionStepValid(f,e){return f.signatureType===0?await this.isActionEventValid(f,e):f.signatureType===1?await this.isActionFunctionValid(f,e):!1}async isActionEventValid(f,e){const t=f.actionParameter,a=f.signature;let n;if(e!=null&&e.knownEvents?n=e.knownEvents[a]:n=D.abi[a],!n)throw new Error(`No known ABI for given event signature: ${a}`);if(this.isArraylikeIndexed(f,n))throw new d.UnparseableAbiParamError(f.actionParameter.fieldIndex,n);const c=f.targetContract,i=(e==null?void 0:e.logs)||await E.getLogs(this._config.getClient({chainId:e==null?void 0:e.chainId}),{...e,address:c,event:n});if(!i.length)return!1;for(let s of i)if(!this.validateLogAgainstCriteria(t,s))return!1;return!0}async isActionFunctionValid(f,e){const t=f.actionParameter,a=o.trim(f.signature);if(!e||!(e!=null&&e.hash))throw new Error("Hash is required for function validation");const c=await this._config.getClient({chainId:e==null?void 0:e.chainId}).getTransaction({hash:e.hash}),i=_.abi[a];if(!i)throw new Error(`No known ABI for given function signature: ${a}`);let s;try{s=o.decodeFunctionData({abi:[i],data:c.input})}catch(T){throw new d.FunctionDataDecodeError([i],T)}const y=s.args;return!(!y||!s||!this.validateFunctionAgainstCriteria(t,y))}validateFieldAgainstCriteria(f,e,t){switch(f.filterType){case 0:return f.fieldType===1?o.isAddressEqual(f.filterData,e):e===f.filterData;case 1:return e!==f.filterData;case 2:if(f.fieldType===0)return BigInt(e)>BigInt(f.filterData);throw new d.InvalidNumericalCriteriaError({...t,criteria:f,fieldValue:e});case 3:if(f.fieldType===0)return BigInt(e)<BigInt(f.filterData);throw new d.InvalidNumericalCriteriaError({...t,criteria:f,fieldValue:e});case 4:if(f.fieldType===2||f.fieldType===3){let a;return f.fieldType===3?a=o.fromHex(f.filterData,"string"):a=f.filterData.slice(2),e.includes(a)}throw new d.FieldValueNotComparableError({...t,criteria:f,fieldValue:e});case 5:if(typeof e!="string")throw new d.FieldValueNotComparableError({...t,criteria:f,fieldValue:e});if(f.fieldType===3){const a=o.fromHex(f.filterData,"string");return new RegExp(a).test(e)}default:throw new d.UnrecognizedFilterTypeError({...t,criteria:f,fieldValue:e})}}validateLogAgainstCriteria(f,e){if(!Array.isArray(e.args)||e.args.length<=f.fieldIndex)throw new d.DecodedArgsMalformedError({log:e,criteria:f,fieldValue:void 0});const t=e.args.at(f.fieldIndex);if(t===void 0)throw new d.FieldValueUndefinedError({log:e,criteria:f,fieldValue:t});return this.validateFieldAgainstCriteria(f,t,{log:e})}validateFunctionAgainstCriteria(f,e){const t=e[f.fieldIndex];if(t===void 0)throw new d.FieldValueUndefinedError({criteria:f,fieldValue:t});return this.validateFieldAgainstCriteria(f,t,{decodedArgs:e})}buildParameters(f,e){const[t,a]=this.validateDeploymentConfig(f,e);let n;if(w(t)){let c=t.actionSteps.filter(s=>!!s);if(c.length===0)throw new d.NoEventActionStepsProvidedError;if(c.length>4)throw new d.TooManyEventActionStepsProvidedError;let i=Array.from({length:4},(s,y)=>c.at(y)||c.at(-1));n={actionClaimant:t.actionClaimant,actionStepOne:i[0],actionStepTwo:i[1],actionStepThree:i[2],actionStepFour:i[3]}}else n=t;return{abi:r.W,bytecode:v,args:[x(n)],...this.optionallyAttachAccount(a.account)}}isArraylikeIndexed(f,e){var t;return!!((f.actionParameter.fieldType===3||f.actionParameter.fieldType===2)&&((t=e.inputs[f.actionParameter.fieldIndex])!=null&&t.indexed))}};p.base="0x2bD655240116b18f5b9F24E4b7b51B87B7b33D37",p.registryType=S.RegistryType.ACTION;let l=p;function B(b){const f=[],e={};for(let t of b){const a=JSON.stringify(t);e[a]||(f.push(t),e[a]=!0)}return f}function u(b){return{...b,chainid:BigInt(b.chainid)}}function g(b){if(b.chainid>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("Chain ID exceeds max safe integer");return{...b,chainid:Number(b.chainid)}}function x({actionClaimant:b,actionStepOne:f,actionStepTwo:e,actionStepThree:t,actionStepFour:a}){return o.encodeAbiParameters([{type:"tuple",name:"initPayload",components:[{type:"tuple",name:"actionClaimant",components:[{type:"uint8",name:"signatureType"},{type:"bytes32",name:"signature"},{type:"uint8",name:"fieldIndex"},{type:"address",name:"targetContract"},{type:"uint256",name:"chainid"}]},{type:"tuple",name:"actionStepOne",components:[{type:"bytes32",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"uint256",name:"chainid"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]},{type:"tuple",name:"actionStepTwo",components:[{type:"bytes32",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"uint256",name:"chainid"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]},{type:"tuple",name:"actionStepThree",components:[{type:"bytes32",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"uint256",name:"chainid"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]},{type:"tuple",name:"actionStepFour",components:[{type:"bytes32",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"uint256",name:"chainid"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]}]}],[{actionClaimant:u(b),actionStepOne:{...u(f),actionType:f.actionType||0},actionStepTwo:{...u(e),actionType:e.actionType||0},actionStepThree:{...u(t),actionType:t.actionType||0},actionStepFour:{...u(a),actionType:a.actionType||0}}])}exports.EventAction=l;exports.FilterType=h;exports.PrimitiveType=m;exports.SignatureType=A;exports.isEventActionPayloadSimple=w;exports.prepareEventActionPayload=x;
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 encodeAbiParameters,\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 GetLogsParams,\n type Overwrite,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\n/*\n * Action Event Payloads\n */\n\n/**\n * Filter types used to determine how criteria are evaluated.\n *\n * @export\n * @enum {number}\n */\nexport enum FilterType {\n EQUAL = 0,\n NOT_EQUAL = 1,\n GREATER_THAN = 2,\n LESS_THAN = 3,\n CONTAINS = 4,\n}\n\n/**\n * The primitive types supported for filtering.\n *\n * @export\n * @enum {number}\n */\nexport enum PrimitiveType {\n UINT = 0,\n ADDRESS = 1,\n BYTES = 2,\n STRING = 3,\n}\n\n/**\n * Object representation of a `Criteria` struct used in event actions.\n *\n * @export\n * @interface Criteria\n * @typedef {Criteria}\n */\nexport interface Criteria {\n /**\n * The filter type used in this criteria.\n *\n * @type {FilterType}\n */\n filterType: FilterType;\n /**\n * The primitive type of the field being filtered.\n *\n * @type {PrimitiveType}\n */\n fieldType: PrimitiveType;\n /**\n * The index in the logs argument array where the field is located.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The filter data used for complex filtering.\n *\n * @type {Hex}\n */\n filterData: Hex;\n}\n\n/**\n * Whether a given signature is an event or function\n *\n * @export\n * @enum {number}\n */\nexport enum SignatureType {\n EVENT = 0,\n FUNC = 1,\n}\n\n/**\n * The payload describing how claimants are identified\n *\n * @export\n * @interface ActionClaimant\n * @typedef {ActionClaimant}\n */\nexport interface ActionClaimant {\n /**\n * Whether claimaint is inferred from event or function\n *\n * @type {SignatureType}\n */\n signatureType: SignatureType;\n /**\n * The 4 byte signature of the event or function\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * The index corresponding to claimant.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The address of the target contract\n *\n * @type {Address}\n */\n targetContract: Address;\n /**\n * The chain id of the target contract.\n * @type {number}\n */\n chainid: number;\n}\n\n/**\n * Object representation of an `ActionStep` struct used in event actions.\n *\n * @export\n * @interface ActionStep\n * @typedef {ActionStep}\n */\nexport interface ActionStep {\n /**\n * The signature of the event.\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * Whether claimaint is inferred from event or function\n *\n * @type {SignatureType}\n */\n signatureType: SignatureType;\n /**\n * The type of action being performed.\n *\n * @type {number}\n */\n actionType?: number;\n /**\n * The address of the target contract.\n *\n * @type {Address}\n */\n targetContract: Address;\n /**\n * The chain id of the target contract.\n * @type {number}\n */\n chainid: number;\n /**\n * The criteria used for this action step.\n *\n * @type {Criteria}\n */\n actionParameter: Criteria;\n}\n/**\n * You can either supply a simplified version of the payload, or one that explicitly declares action steps.\n *\n * @export\n * @typedef {EventActionPayload}\n */\nexport type EventActionPayload =\n | EventActionPayloadSimple\n | EventActionPayloadRaw;\n\nexport interface EventActionPayloadSimple {\n /**\n * The payload describing how claimants are identified\n *\n * @type {ActionClaimant}\n */\n actionClaimant: ActionClaimant;\n\n /**\n * Up to 4 action steps.\n * If you supply less than 4, then the last step will be reused to satisfy the EventAction.InitPayload\n * Any more than 4 will throw an error.\n *\n * @type {ActionStep[]}\n */\n actionSteps: ActionStep[];\n}\n\nexport type ActionStepTuple = [ActionStep, ActionStep, ActionStep, ActionStep];\n\n/**\n * Typeguard to determine if a user is supplying a simple or raw EventActionPayload\n *\n * @param {*} opts\n * @returns {opts is EventActionPayloadSimple}\n */\nexport function isEventActionPayloadSimple(\n opts: EventActionPayload,\n): opts is EventActionPayloadSimple {\n return Array.isArray((opts as EventActionPayloadSimple).actionSteps);\n}\n\n/**\n * Object representation of an `InitPayload` struct used to initialize event actions.\n *\n * @export\n * @interface EventActionPayloadRaw\n * @typedef {EventActionPayloadRaw}\n */\nexport interface EventActionPayloadRaw {\n /**\n * The payload describing how claimants are identified\n *\n * @type {ActionClaimant}\n */\n actionClaimant: ActionClaimant;\n /**\n * The first action step.\n *\n * @type {ActionStep}\n */\n actionStepOne: ActionStep;\n /**\n * The second action step.\n *\n * @type {ActionStep}\n */\n actionStepTwo: ActionStep;\n /**\n * The third action step.\n *\n * @type {ActionStep}\n */\n actionStepThree: ActionStep;\n /**\n * The fourth action step.\n *\n * @type {ActionStep}\n */\n actionStepFour: ActionStep;\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 RawActionStep[];\n return _dedupeActionSteps(steps.map(_fromRawActionStep));\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 const result = (await 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 RawActionClaimant;\n return _fromRawActionStep(result);\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 await 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 {boolean} - Returns true if the log passes the criteria, false otherwise.\n */\n public 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 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.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: ActionStep[] = 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: ActionStepTuple = 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.at(-1);\n }) as ActionStepTuple;\n rawPayload = {\n actionClaimant: payload.actionClaimant,\n actionStepOne: steps[0],\n actionStepTwo: steps[1],\n actionStepThree: steps[2],\n actionStepFour: steps[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\nfunction _dedupeActionSteps(_steps: ActionStep[]): ActionStep[] {\n const steps: ActionStep[] = [],\n signatures: Record<string, boolean> = {};\n for (let step of _steps) {\n const signature = JSON.stringify(step);\n if (signatures[signature]) continue;\n steps.push(step);\n signatures[signature] = true;\n }\n return steps;\n}\ntype RawActionStep = Overwrite<ActionStep, { chainid: bigint }>;\ntype RawActionClaimant = Overwrite<ActionClaimant, { chainid: bigint }>;\n\nfunction _toRawActionStep<T extends ActionStep | ActionClaimant>(obj: T) {\n return {\n ...obj,\n chainid: BigInt(obj.chainid),\n };\n}\n\nfunction _fromRawActionStep<T extends RawActionStep | RawActionClaimant>(\n obj: T,\n) {\n if (obj.chainid > BigInt(Number.MAX_SAFE_INTEGER)) {\n throw new Error('Chain ID exceeds max safe integer');\n }\n\n return {\n ...obj,\n chainid: Number(obj.chainid),\n };\n}\n\n/**\n * Typeguard to determine if a user is supplying a simple or raw EventActionPayload\n *\n * @param {*} opts\n * @returns {opts is EventActionPayloadSimple}\n */\nfunction _isEventActionPayloadSimple(\n opts: EventActionPayload,\n): opts is EventActionPayloadSimple {\n return Array.isArray((opts as EventActionPayloadSimple).actionSteps);\n}\n\n/**\n * Function to properly encode an event action payload.\n *\n * @param {InitPayload} param0\n * @param {ActionStep} param0.actionStepOne - The first action step to initialize.\n * @param {ActionStep} param0.actionStepTwo - The second action step to initialize.\n * @param {ActionStep} param0.actionStepThree - The third action step to initialize.\n * @param {ActionStep} param0.actionStepFour - The fourth action step to initialize.\n * @returns {Hex}\n */\nexport function prepareEventActionPayload({\n actionClaimant,\n actionStepOne,\n actionStepTwo,\n actionStepThree,\n actionStepFour,\n}: EventActionPayloadRaw) {\n // note chainIds are technically uint256 but viem treats them (safely) as numbers,\n // so we encode them as uint32 here to avoid downcast issues\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayload',\n components: [\n {\n type: 'tuple',\n name: 'actionClaimant',\n components: [\n { type: 'uint8', name: 'signatureType' },\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint256', name: 'chainid' },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepOne',\n components: [\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint256', name: 'chainid' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepTwo',\n components: [\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint256', name: 'chainid' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepThree',\n components: [\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint256', name: 'chainid' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepFour',\n components: [\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint256', name: 'chainid' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n ],\n },\n ],\n [\n {\n actionClaimant: _toRawActionStep(actionClaimant),\n actionStepOne: {\n ..._toRawActionStep(actionStepOne),\n actionType: actionStepOne.actionType || 0,\n },\n actionStepTwo: {\n ..._toRawActionStep(actionStepTwo),\n actionType: actionStepTwo.actionType || 0,\n },\n actionStepThree: {\n ..._toRawActionStep(actionStepThree),\n actionType: actionStepThree.actionType || 0,\n },\n actionStepFour: {\n ..._toRawActionStep(actionStepFour),\n actionType: actionStepFour.actionType || 0,\n },\n },\n ],\n );\n}\n"],"names":["FilterType","PrimitiveType","SignatureType","isEventActionPayloadSimple","opts","_EventAction","DeployableTarget","eventActionAbi","index","params","steps","readEventActionGetActionSteps","_dedupeActionSteps","_fromRawActionStep","result","readEventActionGetActionClaimant","data","request","simulateEventActionExecute","writeEventActionExecute","actionSteps","actionStep","criteria","signature","event","events","targetContract","logs","getLogs","log","fieldValue","FieldValueUndefinedError","isAddressEqual","InvalidNumericalCriteriaError","FieldValueNotComparableError","UnrecognizedFilterTypeError","_payload","_options","payload","options","rawPayload","tmpSteps","step","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","_","i","bytecode","prepareEventActionPayload","RegistryType","EventAction","_steps","signatures","_toRawActionStep","obj","actionClaimant","actionStepOne","actionStepTwo","actionStepThree","actionStepFour","encodeAbiParameters"],"mappings":"+nnBAmDY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,MAAQ,CAAR,EAAA,QACAA,EAAAA,EAAA,UAA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,KAAM,QAAS,KAAM,eAAgB,EACvC,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,UAAW,KAAM,gBAAiB,EAC1C,CAAE,KAAM,UAAW,KAAM,SAAU,EACnC,CACE,KAAM,QACN,KAAM,kBACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,QAAS,KAAM,WAAY,EACnC,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,QAAS,KAAM,YAAa,CACtC,CACF,CACF,CACF,EACA,CACE,KAAM,QACN,KAAM,iBACN,WAAY,CACV,CAAE,KAAM,UAAW,KAAM,WAAY,EACrC,CAAE,KAAM,QAAS,KAAM,eAAgB,EACvC,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,UAAW,KAAM,gBAAiB,EAC1C,CAAE,KAAM,UAAW,KAAM,SAAU,EACnC,CACE,KAAM,QACN,KAAM,kBACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,QAAS,KAAM,WAAY,EACnC,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,QAAS,KAAM,YAAa,CACtC,CACF,CACF,CACF,CACF,CACF,CACF,EACA,CACE,CACE,eAAgBP,EAAiBE,CAAc,EAC/C,cAAe,CACb,GAAGF,EAAiBG,CAAa,EACjC,WAAYA,EAAc,YAAc,CAC1C,EACA,cAAe,CACb,GAAGH,EAAiBI,CAAa,EACjC,WAAYA,EAAc,YAAc,CAC1C,EACA,gBAAiB,CACf,GAAGJ,EAAiBK,CAAe,EACnC,WAAYA,EAAgB,YAAc,CAC5C,EACA,eAAgB,CACd,GAAGL,EAAiBM,CAAc,EAClC,WAAYA,EAAe,YAAc,CAC3C,CACF,CACF,CAAA,CAEJ"}
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 functions from '@boostxyz/signatures/functions';\nimport {\n type Abi,\n type AbiEvent,\n type AbiFunction,\n type Address,\n type ContractEventName,\n type ContractFunctionName,\n type GetLogsReturnType,\n type GetTransactionParameters,\n type Hex,\n type Log,\n type PublicClient,\n decodeFunctionData,\n encodeAbiParameters,\n fromHex,\n isAddressEqual,\n trim,\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 DecodedArgsMalformedError,\n FieldValueNotComparableError,\n FieldValueUndefinedError,\n FunctionDataDecodeError,\n InvalidNumericalCriteriaError,\n NoEventActionStepsProvidedError,\n TooManyEventActionStepsProvidedError,\n UnparseableAbiParamError,\n UnrecognizedFilterTypeError,\n} from '../errors';\nimport {\n type GetLogsParams,\n type Overwrite,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\n/*\n * Action Event Payloads\n */\n\n/**\n * Filter types used to determine how criteria are evaluated.\n *\n * @export\n * @enum {number}\n */\nexport enum FilterType {\n EQUAL = 0,\n NOT_EQUAL = 1,\n GREATER_THAN = 2,\n LESS_THAN = 3,\n CONTAINS = 4,\n REGEX = 5,\n}\n\n/**\n * The primitive types supported for filtering.\n *\n * @export\n * @enum {number}\n */\nexport enum PrimitiveType {\n UINT = 0,\n ADDRESS = 1,\n BYTES = 2,\n STRING = 3,\n}\n\n/**\n * Object representation of a `Criteria` struct used in event actions.\n *\n * @export\n * @interface Criteria\n * @typedef {Criteria}\n */\nexport interface Criteria {\n /**\n * The filter type used in this criteria.\n *\n * @type {FilterType}\n */\n filterType: FilterType;\n /**\n * The primitive type of the field being filtered.\n *\n * @type {PrimitiveType}\n */\n fieldType: PrimitiveType;\n /**\n * The index in the logs argument array where the field is located.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The filter data used for complex filtering.\n *\n * @type {Hex}\n */\n filterData: Hex;\n}\n\n/**\n * Whether a given signature is an event or function\n *\n * @export\n * @enum {number}\n */\nexport enum SignatureType {\n EVENT = 0,\n FUNC = 1,\n}\n\n/**\n * The payload describing how claimants are identified\n *\n * @export\n * @interface ActionClaimant\n * @typedef {ActionClaimant}\n */\nexport interface ActionClaimant {\n /**\n * Whether claimaint is inferred from event or function\n *\n * @type {SignatureType}\n */\n signatureType: SignatureType;\n /**\n * The 4 byte signature of the event or function\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * The index corresponding to claimant.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The address of the target contract\n *\n * @type {Address}\n */\n targetContract: Address;\n /**\n * The chain id of the target contract.\n * @type {number}\n */\n chainid: number;\n}\n\n/**\n * Object representation of an `ActionStep` struct used in event actions.\n *\n * @export\n * @interface ActionStep\n * @typedef {ActionStep}\n */\nexport interface ActionStep {\n /**\n * The signature of the event.\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * Whether claimaint is inferred from event or function\n *\n * @type {SignatureType}\n */\n signatureType: SignatureType;\n /**\n * The type of action being performed.\n *\n * @type {number}\n */\n actionType?: number;\n /**\n * The address of the target contract.\n *\n * @type {Address}\n */\n targetContract: Address;\n /**\n * The chain id of the target contract.\n * @type {number}\n */\n chainid: number;\n /**\n * The criteria used for this action step.\n *\n * @type {Criteria}\n */\n actionParameter: Criteria;\n}\n\n/**\n * Parameters for validating an event step.\n *\n * This type omits the 'address' field from GetLogsParams and adds optional fields\n * for logs and known events.\n *\n * @typedef {Object} ValidateEventStepParams\n * @property {Log[]} [logs]\n * @property {Record<Hex, AbiEvent>} [knownEvents]\n * @property {number} [fromBlock]\n * @property {number} [toBlock]\n * @property {Hex} [blockHash]\n * @property {Abi} abi\n * @property {ContractEventName<Abi>} eventName\n */\nexport type ValidateEventStepParams = Omit<\n GetLogsParams<Abi, ContractEventName<Abi>> & {\n logs?: Log[];\n knownEvents?: Record<Hex, AbiEvent>;\n },\n 'address'\n>;\n\n/**\n * Parameters for validating a function step.\n *\n * This type includes all parameters required to get a transaction.\n *\n * @typedef {Object} ValidateFunctionStepParams\n * @property {Hex} hash\n * @property {number} [chainId]\n */\nexport type ValidateFunctionStepParams = GetTransactionParameters;\n\n/**\n * You can either supply a simplified version of the payload, or one that explicitly declares action steps.\n *\n * @export\n * @typedef {EventActionPayload}\n */\nexport type EventActionPayload =\n | EventActionPayloadSimple\n | EventActionPayloadRaw;\n\nexport interface EventActionPayloadSimple {\n /**\n * The payload describing how claimants are identified\n *\n * @type {ActionClaimant}\n */\n actionClaimant: ActionClaimant;\n\n /**\n * Up to 4 action steps.\n * If you supply less than 4, then the last step will be reused to satisfy the EventAction.InitPayload\n * Any more than 4 will throw an error.\n *\n * @type {ActionStep[]}\n */\n actionSteps: ActionStep[];\n}\n\nexport type ActionStepTuple = [ActionStep, ActionStep, ActionStep, ActionStep];\n\n/**\n * Typeguard to determine if a user is supplying a simple or raw EventActionPayload\n *\n * @param {*} opts\n * @returns {opts is EventActionPayloadSimple}\n */\nexport function isEventActionPayloadSimple(\n opts: EventActionPayload,\n): opts is EventActionPayloadSimple {\n return Array.isArray((opts as EventActionPayloadSimple).actionSteps);\n}\n\n/**\n * Object representation of an `InitPayload` struct used to initialize event actions.\n *\n * @export\n * @interface EventActionPayloadRaw\n * @typedef {EventActionPayloadRaw}\n */\nexport interface EventActionPayloadRaw {\n /**\n * The payload describing how claimants are identified\n *\n * @type {ActionClaimant}\n */\n actionClaimant: ActionClaimant;\n /**\n * The first action step.\n *\n * @type {ActionStep}\n */\n actionStepOne: ActionStep;\n /**\n * The second action step.\n *\n * @type {ActionStep}\n */\n actionStepTwo: ActionStep;\n /**\n * The third action step.\n *\n * @type {ActionStep}\n */\n actionStepThree: ActionStep;\n /**\n * The fourth action step.\n *\n * @type {ActionStep}\n */\n actionStepFour: ActionStep;\n}\n\n/**\n * Array of event logs to pass into TxParams\n * @export\n * @typedef {EventLogs}\n */\nexport type EventLogs = GetLogsReturnType<AbiEvent, AbiEvent[], true>;\n\n/**\n * Getter params from the event action contract\n *\n * @export\n * @typedef {ReadEventActionParams}\n * @param {fnName} fnName - The getter function name\n */\nexport type ReadEventActionParams<\n fnName extends ContractFunctionName<typeof eventActionAbi, 'pure' | 'view'>,\n> = ReadParams<typeof eventActionAbi, fnName>;\n\ntype TxParams = ValidateEventStepParams | ValidateFunctionStepParams;\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 {?ReadEventActionParams<'getActionStep'>} [params]\n * @returns {Promise<ActionStep>}\n */\n public async getActionStep(\n index: number,\n params?: ReadEventActionParams<'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 {?ReadEventActionParams<'getActionSteps'>} [params]\n * @returns {Promise<ActionStep[]>}\n */\n public async getActionSteps(\n params?: ReadEventActionParams<'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 RawActionStep[];\n return _dedupeActionSteps(steps.map(_fromRawActionStep));\n }\n\n /**\n * Gets the count of action events\n *\n * @public\n * @async\n * @param {?ReadEventActionParams<'getActionStepsCount'>} [params]\n * @returns {Promise<bigint>}\n */\n public async getActionStepsCount(\n params?: ReadEventActionParams<'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 {?ReadEventActionParams<'getActionClaimant'>} [params]\n * @returns {Promise<ActionClaimant>}\n */\n public async getActionClaimant(\n params?: ReadEventActionParams<'getActionClaimant'>,\n ) {\n const result = (await readEventActionGetActionClaimant(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n ...params,\n })) as RawActionClaimant;\n return _fromRawActionStep(result);\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 await 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 {?TxParams} [params]\n * @returns {Promise<boolean>}\n */\n public async validateActionSteps(params?: TxParams) {\n const actionSteps = await this.getActionSteps();\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 or function calls.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of being fetched with the configured client.\n * For functions a hash is required.\n *\n * @public\n * @async\n * @param {ActionStep} actionStep - The action step to validate. Can be a function of event step.\n * @param {?TxParams & { chainId?: number }} [params] - Additional parameters for validation, including known events, logs, and chain ID.\n * @returns {Promise<boolean>}\n */\n public async isActionStepValid(\n actionStep: ActionStep,\n params?: TxParams & { chainId?: number },\n ) {\n if (actionStep.signatureType === SignatureType.EVENT) {\n return await this.isActionEventValid(actionStep, params);\n }\n if (actionStep.signatureType === SignatureType.FUNC) {\n return await this.isActionFunctionValid(\n actionStep,\n params as ValidateFunctionStepParams,\n );\n }\n return false;\n }\n\n /**\n * Validates a single action event with a given criteria against logs.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of being fetched with the configured client.\n *\n * @public\n * @async\n * @param {ActionStep} actionStep - The action step containing the event to validate.\n * @param {?ValidateEventStepParams & { chainId?: number }} [params] - Additional parameters for validation, including known events, logs, and chain ID.\n * @returns {Promise<boolean>} Resolves to true if the action event is valid, throws if input is invalid, otherwise false.\n */\n public async isActionEventValid(\n actionStep: ActionStep,\n params?: ValidateEventStepParams & { chainId?: number },\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\n if (!event) {\n throw new Error(`No known ABI for given event signature: ${signature}`);\n }\n\n if (this.isArraylikeIndexed(actionStep, event)) {\n // If the field is indexed, we can't filter on it\n throw new UnparseableAbiParamError(\n actionStep.actionParameter.fieldIndex,\n event,\n );\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 as EventLogs[0])) {\n return false;\n }\n }\n return true;\n }\n /**\n * Validates a single action function with a given criteria against the transaction input.\n * If a transaction hash is provided in the optional `params` argument, then the transaction\n * will be fetched and decoded using the configured client.\n *\n * @public\n * @async\n * @param {ActionStep} actionStep - The action step containing the function to validate.\n * @param {?ValidateFunctionStepParams & { chainId?: number }} [params] - Additional parameters for validation, including known events, transaction hash, and chain ID.\n * @returns {Promise<boolean>} Resolves to true if the action function is valid, throws if the inputs are invalid, otherwise false.\n */\n public async isActionFunctionValid(\n actionStep: ActionStep,\n params?: ValidateFunctionStepParams & { chainId?: number },\n ) {\n const criteria = actionStep.actionParameter;\n const signature = trim(actionStep.signature);\n if (!params || !params?.hash) {\n // Should we return false in this case?\n throw new Error('Hash is required for function validation');\n }\n const client = this._config.getClient({\n chainId: params?.chainId,\n }) as PublicClient;\n // Fetch the transaction receipt and decode the function input using `viem` utilities\n const transaction = await client.getTransaction({ hash: params.hash });\n const func = (functions.abi as Record<Hex, AbiFunction>)[\n signature\n ] as AbiFunction;\n\n if (!func) {\n throw new Error(\n `No known ABI for given function signature: ${signature}`,\n );\n }\n let decodedData;\n try {\n decodedData = decodeFunctionData({\n abi: [func],\n data: transaction.input,\n });\n } catch (e) {\n throw new FunctionDataDecodeError([func], e as Error);\n }\n\n // Validate the criteria against decoded arguments using fieldIndex\n const decodedArgs = decodedData.args;\n\n if (!decodedArgs || !decodedData) return false;\n\n if (\n !this.validateFunctionAgainstCriteria(\n criteria,\n decodedArgs as (string | bigint)[],\n )\n ) {\n return false;\n }\n\n return true;\n }\n /**\n * Validates a field against a given criteria.\n *\n * @param {Criteria} criteria - The criteria to validate against.\n * @param {string | bigint} fieldValue - The field value to validate.\n * @returns {Promise<boolean>} - Returns true if the field passes the criteria, false otherwise.\n */\n public validateFieldAgainstCriteria(\n criteria: Criteria,\n fieldValue: string | bigint | Hex,\n input:\n | { log: EventLogs[0] }\n | { decodedArgs: readonly (string | bigint)[] },\n ): boolean {\n // Type narrow based on criteria.filterType\n switch (criteria.filterType) {\n case FilterType.EQUAL:\n if (criteria.fieldType === PrimitiveType.ADDRESS) {\n return isAddressEqual(criteria.filterData, fieldValue as Address);\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({\n ...input,\n criteria,\n fieldValue,\n });\n\n case FilterType.LESS_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) < BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({\n ...input,\n criteria,\n fieldValue,\n });\n\n case FilterType.CONTAINS:\n if (\n criteria.fieldType === PrimitiveType.BYTES ||\n criteria.fieldType === PrimitiveType.STRING\n ) {\n let substring;\n if (criteria.fieldType === PrimitiveType.STRING) {\n substring = fromHex(criteria.filterData, 'string');\n } else {\n // truncate the `0x` prefix\n substring = criteria.filterData.slice(2);\n }\n return (fieldValue as string).includes(substring);\n }\n throw new FieldValueNotComparableError({\n ...input,\n criteria,\n fieldValue,\n });\n\n case FilterType.REGEX:\n if (typeof fieldValue !== 'string') {\n throw new FieldValueNotComparableError({\n ...input,\n criteria,\n fieldValue,\n });\n }\n\n if (criteria.fieldType === PrimitiveType.STRING) {\n // fieldValue is decoded by the ABI\n const regexString = fromHex(criteria.filterData, 'string');\n return new RegExp(regexString).test(fieldValue);\n }\n\n default:\n throw new UnrecognizedFilterTypeError({\n ...input,\n criteria,\n fieldValue,\n });\n }\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 validateLogAgainstCriteria(\n criteria: Criteria,\n log: EventLogs[0],\n ): boolean {\n if (!Array.isArray(log.args) || log.args.length <= criteria.fieldIndex) {\n throw new DecodedArgsMalformedError({\n log,\n criteria,\n fieldValue: undefined,\n });\n }\n\n const fieldValue = log.args.at(criteria.fieldIndex);\n if (fieldValue === undefined) {\n throw new FieldValueUndefinedError({ log, criteria, fieldValue });\n }\n return this.validateFieldAgainstCriteria(criteria, fieldValue, { log });\n }\n\n /**\n * Validates a function's decoded arguments against a given criteria.\n *\n * @param {Criteria} criteria - The criteria to validate against.\n * @param {unknown[]} decodedArgs - The decoded arguments of the function call.\n * @returns {Promise<boolean>} - Returns true if the decoded argument passes the criteria, false otherwise.\n */\n public validateFunctionAgainstCriteria(\n criteria: Criteria,\n decodedArgs: readonly (string | bigint)[],\n ): boolean {\n const fieldValue = decodedArgs[criteria.fieldIndex];\n if (fieldValue === undefined) {\n throw new FieldValueUndefinedError({\n criteria,\n fieldValue,\n });\n }\n return this.validateFieldAgainstCriteria(criteria, fieldValue, {\n decodedArgs,\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: ActionStep[] = 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: ActionStepTuple = 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.at(-1);\n }) as ActionStepTuple;\n rawPayload = {\n actionClaimant: payload.actionClaimant,\n actionStepOne: steps[0],\n actionStepTwo: steps[1],\n actionStepThree: steps[2],\n actionStepFour: steps[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 public isArraylikeIndexed(step: ActionStep, event: AbiEvent) {\n if (\n (step.actionParameter.fieldType === PrimitiveType.STRING ||\n step.actionParameter.fieldType === PrimitiveType.BYTES) &&\n event.inputs[step.actionParameter.fieldIndex]?.indexed\n ) {\n return true;\n }\n return false;\n }\n}\n\nfunction _dedupeActionSteps(_steps: ActionStep[]): ActionStep[] {\n const steps: ActionStep[] = [],\n signatures: Record<string, boolean> = {};\n for (let step of _steps) {\n const signature = JSON.stringify(step);\n if (signatures[signature]) continue;\n steps.push(step);\n signatures[signature] = true;\n }\n return steps;\n}\ntype RawActionStep = Overwrite<ActionStep, { chainid: bigint }>;\ntype RawActionClaimant = Overwrite<ActionClaimant, { chainid: bigint }>;\n\nfunction _toRawActionStep<T extends ActionStep | ActionClaimant>(obj: T) {\n return {\n ...obj,\n chainid: BigInt(obj.chainid),\n };\n}\n\nfunction _fromRawActionStep<T extends RawActionStep | RawActionClaimant>(\n obj: T,\n) {\n if (obj.chainid > BigInt(Number.MAX_SAFE_INTEGER)) {\n throw new Error('Chain ID exceeds max safe integer');\n }\n\n return {\n ...obj,\n chainid: Number(obj.chainid),\n };\n}\n\n/**\n * Typeguard to determine if a user is supplying a simple or raw EventActionPayload\n *\n * @param {*} opts\n * @returns {opts is EventActionPayloadSimple}\n */\nfunction _isEventActionPayloadSimple(\n opts: EventActionPayload,\n): opts is EventActionPayloadSimple {\n return Array.isArray((opts as EventActionPayloadSimple).actionSteps);\n}\n\n/**\n * Function to properly encode an event action payload.\n *\n * @param {InitPayload} param0\n * @param {ActionStep} param0.actionStepOne - The first action step to initialize.\n * @param {ActionStep} param0.actionStepTwo - The second action step to initialize.\n * @param {ActionStep} param0.actionStepThree - The third action step to initialize.\n * @param {ActionStep} param0.actionStepFour - The fourth action step to initialize.\n * @returns {Hex}\n */\nexport function prepareEventActionPayload({\n actionClaimant,\n actionStepOne,\n actionStepTwo,\n actionStepThree,\n actionStepFour,\n}: EventActionPayloadRaw) {\n // note chainIds are technically uint256 but viem treats them (safely) as numbers,\n // so we encode them as uint32 here to avoid downcast issues\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayload',\n components: [\n {\n type: 'tuple',\n name: 'actionClaimant',\n components: [\n { type: 'uint8', name: 'signatureType' },\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint256', name: 'chainid' },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepOne',\n components: [\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint256', name: 'chainid' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepTwo',\n components: [\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint256', name: 'chainid' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepThree',\n components: [\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint256', name: 'chainid' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepFour',\n components: [\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint256', name: 'chainid' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n ],\n },\n ],\n [\n {\n actionClaimant: _toRawActionStep(actionClaimant),\n actionStepOne: {\n ..._toRawActionStep(actionStepOne),\n actionType: actionStepOne.actionType || 0,\n },\n actionStepTwo: {\n ..._toRawActionStep(actionStepTwo),\n actionType: actionStepTwo.actionType || 0,\n },\n actionStepThree: {\n ..._toRawActionStep(actionStepThree),\n actionType: actionStepThree.actionType || 0,\n },\n actionStepFour: {\n ..._toRawActionStep(actionStepFour),\n actionType: actionStepFour.actionType || 0,\n },\n },\n ],\n );\n}\n"],"names":["FilterType","PrimitiveType","SignatureType","isEventActionPayloadSimple","opts","_EventAction","DeployableTarget","eventActionAbi","index","params","steps","readEventActionGetActionSteps","_dedupeActionSteps","_fromRawActionStep","result","readEventActionGetActionClaimant","data","request","simulateEventActionExecute","writeEventActionExecute","actionSteps","actionStep","criteria","signature","event","events","UnparseableAbiParamError","targetContract","logs","getLogs","log","trim","transaction","func","functions","decodedData","decodeFunctionData","e","FunctionDataDecodeError","decodedArgs","fieldValue","input","isAddressEqual","InvalidNumericalCriteriaError","substring","fromHex","FieldValueNotComparableError","regexString","UnrecognizedFilterTypeError","DecodedArgsMalformedError","FieldValueUndefinedError","_payload","_options","payload","options","rawPayload","tmpSteps","step","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","_","i","bytecode","prepareEventActionPayload","_a","RegistryType","EventAction","_steps","signatures","_toRawActionStep","obj","actionClaimant","actionStepOne","actionStepTwo","actionStepThree","actionStepFour","encodeAbiParameters"],"mappings":"6ipBA+DY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,MAAQ,CAAR,EAAA,QACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YACAA,EAAAA,EAAA,aAAe,CAAf,EAAA,eACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YACAA,EAAAA,EAAA,SAAW,CAAX,EAAA,WACAA,EAAAA,EAAA,MAAQ,CAAR,EAAA,QANUA,IAAAA,GAAA,CAAA,CAAA,EAeAC,GAAAA,IACVA,EAAAA,EAAA,KAAO,CAAP,EAAA,OACAA,EAAAA,EAAA,QAAU,CAAV,EAAA,UACAA,EAAAA,EAAA,MAAQ,CAAR,EAAA,QACAA,EAAAA,EAAA,OAAS,CAAT,EAAA,SAJUA,IAAAA,GAAA,CAAA,CAAA,EA+CAC,GAAAA,IACVA,EAAAA,EAAA,MAAQ,CAAR,EAAA,QACAA,EAAAA,EAAA,KAAO,CAAP,EAAA,OAFUA,IAAAA,GAAA,CAAA,CAAA,EA+JL,SAASC,EACdC,EACkC,CAC3B,OAAA,MAAM,QAASA,EAAkC,WAAW,CACrE,CAsEO,MAAMC,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,G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,KAAM,YAAa,EACpC,CAAE,KAAM,UAAW,KAAM,gBAAiB,EAC1C,CAAE,KAAM,UAAW,KAAM,SAAU,EACnC,CACE,KAAM,QACN,KAAM,kBACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,QAAS,KAAM,WAAY,EACnC,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,QAAS,KAAM,YAAa,CACtC,CACF,CACF,CACF,EACA,CACE,KAAM,QACN,KAAM,iBACN,WAAY,CACV,CAAE,KAAM,UAAW,KAAM,WAAY,EACrC,CAAE,KAAM,QAAS,KAAM,eAAgB,EACvC,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,UAAW,KAAM,gBAAiB,EAC1C,CAAE,KAAM,UAAW,KAAM,SAAU,EACnC,CACE,KAAM,QACN,KAAM,kBACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,QAAS,KAAM,WAAY,EACnC,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,QAAS,KAAM,YAAa,CACtC,CACF,CACF,CACF,CACF,CACF,CACF,EACA,CACE,CACE,eAAgBP,EAAiBE,CAAc,EAC/C,cAAe,CACb,GAAGF,EAAiBG,CAAa,EACjC,WAAYA,EAAc,YAAc,CAC1C,EACA,cAAe,CACb,GAAGH,EAAiBI,CAAa,EACjC,WAAYA,EAAc,YAAc,CAC1C,EACA,gBAAiB,CACf,GAAGJ,EAAiBK,CAAe,EACnC,WAAYA,EAAgB,YAAc,CAC5C,EACA,eAAgB,CACd,GAAGL,EAAiBM,CAAc,EAClC,WAAYA,EAAe,YAAc,CAC3C,CACF,CACF,CAAA,CAEJ"}
@@ -1,5 +1,5 @@
1
1
  import { eventActionAbi } from '@boostxyz/evm';
2
- import { type Abi, type AbiEvent, type Address, type ContractEventName, type Hex, type Log } from 'viem';
2
+ import { type Abi, type AbiEvent, type Address, type ContractEventName, type ContractFunctionName, type GetLogsReturnType, type GetTransactionParameters, type Hex, type Log } from 'viem';
3
3
  import type { DeployableOptions, GenericDeployableParams } from '../Deployable/Deployable';
4
4
  import { DeployableTarget } from '../Deployable/DeployableTarget';
5
5
  import { type GetLogsParams, type ReadParams, RegistryType, type WriteParams } from '../utils';
@@ -14,7 +14,8 @@ export declare enum FilterType {
14
14
  NOT_EQUAL = 1,
15
15
  GREATER_THAN = 2,
16
16
  LESS_THAN = 3,
17
- CONTAINS = 4
17
+ CONTAINS = 4,
18
+ REGEX = 5
18
19
  }
19
20
  /**
20
21
  * The primitive types supported for filtering.
@@ -153,6 +154,35 @@ export interface ActionStep {
153
154
  */
154
155
  actionParameter: Criteria;
155
156
  }
157
+ /**
158
+ * Parameters for validating an event step.
159
+ *
160
+ * This type omits the 'address' field from GetLogsParams and adds optional fields
161
+ * for logs and known events.
162
+ *
163
+ * @typedef {Object} ValidateEventStepParams
164
+ * @property {Log[]} [logs]
165
+ * @property {Record<Hex, AbiEvent>} [knownEvents]
166
+ * @property {number} [fromBlock]
167
+ * @property {number} [toBlock]
168
+ * @property {Hex} [blockHash]
169
+ * @property {Abi} abi
170
+ * @property {ContractEventName<Abi>} eventName
171
+ */
172
+ export type ValidateEventStepParams = Omit<GetLogsParams<Abi, ContractEventName<Abi>> & {
173
+ logs?: Log[];
174
+ knownEvents?: Record<Hex, AbiEvent>;
175
+ }, 'address'>;
176
+ /**
177
+ * Parameters for validating a function step.
178
+ *
179
+ * This type includes all parameters required to get a transaction.
180
+ *
181
+ * @typedef {Object} ValidateFunctionStepParams
182
+ * @property {Hex} hash
183
+ * @property {number} [chainId]
184
+ */
185
+ export type ValidateFunctionStepParams = GetTransactionParameters;
156
186
  /**
157
187
  * You can either supply a simplified version of the payload, or one that explicitly declares action steps.
158
188
  *
@@ -223,6 +253,21 @@ export interface EventActionPayloadRaw {
223
253
  */
224
254
  actionStepFour: ActionStep;
225
255
  }
256
+ /**
257
+ * Array of event logs to pass into TxParams
258
+ * @export
259
+ * @typedef {EventLogs}
260
+ */
261
+ export type EventLogs = GetLogsReturnType<AbiEvent, AbiEvent[], true>;
262
+ /**
263
+ * Getter params from the event action contract
264
+ *
265
+ * @export
266
+ * @typedef {ReadEventActionParams}
267
+ * @param {fnName} fnName - The getter function name
268
+ */
269
+ export type ReadEventActionParams<fnName extends ContractFunctionName<typeof eventActionAbi, 'pure' | 'view'>> = ReadParams<typeof eventActionAbi, fnName>;
270
+ type TxParams = ValidateEventStepParams | ValidateFunctionStepParams;
226
271
  /**
227
272
  * A generic event action
228
273
  *
@@ -570,37 +615,37 @@ export declare class EventAction extends DeployableTarget<EventActionPayload, ty
570
615
  * @public
571
616
  * @async
572
617
  * @param {number} index The index of the action event to retrieve
573
- * @param {?ReadParams<typeof eventActionAbi, 'getActionStep'>} [params]
618
+ * @param {?ReadEventActionParams<'getActionStep'>} [params]
574
619
  * @returns {Promise<ActionStep>}
575
620
  */
576
- getActionStep(index: number, params?: ReadParams<typeof eventActionAbi, 'getActionStep'>): Promise<ActionStep | undefined>;
621
+ getActionStep(index: number, params?: ReadEventActionParams<'getActionStep'>): Promise<ActionStep | undefined>;
577
622
  /**
578
623
  * Gets all action events
579
624
  *
580
625
  * @public
581
626
  * @async
582
- * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'>} [params]
627
+ * @param {?ReadEventActionParams<'getActionSteps'>} [params]
583
628
  * @returns {Promise<ActionStep[]>}
584
629
  */
585
- getActionSteps(params?: ReadParams<typeof eventActionAbi, 'getActionSteps'>): Promise<ActionStep[]>;
630
+ getActionSteps(params?: ReadEventActionParams<'getActionSteps'>): Promise<ActionStep[]>;
586
631
  /**
587
632
  * Gets the count of action events
588
633
  *
589
634
  * @public
590
635
  * @async
591
- * @param {?ReadParams<typeof eventActionAbi, 'getActionStepsCount'>} [params]
636
+ * @param {?ReadEventActionParams<'getActionStepsCount'>} [params]
592
637
  * @returns {Promise<bigint>}
593
638
  */
594
- getActionStepsCount(params?: ReadParams<typeof eventActionAbi, 'getActionStepsCount'>): Promise<number>;
639
+ getActionStepsCount(params?: ReadEventActionParams<'getActionStepsCount'>): Promise<number>;
595
640
  /**
596
641
  * Retrieves the payload describing how claimants can be identified from logs or function calls.
597
642
  *
598
643
  * @public
599
644
  * @async
600
- * @param {?ReadParams<typeof eventActionAbi, 'getActionClaimant'>} [params]
645
+ * @param {?ReadEventActionParams<'getActionClaimant'>} [params]
601
646
  * @returns {Promise<ActionClaimant>}
602
647
  */
603
- getActionClaimant(params?: ReadParams<typeof eventActionAbi, 'getActionClaimant'>): Promise<Pick<ActionClaimant, "signatureType" | "signature" | "fieldIndex" | "targetContract"> & {
648
+ getActionClaimant(params?: ReadEventActionParams<'getActionClaimant'>): Promise<Pick<ActionClaimant, "signatureType" | "signature" | "fieldIndex" | "targetContract"> & {
604
649
  chainid: bigint;
605
650
  } & {
606
651
  chainid: number;
@@ -634,42 +679,79 @@ export declare class EventAction extends DeployableTarget<EventActionPayload, ty
634
679
  *
635
680
  * @public
636
681
  * @async
637
- * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'> &
638
- * GetLogsParams<Abi, ContractEventName<Abi>> & {
639
- * knownEvents?: Record<Hex, AbiEvent>;
640
- * logs?: Log[];
641
- * }} [params]
682
+ * @param {?TxParams} [params]
642
683
  * @returns {Promise<boolean>}
643
684
  */
644
- validateActionSteps(params?: ReadParams<typeof eventActionAbi, 'getActionSteps'> & GetLogsParams<Abi, ContractEventName<Abi>> & {
645
- knownEvents?: Record<Hex, AbiEvent>;
646
- logs?: Log[];
647
- }): Promise<boolean>;
685
+ validateActionSteps(params?: TxParams): Promise<boolean>;
648
686
  /**
649
- * Validates a single action step with a given criteria against logs.
650
- * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.
687
+ * Validates a single action step with a given criteria against logs or function calls.
688
+ * If logs are provided in the optional `params` argument, then those logs will be used instead of being fetched with the configured client.
689
+ * For functions a hash is required.
651
690
  *
652
691
  * @public
653
692
  * @async
654
- * @param {ActionStep} actionStep
655
- * @param {?GetLogsParams<Abi, ContractEventName<Abi>> & {
656
- * knownEvents?: Record<Hex, AbiEvent>;
657
- * logs?: Log[];
658
- * }} [params]
693
+ * @param {ActionStep} actionStep - The action step to validate. Can be a function of event step.
694
+ * @param {?TxParams & { chainId?: number }} [params] - Additional parameters for validation, including known events, logs, and chain ID.
659
695
  * @returns {Promise<boolean>}
660
696
  */
661
- isActionStepValid(actionStep: ActionStep, params?: GetLogsParams<Abi, ContractEventName<Abi>> & {
662
- knownEvents?: Record<Hex, AbiEvent>;
663
- logs?: Log[];
697
+ isActionStepValid(actionStep: ActionStep, params?: TxParams & {
698
+ chainId?: number;
664
699
  }): Promise<boolean>;
700
+ /**
701
+ * Validates a single action event with a given criteria against logs.
702
+ * If logs are provided in the optional `params` argument, then those logs will be used instead of being fetched with the configured client.
703
+ *
704
+ * @public
705
+ * @async
706
+ * @param {ActionStep} actionStep - The action step containing the event to validate.
707
+ * @param {?ValidateEventStepParams & { chainId?: number }} [params] - Additional parameters for validation, including known events, logs, and chain ID.
708
+ * @returns {Promise<boolean>} Resolves to true if the action event is valid, throws if input is invalid, otherwise false.
709
+ */
710
+ isActionEventValid(actionStep: ActionStep, params?: ValidateEventStepParams & {
711
+ chainId?: number;
712
+ }): Promise<boolean>;
713
+ /**
714
+ * Validates a single action function with a given criteria against the transaction input.
715
+ * If a transaction hash is provided in the optional `params` argument, then the transaction
716
+ * will be fetched and decoded using the configured client.
717
+ *
718
+ * @public
719
+ * @async
720
+ * @param {ActionStep} actionStep - The action step containing the function to validate.
721
+ * @param {?ValidateFunctionStepParams & { chainId?: number }} [params] - Additional parameters for validation, including known events, transaction hash, and chain ID.
722
+ * @returns {Promise<boolean>} Resolves to true if the action function is valid, throws if the inputs are invalid, otherwise false.
723
+ */
724
+ isActionFunctionValid(actionStep: ActionStep, params?: ValidateFunctionStepParams & {
725
+ chainId?: number;
726
+ }): Promise<boolean>;
727
+ /**
728
+ * Validates a field against a given criteria.
729
+ *
730
+ * @param {Criteria} criteria - The criteria to validate against.
731
+ * @param {string | bigint} fieldValue - The field value to validate.
732
+ * @returns {Promise<boolean>} - Returns true if the field passes the criteria, false otherwise.
733
+ */
734
+ validateFieldAgainstCriteria(criteria: Criteria, fieldValue: string | bigint | Hex, input: {
735
+ log: EventLogs[0];
736
+ } | {
737
+ decodedArgs: readonly (string | bigint)[];
738
+ }): boolean;
665
739
  /**
666
740
  * Validates a {@link Log} against a given criteria.
667
741
  *
668
742
  * @param {Criteria} criteria - The criteria to validate against.
669
743
  * @param {Log} log - The Viem event log.
670
- * @returns {boolean} - Returns true if the log passes the criteria, false otherwise.
744
+ * @returns {Promise<boolean>} - Returns true if the log passes the criteria, false otherwise.
745
+ */
746
+ validateLogAgainstCriteria(criteria: Criteria, log: EventLogs[0]): boolean;
747
+ /**
748
+ * Validates a function's decoded arguments against a given criteria.
749
+ *
750
+ * @param {Criteria} criteria - The criteria to validate against.
751
+ * @param {unknown[]} decodedArgs - The decoded arguments of the function call.
752
+ * @returns {Promise<boolean>} - Returns true if the decoded argument passes the criteria, false otherwise.
671
753
  */
672
- validateLogAgainstCriteria(criteria: Criteria, log: Log): boolean;
754
+ validateFunctionAgainstCriteria(criteria: Criteria, decodedArgs: readonly (string | bigint)[]): boolean;
673
755
  /**
674
756
  * @inheritdoc
675
757
  *
@@ -679,6 +761,7 @@ export declare class EventAction extends DeployableTarget<EventActionPayload, ty
679
761
  * @returns {GenericDeployableParams}
680
762
  */
681
763
  buildParameters(_payload?: EventActionPayload, _options?: DeployableOptions): GenericDeployableParams;
764
+ isArraylikeIndexed(step: ActionStep, event: AbiEvent): boolean;
682
765
  }
683
766
  /**
684
767
  * Function to properly encode an event action payload.
@@ -691,4 +774,5 @@ export declare class EventAction extends DeployableTarget<EventActionPayload, ty
691
774
  * @returns {Hex}
692
775
  */
693
776
  export declare function prepareEventActionPayload({ actionClaimant, actionStepOne, actionStepTwo, actionStepThree, actionStepFour, }: EventActionPayloadRaw): `0x${string}`;
777
+ export {};
694
778
  //# sourceMappingURL=EventAction.d.ts.map
@@ -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,EAGT,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,aAAa,EAElB,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAMlB;;;;;GAKG;AACH,oBAAY,UAAU;IACpB,KAAK,IAAI;IACT,SAAS,IAAI;IACb,YAAY,IAAI;IAChB,SAAS,IAAI;IACb,QAAQ,IAAI;CACb;AAED;;;;;GAKG;AACH,oBAAY,aAAa;IACvB,IAAI,IAAI;IACR,OAAO,IAAI;IACX,KAAK,IAAI;IACT,MAAM,IAAI;CACX;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;;;OAIG;IACH,SAAS,EAAE,aAAa,CAAC;IACzB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,EAAE,GAAG,CAAC;CACjB;AAED;;;;;GAKG;AACH,oBAAY,aAAa;IACvB,KAAK,IAAI;IACT,IAAI,IAAI;CACT;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,aAAa,EAAE,aAAa,CAAC;IAC7B;;;;OAIG;IACH,SAAS,EAAE,GAAG,CAAC;IACf;;;;OAIG;IACH,UA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