@unifold/core 0.1.80 → 0.1.81

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/index.d.mts CHANGED
@@ -258,6 +258,21 @@ declare function getSupportedDestinationTokens(publishableKey?: string, options?
258
258
  */
259
259
  source_chain_type?: ChainType;
260
260
  }): Promise<SupportedDestinationTokensResponse>;
261
+ /**
262
+ * Fiat currency a stablecoin is pegged to (lowercase ISO 4217). Mirrors the
263
+ * API's `FiatCurrency` enum; kept as a local union here because the SDK cannot
264
+ * import server-side types across the package boundary. Named distinctly from
265
+ * the onramp `FiatCurrency` object interface below.
266
+ *
267
+ * This is intentionally an OPEN union: `'usd'` and `'eur'` are listed for
268
+ * editor autocomplete, but the `(string & Record<never, never>)` member keeps
269
+ * the type forward-compatible. If the backend later adds a new fiat currency
270
+ * (e.g. `'gbp'`), an older SDK build still type-checks — the new value is a
271
+ * valid `string`, so consumers can compare/handle it without a TS error and
272
+ * without needing to upgrade. Always treat unknown values defensively rather
273
+ * than assuming USD.
274
+ */
275
+ type StablecoinFiatCurrency = 'usd' | 'eur' | (string & Record<never, never>);
261
276
  interface SupportedToken {
262
277
  symbol: string;
263
278
  /** Slugged `symbol` (e.g. "usdc", "usdc_e", "usdc_perp"). */
@@ -266,6 +281,12 @@ interface SupportedToken {
266
281
  icon_url: string;
267
282
  is_newly_added: boolean;
268
283
  is_stablecoin: boolean;
284
+ /**
285
+ * Fiat currency a stablecoin tracks (e.g. "usd", "eur"). Present only for
286
+ * stablecoins. Consumers must not assume a stablecoin is USD-denominated —
287
+ * check this before treating a token amount as a USD amount.
288
+ */
289
+ stablecoin_fiat_currency?: StablecoinFiatCurrency;
269
290
  chains: SupportedChain[];
270
291
  }
271
292
  interface SupportedDepositTokensResponse {
@@ -297,6 +318,8 @@ interface TokenMetadata {
297
318
  chain_id: string;
298
319
  token_address: string;
299
320
  decimals: number;
321
+ /** Catalog classification from `/v1/public/tokens/token`. */
322
+ is_stablecoin?: boolean;
300
323
  chain_icon_url: string;
301
324
  chain_icon_urls: IconUrl[];
302
325
  }
@@ -400,6 +423,8 @@ interface OnrampQuote {
400
423
  institution_name: string | null;
401
424
  low_kyc: boolean;
402
425
  partner_fee: number | null;
426
+ /** Seconds. Same unit as token `estimated_processing_time`. */
427
+ estimated_processing_time: number;
403
428
  }
404
429
  interface OnrampQuotesRequest {
405
430
  country_code: string;
@@ -1900,6 +1925,7 @@ interface StripeQuotesResponse {
1900
1925
  destination_network: string;
1901
1926
  service_provider: string;
1902
1927
  service_provider_display_name: string;
1928
+ estimated_processing_time: number;
1903
1929
  destination_network_quotes: Record<string, unknown[]>;
1904
1930
  }
1905
1931
  /**
@@ -2897,6 +2923,8 @@ interface OnrampProviderQuote {
2897
2923
  iconUrl: string;
2898
2924
  iconUrls: IconUrl[];
2899
2925
  institutionName: string | null;
2926
+ /** Seconds. Same unit as token `estimatedProcessingTime`. */
2927
+ estimatedProcessingTime: number;
2900
2928
  }
2901
2929
  /** Map a wire {@link OnrampQuote} to the SDK-facing {@link OnrampProviderQuote}. */
2902
2930
  declare function mapOnrampQuote(quote: OnrampQuote): OnrampProviderQuote;
package/dist/index.d.ts CHANGED
@@ -258,6 +258,21 @@ declare function getSupportedDestinationTokens(publishableKey?: string, options?
258
258
  */
259
259
  source_chain_type?: ChainType;
260
260
  }): Promise<SupportedDestinationTokensResponse>;
261
+ /**
262
+ * Fiat currency a stablecoin is pegged to (lowercase ISO 4217). Mirrors the
263
+ * API's `FiatCurrency` enum; kept as a local union here because the SDK cannot
264
+ * import server-side types across the package boundary. Named distinctly from
265
+ * the onramp `FiatCurrency` object interface below.
266
+ *
267
+ * This is intentionally an OPEN union: `'usd'` and `'eur'` are listed for
268
+ * editor autocomplete, but the `(string & Record<never, never>)` member keeps
269
+ * the type forward-compatible. If the backend later adds a new fiat currency
270
+ * (e.g. `'gbp'`), an older SDK build still type-checks — the new value is a
271
+ * valid `string`, so consumers can compare/handle it without a TS error and
272
+ * without needing to upgrade. Always treat unknown values defensively rather
273
+ * than assuming USD.
274
+ */
275
+ type StablecoinFiatCurrency = 'usd' | 'eur' | (string & Record<never, never>);
261
276
  interface SupportedToken {
262
277
  symbol: string;
263
278
  /** Slugged `symbol` (e.g. "usdc", "usdc_e", "usdc_perp"). */
@@ -266,6 +281,12 @@ interface SupportedToken {
266
281
  icon_url: string;
267
282
  is_newly_added: boolean;
268
283
  is_stablecoin: boolean;
284
+ /**
285
+ * Fiat currency a stablecoin tracks (e.g. "usd", "eur"). Present only for
286
+ * stablecoins. Consumers must not assume a stablecoin is USD-denominated —
287
+ * check this before treating a token amount as a USD amount.
288
+ */
289
+ stablecoin_fiat_currency?: StablecoinFiatCurrency;
269
290
  chains: SupportedChain[];
270
291
  }
271
292
  interface SupportedDepositTokensResponse {
@@ -297,6 +318,8 @@ interface TokenMetadata {
297
318
  chain_id: string;
298
319
  token_address: string;
299
320
  decimals: number;
321
+ /** Catalog classification from `/v1/public/tokens/token`. */
322
+ is_stablecoin?: boolean;
300
323
  chain_icon_url: string;
301
324
  chain_icon_urls: IconUrl[];
302
325
  }
@@ -400,6 +423,8 @@ interface OnrampQuote {
400
423
  institution_name: string | null;
401
424
  low_kyc: boolean;
402
425
  partner_fee: number | null;
426
+ /** Seconds. Same unit as token `estimated_processing_time`. */
427
+ estimated_processing_time: number;
403
428
  }
404
429
  interface OnrampQuotesRequest {
405
430
  country_code: string;
@@ -1900,6 +1925,7 @@ interface StripeQuotesResponse {
1900
1925
  destination_network: string;
1901
1926
  service_provider: string;
1902
1927
  service_provider_display_name: string;
1928
+ estimated_processing_time: number;
1903
1929
  destination_network_quotes: Record<string, unknown[]>;
1904
1930
  }
1905
1931
  /**
@@ -2897,6 +2923,8 @@ interface OnrampProviderQuote {
2897
2923
  iconUrl: string;
2898
2924
  iconUrls: IconUrl[];
2899
2925
  institutionName: string | null;
2926
+ /** Seconds. Same unit as token `estimatedProcessingTime`. */
2927
+ estimatedProcessingTime: number;
2900
2928
  }
2901
2929
  /** Map a wire {@link OnrampQuote} to the SDK-facing {@link OnrampProviderQuote}. */
2902
2930
  declare function mapOnrampQuote(quote: OnrampQuote): OnrampProviderQuote;
package/dist/index.js CHANGED
@@ -192,7 +192,7 @@ function generatePrefixedKSUID(prefix) {
192
192
  }
193
193
 
194
194
  // src/lib/client-headers.ts
195
- var SDK_VERSION = true ? "0.1.80" : "0.0.0-dev";
195
+ var SDK_VERSION = true ? "0.1.81" : "0.0.0-dev";
196
196
  var CLIENT_VERSION_HEADER = "x-unifold-client-version";
197
197
  var CLIENT_USER_AGENT_HEADER = "x-unifold-client-user-agent";
198
198
  function detectRuntime() {
@@ -2156,7 +2156,8 @@ function mapOnrampQuote(quote) {
2156
2156
  lowKyc: quote.low_kyc,
2157
2157
  iconUrl: quote.icon_url,
2158
2158
  iconUrls: quote.icon_urls,
2159
- institutionName: quote.institution_name
2159
+ institutionName: quote.institution_name,
2160
+ estimatedProcessingTime: quote.estimated_processing_time
2160
2161
  };
2161
2162
  }
2162
2163
  function mapDefaultOnrampToken(response) {
package/dist/index.mjs CHANGED
@@ -41,7 +41,7 @@ function generatePrefixedKSUID(prefix) {
41
41
  }
42
42
 
43
43
  // src/lib/client-headers.ts
44
- var SDK_VERSION = true ? "0.1.80" : "0.0.0-dev";
44
+ var SDK_VERSION = true ? "0.1.81" : "0.0.0-dev";
45
45
  var CLIENT_VERSION_HEADER = "x-unifold-client-version";
46
46
  var CLIENT_USER_AGENT_HEADER = "x-unifold-client-user-agent";
47
47
  function detectRuntime() {
@@ -2005,7 +2005,8 @@ function mapOnrampQuote(quote) {
2005
2005
  lowKyc: quote.low_kyc,
2006
2006
  iconUrl: quote.icon_url,
2007
2007
  iconUrls: quote.icon_urls,
2008
- institutionName: quote.institution_name
2008
+ institutionName: quote.institution_name,
2009
+ estimatedProcessingTime: quote.estimated_processing_time
2009
2010
  };
2010
2011
  }
2011
2012
  function mapDefaultOnrampToken(response) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/core",
3
- "version": "0.1.80",
3
+ "version": "0.1.81",
4
4
  "description": "Unifold Core SDK - Core types, API client, and business logic",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",