@lit-protocol/vincent-policy-send-counter 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/CONTRIBUTING.md +6 -6
  3. package/README.md +1 -1
  4. package/dist/CHANGELOG.md +22 -0
  5. package/dist/CONTRIBUTING.md +6 -6
  6. package/dist/README.md +1 -1
  7. package/dist/package.json +3 -3
  8. package/dist/src/generated/lit-action.js +2 -2
  9. package/dist/src/generated/vincent-bundled-policy.d.ts +183 -144
  10. package/dist/src/generated/vincent-bundled-policy.d.ts.map +1 -1
  11. package/dist/src/generated/vincent-policy-metadata.json +1 -1
  12. package/dist/src/lib/abi/counterSignatures.d.ts +82 -0
  13. package/dist/src/lib/abi/counterSignatures.d.ts.map +1 -0
  14. package/dist/src/lib/abi/counterSignatures.js +100 -0
  15. package/dist/src/lib/abi/counterSignatures.js.map +1 -0
  16. package/dist/src/lib/helpers/index.d.ts +26 -0
  17. package/dist/src/lib/helpers/index.d.ts.map +1 -0
  18. package/dist/src/lib/helpers/index.js +107 -0
  19. package/dist/src/lib/helpers/index.js.map +1 -0
  20. package/dist/src/lib/schemas.d.ts +115 -64
  21. package/dist/src/lib/schemas.d.ts.map +1 -1
  22. package/dist/src/lib/schemas.js +71 -36
  23. package/dist/src/lib/schemas.js.map +1 -1
  24. package/dist/src/lib/vincent-policy.d.ts +183 -144
  25. package/dist/src/lib/vincent-policy.d.ts.map +1 -1
  26. package/dist/src/lib/vincent-policy.js +145 -74
  27. package/dist/src/lib/vincent-policy.js.map +1 -1
  28. package/package.json +5 -5
  29. package/dist/src/lib/policy-helpers/calculate-usd-value.d.ts +0 -7
  30. package/dist/src/lib/policy-helpers/calculate-usd-value.d.ts.map +0 -1
  31. package/dist/src/lib/policy-helpers/calculate-usd-value.js +0 -22
  32. package/dist/src/lib/policy-helpers/calculate-usd-value.js.map +0 -1
  33. package/dist/src/lib/policy-helpers/check-spending-limit.d.ts +0 -16
  34. package/dist/src/lib/policy-helpers/check-spending-limit.d.ts.map +0 -1
  35. package/dist/src/lib/policy-helpers/check-spending-limit.js +0 -29
  36. package/dist/src/lib/policy-helpers/check-spending-limit.js.map +0 -1
  37. package/dist/src/lib/policy-helpers/get-eth-usd-price.d.ts +0 -6
  38. package/dist/src/lib/policy-helpers/get-eth-usd-price.d.ts.map +0 -1
  39. package/dist/src/lib/policy-helpers/get-eth-usd-price.js +0 -22
  40. package/dist/src/lib/policy-helpers/get-eth-usd-price.js.map +0 -1
  41. package/dist/src/lib/policy-helpers/get-token-amount-in-usd.d.ts +0 -10
  42. package/dist/src/lib/policy-helpers/get-token-amount-in-usd.d.ts.map +0 -1
  43. package/dist/src/lib/policy-helpers/get-token-amount-in-usd.js +0 -68
  44. package/dist/src/lib/policy-helpers/get-token-amount-in-usd.js.map +0 -1
  45. package/dist/src/lib/policy-helpers/get-uniswap-quote.d.ts +0 -15
  46. package/dist/src/lib/policy-helpers/get-uniswap-quote.d.ts.map +0 -1
  47. package/dist/src/lib/policy-helpers/get-uniswap-quote.js +0 -114
  48. package/dist/src/lib/policy-helpers/get-uniswap-quote.js.map +0 -1
  49. package/dist/src/lib/policy-helpers/index.d.ts +0 -7
  50. package/dist/src/lib/policy-helpers/index.d.ts.map +0 -1
  51. package/dist/src/lib/policy-helpers/index.js +0 -10
  52. package/dist/src/lib/policy-helpers/index.js.map +0 -1
  53. package/dist/src/lib/policy-helpers/send-spend-tx.d.ts +0 -9
  54. package/dist/src/lib/policy-helpers/send-spend-tx.d.ts.map +0 -1
  55. package/dist/src/lib/policy-helpers/send-spend-tx.js +0 -144
  56. package/dist/src/lib/policy-helpers/send-spend-tx.js.map +0 -1
  57. package/dist/src/lib/policy-helpers/sign-tx.d.ts +0 -3
  58. package/dist/src/lib/policy-helpers/sign-tx.d.ts.map +0 -1
  59. package/dist/src/lib/policy-helpers/sign-tx.js +0 -28
  60. package/dist/src/lib/policy-helpers/sign-tx.js.map +0 -1
  61. package/dist/src/lib/policy-helpers/spending-limit-contract.d.ts +0 -4
  62. package/dist/src/lib/policy-helpers/spending-limit-contract.d.ts.map +0 -1
  63. package/dist/src/lib/policy-helpers/spending-limit-contract.js +0 -22
  64. package/dist/src/lib/policy-helpers/spending-limit-contract.js.map +0 -1
