tempo.ts 0.1.4 → 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.
- package/README.md +33 -2
- package/dist/chains.d.ts +509 -115
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +18 -9
- package/dist/chains.js.map +1 -1
- package/dist/ox/Order.d.ts +92 -0
- package/dist/ox/Order.d.ts.map +1 -0
- package/dist/ox/Order.js +88 -0
- package/dist/ox/Order.js.map +1 -0
- package/dist/ox/OrdersFilters.d.ts +72 -0
- package/dist/ox/OrdersFilters.d.ts.map +1 -0
- package/dist/ox/OrdersFilters.js +100 -0
- package/dist/ox/OrdersFilters.js.map +1 -0
- package/dist/ox/Pagination.d.ts +128 -0
- package/dist/ox/Pagination.d.ts.map +1 -0
- package/dist/ox/Pagination.js +78 -0
- package/dist/ox/Pagination.js.map +1 -0
- package/dist/ox/PoolId.d.ts +18 -0
- package/dist/ox/PoolId.d.ts.map +1 -0
- package/dist/ox/PoolId.js +13 -0
- package/dist/ox/PoolId.js.map +1 -0
- package/dist/ox/RpcSchema.d.ts +32 -0
- package/dist/ox/RpcSchema.d.ts.map +1 -0
- package/dist/ox/RpcSchema.js +2 -0
- package/dist/ox/RpcSchema.js.map +1 -0
- package/dist/ox/SignatureEnvelope.d.ts +1 -1
- package/dist/ox/SignatureEnvelope.d.ts.map +1 -1
- package/dist/ox/SignatureEnvelope.js.map +1 -1
- package/dist/{viem → ox}/Tick.d.ts +4 -0
- package/dist/ox/Tick.d.ts.map +1 -0
- package/dist/ox/Tick.js.map +1 -0
- package/dist/ox/Transaction.d.ts.map +1 -1
- package/dist/ox/Transaction.js +2 -1
- package/dist/ox/Transaction.js.map +1 -1
- package/dist/ox/TransactionEnvelopeAA.d.ts +6 -6
- package/dist/ox/TransactionEnvelopeAA.d.ts.map +1 -1
- package/dist/ox/TransactionEnvelopeAA.js +4 -2
- package/dist/ox/TransactionEnvelopeAA.js.map +1 -1
- package/dist/ox/TransactionRequest.d.ts +4 -0
- package/dist/ox/TransactionRequest.d.ts.map +1 -1
- package/dist/ox/TransactionRequest.js.map +1 -1
- package/dist/ox/index.d.ts +6 -0
- package/dist/ox/index.d.ts.map +1 -1
- package/dist/ox/index.js +6 -0
- package/dist/ox/index.js.map +1 -1
- package/dist/prool/Instance.d.ts +5 -0
- package/dist/prool/Instance.d.ts.map +1 -1
- package/dist/prool/Instance.js +32 -8
- package/dist/prool/Instance.js.map +1 -1
- package/dist/viem/Abis.d.ts +1469 -1082
- package/dist/viem/Abis.d.ts.map +1 -1
- package/dist/viem/Abis.js +932 -671
- package/dist/viem/Abis.js.map +1 -1
- package/dist/viem/Account.d.ts +150 -0
- package/dist/viem/Account.d.ts.map +1 -0
- package/dist/viem/Account.js +221 -0
- package/dist/viem/Account.js.map +1 -0
- package/dist/viem/Actions/amm.d.ts +80 -118
- package/dist/viem/Actions/amm.d.ts.map +1 -1
- package/dist/viem/Actions/amm.js +47 -116
- package/dist/viem/Actions/amm.js.map +1 -1
- package/dist/viem/Actions/dex.d.ts +889 -633
- package/dist/viem/Actions/dex.d.ts.map +1 -1
- package/dist/viem/Actions/dex.js +99 -0
- package/dist/viem/Actions/dex.js.map +1 -1
- package/dist/viem/Actions/fee.d.ts +3 -17
- package/dist/viem/Actions/fee.d.ts.map +1 -1
- package/dist/viem/Actions/fee.js.map +1 -1
- package/dist/viem/Actions/index.d.ts +1 -0
- package/dist/viem/Actions/index.d.ts.map +1 -1
- package/dist/viem/Actions/index.js +1 -0
- package/dist/viem/Actions/index.js.map +1 -1
- package/dist/viem/Actions/reward.d.ts +3236 -0
- package/dist/viem/Actions/reward.d.ts.map +1 -0
- package/dist/viem/Actions/reward.js +725 -0
- package/dist/viem/Actions/reward.js.map +1 -0
- package/dist/viem/Actions/token.d.ts +4295 -2646
- package/dist/viem/Actions/token.d.ts.map +1 -1
- package/dist/viem/Actions/token.js +214 -335
- package/dist/viem/Actions/token.js.map +1 -1
- package/dist/viem/Addresses.d.ts +1 -2
- package/dist/viem/Addresses.d.ts.map +1 -1
- package/dist/viem/Addresses.js +1 -2
- package/dist/viem/Addresses.js.map +1 -1
- package/dist/viem/Chain.d.ts +38 -12
- package/dist/viem/Chain.d.ts.map +1 -1
- package/dist/viem/Chain.js +27 -18
- package/dist/viem/Chain.js.map +1 -1
- package/dist/viem/Decorator.d.ts +959 -405
- package/dist/viem/Decorator.d.ts.map +1 -1
- package/dist/viem/Decorator.js +13 -5
- package/dist/viem/Decorator.js.map +1 -1
- package/dist/viem/Formatters.d.ts +8 -1
- package/dist/viem/Formatters.d.ts.map +1 -1
- package/dist/viem/Formatters.js +17 -0
- package/dist/viem/Formatters.js.map +1 -1
- package/dist/viem/P256.d.ts +2 -0
- package/dist/viem/P256.d.ts.map +1 -0
- package/dist/viem/P256.js +2 -0
- package/dist/viem/P256.js.map +1 -0
- package/dist/viem/Secp256k1.d.ts +2 -0
- package/dist/viem/Secp256k1.d.ts.map +1 -0
- package/dist/viem/Secp256k1.js +2 -0
- package/dist/viem/Secp256k1.js.map +1 -0
- package/dist/viem/TokenIds.d.ts +1 -2
- package/dist/viem/TokenIds.d.ts.map +1 -1
- package/dist/viem/TokenIds.js +1 -2
- package/dist/viem/TokenIds.js.map +1 -1
- package/dist/viem/Transaction.d.ts +1 -1
- package/dist/viem/Transaction.d.ts.map +1 -1
- package/dist/viem/Transaction.js +46 -5
- package/dist/viem/Transaction.js.map +1 -1
- package/dist/viem/WebAuthnP256.d.ts +79 -0
- package/dist/viem/WebAuthnP256.d.ts.map +1 -0
- package/dist/viem/WebAuthnP256.js +95 -0
- package/dist/viem/WebAuthnP256.js.map +1 -0
- package/dist/viem/WebCryptoP256.d.ts +2 -0
- package/dist/viem/WebCryptoP256.d.ts.map +1 -0
- package/dist/viem/WebCryptoP256.js +2 -0
- package/dist/viem/WebCryptoP256.js.map +1 -0
- package/dist/viem/index.d.ts +6 -3
- package/dist/viem/index.d.ts.map +1 -1
- package/dist/viem/index.js +6 -3
- package/dist/viem/index.js.map +1 -1
- package/dist/viem/internal/account.d.ts +24 -0
- package/dist/viem/internal/account.d.ts.map +1 -0
- package/dist/viem/internal/account.js +68 -0
- package/dist/viem/internal/account.js.map +1 -0
- package/dist/viem/internal/types.d.ts +10 -0
- package/dist/viem/internal/types.d.ts.map +1 -1
- package/dist/wagmi/Actions/amm.d.ts +428 -0
- package/dist/wagmi/Actions/amm.d.ts.map +1 -0
- package/dist/wagmi/Actions/amm.js +472 -0
- package/dist/wagmi/Actions/amm.js.map +1 -0
- package/dist/wagmi/Actions/dex.d.ts +908 -0
- package/dist/wagmi/Actions/dex.d.ts.map +1 -0
- package/dist/wagmi/Actions/dex.js +1023 -0
- package/dist/wagmi/Actions/dex.js.map +1 -0
- package/dist/wagmi/Actions/fee.d.ts +111 -0
- package/dist/wagmi/Actions/fee.d.ts.map +1 -0
- package/dist/wagmi/Actions/fee.js +126 -0
- package/dist/wagmi/Actions/fee.js.map +1 -0
- package/dist/wagmi/Actions/index.d.ts +6 -0
- package/dist/wagmi/Actions/index.d.ts.map +1 -0
- package/dist/wagmi/Actions/index.js +6 -0
- package/dist/wagmi/Actions/index.js.map +1 -0
- package/dist/wagmi/Actions/reward.d.ts +348 -0
- package/dist/wagmi/Actions/reward.d.ts.map +1 -0
- package/dist/wagmi/Actions/reward.js +388 -0
- package/dist/wagmi/Actions/reward.js.map +1 -0
- package/dist/wagmi/Actions/token.d.ts +1546 -0
- package/dist/wagmi/Actions/token.d.ts.map +1 -0
- package/dist/wagmi/Actions/token.js +1712 -0
- package/dist/wagmi/Actions/token.js.map +1 -0
- package/dist/wagmi/Connector.d.ts +73 -0
- package/dist/wagmi/Connector.d.ts.map +1 -0
- package/dist/wagmi/Connector.js +249 -0
- package/dist/wagmi/Connector.js.map +1 -0
- package/dist/wagmi/Hooks/amm.d.ts +421 -0
- package/dist/wagmi/Hooks/amm.d.ts.map +1 -0
- package/dist/wagmi/Hooks/amm.js +504 -0
- package/dist/wagmi/Hooks/amm.js.map +1 -0
- package/dist/wagmi/Hooks/dex.d.ts +816 -0
- package/dist/wagmi/Hooks/dex.d.ts.map +1 -0
- package/dist/wagmi/Hooks/dex.js +973 -0
- package/dist/wagmi/Hooks/dex.js.map +1 -0
- package/dist/wagmi/Hooks/fee.d.ts +97 -0
- package/dist/wagmi/Hooks/fee.d.ts.map +1 -0
- package/dist/wagmi/Hooks/fee.js +109 -0
- package/dist/wagmi/Hooks/fee.js.map +1 -0
- package/dist/wagmi/Hooks/index.d.ts +6 -0
- package/dist/wagmi/Hooks/index.d.ts.map +1 -0
- package/dist/wagmi/Hooks/index.js +6 -0
- package/dist/wagmi/Hooks/index.js.map +1 -0
- package/dist/wagmi/Hooks/reward.d.ts +307 -0
- package/dist/wagmi/Hooks/reward.d.ts.map +1 -0
- package/dist/wagmi/Hooks/reward.js +349 -0
- package/dist/wagmi/Hooks/reward.js.map +1 -0
- package/dist/wagmi/Hooks/token.d.ts +1388 -0
- package/dist/wagmi/Hooks/token.d.ts.map +1 -0
- package/dist/wagmi/Hooks/token.js +1657 -0
- package/dist/wagmi/Hooks/token.js.map +1 -0
- package/dist/wagmi/index.d.ts +4 -0
- package/dist/wagmi/index.d.ts.map +1 -0
- package/dist/wagmi/index.js +4 -0
- package/dist/wagmi/index.js.map +1 -0
- package/package.json +54 -10
- package/src/chains.ts +19 -9
- package/src/ox/Order.test.ts +78 -0
- package/src/ox/Order.ts +125 -0
- package/src/ox/OrdersFilters.test.ts +182 -0
- package/src/ox/OrdersFilters.ts +125 -0
- package/src/ox/Pagination.test.ts +162 -0
- package/src/ox/Pagination.ts +164 -0
- package/src/ox/PoolId.test.ts +33 -0
- package/src/ox/PoolId.ts +27 -0
- package/src/ox/RpcSchema.ts +35 -0
- package/src/ox/SignatureEnvelope.ts +3 -1
- package/src/{viem → ox}/Tick.test.ts +1 -1
- package/src/{viem → ox}/Tick.ts +5 -0
- package/src/ox/Transaction.test.ts +1 -1
- package/src/ox/Transaction.ts +2 -1
- package/src/ox/TransactionEnvelopeAA.test.ts +239 -96
- package/src/ox/TransactionEnvelopeAA.ts +9 -7
- package/src/ox/TransactionRequest.ts +4 -0
- package/src/ox/index.ts +6 -0
- package/src/prool/Instance.ts +75 -38
- package/src/prool/internal/chain.json +104 -52
- package/src/tsconfig.json +9 -0
- package/src/viem/Abis.ts +972 -710
- package/src/viem/Account.ts +279 -0
- package/src/viem/Actions/__snapshots__/dex.test.ts.snap +850 -0
- package/src/viem/Actions/amm.test.ts +98 -169
- package/src/viem/Actions/amm.ts +68 -155
- package/src/viem/Actions/dex.test.ts +563 -484
- package/src/viem/Actions/dex.ts +173 -0
- package/src/viem/Actions/fee.test.ts +23 -34
- package/src/viem/Actions/fee.ts +7 -0
- package/src/viem/Actions/index.ts +1 -0
- package/src/viem/Actions/policy.test.ts +19 -33
- package/src/viem/Actions/reward.test.ts +457 -0
- package/src/viem/Actions/reward.ts +999 -0
- package/src/viem/Actions/token.test.ts +453 -287
- package/src/viem/Actions/token.ts +452 -540
- package/src/viem/Addresses.ts +1 -2
- package/src/viem/Chain.ts +70 -20
- package/src/viem/Decorator.test.ts +2 -1
- package/src/viem/Decorator.ts +996 -421
- package/src/viem/Formatters.ts +31 -5
- package/src/viem/P256.ts +1 -0
- package/src/viem/Secp256k1.ts +1 -0
- package/src/viem/TokenIds.ts +1 -2
- package/src/viem/Transaction.ts +53 -7
- package/src/viem/WebAuthnP256.ts +140 -0
- package/src/viem/WebCryptoP256.ts +1 -0
- package/src/viem/e2e.test.ts +1126 -297
- package/src/viem/index.ts +6 -3
- package/src/viem/internal/account.ts +107 -0
- package/src/viem/internal/types.ts +9 -0
- package/src/wagmi/Actions/__snapshots__/dex.test.ts.snap +310 -0
- package/src/wagmi/Actions/amm.test.ts +198 -0
- package/src/wagmi/Actions/amm.ts +691 -0
- package/src/wagmi/Actions/dex.test.ts +1507 -0
- package/src/wagmi/Actions/dex.ts +1640 -0
- package/src/wagmi/Actions/fee.test.ts +63 -0
- package/src/wagmi/Actions/fee.ts +208 -0
- package/src/wagmi/Actions/index.ts +5 -0
- package/src/wagmi/Actions/reward.test.ts +210 -0
- package/src/wagmi/Actions/reward.ts +632 -0
- package/src/wagmi/Actions/token.test.ts +1308 -0
- package/src/wagmi/Actions/token.ts +2613 -0
- package/src/wagmi/Connector.test.ts +53 -0
- package/src/wagmi/Connector.ts +367 -0
- package/src/wagmi/Hooks/__snapshots__/dex.test.ts.snap +457 -0
- package/src/wagmi/Hooks/amm.test.ts +424 -0
- package/src/wagmi/Hooks/amm.ts +806 -0
- package/src/wagmi/Hooks/dex.test.ts +1017 -0
- package/src/wagmi/Hooks/dex.ts +1685 -0
- package/src/wagmi/Hooks/fee.test.ts +166 -0
- package/src/wagmi/Hooks/fee.ts +206 -0
- package/src/wagmi/Hooks/index.ts +5 -0
- package/src/wagmi/Hooks/reward.test.ts +219 -0
- package/src/wagmi/Hooks/reward.ts +672 -0
- package/src/wagmi/Hooks/token.test.ts +1670 -0
- package/src/wagmi/Hooks/token.ts +2906 -0
- package/src/wagmi/index.ts +3 -0
- package/src/wagmi/internal/types.ts +16 -0
- package/dist/viem/Client.d.ts +0 -27
- package/dist/viem/Client.d.ts.map +0 -1
- package/dist/viem/Client.js +0 -28
- package/dist/viem/Client.js.map +0 -1
- package/dist/viem/Tick.d.ts.map +0 -1
- package/dist/viem/Tick.js.map +0 -1
- package/src/viem/Client.bench-d.ts +0 -8
- package/src/viem/Client.test.ts +0 -178
- package/src/viem/Client.ts +0 -91
- /package/dist/{viem → ox}/Tick.js +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as Hex from 'ox/Hex'
|
|
2
|
-
import * as Signature from 'ox/Signature'
|
|
3
2
|
import {
|
|
4
3
|
type Account,
|
|
5
4
|
type Address,
|
|
5
|
+
type BaseErrorType,
|
|
6
6
|
type Chain,
|
|
7
7
|
type Client,
|
|
8
8
|
type ExtractAbiItem,
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
type Transport,
|
|
17
17
|
type Log as viem_Log,
|
|
18
18
|
type WatchContractEventParameters,
|
|
19
|
+
type WatchContractEventReturnType,
|
|
19
20
|
type WriteContractReturnType,
|
|
20
21
|
} from 'viem'
|
|
21
22
|
import { parseAccount } from 'viem/accounts'
|
|
@@ -73,7 +74,7 @@ export async function approve<
|
|
|
73
74
|
client: Client<Transport, chain, account>,
|
|
74
75
|
parameters: approve.Parameters<chain, account>,
|
|
75
76
|
): Promise<approve.ReturnValue> {
|
|
76
|
-
const { token
|
|
77
|
+
const { token, ...rest } = parameters
|
|
77
78
|
return approve.inner(writeContract, client, parameters, { ...rest, token })
|
|
78
79
|
}
|
|
79
80
|
|
|
@@ -88,12 +89,15 @@ export namespace approve {
|
|
|
88
89
|
amount: bigint
|
|
89
90
|
/** Address of the spender. */
|
|
90
91
|
spender: Address
|
|
91
|
-
/** Address or ID of the TIP20 token.
|
|
92
|
-
token
|
|
92
|
+
/** Address or ID of the TIP20 token. */
|
|
93
|
+
token: TokenId.TokenIdOrAddress
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
export type ReturnValue = WriteContractReturnType
|
|
96
97
|
|
|
98
|
+
// TODO: exhaustive error type
|
|
99
|
+
export type ErrorType = BaseErrorType
|
|
100
|
+
|
|
97
101
|
/** @internal */
|
|
98
102
|
export async function inner<
|
|
99
103
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -146,7 +150,7 @@ export namespace approve {
|
|
|
146
150
|
* @returns The call.
|
|
147
151
|
*/
|
|
148
152
|
export function call(args: Args) {
|
|
149
|
-
const { spender, amount, token
|
|
153
|
+
const { spender, amount, token } = args
|
|
150
154
|
return defineCall({
|
|
151
155
|
address: TokenId.toAddress(token),
|
|
152
156
|
abi: Abis.tip20,
|
|
@@ -199,19 +203,12 @@ export async function approveSync<
|
|
|
199
203
|
client: Client<Transport, chain, account>,
|
|
200
204
|
parameters: approveSync.Parameters<chain, account>,
|
|
201
205
|
): Promise<approveSync.ReturnValue> {
|
|
202
|
-
const {
|
|
203
|
-
throwOnReceiptRevert = true,
|
|
204
|
-
token = Addresses.defaultFeeToken,
|
|
205
|
-
...rest
|
|
206
|
-
} = parameters
|
|
206
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
207
207
|
const receipt = await approve.inner(
|
|
208
208
|
writeContractSync,
|
|
209
209
|
client,
|
|
210
210
|
{ ...parameters, throwOnReceiptRevert } as never,
|
|
211
|
-
|
|
212
|
-
...rest,
|
|
213
|
-
token,
|
|
214
|
-
},
|
|
211
|
+
rest,
|
|
215
212
|
)
|
|
216
213
|
const { args } = approve.extractEvent(receipt.logs)
|
|
217
214
|
return {
|
|
@@ -241,6 +238,9 @@ export namespace approveSync {
|
|
|
241
238
|
receipt: TransactionReceipt
|
|
242
239
|
}
|
|
243
240
|
>
|
|
241
|
+
|
|
242
|
+
// TODO: exhaustive error type
|
|
243
|
+
export type ErrorType = BaseErrorType
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
/**
|
|
@@ -297,6 +297,9 @@ export namespace burnBlocked {
|
|
|
297
297
|
|
|
298
298
|
export type ReturnValue = WriteContractReturnType
|
|
299
299
|
|
|
300
|
+
// TODO: exhaustive error type
|
|
301
|
+
export type ErrorType = BaseErrorType
|
|
302
|
+
|
|
300
303
|
/** @internal */
|
|
301
304
|
export async function inner<
|
|
302
305
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -442,6 +445,9 @@ export namespace burnBlockedSync {
|
|
|
442
445
|
receipt: TransactionReceipt
|
|
443
446
|
}
|
|
444
447
|
>
|
|
448
|
+
|
|
449
|
+
// TODO: exhaustive error type
|
|
450
|
+
export type ErrorType = BaseErrorType
|
|
445
451
|
}
|
|
446
452
|
|
|
447
453
|
/**
|
|
@@ -497,6 +503,9 @@ export namespace burn {
|
|
|
497
503
|
|
|
498
504
|
export type ReturnValue = WriteContractReturnType
|
|
499
505
|
|
|
506
|
+
// TODO: exhaustive error type
|
|
507
|
+
export type ErrorType = BaseErrorType
|
|
508
|
+
|
|
500
509
|
/** @internal */
|
|
501
510
|
export async function inner<
|
|
502
511
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -647,6 +656,9 @@ export namespace burnSync {
|
|
|
647
656
|
receipt: TransactionReceipt
|
|
648
657
|
}
|
|
649
658
|
>
|
|
659
|
+
|
|
660
|
+
// TODO: exhaustive error type
|
|
661
|
+
export type ErrorType = BaseErrorType
|
|
650
662
|
}
|
|
651
663
|
|
|
652
664
|
/**
|
|
@@ -700,6 +712,9 @@ export namespace changeTransferPolicy {
|
|
|
700
712
|
|
|
701
713
|
export type ReturnValue = WriteContractReturnType
|
|
702
714
|
|
|
715
|
+
// TODO: exhaustive error type
|
|
716
|
+
export type ErrorType = BaseErrorType
|
|
717
|
+
|
|
703
718
|
/** @internal */
|
|
704
719
|
export async function inner<
|
|
705
720
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -842,6 +857,9 @@ export namespace changeTransferPolicySync {
|
|
|
842
857
|
receipt: TransactionReceipt
|
|
843
858
|
}
|
|
844
859
|
>
|
|
860
|
+
|
|
861
|
+
// TODO: exhaustive error type
|
|
862
|
+
export type ErrorType = BaseErrorType
|
|
845
863
|
}
|
|
846
864
|
|
|
847
865
|
/**
|
|
@@ -906,6 +924,9 @@ export namespace create {
|
|
|
906
924
|
|
|
907
925
|
export type ReturnValue = WriteContractReturnType
|
|
908
926
|
|
|
927
|
+
// TODO: exhaustive error type
|
|
928
|
+
export type ErrorType = BaseErrorType
|
|
929
|
+
|
|
909
930
|
/** @internal */
|
|
910
931
|
export async function inner<
|
|
911
932
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -977,7 +998,7 @@ export namespace create {
|
|
|
977
998
|
name,
|
|
978
999
|
symbol,
|
|
979
1000
|
currency,
|
|
980
|
-
quoteToken = Addresses.
|
|
1001
|
+
quoteToken = Addresses.linkingUsd,
|
|
981
1002
|
admin,
|
|
982
1003
|
} = args
|
|
983
1004
|
return defineCall({
|
|
@@ -1072,196 +1093,9 @@ export namespace createSync {
|
|
|
1072
1093
|
receipt: TransactionReceipt
|
|
1073
1094
|
}
|
|
1074
1095
|
>
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
/**
|
|
1078
|
-
* Finalizes the quote token update for a TIP20 token.
|
|
1079
|
-
*
|
|
1080
|
-
* @example
|
|
1081
|
-
* ```ts
|
|
1082
|
-
* import { createClient, http } from 'viem'
|
|
1083
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1084
|
-
* import * as actions from 'tempo.ts/viem/actions'
|
|
1085
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1086
|
-
*
|
|
1087
|
-
* const client = createClient({
|
|
1088
|
-
* account: privateKeyToAccount('0x...'),
|
|
1089
|
-
* chain: tempo,
|
|
1090
|
-
* transport: http(),
|
|
1091
|
-
* })
|
|
1092
|
-
*
|
|
1093
|
-
* const result = await actions.token.finalizeUpdateQuoteToken(client, {
|
|
1094
|
-
* token: '0x...',
|
|
1095
|
-
* })
|
|
1096
|
-
* ```
|
|
1097
|
-
*
|
|
1098
|
-
* @param client - Client.
|
|
1099
|
-
* @param parameters - Parameters.
|
|
1100
|
-
* @returns The transaction hash.
|
|
1101
|
-
*/
|
|
1102
|
-
export async function finalizeUpdateQuoteToken<
|
|
1103
|
-
chain extends Chain | undefined,
|
|
1104
|
-
account extends Account | undefined,
|
|
1105
|
-
>(
|
|
1106
|
-
client: Client<Transport, chain, account>,
|
|
1107
|
-
parameters: finalizeUpdateQuoteToken.Parameters<chain, account>,
|
|
1108
|
-
): Promise<finalizeUpdateQuoteToken.ReturnValue> {
|
|
1109
|
-
return finalizeUpdateQuoteToken.inner(writeContract, client, parameters)
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
export namespace finalizeUpdateQuoteToken {
|
|
1113
|
-
export type Parameters<
|
|
1114
|
-
chain extends Chain | undefined = Chain | undefined,
|
|
1115
|
-
account extends Account | undefined = Account | undefined,
|
|
1116
|
-
> = WriteParameters<chain, account> & Args
|
|
1117
|
-
|
|
1118
|
-
export type Args = {
|
|
1119
|
-
/** Address or ID of the TIP20 token. */
|
|
1120
|
-
token: TokenId.TokenIdOrAddress
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
export type ReturnValue = WriteContractReturnType
|
|
1124
|
-
|
|
1125
|
-
/** @internal */
|
|
1126
|
-
export async function inner<
|
|
1127
|
-
action extends typeof writeContract | typeof writeContractSync,
|
|
1128
|
-
chain extends Chain | undefined,
|
|
1129
|
-
account extends Account | undefined,
|
|
1130
|
-
>(
|
|
1131
|
-
action: action,
|
|
1132
|
-
client: Client<Transport, chain, account>,
|
|
1133
|
-
parameters: finalizeUpdateQuoteToken.Parameters<chain, account>,
|
|
1134
|
-
): Promise<ReturnType<action>> {
|
|
1135
|
-
const { token, ...rest } = parameters
|
|
1136
|
-
const call = finalizeUpdateQuoteToken.call({ token })
|
|
1137
|
-
return (await action(client, {
|
|
1138
|
-
...rest,
|
|
1139
|
-
...call,
|
|
1140
|
-
} as never)) as never
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
/**
|
|
1144
|
-
* Defines a call to the `finalizeQuoteTokenUpdate` function.
|
|
1145
|
-
*
|
|
1146
|
-
* Can be passed as a parameter to:
|
|
1147
|
-
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
1148
|
-
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
1149
|
-
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
1150
|
-
*
|
|
1151
|
-
* @example
|
|
1152
|
-
* ```ts
|
|
1153
|
-
* import { createClient, http, walletActions } from 'viem'
|
|
1154
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1155
|
-
* import * as actions from 'tempo.ts/viem/actions'
|
|
1156
|
-
*
|
|
1157
|
-
* const client = createClient({
|
|
1158
|
-
* chain: tempo,
|
|
1159
|
-
* transport: http(),
|
|
1160
|
-
* }).extend(walletActions)
|
|
1161
|
-
*
|
|
1162
|
-
* const { result } = await client.sendCalls({
|
|
1163
|
-
* calls: [
|
|
1164
|
-
* actions.token.finalizeUpdateQuoteToken.call({
|
|
1165
|
-
* token: '0x20c0...babe',
|
|
1166
|
-
* }),
|
|
1167
|
-
* ]
|
|
1168
|
-
* })
|
|
1169
|
-
* ```
|
|
1170
|
-
*
|
|
1171
|
-
* @param args - Arguments.
|
|
1172
|
-
* @returns The call.
|
|
1173
|
-
*/
|
|
1174
|
-
export function call(args: Args) {
|
|
1175
|
-
const { token } = args
|
|
1176
|
-
return defineCall({
|
|
1177
|
-
address: TokenId.toAddress(token),
|
|
1178
|
-
abi: Abis.tip20,
|
|
1179
|
-
functionName: 'finalizeQuoteTokenUpdate',
|
|
1180
|
-
args: [],
|
|
1181
|
-
})
|
|
1182
|
-
}
|
|
1183
1096
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
*
|
|
1187
|
-
* @param logs - Logs.
|
|
1188
|
-
* @returns The event.
|
|
1189
|
-
*/
|
|
1190
|
-
export function extractEvent(logs: Log[]) {
|
|
1191
|
-
const [log] = parseEventLogs({
|
|
1192
|
-
abi: Abis.tip20,
|
|
1193
|
-
logs,
|
|
1194
|
-
eventName: 'QuoteTokenUpdateFinalized',
|
|
1195
|
-
})
|
|
1196
|
-
if (!log) throw new Error('`QuoteTokenUpdateFinalized` event not found.')
|
|
1197
|
-
return log
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
/**
|
|
1202
|
-
* Finalizes the quote token update for a TIP20 token.
|
|
1203
|
-
*
|
|
1204
|
-
* @example
|
|
1205
|
-
* ```ts
|
|
1206
|
-
* import { createClient, http } from 'viem'
|
|
1207
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1208
|
-
* import * as actions from 'tempo.ts/viem/actions'
|
|
1209
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1210
|
-
*
|
|
1211
|
-
* const client = createClient({
|
|
1212
|
-
* account: privateKeyToAccount('0x...'),
|
|
1213
|
-
* chain: tempo,
|
|
1214
|
-
* transport: http(),
|
|
1215
|
-
* })
|
|
1216
|
-
*
|
|
1217
|
-
* const result = await actions.token.finalizeUpdateQuoteTokenSync(client, {
|
|
1218
|
-
* token: '0x...',
|
|
1219
|
-
* })
|
|
1220
|
-
* ```
|
|
1221
|
-
*
|
|
1222
|
-
* @param client - Client.
|
|
1223
|
-
* @param parameters - Parameters.
|
|
1224
|
-
* @returns The transaction receipt and event data.
|
|
1225
|
-
*/
|
|
1226
|
-
export async function finalizeUpdateQuoteTokenSync<
|
|
1227
|
-
chain extends Chain | undefined,
|
|
1228
|
-
account extends Account | undefined,
|
|
1229
|
-
>(
|
|
1230
|
-
client: Client<Transport, chain, account>,
|
|
1231
|
-
parameters: finalizeUpdateQuoteTokenSync.Parameters<chain, account>,
|
|
1232
|
-
): Promise<finalizeUpdateQuoteTokenSync.ReturnValue> {
|
|
1233
|
-
const receipt = await finalizeUpdateQuoteToken.inner(
|
|
1234
|
-
writeContractSync,
|
|
1235
|
-
client,
|
|
1236
|
-
parameters,
|
|
1237
|
-
)
|
|
1238
|
-
const { args } = finalizeUpdateQuoteToken.extractEvent(receipt.logs)
|
|
1239
|
-
return {
|
|
1240
|
-
...args,
|
|
1241
|
-
receipt,
|
|
1242
|
-
} as never
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
export namespace finalizeUpdateQuoteTokenSync {
|
|
1246
|
-
export type Parameters<
|
|
1247
|
-
chain extends Chain | undefined = Chain | undefined,
|
|
1248
|
-
account extends Account | undefined = Account | undefined,
|
|
1249
|
-
> = finalizeUpdateQuoteToken.Parameters<chain, account>
|
|
1250
|
-
|
|
1251
|
-
export type Args = finalizeUpdateQuoteToken.Args
|
|
1252
|
-
|
|
1253
|
-
export type ReturnValue = Compute<
|
|
1254
|
-
GetEventArgs<
|
|
1255
|
-
typeof Abis.tip20,
|
|
1256
|
-
'QuoteTokenUpdateFinalized',
|
|
1257
|
-
{
|
|
1258
|
-
IndexedOnly: false
|
|
1259
|
-
Required: true
|
|
1260
|
-
}
|
|
1261
|
-
> & {
|
|
1262
|
-
receipt: TransactionReceipt
|
|
1263
|
-
}
|
|
1264
|
-
>
|
|
1097
|
+
// TODO: exhaustive error type
|
|
1098
|
+
export type ErrorType = BaseErrorType
|
|
1265
1099
|
}
|
|
1266
1100
|
|
|
1267
1101
|
/**
|
|
@@ -1315,8 +1149,8 @@ export namespace getAllowance {
|
|
|
1315
1149
|
account: Address
|
|
1316
1150
|
/** Address of the spender. */
|
|
1317
1151
|
spender: Address
|
|
1318
|
-
/** Address or ID of the TIP20 token.
|
|
1319
|
-
token
|
|
1152
|
+
/** Address or ID of the TIP20 token. */
|
|
1153
|
+
token: TokenId.TokenIdOrAddress
|
|
1320
1154
|
}
|
|
1321
1155
|
|
|
1322
1156
|
export type ReturnValue = ReadContractReturnType<
|
|
@@ -1332,7 +1166,7 @@ export namespace getAllowance {
|
|
|
1332
1166
|
* @returns The call.
|
|
1333
1167
|
*/
|
|
1334
1168
|
export function call(args: Args) {
|
|
1335
|
-
const { account, spender, token
|
|
1169
|
+
const { account, spender, token } = args
|
|
1336
1170
|
return defineCall({
|
|
1337
1171
|
address: TokenId.toAddress(token),
|
|
1338
1172
|
abi: Abis.tip20,
|
|
@@ -1372,11 +1206,9 @@ export async function getBalance<
|
|
|
1372
1206
|
account extends Account | undefined,
|
|
1373
1207
|
>(
|
|
1374
1208
|
client: Client<Transport, chain, account>,
|
|
1375
|
-
|
|
1376
|
-
? [getBalance.Parameters<account>] | []
|
|
1377
|
-
: [getBalance.Parameters<account>]
|
|
1209
|
+
parameters: getBalance.Parameters<account>,
|
|
1378
1210
|
): Promise<getBalance.ReturnValue> {
|
|
1379
|
-
const { account = client.account, ...rest } = parameters
|
|
1211
|
+
const { account = client.account, ...rest } = parameters
|
|
1380
1212
|
const address = account ? parseAccount(account).address : undefined
|
|
1381
1213
|
if (!address) throw new Error('account is required.')
|
|
1382
1214
|
return readContract(client, {
|
|
@@ -1393,8 +1225,8 @@ export namespace getBalance {
|
|
|
1393
1225
|
export type Args = {
|
|
1394
1226
|
/** Account address. */
|
|
1395
1227
|
account: Address
|
|
1396
|
-
/** Address or ID of the TIP20 token.
|
|
1397
|
-
token
|
|
1228
|
+
/** Address or ID of the TIP20 token. */
|
|
1229
|
+
token: TokenId.TokenIdOrAddress
|
|
1398
1230
|
}
|
|
1399
1231
|
|
|
1400
1232
|
export type ReturnValue = ReadContractReturnType<
|
|
@@ -1410,7 +1242,7 @@ export namespace getBalance {
|
|
|
1410
1242
|
* @returns The call.
|
|
1411
1243
|
*/
|
|
1412
1244
|
export function call(args: Args) {
|
|
1413
|
-
const { account, token
|
|
1245
|
+
const { account, token } = args
|
|
1414
1246
|
return defineCall({
|
|
1415
1247
|
address: TokenId.toAddress(token),
|
|
1416
1248
|
abi: Abis.tip20,
|
|
@@ -1447,13 +1279,13 @@ export namespace getBalance {
|
|
|
1447
1279
|
*/
|
|
1448
1280
|
export async function getMetadata<chain extends Chain | undefined>(
|
|
1449
1281
|
client: Client<Transport, chain>,
|
|
1450
|
-
parameters: getMetadata.Parameters
|
|
1282
|
+
parameters: getMetadata.Parameters,
|
|
1451
1283
|
): Promise<getMetadata.ReturnValue> {
|
|
1452
|
-
const { token
|
|
1284
|
+
const { token, ...rest } = parameters
|
|
1453
1285
|
const address = TokenId.toAddress(token)
|
|
1454
1286
|
const abi = Abis.tip20
|
|
1455
1287
|
|
|
1456
|
-
if (TokenId.from(token) === TokenId.fromAddress(Addresses.
|
|
1288
|
+
if (TokenId.from(token) === TokenId.fromAddress(Addresses.linkingUsd))
|
|
1457
1289
|
return multicall(client, {
|
|
1458
1290
|
...rest,
|
|
1459
1291
|
contracts: [
|
|
@@ -1571,8 +1403,8 @@ export async function getMetadata<chain extends Chain | undefined>(
|
|
|
1571
1403
|
|
|
1572
1404
|
export declare namespace getMetadata {
|
|
1573
1405
|
export type Parameters = {
|
|
1574
|
-
/** Address or ID of the TIP20 token.
|
|
1575
|
-
token
|
|
1406
|
+
/** Address or ID of the TIP20 token. */
|
|
1407
|
+
token: TokenId.TokenIdOrAddress
|
|
1576
1408
|
}
|
|
1577
1409
|
|
|
1578
1410
|
export type ReturnValue = Compute<{
|
|
@@ -1624,6 +1456,73 @@ export declare namespace getMetadata {
|
|
|
1624
1456
|
}>
|
|
1625
1457
|
}
|
|
1626
1458
|
|
|
1459
|
+
/**
|
|
1460
|
+
* Gets the admin role for a specific role in a TIP20 token.
|
|
1461
|
+
*
|
|
1462
|
+
* @example
|
|
1463
|
+
* ```ts
|
|
1464
|
+
* import { createClient, http } from 'viem'
|
|
1465
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1466
|
+
* import * as actions from 'tempo.ts/viem/actions'
|
|
1467
|
+
*
|
|
1468
|
+
* const client = createClient({
|
|
1469
|
+
* chain: tempo,
|
|
1470
|
+
* transport: http(),
|
|
1471
|
+
* })
|
|
1472
|
+
*
|
|
1473
|
+
* const adminRole = await actions.token.getRoleAdmin(client, {
|
|
1474
|
+
* role: 'minter',
|
|
1475
|
+
* token: '0x...',
|
|
1476
|
+
* })
|
|
1477
|
+
* ```
|
|
1478
|
+
*
|
|
1479
|
+
* @param client - Client.
|
|
1480
|
+
* @param parameters - Parameters.
|
|
1481
|
+
* @returns The admin role hash.
|
|
1482
|
+
*/
|
|
1483
|
+
export async function getRoleAdmin<chain extends Chain | undefined>(
|
|
1484
|
+
client: Client<Transport, chain>,
|
|
1485
|
+
parameters: getRoleAdmin.Parameters,
|
|
1486
|
+
): Promise<getRoleAdmin.ReturnValue> {
|
|
1487
|
+
return readContract(client, {
|
|
1488
|
+
...parameters,
|
|
1489
|
+
...getRoleAdmin.call(parameters),
|
|
1490
|
+
})
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
export namespace getRoleAdmin {
|
|
1494
|
+
export type Parameters = ReadParameters & Args
|
|
1495
|
+
|
|
1496
|
+
export type Args = {
|
|
1497
|
+
/** Role to get admin for. */
|
|
1498
|
+
role: TokenRole.TokenRole
|
|
1499
|
+
/** Address or ID of the TIP20 token. */
|
|
1500
|
+
token: TokenId.TokenIdOrAddress
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
export type ReturnValue = ReadContractReturnType<
|
|
1504
|
+
typeof Abis.tip20,
|
|
1505
|
+
'getRoleAdmin',
|
|
1506
|
+
never
|
|
1507
|
+
>
|
|
1508
|
+
|
|
1509
|
+
/**
|
|
1510
|
+
* Defines a call to the `getRoleAdmin` function.
|
|
1511
|
+
*
|
|
1512
|
+
* @param args - Arguments.
|
|
1513
|
+
* @returns The call.
|
|
1514
|
+
*/
|
|
1515
|
+
export function call(args: Args) {
|
|
1516
|
+
const { role, token } = args
|
|
1517
|
+
return defineCall({
|
|
1518
|
+
address: TokenId.toAddress(token),
|
|
1519
|
+
abi: Abis.tip20,
|
|
1520
|
+
functionName: 'getRoleAdmin',
|
|
1521
|
+
args: [TokenRole.serialize(role)],
|
|
1522
|
+
})
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1627
1526
|
/**
|
|
1628
1527
|
* Checks if an account has a specific role for a TIP20 token.
|
|
1629
1528
|
*
|
|
@@ -1760,6 +1659,9 @@ export namespace grantRoles {
|
|
|
1760
1659
|
|
|
1761
1660
|
export type ReturnValue = WriteContractReturnType
|
|
1762
1661
|
|
|
1662
|
+
// TODO: exhaustive error type
|
|
1663
|
+
export type ErrorType = BaseErrorType
|
|
1664
|
+
|
|
1763
1665
|
/** @internal */
|
|
1764
1666
|
export async function inner<
|
|
1765
1667
|
action extends typeof sendTransaction | typeof sendTransactionSync,
|
|
@@ -1907,6 +1809,9 @@ export namespace grantRolesSync {
|
|
|
1907
1809
|
{ IndexedOnly: false; Required: true }
|
|
1908
1810
|
>[]
|
|
1909
1811
|
}
|
|
1812
|
+
|
|
1813
|
+
// TODO: exhaustive error type
|
|
1814
|
+
export type ErrorType = BaseErrorType
|
|
1910
1815
|
}
|
|
1911
1816
|
|
|
1912
1817
|
/**
|
|
@@ -1965,6 +1870,9 @@ export namespace mint {
|
|
|
1965
1870
|
|
|
1966
1871
|
export type ReturnValue = WriteContractReturnType
|
|
1967
1872
|
|
|
1873
|
+
// TODO: exhaustive error type
|
|
1874
|
+
export type ErrorType = BaseErrorType
|
|
1875
|
+
|
|
1968
1876
|
/** @internal */
|
|
1969
1877
|
export async function inner<
|
|
1970
1878
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -2116,6 +2024,9 @@ export namespace mintSync {
|
|
|
2116
2024
|
receipt: TransactionReceipt
|
|
2117
2025
|
}
|
|
2118
2026
|
>
|
|
2027
|
+
|
|
2028
|
+
// TODO: exhaustive error type
|
|
2029
|
+
export type ErrorType = BaseErrorType
|
|
2119
2030
|
}
|
|
2120
2031
|
|
|
2121
2032
|
/**
|
|
@@ -2150,221 +2061,25 @@ export async function pause<
|
|
|
2150
2061
|
client: Client<Transport, chain, account>,
|
|
2151
2062
|
parameters: pause.Parameters<chain, account>,
|
|
2152
2063
|
): Promise<pause.ReturnValue> {
|
|
2153
|
-
return pause.inner(writeContract, client, parameters)
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
export namespace pause {
|
|
2157
|
-
export type Parameters<
|
|
2158
|
-
chain extends Chain | undefined = Chain | undefined,
|
|
2159
|
-
account extends Account | undefined = Account | undefined,
|
|
2160
|
-
> = WriteParameters<chain, account> & Args
|
|
2161
|
-
|
|
2162
|
-
export type Args = {
|
|
2163
|
-
/** Address or ID of the TIP20 token. */
|
|
2164
|
-
token: TokenId.TokenIdOrAddress
|
|
2165
|
-
}
|
|
2166
|
-
|
|
2167
|
-
export type ReturnValue = WriteContractReturnType
|
|
2168
|
-
|
|
2169
|
-
/** @internal */
|
|
2170
|
-
export async function inner<
|
|
2171
|
-
action extends typeof writeContract | typeof writeContractSync,
|
|
2172
|
-
chain extends Chain | undefined,
|
|
2173
|
-
account extends Account | undefined,
|
|
2174
|
-
>(
|
|
2175
|
-
action: action,
|
|
2176
|
-
client: Client<Transport, chain, account>,
|
|
2177
|
-
parameters: pause.Parameters<chain, account>,
|
|
2178
|
-
): Promise<ReturnType<action>> {
|
|
2179
|
-
const { token, ...rest } = parameters
|
|
2180
|
-
const call = pause.call({ token })
|
|
2181
|
-
return (await action(client, {
|
|
2182
|
-
...rest,
|
|
2183
|
-
...call,
|
|
2184
|
-
} as never)) as never
|
|
2185
|
-
}
|
|
2186
|
-
|
|
2187
|
-
/**
|
|
2188
|
-
* Defines a call to the `pause` function.
|
|
2189
|
-
*
|
|
2190
|
-
* Can be passed as a parameter to:
|
|
2191
|
-
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
2192
|
-
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
2193
|
-
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
2194
|
-
*
|
|
2195
|
-
* @example
|
|
2196
|
-
* ```ts
|
|
2197
|
-
* import { createClient, http, walletActions } from 'viem'
|
|
2198
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
2199
|
-
* import * as actions from 'tempo.ts/viem/actions'
|
|
2200
|
-
*
|
|
2201
|
-
* const client = createClient({
|
|
2202
|
-
* chain: tempo,
|
|
2203
|
-
* transport: http(),
|
|
2204
|
-
* }).extend(walletActions)
|
|
2205
|
-
*
|
|
2206
|
-
* const { result } = await client.sendCalls({
|
|
2207
|
-
* calls: [
|
|
2208
|
-
* actions.token.pause.call({
|
|
2209
|
-
* token: '0x20c0...babe',
|
|
2210
|
-
* }),
|
|
2211
|
-
* ]
|
|
2212
|
-
* })
|
|
2213
|
-
* ```
|
|
2214
|
-
*
|
|
2215
|
-
* @param args - Arguments.
|
|
2216
|
-
* @returns The call.
|
|
2217
|
-
*/
|
|
2218
|
-
export function call(args: Args) {
|
|
2219
|
-
const { token } = args
|
|
2220
|
-
return defineCall({
|
|
2221
|
-
address: TokenId.toAddress(token),
|
|
2222
|
-
abi: Abis.tip20,
|
|
2223
|
-
functionName: 'pause',
|
|
2224
|
-
args: [],
|
|
2225
|
-
})
|
|
2226
|
-
}
|
|
2227
|
-
|
|
2228
|
-
/**
|
|
2229
|
-
* Extracts the event from the logs.
|
|
2230
|
-
*
|
|
2231
|
-
* @param logs - Logs.
|
|
2232
|
-
* @returns The event.
|
|
2233
|
-
*/
|
|
2234
|
-
export function extractEvent(logs: Log[]) {
|
|
2235
|
-
const [log] = parseEventLogs({
|
|
2236
|
-
abi: Abis.tip20,
|
|
2237
|
-
logs,
|
|
2238
|
-
eventName: 'PauseStateUpdate',
|
|
2239
|
-
})
|
|
2240
|
-
if (!log) throw new Error('`PauseStateUpdate` event not found.')
|
|
2241
|
-
return log
|
|
2242
|
-
}
|
|
2243
|
-
}
|
|
2244
|
-
|
|
2245
|
-
/**
|
|
2246
|
-
* Pauses a TIP20 token.
|
|
2247
|
-
*
|
|
2248
|
-
* @example
|
|
2249
|
-
* ```ts
|
|
2250
|
-
* import { createClient, http } from 'viem'
|
|
2251
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
2252
|
-
* import * as actions from 'tempo.ts/viem/actions'
|
|
2253
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2254
|
-
*
|
|
2255
|
-
* const client = createClient({
|
|
2256
|
-
* account: privateKeyToAccount('0x...'),
|
|
2257
|
-
* chain: tempo,
|
|
2258
|
-
* transport: http(),
|
|
2259
|
-
* })
|
|
2260
|
-
*
|
|
2261
|
-
* const result = await actions.token.pauseSync(client, {
|
|
2262
|
-
* token: '0x...',
|
|
2263
|
-
* })
|
|
2264
|
-
* ```
|
|
2265
|
-
*
|
|
2266
|
-
* @param client - Client.
|
|
2267
|
-
* @param parameters - Parameters.
|
|
2268
|
-
* @returns The transaction receipt and event data.
|
|
2269
|
-
*/
|
|
2270
|
-
export async function pauseSync<
|
|
2271
|
-
chain extends Chain | undefined,
|
|
2272
|
-
account extends Account | undefined,
|
|
2273
|
-
>(
|
|
2274
|
-
client: Client<Transport, chain, account>,
|
|
2275
|
-
parameters: pauseSync.Parameters<chain, account>,
|
|
2276
|
-
): Promise<pauseSync.ReturnValue> {
|
|
2277
|
-
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
2278
|
-
const receipt = await pause.inner(writeContractSync, client, {
|
|
2279
|
-
...rest,
|
|
2280
|
-
throwOnReceiptRevert,
|
|
2281
|
-
} as never)
|
|
2282
|
-
const { args } = pause.extractEvent(receipt.logs)
|
|
2283
|
-
return {
|
|
2284
|
-
...args,
|
|
2285
|
-
receipt,
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2288
|
-
|
|
2289
|
-
export namespace pauseSync {
|
|
2290
|
-
export type Parameters<
|
|
2291
|
-
chain extends Chain | undefined = Chain | undefined,
|
|
2292
|
-
account extends Account | undefined = Account | undefined,
|
|
2293
|
-
> = pause.Parameters<chain, account>
|
|
2294
|
-
|
|
2295
|
-
export type Args = pause.Args
|
|
2296
|
-
|
|
2297
|
-
export type ReturnValue = GetEventArgs<
|
|
2298
|
-
typeof Abis.tip20,
|
|
2299
|
-
'PauseStateUpdate',
|
|
2300
|
-
{ IndexedOnly: false; Required: true }
|
|
2301
|
-
> & {
|
|
2302
|
-
receipt: TransactionReceipt
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
|
|
2306
|
-
/**
|
|
2307
|
-
* Approves a spender using a signed permit.
|
|
2308
|
-
*
|
|
2309
|
-
* @example
|
|
2310
|
-
* ```ts
|
|
2311
|
-
* import { createClient, http } from 'viem'
|
|
2312
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
2313
|
-
* import * as actions from 'tempo.ts/viem/actions'
|
|
2314
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2315
|
-
*
|
|
2316
|
-
* const client = createClient({
|
|
2317
|
-
* account: privateKeyToAccount('0x...'),
|
|
2318
|
-
* chain: tempo,
|
|
2319
|
-
* transport: http(),
|
|
2320
|
-
* })
|
|
2321
|
-
*
|
|
2322
|
-
* const result = await actions.token.permit(client, {
|
|
2323
|
-
* owner: '0x...',
|
|
2324
|
-
* spender: '0x...',
|
|
2325
|
-
* value: 100n,
|
|
2326
|
-
* deadline: 1234567890n,
|
|
2327
|
-
* signature: { r: 0n, s: 0n, yParity: 0 },
|
|
2328
|
-
* })
|
|
2329
|
-
* ```
|
|
2330
|
-
*
|
|
2331
|
-
* @param client - Client.
|
|
2332
|
-
* @param parameters - Parameters.
|
|
2333
|
-
* @returns The transaction hash.
|
|
2334
|
-
*/
|
|
2335
|
-
export async function permit<
|
|
2336
|
-
chain extends Chain | undefined,
|
|
2337
|
-
account extends Account | undefined,
|
|
2338
|
-
>(
|
|
2339
|
-
client: Client<Transport, chain, account>,
|
|
2340
|
-
parameters: permit.Parameters<chain, account>,
|
|
2341
|
-
): Promise<permit.ReturnValue> {
|
|
2342
|
-
return permit.inner(writeContract, client, parameters)
|
|
2064
|
+
return pause.inner(writeContract, client, parameters)
|
|
2343
2065
|
}
|
|
2344
2066
|
|
|
2345
|
-
export namespace
|
|
2067
|
+
export namespace pause {
|
|
2346
2068
|
export type Parameters<
|
|
2347
2069
|
chain extends Chain | undefined = Chain | undefined,
|
|
2348
2070
|
account extends Account | undefined = Account | undefined,
|
|
2349
2071
|
> = WriteParameters<chain, account> & Args
|
|
2350
2072
|
|
|
2351
2073
|
export type Args = {
|
|
2352
|
-
/**
|
|
2353
|
-
|
|
2354
|
-
/** Address of the owner. */
|
|
2355
|
-
owner: Address
|
|
2356
|
-
/** Signature. */
|
|
2357
|
-
signature: Signature.Signature
|
|
2358
|
-
/** Address of the spender. */
|
|
2359
|
-
spender: Address
|
|
2360
|
-
/** Address or ID of the TIP20 token. @default `Addresses.defaultFeeToken` */
|
|
2361
|
-
token?: TokenId.TokenIdOrAddress | undefined
|
|
2362
|
-
/** Amount to approve. */
|
|
2363
|
-
value: bigint
|
|
2074
|
+
/** Address or ID of the TIP20 token. */
|
|
2075
|
+
token: TokenId.TokenIdOrAddress
|
|
2364
2076
|
}
|
|
2365
2077
|
|
|
2366
2078
|
export type ReturnValue = WriteContractReturnType
|
|
2367
2079
|
|
|
2080
|
+
// TODO: exhaustive error type
|
|
2081
|
+
export type ErrorType = BaseErrorType
|
|
2082
|
+
|
|
2368
2083
|
/** @internal */
|
|
2369
2084
|
export async function inner<
|
|
2370
2085
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -2373,18 +2088,10 @@ export namespace permit {
|
|
|
2373
2088
|
>(
|
|
2374
2089
|
action: action,
|
|
2375
2090
|
client: Client<Transport, chain, account>,
|
|
2376
|
-
parameters:
|
|
2091
|
+
parameters: pause.Parameters<chain, account>,
|
|
2377
2092
|
): Promise<ReturnType<action>> {
|
|
2378
|
-
const {
|
|
2379
|
-
|
|
2380
|
-
const call = permit.call({
|
|
2381
|
-
owner,
|
|
2382
|
-
spender,
|
|
2383
|
-
value,
|
|
2384
|
-
deadline,
|
|
2385
|
-
signature,
|
|
2386
|
-
token,
|
|
2387
|
-
})
|
|
2093
|
+
const { token, ...rest } = parameters
|
|
2094
|
+
const call = pause.call({ token })
|
|
2388
2095
|
return (await action(client, {
|
|
2389
2096
|
...rest,
|
|
2390
2097
|
...call,
|
|
@@ -2392,7 +2099,7 @@ export namespace permit {
|
|
|
2392
2099
|
}
|
|
2393
2100
|
|
|
2394
2101
|
/**
|
|
2395
|
-
* Defines a call to the `
|
|
2102
|
+
* Defines a call to the `pause` function.
|
|
2396
2103
|
*
|
|
2397
2104
|
* Can be passed as a parameter to:
|
|
2398
2105
|
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
@@ -2412,13 +2119,8 @@ export namespace permit {
|
|
|
2412
2119
|
*
|
|
2413
2120
|
* const { result } = await client.sendCalls({
|
|
2414
2121
|
* calls: [
|
|
2415
|
-
* actions.token.
|
|
2416
|
-
*
|
|
2417
|
-
* spender: '0x20c0...babe',
|
|
2418
|
-
* value: 100n,
|
|
2419
|
-
* deadline: 1234567890n,
|
|
2420
|
-
* signature: { r: 0n, s: 0n, yParity: 0 },
|
|
2421
|
-
* token: '0x20c0...cafe',
|
|
2122
|
+
* actions.token.pause.call({
|
|
2123
|
+
* token: '0x20c0...babe',
|
|
2422
2124
|
* }),
|
|
2423
2125
|
* ]
|
|
2424
2126
|
* })
|
|
@@ -2428,29 +2130,12 @@ export namespace permit {
|
|
|
2428
2130
|
* @returns The call.
|
|
2429
2131
|
*/
|
|
2430
2132
|
export function call(args: Args) {
|
|
2431
|
-
const {
|
|
2432
|
-
owner,
|
|
2433
|
-
spender,
|
|
2434
|
-
value,
|
|
2435
|
-
deadline,
|
|
2436
|
-
signature,
|
|
2437
|
-
token = Addresses.defaultFeeToken,
|
|
2438
|
-
} = args
|
|
2439
|
-
const { r, s, yParity } = Signature.from(signature)
|
|
2440
|
-
const v = Signature.yParityToV(yParity)
|
|
2133
|
+
const { token } = args
|
|
2441
2134
|
return defineCall({
|
|
2442
2135
|
address: TokenId.toAddress(token),
|
|
2443
2136
|
abi: Abis.tip20,
|
|
2444
|
-
functionName: '
|
|
2445
|
-
args: [
|
|
2446
|
-
owner,
|
|
2447
|
-
spender,
|
|
2448
|
-
value,
|
|
2449
|
-
deadline,
|
|
2450
|
-
v,
|
|
2451
|
-
Hex.trimLeft(Hex.fromNumber(r!)),
|
|
2452
|
-
Hex.trimLeft(Hex.fromNumber(s!)),
|
|
2453
|
-
],
|
|
2137
|
+
functionName: 'pause',
|
|
2138
|
+
args: [],
|
|
2454
2139
|
})
|
|
2455
2140
|
}
|
|
2456
2141
|
|
|
@@ -2464,15 +2149,15 @@ export namespace permit {
|
|
|
2464
2149
|
const [log] = parseEventLogs({
|
|
2465
2150
|
abi: Abis.tip20,
|
|
2466
2151
|
logs,
|
|
2467
|
-
eventName: '
|
|
2152
|
+
eventName: 'PauseStateUpdate',
|
|
2468
2153
|
})
|
|
2469
|
-
if (!log) throw new Error('`
|
|
2154
|
+
if (!log) throw new Error('`PauseStateUpdate` event not found.')
|
|
2470
2155
|
return log
|
|
2471
2156
|
}
|
|
2472
2157
|
}
|
|
2473
2158
|
|
|
2474
2159
|
/**
|
|
2475
|
-
*
|
|
2160
|
+
* Pauses a TIP20 token.
|
|
2476
2161
|
*
|
|
2477
2162
|
* @example
|
|
2478
2163
|
* ```ts
|
|
@@ -2487,12 +2172,8 @@ export namespace permit {
|
|
|
2487
2172
|
* transport: http(),
|
|
2488
2173
|
* })
|
|
2489
2174
|
*
|
|
2490
|
-
* const result = await actions.token.
|
|
2491
|
-
*
|
|
2492
|
-
* spender: '0x...',
|
|
2493
|
-
* value: 100n,
|
|
2494
|
-
* deadline: 1234567890n,
|
|
2495
|
-
* signature: { r: 0n, s: 0n, yParity: 0 },
|
|
2175
|
+
* const result = await actions.token.pauseSync(client, {
|
|
2176
|
+
* token: '0x...',
|
|
2496
2177
|
* })
|
|
2497
2178
|
* ```
|
|
2498
2179
|
*
|
|
@@ -2500,40 +2181,43 @@ export namespace permit {
|
|
|
2500
2181
|
* @param parameters - Parameters.
|
|
2501
2182
|
* @returns The transaction receipt and event data.
|
|
2502
2183
|
*/
|
|
2503
|
-
export async function
|
|
2184
|
+
export async function pauseSync<
|
|
2504
2185
|
chain extends Chain | undefined,
|
|
2505
2186
|
account extends Account | undefined,
|
|
2506
2187
|
>(
|
|
2507
2188
|
client: Client<Transport, chain, account>,
|
|
2508
|
-
parameters:
|
|
2509
|
-
): Promise<
|
|
2189
|
+
parameters: pauseSync.Parameters<chain, account>,
|
|
2190
|
+
): Promise<pauseSync.ReturnValue> {
|
|
2510
2191
|
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
2511
|
-
const receipt = await
|
|
2192
|
+
const receipt = await pause.inner(writeContractSync, client, {
|
|
2512
2193
|
...rest,
|
|
2513
2194
|
throwOnReceiptRevert,
|
|
2514
2195
|
} as never)
|
|
2515
|
-
const { args } =
|
|
2196
|
+
const { args } = pause.extractEvent(receipt.logs)
|
|
2516
2197
|
return {
|
|
2517
2198
|
...args,
|
|
2518
2199
|
receipt,
|
|
2519
|
-
}
|
|
2200
|
+
}
|
|
2520
2201
|
}
|
|
2521
2202
|
|
|
2522
|
-
export namespace
|
|
2203
|
+
export namespace pauseSync {
|
|
2523
2204
|
export type Parameters<
|
|
2524
2205
|
chain extends Chain | undefined = Chain | undefined,
|
|
2525
2206
|
account extends Account | undefined = Account | undefined,
|
|
2526
|
-
> =
|
|
2207
|
+
> = pause.Parameters<chain, account>
|
|
2527
2208
|
|
|
2528
|
-
export type Args =
|
|
2209
|
+
export type Args = pause.Args
|
|
2529
2210
|
|
|
2530
2211
|
export type ReturnValue = GetEventArgs<
|
|
2531
2212
|
typeof Abis.tip20,
|
|
2532
|
-
'
|
|
2213
|
+
'PauseStateUpdate',
|
|
2533
2214
|
{ IndexedOnly: false; Required: true }
|
|
2534
2215
|
> & {
|
|
2535
2216
|
receipt: TransactionReceipt
|
|
2536
2217
|
}
|
|
2218
|
+
|
|
2219
|
+
// TODO: exhaustive error type
|
|
2220
|
+
export type ErrorType = BaseErrorType
|
|
2537
2221
|
}
|
|
2538
2222
|
|
|
2539
2223
|
/**
|
|
@@ -2591,6 +2275,9 @@ export namespace renounceRoles {
|
|
|
2591
2275
|
|
|
2592
2276
|
export type ReturnValue = WriteContractReturnType
|
|
2593
2277
|
|
|
2278
|
+
// TODO: exhaustive error type
|
|
2279
|
+
export type ErrorType = BaseErrorType
|
|
2280
|
+
|
|
2594
2281
|
/** @internal */
|
|
2595
2282
|
export async function inner<
|
|
2596
2283
|
action extends typeof sendTransaction | typeof sendTransactionSync,
|
|
@@ -2736,6 +2423,9 @@ export namespace renounceRolesSync {
|
|
|
2736
2423
|
{ IndexedOnly: false; Required: true }
|
|
2737
2424
|
>[]
|
|
2738
2425
|
}
|
|
2426
|
+
|
|
2427
|
+
// TODO: exhaustive error type
|
|
2428
|
+
export type ErrorType = BaseErrorType
|
|
2739
2429
|
}
|
|
2740
2430
|
|
|
2741
2431
|
/**
|
|
@@ -2796,6 +2486,9 @@ export namespace revokeRoles {
|
|
|
2796
2486
|
|
|
2797
2487
|
export type ReturnValue = WriteContractReturnType
|
|
2798
2488
|
|
|
2489
|
+
// TODO: exhaustive error type
|
|
2490
|
+
export type ErrorType = BaseErrorType
|
|
2491
|
+
|
|
2799
2492
|
/** @internal */
|
|
2800
2493
|
export async function inner<
|
|
2801
2494
|
action extends typeof sendTransaction | typeof sendTransactionSync,
|
|
@@ -2943,6 +2636,9 @@ export namespace revokeRolesSync {
|
|
|
2943
2636
|
{ IndexedOnly: false; Required: true }
|
|
2944
2637
|
>[]
|
|
2945
2638
|
}
|
|
2639
|
+
|
|
2640
|
+
// TODO: exhaustive error type
|
|
2641
|
+
export type ErrorType = BaseErrorType
|
|
2946
2642
|
}
|
|
2947
2643
|
|
|
2948
2644
|
/**
|
|
@@ -2996,6 +2692,9 @@ export namespace setSupplyCap {
|
|
|
2996
2692
|
|
|
2997
2693
|
export type ReturnValue = WriteContractReturnType
|
|
2998
2694
|
|
|
2695
|
+
// TODO: exhaustive error type
|
|
2696
|
+
export type ErrorType = BaseErrorType
|
|
2697
|
+
|
|
2999
2698
|
/** @internal */
|
|
3000
2699
|
export async function inner<
|
|
3001
2700
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -3133,6 +2832,9 @@ export namespace setSupplyCapSync {
|
|
|
3133
2832
|
> & {
|
|
3134
2833
|
receipt: TransactionReceipt
|
|
3135
2834
|
}
|
|
2835
|
+
|
|
2836
|
+
// TODO: exhaustive error type
|
|
2837
|
+
export type ErrorType = BaseErrorType
|
|
3136
2838
|
}
|
|
3137
2839
|
|
|
3138
2840
|
/**
|
|
@@ -3189,6 +2891,9 @@ export namespace setRoleAdmin {
|
|
|
3189
2891
|
|
|
3190
2892
|
export type ReturnValue = WriteContractReturnType
|
|
3191
2893
|
|
|
2894
|
+
// TODO: exhaustive error type
|
|
2895
|
+
export type ErrorType = BaseErrorType
|
|
2896
|
+
|
|
3192
2897
|
/** @internal */
|
|
3193
2898
|
export async function inner<
|
|
3194
2899
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -3330,6 +3035,9 @@ export namespace setRoleAdminSync {
|
|
|
3330
3035
|
> & {
|
|
3331
3036
|
receipt: TransactionReceipt
|
|
3332
3037
|
}
|
|
3038
|
+
|
|
3039
|
+
// TODO: exhaustive error type
|
|
3040
|
+
export type ErrorType = BaseErrorType
|
|
3333
3041
|
}
|
|
3334
3042
|
|
|
3335
3043
|
/**
|
|
@@ -3381,14 +3089,17 @@ export namespace transfer {
|
|
|
3381
3089
|
from?: Address | undefined
|
|
3382
3090
|
/** Memo to include in the transfer. */
|
|
3383
3091
|
memo?: Hex.Hex | undefined
|
|
3384
|
-
/** Address or ID of the TIP20 token.
|
|
3385
|
-
token
|
|
3092
|
+
/** Address or ID of the TIP20 token. */
|
|
3093
|
+
token: TokenId.TokenIdOrAddress
|
|
3386
3094
|
/** Address to transfer tokens to. */
|
|
3387
3095
|
to: Address
|
|
3388
3096
|
}
|
|
3389
3097
|
|
|
3390
3098
|
export type ReturnValue = WriteContractReturnType
|
|
3391
3099
|
|
|
3100
|
+
// TODO: exhaustive error type
|
|
3101
|
+
export type ErrorType = BaseErrorType
|
|
3102
|
+
|
|
3392
3103
|
/** @internal */
|
|
3393
3104
|
export async function inner<
|
|
3394
3105
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -3441,7 +3152,7 @@ export namespace transfer {
|
|
|
3441
3152
|
* @returns The call.
|
|
3442
3153
|
*/
|
|
3443
3154
|
export function call(args: Args) {
|
|
3444
|
-
const { amount, from, memo, token
|
|
3155
|
+
const { amount, from, memo, token, to } = args
|
|
3445
3156
|
const callArgs = (() => {
|
|
3446
3157
|
if (memo && from)
|
|
3447
3158
|
return {
|
|
@@ -3547,6 +3258,9 @@ export namespace transferSync {
|
|
|
3547
3258
|
> & {
|
|
3548
3259
|
receipt: TransactionReceipt
|
|
3549
3260
|
}
|
|
3261
|
+
|
|
3262
|
+
// TODO: exhaustive error type
|
|
3263
|
+
export type ErrorType = BaseErrorType
|
|
3550
3264
|
}
|
|
3551
3265
|
|
|
3552
3266
|
/**
|
|
@@ -3597,6 +3311,9 @@ export namespace unpause {
|
|
|
3597
3311
|
|
|
3598
3312
|
export type ReturnValue = WriteContractReturnType
|
|
3599
3313
|
|
|
3314
|
+
// TODO: exhaustive error type
|
|
3315
|
+
export type ErrorType = BaseErrorType
|
|
3316
|
+
|
|
3600
3317
|
/** @internal */
|
|
3601
3318
|
export async function inner<
|
|
3602
3319
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -3732,6 +3449,9 @@ export namespace unpauseSync {
|
|
|
3732
3449
|
> & {
|
|
3733
3450
|
receipt: TransactionReceipt
|
|
3734
3451
|
}
|
|
3452
|
+
|
|
3453
|
+
// TODO: exhaustive error type
|
|
3454
|
+
export type ErrorType = BaseErrorType
|
|
3735
3455
|
}
|
|
3736
3456
|
|
|
3737
3457
|
/**
|
|
@@ -3750,7 +3470,138 @@ export namespace unpauseSync {
|
|
|
3750
3470
|
* transport: http(),
|
|
3751
3471
|
* })
|
|
3752
3472
|
*
|
|
3753
|
-
* const result = await actions.token.
|
|
3473
|
+
* const result = await actions.token.prepareUpdateQuoteToken(client, {
|
|
3474
|
+
* token: '0x...',
|
|
3475
|
+
* quoteToken: '0x...',
|
|
3476
|
+
* })
|
|
3477
|
+
* ```
|
|
3478
|
+
*
|
|
3479
|
+
* @param client - Client.
|
|
3480
|
+
* @param parameters - Parameters.
|
|
3481
|
+
* @returns The transaction hash.
|
|
3482
|
+
*/
|
|
3483
|
+
export async function prepareUpdateQuoteToken<
|
|
3484
|
+
chain extends Chain | undefined,
|
|
3485
|
+
account extends Account | undefined,
|
|
3486
|
+
>(
|
|
3487
|
+
client: Client<Transport, chain, account>,
|
|
3488
|
+
parameters: prepareUpdateQuoteToken.Parameters<chain, account>,
|
|
3489
|
+
): Promise<prepareUpdateQuoteToken.ReturnValue> {
|
|
3490
|
+
return prepareUpdateQuoteToken.inner(writeContract, client, parameters)
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
export namespace prepareUpdateQuoteToken {
|
|
3494
|
+
export type Parameters<
|
|
3495
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
3496
|
+
account extends Account | undefined = Account | undefined,
|
|
3497
|
+
> = WriteParameters<chain, account> & Args
|
|
3498
|
+
|
|
3499
|
+
export type Args = {
|
|
3500
|
+
/** New quote token address. */
|
|
3501
|
+
quoteToken: TokenId.TokenIdOrAddress
|
|
3502
|
+
/** Address or ID of the TIP20 token. */
|
|
3503
|
+
token: TokenId.TokenIdOrAddress
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
export type ReturnValue = WriteContractReturnType
|
|
3507
|
+
|
|
3508
|
+
// TODO: exhaustive error type
|
|
3509
|
+
export type ErrorType = BaseErrorType
|
|
3510
|
+
|
|
3511
|
+
/** @internal */
|
|
3512
|
+
export async function inner<
|
|
3513
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
3514
|
+
chain extends Chain | undefined,
|
|
3515
|
+
account extends Account | undefined,
|
|
3516
|
+
>(
|
|
3517
|
+
action: action,
|
|
3518
|
+
client: Client<Transport, chain, account>,
|
|
3519
|
+
parameters: prepareUpdateQuoteToken.Parameters<chain, account>,
|
|
3520
|
+
): Promise<ReturnType<action>> {
|
|
3521
|
+
const { quoteToken, token, ...rest } = parameters
|
|
3522
|
+
const call = prepareUpdateQuoteToken.call({ quoteToken, token })
|
|
3523
|
+
return (await action(client, {
|
|
3524
|
+
...rest,
|
|
3525
|
+
...call,
|
|
3526
|
+
} as never)) as never
|
|
3527
|
+
}
|
|
3528
|
+
|
|
3529
|
+
/**
|
|
3530
|
+
* Defines a call to the `prepareUpdateQuoteToken` function.
|
|
3531
|
+
*
|
|
3532
|
+
* Can be passed as a parameter to:
|
|
3533
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
3534
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
3535
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
3536
|
+
*
|
|
3537
|
+
* @example
|
|
3538
|
+
* ```ts
|
|
3539
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
3540
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3541
|
+
* import * as actions from 'tempo.ts/viem/actions'
|
|
3542
|
+
*
|
|
3543
|
+
* const client = createClient({
|
|
3544
|
+
* chain: tempo,
|
|
3545
|
+
* transport: http(),
|
|
3546
|
+
* }).extend(walletActions)
|
|
3547
|
+
*
|
|
3548
|
+
* const { result } = await client.sendCalls({
|
|
3549
|
+
* calls: [
|
|
3550
|
+
* actions.token.prepareUpdateQuoteToken.call({
|
|
3551
|
+
* token: '0x20c0...babe',
|
|
3552
|
+
* quoteToken: '0x20c0...cafe',
|
|
3553
|
+
* }),
|
|
3554
|
+
* ]
|
|
3555
|
+
* })
|
|
3556
|
+
* ```
|
|
3557
|
+
*
|
|
3558
|
+
* @param args - Arguments.
|
|
3559
|
+
* @returns The call.
|
|
3560
|
+
*/
|
|
3561
|
+
export function call(args: Args) {
|
|
3562
|
+
const { token, quoteToken } = args
|
|
3563
|
+
return defineCall({
|
|
3564
|
+
address: TokenId.toAddress(token),
|
|
3565
|
+
abi: Abis.tip20,
|
|
3566
|
+
functionName: 'setNextQuoteToken',
|
|
3567
|
+
args: [TokenId.toAddress(quoteToken)],
|
|
3568
|
+
})
|
|
3569
|
+
}
|
|
3570
|
+
|
|
3571
|
+
/**
|
|
3572
|
+
* Extracts the event from the logs.
|
|
3573
|
+
*
|
|
3574
|
+
* @param logs - Logs.
|
|
3575
|
+
* @returns The event.
|
|
3576
|
+
*/
|
|
3577
|
+
export function extractEvent(logs: Log[]) {
|
|
3578
|
+
const [log] = parseEventLogs({
|
|
3579
|
+
abi: Abis.tip20,
|
|
3580
|
+
logs,
|
|
3581
|
+
eventName: 'NextQuoteTokenSet',
|
|
3582
|
+
})
|
|
3583
|
+
if (!log) throw new Error('`NextQuoteTokenSet` event not found.')
|
|
3584
|
+
return log
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
/**
|
|
3589
|
+
* Updates the quote token for a TIP20 token.
|
|
3590
|
+
*
|
|
3591
|
+
* @example
|
|
3592
|
+
* ```ts
|
|
3593
|
+
* import { createClient, http } from 'viem'
|
|
3594
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3595
|
+
* import * as actions from 'tempo.ts/viem/actions'
|
|
3596
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3597
|
+
*
|
|
3598
|
+
* const client = createClient({
|
|
3599
|
+
* account: privateKeyToAccount('0x...'),
|
|
3600
|
+
* chain: tempo,
|
|
3601
|
+
* transport: http(),
|
|
3602
|
+
* })
|
|
3603
|
+
*
|
|
3604
|
+
* const result = await actions.token.prepareUpdateQuoteTokenSync(client, {
|
|
3754
3605
|
* token: '0x...',
|
|
3755
3606
|
* quoteToken: '0x...',
|
|
3756
3607
|
* })
|
|
@@ -3758,6 +3609,75 @@ export namespace unpauseSync {
|
|
|
3758
3609
|
*
|
|
3759
3610
|
* @param client - Client.
|
|
3760
3611
|
* @param parameters - Parameters.
|
|
3612
|
+
* @returns The transaction receipt and event data.
|
|
3613
|
+
*/
|
|
3614
|
+
export async function prepareUpdateQuoteTokenSync<
|
|
3615
|
+
chain extends Chain | undefined,
|
|
3616
|
+
account extends Account | undefined,
|
|
3617
|
+
>(
|
|
3618
|
+
client: Client<Transport, chain, account>,
|
|
3619
|
+
parameters: prepareUpdateQuoteTokenSync.Parameters<chain, account>,
|
|
3620
|
+
): Promise<prepareUpdateQuoteTokenSync.ReturnValue> {
|
|
3621
|
+
const receipt = await prepareUpdateQuoteToken.inner(
|
|
3622
|
+
writeContractSync,
|
|
3623
|
+
client,
|
|
3624
|
+
parameters,
|
|
3625
|
+
)
|
|
3626
|
+
const { args } = prepareUpdateQuoteToken.extractEvent(receipt.logs)
|
|
3627
|
+
return {
|
|
3628
|
+
...args,
|
|
3629
|
+
receipt,
|
|
3630
|
+
} as never
|
|
3631
|
+
}
|
|
3632
|
+
|
|
3633
|
+
export namespace prepareUpdateQuoteTokenSync {
|
|
3634
|
+
export type Parameters<
|
|
3635
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
3636
|
+
account extends Account | undefined = Account | undefined,
|
|
3637
|
+
> = prepareUpdateQuoteToken.Parameters<chain, account>
|
|
3638
|
+
|
|
3639
|
+
export type Args = prepareUpdateQuoteToken.Args
|
|
3640
|
+
|
|
3641
|
+
export type ReturnValue = Compute<
|
|
3642
|
+
GetEventArgs<
|
|
3643
|
+
typeof Abis.tip20,
|
|
3644
|
+
'NextQuoteTokenSet',
|
|
3645
|
+
{
|
|
3646
|
+
IndexedOnly: false
|
|
3647
|
+
Required: true
|
|
3648
|
+
}
|
|
3649
|
+
> & {
|
|
3650
|
+
receipt: TransactionReceipt
|
|
3651
|
+
}
|
|
3652
|
+
>
|
|
3653
|
+
|
|
3654
|
+
// TODO: exhaustive error type
|
|
3655
|
+
export type ErrorType = BaseErrorType
|
|
3656
|
+
}
|
|
3657
|
+
|
|
3658
|
+
/**
|
|
3659
|
+
* Updates the quote token for a TIP20 token.
|
|
3660
|
+
*
|
|
3661
|
+
* @example
|
|
3662
|
+
* ```ts
|
|
3663
|
+
* import { createClient, http } from 'viem'
|
|
3664
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3665
|
+
* import * as actions from 'tempo.ts/viem/actions'
|
|
3666
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3667
|
+
*
|
|
3668
|
+
* const client = createClient({
|
|
3669
|
+
* account: privateKeyToAccount('0x...'),
|
|
3670
|
+
* chain: tempo,
|
|
3671
|
+
* transport: http(),
|
|
3672
|
+
* })
|
|
3673
|
+
*
|
|
3674
|
+
* const result = await actions.token.updateQuoteToken(client, {
|
|
3675
|
+
* token: '0x...',
|
|
3676
|
+
* })
|
|
3677
|
+
* ```
|
|
3678
|
+
*
|
|
3679
|
+
* @param client - Client.
|
|
3680
|
+
* @param parameters - Parameters.
|
|
3761
3681
|
* @returns The transaction hash.
|
|
3762
3682
|
*/
|
|
3763
3683
|
export async function updateQuoteToken<
|
|
@@ -3777,14 +3697,15 @@ export namespace updateQuoteToken {
|
|
|
3777
3697
|
> = WriteParameters<chain, account> & Args
|
|
3778
3698
|
|
|
3779
3699
|
export type Args = {
|
|
3780
|
-
/** New quote token address. */
|
|
3781
|
-
quoteToken: TokenId.TokenIdOrAddress
|
|
3782
3700
|
/** Address or ID of the TIP20 token. */
|
|
3783
3701
|
token: TokenId.TokenIdOrAddress
|
|
3784
3702
|
}
|
|
3785
3703
|
|
|
3786
3704
|
export type ReturnValue = WriteContractReturnType
|
|
3787
3705
|
|
|
3706
|
+
// TODO: exhaustive error type
|
|
3707
|
+
export type ErrorType = BaseErrorType
|
|
3708
|
+
|
|
3788
3709
|
/** @internal */
|
|
3789
3710
|
export async function inner<
|
|
3790
3711
|
action extends typeof writeContract | typeof writeContractSync,
|
|
@@ -3795,8 +3716,8 @@ export namespace updateQuoteToken {
|
|
|
3795
3716
|
client: Client<Transport, chain, account>,
|
|
3796
3717
|
parameters: updateQuoteToken.Parameters<chain, account>,
|
|
3797
3718
|
): Promise<ReturnType<action>> {
|
|
3798
|
-
const {
|
|
3799
|
-
const call = updateQuoteToken.call({
|
|
3719
|
+
const { token, ...rest } = parameters
|
|
3720
|
+
const call = updateQuoteToken.call({ token })
|
|
3800
3721
|
return (await action(client, {
|
|
3801
3722
|
...rest,
|
|
3802
3723
|
...call,
|
|
@@ -3826,7 +3747,6 @@ export namespace updateQuoteToken {
|
|
|
3826
3747
|
* calls: [
|
|
3827
3748
|
* actions.token.updateQuoteToken.call({
|
|
3828
3749
|
* token: '0x20c0...babe',
|
|
3829
|
-
* quoteToken: '0x20c0...cafe',
|
|
3830
3750
|
* }),
|
|
3831
3751
|
* ]
|
|
3832
3752
|
* })
|
|
@@ -3836,12 +3756,12 @@ export namespace updateQuoteToken {
|
|
|
3836
3756
|
* @returns The call.
|
|
3837
3757
|
*/
|
|
3838
3758
|
export function call(args: Args) {
|
|
3839
|
-
const { token
|
|
3759
|
+
const { token } = args
|
|
3840
3760
|
return defineCall({
|
|
3841
3761
|
address: TokenId.toAddress(token),
|
|
3842
3762
|
abi: Abis.tip20,
|
|
3843
|
-
functionName: '
|
|
3844
|
-
args: [
|
|
3763
|
+
functionName: 'completeQuoteTokenUpdate',
|
|
3764
|
+
args: [],
|
|
3845
3765
|
})
|
|
3846
3766
|
}
|
|
3847
3767
|
|
|
@@ -3855,9 +3775,9 @@ export namespace updateQuoteToken {
|
|
|
3855
3775
|
const [log] = parseEventLogs({
|
|
3856
3776
|
abi: Abis.tip20,
|
|
3857
3777
|
logs,
|
|
3858
|
-
eventName: '
|
|
3778
|
+
eventName: 'QuoteTokenUpdate',
|
|
3859
3779
|
})
|
|
3860
|
-
if (!log) throw new Error('`
|
|
3780
|
+
if (!log) throw new Error('`QuoteTokenUpdateCompleted` event not found.')
|
|
3861
3781
|
return log
|
|
3862
3782
|
}
|
|
3863
3783
|
}
|
|
@@ -3880,7 +3800,6 @@ export namespace updateQuoteToken {
|
|
|
3880
3800
|
*
|
|
3881
3801
|
* const result = await actions.token.updateQuoteTokenSync(client, {
|
|
3882
3802
|
* token: '0x...',
|
|
3883
|
-
* quoteToken: '0x...',
|
|
3884
3803
|
* })
|
|
3885
3804
|
* ```
|
|
3886
3805
|
*
|
|
@@ -3918,7 +3837,7 @@ export namespace updateQuoteTokenSync {
|
|
|
3918
3837
|
export type ReturnValue = Compute<
|
|
3919
3838
|
GetEventArgs<
|
|
3920
3839
|
typeof Abis.tip20,
|
|
3921
|
-
'
|
|
3840
|
+
'QuoteTokenUpdate',
|
|
3922
3841
|
{
|
|
3923
3842
|
IndexedOnly: false
|
|
3924
3843
|
Required: true
|
|
@@ -3927,6 +3846,9 @@ export namespace updateQuoteTokenSync {
|
|
|
3927
3846
|
receipt: TransactionReceipt
|
|
3928
3847
|
}
|
|
3929
3848
|
>
|
|
3849
|
+
|
|
3850
|
+
// TODO: exhaustive error type
|
|
3851
|
+
export type ErrorType = BaseErrorType
|
|
3930
3852
|
}
|
|
3931
3853
|
|
|
3932
3854
|
/**
|
|
@@ -3961,7 +3883,7 @@ export function watchApprove<
|
|
|
3961
3883
|
client: Client<Transport, chain, account>,
|
|
3962
3884
|
parameters: watchApprove.Parameters,
|
|
3963
3885
|
) {
|
|
3964
|
-
const { onApproval, token
|
|
3886
|
+
const { onApproval, token, ...rest } = parameters
|
|
3965
3887
|
return watchContractEvent(client, {
|
|
3966
3888
|
...rest,
|
|
3967
3889
|
address: TokenId.toAddress(token),
|
|
@@ -3995,8 +3917,8 @@ export declare namespace watchApprove {
|
|
|
3995
3917
|
> & {
|
|
3996
3918
|
/** Callback to invoke when tokens are approved. */
|
|
3997
3919
|
onApproval: (args: Args, log: Log) => void
|
|
3998
|
-
/** Address or ID of the TIP20 token.
|
|
3999
|
-
token
|
|
3920
|
+
/** Address or ID of the TIP20 token. */
|
|
3921
|
+
token: TokenId.TokenIdOrAddress
|
|
4000
3922
|
}
|
|
4001
3923
|
}
|
|
4002
3924
|
|
|
@@ -4029,7 +3951,7 @@ export function watchBurn<
|
|
|
4029
3951
|
chain extends Chain | undefined,
|
|
4030
3952
|
account extends Account | undefined,
|
|
4031
3953
|
>(client: Client<Transport, chain, account>, parameters: watchBurn.Parameters) {
|
|
4032
|
-
const { onBurn, token
|
|
3954
|
+
const { onBurn, token, ...rest } = parameters
|
|
4033
3955
|
return watchContractEvent(client, {
|
|
4034
3956
|
...rest,
|
|
4035
3957
|
address: TokenId.toAddress(token),
|
|
@@ -4063,8 +3985,8 @@ export declare namespace watchBurn {
|
|
|
4063
3985
|
> & {
|
|
4064
3986
|
/** Callback to invoke when tokens are burned. */
|
|
4065
3987
|
onBurn: (args: Args, log: Log) => void
|
|
4066
|
-
/** Address or ID of the TIP20 token.
|
|
4067
|
-
token
|
|
3988
|
+
/** Address or ID of the TIP20 token. */
|
|
3989
|
+
token: TokenId.TokenIdOrAddress
|
|
4068
3990
|
}
|
|
4069
3991
|
}
|
|
4070
3992
|
|
|
@@ -4170,7 +4092,7 @@ export function watchMint<
|
|
|
4170
4092
|
chain extends Chain | undefined,
|
|
4171
4093
|
account extends Account | undefined,
|
|
4172
4094
|
>(client: Client<Transport, chain, account>, parameters: watchMint.Parameters) {
|
|
4173
|
-
const { onMint, token
|
|
4095
|
+
const { onMint, token, ...rest } = parameters
|
|
4174
4096
|
return watchContractEvent(client, {
|
|
4175
4097
|
...rest,
|
|
4176
4098
|
address: TokenId.toAddress(token),
|
|
@@ -4204,9 +4126,11 @@ export declare namespace watchMint {
|
|
|
4204
4126
|
> & {
|
|
4205
4127
|
/** Callback to invoke when tokens are minted. */
|
|
4206
4128
|
onMint: (args: Args, log: Log) => void
|
|
4207
|
-
/** Address or ID of the TIP20 token.
|
|
4208
|
-
token
|
|
4129
|
+
/** Address or ID of the TIP20 token. */
|
|
4130
|
+
token: TokenId.TokenIdOrAddress
|
|
4209
4131
|
}
|
|
4132
|
+
|
|
4133
|
+
export type ReturnValue = WatchContractEventReturnType
|
|
4210
4134
|
}
|
|
4211
4135
|
|
|
4212
4136
|
/**
|
|
@@ -4241,11 +4165,7 @@ export function watchAdminRole<
|
|
|
4241
4165
|
client: Client<Transport, chain, account>,
|
|
4242
4166
|
parameters: watchAdminRole.Parameters,
|
|
4243
4167
|
) {
|
|
4244
|
-
const {
|
|
4245
|
-
onRoleAdminUpdated,
|
|
4246
|
-
token = Addresses.defaultFeeToken,
|
|
4247
|
-
...rest
|
|
4248
|
-
} = parameters
|
|
4168
|
+
const { onRoleAdminUpdated, token, ...rest } = parameters
|
|
4249
4169
|
return watchContractEvent(client, {
|
|
4250
4170
|
...rest,
|
|
4251
4171
|
address: TokenId.toAddress(token),
|
|
@@ -4279,8 +4199,8 @@ export declare namespace watchAdminRole {
|
|
|
4279
4199
|
> & {
|
|
4280
4200
|
/** Callback to invoke when a role admin is updated. */
|
|
4281
4201
|
onRoleAdminUpdated: (args: Args, log: Log) => void
|
|
4282
|
-
/** Address or ID of the TIP20 token.
|
|
4283
|
-
token
|
|
4202
|
+
/** Address or ID of the TIP20 token. */
|
|
4203
|
+
token: TokenId.TokenIdOrAddress
|
|
4284
4204
|
}
|
|
4285
4205
|
}
|
|
4286
4206
|
|
|
@@ -4313,11 +4233,7 @@ export function watchRole<
|
|
|
4313
4233
|
chain extends Chain | undefined,
|
|
4314
4234
|
account extends Account | undefined,
|
|
4315
4235
|
>(client: Client<Transport, chain, account>, parameters: watchRole.Parameters) {
|
|
4316
|
-
const {
|
|
4317
|
-
onRoleUpdated,
|
|
4318
|
-
token = Addresses.defaultFeeToken,
|
|
4319
|
-
...rest
|
|
4320
|
-
} = parameters
|
|
4236
|
+
const { onRoleUpdated, token, ...rest } = parameters
|
|
4321
4237
|
return watchContractEvent(client, {
|
|
4322
4238
|
...rest,
|
|
4323
4239
|
address: TokenId.toAddress(token),
|
|
@@ -4361,8 +4277,8 @@ export declare namespace watchRole {
|
|
|
4361
4277
|
> & {
|
|
4362
4278
|
/** Callback to invoke when a role membership is updated. */
|
|
4363
4279
|
onRoleUpdated: (args: Args, log: Log) => void
|
|
4364
|
-
/** Address or ID of the TIP20 token.
|
|
4365
|
-
token
|
|
4280
|
+
/** Address or ID of the TIP20 token. */
|
|
4281
|
+
token: TokenId.TokenIdOrAddress
|
|
4366
4282
|
}
|
|
4367
4283
|
}
|
|
4368
4284
|
|
|
@@ -4399,7 +4315,7 @@ export function watchTransfer<
|
|
|
4399
4315
|
client: Client<Transport, chain, account>,
|
|
4400
4316
|
parameters: watchTransfer.Parameters,
|
|
4401
4317
|
) {
|
|
4402
|
-
const { onTransfer, token
|
|
4318
|
+
const { onTransfer, token, ...rest } = parameters
|
|
4403
4319
|
return watchContractEvent(client, {
|
|
4404
4320
|
...rest,
|
|
4405
4321
|
address: TokenId.toAddress(token),
|
|
@@ -4433,8 +4349,8 @@ export declare namespace watchTransfer {
|
|
|
4433
4349
|
> & {
|
|
4434
4350
|
/** Callback to invoke when tokens are transferred. */
|
|
4435
4351
|
onTransfer: (args: Args, log: Log) => void
|
|
4436
|
-
/** Address or ID of the TIP20 token.
|
|
4437
|
-
token
|
|
4352
|
+
/** Address or ID of the TIP20 token. */
|
|
4353
|
+
token: TokenId.TokenIdOrAddress
|
|
4438
4354
|
}
|
|
4439
4355
|
}
|
|
4440
4356
|
|
|
@@ -4454,8 +4370,8 @@ export declare namespace watchTransfer {
|
|
|
4454
4370
|
*
|
|
4455
4371
|
* const unwatch = actions.token.watchUpdateQuoteToken(client, {
|
|
4456
4372
|
* onUpdateQuoteToken: (args, log) => {
|
|
4457
|
-
* if (args.
|
|
4458
|
-
* console.log('quote token update
|
|
4373
|
+
* if (args.completed)
|
|
4374
|
+
* console.log('quote token update completed:', args.newQuoteToken)
|
|
4459
4375
|
* else
|
|
4460
4376
|
* console.log('quote token update proposed:', args.newQuoteToken)
|
|
4461
4377
|
* },
|
|
@@ -4473,11 +4389,7 @@ export function watchUpdateQuoteToken<
|
|
|
4473
4389
|
client: Client<Transport, chain, account>,
|
|
4474
4390
|
parameters: watchUpdateQuoteToken.Parameters,
|
|
4475
4391
|
) {
|
|
4476
|
-
const {
|
|
4477
|
-
onUpdateQuoteToken,
|
|
4478
|
-
token = Addresses.defaultFeeToken,
|
|
4479
|
-
...rest
|
|
4480
|
-
} = parameters
|
|
4392
|
+
const { onUpdateQuoteToken, token, ...rest } = parameters
|
|
4481
4393
|
const address = TokenId.toAddress(token)
|
|
4482
4394
|
|
|
4483
4395
|
return watchContractEvent(client, {
|
|
@@ -4491,22 +4403,22 @@ export function watchUpdateQuoteToken<
|
|
|
4491
4403
|
false,
|
|
4492
4404
|
ExtractAbiItem<
|
|
4493
4405
|
typeof Abis.tip20,
|
|
4494
|
-
'
|
|
4406
|
+
'NextQuoteTokenSet' | 'QuoteTokenUpdate'
|
|
4495
4407
|
>,
|
|
4496
4408
|
true
|
|
4497
4409
|
>[],
|
|
4498
4410
|
) => {
|
|
4499
4411
|
for (const log of logs) {
|
|
4500
4412
|
if (
|
|
4501
|
-
log.eventName !== '
|
|
4502
|
-
log.eventName !== '
|
|
4413
|
+
log.eventName !== 'NextQuoteTokenSet' &&
|
|
4414
|
+
log.eventName !== 'QuoteTokenUpdate'
|
|
4503
4415
|
)
|
|
4504
4416
|
continue
|
|
4505
4417
|
|
|
4506
4418
|
onUpdateQuoteToken(
|
|
4507
4419
|
{
|
|
4508
4420
|
...log.args,
|
|
4509
|
-
|
|
4421
|
+
completed: log.eventName === 'QuoteTokenUpdate',
|
|
4510
4422
|
},
|
|
4511
4423
|
log,
|
|
4512
4424
|
)
|
|
@@ -4520,17 +4432,17 @@ export declare namespace watchUpdateQuoteToken {
|
|
|
4520
4432
|
export type Args = OneOf<
|
|
4521
4433
|
| GetEventArgs<
|
|
4522
4434
|
typeof Abis.tip20,
|
|
4523
|
-
'
|
|
4435
|
+
'NextQuoteTokenSet',
|
|
4524
4436
|
{ IndexedOnly: false; Required: true }
|
|
4525
4437
|
>
|
|
4526
4438
|
| GetEventArgs<
|
|
4527
4439
|
typeof Abis.tip20,
|
|
4528
|
-
'
|
|
4440
|
+
'QuoteTokenUpdate',
|
|
4529
4441
|
{ IndexedOnly: false; Required: true }
|
|
4530
4442
|
>
|
|
4531
4443
|
> & {
|
|
4532
|
-
/** Whether the update has been
|
|
4533
|
-
|
|
4444
|
+
/** Whether the update has been completed. */
|
|
4445
|
+
completed: boolean
|
|
4534
4446
|
}
|
|
4535
4447
|
|
|
4536
4448
|
export type Log = viem_Log
|
|
@@ -4539,9 +4451,9 @@ export declare namespace watchUpdateQuoteToken {
|
|
|
4539
4451
|
WatchContractEventParameters<typeof Abis.tip20, any, true>,
|
|
4540
4452
|
'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'
|
|
4541
4453
|
> & {
|
|
4542
|
-
/** Callback to invoke when a quote token update is proposed or
|
|
4454
|
+
/** Callback to invoke when a quote token update is proposed or completed. */
|
|
4543
4455
|
onUpdateQuoteToken: (args: Args, log: Log) => void
|
|
4544
|
-
/** Address or ID of the TIP20 token.
|
|
4545
|
-
token
|
|
4456
|
+
/** Address or ID of the TIP20 token. */
|
|
4457
|
+
token: TokenId.TokenIdOrAddress
|
|
4546
4458
|
}
|
|
4547
4459
|
}
|