@coin-voyage/shared 2.4.4-beta.0 → 2.4.4-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.
@@ -1,4 +1,3 @@
1
- import { CurrencyBase } from "../types";
2
1
  export declare const FIAT_CURRENCIES: readonly ["USD", "EUR"];
3
2
  export type FiatCurrency = (typeof FIAT_CURRENCIES)[number];
4
3
  export interface CurrencyExchangeRate {
@@ -15,4 +14,3 @@ export declare const nonUsdCurrencies: {
15
14
  currency: string;
16
15
  decimals: number;
17
16
  }[];
18
- export declare function currencyID(currency: CurrencyBase): string;
@@ -25,6 +25,3 @@ export const nonUsdCurrencies = data.map(([name, symbol, currency, decimals]) =>
25
25
  currency,
26
26
  decimals,
27
27
  }));
28
- export function currencyID(currency) {
29
- return currency.address ? `${currency.address}:${currency.chain_id}` : currency.chain_id.toString();
30
- }
@@ -1,5 +1,5 @@
1
1
  import type { ChainId } from "../types/enums";
2
- import type { Currency, CurrencyBase } from "../types/model";
2
+ import { type Currency, type CurrencyBase } from "../types/model";
3
3
  export interface Token {
4
4
  name: string;
5
5
  address?: string;
@@ -1,4 +1,4 @@
1
- import { currencyID } from "./currencies";
1
+ import { currencyID } from "../types/model";
2
2
  const TOKEN_LIST_URL = "https://raw.githubusercontent.com/coin-voyage/token-list/main/tokenlist.json";
3
3
  const normalizeAddress = (address) => address?.toLowerCase() ?? null;
4
4
  export function tokenToCurrency(token) {
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { FiatCurrency } from "../currency/currencies";
3
- import { zPayOrderMetadata, zPayOrderSettings } from "../schemas/pay-order";
2
+ import type { FiatCurrency } from "../currency/currencies";
3
+ import type { zPayOrderMetadata, zPayOrderSettings } from "../schemas/pay-order";
4
4
  import { ChainId, PaymentRail, PayOrderMode, PayOrderStatus, StepKind } from "./enums";
5
5
  export type PayOrder = {
6
6
  id: string;
@@ -34,6 +34,7 @@ export interface CurrencyBase {
34
34
  chain_id: ChainId;
35
35
  address?: string;
36
36
  }
37
+ export declare function currencyID(currency: CurrencyBase): string;
37
38
  export interface CurrencyWithAmount extends Currency {
38
39
  currency_amount: CurrencyAmount;
39
40
  }
@@ -1 +1,3 @@
1
- export {};
1
+ export function currencyID(currency) {
2
+ return currency.address ? `${currency.address}:${currency.chain_id}` : currency.chain_id.toString();
3
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coin-voyage/shared",
3
3
  "description": "Shared utilities for Coin Voyage",
4
- "version": "2.4.4-beta.0",
4
+ "version": "2.4.4-beta.1",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {