tempo.ts 0.0.0 → 0.0.1

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 (153) hide show
  1. package/README.md +92 -0
  2. package/dist/chains.d.ts +1477 -0
  3. package/dist/chains.d.ts.map +1 -0
  4. package/dist/chains.js +43 -0
  5. package/dist/chains.js.map +1 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +2 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/internal/types.d.ts +284 -0
  11. package/dist/internal/types.d.ts.map +1 -0
  12. package/dist/internal/types.js +2 -0
  13. package/dist/internal/types.js.map +1 -0
  14. package/dist/ox/TokenId.d.ts +18 -0
  15. package/dist/ox/TokenId.d.ts.map +1 -0
  16. package/dist/ox/TokenId.js +29 -0
  17. package/dist/ox/TokenId.js.map +1 -0
  18. package/dist/ox/TokenRole.d.ts +11 -0
  19. package/dist/ox/TokenRole.d.ts.map +1 -0
  20. package/dist/ox/TokenRole.js +22 -0
  21. package/dist/ox/TokenRole.js.map +1 -0
  22. package/dist/ox/Transaction.d.ts +161 -0
  23. package/dist/ox/Transaction.d.ts.map +1 -0
  24. package/dist/ox/Transaction.js +117 -0
  25. package/dist/ox/Transaction.js.map +1 -0
  26. package/dist/ox/TransactionEnvelopeFeeToken.d.ts +393 -0
  27. package/dist/ox/TransactionEnvelopeFeeToken.d.ts.map +1 -0
  28. package/dist/ox/TransactionEnvelopeFeeToken.js +452 -0
  29. package/dist/ox/TransactionEnvelopeFeeToken.js.map +1 -0
  30. package/dist/ox/TransactionRequest.d.ts +62 -0
  31. package/dist/ox/TransactionRequest.d.ts.map +1 -0
  32. package/dist/ox/TransactionRequest.js +66 -0
  33. package/dist/ox/TransactionRequest.js.map +1 -0
  34. package/dist/ox/index.d.ts +5 -0
  35. package/dist/ox/index.d.ts.map +1 -0
  36. package/dist/ox/index.js +5 -0
  37. package/dist/ox/index.js.map +1 -0
  38. package/dist/prool/Instance.d.ts +92 -0
  39. package/dist/prool/Instance.d.ts.map +1 -0
  40. package/dist/prool/Instance.js +96 -0
  41. package/dist/prool/Instance.js.map +1 -0
  42. package/dist/prool/index.d.ts +2 -0
  43. package/dist/prool/index.d.ts.map +1 -0
  44. package/dist/prool/index.js +2 -0
  45. package/dist/prool/index.js.map +1 -0
  46. package/dist/viem/abis.d.ts +2058 -0
  47. package/dist/viem/abis.d.ts.map +1 -0
  48. package/dist/viem/abis.js +1599 -0
  49. package/dist/viem/abis.js.map +1 -0
  50. package/dist/viem/actions/amm.d.ts +2091 -0
  51. package/dist/viem/actions/amm.d.ts.map +1 -0
  52. package/dist/viem/actions/amm.js +876 -0
  53. package/dist/viem/actions/amm.js.map +1 -0
  54. package/dist/viem/actions/fee.d.ts +727 -0
  55. package/dist/viem/actions/fee.d.ts.map +1 -0
  56. package/dist/viem/actions/fee.js +230 -0
  57. package/dist/viem/actions/fee.js.map +1 -0
  58. package/dist/viem/actions/index.d.ts +5 -0
  59. package/dist/viem/actions/index.d.ts.map +1 -0
  60. package/dist/viem/actions/index.js +5 -0
  61. package/dist/viem/actions/index.js.map +1 -0
  62. package/dist/viem/actions/policy.d.ts +1900 -0
  63. package/dist/viem/actions/policy.d.ts.map +1 -0
  64. package/dist/viem/actions/policy.js +841 -0
  65. package/dist/viem/actions/policy.js.map +1 -0
  66. package/dist/viem/actions/token.d.ts +13759 -0
  67. package/dist/viem/actions/token.d.ts.map +1 -0
  68. package/dist/viem/actions/token.js +2579 -0
  69. package/dist/viem/actions/token.js.map +1 -0
  70. package/dist/viem/addresses.d.ts +8 -0
  71. package/dist/viem/addresses.d.ts.map +1 -0
  72. package/dist/viem/addresses.js +8 -0
  73. package/dist/viem/addresses.js.map +1 -0
  74. package/dist/viem/chain.d.ts +341 -0
  75. package/dist/viem/chain.d.ts.map +1 -0
  76. package/dist/viem/chain.js +22 -0
  77. package/dist/viem/chain.js.map +1 -0
  78. package/dist/viem/client.d.ts +27 -0
  79. package/dist/viem/client.d.ts.map +1 -0
  80. package/dist/viem/client.js +28 -0
  81. package/dist/viem/client.js.map +1 -0
  82. package/dist/viem/decorator.d.ts +1636 -0
  83. package/dist/viem/decorator.d.ts.map +1 -0
  84. package/dist/viem/decorator.js +95 -0
  85. package/dist/viem/decorator.js.map +1 -0
  86. package/dist/viem/formatters.d.ts +4 -0
  87. package/dist/viem/formatters.d.ts.map +1 -0
  88. package/dist/viem/formatters.js +69 -0
  89. package/dist/viem/formatters.js.map +1 -0
  90. package/dist/viem/index.d.ts +9 -0
  91. package/dist/viem/index.d.ts.map +1 -0
  92. package/dist/viem/index.js +9 -0
  93. package/dist/viem/index.js.map +1 -0
  94. package/dist/viem/transaction.d.ts +54 -0
  95. package/dist/viem/transaction.d.ts.map +1 -0
  96. package/dist/viem/transaction.js +108 -0
  97. package/dist/viem/transaction.js.map +1 -0
  98. package/dist/viem/transport.d.ts +16 -0
  99. package/dist/viem/transport.d.ts.map +1 -0
  100. package/dist/viem/transport.js +33 -0
  101. package/dist/viem/transport.js.map +1 -0
  102. package/dist/viem/types.d.ts +10 -0
  103. package/dist/viem/types.d.ts.map +1 -0
  104. package/dist/viem/types.js +2 -0
  105. package/dist/viem/types.js.map +1 -0
  106. package/dist/viem/utils.d.ts +8 -0
  107. package/dist/viem/utils.d.ts.map +1 -0
  108. package/dist/viem/utils.js +9 -0
  109. package/dist/viem/utils.js.map +1 -0
  110. package/package.json +100 -2
  111. package/src/chains.ts +46 -0
  112. package/src/index.ts +1 -0
  113. package/src/internal/types.ts +414 -0
  114. package/src/ox/TokenId.test.ts +29 -0
  115. package/src/ox/TokenId.ts +35 -0
  116. package/src/ox/TokenRole.test.ts +20 -0
  117. package/src/ox/TokenRole.ts +27 -0
  118. package/src/ox/Transaction.test.ts +257 -0
  119. package/src/ox/Transaction.ts +247 -0
  120. package/src/ox/TransactionEnvelopeFeeToken.test.ts +1215 -0
  121. package/src/ox/TransactionEnvelopeFeeToken.ts +717 -0
  122. package/src/ox/TransactionRequest.ts +100 -0
  123. package/src/ox/index.ts +4 -0
  124. package/src/prool/Instance.test.ts +43 -0
  125. package/src/prool/Instance.ts +190 -0
  126. package/src/prool/index.ts +1 -0
  127. package/src/prool/internal/chain.json +106 -0
  128. package/src/prool/internal/consensus.toml +32 -0
  129. package/src/viem/abis.ts +1606 -0
  130. package/src/viem/actions/amm.test.ts +425 -0
  131. package/src/viem/actions/amm.ts +1308 -0
  132. package/src/viem/actions/fee.test.ts +281 -0
  133. package/src/viem/actions/fee.ts +362 -0
  134. package/src/viem/actions/index.ts +4 -0
  135. package/src/viem/actions/policy.test.ts +514 -0
  136. package/src/viem/actions/policy.ts +1284 -0
  137. package/src/viem/actions/token.test.ts +2172 -0
  138. package/src/viem/actions/token.ts +3830 -0
  139. package/src/viem/addresses.ts +10 -0
  140. package/src/viem/chain.ts +27 -0
  141. package/src/viem/client.bench-d.ts +8 -0
  142. package/src/viem/client.test.ts +152 -0
  143. package/src/viem/client.ts +91 -0
  144. package/src/viem/decorator.bench-d.ts +11 -0
  145. package/src/viem/decorator.test.ts +35 -0
  146. package/src/viem/decorator.ts +1914 -0
  147. package/src/viem/e2e.test.ts +410 -0
  148. package/src/viem/formatters.ts +100 -0
  149. package/src/viem/index.ts +8 -0
  150. package/src/viem/transaction.ts +253 -0
  151. package/src/viem/transport.ts +47 -0
  152. package/src/viem/types.ts +55 -0
  153. package/src/viem/utils.ts +37 -0
