diff --git a/docs/classes/index.ForexClient.html b/docs/classes/index.ForexClient.html index 0a36e3d..62999aa 100644 --- a/docs/classes/index.ForexClient.html +++ b/docs/classes/index.ForexClient.html @@ -1,163 +1,163 @@ ForexClient | @kabeep/forex - v1.0.0

A client to interact with the Forex API for fetching currency rates and conversion data

-

Hierarchy (view full)

Constructors

constructor +

A client to interact with the Forex API for fetching currency rates and conversion data

+

Hierarchy (view full)

Constructors

Properties

Methods

getCurrencies @@ -169,14 +169,14 @@ _fetch

Constructors

Properties

timeout: number
headers: HeadersInit

Methods

Returns ForexClient

Properties

timeout: number
headers: HeadersInit

Methods

  • Fetches the list of available currencies

    Parameters

    • Optionaldate: Date | "latest" = 'latest'

      The date for fetching currencies, or "latest" for the most recent

    • Optionaloptions: RequestInit = {}

      Additional request options

    Returns Promise<HttpResponse<AvailableCurrency[]>>

    A list of available currencies

    // => {
    // code: 200,
    // message: 'OK',
    // data: [
    // { code: 'eur', name: 'Euro' },
    // { code: 'usd', name: 'US Dollar' },
    // { code: 'cny', name: 'Chinese Yuan Renminbi' },
    // ... More items
    // ]
    // }
    new ForexClient().getCurrencies('latest');
    -

Hierarchy (view full)

Constructors

constructor +

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

timeout: number
headers: HeadersInit

Methods

Hierarchy (view full)

Constructors

constructor +

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

timeout: number
headers: HeadersInit

Methods

+

forex

💱 一个 JavaScript 外汇库,通过 fawazahmed0 的 API。

NodeJS @@ -562,7 +562,7 @@

forex

exchange-api - 如果没有这个,这个包就不会存在。

欢迎通过 Pull Requests 或 Issues 来贡献你的想法和代码。

本项目采用 MIT 许可证。详情请见 LICENSE 文件。

-

@kabeep/forex

+

@kabeep/forex

forex

💱 A JavaScript foreign exchange library via fawazahmed0's API.

NodeJS @@ -562,7 +562,7 @@

forex

exchange-api - This package would not exist without this.

Contributions via Pull Requests or Issues are welcome.

This project is licensed under the MIT License. See the LICENSE file for details.

-

Interface AvailableCurrency

interface AvailableCurrency {
    code: string;
    name: string;
}

Properties

code +

Interface AvailableCurrency

interface AvailableCurrency {
    code: string;
    name: string;
}

Properties

Properties

code: string
name: string

Interface ExchangeRate

interface ExchangeRate {
    code: string;
    rate: number;
}

Properties

code +

Interface ExchangeRate

interface ExchangeRate {
    code: string;
    rate: number;
}

Properties

Properties

code: string
rate: number

Interface ForexClientOptions

interface ForexClientOptions {
    baseCurrency?: string;
    minified?: boolean;
    timeout?: number;
    headers?: HeadersInit;
}

Hierarchy (view full)

Properties

baseCurrency? +

Interface ForexClientOptions

interface ForexClientOptions {
    baseCurrency?: string;
    minified?: boolean;
    timeout?: number;
    headers?: HeadersInit;
}

Hierarchy (view full)

Properties

baseCurrency?: string
minified?: boolean
timeout?: number
headers?: HeadersInit

Interface HttpRequestOptions

interface HttpRequestOptions {
    timeout?: number;
    headers?: HeadersInit;
}

Hierarchy (view full)

Properties

timeout? +

Interface HttpRequestOptions

interface HttpRequestOptions {
    timeout?: number;
    headers?: HeadersInit;
}

Hierarchy (view full)

Properties

Properties

timeout?: number
headers?: HeadersInit

Interface HttpResponse<T>

interface HttpResponse<T> {
    code: number;
    message: string;
    data?: T;
}

Type Parameters

  • T

Properties

code +

Interface HttpResponse<T>

interface HttpResponse<T> {
    code: number;
    message: string;
    data?: T;
}

Type Parameters

  • T

Properties

Properties

code: number
message: string
data?: T

@kabeep/forex

Index

Documents

简体中文 +

@kabeep/forex

Index

Documents

Modules

Index

Classes

HttpClient +

Index

Classes

Type Aliases

Module index

Index

Modules

<internal> +

Type Alias OriginalExchangeRates

