Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions payloads/v0/account.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { APICryptoCurrency, APIMonetary } from './currencies';
import type { APICurrencySymbol, APIMonetary } from './currencies';

export enum APITransactionDirection {
Incoming = 'incoming',
Expand Down Expand Up @@ -42,7 +42,7 @@ export interface APIConnection {
}

export interface APIWallet {
code: APICryptoCurrency;
code: APICurrencySymbol;
name: string;
balance: APIMonetary;
usd_value: APIMonetary;
Expand Down
49 changes: 44 additions & 5 deletions payloads/v0/currencies.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,60 @@
export type APICryptoCurrency = string;
export type APIFiatCurrency = string;
export type APICurrency = string;
export type APICurrencySymbol = string;

export interface APIMonetary {
/* Pattern: `^[0-9]*$` */
value: string;
currency: APICurrency;
currency: APICurrencySymbol;
}

export interface APICoin {
/* Pattern: `^[0-9]*$` */
value: string;
currency: APICryptoCurrency;
currency: APICurrencySymbol;
}

export interface APIExchangeRate {
code: string;
name: string;
usd_value?: APIMonetary;
}

export interface APICryptoCurrencyUnit {
singular: string;
plural?: string;
prefix?: string;
suffix?: string;
scale: number;
aliases?: string[];
minDecimals?: number;
optionalDecimals?: boolean;
min?: number;
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface APIFiatCurrencyUnit extends APICryptoCurrencyUnit {}

export interface APICryptoCurrency {
code: string;
name: string;
color: string;
icon: string;
explorer: string;
feeUnit: string;
format: {
scale: number;
units: APICryptoCurrencyUnit;
};
options: {
extras?: string;
accounts?: boolean;
};
}

export interface APIFiatCurrency {
code: string;
name: string;
format: {
scale: number;
units: APIFiatCurrencyUnit;
};
}
6 changes: 3 additions & 3 deletions rest/v0/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import type {
APIWallet,
APIWithdrawl,
} from '../../payloads/v0/account';
import {
import type {
APICoin,
APICryptoCurrency,
APICurrencySymbol,
APIMonetary,
} from '../../payloads/v0/currencies';

Expand All @@ -34,7 +34,7 @@ export interface RESTGetAPIAccountWalletPath {
* https://api.tip.cc/docs/static/index.html#/wallet/get_api_v0_account_wallets__code__addresses
*/
export interface RESTGetAPIAccountWalletAddressesResult {
code: APICryptoCurrency;
code: APICurrencySymbol;
name: string;
master?: string;
addresses: {
Expand Down
6 changes: 5 additions & 1 deletion rest/v0/currencies.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { APICryptoCurrency, APIExchangeRate, APIFiatCurrency } from '../../v0';
import type {
APICryptoCurrency,
APIFiatCurrency,
APIExchangeRate,
} from '../../v0';

export interface RESTGetAPICurrenciesCryptoCurrenciesResult {
cryptocurrencies: APICryptoCurrency[];
Expand Down