@imtbl/sdk 1.43.3 → 1.43.4
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/dist/Passport.d-011d5035.d.ts +224 -0
- package/dist/blockchain-data.d-1634b683.d.ts +3406 -0
- package/dist/blockchain_data-d989298c.js +1 -0
- package/dist/blockchain_data.d-d538f8d4.d.ts +4543 -0
- package/dist/blockchain_data.d.ts +3 -7950
- package/dist/blockchain_data.js +1 -6058
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/checkout-68675dd1.js +16 -0
- package/dist/checkout.d-ae9ca847.d.ts +3392 -0
- package/dist/checkout.d.ts +7 -16882
- package/dist/checkout.js +1 -37189
- package/dist/config-53a9a4ca.js +1 -0
- package/dist/config.d-65420620.d.ts +18 -0
- package/dist/config.d.ts +1 -30
- package/dist/config.js +1 -394
- package/dist/event-types.d-42520276.d.ts +332 -0
- package/dist/imxProvider.d-cac9e315.d.ts +12538 -0
- package/dist/index-14aad537.js +1 -0
- package/dist/index-3951cdf0.js +1 -0
- package/dist/index-3f40d7f6.js +1 -0
- package/dist/index-58a79c29.js +1 -0
- package/dist/index-96599707.js +1 -0
- package/dist/index-e7002486.js +1 -0
- package/dist/index.browser.js +4 -4
- package/dist/index.cjs +7 -7
- package/dist/index.d-c4a4c17d.d.ts +277 -0
- package/dist/index.d-f0845744.d.ts +30 -0
- package/dist/index.d-f1471830.d.ts +376 -0
- package/dist/index.d.ts +18 -32627
- package/dist/index.js +1 -64124
- package/dist/json-rpc-provider.d-5c038bd9.d.ts +249 -0
- package/dist/minting_backend-04aef147.js +1 -0
- package/dist/minting_backend.d-4754ffee.d.ts +104 -0
- package/dist/minting_backend.d.ts +5 -3535
- package/dist/minting_backend.js +1 -6756
- package/dist/orderbook-e71036df.js +1 -0
- package/dist/orderbook.d-77162c6c.d.ts +1257 -0
- package/dist/orderbook.d.ts +5 -1713
- package/dist/orderbook.js +1 -2479
- package/dist/passport-0f45e532.js +1 -0
- package/dist/passport.d-d3f44798.d.ts +67 -0
- package/dist/passport.d.ts +6 -13703
- package/dist/passport.js +1 -23137
- package/dist/transfer.d-87728423.d.ts +898 -0
- package/dist/webhook-a16541bb.js +1 -0
- package/dist/webhook.d-4c3cb340.d.ts +75 -0
- package/dist/webhook.d.ts +4 -1265
- package/dist/webhook.js +1 -488
- package/dist/x-a5b39578.js +1 -0
- package/dist/x.d-1b51f0c3.d.ts +4879 -0
- package/dist/x.d.ts +6 -18663
- package/dist/x.js +1 -19242
- package/package.json +1 -1
|
@@ -0,0 +1,3392 @@
|
|
|
1
|
+
import { c as Networkish, B as BigNumber, T as TransactionResponse, g as TransactionRequest } from './index.d-c4a4c17d.js';
|
|
2
|
+
import { J as JsonRpcProvider } from './json-rpc-provider.d-5c038bd9.js';
|
|
3
|
+
import { P as Passport } from './Passport.d-011d5035.js';
|
|
4
|
+
import { M as ModuleConfiguration, E as Environment } from './index.d-f0845744.js';
|
|
5
|
+
import { bs as AxiosInstance, bt as AxiosRequestConfig, bu as AxiosResponse } from './imxProvider.d-cac9e315.js';
|
|
6
|
+
|
|
7
|
+
declare type ExternalProvider = {
|
|
8
|
+
isMetaMask?: boolean;
|
|
9
|
+
isStatus?: boolean;
|
|
10
|
+
host?: string;
|
|
11
|
+
path?: string;
|
|
12
|
+
sendAsync?: (request: {
|
|
13
|
+
method: string;
|
|
14
|
+
params?: Array<any>;
|
|
15
|
+
}, callback: (error: any, response: any) => void) => void;
|
|
16
|
+
send?: (request: {
|
|
17
|
+
method: string;
|
|
18
|
+
params?: Array<any>;
|
|
19
|
+
}, callback: (error: any, response: any) => void) => void;
|
|
20
|
+
request?: (request: {
|
|
21
|
+
method: string;
|
|
22
|
+
params?: Array<any>;
|
|
23
|
+
}) => Promise<any>;
|
|
24
|
+
};
|
|
25
|
+
declare type JsonRpcFetchFunc = (method: string, params?: Array<any>) => Promise<any>;
|
|
26
|
+
declare class Web3Provider extends JsonRpcProvider {
|
|
27
|
+
readonly provider: ExternalProvider;
|
|
28
|
+
readonly jsonRpcFetchFunc: JsonRpcFetchFunc;
|
|
29
|
+
constructor(provider: ExternalProvider | JsonRpcFetchFunc, network?: Networkish);
|
|
30
|
+
send(method: string, params: Array<any>): Promise<any>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Enum representing different chain IDs.
|
|
35
|
+
* @enum {number}
|
|
36
|
+
* @property {number} IMTBL_ZKEVM_MAINNET - The chain ID for IMTBL ZKEVM Mainnet.
|
|
37
|
+
* @property {number} IMTBL_ZKEVM_TESTNET - The chain ID for IMTBL ZKEVM Testnet.
|
|
38
|
+
* @property {number} IMTBL_ZKEVM_DEVNET - The chain ID for IMTBL ZKEVM Devnet.
|
|
39
|
+
* @property {number} ETHEREUM - The chain ID for Ethereum.
|
|
40
|
+
* @property {number} SEPOLIA - The chain ID for Sepolia.
|
|
41
|
+
*/
|
|
42
|
+
declare enum ChainId {
|
|
43
|
+
IMTBL_ZKEVM_MAINNET = 13371,
|
|
44
|
+
IMTBL_ZKEVM_TESTNET = 13473,
|
|
45
|
+
IMTBL_ZKEVM_DEVNET = 15003,
|
|
46
|
+
ETHEREUM = 1,
|
|
47
|
+
SEPOLIA = 11155111
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Enum representing different chain names.
|
|
51
|
+
* @enum {string}
|
|
52
|
+
* @property {string} IMTBL_ZKEVM_MAINNET - The chain name for IMTBL ZKEVM Mainnet.
|
|
53
|
+
* @property {string} IMTBL_ZKEVM_TESTNET - The chain name for IMTBL ZKEVM Testnet.
|
|
54
|
+
* @property {string} IMTBL_ZKEVM_DEVNET - The chain name for IMTBL ZKEVM Devnet.
|
|
55
|
+
* @property {string} ETHEREUM - The chain name for Ethereum.
|
|
56
|
+
* @property {string} SEPOLIA - The chain name for Sepolia.
|
|
57
|
+
*/
|
|
58
|
+
declare enum ChainName {
|
|
59
|
+
ETHEREUM = "Ethereum",
|
|
60
|
+
SEPOLIA = "Sepolia",
|
|
61
|
+
IMTBL_ZKEVM_TESTNET = "Immutable zkEVM Testnet",
|
|
62
|
+
IMTBL_ZKEVM_DEVNET = "Immutable zkEVM Dev",
|
|
63
|
+
IMTBL_ZKEVM_MAINNET = "Immutable zkEVM"
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Enum representing different chain slugs.
|
|
67
|
+
* @enum {string}
|
|
68
|
+
* @property {string} IMTBL_ZKEVM_MAINNET - The chain slug for IMTBL ZKEVM Mainnet.
|
|
69
|
+
* @property {string} IMTBL_ZKEVM_TESTNET - The chain slug for IMTBL ZKEVM Testnet.
|
|
70
|
+
* @property {string} IMTBL_ZKEVM_DEVNET - The chain slug for IMTBL ZKEVM Devnet.
|
|
71
|
+
* @property {string} ETHEREUM - The chain slug for Ethereum.
|
|
72
|
+
* @property {string} SEPOLIA - The chain slug for Sepolia.
|
|
73
|
+
*/
|
|
74
|
+
declare enum ChainSlug {
|
|
75
|
+
ETHEREUM = "ethereum",
|
|
76
|
+
SEPOLIA = "sepolia",
|
|
77
|
+
IMTBL_ZKEVM_MAINNET = "imtbl-zkevm-mainnet",
|
|
78
|
+
IMTBL_ZKEVM_TESTNET = "imtbl-zkevm-testnet",
|
|
79
|
+
IMTBL_ZKEVM_DEVNET = "imtbl-zkevm-devnet"
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Represents information about a token.
|
|
84
|
+
* @interface TokenInfo
|
|
85
|
+
* @property {string} name - The name of the token.
|
|
86
|
+
* @property {string} symbol - The symbol of the token.
|
|
87
|
+
* @property {number} decimals - The number of decimal places the token supports.
|
|
88
|
+
* @property {string | undefined} [address] - The address of the token.
|
|
89
|
+
* @property {string | undefined} [icon] - The URL of the token's icon.
|
|
90
|
+
*/
|
|
91
|
+
interface TokenInfo {
|
|
92
|
+
name: string;
|
|
93
|
+
symbol: string;
|
|
94
|
+
decimals: number;
|
|
95
|
+
address?: string;
|
|
96
|
+
icon?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Interface representing the parameters for {@link Checkout.getTokenInfo}.
|
|
100
|
+
* @property {Web3Provider | JsonRpcProvider} provider - The provider used to get the balance.
|
|
101
|
+
* @property {string} tokenAddress - The contract address of the token.
|
|
102
|
+
*/
|
|
103
|
+
interface GetTokenInfoParams {
|
|
104
|
+
provider: Web3Provider | JsonRpcProvider;
|
|
105
|
+
tokenAddress: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Interface representing the parameters for {@link Checkout.getBalance}.
|
|
110
|
+
* @property {Web3Provider} provider - The provider used to get the balance.
|
|
111
|
+
* @property {string} walletAddress - The wallet address.
|
|
112
|
+
* @property {string | undefined} tokenAddress - The contract address of the token.
|
|
113
|
+
*/
|
|
114
|
+
interface GetBalanceParams {
|
|
115
|
+
provider: Web3Provider;
|
|
116
|
+
walletAddress: string;
|
|
117
|
+
tokenAddress?: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Interface representing the result of {@link Checkout.getBalance}.
|
|
121
|
+
* @property {BigNumber} balance - The balance of the wallet for the token.
|
|
122
|
+
* @property {string} formattedBalance - The formatted balance of the wallet for the token.
|
|
123
|
+
* @property {TokenInfo} token - The token information.
|
|
124
|
+
*/
|
|
125
|
+
interface GetBalanceResult {
|
|
126
|
+
balance: BigNumber;
|
|
127
|
+
formattedBalance: string;
|
|
128
|
+
token: TokenInfo;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Interface representing the parameters for {@link Checkout.getAllBalances}.
|
|
132
|
+
* @property {Web3Provider} provider - The provider used to get the balances, it is a required parameter if no walletAddress is provided.
|
|
133
|
+
* @property {string} walletAddress - The wallet address, it is a required parameter if no provider is provided.
|
|
134
|
+
* @property {ChainId} chainId - The ID of the network.
|
|
135
|
+
*/
|
|
136
|
+
interface GetAllBalancesParams {
|
|
137
|
+
provider?: Web3Provider;
|
|
138
|
+
walletAddress?: string;
|
|
139
|
+
chainId: ChainId;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Interface representing the result of {@link Checkout.getAllBalances}.
|
|
143
|
+
* @property {GetBalanceResult[]} balances - The array of balances of the wallet for every token.
|
|
144
|
+
*/
|
|
145
|
+
interface GetAllBalancesResult {
|
|
146
|
+
balances: GetBalanceResult[];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
interface OrderFee {
|
|
150
|
+
amount: FeeToken | FeePercentage;
|
|
151
|
+
recipient: string;
|
|
152
|
+
}
|
|
153
|
+
interface FeeToken {
|
|
154
|
+
token: string;
|
|
155
|
+
}
|
|
156
|
+
interface FeePercentage {
|
|
157
|
+
percentageDecimal: number;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
type BuyResult = BuyResultSuccess | BuyResultFailed | BuyResultFulfillmentsUnsettled | BuyResultInsufficientFunds;
|
|
161
|
+
/**
|
|
162
|
+
* Represents the result of {@link Checkout.buy}
|
|
163
|
+
* @property {CheckoutStatus.SUCCESS} status
|
|
164
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
165
|
+
*/
|
|
166
|
+
type BuyResultSuccess = {
|
|
167
|
+
/** The status to indicate success */
|
|
168
|
+
status: CheckoutStatus.SUCCESS;
|
|
169
|
+
/** The sufficient result of smart checkout */
|
|
170
|
+
smartCheckoutResult: SmartCheckoutSufficient;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Represents the result of {@link Checkout.buy}
|
|
174
|
+
* @property {CheckoutStatus.FAILED} status
|
|
175
|
+
* @property {string} transactionHash
|
|
176
|
+
* @property {string} reason
|
|
177
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
178
|
+
*/
|
|
179
|
+
type BuyResultFailed = {
|
|
180
|
+
/** The status to indicate failure */
|
|
181
|
+
status: CheckoutStatus.FAILED;
|
|
182
|
+
/** The transaction hash of the failed transaction */
|
|
183
|
+
transactionHash: string;
|
|
184
|
+
/** The reason for the failure */
|
|
185
|
+
reason: string;
|
|
186
|
+
/** The sufficient result of smart checkout */
|
|
187
|
+
smartCheckoutResult: SmartCheckoutSufficient;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Represents the result of {@link Checkout.buy}
|
|
191
|
+
* @property {CheckoutStatus.FULFILLMENTS_UNSETTLED} status
|
|
192
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
193
|
+
* @property {SendTransactionResult[]} transactions
|
|
194
|
+
*/
|
|
195
|
+
type BuyResultFulfillmentsUnsettled = {
|
|
196
|
+
/** The status to indicate success */
|
|
197
|
+
status: CheckoutStatus.FULFILLMENTS_UNSETTLED;
|
|
198
|
+
/** The sufficient result of smart checkout */
|
|
199
|
+
smartCheckoutResult: SmartCheckoutSufficient;
|
|
200
|
+
/** Array of transaction results */
|
|
201
|
+
transactions: TransactionResponse[];
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Represents the result of {@link Checkout.buy}
|
|
205
|
+
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status
|
|
206
|
+
* @property {SmartCheckoutInsufficient} smartCheckoutResult
|
|
207
|
+
*/
|
|
208
|
+
type BuyResultInsufficientFunds = {
|
|
209
|
+
/** The status to indicate insufficient funds */
|
|
210
|
+
status: CheckoutStatus.INSUFFICIENT_FUNDS;
|
|
211
|
+
/** The insufficient result of smart checkout */
|
|
212
|
+
smartCheckoutResult: SmartCheckoutInsufficient;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Represents the overrides available for {@link Checkout.buy}
|
|
216
|
+
* @property {boolean} waitFulfillmentSettlements
|
|
217
|
+
*/
|
|
218
|
+
type BuyOverrides = {
|
|
219
|
+
/** If the buy should wait for the fulfillment transactions to settle */
|
|
220
|
+
waitFulfillmentSettlements?: boolean;
|
|
221
|
+
};
|
|
222
|
+
type SellResult = SellResultSuccess | SellResultFailed | SellResultInsufficientFunds;
|
|
223
|
+
/**
|
|
224
|
+
* Represents the result of {@link Checkout.sell}
|
|
225
|
+
* @property {CheckoutStatus.SUCCESS} status
|
|
226
|
+
* @property {string[]} orderIds
|
|
227
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
228
|
+
*/
|
|
229
|
+
type SellResultSuccess = {
|
|
230
|
+
/** The status to indicate success */
|
|
231
|
+
status: CheckoutStatus.SUCCESS;
|
|
232
|
+
/** The orders' ids */
|
|
233
|
+
orderIds: string[];
|
|
234
|
+
/** The sufficient result of smart checkout */
|
|
235
|
+
smartCheckoutResult: SmartCheckoutSufficient;
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Represents the result of {@link Checkout.sell}
|
|
239
|
+
* @property {CheckoutStatus.FAILED} status
|
|
240
|
+
* @property {string} transactionHash
|
|
241
|
+
* @property {string} reason
|
|
242
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
243
|
+
*/
|
|
244
|
+
type SellResultFailed = {
|
|
245
|
+
/** The status to indicate failure */
|
|
246
|
+
status: CheckoutStatus.FAILED;
|
|
247
|
+
/** The transaction hash of the failed transaction */
|
|
248
|
+
transactionHash: string;
|
|
249
|
+
/** The reason for the failure */
|
|
250
|
+
reason: string;
|
|
251
|
+
/** The sufficient result of smart checkout */
|
|
252
|
+
smartCheckoutResult: SmartCheckoutSufficient;
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* Represents the result of {@link Checkout.sell}
|
|
256
|
+
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status
|
|
257
|
+
* @property {SmartCheckoutInsufficient} smartCheckoutResult
|
|
258
|
+
*/
|
|
259
|
+
type SellResultInsufficientFunds = {
|
|
260
|
+
/** The status to indicate insufficient funds */
|
|
261
|
+
status: CheckoutStatus.INSUFFICIENT_FUNDS;
|
|
262
|
+
/** The insufficient result of smart checkout */
|
|
263
|
+
smartCheckoutResult: SmartCheckoutInsufficient;
|
|
264
|
+
};
|
|
265
|
+
type CancelResult = CancelResultSuccess | CancelResultFailed | CancelResultFulfillmentsUnsettled | CancelResultGasless;
|
|
266
|
+
/**
|
|
267
|
+
* Represents the result of {@link Checkout.cancel}
|
|
268
|
+
* @property {CheckoutStatus.SUCCESS} status
|
|
269
|
+
*/
|
|
270
|
+
type CancelResultSuccess = {
|
|
271
|
+
/** The status to indicate success */
|
|
272
|
+
status: CheckoutStatus.SUCCESS;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Represents the result of {@link Checkout.cancel}
|
|
276
|
+
* @property {CheckoutStatus.FAILED} status
|
|
277
|
+
* @property {string} transactionHash
|
|
278
|
+
* @property {string} reason
|
|
279
|
+
*/
|
|
280
|
+
type CancelResultFailed = {
|
|
281
|
+
/** The status to indicate failure */
|
|
282
|
+
status: CheckoutStatus.FAILED;
|
|
283
|
+
/** The transaction hash of the failed transaction */
|
|
284
|
+
transactionHash: string;
|
|
285
|
+
/** The reason for the failure */
|
|
286
|
+
reason: string;
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* Represents the result of {@link Checkout.cancel}
|
|
290
|
+
* @property {CheckoutStatus.FULFILLMENTS_UNSETTLED} status
|
|
291
|
+
* @property {SendTransactionResult[]} transactions
|
|
292
|
+
*/
|
|
293
|
+
type CancelResultFulfillmentsUnsettled = {
|
|
294
|
+
/** The status to indicate the fulfillments have not yet settled on chain. */
|
|
295
|
+
status: CheckoutStatus.FULFILLMENTS_UNSETTLED;
|
|
296
|
+
/** Array of transaction results */
|
|
297
|
+
transactions: TransactionResponse[];
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Represents the result of {@link Checkout.cancel} when using gasless cancel
|
|
301
|
+
* @property {SuccessfulGaslessCancellation[]} successfulCancellations
|
|
302
|
+
* @property {FailedGaslessCancellation[]} failedCancellations
|
|
303
|
+
* @property {PendingGaslessCancellation[]} pendingCancellations
|
|
304
|
+
*/
|
|
305
|
+
type CancelResultGasless = {
|
|
306
|
+
successfulCancellations: SuccessfulGaslessCancellation[];
|
|
307
|
+
failedCancellations: FailedGaslessCancellation[];
|
|
308
|
+
pendingCancellations: PendingGaslessCancellation[];
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* Represents a successful gasless cancellation
|
|
312
|
+
* @property {string} orderId
|
|
313
|
+
*/
|
|
314
|
+
type SuccessfulGaslessCancellation = {
|
|
315
|
+
/** The order id of the successful cancellation */
|
|
316
|
+
orderId: string;
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* Represents a failed gasless cancellation
|
|
320
|
+
* @property {string} orderId
|
|
321
|
+
* @property {string} reason
|
|
322
|
+
*/
|
|
323
|
+
type FailedGaslessCancellation = {
|
|
324
|
+
/** The order id of the failed cancellation */
|
|
325
|
+
orderId: string;
|
|
326
|
+
/** The reason for failure */
|
|
327
|
+
reason: string;
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* Represents a pending gasless cancellation
|
|
331
|
+
* @property {string} orderId
|
|
332
|
+
*/
|
|
333
|
+
type PendingGaslessCancellation = {
|
|
334
|
+
/** The order id of the pending cancellation */
|
|
335
|
+
orderId: string;
|
|
336
|
+
};
|
|
337
|
+
/**
|
|
338
|
+
* Represents the overrides available for {@link Checkout.cancel}
|
|
339
|
+
* @property {boolean} waitFulfillmentSettlements
|
|
340
|
+
*/
|
|
341
|
+
type CancelOverrides = {
|
|
342
|
+
/** If the cancel should wait for the fulfillment transactions to settle */
|
|
343
|
+
waitFulfillmentSettlements?: boolean;
|
|
344
|
+
/** If the cancel should use the gasless option */
|
|
345
|
+
useGaslessCancel?: boolean;
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* An enum representing the checkout status types
|
|
349
|
+
* @enum {string}
|
|
350
|
+
* @property {string} SUCCESS - If checkout succeeded as the transactions were able to be processed
|
|
351
|
+
* @property {string} FAILED - If checkout failed due to transactions not settling on chain
|
|
352
|
+
* @property {string} INSUFFICIENT_FUNDS - If checkout failed due to insufficient funds
|
|
353
|
+
* @property {string} FULFILLMENTS_UNSETTLED - If checkout succeeded but the fulfillment transactions are not yet settled
|
|
354
|
+
*/
|
|
355
|
+
declare enum CheckoutStatus {
|
|
356
|
+
SUCCESS = "SUCCESS",
|
|
357
|
+
FAILED = "FAILED",
|
|
358
|
+
INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS",
|
|
359
|
+
FULFILLMENTS_UNSETTLED = "FULFILLMENTS_UNSETTLED"
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* The type representing the order to buy
|
|
363
|
+
* @property {string} orderId
|
|
364
|
+
* @property {OrderFee[]} takerFees
|
|
365
|
+
*/
|
|
366
|
+
type BuyOrder = {
|
|
367
|
+
/** the id of the order to buy */
|
|
368
|
+
id: string;
|
|
369
|
+
/** array of order fees to apply to the order */
|
|
370
|
+
takerFees?: OrderFee[];
|
|
371
|
+
/** The amount of the order to fill - only applies to ERC1155 orders */
|
|
372
|
+
fillAmount?: string;
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* The type representing the sell order to create a listing from
|
|
376
|
+
* @property {SellToken} sellToken
|
|
377
|
+
* @property {BuyToken} buyToken
|
|
378
|
+
* @property {OrderFee[]} makerFees
|
|
379
|
+
*/
|
|
380
|
+
type SellOrder = {
|
|
381
|
+
/** the token to be listed for sale */
|
|
382
|
+
sellToken: SellToken;
|
|
383
|
+
/** the token info of the price of the item */
|
|
384
|
+
buyToken: BuyToken;
|
|
385
|
+
/** optional array of makerFees to be applied to the listing */
|
|
386
|
+
makerFees?: OrderFee[];
|
|
387
|
+
/** optional order expiry date. Default order expiry to 2 years from now */
|
|
388
|
+
orderExpiry?: Date;
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* Represents the token that the item can be bought with once listed for sale.
|
|
392
|
+
* NativeBuyToken or ERC20BuyToken {@link Checkout.smartCheckout}.
|
|
393
|
+
*/
|
|
394
|
+
type BuyToken = NativeBuyToken | ERC20BuyToken;
|
|
395
|
+
/**
|
|
396
|
+
* Represents a native buy token
|
|
397
|
+
* @property {ItemType} type
|
|
398
|
+
* @property {string} amount
|
|
399
|
+
*/
|
|
400
|
+
type NativeBuyToken = {
|
|
401
|
+
/** The type indicate this is a native token. */
|
|
402
|
+
type: ItemType.NATIVE;
|
|
403
|
+
/** The amount of native token. */
|
|
404
|
+
amount: string;
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* Represents a ERC20 buy token
|
|
408
|
+
* @property {ItemType} type
|
|
409
|
+
* @property {string} amount
|
|
410
|
+
* @property {string} tokenAddress
|
|
411
|
+
*/
|
|
412
|
+
type ERC20BuyToken = {
|
|
413
|
+
/** The type indicate this is a ERC20 token. */
|
|
414
|
+
type: ItemType.ERC20;
|
|
415
|
+
/** The amount of native token. */
|
|
416
|
+
amount: string;
|
|
417
|
+
/** The token address of the ERC20. */
|
|
418
|
+
tokenAddress: string;
|
|
419
|
+
};
|
|
420
|
+
/**
|
|
421
|
+
* Represents the token listed for sale.
|
|
422
|
+
* ERC721SellToken or ERC1155SellToken {@link Checkout.smartCheckout}.
|
|
423
|
+
*/
|
|
424
|
+
type SellToken = DeprecatedERC721SellToken | ERC721SellToken | ERC1155SellToken;
|
|
425
|
+
/**
|
|
426
|
+
* The ERC721SellToken type
|
|
427
|
+
* @property {string} id
|
|
428
|
+
* @property {string} collectionAddress
|
|
429
|
+
*/
|
|
430
|
+
type ERC721SellToken = {
|
|
431
|
+
type: ItemType.ERC721;
|
|
432
|
+
/** The ERC721 token id */
|
|
433
|
+
id: string;
|
|
434
|
+
/** The ERC721 collection address */
|
|
435
|
+
collectionAddress: string;
|
|
436
|
+
};
|
|
437
|
+
/**
|
|
438
|
+
* The original ERC721SellToken type, before the introduction of the ItemType enum
|
|
439
|
+
* @property {string} id
|
|
440
|
+
* @property {string} collectionAddress
|
|
441
|
+
* @deprecated
|
|
442
|
+
*/
|
|
443
|
+
type DeprecatedERC721SellToken = {
|
|
444
|
+
/** The ERC721 token id */
|
|
445
|
+
id: string;
|
|
446
|
+
/** The ERC721 collection address */
|
|
447
|
+
collectionAddress: string;
|
|
448
|
+
};
|
|
449
|
+
/**
|
|
450
|
+
* The ERC1155SellToken type
|
|
451
|
+
* @property {string} id
|
|
452
|
+
* @property {string} collectionAddress
|
|
453
|
+
* @property {string} amount
|
|
454
|
+
*/
|
|
455
|
+
type ERC1155SellToken = {
|
|
456
|
+
type: ItemType.ERC1155;
|
|
457
|
+
/** The ERC1155 token id */
|
|
458
|
+
id: string;
|
|
459
|
+
/** The ERC1155 collection address */
|
|
460
|
+
collectionAddress: string;
|
|
461
|
+
/** The amount of the token to be sold */
|
|
462
|
+
amount: string;
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* Interface representing the parameters for {@link Checkout.smartCheckout}
|
|
466
|
+
* @property {Web3Provider} provider
|
|
467
|
+
* @property {ItemRequirement[]} itemRequirements
|
|
468
|
+
* @property {FulfillmentTransaction | GasAmount} transactionOrGasAmount
|
|
469
|
+
*/
|
|
470
|
+
interface SmartCheckoutParams {
|
|
471
|
+
/** The provider to use for smart checkout. */
|
|
472
|
+
provider: Web3Provider;
|
|
473
|
+
/** The item requirements for the transaction. */
|
|
474
|
+
itemRequirements: (NativeItemRequirement | ERC20ItemRequirement | ERC721ItemRequirement | ERC1155ItemRequirement)[];
|
|
475
|
+
/** The transaction or gas amount. */
|
|
476
|
+
transactionOrGasAmount?: FulfillmentTransaction | GasAmount;
|
|
477
|
+
/** The overrides for funding routes to consider */
|
|
478
|
+
routingOptions?: AvailableRoutingOptions;
|
|
479
|
+
/** The callback to be executed once all funding routes are found */
|
|
480
|
+
onComplete?: (result: SmartCheckoutResult) => void;
|
|
481
|
+
/** The callback to be executed on each funding route found */
|
|
482
|
+
onFundingRoute?: (fundingRoute: FundingRoute) => void;
|
|
483
|
+
/** A flag to get funding routes based on full or partial amount */
|
|
484
|
+
fundingRouteFullAmount?: boolean;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Represents a native item requirement for a transaction.
|
|
488
|
+
* @property {ItemType.NATIVE} type
|
|
489
|
+
* @property {string} amount
|
|
490
|
+
*/
|
|
491
|
+
type NativeItemRequirement = {
|
|
492
|
+
/** The type to indicate this is a native item requirement. */
|
|
493
|
+
type: ItemType.NATIVE;
|
|
494
|
+
/** The amount of the item. */
|
|
495
|
+
amount: string;
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* Represents an ERC20 item requirement for a transaction.
|
|
499
|
+
* @property {ItemType.ERC20} type
|
|
500
|
+
* @property {string} tokenAddress
|
|
501
|
+
* @property {string} amount
|
|
502
|
+
* @property {string} spenderAddress
|
|
503
|
+
*/
|
|
504
|
+
type ERC20ItemRequirement = {
|
|
505
|
+
/** The type to indicate this is a ERC20 item requirement. */
|
|
506
|
+
type: ItemType.ERC20;
|
|
507
|
+
/** The token address of the ERC20. */
|
|
508
|
+
tokenAddress: string;
|
|
509
|
+
/** The amount of the item. */
|
|
510
|
+
amount: string;
|
|
511
|
+
/** The contract address of the approver. */
|
|
512
|
+
spenderAddress: string;
|
|
513
|
+
};
|
|
514
|
+
/**
|
|
515
|
+
* Represents an ERC721 item requirement for a transaction.
|
|
516
|
+
* @property {ItemType.ERC721} type
|
|
517
|
+
* @property {string} contractAddress
|
|
518
|
+
* @property {string} id
|
|
519
|
+
* @property {string} spenderAddress
|
|
520
|
+
*/
|
|
521
|
+
type ERC721ItemRequirement = {
|
|
522
|
+
/** The type to indicate this is a ERC721 item requirement. */
|
|
523
|
+
type: ItemType.ERC721;
|
|
524
|
+
/** The contract address of the ERC721 collection. */
|
|
525
|
+
contractAddress: string;
|
|
526
|
+
/** The ID of this ERC721 in the collection. */
|
|
527
|
+
id: string;
|
|
528
|
+
/** The contract address of the approver. */
|
|
529
|
+
spenderAddress: string;
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* Represents an ERC1155 item requirement for a transaction.
|
|
533
|
+
* @property {ItemType.ERC1155} type
|
|
534
|
+
* @property {string} contractAddress
|
|
535
|
+
* @property {string} id
|
|
536
|
+
* @property {string} spenderAddress
|
|
537
|
+
* @property {BigNumber} amount
|
|
538
|
+
*/
|
|
539
|
+
type ERC1155ItemRequirement = {
|
|
540
|
+
/** The type to indicate this is a ERC1155 item requirement. */
|
|
541
|
+
type: ItemType.ERC1155;
|
|
542
|
+
/** The contract address of the ERC1155 collection. */
|
|
543
|
+
contractAddress: string;
|
|
544
|
+
/** The ID of this ERC1155 in the collection. */
|
|
545
|
+
id: string;
|
|
546
|
+
/** The contract address of the approver. */
|
|
547
|
+
spenderAddress: string;
|
|
548
|
+
/** The amount of the ERC1155 token ID being spent. */
|
|
549
|
+
amount: BigNumber;
|
|
550
|
+
};
|
|
551
|
+
/**
|
|
552
|
+
* An enum representing the item types
|
|
553
|
+
* @enum {string}
|
|
554
|
+
* @property {string} NATIVE - If the item is a native token.
|
|
555
|
+
* @property {string} ERC20 - If the item is an ERC20 token.
|
|
556
|
+
* @property {string} ERC721 - If the item is an ERC721 token.
|
|
557
|
+
* @property {string} ERC1155 - If the item is an ERC1155 token.
|
|
558
|
+
*/
|
|
559
|
+
declare enum ItemType {
|
|
560
|
+
NATIVE = "NATIVE",
|
|
561
|
+
ERC20 = "ERC20",
|
|
562
|
+
ERC721 = "ERC721",
|
|
563
|
+
ERC1155 = "ERC1155"
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* An enum representing transaction or gas types
|
|
567
|
+
* @enum {string}
|
|
568
|
+
* @property {string} TRANSACTION - If the type is a transaction
|
|
569
|
+
* @property {string} GAS - If the type is the gas amount
|
|
570
|
+
*/
|
|
571
|
+
declare enum TransactionOrGasType {
|
|
572
|
+
TRANSACTION = "TRANSACTION",
|
|
573
|
+
GAS = "GAS"
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* The fulfillment transaction which contains the transaction to send.
|
|
577
|
+
* @property {TransactionOrGasType} type
|
|
578
|
+
* @property {TransactionRequest} transaction
|
|
579
|
+
*/
|
|
580
|
+
type FulfillmentTransaction = {
|
|
581
|
+
/** The type to indicate this is a fulfillment transaction. */
|
|
582
|
+
type: TransactionOrGasType.TRANSACTION;
|
|
583
|
+
/** The transaction to send. */
|
|
584
|
+
transaction: TransactionRequest;
|
|
585
|
+
};
|
|
586
|
+
/**
|
|
587
|
+
* The gas amount which contains the gas token and the gas limit.
|
|
588
|
+
* @property {TransactionOrGasType} type
|
|
589
|
+
* @property {GasToken} gasToken
|
|
590
|
+
*/
|
|
591
|
+
type GasAmount = {
|
|
592
|
+
/** The type to indicate this is a gas amount. */
|
|
593
|
+
type: TransactionOrGasType.GAS;
|
|
594
|
+
/** The gas token. */
|
|
595
|
+
gasToken: GasToken;
|
|
596
|
+
};
|
|
597
|
+
/**
|
|
598
|
+
* Represents the gas token which is either a native token or an ERC20 token.
|
|
599
|
+
*/
|
|
600
|
+
type GasToken = NativeGas | ERC20Gas;
|
|
601
|
+
/**
|
|
602
|
+
* An enum representing the gas token types
|
|
603
|
+
* @enum {string}
|
|
604
|
+
* @property {string} NATIVE - If the gas token is a native token.
|
|
605
|
+
* @property {string} ERC20 - If the gas token is an ERC20 token.
|
|
606
|
+
*/
|
|
607
|
+
declare enum GasTokenType {
|
|
608
|
+
NATIVE = "NATIVE",
|
|
609
|
+
ERC20 = "ERC20"
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Represents a native gas token.
|
|
613
|
+
* @property {GasTokenType} type
|
|
614
|
+
* @property {BigNumber} limit
|
|
615
|
+
*/
|
|
616
|
+
type NativeGas = {
|
|
617
|
+
/** The type to indicate this is a native gas token. */
|
|
618
|
+
type: GasTokenType.NATIVE;
|
|
619
|
+
/** The gas limit. */
|
|
620
|
+
limit: BigNumber;
|
|
621
|
+
};
|
|
622
|
+
/**
|
|
623
|
+
* Represents an ERC20 gas token.
|
|
624
|
+
* @property {GasTokenType} type
|
|
625
|
+
* @property {string} tokenAddress
|
|
626
|
+
* @property {BigNumber} limit
|
|
627
|
+
*/
|
|
628
|
+
type ERC20Gas = {
|
|
629
|
+
/** The type to indicate this is an ERC20 gas token. */
|
|
630
|
+
type: GasTokenType.ERC20;
|
|
631
|
+
/** The token address of the ERC20. */
|
|
632
|
+
tokenAddress: string;
|
|
633
|
+
/** The gas limit. */
|
|
634
|
+
limit: BigNumber;
|
|
635
|
+
};
|
|
636
|
+
/**
|
|
637
|
+
* The type representing the result of {@link Checkout.smartCheckout}.
|
|
638
|
+
*/
|
|
639
|
+
type SmartCheckoutResult = SmartCheckoutSufficient | SmartCheckoutInsufficient;
|
|
640
|
+
/**
|
|
641
|
+
* Represents the result of {@link Checkout.smartCheckout} when smart checkout is sufficient.
|
|
642
|
+
* @property {boolean} sufficient
|
|
643
|
+
* @property {TransactionRequirement[]} transactionRequirements
|
|
644
|
+
*/
|
|
645
|
+
type SmartCheckoutSufficient = {
|
|
646
|
+
/** Indicates that smart checkout determined the user had sufficient funds. */
|
|
647
|
+
sufficient: true;
|
|
648
|
+
/** The transaction requirements smart checkout determined were required for the transaction. */
|
|
649
|
+
transactionRequirements: TransactionRequirement[];
|
|
650
|
+
};
|
|
651
|
+
/**
|
|
652
|
+
* Represents the result of {@link Checkout.smartCheckout} when smart checkout is insufficient.
|
|
653
|
+
* @property {boolean} sufficient
|
|
654
|
+
* @property {TransactionRequirement[]} transactionRequirements
|
|
655
|
+
* @property {SmartCheckoutRouter} router
|
|
656
|
+
*/
|
|
657
|
+
type SmartCheckoutInsufficient = {
|
|
658
|
+
/** Indicates that smart checkout determined the user has insufficient funds */
|
|
659
|
+
sufficient: false;
|
|
660
|
+
/** The transaction requirements smart checkout determined were required for the transaction. */
|
|
661
|
+
transactionRequirements: TransactionRequirement[];
|
|
662
|
+
/** The type containing the funding routes the user can take to fulfill the transaction requirements */
|
|
663
|
+
router?: SmartCheckoutRouter;
|
|
664
|
+
};
|
|
665
|
+
/**
|
|
666
|
+
* Represents the routing outcome for a transaction.
|
|
667
|
+
* @property {AvailableRoutingOptions} availableRoutingOptions
|
|
668
|
+
* @property {RoutingOutcome} routingOutcome
|
|
669
|
+
*/
|
|
670
|
+
type SmartCheckoutRouter = {
|
|
671
|
+
/** The routing options available to the user */
|
|
672
|
+
availableRoutingOptions: AvailableRoutingOptions;
|
|
673
|
+
/** The routing outcome for the transaction which includes the funding routes if routes were found */
|
|
674
|
+
routingOutcome: RoutingOutcome;
|
|
675
|
+
};
|
|
676
|
+
/**
|
|
677
|
+
* An enum representing the routing outcome types
|
|
678
|
+
* @enum {string}
|
|
679
|
+
* @property {string} ROUTES_FOUND - If funding routes were found for the transaction.
|
|
680
|
+
* @property {string} NO_ROUTES_FOUND - If no funding routes were found for the transaction.
|
|
681
|
+
* @property {string} NO_ROUTE_OPTIONS - If no routing options were available for the transaction.
|
|
682
|
+
*/
|
|
683
|
+
declare enum RoutingOutcomeType {
|
|
684
|
+
ROUTES_FOUND = "ROUTES_FOUND",
|
|
685
|
+
NO_ROUTES_FOUND = "NO_ROUTES_FOUND",
|
|
686
|
+
NO_ROUTE_OPTIONS = "NO_ROUTE_OPTIONS"
|
|
687
|
+
}
|
|
688
|
+
type RoutingOutcome = RoutesFound | NoRoutesFound | NoRouteOptions;
|
|
689
|
+
/**
|
|
690
|
+
* Represents a routing outcome where funding routes were found.
|
|
691
|
+
* @property {RoutingOutcomeType.ROUTES_FOUND} type
|
|
692
|
+
* @property {AvailableRoutingOptions} fundingRoutes
|
|
693
|
+
*/
|
|
694
|
+
type RoutesFound = {
|
|
695
|
+
/** Indicates that funding routes were found for the transaction. */
|
|
696
|
+
type: RoutingOutcomeType.ROUTES_FOUND;
|
|
697
|
+
/** The funding routes found for the transaction. */
|
|
698
|
+
fundingRoutes: FundingRoute[];
|
|
699
|
+
};
|
|
700
|
+
/**
|
|
701
|
+
* Represents a routing outcome where no funding routes were found.
|
|
702
|
+
* @property {RoutingOutcomeType.NO_ROUTES_FOUND} type
|
|
703
|
+
* @property {string} message
|
|
704
|
+
*/
|
|
705
|
+
type NoRoutesFound = {
|
|
706
|
+
/** Indicates that no funding routes were found for the transaction. */
|
|
707
|
+
type: RoutingOutcomeType.NO_ROUTES_FOUND;
|
|
708
|
+
/** The message indicating why no funding routes were found. */
|
|
709
|
+
message: string;
|
|
710
|
+
};
|
|
711
|
+
/**
|
|
712
|
+
* Represents a routing outcome where no routing options were available for the transaction.
|
|
713
|
+
* @property {RoutingOutcomeType.NO_ROUTE_OPTIONS} type
|
|
714
|
+
* @property {string} message
|
|
715
|
+
*/
|
|
716
|
+
type NoRouteOptions = {
|
|
717
|
+
/** Indicates that no routing options were available for the transaction. */
|
|
718
|
+
type: RoutingOutcomeType.NO_ROUTE_OPTIONS;
|
|
719
|
+
/** The message indicating why no routing options were available. */
|
|
720
|
+
message: string;
|
|
721
|
+
};
|
|
722
|
+
/**
|
|
723
|
+
* Represents a funding route
|
|
724
|
+
* @property {number} priority
|
|
725
|
+
* @property {FundingStep[]} steps
|
|
726
|
+
*/
|
|
727
|
+
type FundingRoute = {
|
|
728
|
+
/** The priority of the route */
|
|
729
|
+
priority: number;
|
|
730
|
+
/** The steps associated with this funding route */
|
|
731
|
+
steps: FundingStep[];
|
|
732
|
+
};
|
|
733
|
+
/**
|
|
734
|
+
* Represents a fee
|
|
735
|
+
* @property {BigNumber} amount
|
|
736
|
+
* @property {string} formatted
|
|
737
|
+
* @property {TokenInfo | undefined} token
|
|
738
|
+
*/
|
|
739
|
+
type Fee = {
|
|
740
|
+
/** The type of fee */
|
|
741
|
+
type: FeeType;
|
|
742
|
+
/** The amount of the fee */
|
|
743
|
+
amount: BigNumber;
|
|
744
|
+
/** The formatted amount of the fee */
|
|
745
|
+
formattedAmount: string;
|
|
746
|
+
/** The token info for the fee */
|
|
747
|
+
token?: TokenInfo;
|
|
748
|
+
/** The basis points for the secondary fee */
|
|
749
|
+
basisPoints?: number;
|
|
750
|
+
};
|
|
751
|
+
/**
|
|
752
|
+
* An enum representing the funding step types
|
|
753
|
+
* @enum {string}
|
|
754
|
+
* @property {string} GAS - If the fee is a gas fee.
|
|
755
|
+
* @property {string} BRIDGE_FEE - If the fee is a bridge fee.
|
|
756
|
+
* @property {string} SWAP_FEE - If the fee is a swap fee.
|
|
757
|
+
* @property {string} IMMUTABLE_FEE - If the fee is an immutable fee.
|
|
758
|
+
*/
|
|
759
|
+
declare enum FeeType {
|
|
760
|
+
GAS = "GAS",
|
|
761
|
+
BRIDGE_FEE = "BRIDGE_FEE",
|
|
762
|
+
SWAP_FEE = "SWAP_FEE",
|
|
763
|
+
IMMUTABLE_FEE = "IMMUTABLE_FEE"
|
|
764
|
+
}
|
|
765
|
+
type FundingStep = BridgeFundingStep | SwapFundingStep | OnRampFundingStep;
|
|
766
|
+
/**
|
|
767
|
+
* Represents a bridge funding route
|
|
768
|
+
* @property {FundingStepType.BRIDGE} type
|
|
769
|
+
* @property {number} chainId
|
|
770
|
+
* @property {FundingItem} fundingItem
|
|
771
|
+
* @property {BridgeFees} fees
|
|
772
|
+
*/
|
|
773
|
+
type BridgeFundingStep = {
|
|
774
|
+
/** Indicates that this is a bridge funding step */
|
|
775
|
+
type: FundingStepType.BRIDGE;
|
|
776
|
+
/** The chain id the bridge should be executed on */
|
|
777
|
+
chainId: number;
|
|
778
|
+
/** The funding item for the bridge */
|
|
779
|
+
fundingItem: FundingItem;
|
|
780
|
+
/** The fees for the bridge */
|
|
781
|
+
fees: BridgeFees;
|
|
782
|
+
};
|
|
783
|
+
/**
|
|
784
|
+
* Represents the fees for a bridge funding step
|
|
785
|
+
* @property {Fee} approvalGasFee
|
|
786
|
+
* @property {Fee} bridgeGasFee
|
|
787
|
+
* @property {Fee[]} bridgeFees
|
|
788
|
+
*/
|
|
789
|
+
type BridgeFees = {
|
|
790
|
+
/** The approval gas fee for the bridge */
|
|
791
|
+
approvalGasFee: Fee;
|
|
792
|
+
/** The bridge gas fee for the bridge */
|
|
793
|
+
bridgeGasFee: Fee;
|
|
794
|
+
/** Additional bridge fees for the bridge */
|
|
795
|
+
bridgeFees: Fee[];
|
|
796
|
+
};
|
|
797
|
+
/**
|
|
798
|
+
* Represents a swap funding route
|
|
799
|
+
* @property {FundingStepType.SWAP} type
|
|
800
|
+
* @property {number} chainId
|
|
801
|
+
* @property {FundingItem} fundingItem
|
|
802
|
+
* @property {SwapFees} fees
|
|
803
|
+
*/
|
|
804
|
+
type SwapFundingStep = {
|
|
805
|
+
/** Indicates that this is a swap funding step */
|
|
806
|
+
type: FundingStepType.SWAP;
|
|
807
|
+
/** The chain id the swap should be executed on */
|
|
808
|
+
chainId: number;
|
|
809
|
+
/** The funding item for the swap */
|
|
810
|
+
fundingItem: FundingItem;
|
|
811
|
+
/** The fees for the swap */
|
|
812
|
+
fees: SwapFees;
|
|
813
|
+
};
|
|
814
|
+
/**
|
|
815
|
+
* Represents the fees for a swap funding step
|
|
816
|
+
* @property {Fee} approvalGasFee
|
|
817
|
+
* @property {Fee} swapGasFee
|
|
818
|
+
* @property {Fee[]} swapFees
|
|
819
|
+
*/
|
|
820
|
+
type SwapFees = {
|
|
821
|
+
/** The approval gas fee for the swap */
|
|
822
|
+
approvalGasFee: Fee;
|
|
823
|
+
/** The swap gas fee for the swap */
|
|
824
|
+
swapGasFee: Fee;
|
|
825
|
+
/** Additional swap fees for the swap */
|
|
826
|
+
swapFees: Fee[];
|
|
827
|
+
};
|
|
828
|
+
/**
|
|
829
|
+
* Represents an onramp funding route
|
|
830
|
+
* @property {FundingStepType.ONRAMP} type
|
|
831
|
+
* @property {number} chainId
|
|
832
|
+
* @property {FundingItem} fundingItem
|
|
833
|
+
*/
|
|
834
|
+
type OnRampFundingStep = {
|
|
835
|
+
/** Indicates that this is an onramp funding step */
|
|
836
|
+
type: FundingStepType.ONRAMP;
|
|
837
|
+
/** The chain id the onramp should provide funds to */
|
|
838
|
+
chainId: number;
|
|
839
|
+
/** The item to be onramped */
|
|
840
|
+
fundingItem: FundingItem;
|
|
841
|
+
};
|
|
842
|
+
/**
|
|
843
|
+
* An enum representing the funding step types
|
|
844
|
+
* @enum {string}
|
|
845
|
+
* @property {string} BRIDGE - If the funding step is a bridge.
|
|
846
|
+
* @property {string} SWAP - If the funding step is a swap.
|
|
847
|
+
* @property {string} ONRAMP - If the funding step is an onramp.
|
|
848
|
+
*/
|
|
849
|
+
declare enum FundingStepType {
|
|
850
|
+
BRIDGE = "BRIDGE",
|
|
851
|
+
SWAP = "SWAP",
|
|
852
|
+
ONRAMP = "ONRAMP"
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Represents a funding item
|
|
856
|
+
* @property {ItemType.NATIVE | ItemType.ERC20} type
|
|
857
|
+
* @property {FundsRequired} fundsRequired
|
|
858
|
+
* @property {UserBalance} userBalance
|
|
859
|
+
* @property {TokenInfo} token
|
|
860
|
+
*/
|
|
861
|
+
type FundingItem = {
|
|
862
|
+
/** The type of the funding item */
|
|
863
|
+
type: ItemType.NATIVE | ItemType.ERC20;
|
|
864
|
+
/** The amount of funds required of this funding item */
|
|
865
|
+
fundsRequired: FundsRequired;
|
|
866
|
+
/** The current user balance of this funding item */
|
|
867
|
+
userBalance: UserBalance;
|
|
868
|
+
/** The token info for the funding item */
|
|
869
|
+
token: TokenInfo;
|
|
870
|
+
};
|
|
871
|
+
/**
|
|
872
|
+
* Represents the funds required of a funding item
|
|
873
|
+
* @property {BigNumber} amount
|
|
874
|
+
* @property {string} formattedAmount
|
|
875
|
+
*/
|
|
876
|
+
type FundsRequired = {
|
|
877
|
+
/** The amount of funds required */
|
|
878
|
+
amount: BigNumber;
|
|
879
|
+
/** The formatted amount of funds required */
|
|
880
|
+
formattedAmount: string;
|
|
881
|
+
};
|
|
882
|
+
/**
|
|
883
|
+
* Represents the user balance of a funding item
|
|
884
|
+
* @property {BigNumber} balance
|
|
885
|
+
* @property {string} formattedBalance
|
|
886
|
+
*/
|
|
887
|
+
type UserBalance = {
|
|
888
|
+
/** The balance of the funding item */
|
|
889
|
+
balance: BigNumber;
|
|
890
|
+
/** The formatted balance of the funding item */
|
|
891
|
+
formattedBalance: string;
|
|
892
|
+
};
|
|
893
|
+
/**
|
|
894
|
+
* Represents the transaction requirement for a transaction.
|
|
895
|
+
* @property {ItemType} type
|
|
896
|
+
* @property {boolean} sufficient
|
|
897
|
+
* @property {ItemBalance} required
|
|
898
|
+
* @property {ItemBalance} current
|
|
899
|
+
* @property {BalanceDelta} delta
|
|
900
|
+
*/
|
|
901
|
+
type TransactionRequirement = {
|
|
902
|
+
/** The type of the transaction requirement. */
|
|
903
|
+
type: ItemType;
|
|
904
|
+
/** If the user address has sufficient funds to cover the transaction. */
|
|
905
|
+
sufficient: boolean;
|
|
906
|
+
/** The required item balance. */
|
|
907
|
+
required: ItemBalance;
|
|
908
|
+
/** The current item balance. */
|
|
909
|
+
current: ItemBalance;
|
|
910
|
+
/** The delta between the required and current balances. */
|
|
911
|
+
delta: BalanceDelta;
|
|
912
|
+
};
|
|
913
|
+
/**
|
|
914
|
+
* Represents the balance for either a native or ERC20 token.
|
|
915
|
+
* @property {ItemType.NATIVE | ItemType.ERC20} type
|
|
916
|
+
* @property {BigNumber} balance
|
|
917
|
+
* @property {string} formattedBalanc
|
|
918
|
+
* @property {TokenInfo} token
|
|
919
|
+
*/
|
|
920
|
+
type TokenBalance = {
|
|
921
|
+
/** Type to indicate this is a native or ERC20 token. */
|
|
922
|
+
type: ItemType.NATIVE | ItemType.ERC20;
|
|
923
|
+
/** The balance of the item. */
|
|
924
|
+
balance: BigNumber;
|
|
925
|
+
/** The formatted balance of the item. */
|
|
926
|
+
formattedBalance: string;
|
|
927
|
+
/** The token info of the item. */
|
|
928
|
+
token: TokenInfo;
|
|
929
|
+
};
|
|
930
|
+
/**
|
|
931
|
+
* Represents the balance for an ERC721.
|
|
932
|
+
* @property {ItemType.ERC721} type
|
|
933
|
+
* @property {BigNumber} balance
|
|
934
|
+
* @property {string} formattedBalance
|
|
935
|
+
* @property {string} contractAddress
|
|
936
|
+
* @property {string} id
|
|
937
|
+
*/
|
|
938
|
+
type ERC721Balance = {
|
|
939
|
+
/** Type to indicate this is an ERC721 token. */
|
|
940
|
+
type: ItemType.ERC721;
|
|
941
|
+
/** The balance of the item. */
|
|
942
|
+
balance: BigNumber;
|
|
943
|
+
/** The formatted balance of the item. */
|
|
944
|
+
formattedBalance: string;
|
|
945
|
+
/** The contract address of the ERC721 collection. */
|
|
946
|
+
contractAddress: string;
|
|
947
|
+
/** The ID of the ERC721 in the collection */
|
|
948
|
+
id: string;
|
|
949
|
+
};
|
|
950
|
+
/**
|
|
951
|
+
* Type representing the balance of an item.
|
|
952
|
+
*/
|
|
953
|
+
type ItemBalance = ERC721Balance | TokenBalance;
|
|
954
|
+
/**
|
|
955
|
+
* Represents the delta between two balances.
|
|
956
|
+
* @property {BigNumber} balance
|
|
957
|
+
* @property {string} formattedBalance
|
|
958
|
+
*/
|
|
959
|
+
type BalanceDelta = {
|
|
960
|
+
/** The delta of the balance. */
|
|
961
|
+
balance: BigNumber;
|
|
962
|
+
/** The formatted balance of the delta. */
|
|
963
|
+
formattedBalance: string;
|
|
964
|
+
};
|
|
965
|
+
/**
|
|
966
|
+
* A type representing the Smart Checkout routing options available for a user
|
|
967
|
+
* if they are configured and enabled (not geo-blocked etc.)
|
|
968
|
+
* @property {boolean | undefined} onRamp
|
|
969
|
+
* @property {boolean | undefined} swap
|
|
970
|
+
* @property {boolean | undefined} bridge
|
|
971
|
+
*/
|
|
972
|
+
type AvailableRoutingOptions = {
|
|
973
|
+
/** If the user can use onramp */
|
|
974
|
+
onRamp?: boolean;
|
|
975
|
+
/** If the user can use swap */
|
|
976
|
+
swap?: boolean;
|
|
977
|
+
/** If the user can use bridge */
|
|
978
|
+
bridge?: boolean;
|
|
979
|
+
};
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* Interface representing the parameters for {@link Checkout.buy}
|
|
983
|
+
* @property {Web3Provider} provider - The provider to use for the buy.
|
|
984
|
+
* @property {Array<BuyOrder>} orders - The orders to buy
|
|
985
|
+
* @property {BuyOverrides} overrides - The overrides to use for the buy.
|
|
986
|
+
* Currently only processes the first order in the array until batch processing is supported.
|
|
987
|
+
*/
|
|
988
|
+
interface BuyParams {
|
|
989
|
+
provider: Web3Provider;
|
|
990
|
+
orders: Array<BuyOrder>;
|
|
991
|
+
overrides?: BuyOverrides;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* Interface representing the parameters for {@link Checkout.cancel}
|
|
996
|
+
* @property {Web3Provider} provider - The provider to use for the cancel.
|
|
997
|
+
* @property {string[]} orderIds - The order IDs to cancel.
|
|
998
|
+
* @property {CancelOverrides} overrides - The overrides to use for the cancel.
|
|
999
|
+
* Currently only processes the first order in the array until batch processing is supported.
|
|
1000
|
+
*/
|
|
1001
|
+
interface CancelParams {
|
|
1002
|
+
provider: Web3Provider;
|
|
1003
|
+
orderIds: string[];
|
|
1004
|
+
overrides?: CancelOverrides;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
type ExchangeContracts = {
|
|
1008
|
+
multicall: string;
|
|
1009
|
+
coreFactory: string;
|
|
1010
|
+
quoter: string;
|
|
1011
|
+
swapRouter: string;
|
|
1012
|
+
immutableSwapProxy: string;
|
|
1013
|
+
};
|
|
1014
|
+
/**
|
|
1015
|
+
* Type representing the secondary fees for a swap
|
|
1016
|
+
* @property {string} recipient - The fee recipient address
|
|
1017
|
+
* @property {number} basisPoints - The fee percentage in basis points
|
|
1018
|
+
* @example 100 basis points = 1%
|
|
1019
|
+
*/
|
|
1020
|
+
type SecondaryFee = {
|
|
1021
|
+
recipient: string;
|
|
1022
|
+
basisPoints: number;
|
|
1023
|
+
};
|
|
1024
|
+
/**
|
|
1025
|
+
* Type representing an ERC20 token
|
|
1026
|
+
* @property {string} type - The token type, used to discriminate between {@link ERC20} and {@link Native}
|
|
1027
|
+
* @property {number} chainId - The chain ID
|
|
1028
|
+
* @property {string} address - The token address
|
|
1029
|
+
* @property {number} decimals - The token decimals
|
|
1030
|
+
* @property {string | undefined} symbol - The token symbol or undefined if it is not available
|
|
1031
|
+
* @property {string | undefined} name - The token name or undefined if it is not available
|
|
1032
|
+
*/
|
|
1033
|
+
type ERC20 = {
|
|
1034
|
+
type: 'erc20';
|
|
1035
|
+
chainId: number;
|
|
1036
|
+
address: string;
|
|
1037
|
+
decimals: number;
|
|
1038
|
+
symbol?: string;
|
|
1039
|
+
name?: string;
|
|
1040
|
+
};
|
|
1041
|
+
/**
|
|
1042
|
+
* Type representing a native token
|
|
1043
|
+
* @property {string} type - The token type, used to discriminate between {@link ERC20} and {@link Native}
|
|
1044
|
+
* @property {number} chainId - The chain ID
|
|
1045
|
+
* @property {number} decimals - The token decimals
|
|
1046
|
+
* @property {string | undefined} symbol - The token symbol or undefined if it is not available
|
|
1047
|
+
* @property {string | undefined} name - The token name or undefined if it is not available
|
|
1048
|
+
*/
|
|
1049
|
+
type Native = {
|
|
1050
|
+
type: 'native';
|
|
1051
|
+
chainId: number;
|
|
1052
|
+
decimals: number;
|
|
1053
|
+
symbol?: string;
|
|
1054
|
+
name?: string;
|
|
1055
|
+
};
|
|
1056
|
+
/**
|
|
1057
|
+
* Type representing the overrides for the {@link Exchange} module
|
|
1058
|
+
* @property {string} rpcURL - The RPC URL for the chain
|
|
1059
|
+
* @property {ExchangeContracts} exchangeContracts - The DEX contract addresses
|
|
1060
|
+
* @property {ERC20[]} commonRoutingTokens - The tokens used to find available pools for a swap
|
|
1061
|
+
* @property {Native} nativeToken - The native token of the chain
|
|
1062
|
+
* @property {ERC20} wrappedNativeToken - The wrapped native token of the chain
|
|
1063
|
+
*/
|
|
1064
|
+
type ExchangeOverrides = {
|
|
1065
|
+
rpcURL: string;
|
|
1066
|
+
exchangeContracts: ExchangeContracts;
|
|
1067
|
+
commonRoutingTokens: ERC20[];
|
|
1068
|
+
nativeToken: Native;
|
|
1069
|
+
wrappedNativeToken: ERC20;
|
|
1070
|
+
};
|
|
1071
|
+
|
|
1072
|
+
interface CheckoutOverrides {
|
|
1073
|
+
}
|
|
1074
|
+
interface CheckoutFeatureConfiguration {
|
|
1075
|
+
enable: boolean;
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* A type representing the on-ramp configurations for the checkout SDK.
|
|
1079
|
+
* @property {boolean} enable - To enable on-ramp feature in Checkout sdk.
|
|
1080
|
+
*/
|
|
1081
|
+
interface CheckoutOnRampConfiguration extends CheckoutFeatureConfiguration {
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* A type representing the swap configurations for the checkout SDK.
|
|
1085
|
+
* @property {boolean} enable - To enable swap feature in Checkout sdk.
|
|
1086
|
+
*/
|
|
1087
|
+
interface CheckoutSwapConfiguration extends CheckoutFeatureConfiguration {
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* A type representing the bridge configurations for the checkout SDK.
|
|
1091
|
+
* @property {boolean} enable - To enable bridge feature in Checkout sdk.
|
|
1092
|
+
*/
|
|
1093
|
+
interface CheckoutBridgeConfiguration extends CheckoutFeatureConfiguration {
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* A type representing checkout SDK configurations.
|
|
1097
|
+
* @property {CheckoutOnRampConfiguration} onRamp - To configure the on-ramp feature.
|
|
1098
|
+
* @property {CheckoutSwapConfiguration} swap - To configure the swap feature.
|
|
1099
|
+
* @property {CheckoutBridgeConfiguration} bridge - To configure the bridge feature.
|
|
1100
|
+
* @property {Passport} passport - To enable passport wallet integration.
|
|
1101
|
+
* @property {string} publishableKey - To identify your integration for tracking and analytics purposes.
|
|
1102
|
+
*/
|
|
1103
|
+
interface CheckoutModuleConfiguration extends ModuleConfiguration<CheckoutOverrides> {
|
|
1104
|
+
onRamp?: CheckoutOnRampConfiguration;
|
|
1105
|
+
swap?: CheckoutSwapConfiguration;
|
|
1106
|
+
bridge?: CheckoutBridgeConfiguration;
|
|
1107
|
+
passport?: Passport;
|
|
1108
|
+
publishableKey?: string;
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* A type representing various remotely defined configurations which are
|
|
1112
|
+
* accessible via the Checkout config and configured based on the Environment.
|
|
1113
|
+
* @property {ConnectConfig} connect
|
|
1114
|
+
* @property {DexConfig} dex
|
|
1115
|
+
* @property {OnRampConfig} onramp
|
|
1116
|
+
* @property {BridgeConfig} bridge
|
|
1117
|
+
* @property {AllowedNetworkConfig[]} allowedNetworks
|
|
1118
|
+
* @property {GasEstimateTokenConfig | undefined} gasEstimateTokens
|
|
1119
|
+
* @property {ImxAddressConfig | undefined} imxAddressMapping
|
|
1120
|
+
* @property {TelemetryConfig | undefined} telemetry
|
|
1121
|
+
*/
|
|
1122
|
+
type RemoteConfiguration = {
|
|
1123
|
+
/** The config used for the Connect. */
|
|
1124
|
+
connect: ConnectConfig;
|
|
1125
|
+
/** The config used for the DEX. */
|
|
1126
|
+
dex: DexConfig;
|
|
1127
|
+
/** The config used for the OnRamp */
|
|
1128
|
+
onramp: OnRampConfig;
|
|
1129
|
+
/** The config used for the Bridge. */
|
|
1130
|
+
bridge: BridgeConfig;
|
|
1131
|
+
/** An array representing the allowed networks. */
|
|
1132
|
+
allowedNetworks: AllowedNetworkConfig[];
|
|
1133
|
+
/** The config for the tokens used to estimate gas. */
|
|
1134
|
+
gasEstimateTokens?: GasEstimateTokenConfig;
|
|
1135
|
+
/** The IMX address mappings across available networks. */
|
|
1136
|
+
imxAddressMapping?: ImxAddressConfig;
|
|
1137
|
+
/** Telemetry config. */
|
|
1138
|
+
telemetry?: TelemetryConfig;
|
|
1139
|
+
};
|
|
1140
|
+
/**
|
|
1141
|
+
* A type representing the fee structure for an OnRamp provider
|
|
1142
|
+
* @property {string | undefined} minPercentage
|
|
1143
|
+
* @property {string | undefined} maxPercentage
|
|
1144
|
+
* @property {string | undefined} feePercentage
|
|
1145
|
+
*/
|
|
1146
|
+
type OnRampProviderFees = {
|
|
1147
|
+
/** The minimum percentage fee shown if a fee range is provided */
|
|
1148
|
+
minPercentage?: string;
|
|
1149
|
+
/** The maximum percentage fee shown if a fee range is provided */
|
|
1150
|
+
maxPercentage?: string;
|
|
1151
|
+
/** The specific fee percentage shown if there is no range provided */
|
|
1152
|
+
feePercentage?: string;
|
|
1153
|
+
};
|
|
1154
|
+
/**
|
|
1155
|
+
* A type representing the configuration for the OnRamp for a specific provider.
|
|
1156
|
+
* @property {string} publishableApiKey
|
|
1157
|
+
* @property {TokenInfo[]} tokens
|
|
1158
|
+
* @property {OnRampProviderFees} fees
|
|
1159
|
+
*/
|
|
1160
|
+
type OnRampProviderConfig = {
|
|
1161
|
+
/** The on ramp provider publishable api-key */
|
|
1162
|
+
publishableApiKey: string;
|
|
1163
|
+
/** The allowed tokens for the OnRamp provider */
|
|
1164
|
+
tokens: TokenInfo[];
|
|
1165
|
+
/** The on ramp provider transaction fees */
|
|
1166
|
+
fees: OnRampProviderFees;
|
|
1167
|
+
};
|
|
1168
|
+
/**
|
|
1169
|
+
* A type representing the configuration for the OnRamp.
|
|
1170
|
+
* @property {OnRampProviderConfig} transak
|
|
1171
|
+
*/
|
|
1172
|
+
type OnRampConfig = {
|
|
1173
|
+
/** OnRamp config for Transak provider */
|
|
1174
|
+
[key: string]: OnRampProviderConfig;
|
|
1175
|
+
};
|
|
1176
|
+
/**
|
|
1177
|
+
* A type representing the configuration for the Connect.
|
|
1178
|
+
* @property {boolean} walletConnect
|
|
1179
|
+
*/
|
|
1180
|
+
type ConnectConfig = {
|
|
1181
|
+
/** A boolean value for enabling/disabling WalletConnect */
|
|
1182
|
+
walletConnect: boolean;
|
|
1183
|
+
/** A configuration for injected wallets */
|
|
1184
|
+
injected: {
|
|
1185
|
+
/** List for sorting injected wallets via wallet rdns */
|
|
1186
|
+
priorityWalletRdns: string[];
|
|
1187
|
+
/** List for blocking injected wallets via wallet rdns */
|
|
1188
|
+
blocklistWalletRdns: string[];
|
|
1189
|
+
};
|
|
1190
|
+
};
|
|
1191
|
+
/**
|
|
1192
|
+
* A type representing the configuration for the DEX.
|
|
1193
|
+
* @property {ExchangeOverrides | undefined} overrides
|
|
1194
|
+
* @property {TokenInfo[] | undefined} tokens
|
|
1195
|
+
*/
|
|
1196
|
+
type DexConfig = {
|
|
1197
|
+
/** The DEX overrides. */
|
|
1198
|
+
overrides?: ExchangeOverrides;
|
|
1199
|
+
/** An array of tokens compatible with the DEX. */
|
|
1200
|
+
tokens?: TokenInfo[];
|
|
1201
|
+
/** An array of secondary fees to be applied to swaps */
|
|
1202
|
+
secondaryFees?: SecondaryFee[];
|
|
1203
|
+
};
|
|
1204
|
+
/**
|
|
1205
|
+
* A type representing the configuration for the Bridge for all the supported chains.
|
|
1206
|
+
*/
|
|
1207
|
+
type BridgeConfig = {
|
|
1208
|
+
/** An object containing the bridge configuration per chain */
|
|
1209
|
+
[chainId: string]: BridgeChainConfig;
|
|
1210
|
+
};
|
|
1211
|
+
/**
|
|
1212
|
+
* A type representing the configuration for the Bridge.
|
|
1213
|
+
* @property {TokenInfo[] | undefined} tokens
|
|
1214
|
+
*/
|
|
1215
|
+
type BridgeChainConfig = {
|
|
1216
|
+
/** An array of tokens compatible with the Bridge. */
|
|
1217
|
+
tokens?: TokenInfo[];
|
|
1218
|
+
};
|
|
1219
|
+
/**
|
|
1220
|
+
* A type representing an allowed network.
|
|
1221
|
+
* @property {number} chainId
|
|
1222
|
+
*/
|
|
1223
|
+
type AllowedNetworkConfig = {
|
|
1224
|
+
/** The network chain id. */
|
|
1225
|
+
chainId: number;
|
|
1226
|
+
};
|
|
1227
|
+
/**
|
|
1228
|
+
* A type representing the IMX address mappings across available networks.
|
|
1229
|
+
* @type {{ [chainId: string]: string }}
|
|
1230
|
+
*/
|
|
1231
|
+
type ImxAddressConfig = {
|
|
1232
|
+
[chainId: string]: string;
|
|
1233
|
+
};
|
|
1234
|
+
/**
|
|
1235
|
+
* A type representing the telemetry configurations.
|
|
1236
|
+
* @property {string} segmentPublishableKey
|
|
1237
|
+
*/
|
|
1238
|
+
type TelemetryConfig = {
|
|
1239
|
+
segmentPublishableKey: string;
|
|
1240
|
+
};
|
|
1241
|
+
/**
|
|
1242
|
+
* A type representing the required information to estimate gas for a transaction.
|
|
1243
|
+
* @type {{ [key: string]: { bridgeToL2Addresses?: GasEstimateBridgeToL2TokenConfig, swapAddresses?: GasEstimateSwapTokenConfig } }}
|
|
1244
|
+
* - A map of addresses for estimating gas keyed by the network chain id.
|
|
1245
|
+
* @property {GasEstimateBridgeToL2TokenConfig | undefined} bridgeToL2Addresses
|
|
1246
|
+
* @property {GasEstimateSwapTokenConfig | undefined} swapAddresses
|
|
1247
|
+
*/
|
|
1248
|
+
type GasEstimateTokenConfig = {
|
|
1249
|
+
[key: string]: {
|
|
1250
|
+
/** The type representing the addresses for a bridge to layer 2 gas estimate. */
|
|
1251
|
+
bridgeToL2Addresses?: GasEstimateBridgeToL2TokenConfig;
|
|
1252
|
+
/** The type representing the addresses for a swap gas estimate */
|
|
1253
|
+
swapAddresses?: GasEstimateSwapTokenConfig;
|
|
1254
|
+
};
|
|
1255
|
+
};
|
|
1256
|
+
/**
|
|
1257
|
+
* A type representing the config for a bridge to layer 2 gas estimate.
|
|
1258
|
+
* @property {string | 'NATIVE'} gasTokenAddress
|
|
1259
|
+
* @property {string} fromAddress
|
|
1260
|
+
*/
|
|
1261
|
+
type GasEstimateBridgeToL2TokenConfig = {
|
|
1262
|
+
/** The address of the gas token. */
|
|
1263
|
+
gasTokenAddress: string | 'NATIVE';
|
|
1264
|
+
/** The address of the token being bridged. */
|
|
1265
|
+
fromAddress: string;
|
|
1266
|
+
};
|
|
1267
|
+
/**
|
|
1268
|
+
* A type representing the config for a swap gas estimate.
|
|
1269
|
+
* @property {string} inAddress
|
|
1270
|
+
* @property {string} outAddress
|
|
1271
|
+
*/
|
|
1272
|
+
type GasEstimateSwapTokenConfig = {
|
|
1273
|
+
/** The in token address. */
|
|
1274
|
+
inAddress: string;
|
|
1275
|
+
/** The out token address. */
|
|
1276
|
+
outAddress: string;
|
|
1277
|
+
};
|
|
1278
|
+
/**
|
|
1279
|
+
* A type representing all the feature flags available.
|
|
1280
|
+
* @property {TokenInfo[] | undefined} allowed -
|
|
1281
|
+
* @property {boolean | undefined} blockscout -
|
|
1282
|
+
*/
|
|
1283
|
+
type ChainTokensConfig = {
|
|
1284
|
+
/** List of allowed tokens for a given chain. */
|
|
1285
|
+
allowed?: TokenInfo[];
|
|
1286
|
+
/** Feature flag to enable/disable blockscout integration. */
|
|
1287
|
+
blockscout?: boolean;
|
|
1288
|
+
};
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* Interface representing the params of {@link Checkout.connect}.
|
|
1292
|
+
* @property {Web3Provider} provider - The provider used to connect to the network.
|
|
1293
|
+
* @property {boolean | undefined} requestWalletPermissions - A boolean that will trigger a permission request for wallet connection.
|
|
1294
|
+
*/
|
|
1295
|
+
interface ConnectParams {
|
|
1296
|
+
provider: Web3Provider;
|
|
1297
|
+
requestWalletPermissions?: boolean;
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* Interface representing the result of {@link Checkout.connect}.
|
|
1301
|
+
* @property {Web3Provider} provider - The provider used to connect to the network.
|
|
1302
|
+
*/
|
|
1303
|
+
interface ConnectResult {
|
|
1304
|
+
provider: Web3Provider;
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* Interface representing the params of {@link Checkout.checkIsWalletConnected}.
|
|
1308
|
+
* @property {Web3Provider} provider - The provider used to connect to the network.
|
|
1309
|
+
*/
|
|
1310
|
+
interface CheckConnectionParams {
|
|
1311
|
+
provider: Web3Provider;
|
|
1312
|
+
}
|
|
1313
|
+
/**
|
|
1314
|
+
* Interface representing the result of {@link Checkout.checkIsWalletConnected}.
|
|
1315
|
+
* @property {boolean} isConnected - A boolean indicating the connection status of the Web3 provider.
|
|
1316
|
+
* @property {string} walletAddress - The wallet address used to check the connection.
|
|
1317
|
+
*/
|
|
1318
|
+
interface CheckConnectionResult {
|
|
1319
|
+
isConnected: boolean;
|
|
1320
|
+
walletAddress: string;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* @typedef {string} Address - Represents an Ethereum address.
|
|
1325
|
+
*/
|
|
1326
|
+
type Address = string;
|
|
1327
|
+
/**
|
|
1328
|
+
* @typedef {Object} BridgeFeeResponse
|
|
1329
|
+
* @property {ethers.BigNumber} sourceChainGas - Gas cost to send tokens to the bridge contract on the source chain.
|
|
1330
|
+
* - priced in the source chain's native token.
|
|
1331
|
+
* @property {ethers.BigNumber} approvalFee - Gas cost to approve bridge contract to spend tokens on the source chain.
|
|
1332
|
+
* - priced in the source chain's native token.
|
|
1333
|
+
* @property {ethers.BigNumber} bridgeFee - destinationChainGas + validatorFee.
|
|
1334
|
+
* This will be added to the tx.value of the bridge transaction and forwarded to the Axelar Gas Service contract.
|
|
1335
|
+
* - priced in the source chain's native token.
|
|
1336
|
+
* @property {ethers.BigNumber} imtblFee - The fee charged by Immutable to facilitate the bridge.
|
|
1337
|
+
* - priced in the source chain's native token.
|
|
1338
|
+
* @property {ethers.BigNumber} totalFees - The total fees the user will be charged which is;
|
|
1339
|
+
* sourceChainGas + approvalFee + bridgeFee + imtblFee.
|
|
1340
|
+
* - priced in the source chain's native token.
|
|
1341
|
+
*/
|
|
1342
|
+
interface BridgeFeeResponse {
|
|
1343
|
+
sourceChainGas: BigNumber;
|
|
1344
|
+
approvalFee: BigNumber;
|
|
1345
|
+
bridgeFee: BigNumber;
|
|
1346
|
+
imtblFee: BigNumber;
|
|
1347
|
+
totalFees: BigNumber;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
interface EIP1193Provider {
|
|
1351
|
+
request(args: EIP1193RequestArguments): Promise<unknown>;
|
|
1352
|
+
on<TEvent extends keyof EIP1193EventMap>(event: TEvent, listener: EIP1193EventMap[TEvent]): void;
|
|
1353
|
+
removeListener<TEvent extends keyof EIP1193EventMap>(event: TEvent, listener: EIP1193EventMap[TEvent]): void;
|
|
1354
|
+
}
|
|
1355
|
+
interface EIP1193RequestArguments {
|
|
1356
|
+
readonly method: string;
|
|
1357
|
+
readonly params?: readonly unknown[] | object;
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* Errors
|
|
1361
|
+
*/
|
|
1362
|
+
declare class ProviderRpcError extends Error {
|
|
1363
|
+
code: number;
|
|
1364
|
+
details: string;
|
|
1365
|
+
constructor(code: number, message: string);
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* Provider Events
|
|
1369
|
+
*/
|
|
1370
|
+
type ProviderConnectInfo = {
|
|
1371
|
+
chainId: string;
|
|
1372
|
+
};
|
|
1373
|
+
type ProviderMessage = {
|
|
1374
|
+
type: string;
|
|
1375
|
+
data: unknown;
|
|
1376
|
+
};
|
|
1377
|
+
type EIP1193EventMap = {
|
|
1378
|
+
accountsChanged(accounts: Address[]): void;
|
|
1379
|
+
chainChanged(chainId: string): void;
|
|
1380
|
+
connect(connectInfo: ProviderConnectInfo): void;
|
|
1381
|
+
disconnect(error: ProviderRpcError): void;
|
|
1382
|
+
message(message: ProviderMessage): void;
|
|
1383
|
+
};
|
|
1384
|
+
|
|
1385
|
+
/**
|
|
1386
|
+
* Event detail from the `eip6963:announceProvider` event.
|
|
1387
|
+
*/
|
|
1388
|
+
interface EIP6963ProviderDetail {
|
|
1389
|
+
info: EIP6963ProviderInfo;
|
|
1390
|
+
provider: EIP1193Provider;
|
|
1391
|
+
}
|
|
1392
|
+
/**
|
|
1393
|
+
* Metadata of the EIP-1193 Provider.
|
|
1394
|
+
*/
|
|
1395
|
+
interface EIP6963ProviderInfo {
|
|
1396
|
+
icon: `data:image/${string}`;
|
|
1397
|
+
name: string;
|
|
1398
|
+
rdns: string;
|
|
1399
|
+
uuid: string;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* An enum representing the type of gas estimate.
|
|
1404
|
+
* @enum {string}
|
|
1405
|
+
* @property {string} BRIDGE_TO_L2 - The gas estimate type for a bridge to L2 transaction.
|
|
1406
|
+
* @property {string} SWAP - The gas estimate type for a swap transaction.
|
|
1407
|
+
*/
|
|
1408
|
+
declare enum GasEstimateType {
|
|
1409
|
+
BRIDGE_TO_L2 = "BRIDGE_TO_L2",
|
|
1410
|
+
SWAP = "SWAP"
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1413
|
+
* Represents the parameters for estimating gas usage, which can be either
|
|
1414
|
+
* GasEstimateBridgeToL2Params or GasEstimateSwapParams {@link Checkout.gasEstimate}.
|
|
1415
|
+
* @typedef {GasEstimateBridgeToL2Params | GasEstimateSwapParams} GasEstimateParams
|
|
1416
|
+
*/
|
|
1417
|
+
type GasEstimateParams = GasEstimateBridgeToL2Params | GasEstimateSwapParams;
|
|
1418
|
+
/**
|
|
1419
|
+
* An interface representing the parameters for estimating gas for a bridge to L2 transaction {@link Checkout.gasEstimate}.
|
|
1420
|
+
* @param {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
|
|
1421
|
+
*/
|
|
1422
|
+
interface GasEstimateBridgeToL2Params {
|
|
1423
|
+
gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
|
|
1424
|
+
}
|
|
1425
|
+
/**
|
|
1426
|
+
* An interface representing the parameters for a gas estimate swap {@link Checkout.gasEstimate}.
|
|
1427
|
+
* @interface
|
|
1428
|
+
* @property {GasEstimateType.SWAP} gasEstimateType - The type of gas estimate, which is always "swap".
|
|
1429
|
+
*/
|
|
1430
|
+
interface GasEstimateSwapParams {
|
|
1431
|
+
gasEstimateType: GasEstimateType.SWAP;
|
|
1432
|
+
}
|
|
1433
|
+
/**
|
|
1434
|
+
* An interface representing the result of a gas estimate for a swap transaction {@link Checkout.gasEstimate}.
|
|
1435
|
+
* @interface GasEstimateSwapResult
|
|
1436
|
+
* @property {GasEstimateType.SWAP} gasEstimateType - The type of gas estimate, which is always "SWAP".
|
|
1437
|
+
* @property {TokenAmountEstimate} fees - The estimated gas fee for the swap transaction.
|
|
1438
|
+
*/
|
|
1439
|
+
interface GasEstimateSwapResult {
|
|
1440
|
+
gasEstimateType: GasEstimateType.SWAP;
|
|
1441
|
+
fees: TokenAmountEstimate;
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* An interface representing the result of a gas estimate for a bridge to L2 transaction {@link Checkout.gasEstimate}.
|
|
1445
|
+
* @interface GasEstimateBridgeToL2Result
|
|
1446
|
+
* @property {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
|
|
1447
|
+
* @property {BridgeFeeResponse} fees - The estimated fees for the transaction.
|
|
1448
|
+
* @property {TokenInfo | undefined} token - The gas token information.
|
|
1449
|
+
*/
|
|
1450
|
+
interface GasEstimateBridgeToL2Result {
|
|
1451
|
+
gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
|
|
1452
|
+
fees: BridgeFeeResponse;
|
|
1453
|
+
token?: TokenInfo;
|
|
1454
|
+
}
|
|
1455
|
+
/**
|
|
1456
|
+
* An interface representing the estimated fees.
|
|
1457
|
+
* @property {BigNumber | undefined} totalFees - The estimated fees for the transaction.
|
|
1458
|
+
* @property {TokenInfo | undefined} token - The gas token information.
|
|
1459
|
+
*/
|
|
1460
|
+
interface TokenAmountEstimate {
|
|
1461
|
+
totalFees?: BigNumber;
|
|
1462
|
+
token?: TokenInfo;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
/**
|
|
1466
|
+
* Represents information about a network.
|
|
1467
|
+
* @interface NetworkInfo
|
|
1468
|
+
* @property {string} name - The name of the network.
|
|
1469
|
+
* @property {number} chainId - The chain ID of the network.
|
|
1470
|
+
* @property {TokenInfo} nativeCurrency - Information about the native currency of the network.
|
|
1471
|
+
* @property {boolean} isSupported - Indicates whether the network is supported.
|
|
1472
|
+
*/
|
|
1473
|
+
interface NetworkInfo {
|
|
1474
|
+
name: string;
|
|
1475
|
+
chainId: number;
|
|
1476
|
+
nativeCurrency: TokenInfo;
|
|
1477
|
+
isSupported: boolean;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
/**
|
|
1481
|
+
* Interface representing the parameters for {@link Checkout.addNetwork}.
|
|
1482
|
+
* @property {Web3Provider} provider - The provider to connect to the network.
|
|
1483
|
+
* @property {ChainId} chainId - The ID of the network to add. We only support adding Immutable zkEVM and Immutable zkEVM Testnet.
|
|
1484
|
+
*/
|
|
1485
|
+
interface AddNetworkParams {
|
|
1486
|
+
provider: Web3Provider;
|
|
1487
|
+
chainId: ChainId;
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* Interface representing the parameters for {@link Checkout.switchNetwork}.
|
|
1491
|
+
* @property {Web3Provider} provider - The provider to connect to the network.
|
|
1492
|
+
* @property {ChainId} chainId - The ID of the network to switch to.
|
|
1493
|
+
*/
|
|
1494
|
+
interface SwitchNetworkParams {
|
|
1495
|
+
provider: Web3Provider;
|
|
1496
|
+
chainId: ChainId;
|
|
1497
|
+
}
|
|
1498
|
+
/**
|
|
1499
|
+
* Represents the result of switching the network in a Web3 application {@link Checkout.switchNetwork}.
|
|
1500
|
+
* @interface SwitchNetworkResult
|
|
1501
|
+
* @property {NetworkInfo} network - The information about the switched network.
|
|
1502
|
+
* @property {Web3Provider} provider - The Web3 provider for the switched network.
|
|
1503
|
+
*/
|
|
1504
|
+
interface SwitchNetworkResult {
|
|
1505
|
+
network: NetworkInfo;
|
|
1506
|
+
provider: Web3Provider;
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* * Interface representing the parameters for {@link Checkout.getNetworkInfo}.
|
|
1510
|
+
* @property {Web3Provider} provider - The provider to connect to the network.
|
|
1511
|
+
*/
|
|
1512
|
+
interface GetNetworkParams {
|
|
1513
|
+
provider: Web3Provider;
|
|
1514
|
+
}
|
|
1515
|
+
/**
|
|
1516
|
+
* * Interface representing the parameters for {@link Checkout.getNetworkAllowList}.
|
|
1517
|
+
* @property {NetworkFilterTypes} type - The type of allow list filter to apply.
|
|
1518
|
+
* @property {NetworkFilter[]} [exclude] - The list of networks to exclude from the allow list.
|
|
1519
|
+
*/
|
|
1520
|
+
interface GetNetworkAllowListParams {
|
|
1521
|
+
type: NetworkFilterTypes;
|
|
1522
|
+
exclude?: NetworkFilter[];
|
|
1523
|
+
}
|
|
1524
|
+
/**
|
|
1525
|
+
* Interface representing the result of {@link Checkout.getNetworkAllowList}.
|
|
1526
|
+
* @property {NetworkInfo[]} networks - The list of allowed networks.
|
|
1527
|
+
*/
|
|
1528
|
+
interface GetNetworkAllowListResult {
|
|
1529
|
+
networks: NetworkInfo[];
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* Enum representing the types of filters that can be applied to get the allow list of networks.
|
|
1533
|
+
*/
|
|
1534
|
+
declare enum NetworkFilterTypes {
|
|
1535
|
+
ALL = "all"
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* Interface representing a filter for filtering a specific network.
|
|
1539
|
+
* @property {ChainId} chainId - The ID of the network to allow or disallow.
|
|
1540
|
+
*/
|
|
1541
|
+
interface NetworkFilter {
|
|
1542
|
+
chainId: ChainId;
|
|
1543
|
+
}
|
|
1544
|
+
type NetworkDetails = {
|
|
1545
|
+
chainIdHex: string;
|
|
1546
|
+
chainName: string;
|
|
1547
|
+
rpcUrls: string[];
|
|
1548
|
+
nativeCurrency: TokenInfo;
|
|
1549
|
+
blockExplorerUrls?: string[];
|
|
1550
|
+
};
|
|
1551
|
+
type NetworkMap = Map<ChainId, NetworkDetails>;
|
|
1552
|
+
|
|
1553
|
+
/**
|
|
1554
|
+
* Interface representing the parameters for {@link Checkout.sell}
|
|
1555
|
+
* @property {Web3Provider} provider - The provider to use for the sell.
|
|
1556
|
+
* @property {Array<SellOrder>} orders - An array of sell orders to execute.
|
|
1557
|
+
* Currently only processes the first order in the array until batch processing is supported.
|
|
1558
|
+
*/
|
|
1559
|
+
interface SellParams {
|
|
1560
|
+
provider: Web3Provider;
|
|
1561
|
+
orders: Array<SellOrder>;
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* Interface representing the parameters for {@link Checkout.getTokenAllowList}.
|
|
1566
|
+
* @property {TokenFilterTypes} type - The type of token to retrieve.
|
|
1567
|
+
* @property {ChainId} chainId - The ID of the blockchain network.
|
|
1568
|
+
* @property {TokenFilter[]} [exclude] - The tokens to exclude from the list.
|
|
1569
|
+
*/
|
|
1570
|
+
interface GetTokenAllowListParams {
|
|
1571
|
+
type: TokenFilterTypes;
|
|
1572
|
+
chainId: ChainId;
|
|
1573
|
+
exclude?: TokenFilter[];
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* Interface representing the result of {@link Checkout.getTokenAllowList}.
|
|
1577
|
+
* @property {TokenInfo[]} tokens - The list of tokens allowed for the specified params.
|
|
1578
|
+
*/
|
|
1579
|
+
interface GetTokenAllowListResult {
|
|
1580
|
+
tokens: TokenInfo[];
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
* Enum representing the types of token filters available.
|
|
1584
|
+
*/
|
|
1585
|
+
declare enum TokenFilterTypes {
|
|
1586
|
+
ALL = "all",
|
|
1587
|
+
SWAP = "swap",
|
|
1588
|
+
BRIDGE = "bridge",
|
|
1589
|
+
ONRAMP = "onramp"
|
|
1590
|
+
}
|
|
1591
|
+
/**
|
|
1592
|
+
* Interface representing a token filter that can be used to exclude certain tokens.
|
|
1593
|
+
* @property {string} address - The token contract address.
|
|
1594
|
+
*/
|
|
1595
|
+
interface TokenFilter {
|
|
1596
|
+
address: string;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Interface representing the parameters for {@link Checkout.sendTransaction}.
|
|
1601
|
+
* @property {Web3Provider} provider - The provider to connect to the network.
|
|
1602
|
+
* @property {TransactionRequest} transaction - The transaction to send.
|
|
1603
|
+
*/
|
|
1604
|
+
interface SendTransactionParams {
|
|
1605
|
+
provider: Web3Provider;
|
|
1606
|
+
transaction: TransactionRequest;
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* Interface representing the result of {@link Checkout.sendTransaction}.
|
|
1610
|
+
* @property {TransactionResponse} transactionResponse - The response of the transaction.
|
|
1611
|
+
*/
|
|
1612
|
+
interface SendTransactionResult {
|
|
1613
|
+
transactionResponse: TransactionResponse;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
/**
|
|
1617
|
+
* Enum representing the names of different wallet providers.
|
|
1618
|
+
*/
|
|
1619
|
+
declare enum WalletProviderName {
|
|
1620
|
+
PASSPORT = "passport",
|
|
1621
|
+
METAMASK = "metamask",
|
|
1622
|
+
WALLETCONNECT = "walletconnect"
|
|
1623
|
+
}
|
|
1624
|
+
/**
|
|
1625
|
+
* Enum representing the rdns of injected wallet providers.
|
|
1626
|
+
*/
|
|
1627
|
+
declare enum WalletProviderRdns {
|
|
1628
|
+
PASSPORT = "com.immutable.passport",
|
|
1629
|
+
METAMASK = "io.metamask",
|
|
1630
|
+
WALLETCONNECT = "walletconnect"
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Interface for the parameters required to create a wallet provider {@link Checkout.createProvider}.
|
|
1634
|
+
* @interface CreateProviderParams
|
|
1635
|
+
* @property {WalletProviderName} walletProviderName - The wallet provider name to create a provider for.
|
|
1636
|
+
*/
|
|
1637
|
+
interface CreateProviderParams {
|
|
1638
|
+
walletProviderName: WalletProviderName;
|
|
1639
|
+
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Represents the result of creating a Web3 provider {@link Checkout.createProvider}.
|
|
1642
|
+
* @property {Web3Provider} provider - The created Web3 provider.
|
|
1643
|
+
* @property {WalletProviderName} walletProviderName - The wallet provider name of the provider that was created.
|
|
1644
|
+
*/
|
|
1645
|
+
type CreateProviderResult = {
|
|
1646
|
+
provider: Web3Provider;
|
|
1647
|
+
walletProviderName: WalletProviderName;
|
|
1648
|
+
};
|
|
1649
|
+
type ValidateProviderOptions = {
|
|
1650
|
+
allowMistmatchedChainId: boolean;
|
|
1651
|
+
allowUnsupportedProvider: boolean;
|
|
1652
|
+
};
|
|
1653
|
+
|
|
1654
|
+
/**
|
|
1655
|
+
* Interface representing a wallet filter to be used in {@link GetWalletAllowListParams}.
|
|
1656
|
+
* @property {WalletProviderName} walletProviderName - The wallet provider name to filter wallets by.
|
|
1657
|
+
*/
|
|
1658
|
+
interface WalletFilter {
|
|
1659
|
+
walletProviderName: WalletProviderName;
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* Interface representing the parameters for {@link Checkout.getWalletAllowList}.
|
|
1663
|
+
* @property {WalletFilterTypes} type - The type of wallets to filter by.
|
|
1664
|
+
* @property {WalletFilter[]} [exclude] - An optional list of wallet filters to exclude from the allowed wallets list.
|
|
1665
|
+
*/
|
|
1666
|
+
interface GetWalletAllowListParams {
|
|
1667
|
+
type: WalletFilterTypes;
|
|
1668
|
+
exclude?: WalletFilter[];
|
|
1669
|
+
}
|
|
1670
|
+
/**
|
|
1671
|
+
* Interface representing information about a wallet used in {@link GetWalletAllowListResult}.
|
|
1672
|
+
* @property {WalletProviderName} walletProviderName - The wallet provider name for the wallet.
|
|
1673
|
+
* @property {string | undefined} description - A description of the wallet.
|
|
1674
|
+
* @property {string | undefined} icon - The URL/data:image of an icon for the wallet.
|
|
1675
|
+
*/
|
|
1676
|
+
interface WalletInfo {
|
|
1677
|
+
walletProviderName: WalletProviderName;
|
|
1678
|
+
description?: string;
|
|
1679
|
+
icon?: string;
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* Interface representing the result of {@link Checkout.getWalletAllowList}.
|
|
1683
|
+
* @property {WalletInfo[]} wallets - A list of {@link WalletInfo} objects representing the allowed wallets.
|
|
1684
|
+
*/
|
|
1685
|
+
interface GetWalletAllowListResult {
|
|
1686
|
+
wallets: WalletInfo[];
|
|
1687
|
+
}
|
|
1688
|
+
/**
|
|
1689
|
+
* Enum representing the platform filters used in {@link GetWalletAllowListParams}.
|
|
1690
|
+
*/
|
|
1691
|
+
declare enum WalletFilterTypes {
|
|
1692
|
+
ALL = "all"
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
/**
|
|
1696
|
+
* An enum representing the type of exchange.
|
|
1697
|
+
* @enum {string}
|
|
1698
|
+
* @property {string} ONRAMP - The exchange type for transacting.
|
|
1699
|
+
*/
|
|
1700
|
+
declare enum ExchangeType {
|
|
1701
|
+
ONRAMP = "onramp"
|
|
1702
|
+
}
|
|
1703
|
+
/**
|
|
1704
|
+
* Interface representing the result of {@link Checkout.createFiatRampUrl}.
|
|
1705
|
+
* @property {ExchangeType} exchangeType - The ExchangeType specified.
|
|
1706
|
+
* @property {Web3Provider} web3Provider - The Web3Provider used to exchange.
|
|
1707
|
+
* @property {string | undefined} tokenAmount - The token amount specified as input.
|
|
1708
|
+
* @property {string | undefined} tokenAddress - The token address specified as input.
|
|
1709
|
+
* @property {Passport | undefined} passport - The Passport instance specified as input.
|
|
1710
|
+
*/
|
|
1711
|
+
interface FiatRampParams {
|
|
1712
|
+
exchangeType: ExchangeType;
|
|
1713
|
+
web3Provider: Web3Provider;
|
|
1714
|
+
tokenAmount?: string;
|
|
1715
|
+
tokenAddress?: string;
|
|
1716
|
+
passport?: any;
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
declare class HttpClient {
|
|
1720
|
+
protected config: any;
|
|
1721
|
+
protected axiosInstance: AxiosInstance;
|
|
1722
|
+
constructor(config?: CheckoutModuleConfiguration);
|
|
1723
|
+
private shouldAddPublishableKey;
|
|
1724
|
+
private setupInterceptors;
|
|
1725
|
+
request(config: AxiosRequestConfig): Promise<AxiosResponse<any, any>>;
|
|
1726
|
+
get(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse<any, any>>;
|
|
1727
|
+
post(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<any, any>>;
|
|
1728
|
+
put(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<any, any>>;
|
|
1729
|
+
delete(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<any, any>>;
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
type RemoteConfigParams = {
|
|
1733
|
+
isDevelopment: boolean;
|
|
1734
|
+
isProduction: boolean;
|
|
1735
|
+
};
|
|
1736
|
+
declare class RemoteConfigFetcher {
|
|
1737
|
+
private httpClient;
|
|
1738
|
+
private isDevelopment;
|
|
1739
|
+
private isProduction;
|
|
1740
|
+
private configCache;
|
|
1741
|
+
private tokensCache;
|
|
1742
|
+
private version;
|
|
1743
|
+
constructor(httpClient: HttpClient, params: RemoteConfigParams);
|
|
1744
|
+
private getEndpoint;
|
|
1745
|
+
private parseResponse;
|
|
1746
|
+
private loadConfig;
|
|
1747
|
+
private loadConfigTokens;
|
|
1748
|
+
getConfig(key?: keyof RemoteConfiguration): Promise<RemoteConfiguration | RemoteConfiguration[keyof RemoteConfiguration] | undefined>;
|
|
1749
|
+
getTokensConfig(chainId: ChainId): Promise<ChainTokensConfig>;
|
|
1750
|
+
getHttpClient: () => HttpClient;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
declare class CheckoutConfiguration {
|
|
1754
|
+
readonly isDevelopment: boolean;
|
|
1755
|
+
readonly isProduction: boolean;
|
|
1756
|
+
readonly isOnRampEnabled: boolean;
|
|
1757
|
+
readonly isSwapEnabled: boolean;
|
|
1758
|
+
readonly isBridgeEnabled: boolean;
|
|
1759
|
+
readonly remote: RemoteConfigFetcher;
|
|
1760
|
+
readonly environment: Environment;
|
|
1761
|
+
readonly networkMap: NetworkMap;
|
|
1762
|
+
constructor(config: CheckoutModuleConfiguration, httpClient: HttpClient);
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
interface FiatRampWidgetParams {
|
|
1766
|
+
exchangeType: ExchangeType;
|
|
1767
|
+
isPassport: boolean;
|
|
1768
|
+
walletAddress?: string;
|
|
1769
|
+
tokenAmount?: string;
|
|
1770
|
+
tokenSymbol?: string;
|
|
1771
|
+
email?: string;
|
|
1772
|
+
allowedTokens?: string[];
|
|
1773
|
+
}
|
|
1774
|
+
declare class FiatRampService {
|
|
1775
|
+
readonly config: CheckoutConfiguration;
|
|
1776
|
+
/**
|
|
1777
|
+
* Constructs a new instance of the FiatRampService class.
|
|
1778
|
+
* @param {CheckoutConfiguration} config - The config required for the FiatRampService.
|
|
1779
|
+
*/
|
|
1780
|
+
constructor(config: CheckoutConfiguration);
|
|
1781
|
+
feeEstimate(): Promise<OnRampProviderFees>;
|
|
1782
|
+
createWidgetUrl(params: FiatRampWidgetParams): Promise<string>;
|
|
1783
|
+
private getTransakWidgetUrl;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
type AvailabilityService = {
|
|
1787
|
+
checkDexAvailability: () => Promise<boolean>;
|
|
1788
|
+
};
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* Enum representing the themes for the widgets.
|
|
1792
|
+
*/
|
|
1793
|
+
declare enum WidgetTheme {
|
|
1794
|
+
LIGHT = "light",
|
|
1795
|
+
DARK = "dark"
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
/**
|
|
1799
|
+
* Widget Configuration represents the shared configuration options for the Checkout Widgets.
|
|
1800
|
+
* @property {WidgetTheme | undefined} theme
|
|
1801
|
+
* @property {WidgetLanguage | undefined} language
|
|
1802
|
+
* @property {WalletConnectConfig | undefined} walletConnect
|
|
1803
|
+
*/
|
|
1804
|
+
type WidgetConfiguration = {
|
|
1805
|
+
/** The theme of the Checkout Widget (default: "DARK") */
|
|
1806
|
+
theme?: WidgetTheme;
|
|
1807
|
+
language?: WidgetLanguage;
|
|
1808
|
+
walletConnect?: WalletConnectConfig;
|
|
1809
|
+
};
|
|
1810
|
+
/**
|
|
1811
|
+
* Widget Language represents the language options for the Checkout Widgets.
|
|
1812
|
+
*/
|
|
1813
|
+
type WidgetLanguage = 'en' | 'ja' | 'ko' | 'zh';
|
|
1814
|
+
/**
|
|
1815
|
+
* WalletConnect Config represents the configuration required to enable WalletConnect for the Checkout Widgets.
|
|
1816
|
+
*/
|
|
1817
|
+
type WalletConnectConfig = {
|
|
1818
|
+
/** WalletConnect projectId */
|
|
1819
|
+
projectId: string;
|
|
1820
|
+
/** Dapp metadata that will be displayed on wallet connection and transaction approvals. */
|
|
1821
|
+
metadata: {
|
|
1822
|
+
name: string;
|
|
1823
|
+
description: string;
|
|
1824
|
+
url: string;
|
|
1825
|
+
icons: string[];
|
|
1826
|
+
};
|
|
1827
|
+
};
|
|
1828
|
+
|
|
1829
|
+
/**
|
|
1830
|
+
* Connect Widget Configuration represents the configuration options for the Connect Widget.
|
|
1831
|
+
*/
|
|
1832
|
+
type ConnectWidgetConfiguration = {} & WidgetConfiguration;
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* Bridge Widget Configuration represents the configuration options for the Bridge Widget.
|
|
1836
|
+
*/
|
|
1837
|
+
type BridgeWidgetConfiguration = {} & WidgetConfiguration;
|
|
1838
|
+
|
|
1839
|
+
/**
|
|
1840
|
+
* Wallet Widget Configuration represents the configuration options for the Wallet Widget.
|
|
1841
|
+
* @property {boolean | undefined} showDisconnectButton
|
|
1842
|
+
* @property {boolean | undefined} showNetworkMenu
|
|
1843
|
+
*/
|
|
1844
|
+
type WalletWidgetConfiguration = {
|
|
1845
|
+
/** Show/hide the disconnect button in the Wallet Widget (defaults to true) */
|
|
1846
|
+
showDisconnectButton?: boolean;
|
|
1847
|
+
/** Show/hide the network menu in the Wallet Widget (defaults to true) */
|
|
1848
|
+
showNetworkMenu?: boolean;
|
|
1849
|
+
} & WidgetConfiguration;
|
|
1850
|
+
|
|
1851
|
+
/**
|
|
1852
|
+
* Swap Widget Configuration represents the configuration options for the Swap Widget.
|
|
1853
|
+
*/
|
|
1854
|
+
type SwapWidgetConfiguration = {} & WidgetConfiguration;
|
|
1855
|
+
|
|
1856
|
+
/**
|
|
1857
|
+
* Onramp Widget Configuration represents the configuration options for the Onramp Widget.
|
|
1858
|
+
*/
|
|
1859
|
+
type OnrampWidgetConfiguration = {} & WidgetConfiguration;
|
|
1860
|
+
|
|
1861
|
+
/**
|
|
1862
|
+
* Sale Widget Configuration represents the configuration options for the Sale Widget.
|
|
1863
|
+
*/
|
|
1864
|
+
type SaleWidgetConfiguration = {
|
|
1865
|
+
waitFulfillmentSettlements?: boolean;
|
|
1866
|
+
hideExcludedPaymentTypes?: boolean;
|
|
1867
|
+
} & WidgetConfiguration;
|
|
1868
|
+
|
|
1869
|
+
/**
|
|
1870
|
+
* Enum representing the events emitted by the widgets.
|
|
1871
|
+
*/
|
|
1872
|
+
declare enum IMTBLWidgetEvents {
|
|
1873
|
+
IMTBL_WIDGETS_PROVIDER = "imtbl-widgets-provider",
|
|
1874
|
+
IMTBL_CONNECT_WIDGET_EVENT = "imtbl-connect-widget",
|
|
1875
|
+
IMTBL_WALLET_WIDGET_EVENT = "imtbl-wallet-widget",
|
|
1876
|
+
IMTBL_SWAP_WIDGET_EVENT = "imtbl-swap-widget",
|
|
1877
|
+
IMTBL_BRIDGE_WIDGET_EVENT = "imtbl-bridge-widget",
|
|
1878
|
+
IMTBL_ONRAMP_WIDGET_EVENT = "imtbl-onramp-widget",
|
|
1879
|
+
IMTBL_SALE_WIDGET_EVENT = "imtbl-sale-widget"
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Enum for events raised for about provider objects
|
|
1883
|
+
*/
|
|
1884
|
+
declare enum ProviderEventType {
|
|
1885
|
+
PROVIDER_UPDATED = "PROVIDER_UPDATED"
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* Payload type for the PROVIDER_UPDATED event
|
|
1889
|
+
*/
|
|
1890
|
+
type ProviderUpdated = {
|
|
1891
|
+
provider: Web3Provider;
|
|
1892
|
+
};
|
|
1893
|
+
/**
|
|
1894
|
+
* Payload type for the LANGUAGE_CHANGED event
|
|
1895
|
+
*/
|
|
1896
|
+
type LanguageChanged = {
|
|
1897
|
+
language: WidgetLanguage;
|
|
1898
|
+
};
|
|
1899
|
+
|
|
1900
|
+
/**
|
|
1901
|
+
* Enum representing possible Connect Widget event types.
|
|
1902
|
+
*/
|
|
1903
|
+
declare enum ConnectEventType {
|
|
1904
|
+
CLOSE_WIDGET = "close-widget",
|
|
1905
|
+
SUCCESS = "success",
|
|
1906
|
+
FAILURE = "failure",
|
|
1907
|
+
LANGUAGE_CHANGED = "language-changed",
|
|
1908
|
+
WALLETCONNECT_PROVIDER_UPDATED = "walletconnect-provider-updated"
|
|
1909
|
+
}
|
|
1910
|
+
/**
|
|
1911
|
+
* Represents a successful connection.
|
|
1912
|
+
* @property {Web3Provider} provider
|
|
1913
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
1914
|
+
*/
|
|
1915
|
+
type ConnectionSuccess = {
|
|
1916
|
+
/** The connected provider. */
|
|
1917
|
+
provider: Web3Provider;
|
|
1918
|
+
/** The wallet provider name of the connected provider. */
|
|
1919
|
+
walletProviderName: WalletProviderName | undefined;
|
|
1920
|
+
/** The wallet provider EIP-6963 metadata. */
|
|
1921
|
+
walletProviderInfo: EIP6963ProviderInfo | undefined;
|
|
1922
|
+
};
|
|
1923
|
+
/**
|
|
1924
|
+
* Represents a connection failure with a reason.
|
|
1925
|
+
* @property {string} reason
|
|
1926
|
+
*/
|
|
1927
|
+
type ConnectionFailed = {
|
|
1928
|
+
/** The reason for the failed connection. */
|
|
1929
|
+
reason: string;
|
|
1930
|
+
};
|
|
1931
|
+
type WalletConnectProviderChanged = {
|
|
1932
|
+
ethereumProvider: any;
|
|
1933
|
+
walletConnectManager: WalletConnectManager;
|
|
1934
|
+
};
|
|
1935
|
+
/**
|
|
1936
|
+
* Provides access to the underlying WalletConnect modal and provider.
|
|
1937
|
+
*/
|
|
1938
|
+
interface WalletConnectManager {
|
|
1939
|
+
isInitialised: () => boolean;
|
|
1940
|
+
isEnabled: () => boolean;
|
|
1941
|
+
getModal: () => any;
|
|
1942
|
+
getProvider: () => Promise<any>;
|
|
1943
|
+
loadWalletListings: () => Promise<Response | undefined>;
|
|
1944
|
+
getWalletLogoUrl: (walletSlug?: string) => Promise<string | undefined>;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
/**
|
|
1948
|
+
* Enum representing possible Wallet Widget event types.
|
|
1949
|
+
*/
|
|
1950
|
+
declare enum WalletEventType {
|
|
1951
|
+
CLOSE_WIDGET = "close-widget",
|
|
1952
|
+
NETWORK_SWITCH = "network-switch",
|
|
1953
|
+
DISCONNECT_WALLET = "disconnect-wallet",
|
|
1954
|
+
LANGUAGE_CHANGED = "language-changed"
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Represents an event that is triggered when the user switches the network in their wallet.
|
|
1958
|
+
* @property {string} network
|
|
1959
|
+
* @property {number} chainId
|
|
1960
|
+
* @property {Web3Provider} provider
|
|
1961
|
+
*/
|
|
1962
|
+
type WalletNetworkSwitch = {
|
|
1963
|
+
/** The name of the network that the user switched to. */
|
|
1964
|
+
network: string;
|
|
1965
|
+
/** The chain ID of the network that the user switched to. */
|
|
1966
|
+
chainId: number;
|
|
1967
|
+
/** The Web3 provider object for the switched network. */
|
|
1968
|
+
provider: Web3Provider;
|
|
1969
|
+
};
|
|
1970
|
+
/**
|
|
1971
|
+
* Represents an event that is triggered when a wallet is disconnected.
|
|
1972
|
+
*/
|
|
1973
|
+
type WalletDisconnect = {};
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Enum representing possible Swap Widget event types.
|
|
1977
|
+
*/
|
|
1978
|
+
declare enum SwapEventType {
|
|
1979
|
+
CLOSE_WIDGET = "close-widget",
|
|
1980
|
+
SUCCESS = "success",
|
|
1981
|
+
FAILURE = "failure",
|
|
1982
|
+
REJECTED = "rejected",
|
|
1983
|
+
LANGUAGE_CHANGED = "language-changed"
|
|
1984
|
+
}
|
|
1985
|
+
/**
|
|
1986
|
+
* Represents a successful swap transaction.
|
|
1987
|
+
* @property {string} transactionHash
|
|
1988
|
+
*/
|
|
1989
|
+
type SwapSuccess = {
|
|
1990
|
+
/** The hash of the successful transaction. */
|
|
1991
|
+
transactionHash: string;
|
|
1992
|
+
};
|
|
1993
|
+
/**
|
|
1994
|
+
* Type representing a Swap Widget with type FAILURE.
|
|
1995
|
+
* @property {string} reason
|
|
1996
|
+
* @property {number} timestamp
|
|
1997
|
+
*/
|
|
1998
|
+
type SwapFailed = {
|
|
1999
|
+
/** The reason why the swap failed. */
|
|
2000
|
+
reason: string;
|
|
2001
|
+
/** The timestamp of the failed swap. */
|
|
2002
|
+
timestamp: number;
|
|
2003
|
+
};
|
|
2004
|
+
/**
|
|
2005
|
+
* Type representing a Swap Widget with type REJECTED.
|
|
2006
|
+
* @property {string} reason -
|
|
2007
|
+
* @property {number} timestamp -
|
|
2008
|
+
*/
|
|
2009
|
+
type SwapRejected = {
|
|
2010
|
+
/** The reason why the swap failed. */
|
|
2011
|
+
reason: string;
|
|
2012
|
+
/** The timestamp of the failed swap. */
|
|
2013
|
+
timestamp: number;
|
|
2014
|
+
};
|
|
2015
|
+
|
|
2016
|
+
/**
|
|
2017
|
+
* Enum representing possible Sale Widget event types.
|
|
2018
|
+
*/
|
|
2019
|
+
declare enum SaleEventType {
|
|
2020
|
+
CLOSE_WIDGET = "close-widget",
|
|
2021
|
+
SUCCESS = "success",
|
|
2022
|
+
FAILURE = "failure",
|
|
2023
|
+
REJECTED = "rejected",
|
|
2024
|
+
TRANSACTION_SUCCESS = "transaction-success",
|
|
2025
|
+
LANGUAGE_CHANGED = "language-changed",
|
|
2026
|
+
PAYMENT_METHOD = "payment-method",
|
|
2027
|
+
REQUEST_BRIDGE = "request-bridge",
|
|
2028
|
+
REQUEST_ONRAMP = "request-onramp",
|
|
2029
|
+
REQUEST_SWAP = "request-swap",
|
|
2030
|
+
PAYMENT_TOKEN = "payment-token"
|
|
2031
|
+
}
|
|
2032
|
+
/**
|
|
2033
|
+
* Represents a successful Sale transaction.
|
|
2034
|
+
* @property {Array} transactions -
|
|
2035
|
+
*/
|
|
2036
|
+
type SaleSuccess = {
|
|
2037
|
+
/** Chosen payment method */
|
|
2038
|
+
paymentMethod: SalePaymentTypes | undefined;
|
|
2039
|
+
/** The minted items token ids */
|
|
2040
|
+
tokenIds: string[];
|
|
2041
|
+
/** The executed transactions */
|
|
2042
|
+
transactions: {
|
|
2043
|
+
method: string;
|
|
2044
|
+
hash: string | undefined;
|
|
2045
|
+
}[];
|
|
2046
|
+
/** The order reference id, use it to trace order throughout flow */
|
|
2047
|
+
transactionId: string;
|
|
2048
|
+
[key: string]: unknown;
|
|
2049
|
+
};
|
|
2050
|
+
/**
|
|
2051
|
+
* Type representing a Sale Widget with type FAILURE.
|
|
2052
|
+
* @property {string} reason
|
|
2053
|
+
* @property {number} timestamp
|
|
2054
|
+
* @property {Array} transactions
|
|
2055
|
+
*/
|
|
2056
|
+
type SaleFailed = {
|
|
2057
|
+
/** The reason why sale transaction failed. */
|
|
2058
|
+
reason: string;
|
|
2059
|
+
/** The error object. */
|
|
2060
|
+
error: Record<string, unknown>;
|
|
2061
|
+
/** The timestamp of the failed swap. */
|
|
2062
|
+
timestamp: number;
|
|
2063
|
+
/** Chosen payment method */
|
|
2064
|
+
paymentMethod: SalePaymentTypes | undefined;
|
|
2065
|
+
/** The executed transactions */
|
|
2066
|
+
transactions: {
|
|
2067
|
+
method: string;
|
|
2068
|
+
hash: string | undefined;
|
|
2069
|
+
}[];
|
|
2070
|
+
/** The order reference id, use it to trace order throughout flow */
|
|
2071
|
+
transactionId: string;
|
|
2072
|
+
};
|
|
2073
|
+
/**
|
|
2074
|
+
* Type representing a Sale Widget with type TRANSACTION_SUCCESS.
|
|
2075
|
+
* @property {Object} transactions
|
|
2076
|
+
*/
|
|
2077
|
+
type SaleTransactionSuccess = {
|
|
2078
|
+
paymentMethod: SalePaymentTypes | undefined;
|
|
2079
|
+
/** The executed transactions */
|
|
2080
|
+
transactions: {
|
|
2081
|
+
method: string;
|
|
2082
|
+
hash: string | undefined;
|
|
2083
|
+
}[];
|
|
2084
|
+
};
|
|
2085
|
+
/**
|
|
2086
|
+
* Type representing a Sale Widget with type PAYMENT_METHOD.
|
|
2087
|
+
* @property {Object} transactions
|
|
2088
|
+
*/
|
|
2089
|
+
type SalePaymentMethod = {
|
|
2090
|
+
/** Chosen payment method */
|
|
2091
|
+
paymentMethod: SalePaymentTypes | undefined;
|
|
2092
|
+
};
|
|
2093
|
+
/**
|
|
2094
|
+
* Type representing a Sale Widget with type PAYMENT_TOKEN.
|
|
2095
|
+
* @property {Object} transactions
|
|
2096
|
+
*/
|
|
2097
|
+
type SalePaymentToken = {
|
|
2098
|
+
/** Chosen payment token */
|
|
2099
|
+
type: string;
|
|
2100
|
+
token: TokenInfo;
|
|
2101
|
+
amount: string;
|
|
2102
|
+
balance: string;
|
|
2103
|
+
fiat: {
|
|
2104
|
+
amount: string;
|
|
2105
|
+
balance: string;
|
|
2106
|
+
symbol: string;
|
|
2107
|
+
};
|
|
2108
|
+
};
|
|
2109
|
+
/**
|
|
2110
|
+
* Enum representing Sale Widget available payment types.
|
|
2111
|
+
*/
|
|
2112
|
+
declare enum SalePaymentTypes {
|
|
2113
|
+
CRYPTO = "crypto",
|
|
2114
|
+
DEBIT = "debit",
|
|
2115
|
+
CREDIT = "credit"
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
/**
|
|
2119
|
+
* Enum of possible Bridge Widget event types.
|
|
2120
|
+
*/
|
|
2121
|
+
declare enum BridgeEventType {
|
|
2122
|
+
CLOSE_WIDGET = "close-widget",
|
|
2123
|
+
FAILURE = "failure",
|
|
2124
|
+
TRANSACTION_SENT = "transaction-sent",
|
|
2125
|
+
LANGUAGE_CHANGED = "language-changed",
|
|
2126
|
+
CLAIM_WITHDRAWAL_SUCCESS = "claim-withdrawal-success",
|
|
2127
|
+
CLAIM_WITHDRAWAL_FAILURE = "claim-withdrawal-failure"
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Represents a successful bridge transaction.
|
|
2131
|
+
* @property {string} transactionHash
|
|
2132
|
+
*/
|
|
2133
|
+
type BridgeTransactionSent = {
|
|
2134
|
+
/** The hash of the successful transaction. */
|
|
2135
|
+
transactionHash: string;
|
|
2136
|
+
};
|
|
2137
|
+
/**
|
|
2138
|
+
* Represents a failed bridge transaction.
|
|
2139
|
+
* @property {string} reason
|
|
2140
|
+
* @property {number} timestamp
|
|
2141
|
+
*/
|
|
2142
|
+
type BridgeFailed = {
|
|
2143
|
+
/** The reason for the failed transaction. */
|
|
2144
|
+
reason: string;
|
|
2145
|
+
/** The timestamp of the failed transaction. */
|
|
2146
|
+
timestamp: number;
|
|
2147
|
+
};
|
|
2148
|
+
/**
|
|
2149
|
+
* Represents a successful bridge claim withdrawal.
|
|
2150
|
+
* @property {string} transactionHash
|
|
2151
|
+
*/
|
|
2152
|
+
type BridgeClaimWithdrawalSuccess = {
|
|
2153
|
+
/** The hash of the successful transaction. */
|
|
2154
|
+
transactionHash: string;
|
|
2155
|
+
};
|
|
2156
|
+
/**
|
|
2157
|
+
* Represents a failed bridge claim withdrawal.
|
|
2158
|
+
* @property {string} transactionHash
|
|
2159
|
+
* @property {string} reason
|
|
2160
|
+
* @property {number} timestamp
|
|
2161
|
+
*/
|
|
2162
|
+
type BridgeClaimWithdrawalFailed = {
|
|
2163
|
+
/** The hash of the failed transaction. */
|
|
2164
|
+
transactionHash: string;
|
|
2165
|
+
/** The reason for the failed transaction. */
|
|
2166
|
+
reason: string;
|
|
2167
|
+
/** The timestamp of the failed transaction. */
|
|
2168
|
+
timestamp: number;
|
|
2169
|
+
};
|
|
2170
|
+
|
|
2171
|
+
/**
|
|
2172
|
+
* Enum representing different types of orchestration events.
|
|
2173
|
+
*/
|
|
2174
|
+
declare enum OrchestrationEventType {
|
|
2175
|
+
REQUEST_CONNECT = "request-connect",
|
|
2176
|
+
REQUEST_WALLET = "request-wallet",
|
|
2177
|
+
REQUEST_SWAP = "request-swap",
|
|
2178
|
+
REQUEST_BRIDGE = "request-bridge",
|
|
2179
|
+
REQUEST_ONRAMP = "request-onramp"
|
|
2180
|
+
}
|
|
2181
|
+
/**
|
|
2182
|
+
* Represents the connect event object when the connect widget is requested.
|
|
2183
|
+
* @property {string} walletProviderName
|
|
2184
|
+
*/
|
|
2185
|
+
type RequestConnectEvent = {
|
|
2186
|
+
/** The wallet provider name. */
|
|
2187
|
+
walletProviderName: string;
|
|
2188
|
+
};
|
|
2189
|
+
/**
|
|
2190
|
+
* Represents the wallet event object when the wallet widget is requested.
|
|
2191
|
+
* @property {string} walletProviderName
|
|
2192
|
+
*/
|
|
2193
|
+
type RequestWalletEvent = {
|
|
2194
|
+
/** The wallet provider name. */
|
|
2195
|
+
walletProviderName: string;
|
|
2196
|
+
};
|
|
2197
|
+
/**
|
|
2198
|
+
* Represents the swap event object when the swap widget is requested.
|
|
2199
|
+
* @property {string} fromTokenAddress
|
|
2200
|
+
* @property {string} toTokenAddress
|
|
2201
|
+
* @property {string} amount
|
|
2202
|
+
*/
|
|
2203
|
+
type RequestSwapEvent = {
|
|
2204
|
+
/** The address of the token to swap from. */
|
|
2205
|
+
fromTokenAddress: string;
|
|
2206
|
+
/** The address of the token to swap to. */
|
|
2207
|
+
toTokenAddress: string;
|
|
2208
|
+
/** The amount of from tokens to swap. */
|
|
2209
|
+
amount: string;
|
|
2210
|
+
};
|
|
2211
|
+
/**
|
|
2212
|
+
* Represents the bridge event object when the bridge widget is requested.
|
|
2213
|
+
* @property {string} tokenAddress
|
|
2214
|
+
* @property {string} amount
|
|
2215
|
+
*/
|
|
2216
|
+
type RequestBridgeEvent = {
|
|
2217
|
+
/** The address of the token to bridge. */
|
|
2218
|
+
tokenAddress: string;
|
|
2219
|
+
/** The amount of tokens to bridge. */
|
|
2220
|
+
amount: string;
|
|
2221
|
+
};
|
|
2222
|
+
/**
|
|
2223
|
+
* Represents the onramp event object when the onramp widget is requested.
|
|
2224
|
+
* @property {string} tokenAddress
|
|
2225
|
+
* @property {string} amount
|
|
2226
|
+
*/
|
|
2227
|
+
type RequestOnrampEvent = {
|
|
2228
|
+
/** The address of the token to be used for onramp. */
|
|
2229
|
+
tokenAddress: string;
|
|
2230
|
+
/** The amount of tokens to onramp. */
|
|
2231
|
+
amount: string;
|
|
2232
|
+
};
|
|
2233
|
+
type OrchestrationEventData = RequestConnectEvent | RequestWalletEvent | RequestSwapEvent | RequestBridgeEvent | RequestOnrampEvent;
|
|
2234
|
+
|
|
2235
|
+
/**
|
|
2236
|
+
* Enum of possible OnRamp Widget event types.
|
|
2237
|
+
*/
|
|
2238
|
+
declare enum OnRampEventType {
|
|
2239
|
+
CLOSE_WIDGET = "close-widget",
|
|
2240
|
+
SUCCESS = "success",
|
|
2241
|
+
FAILURE = "failure",
|
|
2242
|
+
LANGUAGE_CHANGED = "language-changed"
|
|
2243
|
+
}
|
|
2244
|
+
/**
|
|
2245
|
+
* Represents a successful on-ramp transaction.
|
|
2246
|
+
* @property {string} transactionHash
|
|
2247
|
+
*/
|
|
2248
|
+
type OnRampSuccess = {
|
|
2249
|
+
/** The transaction hash of the successful transaction. */
|
|
2250
|
+
transactionHash: string;
|
|
2251
|
+
};
|
|
2252
|
+
/**
|
|
2253
|
+
* Type representing a On-ramp Widget with type FAILURE.
|
|
2254
|
+
* @property {string} reason
|
|
2255
|
+
* @property {number} timestamp
|
|
2256
|
+
*/
|
|
2257
|
+
type OnRampFailed = {
|
|
2258
|
+
/** The reason why the on-ramp failed. */
|
|
2259
|
+
reason: string;
|
|
2260
|
+
/** The timestamp of the failed transaction. */
|
|
2261
|
+
timestamp: number;
|
|
2262
|
+
};
|
|
2263
|
+
|
|
2264
|
+
declare enum ConnectTargetLayer {
|
|
2265
|
+
LAYER1 = "LAYER1",
|
|
2266
|
+
LAYER2 = "LAYER2"
|
|
2267
|
+
}
|
|
2268
|
+
type ConnectWidgetParams = {
|
|
2269
|
+
/** The language to use for the connect widget */
|
|
2270
|
+
language?: WidgetLanguage;
|
|
2271
|
+
/** The target chain to connect to as part of the connection process (defaults to Immutable zkEVM / Immutable zkEVM Testnet) */
|
|
2272
|
+
targetChainId?: ChainId;
|
|
2273
|
+
/** The target wallet to establish a connection with */
|
|
2274
|
+
targetWalletRdns?: string | WalletProviderRdns;
|
|
2275
|
+
/** List of wallets rdns to exclude from the connect widget */
|
|
2276
|
+
blocklistWalletRdns?: string[];
|
|
2277
|
+
};
|
|
2278
|
+
|
|
2279
|
+
/**
|
|
2280
|
+
* Bridge Widget parameters
|
|
2281
|
+
* @property {string | undefined} tokenAddress
|
|
2282
|
+
* @property {string | undefined} amount
|
|
2283
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
2284
|
+
*/
|
|
2285
|
+
type BridgeWidgetParams = {
|
|
2286
|
+
/** The contract address of the token to bridge from, used to populate the bridge form token field */
|
|
2287
|
+
tokenAddress?: string;
|
|
2288
|
+
/** The formatted amount to bridge, used to populate the bridge form amount field */
|
|
2289
|
+
amount?: string;
|
|
2290
|
+
/** The wallet provider name to use for the bridge widget */
|
|
2291
|
+
walletProviderName?: WalletProviderName;
|
|
2292
|
+
/** The language to use for the bridge widget */
|
|
2293
|
+
language?: WidgetLanguage;
|
|
2294
|
+
};
|
|
2295
|
+
|
|
2296
|
+
/**
|
|
2297
|
+
* Wallet Widget parameters
|
|
2298
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
2299
|
+
*/
|
|
2300
|
+
type WalletWidgetParams = {
|
|
2301
|
+
/** The wallet provider name to use for the wallet widget */
|
|
2302
|
+
walletProviderName?: WalletProviderName;
|
|
2303
|
+
/** The language to use for the wallet widget */
|
|
2304
|
+
language?: WidgetLanguage;
|
|
2305
|
+
};
|
|
2306
|
+
|
|
2307
|
+
/**
|
|
2308
|
+
* Swap Widget parameters
|
|
2309
|
+
* @property {string | undefined} amount
|
|
2310
|
+
* @property {string | undefined} fromTokenAddress
|
|
2311
|
+
* @property {string | undefined} toTokenAddress
|
|
2312
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
2313
|
+
*/
|
|
2314
|
+
type SwapWidgetParams = {
|
|
2315
|
+
/** The formatted amount to swap, used to populate the swap from amount field */
|
|
2316
|
+
amount?: string;
|
|
2317
|
+
/** The contract address of the token to swap from */
|
|
2318
|
+
fromTokenAddress?: string;
|
|
2319
|
+
/** The contract address of the token to swap to */
|
|
2320
|
+
toTokenAddress?: string;
|
|
2321
|
+
/** The wallet provider name to use for the swap widget */
|
|
2322
|
+
walletProviderName?: WalletProviderName;
|
|
2323
|
+
/** The language to use for the swap widget */
|
|
2324
|
+
language?: WidgetLanguage;
|
|
2325
|
+
};
|
|
2326
|
+
|
|
2327
|
+
/**
|
|
2328
|
+
* OnRamp Widget parameters
|
|
2329
|
+
* @property {string | undefined} tokenAddress
|
|
2330
|
+
* @property {string | undefined} amount
|
|
2331
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
2332
|
+
*/
|
|
2333
|
+
type OnRampWidgetParams = {
|
|
2334
|
+
/** The contract address of the token to onramp */
|
|
2335
|
+
tokenAddress?: string;
|
|
2336
|
+
/** The formatted amount to onramp, used to populate the onramp form amount field */
|
|
2337
|
+
amount?: string;
|
|
2338
|
+
/** The wallet provider name to use for the onramp widget */
|
|
2339
|
+
walletProviderName?: WalletProviderName;
|
|
2340
|
+
/** The language to use for the onramp widget */
|
|
2341
|
+
language?: WidgetLanguage;
|
|
2342
|
+
};
|
|
2343
|
+
|
|
2344
|
+
/**
|
|
2345
|
+
* Sale Widget parameters
|
|
2346
|
+
* @property {string} amount
|
|
2347
|
+
* @property {string} environmentId
|
|
2348
|
+
* @property {SaleItem[]} items
|
|
2349
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
2350
|
+
*/
|
|
2351
|
+
type SaleWidgetParams = {
|
|
2352
|
+
/** Environment id from Immutable Hub */
|
|
2353
|
+
environmentId?: string;
|
|
2354
|
+
/** The list of products to be purchased */
|
|
2355
|
+
items?: SaleItem[];
|
|
2356
|
+
/** The name of the NFT collection on sale */
|
|
2357
|
+
collectionName?: string;
|
|
2358
|
+
/** The wallet provider name to default to if no web3Provider is passed */
|
|
2359
|
+
walletProviderName?: WalletProviderName;
|
|
2360
|
+
/** The language to use for the sales widget */
|
|
2361
|
+
language?: WidgetLanguage;
|
|
2362
|
+
/** The disabled payment types */
|
|
2363
|
+
excludePaymentTypes?: SalePaymentTypes[];
|
|
2364
|
+
/** Preferred currency, replacing the backend's base currency */
|
|
2365
|
+
preferredCurrency?: string;
|
|
2366
|
+
};
|
|
2367
|
+
/**
|
|
2368
|
+
* A product to be purchased
|
|
2369
|
+
* @property {string} productId
|
|
2370
|
+
* @property {number} qty
|
|
2371
|
+
* @property {string} name
|
|
2372
|
+
* @property {string} image
|
|
2373
|
+
* @property {string} description
|
|
2374
|
+
*/
|
|
2375
|
+
type SaleItem = {
|
|
2376
|
+
/** The id of the product */
|
|
2377
|
+
productId: string;
|
|
2378
|
+
/** The quantity to be purchased */
|
|
2379
|
+
qty: number;
|
|
2380
|
+
/** The name of the item */
|
|
2381
|
+
name: string;
|
|
2382
|
+
/** The image url of the item */
|
|
2383
|
+
image: string;
|
|
2384
|
+
/** The description of the item */
|
|
2385
|
+
description: string;
|
|
2386
|
+
};
|
|
2387
|
+
|
|
2388
|
+
/**
|
|
2389
|
+
* Enum representing the list of widget types.
|
|
2390
|
+
*/
|
|
2391
|
+
declare enum WidgetType {
|
|
2392
|
+
CONNECT = "connect",
|
|
2393
|
+
WALLET = "wallet",
|
|
2394
|
+
SWAP = "swap",
|
|
2395
|
+
BRIDGE = "bridge",
|
|
2396
|
+
ONRAMP = "onramp",
|
|
2397
|
+
SALE = "sale"
|
|
2398
|
+
}
|
|
2399
|
+
/**
|
|
2400
|
+
* Widget properties definition for each widget. Used for creating and updating widgets
|
|
2401
|
+
*/
|
|
2402
|
+
type WidgetProperties<T extends WidgetType> = {
|
|
2403
|
+
config?: WidgetConfigurations[T];
|
|
2404
|
+
provider?: Web3Provider;
|
|
2405
|
+
};
|
|
2406
|
+
type WidgetConfigurations = {
|
|
2407
|
+
[WidgetType.CONNECT]: ConnectWidgetConfiguration;
|
|
2408
|
+
[WidgetType.WALLET]: WalletWidgetConfiguration;
|
|
2409
|
+
[WidgetType.SWAP]: SwapWidgetConfiguration;
|
|
2410
|
+
[WidgetType.BRIDGE]: BridgeWidgetConfiguration;
|
|
2411
|
+
[WidgetType.ONRAMP]: OnrampWidgetConfiguration;
|
|
2412
|
+
[WidgetType.SALE]: SaleWidgetConfiguration;
|
|
2413
|
+
};
|
|
2414
|
+
type WidgetParameters = {
|
|
2415
|
+
[WidgetType.CONNECT]: ConnectWidgetParams;
|
|
2416
|
+
[WidgetType.WALLET]: WalletWidgetParams;
|
|
2417
|
+
[WidgetType.SWAP]: SwapWidgetParams;
|
|
2418
|
+
[WidgetType.BRIDGE]: BridgeWidgetParams;
|
|
2419
|
+
[WidgetType.ONRAMP]: OnRampWidgetParams;
|
|
2420
|
+
[WidgetType.SALE]: SaleWidgetParams;
|
|
2421
|
+
};
|
|
2422
|
+
/**
|
|
2423
|
+
* Represents all the possible event types that are emitted by the widgets.
|
|
2424
|
+
*/
|
|
2425
|
+
type WidgetEventTypes = {
|
|
2426
|
+
[WidgetType.CONNECT]: ConnectEventType | OrchestrationEventType;
|
|
2427
|
+
[WidgetType.WALLET]: WalletEventType | OrchestrationEventType;
|
|
2428
|
+
[WidgetType.SWAP]: SwapEventType | OrchestrationEventType;
|
|
2429
|
+
[WidgetType.BRIDGE]: BridgeEventType | OrchestrationEventType;
|
|
2430
|
+
[WidgetType.ONRAMP]: OnRampEventType | OrchestrationEventType;
|
|
2431
|
+
[WidgetType.SALE]: SaleEventType | OrchestrationEventType;
|
|
2432
|
+
};
|
|
2433
|
+
type OrchestrationMapping = {
|
|
2434
|
+
[OrchestrationEventType.REQUEST_CONNECT]: RequestConnectEvent;
|
|
2435
|
+
[OrchestrationEventType.REQUEST_WALLET]: RequestWalletEvent;
|
|
2436
|
+
[OrchestrationEventType.REQUEST_SWAP]: RequestSwapEvent;
|
|
2437
|
+
[OrchestrationEventType.REQUEST_BRIDGE]: RequestBridgeEvent;
|
|
2438
|
+
[OrchestrationEventType.REQUEST_ONRAMP]: RequestOnrampEvent;
|
|
2439
|
+
};
|
|
2440
|
+
type ProviderEventMapping = {
|
|
2441
|
+
[ProviderEventType.PROVIDER_UPDATED]: ProviderUpdated;
|
|
2442
|
+
};
|
|
2443
|
+
/**
|
|
2444
|
+
* Mapping of widget type, to each of it's events and then each event's payload
|
|
2445
|
+
* Update this whenever a new event is created and used by a widget
|
|
2446
|
+
* Each widget also has all of the orchestration events
|
|
2447
|
+
*/
|
|
2448
|
+
type WidgetEventData = {
|
|
2449
|
+
[WidgetType.CONNECT]: {
|
|
2450
|
+
[ConnectEventType.SUCCESS]: ConnectionSuccess;
|
|
2451
|
+
[ConnectEventType.FAILURE]: ConnectionFailed;
|
|
2452
|
+
[ConnectEventType.CLOSE_WIDGET]: {};
|
|
2453
|
+
[ConnectEventType.WALLETCONNECT_PROVIDER_UPDATED]: WalletConnectProviderChanged;
|
|
2454
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
2455
|
+
[WidgetType.WALLET]: {
|
|
2456
|
+
[WalletEventType.NETWORK_SWITCH]: WalletNetworkSwitch;
|
|
2457
|
+
[WalletEventType.DISCONNECT_WALLET]: WalletDisconnect;
|
|
2458
|
+
[WalletEventType.CLOSE_WIDGET]: {};
|
|
2459
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
2460
|
+
[WidgetType.SWAP]: {
|
|
2461
|
+
[SwapEventType.SUCCESS]: SwapSuccess;
|
|
2462
|
+
[SwapEventType.FAILURE]: SwapFailed;
|
|
2463
|
+
[SwapEventType.REJECTED]: SwapRejected;
|
|
2464
|
+
[SwapEventType.CLOSE_WIDGET]: {};
|
|
2465
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
2466
|
+
[WidgetType.BRIDGE]: {
|
|
2467
|
+
[BridgeEventType.TRANSACTION_SENT]: BridgeTransactionSent;
|
|
2468
|
+
[BridgeEventType.FAILURE]: BridgeFailed;
|
|
2469
|
+
[BridgeEventType.CLOSE_WIDGET]: {};
|
|
2470
|
+
[BridgeEventType.CLAIM_WITHDRAWAL_SUCCESS]: BridgeClaimWithdrawalSuccess;
|
|
2471
|
+
[BridgeEventType.CLAIM_WITHDRAWAL_FAILURE]: BridgeClaimWithdrawalFailed;
|
|
2472
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
2473
|
+
[WidgetType.ONRAMP]: {
|
|
2474
|
+
[OnRampEventType.SUCCESS]: OnRampSuccess;
|
|
2475
|
+
[OnRampEventType.FAILURE]: OnRampFailed;
|
|
2476
|
+
[OnRampEventType.CLOSE_WIDGET]: {};
|
|
2477
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
2478
|
+
[WidgetType.SALE]: {
|
|
2479
|
+
[SaleEventType.SUCCESS]: SaleSuccess;
|
|
2480
|
+
[SaleEventType.FAILURE]: SaleFailed;
|
|
2481
|
+
[SaleEventType.REJECTED]: any;
|
|
2482
|
+
[SaleEventType.CLOSE_WIDGET]: {};
|
|
2483
|
+
[SaleEventType.TRANSACTION_SUCCESS]: SaleTransactionSuccess;
|
|
2484
|
+
[SaleEventType.PAYMENT_METHOD]: SalePaymentMethod;
|
|
2485
|
+
[SaleEventType.PAYMENT_TOKEN]: SalePaymentToken;
|
|
2486
|
+
[SaleEventType.REQUEST_BRIDGE]: {};
|
|
2487
|
+
[SaleEventType.REQUEST_SWAP]: {};
|
|
2488
|
+
[SaleEventType.REQUEST_ONRAMP]: {};
|
|
2489
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
2490
|
+
};
|
|
2491
|
+
/**
|
|
2492
|
+
* Represents an event emitted by a widget. The event type should match the event data
|
|
2493
|
+
*/
|
|
2494
|
+
/**
|
|
2495
|
+
* Represents an event emitted by a widget.
|
|
2496
|
+
* @template T - The widget type
|
|
2497
|
+
* @template KEventName - The widget event name.
|
|
2498
|
+
* @property {KEventName} type - The type of the event.
|
|
2499
|
+
* @property {WidgetEventData[T][KEventName]} data - The data associated with the widget event.
|
|
2500
|
+
*/
|
|
2501
|
+
type WidgetEvent<T extends WidgetType, KEventName extends keyof WidgetEventData[T]> = {
|
|
2502
|
+
type: KEventName;
|
|
2503
|
+
data: WidgetEventData[T][KEventName];
|
|
2504
|
+
};
|
|
2505
|
+
/**
|
|
2506
|
+
* Represents an event emitted by a widget.
|
|
2507
|
+
* @template KEventName - The orchestration event name.
|
|
2508
|
+
* @property {KEventName} type
|
|
2509
|
+
* @property {OrchestrationMapping[KEventName]} data
|
|
2510
|
+
*/
|
|
2511
|
+
type OrchestrationEvent<KEventName extends keyof OrchestrationMapping> = {
|
|
2512
|
+
/** The type of the event. */
|
|
2513
|
+
type: KEventName;
|
|
2514
|
+
/** The data associated with the event. */
|
|
2515
|
+
data: OrchestrationMapping[KEventName];
|
|
2516
|
+
};
|
|
2517
|
+
/**
|
|
2518
|
+
* Represents an event emitted by a widget.
|
|
2519
|
+
* @template KEventName - The provider event name.
|
|
2520
|
+
* @property {KEventName} type
|
|
2521
|
+
* @property {ProviderEventMapping[KEventName]} data
|
|
2522
|
+
*/
|
|
2523
|
+
type ProviderEvent<KEventName extends keyof ProviderEventMapping> = {
|
|
2524
|
+
/** The type of the event. */
|
|
2525
|
+
type: KEventName;
|
|
2526
|
+
/** The data associated with the event. */
|
|
2527
|
+
data: ProviderEventMapping[KEventName];
|
|
2528
|
+
};
|
|
2529
|
+
interface IWidgetsFactory {
|
|
2530
|
+
/**
|
|
2531
|
+
* Create a new widget instance.
|
|
2532
|
+
* @param type widget type to instantiate.
|
|
2533
|
+
* @param props widget configurations and provider.
|
|
2534
|
+
*/
|
|
2535
|
+
create<T extends WidgetType>(type: T, props?: WidgetProperties<T>): Widget<T>;
|
|
2536
|
+
/**
|
|
2537
|
+
* Update the widgets provider instance.
|
|
2538
|
+
* @param provider the provider instance to update all widgets.
|
|
2539
|
+
*/
|
|
2540
|
+
updateProvider(provider: Web3Provider): void;
|
|
2541
|
+
}
|
|
2542
|
+
/**
|
|
2543
|
+
* Widget interface. Every widget implements this interface.
|
|
2544
|
+
*/
|
|
2545
|
+
interface Widget<T extends WidgetType> {
|
|
2546
|
+
/**
|
|
2547
|
+
* Mount a widget to a DOM ref element.
|
|
2548
|
+
* @param id ID of the DOM element where the widget will be mounted.
|
|
2549
|
+
* @param params widget parameters.
|
|
2550
|
+
*/
|
|
2551
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
2552
|
+
/**
|
|
2553
|
+
* Unmount a widget and reset parameters
|
|
2554
|
+
*/
|
|
2555
|
+
unmount(): void;
|
|
2556
|
+
/**
|
|
2557
|
+
* Update the widget properties
|
|
2558
|
+
* @param props Widget specific properties including configuration
|
|
2559
|
+
*/
|
|
2560
|
+
update(props: WidgetProperties<T>): void;
|
|
2561
|
+
/**
|
|
2562
|
+
* Add a listener for a widget event.
|
|
2563
|
+
* @param event Widget specific event name.
|
|
2564
|
+
* @param callback function to execute when the event is received.
|
|
2565
|
+
*/
|
|
2566
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
2567
|
+
/**
|
|
2568
|
+
* Removes an event listener for a widget event.
|
|
2569
|
+
* @param type Widget specific event name.
|
|
2570
|
+
*/
|
|
2571
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
2572
|
+
}
|
|
2573
|
+
/**
|
|
2574
|
+
* Represents the version of the Checkout Widgets to use defaults to (0.1.9-alpha)
|
|
2575
|
+
* @property {number} major
|
|
2576
|
+
* @property {number | undefined} minor
|
|
2577
|
+
* @property {number | undefined} patch
|
|
2578
|
+
* @property {'alpha' | undefined} prerelease
|
|
2579
|
+
* @property {number | undefined} build
|
|
2580
|
+
*
|
|
2581
|
+
* @example
|
|
2582
|
+
* { major: 0 } - use default version 0.1.9-alpha
|
|
2583
|
+
* { major: 1 } - use version 1.x.x, pickup all new minor and patch versions released
|
|
2584
|
+
* { major: 1, minor: 1 } - use version 1.1.x, pickup all new patch versions released
|
|
2585
|
+
* { major: 1, minor: 2, patch: 3 } - use version 1.2.3 specifically
|
|
2586
|
+
*/
|
|
2587
|
+
type SemanticVersion = {
|
|
2588
|
+
/** The major version of the widgets, must specify a major version even if it is 0. */
|
|
2589
|
+
major: number;
|
|
2590
|
+
/** The minor version of the widgets, leaving this blank will use the latest minor based on major */
|
|
2591
|
+
minor?: number;
|
|
2592
|
+
/** The patch version of the widgets, leaving this blank will use the latest minor based on minor */
|
|
2593
|
+
patch?: number;
|
|
2594
|
+
/** The prerelease version of the widgets, can only be 'alpha'. Do not use in production. */
|
|
2595
|
+
prerelease?: 'alpha';
|
|
2596
|
+
/** The build version of the widgets. Do not use in production. */
|
|
2597
|
+
build?: number;
|
|
2598
|
+
};
|
|
2599
|
+
/**
|
|
2600
|
+
* Represents the global configuration options for the Checkout Widgets.
|
|
2601
|
+
* @property {WidgetTheme | undefined} theme
|
|
2602
|
+
* @property {Environment | undefined} environment
|
|
2603
|
+
* @property {SemanticVersion | undefined} version
|
|
2604
|
+
* @property {boolean | undefined} isOnRampEnabled
|
|
2605
|
+
* @property {boolean | undefined} isSwapEnabled
|
|
2606
|
+
* @property {boolean | undefined} isBridgeEnabled
|
|
2607
|
+
*/
|
|
2608
|
+
type CheckoutWidgetsConfig = {
|
|
2609
|
+
/** The theme of the Checkout Widget (default: "DARK") */
|
|
2610
|
+
theme?: WidgetTheme;
|
|
2611
|
+
/** The environment configuration (default: "SANDBOX") */
|
|
2612
|
+
environment?: Environment;
|
|
2613
|
+
/** The version of the checkout widgets js file to use (default: "0.1.x") */
|
|
2614
|
+
version?: SemanticVersion;
|
|
2615
|
+
/** Enable on-ramp top-up method (default: "true") */
|
|
2616
|
+
isOnRampEnabled?: boolean;
|
|
2617
|
+
/** Enable swap top-up method (default: "true") */
|
|
2618
|
+
isSwapEnabled?: boolean;
|
|
2619
|
+
/** Enable bridge top-up method (default: "true") */
|
|
2620
|
+
isBridgeEnabled?: boolean;
|
|
2621
|
+
};
|
|
2622
|
+
|
|
2623
|
+
/**
|
|
2624
|
+
* Represents the configuration options for instantiating the Checkout Widgets factory.
|
|
2625
|
+
* @property {WidgetConfiguration} config - global configuration options for the widgets.
|
|
2626
|
+
* @property {SemanticVersion | undefined} version - version of the Checkout widgets bundle(default latest version will be used).
|
|
2627
|
+
*/
|
|
2628
|
+
type WidgetsInit = {
|
|
2629
|
+
config: WidgetConfiguration;
|
|
2630
|
+
version?: SemanticVersion;
|
|
2631
|
+
};
|
|
2632
|
+
|
|
2633
|
+
declare class Checkout {
|
|
2634
|
+
private readOnlyProviders;
|
|
2635
|
+
private httpClient;
|
|
2636
|
+
readonly config: CheckoutConfiguration;
|
|
2637
|
+
readonly fiatRampService: FiatRampService;
|
|
2638
|
+
readonly availability: AvailabilityService;
|
|
2639
|
+
readonly passport?: Passport;
|
|
2640
|
+
/**
|
|
2641
|
+
* Constructs a new instance of the CheckoutModule class.
|
|
2642
|
+
* @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
|
|
2643
|
+
*/
|
|
2644
|
+
constructor(config?: CheckoutModuleConfiguration);
|
|
2645
|
+
/**
|
|
2646
|
+
* Loads the widgets bundle and initiate the widgets factory.
|
|
2647
|
+
* @param {WidgetsInit} init - The initialisation parameters for loading the widgets bundle and applying configuration
|
|
2648
|
+
*/
|
|
2649
|
+
widgets(init: WidgetsInit): Promise<ImmutableCheckoutWidgets.WidgetsFactory>;
|
|
2650
|
+
private loadUmdBundle;
|
|
2651
|
+
private loadEsModules;
|
|
2652
|
+
/**
|
|
2653
|
+
* Creates a provider using the given parameters.
|
|
2654
|
+
* @param {CreateProviderParams} params - The parameters for creating the provider.
|
|
2655
|
+
* @returns {Promise<CreateProviderResult>} A promise that resolves to the created provider.
|
|
2656
|
+
*/
|
|
2657
|
+
createProvider(params: CreateProviderParams): Promise<CreateProviderResult>;
|
|
2658
|
+
/**
|
|
2659
|
+
* Returns a list of EIP-6963 injected providers and their metadata.
|
|
2660
|
+
*/
|
|
2661
|
+
getInjectedProviders(): readonly EIP6963ProviderDetail[];
|
|
2662
|
+
/**
|
|
2663
|
+
* Finds an injected provider by its RDNS.
|
|
2664
|
+
* @param {rdns: string} args - The parameters for finding the injected provider.
|
|
2665
|
+
* @returns {EIP6963ProviderDetail | undefined} - The found provider and metadata or undefined.
|
|
2666
|
+
*/
|
|
2667
|
+
findInjectedProvider(args: {
|
|
2668
|
+
rdns: string;
|
|
2669
|
+
}): EIP6963ProviderDetail | undefined;
|
|
2670
|
+
/**
|
|
2671
|
+
* Subscribes to changes in the injected providers.
|
|
2672
|
+
* @param listener - The listener to be called when the injected providers change.
|
|
2673
|
+
*/
|
|
2674
|
+
onInjectedProvidersChange(listener: (providers: EIP6963ProviderDetail[]) => void): () => void;
|
|
2675
|
+
/**
|
|
2676
|
+
* Checks if a wallet is connected to the specified provider.
|
|
2677
|
+
* @param {CheckConnectionParams} params - The parameters for checking the wallet connection.
|
|
2678
|
+
* @returns {Promise<CheckConnectionResult>} - A promise that resolves to the result of the check.
|
|
2679
|
+
*/
|
|
2680
|
+
checkIsWalletConnected(params: CheckConnectionParams): Promise<CheckConnectionResult>;
|
|
2681
|
+
/**
|
|
2682
|
+
* Connects to a blockchain network using the specified provider.
|
|
2683
|
+
* @param {ConnectParams} params - The parameters for connecting to the network.
|
|
2684
|
+
* @returns {Promise<ConnectResult>} A promise that resolves to an object containing the provider and network information.
|
|
2685
|
+
* @throws {Error} If the provider is not valid or if there is an error connecting to the network.
|
|
2686
|
+
*/
|
|
2687
|
+
connect(params: ConnectParams): Promise<ConnectResult>;
|
|
2688
|
+
/**
|
|
2689
|
+
* Adds the network for the current wallet provider.
|
|
2690
|
+
* @param {AddNetworkParams} params - The parameters for adding the network.
|
|
2691
|
+
* @returns {Promise<any>} - A promise that resolves to the result of adding the network.
|
|
2692
|
+
*/
|
|
2693
|
+
addNetwork(params: AddNetworkParams): Promise<any>;
|
|
2694
|
+
/**
|
|
2695
|
+
* Switches the network for the current wallet provider.
|
|
2696
|
+
* @param {SwitchNetworkParams} params - The parameters for switching the network.
|
|
2697
|
+
* @returns {Promise<SwitchNetworkResult>} - A promise that resolves to the result of switching the network.
|
|
2698
|
+
*/
|
|
2699
|
+
switchNetwork(params: SwitchNetworkParams): Promise<SwitchNetworkResult>;
|
|
2700
|
+
/**
|
|
2701
|
+
* Retrieves the token information given the token address. This function makes RPC calls to
|
|
2702
|
+
* ERC20 contracts to fetch the main contract information (e.g. symbol).
|
|
2703
|
+
* @param {GetTokenInfoParams} params - The parameters for retrieving the token information.
|
|
2704
|
+
* @returns {Promise<TokenInfo>} - A promise that resolves to the token info request.
|
|
2705
|
+
*/
|
|
2706
|
+
getTokenInfo(params: GetTokenInfoParams): Promise<TokenInfo>;
|
|
2707
|
+
/**
|
|
2708
|
+
* Retrieves the balance of a wallet address.
|
|
2709
|
+
* @param {GetBalanceParams} params - The parameters for retrieving the balance.
|
|
2710
|
+
* @returns {Promise<GetBalanceResult>} - A promise that resolves to the balance result.
|
|
2711
|
+
*/
|
|
2712
|
+
getBalance(params: GetBalanceParams): Promise<GetBalanceResult>;
|
|
2713
|
+
/**
|
|
2714
|
+
* Retrieves the balances of all tokens for a given wallet address on a specific chain.
|
|
2715
|
+
* @param {GetAllBalancesParams} params - The parameters for retrieving the balances.
|
|
2716
|
+
* @returns {Promise<GetAllBalancesResult>} - A promise that resolves to the result of retrieving the balances.
|
|
2717
|
+
*/
|
|
2718
|
+
getAllBalances(params: GetAllBalancesParams): Promise<GetAllBalancesResult>;
|
|
2719
|
+
/**
|
|
2720
|
+
* Retrieves the supported networks based on the provided parameters.
|
|
2721
|
+
* @param {GetNetworkAllowListParams} params - The parameters for retrieving the network allow list.
|
|
2722
|
+
* @returns {Promise<GetNetworkAllowListResult>} - A promise that resolves to the network allow list result.
|
|
2723
|
+
*/
|
|
2724
|
+
getNetworkAllowList(params: GetNetworkAllowListParams): Promise<GetNetworkAllowListResult>;
|
|
2725
|
+
/**
|
|
2726
|
+
* Retrieves the supported tokens based on the provided parameters.
|
|
2727
|
+
* @param {GetTokenAllowListParams} params - The parameters for retrieving the token allow list.
|
|
2728
|
+
* @returns {Promise<GetTokenAllowListResult>} - A promise that resolves to the token allow list result.
|
|
2729
|
+
*/
|
|
2730
|
+
getTokenAllowList(params: GetTokenAllowListParams): Promise<GetTokenAllowListResult>;
|
|
2731
|
+
/**
|
|
2732
|
+
* Retrieves the default supported wallets based on the provided parameters.
|
|
2733
|
+
* @param {GetWalletAllowListParams} params - The parameters for retrieving the wallet allow list.
|
|
2734
|
+
* @returns {Promise<GetWalletAllowListResult>} - A promise that resolves to the wallet allow list result.
|
|
2735
|
+
*/
|
|
2736
|
+
getWalletAllowList(params: GetWalletAllowListParams): Promise<GetWalletAllowListResult>;
|
|
2737
|
+
/**
|
|
2738
|
+
* Sends a transaction using the specified provider and transaction parameters.
|
|
2739
|
+
* @param {SendTransactionParams} params - The parameters for sending the transaction.
|
|
2740
|
+
* @returns {Promise<SendTransactionResult>} A promise that resolves to the result of the transaction.
|
|
2741
|
+
*/
|
|
2742
|
+
sendTransaction(params: SendTransactionParams): Promise<SendTransactionResult>;
|
|
2743
|
+
/**
|
|
2744
|
+
* Wraps a Web3Provider call to validate the provider and handle errors.
|
|
2745
|
+
* @param {Web3Provider} web3Provider - The provider to connect to the network.
|
|
2746
|
+
* @param {(web3Provider: Web3Provider) => Promise<T>)} block - The block executing the provider call.
|
|
2747
|
+
* @returns {Promise<T>} Returns the result of the provided block param.
|
|
2748
|
+
*/
|
|
2749
|
+
providerCall<T>(web3Provider: Web3Provider, block: (web3Provider: Web3Provider) => Promise<T>): Promise<T>;
|
|
2750
|
+
/**
|
|
2751
|
+
* Retrieves network information using the specified provider.
|
|
2752
|
+
* @param {GetNetworkParams} params - The parameters for retrieving network information.
|
|
2753
|
+
* @returns {Promise<NetworkInfo>} A promise that resolves to the network information.
|
|
2754
|
+
*/
|
|
2755
|
+
getNetworkInfo(params: GetNetworkParams): Promise<NetworkInfo>;
|
|
2756
|
+
/**
|
|
2757
|
+
* Determines the requirements for performing a buy.
|
|
2758
|
+
* @param {BuyParams} params - The parameters for the buy.
|
|
2759
|
+
*/
|
|
2760
|
+
buy(params: BuyParams): Promise<BuyResult>;
|
|
2761
|
+
/**
|
|
2762
|
+
* Determines the requirements for performing a sell.
|
|
2763
|
+
* @param {SellParams} params - The parameters for the sell.
|
|
2764
|
+
* Only currently actions the first order in the array until we support batch processing.
|
|
2765
|
+
* Only currently actions the first fee in the fees array of each order until we support multiple fees.
|
|
2766
|
+
*/
|
|
2767
|
+
sell(params: SellParams): Promise<SellResult>;
|
|
2768
|
+
/**
|
|
2769
|
+
* Cancels a sell.
|
|
2770
|
+
* @param {CancelParams} params - The parameters for the cancel.
|
|
2771
|
+
*/
|
|
2772
|
+
cancel(params: CancelParams): Promise<CancelResult>;
|
|
2773
|
+
/**
|
|
2774
|
+
* Determines the transaction requirements to complete a purchase.
|
|
2775
|
+
* @params {SmartCheckoutParams} params - The parameters for smart checkout.
|
|
2776
|
+
*/
|
|
2777
|
+
smartCheckout(params: SmartCheckoutParams): Promise<SmartCheckoutResult>;
|
|
2778
|
+
/**
|
|
2779
|
+
* Checks if the given object is a Web3 provider.
|
|
2780
|
+
* @param {Web3Provider} web3Provider - The object to check.
|
|
2781
|
+
* @returns {boolean} - True if the object is a Web3 provider, false otherwise.
|
|
2782
|
+
*/
|
|
2783
|
+
static isWeb3Provider(web3Provider: Web3Provider): boolean;
|
|
2784
|
+
/**
|
|
2785
|
+
* Estimates the gas required for a swap or bridge transaction.
|
|
2786
|
+
* @param {GasEstimateParams} params - The parameters for the gas estimation.
|
|
2787
|
+
* @returns {Promise<GasEstimateSwapResult | GasEstimateBridgeToL2Result>} - A promise that resolves to the gas estimation result.
|
|
2788
|
+
*/
|
|
2789
|
+
gasEstimate(params: GasEstimateParams): Promise<GasEstimateSwapResult | GasEstimateBridgeToL2Result>;
|
|
2790
|
+
/**
|
|
2791
|
+
* Creates and returns a URL for the fiat ramp widget.
|
|
2792
|
+
* @param {FiatRampParams} params - The parameters for creating the url.
|
|
2793
|
+
* @returns {Promise<string>} - A promise that resolves to a string url.
|
|
2794
|
+
*/
|
|
2795
|
+
createFiatRampUrl(params: FiatRampParams): Promise<string>;
|
|
2796
|
+
/**
|
|
2797
|
+
* Fetches fiat ramp fee estimations.
|
|
2798
|
+
* @returns {Promise<OnRampProviderFees>} - A promise that resolves to OnRampProviderFees.
|
|
2799
|
+
*/
|
|
2800
|
+
getExchangeFeeEstimate(): Promise<OnRampProviderFees>;
|
|
2801
|
+
/**
|
|
2802
|
+
* Fetches Swap widget availability.
|
|
2803
|
+
* @returns {Promise<boolean>} - A promise that resolves to a boolean.
|
|
2804
|
+
*/
|
|
2805
|
+
isSwapAvailable(): Promise<boolean>;
|
|
2806
|
+
}
|
|
2807
|
+
|
|
2808
|
+
/**
|
|
2809
|
+
* Declares global interfaces and namespaces for the application.
|
|
2810
|
+
* @global
|
|
2811
|
+
* @namespace ImmutableCheckoutWidgets
|
|
2812
|
+
* */
|
|
2813
|
+
declare global {
|
|
2814
|
+
namespace ImmutableCheckoutWidgets {
|
|
2815
|
+
class WidgetsFactory implements IWidgetsFactory {
|
|
2816
|
+
constructor(sdk: Checkout, config: CheckoutWidgetsConfig);
|
|
2817
|
+
create<T extends WidgetType>(type: T, props?: WidgetProperties<T>): Widget<T>;
|
|
2818
|
+
updateProvider(provider: Web3Provider): void;
|
|
2819
|
+
}
|
|
2820
|
+
class Connect<T extends WidgetType> implements Widget<T> {
|
|
2821
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
2822
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
2823
|
+
unmount(): void;
|
|
2824
|
+
update(props: WidgetProperties<T>): void;
|
|
2825
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
2826
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
2827
|
+
}
|
|
2828
|
+
class Bridge<T extends WidgetType> implements Widget<T> {
|
|
2829
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
2830
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
2831
|
+
unmount(): void;
|
|
2832
|
+
update(props: WidgetProperties<T>): void;
|
|
2833
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
2834
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
2835
|
+
}
|
|
2836
|
+
class Wallet<T extends WidgetType> implements Widget<T> {
|
|
2837
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
2838
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
2839
|
+
unmount(): void;
|
|
2840
|
+
update(props: WidgetProperties<T>): void;
|
|
2841
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
2842
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
2843
|
+
}
|
|
2844
|
+
class Swap<T extends WidgetType> implements Widget<T> {
|
|
2845
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
2846
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
2847
|
+
unmount(): void;
|
|
2848
|
+
update(props: WidgetProperties<T>): void;
|
|
2849
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
2850
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
2851
|
+
}
|
|
2852
|
+
class OnRamp<T extends WidgetType> implements Widget<T> {
|
|
2853
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
2854
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
2855
|
+
unmount(): void;
|
|
2856
|
+
update(props: WidgetProperties<T>): void;
|
|
2857
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
2858
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
2859
|
+
}
|
|
2860
|
+
class Sale<T extends WidgetType> implements Widget<T> {
|
|
2861
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
2862
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
2863
|
+
unmount(): void;
|
|
2864
|
+
update(props: WidgetProperties<T>): void;
|
|
2865
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
2866
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
/**
|
|
2872
|
+
* Base URL for the Immutable API based on the environment.
|
|
2873
|
+
* @property {string} DEVELOPMENT - The base URL for the development environment.
|
|
2874
|
+
* @property {string} SANDBOX - The base URL for the sandbox environment.
|
|
2875
|
+
* @property {string} PRODUCTION - The base URL for the production environment.
|
|
2876
|
+
*/
|
|
2877
|
+
declare const IMMUTABLE_API_BASE_URL: {
|
|
2878
|
+
[x: string]: string;
|
|
2879
|
+
sandbox: string;
|
|
2880
|
+
production: string;
|
|
2881
|
+
};
|
|
2882
|
+
|
|
2883
|
+
declare const getPassportProviderDetail: (provider: EIP1193Provider) => EIP6963ProviderDetail;
|
|
2884
|
+
declare const getMetaMaskProviderDetail: (provider: EIP1193Provider) => EIP6963ProviderDetail;
|
|
2885
|
+
|
|
2886
|
+
declare function validateProvider(config: CheckoutConfiguration, web3Provider: Web3Provider, validateProviderOptions?: ValidateProviderOptions): Promise<Web3Provider>;
|
|
2887
|
+
|
|
2888
|
+
/**
|
|
2889
|
+
* Enum representing different types of errors that can occur during the checkout process.
|
|
2890
|
+
*/
|
|
2891
|
+
declare enum CheckoutErrorType {
|
|
2892
|
+
MISSING_PARAMS = "MISSING_PARAMS",
|
|
2893
|
+
WEB3_PROVIDER_ERROR = "WEB3_PROVIDER_ERROR",
|
|
2894
|
+
PROVIDER_ERROR = "PROVIDER_ERROR",
|
|
2895
|
+
DEFAULT_PROVIDER_ERROR = "DEFAULT_PROVIDER_ERROR",
|
|
2896
|
+
CONNECT_PROVIDER_ERROR = "CONNECT_PROVIDER_ERROR",
|
|
2897
|
+
GET_BALANCE_ERROR = "GET_BALANCE_ERROR",
|
|
2898
|
+
GET_INDEXER_BALANCE_ERROR = "GET_INDEXER_BALANCE_ERROR",
|
|
2899
|
+
GET_ERC20_INFO_ERROR = "GET_ERC20_INFO_ERROR",
|
|
2900
|
+
GET_ERC20_BALANCE_ERROR = "GET_ERC20_BALANCE_ERROR",
|
|
2901
|
+
GET_ERC721_BALANCE_ERROR = "GET_ERC721_BALANCE_ERROR",
|
|
2902
|
+
GET_NETWORK_INFO_ERROR = "GET_NETWORK_INFO_ERROR",
|
|
2903
|
+
METAMASK_PROVIDER_ERROR = "METAMASK_PROVIDER_ERROR",
|
|
2904
|
+
CHAIN_NOT_SUPPORTED_ERROR = "CHAIN_NOT_SUPPORTED_ERROR",
|
|
2905
|
+
PROVIDER_REQUEST_MISSING_ERROR = "PROVIDER_REQUEST_MISSING_ERROR",
|
|
2906
|
+
PROVIDER_REQUEST_FAILED_ERROR = "PROVIDER_REQUEST_FAILED_ERROR",
|
|
2907
|
+
USER_REJECTED_REQUEST_ERROR = "USER_REJECTED_REQUEST_ERROR",
|
|
2908
|
+
TRANSACTION_FAILED = "TRANSACTION_FAILED",
|
|
2909
|
+
INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS",
|
|
2910
|
+
UNPREDICTABLE_GAS_LIMIT = "UNPREDICTABLE_GAS_LIMIT",
|
|
2911
|
+
INVALID_GAS_ESTIMATE_TYPE = "INVALID_GAS_ESTIMATE_TYPE",
|
|
2912
|
+
UNSUPPORTED_TOKEN_TYPE_ERROR = "UNSUPPORTED_TOKEN_TYPE_ERROR",
|
|
2913
|
+
UNSUPPORTED_BALANCE_REQUIREMENT_ERROR = "UNSUPPORTED_BALANCE_REQUIREMENT_ERROR",
|
|
2914
|
+
GET_ORDER_LISTING_ERROR = "GET_ORDER_LISTING_ERROR",
|
|
2915
|
+
CANCEL_ORDER_LISTING_ERROR = "CANCEL_ORDER_LISTING_ERROR",
|
|
2916
|
+
PREPARE_ORDER_LISTING_ERROR = "PREPARE_ORDER_LISTING_ERROR",
|
|
2917
|
+
CREATE_ORDER_LISTING_ERROR = "CREATE_ORDER_LISTING_ERROR",
|
|
2918
|
+
FULFILL_ORDER_LISTING_ERROR = "FULFILL_ORDER_LISTING_ERROR",
|
|
2919
|
+
SWITCH_NETWORK_UNSUPPORTED = "SWITCH_NETWORK_UNSUPPORTED",
|
|
2920
|
+
GET_ERC20_ALLOWANCE_ERROR = "GET_ERC20_ALLOWANCE_ERROR",
|
|
2921
|
+
GET_ERC721_ALLOWANCE_ERROR = "GET_ERC721_ALLOWANCE_ERROR",
|
|
2922
|
+
GET_ERC1155_ALLOWANCE_ERROR = "GET_ERC1155_ALLOWANCE_ERROR",
|
|
2923
|
+
EXECUTE_APPROVAL_TRANSACTION_ERROR = "EXECUTE_APPROVAL_TRANSACTION_ERROR",
|
|
2924
|
+
EXECUTE_FULFILLMENT_TRANSACTION_ERROR = "EXECUTE_FULFILLMENT_TRANSACTION_ERROR",
|
|
2925
|
+
SIGN_MESSAGE_ERROR = "SIGN_MESSAGE_ERROR",
|
|
2926
|
+
BRIDGE_GAS_ESTIMATE_ERROR = "BRIDGE_GAS_ESTIMATE_ERROR",
|
|
2927
|
+
ORDER_FEE_ERROR = "ORDER_FEE_ERROR",
|
|
2928
|
+
ITEM_REQUIREMENTS_ERROR = "ITEM_REQUIREMENTS_ERROR",
|
|
2929
|
+
API_ERROR = "API_ERROR",
|
|
2930
|
+
ORDER_EXPIRED_ERROR = "ORDER_EXPIRED_ERROR",
|
|
2931
|
+
WIDGETS_SCRIPT_LOAD_ERROR = "WIDGETS_SCRIPT_LOAD_ERROR"
|
|
2932
|
+
}
|
|
2933
|
+
/**
|
|
2934
|
+
* Represents an error object with a specific type, optional message, and optional data.
|
|
2935
|
+
* @property {CheckoutErrorType} type
|
|
2936
|
+
* @property {string | undefined} [message]
|
|
2937
|
+
* @property {Object.<string, string> | undefined} [data]
|
|
2938
|
+
*/
|
|
2939
|
+
type ErrorType = {
|
|
2940
|
+
/** The type of the error. */
|
|
2941
|
+
type: CheckoutErrorType;
|
|
2942
|
+
/** The error message. */
|
|
2943
|
+
message?: string;
|
|
2944
|
+
/** Additional data associated with the error. */
|
|
2945
|
+
data?: {
|
|
2946
|
+
[key: string]: string;
|
|
2947
|
+
};
|
|
2948
|
+
};
|
|
2949
|
+
|
|
2950
|
+
declare class BlockExplorerService {
|
|
2951
|
+
/**
|
|
2952
|
+
* getTransationLink returns the link to the transaction on blockscout
|
|
2953
|
+
* @param hash transaction hash
|
|
2954
|
+
* @returns link to the transaction on blockscout
|
|
2955
|
+
*/
|
|
2956
|
+
static getTransactionLink(chainId: ChainId, hash: string): string | undefined;
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
type checkout_d_AllowedNetworkConfig = AllowedNetworkConfig;
|
|
2960
|
+
type checkout_d_AvailableRoutingOptions = AvailableRoutingOptions;
|
|
2961
|
+
type checkout_d_BalanceDelta = BalanceDelta;
|
|
2962
|
+
type checkout_d_BlockExplorerService = BlockExplorerService;
|
|
2963
|
+
declare const checkout_d_BlockExplorerService: typeof BlockExplorerService;
|
|
2964
|
+
type checkout_d_BridgeClaimWithdrawalFailed = BridgeClaimWithdrawalFailed;
|
|
2965
|
+
type checkout_d_BridgeClaimWithdrawalSuccess = BridgeClaimWithdrawalSuccess;
|
|
2966
|
+
type checkout_d_BridgeEventType = BridgeEventType;
|
|
2967
|
+
declare const checkout_d_BridgeEventType: typeof BridgeEventType;
|
|
2968
|
+
type checkout_d_BridgeFailed = BridgeFailed;
|
|
2969
|
+
type checkout_d_BridgeFundingStep = BridgeFundingStep;
|
|
2970
|
+
type checkout_d_BridgeTransactionSent = BridgeTransactionSent;
|
|
2971
|
+
type checkout_d_BridgeWidgetConfiguration = BridgeWidgetConfiguration;
|
|
2972
|
+
type checkout_d_BridgeWidgetParams = BridgeWidgetParams;
|
|
2973
|
+
type checkout_d_BuyOrder = BuyOrder;
|
|
2974
|
+
type checkout_d_BuyOverrides = BuyOverrides;
|
|
2975
|
+
type checkout_d_BuyParams = BuyParams;
|
|
2976
|
+
type checkout_d_BuyResult = BuyResult;
|
|
2977
|
+
type checkout_d_BuyResultFailed = BuyResultFailed;
|
|
2978
|
+
type checkout_d_BuyResultFulfillmentsUnsettled = BuyResultFulfillmentsUnsettled;
|
|
2979
|
+
type checkout_d_BuyResultInsufficientFunds = BuyResultInsufficientFunds;
|
|
2980
|
+
type checkout_d_BuyResultSuccess = BuyResultSuccess;
|
|
2981
|
+
type checkout_d_BuyToken = BuyToken;
|
|
2982
|
+
type checkout_d_CancelOverrides = CancelOverrides;
|
|
2983
|
+
type checkout_d_CancelParams = CancelParams;
|
|
2984
|
+
type checkout_d_CancelResult = CancelResult;
|
|
2985
|
+
type checkout_d_CancelResultFailed = CancelResultFailed;
|
|
2986
|
+
type checkout_d_CancelResultFulfillmentsUnsettled = CancelResultFulfillmentsUnsettled;
|
|
2987
|
+
type checkout_d_CancelResultGasless = CancelResultGasless;
|
|
2988
|
+
type checkout_d_CancelResultSuccess = CancelResultSuccess;
|
|
2989
|
+
type checkout_d_ChainId = ChainId;
|
|
2990
|
+
declare const checkout_d_ChainId: typeof ChainId;
|
|
2991
|
+
type checkout_d_ChainName = ChainName;
|
|
2992
|
+
declare const checkout_d_ChainName: typeof ChainName;
|
|
2993
|
+
type checkout_d_ChainSlug = ChainSlug;
|
|
2994
|
+
declare const checkout_d_ChainSlug: typeof ChainSlug;
|
|
2995
|
+
type checkout_d_CheckConnectionParams = CheckConnectionParams;
|
|
2996
|
+
type checkout_d_CheckConnectionResult = CheckConnectionResult;
|
|
2997
|
+
type checkout_d_Checkout = Checkout;
|
|
2998
|
+
declare const checkout_d_Checkout: typeof Checkout;
|
|
2999
|
+
type checkout_d_CheckoutBridgeConfiguration = CheckoutBridgeConfiguration;
|
|
3000
|
+
type checkout_d_CheckoutConfiguration = CheckoutConfiguration;
|
|
3001
|
+
declare const checkout_d_CheckoutConfiguration: typeof CheckoutConfiguration;
|
|
3002
|
+
type checkout_d_CheckoutErrorType = CheckoutErrorType;
|
|
3003
|
+
declare const checkout_d_CheckoutErrorType: typeof CheckoutErrorType;
|
|
3004
|
+
type checkout_d_CheckoutModuleConfiguration = CheckoutModuleConfiguration;
|
|
3005
|
+
type checkout_d_CheckoutOnRampConfiguration = CheckoutOnRampConfiguration;
|
|
3006
|
+
type checkout_d_CheckoutStatus = CheckoutStatus;
|
|
3007
|
+
declare const checkout_d_CheckoutStatus: typeof CheckoutStatus;
|
|
3008
|
+
type checkout_d_CheckoutSwapConfiguration = CheckoutSwapConfiguration;
|
|
3009
|
+
type checkout_d_CheckoutWidgetsConfig = CheckoutWidgetsConfig;
|
|
3010
|
+
type checkout_d_ConnectEventType = ConnectEventType;
|
|
3011
|
+
declare const checkout_d_ConnectEventType: typeof ConnectEventType;
|
|
3012
|
+
type checkout_d_ConnectParams = ConnectParams;
|
|
3013
|
+
type checkout_d_ConnectResult = ConnectResult;
|
|
3014
|
+
type checkout_d_ConnectTargetLayer = ConnectTargetLayer;
|
|
3015
|
+
declare const checkout_d_ConnectTargetLayer: typeof ConnectTargetLayer;
|
|
3016
|
+
type checkout_d_ConnectWidgetConfiguration = ConnectWidgetConfiguration;
|
|
3017
|
+
type checkout_d_ConnectWidgetParams = ConnectWidgetParams;
|
|
3018
|
+
type checkout_d_ConnectionFailed = ConnectionFailed;
|
|
3019
|
+
type checkout_d_ConnectionSuccess = ConnectionSuccess;
|
|
3020
|
+
type checkout_d_CreateProviderParams = CreateProviderParams;
|
|
3021
|
+
type checkout_d_CreateProviderResult = CreateProviderResult;
|
|
3022
|
+
type checkout_d_DexConfig = DexConfig;
|
|
3023
|
+
type checkout_d_EIP1193Provider = EIP1193Provider;
|
|
3024
|
+
type checkout_d_EIP6963ProviderDetail = EIP6963ProviderDetail;
|
|
3025
|
+
type checkout_d_EIP6963ProviderInfo = EIP6963ProviderInfo;
|
|
3026
|
+
type checkout_d_ERC20ItemRequirement = ERC20ItemRequirement;
|
|
3027
|
+
type checkout_d_ERC721Balance = ERC721Balance;
|
|
3028
|
+
type checkout_d_ERC721ItemRequirement = ERC721ItemRequirement;
|
|
3029
|
+
type checkout_d_ErrorType = ErrorType;
|
|
3030
|
+
type checkout_d_ExchangeType = ExchangeType;
|
|
3031
|
+
declare const checkout_d_ExchangeType: typeof ExchangeType;
|
|
3032
|
+
type checkout_d_FailedGaslessCancellation = FailedGaslessCancellation;
|
|
3033
|
+
type checkout_d_Fee = Fee;
|
|
3034
|
+
type checkout_d_FeePercentage = FeePercentage;
|
|
3035
|
+
type checkout_d_FeeToken = FeeToken;
|
|
3036
|
+
type checkout_d_FeeType = FeeType;
|
|
3037
|
+
declare const checkout_d_FeeType: typeof FeeType;
|
|
3038
|
+
type checkout_d_FiatRampParams = FiatRampParams;
|
|
3039
|
+
type checkout_d_FulfillmentTransaction = FulfillmentTransaction;
|
|
3040
|
+
type checkout_d_FundingItem = FundingItem;
|
|
3041
|
+
type checkout_d_FundingRoute = FundingRoute;
|
|
3042
|
+
type checkout_d_FundingStep = FundingStep;
|
|
3043
|
+
type checkout_d_FundingStepType = FundingStepType;
|
|
3044
|
+
declare const checkout_d_FundingStepType: typeof FundingStepType;
|
|
3045
|
+
type checkout_d_GasAmount = GasAmount;
|
|
3046
|
+
type checkout_d_GasEstimateBridgeToL2Result = GasEstimateBridgeToL2Result;
|
|
3047
|
+
type checkout_d_GasEstimateParams = GasEstimateParams;
|
|
3048
|
+
type checkout_d_GasEstimateSwapResult = GasEstimateSwapResult;
|
|
3049
|
+
type checkout_d_GasEstimateTokenConfig = GasEstimateTokenConfig;
|
|
3050
|
+
type checkout_d_GasEstimateType = GasEstimateType;
|
|
3051
|
+
declare const checkout_d_GasEstimateType: typeof GasEstimateType;
|
|
3052
|
+
type checkout_d_GasToken = GasToken;
|
|
3053
|
+
type checkout_d_GasTokenType = GasTokenType;
|
|
3054
|
+
declare const checkout_d_GasTokenType: typeof GasTokenType;
|
|
3055
|
+
type checkout_d_GetAllBalancesParams = GetAllBalancesParams;
|
|
3056
|
+
type checkout_d_GetAllBalancesResult = GetAllBalancesResult;
|
|
3057
|
+
type checkout_d_GetBalanceParams = GetBalanceParams;
|
|
3058
|
+
type checkout_d_GetBalanceResult = GetBalanceResult;
|
|
3059
|
+
type checkout_d_GetNetworkAllowListParams = GetNetworkAllowListParams;
|
|
3060
|
+
type checkout_d_GetNetworkAllowListResult = GetNetworkAllowListResult;
|
|
3061
|
+
type checkout_d_GetNetworkParams = GetNetworkParams;
|
|
3062
|
+
type checkout_d_GetTokenAllowListParams = GetTokenAllowListParams;
|
|
3063
|
+
type checkout_d_GetTokenAllowListResult = GetTokenAllowListResult;
|
|
3064
|
+
type checkout_d_GetTokenInfoParams = GetTokenInfoParams;
|
|
3065
|
+
type checkout_d_GetWalletAllowListParams = GetWalletAllowListParams;
|
|
3066
|
+
type checkout_d_GetWalletAllowListResult = GetWalletAllowListResult;
|
|
3067
|
+
declare const checkout_d_IMMUTABLE_API_BASE_URL: typeof IMMUTABLE_API_BASE_URL;
|
|
3068
|
+
type checkout_d_IMTBLWidgetEvents = IMTBLWidgetEvents;
|
|
3069
|
+
declare const checkout_d_IMTBLWidgetEvents: typeof IMTBLWidgetEvents;
|
|
3070
|
+
type checkout_d_IWidgetsFactory = IWidgetsFactory;
|
|
3071
|
+
type checkout_d_ItemBalance = ItemBalance;
|
|
3072
|
+
type checkout_d_ItemType = ItemType;
|
|
3073
|
+
declare const checkout_d_ItemType: typeof ItemType;
|
|
3074
|
+
type checkout_d_LanguageChanged = LanguageChanged;
|
|
3075
|
+
type checkout_d_NativeItemRequirement = NativeItemRequirement;
|
|
3076
|
+
type checkout_d_NetworkFilter = NetworkFilter;
|
|
3077
|
+
type checkout_d_NetworkFilterTypes = NetworkFilterTypes;
|
|
3078
|
+
declare const checkout_d_NetworkFilterTypes: typeof NetworkFilterTypes;
|
|
3079
|
+
type checkout_d_NetworkInfo = NetworkInfo;
|
|
3080
|
+
type checkout_d_NoRouteOptions = NoRouteOptions;
|
|
3081
|
+
type checkout_d_NoRoutesFound = NoRoutesFound;
|
|
3082
|
+
type checkout_d_OnRampEventType = OnRampEventType;
|
|
3083
|
+
declare const checkout_d_OnRampEventType: typeof OnRampEventType;
|
|
3084
|
+
type checkout_d_OnRampFailed = OnRampFailed;
|
|
3085
|
+
type checkout_d_OnRampFundingStep = OnRampFundingStep;
|
|
3086
|
+
type checkout_d_OnRampProviderFees = OnRampProviderFees;
|
|
3087
|
+
type checkout_d_OnRampSuccess = OnRampSuccess;
|
|
3088
|
+
type checkout_d_OnRampWidgetParams = OnRampWidgetParams;
|
|
3089
|
+
type checkout_d_OnrampWidgetConfiguration = OnrampWidgetConfiguration;
|
|
3090
|
+
type checkout_d_OrchestrationEvent<KEventName extends keyof OrchestrationMapping> = OrchestrationEvent<KEventName>;
|
|
3091
|
+
type checkout_d_OrchestrationEventData = OrchestrationEventData;
|
|
3092
|
+
type checkout_d_OrchestrationEventType = OrchestrationEventType;
|
|
3093
|
+
declare const checkout_d_OrchestrationEventType: typeof OrchestrationEventType;
|
|
3094
|
+
type checkout_d_OrderFee = OrderFee;
|
|
3095
|
+
type checkout_d_PendingGaslessCancellation = PendingGaslessCancellation;
|
|
3096
|
+
type checkout_d_ProviderEvent<KEventName extends keyof ProviderEventMapping> = ProviderEvent<KEventName>;
|
|
3097
|
+
type checkout_d_ProviderEventType = ProviderEventType;
|
|
3098
|
+
declare const checkout_d_ProviderEventType: typeof ProviderEventType;
|
|
3099
|
+
type checkout_d_ProviderUpdated = ProviderUpdated;
|
|
3100
|
+
type checkout_d_RemoteConfiguration = RemoteConfiguration;
|
|
3101
|
+
type checkout_d_RequestBridgeEvent = RequestBridgeEvent;
|
|
3102
|
+
type checkout_d_RequestConnectEvent = RequestConnectEvent;
|
|
3103
|
+
type checkout_d_RequestOnrampEvent = RequestOnrampEvent;
|
|
3104
|
+
type checkout_d_RequestSwapEvent = RequestSwapEvent;
|
|
3105
|
+
type checkout_d_RequestWalletEvent = RequestWalletEvent;
|
|
3106
|
+
type checkout_d_RoutesFound = RoutesFound;
|
|
3107
|
+
type checkout_d_RoutingOutcome = RoutingOutcome;
|
|
3108
|
+
type checkout_d_RoutingOutcomeType = RoutingOutcomeType;
|
|
3109
|
+
declare const checkout_d_RoutingOutcomeType: typeof RoutingOutcomeType;
|
|
3110
|
+
type checkout_d_SaleEventType = SaleEventType;
|
|
3111
|
+
declare const checkout_d_SaleEventType: typeof SaleEventType;
|
|
3112
|
+
type checkout_d_SaleFailed = SaleFailed;
|
|
3113
|
+
type checkout_d_SaleItem = SaleItem;
|
|
3114
|
+
type checkout_d_SalePaymentMethod = SalePaymentMethod;
|
|
3115
|
+
type checkout_d_SalePaymentToken = SalePaymentToken;
|
|
3116
|
+
type checkout_d_SalePaymentTypes = SalePaymentTypes;
|
|
3117
|
+
declare const checkout_d_SalePaymentTypes: typeof SalePaymentTypes;
|
|
3118
|
+
type checkout_d_SaleSuccess = SaleSuccess;
|
|
3119
|
+
type checkout_d_SaleTransactionSuccess = SaleTransactionSuccess;
|
|
3120
|
+
type checkout_d_SaleWidgetConfiguration = SaleWidgetConfiguration;
|
|
3121
|
+
type checkout_d_SaleWidgetParams = SaleWidgetParams;
|
|
3122
|
+
type checkout_d_SellOrder = SellOrder;
|
|
3123
|
+
type checkout_d_SellParams = SellParams;
|
|
3124
|
+
type checkout_d_SellResult = SellResult;
|
|
3125
|
+
type checkout_d_SellResultFailed = SellResultFailed;
|
|
3126
|
+
type checkout_d_SellResultInsufficientFunds = SellResultInsufficientFunds;
|
|
3127
|
+
type checkout_d_SellResultSuccess = SellResultSuccess;
|
|
3128
|
+
type checkout_d_SellToken = SellToken;
|
|
3129
|
+
type checkout_d_SemanticVersion = SemanticVersion;
|
|
3130
|
+
type checkout_d_SendTransactionParams = SendTransactionParams;
|
|
3131
|
+
type checkout_d_SendTransactionResult = SendTransactionResult;
|
|
3132
|
+
type checkout_d_SmartCheckoutInsufficient = SmartCheckoutInsufficient;
|
|
3133
|
+
type checkout_d_SmartCheckoutParams = SmartCheckoutParams;
|
|
3134
|
+
type checkout_d_SmartCheckoutResult = SmartCheckoutResult;
|
|
3135
|
+
type checkout_d_SmartCheckoutRouter = SmartCheckoutRouter;
|
|
3136
|
+
type checkout_d_SmartCheckoutSufficient = SmartCheckoutSufficient;
|
|
3137
|
+
type checkout_d_SuccessfulGaslessCancellation = SuccessfulGaslessCancellation;
|
|
3138
|
+
type checkout_d_SwapEventType = SwapEventType;
|
|
3139
|
+
declare const checkout_d_SwapEventType: typeof SwapEventType;
|
|
3140
|
+
type checkout_d_SwapFailed = SwapFailed;
|
|
3141
|
+
type checkout_d_SwapFundingStep = SwapFundingStep;
|
|
3142
|
+
type checkout_d_SwapRejected = SwapRejected;
|
|
3143
|
+
type checkout_d_SwapSuccess = SwapSuccess;
|
|
3144
|
+
type checkout_d_SwapWidgetConfiguration = SwapWidgetConfiguration;
|
|
3145
|
+
type checkout_d_SwapWidgetParams = SwapWidgetParams;
|
|
3146
|
+
type checkout_d_SwitchNetworkParams = SwitchNetworkParams;
|
|
3147
|
+
type checkout_d_SwitchNetworkResult = SwitchNetworkResult;
|
|
3148
|
+
type checkout_d_TokenAmountEstimate = TokenAmountEstimate;
|
|
3149
|
+
type checkout_d_TokenBalance = TokenBalance;
|
|
3150
|
+
type checkout_d_TokenFilter = TokenFilter;
|
|
3151
|
+
type checkout_d_TokenFilterTypes = TokenFilterTypes;
|
|
3152
|
+
declare const checkout_d_TokenFilterTypes: typeof TokenFilterTypes;
|
|
3153
|
+
type checkout_d_TokenInfo = TokenInfo;
|
|
3154
|
+
type checkout_d_TransactionOrGasType = TransactionOrGasType;
|
|
3155
|
+
declare const checkout_d_TransactionOrGasType: typeof TransactionOrGasType;
|
|
3156
|
+
type checkout_d_TransactionRequirement = TransactionRequirement;
|
|
3157
|
+
type checkout_d_WalletConnectConfig = WalletConnectConfig;
|
|
3158
|
+
type checkout_d_WalletConnectManager = WalletConnectManager;
|
|
3159
|
+
type checkout_d_WalletConnectProviderChanged = WalletConnectProviderChanged;
|
|
3160
|
+
type checkout_d_WalletDisconnect = WalletDisconnect;
|
|
3161
|
+
type checkout_d_WalletEventType = WalletEventType;
|
|
3162
|
+
declare const checkout_d_WalletEventType: typeof WalletEventType;
|
|
3163
|
+
type checkout_d_WalletFilter = WalletFilter;
|
|
3164
|
+
type checkout_d_WalletFilterTypes = WalletFilterTypes;
|
|
3165
|
+
declare const checkout_d_WalletFilterTypes: typeof WalletFilterTypes;
|
|
3166
|
+
type checkout_d_WalletInfo = WalletInfo;
|
|
3167
|
+
type checkout_d_WalletNetworkSwitch = WalletNetworkSwitch;
|
|
3168
|
+
type checkout_d_WalletProviderName = WalletProviderName;
|
|
3169
|
+
declare const checkout_d_WalletProviderName: typeof WalletProviderName;
|
|
3170
|
+
type checkout_d_WalletProviderRdns = WalletProviderRdns;
|
|
3171
|
+
declare const checkout_d_WalletProviderRdns: typeof WalletProviderRdns;
|
|
3172
|
+
type checkout_d_WalletWidgetConfiguration = WalletWidgetConfiguration;
|
|
3173
|
+
type checkout_d_WalletWidgetParams = WalletWidgetParams;
|
|
3174
|
+
type checkout_d_Widget<T extends WidgetType> = Widget<T>;
|
|
3175
|
+
type checkout_d_WidgetConfiguration = WidgetConfiguration;
|
|
3176
|
+
type checkout_d_WidgetConfigurations = WidgetConfigurations;
|
|
3177
|
+
type checkout_d_WidgetEvent<T extends WidgetType, KEventName extends keyof WidgetEventData[T]> = WidgetEvent<T, KEventName>;
|
|
3178
|
+
type checkout_d_WidgetEventData = WidgetEventData;
|
|
3179
|
+
type checkout_d_WidgetEventTypes = WidgetEventTypes;
|
|
3180
|
+
type checkout_d_WidgetLanguage = WidgetLanguage;
|
|
3181
|
+
type checkout_d_WidgetParameters = WidgetParameters;
|
|
3182
|
+
type checkout_d_WidgetProperties<T extends WidgetType> = WidgetProperties<T>;
|
|
3183
|
+
type checkout_d_WidgetTheme = WidgetTheme;
|
|
3184
|
+
declare const checkout_d_WidgetTheme: typeof WidgetTheme;
|
|
3185
|
+
type checkout_d_WidgetType = WidgetType;
|
|
3186
|
+
declare const checkout_d_WidgetType: typeof WidgetType;
|
|
3187
|
+
declare const checkout_d_getMetaMaskProviderDetail: typeof getMetaMaskProviderDetail;
|
|
3188
|
+
declare const checkout_d_getPassportProviderDetail: typeof getPassportProviderDetail;
|
|
3189
|
+
declare const checkout_d_validateProvider: typeof validateProvider;
|
|
3190
|
+
declare namespace checkout_d {
|
|
3191
|
+
export {
|
|
3192
|
+
checkout_d_AllowedNetworkConfig as AllowedNetworkConfig,
|
|
3193
|
+
checkout_d_AvailableRoutingOptions as AvailableRoutingOptions,
|
|
3194
|
+
checkout_d_BalanceDelta as BalanceDelta,
|
|
3195
|
+
checkout_d_BlockExplorerService as BlockExplorerService,
|
|
3196
|
+
checkout_d_BridgeClaimWithdrawalFailed as BridgeClaimWithdrawalFailed,
|
|
3197
|
+
checkout_d_BridgeClaimWithdrawalSuccess as BridgeClaimWithdrawalSuccess,
|
|
3198
|
+
checkout_d_BridgeEventType as BridgeEventType,
|
|
3199
|
+
checkout_d_BridgeFailed as BridgeFailed,
|
|
3200
|
+
checkout_d_BridgeFundingStep as BridgeFundingStep,
|
|
3201
|
+
checkout_d_BridgeTransactionSent as BridgeTransactionSent,
|
|
3202
|
+
checkout_d_BridgeWidgetConfiguration as BridgeWidgetConfiguration,
|
|
3203
|
+
checkout_d_BridgeWidgetParams as BridgeWidgetParams,
|
|
3204
|
+
checkout_d_BuyOrder as BuyOrder,
|
|
3205
|
+
checkout_d_BuyOverrides as BuyOverrides,
|
|
3206
|
+
checkout_d_BuyParams as BuyParams,
|
|
3207
|
+
checkout_d_BuyResult as BuyResult,
|
|
3208
|
+
checkout_d_BuyResultFailed as BuyResultFailed,
|
|
3209
|
+
checkout_d_BuyResultFulfillmentsUnsettled as BuyResultFulfillmentsUnsettled,
|
|
3210
|
+
checkout_d_BuyResultInsufficientFunds as BuyResultInsufficientFunds,
|
|
3211
|
+
checkout_d_BuyResultSuccess as BuyResultSuccess,
|
|
3212
|
+
checkout_d_BuyToken as BuyToken,
|
|
3213
|
+
checkout_d_CancelOverrides as CancelOverrides,
|
|
3214
|
+
checkout_d_CancelParams as CancelParams,
|
|
3215
|
+
checkout_d_CancelResult as CancelResult,
|
|
3216
|
+
checkout_d_CancelResultFailed as CancelResultFailed,
|
|
3217
|
+
checkout_d_CancelResultFulfillmentsUnsettled as CancelResultFulfillmentsUnsettled,
|
|
3218
|
+
checkout_d_CancelResultGasless as CancelResultGasless,
|
|
3219
|
+
checkout_d_CancelResultSuccess as CancelResultSuccess,
|
|
3220
|
+
checkout_d_ChainId as ChainId,
|
|
3221
|
+
checkout_d_ChainName as ChainName,
|
|
3222
|
+
checkout_d_ChainSlug as ChainSlug,
|
|
3223
|
+
checkout_d_CheckConnectionParams as CheckConnectionParams,
|
|
3224
|
+
checkout_d_CheckConnectionResult as CheckConnectionResult,
|
|
3225
|
+
checkout_d_Checkout as Checkout,
|
|
3226
|
+
checkout_d_CheckoutBridgeConfiguration as CheckoutBridgeConfiguration,
|
|
3227
|
+
checkout_d_CheckoutConfiguration as CheckoutConfiguration,
|
|
3228
|
+
checkout_d_CheckoutErrorType as CheckoutErrorType,
|
|
3229
|
+
checkout_d_CheckoutModuleConfiguration as CheckoutModuleConfiguration,
|
|
3230
|
+
checkout_d_CheckoutOnRampConfiguration as CheckoutOnRampConfiguration,
|
|
3231
|
+
checkout_d_CheckoutStatus as CheckoutStatus,
|
|
3232
|
+
checkout_d_CheckoutSwapConfiguration as CheckoutSwapConfiguration,
|
|
3233
|
+
checkout_d_CheckoutWidgetsConfig as CheckoutWidgetsConfig,
|
|
3234
|
+
checkout_d_ConnectEventType as ConnectEventType,
|
|
3235
|
+
checkout_d_ConnectParams as ConnectParams,
|
|
3236
|
+
checkout_d_ConnectResult as ConnectResult,
|
|
3237
|
+
checkout_d_ConnectTargetLayer as ConnectTargetLayer,
|
|
3238
|
+
checkout_d_ConnectWidgetConfiguration as ConnectWidgetConfiguration,
|
|
3239
|
+
checkout_d_ConnectWidgetParams as ConnectWidgetParams,
|
|
3240
|
+
checkout_d_ConnectionFailed as ConnectionFailed,
|
|
3241
|
+
checkout_d_ConnectionSuccess as ConnectionSuccess,
|
|
3242
|
+
checkout_d_CreateProviderParams as CreateProviderParams,
|
|
3243
|
+
checkout_d_CreateProviderResult as CreateProviderResult,
|
|
3244
|
+
checkout_d_DexConfig as DexConfig,
|
|
3245
|
+
checkout_d_EIP1193Provider as EIP1193Provider,
|
|
3246
|
+
checkout_d_EIP6963ProviderDetail as EIP6963ProviderDetail,
|
|
3247
|
+
checkout_d_EIP6963ProviderInfo as EIP6963ProviderInfo,
|
|
3248
|
+
checkout_d_ERC20ItemRequirement as ERC20ItemRequirement,
|
|
3249
|
+
checkout_d_ERC721Balance as ERC721Balance,
|
|
3250
|
+
checkout_d_ERC721ItemRequirement as ERC721ItemRequirement,
|
|
3251
|
+
checkout_d_ErrorType as ErrorType,
|
|
3252
|
+
checkout_d_ExchangeType as ExchangeType,
|
|
3253
|
+
checkout_d_FailedGaslessCancellation as FailedGaslessCancellation,
|
|
3254
|
+
checkout_d_Fee as Fee,
|
|
3255
|
+
checkout_d_FeePercentage as FeePercentage,
|
|
3256
|
+
checkout_d_FeeToken as FeeToken,
|
|
3257
|
+
checkout_d_FeeType as FeeType,
|
|
3258
|
+
checkout_d_FiatRampParams as FiatRampParams,
|
|
3259
|
+
checkout_d_FulfillmentTransaction as FulfillmentTransaction,
|
|
3260
|
+
checkout_d_FundingItem as FundingItem,
|
|
3261
|
+
checkout_d_FundingRoute as FundingRoute,
|
|
3262
|
+
checkout_d_FundingStep as FundingStep,
|
|
3263
|
+
checkout_d_FundingStepType as FundingStepType,
|
|
3264
|
+
checkout_d_GasAmount as GasAmount,
|
|
3265
|
+
checkout_d_GasEstimateBridgeToL2Result as GasEstimateBridgeToL2Result,
|
|
3266
|
+
checkout_d_GasEstimateParams as GasEstimateParams,
|
|
3267
|
+
checkout_d_GasEstimateSwapResult as GasEstimateSwapResult,
|
|
3268
|
+
checkout_d_GasEstimateTokenConfig as GasEstimateTokenConfig,
|
|
3269
|
+
checkout_d_GasEstimateType as GasEstimateType,
|
|
3270
|
+
checkout_d_GasToken as GasToken,
|
|
3271
|
+
checkout_d_GasTokenType as GasTokenType,
|
|
3272
|
+
checkout_d_GetAllBalancesParams as GetAllBalancesParams,
|
|
3273
|
+
checkout_d_GetAllBalancesResult as GetAllBalancesResult,
|
|
3274
|
+
checkout_d_GetBalanceParams as GetBalanceParams,
|
|
3275
|
+
checkout_d_GetBalanceResult as GetBalanceResult,
|
|
3276
|
+
checkout_d_GetNetworkAllowListParams as GetNetworkAllowListParams,
|
|
3277
|
+
checkout_d_GetNetworkAllowListResult as GetNetworkAllowListResult,
|
|
3278
|
+
checkout_d_GetNetworkParams as GetNetworkParams,
|
|
3279
|
+
checkout_d_GetTokenAllowListParams as GetTokenAllowListParams,
|
|
3280
|
+
checkout_d_GetTokenAllowListResult as GetTokenAllowListResult,
|
|
3281
|
+
checkout_d_GetTokenInfoParams as GetTokenInfoParams,
|
|
3282
|
+
checkout_d_GetWalletAllowListParams as GetWalletAllowListParams,
|
|
3283
|
+
checkout_d_GetWalletAllowListResult as GetWalletAllowListResult,
|
|
3284
|
+
checkout_d_IMMUTABLE_API_BASE_URL as IMMUTABLE_API_BASE_URL,
|
|
3285
|
+
checkout_d_IMTBLWidgetEvents as IMTBLWidgetEvents,
|
|
3286
|
+
checkout_d_IWidgetsFactory as IWidgetsFactory,
|
|
3287
|
+
checkout_d_ItemBalance as ItemBalance,
|
|
3288
|
+
checkout_d_ItemType as ItemType,
|
|
3289
|
+
checkout_d_LanguageChanged as LanguageChanged,
|
|
3290
|
+
checkout_d_NativeItemRequirement as NativeItemRequirement,
|
|
3291
|
+
checkout_d_NetworkFilter as NetworkFilter,
|
|
3292
|
+
checkout_d_NetworkFilterTypes as NetworkFilterTypes,
|
|
3293
|
+
checkout_d_NetworkInfo as NetworkInfo,
|
|
3294
|
+
checkout_d_NoRouteOptions as NoRouteOptions,
|
|
3295
|
+
checkout_d_NoRoutesFound as NoRoutesFound,
|
|
3296
|
+
checkout_d_OnRampEventType as OnRampEventType,
|
|
3297
|
+
checkout_d_OnRampFailed as OnRampFailed,
|
|
3298
|
+
checkout_d_OnRampFundingStep as OnRampFundingStep,
|
|
3299
|
+
checkout_d_OnRampProviderFees as OnRampProviderFees,
|
|
3300
|
+
checkout_d_OnRampSuccess as OnRampSuccess,
|
|
3301
|
+
checkout_d_OnRampWidgetParams as OnRampWidgetParams,
|
|
3302
|
+
checkout_d_OnrampWidgetConfiguration as OnrampWidgetConfiguration,
|
|
3303
|
+
checkout_d_OrchestrationEvent as OrchestrationEvent,
|
|
3304
|
+
checkout_d_OrchestrationEventData as OrchestrationEventData,
|
|
3305
|
+
checkout_d_OrchestrationEventType as OrchestrationEventType,
|
|
3306
|
+
checkout_d_OrderFee as OrderFee,
|
|
3307
|
+
checkout_d_PendingGaslessCancellation as PendingGaslessCancellation,
|
|
3308
|
+
checkout_d_ProviderEvent as ProviderEvent,
|
|
3309
|
+
checkout_d_ProviderEventType as ProviderEventType,
|
|
3310
|
+
checkout_d_ProviderUpdated as ProviderUpdated,
|
|
3311
|
+
checkout_d_RemoteConfiguration as RemoteConfiguration,
|
|
3312
|
+
checkout_d_RequestBridgeEvent as RequestBridgeEvent,
|
|
3313
|
+
checkout_d_RequestConnectEvent as RequestConnectEvent,
|
|
3314
|
+
checkout_d_RequestOnrampEvent as RequestOnrampEvent,
|
|
3315
|
+
checkout_d_RequestSwapEvent as RequestSwapEvent,
|
|
3316
|
+
checkout_d_RequestWalletEvent as RequestWalletEvent,
|
|
3317
|
+
checkout_d_RoutesFound as RoutesFound,
|
|
3318
|
+
checkout_d_RoutingOutcome as RoutingOutcome,
|
|
3319
|
+
checkout_d_RoutingOutcomeType as RoutingOutcomeType,
|
|
3320
|
+
checkout_d_SaleEventType as SaleEventType,
|
|
3321
|
+
checkout_d_SaleFailed as SaleFailed,
|
|
3322
|
+
checkout_d_SaleItem as SaleItem,
|
|
3323
|
+
checkout_d_SalePaymentMethod as SalePaymentMethod,
|
|
3324
|
+
checkout_d_SalePaymentToken as SalePaymentToken,
|
|
3325
|
+
checkout_d_SalePaymentTypes as SalePaymentTypes,
|
|
3326
|
+
checkout_d_SaleSuccess as SaleSuccess,
|
|
3327
|
+
checkout_d_SaleTransactionSuccess as SaleTransactionSuccess,
|
|
3328
|
+
checkout_d_SaleWidgetConfiguration as SaleWidgetConfiguration,
|
|
3329
|
+
checkout_d_SaleWidgetParams as SaleWidgetParams,
|
|
3330
|
+
checkout_d_SellOrder as SellOrder,
|
|
3331
|
+
checkout_d_SellParams as SellParams,
|
|
3332
|
+
checkout_d_SellResult as SellResult,
|
|
3333
|
+
checkout_d_SellResultFailed as SellResultFailed,
|
|
3334
|
+
checkout_d_SellResultInsufficientFunds as SellResultInsufficientFunds,
|
|
3335
|
+
checkout_d_SellResultSuccess as SellResultSuccess,
|
|
3336
|
+
checkout_d_SellToken as SellToken,
|
|
3337
|
+
checkout_d_SemanticVersion as SemanticVersion,
|
|
3338
|
+
checkout_d_SendTransactionParams as SendTransactionParams,
|
|
3339
|
+
checkout_d_SendTransactionResult as SendTransactionResult,
|
|
3340
|
+
checkout_d_SmartCheckoutInsufficient as SmartCheckoutInsufficient,
|
|
3341
|
+
checkout_d_SmartCheckoutParams as SmartCheckoutParams,
|
|
3342
|
+
checkout_d_SmartCheckoutResult as SmartCheckoutResult,
|
|
3343
|
+
checkout_d_SmartCheckoutRouter as SmartCheckoutRouter,
|
|
3344
|
+
checkout_d_SmartCheckoutSufficient as SmartCheckoutSufficient,
|
|
3345
|
+
checkout_d_SuccessfulGaslessCancellation as SuccessfulGaslessCancellation,
|
|
3346
|
+
checkout_d_SwapEventType as SwapEventType,
|
|
3347
|
+
checkout_d_SwapFailed as SwapFailed,
|
|
3348
|
+
checkout_d_SwapFundingStep as SwapFundingStep,
|
|
3349
|
+
checkout_d_SwapRejected as SwapRejected,
|
|
3350
|
+
checkout_d_SwapSuccess as SwapSuccess,
|
|
3351
|
+
checkout_d_SwapWidgetConfiguration as SwapWidgetConfiguration,
|
|
3352
|
+
checkout_d_SwapWidgetParams as SwapWidgetParams,
|
|
3353
|
+
checkout_d_SwitchNetworkParams as SwitchNetworkParams,
|
|
3354
|
+
checkout_d_SwitchNetworkResult as SwitchNetworkResult,
|
|
3355
|
+
checkout_d_TokenAmountEstimate as TokenAmountEstimate,
|
|
3356
|
+
checkout_d_TokenBalance as TokenBalance,
|
|
3357
|
+
checkout_d_TokenFilter as TokenFilter,
|
|
3358
|
+
checkout_d_TokenFilterTypes as TokenFilterTypes,
|
|
3359
|
+
checkout_d_TokenInfo as TokenInfo,
|
|
3360
|
+
checkout_d_TransactionOrGasType as TransactionOrGasType,
|
|
3361
|
+
checkout_d_TransactionRequirement as TransactionRequirement,
|
|
3362
|
+
checkout_d_WalletConnectConfig as WalletConnectConfig,
|
|
3363
|
+
checkout_d_WalletConnectManager as WalletConnectManager,
|
|
3364
|
+
checkout_d_WalletConnectProviderChanged as WalletConnectProviderChanged,
|
|
3365
|
+
checkout_d_WalletDisconnect as WalletDisconnect,
|
|
3366
|
+
checkout_d_WalletEventType as WalletEventType,
|
|
3367
|
+
checkout_d_WalletFilter as WalletFilter,
|
|
3368
|
+
checkout_d_WalletFilterTypes as WalletFilterTypes,
|
|
3369
|
+
checkout_d_WalletInfo as WalletInfo,
|
|
3370
|
+
checkout_d_WalletNetworkSwitch as WalletNetworkSwitch,
|
|
3371
|
+
checkout_d_WalletProviderName as WalletProviderName,
|
|
3372
|
+
checkout_d_WalletProviderRdns as WalletProviderRdns,
|
|
3373
|
+
checkout_d_WalletWidgetConfiguration as WalletWidgetConfiguration,
|
|
3374
|
+
checkout_d_WalletWidgetParams as WalletWidgetParams,
|
|
3375
|
+
checkout_d_Widget as Widget,
|
|
3376
|
+
checkout_d_WidgetConfiguration as WidgetConfiguration,
|
|
3377
|
+
checkout_d_WidgetConfigurations as WidgetConfigurations,
|
|
3378
|
+
checkout_d_WidgetEvent as WidgetEvent,
|
|
3379
|
+
checkout_d_WidgetEventData as WidgetEventData,
|
|
3380
|
+
checkout_d_WidgetEventTypes as WidgetEventTypes,
|
|
3381
|
+
checkout_d_WidgetLanguage as WidgetLanguage,
|
|
3382
|
+
checkout_d_WidgetParameters as WidgetParameters,
|
|
3383
|
+
checkout_d_WidgetProperties as WidgetProperties,
|
|
3384
|
+
checkout_d_WidgetTheme as WidgetTheme,
|
|
3385
|
+
checkout_d_WidgetType as WidgetType,
|
|
3386
|
+
checkout_d_getMetaMaskProviderDetail as getMetaMaskProviderDetail,
|
|
3387
|
+
checkout_d_getPassportProviderDetail as getPassportProviderDetail,
|
|
3388
|
+
checkout_d_validateProvider as validateProvider,
|
|
3389
|
+
};
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
export { ConnectResult as $, AllowedNetworkConfig as A, BalanceDelta as B, Checkout as C, BuyResultFulfillmentsUnsettled as D, EIP1193Provider as E, FeeType as F, GasEstimateType as G, BuyToken as H, IMMUTABLE_API_BASE_URL as I, CancelParams as J, CancelOverrides as K, CancelResult as L, CancelResultFailed as M, NetworkFilterTypes as N, CancelResultGasless as O, CancelResultSuccess as P, CancelResultFulfillmentsUnsettled as Q, RoutingOutcomeType as R, CheckConnectionParams as S, TokenFilterTypes as T, CheckConnectionResult as U, CheckoutModuleConfiguration as V, WalletFilterTypes as W, CheckoutOnRampConfiguration as X, CheckoutBridgeConfiguration as Y, CheckoutSwapConfiguration as Z, ConnectParams as _, getMetaMaskProviderDetail as a, SwitchNetworkResult as a$, CreateProviderParams as a0, CreateProviderResult as a1, DexConfig as a2, ERC20ItemRequirement as a3, ERC721Balance as a4, ERC721ItemRequirement as a5, FailedGaslessCancellation as a6, Fee as a7, FeePercentage as a8, FeeToken as a9, NetworkInfo as aA, NoRouteOptions as aB, NoRoutesFound as aC, OnRampFundingStep as aD, OrderFee as aE, OnRampProviderFees as aF, PendingGaslessCancellation as aG, RemoteConfiguration as aH, RoutesFound as aI, RoutingOutcome as aJ, SellOrder as aK, SellParams as aL, SellResult as aM, SellResultFailed as aN, SellResultInsufficientFunds as aO, SellResultSuccess as aP, SellToken as aQ, SendTransactionParams as aR, SendTransactionResult as aS, SmartCheckoutInsufficient as aT, SmartCheckoutParams as aU, SmartCheckoutResult as aV, SmartCheckoutRouter as aW, SmartCheckoutSufficient as aX, SuccessfulGaslessCancellation as aY, SwapFundingStep as aZ, SwitchNetworkParams as a_, FiatRampParams as aa, FulfillmentTransaction as ab, FundingItem as ac, FundingRoute as ad, FundingStep as ae, GasAmount as af, GasEstimateBridgeToL2Result as ag, GasEstimateParams as ah, GasEstimateSwapResult as ai, GasEstimateTokenConfig as aj, GasToken as ak, GetAllBalancesParams as al, GetAllBalancesResult as am, GetBalanceParams as an, GetBalanceResult as ao, GetNetworkAllowListParams as ap, GetNetworkAllowListResult as aq, GetNetworkParams as ar, GetTokenInfoParams as as, GetTokenAllowListParams as at, GetTokenAllowListResult as au, GetWalletAllowListParams as av, GetWalletAllowListResult as aw, ItemBalance as ax, NativeItemRequirement as ay, NetworkFilter as az, ChainId as b, ConnectWidgetParams as b$, TokenAmountEstimate as b0, TokenBalance as b1, TokenFilter as b2, TokenInfo as b3, TransactionRequirement as b4, WalletFilter as b5, WalletInfo as b6, ErrorType as b7, CheckoutErrorType as b8, CheckoutConfiguration as b9, BridgeFailed as bA, BridgeClaimWithdrawalSuccess as bB, BridgeClaimWithdrawalFailed as bC, OrchestrationEventType as bD, RequestConnectEvent as bE, RequestWalletEvent as bF, RequestSwapEvent as bG, RequestBridgeEvent as bH, RequestOnrampEvent as bI, OrchestrationEventData as bJ, OnRampEventType as bK, OnRampSuccess as bL, OnRampFailed as bM, WidgetType as bN, WidgetProperties as bO, WidgetConfigurations as bP, WidgetParameters as bQ, WidgetEventTypes as bR, WidgetEventData as bS, WidgetEvent as bT, OrchestrationEvent as bU, ProviderEvent as bV, IWidgetsFactory as bW, Widget as bX, SemanticVersion as bY, CheckoutWidgetsConfig as bZ, ConnectTargetLayer as b_, BlockExplorerService as ba, IMTBLWidgetEvents as bb, ProviderEventType as bc, ProviderUpdated as bd, LanguageChanged as be, ConnectEventType as bf, ConnectionSuccess as bg, ConnectionFailed as bh, WalletConnectProviderChanged as bi, WalletConnectManager as bj, WalletEventType as bk, WalletNetworkSwitch as bl, WalletDisconnect as bm, SwapEventType as bn, SwapSuccess as bo, SwapFailed as bp, SwapRejected as bq, SaleEventType as br, SaleSuccess as bs, SaleFailed as bt, SaleTransactionSuccess as bu, SalePaymentMethod as bv, SalePaymentToken as bw, SalePaymentTypes as bx, BridgeEventType as by, BridgeTransactionSent as bz, checkout_d as c, BridgeWidgetParams as c0, WalletWidgetParams as c1, SwapWidgetParams as c2, OnRampWidgetParams as c3, SaleWidgetParams as c4, SaleItem as c5, ConnectWidgetConfiguration as c6, BridgeWidgetConfiguration as c7, WalletWidgetConfiguration as c8, SwapWidgetConfiguration as c9, OnrampWidgetConfiguration as ca, SaleWidgetConfiguration as cb, WidgetTheme as cc, WidgetConfiguration as cd, WidgetLanguage as ce, WalletConnectConfig as cf, ChainName as d, ChainSlug as e, CheckoutStatus as f, getPassportProviderDetail as g, EIP6963ProviderInfo as h, EIP6963ProviderDetail as i, ExchangeType as j, FundingStepType as k, GasTokenType as l, ItemType as m, TransactionOrGasType as n, WalletProviderName as o, WalletProviderRdns as p, AvailableRoutingOptions as q, BridgeFundingStep as r, BuyOrder as s, BuyParams as t, BuyOverrides as u, validateProvider as v, BuyResult as w, BuyResultFailed as x, BuyResultInsufficientFunds as y, BuyResultSuccess as z };
|