@@ -1,212 +1,251 @@
1
1
  /**
2
2
  * DO NOT EDIT THIS FILE. IT IS GENERATED ON BUILD.
3
3
  */
4
- export declare const bundledVincentPolicy: import("@lit-protocol/vincent-ability-sdk").BundledVincentPolicy<import("node_modules/@lit-protocol/vincent-ability-sdk/dist/src/lib/types").VincentPolicy<"@lit-protocol/vincent-policy-spending-limit", import("zod").ZodObject<{
5
- ethRpcUrl: import("zod").ZodString;
6
- rpcUrlForUniswap: import("zod").ZodString;
7
- chainIdForUniswap: import("zod").ZodNumber;
8
- tokenAddress: import("zod").ZodString;
9
- tokenDecimals: import("zod").ZodNumber;
10
- buyAmount: import("zod").ZodNumber;
4
+ export declare const bundledVincentPolicy: import("@lit-protocol/vincent-ability-sdk").BundledVincentPolicy<import("node_modules/@lit-protocol/vincent-ability-sdk/dist/src/lib/types").VincentPolicy<"@lit-protocol/vincent-policy-send-counter-limit", import("zod").ZodObject<{
5
+ to: import("zod").ZodString;
6
+ amount: import("zod").ZodString;
11
7
  }, "strip", import("zod").ZodTypeAny, {
12
- ethRpcUrl: string;
13
- rpcUrlForUniswap: string;
14
- chainIdForUniswap: number;
15
- tokenAddress: string;
16
- tokenDecimals: number;
17
- buyAmount: number;
8
+ to: string;
9
+ amount: string;
18
10
  }, {
19
- ethRpcUrl: string;
20
- rpcUrlForUniswap: string;
21
- chainIdForUniswap: number;
22
- tokenAddress: string;
23
- tokenDecimals: number;
24
- buyAmount: number;
11
+ to: string;
12
+ amount: string;
25
13
  }>, import("zod").ZodObject<{
26
- maxDailySpendingLimitInUsdCents: import("zod").ZodBigInt;
14
+ maxSends: import("zod").ZodNumber;
15
+ timeWindowSeconds: import("zod").ZodNumber;
27
16
  }, "strip", import("zod").ZodTypeAny, {
28
- maxDailySpendingLimitInUsdCents: bigint;
17
+ maxSends: number;
18
+ timeWindowSeconds: number;
29
19
  }, {
30
- maxDailySpendingLimitInUsdCents: bigint;
20
+ maxSends: number;
21
+ timeWindowSeconds: number;
31
22
  }>, import("zod").ZodObject<{
32
- maxSpendingLimitInUsd: import("zod").ZodNumber;
33
- buyAmountInUsd: import("zod").ZodNumber;
23
+ currentCount: import("zod").ZodNumber;
24
+ maxSends: import("zod").ZodNumber;
25
+ remainingSends: import("zod").ZodNumber;
26
+ timeWindowSeconds: import("zod").ZodNumber;
34
27
  }, "strip", import("zod").ZodTypeAny, {
35
- maxSpendingLimitInUsd: number;
36
- buyAmountInUsd: number;
28
+ currentCount: number;
29
+ remainingSends: number;
30
+ maxSends: number;
31
+ timeWindowSeconds: number;
37
32
  }, {
38
- maxSpendingLimitInUsd: number;
39
- buyAmountInUsd: number;
33
+ currentCount: number;
34
+ remainingSends: number;
35
+ maxSends: number;
36
+ timeWindowSeconds: number;
40
37
  }>, import("zod").ZodObject<{
41
- reason: import("zod").ZodLiteral<"Attempted buy amount exceeds daily limit">;
42
- maxSpendingLimitInUsd: import("zod").ZodNumber;
43
- buyAmountInUsd: import("zod").ZodNumber;
38
+ reason: import("zod").ZodString;
39
+ currentCount: import("zod").ZodNumber;
40
+ maxSends: import("zod").ZodNumber;
41
+ secondsUntilReset: import("zod").ZodNumber;
44
42
  }, "strip", import("zod").ZodTypeAny, {
45
- maxSpendingLimitInUsd: number;
46
- reason: "Attempted buy amount exceeds daily limit";
47
- buyAmountInUsd: number;
43
+ currentCount: number;
44
+ secondsUntilReset: number;
45
+ maxSends: number;
46
+ reason: string;
48
47
  }, {
49
- maxSpendingLimitInUsd: number;
50
- reason: "Attempted buy amount exceeds daily limit";
51
- buyAmountInUsd: number;
48
+ currentCount: number;
49
+ secondsUntilReset: number;
50
+ maxSends: number;
51
+ reason: string;
52
52
  }>, import("zod").ZodObject<{
53
- maxSpendingLimitInUsd: import("zod").ZodNumber;
54
- buyAmountInUsd: import("zod").ZodNumber;
53
+ currentCount: import("zod").ZodNumber;
54
+ maxSends: import("zod").ZodNumber;
55
+ remainingSends: import("zod").ZodNumber;
56
+ timeWindowSeconds: import("zod").ZodNumber;
55
57
  }, "strip", import("zod").ZodTypeAny, {
56
- maxSpendingLimitInUsd: number;
57
- buyAmountInUsd: number;
58
+ currentCount: number;
59
+ remainingSends: number;
60
+ maxSends: number;
61
+ timeWindowSeconds: number;
58
62
  }, {
59
- maxSpendingLimitInUsd: number;
60
- buyAmountInUsd: number;
63
+ currentCount: number;
64
+ remainingSends: number;
65
+ maxSends: number;
66
+ timeWindowSeconds: number;
61
67
  }>, import("zod").ZodObject<{
62
68
  reason: import("zod").ZodString;
63
- maxSpendingLimitInUsd: import("zod").ZodOptional<import("zod").ZodNumber>;
64
- buyAmountInUsd: import("zod").ZodOptional<import("zod").ZodNumber>;
65
- }, "strip", import("zod").ZodTypeAny, {
69
+ currentCount: import("zod").ZodNumber;
70
+ maxSends: import("zod").ZodNumber;
71
+ secondsUntilReset: import("zod").ZodNumber;
72
+ timeWindowSeconds: import("zod").ZodNumber;
73
+ }, "strip", import("zod").ZodTypeAny, {
74
+ currentCount: number;
75
+ secondsUntilReset: number;
76
+ maxSends: number;
77
+ timeWindowSeconds: number;
66
78
  reason: string;
67
- maxSpendingLimitInUsd?: number | undefined;
68
- buyAmountInUsd?: number | undefined;
69
79
  }, {
80
+ currentCount: number;
81
+ secondsUntilReset: number;
82
+ maxSends: number;
83
+ timeWindowSeconds: number;
70
84
  reason: string;
71
- maxSpendingLimitInUsd?: number | undefined;
72
- buyAmountInUsd?: number | undefined;
73
85
  }>, import("zod").ZodObject<{
74
- amountSpentUsd: import("zod").ZodNumber;
75
- maxSpendingLimitInUsd: import("zod").ZodNumber;
86
+ currentCount: import("zod").ZodNumber;
87
+ maxSends: import("zod").ZodNumber;
88
+ remainingSends: import("zod").ZodNumber;
89
+ timeWindowSeconds: import("zod").ZodNumber;
76
90
  }, "strip", import("zod").ZodTypeAny, {
77
- amountSpentUsd: number;
78
- maxSpendingLimitInUsd: number;
91
+ currentCount: number;
92
+ remainingSends: number;
93
+ maxSends: number;
94
+ timeWindowSeconds: number;
79
95
  }, {
80
- amountSpentUsd: number;
81
- maxSpendingLimitInUsd: number;
96
+ currentCount: number;
97
+ remainingSends: number;
98
+ maxSends: number;
99
+ timeWindowSeconds: number;
82
100
  }>, import("zod").ZodObject<{
83
- spendTxHash: import("zod").ZodString;
101
+ recorded: import("zod").ZodBoolean;
102
+ newCount: import("zod").ZodNumber;
103
+ remainingSends: import("zod").ZodNumber;
84
104
  }, "strip", import("zod").ZodTypeAny, {
85
- spendTxHash: string;
105
+ remainingSends: number;
106
+ recorded: boolean;
107
+ newCount: number;
86
108
  }, {
87
- spendTxHash: string;
109
+ remainingSends: number;
110
+ recorded: boolean;
111
+ newCount: number;
88
112
  }>, import("zod").ZodObject<{
89
- error: import("zod").ZodString;
113
+ reason: import("zod").ZodString;
90
114
  }, "strip", import("zod").ZodTypeAny, {
91
- error: string;
115
+ reason: string;
92
116
  }, {
93
- error: string;
117
+ reason: string;
94
118
  }>, import("node_modules/@lit-protocol/vincent-ability-sdk/dist/src/lib/types").PolicyLifecycleFunction<import("zod").ZodObject<{
95
- ethRpcUrl: import("zod").ZodString;
96
- rpcUrlForUniswap: import("zod").ZodString;
97
- chainIdForUniswap: import("zod").ZodNumber;
98
- tokenAddress: import("zod").ZodString;
99
- tokenDecimals: import("zod").ZodNumber;
100
- buyAmount: import("zod").ZodNumber;
119
+ to: import("zod").ZodString;
120
+ amount: import("zod").ZodString;
101
121
  }, "strip", import("zod").ZodTypeAny, {
102
- ethRpcUrl: string;
103
- rpcUrlForUniswap: string;
104
- chainIdForUniswap: number;
105
- tokenAddress: string;
106
- tokenDecimals: number;
107
- buyAmount: number;
122
+ to: string;
123
+ amount: string;
108
124
  }, {
109
- ethRpcUrl: string;
110
- rpcUrlForUniswap: string;
111
- chainIdForUniswap: number;
112
- tokenAddress: string;
113
- tokenDecimals: number;
114
- buyAmount: number;
125
+ to: string;
126
+ amount: string;
115
127
  }>, import("zod").ZodObject<{
116
- maxDailySpendingLimitInUsdCents: import("zod").ZodBigInt;
128
+ maxSends: import("zod").ZodNumber;
129
+ timeWindowSeconds: import("zod").ZodNumber;
117
130
  }, "strip", import("zod").ZodTypeAny, {
118
- maxDailySpendingLimitInUsdCents: bigint;
131
+ maxSends: number;
132
+ timeWindowSeconds: number;
119
133
  }, {
120
- maxDailySpendingLimitInUsdCents: bigint;
134
+ maxSends: number;
135
+ timeWindowSeconds: number;
121
136
  }>, import("zod").ZodObject<{
122
- maxSpendingLimitInUsd: import("zod").ZodNumber;
123
- buyAmountInUsd: import("zod").ZodNumber;
137
+ currentCount: import("zod").ZodNumber;
138
+ maxSends: import("zod").ZodNumber;
139
+ remainingSends: import("zod").ZodNumber;
140
+ timeWindowSeconds: import("zod").ZodNumber;
124
141
  }, "strip", import("zod").ZodTypeAny, {
125
- maxSpendingLimitInUsd: number;
126
- buyAmountInUsd: number;
142
+ currentCount: number;
143
+ remainingSends: number;
144
+ maxSends: number;
145
+ timeWindowSeconds: number;
127
146
  }, {
128
- maxSpendingLimitInUsd: number;
129
- buyAmountInUsd: number;
147
+ currentCount: number;
148
+ remainingSends: number;
149
+ maxSends: number;
150
+ timeWindowSeconds: number;
130
151
  }>, import("zod").ZodObject<{
131
152
  reason: import("zod").ZodString;
132
- maxSpendingLimitInUsd: import("zod").ZodOptional<import("zod").ZodNumber>;
133
- buyAmountInUsd: import("zod").ZodOptional<import("zod").ZodNumber>;
134
- }, "strip", import("zod").ZodTypeAny, {
153
+ currentCount: import("zod").ZodNumber;
154
+ maxSends: import("zod").ZodNumber;
155
+ secondsUntilReset: import("zod").ZodNumber;
156
+ timeWindowSeconds: import("zod").ZodNumber;
157
+ }, "strip", import("zod").ZodTypeAny, {
158
+ currentCount: number;
159
+ secondsUntilReset: number;
160
+ maxSends: number;
161
+ timeWindowSeconds: number;
135
162
  reason: string;
136
- maxSpendingLimitInUsd?: number | undefined;
137
- buyAmountInUsd?: number | undefined;
138
163
  }, {
164
+ currentCount: number;
165
+ secondsUntilReset: number;
166
+ maxSends: number;
167
+ timeWindowSeconds: number;
139
168
  reason: string;
140
- maxSpendingLimitInUsd?: number | undefined;
141
- buyAmountInUsd?: number | undefined;
142
169
  }>>, import("node_modules/@lit-protocol/vincent-ability-sdk/dist/src/lib/types").PolicyLifecycleFunction<import("zod").ZodObject<{
143
- ethRpcUrl: import("zod").ZodString;
144
- rpcUrlForUniswap: import("zod").ZodString;
145
- chainIdForUniswap: import("zod").ZodNumber;
146
- tokenAddress: import("zod").ZodString;
147
- tokenDecimals: import("zod").ZodNumber;
148
- buyAmount: import("zod").ZodNumber;
170
+ to: import("zod").ZodString;
171
+ amount: import("zod").ZodString;
149
172
  }, "strip", import("zod").ZodTypeAny, {
150
- ethRpcUrl: string;
151
- rpcUrlForUniswap: string;
152
- chainIdForUniswap: number;
153
- tokenAddress: string;
154
- tokenDecimals: number;
155
- buyAmount: number;
173
+ to: string;
174
+ amount: string;
156
175
  }, {
157
- ethRpcUrl: string;
158
- rpcUrlForUniswap: string;
159
- chainIdForUniswap: number;
160
- tokenAddress: string;
161
- tokenDecimals: number;
162
- buyAmount: number;
176
+ to: string;
177
+ amount: string;
163
178
  }>, import("zod").ZodObject<{
164
- maxDailySpendingLimitInUsdCents: import("zod").ZodBigInt;
179
+ maxSends: import("zod").ZodNumber;
180
+ timeWindowSeconds: import("zod").ZodNumber;
165
181
  }, "strip", import("zod").ZodTypeAny, {
166
- maxDailySpendingLimitInUsdCents: bigint;
182
+ maxSends: number;
183
+ timeWindowSeconds: number;
167
184
  }, {
168
- maxDailySpendingLimitInUsdCents: bigint;
185
+ maxSends: number;
186
+ timeWindowSeconds: number;
169
187
  }>, import("zod").ZodObject<{
170
- maxSpendingLimitInUsd: import("zod").ZodNumber;
171
- buyAmountInUsd: import("zod").ZodNumber;
188
+ currentCount: import("zod").ZodNumber;
189
+ maxSends: import("zod").ZodNumber;
190
+ remainingSends: import("zod").ZodNumber;
191
+ timeWindowSeconds: import("zod").ZodNumber;
172
192
  }, "strip", import("zod").ZodTypeAny, {
173
- maxSpendingLimitInUsd: number;
174
- buyAmountInUsd: number;
193
+ currentCount: number;
194
+ remainingSends: number;
195
+ maxSends: number;
196
+ timeWindowSeconds: number;
175
197
  }, {
176
- maxSpendingLimitInUsd: number;
177
- buyAmountInUsd: number;
198
+ currentCount: number;
199
+ remainingSends: number;
200
+ maxSends: number;
201
+ timeWindowSeconds: number;
178
202
  }>, import("zod").ZodObject<{
179
- reason: import("zod").ZodLiteral<"Attempted buy amount exceeds daily limit">;
180
- maxSpendingLimitInUsd: import("zod").ZodNumber;
181
- buyAmountInUsd: import("zod").ZodNumber;
203
+ reason: import("zod").ZodString;
204
+ currentCount: import("zod").ZodNumber;
205
+ maxSends: import("zod").ZodNumber;
206
+ secondsUntilReset: import("zod").ZodNumber;
182
207
  }, "strip", import("zod").ZodTypeAny, {
183
- maxSpendingLimitInUsd: number;
184
- reason: "Attempted buy amount exceeds daily limit";
185
- buyAmountInUsd: number;
208
+ currentCount: number;
209
+ secondsUntilReset: number;
210
+ maxSends: number;
211
+ reason: string;
186
212
  }, {
187
- maxSpendingLimitInUsd: number;
188
- reason: "Attempted buy amount exceeds daily limit";
189
- buyAmountInUsd: number;
213
+ currentCount: number;
214
+ secondsUntilReset: number;
215
+ maxSends: number;
216
+ reason: string;
190
217
  }>>, import("node_modules/@lit-protocol/vincent-ability-sdk/dist/src/lib/types").CommitLifecycleFunction<import("zod").ZodObject<{
191
- amountSpentUsd: import("zod").ZodNumber;
192
- maxSpendingLimitInUsd: import("zod").ZodNumber;
218
+ currentCount: import("zod").ZodNumber;
219
+ maxSends: import("zod").ZodNumber;
220
+ remainingSends: import("zod").ZodNumber;
221
+ timeWindowSeconds: import("zod").ZodNumber;
193
222
  }, "strip", import("zod").ZodTypeAny, {
194
- amountSpentUsd: number;
195
- maxSpendingLimitInUsd: number;
223
+ currentCount: number;
224
+ remainingSends: number;
225
+ maxSends: number;
226
+ timeWindowSeconds: number;
196
227
  }, {
197
- amountSpentUsd: number;
198
- maxSpendingLimitInUsd: number;
228
+ currentCount: number;
229
+ remainingSends: number;
230
+ maxSends: number;
231
+ timeWindowSeconds: number;
199
232
  }>, import("zod").ZodObject<{
200
- spendTxHash: import("zod").ZodString;
233
+ recorded: import("zod").ZodBoolean;
234
+ newCount: import("zod").ZodNumber;
235
+ remainingSends: import("zod").ZodNumber;
201
236
  }, "strip", import("zod").ZodTypeAny, {
202
- spendTxHash: string;
237
+ remainingSends: number;
238
+ recorded: boolean;
239
+ newCount: number;
203
240
  }, {
204
- spendTxHash: string;
241
+ remainingSends: number;
242
+ recorded: boolean;
243
+ newCount: number;
205
244
  }>, import("zod").ZodObject<{
206
- error: import("zod").ZodString;
245
+ reason: import("zod").ZodString;
207
246
  }, "strip", import("zod").ZodTypeAny, {
208
- error: string;
247
+ reason: string;
209
248
  }, {
210
- error: string;
249
+ reason: string;
211
250
  }>>>, string>;
212
251
  //# sourceMappingURL=vincent-bundled-policy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vincent-bundled-policy.d.ts","sourceRoot":"","sources":["../../../src/generated/vincent-bundled-policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAA0D,CAAC"}
1
+ {"version":3,"file":"vincent-bundled-policy.d.ts","sourceRoot":"","sources":["../../../src/generated/vincent-bundled-policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAA0D,CAAC"}
@@ -1,3 +1,3 @@
1
1
  {
2
- "ipfsCid": "QmWJnyz9XigvwQhVaUmLmgTCAvzVKhLpC2XU1tY5XFqyXC"
2
+ "ipfsCid": "QmfPpo34JinrFCbpYBNiUQsSdHPj1ieUdCATy2oxaBwCqA"
3
3
  }
@@ -0,0 +1,82 @@
1
+ export declare const counterSignatures: {
2
+ readonly address: "0x91670f6ce98353815278b4b21f11222dec14fefe";
3
+ readonly methods: {
4
+ readonly counterByAddress: {
5
+ readonly type: "function";
6
+ readonly name: "counterByAddress";
7
+ readonly inputs: readonly [{
8
+ readonly name: "";
9
+ readonly type: "address";
10
+ readonly internalType: "address";
11
+ }];
12
+ readonly outputs: readonly [{
13
+ readonly name: "";
14
+ readonly type: "uint256";
15
+ readonly internalType: "uint256";
16
+ }];
17
+ readonly stateMutability: "view";
18
+ };
19
+ readonly getCounter: {
20
+ readonly type: "function";
21
+ readonly name: "getCounter";
22
+ readonly inputs: readonly [{
23
+ readonly name: "addr";
24
+ readonly type: "address";
25
+ readonly internalType: "address";
26
+ }];
27
+ readonly outputs: readonly [{
28
+ readonly name: "";
29
+ readonly type: "uint256";
30
+ readonly internalType: "uint256";
31
+ }];
32
+ readonly stateMutability: "view";
33
+ };
34
+ readonly getLastIncrementTime: {
35
+ readonly type: "function";
36
+ readonly name: "getLastIncrementTime";
37
+ readonly inputs: readonly [{
38
+ readonly name: "addr";
39
+ readonly type: "address";
40
+ readonly internalType: "address";
41
+ }];
42
+ readonly outputs: readonly [{
43
+ readonly name: "";
44
+ readonly type: "uint256";
45
+ readonly internalType: "uint256";
46
+ }];
47
+ readonly stateMutability: "view";
48
+ };
49
+ readonly increment: {
50
+ readonly type: "function";
51
+ readonly name: "increment";
52
+ readonly inputs: readonly [];
53
+ readonly outputs: readonly [];
54
+ readonly stateMutability: "nonpayable";
55
+ };
56
+ readonly lastIncrementTime: {
57
+ readonly type: "function";
58
+ readonly name: "lastIncrementTime";
59
+ readonly inputs: readonly [{
60
+ readonly name: "";
61
+ readonly type: "address";
62
+ readonly internalType: "address";
63
+ }];
64
+ readonly outputs: readonly [{
65
+ readonly name: "";
66
+ readonly type: "uint256";
67
+ readonly internalType: "uint256";
68
+ }];
69
+ readonly stateMutability: "view";
70
+ };
71
+ readonly reset: {
72
+ readonly type: "function";
73
+ readonly name: "reset";
74
+ readonly inputs: readonly [];
75
+ readonly outputs: readonly [];
76
+ readonly stateMutability: "nonpayable";
77
+ };
78
+ };
79
+ readonly events: readonly [];
80
+ };
81
+ export type CounterSignatures = typeof counterSignatures;
82
+ //# sourceMappingURL=counterSignatures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counterSignatures.d.ts","sourceRoot":"","sources":["../../../../src/lib/abi/counterSignatures.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+FpB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC"}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.counterSignatures = void 0;
4
+ exports.counterSignatures = {
5
+ address: '0x91670f6ce98353815278b4b21f11222dec14fefe',
6
+ methods: {
7
+ counterByAddress: {
8
+ type: 'function',
9
+ name: 'counterByAddress',
10
+ inputs: [
11
+ {
12
+ name: '',
13
+ type: 'address',
14
+ internalType: 'address',
15
+ },
16
+ ],
17
+ outputs: [
18
+ {
19
+ name: '',
20
+ type: 'uint256',
21
+ internalType: 'uint256',
22
+ },
23
+ ],
24
+ stateMutability: 'view',
25
+ },
26
+ getCounter: {
27
+ type: 'function',
28
+ name: 'getCounter',
29
+ inputs: [
30
+ {
31
+ name: 'addr',
32
+ type: 'address',
33
+ internalType: 'address',
34
+ },
35
+ ],
36
+ outputs: [
37
+ {
38
+ name: '',
39
+ type: 'uint256',
40
+ internalType: 'uint256',
41
+ },
42
+ ],
43
+ stateMutability: 'view',
44
+ },
45
+ getLastIncrementTime: {
46
+ type: 'function',
47
+ name: 'getLastIncrementTime',
48
+ inputs: [
49
+ {
50
+ name: 'addr',
51
+ type: 'address',
52
+ internalType: 'address',
53
+ },
54
+ ],
55
+ outputs: [
56
+ {
57
+ name: '',
58
+ type: 'uint256',
59
+ internalType: 'uint256',
60
+ },
61
+ ],
62
+ stateMutability: 'view',
63
+ },
64
+ increment: {
65
+ type: 'function',
66
+ name: 'increment',
67
+ inputs: [],
68
+ outputs: [],
69
+ stateMutability: 'nonpayable',
70
+ },
71
+ lastIncrementTime: {
72
+ type: 'function',
73
+ name: 'lastIncrementTime',
74
+ inputs: [
75
+ {
76
+ name: '',
77
+ type: 'address',
78
+ internalType: 'address',
79
+ },
80
+ ],
81
+ outputs: [
82
+ {
83
+ name: '',
84
+ type: 'uint256',
85
+ internalType: 'uint256',
86
+ },
87
+ ],
88
+ stateMutability: 'view',
89
+ },
90
+ reset: {
91
+ type: 'function',
92
+ name: 'reset',
93
+ inputs: [],
94
+ outputs: [],
95
+ stateMutability: 'nonpayable',
96
+ },
97
+ },
98
+ events: [],
99
+ };
100
+ //# sourceMappingURL=counterSignatures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counterSignatures.js","sourceRoot":"","sources":["../../../../src/lib/abi/counterSignatures.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;IAC/B,OAAO,EAAE,4CAA4C;IACrD,OAAO,EAAE;QACP,gBAAgB,EAAE;YAChB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,kBAAkB;YACxB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,EAAE;oBACR,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,SAAS;iBACxB;aACF;YACD,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,EAAE;oBACR,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,SAAS;iBACxB;aACF;YACD,eAAe,EAAE,MAAM;SACxB;QACD,UAAU,EAAE;YACV,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,SAAS;iBACxB;aACF;YACD,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,EAAE;oBACR,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,SAAS;iBACxB;aACF;YACD,eAAe,EAAE,MAAM;SACxB;QACD,oBAAoB,EAAE;YACpB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,sBAAsB;YAC5B,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,SAAS;iBACxB;aACF;YACD,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,EAAE;oBACR,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,SAAS;iBACxB;aACF;YACD,eAAe,EAAE,MAAM;SACxB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,WAAW;YACjB,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,EAAE;YACX,eAAe,EAAE,YAAY;SAC9B;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,mBAAmB;YACzB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,EAAE;oBACR,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,SAAS;iBACxB;aACF;YACD,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,EAAE;oBACR,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,SAAS;iBACxB;aACF;YACD,eAAe,EAAE,MAAM;SACxB;QACD,KAAK,EAAE;YACL,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,EAAE;YACX,eAAe,EAAE,YAAY;SAC9B;KACF;IACD,MAAM,EAAE,EAAE;CACF,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Helper functions for the send-counter-limit policy
3
+ * Integrates with the Counter smart contract to track send limits
4
+ */
5
+ /**
6
+ * Check how many sends a user has made and if they can send again
7
+ * @param userAddress - The user's address (PKP address)
8
+ * @param maxSends - Maximum number of sends allowed
9
+ * @param timeWindowSeconds - Time window in seconds before reset
10
+ * @returns Send limit status and timing information
11
+ */
12
+ export declare function checkSendLimit(userAddress: string, maxSends: number, timeWindowSeconds: number): Promise<{
13
+ allowed: boolean;
14
+ currentCount: number;
15
+ remainingSends: number;
16
+ shouldReset?: boolean;
17
+ secondsUntilReset?: number;
18
+ }>;
19
+ /**
20
+ * Reset the send counter for a user by calling reset on the
21
+ contract
22
+ * @param userAddress - The user's address (PKP address)
23
+ * @param pkpPublicKey - The PKP public key for signing
24
+ */
25
+ export declare function resetSendCounter(userAddress: string, pkpPublicKey: string): Promise<string>;
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/helpers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC,CA2ED;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA2BjG"}