viem 2.50.4 → 2.51.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/CHANGELOG.md +22 -0
- package/_cjs/actions/index.js +5 -3
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/public/createAccessList.js +3 -0
- package/_cjs/actions/public/createAccessList.js.map +1 -1
- package/_cjs/actions/public/getBlockReceipts.js +19 -0
- package/_cjs/actions/public/getBlockReceipts.js.map +1 -0
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/chains/definitions/somnia.js +7 -0
- package/_cjs/chains/definitions/somnia.js.map +1 -1
- package/_cjs/chains/definitions/somniaTestnet.js +3 -2
- package/_cjs/chains/definitions/somniaTestnet.js.map +1 -1
- package/_cjs/clients/decorators/public.js +2 -0
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/op-stack/actions/buildProveWithdrawal.js +10 -2
- package/_cjs/op-stack/actions/buildProveWithdrawal.js.map +1 -1
- package/_cjs/op-stack/actions/getGame.js.map +1 -1
- package/_cjs/op-stack/actions/getGames.js +3 -1
- package/_cjs/op-stack/actions/getGames.js.map +1 -1
- package/_cjs/op-stack/actions/getTimeToProve.js +3 -3
- package/_cjs/op-stack/actions/getTimeToProve.js.map +1 -1
- package/_cjs/op-stack/actions/getWithdrawalStatus.js +1 -1
- package/_cjs/op-stack/actions/getWithdrawalStatus.js.map +1 -1
- package/_cjs/op-stack/actions/waitToProve.js +4 -3
- package/_cjs/op-stack/actions/waitToProve.js.map +1 -1
- package/_cjs/op-stack/gameTypes.js +9 -0
- package/_cjs/op-stack/gameTypes.js.map +1 -0
- package/_cjs/op-stack/index.js +7 -1
- package/_cjs/op-stack/index.js.map +1 -1
- package/_cjs/op-stack/utils/getL2BlockNumberAtTimestamp.js +29 -0
- package/_cjs/op-stack/utils/getL2BlockNumberAtTimestamp.js.map +1 -0
- package/_cjs/tempo/Abis.js +477 -11
- package/_cjs/tempo/Abis.js.map +1 -1
- package/_cjs/tempo/Account.js +27 -1
- package/_cjs/tempo/Account.js.map +1 -1
- package/_cjs/tempo/Decorator.js +17 -0
- package/_cjs/tempo/Decorator.js.map +1 -1
- package/_cjs/tempo/Transaction.js +10 -2
- package/_cjs/tempo/Transaction.js.map +1 -1
- package/_cjs/tempo/actions/channel.js +377 -0
- package/_cjs/tempo/actions/channel.js.map +1 -0
- package/_cjs/tempo/actions/index.js +2 -1
- package/_cjs/tempo/actions/index.js.map +1 -1
- package/_cjs/tempo/actions/token.js +57 -27
- package/_cjs/tempo/actions/token.js.map +1 -1
- package/_cjs/tempo/index.js +2 -1
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/utils/formatters/transactionRequest.js.map +1 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_esm/actions/index.js +1 -0
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/public/createAccessList.js +3 -0
- package/_esm/actions/public/createAccessList.js.map +1 -1
- package/_esm/actions/public/getBlockReceipts.js +39 -0
- package/_esm/actions/public/getBlockReceipts.js.map +1 -0
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/chains/definitions/somnia.js +7 -0
- package/_esm/chains/definitions/somnia.js.map +1 -1
- package/_esm/chains/definitions/somniaTestnet.js +3 -2
- package/_esm/chains/definitions/somniaTestnet.js.map +1 -1
- package/_esm/clients/decorators/public.js +2 -0
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/op-stack/actions/buildProveWithdrawal.js +10 -2
- package/_esm/op-stack/actions/buildProveWithdrawal.js.map +1 -1
- package/_esm/op-stack/actions/getGame.js.map +1 -1
- package/_esm/op-stack/actions/getGames.js +3 -1
- package/_esm/op-stack/actions/getGames.js.map +1 -1
- package/_esm/op-stack/actions/getTimeToProve.js +3 -3
- package/_esm/op-stack/actions/getTimeToProve.js.map +1 -1
- package/_esm/op-stack/actions/getWithdrawalStatus.js +1 -1
- package/_esm/op-stack/actions/getWithdrawalStatus.js.map +1 -1
- package/_esm/op-stack/actions/waitToProve.js +4 -3
- package/_esm/op-stack/actions/waitToProve.js.map +1 -1
- package/_esm/op-stack/gameTypes.js +9 -0
- package/_esm/op-stack/gameTypes.js.map +1 -0
- package/_esm/op-stack/index.js +2 -0
- package/_esm/op-stack/index.js.map +1 -1
- package/_esm/op-stack/utils/getL2BlockNumberAtTimestamp.js +33 -0
- package/_esm/op-stack/utils/getL2BlockNumberAtTimestamp.js.map +1 -0
- package/_esm/tempo/Abis.js +476 -10
- package/_esm/tempo/Abis.js.map +1 -1
- package/_esm/tempo/Account.js +27 -2
- package/_esm/tempo/Account.js.map +1 -1
- package/_esm/tempo/Decorator.js +17 -0
- package/_esm/tempo/Decorator.js.map +1 -1
- package/_esm/tempo/Transaction.js +16 -11
- package/_esm/tempo/Transaction.js.map +1 -1
- package/_esm/tempo/actions/channel.js +736 -0
- package/_esm/tempo/actions/channel.js.map +1 -0
- package/_esm/tempo/actions/index.js +1 -0
- package/_esm/tempo/actions/index.js.map +1 -1
- package/_esm/tempo/actions/token.js +61 -28
- package/_esm/tempo/actions/token.js.map +1 -1
- package/_esm/tempo/index.js +1 -1
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/utils/formatters/transactionRequest.js.map +1 -1
- package/_esm/utils/index.js.map +1 -1
- package/_types/actions/index.d.ts +1 -0
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/public/createAccessList.d.ts +2 -1
- package/_types/actions/public/createAccessList.d.ts.map +1 -1
- package/_types/actions/public/getBlockReceipts.d.ts +53 -0
- package/_types/actions/public/getBlockReceipts.d.ts.map +1 -0
- package/_types/actions/wallet/prepareTransactionRequest.d.ts +4 -5
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/chains/definitions/somnia.d.ts +7 -10
- package/_types/chains/definitions/somnia.d.ts.map +1 -1
- package/_types/chains/definitions/somniaTestnet.d.ts +3 -3
- package/_types/chains/definitions/somniaTestnet.d.ts.map +1 -1
- package/_types/clients/decorators/public.d.ts +23 -0
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +2 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/op-stack/actions/buildProveWithdrawal.d.ts +2 -1
- package/_types/op-stack/actions/buildProveWithdrawal.d.ts.map +1 -1
- package/_types/op-stack/actions/getGame.d.ts +7 -0
- package/_types/op-stack/actions/getGame.d.ts.map +1 -1
- package/_types/op-stack/actions/getGames.d.ts +7 -0
- package/_types/op-stack/actions/getGames.d.ts.map +1 -1
- package/_types/op-stack/actions/getTimeToProve.d.ts +4 -0
- package/_types/op-stack/actions/getTimeToProve.d.ts.map +1 -1
- package/_types/op-stack/actions/getWithdrawalStatus.d.ts +4 -0
- package/_types/op-stack/actions/getWithdrawalStatus.d.ts.map +1 -1
- package/_types/op-stack/actions/waitToProve.d.ts +4 -0
- package/_types/op-stack/actions/waitToProve.d.ts.map +1 -1
- package/_types/op-stack/gameTypes.d.ts +7 -0
- package/_types/op-stack/gameTypes.d.ts.map +1 -0
- package/_types/op-stack/index.d.ts +2 -0
- package/_types/op-stack/index.d.ts.map +1 -1
- package/_types/op-stack/utils/getL2BlockNumberAtTimestamp.d.ts +21 -0
- package/_types/op-stack/utils/getL2BlockNumberAtTimestamp.d.ts.map +1 -0
- package/_types/tempo/Abis.d.ts +3784 -2271
- package/_types/tempo/Abis.d.ts.map +1 -1
- package/_types/tempo/Account.d.ts +32 -1
- package/_types/tempo/Account.d.ts.map +1 -1
- package/_types/tempo/Decorator.d.ts +246 -1
- package/_types/tempo/Decorator.d.ts.map +1 -1
- package/_types/tempo/Transaction.d.ts.map +1 -1
- package/_types/tempo/actions/accessKey.d.ts +339 -0
- package/_types/tempo/actions/accessKey.d.ts.map +1 -1
- package/_types/tempo/actions/channel.d.ts +4390 -0
- package/_types/tempo/actions/channel.d.ts.map +1 -0
- package/_types/tempo/actions/dex.d.ts +140 -0
- package/_types/tempo/actions/dex.d.ts.map +1 -1
- package/_types/tempo/actions/fee.d.ts +0 -48
- package/_types/tempo/actions/fee.d.ts.map +1 -1
- package/_types/tempo/actions/index.d.ts +1 -0
- package/_types/tempo/actions/index.d.ts.map +1 -1
- package/_types/tempo/actions/reward.d.ts +74 -18
- package/_types/tempo/actions/reward.d.ts.map +1 -1
- package/_types/tempo/actions/token.d.ts +629 -141
- package/_types/tempo/actions/token.d.ts.map +1 -1
- package/_types/tempo/actions/virtualAddress.d.ts +11 -0
- package/_types/tempo/actions/virtualAddress.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +1 -1
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +13 -0
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +6 -1
- package/_types/utils/formatters/transactionRequest.d.ts.map +1 -1
- package/_types/utils/index.d.ts +1 -1
- package/_types/utils/index.d.ts.map +1 -1
- package/actions/index.ts +6 -0
- package/actions/public/createAccessList.ts +4 -0
- package/actions/public/getBlockReceipts.ts +101 -0
- package/actions/wallet/prepareTransactionRequest.ts +7 -10
- package/chains/definitions/somnia.ts +7 -0
- package/chains/definitions/somniaTestnet.ts +3 -2
- package/clients/decorators/public.ts +30 -0
- package/errors/version.ts +1 -1
- package/index.ts +6 -0
- package/op-stack/actions/buildProveWithdrawal.ts +17 -2
- package/op-stack/actions/getGame.ts +7 -0
- package/op-stack/actions/getGames.ts +10 -1
- package/op-stack/actions/getTimeToProve.ts +7 -3
- package/op-stack/actions/getWithdrawalStatus.ts +6 -1
- package/op-stack/actions/waitToProve.ts +8 -3
- package/op-stack/gameTypes.ts +9 -0
- package/op-stack/index.ts +7 -1
- package/op-stack/utils/getL2BlockNumberAtTimestamp.ts +57 -0
- package/package.json +2 -2
- package/tempo/Abis.ts +477 -10
- package/tempo/Account.ts +67 -2
- package/tempo/Decorator.ts +299 -1
- package/tempo/Transaction.ts +18 -11
- package/tempo/actions/channel.ts +1197 -0
- package/tempo/actions/index.ts +1 -0
- package/tempo/actions/token.ts +85 -26
- package/tempo/index.ts +1 -0
- package/types/eip1193.ts +13 -0
- package/utils/formatters/transactionRequest.ts +13 -1
- package/utils/index.ts +1 -0
|
@@ -0,0 +1,4390 @@
|
|
|
1
|
+
import * as Address from 'ox/Address';
|
|
2
|
+
import * as Hex from 'ox/Hex';
|
|
3
|
+
import { Channel as ox_Channel, TokenId } from 'ox/tempo';
|
|
4
|
+
import type { Account } from '../../accounts/types.js';
|
|
5
|
+
import type { ReadContractReturnType } from '../../actions/public/readContract.js';
|
|
6
|
+
import type { WriteContractReturnType } from '../../actions/wallet/writeContract.js';
|
|
7
|
+
import { writeContract } from '../../actions/wallet/writeContract.js';
|
|
8
|
+
import { writeContractSync } from '../../actions/wallet/writeContractSync.js';
|
|
9
|
+
import type { Client } from '../../clients/createClient.js';
|
|
10
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
|
11
|
+
import type { BaseErrorType } from '../../errors/base.js';
|
|
12
|
+
import type { Chain } from '../../types/chain.js';
|
|
13
|
+
import type { GetEventArgs } from '../../types/contract.js';
|
|
14
|
+
import type { Log } from '../../types/log.js';
|
|
15
|
+
import type { Compute } from '../../types/utils.js';
|
|
16
|
+
import * as Abis from '../Abis.js';
|
|
17
|
+
import type { GetAccountParameter, ReadParameters, WriteParameters } from '../internal/types.js';
|
|
18
|
+
import type { TransactionReceipt } from '../Transaction.js';
|
|
19
|
+
/**
|
|
20
|
+
* Closes a TIP-20 channel reserve channel from the payee or operator side.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { Actions } from 'viem/tempo'
|
|
25
|
+
*
|
|
26
|
+
* const hash = await Actions.channel.close(client, {
|
|
27
|
+
* captureAmount: 100n,
|
|
28
|
+
* cumulativeAmount: 100n,
|
|
29
|
+
* channel,
|
|
30
|
+
* signature: '0x...',
|
|
31
|
+
* })
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param client - Client.
|
|
35
|
+
* @param parameters - Parameters.
|
|
36
|
+
* @returns The transaction hash.
|
|
37
|
+
*/
|
|
38
|
+
export declare function close<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: close.Parameters<chain, account>): Promise<close.ReturnValue>;
|
|
39
|
+
export declare namespace close {
|
|
40
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
|
|
41
|
+
type Args = {
|
|
42
|
+
/** Amount to capture for the payee during close. */
|
|
43
|
+
captureAmount: bigint;
|
|
44
|
+
/** Total voucher amount signed for the channel. */
|
|
45
|
+
cumulativeAmount: bigint;
|
|
46
|
+
/** TIP-20 channel. */
|
|
47
|
+
channel: ox_Channel.from.Value;
|
|
48
|
+
/** Voucher signature. */
|
|
49
|
+
signature: Hex.Hex;
|
|
50
|
+
};
|
|
51
|
+
type ReturnValue = WriteContractReturnType;
|
|
52
|
+
type ErrorType = BaseErrorType;
|
|
53
|
+
/** @internal */
|
|
54
|
+
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>>;
|
|
55
|
+
/**
|
|
56
|
+
* Defines a call to the `close` function.
|
|
57
|
+
*
|
|
58
|
+
* @param args - Arguments.
|
|
59
|
+
* @returns The call.
|
|
60
|
+
*/
|
|
61
|
+
function call(args: Args): {
|
|
62
|
+
abi: [{
|
|
63
|
+
readonly name: "close";
|
|
64
|
+
readonly type: "function";
|
|
65
|
+
readonly stateMutability: "nonpayable";
|
|
66
|
+
readonly inputs: readonly [{
|
|
67
|
+
readonly type: "tuple";
|
|
68
|
+
readonly name: "descriptor";
|
|
69
|
+
readonly components: readonly [{
|
|
70
|
+
readonly type: "address";
|
|
71
|
+
readonly name: "payer";
|
|
72
|
+
}, {
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
readonly name: "payee";
|
|
75
|
+
}, {
|
|
76
|
+
readonly type: "address";
|
|
77
|
+
readonly name: "operator";
|
|
78
|
+
}, {
|
|
79
|
+
readonly type: "address";
|
|
80
|
+
readonly name: "token";
|
|
81
|
+
}, {
|
|
82
|
+
readonly type: "bytes32";
|
|
83
|
+
readonly name: "salt";
|
|
84
|
+
}, {
|
|
85
|
+
readonly type: "address";
|
|
86
|
+
readonly name: "authorizedSigner";
|
|
87
|
+
}, {
|
|
88
|
+
readonly type: "bytes32";
|
|
89
|
+
readonly name: "expiringNonceHash";
|
|
90
|
+
}];
|
|
91
|
+
}, {
|
|
92
|
+
readonly type: "uint96";
|
|
93
|
+
readonly name: "cumulativeAmount";
|
|
94
|
+
}, {
|
|
95
|
+
readonly type: "uint96";
|
|
96
|
+
readonly name: "captureAmount";
|
|
97
|
+
}, {
|
|
98
|
+
readonly type: "bytes";
|
|
99
|
+
readonly name: "signature";
|
|
100
|
+
}];
|
|
101
|
+
readonly outputs: readonly [];
|
|
102
|
+
}];
|
|
103
|
+
functionName: "close";
|
|
104
|
+
} & {
|
|
105
|
+
args: readonly [{
|
|
106
|
+
payer: `0x${string}`;
|
|
107
|
+
payee: `0x${string}`;
|
|
108
|
+
operator: `0x${string}`;
|
|
109
|
+
token: `0x${string}`;
|
|
110
|
+
salt: `0x${string}`;
|
|
111
|
+
authorizedSigner: `0x${string}`;
|
|
112
|
+
expiringNonceHash: `0x${string}`;
|
|
113
|
+
}, bigint, bigint, signature: `0x${string}`];
|
|
114
|
+
} & {
|
|
115
|
+
address: import("abitype").Address;
|
|
116
|
+
} & {
|
|
117
|
+
data: import("../../index.js").Hex;
|
|
118
|
+
to: import("abitype").Address;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Extracts the `ChannelClosed` event from logs.
|
|
122
|
+
*
|
|
123
|
+
* @param logs - The logs.
|
|
124
|
+
* @returns The `ChannelClosed` event.
|
|
125
|
+
*/
|
|
126
|
+
function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
|
|
127
|
+
readonly name: "CLOSE_GRACE_PERIOD";
|
|
128
|
+
readonly type: "function";
|
|
129
|
+
readonly stateMutability: "view";
|
|
130
|
+
readonly inputs: readonly [];
|
|
131
|
+
readonly outputs: readonly [{
|
|
132
|
+
readonly type: "uint64";
|
|
133
|
+
}];
|
|
134
|
+
}, {
|
|
135
|
+
readonly name: "VOUCHER_TYPEHASH";
|
|
136
|
+
readonly type: "function";
|
|
137
|
+
readonly stateMutability: "view";
|
|
138
|
+
readonly inputs: readonly [];
|
|
139
|
+
readonly outputs: readonly [{
|
|
140
|
+
readonly type: "bytes32";
|
|
141
|
+
}];
|
|
142
|
+
}, {
|
|
143
|
+
readonly name: "open";
|
|
144
|
+
readonly type: "function";
|
|
145
|
+
readonly stateMutability: "nonpayable";
|
|
146
|
+
readonly inputs: readonly [{
|
|
147
|
+
readonly type: "address";
|
|
148
|
+
readonly name: "payee";
|
|
149
|
+
}, {
|
|
150
|
+
readonly type: "address";
|
|
151
|
+
readonly name: "operator";
|
|
152
|
+
}, {
|
|
153
|
+
readonly type: "address";
|
|
154
|
+
readonly name: "token";
|
|
155
|
+
}, {
|
|
156
|
+
readonly type: "uint96";
|
|
157
|
+
readonly name: "deposit";
|
|
158
|
+
}, {
|
|
159
|
+
readonly type: "bytes32";
|
|
160
|
+
readonly name: "salt";
|
|
161
|
+
}, {
|
|
162
|
+
readonly type: "address";
|
|
163
|
+
readonly name: "authorizedSigner";
|
|
164
|
+
}];
|
|
165
|
+
readonly outputs: readonly [{
|
|
166
|
+
readonly type: "bytes32";
|
|
167
|
+
readonly name: "channelId";
|
|
168
|
+
}];
|
|
169
|
+
}, {
|
|
170
|
+
readonly name: "settle";
|
|
171
|
+
readonly type: "function";
|
|
172
|
+
readonly stateMutability: "nonpayable";
|
|
173
|
+
readonly inputs: readonly [{
|
|
174
|
+
readonly type: "tuple";
|
|
175
|
+
readonly name: "descriptor";
|
|
176
|
+
readonly components: readonly [{
|
|
177
|
+
readonly type: "address";
|
|
178
|
+
readonly name: "payer";
|
|
179
|
+
}, {
|
|
180
|
+
readonly type: "address";
|
|
181
|
+
readonly name: "payee";
|
|
182
|
+
}, {
|
|
183
|
+
readonly type: "address";
|
|
184
|
+
readonly name: "operator";
|
|
185
|
+
}, {
|
|
186
|
+
readonly type: "address";
|
|
187
|
+
readonly name: "token";
|
|
188
|
+
}, {
|
|
189
|
+
readonly type: "bytes32";
|
|
190
|
+
readonly name: "salt";
|
|
191
|
+
}, {
|
|
192
|
+
readonly type: "address";
|
|
193
|
+
readonly name: "authorizedSigner";
|
|
194
|
+
}, {
|
|
195
|
+
readonly type: "bytes32";
|
|
196
|
+
readonly name: "expiringNonceHash";
|
|
197
|
+
}];
|
|
198
|
+
}, {
|
|
199
|
+
readonly type: "uint96";
|
|
200
|
+
readonly name: "cumulativeAmount";
|
|
201
|
+
}, {
|
|
202
|
+
readonly type: "bytes";
|
|
203
|
+
readonly name: "signature";
|
|
204
|
+
}];
|
|
205
|
+
readonly outputs: readonly [];
|
|
206
|
+
}, {
|
|
207
|
+
readonly name: "topUp";
|
|
208
|
+
readonly type: "function";
|
|
209
|
+
readonly stateMutability: "nonpayable";
|
|
210
|
+
readonly inputs: readonly [{
|
|
211
|
+
readonly type: "tuple";
|
|
212
|
+
readonly name: "descriptor";
|
|
213
|
+
readonly components: readonly [{
|
|
214
|
+
readonly type: "address";
|
|
215
|
+
readonly name: "payer";
|
|
216
|
+
}, {
|
|
217
|
+
readonly type: "address";
|
|
218
|
+
readonly name: "payee";
|
|
219
|
+
}, {
|
|
220
|
+
readonly type: "address";
|
|
221
|
+
readonly name: "operator";
|
|
222
|
+
}, {
|
|
223
|
+
readonly type: "address";
|
|
224
|
+
readonly name: "token";
|
|
225
|
+
}, {
|
|
226
|
+
readonly type: "bytes32";
|
|
227
|
+
readonly name: "salt";
|
|
228
|
+
}, {
|
|
229
|
+
readonly type: "address";
|
|
230
|
+
readonly name: "authorizedSigner";
|
|
231
|
+
}, {
|
|
232
|
+
readonly type: "bytes32";
|
|
233
|
+
readonly name: "expiringNonceHash";
|
|
234
|
+
}];
|
|
235
|
+
}, {
|
|
236
|
+
readonly type: "uint96";
|
|
237
|
+
readonly name: "additionalDeposit";
|
|
238
|
+
}];
|
|
239
|
+
readonly outputs: readonly [];
|
|
240
|
+
}, {
|
|
241
|
+
readonly name: "close";
|
|
242
|
+
readonly type: "function";
|
|
243
|
+
readonly stateMutability: "nonpayable";
|
|
244
|
+
readonly inputs: readonly [{
|
|
245
|
+
readonly type: "tuple";
|
|
246
|
+
readonly name: "descriptor";
|
|
247
|
+
readonly components: readonly [{
|
|
248
|
+
readonly type: "address";
|
|
249
|
+
readonly name: "payer";
|
|
250
|
+
}, {
|
|
251
|
+
readonly type: "address";
|
|
252
|
+
readonly name: "payee";
|
|
253
|
+
}, {
|
|
254
|
+
readonly type: "address";
|
|
255
|
+
readonly name: "operator";
|
|
256
|
+
}, {
|
|
257
|
+
readonly type: "address";
|
|
258
|
+
readonly name: "token";
|
|
259
|
+
}, {
|
|
260
|
+
readonly type: "bytes32";
|
|
261
|
+
readonly name: "salt";
|
|
262
|
+
}, {
|
|
263
|
+
readonly type: "address";
|
|
264
|
+
readonly name: "authorizedSigner";
|
|
265
|
+
}, {
|
|
266
|
+
readonly type: "bytes32";
|
|
267
|
+
readonly name: "expiringNonceHash";
|
|
268
|
+
}];
|
|
269
|
+
}, {
|
|
270
|
+
readonly type: "uint96";
|
|
271
|
+
readonly name: "cumulativeAmount";
|
|
272
|
+
}, {
|
|
273
|
+
readonly type: "uint96";
|
|
274
|
+
readonly name: "captureAmount";
|
|
275
|
+
}, {
|
|
276
|
+
readonly type: "bytes";
|
|
277
|
+
readonly name: "signature";
|
|
278
|
+
}];
|
|
279
|
+
readonly outputs: readonly [];
|
|
280
|
+
}, {
|
|
281
|
+
readonly name: "requestClose";
|
|
282
|
+
readonly type: "function";
|
|
283
|
+
readonly stateMutability: "nonpayable";
|
|
284
|
+
readonly inputs: readonly [{
|
|
285
|
+
readonly type: "tuple";
|
|
286
|
+
readonly name: "descriptor";
|
|
287
|
+
readonly components: readonly [{
|
|
288
|
+
readonly type: "address";
|
|
289
|
+
readonly name: "payer";
|
|
290
|
+
}, {
|
|
291
|
+
readonly type: "address";
|
|
292
|
+
readonly name: "payee";
|
|
293
|
+
}, {
|
|
294
|
+
readonly type: "address";
|
|
295
|
+
readonly name: "operator";
|
|
296
|
+
}, {
|
|
297
|
+
readonly type: "address";
|
|
298
|
+
readonly name: "token";
|
|
299
|
+
}, {
|
|
300
|
+
readonly type: "bytes32";
|
|
301
|
+
readonly name: "salt";
|
|
302
|
+
}, {
|
|
303
|
+
readonly type: "address";
|
|
304
|
+
readonly name: "authorizedSigner";
|
|
305
|
+
}, {
|
|
306
|
+
readonly type: "bytes32";
|
|
307
|
+
readonly name: "expiringNonceHash";
|
|
308
|
+
}];
|
|
309
|
+
}];
|
|
310
|
+
readonly outputs: readonly [];
|
|
311
|
+
}, {
|
|
312
|
+
readonly name: "withdraw";
|
|
313
|
+
readonly type: "function";
|
|
314
|
+
readonly stateMutability: "nonpayable";
|
|
315
|
+
readonly inputs: readonly [{
|
|
316
|
+
readonly type: "tuple";
|
|
317
|
+
readonly name: "descriptor";
|
|
318
|
+
readonly components: readonly [{
|
|
319
|
+
readonly type: "address";
|
|
320
|
+
readonly name: "payer";
|
|
321
|
+
}, {
|
|
322
|
+
readonly type: "address";
|
|
323
|
+
readonly name: "payee";
|
|
324
|
+
}, {
|
|
325
|
+
readonly type: "address";
|
|
326
|
+
readonly name: "operator";
|
|
327
|
+
}, {
|
|
328
|
+
readonly type: "address";
|
|
329
|
+
readonly name: "token";
|
|
330
|
+
}, {
|
|
331
|
+
readonly type: "bytes32";
|
|
332
|
+
readonly name: "salt";
|
|
333
|
+
}, {
|
|
334
|
+
readonly type: "address";
|
|
335
|
+
readonly name: "authorizedSigner";
|
|
336
|
+
}, {
|
|
337
|
+
readonly type: "bytes32";
|
|
338
|
+
readonly name: "expiringNonceHash";
|
|
339
|
+
}];
|
|
340
|
+
}];
|
|
341
|
+
readonly outputs: readonly [];
|
|
342
|
+
}, {
|
|
343
|
+
readonly name: "getChannel";
|
|
344
|
+
readonly type: "function";
|
|
345
|
+
readonly stateMutability: "view";
|
|
346
|
+
readonly inputs: readonly [{
|
|
347
|
+
readonly type: "tuple";
|
|
348
|
+
readonly name: "descriptor";
|
|
349
|
+
readonly components: readonly [{
|
|
350
|
+
readonly type: "address";
|
|
351
|
+
readonly name: "payer";
|
|
352
|
+
}, {
|
|
353
|
+
readonly type: "address";
|
|
354
|
+
readonly name: "payee";
|
|
355
|
+
}, {
|
|
356
|
+
readonly type: "address";
|
|
357
|
+
readonly name: "operator";
|
|
358
|
+
}, {
|
|
359
|
+
readonly type: "address";
|
|
360
|
+
readonly name: "token";
|
|
361
|
+
}, {
|
|
362
|
+
readonly type: "bytes32";
|
|
363
|
+
readonly name: "salt";
|
|
364
|
+
}, {
|
|
365
|
+
readonly type: "address";
|
|
366
|
+
readonly name: "authorizedSigner";
|
|
367
|
+
}, {
|
|
368
|
+
readonly type: "bytes32";
|
|
369
|
+
readonly name: "expiringNonceHash";
|
|
370
|
+
}];
|
|
371
|
+
}];
|
|
372
|
+
readonly outputs: readonly [{
|
|
373
|
+
readonly type: "tuple";
|
|
374
|
+
readonly components: readonly [{
|
|
375
|
+
readonly type: "tuple";
|
|
376
|
+
readonly name: "descriptor";
|
|
377
|
+
readonly components: readonly [{
|
|
378
|
+
readonly type: "address";
|
|
379
|
+
readonly name: "payer";
|
|
380
|
+
}, {
|
|
381
|
+
readonly type: "address";
|
|
382
|
+
readonly name: "payee";
|
|
383
|
+
}, {
|
|
384
|
+
readonly type: "address";
|
|
385
|
+
readonly name: "operator";
|
|
386
|
+
}, {
|
|
387
|
+
readonly type: "address";
|
|
388
|
+
readonly name: "token";
|
|
389
|
+
}, {
|
|
390
|
+
readonly type: "bytes32";
|
|
391
|
+
readonly name: "salt";
|
|
392
|
+
}, {
|
|
393
|
+
readonly type: "address";
|
|
394
|
+
readonly name: "authorizedSigner";
|
|
395
|
+
}, {
|
|
396
|
+
readonly type: "bytes32";
|
|
397
|
+
readonly name: "expiringNonceHash";
|
|
398
|
+
}];
|
|
399
|
+
}, {
|
|
400
|
+
readonly type: "tuple";
|
|
401
|
+
readonly name: "state";
|
|
402
|
+
readonly components: readonly [{
|
|
403
|
+
readonly type: "uint96";
|
|
404
|
+
readonly name: "settled";
|
|
405
|
+
}, {
|
|
406
|
+
readonly type: "uint96";
|
|
407
|
+
readonly name: "deposit";
|
|
408
|
+
}, {
|
|
409
|
+
readonly type: "uint32";
|
|
410
|
+
readonly name: "closeRequestedAt";
|
|
411
|
+
}];
|
|
412
|
+
}];
|
|
413
|
+
}];
|
|
414
|
+
}, {
|
|
415
|
+
readonly name: "getChannelState";
|
|
416
|
+
readonly type: "function";
|
|
417
|
+
readonly stateMutability: "view";
|
|
418
|
+
readonly inputs: readonly [{
|
|
419
|
+
readonly type: "bytes32";
|
|
420
|
+
readonly name: "channelId";
|
|
421
|
+
}];
|
|
422
|
+
readonly outputs: readonly [{
|
|
423
|
+
readonly type: "tuple";
|
|
424
|
+
readonly components: readonly [{
|
|
425
|
+
readonly type: "uint96";
|
|
426
|
+
readonly name: "settled";
|
|
427
|
+
}, {
|
|
428
|
+
readonly type: "uint96";
|
|
429
|
+
readonly name: "deposit";
|
|
430
|
+
}, {
|
|
431
|
+
readonly type: "uint32";
|
|
432
|
+
readonly name: "closeRequestedAt";
|
|
433
|
+
}];
|
|
434
|
+
}];
|
|
435
|
+
}, {
|
|
436
|
+
readonly name: "getChannelStatesBatch";
|
|
437
|
+
readonly type: "function";
|
|
438
|
+
readonly stateMutability: "view";
|
|
439
|
+
readonly inputs: readonly [{
|
|
440
|
+
readonly type: "bytes32[]";
|
|
441
|
+
readonly name: "channelIds";
|
|
442
|
+
}];
|
|
443
|
+
readonly outputs: readonly [{
|
|
444
|
+
readonly type: "tuple[]";
|
|
445
|
+
readonly components: readonly [{
|
|
446
|
+
readonly type: "uint96";
|
|
447
|
+
readonly name: "settled";
|
|
448
|
+
}, {
|
|
449
|
+
readonly type: "uint96";
|
|
450
|
+
readonly name: "deposit";
|
|
451
|
+
}, {
|
|
452
|
+
readonly type: "uint32";
|
|
453
|
+
readonly name: "closeRequestedAt";
|
|
454
|
+
}];
|
|
455
|
+
}];
|
|
456
|
+
}, {
|
|
457
|
+
readonly name: "computeChannelId";
|
|
458
|
+
readonly type: "function";
|
|
459
|
+
readonly stateMutability: "view";
|
|
460
|
+
readonly inputs: readonly [{
|
|
461
|
+
readonly type: "address";
|
|
462
|
+
readonly name: "payer";
|
|
463
|
+
}, {
|
|
464
|
+
readonly type: "address";
|
|
465
|
+
readonly name: "payee";
|
|
466
|
+
}, {
|
|
467
|
+
readonly type: "address";
|
|
468
|
+
readonly name: "operator";
|
|
469
|
+
}, {
|
|
470
|
+
readonly type: "address";
|
|
471
|
+
readonly name: "token";
|
|
472
|
+
}, {
|
|
473
|
+
readonly type: "bytes32";
|
|
474
|
+
readonly name: "salt";
|
|
475
|
+
}, {
|
|
476
|
+
readonly type: "address";
|
|
477
|
+
readonly name: "authorizedSigner";
|
|
478
|
+
}, {
|
|
479
|
+
readonly type: "bytes32";
|
|
480
|
+
readonly name: "expiringNonceHash";
|
|
481
|
+
}];
|
|
482
|
+
readonly outputs: readonly [{
|
|
483
|
+
readonly type: "bytes32";
|
|
484
|
+
}];
|
|
485
|
+
}, {
|
|
486
|
+
readonly name: "getVoucherDigest";
|
|
487
|
+
readonly type: "function";
|
|
488
|
+
readonly stateMutability: "view";
|
|
489
|
+
readonly inputs: readonly [{
|
|
490
|
+
readonly type: "bytes32";
|
|
491
|
+
readonly name: "channelId";
|
|
492
|
+
}, {
|
|
493
|
+
readonly type: "uint96";
|
|
494
|
+
readonly name: "cumulativeAmount";
|
|
495
|
+
}];
|
|
496
|
+
readonly outputs: readonly [{
|
|
497
|
+
readonly type: "bytes32";
|
|
498
|
+
}];
|
|
499
|
+
}, {
|
|
500
|
+
readonly name: "domainSeparator";
|
|
501
|
+
readonly type: "function";
|
|
502
|
+
readonly stateMutability: "view";
|
|
503
|
+
readonly inputs: readonly [];
|
|
504
|
+
readonly outputs: readonly [{
|
|
505
|
+
readonly type: "bytes32";
|
|
506
|
+
}];
|
|
507
|
+
}, {
|
|
508
|
+
readonly name: "ChannelOpened";
|
|
509
|
+
readonly type: "event";
|
|
510
|
+
readonly inputs: readonly [{
|
|
511
|
+
readonly type: "bytes32";
|
|
512
|
+
readonly name: "channelId";
|
|
513
|
+
readonly indexed: true;
|
|
514
|
+
}, {
|
|
515
|
+
readonly type: "address";
|
|
516
|
+
readonly name: "payer";
|
|
517
|
+
readonly indexed: true;
|
|
518
|
+
}, {
|
|
519
|
+
readonly type: "address";
|
|
520
|
+
readonly name: "payee";
|
|
521
|
+
readonly indexed: true;
|
|
522
|
+
}, {
|
|
523
|
+
readonly type: "address";
|
|
524
|
+
readonly name: "operator";
|
|
525
|
+
}, {
|
|
526
|
+
readonly type: "address";
|
|
527
|
+
readonly name: "token";
|
|
528
|
+
}, {
|
|
529
|
+
readonly type: "address";
|
|
530
|
+
readonly name: "authorizedSigner";
|
|
531
|
+
}, {
|
|
532
|
+
readonly type: "bytes32";
|
|
533
|
+
readonly name: "salt";
|
|
534
|
+
}, {
|
|
535
|
+
readonly type: "bytes32";
|
|
536
|
+
readonly name: "expiringNonceHash";
|
|
537
|
+
}, {
|
|
538
|
+
readonly type: "uint96";
|
|
539
|
+
readonly name: "deposit";
|
|
540
|
+
}];
|
|
541
|
+
}, {
|
|
542
|
+
readonly name: "Settled";
|
|
543
|
+
readonly type: "event";
|
|
544
|
+
readonly inputs: readonly [{
|
|
545
|
+
readonly type: "bytes32";
|
|
546
|
+
readonly name: "channelId";
|
|
547
|
+
readonly indexed: true;
|
|
548
|
+
}, {
|
|
549
|
+
readonly type: "address";
|
|
550
|
+
readonly name: "payer";
|
|
551
|
+
readonly indexed: true;
|
|
552
|
+
}, {
|
|
553
|
+
readonly type: "address";
|
|
554
|
+
readonly name: "payee";
|
|
555
|
+
readonly indexed: true;
|
|
556
|
+
}, {
|
|
557
|
+
readonly type: "uint96";
|
|
558
|
+
readonly name: "cumulativeAmount";
|
|
559
|
+
}, {
|
|
560
|
+
readonly type: "uint96";
|
|
561
|
+
readonly name: "deltaPaid";
|
|
562
|
+
}, {
|
|
563
|
+
readonly type: "uint96";
|
|
564
|
+
readonly name: "newSettled";
|
|
565
|
+
}];
|
|
566
|
+
}, {
|
|
567
|
+
readonly name: "TopUp";
|
|
568
|
+
readonly type: "event";
|
|
569
|
+
readonly inputs: readonly [{
|
|
570
|
+
readonly type: "bytes32";
|
|
571
|
+
readonly name: "channelId";
|
|
572
|
+
readonly indexed: true;
|
|
573
|
+
}, {
|
|
574
|
+
readonly type: "address";
|
|
575
|
+
readonly name: "payer";
|
|
576
|
+
readonly indexed: true;
|
|
577
|
+
}, {
|
|
578
|
+
readonly type: "address";
|
|
579
|
+
readonly name: "payee";
|
|
580
|
+
readonly indexed: true;
|
|
581
|
+
}, {
|
|
582
|
+
readonly type: "uint96";
|
|
583
|
+
readonly name: "additionalDeposit";
|
|
584
|
+
}, {
|
|
585
|
+
readonly type: "uint96";
|
|
586
|
+
readonly name: "newDeposit";
|
|
587
|
+
}];
|
|
588
|
+
}, {
|
|
589
|
+
readonly name: "CloseRequested";
|
|
590
|
+
readonly type: "event";
|
|
591
|
+
readonly inputs: readonly [{
|
|
592
|
+
readonly type: "bytes32";
|
|
593
|
+
readonly name: "channelId";
|
|
594
|
+
readonly indexed: true;
|
|
595
|
+
}, {
|
|
596
|
+
readonly type: "address";
|
|
597
|
+
readonly name: "payer";
|
|
598
|
+
readonly indexed: true;
|
|
599
|
+
}, {
|
|
600
|
+
readonly type: "address";
|
|
601
|
+
readonly name: "payee";
|
|
602
|
+
readonly indexed: true;
|
|
603
|
+
}, {
|
|
604
|
+
readonly type: "uint256";
|
|
605
|
+
readonly name: "closeGraceEnd";
|
|
606
|
+
}];
|
|
607
|
+
}, {
|
|
608
|
+
readonly name: "ChannelClosed";
|
|
609
|
+
readonly type: "event";
|
|
610
|
+
readonly inputs: readonly [{
|
|
611
|
+
readonly type: "bytes32";
|
|
612
|
+
readonly name: "channelId";
|
|
613
|
+
readonly indexed: true;
|
|
614
|
+
}, {
|
|
615
|
+
readonly type: "address";
|
|
616
|
+
readonly name: "payer";
|
|
617
|
+
readonly indexed: true;
|
|
618
|
+
}, {
|
|
619
|
+
readonly type: "address";
|
|
620
|
+
readonly name: "payee";
|
|
621
|
+
readonly indexed: true;
|
|
622
|
+
}, {
|
|
623
|
+
readonly type: "uint96";
|
|
624
|
+
readonly name: "settledToPayee";
|
|
625
|
+
}, {
|
|
626
|
+
readonly type: "uint96";
|
|
627
|
+
readonly name: "refundedToPayer";
|
|
628
|
+
}];
|
|
629
|
+
}, {
|
|
630
|
+
readonly name: "CloseRequestCancelled";
|
|
631
|
+
readonly type: "event";
|
|
632
|
+
readonly inputs: readonly [{
|
|
633
|
+
readonly type: "bytes32";
|
|
634
|
+
readonly name: "channelId";
|
|
635
|
+
readonly indexed: true;
|
|
636
|
+
}, {
|
|
637
|
+
readonly type: "address";
|
|
638
|
+
readonly name: "payer";
|
|
639
|
+
readonly indexed: true;
|
|
640
|
+
}, {
|
|
641
|
+
readonly type: "address";
|
|
642
|
+
readonly name: "payee";
|
|
643
|
+
readonly indexed: true;
|
|
644
|
+
}];
|
|
645
|
+
}, {
|
|
646
|
+
readonly name: "ChannelAlreadyExists";
|
|
647
|
+
readonly type: "error";
|
|
648
|
+
readonly inputs: readonly [];
|
|
649
|
+
}, {
|
|
650
|
+
readonly name: "ChannelNotFound";
|
|
651
|
+
readonly type: "error";
|
|
652
|
+
readonly inputs: readonly [];
|
|
653
|
+
}, {
|
|
654
|
+
readonly name: "NotPayer";
|
|
655
|
+
readonly type: "error";
|
|
656
|
+
readonly inputs: readonly [];
|
|
657
|
+
}, {
|
|
658
|
+
readonly name: "NotPayeeOrOperator";
|
|
659
|
+
readonly type: "error";
|
|
660
|
+
readonly inputs: readonly [];
|
|
661
|
+
}, {
|
|
662
|
+
readonly name: "InvalidPayee";
|
|
663
|
+
readonly type: "error";
|
|
664
|
+
readonly inputs: readonly [];
|
|
665
|
+
}, {
|
|
666
|
+
readonly name: "ZeroDeposit";
|
|
667
|
+
readonly type: "error";
|
|
668
|
+
readonly inputs: readonly [];
|
|
669
|
+
}, {
|
|
670
|
+
readonly name: "ExpiringNonceHashNotSet";
|
|
671
|
+
readonly type: "error";
|
|
672
|
+
readonly inputs: readonly [];
|
|
673
|
+
}, {
|
|
674
|
+
readonly name: "InvalidSignature";
|
|
675
|
+
readonly type: "error";
|
|
676
|
+
readonly inputs: readonly [];
|
|
677
|
+
}, {
|
|
678
|
+
readonly name: "AmountExceedsDeposit";
|
|
679
|
+
readonly type: "error";
|
|
680
|
+
readonly inputs: readonly [];
|
|
681
|
+
}, {
|
|
682
|
+
readonly name: "AmountNotIncreasing";
|
|
683
|
+
readonly type: "error";
|
|
684
|
+
readonly inputs: readonly [];
|
|
685
|
+
}, {
|
|
686
|
+
readonly name: "CaptureAmountInvalid";
|
|
687
|
+
readonly type: "error";
|
|
688
|
+
readonly inputs: readonly [];
|
|
689
|
+
}, {
|
|
690
|
+
readonly name: "CloseNotReady";
|
|
691
|
+
readonly type: "error";
|
|
692
|
+
readonly inputs: readonly [];
|
|
693
|
+
}, {
|
|
694
|
+
readonly name: "DepositOverflow";
|
|
695
|
+
readonly type: "error";
|
|
696
|
+
readonly inputs: readonly [];
|
|
697
|
+
}], "ChannelClosed">;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Closes a TIP-20 channel reserve channel and waits for the transaction receipt.
|
|
701
|
+
*
|
|
702
|
+
* @example
|
|
703
|
+
* ```ts
|
|
704
|
+
* import { Actions } from 'viem/tempo'
|
|
705
|
+
*
|
|
706
|
+
* const result = await Actions.channel.closeSync(client, {
|
|
707
|
+
* captureAmount: 100n,
|
|
708
|
+
* cumulativeAmount: 100n,
|
|
709
|
+
* channel,
|
|
710
|
+
* signature: '0x...',
|
|
711
|
+
* })
|
|
712
|
+
* ```
|
|
713
|
+
*
|
|
714
|
+
* @param client - Client.
|
|
715
|
+
* @param parameters - Parameters.
|
|
716
|
+
* @returns The transaction receipt and event data.
|
|
717
|
+
*/
|
|
718
|
+
export declare function closeSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: closeSync.Parameters<chain, account>): Promise<closeSync.ReturnValue>;
|
|
719
|
+
export declare namespace closeSync {
|
|
720
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = close.Parameters<chain, account>;
|
|
721
|
+
type Args = close.Args;
|
|
722
|
+
type ReturnValue = Compute<GetEventArgs<typeof Abis.tip20ChannelReserve, 'ChannelClosed', {
|
|
723
|
+
IndexedOnly: false;
|
|
724
|
+
Required: true;
|
|
725
|
+
}> & {
|
|
726
|
+
/** Transaction receipt. */
|
|
727
|
+
receipt: TransactionReceipt;
|
|
728
|
+
}>;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Gets TIP-20 channel reserve state for a channel ID or channel.
|
|
732
|
+
*
|
|
733
|
+
* @example
|
|
734
|
+
* ```ts
|
|
735
|
+
* import { createClient, http } from 'viem'
|
|
736
|
+
* import { tempo } from 'viem/chains'
|
|
737
|
+
* import { Actions } from 'viem/tempo'
|
|
738
|
+
*
|
|
739
|
+
* const client = createClient({
|
|
740
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
741
|
+
* transport: http(),
|
|
742
|
+
* })
|
|
743
|
+
*
|
|
744
|
+
* const state = await Actions.channel.getStates(client, {
|
|
745
|
+
* channel: '0x...',
|
|
746
|
+
* })
|
|
747
|
+
* ```
|
|
748
|
+
*
|
|
749
|
+
* @param client - Client.
|
|
750
|
+
* @param parameters - Parameters.
|
|
751
|
+
* @returns Channel state for a single channel, or channel states for multiple channels.
|
|
752
|
+
*/
|
|
753
|
+
export declare function getStates<chain extends Chain | undefined, const channel extends getStates.Channel | readonly getStates.Channel[]>(client: Client<Transport, chain>, parameters: getStates.Parameters<channel>): Promise<getStates.ReturnValue<channel>>;
|
|
754
|
+
export declare namespace getStates {
|
|
755
|
+
type Parameters<channel extends Channel | readonly Channel[] = Channel | readonly Channel[]> = ReadParameters & {
|
|
756
|
+
/** Channel ID, channel, or list of IDs and channels. */
|
|
757
|
+
channel: channel;
|
|
758
|
+
};
|
|
759
|
+
type Args<channel extends Channel | readonly Channel[] = Channel | readonly Channel[]> = {
|
|
760
|
+
/**
|
|
761
|
+
* Chain ID used to compute IDs for channel inputs.
|
|
762
|
+
*
|
|
763
|
+
* Required for channel inputs when using `getStates.call` directly.
|
|
764
|
+
*/
|
|
765
|
+
chainId?: number | undefined;
|
|
766
|
+
/** Channel ID, channel, or list of IDs and channels. */
|
|
767
|
+
channel: channel;
|
|
768
|
+
};
|
|
769
|
+
type Channel = Hex.Hex | ox_Channel.from.Value;
|
|
770
|
+
type State = ReadContractReturnType<typeof Abis.tip20ChannelReserve, 'getChannelState', readonly [Hex.Hex]>;
|
|
771
|
+
type ReturnValue<channel extends Channel | readonly Channel[]> = channel extends readonly Channel[] ? readonly State[] : State;
|
|
772
|
+
type ErrorType = BaseErrorType;
|
|
773
|
+
/**
|
|
774
|
+
* Defines a call to the `getChannelState` or `getChannelStatesBatch` function.
|
|
775
|
+
*
|
|
776
|
+
* Can be passed as a parameter to:
|
|
777
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
778
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
779
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
780
|
+
*
|
|
781
|
+
* @example
|
|
782
|
+
* ```ts
|
|
783
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
784
|
+
* import { tempo } from 'viem/chains'
|
|
785
|
+
* import { Actions } from 'viem/tempo'
|
|
786
|
+
*
|
|
787
|
+
* const client = createClient({
|
|
788
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
789
|
+
* transport: http(),
|
|
790
|
+
* }).extend(walletActions)
|
|
791
|
+
*
|
|
792
|
+
* const calls = [Actions.channel.getStates.call({ channel: '0x...' })]
|
|
793
|
+
* ```
|
|
794
|
+
*
|
|
795
|
+
* @param args - Arguments.
|
|
796
|
+
* @returns The call.
|
|
797
|
+
*/
|
|
798
|
+
function call<const channel extends Channel | readonly Channel[]>(args: Args<channel>): ({
|
|
799
|
+
abi: [{
|
|
800
|
+
readonly name: "getChannelStatesBatch";
|
|
801
|
+
readonly type: "function";
|
|
802
|
+
readonly stateMutability: "view";
|
|
803
|
+
readonly inputs: readonly [{
|
|
804
|
+
readonly type: "bytes32[]";
|
|
805
|
+
readonly name: "channelIds";
|
|
806
|
+
}];
|
|
807
|
+
readonly outputs: readonly [{
|
|
808
|
+
readonly type: "tuple[]";
|
|
809
|
+
readonly components: readonly [{
|
|
810
|
+
readonly type: "uint96";
|
|
811
|
+
readonly name: "settled";
|
|
812
|
+
}, {
|
|
813
|
+
readonly type: "uint96";
|
|
814
|
+
readonly name: "deposit";
|
|
815
|
+
}, {
|
|
816
|
+
readonly type: "uint32";
|
|
817
|
+
readonly name: "closeRequestedAt";
|
|
818
|
+
}];
|
|
819
|
+
}];
|
|
820
|
+
}];
|
|
821
|
+
functionName: "getChannelStatesBatch";
|
|
822
|
+
} & {
|
|
823
|
+
args: readonly [readonly `0x${string}`[]];
|
|
824
|
+
} & {
|
|
825
|
+
address: import("abitype").Address;
|
|
826
|
+
} & {
|
|
827
|
+
data: import("../../index.js").Hex;
|
|
828
|
+
to: import("abitype").Address;
|
|
829
|
+
}) | ({
|
|
830
|
+
abi: [{
|
|
831
|
+
readonly name: "getChannelState";
|
|
832
|
+
readonly type: "function";
|
|
833
|
+
readonly stateMutability: "view";
|
|
834
|
+
readonly inputs: readonly [{
|
|
835
|
+
readonly type: "bytes32";
|
|
836
|
+
readonly name: "channelId";
|
|
837
|
+
}];
|
|
838
|
+
readonly outputs: readonly [{
|
|
839
|
+
readonly type: "tuple";
|
|
840
|
+
readonly components: readonly [{
|
|
841
|
+
readonly type: "uint96";
|
|
842
|
+
readonly name: "settled";
|
|
843
|
+
}, {
|
|
844
|
+
readonly type: "uint96";
|
|
845
|
+
readonly name: "deposit";
|
|
846
|
+
}, {
|
|
847
|
+
readonly type: "uint32";
|
|
848
|
+
readonly name: "closeRequestedAt";
|
|
849
|
+
}];
|
|
850
|
+
}];
|
|
851
|
+
}];
|
|
852
|
+
functionName: "getChannelState";
|
|
853
|
+
} & {
|
|
854
|
+
args: readonly [channelId: `0x${string}`];
|
|
855
|
+
} & {
|
|
856
|
+
address: import("abitype").Address;
|
|
857
|
+
} & {
|
|
858
|
+
data: import("../../index.js").Hex;
|
|
859
|
+
to: import("abitype").Address;
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Opens and funds a TIP-20 channel reserve channel.
|
|
864
|
+
*
|
|
865
|
+
* @example
|
|
866
|
+
* ```ts
|
|
867
|
+
* import { createClient, http } from 'viem'
|
|
868
|
+
* import { tempo } from 'viem/chains'
|
|
869
|
+
* import { Actions } from 'viem/tempo'
|
|
870
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
871
|
+
*
|
|
872
|
+
* const client = createClient({
|
|
873
|
+
* account: privateKeyToAccount('0x...'),
|
|
874
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
875
|
+
* transport: http(),
|
|
876
|
+
* })
|
|
877
|
+
*
|
|
878
|
+
* const hash = await Actions.channel.open(client, {
|
|
879
|
+
* deposit: 100n,
|
|
880
|
+
* payee: '0x...',
|
|
881
|
+
* token: 1n,
|
|
882
|
+
* })
|
|
883
|
+
* ```
|
|
884
|
+
*
|
|
885
|
+
* @param client - Client.
|
|
886
|
+
* @param parameters - Parameters.
|
|
887
|
+
* @returns The transaction hash.
|
|
888
|
+
*/
|
|
889
|
+
export declare function open<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: open.Parameters<chain, account>): Promise<open.ReturnValue>;
|
|
890
|
+
export declare namespace open {
|
|
891
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
|
|
892
|
+
type Args = {
|
|
893
|
+
/** Optional signer for vouchers. Zero means `payer` signs. @default zeroAddress */
|
|
894
|
+
authorizedSigner?: Address.Address | undefined;
|
|
895
|
+
/** Amount of TIP-20 token to deposit. */
|
|
896
|
+
deposit: bigint;
|
|
897
|
+
/** Optional relayer allowed to submit `settle` for the payee. @default zeroAddress */
|
|
898
|
+
operator?: Address.Address | undefined;
|
|
899
|
+
/** Account that receives settled voucher payments. */
|
|
900
|
+
payee: Address.Address;
|
|
901
|
+
/** User-supplied salt to distinguish otherwise identical channels. @default Hex.random(32) */
|
|
902
|
+
salt?: Hex.Hex | undefined;
|
|
903
|
+
/** TIP-20 token address or ID held by the channel. */
|
|
904
|
+
token: TokenId.TokenIdOrAddress<Address.Address>;
|
|
905
|
+
};
|
|
906
|
+
type ReturnValue = WriteContractReturnType;
|
|
907
|
+
type ErrorType = BaseErrorType;
|
|
908
|
+
/** @internal */
|
|
909
|
+
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>>;
|
|
910
|
+
/**
|
|
911
|
+
* Defines a call to the `open` function.
|
|
912
|
+
*
|
|
913
|
+
* @param args - Arguments.
|
|
914
|
+
* @returns The call.
|
|
915
|
+
*/
|
|
916
|
+
function call(args: Args): {
|
|
917
|
+
abi: [{
|
|
918
|
+
readonly name: "open";
|
|
919
|
+
readonly type: "function";
|
|
920
|
+
readonly stateMutability: "nonpayable";
|
|
921
|
+
readonly inputs: readonly [{
|
|
922
|
+
readonly type: "address";
|
|
923
|
+
readonly name: "payee";
|
|
924
|
+
}, {
|
|
925
|
+
readonly type: "address";
|
|
926
|
+
readonly name: "operator";
|
|
927
|
+
}, {
|
|
928
|
+
readonly type: "address";
|
|
929
|
+
readonly name: "token";
|
|
930
|
+
}, {
|
|
931
|
+
readonly type: "uint96";
|
|
932
|
+
readonly name: "deposit";
|
|
933
|
+
}, {
|
|
934
|
+
readonly type: "bytes32";
|
|
935
|
+
readonly name: "salt";
|
|
936
|
+
}, {
|
|
937
|
+
readonly type: "address";
|
|
938
|
+
readonly name: "authorizedSigner";
|
|
939
|
+
}];
|
|
940
|
+
readonly outputs: readonly [{
|
|
941
|
+
readonly type: "bytes32";
|
|
942
|
+
readonly name: "channelId";
|
|
943
|
+
}];
|
|
944
|
+
}];
|
|
945
|
+
functionName: "open";
|
|
946
|
+
} & {
|
|
947
|
+
args: readonly [payee: `0x${string}`, operator: `0x${string}`, token: `0x${string}`, deposit: bigint, salt: `0x${string}`, `0x${string}`];
|
|
948
|
+
} & {
|
|
949
|
+
address: import("abitype").Address;
|
|
950
|
+
} & {
|
|
951
|
+
data: import("../../index.js").Hex;
|
|
952
|
+
to: import("abitype").Address;
|
|
953
|
+
};
|
|
954
|
+
/**
|
|
955
|
+
* Extracts the `ChannelOpened` event from logs.
|
|
956
|
+
*
|
|
957
|
+
* @param logs - The logs.
|
|
958
|
+
* @returns The `ChannelOpened` event.
|
|
959
|
+
*/
|
|
960
|
+
function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
|
|
961
|
+
readonly name: "CLOSE_GRACE_PERIOD";
|
|
962
|
+
readonly type: "function";
|
|
963
|
+
readonly stateMutability: "view";
|
|
964
|
+
readonly inputs: readonly [];
|
|
965
|
+
readonly outputs: readonly [{
|
|
966
|
+
readonly type: "uint64";
|
|
967
|
+
}];
|
|
968
|
+
}, {
|
|
969
|
+
readonly name: "VOUCHER_TYPEHASH";
|
|
970
|
+
readonly type: "function";
|
|
971
|
+
readonly stateMutability: "view";
|
|
972
|
+
readonly inputs: readonly [];
|
|
973
|
+
readonly outputs: readonly [{
|
|
974
|
+
readonly type: "bytes32";
|
|
975
|
+
}];
|
|
976
|
+
}, {
|
|
977
|
+
readonly name: "open";
|
|
978
|
+
readonly type: "function";
|
|
979
|
+
readonly stateMutability: "nonpayable";
|
|
980
|
+
readonly inputs: readonly [{
|
|
981
|
+
readonly type: "address";
|
|
982
|
+
readonly name: "payee";
|
|
983
|
+
}, {
|
|
984
|
+
readonly type: "address";
|
|
985
|
+
readonly name: "operator";
|
|
986
|
+
}, {
|
|
987
|
+
readonly type: "address";
|
|
988
|
+
readonly name: "token";
|
|
989
|
+
}, {
|
|
990
|
+
readonly type: "uint96";
|
|
991
|
+
readonly name: "deposit";
|
|
992
|
+
}, {
|
|
993
|
+
readonly type: "bytes32";
|
|
994
|
+
readonly name: "salt";
|
|
995
|
+
}, {
|
|
996
|
+
readonly type: "address";
|
|
997
|
+
readonly name: "authorizedSigner";
|
|
998
|
+
}];
|
|
999
|
+
readonly outputs: readonly [{
|
|
1000
|
+
readonly type: "bytes32";
|
|
1001
|
+
readonly name: "channelId";
|
|
1002
|
+
}];
|
|
1003
|
+
}, {
|
|
1004
|
+
readonly name: "settle";
|
|
1005
|
+
readonly type: "function";
|
|
1006
|
+
readonly stateMutability: "nonpayable";
|
|
1007
|
+
readonly inputs: readonly [{
|
|
1008
|
+
readonly type: "tuple";
|
|
1009
|
+
readonly name: "descriptor";
|
|
1010
|
+
readonly components: readonly [{
|
|
1011
|
+
readonly type: "address";
|
|
1012
|
+
readonly name: "payer";
|
|
1013
|
+
}, {
|
|
1014
|
+
readonly type: "address";
|
|
1015
|
+
readonly name: "payee";
|
|
1016
|
+
}, {
|
|
1017
|
+
readonly type: "address";
|
|
1018
|
+
readonly name: "operator";
|
|
1019
|
+
}, {
|
|
1020
|
+
readonly type: "address";
|
|
1021
|
+
readonly name: "token";
|
|
1022
|
+
}, {
|
|
1023
|
+
readonly type: "bytes32";
|
|
1024
|
+
readonly name: "salt";
|
|
1025
|
+
}, {
|
|
1026
|
+
readonly type: "address";
|
|
1027
|
+
readonly name: "authorizedSigner";
|
|
1028
|
+
}, {
|
|
1029
|
+
readonly type: "bytes32";
|
|
1030
|
+
readonly name: "expiringNonceHash";
|
|
1031
|
+
}];
|
|
1032
|
+
}, {
|
|
1033
|
+
readonly type: "uint96";
|
|
1034
|
+
readonly name: "cumulativeAmount";
|
|
1035
|
+
}, {
|
|
1036
|
+
readonly type: "bytes";
|
|
1037
|
+
readonly name: "signature";
|
|
1038
|
+
}];
|
|
1039
|
+
readonly outputs: readonly [];
|
|
1040
|
+
}, {
|
|
1041
|
+
readonly name: "topUp";
|
|
1042
|
+
readonly type: "function";
|
|
1043
|
+
readonly stateMutability: "nonpayable";
|
|
1044
|
+
readonly inputs: readonly [{
|
|
1045
|
+
readonly type: "tuple";
|
|
1046
|
+
readonly name: "descriptor";
|
|
1047
|
+
readonly components: readonly [{
|
|
1048
|
+
readonly type: "address";
|
|
1049
|
+
readonly name: "payer";
|
|
1050
|
+
}, {
|
|
1051
|
+
readonly type: "address";
|
|
1052
|
+
readonly name: "payee";
|
|
1053
|
+
}, {
|
|
1054
|
+
readonly type: "address";
|
|
1055
|
+
readonly name: "operator";
|
|
1056
|
+
}, {
|
|
1057
|
+
readonly type: "address";
|
|
1058
|
+
readonly name: "token";
|
|
1059
|
+
}, {
|
|
1060
|
+
readonly type: "bytes32";
|
|
1061
|
+
readonly name: "salt";
|
|
1062
|
+
}, {
|
|
1063
|
+
readonly type: "address";
|
|
1064
|
+
readonly name: "authorizedSigner";
|
|
1065
|
+
}, {
|
|
1066
|
+
readonly type: "bytes32";
|
|
1067
|
+
readonly name: "expiringNonceHash";
|
|
1068
|
+
}];
|
|
1069
|
+
}, {
|
|
1070
|
+
readonly type: "uint96";
|
|
1071
|
+
readonly name: "additionalDeposit";
|
|
1072
|
+
}];
|
|
1073
|
+
readonly outputs: readonly [];
|
|
1074
|
+
}, {
|
|
1075
|
+
readonly name: "close";
|
|
1076
|
+
readonly type: "function";
|
|
1077
|
+
readonly stateMutability: "nonpayable";
|
|
1078
|
+
readonly inputs: readonly [{
|
|
1079
|
+
readonly type: "tuple";
|
|
1080
|
+
readonly name: "descriptor";
|
|
1081
|
+
readonly components: readonly [{
|
|
1082
|
+
readonly type: "address";
|
|
1083
|
+
readonly name: "payer";
|
|
1084
|
+
}, {
|
|
1085
|
+
readonly type: "address";
|
|
1086
|
+
readonly name: "payee";
|
|
1087
|
+
}, {
|
|
1088
|
+
readonly type: "address";
|
|
1089
|
+
readonly name: "operator";
|
|
1090
|
+
}, {
|
|
1091
|
+
readonly type: "address";
|
|
1092
|
+
readonly name: "token";
|
|
1093
|
+
}, {
|
|
1094
|
+
readonly type: "bytes32";
|
|
1095
|
+
readonly name: "salt";
|
|
1096
|
+
}, {
|
|
1097
|
+
readonly type: "address";
|
|
1098
|
+
readonly name: "authorizedSigner";
|
|
1099
|
+
}, {
|
|
1100
|
+
readonly type: "bytes32";
|
|
1101
|
+
readonly name: "expiringNonceHash";
|
|
1102
|
+
}];
|
|
1103
|
+
}, {
|
|
1104
|
+
readonly type: "uint96";
|
|
1105
|
+
readonly name: "cumulativeAmount";
|
|
1106
|
+
}, {
|
|
1107
|
+
readonly type: "uint96";
|
|
1108
|
+
readonly name: "captureAmount";
|
|
1109
|
+
}, {
|
|
1110
|
+
readonly type: "bytes";
|
|
1111
|
+
readonly name: "signature";
|
|
1112
|
+
}];
|
|
1113
|
+
readonly outputs: readonly [];
|
|
1114
|
+
}, {
|
|
1115
|
+
readonly name: "requestClose";
|
|
1116
|
+
readonly type: "function";
|
|
1117
|
+
readonly stateMutability: "nonpayable";
|
|
1118
|
+
readonly inputs: readonly [{
|
|
1119
|
+
readonly type: "tuple";
|
|
1120
|
+
readonly name: "descriptor";
|
|
1121
|
+
readonly components: readonly [{
|
|
1122
|
+
readonly type: "address";
|
|
1123
|
+
readonly name: "payer";
|
|
1124
|
+
}, {
|
|
1125
|
+
readonly type: "address";
|
|
1126
|
+
readonly name: "payee";
|
|
1127
|
+
}, {
|
|
1128
|
+
readonly type: "address";
|
|
1129
|
+
readonly name: "operator";
|
|
1130
|
+
}, {
|
|
1131
|
+
readonly type: "address";
|
|
1132
|
+
readonly name: "token";
|
|
1133
|
+
}, {
|
|
1134
|
+
readonly type: "bytes32";
|
|
1135
|
+
readonly name: "salt";
|
|
1136
|
+
}, {
|
|
1137
|
+
readonly type: "address";
|
|
1138
|
+
readonly name: "authorizedSigner";
|
|
1139
|
+
}, {
|
|
1140
|
+
readonly type: "bytes32";
|
|
1141
|
+
readonly name: "expiringNonceHash";
|
|
1142
|
+
}];
|
|
1143
|
+
}];
|
|
1144
|
+
readonly outputs: readonly [];
|
|
1145
|
+
}, {
|
|
1146
|
+
readonly name: "withdraw";
|
|
1147
|
+
readonly type: "function";
|
|
1148
|
+
readonly stateMutability: "nonpayable";
|
|
1149
|
+
readonly inputs: readonly [{
|
|
1150
|
+
readonly type: "tuple";
|
|
1151
|
+
readonly name: "descriptor";
|
|
1152
|
+
readonly components: readonly [{
|
|
1153
|
+
readonly type: "address";
|
|
1154
|
+
readonly name: "payer";
|
|
1155
|
+
}, {
|
|
1156
|
+
readonly type: "address";
|
|
1157
|
+
readonly name: "payee";
|
|
1158
|
+
}, {
|
|
1159
|
+
readonly type: "address";
|
|
1160
|
+
readonly name: "operator";
|
|
1161
|
+
}, {
|
|
1162
|
+
readonly type: "address";
|
|
1163
|
+
readonly name: "token";
|
|
1164
|
+
}, {
|
|
1165
|
+
readonly type: "bytes32";
|
|
1166
|
+
readonly name: "salt";
|
|
1167
|
+
}, {
|
|
1168
|
+
readonly type: "address";
|
|
1169
|
+
readonly name: "authorizedSigner";
|
|
1170
|
+
}, {
|
|
1171
|
+
readonly type: "bytes32";
|
|
1172
|
+
readonly name: "expiringNonceHash";
|
|
1173
|
+
}];
|
|
1174
|
+
}];
|
|
1175
|
+
readonly outputs: readonly [];
|
|
1176
|
+
}, {
|
|
1177
|
+
readonly name: "getChannel";
|
|
1178
|
+
readonly type: "function";
|
|
1179
|
+
readonly stateMutability: "view";
|
|
1180
|
+
readonly inputs: readonly [{
|
|
1181
|
+
readonly type: "tuple";
|
|
1182
|
+
readonly name: "descriptor";
|
|
1183
|
+
readonly components: readonly [{
|
|
1184
|
+
readonly type: "address";
|
|
1185
|
+
readonly name: "payer";
|
|
1186
|
+
}, {
|
|
1187
|
+
readonly type: "address";
|
|
1188
|
+
readonly name: "payee";
|
|
1189
|
+
}, {
|
|
1190
|
+
readonly type: "address";
|
|
1191
|
+
readonly name: "operator";
|
|
1192
|
+
}, {
|
|
1193
|
+
readonly type: "address";
|
|
1194
|
+
readonly name: "token";
|
|
1195
|
+
}, {
|
|
1196
|
+
readonly type: "bytes32";
|
|
1197
|
+
readonly name: "salt";
|
|
1198
|
+
}, {
|
|
1199
|
+
readonly type: "address";
|
|
1200
|
+
readonly name: "authorizedSigner";
|
|
1201
|
+
}, {
|
|
1202
|
+
readonly type: "bytes32";
|
|
1203
|
+
readonly name: "expiringNonceHash";
|
|
1204
|
+
}];
|
|
1205
|
+
}];
|
|
1206
|
+
readonly outputs: readonly [{
|
|
1207
|
+
readonly type: "tuple";
|
|
1208
|
+
readonly components: readonly [{
|
|
1209
|
+
readonly type: "tuple";
|
|
1210
|
+
readonly name: "descriptor";
|
|
1211
|
+
readonly components: readonly [{
|
|
1212
|
+
readonly type: "address";
|
|
1213
|
+
readonly name: "payer";
|
|
1214
|
+
}, {
|
|
1215
|
+
readonly type: "address";
|
|
1216
|
+
readonly name: "payee";
|
|
1217
|
+
}, {
|
|
1218
|
+
readonly type: "address";
|
|
1219
|
+
readonly name: "operator";
|
|
1220
|
+
}, {
|
|
1221
|
+
readonly type: "address";
|
|
1222
|
+
readonly name: "token";
|
|
1223
|
+
}, {
|
|
1224
|
+
readonly type: "bytes32";
|
|
1225
|
+
readonly name: "salt";
|
|
1226
|
+
}, {
|
|
1227
|
+
readonly type: "address";
|
|
1228
|
+
readonly name: "authorizedSigner";
|
|
1229
|
+
}, {
|
|
1230
|
+
readonly type: "bytes32";
|
|
1231
|
+
readonly name: "expiringNonceHash";
|
|
1232
|
+
}];
|
|
1233
|
+
}, {
|
|
1234
|
+
readonly type: "tuple";
|
|
1235
|
+
readonly name: "state";
|
|
1236
|
+
readonly components: readonly [{
|
|
1237
|
+
readonly type: "uint96";
|
|
1238
|
+
readonly name: "settled";
|
|
1239
|
+
}, {
|
|
1240
|
+
readonly type: "uint96";
|
|
1241
|
+
readonly name: "deposit";
|
|
1242
|
+
}, {
|
|
1243
|
+
readonly type: "uint32";
|
|
1244
|
+
readonly name: "closeRequestedAt";
|
|
1245
|
+
}];
|
|
1246
|
+
}];
|
|
1247
|
+
}];
|
|
1248
|
+
}, {
|
|
1249
|
+
readonly name: "getChannelState";
|
|
1250
|
+
readonly type: "function";
|
|
1251
|
+
readonly stateMutability: "view";
|
|
1252
|
+
readonly inputs: readonly [{
|
|
1253
|
+
readonly type: "bytes32";
|
|
1254
|
+
readonly name: "channelId";
|
|
1255
|
+
}];
|
|
1256
|
+
readonly outputs: readonly [{
|
|
1257
|
+
readonly type: "tuple";
|
|
1258
|
+
readonly components: readonly [{
|
|
1259
|
+
readonly type: "uint96";
|
|
1260
|
+
readonly name: "settled";
|
|
1261
|
+
}, {
|
|
1262
|
+
readonly type: "uint96";
|
|
1263
|
+
readonly name: "deposit";
|
|
1264
|
+
}, {
|
|
1265
|
+
readonly type: "uint32";
|
|
1266
|
+
readonly name: "closeRequestedAt";
|
|
1267
|
+
}];
|
|
1268
|
+
}];
|
|
1269
|
+
}, {
|
|
1270
|
+
readonly name: "getChannelStatesBatch";
|
|
1271
|
+
readonly type: "function";
|
|
1272
|
+
readonly stateMutability: "view";
|
|
1273
|
+
readonly inputs: readonly [{
|
|
1274
|
+
readonly type: "bytes32[]";
|
|
1275
|
+
readonly name: "channelIds";
|
|
1276
|
+
}];
|
|
1277
|
+
readonly outputs: readonly [{
|
|
1278
|
+
readonly type: "tuple[]";
|
|
1279
|
+
readonly components: readonly [{
|
|
1280
|
+
readonly type: "uint96";
|
|
1281
|
+
readonly name: "settled";
|
|
1282
|
+
}, {
|
|
1283
|
+
readonly type: "uint96";
|
|
1284
|
+
readonly name: "deposit";
|
|
1285
|
+
}, {
|
|
1286
|
+
readonly type: "uint32";
|
|
1287
|
+
readonly name: "closeRequestedAt";
|
|
1288
|
+
}];
|
|
1289
|
+
}];
|
|
1290
|
+
}, {
|
|
1291
|
+
readonly name: "computeChannelId";
|
|
1292
|
+
readonly type: "function";
|
|
1293
|
+
readonly stateMutability: "view";
|
|
1294
|
+
readonly inputs: readonly [{
|
|
1295
|
+
readonly type: "address";
|
|
1296
|
+
readonly name: "payer";
|
|
1297
|
+
}, {
|
|
1298
|
+
readonly type: "address";
|
|
1299
|
+
readonly name: "payee";
|
|
1300
|
+
}, {
|
|
1301
|
+
readonly type: "address";
|
|
1302
|
+
readonly name: "operator";
|
|
1303
|
+
}, {
|
|
1304
|
+
readonly type: "address";
|
|
1305
|
+
readonly name: "token";
|
|
1306
|
+
}, {
|
|
1307
|
+
readonly type: "bytes32";
|
|
1308
|
+
readonly name: "salt";
|
|
1309
|
+
}, {
|
|
1310
|
+
readonly type: "address";
|
|
1311
|
+
readonly name: "authorizedSigner";
|
|
1312
|
+
}, {
|
|
1313
|
+
readonly type: "bytes32";
|
|
1314
|
+
readonly name: "expiringNonceHash";
|
|
1315
|
+
}];
|
|
1316
|
+
readonly outputs: readonly [{
|
|
1317
|
+
readonly type: "bytes32";
|
|
1318
|
+
}];
|
|
1319
|
+
}, {
|
|
1320
|
+
readonly name: "getVoucherDigest";
|
|
1321
|
+
readonly type: "function";
|
|
1322
|
+
readonly stateMutability: "view";
|
|
1323
|
+
readonly inputs: readonly [{
|
|
1324
|
+
readonly type: "bytes32";
|
|
1325
|
+
readonly name: "channelId";
|
|
1326
|
+
}, {
|
|
1327
|
+
readonly type: "uint96";
|
|
1328
|
+
readonly name: "cumulativeAmount";
|
|
1329
|
+
}];
|
|
1330
|
+
readonly outputs: readonly [{
|
|
1331
|
+
readonly type: "bytes32";
|
|
1332
|
+
}];
|
|
1333
|
+
}, {
|
|
1334
|
+
readonly name: "domainSeparator";
|
|
1335
|
+
readonly type: "function";
|
|
1336
|
+
readonly stateMutability: "view";
|
|
1337
|
+
readonly inputs: readonly [];
|
|
1338
|
+
readonly outputs: readonly [{
|
|
1339
|
+
readonly type: "bytes32";
|
|
1340
|
+
}];
|
|
1341
|
+
}, {
|
|
1342
|
+
readonly name: "ChannelOpened";
|
|
1343
|
+
readonly type: "event";
|
|
1344
|
+
readonly inputs: readonly [{
|
|
1345
|
+
readonly type: "bytes32";
|
|
1346
|
+
readonly name: "channelId";
|
|
1347
|
+
readonly indexed: true;
|
|
1348
|
+
}, {
|
|
1349
|
+
readonly type: "address";
|
|
1350
|
+
readonly name: "payer";
|
|
1351
|
+
readonly indexed: true;
|
|
1352
|
+
}, {
|
|
1353
|
+
readonly type: "address";
|
|
1354
|
+
readonly name: "payee";
|
|
1355
|
+
readonly indexed: true;
|
|
1356
|
+
}, {
|
|
1357
|
+
readonly type: "address";
|
|
1358
|
+
readonly name: "operator";
|
|
1359
|
+
}, {
|
|
1360
|
+
readonly type: "address";
|
|
1361
|
+
readonly name: "token";
|
|
1362
|
+
}, {
|
|
1363
|
+
readonly type: "address";
|
|
1364
|
+
readonly name: "authorizedSigner";
|
|
1365
|
+
}, {
|
|
1366
|
+
readonly type: "bytes32";
|
|
1367
|
+
readonly name: "salt";
|
|
1368
|
+
}, {
|
|
1369
|
+
readonly type: "bytes32";
|
|
1370
|
+
readonly name: "expiringNonceHash";
|
|
1371
|
+
}, {
|
|
1372
|
+
readonly type: "uint96";
|
|
1373
|
+
readonly name: "deposit";
|
|
1374
|
+
}];
|
|
1375
|
+
}, {
|
|
1376
|
+
readonly name: "Settled";
|
|
1377
|
+
readonly type: "event";
|
|
1378
|
+
readonly inputs: readonly [{
|
|
1379
|
+
readonly type: "bytes32";
|
|
1380
|
+
readonly name: "channelId";
|
|
1381
|
+
readonly indexed: true;
|
|
1382
|
+
}, {
|
|
1383
|
+
readonly type: "address";
|
|
1384
|
+
readonly name: "payer";
|
|
1385
|
+
readonly indexed: true;
|
|
1386
|
+
}, {
|
|
1387
|
+
readonly type: "address";
|
|
1388
|
+
readonly name: "payee";
|
|
1389
|
+
readonly indexed: true;
|
|
1390
|
+
}, {
|
|
1391
|
+
readonly type: "uint96";
|
|
1392
|
+
readonly name: "cumulativeAmount";
|
|
1393
|
+
}, {
|
|
1394
|
+
readonly type: "uint96";
|
|
1395
|
+
readonly name: "deltaPaid";
|
|
1396
|
+
}, {
|
|
1397
|
+
readonly type: "uint96";
|
|
1398
|
+
readonly name: "newSettled";
|
|
1399
|
+
}];
|
|
1400
|
+
}, {
|
|
1401
|
+
readonly name: "TopUp";
|
|
1402
|
+
readonly type: "event";
|
|
1403
|
+
readonly inputs: readonly [{
|
|
1404
|
+
readonly type: "bytes32";
|
|
1405
|
+
readonly name: "channelId";
|
|
1406
|
+
readonly indexed: true;
|
|
1407
|
+
}, {
|
|
1408
|
+
readonly type: "address";
|
|
1409
|
+
readonly name: "payer";
|
|
1410
|
+
readonly indexed: true;
|
|
1411
|
+
}, {
|
|
1412
|
+
readonly type: "address";
|
|
1413
|
+
readonly name: "payee";
|
|
1414
|
+
readonly indexed: true;
|
|
1415
|
+
}, {
|
|
1416
|
+
readonly type: "uint96";
|
|
1417
|
+
readonly name: "additionalDeposit";
|
|
1418
|
+
}, {
|
|
1419
|
+
readonly type: "uint96";
|
|
1420
|
+
readonly name: "newDeposit";
|
|
1421
|
+
}];
|
|
1422
|
+
}, {
|
|
1423
|
+
readonly name: "CloseRequested";
|
|
1424
|
+
readonly type: "event";
|
|
1425
|
+
readonly inputs: readonly [{
|
|
1426
|
+
readonly type: "bytes32";
|
|
1427
|
+
readonly name: "channelId";
|
|
1428
|
+
readonly indexed: true;
|
|
1429
|
+
}, {
|
|
1430
|
+
readonly type: "address";
|
|
1431
|
+
readonly name: "payer";
|
|
1432
|
+
readonly indexed: true;
|
|
1433
|
+
}, {
|
|
1434
|
+
readonly type: "address";
|
|
1435
|
+
readonly name: "payee";
|
|
1436
|
+
readonly indexed: true;
|
|
1437
|
+
}, {
|
|
1438
|
+
readonly type: "uint256";
|
|
1439
|
+
readonly name: "closeGraceEnd";
|
|
1440
|
+
}];
|
|
1441
|
+
}, {
|
|
1442
|
+
readonly name: "ChannelClosed";
|
|
1443
|
+
readonly type: "event";
|
|
1444
|
+
readonly inputs: readonly [{
|
|
1445
|
+
readonly type: "bytes32";
|
|
1446
|
+
readonly name: "channelId";
|
|
1447
|
+
readonly indexed: true;
|
|
1448
|
+
}, {
|
|
1449
|
+
readonly type: "address";
|
|
1450
|
+
readonly name: "payer";
|
|
1451
|
+
readonly indexed: true;
|
|
1452
|
+
}, {
|
|
1453
|
+
readonly type: "address";
|
|
1454
|
+
readonly name: "payee";
|
|
1455
|
+
readonly indexed: true;
|
|
1456
|
+
}, {
|
|
1457
|
+
readonly type: "uint96";
|
|
1458
|
+
readonly name: "settledToPayee";
|
|
1459
|
+
}, {
|
|
1460
|
+
readonly type: "uint96";
|
|
1461
|
+
readonly name: "refundedToPayer";
|
|
1462
|
+
}];
|
|
1463
|
+
}, {
|
|
1464
|
+
readonly name: "CloseRequestCancelled";
|
|
1465
|
+
readonly type: "event";
|
|
1466
|
+
readonly inputs: readonly [{
|
|
1467
|
+
readonly type: "bytes32";
|
|
1468
|
+
readonly name: "channelId";
|
|
1469
|
+
readonly indexed: true;
|
|
1470
|
+
}, {
|
|
1471
|
+
readonly type: "address";
|
|
1472
|
+
readonly name: "payer";
|
|
1473
|
+
readonly indexed: true;
|
|
1474
|
+
}, {
|
|
1475
|
+
readonly type: "address";
|
|
1476
|
+
readonly name: "payee";
|
|
1477
|
+
readonly indexed: true;
|
|
1478
|
+
}];
|
|
1479
|
+
}, {
|
|
1480
|
+
readonly name: "ChannelAlreadyExists";
|
|
1481
|
+
readonly type: "error";
|
|
1482
|
+
readonly inputs: readonly [];
|
|
1483
|
+
}, {
|
|
1484
|
+
readonly name: "ChannelNotFound";
|
|
1485
|
+
readonly type: "error";
|
|
1486
|
+
readonly inputs: readonly [];
|
|
1487
|
+
}, {
|
|
1488
|
+
readonly name: "NotPayer";
|
|
1489
|
+
readonly type: "error";
|
|
1490
|
+
readonly inputs: readonly [];
|
|
1491
|
+
}, {
|
|
1492
|
+
readonly name: "NotPayeeOrOperator";
|
|
1493
|
+
readonly type: "error";
|
|
1494
|
+
readonly inputs: readonly [];
|
|
1495
|
+
}, {
|
|
1496
|
+
readonly name: "InvalidPayee";
|
|
1497
|
+
readonly type: "error";
|
|
1498
|
+
readonly inputs: readonly [];
|
|
1499
|
+
}, {
|
|
1500
|
+
readonly name: "ZeroDeposit";
|
|
1501
|
+
readonly type: "error";
|
|
1502
|
+
readonly inputs: readonly [];
|
|
1503
|
+
}, {
|
|
1504
|
+
readonly name: "ExpiringNonceHashNotSet";
|
|
1505
|
+
readonly type: "error";
|
|
1506
|
+
readonly inputs: readonly [];
|
|
1507
|
+
}, {
|
|
1508
|
+
readonly name: "InvalidSignature";
|
|
1509
|
+
readonly type: "error";
|
|
1510
|
+
readonly inputs: readonly [];
|
|
1511
|
+
}, {
|
|
1512
|
+
readonly name: "AmountExceedsDeposit";
|
|
1513
|
+
readonly type: "error";
|
|
1514
|
+
readonly inputs: readonly [];
|
|
1515
|
+
}, {
|
|
1516
|
+
readonly name: "AmountNotIncreasing";
|
|
1517
|
+
readonly type: "error";
|
|
1518
|
+
readonly inputs: readonly [];
|
|
1519
|
+
}, {
|
|
1520
|
+
readonly name: "CaptureAmountInvalid";
|
|
1521
|
+
readonly type: "error";
|
|
1522
|
+
readonly inputs: readonly [];
|
|
1523
|
+
}, {
|
|
1524
|
+
readonly name: "CloseNotReady";
|
|
1525
|
+
readonly type: "error";
|
|
1526
|
+
readonly inputs: readonly [];
|
|
1527
|
+
}, {
|
|
1528
|
+
readonly name: "DepositOverflow";
|
|
1529
|
+
readonly type: "error";
|
|
1530
|
+
readonly inputs: readonly [];
|
|
1531
|
+
}], "ChannelOpened">;
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* Opens and funds a TIP-20 channel reserve channel and waits for the
|
|
1535
|
+
* transaction receipt.
|
|
1536
|
+
*
|
|
1537
|
+
* @example
|
|
1538
|
+
* ```ts
|
|
1539
|
+
* import { createClient, http } from 'viem'
|
|
1540
|
+
* import { tempo } from 'viem/chains'
|
|
1541
|
+
* import { Actions } from 'viem/tempo'
|
|
1542
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1543
|
+
*
|
|
1544
|
+
* const client = createClient({
|
|
1545
|
+
* account: privateKeyToAccount('0x...'),
|
|
1546
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
1547
|
+
* transport: http(),
|
|
1548
|
+
* })
|
|
1549
|
+
*
|
|
1550
|
+
* const result = await Actions.channel.openSync(client, {
|
|
1551
|
+
* deposit: 100n,
|
|
1552
|
+
* payee: '0x...',
|
|
1553
|
+
* token: 1n,
|
|
1554
|
+
* })
|
|
1555
|
+
* ```
|
|
1556
|
+
*
|
|
1557
|
+
* @param client - Client.
|
|
1558
|
+
* @param parameters - Parameters.
|
|
1559
|
+
* @returns The transaction receipt and event data.
|
|
1560
|
+
*/
|
|
1561
|
+
export declare function openSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: openSync.Parameters<chain, account>): Promise<openSync.ReturnValue>;
|
|
1562
|
+
export declare namespace openSync {
|
|
1563
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = open.Parameters<chain, account>;
|
|
1564
|
+
type Args = open.Args;
|
|
1565
|
+
type ReturnValue = Compute<GetEventArgs<typeof Abis.tip20ChannelReserve, 'ChannelOpened', {
|
|
1566
|
+
IndexedOnly: false;
|
|
1567
|
+
Required: true;
|
|
1568
|
+
}> & {
|
|
1569
|
+
/** Transaction receipt. */
|
|
1570
|
+
receipt: TransactionReceipt;
|
|
1571
|
+
}>;
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* Starts the payer close timer for a TIP-20 channel reserve channel.
|
|
1575
|
+
*
|
|
1576
|
+
* @example
|
|
1577
|
+
* ```ts
|
|
1578
|
+
* import { Actions } from 'viem/tempo'
|
|
1579
|
+
*
|
|
1580
|
+
* const hash = await Actions.channel.requestClose(client, {
|
|
1581
|
+
* channel,
|
|
1582
|
+
* })
|
|
1583
|
+
* ```
|
|
1584
|
+
*
|
|
1585
|
+
* @param client - Client.
|
|
1586
|
+
* @param parameters - Parameters.
|
|
1587
|
+
* @returns The transaction hash.
|
|
1588
|
+
*/
|
|
1589
|
+
export declare function requestClose<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: requestClose.Parameters<chain, account>): Promise<requestClose.ReturnValue>;
|
|
1590
|
+
export declare namespace requestClose {
|
|
1591
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
|
|
1592
|
+
type Args = {
|
|
1593
|
+
/** TIP-20 channel. */
|
|
1594
|
+
channel: ox_Channel.from.Value;
|
|
1595
|
+
};
|
|
1596
|
+
type ReturnValue = WriteContractReturnType;
|
|
1597
|
+
type ErrorType = BaseErrorType;
|
|
1598
|
+
/** @internal */
|
|
1599
|
+
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>>;
|
|
1600
|
+
/**
|
|
1601
|
+
* Defines a call to the `requestClose` function.
|
|
1602
|
+
*
|
|
1603
|
+
* @param args - Arguments.
|
|
1604
|
+
* @returns The call.
|
|
1605
|
+
*/
|
|
1606
|
+
function call(args: Args): {
|
|
1607
|
+
abi: [{
|
|
1608
|
+
readonly name: "requestClose";
|
|
1609
|
+
readonly type: "function";
|
|
1610
|
+
readonly stateMutability: "nonpayable";
|
|
1611
|
+
readonly inputs: readonly [{
|
|
1612
|
+
readonly type: "tuple";
|
|
1613
|
+
readonly name: "descriptor";
|
|
1614
|
+
readonly components: readonly [{
|
|
1615
|
+
readonly type: "address";
|
|
1616
|
+
readonly name: "payer";
|
|
1617
|
+
}, {
|
|
1618
|
+
readonly type: "address";
|
|
1619
|
+
readonly name: "payee";
|
|
1620
|
+
}, {
|
|
1621
|
+
readonly type: "address";
|
|
1622
|
+
readonly name: "operator";
|
|
1623
|
+
}, {
|
|
1624
|
+
readonly type: "address";
|
|
1625
|
+
readonly name: "token";
|
|
1626
|
+
}, {
|
|
1627
|
+
readonly type: "bytes32";
|
|
1628
|
+
readonly name: "salt";
|
|
1629
|
+
}, {
|
|
1630
|
+
readonly type: "address";
|
|
1631
|
+
readonly name: "authorizedSigner";
|
|
1632
|
+
}, {
|
|
1633
|
+
readonly type: "bytes32";
|
|
1634
|
+
readonly name: "expiringNonceHash";
|
|
1635
|
+
}];
|
|
1636
|
+
}];
|
|
1637
|
+
readonly outputs: readonly [];
|
|
1638
|
+
}];
|
|
1639
|
+
functionName: "requestClose";
|
|
1640
|
+
} & {
|
|
1641
|
+
args: readonly [{
|
|
1642
|
+
payer: `0x${string}`;
|
|
1643
|
+
payee: `0x${string}`;
|
|
1644
|
+
operator: `0x${string}`;
|
|
1645
|
+
token: `0x${string}`;
|
|
1646
|
+
salt: `0x${string}`;
|
|
1647
|
+
authorizedSigner: `0x${string}`;
|
|
1648
|
+
expiringNonceHash: `0x${string}`;
|
|
1649
|
+
}];
|
|
1650
|
+
} & {
|
|
1651
|
+
address: import("abitype").Address;
|
|
1652
|
+
} & {
|
|
1653
|
+
data: import("../../index.js").Hex;
|
|
1654
|
+
to: import("abitype").Address;
|
|
1655
|
+
};
|
|
1656
|
+
/**
|
|
1657
|
+
* Extracts the `CloseRequested` event from logs.
|
|
1658
|
+
*
|
|
1659
|
+
* @param logs - The logs.
|
|
1660
|
+
* @returns The `CloseRequested` event.
|
|
1661
|
+
*/
|
|
1662
|
+
function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
|
|
1663
|
+
readonly name: "CLOSE_GRACE_PERIOD";
|
|
1664
|
+
readonly type: "function";
|
|
1665
|
+
readonly stateMutability: "view";
|
|
1666
|
+
readonly inputs: readonly [];
|
|
1667
|
+
readonly outputs: readonly [{
|
|
1668
|
+
readonly type: "uint64";
|
|
1669
|
+
}];
|
|
1670
|
+
}, {
|
|
1671
|
+
readonly name: "VOUCHER_TYPEHASH";
|
|
1672
|
+
readonly type: "function";
|
|
1673
|
+
readonly stateMutability: "view";
|
|
1674
|
+
readonly inputs: readonly [];
|
|
1675
|
+
readonly outputs: readonly [{
|
|
1676
|
+
readonly type: "bytes32";
|
|
1677
|
+
}];
|
|
1678
|
+
}, {
|
|
1679
|
+
readonly name: "open";
|
|
1680
|
+
readonly type: "function";
|
|
1681
|
+
readonly stateMutability: "nonpayable";
|
|
1682
|
+
readonly inputs: readonly [{
|
|
1683
|
+
readonly type: "address";
|
|
1684
|
+
readonly name: "payee";
|
|
1685
|
+
}, {
|
|
1686
|
+
readonly type: "address";
|
|
1687
|
+
readonly name: "operator";
|
|
1688
|
+
}, {
|
|
1689
|
+
readonly type: "address";
|
|
1690
|
+
readonly name: "token";
|
|
1691
|
+
}, {
|
|
1692
|
+
readonly type: "uint96";
|
|
1693
|
+
readonly name: "deposit";
|
|
1694
|
+
}, {
|
|
1695
|
+
readonly type: "bytes32";
|
|
1696
|
+
readonly name: "salt";
|
|
1697
|
+
}, {
|
|
1698
|
+
readonly type: "address";
|
|
1699
|
+
readonly name: "authorizedSigner";
|
|
1700
|
+
}];
|
|
1701
|
+
readonly outputs: readonly [{
|
|
1702
|
+
readonly type: "bytes32";
|
|
1703
|
+
readonly name: "channelId";
|
|
1704
|
+
}];
|
|
1705
|
+
}, {
|
|
1706
|
+
readonly name: "settle";
|
|
1707
|
+
readonly type: "function";
|
|
1708
|
+
readonly stateMutability: "nonpayable";
|
|
1709
|
+
readonly inputs: readonly [{
|
|
1710
|
+
readonly type: "tuple";
|
|
1711
|
+
readonly name: "descriptor";
|
|
1712
|
+
readonly components: readonly [{
|
|
1713
|
+
readonly type: "address";
|
|
1714
|
+
readonly name: "payer";
|
|
1715
|
+
}, {
|
|
1716
|
+
readonly type: "address";
|
|
1717
|
+
readonly name: "payee";
|
|
1718
|
+
}, {
|
|
1719
|
+
readonly type: "address";
|
|
1720
|
+
readonly name: "operator";
|
|
1721
|
+
}, {
|
|
1722
|
+
readonly type: "address";
|
|
1723
|
+
readonly name: "token";
|
|
1724
|
+
}, {
|
|
1725
|
+
readonly type: "bytes32";
|
|
1726
|
+
readonly name: "salt";
|
|
1727
|
+
}, {
|
|
1728
|
+
readonly type: "address";
|
|
1729
|
+
readonly name: "authorizedSigner";
|
|
1730
|
+
}, {
|
|
1731
|
+
readonly type: "bytes32";
|
|
1732
|
+
readonly name: "expiringNonceHash";
|
|
1733
|
+
}];
|
|
1734
|
+
}, {
|
|
1735
|
+
readonly type: "uint96";
|
|
1736
|
+
readonly name: "cumulativeAmount";
|
|
1737
|
+
}, {
|
|
1738
|
+
readonly type: "bytes";
|
|
1739
|
+
readonly name: "signature";
|
|
1740
|
+
}];
|
|
1741
|
+
readonly outputs: readonly [];
|
|
1742
|
+
}, {
|
|
1743
|
+
readonly name: "topUp";
|
|
1744
|
+
readonly type: "function";
|
|
1745
|
+
readonly stateMutability: "nonpayable";
|
|
1746
|
+
readonly inputs: readonly [{
|
|
1747
|
+
readonly type: "tuple";
|
|
1748
|
+
readonly name: "descriptor";
|
|
1749
|
+
readonly components: readonly [{
|
|
1750
|
+
readonly type: "address";
|
|
1751
|
+
readonly name: "payer";
|
|
1752
|
+
}, {
|
|
1753
|
+
readonly type: "address";
|
|
1754
|
+
readonly name: "payee";
|
|
1755
|
+
}, {
|
|
1756
|
+
readonly type: "address";
|
|
1757
|
+
readonly name: "operator";
|
|
1758
|
+
}, {
|
|
1759
|
+
readonly type: "address";
|
|
1760
|
+
readonly name: "token";
|
|
1761
|
+
}, {
|
|
1762
|
+
readonly type: "bytes32";
|
|
1763
|
+
readonly name: "salt";
|
|
1764
|
+
}, {
|
|
1765
|
+
readonly type: "address";
|
|
1766
|
+
readonly name: "authorizedSigner";
|
|
1767
|
+
}, {
|
|
1768
|
+
readonly type: "bytes32";
|
|
1769
|
+
readonly name: "expiringNonceHash";
|
|
1770
|
+
}];
|
|
1771
|
+
}, {
|
|
1772
|
+
readonly type: "uint96";
|
|
1773
|
+
readonly name: "additionalDeposit";
|
|
1774
|
+
}];
|
|
1775
|
+
readonly outputs: readonly [];
|
|
1776
|
+
}, {
|
|
1777
|
+
readonly name: "close";
|
|
1778
|
+
readonly type: "function";
|
|
1779
|
+
readonly stateMutability: "nonpayable";
|
|
1780
|
+
readonly inputs: readonly [{
|
|
1781
|
+
readonly type: "tuple";
|
|
1782
|
+
readonly name: "descriptor";
|
|
1783
|
+
readonly components: readonly [{
|
|
1784
|
+
readonly type: "address";
|
|
1785
|
+
readonly name: "payer";
|
|
1786
|
+
}, {
|
|
1787
|
+
readonly type: "address";
|
|
1788
|
+
readonly name: "payee";
|
|
1789
|
+
}, {
|
|
1790
|
+
readonly type: "address";
|
|
1791
|
+
readonly name: "operator";
|
|
1792
|
+
}, {
|
|
1793
|
+
readonly type: "address";
|
|
1794
|
+
readonly name: "token";
|
|
1795
|
+
}, {
|
|
1796
|
+
readonly type: "bytes32";
|
|
1797
|
+
readonly name: "salt";
|
|
1798
|
+
}, {
|
|
1799
|
+
readonly type: "address";
|
|
1800
|
+
readonly name: "authorizedSigner";
|
|
1801
|
+
}, {
|
|
1802
|
+
readonly type: "bytes32";
|
|
1803
|
+
readonly name: "expiringNonceHash";
|
|
1804
|
+
}];
|
|
1805
|
+
}, {
|
|
1806
|
+
readonly type: "uint96";
|
|
1807
|
+
readonly name: "cumulativeAmount";
|
|
1808
|
+
}, {
|
|
1809
|
+
readonly type: "uint96";
|
|
1810
|
+
readonly name: "captureAmount";
|
|
1811
|
+
}, {
|
|
1812
|
+
readonly type: "bytes";
|
|
1813
|
+
readonly name: "signature";
|
|
1814
|
+
}];
|
|
1815
|
+
readonly outputs: readonly [];
|
|
1816
|
+
}, {
|
|
1817
|
+
readonly name: "requestClose";
|
|
1818
|
+
readonly type: "function";
|
|
1819
|
+
readonly stateMutability: "nonpayable";
|
|
1820
|
+
readonly inputs: readonly [{
|
|
1821
|
+
readonly type: "tuple";
|
|
1822
|
+
readonly name: "descriptor";
|
|
1823
|
+
readonly components: readonly [{
|
|
1824
|
+
readonly type: "address";
|
|
1825
|
+
readonly name: "payer";
|
|
1826
|
+
}, {
|
|
1827
|
+
readonly type: "address";
|
|
1828
|
+
readonly name: "payee";
|
|
1829
|
+
}, {
|
|
1830
|
+
readonly type: "address";
|
|
1831
|
+
readonly name: "operator";
|
|
1832
|
+
}, {
|
|
1833
|
+
readonly type: "address";
|
|
1834
|
+
readonly name: "token";
|
|
1835
|
+
}, {
|
|
1836
|
+
readonly type: "bytes32";
|
|
1837
|
+
readonly name: "salt";
|
|
1838
|
+
}, {
|
|
1839
|
+
readonly type: "address";
|
|
1840
|
+
readonly name: "authorizedSigner";
|
|
1841
|
+
}, {
|
|
1842
|
+
readonly type: "bytes32";
|
|
1843
|
+
readonly name: "expiringNonceHash";
|
|
1844
|
+
}];
|
|
1845
|
+
}];
|
|
1846
|
+
readonly outputs: readonly [];
|
|
1847
|
+
}, {
|
|
1848
|
+
readonly name: "withdraw";
|
|
1849
|
+
readonly type: "function";
|
|
1850
|
+
readonly stateMutability: "nonpayable";
|
|
1851
|
+
readonly inputs: readonly [{
|
|
1852
|
+
readonly type: "tuple";
|
|
1853
|
+
readonly name: "descriptor";
|
|
1854
|
+
readonly components: readonly [{
|
|
1855
|
+
readonly type: "address";
|
|
1856
|
+
readonly name: "payer";
|
|
1857
|
+
}, {
|
|
1858
|
+
readonly type: "address";
|
|
1859
|
+
readonly name: "payee";
|
|
1860
|
+
}, {
|
|
1861
|
+
readonly type: "address";
|
|
1862
|
+
readonly name: "operator";
|
|
1863
|
+
}, {
|
|
1864
|
+
readonly type: "address";
|
|
1865
|
+
readonly name: "token";
|
|
1866
|
+
}, {
|
|
1867
|
+
readonly type: "bytes32";
|
|
1868
|
+
readonly name: "salt";
|
|
1869
|
+
}, {
|
|
1870
|
+
readonly type: "address";
|
|
1871
|
+
readonly name: "authorizedSigner";
|
|
1872
|
+
}, {
|
|
1873
|
+
readonly type: "bytes32";
|
|
1874
|
+
readonly name: "expiringNonceHash";
|
|
1875
|
+
}];
|
|
1876
|
+
}];
|
|
1877
|
+
readonly outputs: readonly [];
|
|
1878
|
+
}, {
|
|
1879
|
+
readonly name: "getChannel";
|
|
1880
|
+
readonly type: "function";
|
|
1881
|
+
readonly stateMutability: "view";
|
|
1882
|
+
readonly inputs: readonly [{
|
|
1883
|
+
readonly type: "tuple";
|
|
1884
|
+
readonly name: "descriptor";
|
|
1885
|
+
readonly components: readonly [{
|
|
1886
|
+
readonly type: "address";
|
|
1887
|
+
readonly name: "payer";
|
|
1888
|
+
}, {
|
|
1889
|
+
readonly type: "address";
|
|
1890
|
+
readonly name: "payee";
|
|
1891
|
+
}, {
|
|
1892
|
+
readonly type: "address";
|
|
1893
|
+
readonly name: "operator";
|
|
1894
|
+
}, {
|
|
1895
|
+
readonly type: "address";
|
|
1896
|
+
readonly name: "token";
|
|
1897
|
+
}, {
|
|
1898
|
+
readonly type: "bytes32";
|
|
1899
|
+
readonly name: "salt";
|
|
1900
|
+
}, {
|
|
1901
|
+
readonly type: "address";
|
|
1902
|
+
readonly name: "authorizedSigner";
|
|
1903
|
+
}, {
|
|
1904
|
+
readonly type: "bytes32";
|
|
1905
|
+
readonly name: "expiringNonceHash";
|
|
1906
|
+
}];
|
|
1907
|
+
}];
|
|
1908
|
+
readonly outputs: readonly [{
|
|
1909
|
+
readonly type: "tuple";
|
|
1910
|
+
readonly components: readonly [{
|
|
1911
|
+
readonly type: "tuple";
|
|
1912
|
+
readonly name: "descriptor";
|
|
1913
|
+
readonly components: readonly [{
|
|
1914
|
+
readonly type: "address";
|
|
1915
|
+
readonly name: "payer";
|
|
1916
|
+
}, {
|
|
1917
|
+
readonly type: "address";
|
|
1918
|
+
readonly name: "payee";
|
|
1919
|
+
}, {
|
|
1920
|
+
readonly type: "address";
|
|
1921
|
+
readonly name: "operator";
|
|
1922
|
+
}, {
|
|
1923
|
+
readonly type: "address";
|
|
1924
|
+
readonly name: "token";
|
|
1925
|
+
}, {
|
|
1926
|
+
readonly type: "bytes32";
|
|
1927
|
+
readonly name: "salt";
|
|
1928
|
+
}, {
|
|
1929
|
+
readonly type: "address";
|
|
1930
|
+
readonly name: "authorizedSigner";
|
|
1931
|
+
}, {
|
|
1932
|
+
readonly type: "bytes32";
|
|
1933
|
+
readonly name: "expiringNonceHash";
|
|
1934
|
+
}];
|
|
1935
|
+
}, {
|
|
1936
|
+
readonly type: "tuple";
|
|
1937
|
+
readonly name: "state";
|
|
1938
|
+
readonly components: readonly [{
|
|
1939
|
+
readonly type: "uint96";
|
|
1940
|
+
readonly name: "settled";
|
|
1941
|
+
}, {
|
|
1942
|
+
readonly type: "uint96";
|
|
1943
|
+
readonly name: "deposit";
|
|
1944
|
+
}, {
|
|
1945
|
+
readonly type: "uint32";
|
|
1946
|
+
readonly name: "closeRequestedAt";
|
|
1947
|
+
}];
|
|
1948
|
+
}];
|
|
1949
|
+
}];
|
|
1950
|
+
}, {
|
|
1951
|
+
readonly name: "getChannelState";
|
|
1952
|
+
readonly type: "function";
|
|
1953
|
+
readonly stateMutability: "view";
|
|
1954
|
+
readonly inputs: readonly [{
|
|
1955
|
+
readonly type: "bytes32";
|
|
1956
|
+
readonly name: "channelId";
|
|
1957
|
+
}];
|
|
1958
|
+
readonly outputs: readonly [{
|
|
1959
|
+
readonly type: "tuple";
|
|
1960
|
+
readonly components: readonly [{
|
|
1961
|
+
readonly type: "uint96";
|
|
1962
|
+
readonly name: "settled";
|
|
1963
|
+
}, {
|
|
1964
|
+
readonly type: "uint96";
|
|
1965
|
+
readonly name: "deposit";
|
|
1966
|
+
}, {
|
|
1967
|
+
readonly type: "uint32";
|
|
1968
|
+
readonly name: "closeRequestedAt";
|
|
1969
|
+
}];
|
|
1970
|
+
}];
|
|
1971
|
+
}, {
|
|
1972
|
+
readonly name: "getChannelStatesBatch";
|
|
1973
|
+
readonly type: "function";
|
|
1974
|
+
readonly stateMutability: "view";
|
|
1975
|
+
readonly inputs: readonly [{
|
|
1976
|
+
readonly type: "bytes32[]";
|
|
1977
|
+
readonly name: "channelIds";
|
|
1978
|
+
}];
|
|
1979
|
+
readonly outputs: readonly [{
|
|
1980
|
+
readonly type: "tuple[]";
|
|
1981
|
+
readonly components: readonly [{
|
|
1982
|
+
readonly type: "uint96";
|
|
1983
|
+
readonly name: "settled";
|
|
1984
|
+
}, {
|
|
1985
|
+
readonly type: "uint96";
|
|
1986
|
+
readonly name: "deposit";
|
|
1987
|
+
}, {
|
|
1988
|
+
readonly type: "uint32";
|
|
1989
|
+
readonly name: "closeRequestedAt";
|
|
1990
|
+
}];
|
|
1991
|
+
}];
|
|
1992
|
+
}, {
|
|
1993
|
+
readonly name: "computeChannelId";
|
|
1994
|
+
readonly type: "function";
|
|
1995
|
+
readonly stateMutability: "view";
|
|
1996
|
+
readonly inputs: readonly [{
|
|
1997
|
+
readonly type: "address";
|
|
1998
|
+
readonly name: "payer";
|
|
1999
|
+
}, {
|
|
2000
|
+
readonly type: "address";
|
|
2001
|
+
readonly name: "payee";
|
|
2002
|
+
}, {
|
|
2003
|
+
readonly type: "address";
|
|
2004
|
+
readonly name: "operator";
|
|
2005
|
+
}, {
|
|
2006
|
+
readonly type: "address";
|
|
2007
|
+
readonly name: "token";
|
|
2008
|
+
}, {
|
|
2009
|
+
readonly type: "bytes32";
|
|
2010
|
+
readonly name: "salt";
|
|
2011
|
+
}, {
|
|
2012
|
+
readonly type: "address";
|
|
2013
|
+
readonly name: "authorizedSigner";
|
|
2014
|
+
}, {
|
|
2015
|
+
readonly type: "bytes32";
|
|
2016
|
+
readonly name: "expiringNonceHash";
|
|
2017
|
+
}];
|
|
2018
|
+
readonly outputs: readonly [{
|
|
2019
|
+
readonly type: "bytes32";
|
|
2020
|
+
}];
|
|
2021
|
+
}, {
|
|
2022
|
+
readonly name: "getVoucherDigest";
|
|
2023
|
+
readonly type: "function";
|
|
2024
|
+
readonly stateMutability: "view";
|
|
2025
|
+
readonly inputs: readonly [{
|
|
2026
|
+
readonly type: "bytes32";
|
|
2027
|
+
readonly name: "channelId";
|
|
2028
|
+
}, {
|
|
2029
|
+
readonly type: "uint96";
|
|
2030
|
+
readonly name: "cumulativeAmount";
|
|
2031
|
+
}];
|
|
2032
|
+
readonly outputs: readonly [{
|
|
2033
|
+
readonly type: "bytes32";
|
|
2034
|
+
}];
|
|
2035
|
+
}, {
|
|
2036
|
+
readonly name: "domainSeparator";
|
|
2037
|
+
readonly type: "function";
|
|
2038
|
+
readonly stateMutability: "view";
|
|
2039
|
+
readonly inputs: readonly [];
|
|
2040
|
+
readonly outputs: readonly [{
|
|
2041
|
+
readonly type: "bytes32";
|
|
2042
|
+
}];
|
|
2043
|
+
}, {
|
|
2044
|
+
readonly name: "ChannelOpened";
|
|
2045
|
+
readonly type: "event";
|
|
2046
|
+
readonly inputs: readonly [{
|
|
2047
|
+
readonly type: "bytes32";
|
|
2048
|
+
readonly name: "channelId";
|
|
2049
|
+
readonly indexed: true;
|
|
2050
|
+
}, {
|
|
2051
|
+
readonly type: "address";
|
|
2052
|
+
readonly name: "payer";
|
|
2053
|
+
readonly indexed: true;
|
|
2054
|
+
}, {
|
|
2055
|
+
readonly type: "address";
|
|
2056
|
+
readonly name: "payee";
|
|
2057
|
+
readonly indexed: true;
|
|
2058
|
+
}, {
|
|
2059
|
+
readonly type: "address";
|
|
2060
|
+
readonly name: "operator";
|
|
2061
|
+
}, {
|
|
2062
|
+
readonly type: "address";
|
|
2063
|
+
readonly name: "token";
|
|
2064
|
+
}, {
|
|
2065
|
+
readonly type: "address";
|
|
2066
|
+
readonly name: "authorizedSigner";
|
|
2067
|
+
}, {
|
|
2068
|
+
readonly type: "bytes32";
|
|
2069
|
+
readonly name: "salt";
|
|
2070
|
+
}, {
|
|
2071
|
+
readonly type: "bytes32";
|
|
2072
|
+
readonly name: "expiringNonceHash";
|
|
2073
|
+
}, {
|
|
2074
|
+
readonly type: "uint96";
|
|
2075
|
+
readonly name: "deposit";
|
|
2076
|
+
}];
|
|
2077
|
+
}, {
|
|
2078
|
+
readonly name: "Settled";
|
|
2079
|
+
readonly type: "event";
|
|
2080
|
+
readonly inputs: readonly [{
|
|
2081
|
+
readonly type: "bytes32";
|
|
2082
|
+
readonly name: "channelId";
|
|
2083
|
+
readonly indexed: true;
|
|
2084
|
+
}, {
|
|
2085
|
+
readonly type: "address";
|
|
2086
|
+
readonly name: "payer";
|
|
2087
|
+
readonly indexed: true;
|
|
2088
|
+
}, {
|
|
2089
|
+
readonly type: "address";
|
|
2090
|
+
readonly name: "payee";
|
|
2091
|
+
readonly indexed: true;
|
|
2092
|
+
}, {
|
|
2093
|
+
readonly type: "uint96";
|
|
2094
|
+
readonly name: "cumulativeAmount";
|
|
2095
|
+
}, {
|
|
2096
|
+
readonly type: "uint96";
|
|
2097
|
+
readonly name: "deltaPaid";
|
|
2098
|
+
}, {
|
|
2099
|
+
readonly type: "uint96";
|
|
2100
|
+
readonly name: "newSettled";
|
|
2101
|
+
}];
|
|
2102
|
+
}, {
|
|
2103
|
+
readonly name: "TopUp";
|
|
2104
|
+
readonly type: "event";
|
|
2105
|
+
readonly inputs: readonly [{
|
|
2106
|
+
readonly type: "bytes32";
|
|
2107
|
+
readonly name: "channelId";
|
|
2108
|
+
readonly indexed: true;
|
|
2109
|
+
}, {
|
|
2110
|
+
readonly type: "address";
|
|
2111
|
+
readonly name: "payer";
|
|
2112
|
+
readonly indexed: true;
|
|
2113
|
+
}, {
|
|
2114
|
+
readonly type: "address";
|
|
2115
|
+
readonly name: "payee";
|
|
2116
|
+
readonly indexed: true;
|
|
2117
|
+
}, {
|
|
2118
|
+
readonly type: "uint96";
|
|
2119
|
+
readonly name: "additionalDeposit";
|
|
2120
|
+
}, {
|
|
2121
|
+
readonly type: "uint96";
|
|
2122
|
+
readonly name: "newDeposit";
|
|
2123
|
+
}];
|
|
2124
|
+
}, {
|
|
2125
|
+
readonly name: "CloseRequested";
|
|
2126
|
+
readonly type: "event";
|
|
2127
|
+
readonly inputs: readonly [{
|
|
2128
|
+
readonly type: "bytes32";
|
|
2129
|
+
readonly name: "channelId";
|
|
2130
|
+
readonly indexed: true;
|
|
2131
|
+
}, {
|
|
2132
|
+
readonly type: "address";
|
|
2133
|
+
readonly name: "payer";
|
|
2134
|
+
readonly indexed: true;
|
|
2135
|
+
}, {
|
|
2136
|
+
readonly type: "address";
|
|
2137
|
+
readonly name: "payee";
|
|
2138
|
+
readonly indexed: true;
|
|
2139
|
+
}, {
|
|
2140
|
+
readonly type: "uint256";
|
|
2141
|
+
readonly name: "closeGraceEnd";
|
|
2142
|
+
}];
|
|
2143
|
+
}, {
|
|
2144
|
+
readonly name: "ChannelClosed";
|
|
2145
|
+
readonly type: "event";
|
|
2146
|
+
readonly inputs: readonly [{
|
|
2147
|
+
readonly type: "bytes32";
|
|
2148
|
+
readonly name: "channelId";
|
|
2149
|
+
readonly indexed: true;
|
|
2150
|
+
}, {
|
|
2151
|
+
readonly type: "address";
|
|
2152
|
+
readonly name: "payer";
|
|
2153
|
+
readonly indexed: true;
|
|
2154
|
+
}, {
|
|
2155
|
+
readonly type: "address";
|
|
2156
|
+
readonly name: "payee";
|
|
2157
|
+
readonly indexed: true;
|
|
2158
|
+
}, {
|
|
2159
|
+
readonly type: "uint96";
|
|
2160
|
+
readonly name: "settledToPayee";
|
|
2161
|
+
}, {
|
|
2162
|
+
readonly type: "uint96";
|
|
2163
|
+
readonly name: "refundedToPayer";
|
|
2164
|
+
}];
|
|
2165
|
+
}, {
|
|
2166
|
+
readonly name: "CloseRequestCancelled";
|
|
2167
|
+
readonly type: "event";
|
|
2168
|
+
readonly inputs: readonly [{
|
|
2169
|
+
readonly type: "bytes32";
|
|
2170
|
+
readonly name: "channelId";
|
|
2171
|
+
readonly indexed: true;
|
|
2172
|
+
}, {
|
|
2173
|
+
readonly type: "address";
|
|
2174
|
+
readonly name: "payer";
|
|
2175
|
+
readonly indexed: true;
|
|
2176
|
+
}, {
|
|
2177
|
+
readonly type: "address";
|
|
2178
|
+
readonly name: "payee";
|
|
2179
|
+
readonly indexed: true;
|
|
2180
|
+
}];
|
|
2181
|
+
}, {
|
|
2182
|
+
readonly name: "ChannelAlreadyExists";
|
|
2183
|
+
readonly type: "error";
|
|
2184
|
+
readonly inputs: readonly [];
|
|
2185
|
+
}, {
|
|
2186
|
+
readonly name: "ChannelNotFound";
|
|
2187
|
+
readonly type: "error";
|
|
2188
|
+
readonly inputs: readonly [];
|
|
2189
|
+
}, {
|
|
2190
|
+
readonly name: "NotPayer";
|
|
2191
|
+
readonly type: "error";
|
|
2192
|
+
readonly inputs: readonly [];
|
|
2193
|
+
}, {
|
|
2194
|
+
readonly name: "NotPayeeOrOperator";
|
|
2195
|
+
readonly type: "error";
|
|
2196
|
+
readonly inputs: readonly [];
|
|
2197
|
+
}, {
|
|
2198
|
+
readonly name: "InvalidPayee";
|
|
2199
|
+
readonly type: "error";
|
|
2200
|
+
readonly inputs: readonly [];
|
|
2201
|
+
}, {
|
|
2202
|
+
readonly name: "ZeroDeposit";
|
|
2203
|
+
readonly type: "error";
|
|
2204
|
+
readonly inputs: readonly [];
|
|
2205
|
+
}, {
|
|
2206
|
+
readonly name: "ExpiringNonceHashNotSet";
|
|
2207
|
+
readonly type: "error";
|
|
2208
|
+
readonly inputs: readonly [];
|
|
2209
|
+
}, {
|
|
2210
|
+
readonly name: "InvalidSignature";
|
|
2211
|
+
readonly type: "error";
|
|
2212
|
+
readonly inputs: readonly [];
|
|
2213
|
+
}, {
|
|
2214
|
+
readonly name: "AmountExceedsDeposit";
|
|
2215
|
+
readonly type: "error";
|
|
2216
|
+
readonly inputs: readonly [];
|
|
2217
|
+
}, {
|
|
2218
|
+
readonly name: "AmountNotIncreasing";
|
|
2219
|
+
readonly type: "error";
|
|
2220
|
+
readonly inputs: readonly [];
|
|
2221
|
+
}, {
|
|
2222
|
+
readonly name: "CaptureAmountInvalid";
|
|
2223
|
+
readonly type: "error";
|
|
2224
|
+
readonly inputs: readonly [];
|
|
2225
|
+
}, {
|
|
2226
|
+
readonly name: "CloseNotReady";
|
|
2227
|
+
readonly type: "error";
|
|
2228
|
+
readonly inputs: readonly [];
|
|
2229
|
+
}, {
|
|
2230
|
+
readonly name: "DepositOverflow";
|
|
2231
|
+
readonly type: "error";
|
|
2232
|
+
readonly inputs: readonly [];
|
|
2233
|
+
}], "CloseRequested">;
|
|
2234
|
+
}
|
|
2235
|
+
/**
|
|
2236
|
+
* Starts the payer close timer and waits for the transaction receipt.
|
|
2237
|
+
*
|
|
2238
|
+
* @example
|
|
2239
|
+
* ```ts
|
|
2240
|
+
* import { Actions } from 'viem/tempo'
|
|
2241
|
+
*
|
|
2242
|
+
* const result = await Actions.channel.requestCloseSync(client, {
|
|
2243
|
+
* channel,
|
|
2244
|
+
* })
|
|
2245
|
+
* ```
|
|
2246
|
+
*
|
|
2247
|
+
* @param client - Client.
|
|
2248
|
+
* @param parameters - Parameters.
|
|
2249
|
+
* @returns The transaction receipt and event data.
|
|
2250
|
+
*/
|
|
2251
|
+
export declare function requestCloseSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: requestCloseSync.Parameters<chain, account>): Promise<requestCloseSync.ReturnValue>;
|
|
2252
|
+
export declare namespace requestCloseSync {
|
|
2253
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = requestClose.Parameters<chain, account>;
|
|
2254
|
+
type Args = requestClose.Args;
|
|
2255
|
+
type ReturnValue = Compute<GetEventArgs<typeof Abis.tip20ChannelReserve, 'CloseRequested', {
|
|
2256
|
+
IndexedOnly: false;
|
|
2257
|
+
Required: true;
|
|
2258
|
+
}> & {
|
|
2259
|
+
/** Transaction receipt. */
|
|
2260
|
+
receipt: TransactionReceipt;
|
|
2261
|
+
}>;
|
|
2262
|
+
}
|
|
2263
|
+
/**
|
|
2264
|
+
* Settles a TIP-20 channel reserve voucher.
|
|
2265
|
+
*
|
|
2266
|
+
* @example
|
|
2267
|
+
* ```ts
|
|
2268
|
+
* import { createClient, http } from 'viem'
|
|
2269
|
+
* import { tempo } from 'viem/chains'
|
|
2270
|
+
* import { Actions } from 'viem/tempo'
|
|
2271
|
+
*
|
|
2272
|
+
* const hash = await Actions.channel.settle(client, {
|
|
2273
|
+
* cumulativeAmount: 100n,
|
|
2274
|
+
* channel,
|
|
2275
|
+
* signature: '0x...',
|
|
2276
|
+
* })
|
|
2277
|
+
* ```
|
|
2278
|
+
*
|
|
2279
|
+
* @param client - Client.
|
|
2280
|
+
* @param parameters - Parameters.
|
|
2281
|
+
* @returns The transaction hash.
|
|
2282
|
+
*/
|
|
2283
|
+
export declare function settle<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: settle.Parameters<chain, account>): Promise<settle.ReturnValue>;
|
|
2284
|
+
export declare namespace settle {
|
|
2285
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
|
|
2286
|
+
type Args = {
|
|
2287
|
+
/** Total voucher amount signed for the channel. */
|
|
2288
|
+
cumulativeAmount: bigint;
|
|
2289
|
+
/** TIP-20 channel. */
|
|
2290
|
+
channel: ox_Channel.from.Value;
|
|
2291
|
+
/** Voucher signature. */
|
|
2292
|
+
signature: Hex.Hex;
|
|
2293
|
+
};
|
|
2294
|
+
type ReturnValue = WriteContractReturnType;
|
|
2295
|
+
type ErrorType = BaseErrorType;
|
|
2296
|
+
/** @internal */
|
|
2297
|
+
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>>;
|
|
2298
|
+
/**
|
|
2299
|
+
* Defines a call to the `settle` function.
|
|
2300
|
+
*
|
|
2301
|
+
* @param args - Arguments.
|
|
2302
|
+
* @returns The call.
|
|
2303
|
+
*/
|
|
2304
|
+
function call(args: Args): {
|
|
2305
|
+
abi: [{
|
|
2306
|
+
readonly name: "settle";
|
|
2307
|
+
readonly type: "function";
|
|
2308
|
+
readonly stateMutability: "nonpayable";
|
|
2309
|
+
readonly inputs: readonly [{
|
|
2310
|
+
readonly type: "tuple";
|
|
2311
|
+
readonly name: "descriptor";
|
|
2312
|
+
readonly components: readonly [{
|
|
2313
|
+
readonly type: "address";
|
|
2314
|
+
readonly name: "payer";
|
|
2315
|
+
}, {
|
|
2316
|
+
readonly type: "address";
|
|
2317
|
+
readonly name: "payee";
|
|
2318
|
+
}, {
|
|
2319
|
+
readonly type: "address";
|
|
2320
|
+
readonly name: "operator";
|
|
2321
|
+
}, {
|
|
2322
|
+
readonly type: "address";
|
|
2323
|
+
readonly name: "token";
|
|
2324
|
+
}, {
|
|
2325
|
+
readonly type: "bytes32";
|
|
2326
|
+
readonly name: "salt";
|
|
2327
|
+
}, {
|
|
2328
|
+
readonly type: "address";
|
|
2329
|
+
readonly name: "authorizedSigner";
|
|
2330
|
+
}, {
|
|
2331
|
+
readonly type: "bytes32";
|
|
2332
|
+
readonly name: "expiringNonceHash";
|
|
2333
|
+
}];
|
|
2334
|
+
}, {
|
|
2335
|
+
readonly type: "uint96";
|
|
2336
|
+
readonly name: "cumulativeAmount";
|
|
2337
|
+
}, {
|
|
2338
|
+
readonly type: "bytes";
|
|
2339
|
+
readonly name: "signature";
|
|
2340
|
+
}];
|
|
2341
|
+
readonly outputs: readonly [];
|
|
2342
|
+
}];
|
|
2343
|
+
functionName: "settle";
|
|
2344
|
+
} & {
|
|
2345
|
+
args: readonly [{
|
|
2346
|
+
payer: `0x${string}`;
|
|
2347
|
+
payee: `0x${string}`;
|
|
2348
|
+
operator: `0x${string}`;
|
|
2349
|
+
token: `0x${string}`;
|
|
2350
|
+
salt: `0x${string}`;
|
|
2351
|
+
authorizedSigner: `0x${string}`;
|
|
2352
|
+
expiringNonceHash: `0x${string}`;
|
|
2353
|
+
}, bigint, signature: `0x${string}`];
|
|
2354
|
+
} & {
|
|
2355
|
+
address: import("abitype").Address;
|
|
2356
|
+
} & {
|
|
2357
|
+
data: import("../../index.js").Hex;
|
|
2358
|
+
to: import("abitype").Address;
|
|
2359
|
+
};
|
|
2360
|
+
/**
|
|
2361
|
+
* Extracts the `Settled` event from logs.
|
|
2362
|
+
*
|
|
2363
|
+
* @param logs - The logs.
|
|
2364
|
+
* @returns The `Settled` event.
|
|
2365
|
+
*/
|
|
2366
|
+
function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
|
|
2367
|
+
readonly name: "CLOSE_GRACE_PERIOD";
|
|
2368
|
+
readonly type: "function";
|
|
2369
|
+
readonly stateMutability: "view";
|
|
2370
|
+
readonly inputs: readonly [];
|
|
2371
|
+
readonly outputs: readonly [{
|
|
2372
|
+
readonly type: "uint64";
|
|
2373
|
+
}];
|
|
2374
|
+
}, {
|
|
2375
|
+
readonly name: "VOUCHER_TYPEHASH";
|
|
2376
|
+
readonly type: "function";
|
|
2377
|
+
readonly stateMutability: "view";
|
|
2378
|
+
readonly inputs: readonly [];
|
|
2379
|
+
readonly outputs: readonly [{
|
|
2380
|
+
readonly type: "bytes32";
|
|
2381
|
+
}];
|
|
2382
|
+
}, {
|
|
2383
|
+
readonly name: "open";
|
|
2384
|
+
readonly type: "function";
|
|
2385
|
+
readonly stateMutability: "nonpayable";
|
|
2386
|
+
readonly inputs: readonly [{
|
|
2387
|
+
readonly type: "address";
|
|
2388
|
+
readonly name: "payee";
|
|
2389
|
+
}, {
|
|
2390
|
+
readonly type: "address";
|
|
2391
|
+
readonly name: "operator";
|
|
2392
|
+
}, {
|
|
2393
|
+
readonly type: "address";
|
|
2394
|
+
readonly name: "token";
|
|
2395
|
+
}, {
|
|
2396
|
+
readonly type: "uint96";
|
|
2397
|
+
readonly name: "deposit";
|
|
2398
|
+
}, {
|
|
2399
|
+
readonly type: "bytes32";
|
|
2400
|
+
readonly name: "salt";
|
|
2401
|
+
}, {
|
|
2402
|
+
readonly type: "address";
|
|
2403
|
+
readonly name: "authorizedSigner";
|
|
2404
|
+
}];
|
|
2405
|
+
readonly outputs: readonly [{
|
|
2406
|
+
readonly type: "bytes32";
|
|
2407
|
+
readonly name: "channelId";
|
|
2408
|
+
}];
|
|
2409
|
+
}, {
|
|
2410
|
+
readonly name: "settle";
|
|
2411
|
+
readonly type: "function";
|
|
2412
|
+
readonly stateMutability: "nonpayable";
|
|
2413
|
+
readonly inputs: readonly [{
|
|
2414
|
+
readonly type: "tuple";
|
|
2415
|
+
readonly name: "descriptor";
|
|
2416
|
+
readonly components: readonly [{
|
|
2417
|
+
readonly type: "address";
|
|
2418
|
+
readonly name: "payer";
|
|
2419
|
+
}, {
|
|
2420
|
+
readonly type: "address";
|
|
2421
|
+
readonly name: "payee";
|
|
2422
|
+
}, {
|
|
2423
|
+
readonly type: "address";
|
|
2424
|
+
readonly name: "operator";
|
|
2425
|
+
}, {
|
|
2426
|
+
readonly type: "address";
|
|
2427
|
+
readonly name: "token";
|
|
2428
|
+
}, {
|
|
2429
|
+
readonly type: "bytes32";
|
|
2430
|
+
readonly name: "salt";
|
|
2431
|
+
}, {
|
|
2432
|
+
readonly type: "address";
|
|
2433
|
+
readonly name: "authorizedSigner";
|
|
2434
|
+
}, {
|
|
2435
|
+
readonly type: "bytes32";
|
|
2436
|
+
readonly name: "expiringNonceHash";
|
|
2437
|
+
}];
|
|
2438
|
+
}, {
|
|
2439
|
+
readonly type: "uint96";
|
|
2440
|
+
readonly name: "cumulativeAmount";
|
|
2441
|
+
}, {
|
|
2442
|
+
readonly type: "bytes";
|
|
2443
|
+
readonly name: "signature";
|
|
2444
|
+
}];
|
|
2445
|
+
readonly outputs: readonly [];
|
|
2446
|
+
}, {
|
|
2447
|
+
readonly name: "topUp";
|
|
2448
|
+
readonly type: "function";
|
|
2449
|
+
readonly stateMutability: "nonpayable";
|
|
2450
|
+
readonly inputs: readonly [{
|
|
2451
|
+
readonly type: "tuple";
|
|
2452
|
+
readonly name: "descriptor";
|
|
2453
|
+
readonly components: readonly [{
|
|
2454
|
+
readonly type: "address";
|
|
2455
|
+
readonly name: "payer";
|
|
2456
|
+
}, {
|
|
2457
|
+
readonly type: "address";
|
|
2458
|
+
readonly name: "payee";
|
|
2459
|
+
}, {
|
|
2460
|
+
readonly type: "address";
|
|
2461
|
+
readonly name: "operator";
|
|
2462
|
+
}, {
|
|
2463
|
+
readonly type: "address";
|
|
2464
|
+
readonly name: "token";
|
|
2465
|
+
}, {
|
|
2466
|
+
readonly type: "bytes32";
|
|
2467
|
+
readonly name: "salt";
|
|
2468
|
+
}, {
|
|
2469
|
+
readonly type: "address";
|
|
2470
|
+
readonly name: "authorizedSigner";
|
|
2471
|
+
}, {
|
|
2472
|
+
readonly type: "bytes32";
|
|
2473
|
+
readonly name: "expiringNonceHash";
|
|
2474
|
+
}];
|
|
2475
|
+
}, {
|
|
2476
|
+
readonly type: "uint96";
|
|
2477
|
+
readonly name: "additionalDeposit";
|
|
2478
|
+
}];
|
|
2479
|
+
readonly outputs: readonly [];
|
|
2480
|
+
}, {
|
|
2481
|
+
readonly name: "close";
|
|
2482
|
+
readonly type: "function";
|
|
2483
|
+
readonly stateMutability: "nonpayable";
|
|
2484
|
+
readonly inputs: readonly [{
|
|
2485
|
+
readonly type: "tuple";
|
|
2486
|
+
readonly name: "descriptor";
|
|
2487
|
+
readonly components: readonly [{
|
|
2488
|
+
readonly type: "address";
|
|
2489
|
+
readonly name: "payer";
|
|
2490
|
+
}, {
|
|
2491
|
+
readonly type: "address";
|
|
2492
|
+
readonly name: "payee";
|
|
2493
|
+
}, {
|
|
2494
|
+
readonly type: "address";
|
|
2495
|
+
readonly name: "operator";
|
|
2496
|
+
}, {
|
|
2497
|
+
readonly type: "address";
|
|
2498
|
+
readonly name: "token";
|
|
2499
|
+
}, {
|
|
2500
|
+
readonly type: "bytes32";
|
|
2501
|
+
readonly name: "salt";
|
|
2502
|
+
}, {
|
|
2503
|
+
readonly type: "address";
|
|
2504
|
+
readonly name: "authorizedSigner";
|
|
2505
|
+
}, {
|
|
2506
|
+
readonly type: "bytes32";
|
|
2507
|
+
readonly name: "expiringNonceHash";
|
|
2508
|
+
}];
|
|
2509
|
+
}, {
|
|
2510
|
+
readonly type: "uint96";
|
|
2511
|
+
readonly name: "cumulativeAmount";
|
|
2512
|
+
}, {
|
|
2513
|
+
readonly type: "uint96";
|
|
2514
|
+
readonly name: "captureAmount";
|
|
2515
|
+
}, {
|
|
2516
|
+
readonly type: "bytes";
|
|
2517
|
+
readonly name: "signature";
|
|
2518
|
+
}];
|
|
2519
|
+
readonly outputs: readonly [];
|
|
2520
|
+
}, {
|
|
2521
|
+
readonly name: "requestClose";
|
|
2522
|
+
readonly type: "function";
|
|
2523
|
+
readonly stateMutability: "nonpayable";
|
|
2524
|
+
readonly inputs: readonly [{
|
|
2525
|
+
readonly type: "tuple";
|
|
2526
|
+
readonly name: "descriptor";
|
|
2527
|
+
readonly components: readonly [{
|
|
2528
|
+
readonly type: "address";
|
|
2529
|
+
readonly name: "payer";
|
|
2530
|
+
}, {
|
|
2531
|
+
readonly type: "address";
|
|
2532
|
+
readonly name: "payee";
|
|
2533
|
+
}, {
|
|
2534
|
+
readonly type: "address";
|
|
2535
|
+
readonly name: "operator";
|
|
2536
|
+
}, {
|
|
2537
|
+
readonly type: "address";
|
|
2538
|
+
readonly name: "token";
|
|
2539
|
+
}, {
|
|
2540
|
+
readonly type: "bytes32";
|
|
2541
|
+
readonly name: "salt";
|
|
2542
|
+
}, {
|
|
2543
|
+
readonly type: "address";
|
|
2544
|
+
readonly name: "authorizedSigner";
|
|
2545
|
+
}, {
|
|
2546
|
+
readonly type: "bytes32";
|
|
2547
|
+
readonly name: "expiringNonceHash";
|
|
2548
|
+
}];
|
|
2549
|
+
}];
|
|
2550
|
+
readonly outputs: readonly [];
|
|
2551
|
+
}, {
|
|
2552
|
+
readonly name: "withdraw";
|
|
2553
|
+
readonly type: "function";
|
|
2554
|
+
readonly stateMutability: "nonpayable";
|
|
2555
|
+
readonly inputs: readonly [{
|
|
2556
|
+
readonly type: "tuple";
|
|
2557
|
+
readonly name: "descriptor";
|
|
2558
|
+
readonly components: readonly [{
|
|
2559
|
+
readonly type: "address";
|
|
2560
|
+
readonly name: "payer";
|
|
2561
|
+
}, {
|
|
2562
|
+
readonly type: "address";
|
|
2563
|
+
readonly name: "payee";
|
|
2564
|
+
}, {
|
|
2565
|
+
readonly type: "address";
|
|
2566
|
+
readonly name: "operator";
|
|
2567
|
+
}, {
|
|
2568
|
+
readonly type: "address";
|
|
2569
|
+
readonly name: "token";
|
|
2570
|
+
}, {
|
|
2571
|
+
readonly type: "bytes32";
|
|
2572
|
+
readonly name: "salt";
|
|
2573
|
+
}, {
|
|
2574
|
+
readonly type: "address";
|
|
2575
|
+
readonly name: "authorizedSigner";
|
|
2576
|
+
}, {
|
|
2577
|
+
readonly type: "bytes32";
|
|
2578
|
+
readonly name: "expiringNonceHash";
|
|
2579
|
+
}];
|
|
2580
|
+
}];
|
|
2581
|
+
readonly outputs: readonly [];
|
|
2582
|
+
}, {
|
|
2583
|
+
readonly name: "getChannel";
|
|
2584
|
+
readonly type: "function";
|
|
2585
|
+
readonly stateMutability: "view";
|
|
2586
|
+
readonly inputs: readonly [{
|
|
2587
|
+
readonly type: "tuple";
|
|
2588
|
+
readonly name: "descriptor";
|
|
2589
|
+
readonly components: readonly [{
|
|
2590
|
+
readonly type: "address";
|
|
2591
|
+
readonly name: "payer";
|
|
2592
|
+
}, {
|
|
2593
|
+
readonly type: "address";
|
|
2594
|
+
readonly name: "payee";
|
|
2595
|
+
}, {
|
|
2596
|
+
readonly type: "address";
|
|
2597
|
+
readonly name: "operator";
|
|
2598
|
+
}, {
|
|
2599
|
+
readonly type: "address";
|
|
2600
|
+
readonly name: "token";
|
|
2601
|
+
}, {
|
|
2602
|
+
readonly type: "bytes32";
|
|
2603
|
+
readonly name: "salt";
|
|
2604
|
+
}, {
|
|
2605
|
+
readonly type: "address";
|
|
2606
|
+
readonly name: "authorizedSigner";
|
|
2607
|
+
}, {
|
|
2608
|
+
readonly type: "bytes32";
|
|
2609
|
+
readonly name: "expiringNonceHash";
|
|
2610
|
+
}];
|
|
2611
|
+
}];
|
|
2612
|
+
readonly outputs: readonly [{
|
|
2613
|
+
readonly type: "tuple";
|
|
2614
|
+
readonly components: readonly [{
|
|
2615
|
+
readonly type: "tuple";
|
|
2616
|
+
readonly name: "descriptor";
|
|
2617
|
+
readonly components: readonly [{
|
|
2618
|
+
readonly type: "address";
|
|
2619
|
+
readonly name: "payer";
|
|
2620
|
+
}, {
|
|
2621
|
+
readonly type: "address";
|
|
2622
|
+
readonly name: "payee";
|
|
2623
|
+
}, {
|
|
2624
|
+
readonly type: "address";
|
|
2625
|
+
readonly name: "operator";
|
|
2626
|
+
}, {
|
|
2627
|
+
readonly type: "address";
|
|
2628
|
+
readonly name: "token";
|
|
2629
|
+
}, {
|
|
2630
|
+
readonly type: "bytes32";
|
|
2631
|
+
readonly name: "salt";
|
|
2632
|
+
}, {
|
|
2633
|
+
readonly type: "address";
|
|
2634
|
+
readonly name: "authorizedSigner";
|
|
2635
|
+
}, {
|
|
2636
|
+
readonly type: "bytes32";
|
|
2637
|
+
readonly name: "expiringNonceHash";
|
|
2638
|
+
}];
|
|
2639
|
+
}, {
|
|
2640
|
+
readonly type: "tuple";
|
|
2641
|
+
readonly name: "state";
|
|
2642
|
+
readonly components: readonly [{
|
|
2643
|
+
readonly type: "uint96";
|
|
2644
|
+
readonly name: "settled";
|
|
2645
|
+
}, {
|
|
2646
|
+
readonly type: "uint96";
|
|
2647
|
+
readonly name: "deposit";
|
|
2648
|
+
}, {
|
|
2649
|
+
readonly type: "uint32";
|
|
2650
|
+
readonly name: "closeRequestedAt";
|
|
2651
|
+
}];
|
|
2652
|
+
}];
|
|
2653
|
+
}];
|
|
2654
|
+
}, {
|
|
2655
|
+
readonly name: "getChannelState";
|
|
2656
|
+
readonly type: "function";
|
|
2657
|
+
readonly stateMutability: "view";
|
|
2658
|
+
readonly inputs: readonly [{
|
|
2659
|
+
readonly type: "bytes32";
|
|
2660
|
+
readonly name: "channelId";
|
|
2661
|
+
}];
|
|
2662
|
+
readonly outputs: readonly [{
|
|
2663
|
+
readonly type: "tuple";
|
|
2664
|
+
readonly components: readonly [{
|
|
2665
|
+
readonly type: "uint96";
|
|
2666
|
+
readonly name: "settled";
|
|
2667
|
+
}, {
|
|
2668
|
+
readonly type: "uint96";
|
|
2669
|
+
readonly name: "deposit";
|
|
2670
|
+
}, {
|
|
2671
|
+
readonly type: "uint32";
|
|
2672
|
+
readonly name: "closeRequestedAt";
|
|
2673
|
+
}];
|
|
2674
|
+
}];
|
|
2675
|
+
}, {
|
|
2676
|
+
readonly name: "getChannelStatesBatch";
|
|
2677
|
+
readonly type: "function";
|
|
2678
|
+
readonly stateMutability: "view";
|
|
2679
|
+
readonly inputs: readonly [{
|
|
2680
|
+
readonly type: "bytes32[]";
|
|
2681
|
+
readonly name: "channelIds";
|
|
2682
|
+
}];
|
|
2683
|
+
readonly outputs: readonly [{
|
|
2684
|
+
readonly type: "tuple[]";
|
|
2685
|
+
readonly components: readonly [{
|
|
2686
|
+
readonly type: "uint96";
|
|
2687
|
+
readonly name: "settled";
|
|
2688
|
+
}, {
|
|
2689
|
+
readonly type: "uint96";
|
|
2690
|
+
readonly name: "deposit";
|
|
2691
|
+
}, {
|
|
2692
|
+
readonly type: "uint32";
|
|
2693
|
+
readonly name: "closeRequestedAt";
|
|
2694
|
+
}];
|
|
2695
|
+
}];
|
|
2696
|
+
}, {
|
|
2697
|
+
readonly name: "computeChannelId";
|
|
2698
|
+
readonly type: "function";
|
|
2699
|
+
readonly stateMutability: "view";
|
|
2700
|
+
readonly inputs: readonly [{
|
|
2701
|
+
readonly type: "address";
|
|
2702
|
+
readonly name: "payer";
|
|
2703
|
+
}, {
|
|
2704
|
+
readonly type: "address";
|
|
2705
|
+
readonly name: "payee";
|
|
2706
|
+
}, {
|
|
2707
|
+
readonly type: "address";
|
|
2708
|
+
readonly name: "operator";
|
|
2709
|
+
}, {
|
|
2710
|
+
readonly type: "address";
|
|
2711
|
+
readonly name: "token";
|
|
2712
|
+
}, {
|
|
2713
|
+
readonly type: "bytes32";
|
|
2714
|
+
readonly name: "salt";
|
|
2715
|
+
}, {
|
|
2716
|
+
readonly type: "address";
|
|
2717
|
+
readonly name: "authorizedSigner";
|
|
2718
|
+
}, {
|
|
2719
|
+
readonly type: "bytes32";
|
|
2720
|
+
readonly name: "expiringNonceHash";
|
|
2721
|
+
}];
|
|
2722
|
+
readonly outputs: readonly [{
|
|
2723
|
+
readonly type: "bytes32";
|
|
2724
|
+
}];
|
|
2725
|
+
}, {
|
|
2726
|
+
readonly name: "getVoucherDigest";
|
|
2727
|
+
readonly type: "function";
|
|
2728
|
+
readonly stateMutability: "view";
|
|
2729
|
+
readonly inputs: readonly [{
|
|
2730
|
+
readonly type: "bytes32";
|
|
2731
|
+
readonly name: "channelId";
|
|
2732
|
+
}, {
|
|
2733
|
+
readonly type: "uint96";
|
|
2734
|
+
readonly name: "cumulativeAmount";
|
|
2735
|
+
}];
|
|
2736
|
+
readonly outputs: readonly [{
|
|
2737
|
+
readonly type: "bytes32";
|
|
2738
|
+
}];
|
|
2739
|
+
}, {
|
|
2740
|
+
readonly name: "domainSeparator";
|
|
2741
|
+
readonly type: "function";
|
|
2742
|
+
readonly stateMutability: "view";
|
|
2743
|
+
readonly inputs: readonly [];
|
|
2744
|
+
readonly outputs: readonly [{
|
|
2745
|
+
readonly type: "bytes32";
|
|
2746
|
+
}];
|
|
2747
|
+
}, {
|
|
2748
|
+
readonly name: "ChannelOpened";
|
|
2749
|
+
readonly type: "event";
|
|
2750
|
+
readonly inputs: readonly [{
|
|
2751
|
+
readonly type: "bytes32";
|
|
2752
|
+
readonly name: "channelId";
|
|
2753
|
+
readonly indexed: true;
|
|
2754
|
+
}, {
|
|
2755
|
+
readonly type: "address";
|
|
2756
|
+
readonly name: "payer";
|
|
2757
|
+
readonly indexed: true;
|
|
2758
|
+
}, {
|
|
2759
|
+
readonly type: "address";
|
|
2760
|
+
readonly name: "payee";
|
|
2761
|
+
readonly indexed: true;
|
|
2762
|
+
}, {
|
|
2763
|
+
readonly type: "address";
|
|
2764
|
+
readonly name: "operator";
|
|
2765
|
+
}, {
|
|
2766
|
+
readonly type: "address";
|
|
2767
|
+
readonly name: "token";
|
|
2768
|
+
}, {
|
|
2769
|
+
readonly type: "address";
|
|
2770
|
+
readonly name: "authorizedSigner";
|
|
2771
|
+
}, {
|
|
2772
|
+
readonly type: "bytes32";
|
|
2773
|
+
readonly name: "salt";
|
|
2774
|
+
}, {
|
|
2775
|
+
readonly type: "bytes32";
|
|
2776
|
+
readonly name: "expiringNonceHash";
|
|
2777
|
+
}, {
|
|
2778
|
+
readonly type: "uint96";
|
|
2779
|
+
readonly name: "deposit";
|
|
2780
|
+
}];
|
|
2781
|
+
}, {
|
|
2782
|
+
readonly name: "Settled";
|
|
2783
|
+
readonly type: "event";
|
|
2784
|
+
readonly inputs: readonly [{
|
|
2785
|
+
readonly type: "bytes32";
|
|
2786
|
+
readonly name: "channelId";
|
|
2787
|
+
readonly indexed: true;
|
|
2788
|
+
}, {
|
|
2789
|
+
readonly type: "address";
|
|
2790
|
+
readonly name: "payer";
|
|
2791
|
+
readonly indexed: true;
|
|
2792
|
+
}, {
|
|
2793
|
+
readonly type: "address";
|
|
2794
|
+
readonly name: "payee";
|
|
2795
|
+
readonly indexed: true;
|
|
2796
|
+
}, {
|
|
2797
|
+
readonly type: "uint96";
|
|
2798
|
+
readonly name: "cumulativeAmount";
|
|
2799
|
+
}, {
|
|
2800
|
+
readonly type: "uint96";
|
|
2801
|
+
readonly name: "deltaPaid";
|
|
2802
|
+
}, {
|
|
2803
|
+
readonly type: "uint96";
|
|
2804
|
+
readonly name: "newSettled";
|
|
2805
|
+
}];
|
|
2806
|
+
}, {
|
|
2807
|
+
readonly name: "TopUp";
|
|
2808
|
+
readonly type: "event";
|
|
2809
|
+
readonly inputs: readonly [{
|
|
2810
|
+
readonly type: "bytes32";
|
|
2811
|
+
readonly name: "channelId";
|
|
2812
|
+
readonly indexed: true;
|
|
2813
|
+
}, {
|
|
2814
|
+
readonly type: "address";
|
|
2815
|
+
readonly name: "payer";
|
|
2816
|
+
readonly indexed: true;
|
|
2817
|
+
}, {
|
|
2818
|
+
readonly type: "address";
|
|
2819
|
+
readonly name: "payee";
|
|
2820
|
+
readonly indexed: true;
|
|
2821
|
+
}, {
|
|
2822
|
+
readonly type: "uint96";
|
|
2823
|
+
readonly name: "additionalDeposit";
|
|
2824
|
+
}, {
|
|
2825
|
+
readonly type: "uint96";
|
|
2826
|
+
readonly name: "newDeposit";
|
|
2827
|
+
}];
|
|
2828
|
+
}, {
|
|
2829
|
+
readonly name: "CloseRequested";
|
|
2830
|
+
readonly type: "event";
|
|
2831
|
+
readonly inputs: readonly [{
|
|
2832
|
+
readonly type: "bytes32";
|
|
2833
|
+
readonly name: "channelId";
|
|
2834
|
+
readonly indexed: true;
|
|
2835
|
+
}, {
|
|
2836
|
+
readonly type: "address";
|
|
2837
|
+
readonly name: "payer";
|
|
2838
|
+
readonly indexed: true;
|
|
2839
|
+
}, {
|
|
2840
|
+
readonly type: "address";
|
|
2841
|
+
readonly name: "payee";
|
|
2842
|
+
readonly indexed: true;
|
|
2843
|
+
}, {
|
|
2844
|
+
readonly type: "uint256";
|
|
2845
|
+
readonly name: "closeGraceEnd";
|
|
2846
|
+
}];
|
|
2847
|
+
}, {
|
|
2848
|
+
readonly name: "ChannelClosed";
|
|
2849
|
+
readonly type: "event";
|
|
2850
|
+
readonly inputs: readonly [{
|
|
2851
|
+
readonly type: "bytes32";
|
|
2852
|
+
readonly name: "channelId";
|
|
2853
|
+
readonly indexed: true;
|
|
2854
|
+
}, {
|
|
2855
|
+
readonly type: "address";
|
|
2856
|
+
readonly name: "payer";
|
|
2857
|
+
readonly indexed: true;
|
|
2858
|
+
}, {
|
|
2859
|
+
readonly type: "address";
|
|
2860
|
+
readonly name: "payee";
|
|
2861
|
+
readonly indexed: true;
|
|
2862
|
+
}, {
|
|
2863
|
+
readonly type: "uint96";
|
|
2864
|
+
readonly name: "settledToPayee";
|
|
2865
|
+
}, {
|
|
2866
|
+
readonly type: "uint96";
|
|
2867
|
+
readonly name: "refundedToPayer";
|
|
2868
|
+
}];
|
|
2869
|
+
}, {
|
|
2870
|
+
readonly name: "CloseRequestCancelled";
|
|
2871
|
+
readonly type: "event";
|
|
2872
|
+
readonly inputs: readonly [{
|
|
2873
|
+
readonly type: "bytes32";
|
|
2874
|
+
readonly name: "channelId";
|
|
2875
|
+
readonly indexed: true;
|
|
2876
|
+
}, {
|
|
2877
|
+
readonly type: "address";
|
|
2878
|
+
readonly name: "payer";
|
|
2879
|
+
readonly indexed: true;
|
|
2880
|
+
}, {
|
|
2881
|
+
readonly type: "address";
|
|
2882
|
+
readonly name: "payee";
|
|
2883
|
+
readonly indexed: true;
|
|
2884
|
+
}];
|
|
2885
|
+
}, {
|
|
2886
|
+
readonly name: "ChannelAlreadyExists";
|
|
2887
|
+
readonly type: "error";
|
|
2888
|
+
readonly inputs: readonly [];
|
|
2889
|
+
}, {
|
|
2890
|
+
readonly name: "ChannelNotFound";
|
|
2891
|
+
readonly type: "error";
|
|
2892
|
+
readonly inputs: readonly [];
|
|
2893
|
+
}, {
|
|
2894
|
+
readonly name: "NotPayer";
|
|
2895
|
+
readonly type: "error";
|
|
2896
|
+
readonly inputs: readonly [];
|
|
2897
|
+
}, {
|
|
2898
|
+
readonly name: "NotPayeeOrOperator";
|
|
2899
|
+
readonly type: "error";
|
|
2900
|
+
readonly inputs: readonly [];
|
|
2901
|
+
}, {
|
|
2902
|
+
readonly name: "InvalidPayee";
|
|
2903
|
+
readonly type: "error";
|
|
2904
|
+
readonly inputs: readonly [];
|
|
2905
|
+
}, {
|
|
2906
|
+
readonly name: "ZeroDeposit";
|
|
2907
|
+
readonly type: "error";
|
|
2908
|
+
readonly inputs: readonly [];
|
|
2909
|
+
}, {
|
|
2910
|
+
readonly name: "ExpiringNonceHashNotSet";
|
|
2911
|
+
readonly type: "error";
|
|
2912
|
+
readonly inputs: readonly [];
|
|
2913
|
+
}, {
|
|
2914
|
+
readonly name: "InvalidSignature";
|
|
2915
|
+
readonly type: "error";
|
|
2916
|
+
readonly inputs: readonly [];
|
|
2917
|
+
}, {
|
|
2918
|
+
readonly name: "AmountExceedsDeposit";
|
|
2919
|
+
readonly type: "error";
|
|
2920
|
+
readonly inputs: readonly [];
|
|
2921
|
+
}, {
|
|
2922
|
+
readonly name: "AmountNotIncreasing";
|
|
2923
|
+
readonly type: "error";
|
|
2924
|
+
readonly inputs: readonly [];
|
|
2925
|
+
}, {
|
|
2926
|
+
readonly name: "CaptureAmountInvalid";
|
|
2927
|
+
readonly type: "error";
|
|
2928
|
+
readonly inputs: readonly [];
|
|
2929
|
+
}, {
|
|
2930
|
+
readonly name: "CloseNotReady";
|
|
2931
|
+
readonly type: "error";
|
|
2932
|
+
readonly inputs: readonly [];
|
|
2933
|
+
}, {
|
|
2934
|
+
readonly name: "DepositOverflow";
|
|
2935
|
+
readonly type: "error";
|
|
2936
|
+
readonly inputs: readonly [];
|
|
2937
|
+
}], "Settled">;
|
|
2938
|
+
}
|
|
2939
|
+
/**
|
|
2940
|
+
* Settles a TIP-20 channel reserve voucher and waits for the transaction receipt.
|
|
2941
|
+
*
|
|
2942
|
+
* @example
|
|
2943
|
+
* ```ts
|
|
2944
|
+
* import { Actions } from 'viem/tempo'
|
|
2945
|
+
*
|
|
2946
|
+
* const result = await Actions.channel.settleSync(client, {
|
|
2947
|
+
* cumulativeAmount: 100n,
|
|
2948
|
+
* channel,
|
|
2949
|
+
* signature: '0x...',
|
|
2950
|
+
* })
|
|
2951
|
+
* ```
|
|
2952
|
+
*
|
|
2953
|
+
* @param client - Client.
|
|
2954
|
+
* @param parameters - Parameters.
|
|
2955
|
+
* @returns The transaction receipt and event data.
|
|
2956
|
+
*/
|
|
2957
|
+
export declare function settleSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: settleSync.Parameters<chain, account>): Promise<settleSync.ReturnValue>;
|
|
2958
|
+
export declare namespace settleSync {
|
|
2959
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = settle.Parameters<chain, account>;
|
|
2960
|
+
type Args = settle.Args;
|
|
2961
|
+
type ReturnValue = Compute<GetEventArgs<typeof Abis.tip20ChannelReserve, 'Settled', {
|
|
2962
|
+
IndexedOnly: false;
|
|
2963
|
+
Required: true;
|
|
2964
|
+
}> & {
|
|
2965
|
+
/** Transaction receipt. */
|
|
2966
|
+
receipt: TransactionReceipt;
|
|
2967
|
+
}>;
|
|
2968
|
+
}
|
|
2969
|
+
/**
|
|
2970
|
+
* Signs a TIP-20 channel reserve voucher.
|
|
2971
|
+
*
|
|
2972
|
+
* @example
|
|
2973
|
+
* ```ts
|
|
2974
|
+
* import { parseUnits } from 'viem'
|
|
2975
|
+
* import { Actions } from 'viem/tempo'
|
|
2976
|
+
*
|
|
2977
|
+
* const signature = await Actions.channel.signVoucher(client, {
|
|
2978
|
+
* channel,
|
|
2979
|
+
* cumulativeAmount: parseUnits('40', 6),
|
|
2980
|
+
* })
|
|
2981
|
+
* ```
|
|
2982
|
+
*
|
|
2983
|
+
* @param client - Client.
|
|
2984
|
+
* @param parameters - Parameters.
|
|
2985
|
+
* @returns The voucher signature.
|
|
2986
|
+
*/
|
|
2987
|
+
export declare function signVoucher<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: signVoucher.Parameters<account>): Promise<signVoucher.ReturnValue>;
|
|
2988
|
+
export declare namespace signVoucher {
|
|
2989
|
+
type Parameters<account extends Account | undefined = Account | undefined> = GetAccountParameter<account> & Args;
|
|
2990
|
+
type Args = {
|
|
2991
|
+
/** Channel ID or channel. */
|
|
2992
|
+
channel: getStates.Channel;
|
|
2993
|
+
/** The chain ID. @default client.chain.id */
|
|
2994
|
+
chainId?: number | bigint | undefined;
|
|
2995
|
+
/** Total voucher amount signed for the channel. */
|
|
2996
|
+
cumulativeAmount: bigint;
|
|
2997
|
+
};
|
|
2998
|
+
type ReturnValue = Hex.Hex;
|
|
2999
|
+
type ErrorType = BaseErrorType;
|
|
3000
|
+
}
|
|
3001
|
+
/**
|
|
3002
|
+
* Adds deposit to a TIP-20 channel reserve channel.
|
|
3003
|
+
*
|
|
3004
|
+
* @example
|
|
3005
|
+
* ```ts
|
|
3006
|
+
* import { Actions } from 'viem/tempo'
|
|
3007
|
+
*
|
|
3008
|
+
* const hash = await Actions.channel.topUp(client, {
|
|
3009
|
+
* additionalDeposit: 100n,
|
|
3010
|
+
* channel,
|
|
3011
|
+
* })
|
|
3012
|
+
* ```
|
|
3013
|
+
*
|
|
3014
|
+
* @param client - Client.
|
|
3015
|
+
* @param parameters - Parameters.
|
|
3016
|
+
* @returns The transaction hash.
|
|
3017
|
+
*/
|
|
3018
|
+
export declare function topUp<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: topUp.Parameters<chain, account>): Promise<topUp.ReturnValue>;
|
|
3019
|
+
export declare namespace topUp {
|
|
3020
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
|
|
3021
|
+
type Args = {
|
|
3022
|
+
/** Additional deposit to lock in the channel. */
|
|
3023
|
+
additionalDeposit: bigint;
|
|
3024
|
+
/** TIP-20 channel. */
|
|
3025
|
+
channel: ox_Channel.from.Value;
|
|
3026
|
+
};
|
|
3027
|
+
type ReturnValue = WriteContractReturnType;
|
|
3028
|
+
type ErrorType = BaseErrorType;
|
|
3029
|
+
/** @internal */
|
|
3030
|
+
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>>;
|
|
3031
|
+
/**
|
|
3032
|
+
* Defines a call to the `topUp` function.
|
|
3033
|
+
*
|
|
3034
|
+
* @param args - Arguments.
|
|
3035
|
+
* @returns The call.
|
|
3036
|
+
*/
|
|
3037
|
+
function call(args: Args): {
|
|
3038
|
+
abi: [{
|
|
3039
|
+
readonly name: "topUp";
|
|
3040
|
+
readonly type: "function";
|
|
3041
|
+
readonly stateMutability: "nonpayable";
|
|
3042
|
+
readonly inputs: readonly [{
|
|
3043
|
+
readonly type: "tuple";
|
|
3044
|
+
readonly name: "descriptor";
|
|
3045
|
+
readonly components: readonly [{
|
|
3046
|
+
readonly type: "address";
|
|
3047
|
+
readonly name: "payer";
|
|
3048
|
+
}, {
|
|
3049
|
+
readonly type: "address";
|
|
3050
|
+
readonly name: "payee";
|
|
3051
|
+
}, {
|
|
3052
|
+
readonly type: "address";
|
|
3053
|
+
readonly name: "operator";
|
|
3054
|
+
}, {
|
|
3055
|
+
readonly type: "address";
|
|
3056
|
+
readonly name: "token";
|
|
3057
|
+
}, {
|
|
3058
|
+
readonly type: "bytes32";
|
|
3059
|
+
readonly name: "salt";
|
|
3060
|
+
}, {
|
|
3061
|
+
readonly type: "address";
|
|
3062
|
+
readonly name: "authorizedSigner";
|
|
3063
|
+
}, {
|
|
3064
|
+
readonly type: "bytes32";
|
|
3065
|
+
readonly name: "expiringNonceHash";
|
|
3066
|
+
}];
|
|
3067
|
+
}, {
|
|
3068
|
+
readonly type: "uint96";
|
|
3069
|
+
readonly name: "additionalDeposit";
|
|
3070
|
+
}];
|
|
3071
|
+
readonly outputs: readonly [];
|
|
3072
|
+
}];
|
|
3073
|
+
functionName: "topUp";
|
|
3074
|
+
} & {
|
|
3075
|
+
args: readonly [{
|
|
3076
|
+
payer: `0x${string}`;
|
|
3077
|
+
payee: `0x${string}`;
|
|
3078
|
+
operator: `0x${string}`;
|
|
3079
|
+
token: `0x${string}`;
|
|
3080
|
+
salt: `0x${string}`;
|
|
3081
|
+
authorizedSigner: `0x${string}`;
|
|
3082
|
+
expiringNonceHash: `0x${string}`;
|
|
3083
|
+
}, bigint];
|
|
3084
|
+
} & {
|
|
3085
|
+
address: import("abitype").Address;
|
|
3086
|
+
} & {
|
|
3087
|
+
data: import("../../index.js").Hex;
|
|
3088
|
+
to: import("abitype").Address;
|
|
3089
|
+
};
|
|
3090
|
+
/**
|
|
3091
|
+
* Extracts the `TopUp` event from logs.
|
|
3092
|
+
*
|
|
3093
|
+
* @param logs - The logs.
|
|
3094
|
+
* @returns The `TopUp` event.
|
|
3095
|
+
*/
|
|
3096
|
+
function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
|
|
3097
|
+
readonly name: "CLOSE_GRACE_PERIOD";
|
|
3098
|
+
readonly type: "function";
|
|
3099
|
+
readonly stateMutability: "view";
|
|
3100
|
+
readonly inputs: readonly [];
|
|
3101
|
+
readonly outputs: readonly [{
|
|
3102
|
+
readonly type: "uint64";
|
|
3103
|
+
}];
|
|
3104
|
+
}, {
|
|
3105
|
+
readonly name: "VOUCHER_TYPEHASH";
|
|
3106
|
+
readonly type: "function";
|
|
3107
|
+
readonly stateMutability: "view";
|
|
3108
|
+
readonly inputs: readonly [];
|
|
3109
|
+
readonly outputs: readonly [{
|
|
3110
|
+
readonly type: "bytes32";
|
|
3111
|
+
}];
|
|
3112
|
+
}, {
|
|
3113
|
+
readonly name: "open";
|
|
3114
|
+
readonly type: "function";
|
|
3115
|
+
readonly stateMutability: "nonpayable";
|
|
3116
|
+
readonly inputs: readonly [{
|
|
3117
|
+
readonly type: "address";
|
|
3118
|
+
readonly name: "payee";
|
|
3119
|
+
}, {
|
|
3120
|
+
readonly type: "address";
|
|
3121
|
+
readonly name: "operator";
|
|
3122
|
+
}, {
|
|
3123
|
+
readonly type: "address";
|
|
3124
|
+
readonly name: "token";
|
|
3125
|
+
}, {
|
|
3126
|
+
readonly type: "uint96";
|
|
3127
|
+
readonly name: "deposit";
|
|
3128
|
+
}, {
|
|
3129
|
+
readonly type: "bytes32";
|
|
3130
|
+
readonly name: "salt";
|
|
3131
|
+
}, {
|
|
3132
|
+
readonly type: "address";
|
|
3133
|
+
readonly name: "authorizedSigner";
|
|
3134
|
+
}];
|
|
3135
|
+
readonly outputs: readonly [{
|
|
3136
|
+
readonly type: "bytes32";
|
|
3137
|
+
readonly name: "channelId";
|
|
3138
|
+
}];
|
|
3139
|
+
}, {
|
|
3140
|
+
readonly name: "settle";
|
|
3141
|
+
readonly type: "function";
|
|
3142
|
+
readonly stateMutability: "nonpayable";
|
|
3143
|
+
readonly inputs: readonly [{
|
|
3144
|
+
readonly type: "tuple";
|
|
3145
|
+
readonly name: "descriptor";
|
|
3146
|
+
readonly components: readonly [{
|
|
3147
|
+
readonly type: "address";
|
|
3148
|
+
readonly name: "payer";
|
|
3149
|
+
}, {
|
|
3150
|
+
readonly type: "address";
|
|
3151
|
+
readonly name: "payee";
|
|
3152
|
+
}, {
|
|
3153
|
+
readonly type: "address";
|
|
3154
|
+
readonly name: "operator";
|
|
3155
|
+
}, {
|
|
3156
|
+
readonly type: "address";
|
|
3157
|
+
readonly name: "token";
|
|
3158
|
+
}, {
|
|
3159
|
+
readonly type: "bytes32";
|
|
3160
|
+
readonly name: "salt";
|
|
3161
|
+
}, {
|
|
3162
|
+
readonly type: "address";
|
|
3163
|
+
readonly name: "authorizedSigner";
|
|
3164
|
+
}, {
|
|
3165
|
+
readonly type: "bytes32";
|
|
3166
|
+
readonly name: "expiringNonceHash";
|
|
3167
|
+
}];
|
|
3168
|
+
}, {
|
|
3169
|
+
readonly type: "uint96";
|
|
3170
|
+
readonly name: "cumulativeAmount";
|
|
3171
|
+
}, {
|
|
3172
|
+
readonly type: "bytes";
|
|
3173
|
+
readonly name: "signature";
|
|
3174
|
+
}];
|
|
3175
|
+
readonly outputs: readonly [];
|
|
3176
|
+
}, {
|
|
3177
|
+
readonly name: "topUp";
|
|
3178
|
+
readonly type: "function";
|
|
3179
|
+
readonly stateMutability: "nonpayable";
|
|
3180
|
+
readonly inputs: readonly [{
|
|
3181
|
+
readonly type: "tuple";
|
|
3182
|
+
readonly name: "descriptor";
|
|
3183
|
+
readonly components: readonly [{
|
|
3184
|
+
readonly type: "address";
|
|
3185
|
+
readonly name: "payer";
|
|
3186
|
+
}, {
|
|
3187
|
+
readonly type: "address";
|
|
3188
|
+
readonly name: "payee";
|
|
3189
|
+
}, {
|
|
3190
|
+
readonly type: "address";
|
|
3191
|
+
readonly name: "operator";
|
|
3192
|
+
}, {
|
|
3193
|
+
readonly type: "address";
|
|
3194
|
+
readonly name: "token";
|
|
3195
|
+
}, {
|
|
3196
|
+
readonly type: "bytes32";
|
|
3197
|
+
readonly name: "salt";
|
|
3198
|
+
}, {
|
|
3199
|
+
readonly type: "address";
|
|
3200
|
+
readonly name: "authorizedSigner";
|
|
3201
|
+
}, {
|
|
3202
|
+
readonly type: "bytes32";
|
|
3203
|
+
readonly name: "expiringNonceHash";
|
|
3204
|
+
}];
|
|
3205
|
+
}, {
|
|
3206
|
+
readonly type: "uint96";
|
|
3207
|
+
readonly name: "additionalDeposit";
|
|
3208
|
+
}];
|
|
3209
|
+
readonly outputs: readonly [];
|
|
3210
|
+
}, {
|
|
3211
|
+
readonly name: "close";
|
|
3212
|
+
readonly type: "function";
|
|
3213
|
+
readonly stateMutability: "nonpayable";
|
|
3214
|
+
readonly inputs: readonly [{
|
|
3215
|
+
readonly type: "tuple";
|
|
3216
|
+
readonly name: "descriptor";
|
|
3217
|
+
readonly components: readonly [{
|
|
3218
|
+
readonly type: "address";
|
|
3219
|
+
readonly name: "payer";
|
|
3220
|
+
}, {
|
|
3221
|
+
readonly type: "address";
|
|
3222
|
+
readonly name: "payee";
|
|
3223
|
+
}, {
|
|
3224
|
+
readonly type: "address";
|
|
3225
|
+
readonly name: "operator";
|
|
3226
|
+
}, {
|
|
3227
|
+
readonly type: "address";
|
|
3228
|
+
readonly name: "token";
|
|
3229
|
+
}, {
|
|
3230
|
+
readonly type: "bytes32";
|
|
3231
|
+
readonly name: "salt";
|
|
3232
|
+
}, {
|
|
3233
|
+
readonly type: "address";
|
|
3234
|
+
readonly name: "authorizedSigner";
|
|
3235
|
+
}, {
|
|
3236
|
+
readonly type: "bytes32";
|
|
3237
|
+
readonly name: "expiringNonceHash";
|
|
3238
|
+
}];
|
|
3239
|
+
}, {
|
|
3240
|
+
readonly type: "uint96";
|
|
3241
|
+
readonly name: "cumulativeAmount";
|
|
3242
|
+
}, {
|
|
3243
|
+
readonly type: "uint96";
|
|
3244
|
+
readonly name: "captureAmount";
|
|
3245
|
+
}, {
|
|
3246
|
+
readonly type: "bytes";
|
|
3247
|
+
readonly name: "signature";
|
|
3248
|
+
}];
|
|
3249
|
+
readonly outputs: readonly [];
|
|
3250
|
+
}, {
|
|
3251
|
+
readonly name: "requestClose";
|
|
3252
|
+
readonly type: "function";
|
|
3253
|
+
readonly stateMutability: "nonpayable";
|
|
3254
|
+
readonly inputs: readonly [{
|
|
3255
|
+
readonly type: "tuple";
|
|
3256
|
+
readonly name: "descriptor";
|
|
3257
|
+
readonly components: readonly [{
|
|
3258
|
+
readonly type: "address";
|
|
3259
|
+
readonly name: "payer";
|
|
3260
|
+
}, {
|
|
3261
|
+
readonly type: "address";
|
|
3262
|
+
readonly name: "payee";
|
|
3263
|
+
}, {
|
|
3264
|
+
readonly type: "address";
|
|
3265
|
+
readonly name: "operator";
|
|
3266
|
+
}, {
|
|
3267
|
+
readonly type: "address";
|
|
3268
|
+
readonly name: "token";
|
|
3269
|
+
}, {
|
|
3270
|
+
readonly type: "bytes32";
|
|
3271
|
+
readonly name: "salt";
|
|
3272
|
+
}, {
|
|
3273
|
+
readonly type: "address";
|
|
3274
|
+
readonly name: "authorizedSigner";
|
|
3275
|
+
}, {
|
|
3276
|
+
readonly type: "bytes32";
|
|
3277
|
+
readonly name: "expiringNonceHash";
|
|
3278
|
+
}];
|
|
3279
|
+
}];
|
|
3280
|
+
readonly outputs: readonly [];
|
|
3281
|
+
}, {
|
|
3282
|
+
readonly name: "withdraw";
|
|
3283
|
+
readonly type: "function";
|
|
3284
|
+
readonly stateMutability: "nonpayable";
|
|
3285
|
+
readonly inputs: readonly [{
|
|
3286
|
+
readonly type: "tuple";
|
|
3287
|
+
readonly name: "descriptor";
|
|
3288
|
+
readonly components: readonly [{
|
|
3289
|
+
readonly type: "address";
|
|
3290
|
+
readonly name: "payer";
|
|
3291
|
+
}, {
|
|
3292
|
+
readonly type: "address";
|
|
3293
|
+
readonly name: "payee";
|
|
3294
|
+
}, {
|
|
3295
|
+
readonly type: "address";
|
|
3296
|
+
readonly name: "operator";
|
|
3297
|
+
}, {
|
|
3298
|
+
readonly type: "address";
|
|
3299
|
+
readonly name: "token";
|
|
3300
|
+
}, {
|
|
3301
|
+
readonly type: "bytes32";
|
|
3302
|
+
readonly name: "salt";
|
|
3303
|
+
}, {
|
|
3304
|
+
readonly type: "address";
|
|
3305
|
+
readonly name: "authorizedSigner";
|
|
3306
|
+
}, {
|
|
3307
|
+
readonly type: "bytes32";
|
|
3308
|
+
readonly name: "expiringNonceHash";
|
|
3309
|
+
}];
|
|
3310
|
+
}];
|
|
3311
|
+
readonly outputs: readonly [];
|
|
3312
|
+
}, {
|
|
3313
|
+
readonly name: "getChannel";
|
|
3314
|
+
readonly type: "function";
|
|
3315
|
+
readonly stateMutability: "view";
|
|
3316
|
+
readonly inputs: readonly [{
|
|
3317
|
+
readonly type: "tuple";
|
|
3318
|
+
readonly name: "descriptor";
|
|
3319
|
+
readonly components: readonly [{
|
|
3320
|
+
readonly type: "address";
|
|
3321
|
+
readonly name: "payer";
|
|
3322
|
+
}, {
|
|
3323
|
+
readonly type: "address";
|
|
3324
|
+
readonly name: "payee";
|
|
3325
|
+
}, {
|
|
3326
|
+
readonly type: "address";
|
|
3327
|
+
readonly name: "operator";
|
|
3328
|
+
}, {
|
|
3329
|
+
readonly type: "address";
|
|
3330
|
+
readonly name: "token";
|
|
3331
|
+
}, {
|
|
3332
|
+
readonly type: "bytes32";
|
|
3333
|
+
readonly name: "salt";
|
|
3334
|
+
}, {
|
|
3335
|
+
readonly type: "address";
|
|
3336
|
+
readonly name: "authorizedSigner";
|
|
3337
|
+
}, {
|
|
3338
|
+
readonly type: "bytes32";
|
|
3339
|
+
readonly name: "expiringNonceHash";
|
|
3340
|
+
}];
|
|
3341
|
+
}];
|
|
3342
|
+
readonly outputs: readonly [{
|
|
3343
|
+
readonly type: "tuple";
|
|
3344
|
+
readonly components: readonly [{
|
|
3345
|
+
readonly type: "tuple";
|
|
3346
|
+
readonly name: "descriptor";
|
|
3347
|
+
readonly components: readonly [{
|
|
3348
|
+
readonly type: "address";
|
|
3349
|
+
readonly name: "payer";
|
|
3350
|
+
}, {
|
|
3351
|
+
readonly type: "address";
|
|
3352
|
+
readonly name: "payee";
|
|
3353
|
+
}, {
|
|
3354
|
+
readonly type: "address";
|
|
3355
|
+
readonly name: "operator";
|
|
3356
|
+
}, {
|
|
3357
|
+
readonly type: "address";
|
|
3358
|
+
readonly name: "token";
|
|
3359
|
+
}, {
|
|
3360
|
+
readonly type: "bytes32";
|
|
3361
|
+
readonly name: "salt";
|
|
3362
|
+
}, {
|
|
3363
|
+
readonly type: "address";
|
|
3364
|
+
readonly name: "authorizedSigner";
|
|
3365
|
+
}, {
|
|
3366
|
+
readonly type: "bytes32";
|
|
3367
|
+
readonly name: "expiringNonceHash";
|
|
3368
|
+
}];
|
|
3369
|
+
}, {
|
|
3370
|
+
readonly type: "tuple";
|
|
3371
|
+
readonly name: "state";
|
|
3372
|
+
readonly components: readonly [{
|
|
3373
|
+
readonly type: "uint96";
|
|
3374
|
+
readonly name: "settled";
|
|
3375
|
+
}, {
|
|
3376
|
+
readonly type: "uint96";
|
|
3377
|
+
readonly name: "deposit";
|
|
3378
|
+
}, {
|
|
3379
|
+
readonly type: "uint32";
|
|
3380
|
+
readonly name: "closeRequestedAt";
|
|
3381
|
+
}];
|
|
3382
|
+
}];
|
|
3383
|
+
}];
|
|
3384
|
+
}, {
|
|
3385
|
+
readonly name: "getChannelState";
|
|
3386
|
+
readonly type: "function";
|
|
3387
|
+
readonly stateMutability: "view";
|
|
3388
|
+
readonly inputs: readonly [{
|
|
3389
|
+
readonly type: "bytes32";
|
|
3390
|
+
readonly name: "channelId";
|
|
3391
|
+
}];
|
|
3392
|
+
readonly outputs: readonly [{
|
|
3393
|
+
readonly type: "tuple";
|
|
3394
|
+
readonly components: readonly [{
|
|
3395
|
+
readonly type: "uint96";
|
|
3396
|
+
readonly name: "settled";
|
|
3397
|
+
}, {
|
|
3398
|
+
readonly type: "uint96";
|
|
3399
|
+
readonly name: "deposit";
|
|
3400
|
+
}, {
|
|
3401
|
+
readonly type: "uint32";
|
|
3402
|
+
readonly name: "closeRequestedAt";
|
|
3403
|
+
}];
|
|
3404
|
+
}];
|
|
3405
|
+
}, {
|
|
3406
|
+
readonly name: "getChannelStatesBatch";
|
|
3407
|
+
readonly type: "function";
|
|
3408
|
+
readonly stateMutability: "view";
|
|
3409
|
+
readonly inputs: readonly [{
|
|
3410
|
+
readonly type: "bytes32[]";
|
|
3411
|
+
readonly name: "channelIds";
|
|
3412
|
+
}];
|
|
3413
|
+
readonly outputs: readonly [{
|
|
3414
|
+
readonly type: "tuple[]";
|
|
3415
|
+
readonly components: readonly [{
|
|
3416
|
+
readonly type: "uint96";
|
|
3417
|
+
readonly name: "settled";
|
|
3418
|
+
}, {
|
|
3419
|
+
readonly type: "uint96";
|
|
3420
|
+
readonly name: "deposit";
|
|
3421
|
+
}, {
|
|
3422
|
+
readonly type: "uint32";
|
|
3423
|
+
readonly name: "closeRequestedAt";
|
|
3424
|
+
}];
|
|
3425
|
+
}];
|
|
3426
|
+
}, {
|
|
3427
|
+
readonly name: "computeChannelId";
|
|
3428
|
+
readonly type: "function";
|
|
3429
|
+
readonly stateMutability: "view";
|
|
3430
|
+
readonly inputs: readonly [{
|
|
3431
|
+
readonly type: "address";
|
|
3432
|
+
readonly name: "payer";
|
|
3433
|
+
}, {
|
|
3434
|
+
readonly type: "address";
|
|
3435
|
+
readonly name: "payee";
|
|
3436
|
+
}, {
|
|
3437
|
+
readonly type: "address";
|
|
3438
|
+
readonly name: "operator";
|
|
3439
|
+
}, {
|
|
3440
|
+
readonly type: "address";
|
|
3441
|
+
readonly name: "token";
|
|
3442
|
+
}, {
|
|
3443
|
+
readonly type: "bytes32";
|
|
3444
|
+
readonly name: "salt";
|
|
3445
|
+
}, {
|
|
3446
|
+
readonly type: "address";
|
|
3447
|
+
readonly name: "authorizedSigner";
|
|
3448
|
+
}, {
|
|
3449
|
+
readonly type: "bytes32";
|
|
3450
|
+
readonly name: "expiringNonceHash";
|
|
3451
|
+
}];
|
|
3452
|
+
readonly outputs: readonly [{
|
|
3453
|
+
readonly type: "bytes32";
|
|
3454
|
+
}];
|
|
3455
|
+
}, {
|
|
3456
|
+
readonly name: "getVoucherDigest";
|
|
3457
|
+
readonly type: "function";
|
|
3458
|
+
readonly stateMutability: "view";
|
|
3459
|
+
readonly inputs: readonly [{
|
|
3460
|
+
readonly type: "bytes32";
|
|
3461
|
+
readonly name: "channelId";
|
|
3462
|
+
}, {
|
|
3463
|
+
readonly type: "uint96";
|
|
3464
|
+
readonly name: "cumulativeAmount";
|
|
3465
|
+
}];
|
|
3466
|
+
readonly outputs: readonly [{
|
|
3467
|
+
readonly type: "bytes32";
|
|
3468
|
+
}];
|
|
3469
|
+
}, {
|
|
3470
|
+
readonly name: "domainSeparator";
|
|
3471
|
+
readonly type: "function";
|
|
3472
|
+
readonly stateMutability: "view";
|
|
3473
|
+
readonly inputs: readonly [];
|
|
3474
|
+
readonly outputs: readonly [{
|
|
3475
|
+
readonly type: "bytes32";
|
|
3476
|
+
}];
|
|
3477
|
+
}, {
|
|
3478
|
+
readonly name: "ChannelOpened";
|
|
3479
|
+
readonly type: "event";
|
|
3480
|
+
readonly inputs: readonly [{
|
|
3481
|
+
readonly type: "bytes32";
|
|
3482
|
+
readonly name: "channelId";
|
|
3483
|
+
readonly indexed: true;
|
|
3484
|
+
}, {
|
|
3485
|
+
readonly type: "address";
|
|
3486
|
+
readonly name: "payer";
|
|
3487
|
+
readonly indexed: true;
|
|
3488
|
+
}, {
|
|
3489
|
+
readonly type: "address";
|
|
3490
|
+
readonly name: "payee";
|
|
3491
|
+
readonly indexed: true;
|
|
3492
|
+
}, {
|
|
3493
|
+
readonly type: "address";
|
|
3494
|
+
readonly name: "operator";
|
|
3495
|
+
}, {
|
|
3496
|
+
readonly type: "address";
|
|
3497
|
+
readonly name: "token";
|
|
3498
|
+
}, {
|
|
3499
|
+
readonly type: "address";
|
|
3500
|
+
readonly name: "authorizedSigner";
|
|
3501
|
+
}, {
|
|
3502
|
+
readonly type: "bytes32";
|
|
3503
|
+
readonly name: "salt";
|
|
3504
|
+
}, {
|
|
3505
|
+
readonly type: "bytes32";
|
|
3506
|
+
readonly name: "expiringNonceHash";
|
|
3507
|
+
}, {
|
|
3508
|
+
readonly type: "uint96";
|
|
3509
|
+
readonly name: "deposit";
|
|
3510
|
+
}];
|
|
3511
|
+
}, {
|
|
3512
|
+
readonly name: "Settled";
|
|
3513
|
+
readonly type: "event";
|
|
3514
|
+
readonly inputs: readonly [{
|
|
3515
|
+
readonly type: "bytes32";
|
|
3516
|
+
readonly name: "channelId";
|
|
3517
|
+
readonly indexed: true;
|
|
3518
|
+
}, {
|
|
3519
|
+
readonly type: "address";
|
|
3520
|
+
readonly name: "payer";
|
|
3521
|
+
readonly indexed: true;
|
|
3522
|
+
}, {
|
|
3523
|
+
readonly type: "address";
|
|
3524
|
+
readonly name: "payee";
|
|
3525
|
+
readonly indexed: true;
|
|
3526
|
+
}, {
|
|
3527
|
+
readonly type: "uint96";
|
|
3528
|
+
readonly name: "cumulativeAmount";
|
|
3529
|
+
}, {
|
|
3530
|
+
readonly type: "uint96";
|
|
3531
|
+
readonly name: "deltaPaid";
|
|
3532
|
+
}, {
|
|
3533
|
+
readonly type: "uint96";
|
|
3534
|
+
readonly name: "newSettled";
|
|
3535
|
+
}];
|
|
3536
|
+
}, {
|
|
3537
|
+
readonly name: "TopUp";
|
|
3538
|
+
readonly type: "event";
|
|
3539
|
+
readonly inputs: readonly [{
|
|
3540
|
+
readonly type: "bytes32";
|
|
3541
|
+
readonly name: "channelId";
|
|
3542
|
+
readonly indexed: true;
|
|
3543
|
+
}, {
|
|
3544
|
+
readonly type: "address";
|
|
3545
|
+
readonly name: "payer";
|
|
3546
|
+
readonly indexed: true;
|
|
3547
|
+
}, {
|
|
3548
|
+
readonly type: "address";
|
|
3549
|
+
readonly name: "payee";
|
|
3550
|
+
readonly indexed: true;
|
|
3551
|
+
}, {
|
|
3552
|
+
readonly type: "uint96";
|
|
3553
|
+
readonly name: "additionalDeposit";
|
|
3554
|
+
}, {
|
|
3555
|
+
readonly type: "uint96";
|
|
3556
|
+
readonly name: "newDeposit";
|
|
3557
|
+
}];
|
|
3558
|
+
}, {
|
|
3559
|
+
readonly name: "CloseRequested";
|
|
3560
|
+
readonly type: "event";
|
|
3561
|
+
readonly inputs: readonly [{
|
|
3562
|
+
readonly type: "bytes32";
|
|
3563
|
+
readonly name: "channelId";
|
|
3564
|
+
readonly indexed: true;
|
|
3565
|
+
}, {
|
|
3566
|
+
readonly type: "address";
|
|
3567
|
+
readonly name: "payer";
|
|
3568
|
+
readonly indexed: true;
|
|
3569
|
+
}, {
|
|
3570
|
+
readonly type: "address";
|
|
3571
|
+
readonly name: "payee";
|
|
3572
|
+
readonly indexed: true;
|
|
3573
|
+
}, {
|
|
3574
|
+
readonly type: "uint256";
|
|
3575
|
+
readonly name: "closeGraceEnd";
|
|
3576
|
+
}];
|
|
3577
|
+
}, {
|
|
3578
|
+
readonly name: "ChannelClosed";
|
|
3579
|
+
readonly type: "event";
|
|
3580
|
+
readonly inputs: readonly [{
|
|
3581
|
+
readonly type: "bytes32";
|
|
3582
|
+
readonly name: "channelId";
|
|
3583
|
+
readonly indexed: true;
|
|
3584
|
+
}, {
|
|
3585
|
+
readonly type: "address";
|
|
3586
|
+
readonly name: "payer";
|
|
3587
|
+
readonly indexed: true;
|
|
3588
|
+
}, {
|
|
3589
|
+
readonly type: "address";
|
|
3590
|
+
readonly name: "payee";
|
|
3591
|
+
readonly indexed: true;
|
|
3592
|
+
}, {
|
|
3593
|
+
readonly type: "uint96";
|
|
3594
|
+
readonly name: "settledToPayee";
|
|
3595
|
+
}, {
|
|
3596
|
+
readonly type: "uint96";
|
|
3597
|
+
readonly name: "refundedToPayer";
|
|
3598
|
+
}];
|
|
3599
|
+
}, {
|
|
3600
|
+
readonly name: "CloseRequestCancelled";
|
|
3601
|
+
readonly type: "event";
|
|
3602
|
+
readonly inputs: readonly [{
|
|
3603
|
+
readonly type: "bytes32";
|
|
3604
|
+
readonly name: "channelId";
|
|
3605
|
+
readonly indexed: true;
|
|
3606
|
+
}, {
|
|
3607
|
+
readonly type: "address";
|
|
3608
|
+
readonly name: "payer";
|
|
3609
|
+
readonly indexed: true;
|
|
3610
|
+
}, {
|
|
3611
|
+
readonly type: "address";
|
|
3612
|
+
readonly name: "payee";
|
|
3613
|
+
readonly indexed: true;
|
|
3614
|
+
}];
|
|
3615
|
+
}, {
|
|
3616
|
+
readonly name: "ChannelAlreadyExists";
|
|
3617
|
+
readonly type: "error";
|
|
3618
|
+
readonly inputs: readonly [];
|
|
3619
|
+
}, {
|
|
3620
|
+
readonly name: "ChannelNotFound";
|
|
3621
|
+
readonly type: "error";
|
|
3622
|
+
readonly inputs: readonly [];
|
|
3623
|
+
}, {
|
|
3624
|
+
readonly name: "NotPayer";
|
|
3625
|
+
readonly type: "error";
|
|
3626
|
+
readonly inputs: readonly [];
|
|
3627
|
+
}, {
|
|
3628
|
+
readonly name: "NotPayeeOrOperator";
|
|
3629
|
+
readonly type: "error";
|
|
3630
|
+
readonly inputs: readonly [];
|
|
3631
|
+
}, {
|
|
3632
|
+
readonly name: "InvalidPayee";
|
|
3633
|
+
readonly type: "error";
|
|
3634
|
+
readonly inputs: readonly [];
|
|
3635
|
+
}, {
|
|
3636
|
+
readonly name: "ZeroDeposit";
|
|
3637
|
+
readonly type: "error";
|
|
3638
|
+
readonly inputs: readonly [];
|
|
3639
|
+
}, {
|
|
3640
|
+
readonly name: "ExpiringNonceHashNotSet";
|
|
3641
|
+
readonly type: "error";
|
|
3642
|
+
readonly inputs: readonly [];
|
|
3643
|
+
}, {
|
|
3644
|
+
readonly name: "InvalidSignature";
|
|
3645
|
+
readonly type: "error";
|
|
3646
|
+
readonly inputs: readonly [];
|
|
3647
|
+
}, {
|
|
3648
|
+
readonly name: "AmountExceedsDeposit";
|
|
3649
|
+
readonly type: "error";
|
|
3650
|
+
readonly inputs: readonly [];
|
|
3651
|
+
}, {
|
|
3652
|
+
readonly name: "AmountNotIncreasing";
|
|
3653
|
+
readonly type: "error";
|
|
3654
|
+
readonly inputs: readonly [];
|
|
3655
|
+
}, {
|
|
3656
|
+
readonly name: "CaptureAmountInvalid";
|
|
3657
|
+
readonly type: "error";
|
|
3658
|
+
readonly inputs: readonly [];
|
|
3659
|
+
}, {
|
|
3660
|
+
readonly name: "CloseNotReady";
|
|
3661
|
+
readonly type: "error";
|
|
3662
|
+
readonly inputs: readonly [];
|
|
3663
|
+
}, {
|
|
3664
|
+
readonly name: "DepositOverflow";
|
|
3665
|
+
readonly type: "error";
|
|
3666
|
+
readonly inputs: readonly [];
|
|
3667
|
+
}], "TopUp">;
|
|
3668
|
+
}
|
|
3669
|
+
/**
|
|
3670
|
+
* Adds deposit to a TIP-20 channel reserve channel and waits for the
|
|
3671
|
+
* transaction receipt.
|
|
3672
|
+
*
|
|
3673
|
+
* @example
|
|
3674
|
+
* ```ts
|
|
3675
|
+
* import { Actions } from 'viem/tempo'
|
|
3676
|
+
*
|
|
3677
|
+
* const result = await Actions.channel.topUpSync(client, {
|
|
3678
|
+
* additionalDeposit: 100n,
|
|
3679
|
+
* channel,
|
|
3680
|
+
* })
|
|
3681
|
+
* ```
|
|
3682
|
+
*
|
|
3683
|
+
* @param client - Client.
|
|
3684
|
+
* @param parameters - Parameters.
|
|
3685
|
+
* @returns The transaction receipt and event data.
|
|
3686
|
+
*/
|
|
3687
|
+
export declare function topUpSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: topUpSync.Parameters<chain, account>): Promise<topUpSync.ReturnValue>;
|
|
3688
|
+
export declare namespace topUpSync {
|
|
3689
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = topUp.Parameters<chain, account>;
|
|
3690
|
+
type Args = topUp.Args;
|
|
3691
|
+
type ReturnValue = Compute<GetEventArgs<typeof Abis.tip20ChannelReserve, 'TopUp', {
|
|
3692
|
+
IndexedOnly: false;
|
|
3693
|
+
Required: true;
|
|
3694
|
+
}> & {
|
|
3695
|
+
/** Transaction receipt. */
|
|
3696
|
+
receipt: TransactionReceipt;
|
|
3697
|
+
}>;
|
|
3698
|
+
}
|
|
3699
|
+
/**
|
|
3700
|
+
* Withdraws payer funds after the close grace period elapses.
|
|
3701
|
+
*
|
|
3702
|
+
* @example
|
|
3703
|
+
* ```ts
|
|
3704
|
+
* import { Actions } from 'viem/tempo'
|
|
3705
|
+
*
|
|
3706
|
+
* const hash = await Actions.channel.withdraw(client, {
|
|
3707
|
+
* channel,
|
|
3708
|
+
* })
|
|
3709
|
+
* ```
|
|
3710
|
+
*
|
|
3711
|
+
* @param client - Client.
|
|
3712
|
+
* @param parameters - Parameters.
|
|
3713
|
+
* @returns The transaction hash.
|
|
3714
|
+
*/
|
|
3715
|
+
export declare function withdraw<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: withdraw.Parameters<chain, account>): Promise<withdraw.ReturnValue>;
|
|
3716
|
+
export declare namespace withdraw {
|
|
3717
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
|
|
3718
|
+
type Args = {
|
|
3719
|
+
/** TIP-20 channel. */
|
|
3720
|
+
channel: ox_Channel.from.Value;
|
|
3721
|
+
};
|
|
3722
|
+
type ReturnValue = WriteContractReturnType;
|
|
3723
|
+
type ErrorType = BaseErrorType;
|
|
3724
|
+
/** @internal */
|
|
3725
|
+
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>>;
|
|
3726
|
+
/**
|
|
3727
|
+
* Defines a call to the `withdraw` function.
|
|
3728
|
+
*
|
|
3729
|
+
* @param args - Arguments.
|
|
3730
|
+
* @returns The call.
|
|
3731
|
+
*/
|
|
3732
|
+
function call(args: Args): {
|
|
3733
|
+
abi: [{
|
|
3734
|
+
readonly name: "withdraw";
|
|
3735
|
+
readonly type: "function";
|
|
3736
|
+
readonly stateMutability: "nonpayable";
|
|
3737
|
+
readonly inputs: readonly [{
|
|
3738
|
+
readonly type: "tuple";
|
|
3739
|
+
readonly name: "descriptor";
|
|
3740
|
+
readonly components: readonly [{
|
|
3741
|
+
readonly type: "address";
|
|
3742
|
+
readonly name: "payer";
|
|
3743
|
+
}, {
|
|
3744
|
+
readonly type: "address";
|
|
3745
|
+
readonly name: "payee";
|
|
3746
|
+
}, {
|
|
3747
|
+
readonly type: "address";
|
|
3748
|
+
readonly name: "operator";
|
|
3749
|
+
}, {
|
|
3750
|
+
readonly type: "address";
|
|
3751
|
+
readonly name: "token";
|
|
3752
|
+
}, {
|
|
3753
|
+
readonly type: "bytes32";
|
|
3754
|
+
readonly name: "salt";
|
|
3755
|
+
}, {
|
|
3756
|
+
readonly type: "address";
|
|
3757
|
+
readonly name: "authorizedSigner";
|
|
3758
|
+
}, {
|
|
3759
|
+
readonly type: "bytes32";
|
|
3760
|
+
readonly name: "expiringNonceHash";
|
|
3761
|
+
}];
|
|
3762
|
+
}];
|
|
3763
|
+
readonly outputs: readonly [];
|
|
3764
|
+
}];
|
|
3765
|
+
functionName: "withdraw";
|
|
3766
|
+
} & {
|
|
3767
|
+
args: readonly [{
|
|
3768
|
+
payer: `0x${string}`;
|
|
3769
|
+
payee: `0x${string}`;
|
|
3770
|
+
operator: `0x${string}`;
|
|
3771
|
+
token: `0x${string}`;
|
|
3772
|
+
salt: `0x${string}`;
|
|
3773
|
+
authorizedSigner: `0x${string}`;
|
|
3774
|
+
expiringNonceHash: `0x${string}`;
|
|
3775
|
+
}];
|
|
3776
|
+
} & {
|
|
3777
|
+
address: import("abitype").Address;
|
|
3778
|
+
} & {
|
|
3779
|
+
data: import("../../index.js").Hex;
|
|
3780
|
+
to: import("abitype").Address;
|
|
3781
|
+
};
|
|
3782
|
+
/**
|
|
3783
|
+
* Extracts the `ChannelClosed` event from logs.
|
|
3784
|
+
*
|
|
3785
|
+
* @param logs - The logs.
|
|
3786
|
+
* @returns The `ChannelClosed` event.
|
|
3787
|
+
*/
|
|
3788
|
+
function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
|
|
3789
|
+
readonly name: "CLOSE_GRACE_PERIOD";
|
|
3790
|
+
readonly type: "function";
|
|
3791
|
+
readonly stateMutability: "view";
|
|
3792
|
+
readonly inputs: readonly [];
|
|
3793
|
+
readonly outputs: readonly [{
|
|
3794
|
+
readonly type: "uint64";
|
|
3795
|
+
}];
|
|
3796
|
+
}, {
|
|
3797
|
+
readonly name: "VOUCHER_TYPEHASH";
|
|
3798
|
+
readonly type: "function";
|
|
3799
|
+
readonly stateMutability: "view";
|
|
3800
|
+
readonly inputs: readonly [];
|
|
3801
|
+
readonly outputs: readonly [{
|
|
3802
|
+
readonly type: "bytes32";
|
|
3803
|
+
}];
|
|
3804
|
+
}, {
|
|
3805
|
+
readonly name: "open";
|
|
3806
|
+
readonly type: "function";
|
|
3807
|
+
readonly stateMutability: "nonpayable";
|
|
3808
|
+
readonly inputs: readonly [{
|
|
3809
|
+
readonly type: "address";
|
|
3810
|
+
readonly name: "payee";
|
|
3811
|
+
}, {
|
|
3812
|
+
readonly type: "address";
|
|
3813
|
+
readonly name: "operator";
|
|
3814
|
+
}, {
|
|
3815
|
+
readonly type: "address";
|
|
3816
|
+
readonly name: "token";
|
|
3817
|
+
}, {
|
|
3818
|
+
readonly type: "uint96";
|
|
3819
|
+
readonly name: "deposit";
|
|
3820
|
+
}, {
|
|
3821
|
+
readonly type: "bytes32";
|
|
3822
|
+
readonly name: "salt";
|
|
3823
|
+
}, {
|
|
3824
|
+
readonly type: "address";
|
|
3825
|
+
readonly name: "authorizedSigner";
|
|
3826
|
+
}];
|
|
3827
|
+
readonly outputs: readonly [{
|
|
3828
|
+
readonly type: "bytes32";
|
|
3829
|
+
readonly name: "channelId";
|
|
3830
|
+
}];
|
|
3831
|
+
}, {
|
|
3832
|
+
readonly name: "settle";
|
|
3833
|
+
readonly type: "function";
|
|
3834
|
+
readonly stateMutability: "nonpayable";
|
|
3835
|
+
readonly inputs: readonly [{
|
|
3836
|
+
readonly type: "tuple";
|
|
3837
|
+
readonly name: "descriptor";
|
|
3838
|
+
readonly components: readonly [{
|
|
3839
|
+
readonly type: "address";
|
|
3840
|
+
readonly name: "payer";
|
|
3841
|
+
}, {
|
|
3842
|
+
readonly type: "address";
|
|
3843
|
+
readonly name: "payee";
|
|
3844
|
+
}, {
|
|
3845
|
+
readonly type: "address";
|
|
3846
|
+
readonly name: "operator";
|
|
3847
|
+
}, {
|
|
3848
|
+
readonly type: "address";
|
|
3849
|
+
readonly name: "token";
|
|
3850
|
+
}, {
|
|
3851
|
+
readonly type: "bytes32";
|
|
3852
|
+
readonly name: "salt";
|
|
3853
|
+
}, {
|
|
3854
|
+
readonly type: "address";
|
|
3855
|
+
readonly name: "authorizedSigner";
|
|
3856
|
+
}, {
|
|
3857
|
+
readonly type: "bytes32";
|
|
3858
|
+
readonly name: "expiringNonceHash";
|
|
3859
|
+
}];
|
|
3860
|
+
}, {
|
|
3861
|
+
readonly type: "uint96";
|
|
3862
|
+
readonly name: "cumulativeAmount";
|
|
3863
|
+
}, {
|
|
3864
|
+
readonly type: "bytes";
|
|
3865
|
+
readonly name: "signature";
|
|
3866
|
+
}];
|
|
3867
|
+
readonly outputs: readonly [];
|
|
3868
|
+
}, {
|
|
3869
|
+
readonly name: "topUp";
|
|
3870
|
+
readonly type: "function";
|
|
3871
|
+
readonly stateMutability: "nonpayable";
|
|
3872
|
+
readonly inputs: readonly [{
|
|
3873
|
+
readonly type: "tuple";
|
|
3874
|
+
readonly name: "descriptor";
|
|
3875
|
+
readonly components: readonly [{
|
|
3876
|
+
readonly type: "address";
|
|
3877
|
+
readonly name: "payer";
|
|
3878
|
+
}, {
|
|
3879
|
+
readonly type: "address";
|
|
3880
|
+
readonly name: "payee";
|
|
3881
|
+
}, {
|
|
3882
|
+
readonly type: "address";
|
|
3883
|
+
readonly name: "operator";
|
|
3884
|
+
}, {
|
|
3885
|
+
readonly type: "address";
|
|
3886
|
+
readonly name: "token";
|
|
3887
|
+
}, {
|
|
3888
|
+
readonly type: "bytes32";
|
|
3889
|
+
readonly name: "salt";
|
|
3890
|
+
}, {
|
|
3891
|
+
readonly type: "address";
|
|
3892
|
+
readonly name: "authorizedSigner";
|
|
3893
|
+
}, {
|
|
3894
|
+
readonly type: "bytes32";
|
|
3895
|
+
readonly name: "expiringNonceHash";
|
|
3896
|
+
}];
|
|
3897
|
+
}, {
|
|
3898
|
+
readonly type: "uint96";
|
|
3899
|
+
readonly name: "additionalDeposit";
|
|
3900
|
+
}];
|
|
3901
|
+
readonly outputs: readonly [];
|
|
3902
|
+
}, {
|
|
3903
|
+
readonly name: "close";
|
|
3904
|
+
readonly type: "function";
|
|
3905
|
+
readonly stateMutability: "nonpayable";
|
|
3906
|
+
readonly inputs: readonly [{
|
|
3907
|
+
readonly type: "tuple";
|
|
3908
|
+
readonly name: "descriptor";
|
|
3909
|
+
readonly components: readonly [{
|
|
3910
|
+
readonly type: "address";
|
|
3911
|
+
readonly name: "payer";
|
|
3912
|
+
}, {
|
|
3913
|
+
readonly type: "address";
|
|
3914
|
+
readonly name: "payee";
|
|
3915
|
+
}, {
|
|
3916
|
+
readonly type: "address";
|
|
3917
|
+
readonly name: "operator";
|
|
3918
|
+
}, {
|
|
3919
|
+
readonly type: "address";
|
|
3920
|
+
readonly name: "token";
|
|
3921
|
+
}, {
|
|
3922
|
+
readonly type: "bytes32";
|
|
3923
|
+
readonly name: "salt";
|
|
3924
|
+
}, {
|
|
3925
|
+
readonly type: "address";
|
|
3926
|
+
readonly name: "authorizedSigner";
|
|
3927
|
+
}, {
|
|
3928
|
+
readonly type: "bytes32";
|
|
3929
|
+
readonly name: "expiringNonceHash";
|
|
3930
|
+
}];
|
|
3931
|
+
}, {
|
|
3932
|
+
readonly type: "uint96";
|
|
3933
|
+
readonly name: "cumulativeAmount";
|
|
3934
|
+
}, {
|
|
3935
|
+
readonly type: "uint96";
|
|
3936
|
+
readonly name: "captureAmount";
|
|
3937
|
+
}, {
|
|
3938
|
+
readonly type: "bytes";
|
|
3939
|
+
readonly name: "signature";
|
|
3940
|
+
}];
|
|
3941
|
+
readonly outputs: readonly [];
|
|
3942
|
+
}, {
|
|
3943
|
+
readonly name: "requestClose";
|
|
3944
|
+
readonly type: "function";
|
|
3945
|
+
readonly stateMutability: "nonpayable";
|
|
3946
|
+
readonly inputs: readonly [{
|
|
3947
|
+
readonly type: "tuple";
|
|
3948
|
+
readonly name: "descriptor";
|
|
3949
|
+
readonly components: readonly [{
|
|
3950
|
+
readonly type: "address";
|
|
3951
|
+
readonly name: "payer";
|
|
3952
|
+
}, {
|
|
3953
|
+
readonly type: "address";
|
|
3954
|
+
readonly name: "payee";
|
|
3955
|
+
}, {
|
|
3956
|
+
readonly type: "address";
|
|
3957
|
+
readonly name: "operator";
|
|
3958
|
+
}, {
|
|
3959
|
+
readonly type: "address";
|
|
3960
|
+
readonly name: "token";
|
|
3961
|
+
}, {
|
|
3962
|
+
readonly type: "bytes32";
|
|
3963
|
+
readonly name: "salt";
|
|
3964
|
+
}, {
|
|
3965
|
+
readonly type: "address";
|
|
3966
|
+
readonly name: "authorizedSigner";
|
|
3967
|
+
}, {
|
|
3968
|
+
readonly type: "bytes32";
|
|
3969
|
+
readonly name: "expiringNonceHash";
|
|
3970
|
+
}];
|
|
3971
|
+
}];
|
|
3972
|
+
readonly outputs: readonly [];
|
|
3973
|
+
}, {
|
|
3974
|
+
readonly name: "withdraw";
|
|
3975
|
+
readonly type: "function";
|
|
3976
|
+
readonly stateMutability: "nonpayable";
|
|
3977
|
+
readonly inputs: readonly [{
|
|
3978
|
+
readonly type: "tuple";
|
|
3979
|
+
readonly name: "descriptor";
|
|
3980
|
+
readonly components: readonly [{
|
|
3981
|
+
readonly type: "address";
|
|
3982
|
+
readonly name: "payer";
|
|
3983
|
+
}, {
|
|
3984
|
+
readonly type: "address";
|
|
3985
|
+
readonly name: "payee";
|
|
3986
|
+
}, {
|
|
3987
|
+
readonly type: "address";
|
|
3988
|
+
readonly name: "operator";
|
|
3989
|
+
}, {
|
|
3990
|
+
readonly type: "address";
|
|
3991
|
+
readonly name: "token";
|
|
3992
|
+
}, {
|
|
3993
|
+
readonly type: "bytes32";
|
|
3994
|
+
readonly name: "salt";
|
|
3995
|
+
}, {
|
|
3996
|
+
readonly type: "address";
|
|
3997
|
+
readonly name: "authorizedSigner";
|
|
3998
|
+
}, {
|
|
3999
|
+
readonly type: "bytes32";
|
|
4000
|
+
readonly name: "expiringNonceHash";
|
|
4001
|
+
}];
|
|
4002
|
+
}];
|
|
4003
|
+
readonly outputs: readonly [];
|
|
4004
|
+
}, {
|
|
4005
|
+
readonly name: "getChannel";
|
|
4006
|
+
readonly type: "function";
|
|
4007
|
+
readonly stateMutability: "view";
|
|
4008
|
+
readonly inputs: readonly [{
|
|
4009
|
+
readonly type: "tuple";
|
|
4010
|
+
readonly name: "descriptor";
|
|
4011
|
+
readonly components: readonly [{
|
|
4012
|
+
readonly type: "address";
|
|
4013
|
+
readonly name: "payer";
|
|
4014
|
+
}, {
|
|
4015
|
+
readonly type: "address";
|
|
4016
|
+
readonly name: "payee";
|
|
4017
|
+
}, {
|
|
4018
|
+
readonly type: "address";
|
|
4019
|
+
readonly name: "operator";
|
|
4020
|
+
}, {
|
|
4021
|
+
readonly type: "address";
|
|
4022
|
+
readonly name: "token";
|
|
4023
|
+
}, {
|
|
4024
|
+
readonly type: "bytes32";
|
|
4025
|
+
readonly name: "salt";
|
|
4026
|
+
}, {
|
|
4027
|
+
readonly type: "address";
|
|
4028
|
+
readonly name: "authorizedSigner";
|
|
4029
|
+
}, {
|
|
4030
|
+
readonly type: "bytes32";
|
|
4031
|
+
readonly name: "expiringNonceHash";
|
|
4032
|
+
}];
|
|
4033
|
+
}];
|
|
4034
|
+
readonly outputs: readonly [{
|
|
4035
|
+
readonly type: "tuple";
|
|
4036
|
+
readonly components: readonly [{
|
|
4037
|
+
readonly type: "tuple";
|
|
4038
|
+
readonly name: "descriptor";
|
|
4039
|
+
readonly components: readonly [{
|
|
4040
|
+
readonly type: "address";
|
|
4041
|
+
readonly name: "payer";
|
|
4042
|
+
}, {
|
|
4043
|
+
readonly type: "address";
|
|
4044
|
+
readonly name: "payee";
|
|
4045
|
+
}, {
|
|
4046
|
+
readonly type: "address";
|
|
4047
|
+
readonly name: "operator";
|
|
4048
|
+
}, {
|
|
4049
|
+
readonly type: "address";
|
|
4050
|
+
readonly name: "token";
|
|
4051
|
+
}, {
|
|
4052
|
+
readonly type: "bytes32";
|
|
4053
|
+
readonly name: "salt";
|
|
4054
|
+
}, {
|
|
4055
|
+
readonly type: "address";
|
|
4056
|
+
readonly name: "authorizedSigner";
|
|
4057
|
+
}, {
|
|
4058
|
+
readonly type: "bytes32";
|
|
4059
|
+
readonly name: "expiringNonceHash";
|
|
4060
|
+
}];
|
|
4061
|
+
}, {
|
|
4062
|
+
readonly type: "tuple";
|
|
4063
|
+
readonly name: "state";
|
|
4064
|
+
readonly components: readonly [{
|
|
4065
|
+
readonly type: "uint96";
|
|
4066
|
+
readonly name: "settled";
|
|
4067
|
+
}, {
|
|
4068
|
+
readonly type: "uint96";
|
|
4069
|
+
readonly name: "deposit";
|
|
4070
|
+
}, {
|
|
4071
|
+
readonly type: "uint32";
|
|
4072
|
+
readonly name: "closeRequestedAt";
|
|
4073
|
+
}];
|
|
4074
|
+
}];
|
|
4075
|
+
}];
|
|
4076
|
+
}, {
|
|
4077
|
+
readonly name: "getChannelState";
|
|
4078
|
+
readonly type: "function";
|
|
4079
|
+
readonly stateMutability: "view";
|
|
4080
|
+
readonly inputs: readonly [{
|
|
4081
|
+
readonly type: "bytes32";
|
|
4082
|
+
readonly name: "channelId";
|
|
4083
|
+
}];
|
|
4084
|
+
readonly outputs: readonly [{
|
|
4085
|
+
readonly type: "tuple";
|
|
4086
|
+
readonly components: readonly [{
|
|
4087
|
+
readonly type: "uint96";
|
|
4088
|
+
readonly name: "settled";
|
|
4089
|
+
}, {
|
|
4090
|
+
readonly type: "uint96";
|
|
4091
|
+
readonly name: "deposit";
|
|
4092
|
+
}, {
|
|
4093
|
+
readonly type: "uint32";
|
|
4094
|
+
readonly name: "closeRequestedAt";
|
|
4095
|
+
}];
|
|
4096
|
+
}];
|
|
4097
|
+
}, {
|
|
4098
|
+
readonly name: "getChannelStatesBatch";
|
|
4099
|
+
readonly type: "function";
|
|
4100
|
+
readonly stateMutability: "view";
|
|
4101
|
+
readonly inputs: readonly [{
|
|
4102
|
+
readonly type: "bytes32[]";
|
|
4103
|
+
readonly name: "channelIds";
|
|
4104
|
+
}];
|
|
4105
|
+
readonly outputs: readonly [{
|
|
4106
|
+
readonly type: "tuple[]";
|
|
4107
|
+
readonly components: readonly [{
|
|
4108
|
+
readonly type: "uint96";
|
|
4109
|
+
readonly name: "settled";
|
|
4110
|
+
}, {
|
|
4111
|
+
readonly type: "uint96";
|
|
4112
|
+
readonly name: "deposit";
|
|
4113
|
+
}, {
|
|
4114
|
+
readonly type: "uint32";
|
|
4115
|
+
readonly name: "closeRequestedAt";
|
|
4116
|
+
}];
|
|
4117
|
+
}];
|
|
4118
|
+
}, {
|
|
4119
|
+
readonly name: "computeChannelId";
|
|
4120
|
+
readonly type: "function";
|
|
4121
|
+
readonly stateMutability: "view";
|
|
4122
|
+
readonly inputs: readonly [{
|
|
4123
|
+
readonly type: "address";
|
|
4124
|
+
readonly name: "payer";
|
|
4125
|
+
}, {
|
|
4126
|
+
readonly type: "address";
|
|
4127
|
+
readonly name: "payee";
|
|
4128
|
+
}, {
|
|
4129
|
+
readonly type: "address";
|
|
4130
|
+
readonly name: "operator";
|
|
4131
|
+
}, {
|
|
4132
|
+
readonly type: "address";
|
|
4133
|
+
readonly name: "token";
|
|
4134
|
+
}, {
|
|
4135
|
+
readonly type: "bytes32";
|
|
4136
|
+
readonly name: "salt";
|
|
4137
|
+
}, {
|
|
4138
|
+
readonly type: "address";
|
|
4139
|
+
readonly name: "authorizedSigner";
|
|
4140
|
+
}, {
|
|
4141
|
+
readonly type: "bytes32";
|
|
4142
|
+
readonly name: "expiringNonceHash";
|
|
4143
|
+
}];
|
|
4144
|
+
readonly outputs: readonly [{
|
|
4145
|
+
readonly type: "bytes32";
|
|
4146
|
+
}];
|
|
4147
|
+
}, {
|
|
4148
|
+
readonly name: "getVoucherDigest";
|
|
4149
|
+
readonly type: "function";
|
|
4150
|
+
readonly stateMutability: "view";
|
|
4151
|
+
readonly inputs: readonly [{
|
|
4152
|
+
readonly type: "bytes32";
|
|
4153
|
+
readonly name: "channelId";
|
|
4154
|
+
}, {
|
|
4155
|
+
readonly type: "uint96";
|
|
4156
|
+
readonly name: "cumulativeAmount";
|
|
4157
|
+
}];
|
|
4158
|
+
readonly outputs: readonly [{
|
|
4159
|
+
readonly type: "bytes32";
|
|
4160
|
+
}];
|
|
4161
|
+
}, {
|
|
4162
|
+
readonly name: "domainSeparator";
|
|
4163
|
+
readonly type: "function";
|
|
4164
|
+
readonly stateMutability: "view";
|
|
4165
|
+
readonly inputs: readonly [];
|
|
4166
|
+
readonly outputs: readonly [{
|
|
4167
|
+
readonly type: "bytes32";
|
|
4168
|
+
}];
|
|
4169
|
+
}, {
|
|
4170
|
+
readonly name: "ChannelOpened";
|
|
4171
|
+
readonly type: "event";
|
|
4172
|
+
readonly inputs: readonly [{
|
|
4173
|
+
readonly type: "bytes32";
|
|
4174
|
+
readonly name: "channelId";
|
|
4175
|
+
readonly indexed: true;
|
|
4176
|
+
}, {
|
|
4177
|
+
readonly type: "address";
|
|
4178
|
+
readonly name: "payer";
|
|
4179
|
+
readonly indexed: true;
|
|
4180
|
+
}, {
|
|
4181
|
+
readonly type: "address";
|
|
4182
|
+
readonly name: "payee";
|
|
4183
|
+
readonly indexed: true;
|
|
4184
|
+
}, {
|
|
4185
|
+
readonly type: "address";
|
|
4186
|
+
readonly name: "operator";
|
|
4187
|
+
}, {
|
|
4188
|
+
readonly type: "address";
|
|
4189
|
+
readonly name: "token";
|
|
4190
|
+
}, {
|
|
4191
|
+
readonly type: "address";
|
|
4192
|
+
readonly name: "authorizedSigner";
|
|
4193
|
+
}, {
|
|
4194
|
+
readonly type: "bytes32";
|
|
4195
|
+
readonly name: "salt";
|
|
4196
|
+
}, {
|
|
4197
|
+
readonly type: "bytes32";
|
|
4198
|
+
readonly name: "expiringNonceHash";
|
|
4199
|
+
}, {
|
|
4200
|
+
readonly type: "uint96";
|
|
4201
|
+
readonly name: "deposit";
|
|
4202
|
+
}];
|
|
4203
|
+
}, {
|
|
4204
|
+
readonly name: "Settled";
|
|
4205
|
+
readonly type: "event";
|
|
4206
|
+
readonly inputs: readonly [{
|
|
4207
|
+
readonly type: "bytes32";
|
|
4208
|
+
readonly name: "channelId";
|
|
4209
|
+
readonly indexed: true;
|
|
4210
|
+
}, {
|
|
4211
|
+
readonly type: "address";
|
|
4212
|
+
readonly name: "payer";
|
|
4213
|
+
readonly indexed: true;
|
|
4214
|
+
}, {
|
|
4215
|
+
readonly type: "address";
|
|
4216
|
+
readonly name: "payee";
|
|
4217
|
+
readonly indexed: true;
|
|
4218
|
+
}, {
|
|
4219
|
+
readonly type: "uint96";
|
|
4220
|
+
readonly name: "cumulativeAmount";
|
|
4221
|
+
}, {
|
|
4222
|
+
readonly type: "uint96";
|
|
4223
|
+
readonly name: "deltaPaid";
|
|
4224
|
+
}, {
|
|
4225
|
+
readonly type: "uint96";
|
|
4226
|
+
readonly name: "newSettled";
|
|
4227
|
+
}];
|
|
4228
|
+
}, {
|
|
4229
|
+
readonly name: "TopUp";
|
|
4230
|
+
readonly type: "event";
|
|
4231
|
+
readonly inputs: readonly [{
|
|
4232
|
+
readonly type: "bytes32";
|
|
4233
|
+
readonly name: "channelId";
|
|
4234
|
+
readonly indexed: true;
|
|
4235
|
+
}, {
|
|
4236
|
+
readonly type: "address";
|
|
4237
|
+
readonly name: "payer";
|
|
4238
|
+
readonly indexed: true;
|
|
4239
|
+
}, {
|
|
4240
|
+
readonly type: "address";
|
|
4241
|
+
readonly name: "payee";
|
|
4242
|
+
readonly indexed: true;
|
|
4243
|
+
}, {
|
|
4244
|
+
readonly type: "uint96";
|
|
4245
|
+
readonly name: "additionalDeposit";
|
|
4246
|
+
}, {
|
|
4247
|
+
readonly type: "uint96";
|
|
4248
|
+
readonly name: "newDeposit";
|
|
4249
|
+
}];
|
|
4250
|
+
}, {
|
|
4251
|
+
readonly name: "CloseRequested";
|
|
4252
|
+
readonly type: "event";
|
|
4253
|
+
readonly inputs: readonly [{
|
|
4254
|
+
readonly type: "bytes32";
|
|
4255
|
+
readonly name: "channelId";
|
|
4256
|
+
readonly indexed: true;
|
|
4257
|
+
}, {
|
|
4258
|
+
readonly type: "address";
|
|
4259
|
+
readonly name: "payer";
|
|
4260
|
+
readonly indexed: true;
|
|
4261
|
+
}, {
|
|
4262
|
+
readonly type: "address";
|
|
4263
|
+
readonly name: "payee";
|
|
4264
|
+
readonly indexed: true;
|
|
4265
|
+
}, {
|
|
4266
|
+
readonly type: "uint256";
|
|
4267
|
+
readonly name: "closeGraceEnd";
|
|
4268
|
+
}];
|
|
4269
|
+
}, {
|
|
4270
|
+
readonly name: "ChannelClosed";
|
|
4271
|
+
readonly type: "event";
|
|
4272
|
+
readonly inputs: readonly [{
|
|
4273
|
+
readonly type: "bytes32";
|
|
4274
|
+
readonly name: "channelId";
|
|
4275
|
+
readonly indexed: true;
|
|
4276
|
+
}, {
|
|
4277
|
+
readonly type: "address";
|
|
4278
|
+
readonly name: "payer";
|
|
4279
|
+
readonly indexed: true;
|
|
4280
|
+
}, {
|
|
4281
|
+
readonly type: "address";
|
|
4282
|
+
readonly name: "payee";
|
|
4283
|
+
readonly indexed: true;
|
|
4284
|
+
}, {
|
|
4285
|
+
readonly type: "uint96";
|
|
4286
|
+
readonly name: "settledToPayee";
|
|
4287
|
+
}, {
|
|
4288
|
+
readonly type: "uint96";
|
|
4289
|
+
readonly name: "refundedToPayer";
|
|
4290
|
+
}];
|
|
4291
|
+
}, {
|
|
4292
|
+
readonly name: "CloseRequestCancelled";
|
|
4293
|
+
readonly type: "event";
|
|
4294
|
+
readonly inputs: readonly [{
|
|
4295
|
+
readonly type: "bytes32";
|
|
4296
|
+
readonly name: "channelId";
|
|
4297
|
+
readonly indexed: true;
|
|
4298
|
+
}, {
|
|
4299
|
+
readonly type: "address";
|
|
4300
|
+
readonly name: "payer";
|
|
4301
|
+
readonly indexed: true;
|
|
4302
|
+
}, {
|
|
4303
|
+
readonly type: "address";
|
|
4304
|
+
readonly name: "payee";
|
|
4305
|
+
readonly indexed: true;
|
|
4306
|
+
}];
|
|
4307
|
+
}, {
|
|
4308
|
+
readonly name: "ChannelAlreadyExists";
|
|
4309
|
+
readonly type: "error";
|
|
4310
|
+
readonly inputs: readonly [];
|
|
4311
|
+
}, {
|
|
4312
|
+
readonly name: "ChannelNotFound";
|
|
4313
|
+
readonly type: "error";
|
|
4314
|
+
readonly inputs: readonly [];
|
|
4315
|
+
}, {
|
|
4316
|
+
readonly name: "NotPayer";
|
|
4317
|
+
readonly type: "error";
|
|
4318
|
+
readonly inputs: readonly [];
|
|
4319
|
+
}, {
|
|
4320
|
+
readonly name: "NotPayeeOrOperator";
|
|
4321
|
+
readonly type: "error";
|
|
4322
|
+
readonly inputs: readonly [];
|
|
4323
|
+
}, {
|
|
4324
|
+
readonly name: "InvalidPayee";
|
|
4325
|
+
readonly type: "error";
|
|
4326
|
+
readonly inputs: readonly [];
|
|
4327
|
+
}, {
|
|
4328
|
+
readonly name: "ZeroDeposit";
|
|
4329
|
+
readonly type: "error";
|
|
4330
|
+
readonly inputs: readonly [];
|
|
4331
|
+
}, {
|
|
4332
|
+
readonly name: "ExpiringNonceHashNotSet";
|
|
4333
|
+
readonly type: "error";
|
|
4334
|
+
readonly inputs: readonly [];
|
|
4335
|
+
}, {
|
|
4336
|
+
readonly name: "InvalidSignature";
|
|
4337
|
+
readonly type: "error";
|
|
4338
|
+
readonly inputs: readonly [];
|
|
4339
|
+
}, {
|
|
4340
|
+
readonly name: "AmountExceedsDeposit";
|
|
4341
|
+
readonly type: "error";
|
|
4342
|
+
readonly inputs: readonly [];
|
|
4343
|
+
}, {
|
|
4344
|
+
readonly name: "AmountNotIncreasing";
|
|
4345
|
+
readonly type: "error";
|
|
4346
|
+
readonly inputs: readonly [];
|
|
4347
|
+
}, {
|
|
4348
|
+
readonly name: "CaptureAmountInvalid";
|
|
4349
|
+
readonly type: "error";
|
|
4350
|
+
readonly inputs: readonly [];
|
|
4351
|
+
}, {
|
|
4352
|
+
readonly name: "CloseNotReady";
|
|
4353
|
+
readonly type: "error";
|
|
4354
|
+
readonly inputs: readonly [];
|
|
4355
|
+
}, {
|
|
4356
|
+
readonly name: "DepositOverflow";
|
|
4357
|
+
readonly type: "error";
|
|
4358
|
+
readonly inputs: readonly [];
|
|
4359
|
+
}], "ChannelClosed">;
|
|
4360
|
+
}
|
|
4361
|
+
/**
|
|
4362
|
+
* Withdraws payer funds after the close grace period elapses and waits for the
|
|
4363
|
+
* transaction receipt.
|
|
4364
|
+
*
|
|
4365
|
+
* @example
|
|
4366
|
+
* ```ts
|
|
4367
|
+
* import { Actions } from 'viem/tempo'
|
|
4368
|
+
*
|
|
4369
|
+
* const result = await Actions.channel.withdrawSync(client, {
|
|
4370
|
+
* channel,
|
|
4371
|
+
* })
|
|
4372
|
+
* ```
|
|
4373
|
+
*
|
|
4374
|
+
* @param client - Client.
|
|
4375
|
+
* @param parameters - Parameters.
|
|
4376
|
+
* @returns The transaction receipt and event data.
|
|
4377
|
+
*/
|
|
4378
|
+
export declare function withdrawSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: withdrawSync.Parameters<chain, account>): Promise<withdrawSync.ReturnValue>;
|
|
4379
|
+
export declare namespace withdrawSync {
|
|
4380
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = withdraw.Parameters<chain, account>;
|
|
4381
|
+
type Args = withdraw.Args;
|
|
4382
|
+
type ReturnValue = Compute<GetEventArgs<typeof Abis.tip20ChannelReserve, 'ChannelClosed', {
|
|
4383
|
+
IndexedOnly: false;
|
|
4384
|
+
Required: true;
|
|
4385
|
+
}> & {
|
|
4386
|
+
/** Transaction receipt. */
|
|
4387
|
+
receipt: TransactionReceipt;
|
|
4388
|
+
}>;
|
|
4389
|
+
}
|
|
4390
|
+
//# sourceMappingURL=channel.d.ts.map
|