OriginalExchangeRates: {
    [key: string]: Record<string, number>;
} & {
    date: string;
}

Type Alias OriginalExchangeRates

OriginalExchangeRates: {
    [key: string]: Record<string, number>;
} & {
    date: string;
}
HeadersInit: [string, string][] | Record<string, string> | Headers
HeadersInit: [string, string][] | Record<string, string> | Headers
Pick<T, K>: {
    [P in K]: T[P]
}

From T, pick a set of properties whose keys are in the union K

-

Type Parameters

  • T
  • K extends keyof T
Pick<T, K>: {
    [P in K]: T[P]
}

From T, pick a set of properties whose keys are in the union K

+

Type Parameters

  • T
  • K extends keyof T

Type Alias Record<K, T>

Record<K, T>: {
    [P in K]: T
}

Construct a type with a set of properties K of type T

-

Type Parameters

  • K extends keyof any
  • T

Type Alias Record<K, T>

Record<K, T>: {
    [P in K]: T
}

Construct a type with a set of properties K of type T

+

Type Parameters

  • K extends keyof any
  • T

Variable BASE_URLConst

BASE_URL: "https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api" = 'https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api'

https://github.com/fawazahmed0/exchange-api

+

Variable BASE_URLConst

BASE_URL: "https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api" = 'https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api'

https://github.com/fawazahmed0/exchange-api

export const BASE_URL =
'https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api';
-

Variable BASE_URL_VERSIONConst

BASE_URL_VERSION: "v1" = 'v1'

https://github.com/fawazahmed0/exchange-api

+

Variable BASE_URL_VERSIONConst

BASE_URL_VERSION: "v1" = 'v1'

https://github.com/fawazahmed0/exchange-api

export const BASE_URL_VERSION = 'v1';
 
-

Variable LOCALE_CURRENCYConst

LOCALE_CURRENCY: {
    AD: string;
    AE: string;
    AF: string;
    AG: string;
    AI: string;
    AL: string;
    AM: string;
    AO: string;
    AR: string;
    AS: string;
    AT: string;
    AU: string;
    AW: string;
    AX: string;
    AZ: string;
    BA: string;
    BB: string;
    BD: string;
    BE: string;
    BF: string;
    BG: string;
    BH: string;
    BI: string;
    BJ: string;
    BL: string;
    BM: string;
    BN: string;
    BO: string;
    BQ: string;
    BR: string;
    BS: string;
    BT: string;
    BV: string;
    BW: string;
    BY: string;
    BZ: string;
    CA: string;
    CC: string;
    CD: string;
    CF: string;
    CG: string;
    CH: string;
    CI: string;
    CK: string;
    CL: string;
    CM: string;
    CN: string;
    CO: string;
    CR: string;
    CU: string;
    CV: string;
    CW: string;
    CX: string;
    CY: string;
    CZ: string;
    DE: string;
    DJ: string;
    DK: string;
    DM: string;
    DO: string;
    DZ: string;
    EC: string;
    EE: string;
    EG: string;
    EH: string;
    ER: string;
    ES: string;
    ET: string;
    FI: string;
    FJ: string;
    FK: string;
    FM: string;
    FO: string;
    FR: string;
    GA: string;
    GB: string;
    GD: string;
    GE: string;
    GF: string;
    GG: string;
    GH: string;
    GI: string;
    GL: string;
    GM: string;
    GN: string;
    GP: string;
    GQ: string;
    GR: string;
    GS: string;
    GT: string;
    GU: string;
    GW: string;
    GY: string;
    HK: string;
    HM: string;
    HN: string;
    HR: string;
    HT: string;
    HU: string;
    ID: string;
    IE: string;
    IL: string;
    IM: string;
    IN: string;
    IO: string;
    IQ: string;
    IR: string;
    IS: string;
    IT: string;
    JE: string;
    JM: string;
    JO: string;
    JP: string;
    KE: string;
    KG: string;
    KH: string;
    KI: string;
    KM: string;
    KN: string;
    KP: string;
    KR: string;
    KW: string;
    KY: string;
    KZ: string;
    LA: string;
    LB: string;
    LC: string;
    LI: string;
    LK: string;
    LR: string;
    LS: string;
    LT: string;
    LU: string;
    LV: string;
    LY: string;
    MA: string;
    MC: string;
    MD: string;
    ME: string;
    MF: string;
    MG: string;
    MH: string;
    MK: string;
    ML: string;
    MM: string;
    MN: string;
    MO: string;
    MP: string;
    MQ: string;
    MR: string;
    MS: string;
    MT: string;
    MU: string;
    MV: string;
    MW: string;
    MX: string;
    MY: string;
    MZ: string;
    NA: string;
    NC: string;
    NE: string;
    NF: string;
    NG: string;
    NI: string;
    NL: string;
    NO: string;
    NP: string;
    NR: string;
    NU: string;
    NZ: string;
    OM: string;
    PA: string;
    PE: string;
    PF: string;
    PG: string;
    PH: string;
    PK: string;
    PL: string;
    PM: string;
    PN: string;
    PR: string;
    PS: string;
    PT: string;
    PW: string;
    PY: string;
    QA: string;
    RE: string;
    RO: string;
    RS: string;
    RU: string;
    RW: string;
    SA: string;
    SB: string;
    SC: string;
    SD: string;
    SE: string;
    SG: string;
    SH: string;
    SI: string;
    SJ: string;
    SK: string;
    SL: string;
    SM: string;
    SN: string;
    SO: string;
    SR: string;
    ST: string;
    SV: string;
    SX: string;
    SY: string;
    SZ: string;
    TC: string;
    TD: string;
    TF: string;
    TG: string;
    TH: string;
    TJ: string;
    TK: string;
    TL: string;
    TM: string;
    TN: string;
    TO: string;
    TR: string;
    TT: string;
    TV: string;
    TW: string;
    TZ: string;
    UA: string;
    UG: string;
    UM: string;
    US: string;
    UY: string;
    UZ: string;
    VA: string;
    VC: string;
    VE: string;
    VG: string;
    VI: string;
    VN: string;
    VU: string;
    WF: string;
    WS: string;
    YE: string;
    YT: string;
    ZA: string;
    ZM: string;
    ZW: string;
} = ...

