@coin-voyage/shared 2.2.0 → 2.2.2
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/api/client.d.ts +3 -3
- package/dist/api/client.js +1 -1
- package/dist/common/pay-order/types.d.ts +14 -12
- package/package.json +1 -1
package/dist/api/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PayOrder, PayOrderMode } from "../common/index";
|
|
2
2
|
import type { ClaimFeesRequest, ClaimFeesResponse, CreateWebhookRequest, GetFeeBalancesResponse, PaymentDetails, PaymentDetailsParams, PayOrderParams, PayOrderQuoteParams, QuoteWithBalance, SwapDataRequest, SwapDataResponse, SwapQuoteRequest, UpdateWebhookRequest, WebhookResponse } from "../types/api";
|
|
3
3
|
import { type APIEnvironment } from "./config";
|
|
4
4
|
import { type APIResponse } from "./fetcher";
|
|
@@ -140,7 +140,7 @@ export declare class ApiClient {
|
|
|
140
140
|
*
|
|
141
141
|
* @param {string} orderId - The unique identifier of the PayOrder for which the quote is requested.
|
|
142
142
|
* @param {PayOrderQuoteParams} quoteParams - Contains `wallet_address`, `chain_type`, `chain_id`.
|
|
143
|
-
* @returns {Promise<APIResponse<
|
|
143
|
+
* @returns {Promise<APIResponse<QuoteWithBalance[]>>} - An array of PayTokens wrapped in an API response if the request was successful.
|
|
144
144
|
*
|
|
145
145
|
* @example
|
|
146
146
|
* const orderId = 'existingOrderId';
|
|
@@ -155,7 +155,7 @@ export declare class ApiClient {
|
|
|
155
155
|
* console.log('Available tokens:', response.data);
|
|
156
156
|
* }
|
|
157
157
|
*/
|
|
158
|
-
payOrderQuote(orderId: string, quoteParams: PayOrderQuoteParams): Promise<APIResponse<
|
|
158
|
+
payOrderQuote(orderId: string, quoteParams: PayOrderQuoteParams): Promise<APIResponse<QuoteWithBalance[]>>;
|
|
159
159
|
/**
|
|
160
160
|
* Retrieves payment details for a specific PayOrder.
|
|
161
161
|
*
|
package/dist/api/client.js
CHANGED
|
@@ -217,7 +217,7 @@ export class ApiClient {
|
|
|
217
217
|
*
|
|
218
218
|
* @param {string} orderId - The unique identifier of the PayOrder for which the quote is requested.
|
|
219
219
|
* @param {PayOrderQuoteParams} quoteParams - Contains `wallet_address`, `chain_type`, `chain_id`.
|
|
220
|
-
* @returns {Promise<APIResponse<
|
|
220
|
+
* @returns {Promise<APIResponse<QuoteWithBalance[]>>} - An array of PayTokens wrapped in an API response if the request was successful.
|
|
221
221
|
*
|
|
222
222
|
* @example
|
|
223
223
|
* const orderId = 'existingOrderId';
|
|
@@ -14,30 +14,32 @@ export type PayOrder = {
|
|
|
14
14
|
fulfillment: FulfillmentData;
|
|
15
15
|
payment?: PaymentData;
|
|
16
16
|
};
|
|
17
|
-
export interface CurrencyWithTokenFiatAmount extends Currency {
|
|
18
|
-
currency_amount: {
|
|
19
|
-
token: TokenAmount;
|
|
20
|
-
fiat: FiatAmount;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface QuoteWithCurrency extends CurrencyWithAmount {
|
|
24
|
-
total: CurrencyWithAmount;
|
|
25
|
-
base: CurrencyWithAmount;
|
|
26
|
-
fee?: CurrencyWithAmount;
|
|
27
|
-
gas?: CurrencyWithAmount;
|
|
28
|
-
}
|
|
29
17
|
export interface CurrencyWithAmount extends Currency {
|
|
30
18
|
currency_amount: CurrencyAmount;
|
|
31
19
|
}
|
|
20
|
+
export interface QuoteWithCurrency extends CurrencyWithAmount {
|
|
21
|
+
total: CurrencyAmount;
|
|
22
|
+
base: CurrencyAmount;
|
|
23
|
+
fees?: FeeBreakdown;
|
|
24
|
+
gas?: CurrencyAmount;
|
|
25
|
+
}
|
|
32
26
|
export interface CurrencyWithBalance extends CurrencyWithAmount {
|
|
33
27
|
balance?: CurrencyAmount;
|
|
34
28
|
}
|
|
29
|
+
export interface QuoteWithBalance extends QuoteWithCurrency {
|
|
30
|
+
balance?: CurrencyAmount;
|
|
31
|
+
}
|
|
35
32
|
export interface CurrencyAmount {
|
|
36
33
|
ui_amount: number;
|
|
37
34
|
ui_amount_display: string;
|
|
38
35
|
raw_amount: BigIntStr;
|
|
39
36
|
value_usd: number;
|
|
40
37
|
}
|
|
38
|
+
export interface FeeBreakdown {
|
|
39
|
+
total_fee: CurrencyAmount;
|
|
40
|
+
protocol_fee?: CurrencyAmount;
|
|
41
|
+
custom_fee?: CurrencyAmount;
|
|
42
|
+
}
|
|
41
43
|
export type TokenAmount = {
|
|
42
44
|
ui_amount: number;
|
|
43
45
|
raw_amount: BigIntStr;
|