@@ -0,0 +1,1900 @@
1
+ import { type Account, type Address, type Chain, type Client, type ExtractAbiItem, type GetEventArgs, type Log, type ReadContractReturnType, type TransactionReceipt, type Transport, type Log as viem_Log, type WatchContractEventParameters, type WriteContractReturnType } from 'viem';
2
+ import { writeContract, writeContractSync } from 'viem/actions';
3
+ import type { Compute, UnionOmit } from "../../internal/types.js";
4
+ import { tip403RegistryAbi } from "../abis.js";
5
+ import type { ReadParameters, WriteParameters } from "../types.js";
6
+ export type PolicyType = 'whitelist' | 'blacklist';
7
+ /**
8
+ * Creates a new policy.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { createClient, http } from 'viem'
13
+ * import { tempo } from 'tempo.ts/chains'
14
+ * import * as actions from 'tempo.ts/viem/actions'
15
+ * import { privateKeyToAccount } from 'viem/accounts'
16
+ *
17
+ * const client = createClient({
18
+ * account: privateKeyToAccount('0x...'),
19
+ * chain: tempo,
20
+ * transport: http(),
21
+ * })
22
+ *
23
+ * const { hash, policyId } = await actions.policy.create(client, {
24
+ * admin: '0x...',
25
+ * type: 'whitelist',
26
+ * })
27
+ * ```
28
+ *
29
+ * @param client - Client.
30
+ * @param parameters - Parameters.
31
+ * @returns The transaction hash and policy ID.
32
+ */
33
+ export declare function create<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: create.Parameters<chain, account>): Promise<create.ReturnValue>;
34
+ export declare namespace create {
35
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Omit<Args, 'admin'> & {
36
+ /** Address of the policy admin. */
37
+ admin?: Address | undefined;
38
+ };
39
+ type Args = {
40
+ /** Optional array of accounts to initialize the policy with. */
41
+ addresses?: readonly Address[] | undefined;
42
+ /** Address of the policy admin. */
43
+ admin: Address;
44
+ /** Type of policy to create. */
45
+ type: PolicyType;
46
+ };
47
+ type ReturnValue = WriteContractReturnType;
48
+ /** @internal */
49
+ function inner<action extends typeof writeContract | typeof writeContractSync, chain extends Chain | undefined, account extends Account | undefined>(action: action, client: Client<Transport, chain, account>, parameters: Parameters<chain, account>): Promise<ReturnType<action>>;
50
+ /**
51
+ * Defines a call to the `createPolicy` function.
52
+ *
53
+ * Can be passed as a parameter to:
54
+ * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
55
+ * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
56
+ * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * import { createClient, http, walletActions } from 'viem'
61
+ * import { tempo } from 'tempo.ts/chains'
62
+ * import * as actions from 'tempo.ts/viem/actions'
63
+ *
64
+ * const client = createClient({
65
+ * chain: tempo,
66
+ * transport: http(),
67
+ * }).extend(walletActions)
68
+ *
69
+ * const { result } = await client.sendCalls({
70
+ * calls: [
71
+ * actions.policy.create.call({
72
+ * admin: '0xfeed...fede',
73
+ * type: 'whitelist',
74
+ * }),
75
+ * actions.policy.create.call({
76
+ * admin: '0xfeed...fede',
77
+ * type: 'blacklist',
78
+ * addresses: ['0x20c0...beef', '0x20c0...babe'],
79
+ * }),
80
+ * ]
81
+ * })
82
+ * ```
83
+ *
84
+ * @param args - Arguments.
85
+ * @returns The call.
86
+ */
87
+ function call(args: Args): {
88
+ abi: [{
89
+ readonly type: "function";
90
+ readonly name: "createPolicy";
91
+ readonly inputs: readonly [{
92
+ readonly name: "admin";
93
+ readonly type: "address";
94
+ readonly internalType: "address";
95
+ }, {
96
+ readonly name: "policyType";
97
+ readonly type: "uint8";
98
+ readonly internalType: "enum TIP403Registry.PolicyType";
99
+ }, {
100
+ readonly name: "accounts";
101
+ readonly type: "address[]";
102
+ readonly internalType: "address[]";
103
+ }];
104
+ readonly outputs: readonly [{
105
+ readonly name: "newPolicyId";
106
+ readonly type: "uint64";
107
+ readonly internalType: "uint64";
108
+ }];
109
+ readonly stateMutability: "nonpayable";
110
+ } | {
111
+ readonly type: "function";
112
+ readonly name: "createPolicy";
113
+ readonly inputs: readonly [{
114
+ readonly name: "admin";
115
+ readonly type: "address";
116
+ readonly internalType: "address";
117
+ }, {
118
+ readonly name: "policyType";
119
+ readonly type: "uint8";
120
+ readonly internalType: "enum TIP403Registry.PolicyType";
121
+ }];
122
+ readonly outputs: readonly [{
123
+ readonly name: "newPolicyId";
124
+ readonly type: "uint64";
125
+ readonly internalType: "uint64";
126
+ }];
127
+ readonly stateMutability: "nonpayable";
128
+ }];
129
+ functionName: "createPolicy";
130
+ args?: readonly [`0x${string}`, number, readonly `0x${string}`[]] | readonly [`0x${string}`, number] | readonly [`0x${string}`, number, readonly `0x${string}`[]] | undefined;
131
+ } & {
132
+ args: import("viem").Widen<readonly [`0x${string}`, number, readonly `0x${string}`[]] | readonly [`0x${string}`, number]>;
133
+ } & {
134
+ address: Address;
135
+ } & {
136
+ data: import("viem").Hex;
137
+ to: Address;
138
+ };
139
+ /**
140
+ * Extracts the `PolicyCreated` event from logs.
141
+ *
142
+ * @param logs - The logs.
143
+ * @returns The `PolicyCreated` event.
144
+ */
145
+ function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
146
+ readonly type: "function";
147
+ readonly name: "createPolicy";
148
+ readonly inputs: readonly [{
149
+ readonly name: "admin";
150
+ readonly type: "address";
151
+ readonly internalType: "address";
152
+ }, {
153
+ readonly name: "policyType";
154
+ readonly type: "uint8";
155
+ readonly internalType: "enum TIP403Registry.PolicyType";
156
+ }, {
157
+ readonly name: "accounts";
158
+ readonly type: "address[]";
159
+ readonly internalType: "address[]";
160
+ }];
161
+ readonly outputs: readonly [{
162
+ readonly name: "newPolicyId";
163
+ readonly type: "uint64";
164
+ readonly internalType: "uint64";
165
+ }];
166
+ readonly stateMutability: "nonpayable";
167
+ }, {
168
+ readonly type: "function";
169
+ readonly name: "createPolicy";
170
+ readonly inputs: readonly [{
171
+ readonly name: "admin";
172
+ readonly type: "address";
173
+ readonly internalType: "address";
174
+ }, {
175
+ readonly name: "policyType";
176
+ readonly type: "uint8";
177
+ readonly internalType: "enum TIP403Registry.PolicyType";
178
+ }];
179
+ readonly outputs: readonly [{
180
+ readonly name: "newPolicyId";
181
+ readonly type: "uint64";
182
+ readonly internalType: "uint64";
183
+ }];
184
+ readonly stateMutability: "nonpayable";
185
+ }, {
186
+ readonly type: "function";
187
+ readonly name: "isAuthorized";
188
+ readonly inputs: readonly [{
189
+ readonly name: "policyId";
190
+ readonly type: "uint64";
191
+ readonly internalType: "uint64";
192
+ }, {
193
+ readonly name: "user";
194
+ readonly type: "address";
195
+ readonly internalType: "address";
196
+ }];
197
+ readonly outputs: readonly [{
198
+ readonly name: "";
199
+ readonly type: "bool";
200
+ readonly internalType: "bool";
201
+ }];
202
+ readonly stateMutability: "view";
203
+ }, {
204
+ readonly type: "function";
205
+ readonly name: "modifyPolicyBlacklist";
206
+ readonly inputs: readonly [{
207
+ readonly name: "policyId";
208
+ readonly type: "uint64";
209
+ readonly internalType: "uint64";
210
+ }, {
211
+ readonly name: "account";
212
+ readonly type: "address";
213
+ readonly internalType: "address";
214
+ }, {
215
+ readonly name: "restricted";
216
+ readonly type: "bool";
217
+ readonly internalType: "bool";
218
+ }];
219
+ readonly outputs: readonly [];
220
+ readonly stateMutability: "nonpayable";
221
+ }, {
222
+ readonly type: "function";
223
+ readonly name: "modifyPolicyWhitelist";
224
+ readonly inputs: readonly [{
225
+ readonly name: "policyId";
226
+ readonly type: "uint64";
227
+ readonly internalType: "uint64";
228
+ }, {
229
+ readonly name: "account";
230
+ readonly type: "address";
231
+ readonly internalType: "address";
232
+ }, {
233
+ readonly name: "allowed";
234
+ readonly type: "bool";
235
+ readonly internalType: "bool";
236
+ }];
237
+ readonly outputs: readonly [];
238
+ readonly stateMutability: "nonpayable";
239
+ }, {
240
+ readonly type: "function";
241
+ readonly name: "policyData";
242
+ readonly inputs: readonly [{
243
+ readonly name: "";
244
+ readonly type: "uint64";
245
+ readonly internalType: "uint64";
246
+ }];
247
+ readonly outputs: readonly [{
248
+ readonly name: "policyType";
249
+ readonly type: "uint8";
250
+ readonly internalType: "enum TIP403Registry.PolicyType";
251
+ }, {
252
+ readonly name: "admin";
253
+ readonly type: "address";
254
+ readonly internalType: "address";
255
+ }];
256
+ readonly stateMutability: "view";
257
+ }, {
258
+ readonly type: "function";
259
+ readonly name: "policyIdCounter";
260
+ readonly inputs: readonly [];
261
+ readonly outputs: readonly [{
262
+ readonly name: "";
263
+ readonly type: "uint64";
264
+ readonly internalType: "uint64";
265
+ }];
266
+ readonly stateMutability: "view";
267
+ }, {
268
+ readonly type: "function";
269
+ readonly name: "setPolicyAdmin";
270
+ readonly inputs: readonly [{
271
+ readonly name: "policyId";
272
+ readonly type: "uint64";
273
+ readonly internalType: "uint64";
274
+ }, {
275
+ readonly name: "admin";
276
+ readonly type: "address";
277
+ readonly internalType: "address";
278
+ }];
279
+ readonly outputs: readonly [];
280
+ readonly stateMutability: "nonpayable";
281
+ }, {
282
+ readonly type: "event";
283
+ readonly name: "BlacklistUpdated";
284
+ readonly inputs: readonly [{
285
+ readonly name: "policyId";
286
+ readonly type: "uint64";
287
+ readonly indexed: true;
288
+ readonly internalType: "uint64";
289
+ }, {
290
+ readonly name: "updater";
291
+ readonly type: "address";
292
+ readonly indexed: true;
293
+ readonly internalType: "address";
294
+ }, {
295
+ readonly name: "account";
296
+ readonly type: "address";
297
+ readonly indexed: true;
298
+ readonly internalType: "address";
299
+ }, {
300
+ readonly name: "restricted";
301
+ readonly type: "bool";
302
+ readonly indexed: false;
303
+ readonly internalType: "bool";
304
+ }];
305
+ readonly anonymous: false;
306
+ }, {
307
+ readonly type: "event";
308
+ readonly name: "PolicyAdminUpdated";
309
+ readonly inputs: readonly [{
310
+ readonly name: "policyId";
311
+ readonly type: "uint64";
312
+ readonly indexed: true;
313
+ readonly internalType: "uint64";
314
+ }, {
315
+ readonly name: "updater";
316
+ readonly type: "address";
317
+ readonly indexed: true;
318
+ readonly internalType: "address";
319
+ }, {
320
+ readonly name: "admin";
321
+ readonly type: "address";
322
+ readonly indexed: true;
323
+ readonly internalType: "address";
324
+ }];
325
+ readonly anonymous: false;
326
+ }, {
327
+ readonly type: "event";
328
+ readonly name: "PolicyCreated";
329
+ readonly inputs: readonly [{
330
+ readonly name: "policyId";
331
+ readonly type: "uint64";
332
+ readonly indexed: true;
333
+ readonly internalType: "uint64";
334
+ }, {
335
+ readonly name: "updater";
336
+ readonly type: "address";
337
+ readonly indexed: true;
338
+ readonly internalType: "address";
339
+ }, {
340
+ readonly name: "policyType";
341
+ readonly type: "uint8";
342
+ readonly indexed: false;
343
+ readonly internalType: "enum TIP403Registry.PolicyType";
344
+ }];
345
+ readonly anonymous: false;
346
+ }, {
347
+ readonly type: "event";
348
+ readonly name: "WhitelistUpdated";
349
+ readonly inputs: readonly [{
350
+ readonly name: "policyId";
351
+ readonly type: "uint64";
352
+ readonly indexed: true;
353
+ readonly internalType: "uint64";
354
+ }, {
355
+ readonly name: "updater";
356
+ readonly type: "address";
357
+ readonly indexed: true;
358
+ readonly internalType: "address";
359
+ }, {
360
+ readonly name: "account";
361
+ readonly type: "address";
362
+ readonly indexed: true;
363
+ readonly internalType: "address";
364
+ }, {
365
+ readonly name: "allowed";
366
+ readonly type: "bool";
367
+ readonly indexed: false;
368
+ readonly internalType: "bool";
369
+ }];
370
+ readonly anonymous: false;
371
+ }, {
372
+ readonly type: "error";
373
+ readonly name: "ArrayLengthMismatch";
374
+ readonly inputs: readonly [];
375
+ }, {
376
+ readonly type: "error";
377
+ readonly name: "IncompatiblePolicyType";
378
+ readonly inputs: readonly [];
379
+ }, {
380
+ readonly type: "error";
381
+ readonly name: "PolicyDoesNotExist";
382
+ readonly inputs: readonly [];
383
+ }, {
384
+ readonly type: "error";
385
+ readonly name: "Unauthorized";
386
+ readonly inputs: readonly [];
387
+ }], "PolicyCreated">;
388
+ }
389
+ /**
390
+ * Creates a new policy.
391
+ *
392
+ * @example
393
+ * ```ts
394
+ * import { createClient, http } from 'viem'
395
+ * import { tempo } from 'tempo.ts/chains'
396
+ * import * as actions from 'tempo.ts/viem/actions'
397
+ * import { privateKeyToAccount } from 'viem/accounts'
398
+ *
399
+ * const client = createClient({
400
+ * account: privateKeyToAccount('0x...'),
401
+ * chain: tempo,
402
+ * transport: http(),
403
+ * })
404
+ *
405
+ * const result = await actions.policy.createSync(client, {
406
+ * admin: '0x...',
407
+ * type: 'whitelist',
408
+ * })
409
+ * ```
410
+ *
411
+ * @param client - Client.
412
+ * @param parameters - Parameters.
413
+ * @returns The transaction receipt and event data.
414
+ */
415
+ export declare function createSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: createSync.Parameters<chain, account>): Promise<createSync.ReturnValue>;
416
+ export declare namespace createSync {
417
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = create.Parameters<chain, account>;
418
+ type Args = create.Args;
419
+ type ReturnValue = Compute<GetEventArgs<typeof tip403RegistryAbi, 'PolicyCreated', {
420
+ IndexedOnly: false;
421
+ Required: true;
422
+ }> & {
423
+ receipt: TransactionReceipt;
424
+ }>;
425
+ }
426
+ /**
427
+ * Sets the admin for a policy.
428
+ *
429
+ * @example
430
+ * ```ts
431
+ * import { createClient, http } from 'viem'
432
+ * import { tempo } from 'tempo.ts/chains'
433
+ * import * as actions from 'tempo.ts/viem/actions'
434
+ * import { privateKeyToAccount } from 'viem/accounts'
435
+ *
436
+ * const client = createClient({
437
+ * account: privateKeyToAccount('0x...'),
438
+ * chain: tempo,
439
+ * transport: http(),
440
+ * })
441
+ *
442
+ * const hash = await actions.policy.setAdmin(client, {
443
+ * policyId: 2n,
444
+ * admin: '0x...',
445
+ * })
446
+ * ```
447
+ *
448
+ * @param client - Client.
449
+ * @param parameters - Parameters.
450
+ * @returns The transaction hash.
451
+ */
452
+ export declare function setAdmin<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: setAdmin.Parameters<chain, account>): Promise<setAdmin.ReturnValue>;
453
+ export declare namespace setAdmin {
454
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
455
+ type Args = {
456
+ /** New admin address. */
457
+ admin: Address;
458
+ /** Policy ID. */
459
+ policyId: bigint;
460
+ };
461
+ type ReturnValue = WriteContractReturnType;
462
+ /** @internal */
463
+ function inner<action extends typeof writeContract | typeof writeContractSync, chain extends Chain | undefined, account extends Account | undefined>(action: action, client: Client<Transport, chain, account>, parameters: setAdmin.Parameters<chain, account>): Promise<ReturnType<action>>;
464
+ /**
465
+ * Defines a call to the `setPolicyAdmin` function.
466
+ *
467
+ * Can be passed as a parameter to:
468
+ * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
469
+ * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
470
+ * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
471
+ *
472
+ * @example
473
+ * ```ts
474
+ * import { createClient, http, walletActions } from 'viem'
475
+ * import { tempo } from 'tempo.ts/chains'
476
+ * import * as actions from 'tempo.ts/viem/actions'
477
+ *
478
+ * const client = createClient({
479
+ * chain: tempo,
480
+ * transport: http(),
481
+ * }).extend(walletActions)
482
+ *
483
+ * const { result } = await client.sendCalls({
484
+ * calls: [
485
+ * actions.policy.setAdmin.call({
486
+ * policyId: 2n,
487
+ * admin: '0xfeed...fede',
488
+ * }),
489
+ * actions.policy.setAdmin.call({
490
+ * policyId: 3n,
491
+ * admin: '0xfeed...babe',
492
+ * }),
493
+ * ]
494
+ * })
495
+ * ```
496
+ *
497
+ * @param args - Arguments.
498
+ * @returns The call.
499
+ */
500
+ function call(args: Args): {
501
+ abi: [{
502
+ readonly type: "function";
503
+ readonly name: "setPolicyAdmin";
504
+ readonly inputs: readonly [{
505
+ readonly name: "policyId";
506
+ readonly type: "uint64";
507
+ readonly internalType: "uint64";
508
+ }, {
509
+ readonly name: "admin";
510
+ readonly type: "address";
511
+ readonly internalType: "address";
512
+ }];
513
+ readonly outputs: readonly [];
514
+ readonly stateMutability: "nonpayable";
515
+ }];
516
+ functionName: "setPolicyAdmin";
517
+ args?: readonly [bigint, `0x${string}`] | undefined;
518
+ } & {
519
+ args: readonly [bigint, `0x${string}`];
520
+ } & {
521
+ address: Address;
522
+ } & {
523
+ data: import("viem").Hex;
524
+ to: Address;
525
+ };
526
+ /**
527
+ * Extracts the `PolicyAdminUpdated` event from logs.
528
+ *
529
+ * @param logs - The logs.
530
+ * @returns The `PolicyAdminUpdated` event.
531
+ */
532
+ function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
533
+ readonly type: "function";
534
+ readonly name: "createPolicy";
535
+ readonly inputs: readonly [{
536
+ readonly name: "admin";
537
+ readonly type: "address";
538
+ readonly internalType: "address";
539
+ }, {
540
+ readonly name: "policyType";
541
+ readonly type: "uint8";
542
+ readonly internalType: "enum TIP403Registry.PolicyType";
543
+ }, {
544
+ readonly name: "accounts";
545
+ readonly type: "address[]";
546
+ readonly internalType: "address[]";
547
+ }];
548
+ readonly outputs: readonly [{
549
+ readonly name: "newPolicyId";
550
+ readonly type: "uint64";
551
+ readonly internalType: "uint64";
552
+ }];
553
+ readonly stateMutability: "nonpayable";
554
+ }, {
555
+ readonly type: "function";
556
+ readonly name: "createPolicy";
557
+ readonly inputs: readonly [{
558
+ readonly name: "admin";
559
+ readonly type: "address";
560
+ readonly internalType: "address";
561
+ }, {
562
+ readonly name: "policyType";
563
+ readonly type: "uint8";
564
+ readonly internalType: "enum TIP403Registry.PolicyType";
565
+ }];
566
+ readonly outputs: readonly [{
567
+ readonly name: "newPolicyId";
568
+ readonly type: "uint64";
569
+ readonly internalType: "uint64";
570
+ }];
571
+ readonly stateMutability: "nonpayable";
572
+ }, {
573
+ readonly type: "function";
574
+ readonly name: "isAuthorized";
575
+ readonly inputs: readonly [{
576
+ readonly name: "policyId";
577
+ readonly type: "uint64";
578
+ readonly internalType: "uint64";
579
+ }, {
580
+ readonly name: "user";
581
+ readonly type: "address";
582
+ readonly internalType: "address";
583
+ }];
584
+ readonly outputs: readonly [{
585
+ readonly name: "";
586
+ readonly type: "bool";
587
+ readonly internalType: "bool";
588
+ }];
589
+ readonly stateMutability: "view";
590
+ }, {
591
+ readonly type: "function";
592
+ readonly name: "modifyPolicyBlacklist";
593
+ readonly inputs: readonly [{
594
+ readonly name: "policyId";
595
+ readonly type: "uint64";
596
+ readonly internalType: "uint64";
597
+ }, {
598
+ readonly name: "account";
599
+ readonly type: "address";
600
+ readonly internalType: "address";
601
+ }, {
602
+ readonly name: "restricted";
603
+ readonly type: "bool";
604
+ readonly internalType: "bool";
605
+ }];
606
+ readonly outputs: readonly [];
607
+ readonly stateMutability: "nonpayable";
608
+ }, {
609
+ readonly type: "function";
610
+ readonly name: "modifyPolicyWhitelist";
611
+ readonly inputs: readonly [{
612
+ readonly name: "policyId";
613
+ readonly type: "uint64";
614
+ readonly internalType: "uint64";
615
+ }, {
616
+ readonly name: "account";
617
+ readonly type: "address";
618
+ readonly internalType: "address";
619
+ }, {
620
+ readonly name: "allowed";
621
+ readonly type: "bool";
622
+ readonly internalType: "bool";
623
+ }];
624
+ readonly outputs: readonly [];
625
+ readonly stateMutability: "nonpayable";
626
+ }, {
627
+ readonly type: "function";
628
+ readonly name: "policyData";
629
+ readonly inputs: readonly [{
630
+ readonly name: "";
631
+ readonly type: "uint64";
632
+ readonly internalType: "uint64";
633
+ }];
634
+ readonly outputs: readonly [{
635
+ readonly name: "policyType";
636
+ readonly type: "uint8";
637
+ readonly internalType: "enum TIP403Registry.PolicyType";
638
+ }, {
639
+ readonly name: "admin";
640
+ readonly type: "address";
641
+ readonly internalType: "address";
642
+ }];
643
+ readonly stateMutability: "view";
644
+ }, {
645
+ readonly type: "function";
646
+ readonly name: "policyIdCounter";
647
+ readonly inputs: readonly [];
648
+ readonly outputs: readonly [{
649
+ readonly name: "";
650
+ readonly type: "uint64";
651
+ readonly internalType: "uint64";
652
+ }];
653
+ readonly stateMutability: "view";
654
+ }, {
655
+ readonly type: "function";
656
+ readonly name: "setPolicyAdmin";
657
+ readonly inputs: readonly [{
658
+ readonly name: "policyId";
659
+ readonly type: "uint64";
660
+ readonly internalType: "uint64";
661
+ }, {
662
+ readonly name: "admin";
663
+ readonly type: "address";
664
+ readonly internalType: "address";
665
+ }];
666
+ readonly outputs: readonly [];
667
+ readonly stateMutability: "nonpayable";
668
+ }, {
669
+ readonly type: "event";
670
+ readonly name: "BlacklistUpdated";
671
+ readonly inputs: readonly [{
672
+ readonly name: "policyId";
673
+ readonly type: "uint64";
674
+ readonly indexed: true;
675
+ readonly internalType: "uint64";
676
+ }, {
677
+ readonly name: "updater";
678
+ readonly type: "address";
679
+ readonly indexed: true;
680
+ readonly internalType: "address";
681
+ }, {
682
+ readonly name: "account";
683
+ readonly type: "address";
684
+ readonly indexed: true;
685
+ readonly internalType: "address";
686
+ }, {
687
+ readonly name: "restricted";
688
+ readonly type: "bool";
689
+ readonly indexed: false;
690
+ readonly internalType: "bool";
691
+ }];
692
+ readonly anonymous: false;
693
+ }, {
694
+ readonly type: "event";
695
+ readonly name: "PolicyAdminUpdated";
696
+ readonly inputs: readonly [{
697
+ readonly name: "policyId";
698
+ readonly type: "uint64";
699
+ readonly indexed: true;
700
+ readonly internalType: "uint64";
701
+ }, {
702
+ readonly name: "updater";
703
+ readonly type: "address";
704
+ readonly indexed: true;
705
+ readonly internalType: "address";
706
+ }, {
707
+ readonly name: "admin";
708
+ readonly type: "address";
709
+ readonly indexed: true;
710
+ readonly internalType: "address";
711
+ }];
712
+ readonly anonymous: false;
713
+ }, {
714
+ readonly type: "event";
715
+ readonly name: "PolicyCreated";
716
+ readonly inputs: readonly [{
717
+ readonly name: "policyId";
718
+ readonly type: "uint64";
719
+ readonly indexed: true;
720
+ readonly internalType: "uint64";
721
+ }, {
722
+ readonly name: "updater";
723
+ readonly type: "address";
724
+ readonly indexed: true;
725
+ readonly internalType: "address";
726
+ }, {
727
+ readonly name: "policyType";
728
+ readonly type: "uint8";
729
+ readonly indexed: false;
730
+ readonly internalType: "enum TIP403Registry.PolicyType";
731
+ }];
732
+ readonly anonymous: false;
733
+ }, {
734
+ readonly type: "event";
735
+ readonly name: "WhitelistUpdated";
736
+ readonly inputs: readonly [{
737
+ readonly name: "policyId";
738
+ readonly type: "uint64";
739
+ readonly indexed: true;
740
+ readonly internalType: "uint64";
741
+ }, {
742
+ readonly name: "updater";
743
+ readonly type: "address";
744
+ readonly indexed: true;
745
+ readonly internalType: "address";
746
+ }, {
747
+ readonly name: "account";
748
+ readonly type: "address";
749
+ readonly indexed: true;
750
+ readonly internalType: "address";
751
+ }, {
752
+ readonly name: "allowed";
753
+ readonly type: "bool";
754
+ readonly indexed: false;
755
+ readonly internalType: "bool";
756
+ }];
757
+ readonly anonymous: false;
758
+ }, {
759
+ readonly type: "error";
760
+ readonly name: "ArrayLengthMismatch";
761
+ readonly inputs: readonly [];
762
+ }, {
763
+ readonly type: "error";
764
+ readonly name: "IncompatiblePolicyType";
765
+ readonly inputs: readonly [];
766
+ }, {
767
+ readonly type: "error";
768
+ readonly name: "PolicyDoesNotExist";
769
+ readonly inputs: readonly [];
770
+ }, {
771
+ readonly type: "error";
772
+ readonly name: "Unauthorized";
773
+ readonly inputs: readonly [];
774
+ }], "PolicyAdminUpdated">;
775
+ }
776
+ /**
777
+ * Sets the admin for a policy.
778
+ *
779
+ * @example
780
+ * ```ts
781
+ * import { createClient, http } from 'viem'
782
+ * import { tempo } from 'tempo.ts/chains'
783
+ * import * as actions from 'tempo.ts/viem/actions'
784
+ * import { privateKeyToAccount } from 'viem/accounts'
785
+ *
786
+ * const client = createClient({
787
+ * account: privateKeyToAccount('0x...'),
788
+ * chain: tempo,
789
+ * transport: http(),
790
+ * })
791
+ *
792
+ * const result = await actions.policy.setAdminSync(client, {
793
+ * policyId: 2n,
794
+ * admin: '0x...',
795
+ * })
796
+ * ```
797
+ *
798
+ * @param client - Client.
799
+ * @param parameters - Parameters.
800
+ * @returns The transaction receipt and event data.
801
+ */
802
+ export declare function setAdminSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: setAdminSync.Parameters<chain, account>): Promise<setAdminSync.ReturnValue>;
803
+ export declare namespace setAdminSync {
804
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = setAdmin.Parameters<chain, account>;
805
+ type Args = setAdmin.Args;
806
+ type ReturnValue = Compute<GetEventArgs<typeof tip403RegistryAbi, 'PolicyAdminUpdated', {
807
+ IndexedOnly: false;
808
+ Required: true;
809
+ }> & {
810
+ receipt: TransactionReceipt;
811
+ }>;
812
+ }
813
+ /**
814
+ * Modifies a policy whitelist.
815
+ *
816
+ * @example
817
+ * ```ts
818
+ * import { createClient, http } from 'viem'
819
+ * import { tempo } from 'tempo.ts/chains'
820
+ * import * as actions from 'tempo.ts/viem/actions'
821
+ * import { privateKeyToAccount } from 'viem/accounts'
822
+ *
823
+ * const client = createClient({
824
+ * account: privateKeyToAccount('0x...'),
825
+ * chain: tempo,
826
+ * transport: http(),
827
+ * })
828
+ *
829
+ * const hash = await actions.policy.modifyWhitelist(client, {
830
+ * policyId: 2n,
831
+ * account: '0x...',
832
+ * allowed: true,
833
+ * })
834
+ * ```
835
+ *
836
+ * @param client - Client.
837
+ * @param parameters - Parameters.
838
+ * @returns The transaction hash.
839
+ */
840
+ export declare function modifyWhitelist<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: modifyWhitelist.Parameters<chain, account>): Promise<modifyWhitelist.ReturnValue>;
841
+ export declare namespace modifyWhitelist {
842
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
843
+ type Args = {
844
+ /** Target account address. */
845
+ address: Address;
846
+ /** Whether the account is allowed. */
847
+ allowed: boolean;
848
+ /** Policy ID. */
849
+ policyId: bigint;
850
+ };
851
+ type ReturnValue = WriteContractReturnType;
852
+ /** @internal */
853
+ function inner<action extends typeof writeContract | typeof writeContractSync, chain extends Chain | undefined, account extends Account | undefined>(action: action, client: Client<Transport, chain, account>, parameters: modifyWhitelist.Parameters<chain, account>): Promise<ReturnType<action>>;
854
+ /**
855
+ * Defines a call to the `modifyPolicyWhitelist` function.
856
+ *
857
+ * Can be passed as a parameter to:
858
+ * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
859
+ * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
860
+ * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
861
+ *
862
+ * @example
863
+ * ```ts
864
+ * import { createClient, http, walletActions } from 'viem'
865
+ * import { tempo } from 'tempo.ts/chains'
866
+ * import * as actions from 'tempo.ts/viem/actions'
867
+ *
868
+ * const client = createClient({
869
+ * chain: tempo,
870
+ * transport: http(),
871
+ * }).extend(walletActions)
872
+ *
873
+ * const { result } = await client.sendCalls({
874
+ * calls: [
875
+ * actions.policy.modifyWhitelist.call({
876
+ * policyId: 2n,
877
+ * address: '0x20c0...beef',
878
+ * allowed: true,
879
+ * }),
880
+ * actions.policy.modifyWhitelist.call({
881
+ * policyId: 2n,
882
+ * address: '0x20c0...babe',
883
+ * allowed: false,
884
+ * }),
885
+ * ]
886
+ * })
887
+ * ```
888
+ *
889
+ * @param args - Arguments.
890
+ * @returns The call.
891
+ */
892
+ function call(args: Args): {
893
+ abi: [{
894
+ readonly type: "function";
895
+ readonly name: "modifyPolicyWhitelist";
896
+ readonly inputs: readonly [{
897
+ readonly name: "policyId";
898
+ readonly type: "uint64";
899
+ readonly internalType: "uint64";
900
+ }, {
901
+ readonly name: "account";
902
+ readonly type: "address";
903
+ readonly internalType: "address";
904
+ }, {
905
+ readonly name: "allowed";
906
+ readonly type: "bool";
907
+ readonly internalType: "bool";
908
+ }];
909
+ readonly outputs: readonly [];
910
+ readonly stateMutability: "nonpayable";
911
+ }];
912
+ functionName: "modifyPolicyWhitelist";
913
+ args?: readonly [bigint, `0x${string}`, boolean] | readonly [bigint, `0x${string}`, import("viem").Widen<boolean>] | undefined;
914
+ } & {
915
+ args: readonly [bigint, `0x${string}`, import("viem").Widen<boolean>];
916
+ } & {
917
+ address: Address;
918
+ } & {
919
+ data: import("viem").Hex;
920
+ to: Address;
921
+ };
922
+ /**
923
+ * Extracts the `WhitelistUpdated` event from logs.
924
+ *
925
+ * @param logs - The logs.
926
+ * @returns The `WhitelistUpdated` event.
927
+ */
928
+ function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
929
+ readonly type: "function";
930
+ readonly name: "createPolicy";
931
+ readonly inputs: readonly [{
932
+ readonly name: "admin";
933
+ readonly type: "address";
934
+ readonly internalType: "address";
935
+ }, {
936
+ readonly name: "policyType";
937
+ readonly type: "uint8";
938
+ readonly internalType: "enum TIP403Registry.PolicyType";
939
+ }, {
940
+ readonly name: "accounts";
941
+ readonly type: "address[]";
942
+ readonly internalType: "address[]";
943
+ }];
944
+ readonly outputs: readonly [{
945
+ readonly name: "newPolicyId";
946
+ readonly type: "uint64";
947
+ readonly internalType: "uint64";
948
+ }];
949
+ readonly stateMutability: "nonpayable";
950
+ }, {
951
+ readonly type: "function";
952
+ readonly name: "createPolicy";
953
+ readonly inputs: readonly [{
954
+ readonly name: "admin";
955
+ readonly type: "address";
956
+ readonly internalType: "address";
957
+ }, {
958
+ readonly name: "policyType";
959
+ readonly type: "uint8";
960
+ readonly internalType: "enum TIP403Registry.PolicyType";
961
+ }];
962
+ readonly outputs: readonly [{
963
+ readonly name: "newPolicyId";
964
+ readonly type: "uint64";
965
+ readonly internalType: "uint64";
966
+ }];
967
+ readonly stateMutability: "nonpayable";
968
+ }, {
969
+ readonly type: "function";
970
+ readonly name: "isAuthorized";
971
+ readonly inputs: readonly [{
972
+ readonly name: "policyId";
973
+ readonly type: "uint64";
974
+ readonly internalType: "uint64";
975
+ }, {
976
+ readonly name: "user";
977
+ readonly type: "address";
978
+ readonly internalType: "address";
979
+ }];
980
+ readonly outputs: readonly [{
981
+ readonly name: "";
982
+ readonly type: "bool";
983
+ readonly internalType: "bool";
984
+ }];
985
+ readonly stateMutability: "view";
986
+ }, {
987
+ readonly type: "function";
988
+ readonly name: "modifyPolicyBlacklist";
989
+ readonly inputs: readonly [{
990
+ readonly name: "policyId";
991
+ readonly type: "uint64";
992
+ readonly internalType: "uint64";
993
+ }, {
994
+ readonly name: "account";
995
+ readonly type: "address";
996
+ readonly internalType: "address";
997
+ }, {
998
+ readonly name: "restricted";
999
+ readonly type: "bool";
1000
+ readonly internalType: "bool";
1001
+ }];
1002
+ readonly outputs: readonly [];
1003
+ readonly stateMutability: "nonpayable";
1004
+ }, {
1005
+ readonly type: "function";
1006
+ readonly name: "modifyPolicyWhitelist";
1007
+ readonly inputs: readonly [{
1008
+ readonly name: "policyId";
1009
+ readonly type: "uint64";
1010
+ readonly internalType: "uint64";
1011
+ }, {
1012
+ readonly name: "account";
1013
+ readonly type: "address";
1014
+ readonly internalType: "address";
1015
+ }, {
1016
+ readonly name: "allowed";
1017
+ readonly type: "bool";
1018
+ readonly internalType: "bool";
1019
+ }];
1020
+ readonly outputs: readonly [];
1021
+ readonly stateMutability: "nonpayable";
1022
+ }, {
1023
+ readonly type: "function";
1024
+ readonly name: "policyData";
1025
+ readonly inputs: readonly [{
1026
+ readonly name: "";
1027
+ readonly type: "uint64";
1028
+ readonly internalType: "uint64";
1029
+ }];
1030
+ readonly outputs: readonly [{
1031
+ readonly name: "policyType";
1032
+ readonly type: "uint8";
1033
+ readonly internalType: "enum TIP403Registry.PolicyType";
1034
+ }, {
1035
+ readonly name: "admin";
1036
+ readonly type: "address";
1037
+ readonly internalType: "address";
1038
+ }];
1039
+ readonly stateMutability: "view";
1040
+ }, {
1041
+ readonly type: "function";
1042
+ readonly name: "policyIdCounter";
1043
+ readonly inputs: readonly [];
1044
+ readonly outputs: readonly [{
1045
+ readonly name: "";
1046
+ readonly type: "uint64";
1047
+ readonly internalType: "uint64";
1048
+ }];
1049
+ readonly stateMutability: "view";
1050
+ }, {
1051
+ readonly type: "function";
1052
+ readonly name: "setPolicyAdmin";
1053
+ readonly inputs: readonly [{
1054
+ readonly name: "policyId";
1055
+ readonly type: "uint64";
1056
+ readonly internalType: "uint64";
1057
+ }, {
1058
+ readonly name: "admin";
1059
+ readonly type: "address";
1060
+ readonly internalType: "address";
1061
+ }];
1062
+ readonly outputs: readonly [];
1063
+ readonly stateMutability: "nonpayable";
1064
+ }, {
1065
+ readonly type: "event";
1066
+ readonly name: "BlacklistUpdated";
1067
+ readonly inputs: readonly [{
1068
+ readonly name: "policyId";
1069
+ readonly type: "uint64";
1070
+ readonly indexed: true;
1071
+ readonly internalType: "uint64";
1072
+ }, {
1073
+ readonly name: "updater";
1074
+ readonly type: "address";
1075
+ readonly indexed: true;
1076
+ readonly internalType: "address";
1077
+ }, {
1078
+ readonly name: "account";
1079
+ readonly type: "address";
1080
+ readonly indexed: true;
1081
+ readonly internalType: "address";
1082
+ }, {
1083
+ readonly name: "restricted";
1084
+ readonly type: "bool";
1085
+ readonly indexed: false;
1086
+ readonly internalType: "bool";
1087
+ }];
1088
+ readonly anonymous: false;
1089
+ }, {
1090
+ readonly type: "event";
1091
+ readonly name: "PolicyAdminUpdated";
1092
+ readonly inputs: readonly [{
1093
+ readonly name: "policyId";
1094
+ readonly type: "uint64";
1095
+ readonly indexed: true;
1096
+ readonly internalType: "uint64";
1097
+ }, {
1098
+ readonly name: "updater";
1099
+ readonly type: "address";
1100
+ readonly indexed: true;
1101
+ readonly internalType: "address";
1102
+ }, {
1103
+ readonly name: "admin";
1104
+ readonly type: "address";
1105
+ readonly indexed: true;
1106
+ readonly internalType: "address";
1107
+ }];
1108
+ readonly anonymous: false;
1109
+ }, {
1110
+ readonly type: "event";
1111
+ readonly name: "PolicyCreated";
1112
+ readonly inputs: readonly [{
1113
+ readonly name: "policyId";
1114
+ readonly type: "uint64";
1115
+ readonly indexed: true;
1116
+ readonly internalType: "uint64";
1117
+ }, {
1118
+ readonly name: "updater";
1119
+ readonly type: "address";
1120
+ readonly indexed: true;
1121
+ readonly internalType: "address";
1122
+ }, {
1123
+ readonly name: "policyType";
1124
+ readonly type: "uint8";
1125
+ readonly indexed: false;
1126
+ readonly internalType: "enum TIP403Registry.PolicyType";
1127
+ }];
1128
+ readonly anonymous: false;
1129
+ }, {
1130
+ readonly type: "event";
1131
+ readonly name: "WhitelistUpdated";
1132
+ readonly inputs: readonly [{
1133
+ readonly name: "policyId";
1134
+ readonly type: "uint64";
1135
+ readonly indexed: true;
1136
+ readonly internalType: "uint64";
1137
+ }, {
1138
+ readonly name: "updater";
1139
+ readonly type: "address";
1140
+ readonly indexed: true;
1141
+ readonly internalType: "address";
1142
+ }, {
1143
+ readonly name: "account";
1144
+ readonly type: "address";
1145
+ readonly indexed: true;
1146
+ readonly internalType: "address";
1147
+ }, {
1148
+ readonly name: "allowed";
1149
+ readonly type: "bool";
1150
+ readonly indexed: false;
1151
+ readonly internalType: "bool";
1152
+ }];
1153
+ readonly anonymous: false;
1154
+ }, {
1155
+ readonly type: "error";
1156
+ readonly name: "ArrayLengthMismatch";
1157
+ readonly inputs: readonly [];
1158
+ }, {
1159
+ readonly type: "error";
1160
+ readonly name: "IncompatiblePolicyType";
1161
+ readonly inputs: readonly [];
1162
+ }, {
1163
+ readonly type: "error";
1164
+ readonly name: "PolicyDoesNotExist";
1165
+ readonly inputs: readonly [];
1166
+ }, {
1167
+ readonly type: "error";
1168
+ readonly name: "Unauthorized";
1169
+ readonly inputs: readonly [];
1170
+ }], "WhitelistUpdated">;
1171
+ }
1172
+ /**
1173
+ * Modifies a policy whitelist.
1174
+ *
1175
+ * @example
1176
+ * ```ts
1177
+ * import { createClient, http } from 'viem'
1178
+ * import { tempo } from 'tempo.ts/chains'
1179
+ * import * as actions from 'tempo.ts/viem/actions'
1180
+ * import { privateKeyToAccount } from 'viem/accounts'
1181
+ *
1182
+ * const client = createClient({
1183
+ * account: privateKeyToAccount('0x...'),
1184
+ * chain: tempo,
1185
+ * transport: http(),
1186
+ * })
1187
+ *
1188
+ * const result = await actions.policy.modifyWhitelistSync(client, {
1189
+ * policyId: 2n,
1190
+ * account: '0x...',
1191
+ * allowed: true,
1192
+ * })
1193
+ * ```
1194
+ *
1195
+ * @param client - Client.
1196
+ * @param parameters - Parameters.
1197
+ * @returns The transaction receipt and event data.
1198
+ */
1199
+ export declare function modifyWhitelistSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: modifyWhitelistSync.Parameters<chain, account>): Promise<modifyWhitelistSync.ReturnValue>;
1200
+ export declare namespace modifyWhitelistSync {
1201
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = modifyWhitelist.Parameters<chain, account>;
1202
+ type Args = modifyWhitelist.Args;
1203
+ type ReturnValue = Compute<GetEventArgs<typeof tip403RegistryAbi, 'WhitelistUpdated', {
1204
+ IndexedOnly: false;
1205
+ Required: true;
1206
+ }> & {
1207
+ receipt: TransactionReceipt;
1208
+ }>;
1209
+ }
1210
+ /**
1211
+ * Modifies a policy blacklist.
1212
+ *
1213
+ * @example
1214
+ * ```ts
1215
+ * import { createClient, http } from 'viem'
1216
+ * import { tempo } from 'tempo.ts/chains'
1217
+ * import * as actions from 'tempo.ts/viem/actions'
1218
+ * import { privateKeyToAccount } from 'viem/accounts'
1219
+ *
1220
+ * const client = createClient({
1221
+ * account: privateKeyToAccount('0x...'),
1222
+ * chain: tempo,
1223
+ * transport: http(),
1224
+ * })
1225
+ *
1226
+ * const hash = await actions.policy.modifyBlacklist(client, {
1227
+ * policyId: 2n,
1228
+ * account: '0x...',
1229
+ * restricted: true,
1230
+ * })
1231
+ * ```
1232
+ *
1233
+ * @param client - Client.
1234
+ * @param parameters - Parameters.
1235
+ * @returns The transaction hash.
1236
+ */
1237
+ export declare function modifyBlacklist<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: modifyBlacklist.Parameters<chain, account>): Promise<modifyBlacklist.ReturnValue>;
1238
+ export declare namespace modifyBlacklist {
1239
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
1240
+ type Args = {
1241
+ /** Target account address. */
1242
+ address: Address;
1243
+ /** Policy ID. */
1244
+ policyId: bigint;
1245
+ /** Whether the account is restricted. */
1246
+ restricted: boolean;
1247
+ };
1248
+ type ReturnValue = WriteContractReturnType;
1249
+ /** @internal */
1250
+ function inner<action extends typeof writeContract | typeof writeContractSync, chain extends Chain | undefined, account extends Account | undefined>(action: action, client: Client<Transport, chain, account>, parameters: modifyBlacklist.Parameters<chain, account>): Promise<ReturnType<action>>;
1251
+ /**
1252
+ * Defines a call to the `modifyPolicyBlacklist` function.
1253
+ *
1254
+ * Can be passed as a parameter to:
1255
+ * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
1256
+ * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
1257
+ * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
1258
+ *
1259
+ * @example
1260
+ * ```ts
1261
+ * import { createClient, http, walletActions } from 'viem'
1262
+ * import { tempo } from 'tempo.ts/chains'
1263
+ * import * as actions from 'tempo.ts/viem/actions'
1264
+ *
1265
+ * const client = createClient({
1266
+ * chain: tempo,
1267
+ * transport: http(),
1268
+ * }).extend(walletActions)
1269
+ *
1270
+ * const { result } = await client.sendCalls({
1271
+ * calls: [
1272
+ * actions.policy.modifyBlacklist.call({
1273
+ * policyId: 2n,
1274
+ * address: '0x20c0...beef',
1275
+ * restricted: true,
1276
+ * }),
1277
+ * actions.policy.modifyBlacklist.call({
1278
+ * policyId: 2n,
1279
+ * address: '0x20c0...babe',
1280
+ * restricted: false,
1281
+ * }),
1282
+ * ]
1283
+ * })
1284
+ * ```
1285
+ *
1286
+ * @param args - Arguments.
1287
+ * @returns The call.
1288
+ */
1289
+ function call(args: Args): {
1290
+ abi: [{
1291
+ readonly type: "function";
1292
+ readonly name: "modifyPolicyBlacklist";
1293
+ readonly inputs: readonly [{
1294
+ readonly name: "policyId";
1295
+ readonly type: "uint64";
1296
+ readonly internalType: "uint64";
1297
+ }, {
1298
+ readonly name: "account";
1299
+ readonly type: "address";
1300
+ readonly internalType: "address";
1301
+ }, {
1302
+ readonly name: "restricted";
1303
+ readonly type: "bool";
1304
+ readonly internalType: "bool";
1305
+ }];
1306
+ readonly outputs: readonly [];
1307
+ readonly stateMutability: "nonpayable";
1308
+ }];
1309
+ functionName: "modifyPolicyBlacklist";
1310
+ args?: readonly [bigint, `0x${string}`, boolean] | readonly [bigint, `0x${string}`, import("viem").Widen<boolean>] | undefined;
1311
+ } & {
1312
+ args: readonly [bigint, `0x${string}`, import("viem").Widen<boolean>];
1313
+ } & {
1314
+ address: Address;
1315
+ } & {
1316
+ data: import("viem").Hex;
1317
+ to: Address;
1318
+ };
1319
+ /**
1320
+ * Extracts the `BlacklistUpdated` event from logs.
1321
+ *
1322
+ * @param logs - The logs.
1323
+ * @returns The `BlacklistUpdated` event.
1324
+ */
1325
+ function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
1326
+ readonly type: "function";
1327
+ readonly name: "createPolicy";
1328
+ readonly inputs: readonly [{
1329
+ readonly name: "admin";
1330
+ readonly type: "address";
1331
+ readonly internalType: "address";
1332
+ }, {
1333
+ readonly name: "policyType";
1334
+ readonly type: "uint8";
1335
+ readonly internalType: "enum TIP403Registry.PolicyType";
1336
+ }, {
1337
+ readonly name: "accounts";
1338
+ readonly type: "address[]";
1339
+ readonly internalType: "address[]";
1340
+ }];
1341
+ readonly outputs: readonly [{
1342
+ readonly name: "newPolicyId";
1343
+ readonly type: "uint64";
1344
+ readonly internalType: "uint64";
1345
+ }];
1346
+ readonly stateMutability: "nonpayable";
1347
+ }, {
1348
+ readonly type: "function";
1349
+ readonly name: "createPolicy";
1350
+ readonly inputs: readonly [{
1351
+ readonly name: "admin";
1352
+ readonly type: "address";
1353
+ readonly internalType: "address";
1354
+ }, {
1355
+ readonly name: "policyType";
1356
+ readonly type: "uint8";
1357
+ readonly internalType: "enum TIP403Registry.PolicyType";
1358
+ }];
1359
+ readonly outputs: readonly [{
1360
+ readonly name: "newPolicyId";
1361
+ readonly type: "uint64";
1362
+ readonly internalType: "uint64";
1363
+ }];
1364
+ readonly stateMutability: "nonpayable";
1365
+ }, {
1366
+ readonly type: "function";
1367
+ readonly name: "isAuthorized";
1368
+ readonly inputs: readonly [{
1369
+ readonly name: "policyId";
1370
+ readonly type: "uint64";
1371
+ readonly internalType: "uint64";
1372
+ }, {
1373
+ readonly name: "user";
1374
+ readonly type: "address";
1375
+ readonly internalType: "address";
1376
+ }];
1377
+ readonly outputs: readonly [{
1378
+ readonly name: "";
1379
+ readonly type: "bool";
1380
+ readonly internalType: "bool";
1381
+ }];
1382
+ readonly stateMutability: "view";
1383
+ }, {
1384
+ readonly type: "function";
1385
+ readonly name: "modifyPolicyBlacklist";
1386
+ readonly inputs: readonly [{
1387
+ readonly name: "policyId";
1388
+ readonly type: "uint64";
1389
+ readonly internalType: "uint64";
1390
+ }, {
1391
+ readonly name: "account";
1392
+ readonly type: "address";
1393
+ readonly internalType: "address";
1394
+ }, {
1395
+ readonly name: "restricted";
1396
+ readonly type: "bool";
1397
+ readonly internalType: "bool";
1398
+ }];
1399
+ readonly outputs: readonly [];
1400
+ readonly stateMutability: "nonpayable";
1401
+ }, {
1402
+ readonly type: "function";
1403
+ readonly name: "modifyPolicyWhitelist";
1404
+ readonly inputs: readonly [{
1405
+ readonly name: "policyId";
1406
+ readonly type: "uint64";
1407
+ readonly internalType: "uint64";
1408
+ }, {
1409
+ readonly name: "account";
1410
+ readonly type: "address";
1411
+ readonly internalType: "address";
1412
+ }, {
1413
+ readonly name: "allowed";
1414
+ readonly type: "bool";
1415
+ readonly internalType: "bool";
1416
+ }];
1417
+ readonly outputs: readonly [];
1418
+ readonly stateMutability: "nonpayable";
1419
+ }, {
1420
+ readonly type: "function";
1421
+ readonly name: "policyData";
1422
+ readonly inputs: readonly [{
1423
+ readonly name: "";
1424
+ readonly type: "uint64";
1425
+ readonly internalType: "uint64";
1426
+ }];
1427
+ readonly outputs: readonly [{
1428
+ readonly name: "policyType";
1429
+ readonly type: "uint8";
1430
+ readonly internalType: "enum TIP403Registry.PolicyType";
1431
+ }, {
1432
+ readonly name: "admin";
1433
+ readonly type: "address";
1434
+ readonly internalType: "address";
1435
+ }];
1436
+ readonly stateMutability: "view";
1437
+ }, {
1438
+ readonly type: "function";
1439
+ readonly name: "policyIdCounter";
1440
+ readonly inputs: readonly [];
1441
+ readonly outputs: readonly [{
1442
+ readonly name: "";
1443
+ readonly type: "uint64";
1444
+ readonly internalType: "uint64";
1445
+ }];
1446
+ readonly stateMutability: "view";
1447
+ }, {
1448
+ readonly type: "function";
1449
+ readonly name: "setPolicyAdmin";
1450
+ readonly inputs: readonly [{
1451
+ readonly name: "policyId";
1452
+ readonly type: "uint64";
1453
+ readonly internalType: "uint64";
1454
+ }, {
1455
+ readonly name: "admin";
1456
+ readonly type: "address";
1457
+ readonly internalType: "address";
1458
+ }];
1459
+ readonly outputs: readonly [];
1460
+ readonly stateMutability: "nonpayable";
1461
+ }, {
1462
+ readonly type: "event";
1463
+ readonly name: "BlacklistUpdated";
1464
+ readonly inputs: readonly [{
1465
+ readonly name: "policyId";
1466
+ readonly type: "uint64";
1467
+ readonly indexed: true;
1468
+ readonly internalType: "uint64";
1469
+ }, {
1470
+ readonly name: "updater";
1471
+ readonly type: "address";
1472
+ readonly indexed: true;
1473
+ readonly internalType: "address";
1474
+ }, {
1475
+ readonly name: "account";
1476
+ readonly type: "address";
1477
+ readonly indexed: true;
1478
+ readonly internalType: "address";
1479
+ }, {
1480
+ readonly name: "restricted";
1481
+ readonly type: "bool";
1482
+ readonly indexed: false;
1483
+ readonly internalType: "bool";
1484
+ }];
1485
+ readonly anonymous: false;
1486
+ }, {
1487
+ readonly type: "event";
1488
+ readonly name: "PolicyAdminUpdated";
1489
+ readonly inputs: readonly [{
1490
+ readonly name: "policyId";
1491
+ readonly type: "uint64";
1492
+ readonly indexed: true;
1493
+ readonly internalType: "uint64";
1494
+ }, {
1495
+ readonly name: "updater";
1496
+ readonly type: "address";
1497
+ readonly indexed: true;
1498
+ readonly internalType: "address";
1499
+ }, {
1500
+ readonly name: "admin";
1501
+ readonly type: "address";
1502
+ readonly indexed: true;
1503
+ readonly internalType: "address";
1504
+ }];
1505
+ readonly anonymous: false;
1506
+ }, {
1507
+ readonly type: "event";
1508
+ readonly name: "PolicyCreated";
1509
+ readonly inputs: readonly [{
1510
+ readonly name: "policyId";
1511
+ readonly type: "uint64";
1512
+ readonly indexed: true;
1513
+ readonly internalType: "uint64";
1514
+ }, {
1515
+ readonly name: "updater";
1516
+ readonly type: "address";
1517
+ readonly indexed: true;
1518
+ readonly internalType: "address";
1519
+ }, {
1520
+ readonly name: "policyType";
1521
+ readonly type: "uint8";
1522
+ readonly indexed: false;
1523
+ readonly internalType: "enum TIP403Registry.PolicyType";
1524
+ }];
1525
+ readonly anonymous: false;
1526
+ }, {
1527
+ readonly type: "event";
1528
+ readonly name: "WhitelistUpdated";
1529
+ readonly inputs: readonly [{
1530
+ readonly name: "policyId";
1531
+ readonly type: "uint64";
1532
+ readonly indexed: true;
1533
+ readonly internalType: "uint64";
1534
+ }, {
1535
+ readonly name: "updater";
1536
+ readonly type: "address";
1537
+ readonly indexed: true;
1538
+ readonly internalType: "address";
1539
+ }, {
1540
+ readonly name: "account";
1541
+ readonly type: "address";
1542
+ readonly indexed: true;
1543
+ readonly internalType: "address";
1544
+ }, {
1545
+ readonly name: "allowed";
1546
+ readonly type: "bool";
1547
+ readonly indexed: false;
1548
+ readonly internalType: "bool";
1549
+ }];
1550
+ readonly anonymous: false;
1551
+ }, {
1552
+ readonly type: "error";
1553
+ readonly name: "ArrayLengthMismatch";
1554
+ readonly inputs: readonly [];
1555
+ }, {
1556
+ readonly type: "error";
1557
+ readonly name: "IncompatiblePolicyType";
1558
+ readonly inputs: readonly [];
1559
+ }, {
1560
+ readonly type: "error";
1561
+ readonly name: "PolicyDoesNotExist";
1562
+ readonly inputs: readonly [];
1563
+ }, {
1564
+ readonly type: "error";
1565
+ readonly name: "Unauthorized";
1566
+ readonly inputs: readonly [];
1567
+ }], "BlacklistUpdated">;
1568
+ }
1569
+ /**
1570
+ * Modifies a policy blacklist.
1571
+ *
1572
+ * @example
1573
+ * ```ts
1574
+ * import { createClient, http } from 'viem'
1575
+ * import { tempo } from 'tempo.ts/chains'
1576
+ * import * as actions from 'tempo.ts/viem/actions'
1577
+ * import { privateKeyToAccount } from 'viem/accounts'
1578
+ *
1579
+ * const client = createClient({
1580
+ * account: privateKeyToAccount('0x...'),
1581
+ * chain: tempo,
1582
+ * transport: http(),
1583
+ * })
1584
+ *
1585
+ * const result = await actions.policy.modifyBlacklistSync(client, {
1586
+ * policyId: 2n,
1587
+ * account: '0x...',
1588
+ * restricted: true,
1589
+ * })
1590
+ * ```
1591
+ *
1592
+ * @param client - Client.
1593
+ * @param parameters - Parameters.
1594
+ * @returns The transaction receipt and event data.
1595
+ */
1596
+ export declare function modifyBlacklistSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: modifyBlacklistSync.Parameters<chain, account>): Promise<modifyBlacklistSync.ReturnValue>;
1597
+ export declare namespace modifyBlacklistSync {
1598
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = modifyBlacklist.Parameters<chain, account>;
1599
+ type Args = modifyBlacklist.Args;
1600
+ type ReturnValue = Compute<GetEventArgs<typeof tip403RegistryAbi, 'BlacklistUpdated', {
1601
+ IndexedOnly: false;
1602
+ Required: true;
1603
+ }> & {
1604
+ receipt: TransactionReceipt;
1605
+ }>;
1606
+ }
1607
+ /**
1608
+ * Gets policy data.
1609
+ *
1610
+ * @example
1611
+ * ```ts
1612
+ * import { createClient, http } from 'viem'
1613
+ * import { tempo } from 'tempo.ts/chains'
1614
+ * import * as actions from 'tempo.ts/viem/actions'
1615
+ *
1616
+ * const client = createClient({
1617
+ * chain: tempo,
1618
+ * transport: http(),
1619
+ * })
1620
+ *
1621
+ * const data = await actions.policy.getData(client, {
1622
+ * policyId: 2n,
1623
+ * })
1624
+ * ```
1625
+ *
1626
+ * @param client - Client.
1627
+ * @param parameters - Parameters.
1628
+ * @returns The policy data.
1629
+ */
1630
+ export declare function getData<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: getData.Parameters): Promise<getData.ReturnValue>;
1631
+ export declare namespace getData {
1632
+ type Parameters = ReadParameters & Args;
1633
+ type Args = {
1634
+ /** Policy ID. */
1635
+ policyId: bigint;
1636
+ };
1637
+ type ReturnValue = Compute<{
1638
+ /** Admin address. */
1639
+ admin: Address;
1640
+ /** Policy type. */
1641
+ type: PolicyType;
1642
+ }>;
1643
+ /**
1644
+ * Defines a call to the `policyData` function.
1645
+ *
1646
+ * @param args - Arguments.
1647
+ * @returns The call.
1648
+ */
1649
+ function call(args: Args): {
1650
+ abi: [{
1651
+ readonly type: "function";
1652
+ readonly name: "policyData";
1653
+ readonly inputs: readonly [{
1654
+ readonly name: "";
1655
+ readonly type: "uint64";
1656
+ readonly internalType: "uint64";
1657
+ }];
1658
+ readonly outputs: readonly [{
1659
+ readonly name: "policyType";
1660
+ readonly type: "uint8";
1661
+ readonly internalType: "enum TIP403Registry.PolicyType";
1662
+ }, {
1663
+ readonly name: "admin";
1664
+ readonly type: "address";
1665
+ readonly internalType: "address";
1666
+ }];
1667
+ readonly stateMutability: "view";
1668
+ }];
1669
+ functionName: "policyData";
1670
+ args?: readonly [bigint] | undefined;
1671
+ } & {
1672
+ args: readonly [bigint];
1673
+ } & {
1674
+ address: Address;
1675
+ } & {
1676
+ data: import("viem").Hex;
1677
+ to: Address;
1678
+ };
1679
+ }
1680
+ /**
1681
+ * Checks if a user is authorized by a policy.
1682
+ *
1683
+ * @example
1684
+ * ```ts
1685
+ * import { createClient, http } from 'viem'
1686
+ * import { tempo } from 'tempo.ts/chains'
1687
+ * import * as actions from 'tempo.ts/viem/actions'
1688
+ *
1689
+ * const client = createClient({
1690
+ * chain: tempo,
1691
+ * transport: http(),
1692
+ * })
1693
+ *
1694
+ * const authorized = await actions.policy.isAuthorized(client, {
1695
+ * policyId: 2n,
1696
+ * user: '0x...',
1697
+ * })
1698
+ * ```
1699
+ *
1700
+ * @param client - Client.
1701
+ * @param parameters - Parameters.
1702
+ * @returns Whether the user is authorized.
1703
+ */
1704
+ export declare function isAuthorized<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: isAuthorized.Parameters): Promise<isAuthorized.ReturnValue>;
1705
+ export declare namespace isAuthorized {
1706
+ type Parameters = ReadParameters & Args;
1707
+ type Args = {
1708
+ /** Policy ID. */
1709
+ policyId: bigint;
1710
+ /** User address to check. */
1711
+ user: Address;
1712
+ };
1713
+ type ReturnValue = ReadContractReturnType<typeof tip403RegistryAbi, 'isAuthorized', never>;
1714
+ /**
1715
+ * Defines a call to the `isAuthorized` function.
1716
+ *
1717
+ * @param args - Arguments.
1718
+ * @returns The call.
1719
+ */
1720
+ function call(args: Args): {
1721
+ abi: [{
1722
+ readonly type: "function";
1723
+ readonly name: "isAuthorized";
1724
+ readonly inputs: readonly [{
1725
+ readonly name: "policyId";
1726
+ readonly type: "uint64";
1727
+ readonly internalType: "uint64";
1728
+ }, {
1729
+ readonly name: "user";
1730
+ readonly type: "address";
1731
+ readonly internalType: "address";
1732
+ }];
1733
+ readonly outputs: readonly [{
1734
+ readonly name: "";
1735
+ readonly type: "bool";
1736
+ readonly internalType: "bool";
1737
+ }];
1738
+ readonly stateMutability: "view";
1739
+ }];
1740
+ functionName: "isAuthorized";
1741
+ args?: readonly [bigint, `0x${string}`] | undefined;
1742
+ } & {
1743
+ args: readonly [bigint, `0x${string}`];
1744
+ } & {
1745
+ address: Address;
1746
+ } & {
1747
+ data: import("viem").Hex;
1748
+ to: Address;
1749
+ };
1750
+ }
1751
+ /**
1752
+ * Watches for policy creation events.
1753
+ *
1754
+ * @example
1755
+ * ```ts
1756
+ * import { createClient, http } from 'viem'
1757
+ * import { tempo } from 'tempo.ts/chains'
1758
+ * import * as actions from 'tempo.ts/viem/actions'
1759
+ *
1760
+ * const client = createClient({
1761
+ * chain: tempo,
1762
+ * transport: http(),
1763
+ * })
1764
+ *
1765
+ * const unwatch = actions.policy.watchCreate(client, {
1766
+ * onPolicyCreated: (args, log) => {
1767
+ * console.log('Policy created:', args)
1768
+ * },
1769
+ * })
1770
+ * ```
1771
+ *
1772
+ * @param client - Client.
1773
+ * @param parameters - Parameters.
1774
+ * @returns A function to unsubscribe from the event.
1775
+ */
1776
+ export declare function watchCreate<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: watchCreate.Parameters): import("viem").WatchContractEventReturnType;
1777
+ export declare namespace watchCreate {
1778
+ type Args = Compute<{
1779
+ policyId: bigint;
1780
+ updater: Address;
1781
+ type: PolicyType;
1782
+ }>;
1783
+ type Log = viem_Log<bigint, number, false, ExtractAbiItem<typeof tip403RegistryAbi, 'PolicyCreated'>, true>;
1784
+ type Parameters = UnionOmit<WatchContractEventParameters<typeof tip403RegistryAbi, 'PolicyCreated', true>, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & {
1785
+ /** Callback to invoke when a policy is created. */
1786
+ onPolicyCreated: (args: Args, log: Log) => void;
1787
+ };
1788
+ }
1789
+ /**
1790
+ * Watches for policy admin update events.
1791
+ *
1792
+ * @example
1793
+ * ```ts
1794
+ * import { createClient, http } from 'viem'
1795
+ * import { tempo } from 'tempo.ts/chains'
1796
+ * import * as actions from 'tempo.ts/viem/actions'
1797
+ *
1798
+ * const client = createClient({
1799
+ * chain: tempo,
1800
+ * transport: http(),
1801
+ * })
1802
+ *
1803
+ * const unwatch = actions.policy.watchAdminUpdated(client, {
1804
+ * onAdminUpdated: (args, log) => {
1805
+ * console.log('Policy admin updated:', args)
1806
+ * },
1807
+ * })
1808
+ * ```
1809
+ *
1810
+ * @param client - Client.
1811
+ * @param parameters - Parameters.
1812
+ * @returns A function to unsubscribe from the event.
1813
+ */
1814
+ export declare function watchAdminUpdated<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: watchAdminUpdated.Parameters): import("viem").WatchContractEventReturnType;
1815
+ export declare namespace watchAdminUpdated {
1816
+ type Args = GetEventArgs<typeof tip403RegistryAbi, 'PolicyAdminUpdated', {
1817
+ IndexedOnly: false;
1818
+ Required: true;
1819
+ }>;
1820
+ type Log = viem_Log<bigint, number, false, ExtractAbiItem<typeof tip403RegistryAbi, 'PolicyAdminUpdated'>, true>;
1821
+ type Parameters = UnionOmit<WatchContractEventParameters<typeof tip403RegistryAbi, 'PolicyAdminUpdated', true>, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & {
1822
+ /** Callback to invoke when a policy admin is updated. */
1823
+ onAdminUpdated: (args: Args, log: Log) => void;
1824
+ };
1825
+ }
1826
+ /**
1827
+ * Watches for whitelist update events.
1828
+ *
1829
+ * @example
1830
+ * ```ts
1831
+ * import { createClient, http } from 'viem'
1832
+ * import { tempo } from 'tempo.ts/chains'
1833
+ * import * as actions from 'tempo.ts/viem/actions'
1834
+ *
1835
+ * const client = createClient({
1836
+ * chain: tempo,
1837
+ * transport: http(),
1838
+ * })
1839
+ *
1840
+ * const unwatch = actions.policy.watchWhitelistUpdated(client, {
1841
+ * onWhitelistUpdated: (args, log) => {
1842
+ * console.log('Whitelist updated:', args)
1843
+ * },
1844
+ * })
1845
+ * ```
1846
+ *
1847
+ * @param client - Client.
1848
+ * @param parameters - Parameters.
1849
+ * @returns A function to unsubscribe from the event.
1850
+ */
1851
+ export declare function watchWhitelistUpdated<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: watchWhitelistUpdated.Parameters): import("viem").WatchContractEventReturnType;
1852
+ export declare namespace watchWhitelistUpdated {
1853
+ type Args = GetEventArgs<typeof tip403RegistryAbi, 'WhitelistUpdated', {
1854
+ IndexedOnly: false;
1855
+ Required: true;
1856
+ }>;
1857
+ type Log = viem_Log<bigint, number, false, ExtractAbiItem<typeof tip403RegistryAbi, 'WhitelistUpdated'>, true>;
1858
+ type Parameters = UnionOmit<WatchContractEventParameters<typeof tip403RegistryAbi, 'WhitelistUpdated', true>, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & {
1859
+ /** Callback to invoke when a whitelist is updated. */
1860
+ onWhitelistUpdated: (args: Args, log: Log) => void;
1861
+ };
1862
+ }
1863
+ /**
1864
+ * Watches for blacklist update events.
1865
+ *
1866
+ * @example
1867
+ * ```ts
1868
+ * import { createClient, http } from 'viem'
1869
+ * import { tempo } from 'tempo.ts/chains'
1870
+ * import * as actions from 'tempo.ts/viem/actions'
1871
+ *
1872
+ * const client = createClient({
1873
+ * chain: tempo,
1874
+ * transport: http(),
1875
+ * })
1876
+ *
1877
+ * const unwatch = actions.policy.watchBlacklistUpdated(client, {
1878
+ * onBlacklistUpdated: (args, log) => {
1879
+ * console.log('Blacklist updated:', args)
1880
+ * },
1881
+ * })
1882
+ * ```
1883
+ *
1884
+ * @param client - Client.
1885
+ * @param parameters - Parameters.
1886
+ * @returns A function to unsubscribe from the event.
1887
+ */
1888
+ export declare function watchBlacklistUpdated<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: watchBlacklistUpdated.Parameters): import("viem").WatchContractEventReturnType;
1889
+ export declare namespace watchBlacklistUpdated {
1890
+ type Args = GetEventArgs<typeof tip403RegistryAbi, 'BlacklistUpdated', {
1891
+ IndexedOnly: false;
1892
+ Required: true;
1893
+ }>;
1894
+ type Log = viem_Log<bigint, number, false, ExtractAbiItem<typeof tip403RegistryAbi, 'BlacklistUpdated'>, true>;
1895
+ type Parameters = UnionOmit<WatchContractEventParameters<typeof tip403RegistryAbi, 'BlacklistUpdated', true>, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & {
1896
+ /** Callback to invoke when a blacklist is updated. */
1897
+ onBlacklistUpdated: (args: Args, log: Log) => void;
1898
+ };
1899
+ }
1900
+ //# sourceMappingURL=policy.d.ts.map