@selldone/sdk-storefront
Version:
A TypeScript SDK to connect to your shop and build a fully functional storefront and website by simply developing a frontend web application. All backend operations are seamlessly managed by the serverless Selldone solution.
41 lines (40 loc) • 2 kB
TypeScript
/**
* Represents the details of a currency.
*
* @typedef {object} ICurrency
*
* @property {string} code - The unique identifier for the currency (e.g. 'USD', 'EUR').
* @property {boolean} enable - Indicates whether the currency is enabled or not.
* @property {string} name - The name of the currency (e.g. 'global.currency.USD').
* @property {string} [alt_name] - An alternative or localized name for the currency, if available.
* @property {number} [alt_factor] - An alternative or localized factor for the currency, if available. like 0.1
* @property {string} country - The country associated with the currency (e.g. 'USA', 'Euro').
* @property {string} [flag] - The flag or code representing the country (e.g. 'US', 'EU').
* @property {string} [icon] - The path to the currency's icon, if available.
* @property {number} floats - The number of decimal places for the currency (commonly 2 for most currencies).
* @property {string} format - The format string to represent the currency (e.g. '0,0.[00]').
* @property {number} round_factor - The factor used for rounding the currency value.
* @property {[string, string]} gradient - An array of two colors representing a gradient for the currency UI or display.
* @property {string} unicode - The Unicode character representation of the currency (e.g. '$', '€').
* @property {boolean} auto_rate - Indicates whether the currency supports auto rate conversion or not.
* @property {boolean} [at_end] - Optional. Indicates whether the currency sign should be placed at the end of the amount.
*/
export type ICurrency = {
code: string;
enable: boolean;
name: string;
alt_name?: string;
alt_factor?: number;
country: string;
flag?: string;
icon?: string;
floats: number;
format: string;
round_factor: number;
gradient: [string, string];
unicode: string;
auto_rate: boolean;
at_end?: boolean;
blockchain?: boolean;
};
export declare const Currency: Record<string, ICurrency>;