https://en.wikipedia.org/wiki/ISO_4217#Active_codes_(list_one)

+

Variable LOCALE_CURRENCYConst

LOCALE_CURRENCY: {
    AD: string;
    AE: string;
    AF: string;
    AG: string;
    AI: string;
    AL: string;
    AM: string;
    AO: string;
    AR: string;
    AS: string;
    AT: string;
    AU: string;
    AW: string;
    AX: string;
    AZ: string;
    BA: string;
    BB: string;
    BD: string;
    BE: string;
    BF: string;
    BG: string;
    BH: string;
    BI: string;
    BJ: string;
    BL: string;
    BM: string;
    BN: string;
    BO: string;
    BQ: string;
    BR: string;
    BS: string;
    BT: string;
    BV: string;
    BW: string;
    BY: string;
    BZ: string;
    CA: string;
    CC: string;
    CD: string;
    CF: string;
    CG: string;
    CH: string;
    CI: string;
    CK: string;
    CL: string;
    CM: string;
    CN: string;
    CO: string;
    CR: string;
    CU: string;
    CV: string;
    CW: string;
    CX: string;
    CY: string;
    CZ: string;
    DE: string;
    DJ: string;
    DK: string;
    DM: string;
    DO: string;
    DZ: string;
    EC: string;
    EE: string;
    EG: string;
    EH: string;
    ER: string;
    ES: string;
    ET: string;
    FI: string;
    FJ: string;
    FK: string;
    FM: string;
    FO: string;
    FR: string;
    GA: string;
    GB: string;
    GD: string;
    GE: string;
    GF: string;
    GG: string;
    GH: string;
    GI: string;
    GL: string;
    GM: string;
    GN: string;
    GP: string;
    GQ: string;
    GR: string;
    GS: string;
    GT: string;
    GU: string;
    GW: string;
    GY: string;
    HK: string;
    HM: string;
    HN: string;
    HR: string;
    HT: string;
    HU: string;
    ID: string;
    IE: string;
    IL: string;
    IM: string;
    IN: string;
    IO: string;
    IQ: string;
    IR: string;
    IS: string;
    IT: string;
    JE: string;
    JM: string;
    JO: string;
    JP: string;
    KE: string;
    KG: string;
    KH: string;
    KI: string;
    KM: string;
    KN: string;
    KP: string;
    KR: string;
    KW: string;
    KY: string;
    KZ: string;
    LA: string;
    LB: string;
    LC: string;
    LI: string;
    LK: string;
    LR: string;
    LS: string;
    LT: string;
    LU: string;
    LV: string;
    LY: string;
    MA: string;
    MC: string;
    MD: string;
    ME: string;
    MF: string;
    MG: string;
    MH: string;
    MK: string;
    ML: string;
    MM: string;
    MN: string;
    MO: string;
    MP: string;
    MQ: string;
    MR: string;
    MS: string;
    MT: string;
    MU: string;
    MV: string;
    MW: string;
    MX: string;
    MY: string;
    MZ: string;
    NA: string;
    NC: string;
    NE: string;
    NF: string;
    NG: string;
    NI: string;
    NL: string;
    NO: string;
    NP: string;
    NR: string;
    NU: string;
    NZ: string;
    OM: string;
    PA: string;
    PE: string;
    PF: string;
    PG: string;
    PH: string;
    PK: string;
    PL: string;
    PM: string;
    PN: string;
    PR: string;
    PS: string;
    PT: string;
    PW: string;
    PY: string;
    QA: string;
    RE: string;
    RO: string;
    RS: string;
    RU: string;
    RW: string;
    SA: string;
    SB: string;
    SC: string;
    SD: string;
    SE: string;
    SG: string;
    SH: string;
    SI: string;
    SJ: string;
    SK: string;
    SL: string;
    SM: string;
    SN: string;
    SO: string;
    SR: string;
    ST: string;
    SV: string;
    SX: string;
    SY: string;
    SZ: string;
    TC: string;
    TD: string;
    TF: string;
    TG: string;
    TH: string;
    TJ: string;
    TK: string;
    TL: string;
    TM: string;
    TN: string;
    TO: string;
    TR: string;
    TT: string;
    TV: string;
    TW: string;
    TZ: string;
    UA: string;
    UG: string;
    UM: string;
    US: string;
    UY: string;
    UZ: string;
    VA: string;
    VC: string;
    VE: string;
    VG: string;
    VI: string;
    VN: string;
    VU: string;
    WF: string;
    WS: string;
    YE: string;
    YT: string;
    ZA: string;
    ZM: string;
    ZW: string;
} = ...

