@tetherto/wdk-protocol-fiat-moonpay 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +11 -0
- package/LICENSE +176 -0
- package/README.md +210 -0
- package/bare.js +21 -0
- package/index.js +30 -0
- package/package.json +59 -0
- package/src/moonpay-protocol.js +790 -0
- package/types/index.d.ts +14 -0
- package/types/src/moonpay-protocol.d.ts +928 -0
|
@@ -0,0 +1,928 @@
|
|
|
1
|
+
export default class MoonPayProtocol extends FiatProtocol {
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new interface to interact with the MoonPay protocol without binding it to a wallet account.
|
|
4
|
+
*
|
|
5
|
+
* @overload
|
|
6
|
+
* @param {undefined} account - The wallet account to use to interact with the protocol.
|
|
7
|
+
* @param {MoonPayProtocolConfig} config - The MoonPay protocol configuration.
|
|
8
|
+
*/
|
|
9
|
+
constructor(account: undefined, config: MoonPayProtocolConfig);
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new read-only interface to interact with the MoonPay protocol.
|
|
12
|
+
*
|
|
13
|
+
* @overload
|
|
14
|
+
* @param {IWalletAccountReadOnly} account - The wallet account to use to interact with the protocol.
|
|
15
|
+
* @param {MoonPayProtocolConfig} config - The MoonPay protocol configuration.
|
|
16
|
+
*/
|
|
17
|
+
constructor(account: IWalletAccountReadOnly, config: MoonPayProtocolConfig);
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new interface to interact with the MoonPay protocol.
|
|
20
|
+
*
|
|
21
|
+
* @overload
|
|
22
|
+
* @param {IWalletAccount} account - The wallet account to use to interact with the protocol.
|
|
23
|
+
* @param {MoonPayProtocolConfig} config - The MoonPay protocol configuration.
|
|
24
|
+
*/
|
|
25
|
+
constructor(account: IWalletAccount, config: MoonPayProtocolConfig);
|
|
26
|
+
/** @private */
|
|
27
|
+
private _moonPay;
|
|
28
|
+
/** @private */
|
|
29
|
+
private _apiKey;
|
|
30
|
+
/** @private */
|
|
31
|
+
private _supportedCurrenciesCache;
|
|
32
|
+
/** @private */
|
|
33
|
+
private _cacheThreshold;
|
|
34
|
+
/** @private */
|
|
35
|
+
private _getAssetDetails(cryptoAsset: string, fiatCurrency: string): Promise<{
|
|
36
|
+
cryptoInfo: MoonPayCryptoCurrencyDetails;
|
|
37
|
+
fiatInfo: MoonPayFiatCurrencyDetails;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Generates a widget URL for a user to purchase a crypto asset with fiat currency.
|
|
41
|
+
* @override
|
|
42
|
+
* @param {MoonPayBuyOptions} options - The options for the purchase.
|
|
43
|
+
* @returns {Promise<BuyResult>} The URL for the user to complete the purchase.
|
|
44
|
+
*/
|
|
45
|
+
override buy(options: MoonPayBuyOptions): Promise<BuyResult>;
|
|
46
|
+
/**
|
|
47
|
+
* Gets a quote for a crypto asset purchase.
|
|
48
|
+
* @override
|
|
49
|
+
* @param {MoonPayQuoteBuyOptions} options - The options for the quote.
|
|
50
|
+
* @returns {Promise<MoonPayBuyQuote>} A quote for the transaction.
|
|
51
|
+
*/
|
|
52
|
+
override quoteBuy(options: MoonPayQuoteBuyOptions): Promise<MoonPayBuyQuote>;
|
|
53
|
+
/**
|
|
54
|
+
* Gets a quote for a crypto asset sale.
|
|
55
|
+
* @override
|
|
56
|
+
* @param {MoonPayQuoteSellOptions} options - The options for the quote.
|
|
57
|
+
* @returns {Promise<MoonPaySellQuote>} A quote for the transaction.
|
|
58
|
+
*/
|
|
59
|
+
override quoteSell(options: MoonPayQuoteSellOptions): Promise<MoonPaySellQuote>;
|
|
60
|
+
/**
|
|
61
|
+
* Generates a widget URL for a user to sell a crypto asset for fiat currency.
|
|
62
|
+
* @override
|
|
63
|
+
* @param {MoonPaySellOptions} options - The options for the sale.
|
|
64
|
+
* @returns {Promise<SellResult>} The URL for the user to complete the sale.
|
|
65
|
+
*/
|
|
66
|
+
override sell(options: MoonPaySellOptions): Promise<SellResult>;
|
|
67
|
+
/**
|
|
68
|
+
* Retrieves the details of a specific transaction from the provider.
|
|
69
|
+
* @override
|
|
70
|
+
* @param {string} txId - The unique identifier of the transaction.
|
|
71
|
+
* @param {'buy' | 'sell'} [direction] - The direction of the transaction.
|
|
72
|
+
* @returns {Promise<MoonPayTransactionDetail>} The transaction details.
|
|
73
|
+
*/
|
|
74
|
+
override getTransactionDetail(txId: string, direction?: "buy" | "sell"): Promise<MoonPayTransactionDetail>;
|
|
75
|
+
/**
|
|
76
|
+
* Fetches and caches supported currencies from MoonPay.
|
|
77
|
+
* @private
|
|
78
|
+
* @returns {Promise<Array<MoonPayCryptoCurrencyDetails | MoonPayFiatCurrencyDetails>>}
|
|
79
|
+
*/
|
|
80
|
+
private _fetchAndCacheSupportedCurrencies;
|
|
81
|
+
/**
|
|
82
|
+
* Retrieves a list of supported crypto assets from the provider.
|
|
83
|
+
* @override
|
|
84
|
+
* @returns {Promise<MoonPaySupportedCryptoAsset[]>} An array of supported crypto assets.
|
|
85
|
+
*/
|
|
86
|
+
override getSupportedCryptoAssets(): Promise<MoonPaySupportedCryptoAsset[]>;
|
|
87
|
+
/**
|
|
88
|
+
* Retrieves a list of supported fiat currencies from the provider.
|
|
89
|
+
* @override
|
|
90
|
+
* @returns {Promise<MoonPaySupportedFiatCurrency[]>} An array of supported fiat currencies.
|
|
91
|
+
*/
|
|
92
|
+
override getSupportedFiatCurrencies(): Promise<MoonPaySupportedFiatCurrency[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Retrieves a list of supported countries from the provider.
|
|
95
|
+
* @override
|
|
96
|
+
* @returns {Promise<MoonPaySupportedCountry[]>} An array of supported countries.
|
|
97
|
+
*/
|
|
98
|
+
override getSupportedCountries(): Promise<MoonPaySupportedCountry[]>;
|
|
99
|
+
}
|
|
100
|
+
export type IWalletAccount = import("@tetherto/wdk-wallet").IWalletAccount;
|
|
101
|
+
export type IWalletAccountReadOnly = import("@tetherto/wdk-wallet").IWalletAccountReadOnly;
|
|
102
|
+
export type BuyOptions = import("@tetherto/wdk-wallet/protocols").BuyOptions;
|
|
103
|
+
export type BuyResult = import("@tetherto/wdk-wallet/protocols").BuyResult;
|
|
104
|
+
export type SellOptions = import("@tetherto/wdk-wallet/protocols").SellOptions;
|
|
105
|
+
export type SellCommonOptions = import("@tetherto/wdk-wallet/protocols").SellCommonOptions;
|
|
106
|
+
export type SellExactCryptoAmountOptions = import("@tetherto/wdk-wallet/protocols").SellExactCryptoAmountOptions;
|
|
107
|
+
export type SellResult = import("@tetherto/wdk-wallet/protocols").SellResult;
|
|
108
|
+
export type FiatQuote = import("@tetherto/wdk-wallet/protocols").FiatQuote;
|
|
109
|
+
export type FiatTransactionStatus = import("@tetherto/wdk-wallet/protocols").FiatTransactionStatus;
|
|
110
|
+
export type FiatTransactionDetail = import("@tetherto/wdk-wallet/protocols").FiatTransactionDetail;
|
|
111
|
+
export type SupportedCountry = import("@tetherto/wdk-wallet/protocols").SupportedCountry;
|
|
112
|
+
export type SupportedFiatCurrency = import("@tetherto/wdk-wallet/protocols").SupportedFiatCurrency;
|
|
113
|
+
export type SupportedCryptoAsset = import("@tetherto/wdk-wallet/protocols").SupportedCryptoAsset;
|
|
114
|
+
export type MoonPayWidgetUiParams = {
|
|
115
|
+
/**
|
|
116
|
+
* - The hexadecimal color code for the widget's main color.
|
|
117
|
+
*/
|
|
118
|
+
colorCode?: string;
|
|
119
|
+
/**
|
|
120
|
+
* - The default appearance for the widget.
|
|
121
|
+
*/
|
|
122
|
+
theme?: "dark" | "light";
|
|
123
|
+
/**
|
|
124
|
+
* - The ID of the theme created for your application or website.
|
|
125
|
+
*/
|
|
126
|
+
themeId?: string;
|
|
127
|
+
/**
|
|
128
|
+
* - The ISO 639-1 standard language code for the widget.
|
|
129
|
+
*/
|
|
130
|
+
language?: string;
|
|
131
|
+
/**
|
|
132
|
+
* - If true, shows all cryptocurrencies enabled on your account.
|
|
133
|
+
*/
|
|
134
|
+
showAllCurrencies?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* - A comma-separated list of currency codes to display.
|
|
137
|
+
*/
|
|
138
|
+
showOnlyCurrencies?: string;
|
|
139
|
+
/**
|
|
140
|
+
* - If true, shows the wallet address form even if an address is pre-filled.
|
|
141
|
+
*/
|
|
142
|
+
showWalletAddressForm?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* - A URL to redirect the customer to after the flow is complete.
|
|
145
|
+
*/
|
|
146
|
+
redirectURL?: string;
|
|
147
|
+
/**
|
|
148
|
+
* - A URL to redirect the customer to if they are from an unsupported region.
|
|
149
|
+
*/
|
|
150
|
+
unsupportedRegionRedirectUrl?: string;
|
|
151
|
+
/**
|
|
152
|
+
* - If true, skips the unsupported region screen and redirects immediately.
|
|
153
|
+
*/
|
|
154
|
+
skipUnsupportedRegionScreen?: boolean;
|
|
155
|
+
};
|
|
156
|
+
export type MoonPayWidgetUiBuyParams = {
|
|
157
|
+
/**
|
|
158
|
+
* - The code of the cryptocurrency you would prefer the customer to purchase. The customer can still select another currency. If both currencyCode and defaultCurrencyCode are passed, currencyCode will take precedence.
|
|
159
|
+
*/
|
|
160
|
+
defaultCurrencyCode?: string;
|
|
161
|
+
/**
|
|
162
|
+
* - The cryptocurrency wallet address the purchased funds will be sent to. If you pass a valid wallet address the customer won't be prompted to enter one.
|
|
163
|
+
*/
|
|
164
|
+
walletAddress?: string;
|
|
165
|
+
/**
|
|
166
|
+
* - The secondary cryptocurrency wallet address identifier/memo for coins such as EOS, XLM, XRP and XMR. This parameter will be skipped if walletAddress or currencyCode is not passed.
|
|
167
|
+
*/
|
|
168
|
+
walletAddressTag?: string;
|
|
169
|
+
/**
|
|
170
|
+
* - A JSON string representing the wallet addresses you want to use for multiple cryptocurrencies. If the customer selects a cryptocurrency for which you have passed a valid wallet address, the customer won't be prompted to enter one. The currency code must be lowercase.
|
|
171
|
+
*/
|
|
172
|
+
walletAddresses?: string;
|
|
173
|
+
/**
|
|
174
|
+
* - A JSON string representing the wallet address tags you want to use for various cryptocurrencies. An example with EOS and XRP wallet address tags: {"eos":"myeostag","xrp":"0123456789"}.
|
|
175
|
+
*/
|
|
176
|
+
walletAddressTags?: string;
|
|
177
|
+
/**
|
|
178
|
+
* - The contract address of the token you want pre-selected for the user in the widget. [Only supported for DeFi Buy integrations.]
|
|
179
|
+
*/
|
|
180
|
+
contractAddress?: string;
|
|
181
|
+
/**
|
|
182
|
+
* - Defines the network where the token contract exists (e.g., solana, ethereum). Must match the blockchain where the token contract is deployed. [Only supported for DeFi Buy integrations.]
|
|
183
|
+
*/
|
|
184
|
+
networkCode?: string;
|
|
185
|
+
/**
|
|
186
|
+
* - Set this parameter to true to lock the baseCurrencyAmount set for the customer and prevent them from modifying it. This parameter will be skipped if baseCurrencyAmount is not passed.
|
|
187
|
+
*/
|
|
188
|
+
lockAmount?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* - The customer's email address. If you pass a valid email address, the customer won't be prompted to enter one.
|
|
191
|
+
*/
|
|
192
|
+
email?: string;
|
|
193
|
+
/**
|
|
194
|
+
* - An identifier you would like to associate with the transaction. This identifier will be present whenever we pass you transaction data.
|
|
195
|
+
*/
|
|
196
|
+
externalTransactionId?: string;
|
|
197
|
+
/**
|
|
198
|
+
* - An identifier you would like to associate with the customer. This identifier will be present whenever we pass you customer data, allowing you to match our data with your own existing customer data.
|
|
199
|
+
*/
|
|
200
|
+
externalCustomerId?: string;
|
|
201
|
+
/**
|
|
202
|
+
* - Pre-select the payment method you want the customer to use.
|
|
203
|
+
*/
|
|
204
|
+
paymentMethod?: string;
|
|
205
|
+
};
|
|
206
|
+
export type MoonPayBuyParams = MoonPayWidgetUiParams & MoonPayWidgetUiBuyParams;
|
|
207
|
+
export type MoonPayWidgetUiSellParams = {
|
|
208
|
+
/**
|
|
209
|
+
* - The code of the cryptocurrency you would prefer the customer to sell. If you pass a defaultBaseCurrencyCode, the currency will be selected by default, but the customer will still be able to select another currency.
|
|
210
|
+
*/
|
|
211
|
+
defaultBaseCurrencyCode?: string;
|
|
212
|
+
/**
|
|
213
|
+
* - A JSON string representing the wallet addresses you want to use for various cryptocurrencies in case we have to issue a refund. An example with BTC and BCH wallet addresses: {"btc": "tb1qst9rvjnhym6kwmdkwgfs4h5dtp7cau5346jp9x", "bch": "bchtest:qraax8trdwct02968swqf4mpq3y5msqp8y7tmalm77"}
|
|
214
|
+
*/
|
|
215
|
+
refundWalletAddresses?: string;
|
|
216
|
+
/**
|
|
217
|
+
* - Set this parameter to true to lock the baseCurrencyAmount set for the customer and prevent them from modifying it. This parameter will be skipped if baseCurrencyAmount is not passed.
|
|
218
|
+
*/
|
|
219
|
+
lockAmount?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* - The customer's email address. If you pass a valid email address, the customer won't be prompted to enter one.
|
|
222
|
+
*/
|
|
223
|
+
email?: string;
|
|
224
|
+
/**
|
|
225
|
+
* - An identifier you would like to associate with the transaction. This identifier will be present whenever we pass you transaction data.
|
|
226
|
+
*/
|
|
227
|
+
externalTransactionId?: string;
|
|
228
|
+
/**
|
|
229
|
+
* - An identifier you would like to associate with the customer. This identifier will be present whenever we pass you customer data, allowing you to match our data with your own existing customer data.
|
|
230
|
+
*/
|
|
231
|
+
externalCustomerId?: string;
|
|
232
|
+
/**
|
|
233
|
+
* - Pre-select the payout method you want the customer to use.
|
|
234
|
+
*/
|
|
235
|
+
paymentMethod?: string;
|
|
236
|
+
};
|
|
237
|
+
export type MoonPaySellParams = MoonPayWidgetUiParams & MoonPayWidgetUiSellParams;
|
|
238
|
+
export type MoonPayQuoteBuyParams = {
|
|
239
|
+
/**
|
|
240
|
+
* - A positive integer representing your extra fee percentage for the transaction. The minimum is 0 and the maximum is 10. If you don't provide it, we'll use the default value set to your account.
|
|
241
|
+
*/
|
|
242
|
+
extraFeePercentage?: number;
|
|
243
|
+
/**
|
|
244
|
+
* - The transaction's payment method.
|
|
245
|
+
*/
|
|
246
|
+
paymentMethod?: string;
|
|
247
|
+
/**
|
|
248
|
+
* - A boolean indicating whether baseCurrencyAmount should include extra fees. Defaults to false.
|
|
249
|
+
*/
|
|
250
|
+
areFeesIncluded?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* - Wallet address of the customer who requested the quote.
|
|
253
|
+
*/
|
|
254
|
+
walletAddress?: string;
|
|
255
|
+
};
|
|
256
|
+
export type MoonPayQuoteSellParams = {
|
|
257
|
+
/**
|
|
258
|
+
* - A positive integer representing your extra fee percentage for the transaction. The minimum is 0 and the maximum is 10. If you don't provide it, we'll use the default value set to your account.
|
|
259
|
+
*/
|
|
260
|
+
extraFeePercentage?: number;
|
|
261
|
+
/**
|
|
262
|
+
* - The transaction's payment method.
|
|
263
|
+
*/
|
|
264
|
+
payoutMethod?: string;
|
|
265
|
+
};
|
|
266
|
+
export type MoonPayBankDepositInfo = {
|
|
267
|
+
/**
|
|
268
|
+
* - The IBAN of the bank account.
|
|
269
|
+
*/
|
|
270
|
+
iban: string | null;
|
|
271
|
+
/**
|
|
272
|
+
* - The BIC of the bank account.
|
|
273
|
+
*/
|
|
274
|
+
bic: string | null;
|
|
275
|
+
/**
|
|
276
|
+
* - The account number of the bank account.
|
|
277
|
+
*/
|
|
278
|
+
accountNumber: string | null;
|
|
279
|
+
/**
|
|
280
|
+
* - The sort code of the bank account.
|
|
281
|
+
*/
|
|
282
|
+
sortCode: string | null;
|
|
283
|
+
/**
|
|
284
|
+
* - The name of the bank.
|
|
285
|
+
*/
|
|
286
|
+
bankName: string | null;
|
|
287
|
+
/**
|
|
288
|
+
* - The address of the bank.
|
|
289
|
+
*/
|
|
290
|
+
bankAddress: string | null;
|
|
291
|
+
/**
|
|
292
|
+
* - The account name of the bank account.
|
|
293
|
+
*/
|
|
294
|
+
accountName: string;
|
|
295
|
+
/**
|
|
296
|
+
* - The address of the bank account.
|
|
297
|
+
*/
|
|
298
|
+
accountAddress: string;
|
|
299
|
+
};
|
|
300
|
+
export type MoonPayFiatCurrencyDetails = {
|
|
301
|
+
/**
|
|
302
|
+
* - Unique identifier for the currency.
|
|
303
|
+
*/
|
|
304
|
+
id: string;
|
|
305
|
+
/**
|
|
306
|
+
* - Time at which the object was created. Returned as an ISO 8601 string.
|
|
307
|
+
*/
|
|
308
|
+
createdAt: string;
|
|
309
|
+
/**
|
|
310
|
+
* - Time at which the object was last updated. Returned as an ISO 8601 string.
|
|
311
|
+
*/
|
|
312
|
+
updatedAt: string;
|
|
313
|
+
/**
|
|
314
|
+
* - Always 'fiat'.
|
|
315
|
+
*/
|
|
316
|
+
type: "fiat";
|
|
317
|
+
/**
|
|
318
|
+
* - The currency's name.
|
|
319
|
+
*/
|
|
320
|
+
name: string;
|
|
321
|
+
/**
|
|
322
|
+
* - The currency's code.
|
|
323
|
+
*/
|
|
324
|
+
code: string;
|
|
325
|
+
/**
|
|
326
|
+
* - The currency's precision (number of digits after decimal point).
|
|
327
|
+
*/
|
|
328
|
+
precision: number;
|
|
329
|
+
/**
|
|
330
|
+
* - The currency's decimals.
|
|
331
|
+
*/
|
|
332
|
+
decimals: number | null;
|
|
333
|
+
/**
|
|
334
|
+
* - Represents the minimum transaction buy amount when using this currency as a base currency.
|
|
335
|
+
*/
|
|
336
|
+
minBuyAmount: number | null;
|
|
337
|
+
/**
|
|
338
|
+
* - Represents the maximum transaction buy amount when using this currency as a base currency.
|
|
339
|
+
*/
|
|
340
|
+
maxBuyAmount: number | null;
|
|
341
|
+
/**
|
|
342
|
+
* - Whether sales for this currency are supported.
|
|
343
|
+
*/
|
|
344
|
+
isSellSupported: boolean;
|
|
345
|
+
};
|
|
346
|
+
export type MoonPayCryptoCurrencyDetails = {
|
|
347
|
+
/**
|
|
348
|
+
* - Unique identifier for the currency.
|
|
349
|
+
*/
|
|
350
|
+
id: string;
|
|
351
|
+
/**
|
|
352
|
+
* - Time at which the object was created. Returned as an ISO 8601 string.
|
|
353
|
+
*/
|
|
354
|
+
createdAt: string;
|
|
355
|
+
/**
|
|
356
|
+
* - Time at which the object was last updated. Returned as an ISO 8601 string.
|
|
357
|
+
*/
|
|
358
|
+
updatedAt: string;
|
|
359
|
+
/**
|
|
360
|
+
* - Always 'crypto'.
|
|
361
|
+
*/
|
|
362
|
+
type: "crypto";
|
|
363
|
+
/**
|
|
364
|
+
* - The currency's name.
|
|
365
|
+
*/
|
|
366
|
+
name: string;
|
|
367
|
+
/**
|
|
368
|
+
* - The currency's code.
|
|
369
|
+
*/
|
|
370
|
+
code: string;
|
|
371
|
+
/**
|
|
372
|
+
* - The currency's precision (number of digits after decimal point).
|
|
373
|
+
*/
|
|
374
|
+
precision: number;
|
|
375
|
+
/**
|
|
376
|
+
* - The currency's decimals.
|
|
377
|
+
*/
|
|
378
|
+
decimals: number;
|
|
379
|
+
/**
|
|
380
|
+
* - Represents the minimum amount of cryptocurrency you can buy.
|
|
381
|
+
*/
|
|
382
|
+
minBuyAmount: number | null;
|
|
383
|
+
/**
|
|
384
|
+
* - Represents the maximum amount of cryptocurrency you can buy.
|
|
385
|
+
*/
|
|
386
|
+
maxBuyAmount: number | null;
|
|
387
|
+
/**
|
|
388
|
+
* - The minimum amount of cryptocurrency you can sell.
|
|
389
|
+
*/
|
|
390
|
+
minSellAmount: number | null;
|
|
391
|
+
/**
|
|
392
|
+
* - The maximum amount of cryptocurrency you can sell.
|
|
393
|
+
*/
|
|
394
|
+
maxSellAmount: number | null;
|
|
395
|
+
/**
|
|
396
|
+
* - A regular expression which you can test against your end user's wallet addresses.
|
|
397
|
+
*/
|
|
398
|
+
addressRegex: string;
|
|
399
|
+
/**
|
|
400
|
+
* - A regular expression which you can test against your end user's testnet wallet addresses.
|
|
401
|
+
*/
|
|
402
|
+
testnetAddressRegex: string;
|
|
403
|
+
/**
|
|
404
|
+
* - Whether the currency supports address tags.
|
|
405
|
+
*/
|
|
406
|
+
supportsAddressTag: boolean;
|
|
407
|
+
/**
|
|
408
|
+
* - A regular expression which you can test against a wallet address tag. Defined only if the currency supports address tags.
|
|
409
|
+
*/
|
|
410
|
+
addressTagRegex: string | null;
|
|
411
|
+
/**
|
|
412
|
+
* - Whether the currency supports test mode.
|
|
413
|
+
*/
|
|
414
|
+
supportsTestMode: boolean;
|
|
415
|
+
/**
|
|
416
|
+
* - Whether purchases for this currency are suspended.
|
|
417
|
+
*/
|
|
418
|
+
isSuspended: boolean;
|
|
419
|
+
/**
|
|
420
|
+
* - Whether purchases for this currency are supported in the US.
|
|
421
|
+
*/
|
|
422
|
+
isSupportedInUs: boolean;
|
|
423
|
+
/**
|
|
424
|
+
* - Whether sales for this currency are supported.
|
|
425
|
+
*/
|
|
426
|
+
isSellSupported: boolean;
|
|
427
|
+
/**
|
|
428
|
+
* - A list with all the US states for this currency that are not supported.
|
|
429
|
+
*/
|
|
430
|
+
notAllowedUSStates: Array<string>;
|
|
431
|
+
/**
|
|
432
|
+
* - A list with all the ISO 3166-1 alpha-2 country codes for this currency that are not supported.
|
|
433
|
+
*/
|
|
434
|
+
notAllowedCountries: Array<string>;
|
|
435
|
+
/**
|
|
436
|
+
* - Additional metadata for the currency.
|
|
437
|
+
*/
|
|
438
|
+
metadata: {
|
|
439
|
+
contractAddress: string | null;
|
|
440
|
+
chainId: string | null;
|
|
441
|
+
networkCode: string;
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
export type MoonPayBuyTransactionStage = {
|
|
445
|
+
/**
|
|
446
|
+
* - Stage type.
|
|
447
|
+
*/
|
|
448
|
+
stage: "stage_one_ordering" | "stage_two_verification" | "stage_three_processing" | "stage_four_delivery";
|
|
449
|
+
/**
|
|
450
|
+
* - Stage status.
|
|
451
|
+
*/
|
|
452
|
+
status: "not_started" | "in_progress" | "success" | "failed";
|
|
453
|
+
/**
|
|
454
|
+
* - Possible values for failure reason.
|
|
455
|
+
*/
|
|
456
|
+
failureReason: string | null;
|
|
457
|
+
/**
|
|
458
|
+
* - An array of actions required for the stage.
|
|
459
|
+
*/
|
|
460
|
+
actions: Array<{
|
|
461
|
+
type: string;
|
|
462
|
+
url: string;
|
|
463
|
+
}>;
|
|
464
|
+
};
|
|
465
|
+
/**
|
|
466
|
+
* Type definition for the status of a MoonPay transaction.
|
|
467
|
+
*/
|
|
468
|
+
export type MoonPayTransactionStatus = "waitingForDeposit" | "pending" | "failed" | "completed";
|
|
469
|
+
export type MoonPayBuyTransaction = {
|
|
470
|
+
/**
|
|
471
|
+
* - Unique identifier for the object.
|
|
472
|
+
*/
|
|
473
|
+
id: string;
|
|
474
|
+
/**
|
|
475
|
+
* - Time at which the object was created. Returned as an ISO 8601 string.
|
|
476
|
+
*/
|
|
477
|
+
createdAt: string;
|
|
478
|
+
/**
|
|
479
|
+
* - Time at which the object was last updated. Returned as an ISO 8601 string.
|
|
480
|
+
*/
|
|
481
|
+
updatedAt: string;
|
|
482
|
+
/**
|
|
483
|
+
* - A positive number representing how much the customer wants to sell.
|
|
484
|
+
*/
|
|
485
|
+
baseCurrencyAmount: number;
|
|
486
|
+
/**
|
|
487
|
+
* - A positive number representing the amount of cryptocurrency the customer will receive.
|
|
488
|
+
*/
|
|
489
|
+
quoteCurrencyAmount: number;
|
|
490
|
+
/**
|
|
491
|
+
* - A positive number representing the fee for the transaction.
|
|
492
|
+
*/
|
|
493
|
+
feeAmount: number;
|
|
494
|
+
/**
|
|
495
|
+
* - A positive number representing your extra fee for the transaction.
|
|
496
|
+
*/
|
|
497
|
+
extraFeeAmount: number;
|
|
498
|
+
/**
|
|
499
|
+
* - The transaction's payout method.
|
|
500
|
+
*/
|
|
501
|
+
paymentMethod: string;
|
|
502
|
+
/**
|
|
503
|
+
* - The network fee for the transaction.
|
|
504
|
+
*/
|
|
505
|
+
networkFeeAmount: number;
|
|
506
|
+
/**
|
|
507
|
+
* - A boolean indicating whether baseCurrencyAmount includes or excludes the feeAmount, extraFeeAmount and networkFeeAmount.
|
|
508
|
+
*/
|
|
509
|
+
areFeesIncluded: boolean;
|
|
510
|
+
/**
|
|
511
|
+
* - The transaction's status.
|
|
512
|
+
*/
|
|
513
|
+
status: MoonPayTransactionStatus;
|
|
514
|
+
/**
|
|
515
|
+
* - The transaction's failure reason. Set when transaction's status is failed.
|
|
516
|
+
*/
|
|
517
|
+
failureReason: string | null;
|
|
518
|
+
/**
|
|
519
|
+
* - The cryptocurrency wallet address the purchased funds will be sent to.
|
|
520
|
+
*/
|
|
521
|
+
walletAddress: string;
|
|
522
|
+
/**
|
|
523
|
+
* - The secondary cryptocurrency wallet address identifier for coins such as EOS, XRP and XMR.
|
|
524
|
+
*/
|
|
525
|
+
walletAddressTag: string | null;
|
|
526
|
+
/**
|
|
527
|
+
* - The cryptocurrency transaction identifier representing the transfer to the customer's wallet. Set when the withdrawal has been executed.
|
|
528
|
+
*/
|
|
529
|
+
cryptoTransactionId: string | null;
|
|
530
|
+
/**
|
|
531
|
+
* - The URL provided to you, when required, to which to redirect the customer as part of a redirect authentication flow.
|
|
532
|
+
*/
|
|
533
|
+
redirectUrl: string | null;
|
|
534
|
+
/**
|
|
535
|
+
* - The URL the customer is returned to after they authenticate or cancel their payment on the payment method's app or site. If you are using our widget implementation, this is always our transaction tracker page, which provides the customer with real-time information about their transaction.
|
|
536
|
+
*/
|
|
537
|
+
returnUrl: string;
|
|
538
|
+
/**
|
|
539
|
+
* - An optional URL used in a widget implementation. It is passed to us by you in the query parameters, and we include it as a link on the transaction tracker page.
|
|
540
|
+
*/
|
|
541
|
+
widgetRedirectUrl: string | null;
|
|
542
|
+
/**
|
|
543
|
+
* - The exchange rate between the transaction's base currency and Euro at the time of the transaction.
|
|
544
|
+
*/
|
|
545
|
+
eurRate: number;
|
|
546
|
+
/**
|
|
547
|
+
* - The exchange rate between the transaction's base currency and US Dollar at the time of the transaction.
|
|
548
|
+
*/
|
|
549
|
+
usdRate: number;
|
|
550
|
+
/**
|
|
551
|
+
* - The exchange rate between the transaction's base currency and British Pound at the time of the transaction.
|
|
552
|
+
*/
|
|
553
|
+
gbpRate: number;
|
|
554
|
+
/**
|
|
555
|
+
* - Information about the bank deposit.
|
|
556
|
+
*/
|
|
557
|
+
bankDepositInformation: MoonPayBankDepositInfo | null;
|
|
558
|
+
/**
|
|
559
|
+
* - For bank transfer transactions, the reference code the customer should cite when making the transfer.
|
|
560
|
+
*/
|
|
561
|
+
bankTransferReference: string | null;
|
|
562
|
+
/**
|
|
563
|
+
* - The identifier of the cryptocurrency the customer wants to purchase.
|
|
564
|
+
*/
|
|
565
|
+
currencyId: string;
|
|
566
|
+
/**
|
|
567
|
+
* - Details of the crypto currency.
|
|
568
|
+
*/
|
|
569
|
+
currency: MoonPayCryptoCurrencyDetails;
|
|
570
|
+
/**
|
|
571
|
+
* - The identifier of the fiat currency the customer wants to use for the transaction.
|
|
572
|
+
*/
|
|
573
|
+
baseCurrencyId: string;
|
|
574
|
+
/**
|
|
575
|
+
* - Details of the fiat currency.
|
|
576
|
+
*/
|
|
577
|
+
baseCurrency: MoonPayFiatCurrencyDetails;
|
|
578
|
+
/**
|
|
579
|
+
* - The identifier of the customer the transaction is associated with.
|
|
580
|
+
*/
|
|
581
|
+
customerId: string;
|
|
582
|
+
/**
|
|
583
|
+
* - For token or card transactions, the identifier of the payment card used for this transaction.
|
|
584
|
+
*/
|
|
585
|
+
cardId: string | null;
|
|
586
|
+
/**
|
|
587
|
+
* - For bank transfer transactions, the identifier of the bank account used for this transaction.
|
|
588
|
+
*/
|
|
589
|
+
bankAccountId: string | null;
|
|
590
|
+
/**
|
|
591
|
+
* - An identifier associated with the customer, provided by you.
|
|
592
|
+
*/
|
|
593
|
+
externalCustomerId: string | null;
|
|
594
|
+
/**
|
|
595
|
+
* - An identifier associated with the transaction, provided by you.
|
|
596
|
+
*/
|
|
597
|
+
externalTransactionId: string | null;
|
|
598
|
+
/**
|
|
599
|
+
* - The customer's country. Returned as an ISO 3166-1 alpha-3 code.
|
|
600
|
+
*/
|
|
601
|
+
country: string;
|
|
602
|
+
/**
|
|
603
|
+
* - The customer's state, if the customer is from the USA. Returned as a two-letter code.
|
|
604
|
+
*/
|
|
605
|
+
state: string | null;
|
|
606
|
+
/**
|
|
607
|
+
* - The customer's state, if the customer is from the USA. Returned as a two-letter code.
|
|
608
|
+
*/
|
|
609
|
+
cardType: string | null;
|
|
610
|
+
/**
|
|
611
|
+
* - The customer's state, if the customer is from the USA. Returned as a two-letter code.
|
|
612
|
+
*/
|
|
613
|
+
cardPaymentType: string;
|
|
614
|
+
/**
|
|
615
|
+
* - An array of four objects, each representing one of the four stages of the purchase process.
|
|
616
|
+
*/
|
|
617
|
+
stages: Array<MoonPayBuyTransactionStage>;
|
|
618
|
+
};
|
|
619
|
+
export type MoonPaySellTransactionStage = {
|
|
620
|
+
/**
|
|
621
|
+
* - Stage type.
|
|
622
|
+
*/
|
|
623
|
+
stage: "sell_stage_one_verification" | "sell_stage_two_waiting_for_deposit" | "sell_stage_three_processing" | "sell_stage_four_withdrawal";
|
|
624
|
+
/**
|
|
625
|
+
* - Stage status.
|
|
626
|
+
*/
|
|
627
|
+
status: "not_started" | "in_progress" | "success" | "failed";
|
|
628
|
+
/**
|
|
629
|
+
* - Possible values for failure reason.
|
|
630
|
+
*/
|
|
631
|
+
failureReason: string | null;
|
|
632
|
+
/**
|
|
633
|
+
* - An array of actions required for the stage.
|
|
634
|
+
*/
|
|
635
|
+
actions: Array<{
|
|
636
|
+
type: string;
|
|
637
|
+
url: string;
|
|
638
|
+
}>;
|
|
639
|
+
};
|
|
640
|
+
export type MoonPaySellTransaction = {
|
|
641
|
+
/**
|
|
642
|
+
* - Unique identifier for the object.
|
|
643
|
+
*/
|
|
644
|
+
id: string;
|
|
645
|
+
/**
|
|
646
|
+
* - Time at which the object was created. Returned as an ISO 8601 string.
|
|
647
|
+
*/
|
|
648
|
+
createdAt: string;
|
|
649
|
+
/**
|
|
650
|
+
* - Time at which the object was last updated. Returned as an ISO 8601 string.
|
|
651
|
+
*/
|
|
652
|
+
updatedAt: string;
|
|
653
|
+
/**
|
|
654
|
+
* - A positive number representing how much the customer wants to sell.
|
|
655
|
+
*/
|
|
656
|
+
baseCurrencyAmount: number;
|
|
657
|
+
/**
|
|
658
|
+
* - A positive number representing the amount of cryptocurrency the customer will receive. Set when the purchase of cryptocurrency has been executed.
|
|
659
|
+
*/
|
|
660
|
+
quoteCurrencyAmount: number;
|
|
661
|
+
/**
|
|
662
|
+
* - A positive number representing the fee for the transaction.
|
|
663
|
+
*/
|
|
664
|
+
feeAmount: number;
|
|
665
|
+
/**
|
|
666
|
+
* - A positive number representing your extra fee for the transaction.
|
|
667
|
+
*/
|
|
668
|
+
extraFeeAmount: number;
|
|
669
|
+
/**
|
|
670
|
+
* - The transaction's status.
|
|
671
|
+
*/
|
|
672
|
+
status: MoonPayTransactionStatus;
|
|
673
|
+
/**
|
|
674
|
+
* - The transaction's failure reason. Set when transaction's status is failed.
|
|
675
|
+
*/
|
|
676
|
+
failureReason: string | null;
|
|
677
|
+
/**
|
|
678
|
+
* - A wallet address at which the customer can receive cryptocurrency. In case we cannot process the sale of the customer's cryptocurrency, we will return the cryptocurrency to this wallet address. Might be empty
|
|
679
|
+
*/
|
|
680
|
+
refundWalletAddress: string;
|
|
681
|
+
/**
|
|
682
|
+
* - The cryptocurrency transaction identifier representing the transfer from the customer's wallet to MoonPay's wallet. Set when the deposit has been executed and received.
|
|
683
|
+
*/
|
|
684
|
+
depositHash: string | null;
|
|
685
|
+
/**
|
|
686
|
+
* - An optional URL used in a widget implementation. It is passed to us by you in the query parameters, and we include it as a link on the transaction tracker page.
|
|
687
|
+
*/
|
|
688
|
+
widgetRedirectUrl: string | null;
|
|
689
|
+
/**
|
|
690
|
+
* - The transaction's payout method.
|
|
691
|
+
*/
|
|
692
|
+
payoutMethod: string;
|
|
693
|
+
/**
|
|
694
|
+
* - The exchange rate between the transaction's base currency and Euro at the time of the transaction.
|
|
695
|
+
*/
|
|
696
|
+
eurRate: number;
|
|
697
|
+
/**
|
|
698
|
+
* - The exchange rate between the transaction's base currency and US Dollar at the time of the transaction.
|
|
699
|
+
*/
|
|
700
|
+
usdRate: number;
|
|
701
|
+
/**
|
|
702
|
+
* - The exchange rate between the transaction's base currency and British Pound at the time of the transaction.
|
|
703
|
+
*/
|
|
704
|
+
gbpRate: number;
|
|
705
|
+
/**
|
|
706
|
+
* - The identifier of the fiat the customer wants to get.
|
|
707
|
+
*/
|
|
708
|
+
quoteCurrencyId: string;
|
|
709
|
+
/**
|
|
710
|
+
* - The identifier of the crypto currency the customer wants to sell.
|
|
711
|
+
*/
|
|
712
|
+
baseCurrencyId: string;
|
|
713
|
+
/**
|
|
714
|
+
* - The identifier of the customer the transaction is associated with.
|
|
715
|
+
*/
|
|
716
|
+
customerId: string;
|
|
717
|
+
/**
|
|
718
|
+
* - The identifier of the bank account used for this transaction.
|
|
719
|
+
*/
|
|
720
|
+
bankAccountId: string | null;
|
|
721
|
+
/**
|
|
722
|
+
* - An identifier associated with the customer, provided by you.
|
|
723
|
+
*/
|
|
724
|
+
externalCustomerId: string | null;
|
|
725
|
+
/**
|
|
726
|
+
* - An identifier associated with the transaction, provided by you.
|
|
727
|
+
*/
|
|
728
|
+
externalTransactionId: string | null;
|
|
729
|
+
/**
|
|
730
|
+
* - An array of objects, each representing one of the stages of the sell process.
|
|
731
|
+
*/
|
|
732
|
+
stages: Array<MoonPaySellTransactionStage>;
|
|
733
|
+
/**
|
|
734
|
+
* - Details of the crypto currency.
|
|
735
|
+
*/
|
|
736
|
+
baseCurrency: MoonPayCryptoCurrencyDetails;
|
|
737
|
+
/**
|
|
738
|
+
* - Details of the fiat currency.
|
|
739
|
+
*/
|
|
740
|
+
quoteCurrency: MoonPayFiatCurrencyDetails;
|
|
741
|
+
};
|
|
742
|
+
export type MoonPayCountryDetail = {
|
|
743
|
+
/**
|
|
744
|
+
* - The country's ISO 3166-1 alpha-2 code.
|
|
745
|
+
*/
|
|
746
|
+
alpha2: string;
|
|
747
|
+
/**
|
|
748
|
+
* - The country's ISO 3166-1 alpha-3 code.
|
|
749
|
+
*/
|
|
750
|
+
alpha3: string;
|
|
751
|
+
/**
|
|
752
|
+
* - Whether residents of this country can use the service.
|
|
753
|
+
*/
|
|
754
|
+
isAllowed: boolean;
|
|
755
|
+
/**
|
|
756
|
+
* - Whether residents of this country can buy cryptocurrencies.
|
|
757
|
+
*/
|
|
758
|
+
isBuyAllowed: boolean;
|
|
759
|
+
/**
|
|
760
|
+
* - Whether residents of this country can sell cryptocurrencies.
|
|
761
|
+
*/
|
|
762
|
+
isSellAllowed: boolean;
|
|
763
|
+
/**
|
|
764
|
+
* - The country's name.
|
|
765
|
+
*/
|
|
766
|
+
name: string;
|
|
767
|
+
/**
|
|
768
|
+
* - A list of supported identity documents for the country.
|
|
769
|
+
*/
|
|
770
|
+
supportedDocuments: string[];
|
|
771
|
+
};
|
|
772
|
+
export type MoonPayBuyQuoteMetadata = {
|
|
773
|
+
/**
|
|
774
|
+
* - ID of your business account
|
|
775
|
+
*/
|
|
776
|
+
accountId: string;
|
|
777
|
+
/**
|
|
778
|
+
* - The fiat currency the customer wants to use for the transaction.
|
|
779
|
+
*/
|
|
780
|
+
baseCurrency: MoonPayFiatCurrencyDetails;
|
|
781
|
+
baseCurrencyCode: string;
|
|
782
|
+
/**
|
|
783
|
+
* - A positive number representing how much the customer wants to spend. The minimum amount is 20.
|
|
784
|
+
*/
|
|
785
|
+
baseCurrencyAmount: number;
|
|
786
|
+
/**
|
|
787
|
+
* - The cryptocurrency the customer wants to purchase.
|
|
788
|
+
*/
|
|
789
|
+
quoteCurrency: MoonPayCryptoCurrencyDetails;
|
|
790
|
+
quoteCurrencyCode: string;
|
|
791
|
+
/**
|
|
792
|
+
* - A positive number representing the amount of cryptocurrency the customer will receive. Set when the purchase of cryptocurrency has been executed.
|
|
793
|
+
*/
|
|
794
|
+
quoteCurrencyAmount: number;
|
|
795
|
+
/**
|
|
796
|
+
* - The price of the crypto the customer will receive
|
|
797
|
+
*/
|
|
798
|
+
quoteCurrencyPrice: number;
|
|
799
|
+
/**
|
|
800
|
+
* - The transaction's payment method.
|
|
801
|
+
*/
|
|
802
|
+
paymentMethod: string;
|
|
803
|
+
/**
|
|
804
|
+
* - A positive number representing the fee for the transaction.
|
|
805
|
+
*/
|
|
806
|
+
feeAmount: number;
|
|
807
|
+
extraFeePercentage: number;
|
|
808
|
+
extraFeeAmount: number;
|
|
809
|
+
/**
|
|
810
|
+
* - A positive number representing the network fee for the transaction. It is added to baseCurrencyAmount, feeAmount and extraFeeAmount when the customer's card is charged.
|
|
811
|
+
*/
|
|
812
|
+
networkFeeAmount: number;
|
|
813
|
+
networkFeeAmountNonRefundable: boolean;
|
|
814
|
+
totalAmount: number;
|
|
815
|
+
externalId: string | null;
|
|
816
|
+
externalCustomerId: string | null;
|
|
817
|
+
/**
|
|
818
|
+
* - The signature for executing the quote for fixed flow
|
|
819
|
+
*/
|
|
820
|
+
signature: string | null;
|
|
821
|
+
/**
|
|
822
|
+
* - The time in seconds until the quote expires.
|
|
823
|
+
*/
|
|
824
|
+
expiresIn: number | null;
|
|
825
|
+
/**
|
|
826
|
+
* - Time at which the quote expires. Returned as an ISO 8601 string.
|
|
827
|
+
*/
|
|
828
|
+
expiresAt: string | null;
|
|
829
|
+
};
|
|
830
|
+
export type MoonPaySellQuoteMetadata = {
|
|
831
|
+
/**
|
|
832
|
+
* - Fiat currency the customer wants to get.
|
|
833
|
+
*/
|
|
834
|
+
quoteCurrencyCode: string;
|
|
835
|
+
/**
|
|
836
|
+
* - The fiat currency the customer wants to use for the transaction.
|
|
837
|
+
*/
|
|
838
|
+
quoteCurrency: MoonPayFiatCurrencyDetails;
|
|
839
|
+
/**
|
|
840
|
+
* - Crypto currency the customer wants to sell.
|
|
841
|
+
*/
|
|
842
|
+
baseCurrencyCode: string;
|
|
843
|
+
/**
|
|
844
|
+
* - The cryptocurrency the customer wants to sell.
|
|
845
|
+
*/
|
|
846
|
+
baseCurrency: MoonPayCryptoCurrencyDetails;
|
|
847
|
+
/**
|
|
848
|
+
* - A positive number representing how much the customer wants to sell.
|
|
849
|
+
*/
|
|
850
|
+
baseCurrencyAmount: number;
|
|
851
|
+
/**
|
|
852
|
+
* - A positive number representing the amount of cryptocurrency the customer will receive.
|
|
853
|
+
*/
|
|
854
|
+
quoteCurrencyAmount: number;
|
|
855
|
+
/**
|
|
856
|
+
* - The price of the crypto the customer wants to sell
|
|
857
|
+
*/
|
|
858
|
+
baseCurrencyPrice: number;
|
|
859
|
+
/**
|
|
860
|
+
* - A positive number representing the fee for the transaction.
|
|
861
|
+
*/
|
|
862
|
+
feeAmount: number;
|
|
863
|
+
/**
|
|
864
|
+
* - A positive number representing your extra fee for the transaction.
|
|
865
|
+
*/
|
|
866
|
+
extraFeeAmount: number;
|
|
867
|
+
/**
|
|
868
|
+
* - The transaction's payout method.
|
|
869
|
+
*/
|
|
870
|
+
payoutMethod: string;
|
|
871
|
+
/**
|
|
872
|
+
* - The signature for executing the quote for fixed flow
|
|
873
|
+
*/
|
|
874
|
+
signature: string | null;
|
|
875
|
+
/**
|
|
876
|
+
* - The time in seconds until the quote expires.
|
|
877
|
+
*/
|
|
878
|
+
expiresIn: number | null;
|
|
879
|
+
/**
|
|
880
|
+
* - Time at which the quote expires. Returned as an ISO 8601 string.
|
|
881
|
+
*/
|
|
882
|
+
expiresAt: string | null;
|
|
883
|
+
};
|
|
884
|
+
export type MoonPayTransactionDetail = FiatTransactionDetail & {
|
|
885
|
+
metadata: MoonPayBuyTransaction | MoonPaySellTransaction;
|
|
886
|
+
};
|
|
887
|
+
export type MoonPaySupportedCountry = SupportedCountry & {
|
|
888
|
+
metadata: MoonPayCountryDetail;
|
|
889
|
+
};
|
|
890
|
+
export type MoonPaySupportedCryptoAsset = SupportedCryptoAsset & {
|
|
891
|
+
metadata: MoonPayCryptoCurrencyDetails;
|
|
892
|
+
};
|
|
893
|
+
export type MoonPaySupportedFiatCurrency = SupportedFiatCurrency & {
|
|
894
|
+
metadata: MoonPayFiatCurrencyDetails;
|
|
895
|
+
};
|
|
896
|
+
export type MoonPayBuyOptions = BuyOptions & {
|
|
897
|
+
config?: MoonPayBuyParams;
|
|
898
|
+
};
|
|
899
|
+
export type MoonPayQuoteBuyOptions = Omit<BuyOptions, "recipient"> & {
|
|
900
|
+
config?: MoonPayQuoteBuyParams;
|
|
901
|
+
};
|
|
902
|
+
export type MoonPayBuyQuote = FiatQuote & {
|
|
903
|
+
metadata: MoonPayBuyQuoteMetadata;
|
|
904
|
+
};
|
|
905
|
+
export type MoonPayQuoteSellOptions = Omit<SellCommonOptions, "refundAddress"> & SellExactCryptoAmountOptions & {
|
|
906
|
+
config?: MoonPayQuoteSellParams;
|
|
907
|
+
};
|
|
908
|
+
export type MoonPaySellQuote = FiatQuote & {
|
|
909
|
+
metadata: MoonPaySellQuoteMetadata;
|
|
910
|
+
};
|
|
911
|
+
export type MoonPaySellOptions = SellOptions & {
|
|
912
|
+
config?: MoonPaySellParams;
|
|
913
|
+
};
|
|
914
|
+
export type MoonPayProtocolConfig = {
|
|
915
|
+
/**
|
|
916
|
+
* - Your secret key. MoonPay determines the environment (sandbox or production) based on this key.
|
|
917
|
+
*/
|
|
918
|
+
secretKey: string;
|
|
919
|
+
/**
|
|
920
|
+
* - Your publishable API key.
|
|
921
|
+
*/
|
|
922
|
+
apiKey: string;
|
|
923
|
+
/**
|
|
924
|
+
* - The duration in milliseconds to cache supported currencies.
|
|
925
|
+
*/
|
|
926
|
+
cacheTime?: number;
|
|
927
|
+
};
|
|
928
|
+
import { FiatProtocol } from '@tetherto/wdk-wallet/protocols';
|