@team-oozoo/oozoo-pay 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @team-oozoo/oozoo-pay might be problematic. Click here for more details.
- package/README.md +139 -0
- package/dist/index.d.mts +1260 -0
- package/dist/index.d.ts +1260 -0
- package/dist/index.js +1553 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1530 -0
- package/dist/index.mjs.map +1 -0
- package/dist/standalone.global.js +57 -0
- package/dist/standalone.global.js.map +1 -0
- package/package.json +34 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1260 @@
|
|
|
1
|
+
interface PaymentRouter {
|
|
2
|
+
id: string;
|
|
3
|
+
chainId: string;
|
|
4
|
+
address: string;
|
|
5
|
+
}
|
|
6
|
+
interface PaymentSetting {
|
|
7
|
+
id: string;
|
|
8
|
+
chainId: string;
|
|
9
|
+
chainIcon?: string;
|
|
10
|
+
tokenAddress: string;
|
|
11
|
+
tokenName: string;
|
|
12
|
+
tokenSymbol: string;
|
|
13
|
+
tokenDecimals: number;
|
|
14
|
+
tokenIcon?: string;
|
|
15
|
+
receiver: string;
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface PaymentConfig {
|
|
19
|
+
/** Reown project ID (managed by PG) */
|
|
20
|
+
projectId: string;
|
|
21
|
+
/** Project mode: TEST or LIVE */
|
|
22
|
+
mode: 'TEST' | 'LIVE';
|
|
23
|
+
paymentRouters: PaymentRouter[];
|
|
24
|
+
paymentSettings: PaymentSetting[];
|
|
25
|
+
}
|
|
26
|
+
interface PaymentData {
|
|
27
|
+
id: string;
|
|
28
|
+
erc20: string;
|
|
29
|
+
sender: string;
|
|
30
|
+
receiver: string;
|
|
31
|
+
amount: string;
|
|
32
|
+
feeRate: string;
|
|
33
|
+
expirationTimestamp: string;
|
|
34
|
+
}
|
|
35
|
+
interface GetBalanceResult {
|
|
36
|
+
raw: bigint;
|
|
37
|
+
formatted: string;
|
|
38
|
+
}
|
|
39
|
+
interface PaymentInstruction {
|
|
40
|
+
chainType: string;
|
|
41
|
+
chainId: string;
|
|
42
|
+
paymentData: PaymentData;
|
|
43
|
+
signature: string;
|
|
44
|
+
}
|
|
45
|
+
/** Supported currency units for price */
|
|
46
|
+
type PriceUnit = 'usd';
|
|
47
|
+
/** Base invoice parameters */
|
|
48
|
+
interface BaseInvoiceParams {
|
|
49
|
+
/** Price amount */
|
|
50
|
+
price: number;
|
|
51
|
+
/** Unit of the price */
|
|
52
|
+
unit: PriceUnit;
|
|
53
|
+
/** Blockchain chain ID */
|
|
54
|
+
chainId: string;
|
|
55
|
+
/** Token contract address */
|
|
56
|
+
tokenAddress: string;
|
|
57
|
+
}
|
|
58
|
+
/** Parameters passed to pay() onCreateInvoice callback */
|
|
59
|
+
interface PayInvoiceParams extends BaseInvoiceParams {
|
|
60
|
+
/** Payer's wallet address */
|
|
61
|
+
sender: string;
|
|
62
|
+
}
|
|
63
|
+
/** Parameters passed to transfer() onCreateInvoice callback */
|
|
64
|
+
interface TransferInvoiceParams extends BaseInvoiceParams {
|
|
65
|
+
/** Recipient's wallet address */
|
|
66
|
+
receiver: string;
|
|
67
|
+
}
|
|
68
|
+
/** Options for pay() method */
|
|
69
|
+
interface PayOptions {
|
|
70
|
+
/** Payment price */
|
|
71
|
+
price: number;
|
|
72
|
+
/** Unit of the price (default: 'usd') */
|
|
73
|
+
unit?: PriceUnit;
|
|
74
|
+
/**
|
|
75
|
+
* Invoice creation callback.
|
|
76
|
+
* Called when the user clicks Pay. The merchant server should create an HMAC invoice
|
|
77
|
+
* and return the invoiceId.
|
|
78
|
+
*/
|
|
79
|
+
onCreateInvoice: (params: PayInvoiceParams) => Promise<string>;
|
|
80
|
+
/** Redirect URL on payment success */
|
|
81
|
+
successUrl: string;
|
|
82
|
+
/** Redirect URL on payment failure/cancel */
|
|
83
|
+
failUrl: string;
|
|
84
|
+
}
|
|
85
|
+
/** Options for transfer() method */
|
|
86
|
+
interface TransferOptions {
|
|
87
|
+
/** Transfer price */
|
|
88
|
+
price: number;
|
|
89
|
+
/** Unit of the price (default: 'usd') */
|
|
90
|
+
unit?: PriceUnit;
|
|
91
|
+
/**
|
|
92
|
+
* Invoice creation callback.
|
|
93
|
+
* Called when the user clicks Transfer. The merchant server should create an HMAC invoice
|
|
94
|
+
* and return the invoiceId.
|
|
95
|
+
*/
|
|
96
|
+
onCreateInvoice: (params: TransferInvoiceParams) => Promise<string>;
|
|
97
|
+
/** Redirect URL on transfer success */
|
|
98
|
+
successUrl: string;
|
|
99
|
+
/** Redirect URL on transfer failure/cancel */
|
|
100
|
+
failUrl: string;
|
|
101
|
+
}
|
|
102
|
+
/** @deprecated Use PayOptions instead */
|
|
103
|
+
type RequestPaymentOptions = PayOptions;
|
|
104
|
+
/** @deprecated Use TransferOptions instead */
|
|
105
|
+
type RequestWithdrawalOptions = TransferOptions;
|
|
106
|
+
/** @deprecated Use PayInvoiceParams or TransferInvoiceParams instead */
|
|
107
|
+
type CreateInvoiceParams = PayInvoiceParams | TransferInvoiceParams;
|
|
108
|
+
interface PostMessageReady {
|
|
109
|
+
type: 'OOZOO_READY';
|
|
110
|
+
}
|
|
111
|
+
interface PostMessageCreateInvoice {
|
|
112
|
+
type: 'OOZOO_CREATE_INVOICE';
|
|
113
|
+
requestId: string;
|
|
114
|
+
params: {
|
|
115
|
+
price: number;
|
|
116
|
+
unit: PriceUnit;
|
|
117
|
+
chainId: string;
|
|
118
|
+
tokenAddress: string;
|
|
119
|
+
sender?: string;
|
|
120
|
+
receiver?: string;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
interface PostMessageCreateInvoiceResult {
|
|
124
|
+
type: 'OOZOO_CREATE_INVOICE_RESULT';
|
|
125
|
+
requestId: string;
|
|
126
|
+
invoiceId?: string;
|
|
127
|
+
error?: string;
|
|
128
|
+
}
|
|
129
|
+
interface PostMessageSuccess {
|
|
130
|
+
type: 'OOZOO_SUCCESS';
|
|
131
|
+
invoiceId: string;
|
|
132
|
+
}
|
|
133
|
+
interface PostMessageCancel {
|
|
134
|
+
type: 'OOZOO_CANCEL';
|
|
135
|
+
}
|
|
136
|
+
interface PostMessageError {
|
|
137
|
+
type: 'OOZOO_ERROR';
|
|
138
|
+
code: string;
|
|
139
|
+
message: string;
|
|
140
|
+
}
|
|
141
|
+
interface PostMessageResize {
|
|
142
|
+
type: 'OOZOO_RESIZE';
|
|
143
|
+
height: number;
|
|
144
|
+
}
|
|
145
|
+
interface PostMessageSnackbar {
|
|
146
|
+
type: 'OOZOO_SNACKBAR';
|
|
147
|
+
message: string;
|
|
148
|
+
variant: 'success' | 'error' | 'info';
|
|
149
|
+
action?: {
|
|
150
|
+
label: string;
|
|
151
|
+
id: string;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
interface PostMessageSnackbarAction {
|
|
155
|
+
type: 'OOZOO_SNACKBAR_ACTION';
|
|
156
|
+
id: string;
|
|
157
|
+
}
|
|
158
|
+
type OozooPostMessage = PostMessageReady | PostMessageCreateInvoice | PostMessageCreateInvoiceResult | PostMessageSuccess | PostMessageCancel | PostMessageError | PostMessageResize | PostMessageSnackbar | PostMessageSnackbarAction;
|
|
159
|
+
|
|
160
|
+
declare class OozooPayClient {
|
|
161
|
+
private readonly clientKey;
|
|
162
|
+
private readonly checkoutUrl;
|
|
163
|
+
constructor(clientKey: string);
|
|
164
|
+
/**
|
|
165
|
+
* Open checkout window to collect payment from user.
|
|
166
|
+
*/
|
|
167
|
+
pay(options: PayOptions): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Open checkout window to send payout to user.
|
|
170
|
+
*/
|
|
171
|
+
transfer(options: TransferOptions): Promise<void>;
|
|
172
|
+
private openFlow;
|
|
173
|
+
private validateOptions;
|
|
174
|
+
private handleSuccess;
|
|
175
|
+
private handleError;
|
|
176
|
+
private handleCancel;
|
|
177
|
+
/** @deprecated Use pay() instead */
|
|
178
|
+
requestPayment(options: PayOptions): Promise<void>;
|
|
179
|
+
/** @deprecated Use transfer() instead */
|
|
180
|
+
requestWithdrawal(options: TransferOptions): Promise<void>;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Initialize OozooPay SDK.
|
|
184
|
+
*/
|
|
185
|
+
declare function loadOozooPay(clientKey: string): Promise<OozooPayClient>;
|
|
186
|
+
|
|
187
|
+
declare class OozooPayError extends Error {
|
|
188
|
+
constructor(message: string);
|
|
189
|
+
}
|
|
190
|
+
declare class ApiError extends OozooPayError {
|
|
191
|
+
readonly statusCode: number;
|
|
192
|
+
readonly code: string;
|
|
193
|
+
constructor(statusCode: number, code: string, message: string);
|
|
194
|
+
}
|
|
195
|
+
declare class ConfigError extends OozooPayError {
|
|
196
|
+
constructor(message: string);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
interface EncodedTransaction {
|
|
200
|
+
chainId: number;
|
|
201
|
+
to: string;
|
|
202
|
+
data: string;
|
|
203
|
+
value: string;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Encode a payment router transaction from payment data and signature.
|
|
207
|
+
* Returns ready-to-send transaction data (to, data, value).
|
|
208
|
+
*
|
|
209
|
+
* Zero-dependency: uses manual ABI encoding instead of viem.
|
|
210
|
+
*/
|
|
211
|
+
declare function encodePaymentTransaction(routerAddress: string, chainId: string, paymentData: PaymentData, signature: string): EncodedTransaction;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Raw EIP-1193 provider functions for environments without viem PublicClient.
|
|
215
|
+
* Use these with Privy embedded wallets or other EIP-1193 providers.
|
|
216
|
+
*/
|
|
217
|
+
type EIP1193Provider = {
|
|
218
|
+
request: (args: {
|
|
219
|
+
method: string;
|
|
220
|
+
params: any[];
|
|
221
|
+
}) => Promise<any>;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
declare const PaymentRouterAbi: readonly [{
|
|
225
|
+
readonly type: "constructor";
|
|
226
|
+
readonly inputs: readonly [{
|
|
227
|
+
readonly name: "owner_";
|
|
228
|
+
readonly type: "address";
|
|
229
|
+
readonly internalType: "address";
|
|
230
|
+
}, {
|
|
231
|
+
readonly name: "signer_";
|
|
232
|
+
readonly type: "address";
|
|
233
|
+
readonly internalType: "address";
|
|
234
|
+
}, {
|
|
235
|
+
readonly name: "feeRecipient_";
|
|
236
|
+
readonly type: "address";
|
|
237
|
+
readonly internalType: "address";
|
|
238
|
+
}];
|
|
239
|
+
readonly stateMutability: "nonpayable";
|
|
240
|
+
}, {
|
|
241
|
+
readonly type: "function";
|
|
242
|
+
readonly name: "ETH";
|
|
243
|
+
readonly inputs: readonly [];
|
|
244
|
+
readonly outputs: readonly [{
|
|
245
|
+
readonly name: "";
|
|
246
|
+
readonly type: "address";
|
|
247
|
+
readonly internalType: "address";
|
|
248
|
+
}];
|
|
249
|
+
readonly stateMutability: "view";
|
|
250
|
+
}, {
|
|
251
|
+
readonly type: "function";
|
|
252
|
+
readonly name: "FEE_RATE_UNIT_DIVISOR";
|
|
253
|
+
readonly inputs: readonly [];
|
|
254
|
+
readonly outputs: readonly [{
|
|
255
|
+
readonly name: "";
|
|
256
|
+
readonly type: "uint256";
|
|
257
|
+
readonly internalType: "uint256";
|
|
258
|
+
}];
|
|
259
|
+
readonly stateMutability: "view";
|
|
260
|
+
}, {
|
|
261
|
+
readonly type: "function";
|
|
262
|
+
readonly name: "PAYMENT_DATA_TYPE_HASH";
|
|
263
|
+
readonly inputs: readonly [];
|
|
264
|
+
readonly outputs: readonly [{
|
|
265
|
+
readonly name: "";
|
|
266
|
+
readonly type: "bytes32";
|
|
267
|
+
readonly internalType: "bytes32";
|
|
268
|
+
}];
|
|
269
|
+
readonly stateMutability: "view";
|
|
270
|
+
}, {
|
|
271
|
+
readonly type: "function";
|
|
272
|
+
readonly name: "changeFeeRecipient";
|
|
273
|
+
readonly inputs: readonly [{
|
|
274
|
+
readonly name: "newFeeRecipient";
|
|
275
|
+
readonly type: "address";
|
|
276
|
+
readonly internalType: "address";
|
|
277
|
+
}];
|
|
278
|
+
readonly outputs: readonly [];
|
|
279
|
+
readonly stateMutability: "nonpayable";
|
|
280
|
+
}, {
|
|
281
|
+
readonly type: "function";
|
|
282
|
+
readonly name: "changeSigner";
|
|
283
|
+
readonly inputs: readonly [{
|
|
284
|
+
readonly name: "newSigner";
|
|
285
|
+
readonly type: "address";
|
|
286
|
+
readonly internalType: "address";
|
|
287
|
+
}];
|
|
288
|
+
readonly outputs: readonly [];
|
|
289
|
+
readonly stateMutability: "nonpayable";
|
|
290
|
+
}, {
|
|
291
|
+
readonly type: "function";
|
|
292
|
+
readonly name: "eip712Domain";
|
|
293
|
+
readonly inputs: readonly [];
|
|
294
|
+
readonly outputs: readonly [{
|
|
295
|
+
readonly name: "fields";
|
|
296
|
+
readonly type: "bytes1";
|
|
297
|
+
readonly internalType: "bytes1";
|
|
298
|
+
}, {
|
|
299
|
+
readonly name: "name";
|
|
300
|
+
readonly type: "string";
|
|
301
|
+
readonly internalType: "string";
|
|
302
|
+
}, {
|
|
303
|
+
readonly name: "version";
|
|
304
|
+
readonly type: "string";
|
|
305
|
+
readonly internalType: "string";
|
|
306
|
+
}, {
|
|
307
|
+
readonly name: "chainId";
|
|
308
|
+
readonly type: "uint256";
|
|
309
|
+
readonly internalType: "uint256";
|
|
310
|
+
}, {
|
|
311
|
+
readonly name: "verifyingContract";
|
|
312
|
+
readonly type: "address";
|
|
313
|
+
readonly internalType: "address";
|
|
314
|
+
}, {
|
|
315
|
+
readonly name: "salt";
|
|
316
|
+
readonly type: "bytes32";
|
|
317
|
+
readonly internalType: "bytes32";
|
|
318
|
+
}, {
|
|
319
|
+
readonly name: "extensions";
|
|
320
|
+
readonly type: "uint256[]";
|
|
321
|
+
readonly internalType: "uint256[]";
|
|
322
|
+
}];
|
|
323
|
+
readonly stateMutability: "view";
|
|
324
|
+
}, {
|
|
325
|
+
readonly type: "function";
|
|
326
|
+
readonly name: "feeRecipient";
|
|
327
|
+
readonly inputs: readonly [];
|
|
328
|
+
readonly outputs: readonly [{
|
|
329
|
+
readonly name: "";
|
|
330
|
+
readonly type: "address";
|
|
331
|
+
readonly internalType: "address";
|
|
332
|
+
}];
|
|
333
|
+
readonly stateMutability: "view";
|
|
334
|
+
}, {
|
|
335
|
+
readonly type: "function";
|
|
336
|
+
readonly name: "hashPaymentData";
|
|
337
|
+
readonly inputs: readonly [{
|
|
338
|
+
readonly name: "id";
|
|
339
|
+
readonly type: "uint256";
|
|
340
|
+
readonly internalType: "uint256";
|
|
341
|
+
}, {
|
|
342
|
+
readonly name: "erc20";
|
|
343
|
+
readonly type: "address";
|
|
344
|
+
readonly internalType: "contract IERC20";
|
|
345
|
+
}, {
|
|
346
|
+
readonly name: "sender";
|
|
347
|
+
readonly type: "address";
|
|
348
|
+
readonly internalType: "address";
|
|
349
|
+
}, {
|
|
350
|
+
readonly name: "receiver";
|
|
351
|
+
readonly type: "address";
|
|
352
|
+
readonly internalType: "address";
|
|
353
|
+
}, {
|
|
354
|
+
readonly name: "amount";
|
|
355
|
+
readonly type: "uint256";
|
|
356
|
+
readonly internalType: "uint256";
|
|
357
|
+
}, {
|
|
358
|
+
readonly name: "feeRate";
|
|
359
|
+
readonly type: "uint256";
|
|
360
|
+
readonly internalType: "uint256";
|
|
361
|
+
}, {
|
|
362
|
+
readonly name: "expirationTimestamp";
|
|
363
|
+
readonly type: "uint256";
|
|
364
|
+
readonly internalType: "uint256";
|
|
365
|
+
}];
|
|
366
|
+
readonly outputs: readonly [{
|
|
367
|
+
readonly name: "";
|
|
368
|
+
readonly type: "bytes32";
|
|
369
|
+
readonly internalType: "bytes32";
|
|
370
|
+
}];
|
|
371
|
+
readonly stateMutability: "pure";
|
|
372
|
+
}, {
|
|
373
|
+
readonly type: "function";
|
|
374
|
+
readonly name: "owner";
|
|
375
|
+
readonly inputs: readonly [];
|
|
376
|
+
readonly outputs: readonly [{
|
|
377
|
+
readonly name: "";
|
|
378
|
+
readonly type: "address";
|
|
379
|
+
readonly internalType: "address";
|
|
380
|
+
}];
|
|
381
|
+
readonly stateMutability: "view";
|
|
382
|
+
}, {
|
|
383
|
+
readonly type: "function";
|
|
384
|
+
readonly name: "pay";
|
|
385
|
+
readonly inputs: readonly [{
|
|
386
|
+
readonly name: "paramsList";
|
|
387
|
+
readonly type: "tuple[]";
|
|
388
|
+
readonly internalType: "struct IPaymentRouter.PaymentParams[]";
|
|
389
|
+
readonly components: readonly [{
|
|
390
|
+
readonly name: "id";
|
|
391
|
+
readonly type: "uint256";
|
|
392
|
+
readonly internalType: "uint256";
|
|
393
|
+
}, {
|
|
394
|
+
readonly name: "erc20";
|
|
395
|
+
readonly type: "address";
|
|
396
|
+
readonly internalType: "contract IERC20";
|
|
397
|
+
}, {
|
|
398
|
+
readonly name: "receiver";
|
|
399
|
+
readonly type: "address";
|
|
400
|
+
readonly internalType: "address";
|
|
401
|
+
}, {
|
|
402
|
+
readonly name: "amount";
|
|
403
|
+
readonly type: "uint256";
|
|
404
|
+
readonly internalType: "uint256";
|
|
405
|
+
}, {
|
|
406
|
+
readonly name: "feeRate";
|
|
407
|
+
readonly type: "uint256";
|
|
408
|
+
readonly internalType: "uint256";
|
|
409
|
+
}, {
|
|
410
|
+
readonly name: "expirationTimestamp";
|
|
411
|
+
readonly type: "uint256";
|
|
412
|
+
readonly internalType: "uint256";
|
|
413
|
+
}, {
|
|
414
|
+
readonly name: "signature";
|
|
415
|
+
readonly type: "bytes";
|
|
416
|
+
readonly internalType: "bytes";
|
|
417
|
+
}];
|
|
418
|
+
}];
|
|
419
|
+
readonly outputs: readonly [];
|
|
420
|
+
readonly stateMutability: "payable";
|
|
421
|
+
}, {
|
|
422
|
+
readonly type: "function";
|
|
423
|
+
readonly name: "payERC20";
|
|
424
|
+
readonly inputs: readonly [{
|
|
425
|
+
readonly name: "id";
|
|
426
|
+
readonly type: "uint256";
|
|
427
|
+
readonly internalType: "uint256";
|
|
428
|
+
}, {
|
|
429
|
+
readonly name: "erc20";
|
|
430
|
+
readonly type: "address";
|
|
431
|
+
readonly internalType: "contract IERC20";
|
|
432
|
+
}, {
|
|
433
|
+
readonly name: "receiver";
|
|
434
|
+
readonly type: "address";
|
|
435
|
+
readonly internalType: "address";
|
|
436
|
+
}, {
|
|
437
|
+
readonly name: "amount";
|
|
438
|
+
readonly type: "uint256";
|
|
439
|
+
readonly internalType: "uint256";
|
|
440
|
+
}, {
|
|
441
|
+
readonly name: "feeRate";
|
|
442
|
+
readonly type: "uint256";
|
|
443
|
+
readonly internalType: "uint256";
|
|
444
|
+
}, {
|
|
445
|
+
readonly name: "expirationTimestamp";
|
|
446
|
+
readonly type: "uint256";
|
|
447
|
+
readonly internalType: "uint256";
|
|
448
|
+
}, {
|
|
449
|
+
readonly name: "signature";
|
|
450
|
+
readonly type: "bytes";
|
|
451
|
+
readonly internalType: "bytes";
|
|
452
|
+
}];
|
|
453
|
+
readonly outputs: readonly [];
|
|
454
|
+
readonly stateMutability: "nonpayable";
|
|
455
|
+
}, {
|
|
456
|
+
readonly type: "function";
|
|
457
|
+
readonly name: "payETH";
|
|
458
|
+
readonly inputs: readonly [{
|
|
459
|
+
readonly name: "id";
|
|
460
|
+
readonly type: "uint256";
|
|
461
|
+
readonly internalType: "uint256";
|
|
462
|
+
}, {
|
|
463
|
+
readonly name: "receiver";
|
|
464
|
+
readonly type: "address";
|
|
465
|
+
readonly internalType: "address";
|
|
466
|
+
}, {
|
|
467
|
+
readonly name: "feeRate";
|
|
468
|
+
readonly type: "uint256";
|
|
469
|
+
readonly internalType: "uint256";
|
|
470
|
+
}, {
|
|
471
|
+
readonly name: "expirationTimestamp";
|
|
472
|
+
readonly type: "uint256";
|
|
473
|
+
readonly internalType: "uint256";
|
|
474
|
+
}, {
|
|
475
|
+
readonly name: "signature";
|
|
476
|
+
readonly type: "bytes";
|
|
477
|
+
readonly internalType: "bytes";
|
|
478
|
+
}];
|
|
479
|
+
readonly outputs: readonly [];
|
|
480
|
+
readonly stateMutability: "payable";
|
|
481
|
+
}, {
|
|
482
|
+
readonly type: "function";
|
|
483
|
+
readonly name: "recover";
|
|
484
|
+
readonly inputs: readonly [{
|
|
485
|
+
readonly name: "structHash";
|
|
486
|
+
readonly type: "bytes32";
|
|
487
|
+
readonly internalType: "bytes32";
|
|
488
|
+
}, {
|
|
489
|
+
readonly name: "signature";
|
|
490
|
+
readonly type: "bytes";
|
|
491
|
+
readonly internalType: "bytes";
|
|
492
|
+
}];
|
|
493
|
+
readonly outputs: readonly [{
|
|
494
|
+
readonly name: "";
|
|
495
|
+
readonly type: "address";
|
|
496
|
+
readonly internalType: "address";
|
|
497
|
+
}];
|
|
498
|
+
readonly stateMutability: "view";
|
|
499
|
+
}, {
|
|
500
|
+
readonly type: "function";
|
|
501
|
+
readonly name: "renounceOwnership";
|
|
502
|
+
readonly inputs: readonly [];
|
|
503
|
+
readonly outputs: readonly [];
|
|
504
|
+
readonly stateMutability: "nonpayable";
|
|
505
|
+
}, {
|
|
506
|
+
readonly type: "function";
|
|
507
|
+
readonly name: "signer";
|
|
508
|
+
readonly inputs: readonly [];
|
|
509
|
+
readonly outputs: readonly [{
|
|
510
|
+
readonly name: "";
|
|
511
|
+
readonly type: "address";
|
|
512
|
+
readonly internalType: "address";
|
|
513
|
+
}];
|
|
514
|
+
readonly stateMutability: "view";
|
|
515
|
+
}, {
|
|
516
|
+
readonly type: "function";
|
|
517
|
+
readonly name: "transferOwnership";
|
|
518
|
+
readonly inputs: readonly [{
|
|
519
|
+
readonly name: "newOwner";
|
|
520
|
+
readonly type: "address";
|
|
521
|
+
readonly internalType: "address";
|
|
522
|
+
}];
|
|
523
|
+
readonly outputs: readonly [];
|
|
524
|
+
readonly stateMutability: "nonpayable";
|
|
525
|
+
}, {
|
|
526
|
+
readonly type: "event";
|
|
527
|
+
readonly name: "EIP712DomainChanged";
|
|
528
|
+
readonly inputs: readonly [];
|
|
529
|
+
readonly anonymous: false;
|
|
530
|
+
}, {
|
|
531
|
+
readonly type: "event";
|
|
532
|
+
readonly name: "OwnershipTransferred";
|
|
533
|
+
readonly inputs: readonly [{
|
|
534
|
+
readonly name: "previousOwner";
|
|
535
|
+
readonly type: "address";
|
|
536
|
+
readonly indexed: true;
|
|
537
|
+
readonly internalType: "address";
|
|
538
|
+
}, {
|
|
539
|
+
readonly name: "newOwner";
|
|
540
|
+
readonly type: "address";
|
|
541
|
+
readonly indexed: true;
|
|
542
|
+
readonly internalType: "address";
|
|
543
|
+
}];
|
|
544
|
+
readonly anonymous: false;
|
|
545
|
+
}, {
|
|
546
|
+
readonly type: "event";
|
|
547
|
+
readonly name: "Payment";
|
|
548
|
+
readonly inputs: readonly [{
|
|
549
|
+
readonly name: "id";
|
|
550
|
+
readonly type: "uint256";
|
|
551
|
+
readonly indexed: true;
|
|
552
|
+
readonly internalType: "uint256";
|
|
553
|
+
}, {
|
|
554
|
+
readonly name: "erc20";
|
|
555
|
+
readonly type: "address";
|
|
556
|
+
readonly indexed: true;
|
|
557
|
+
readonly internalType: "contract IERC20";
|
|
558
|
+
}, {
|
|
559
|
+
readonly name: "sender";
|
|
560
|
+
readonly type: "address";
|
|
561
|
+
readonly indexed: false;
|
|
562
|
+
readonly internalType: "address";
|
|
563
|
+
}, {
|
|
564
|
+
readonly name: "receiver";
|
|
565
|
+
readonly type: "address";
|
|
566
|
+
readonly indexed: true;
|
|
567
|
+
readonly internalType: "address";
|
|
568
|
+
}, {
|
|
569
|
+
readonly name: "amount";
|
|
570
|
+
readonly type: "uint256";
|
|
571
|
+
readonly indexed: false;
|
|
572
|
+
readonly internalType: "uint256";
|
|
573
|
+
}, {
|
|
574
|
+
readonly name: "feeRecipient";
|
|
575
|
+
readonly type: "address";
|
|
576
|
+
readonly indexed: false;
|
|
577
|
+
readonly internalType: "address";
|
|
578
|
+
}, {
|
|
579
|
+
readonly name: "feeRate";
|
|
580
|
+
readonly type: "uint256";
|
|
581
|
+
readonly indexed: false;
|
|
582
|
+
readonly internalType: "uint256";
|
|
583
|
+
}, {
|
|
584
|
+
readonly name: "fee";
|
|
585
|
+
readonly type: "uint256";
|
|
586
|
+
readonly indexed: false;
|
|
587
|
+
readonly internalType: "uint256";
|
|
588
|
+
}, {
|
|
589
|
+
readonly name: "amountAfterFee";
|
|
590
|
+
readonly type: "uint256";
|
|
591
|
+
readonly indexed: false;
|
|
592
|
+
readonly internalType: "uint256";
|
|
593
|
+
}];
|
|
594
|
+
readonly anonymous: false;
|
|
595
|
+
}, {
|
|
596
|
+
readonly type: "error";
|
|
597
|
+
readonly name: "ECDSAInvalidSignature";
|
|
598
|
+
readonly inputs: readonly [];
|
|
599
|
+
}, {
|
|
600
|
+
readonly type: "error";
|
|
601
|
+
readonly name: "ECDSAInvalidSignatureLength";
|
|
602
|
+
readonly inputs: readonly [{
|
|
603
|
+
readonly name: "length";
|
|
604
|
+
readonly type: "uint256";
|
|
605
|
+
readonly internalType: "uint256";
|
|
606
|
+
}];
|
|
607
|
+
}, {
|
|
608
|
+
readonly type: "error";
|
|
609
|
+
readonly name: "ECDSAInvalidSignatureS";
|
|
610
|
+
readonly inputs: readonly [{
|
|
611
|
+
readonly name: "s";
|
|
612
|
+
readonly type: "bytes32";
|
|
613
|
+
readonly internalType: "bytes32";
|
|
614
|
+
}];
|
|
615
|
+
}, {
|
|
616
|
+
readonly type: "error";
|
|
617
|
+
readonly name: "ETHTransferFailed";
|
|
618
|
+
readonly inputs: readonly [];
|
|
619
|
+
}, {
|
|
620
|
+
readonly type: "error";
|
|
621
|
+
readonly name: "Expired";
|
|
622
|
+
readonly inputs: readonly [];
|
|
623
|
+
}, {
|
|
624
|
+
readonly type: "error";
|
|
625
|
+
readonly name: "InsufficientETH";
|
|
626
|
+
readonly inputs: readonly [];
|
|
627
|
+
}, {
|
|
628
|
+
readonly type: "error";
|
|
629
|
+
readonly name: "InvalidAddress";
|
|
630
|
+
readonly inputs: readonly [];
|
|
631
|
+
}, {
|
|
632
|
+
readonly type: "error";
|
|
633
|
+
readonly name: "InvalidFeeRate";
|
|
634
|
+
readonly inputs: readonly [];
|
|
635
|
+
}, {
|
|
636
|
+
readonly type: "error";
|
|
637
|
+
readonly name: "InvalidId";
|
|
638
|
+
readonly inputs: readonly [];
|
|
639
|
+
}, {
|
|
640
|
+
readonly type: "error";
|
|
641
|
+
readonly name: "InvalidShortString";
|
|
642
|
+
readonly inputs: readonly [];
|
|
643
|
+
}, {
|
|
644
|
+
readonly type: "error";
|
|
645
|
+
readonly name: "InvalidSignature";
|
|
646
|
+
readonly inputs: readonly [];
|
|
647
|
+
}, {
|
|
648
|
+
readonly type: "error";
|
|
649
|
+
readonly name: "OwnableInvalidOwner";
|
|
650
|
+
readonly inputs: readonly [{
|
|
651
|
+
readonly name: "owner";
|
|
652
|
+
readonly type: "address";
|
|
653
|
+
readonly internalType: "address";
|
|
654
|
+
}];
|
|
655
|
+
}, {
|
|
656
|
+
readonly type: "error";
|
|
657
|
+
readonly name: "OwnableUnauthorizedAccount";
|
|
658
|
+
readonly inputs: readonly [{
|
|
659
|
+
readonly name: "account";
|
|
660
|
+
readonly type: "address";
|
|
661
|
+
readonly internalType: "address";
|
|
662
|
+
}];
|
|
663
|
+
}, {
|
|
664
|
+
readonly type: "error";
|
|
665
|
+
readonly name: "ReentrancyGuardReentrantCall";
|
|
666
|
+
readonly inputs: readonly [];
|
|
667
|
+
}, {
|
|
668
|
+
readonly type: "error";
|
|
669
|
+
readonly name: "SafeERC20FailedOperation";
|
|
670
|
+
readonly inputs: readonly [{
|
|
671
|
+
readonly name: "token";
|
|
672
|
+
readonly type: "address";
|
|
673
|
+
readonly internalType: "address";
|
|
674
|
+
}];
|
|
675
|
+
}, {
|
|
676
|
+
readonly type: "error";
|
|
677
|
+
readonly name: "StringTooLong";
|
|
678
|
+
readonly inputs: readonly [{
|
|
679
|
+
readonly name: "str";
|
|
680
|
+
readonly type: "string";
|
|
681
|
+
readonly internalType: "string";
|
|
682
|
+
}];
|
|
683
|
+
}];
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* The ABI of (ethereum) `mainnet` USDT (copied from etherscan).
|
|
687
|
+
* @note Only use it with the old & non-standard (ethereum) `mainnet` USDT contract `0xdAC17F958D2ee523a2206206994597C13D831ec7`.
|
|
688
|
+
* @see https://etherscan.io/address/0xdAC17F958D2ee523a2206206994597C13D831ec7#code
|
|
689
|
+
*/
|
|
690
|
+
declare const mainnetUSDTAbi: readonly [{
|
|
691
|
+
readonly constant: true;
|
|
692
|
+
readonly inputs: readonly [];
|
|
693
|
+
readonly name: "name";
|
|
694
|
+
readonly outputs: readonly [{
|
|
695
|
+
readonly name: "";
|
|
696
|
+
readonly type: "string";
|
|
697
|
+
}];
|
|
698
|
+
readonly payable: false;
|
|
699
|
+
readonly stateMutability: "view";
|
|
700
|
+
readonly type: "function";
|
|
701
|
+
}, {
|
|
702
|
+
readonly constant: false;
|
|
703
|
+
readonly inputs: readonly [{
|
|
704
|
+
readonly name: "_upgradedAddress";
|
|
705
|
+
readonly type: "address";
|
|
706
|
+
}];
|
|
707
|
+
readonly name: "deprecate";
|
|
708
|
+
readonly outputs: readonly [];
|
|
709
|
+
readonly payable: false;
|
|
710
|
+
readonly stateMutability: "nonpayable";
|
|
711
|
+
readonly type: "function";
|
|
712
|
+
}, {
|
|
713
|
+
readonly constant: false;
|
|
714
|
+
readonly inputs: readonly [{
|
|
715
|
+
readonly name: "_spender";
|
|
716
|
+
readonly type: "address";
|
|
717
|
+
}, {
|
|
718
|
+
readonly name: "_value";
|
|
719
|
+
readonly type: "uint256";
|
|
720
|
+
}];
|
|
721
|
+
readonly name: "approve";
|
|
722
|
+
readonly outputs: readonly [];
|
|
723
|
+
readonly payable: false;
|
|
724
|
+
readonly stateMutability: "nonpayable";
|
|
725
|
+
readonly type: "function";
|
|
726
|
+
}, {
|
|
727
|
+
readonly constant: true;
|
|
728
|
+
readonly inputs: readonly [];
|
|
729
|
+
readonly name: "deprecated";
|
|
730
|
+
readonly outputs: readonly [{
|
|
731
|
+
readonly name: "";
|
|
732
|
+
readonly type: "bool";
|
|
733
|
+
}];
|
|
734
|
+
readonly payable: false;
|
|
735
|
+
readonly stateMutability: "view";
|
|
736
|
+
readonly type: "function";
|
|
737
|
+
}, {
|
|
738
|
+
readonly constant: false;
|
|
739
|
+
readonly inputs: readonly [{
|
|
740
|
+
readonly name: "_evilUser";
|
|
741
|
+
readonly type: "address";
|
|
742
|
+
}];
|
|
743
|
+
readonly name: "addBlackList";
|
|
744
|
+
readonly outputs: readonly [];
|
|
745
|
+
readonly payable: false;
|
|
746
|
+
readonly stateMutability: "nonpayable";
|
|
747
|
+
readonly type: "function";
|
|
748
|
+
}, {
|
|
749
|
+
readonly constant: true;
|
|
750
|
+
readonly inputs: readonly [];
|
|
751
|
+
readonly name: "totalSupply";
|
|
752
|
+
readonly outputs: readonly [{
|
|
753
|
+
readonly name: "";
|
|
754
|
+
readonly type: "uint256";
|
|
755
|
+
}];
|
|
756
|
+
readonly payable: false;
|
|
757
|
+
readonly stateMutability: "view";
|
|
758
|
+
readonly type: "function";
|
|
759
|
+
}, {
|
|
760
|
+
readonly constant: false;
|
|
761
|
+
readonly inputs: readonly [{
|
|
762
|
+
readonly name: "_from";
|
|
763
|
+
readonly type: "address";
|
|
764
|
+
}, {
|
|
765
|
+
readonly name: "_to";
|
|
766
|
+
readonly type: "address";
|
|
767
|
+
}, {
|
|
768
|
+
readonly name: "_value";
|
|
769
|
+
readonly type: "uint256";
|
|
770
|
+
}];
|
|
771
|
+
readonly name: "transferFrom";
|
|
772
|
+
readonly outputs: readonly [];
|
|
773
|
+
readonly payable: false;
|
|
774
|
+
readonly stateMutability: "nonpayable";
|
|
775
|
+
readonly type: "function";
|
|
776
|
+
}, {
|
|
777
|
+
readonly constant: true;
|
|
778
|
+
readonly inputs: readonly [];
|
|
779
|
+
readonly name: "upgradedAddress";
|
|
780
|
+
readonly outputs: readonly [{
|
|
781
|
+
readonly name: "";
|
|
782
|
+
readonly type: "address";
|
|
783
|
+
}];
|
|
784
|
+
readonly payable: false;
|
|
785
|
+
readonly stateMutability: "view";
|
|
786
|
+
readonly type: "function";
|
|
787
|
+
}, {
|
|
788
|
+
readonly constant: true;
|
|
789
|
+
readonly inputs: readonly [{
|
|
790
|
+
readonly name: "";
|
|
791
|
+
readonly type: "address";
|
|
792
|
+
}];
|
|
793
|
+
readonly name: "balances";
|
|
794
|
+
readonly outputs: readonly [{
|
|
795
|
+
readonly name: "";
|
|
796
|
+
readonly type: "uint256";
|
|
797
|
+
}];
|
|
798
|
+
readonly payable: false;
|
|
799
|
+
readonly stateMutability: "view";
|
|
800
|
+
readonly type: "function";
|
|
801
|
+
}, {
|
|
802
|
+
readonly constant: true;
|
|
803
|
+
readonly inputs: readonly [];
|
|
804
|
+
readonly name: "decimals";
|
|
805
|
+
readonly outputs: readonly [{
|
|
806
|
+
readonly name: "";
|
|
807
|
+
readonly type: "uint256";
|
|
808
|
+
}];
|
|
809
|
+
readonly payable: false;
|
|
810
|
+
readonly stateMutability: "view";
|
|
811
|
+
readonly type: "function";
|
|
812
|
+
}, {
|
|
813
|
+
readonly constant: true;
|
|
814
|
+
readonly inputs: readonly [];
|
|
815
|
+
readonly name: "maximumFee";
|
|
816
|
+
readonly outputs: readonly [{
|
|
817
|
+
readonly name: "";
|
|
818
|
+
readonly type: "uint256";
|
|
819
|
+
}];
|
|
820
|
+
readonly payable: false;
|
|
821
|
+
readonly stateMutability: "view";
|
|
822
|
+
readonly type: "function";
|
|
823
|
+
}, {
|
|
824
|
+
readonly constant: true;
|
|
825
|
+
readonly inputs: readonly [];
|
|
826
|
+
readonly name: "_totalSupply";
|
|
827
|
+
readonly outputs: readonly [{
|
|
828
|
+
readonly name: "";
|
|
829
|
+
readonly type: "uint256";
|
|
830
|
+
}];
|
|
831
|
+
readonly payable: false;
|
|
832
|
+
readonly stateMutability: "view";
|
|
833
|
+
readonly type: "function";
|
|
834
|
+
}, {
|
|
835
|
+
readonly constant: false;
|
|
836
|
+
readonly inputs: readonly [];
|
|
837
|
+
readonly name: "unpause";
|
|
838
|
+
readonly outputs: readonly [];
|
|
839
|
+
readonly payable: false;
|
|
840
|
+
readonly stateMutability: "nonpayable";
|
|
841
|
+
readonly type: "function";
|
|
842
|
+
}, {
|
|
843
|
+
readonly constant: true;
|
|
844
|
+
readonly inputs: readonly [{
|
|
845
|
+
readonly name: "_maker";
|
|
846
|
+
readonly type: "address";
|
|
847
|
+
}];
|
|
848
|
+
readonly name: "getBlackListStatus";
|
|
849
|
+
readonly outputs: readonly [{
|
|
850
|
+
readonly name: "";
|
|
851
|
+
readonly type: "bool";
|
|
852
|
+
}];
|
|
853
|
+
readonly payable: false;
|
|
854
|
+
readonly stateMutability: "view";
|
|
855
|
+
readonly type: "function";
|
|
856
|
+
}, {
|
|
857
|
+
readonly constant: true;
|
|
858
|
+
readonly inputs: readonly [{
|
|
859
|
+
readonly name: "";
|
|
860
|
+
readonly type: "address";
|
|
861
|
+
}, {
|
|
862
|
+
readonly name: "";
|
|
863
|
+
readonly type: "address";
|
|
864
|
+
}];
|
|
865
|
+
readonly name: "allowed";
|
|
866
|
+
readonly outputs: readonly [{
|
|
867
|
+
readonly name: "";
|
|
868
|
+
readonly type: "uint256";
|
|
869
|
+
}];
|
|
870
|
+
readonly payable: false;
|
|
871
|
+
readonly stateMutability: "view";
|
|
872
|
+
readonly type: "function";
|
|
873
|
+
}, {
|
|
874
|
+
readonly constant: true;
|
|
875
|
+
readonly inputs: readonly [];
|
|
876
|
+
readonly name: "paused";
|
|
877
|
+
readonly outputs: readonly [{
|
|
878
|
+
readonly name: "";
|
|
879
|
+
readonly type: "bool";
|
|
880
|
+
}];
|
|
881
|
+
readonly payable: false;
|
|
882
|
+
readonly stateMutability: "view";
|
|
883
|
+
readonly type: "function";
|
|
884
|
+
}, {
|
|
885
|
+
readonly constant: true;
|
|
886
|
+
readonly inputs: readonly [{
|
|
887
|
+
readonly name: "who";
|
|
888
|
+
readonly type: "address";
|
|
889
|
+
}];
|
|
890
|
+
readonly name: "balanceOf";
|
|
891
|
+
readonly outputs: readonly [{
|
|
892
|
+
readonly name: "";
|
|
893
|
+
readonly type: "uint256";
|
|
894
|
+
}];
|
|
895
|
+
readonly payable: false;
|
|
896
|
+
readonly stateMutability: "view";
|
|
897
|
+
readonly type: "function";
|
|
898
|
+
}, {
|
|
899
|
+
readonly constant: false;
|
|
900
|
+
readonly inputs: readonly [];
|
|
901
|
+
readonly name: "pause";
|
|
902
|
+
readonly outputs: readonly [];
|
|
903
|
+
readonly payable: false;
|
|
904
|
+
readonly stateMutability: "nonpayable";
|
|
905
|
+
readonly type: "function";
|
|
906
|
+
}, {
|
|
907
|
+
readonly constant: true;
|
|
908
|
+
readonly inputs: readonly [];
|
|
909
|
+
readonly name: "getOwner";
|
|
910
|
+
readonly outputs: readonly [{
|
|
911
|
+
readonly name: "";
|
|
912
|
+
readonly type: "address";
|
|
913
|
+
}];
|
|
914
|
+
readonly payable: false;
|
|
915
|
+
readonly stateMutability: "view";
|
|
916
|
+
readonly type: "function";
|
|
917
|
+
}, {
|
|
918
|
+
readonly constant: true;
|
|
919
|
+
readonly inputs: readonly [];
|
|
920
|
+
readonly name: "owner";
|
|
921
|
+
readonly outputs: readonly [{
|
|
922
|
+
readonly name: "";
|
|
923
|
+
readonly type: "address";
|
|
924
|
+
}];
|
|
925
|
+
readonly payable: false;
|
|
926
|
+
readonly stateMutability: "view";
|
|
927
|
+
readonly type: "function";
|
|
928
|
+
}, {
|
|
929
|
+
readonly constant: true;
|
|
930
|
+
readonly inputs: readonly [];
|
|
931
|
+
readonly name: "symbol";
|
|
932
|
+
readonly outputs: readonly [{
|
|
933
|
+
readonly name: "";
|
|
934
|
+
readonly type: "string";
|
|
935
|
+
}];
|
|
936
|
+
readonly payable: false;
|
|
937
|
+
readonly stateMutability: "view";
|
|
938
|
+
readonly type: "function";
|
|
939
|
+
}, {
|
|
940
|
+
readonly constant: false;
|
|
941
|
+
readonly inputs: readonly [{
|
|
942
|
+
readonly name: "_to";
|
|
943
|
+
readonly type: "address";
|
|
944
|
+
}, {
|
|
945
|
+
readonly name: "_value";
|
|
946
|
+
readonly type: "uint256";
|
|
947
|
+
}];
|
|
948
|
+
readonly name: "transfer";
|
|
949
|
+
readonly outputs: readonly [];
|
|
950
|
+
readonly payable: false;
|
|
951
|
+
readonly stateMutability: "nonpayable";
|
|
952
|
+
readonly type: "function";
|
|
953
|
+
}, {
|
|
954
|
+
readonly constant: false;
|
|
955
|
+
readonly inputs: readonly [{
|
|
956
|
+
readonly name: "newBasisPoints";
|
|
957
|
+
readonly type: "uint256";
|
|
958
|
+
}, {
|
|
959
|
+
readonly name: "newMaxFee";
|
|
960
|
+
readonly type: "uint256";
|
|
961
|
+
}];
|
|
962
|
+
readonly name: "setParams";
|
|
963
|
+
readonly outputs: readonly [];
|
|
964
|
+
readonly payable: false;
|
|
965
|
+
readonly stateMutability: "nonpayable";
|
|
966
|
+
readonly type: "function";
|
|
967
|
+
}, {
|
|
968
|
+
readonly constant: false;
|
|
969
|
+
readonly inputs: readonly [{
|
|
970
|
+
readonly name: "amount";
|
|
971
|
+
readonly type: "uint256";
|
|
972
|
+
}];
|
|
973
|
+
readonly name: "issue";
|
|
974
|
+
readonly outputs: readonly [];
|
|
975
|
+
readonly payable: false;
|
|
976
|
+
readonly stateMutability: "nonpayable";
|
|
977
|
+
readonly type: "function";
|
|
978
|
+
}, {
|
|
979
|
+
readonly constant: false;
|
|
980
|
+
readonly inputs: readonly [{
|
|
981
|
+
readonly name: "amount";
|
|
982
|
+
readonly type: "uint256";
|
|
983
|
+
}];
|
|
984
|
+
readonly name: "redeem";
|
|
985
|
+
readonly outputs: readonly [];
|
|
986
|
+
readonly payable: false;
|
|
987
|
+
readonly stateMutability: "nonpayable";
|
|
988
|
+
readonly type: "function";
|
|
989
|
+
}, {
|
|
990
|
+
readonly constant: true;
|
|
991
|
+
readonly inputs: readonly [{
|
|
992
|
+
readonly name: "_owner";
|
|
993
|
+
readonly type: "address";
|
|
994
|
+
}, {
|
|
995
|
+
readonly name: "_spender";
|
|
996
|
+
readonly type: "address";
|
|
997
|
+
}];
|
|
998
|
+
readonly name: "allowance";
|
|
999
|
+
readonly outputs: readonly [{
|
|
1000
|
+
readonly name: "remaining";
|
|
1001
|
+
readonly type: "uint256";
|
|
1002
|
+
}];
|
|
1003
|
+
readonly payable: false;
|
|
1004
|
+
readonly stateMutability: "view";
|
|
1005
|
+
readonly type: "function";
|
|
1006
|
+
}, {
|
|
1007
|
+
readonly constant: true;
|
|
1008
|
+
readonly inputs: readonly [];
|
|
1009
|
+
readonly name: "basisPointsRate";
|
|
1010
|
+
readonly outputs: readonly [{
|
|
1011
|
+
readonly name: "";
|
|
1012
|
+
readonly type: "uint256";
|
|
1013
|
+
}];
|
|
1014
|
+
readonly payable: false;
|
|
1015
|
+
readonly stateMutability: "view";
|
|
1016
|
+
readonly type: "function";
|
|
1017
|
+
}, {
|
|
1018
|
+
readonly constant: true;
|
|
1019
|
+
readonly inputs: readonly [{
|
|
1020
|
+
readonly name: "";
|
|
1021
|
+
readonly type: "address";
|
|
1022
|
+
}];
|
|
1023
|
+
readonly name: "isBlackListed";
|
|
1024
|
+
readonly outputs: readonly [{
|
|
1025
|
+
readonly name: "";
|
|
1026
|
+
readonly type: "bool";
|
|
1027
|
+
}];
|
|
1028
|
+
readonly payable: false;
|
|
1029
|
+
readonly stateMutability: "view";
|
|
1030
|
+
readonly type: "function";
|
|
1031
|
+
}, {
|
|
1032
|
+
readonly constant: false;
|
|
1033
|
+
readonly inputs: readonly [{
|
|
1034
|
+
readonly name: "_clearedUser";
|
|
1035
|
+
readonly type: "address";
|
|
1036
|
+
}];
|
|
1037
|
+
readonly name: "removeBlackList";
|
|
1038
|
+
readonly outputs: readonly [];
|
|
1039
|
+
readonly payable: false;
|
|
1040
|
+
readonly stateMutability: "nonpayable";
|
|
1041
|
+
readonly type: "function";
|
|
1042
|
+
}, {
|
|
1043
|
+
readonly constant: true;
|
|
1044
|
+
readonly inputs: readonly [];
|
|
1045
|
+
readonly name: "MAX_UINT";
|
|
1046
|
+
readonly outputs: readonly [{
|
|
1047
|
+
readonly name: "";
|
|
1048
|
+
readonly type: "uint256";
|
|
1049
|
+
}];
|
|
1050
|
+
readonly payable: false;
|
|
1051
|
+
readonly stateMutability: "view";
|
|
1052
|
+
readonly type: "function";
|
|
1053
|
+
}, {
|
|
1054
|
+
readonly constant: false;
|
|
1055
|
+
readonly inputs: readonly [{
|
|
1056
|
+
readonly name: "newOwner";
|
|
1057
|
+
readonly type: "address";
|
|
1058
|
+
}];
|
|
1059
|
+
readonly name: "transferOwnership";
|
|
1060
|
+
readonly outputs: readonly [];
|
|
1061
|
+
readonly payable: false;
|
|
1062
|
+
readonly stateMutability: "nonpayable";
|
|
1063
|
+
readonly type: "function";
|
|
1064
|
+
}, {
|
|
1065
|
+
readonly constant: false;
|
|
1066
|
+
readonly inputs: readonly [{
|
|
1067
|
+
readonly name: "_blackListedUser";
|
|
1068
|
+
readonly type: "address";
|
|
1069
|
+
}];
|
|
1070
|
+
readonly name: "destroyBlackFunds";
|
|
1071
|
+
readonly outputs: readonly [];
|
|
1072
|
+
readonly payable: false;
|
|
1073
|
+
readonly stateMutability: "nonpayable";
|
|
1074
|
+
readonly type: "function";
|
|
1075
|
+
}, {
|
|
1076
|
+
readonly inputs: readonly [{
|
|
1077
|
+
readonly name: "_initialSupply";
|
|
1078
|
+
readonly type: "uint256";
|
|
1079
|
+
}, {
|
|
1080
|
+
readonly name: "_name";
|
|
1081
|
+
readonly type: "string";
|
|
1082
|
+
}, {
|
|
1083
|
+
readonly name: "_symbol";
|
|
1084
|
+
readonly type: "string";
|
|
1085
|
+
}, {
|
|
1086
|
+
readonly name: "_decimals";
|
|
1087
|
+
readonly type: "uint256";
|
|
1088
|
+
}];
|
|
1089
|
+
readonly payable: false;
|
|
1090
|
+
readonly stateMutability: "nonpayable";
|
|
1091
|
+
readonly type: "constructor";
|
|
1092
|
+
}, {
|
|
1093
|
+
readonly anonymous: false;
|
|
1094
|
+
readonly inputs: readonly [{
|
|
1095
|
+
readonly indexed: false;
|
|
1096
|
+
readonly name: "amount";
|
|
1097
|
+
readonly type: "uint256";
|
|
1098
|
+
}];
|
|
1099
|
+
readonly name: "Issue";
|
|
1100
|
+
readonly type: "event";
|
|
1101
|
+
}, {
|
|
1102
|
+
readonly anonymous: false;
|
|
1103
|
+
readonly inputs: readonly [{
|
|
1104
|
+
readonly indexed: false;
|
|
1105
|
+
readonly name: "amount";
|
|
1106
|
+
readonly type: "uint256";
|
|
1107
|
+
}];
|
|
1108
|
+
readonly name: "Redeem";
|
|
1109
|
+
readonly type: "event";
|
|
1110
|
+
}, {
|
|
1111
|
+
readonly anonymous: false;
|
|
1112
|
+
readonly inputs: readonly [{
|
|
1113
|
+
readonly indexed: false;
|
|
1114
|
+
readonly name: "newAddress";
|
|
1115
|
+
readonly type: "address";
|
|
1116
|
+
}];
|
|
1117
|
+
readonly name: "Deprecate";
|
|
1118
|
+
readonly type: "event";
|
|
1119
|
+
}, {
|
|
1120
|
+
readonly anonymous: false;
|
|
1121
|
+
readonly inputs: readonly [{
|
|
1122
|
+
readonly indexed: false;
|
|
1123
|
+
readonly name: "feeBasisPoints";
|
|
1124
|
+
readonly type: "uint256";
|
|
1125
|
+
}, {
|
|
1126
|
+
readonly indexed: false;
|
|
1127
|
+
readonly name: "maxFee";
|
|
1128
|
+
readonly type: "uint256";
|
|
1129
|
+
}];
|
|
1130
|
+
readonly name: "Params";
|
|
1131
|
+
readonly type: "event";
|
|
1132
|
+
}, {
|
|
1133
|
+
readonly anonymous: false;
|
|
1134
|
+
readonly inputs: readonly [{
|
|
1135
|
+
readonly indexed: false;
|
|
1136
|
+
readonly name: "_blackListedUser";
|
|
1137
|
+
readonly type: "address";
|
|
1138
|
+
}, {
|
|
1139
|
+
readonly indexed: false;
|
|
1140
|
+
readonly name: "_balance";
|
|
1141
|
+
readonly type: "uint256";
|
|
1142
|
+
}];
|
|
1143
|
+
readonly name: "DestroyedBlackFunds";
|
|
1144
|
+
readonly type: "event";
|
|
1145
|
+
}, {
|
|
1146
|
+
readonly anonymous: false;
|
|
1147
|
+
readonly inputs: readonly [{
|
|
1148
|
+
readonly indexed: false;
|
|
1149
|
+
readonly name: "_user";
|
|
1150
|
+
readonly type: "address";
|
|
1151
|
+
}];
|
|
1152
|
+
readonly name: "AddedBlackList";
|
|
1153
|
+
readonly type: "event";
|
|
1154
|
+
}, {
|
|
1155
|
+
readonly anonymous: false;
|
|
1156
|
+
readonly inputs: readonly [{
|
|
1157
|
+
readonly indexed: false;
|
|
1158
|
+
readonly name: "_user";
|
|
1159
|
+
readonly type: "address";
|
|
1160
|
+
}];
|
|
1161
|
+
readonly name: "RemovedBlackList";
|
|
1162
|
+
readonly type: "event";
|
|
1163
|
+
}, {
|
|
1164
|
+
readonly anonymous: false;
|
|
1165
|
+
readonly inputs: readonly [{
|
|
1166
|
+
readonly indexed: true;
|
|
1167
|
+
readonly name: "owner";
|
|
1168
|
+
readonly type: "address";
|
|
1169
|
+
}, {
|
|
1170
|
+
readonly indexed: true;
|
|
1171
|
+
readonly name: "spender";
|
|
1172
|
+
readonly type: "address";
|
|
1173
|
+
}, {
|
|
1174
|
+
readonly indexed: false;
|
|
1175
|
+
readonly name: "value";
|
|
1176
|
+
readonly type: "uint256";
|
|
1177
|
+
}];
|
|
1178
|
+
readonly name: "Approval";
|
|
1179
|
+
readonly type: "event";
|
|
1180
|
+
}, {
|
|
1181
|
+
readonly anonymous: false;
|
|
1182
|
+
readonly inputs: readonly [{
|
|
1183
|
+
readonly indexed: true;
|
|
1184
|
+
readonly name: "from";
|
|
1185
|
+
readonly type: "address";
|
|
1186
|
+
}, {
|
|
1187
|
+
readonly indexed: true;
|
|
1188
|
+
readonly name: "to";
|
|
1189
|
+
readonly type: "address";
|
|
1190
|
+
}, {
|
|
1191
|
+
readonly indexed: false;
|
|
1192
|
+
readonly name: "value";
|
|
1193
|
+
readonly type: "uint256";
|
|
1194
|
+
}];
|
|
1195
|
+
readonly name: "Transfer";
|
|
1196
|
+
readonly type: "event";
|
|
1197
|
+
}, {
|
|
1198
|
+
readonly anonymous: false;
|
|
1199
|
+
readonly inputs: readonly [];
|
|
1200
|
+
readonly name: "Pause";
|
|
1201
|
+
readonly type: "event";
|
|
1202
|
+
}, {
|
|
1203
|
+
readonly anonymous: false;
|
|
1204
|
+
readonly inputs: readonly [];
|
|
1205
|
+
readonly name: "Unpause";
|
|
1206
|
+
readonly type: "event";
|
|
1207
|
+
}];
|
|
1208
|
+
|
|
1209
|
+
/** ERC7528 ETH address */
|
|
1210
|
+
declare const ETH = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
1211
|
+
/**
|
|
1212
|
+
* USDT addresses
|
|
1213
|
+
* @see Tether deployed USDT (only mainnets) https://tether.to/en/supported-protocols
|
|
1214
|
+
*/
|
|
1215
|
+
declare const USDT_ADDRESSES: Record<number, string>;
|
|
1216
|
+
/**
|
|
1217
|
+
* USDC addresses
|
|
1218
|
+
* @see https://developers.circle.com/stablecoins/usdc-contract-addresses
|
|
1219
|
+
*/
|
|
1220
|
+
declare const USDC_ADDRESSES: Record<number, string>;
|
|
1221
|
+
/**
|
|
1222
|
+
* PaymentRouter deployed by prod-deployer `0xB6bB80d3737Bd98A07d424e7fdde95EAE40DbaB8`
|
|
1223
|
+
* salt: `bytes32(keccak256("PaymentRouterCheckpointOne"))`
|
|
1224
|
+
*/
|
|
1225
|
+
declare const PAYMENT_ROUTER = "0xe50342E06Ab270dfecc69C3B1EE6Da7E2e2D02f0";
|
|
1226
|
+
|
|
1227
|
+
/** Chain IDs supported by OozooPay */
|
|
1228
|
+
declare const MAINNET_CHAIN_IDS: readonly [1, 42161, 8453, 56, 137, 8217];
|
|
1229
|
+
declare const TESTNET_CHAIN_IDS: readonly [31337, 11155111, 421614, 84532, 97, 80002, 1001];
|
|
1230
|
+
/** Ethereum mainnet chain ID */
|
|
1231
|
+
declare const ETHEREUM_MAINNET_ID = 1;
|
|
1232
|
+
|
|
1233
|
+
/** Check if token address is the native coin (ETH) sentinel address */
|
|
1234
|
+
declare function isNativeCoin(tokenAddress: string): boolean;
|
|
1235
|
+
/**
|
|
1236
|
+
* Check if the token is Ethereum mainnet USDT (non-standard ERC20).
|
|
1237
|
+
* Mainnet USDT requires special handling: revoke to 0 before re-approving.
|
|
1238
|
+
*/
|
|
1239
|
+
declare function isMainnetUSDT(chainId: number, tokenAddress: string): boolean;
|
|
1240
|
+
|
|
1241
|
+
/**
|
|
1242
|
+
* Chain-agnostic provider functions.
|
|
1243
|
+
* Currently only EVM is supported.
|
|
1244
|
+
*/
|
|
1245
|
+
|
|
1246
|
+
type ChainType = 'evm' | 'svm';
|
|
1247
|
+
/**
|
|
1248
|
+
* Get native coin balance (ETH, etc.).
|
|
1249
|
+
*/
|
|
1250
|
+
declare function getNativeBalance(chainType: ChainType, provider: EIP1193Provider, address: string): Promise<bigint>;
|
|
1251
|
+
/**
|
|
1252
|
+
* Get token balance (ERC-20, etc.).
|
|
1253
|
+
*/
|
|
1254
|
+
declare function getTokenBalance(chainType: ChainType, provider: EIP1193Provider, tokenAddress: string, walletAddress: string): Promise<bigint>;
|
|
1255
|
+
/**
|
|
1256
|
+
* Estimate gas/fee cost in native token units.
|
|
1257
|
+
*/
|
|
1258
|
+
declare function estimateGasCost(chainType: ChainType, provider: EIP1193Provider, gasUnits?: bigint): Promise<bigint>;
|
|
1259
|
+
|
|
1260
|
+
export { ApiError, type ChainType, ConfigError, type CreateInvoiceParams, type EIP1193Provider, ETH, ETHEREUM_MAINNET_ID, type EncodedTransaction, type GetBalanceResult, MAINNET_CHAIN_IDS, OozooPayClient, OozooPayError, type OozooPostMessage, PAYMENT_ROUTER, type PayInvoiceParams, type PayOptions, type PaymentConfig, type PaymentData, type PaymentInstruction, type PaymentRouter, PaymentRouterAbi, type PaymentSetting, type PostMessageCancel, type PostMessageCreateInvoice, type PostMessageCreateInvoiceResult, type PostMessageReady, type PostMessageResize, type PostMessageSnackbar, type PostMessageSnackbarAction, type PostMessageSuccess, type PriceUnit, type RequestPaymentOptions, type RequestWithdrawalOptions, TESTNET_CHAIN_IDS, type TransferInvoiceParams, type TransferOptions, USDC_ADDRESSES, USDT_ADDRESSES, encodePaymentTransaction, estimateGasCost, getNativeBalance, getTokenBalance, isMainnetUSDT, isNativeCoin, loadOozooPay, mainnetUSDTAbi };
|