@boostxyz/sdk 6.1.1 → 6.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +1 -1
- package/dist/BoostCore.cjs +1 -1
- package/dist/BoostCore.js +2 -2
- package/dist/{Budget-Dm6h8giH.cjs → Budget-BjfL8dVX.cjs} +2 -2
- package/dist/{Budget-Dm6h8giH.cjs.map → Budget-BjfL8dVX.cjs.map} +1 -1
- package/dist/{Budget-JjYzHgRx.js → Budget-DD7IPuDx.js} +2 -2
- package/dist/{Budget-JjYzHgRx.js.map → Budget-DD7IPuDx.js.map} +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/{Incentive-DCOhfsid.js → Incentive-V1RjH38L.js} +2 -2
- package/dist/{Incentive-DCOhfsid.js.map → Incentive-V1RjH38L.js.map} +1 -1
- package/dist/{Incentive-BHOurMJr.cjs → Incentive-gVTfsnMB.cjs} +2 -2
- package/dist/{Incentive-BHOurMJr.cjs.map → Incentive-gVTfsnMB.cjs.map} +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.js +2 -2
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
- package/dist/Validators/LimitedSignerValidator.d.ts.map +1 -1
- package/dist/Validators/LimitedSignerValidator.js +37 -41
- package/dist/Validators/LimitedSignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.cjs.map +1 -1
- package/dist/Validators/Validator.d.ts +2 -2
- package/dist/Validators/Validator.d.ts.map +1 -1
- package/dist/Validators/Validator.js +19 -20
- package/dist/Validators/Validator.js.map +1 -1
- package/dist/componentInterfaces-CA1UIqWL.js +20 -0
- package/dist/componentInterfaces-CA1UIqWL.js.map +1 -0
- package/dist/componentInterfaces-aBgBbB7r.cjs +2 -0
- package/dist/componentInterfaces-aBgBbB7r.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/Validators/LimitedSignerValidator.ts +1 -4
- package/src/Validators/Validator.ts +2 -4
- package/dist/componentInterfaces-5Ezh3Pvx.js +0 -19
- package/dist/componentInterfaces-5Ezh3Pvx.js.map +0 -1
- package/dist/componentInterfaces-Cm4Zfn1v.cjs +0 -2
- package/dist/componentInterfaces-Cm4Zfn1v.cjs.map +0 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { S as
|
|
1
|
+
import { S as n, by as m, bz as h, bA as y, bB as p, bC as g, bD as w, bE as A, bF as D } from "../generated-CElkFqkY.js";
|
|
2
2
|
import { encodeAbiParameters as s } from "viem";
|
|
3
|
-
import { signTypedData as D } from "viem/accounts";
|
|
4
3
|
import { L as v } from "../deployments-W_LUj833.js";
|
|
5
4
|
import { DeployableTarget as V } from "../Deployable/DeployableTarget.js";
|
|
6
5
|
import { RegistryType as C } from "../utils.js";
|
|
7
6
|
const z = "0x610120604052348015610010575f80fd5b50306080524660a0525f60c081905260e081905261010052610030610035565b610096565b63409feecd19805460018116156100535763f92ee8a95f526004601cfd5b8160c01c808260011c14610091578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b60805160a05160c05160e0516101005161194d6100c45f395f50505f50505f50505f50505f505061194d5ff3fe60806040526004361061013d575f3560e01c8063715018a6116100bb578063ce5c134f11610071578063f04e283e11610057578063f04e283e1461036d578063f2fde38b14610380578063fee81cf414610393575f80fd5b8063ce5c134f14610339578063d3de6e751461034e575f80fd5b806384b0196e116100a157806384b0196e146102a05780638da5cb5b146102c7578063a1d2756f1461031a575f80fd5b8063715018a61461026a578063736c0d5b14610272575f80fd5b80632f9e058b11610110578063439fab91116100f6578063439fab911461023057806354d1f13d1461024f578063703b690014610257575f80fd5b80632f9e058b146101e65780634359d28a14610211575f80fd5b806301ffc9a7146101415780630668e9d41461017557806325692962146101a257806328d6183b146101ac575b5f80fd5b34801561014c575f80fd5b5061016061015b36600461110d565b6103c4565b60405190151581526020015b60405180910390f35b348015610180575f80fd5b5061019461018f36600461116d565b61041f565b60405190815260200161016c565b6101aa610480565b005b3480156101b7575f80fd5b506040517fc8ebc75800000000000000000000000000000000000000000000000000000000815260200161016c565b3480156101f1575f80fd5b506101946102003660046111a3565b60016020525f908152604090205481565b34801561021c575f80fd5b506101aa61022b366004611202565b6104cd565b34801561023b575f80fd5b506101aa61024a3660046112ac565b6105c9565b6101aa61075e565b6101606102653660046112eb565b610797565b6101aa61080d565b34801561027d575f80fd5b5061016061028c366004611350565b5f6020819052908152604090205460ff1681565b3480156102ab575f80fd5b506102b4610820565b60405161016c97969594939291906113b7565b3480156102d2575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016c565b348015610325575f80fd5b506101aa610334366004611350565b6108c8565b348015610344575f80fd5b5061019460025481565b348015610359575f80fd5b506101946103683660046115c0565b610917565b6101aa61037b366004611350565b6109aa565b6101aa61038e366004611350565b6109e7565b34801561039e575f80fd5b506101946103ad366004611350565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fc8ebc758000000000000000000000000000000000000000000000000000000001480610419575061041982610a0d565b92915050565b6040805160208101859052908101839052606082811b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016908201525f906074016040516020818303038152906040528051906020012090505b9392505050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b6104d5610a62565b82811461050e576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b838110156105c25782828281811061052a5761052a611628565b905060200201602081019061053f9190611655565b5f8087878581811061055357610553611628565b90506020020160208101906105689190611350565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610510565b5050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf601132805460038255801561061a5760018160011c14303b106106115763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f808061062a85870187611684565b925092509250610652835f8151811061064557610645611628565b6020026020010151610a97565b60028190555f5b83518110156106dc5760015f8086848151811061067857610678611628565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610659565b5050600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055508015610759576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f6107a3868686610afa565b6107f6576040517f059b704500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024015b60405180910390fd5b6108038686868686610b54565b9695505050505050565b610815610a62565b61081e5f610cdc565b565b7f0f000000000000000000000000000000000000000000000000000000000000006060805f8080836108b6604080518082018252601681527f4c696d697465645369676e657256616c696461746f72000000000000000000006020808301919091528251808401909352600183527f31000000000000000000000000000000000000000000000000000000000000009083015291565b97989097965046955030945091925090565b6108d0610a62565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b8051602080830191909120604080517ffea51d5bd45bcd3c2ecc3679b43a3b80b0bd0923f8c16f822455b8cdecd9852f93810193909352820186905260ff8516606083015273ffffffffffffffffffffffffffffffffffffffff8416608083015260a08201525f906109a19060c00160405160208183030381529060405280519060200120610d41565b95945050505050565b6109b2610a62565b63389a75e1600c52805f526020600c2080544211156109d857636f5e88185f526004601cfd5b5f90556109e481610cdc565b50565b6109ef610a62565b8060601b610a0457637448fbae5f526004601cfd5b6109e481610cdc565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fc8ebc758000000000000000000000000000000000000000000000000000000001480610419575061041982610d6d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461081e576382b429005f526004601cfd5b73ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b5f80610b0785858561041f565b5f8181526001602081905260408220549293509091610b2591611754565b9050600254811115610b3b575f92505050610479565b5f91825260016020819052604090922055949350505050565b6004545f9073ffffffffffffffffffffffffffffffffffffffff163314610ba7576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610bb48385018561178c565b90505f815f0151806020019051810190610bce919061184c565b90505f610be5898360400151898660200151610917565b905087826040015160ff1611610c395760408083015190517f17c66bc700000000000000000000000000000000000000000000000000000000815260ff9091166004820152602481018990526044016107ed565b815173ffffffffffffffffffffffffffffffffffffffff165f9081526020819052604090205460ff16610c98576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ca46003828a610dc2565b60208201518251610ccf9173ffffffffffffffffffffffffffffffffffffffff909116908390610e50565b9998505050505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f610d4a610f5a565b6719010000000000005f908152601a91909152603a928352604260182092525090565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fb8ce7b22000000000000000000000000000000000000000000000000000000001480610419575061041982611027565b7f3f57fc5c000000000000000000000000000000000000000000000000000000007f4de1225a000000000000000000000000000000000000000000000000000000006007831115610e1957815f528260045260245ffd5b84602052835f5260405f206001841b81541880851c6001166001188015610e4657835f528560045260245ffd5b5090555050505050565b73ffffffffffffffffffffffffffffffffffffffff909216915f831561047957604051835f5260208301516040526040835103610ec9576040830151601b8160ff1c016020528060011b60011c606052506020600160805f60015afa805186183d1517610ec757505f606052604052506001610479565b505b6041835103610f0c5760608301515f1a60205260408301516060526020600160805f60015afa805186183d1517610f0a57505f606052604052506001610479565b505b5f60605280604052631626ba7e60e01b808252846004830152602482016040815284516020018060448501828860045afa505060208160443d01858a5afa9051909114169150509392505050565b5f805f80610fcc604080518082018252601681527f4c696d697465645369676e657256616c696461746f72000000000000000000006020808301919091528251808401909352600183527f31000000000000000000000000000000000000000000000000000000000000009083015291565b8151602092830120815191830191909120604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8152938401929092529082015246606082015230608082015260a09020949350505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f5912b89c0000000000000000000000000000000000000000000000000000000014806104195750610419825f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061041957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610419565b5f6020828403121561111d575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610479575f80fd5b73ffffffffffffffffffffffffffffffffffffffff811681146109e4575f80fd5b5f805f6060848603121561117f575f80fd5b833592506020840135915060408401356111988161114c565b809150509250925092565b5f602082840312156111b3575f80fd5b5035919050565b5f8083601f8401126111ca575f80fd5b50813567ffffffffffffffff8111156111e1575f80fd5b6020830191508360208260051b85010111156111fb575f80fd5b9250929050565b5f805f8060408587031215611215575f80fd5b843567ffffffffffffffff81111561122b575f80fd5b611237878288016111ba565b909550935050602085013567ffffffffffffffff811115611256575f80fd5b611262878288016111ba565b95989497509550505050565b5f8083601f84011261127e575f80fd5b50813567ffffffffffffffff811115611295575f80fd5b6020830191508360208285010111156111fb575f80fd5b5f80602083850312156112bd575f80fd5b823567ffffffffffffffff8111156112d3575f80fd5b6112df8582860161126e565b90969095509350505050565b5f805f805f608086880312156112ff575f80fd5b853594506020860135935060408601356113188161114c565b9250606086013567ffffffffffffffff811115611333575f80fd5b61133f8882890161126e565b969995985093965092949392505050565b5f60208284031215611360575f80fd5b81356104798161114c565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b7fff000000000000000000000000000000000000000000000000000000000000008816815260e060208201525f6113f160e083018961136b565b8281036040840152611403818961136b565b6060840188905273ffffffffffffffffffffffffffffffffffffffff8716608085015260a0840186905283810360c0850152845180825260208087019350909101905f5b81811015611465578351835260209384019390920191600101611447565b50909b9a5050505050505050505050565b60ff811681146109e4575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516060810167ffffffffffffffff811182821017156114d4576114d4611484565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561152157611521611484565b604052919050565b5f67ffffffffffffffff82111561154257611542611484565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f82601f83011261157d575f80fd5b813561159061158b82611529565b6114da565b8181528460208386010111156115a4575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f80608085870312156115d3575f80fd5b8435935060208501356115e581611476565b925060408501356115f58161114c565b9150606085013567ffffffffffffffff811115611610575f80fd5b61161c8782880161156e565b91505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611665575f80fd5b81358015158114610479575f80fd5b803561167f8161114c565b919050565b5f805f60608486031215611696575f80fd5b833567ffffffffffffffff8111156116ac575f80fd5b8401601f810186136116bc575f80fd5b803567ffffffffffffffff8111156116d6576116d6611484565b8060051b6116e6602082016114da565b91825260208184018101929081019089841115611701575f80fd5b6020850194505b8385101561172f578435925061171d8361114c565b82825260209485019490910190611708565b809750505050505061174360208501611674565b929592945050506040919091013590565b80820180821115610419577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6020828403121561179c575f80fd5b813567ffffffffffffffff8111156117b2575f80fd5b8201604081850312156117c3575f80fd5b6040805190810167ffffffffffffffff811182821017156117e6576117e6611484565b604052813567ffffffffffffffff8111156117ff575f80fd5b61180b8682850161156e565b825250602082013567ffffffffffffffff811115611827575f80fd5b6118338682850161156e565b602083015250949350505050565b805161167f81611476565b5f6020828403121561185c575f80fd5b815167ffffffffffffffff811115611872575f80fd5b820160608185031215611883575f80fd5b61188b6114b1565b81516118968161114c565b8152602082015167ffffffffffffffff8111156118b1575f80fd5b8201601f810186136118c1575f80fd5b80516118cf61158b82611529565b8181528760208385010111156118e3575f80fd5b8160208401602083015e5f6020838301015280602085015250505061190a60408301611841565b604082015294935050505056fea264697066735822122063c3658c9a3036ea162ceac551ee8d1dfba428fee8f20bcb409727cb88030d5a64736f6c634300081a0033", c = class c extends V {
|
|
8
7
|
constructor() {
|
|
9
|
-
super(...arguments), this.abi =
|
|
8
|
+
super(...arguments), this.abi = n;
|
|
10
9
|
}
|
|
11
10
|
/**
|
|
12
11
|
* The set of authorized signers
|
|
@@ -18,7 +17,7 @@ const z = "0x610120604052348015610010575f80fd5b50306080524660a0525f60c081905260e
|
|
|
18
17
|
* @returns {Promise<boolean>}
|
|
19
18
|
*/
|
|
20
19
|
async signers(f, b) {
|
|
21
|
-
return await
|
|
20
|
+
return await m(this._config, {
|
|
22
21
|
address: this.assertValidAddress(),
|
|
23
22
|
args: [f],
|
|
24
23
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -35,7 +34,7 @@ const z = "0x610120604052348015610010575f80fd5b50306080524660a0525f60c081905260e
|
|
|
35
34
|
* @returns {Promise<Hex>}
|
|
36
35
|
*/
|
|
37
36
|
async hashSignerData(f, b) {
|
|
38
|
-
return await
|
|
37
|
+
return await h(this._config, {
|
|
39
38
|
address: this.assertValidAddress(),
|
|
40
39
|
args: [
|
|
41
40
|
f.boostId,
|
|
@@ -84,7 +83,7 @@ const z = "0x610120604052348015610010575f80fd5b50306080524660a0525f60c081905260e
|
|
|
84
83
|
...b
|
|
85
84
|
}
|
|
86
85
|
);
|
|
87
|
-
return { hash: await
|
|
86
|
+
return { hash: await p(
|
|
88
87
|
this._config,
|
|
89
88
|
a
|
|
90
89
|
), result: e };
|
|
@@ -115,14 +114,14 @@ const z = "0x610120604052348015610010575f80fd5b50306080524660a0525f60c081905260e
|
|
|
115
114
|
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
116
115
|
*/
|
|
117
116
|
async setAuthorizedRaw(f, b, a) {
|
|
118
|
-
const { request: e, result: t } = await
|
|
117
|
+
const { request: e, result: t } = await g(this._config, {
|
|
119
118
|
address: this.assertValidAddress(),
|
|
120
119
|
args: [f, b],
|
|
121
120
|
...this.optionallyAttachAccount(),
|
|
122
121
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
123
122
|
...a
|
|
124
123
|
});
|
|
125
|
-
return { hash: await
|
|
124
|
+
return { hash: await w(
|
|
126
125
|
this._config,
|
|
127
126
|
e
|
|
128
127
|
), result: t };
|
|
@@ -137,14 +136,14 @@ const z = "0x610120604052348015610010575f80fd5b50306080524660a0525f60c081905260e
|
|
|
137
136
|
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
138
137
|
*/
|
|
139
138
|
async setValidatorCallerRaw(f, b) {
|
|
140
|
-
const { request: a, result: e } = await
|
|
139
|
+
const { request: a, result: e } = await A(this._config, {
|
|
141
140
|
address: this.assertValidAddress(),
|
|
142
141
|
args: [f],
|
|
143
142
|
...this.optionallyAttachAccount(),
|
|
144
143
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
145
144
|
...b
|
|
146
145
|
});
|
|
147
|
-
return { hash: await
|
|
146
|
+
return { hash: await D(
|
|
148
147
|
this._config,
|
|
149
148
|
a
|
|
150
149
|
), result: e };
|
|
@@ -189,7 +188,7 @@ const z = "0x610120604052348015610010575f80fd5b50306080524660a0525f60c081905260e
|
|
|
189
188
|
b
|
|
190
189
|
);
|
|
191
190
|
return {
|
|
192
|
-
abi:
|
|
191
|
+
abi: n,
|
|
193
192
|
bytecode: z,
|
|
194
193
|
args: [I(a)],
|
|
195
194
|
...this.optionallyAttachAccount(e.account)
|
|
@@ -200,7 +199,7 @@ c.bases = {
|
|
|
200
199
|
31337: void 0,
|
|
201
200
|
...v
|
|
202
201
|
}, c.registryType = C.VALIDATOR;
|
|
203
|
-
let
|
|
202
|
+
let r = c;
|
|
204
203
|
async function R({
|
|
205
204
|
signer: d,
|
|
206
205
|
incentiveData: f,
|
|
@@ -210,34 +209,31 @@ async function R({
|
|
|
210
209
|
claimant: t,
|
|
211
210
|
boostId: i
|
|
212
211
|
}) {
|
|
213
|
-
const o =
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
]
|
|
228
|
-
},
|
|
229
|
-
primaryType: "SignerValidatorData",
|
|
230
|
-
message: {
|
|
231
|
-
boostId: i,
|
|
232
|
-
incentiveQuantity: e,
|
|
233
|
-
claimant: t,
|
|
234
|
-
incentiveData: f
|
|
235
|
-
}
|
|
212
|
+
const o = {
|
|
213
|
+
domain: {
|
|
214
|
+
name: "LimitedSignerValidator",
|
|
215
|
+
version: "1",
|
|
216
|
+
chainId: b,
|
|
217
|
+
verifyingContract: a
|
|
218
|
+
},
|
|
219
|
+
types: {
|
|
220
|
+
SignerValidatorData: [
|
|
221
|
+
{ name: "boostId", type: "uint256" },
|
|
222
|
+
{ name: "incentiveQuantity", type: "uint8" },
|
|
223
|
+
{ name: "claimant", type: "address" },
|
|
224
|
+
{ name: "incentiveData", type: "bytes" }
|
|
225
|
+
]
|
|
236
226
|
},
|
|
237
|
-
|
|
238
|
-
|
|
227
|
+
primaryType: "SignerValidatorData",
|
|
228
|
+
message: {
|
|
229
|
+
boostId: i,
|
|
230
|
+
incentiveQuantity: e,
|
|
231
|
+
claimant: t,
|
|
232
|
+
incentiveData: f
|
|
233
|
+
}
|
|
234
|
+
}, l = await d.privateKey.signTypedData(o), u = S({
|
|
239
235
|
signer: d.account,
|
|
240
|
-
signature:
|
|
236
|
+
signature: l,
|
|
241
237
|
incentiveQuantity: e
|
|
242
238
|
// Adjust incentive quantity as necessary
|
|
243
239
|
});
|
|
@@ -252,7 +248,7 @@ async function R({
|
|
|
252
248
|
]
|
|
253
249
|
}
|
|
254
250
|
],
|
|
255
|
-
[{ validatorData:
|
|
251
|
+
[{ validatorData: u, incentiveData: f }]
|
|
256
252
|
);
|
|
257
253
|
}
|
|
258
254
|
function S({
|
|
@@ -290,8 +286,8 @@ function I({
|
|
|
290
286
|
);
|
|
291
287
|
}
|
|
292
288
|
export {
|
|
293
|
-
|
|
294
|
-
|
|
289
|
+
r as LimitedSignerValidator,
|
|
290
|
+
n as limitedSignerValidatorAbi,
|
|
295
291
|
R as prepareLimitedSignerValidatorClaimDataPayload,
|
|
296
292
|
S as prepareLimitedSignerValidatorInputParams,
|
|
297
293
|
I as prepareLimitedSignerValidatorPayload
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LimitedSignerValidator.js","sources":["../../src/Validators/LimitedSignerValidator.ts"],"sourcesContent":["import {\n limitedSignerValidatorAbi,\n readLimitedSignerValidatorHashSignerData,\n readLimitedSignerValidatorSigners,\n simulateLimitedSignerValidatorSetAuthorized,\n simulateLimitedSignerValidatorSetValidatorCaller,\n simulateLimitedSignerValidatorValidate,\n writeLimitedSignerValidatorSetAuthorized,\n writeLimitedSignerValidatorSetValidatorCaller,\n writeLimitedSignerValidatorValidate,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/validators/LimitedSignerValidator.sol/LimitedSignerValidator.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n type PrivateKeyAccount,\n encodeAbiParameters,\n} from 'viem';\nimport { signTypedData } from 'viem/accounts';\nimport { LimitedSignerValidator as SignerValidatorBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { limitedSignerValidatorAbi };\n\n/**\n * Object reprentation of a {@link LimitedSignerValidator} initialization payload\n *\n * @export\n * @interface LimitedSignerValidatorPayload\n * @typedef {LimitedSignerValidatorPayload}\n */\nexport interface LimitedSignerValidatorPayload {\n /**\n * The list of authorized signers. The first address in the list will be the initial owner of the contract.\n *\n * @type {Address[]}\n */\n signers: Address[];\n /**\n * The authorized caller of the {@link prepareSignerValidator} function\n * @type {Address}\n */\n validatorCaller: Address;\n /**\n * The max quantity of claims a user can make for a given incentive,\n * regardless of how many valid transactions they have\n * @type {number}\n */\n maxClaimCount: number;\n}\n\n/**\n * Description placeholder\n *\n * @export\n * @interface LimitedSignerValidatorValidatePayload\n * @typedef {LimitedSignerValidatorValidatePayload}\n */\nexport interface LimitedSignerValidatorValidatePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {bigint}\n */\n incentiveId: bigint;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n claimData: Hex;\n}\n\n/**\n * Object reprentation of a {@link LimitedSignerValidator} initialization payload\n *\n * @export\n * @interface LimitedSignerValidatorPayload\n * @typedef {LimitedSignerValidatorPayload}\n */\nexport interface LimitedSignerValidatorPayload {\n /**\n * The list of authorized signers. The first address in the list will be the initial owner of the contract.\n *\n * @type {Address[]}\n */\n signers: Address[];\n /**\n * The authorized caller of the {@link prepareSignerValidator} function\n * @type {Address}\n */\n validatorCaller: Address;\n}\n\n/**\n * Description placeholder\n *\n * @export\n * @interface LimitedSignerValidatorValidatePayload\n * @typedef {LimitedSignerValidatorValidatePayload}\n */\nexport interface LimitedSignerValidatorValidatePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {bigint}\n */\n incentiveId: bigint;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n claimData: Hex;\n}\n\n/**\n * Signer Validator Claim Data Payload\n *\n * @export\n * @interface LimitedSignerValidatorClaimDataParams\n * @typedef {LimitedSignerValidatorClaimDataParams}\n */\nexport interface LimitedSignerValidatorClaimDataParams {\n /**\n * The signer with which to sign the input\n *\n * @type {{\n * account: Address;\n * key: Hex;\n * privateKey: PrivateKeyAccount;\n * }}\n */\n signer: {\n account: Address;\n key: Hex;\n privateKey: PrivateKeyAccount;\n };\n /**\n * The encoded data to provide the underlying incentive. You can use {@link prepareAllowListIncentivePayload}, {@link prepareCGDAIncentivePayload}, {@link prepareERC20IncentivePayload}, {@link prepareERC1155IncentivePayload}, or {@link preparePointsIncentivePayload}\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n /**\n * The chain id to target\n *\n * @type {number}\n */\n chainId: number;\n /**\n * The address of the validator\n *\n * @type {Address}\n */\n validator: Address;\n /**\n * The incentive quantity.\n *\n * @type {number}\n */\n incentiveQuantity: number;\n /**\n * The address of the claimant\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The ID of the boost\n *\n * @type {bigint}\n */\n boostId: bigint;\n}\n\n/**\n * Object representation of a {@link LimitedSignerValidatorInputParams} initialization payload\n *\n * @export\n * @interface LimitedSignerValidatorInputParams\n * @typedef {LimitedSignerValidatorInputParams}\n */\nexport interface LimitedSignerValidatorInputParams {\n /**\n * The signer address.\n *\n * @type {Address}\n */\n signer: Address;\n\n /**\n * The signature data.\n *\n * @type {string}\n */\n signature: Hex;\n\n /**\n * The incentive quantity.\n *\n * @type {number}\n */\n incentiveQuantity: number;\n}\n\n/**\n * Object representing the payload for signing before validaton.\n *\n * @export\n * @interface LimitedSignerValidatorSignaturePayload\n * @typedef {LimitedSignerValidatorSignaturePayload}\n */\nexport interface LimitedSignerValidatorSignaturePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {number}\n */\n incentiveQuantity: number;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n}\n\n/**\n * A generic `viem.Log` event with support for `BoostCore` event types.\n *\n * @export\n * @typedef {LimitedSignerValidatorLog}\n * @template {ContractEventName<\n * typeof limitedSignerValidatorAbi\n * >} [event=ContractEventName<typeof limitedSignerValidatorAbi>]\n */\nexport type LimitedSignerValidatorLog<\n event extends ContractEventName<\n typeof limitedSignerValidatorAbi\n > = ContractEventName<typeof limitedSignerValidatorAbi>,\n> = GenericLog<typeof limitedSignerValidatorAbi, event>;\n\n/**\n * A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers\n *\n * @export\n * @class SignerValidator\n * @typedef {SignerValidator}\n * @extends {DeployableTarget<SignerValidatorPayload>}\n */\nexport class LimitedSignerValidator extends DeployableTarget<\n LimitedSignerValidatorPayload,\n typeof limitedSignerValidatorAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = limitedSignerValidatorAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_LIMITED_SIGNER_VALIDATOR_BASE,\n ...(SignerValidatorBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.VALIDATOR;\n\n /**\n * The set of authorized signers\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async signers(address: Address, params?: ReadParams) {\n return await readLimitedSignerValidatorSigners(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Retrieve the hash and signer data for a given hash\n *\n * @public\n * @async\n * @param {SignerValidatorSignaturePayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async hashSignerData(\n payload: LimitedSignerValidatorSignaturePayload,\n params?: ReadParams,\n ) {\n return await readLimitedSignerValidatorHashSignerData(this._config, {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveQuantity,\n payload.claimant,\n payload.incentiveData,\n ],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n protected async validate(\n payload: LimitedSignerValidatorValidatePayload,\n params?: WriteParams,\n ) {\n return await this.awaitResult(this.validateRaw(payload, params));\n }\n\n /**\n * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n protected async validateRaw(\n payload: LimitedSignerValidatorValidatePayload,\n params?: WriteParams,\n ) {\n const { request, result } = await simulateLimitedSignerValidatorValidate(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveId,\n payload.claimant,\n payload.claimData,\n ],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeLimitedSignerValidatorValidate(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setAuthorized(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n return await this.awaitResult(\n this.setAuthorizedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setAuthorizedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n const { request, result } =\n await simulateLimitedSignerValidatorSetAuthorized(this._config, {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n const hash = await writeLimitedSignerValidatorSetAuthorized(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Update the authorized caller of the validator function\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setValidatorCallerRaw(address: Address, params?: WriteParams) {\n const { request, result } =\n await simulateLimitedSignerValidatorSetValidatorCaller(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n const hash = await writeLimitedSignerValidatorSetValidatorCaller(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Update the authorized caller of the validator function\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setValidatorCaller(address: Address, params?: WriteParams) {\n return await this.awaitResult(this.setValidatorCallerRaw(address, params));\n }\n\n /**\n * Properly encodes the data needed to claim\n *\n * @public\n * @async\n * @param {SignerValidatorClaimDataParams} params\n * @returns {Promise<Hex>}\n */\n public async encodeClaimData(\n params: Omit<LimitedSignerValidatorClaimDataParams, 'validator'>,\n ): Promise<Hex> {\n return await prepareLimitedSignerValidatorClaimDataPayload({\n ...params,\n validator: this.assertValidAddress(),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SignerValidatorPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: LimitedSignerValidatorPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: limitedSignerValidatorAbi,\n bytecode: bytecode as Hex,\n args: [prepareLimitedSignerValidatorPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Signer Validator Claim Data Payload Preparation\n *\n * @export\n * @async\n * @param {SignerValidatorClaimDataParams} param0\n * @param {{ account: Address; key: Hex; privateKey: PrivateKeyAccount; }} param0.signer\n * @param {Hex} param0.incentiveData\n * @param {number} param0.chainId\n * @param {Address} param0.validator\n * @param {number} param0.incentiveQuantity\n * @param {Address} param0.claimant\n * @param {bigint} param0.boostId\n * @returns {Promise<Hex>}\n */\nexport async function prepareLimitedSignerValidatorClaimDataPayload({\n signer,\n incentiveData,\n chainId,\n validator,\n incentiveQuantity,\n claimant,\n boostId,\n}: LimitedSignerValidatorClaimDataParams): Promise<Hex> {\n const domain = {\n name: 'LimitedSignerValidator',\n version: '1',\n chainId: chainId,\n verifyingContract: validator,\n };\n const typedData = {\n domain,\n types: {\n SignerValidatorData: [\n { name: 'boostId', type: 'uint256' },\n { name: 'incentiveQuantity', type: 'uint8' },\n { name: 'claimant', type: 'address' },\n { name: 'incentiveData', type: 'bytes' },\n ],\n },\n primaryType: 'SignerValidatorData' as const,\n message: {\n boostId,\n incentiveQuantity,\n claimant,\n incentiveData: incentiveData,\n },\n };\n\n const trustedSignature = await signTypedData({\n ...typedData,\n privateKey: signer.key,\n });\n\n // Prepare the claim data payload using the new helper\n const validatorData = prepareLimitedSignerValidatorInputParams({\n signer: signer.account,\n signature: trustedSignature,\n incentiveQuantity, // Adjust incentive quantity as necessary\n });\n\n const boostClaimDataPayload = encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n [{ validatorData, incentiveData }],\n );\n\n return boostClaimDataPayload;\n}\n\n/**\n * Given a {@link SignerValidatorInputParams}, properly encode the initialization payload.\n *\n * @param {SignerValidatorInputParams} param0\n * @param {Address} param0.signer\n * @param {Hex} param0.signature\n * @param {number} param0.incentiveQuantity\n * @returns {Hex}\n */\nexport function prepareLimitedSignerValidatorInputParams({\n signer,\n signature,\n incentiveQuantity,\n}: LimitedSignerValidatorInputParams) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'SignerValidatorInputParams',\n components: [\n { type: 'address', name: 'signer' },\n { type: 'bytes', name: 'signature' },\n { type: 'uint8', name: 'incentiveQuantity' },\n ],\n },\n ],\n [{ signer, signature, incentiveQuantity }],\n );\n}\n\n/**\n * Given a {@link SignerValidatorPayload}, properly encode the initialization payload.\n *\n * @param {SignerValidatorPayload} param0\n SignerValidator: class TSignerValidator extends SignerValidator {\n public static override bases: Record<number, Address> = {\n [chainId]: signerValidatorBase,\n };\n },\n * @param {Address[]} param0.signers\n * @param {Address} param0.validatorCaller\n * @returns {Hex}\n */\nexport function prepareLimitedSignerValidatorPayload({\n signers,\n validatorCaller,\n maxClaimCount,\n}: LimitedSignerValidatorPayload) {\n return encodeAbiParameters(\n [\n { type: 'address[]', name: 'signers' },\n { type: 'address', name: 'validatorCaller' },\n { type: 'uint256', name: 'maxClaimCount' },\n ],\n [signers, validatorCaller, BigInt(maxClaimCount)],\n );\n}\n"],"names":["_LimitedSignerValidator","DeployableTarget","limitedSignerValidatorAbi","address","params","readLimitedSignerValidatorSigners","payload","readLimitedSignerValidatorHashSignerData","request","result","simulateLimitedSignerValidatorValidate","writeLimitedSignerValidatorValidate","addresses","allowed","simulateLimitedSignerValidatorSetAuthorized","writeLimitedSignerValidatorSetAuthorized","simulateLimitedSignerValidatorSetValidatorCaller","writeLimitedSignerValidatorSetValidatorCaller","prepareLimitedSignerValidatorClaimDataPayload","_payload","_options","options","bytecode","prepareLimitedSignerValidatorPayload","SignerValidatorBases","RegistryType","LimitedSignerValidator","signer","incentiveData","chainId","validator","incentiveQuantity","claimant","boostId","trustedSignature","signTypedData","validatorData","prepareLimitedSignerValidatorInputParams","encodeAbiParameters","signature","signers","validatorCaller","maxClaimCount"],"mappings":";;;;;;kjaA0SaA,IAAN,MAAMA,UAA+BC,EAG1C;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAWL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8B/B,MAAa,QAAQC,GAAkBC,GAAqB;AACnD,WAAA,MAAMC,EAAkC,KAAK,SAAS;AAAA,MAC3D,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACF,CAA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CACD;AAgBM,SAduBO;AAAA,IAC5B;AAAA,MACE;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,YAAY;AAAA,UACV,EAAE,MAAM,SAAS,MAAM,gBAAgB;AAAA,UACvC,EAAE,MAAM,SAAS,MAAM,gBAAgB;AAAA,QACzC;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,EAAE,eAAAF,GAAe,eAAAR,GAAe;AAAA,EAAA;AAIrC;AAWO,SAASS,EAAyC;AAAA,EACvD,QAAAV;AAAA,EACA,WAAAY;AAAA,EACA,mBAAAR;AACF,GAAsC;AAC7B,SAAAO;AAAA,IACL;AAAA,MACE;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,YAAY;AAAA,UACV,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,UAClC,EAAE,MAAM,SAAS,MAAM,YAAY;AAAA,UACnC,EAAE,MAAM,SAAS,MAAM,oBAAoB;AAAA,QAC7C;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,EAAE,QAAAX,GAAQ,WAAAY,GAAW,mBAAAR,GAAmB;AAAA,EAAA;AAE7C;AAeO,SAASR,EAAqC;AAAA,EACnD,SAAAiB;AAAA,EACA,iBAAAC;AAAA,EACA,eAAAC;AACF,GAAkC;AACzB,SAAAJ;AAAA,IACL;AAAA,MACE,EAAE,MAAM,aAAa,MAAM,UAAU;AAAA,MACrC,EAAE,MAAM,WAAW,MAAM,kBAAkB;AAAA,MAC3C,EAAE,MAAM,WAAW,MAAM,gBAAgB;AAAA,IAC3C;AAAA,IACA,CAACE,GAASC,GAAiB,OAAOC,CAAa,CAAC;AAAA,EAAA;AAEpD;"}
|
|
1
|
+
{"version":3,"file":"LimitedSignerValidator.js","sources":["../../src/Validators/LimitedSignerValidator.ts"],"sourcesContent":["import {\n limitedSignerValidatorAbi,\n readLimitedSignerValidatorHashSignerData,\n readLimitedSignerValidatorSigners,\n simulateLimitedSignerValidatorSetAuthorized,\n simulateLimitedSignerValidatorSetValidatorCaller,\n simulateLimitedSignerValidatorValidate,\n writeLimitedSignerValidatorSetAuthorized,\n writeLimitedSignerValidatorSetValidatorCaller,\n writeLimitedSignerValidatorValidate,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/validators/LimitedSignerValidator.sol/LimitedSignerValidator.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n type PrivateKeyAccount,\n encodeAbiParameters,\n} from 'viem';\nimport { signTypedData } from 'viem/accounts';\nimport { LimitedSignerValidator as SignerValidatorBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { limitedSignerValidatorAbi };\n\n/**\n * Object reprentation of a {@link LimitedSignerValidator} initialization payload\n *\n * @export\n * @interface LimitedSignerValidatorPayload\n * @typedef {LimitedSignerValidatorPayload}\n */\nexport interface LimitedSignerValidatorPayload {\n /**\n * The list of authorized signers. The first address in the list will be the initial owner of the contract.\n *\n * @type {Address[]}\n */\n signers: Address[];\n /**\n * The authorized caller of the {@link prepareSignerValidator} function\n * @type {Address}\n */\n validatorCaller: Address;\n /**\n * The max quantity of claims a user can make for a given incentive,\n * regardless of how many valid transactions they have\n * @type {number}\n */\n maxClaimCount: number;\n}\n\n/**\n * Description placeholder\n *\n * @export\n * @interface LimitedSignerValidatorValidatePayload\n * @typedef {LimitedSignerValidatorValidatePayload}\n */\nexport interface LimitedSignerValidatorValidatePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {bigint}\n */\n incentiveId: bigint;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n claimData: Hex;\n}\n\n/**\n * Object reprentation of a {@link LimitedSignerValidator} initialization payload\n *\n * @export\n * @interface LimitedSignerValidatorPayload\n * @typedef {LimitedSignerValidatorPayload}\n */\nexport interface LimitedSignerValidatorPayload {\n /**\n * The list of authorized signers. The first address in the list will be the initial owner of the contract.\n *\n * @type {Address[]}\n */\n signers: Address[];\n /**\n * The authorized caller of the {@link prepareSignerValidator} function\n * @type {Address}\n */\n validatorCaller: Address;\n}\n\n/**\n * Description placeholder\n *\n * @export\n * @interface LimitedSignerValidatorValidatePayload\n * @typedef {LimitedSignerValidatorValidatePayload}\n */\nexport interface LimitedSignerValidatorValidatePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {bigint}\n */\n incentiveId: bigint;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n claimData: Hex;\n}\n\n/**\n * Signer Validator Claim Data Payload\n *\n * @export\n * @interface LimitedSignerValidatorClaimDataParams\n * @typedef {LimitedSignerValidatorClaimDataParams}\n */\nexport interface LimitedSignerValidatorClaimDataParams {\n /**\n * The signer with which to sign the input\n *\n * @type {{\n * account: Address;\n * key: Hex;\n * privateKey: PrivateKeyAccount;\n * }}\n */\n signer: {\n account: Address;\n key: Hex;\n privateKey: PrivateKeyAccount;\n };\n /**\n * The encoded data to provide the underlying incentive. You can use {@link prepareAllowListIncentivePayload}, {@link prepareCGDAIncentivePayload}, {@link prepareERC20IncentivePayload}, {@link prepareERC1155IncentivePayload}, or {@link preparePointsIncentivePayload}\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n /**\n * The chain id to target\n *\n * @type {number}\n */\n chainId: number;\n /**\n * The address of the validator\n *\n * @type {Address}\n */\n validator: Address;\n /**\n * The incentive quantity.\n *\n * @type {number}\n */\n incentiveQuantity: number;\n /**\n * The address of the claimant\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The ID of the boost\n *\n * @type {bigint}\n */\n boostId: bigint;\n}\n\n/**\n * Object representation of a {@link LimitedSignerValidatorInputParams} initialization payload\n *\n * @export\n * @interface LimitedSignerValidatorInputParams\n * @typedef {LimitedSignerValidatorInputParams}\n */\nexport interface LimitedSignerValidatorInputParams {\n /**\n * The signer address.\n *\n * @type {Address}\n */\n signer: Address;\n\n /**\n * The signature data.\n *\n * @type {string}\n */\n signature: Hex;\n\n /**\n * The incentive quantity.\n *\n * @type {number}\n */\n incentiveQuantity: number;\n}\n\n/**\n * Object representing the payload for signing before validaton.\n *\n * @export\n * @interface LimitedSignerValidatorSignaturePayload\n * @typedef {LimitedSignerValidatorSignaturePayload}\n */\nexport interface LimitedSignerValidatorSignaturePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {number}\n */\n incentiveQuantity: number;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n}\n\n/**\n * A generic `viem.Log` event with support for `BoostCore` event types.\n *\n * @export\n * @typedef {LimitedSignerValidatorLog}\n * @template {ContractEventName<\n * typeof limitedSignerValidatorAbi\n * >} [event=ContractEventName<typeof limitedSignerValidatorAbi>]\n */\nexport type LimitedSignerValidatorLog<\n event extends ContractEventName<\n typeof limitedSignerValidatorAbi\n > = ContractEventName<typeof limitedSignerValidatorAbi>,\n> = GenericLog<typeof limitedSignerValidatorAbi, event>;\n\n/**\n * A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers\n *\n * @export\n * @class SignerValidator\n * @typedef {SignerValidator}\n * @extends {DeployableTarget<SignerValidatorPayload>}\n */\nexport class LimitedSignerValidator extends DeployableTarget<\n LimitedSignerValidatorPayload,\n typeof limitedSignerValidatorAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = limitedSignerValidatorAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_LIMITED_SIGNER_VALIDATOR_BASE,\n ...(SignerValidatorBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.VALIDATOR;\n\n /**\n * The set of authorized signers\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async signers(address: Address, params?: ReadParams) {\n return await readLimitedSignerValidatorSigners(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Retrieve the hash and signer data for a given hash\n *\n * @public\n * @async\n * @param {SignerValidatorSignaturePayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async hashSignerData(\n payload: LimitedSignerValidatorSignaturePayload,\n params?: ReadParams,\n ) {\n return await readLimitedSignerValidatorHashSignerData(this._config, {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveQuantity,\n payload.claimant,\n payload.incentiveData,\n ],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n protected async validate(\n payload: LimitedSignerValidatorValidatePayload,\n params?: WriteParams,\n ) {\n return await this.awaitResult(this.validateRaw(payload, params));\n }\n\n /**\n * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n protected async validateRaw(\n payload: LimitedSignerValidatorValidatePayload,\n params?: WriteParams,\n ) {\n const { request, result } = await simulateLimitedSignerValidatorValidate(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveId,\n payload.claimant,\n payload.claimData,\n ],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeLimitedSignerValidatorValidate(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setAuthorized(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n return await this.awaitResult(\n this.setAuthorizedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setAuthorizedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n const { request, result } =\n await simulateLimitedSignerValidatorSetAuthorized(this._config, {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n const hash = await writeLimitedSignerValidatorSetAuthorized(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Update the authorized caller of the validator function\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setValidatorCallerRaw(address: Address, params?: WriteParams) {\n const { request, result } =\n await simulateLimitedSignerValidatorSetValidatorCaller(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n const hash = await writeLimitedSignerValidatorSetValidatorCaller(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Update the authorized caller of the validator function\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setValidatorCaller(address: Address, params?: WriteParams) {\n return await this.awaitResult(this.setValidatorCallerRaw(address, params));\n }\n\n /**\n * Properly encodes the data needed to claim\n *\n * @public\n * @async\n * @param {SignerValidatorClaimDataParams} params\n * @returns {Promise<Hex>}\n */\n public async encodeClaimData(\n params: Omit<LimitedSignerValidatorClaimDataParams, 'validator'>,\n ): Promise<Hex> {\n return await prepareLimitedSignerValidatorClaimDataPayload({\n ...params,\n validator: this.assertValidAddress(),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SignerValidatorPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: LimitedSignerValidatorPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: limitedSignerValidatorAbi,\n bytecode: bytecode as Hex,\n args: [prepareLimitedSignerValidatorPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Signer Validator Claim Data Payload Preparation\n *\n * @export\n * @async\n * @param {SignerValidatorClaimDataParams} param0\n * @param {{ account: Address; key: Hex; privateKey: PrivateKeyAccount; }} param0.signer\n * @param {Hex} param0.incentiveData\n * @param {number} param0.chainId\n * @param {Address} param0.validator\n * @param {number} param0.incentiveQuantity\n * @param {Address} param0.claimant\n * @param {bigint} param0.boostId\n * @returns {Promise<Hex>}\n */\nexport async function prepareLimitedSignerValidatorClaimDataPayload({\n signer,\n incentiveData,\n chainId,\n validator,\n incentiveQuantity,\n claimant,\n boostId,\n}: LimitedSignerValidatorClaimDataParams): Promise<Hex> {\n const domain = {\n name: 'LimitedSignerValidator',\n version: '1',\n chainId: chainId,\n verifyingContract: validator,\n };\n const typedData = {\n domain,\n types: {\n SignerValidatorData: [\n { name: 'boostId', type: 'uint256' },\n { name: 'incentiveQuantity', type: 'uint8' },\n { name: 'claimant', type: 'address' },\n { name: 'incentiveData', type: 'bytes' },\n ],\n },\n primaryType: 'SignerValidatorData' as const,\n message: {\n boostId,\n incentiveQuantity,\n claimant,\n incentiveData: incentiveData,\n },\n };\n\n const trustedSignature = await signer.privateKey.signTypedData(typedData);\n\n // Prepare the claim data payload using the new helper\n const validatorData = prepareLimitedSignerValidatorInputParams({\n signer: signer.account,\n signature: trustedSignature,\n incentiveQuantity, // Adjust incentive quantity as necessary\n });\n\n const boostClaimDataPayload = encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n [{ validatorData, incentiveData }],\n );\n\n return boostClaimDataPayload;\n}\n\n/**\n * Given a {@link SignerValidatorInputParams}, properly encode the initialization payload.\n *\n * @param {SignerValidatorInputParams} param0\n * @param {Address} param0.signer\n * @param {Hex} param0.signature\n * @param {number} param0.incentiveQuantity\n * @returns {Hex}\n */\nexport function prepareLimitedSignerValidatorInputParams({\n signer,\n signature,\n incentiveQuantity,\n}: LimitedSignerValidatorInputParams) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'SignerValidatorInputParams',\n components: [\n { type: 'address', name: 'signer' },\n { type: 'bytes', name: 'signature' },\n { type: 'uint8', name: 'incentiveQuantity' },\n ],\n },\n ],\n [{ signer, signature, incentiveQuantity }],\n );\n}\n\n/**\n * Given a {@link SignerValidatorPayload}, properly encode the initialization payload.\n *\n * @param {SignerValidatorPayload} param0\n SignerValidator: class TSignerValidator extends SignerValidator {\n public static override bases: Record<number, Address> = {\n [chainId]: signerValidatorBase,\n };\n },\n * @param {Address[]} param0.signers\n * @param {Address} param0.validatorCaller\n * @returns {Hex}\n */\nexport function prepareLimitedSignerValidatorPayload({\n signers,\n validatorCaller,\n maxClaimCount,\n}: LimitedSignerValidatorPayload) {\n return encodeAbiParameters(\n [\n { type: 'address[]', name: 'signers' },\n { type: 'address', name: 'validatorCaller' },\n { type: 'uint256', name: 'maxClaimCount' },\n ],\n [signers, validatorCaller, BigInt(maxClaimCount)],\n );\n}\n"],"names":["_LimitedSignerValidator","DeployableTarget","limitedSignerValidatorAbi","address","params","readLimitedSignerValidatorSigners","payload","readLimitedSignerValidatorHashSignerData","request","result","simulateLimitedSignerValidatorValidate","writeLimitedSignerValidatorValidate","addresses","allowed","simulateLimitedSignerValidatorSetAuthorized","writeLimitedSignerValidatorSetAuthorized","simulateLimitedSignerValidatorSetValidatorCaller","writeLimitedSignerValidatorSetValidatorCaller","prepareLimitedSignerValidatorClaimDataPayload","_payload","_options","options","bytecode","prepareLimitedSignerValidatorPayload","SignerValidatorBases","RegistryType","LimitedSignerValidator","signer","incentiveData","chainId","validator","incentiveQuantity","claimant","boostId","typedData","trustedSignature","validatorData","prepareLimitedSignerValidatorInputParams","encodeAbiParameters","signature","signers","validatorCaller","maxClaimCount"],"mappings":";;;;;kjaA0SaA,IAAN,MAAMA,UAA+BC,EAG1C;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAWL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8B/B,MAAa,QAAQC,GAAkBC,GAAqB;AACnD,WAAA,MAAMC,E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ACf,WAAWQ;AAAA,IACX,mBAAAJ;AAAA;AAAA,EAAA,CACD;AAgBM,SAduBO;AAAA,IAC5B;AAAA,MACE;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,YAAY;AAAA,UACV,EAAE,MAAM,SAAS,MAAM,gBAAgB;AAAA,UACvC,EAAE,MAAM,SAAS,MAAM,gBAAgB;AAAA,QACzC;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,EAAE,eAAAF,GAAe,eAAAR,GAAe;AAAA,EAAA;AAIrC;AAWO,SAASS,EAAyC;AAAA,EACvD,QAAAV;AAAA,EACA,WAAAY;AAAA,EACA,mBAAAR;AACF,GAAsC;AAC7B,SAAAO;AAAA,IACL;AAAA,MACE;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,YAAY;AAAA,UACV,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,UAClC,EAAE,MAAM,SAAS,MAAM,YAAY;AAAA,UACnC,EAAE,MAAM,SAAS,MAAM,oBAAoB;AAAA,QAC7C;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,EAAE,QAAAX,GAAQ,WAAAY,GAAW,mBAAAR,GAAmB;AAAA,EAAA;AAE7C;AAeO,SAASR,EAAqC;AAAA,EACnD,SAAAiB;AAAA,EACA,iBAAAC;AAAA,EACA,eAAAC;AACF,GAAkC;AACzB,SAAAJ;AAAA,IACL;AAAA,MACE,EAAE,MAAM,aAAa,MAAM,UAAU;AAAA,MACrC,EAAE,MAAM,WAAW,MAAM,kBAAkB;AAAA,MAC3C,EAAE,MAAM,WAAW,MAAM,gBAAgB;AAAA,IAC3C;AAAA,IACA,CAACE,GAASC,GAAiB,OAAOC,CAAa,CAAC;AAAA,EAAA;AAEpD;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../generated-BPiHi7W2.cjs"),i=require("../componentInterfaces-aBgBbB7r.cjs"),s=require("@wagmi/core"),m=require("viem"),f=require("../errors.cjs"),n=require("./LimitedSignerValidator.cjs"),d=require("./SignerValidator.cjs"),t={[i.ASignerValidator]:d.SignerValidator,[i.ALimitedSignerValidator]:n.LimitedSignerValidator};async function u(e,r,c){const a=await s.readContract(e.config,{abi:l.Te,functionName:"getComponentInterface",address:r,...c}),o=t[a];if(!o)throw new f.InvalidComponentInterfaceError(Object.keys(t),a);return new o(e,r)}const g={MAINNET:"0xCBD0C302040bC803B4B2EDaF21Be0e49Deff5480",TESTNET:"0xd63167e9db11B108940b2E8236581F961f33f396"};function V(e){return m.decodeAbiParameters([{type:"tuple",name:"BoostClaimData",components:[{type:"bytes",name:"validatorData"},{type:"bytes",name:"incentiveData"}]}],e)[0]}exports.LimitedSignerValidator=n.LimitedSignerValidator;exports.SignerValidator=d.SignerValidator;exports.BoostValidatorEOA=g;exports.ValidatorByComponentInterface=t;exports.decodeClaimData=V;exports.validatorFromAddress=u;
|
|
2
2
|
//# sourceMappingURL=Validator.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Validator.cjs","sources":["../../src/Validators/Validator.ts"],"sourcesContent":["import { aValidatorAbi } from '@boostxyz/evm';\nimport {\n
|
|
1
|
+
{"version":3,"file":"Validator.cjs","sources":["../../src/Validators/Validator.ts"],"sourcesContent":["import { aValidatorAbi } from '@boostxyz/evm';\nimport {\n ALimitedSignerValidator,\n ASignerValidator,\n} from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport { type Address, type Hex, decodeAbiParameters } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport type { ReadParams } from '../utils';\nimport { LimitedSignerValidator } from './LimitedSignerValidator';\nimport { SignerValidator } from './SignerValidator';\n\nexport { SignerValidator, LimitedSignerValidator };\n\n/**\n * A union type representing all valid protocol Validator implementations\n *\n * @export\n * @typedef {Validator}\n */\nexport type Validator = SignerValidator | LimitedSignerValidator;\n\n/**\n * A map of Validator component interfaces to their constructors.\n *\n * @type {{ \"0xd8725ea2\": typeof SignerValidator; }}\n */\nexport const ValidatorByComponentInterface = {\n [ASignerValidator as Hex]: SignerValidator,\n [ALimitedSignerValidator as Hex]: LimitedSignerValidator,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Promise<Validator>}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function validatorFromAddress(\n options: DeployableOptions,\n address: Address,\n params?: ReadParams,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aValidatorAbi,\n functionName: 'getComponentInterface',\n address,\n ...params,\n })) as keyof typeof ValidatorByComponentInterface;\n const Ctor = ValidatorByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(ValidatorByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n\n/**\n * An enum of verified Boost Validator EOA (Externally Owned Account) addresses used by the Boost protocol\n * for validating transactions on mainnet and testnet environments.\n *\n * @example\n * ```typescript\n * // Initialize a SignerValidator using the pre-configured EOA address of a verified Boost validator.\n * // If no validator is provided to core.createBoost(...), then this is what will be used by default.\n * const validator = core.SignerValidator({\n * signers: [BoostValidatorEOA.[TESTNET | MAINNET]],\n * validatorCaller: core.assertValidAddress()\n * })\n * ```\n * @enum {Address}\n */\nexport const BoostValidatorEOA = {\n MAINNET: import.meta.env.VITE_BOOST_MAINNET_SIGNER_EOA as Address,\n TESTNET: import.meta.env.VITE_BOOST_TESTNET_SIGNER_EOA as Address,\n};\n\n/**\n * Decodes a claim data hex string into its validator data and incentive data components.\n *\n * @export\n * @param {Hex} data - The hex-encoded claim data to decode\n * @returns {{ validatorData: Hex; incentiveData: Hex }} The decoded claim data components\n */\nexport function decodeClaimData(data: Hex) {\n return decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n data,\n )[0];\n}\n"],"names":["ValidatorByComponentInterface","ASignerValidator","SignerValidator","ALimitedSignerValidator","LimitedSignerValidator","validatorFromAddress","options","address","params","interfaceId","readContract","aValidatorAbi","Ctor","InvalidComponentInterfaceError","BoostValidatorEOA","decodeClaimData","data","decodeAbiParameters"],"mappings":"iUA4BaA,EAAgC,CAC3C,CAACC,EAAuB,gBAAA,EAAGC,EAAA,gBAC3B,CAACC,EAA8B,uBAAA,EAAGC,EAAA,sBACpC,EAYsB,eAAAC,EACpBC,EACAC,EACAC,EACA,CACA,MAAMC,EAAe,MAAMC,eAAaJ,EAAQ,OAAQ,CACtD,IAAKK,EAAA,GACL,aAAc,wBACd,QAAAJ,EACA,GAAGC,CAAA,CACJ,EACKI,EAAOZ,EAA8BS,CAAW,EACtD,GAAI,CAACG,EACH,MAAM,IAAIC,EAAA,+BACR,OAAO,KAAKb,CAA6B,EACzCS,CAAA,EAGG,OAAA,IAAIG,EAAKN,EAASC,CAAO,CAClC,CAiBO,MAAMO,EAAoB,CAC/B,QAAS,6CACT,QAAS,4CACX,EASO,SAASC,EAAgBC,EAAW,CAClC,OAAAC,EAAA,oBACL,CACE,CACE,KAAM,QACN,KAAM,iBACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,eAAgB,EACvC,CAAE,KAAM,QAAS,KAAM,eAAgB,CACzC,CACF,CACF,EACAD,GACA,CAAC,CACL"}
|
|
@@ -17,7 +17,7 @@ export type Validator = SignerValidator | LimitedSignerValidator;
|
|
|
17
17
|
* @type {{ "0xd8725ea2": typeof SignerValidator; }}
|
|
18
18
|
*/
|
|
19
19
|
export declare const ValidatorByComponentInterface: {
|
|
20
|
-
[x: string]: typeof SignerValidator;
|
|
20
|
+
[x: string]: typeof LimitedSignerValidator | typeof SignerValidator;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
23
|
* A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.
|
|
@@ -29,7 +29,7 @@ export declare const ValidatorByComponentInterface: {
|
|
|
29
29
|
* @returns {Promise<Validator>}
|
|
30
30
|
* @throws {@link InvalidComponentInterfaceError}
|
|
31
31
|
*/
|
|
32
|
-
export declare function validatorFromAddress(options: DeployableOptions, address: Address, params?: ReadParams): Promise<SignerValidator>;
|
|
32
|
+
export declare function validatorFromAddress(options: DeployableOptions, address: Address, params?: ReadParams): Promise<LimitedSignerValidator | SignerValidator>;
|
|
33
33
|
/**
|
|
34
34
|
* An enum of verified Boost Validator EOA (Externally Owned Account) addresses used by the Boost protocol
|
|
35
35
|
* for validating transactions on mainnet and testnet environments.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Validator.d.ts","sourceRoot":"","sources":["../../src/Validators/Validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Validator.d.ts","sourceRoot":"","sources":["../../src/Validators/Validator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAuB,MAAM,MAAM,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,sBAAsB,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;CAGzC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,UAAU,qDAgBpB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB;aAC8B,OAAO;aACP,OAAO;CAClE,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,GAAG;;;EAcxC"}
|
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
import { T as i } from "../generated-CElkFqkY.js";
|
|
2
|
-
import { a as m } from "../componentInterfaces-
|
|
3
|
-
import { readContract as
|
|
4
|
-
import { decodeAbiParameters as
|
|
5
|
-
import { InvalidComponentInterfaceError as
|
|
6
|
-
import { LimitedSignerValidator as
|
|
7
|
-
import { SignerValidator as
|
|
2
|
+
import { a as m, b as f } from "../componentInterfaces-CA1UIqWL.js";
|
|
3
|
+
import { readContract as c } from "@wagmi/core";
|
|
4
|
+
import { decodeAbiParameters as d } from "viem";
|
|
5
|
+
import { InvalidComponentInterfaceError as p } from "../errors.js";
|
|
6
|
+
import { LimitedSignerValidator as s } from "./LimitedSignerValidator.js";
|
|
7
|
+
import { SignerValidator as l } from "./SignerValidator.js";
|
|
8
8
|
const r = {
|
|
9
|
-
[m]:
|
|
10
|
-
|
|
11
|
-
// [ALimitedSignerValidator as Hex]: LimitedSignerValidator,
|
|
9
|
+
[m]: l,
|
|
10
|
+
[f]: s
|
|
12
11
|
};
|
|
13
|
-
async function
|
|
14
|
-
const o = await
|
|
12
|
+
async function u(t, e, n) {
|
|
13
|
+
const o = await c(t.config, {
|
|
15
14
|
abi: i,
|
|
16
15
|
functionName: "getComponentInterface",
|
|
17
16
|
address: e,
|
|
18
17
|
...n
|
|
19
18
|
}), a = r[o];
|
|
20
19
|
if (!a)
|
|
21
|
-
throw new
|
|
20
|
+
throw new p(
|
|
22
21
|
Object.keys(r),
|
|
23
22
|
o
|
|
24
23
|
);
|
|
25
24
|
return new a(t, e);
|
|
26
25
|
}
|
|
27
|
-
const
|
|
26
|
+
const A = {
|
|
28
27
|
MAINNET: "0xCBD0C302040bC803B4B2EDaF21Be0e49Deff5480",
|
|
29
28
|
TESTNET: "0xd63167e9db11B108940b2E8236581F961f33f396"
|
|
30
29
|
};
|
|
31
|
-
function
|
|
32
|
-
return
|
|
30
|
+
function I(t) {
|
|
31
|
+
return d(
|
|
33
32
|
[
|
|
34
33
|
{
|
|
35
34
|
type: "tuple",
|
|
@@ -44,11 +43,11 @@ function u(t) {
|
|
|
44
43
|
)[0];
|
|
45
44
|
}
|
|
46
45
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
A as BoostValidatorEOA,
|
|
47
|
+
s as LimitedSignerValidator,
|
|
48
|
+
l as SignerValidator,
|
|
50
49
|
r as ValidatorByComponentInterface,
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
I as decodeClaimData,
|
|
51
|
+
u as validatorFromAddress
|
|
53
52
|
};
|
|
54
53
|
//# sourceMappingURL=Validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Validator.js","sources":["../../src/Validators/Validator.ts"],"sourcesContent":["import { aValidatorAbi } from '@boostxyz/evm';\nimport {\n
|
|
1
|
+
{"version":3,"file":"Validator.js","sources":["../../src/Validators/Validator.ts"],"sourcesContent":["import { aValidatorAbi } from '@boostxyz/evm';\nimport {\n ALimitedSignerValidator,\n ASignerValidator,\n} from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport { type Address, type Hex, decodeAbiParameters } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport type { ReadParams } from '../utils';\nimport { LimitedSignerValidator } from './LimitedSignerValidator';\nimport { SignerValidator } from './SignerValidator';\n\nexport { SignerValidator, LimitedSignerValidator };\n\n/**\n * A union type representing all valid protocol Validator implementations\n *\n * @export\n * @typedef {Validator}\n */\nexport type Validator = SignerValidator | LimitedSignerValidator;\n\n/**\n * A map of Validator component interfaces to their constructors.\n *\n * @type {{ \"0xd8725ea2\": typeof SignerValidator; }}\n */\nexport const ValidatorByComponentInterface = {\n [ASignerValidator as Hex]: SignerValidator,\n [ALimitedSignerValidator as Hex]: LimitedSignerValidator,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Promise<Validator>}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function validatorFromAddress(\n options: DeployableOptions,\n address: Address,\n params?: ReadParams,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aValidatorAbi,\n functionName: 'getComponentInterface',\n address,\n ...params,\n })) as keyof typeof ValidatorByComponentInterface;\n const Ctor = ValidatorByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(ValidatorByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n\n/**\n * An enum of verified Boost Validator EOA (Externally Owned Account) addresses used by the Boost protocol\n * for validating transactions on mainnet and testnet environments.\n *\n * @example\n * ```typescript\n * // Initialize a SignerValidator using the pre-configured EOA address of a verified Boost validator.\n * // If no validator is provided to core.createBoost(...), then this is what will be used by default.\n * const validator = core.SignerValidator({\n * signers: [BoostValidatorEOA.[TESTNET | MAINNET]],\n * validatorCaller: core.assertValidAddress()\n * })\n * ```\n * @enum {Address}\n */\nexport const BoostValidatorEOA = {\n MAINNET: import.meta.env.VITE_BOOST_MAINNET_SIGNER_EOA as Address,\n TESTNET: import.meta.env.VITE_BOOST_TESTNET_SIGNER_EOA as Address,\n};\n\n/**\n * Decodes a claim data hex string into its validator data and incentive data components.\n *\n * @export\n * @param {Hex} data - The hex-encoded claim data to decode\n * @returns {{ validatorData: Hex; incentiveData: Hex }} The decoded claim data components\n */\nexport function decodeClaimData(data: Hex) {\n return decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n data,\n )[0];\n}\n"],"names":["ValidatorByComponentInterface","ASignerValidator","SignerValidator","ALimitedSignerValidator","LimitedSignerValidator","validatorFromAddress","options","address","params","interfaceId","readContract","aValidatorAbi","Ctor","InvalidComponentInterfaceError","BoostValidatorEOA","decodeClaimData","data","decodeAbiParameters"],"mappings":";;;;;;;AA4BO,MAAMA,IAAgC;AAAA,EAC3C,CAACC,CAAuB,GAAGC;AAAA,EAC3B,CAACC,CAA8B,GAAGC;AACpC;AAYsB,eAAAC,EACpBC,GACAC,GACAC,GACA;AACA,QAAMC,IAAe,MAAMC,EAAaJ,EAAQ,QAAQ;AAAA,IACtD,KAAKK;AAAAA,IACL,cAAc;AAAA,IACd,SAAAJ;AAAA,IACA,GAAGC;AAAA,EAAA,CACJ,GACKI,IAAOZ,EAA8BS,CAAW;AACtD,MAAI,CAACG;AACH,UAAM,IAAIC;AAAA,MACR,OAAO,KAAKb,CAA6B;AAAA,MACzCS;AAAA,IAAA;AAGG,SAAA,IAAIG,EAAKN,GAASC,CAAO;AAClC;AAiBO,MAAMO,IAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AACX;AASO,SAASC,EAAgBC,GAAW;AAClC,SAAAC;AAAA,IACL;AAAA,MACE;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,YAAY;AAAA,UACV,EAAE,MAAM,SAAS,MAAM,gBAAgB;AAAA,UACvC,EAAE,MAAM,SAAS,MAAM,gBAAgB;AAAA,QACzC;AAAA,MACF;AAAA,IACF;AAAA,IACAD;AAAA,IACA,CAAC;AACL;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const e = "0xc2c281ec", n = "0x53cf8555", a = "0x7cc1d5bb", t = "0x56586338", c = "0xf60c99c9", s = "0x52b8e45c", i = "0x90318111", o = "0x7687b0ed", d = "0xc8ebc758", A = "0x5fbfaa4e", x = "0xde98bbf0", b = "0xa2dceadb", g = "0x0d36a40d", l = "0xb8ce7b22", r = "0x1392d798", v = "0x3d30a22c";
|
|
2
|
+
export {
|
|
3
|
+
o as A,
|
|
4
|
+
l as a,
|
|
5
|
+
d as b,
|
|
6
|
+
r as c,
|
|
7
|
+
v as d,
|
|
8
|
+
A as e,
|
|
9
|
+
x as f,
|
|
10
|
+
b as g,
|
|
11
|
+
g as h,
|
|
12
|
+
a as i,
|
|
13
|
+
c as j,
|
|
14
|
+
t as k,
|
|
15
|
+
e as l,
|
|
16
|
+
n as m,
|
|
17
|
+
i as n,
|
|
18
|
+
s as o
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=componentInterfaces-CA1UIqWL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentInterfaces-CA1UIqWL.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e="0xc2c281ec",n="0x53cf8555",t="0x7cc1d5bb",i="0x56586338",c="0xf60c99c9",a="0x52b8e45c",A="0x90318111",d="0x7687b0ed",s="0xc8ebc758",o="0x5fbfaa4e",g="0xde98bbf0",r="0xa2dceadb",l="0x0d36a40d",v="0xb8ce7b22",b="0x1392d798",x="0x3d30a22c";exports.AAllowListIncentive=e;exports.ACGDAIncentive=n;exports.AERC20Incentive=t;exports.AERC20PeggedIncentive=i;exports.AERC20PeggedVariableCriteriaIncentive=c;exports.AERC20VariableCriteriaIncentive=a;exports.AERC20VariableIncentive=A;exports.AEventAction=d;exports.ALimitedSignerValidator=s;exports.AManagedBudget=o;exports.AManagedBudgetWithFees=g;exports.AManagedBudgetWithFeesV2=r;exports.APointsIncentive=l;exports.ASignerValidator=v;exports.ASimpleAllowList=b;exports.ASimpleDenyList=x;
|
|
2
|
+
//# sourceMappingURL=componentInterfaces-aBgBbB7r.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentInterfaces-aBgBbB7r.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./BoostRegistry.cjs"),l=require("./BoostCore.cjs"),u=require("./Boost.cjs"),C=require("./Actions/Action.cjs"),a=require("./Actions/EventAction.cjs"),E=require("./AllowLists/AllowList.cjs"),y=require("./AllowLists/SimpleAllowList.cjs"),I=require("./SimpleDenyList-DgjVf7FK.cjs"),t=require("./Budget-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./BoostRegistry.cjs"),l=require("./BoostCore.cjs"),u=require("./Boost.cjs"),C=require("./Actions/Action.cjs"),a=require("./Actions/EventAction.cjs"),E=require("./AllowLists/AllowList.cjs"),y=require("./AllowLists/SimpleAllowList.cjs"),I=require("./SimpleDenyList-DgjVf7FK.cjs"),t=require("./Budget-BjfL8dVX.cjs"),o=require("./Budgets/ManagedBudget.cjs"),D=require("./Deployable/Deployable.cjs"),T=require("./Deployable/Contract.cjs"),V=require("./Deployable/DeployableTarget.cjs"),P=require("./Deployable/DeployableTargetWithRBAC.cjs"),v=require("./Incentives/AllowListIncentive.cjs"),R=require("./Incentives/CGDAIncentive.cjs"),S=require("./Incentives/ERC20Incentive.cjs"),n=require("./Incentive-gVTfsnMB.cjs"),m=require("./Incentives/ERC20VariableIncentive.cjs"),A=require("./Incentives/ERC20VariableCriteriaIncentive.cjs"),b=require("./Incentives/PointsIncentive.cjs"),s=require("./Validators/SignerValidator.cjs"),p=require("./Validators/LimitedSignerValidator.cjs"),c=require("./Validators/Validator.cjs"),e=require("./errors.cjs"),i=require("./utils.cjs"),B=require("./claiming.cjs"),d=require("./transfers.cjs"),F=require("./Auth/PassthroughAuth.cjs"),r=require("./generated-BPiHi7W2.cjs");exports.BOOST_REGISTRY_ADDRESS=g.BOOST_REGISTRY_ADDRESS;exports.BOOST_REGISTRY_ADDRESSES=g.BOOST_REGISTRY_ADDRESSES;exports.BoostRegistry=g.BoostRegistry;exports.BOOST_CORE_ADDRESS=l.BOOST_CORE_ADDRESS;exports.BOOST_CORE_ADDRESSES=l.BOOST_CORE_ADDRESSES;exports.BoostCore=l.BoostCore;exports.FEE_DENOMINATOR=l.FEE_DENOMINATOR;exports.Boost=u.Boost;exports.prepareBoostPayload=u.prepareBoostPayload;exports.ActionByComponentInterface=C.ActionByComponentInterface;exports.actionFromAddress=C.actionFromAddress;exports.EventAction=a.EventAction;exports.FilterType=a.FilterType;exports.PrimitiveType=a.PrimitiveType;exports.SignatureType=a.SignatureType;exports.anyActionParameter=a.anyActionParameter;exports.decodeAndReorderLogArgs=a.decodeAndReorderLogArgs;exports.detectSignatureType=a.detectSignatureType;exports.isEventActionPayloadSimple=a.isEventActionPayloadSimple;exports.packFieldIndexes=a.packFieldIndexes;exports.prepareEventActionPayload=a.prepareEventActionPayload;exports.transactionSenderClaimant=a.transactionSenderClaimant;exports.unpackFieldIndexes=a.unpackFieldIndexes;exports.AllowListByComponentInterface=E.AllowListByComponentInterface;exports.OpenAllowList=E.OpenAllowList;exports.allowListFromAddress=E.allowListFromAddress;exports.LIST_MANAGER_ROLE=y.LIST_MANAGER_ROLE;exports.SimpleAllowList=y.SimpleAllowList;exports.prepareSimpleAllowListPayload=y.prepareSimpleAllowListPayload;exports.SimpleDenyList=I.SimpleDenyList;exports.prepareSimpleDenyListPayload=I.prepareSimpleDenyListPayload;exports.BudgetByComponentInterface=t.BudgetByComponentInterface;exports.ManagedBudgetWithFees=t.ManagedBudgetWithFees;exports.ManagedBudgetWithFeesV2=t.ManagedBudgetWithFeesV2;exports.budgetFromAddress=t.budgetFromAddress;exports.prepareManagedBudgetWithFeesPayload=t.prepareManagedBudgetWithFeesPayload;exports.prepareManagedBudgetWithFeesV2Payload=t.prepareManagedBudgetWithFeesV2Payload;exports.ManagedBudget=o.ManagedBudget;exports.ManagedBudgetRoles=o.ManagedBudgetRoles;exports.isERC1155TransferPayload=o.isERC1155TransferPayload;exports.isFungibleTransfer=o.isFungibleTransfer;exports.prepareManagedBudgetPayload=o.prepareManagedBudgetPayload;exports.prepareTransfer=o.prepareTransfer;exports.Deployable=D.Deployable;exports.Contract=T.Contract;exports.DeployableTarget=V.DeployableTarget;exports.DeployableTargetWithRBAC=P.DeployableTargetWithRBAC;exports.Roles=P.Roles;exports.AllowListIncentive=v.AllowListIncentive;exports.prepareAllowListIncentivePayload=v.prepareAllowListIncentivePayload;exports.CGDAIncentive=R.CGDAIncentive;exports.prepareCGDAIncentivePayload=R.prepareCGDAIncentivePayload;exports.ERC20Incentive=S.ERC20Incentive;exports.prepareERC20IncentivePayload=S.prepareERC20IncentivePayload;exports.ERC20PeggedIncentive=n.ERC20PeggedIncentive;exports.ERC20PeggedVariableCriteriaIncentive=n.ERC20PeggedVariableCriteriaIncentive;exports.IncentiveByComponentInterface=n.IncentiveByComponentInterface;exports.incentiveFromAddress=n.incentiveFromAddress;exports.prepareERC20PeggedIncentivePayload=n.prepareERC20PeggedIncentivePayload;exports.prepareERC20PeggedVariableCriteriaIncentivePayload=n.prepareERC20PeggedVariableCriteriaIncentivePayload;exports.ERC20VariableIncentive=m.ERC20VariableIncentive;exports.prepareERC20VariableIncentivePayload=m.prepareERC20VariableIncentivePayload;exports.ERC20VariableCriteriaIncentive=A.ERC20VariableCriteriaIncentive;exports.gasRebateIncentiveCriteria=A.gasRebateIncentiveCriteria;exports.prepareERC20VariableCriteriaIncentivePayload=A.prepareERC20VariableCriteriaIncentivePayload;exports.PointsIncentive=b.PointsIncentive;exports.preparePointsIncentivePayload=b.preparePointsIncentivePayload;exports.SignerValidator=s.SignerValidator;exports.prepareSignerValidatorClaimDataPayload=s.prepareSignerValidatorClaimDataPayload;exports.prepareSignerValidatorInputParams=s.prepareSignerValidatorInputParams;exports.prepareSignerValidatorPayload=s.prepareSignerValidatorPayload;exports.LimitedSignerValidator=p.LimitedSignerValidator;exports.prepareLimitedSignerValidatorClaimDataPayload=p.prepareLimitedSignerValidatorClaimDataPayload;exports.prepareLimitedSignerValidatorInputParams=p.prepareLimitedSignerValidatorInputParams;exports.prepareLimitedSignerValidatorPayload=p.prepareLimitedSignerValidatorPayload;exports.BoostValidatorEOA=c.BoostValidatorEOA;exports.ValidatorByComponentInterface=c.ValidatorByComponentInterface;exports.decodeClaimData=c.decodeClaimData;exports.validatorFromAddress=c.validatorFromAddress;exports.BoostCoreNoIdentifierEmitted=e.BoostCoreNoIdentifierEmitted;exports.BoostNotFoundError=e.BoostNotFoundError;exports.BudgetMustAuthorizeBoostCore=e.BudgetMustAuthorizeBoostCore;exports.ContractAddressRequiredError=e.ContractAddressRequiredError;exports.DecodedArgsError=e.DecodedArgsError;exports.DecodedArgsMalformedError=e.DecodedArgsMalformedError;exports.DeployableAlreadyDeployedError=e.DeployableAlreadyDeployedError;exports.DeployableBuildParametersUnspecifiedError=e.DeployableBuildParametersUnspecifiedError;exports.DeployableMissingPayloadError=e.DeployableMissingPayloadError;exports.DeployableUnknownOwnerProvidedError=e.DeployableUnknownOwnerProvidedError;exports.DeployableWagmiConfigurationRequiredError=e.DeployableWagmiConfigurationRequiredError;exports.FieldActionValidationError=e.FieldActionValidationError;exports.FieldValueNotComparableError=e.FieldValueNotComparableError;exports.FieldValueUndefinedError=e.FieldValueUndefinedError;exports.FunctionDataDecodeError=e.FunctionDataDecodeError;exports.IncentiveCriteriaNotFoundError=e.IncentiveCriteriaNotFoundError;exports.IncentiveNotCloneableError=e.IncentiveNotCloneableError;exports.InvalidComponentInterfaceError=e.InvalidComponentInterfaceError;exports.InvalidCriteriaTypeError=e.InvalidCriteriaTypeError;exports.InvalidNumericalCriteriaError=e.InvalidNumericalCriteriaError;exports.InvalidProtocolChainIdError=e.InvalidProtocolChainIdError;exports.InvalidTupleDecodingError=e.InvalidTupleDecodingError;exports.InvalidTupleEncodingError=e.InvalidTupleEncodingError;exports.MustInitializeBudgetError=e.MustInitializeBudgetError;exports.NoConnectedChainIdError=e.NoConnectedChainIdError;exports.NoContractAddressUponReceiptError=e.NoContractAddressUponReceiptError;exports.NoEventActionStepsProvidedError=e.NoEventActionStepsProvidedError;exports.NoMatchingLogsError=e.NoMatchingLogsError;exports.TooManyEventActionStepsProvidedError=e.TooManyEventActionStepsProvidedError;exports.UnknownTransferPayloadSupplied=e.UnknownTransferPayloadSupplied;exports.UnparseableAbiParamError=e.UnparseableAbiParamError;exports.UnrecognizedFilterTypeError=e.UnrecognizedFilterTypeError;exports.ValidationAbiMissingError=e.ValidationAbiMissingError;exports.CheatCodes=i.CheatCodes;exports.RegistryType=i.RegistryType;exports.TRANSFER_SIGNATURE=i.TRANSFER_SIGNATURE;exports.assertValidAddressByChainId=i.assertValidAddressByChainId;exports.awaitResult=i.awaitResult;exports.bytes4=i.bytes4;exports.getDeployedContractAddress=i.getDeployedContractAddress;exports.getErc20Balance=i.getErc20Balance;exports.StrategyType=B.StrategyType;exports.prepareClaimPayload=B.prepareClaimPayload;exports.AssetType=d.AssetType;exports.prepareERC1155Payload=d.prepareERC1155Payload;exports.prepareERC1155Transfer=d.prepareERC1155Transfer;exports.prepareFungiblePayload=d.prepareFungiblePayload;exports.prepareFungibleTransfer=d.prepareFungibleTransfer;exports.prepareTransferPayload=d.prepareTransferPayload;exports.PassthroughAuth=F.PassthroughAuth;exports.allowListIncentiveAbi=r.H;exports.boostCoreAbi=r.g;exports.boostRegistryAbi=r.be;exports.cgdaIncentiveAbi=r.N;exports.erc20IncentiveAbi=r.m;exports.erc20PeggedIncentiveAbi=r.f;exports.erc20PeggedVariableCriteriaIncentiveAbi=r.y;exports.erc20VariableCriteriaIncentiveAbi=r.d;exports.erc20VariableIncentiveAbi=r.A;exports.limitedSignerValidatorAbi=r.S;exports.managedBudgetAbi=r.h;exports.managedBudgetWithFeesAbi=r.p;exports.managedBudgetWithFeesV2Abi=r.r;exports.passthroughAuthAbi=r.$e;exports.pointsIncentiveAbi=r.R;exports.rbacAbi=r.V;exports.signerValidatorAbi=r._;exports.simpleAllowListAbi=r.z;exports.simpleDenyListAbi=r.B;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { EventAction as C, FilterType as I, PrimitiveType as b, SignatureType as
|
|
|
6
6
|
import { AllowListByComponentInterface as V, OpenAllowList as F, allowListFromAddress as h } from "./AllowLists/AllowList.js";
|
|
7
7
|
import { LIST_MANAGER_ROLE as M, SimpleAllowList as N, prepareSimpleAllowListPayload as O } from "./AllowLists/SimpleAllowList.js";
|
|
8
8
|
import { S as _, p as U } from "./SimpleDenyList-BKfPoTo1.js";
|
|
9
|
-
import { B as G, M as k, a as z, b as q, p as Y, c as H } from "./Budget-
|
|
9
|
+
import { B as G, M as k, a as z, b as q, p as Y, c as H } from "./Budget-DD7IPuDx.js";
|
|
10
10
|
import { ManagedBudget as j, ManagedBudgetRoles as J, isERC1155TransferPayload as K, isFungibleTransfer as Q, prepareManagedBudgetPayload as X, prepareTransfer as Z } from "./Budgets/ManagedBudget.js";
|
|
11
11
|
import { Deployable as re } from "./Deployable/Deployable.js";
|
|
12
12
|
import { Contract as oe } from "./Deployable/Contract.js";
|
|
@@ -15,7 +15,7 @@ import { DeployableTargetWithRBAC as de, Roles as pe } from "./Deployable/Deploy
|
|
|
15
15
|
import { AllowListIncentive as se, prepareAllowListIncentivePayload as ce } from "./Incentives/AllowListIncentive.js";
|
|
16
16
|
import { CGDAIncentive as me, prepareCGDAIncentivePayload as Ee } from "./Incentives/CGDAIncentive.js";
|
|
17
17
|
import { ERC20Incentive as ye, prepareERC20IncentivePayload as Ce } from "./Incentives/ERC20Incentive.js";
|
|
18
|
-
import { E as be, a as fe, I as Pe, i as ve, p as ue, b as Re } from "./Incentive-
|
|
18
|
+
import { E as be, a as fe, I as Pe, i as ve, p as ue, b as Re } from "./Incentive-V1RjH38L.js";
|
|
19
19
|
import { ERC20VariableIncentive as Be, prepareERC20VariableIncentivePayload as xe } from "./Incentives/ERC20VariableIncentive.js";
|
|
20
20
|
import { ERC20VariableCriteriaIncentive as Te, gasRebateIncentiveCriteria as Ve, prepareERC20VariableCriteriaIncentivePayload as Fe } from "./Incentives/ERC20VariableCriteriaIncentive.js";
|
|
21
21
|
import { PointsIncentive as Le, preparePointsIncentivePayload as Me } from "./Incentives/PointsIncentive.js";
|
package/package.json
CHANGED
|
@@ -602,10 +602,7 @@ export async function prepareLimitedSignerValidatorClaimDataPayload({
|
|
|
602
602
|
},
|
|
603
603
|
};
|
|
604
604
|
|
|
605
|
-
const trustedSignature = await signTypedData(
|
|
606
|
-
...typedData,
|
|
607
|
-
privateKey: signer.key,
|
|
608
|
-
});
|
|
605
|
+
const trustedSignature = await signer.privateKey.signTypedData(typedData);
|
|
609
606
|
|
|
610
607
|
// Prepare the claim data payload using the new helper
|
|
611
608
|
const validatorData = prepareLimitedSignerValidatorInputParams({
|