https://en.wikipedia.org/wiki/ISO_4217#Active_codes_(list_one)

export const LOCALE_CURRENCY = {
AD: 'EUR',
AE: 'AED',
AF: 'AFN',
AG: 'XCD',
AI: 'XCD',
AL: 'ALL',
AM: 'AMD',
AO: 'AOA',
AR: 'ARS',
AS: 'USD',
AT: 'EUR',
AU: 'AUD',
AW: 'AWG',
AX: 'EUR',
AZ: 'AZN',
BA: 'BAM',
BB: 'BBD',
BD: 'BDT',
BE: 'EUR',
BF: 'XOF',
BG: 'BGN',
BH: 'BHD',
BI: 'BIF',
BJ: 'XOF',
BL: 'EUR',
BM: 'BMD',
BN: 'BND',
BO: 'BOB',
BQ: 'USD',
BR: 'BRL',
BS: 'BSD',
BT: 'BTN',
BV: 'NOK',
BW: 'BWP',
BY: 'BYN',
BZ: 'BZD',
CA: 'CAD',
CC: 'AUD',
CD: 'CDF',
CF: 'XAF',
CG: 'XAF',
CH: 'CHF',
CI: 'XOF',
CK: 'NZD',
CL: 'CLP',
CM: 'XAF',
CN: 'CNY',
CO: 'COP',
CR: 'CRC',
CU: 'CUP',
CV: 'CVE',
CW: 'ANG',
CX: 'AUD',
CY: 'EUR',
CZ: 'CZK',
DE: 'EUR',
DJ: 'DJF',
DK: 'DKK',
DM: 'XCD',
DO: 'DOP',
DZ: 'DZD',
EC: 'USD',
EE: 'EUR',
EG: 'EGP',
EH: 'MAD',
ER: 'ERN',
ES: 'EUR',
ET: 'ETB',
FI: 'EUR',
FJ: 'FJD',
FK: 'FKP',
FM: 'USD',
FO: 'DKK',
FR: 'EUR',
GA: 'XAF',
GB: 'GBP',
GD: 'XCD',
GE: 'GEL',
GF: 'EUR',
GG: 'GBP',
GH: 'GHS',
GI: 'GIP',
GL: 'DKK',
GM: 'GMD',
GN: 'GNF',
GP: 'EUR',
GQ: 'XAF',
GR: 'EUR',
GS: 'GBP',
GT: 'GTQ',
GU: 'USD',
GW: 'XOF',
GY: 'GYD',
HK: 'HKD',
HM: 'AUD',
HN: 'HNL',
HR: 'EUR',
HT: 'HTG',
HU: 'HUF',
ID: 'IDR',
IE: 'EUR',
IL: 'ILS',
IM: 'GBP',
IN: 'INR',
IO: 'USD',
IQ: 'IQD',
IR: 'IRR',
IS: 'ISK',
IT: 'EUR',
JE: 'GBP',
JM: 'JMD',
JO: 'JOD',
JP: 'JPY',
KE: 'KES',
KG: 'KGS',
KH: 'KHR',
KI: 'AUD',
KM: 'KMF',
KN: 'XCD',
KP: 'KPW',
KR: 'KRW',
KW: 'KWD',
KY: 'KYD',
KZ: 'KZT',
LA: 'LAK',
LB: 'LBP',
LC: 'XCD',
LI: 'CHF',
LK: 'LKR',
LR: 'LRD',
LS: 'LSL',
LT: 'EUR',
LU: 'EUR',
LV: 'EUR',
LY: 'LYD',
MA: 'MAD',
MC: 'EUR',
MD: 'MDL',
ME: 'EUR',
MF: 'EUR',
MG: 'MGA',
MH: 'USD',
MK: 'MKD',
ML: 'XOF',
MM: 'MMK',
MN: 'MNT',
MO: 'MOP',
MP: 'USD',
MQ: 'EUR',
MR: 'MRO',
MS: 'XCD',
MT: 'EUR',
MU: 'MUR',
MV: 'MVR',
MW: 'MWK',
MX: 'MXN',
MY: 'MYR',
MZ: 'MZN',
NA: 'NAD',
NC: 'XPF',
NE: 'XOF',
NF: 'AUD',
NG: 'NGN',
NI: 'NIO',
NL: 'EUR',
NO: 'NOK',
NP: 'NPR',
NR: 'AUD',
NU: 'NZD',
NZ: 'NZD',
OM: 'OMR',
PA: 'PAB',
PE: 'PEN',
PF: 'XPF',
PG: 'PGK',
PH: 'PHP',
PK: 'PKR',
PL: 'PLN',
PM: 'EUR',
PN: 'NZD',
PR: 'USD',
PS: 'ILS',
PT: 'EUR',
PW: 'USD',
PY: 'PYG',
QA: 'QAR',
RE: 'EUR',
RO: 'RON',
RS: 'RSD',
RU: 'RUB',
RW: 'RWF',
SA: 'SAR',
SB: 'SBD',
SC: 'SCR',
SD: 'SDG',
SE: 'SEK',
SG: 'SGD',
SH: 'SHP',
SI: 'EUR',
SJ: 'NOK',
SK: 'EUR',
SL: 'SLL',
SM: 'EUR',
SN: 'XOF',
SO: 'SOS',
SR: 'SRD',
ST: 'STD',
SV: 'SVC',
SX: 'ANG',
SY: 'SYP',
SZ: 'SZL',
TC: 'USD',
TD: 'XAF',
TF: 'EUR',
TG: 'XOF',
TH: 'THB',
TJ: 'TJS',
TK: 'NZD',
TL: 'USD',
TM: 'TMT',
TN: 'TND',
TO: 'TOP',
TR: 'TRY',
TT: 'TTD',
TV: 'AUD',
TW: 'TWD',
TZ: 'TZS',
UA: 'UAH',
UG: 'UGX',
UM: 'USD',
US: 'USD',
UY: 'UYU',
UZ: 'UZS',
VA: 'EUR',
VC: 'XCD',
VE: 'VEF',
VG: 'USD',
VI: 'USD',
VN: 'VND',
VU: 'VUV',
WF: 'XPF',
WS: 'WST',
YE: 'YER',
YT: 'EUR',
ZA: 'ZAR',
ZM: 'ZMW',
ZW: 'ZWL',
};
-

Variable NON_STANDARD_CODESConst

NON_STANDARD_CODES: {
    BDS: string;
    CNT: string;
    NIS: string;
    NTD: string;
    STG: string;
    RMB: string;
} = ...

https://en.wikipedia.org/wiki/ISO_4217#Non-standard_codes

+

Variable NON_STANDARD_CODESConst

NON_STANDARD_CODES: {
    BDS: string;
    CNT: string;
    NIS: string;
    NTD: string;
    STG: string;
    RMB: string;
} = ...

https://en.wikipedia.org/wiki/ISO_4217#Non-standard_codes

export const NON_STANDARD_CODES = {
BDS: 'BBD',
CNT: 'TWD',
NIS: 'ILS',
NTD: 'TWD',
STG: 'GBP',
RMB: 'CNY',
};
-