@nevermined-io/commons 1.2.0 → 1.2.2
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/lib/constants/DelegationCurrencies.d.ts +25 -0
- package/dist/lib/constants/DelegationCurrencies.d.ts.map +1 -0
- package/dist/lib/constants/DelegationCurrencies.js +29 -0
- package/dist/lib/constants/DelegationCurrencies.js.map +1 -0
- package/dist/lib/constants/index.d.ts +2 -0
- package/dist/lib/constants/index.d.ts.map +1 -1
- package/dist/lib/constants/index.js +1 -0
- package/dist/lib/constants/index.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/constants/DelegationCurrencies.ts +22 -0
- package/src/lib/constants/index.ts +2 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selectable currencies for delegation creation, grouped by rail. Delegations
|
|
3
|
+
* are plan-agnostic (#1534) so the user picks the currency; the backend enum is
|
|
4
|
+
* usd|eur|usdc|eurc (#1677). `label` is the spending-limit suffix — '$'/'€'
|
|
5
|
+
* prefixed for fiat, 'USDC'/'EURC' appended for crypto. Single source for both
|
|
6
|
+
* the webapp delegation dialog and the embed delegation form so the option
|
|
7
|
+
* lists can't drift (#2014).
|
|
8
|
+
*/
|
|
9
|
+
export declare const FIAT_CURRENCIES: readonly [{
|
|
10
|
+
readonly value: "usd";
|
|
11
|
+
readonly label: "$";
|
|
12
|
+
}, {
|
|
13
|
+
readonly value: "eur";
|
|
14
|
+
readonly label: "€";
|
|
15
|
+
}];
|
|
16
|
+
export declare const CRYPTO_CURRENCIES: readonly [{
|
|
17
|
+
readonly value: "usdc";
|
|
18
|
+
readonly label: "USDC";
|
|
19
|
+
}, {
|
|
20
|
+
readonly value: "eurc";
|
|
21
|
+
readonly label: "EURC";
|
|
22
|
+
}];
|
|
23
|
+
/** The closed currency union, derived from the arrays so it can't fall out of sync. */
|
|
24
|
+
export type DelegationCurrency = (typeof FIAT_CURRENCIES)[number]['value'] | (typeof CRYPTO_CURRENCIES)[number]['value'];
|
|
25
|
+
//# sourceMappingURL=DelegationCurrencies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DelegationCurrencies.d.ts","sourceRoot":"","sources":["../../../src/lib/constants/DelegationCurrencies.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;;;EAGlB,CAAA;AAEV,eAAO,MAAM,iBAAiB;;;;;;EAGpB,CAAA;AAEV,uFAAuF;AACvF,MAAM,MAAM,kBAAkB,GAC1B,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GACzC,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selectable currencies for delegation creation, grouped by rail. Delegations
|
|
3
|
+
* are plan-agnostic (#1534) so the user picks the currency; the backend enum is
|
|
4
|
+
* usd|eur|usdc|eurc (#1677). `label` is the spending-limit suffix — '$'/'€'
|
|
5
|
+
* prefixed for fiat, 'USDC'/'EURC' appended for crypto. Single source for both
|
|
6
|
+
* the webapp delegation dialog and the embed delegation form so the option
|
|
7
|
+
* lists can't drift (#2014).
|
|
8
|
+
*/ export const FIAT_CURRENCIES = [
|
|
9
|
+
{
|
|
10
|
+
value: 'usd',
|
|
11
|
+
label: '$'
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: 'eur',
|
|
15
|
+
label: '€'
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
export const CRYPTO_CURRENCIES = [
|
|
19
|
+
{
|
|
20
|
+
value: 'usdc',
|
|
21
|
+
label: 'USDC'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: 'eurc',
|
|
25
|
+
label: 'EURC'
|
|
26
|
+
}
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=DelegationCurrencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/constants/DelegationCurrencies.ts"],"sourcesContent":["/**\n * Selectable currencies for delegation creation, grouped by rail. Delegations\n * are plan-agnostic (#1534) so the user picks the currency; the backend enum is\n * usd|eur|usdc|eurc (#1677). `label` is the spending-limit suffix — '$'/'€'\n * prefixed for fiat, 'USDC'/'EURC' appended for crypto. Single source for both\n * the webapp delegation dialog and the embed delegation form so the option\n * lists can't drift (#2014).\n */\nexport const FIAT_CURRENCIES = [\n { value: 'usd', label: '$' },\n { value: 'eur', label: '€' },\n] as const\n\nexport const CRYPTO_CURRENCIES = [\n { value: 'usdc', label: 'USDC' },\n { value: 'eurc', label: 'EURC' },\n] as const\n\n/** The closed currency union, derived from the arrays so it can't fall out of sync. */\nexport type DelegationCurrency =\n | (typeof FIAT_CURRENCIES)[number]['value']\n | (typeof CRYPTO_CURRENCIES)[number]['value']\n"],"names":["FIAT_CURRENCIES","value","label","CRYPTO_CURRENCIES"],"mappings":"AAAA;;;;;;;CAOC,GACD,OAAO,MAAMA,kBAAkB;IAC7B;QAAEC,OAAO;QAAOC,OAAO;IAAI;IAC3B;QAAED,OAAO;QAAOC,OAAO;IAAI;CAC5B,CAAS;AAEV,OAAO,MAAMC,oBAAoB;IAC/B;QAAEF,OAAO;QAAQC,OAAO;IAAO;IAC/B;QAAED,OAAO;QAAQC,OAAO;IAAO;CAChC,CAAS"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { DEFAULT_ENCRYPTION_METHOD, NETWORK_FEE_DENOMINATOR } from './AssetConstants.js';
|
|
2
2
|
export type { EncryptionMethod } from './AssetConstants.js';
|
|
3
|
+
export { FIAT_CURRENCIES, CRYPTO_CURRENCIES } from './DelegationCurrencies.js';
|
|
4
|
+
export type { DelegationCurrency } from './DelegationCurrencies.js';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AACxF,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AACxF,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/constants/index.ts"],"sourcesContent":["export { DEFAULT_ENCRYPTION_METHOD, NETWORK_FEE_DENOMINATOR } from './AssetConstants.js'\nexport type { EncryptionMethod } from './AssetConstants.js'\n"],"names":["DEFAULT_ENCRYPTION_METHOD","NETWORK_FEE_DENOMINATOR"],"mappings":"AAAA,SAASA,yBAAyB,EAAEC,uBAAuB,QAAQ,sBAAqB"}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/constants/index.ts"],"sourcesContent":["export { DEFAULT_ENCRYPTION_METHOD, NETWORK_FEE_DENOMINATOR } from './AssetConstants.js'\nexport type { EncryptionMethod } from './AssetConstants.js'\nexport { FIAT_CURRENCIES, CRYPTO_CURRENCIES } from './DelegationCurrencies.js'\nexport type { DelegationCurrency } from './DelegationCurrencies.js'\n"],"names":["DEFAULT_ENCRYPTION_METHOD","NETWORK_FEE_DENOMINATOR","FIAT_CURRENCIES","CRYPTO_CURRENCIES"],"mappings":"AAAA,SAASA,yBAAyB,EAAEC,uBAAuB,QAAQ,sBAAqB;AAExF,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,4BAA2B"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selectable currencies for delegation creation, grouped by rail. Delegations
|
|
3
|
+
* are plan-agnostic (#1534) so the user picks the currency; the backend enum is
|
|
4
|
+
* usd|eur|usdc|eurc (#1677). `label` is the spending-limit suffix — '$'/'€'
|
|
5
|
+
* prefixed for fiat, 'USDC'/'EURC' appended for crypto. Single source for both
|
|
6
|
+
* the webapp delegation dialog and the embed delegation form so the option
|
|
7
|
+
* lists can't drift (#2014).
|
|
8
|
+
*/
|
|
9
|
+
export const FIAT_CURRENCIES = [
|
|
10
|
+
{ value: 'usd', label: '$' },
|
|
11
|
+
{ value: 'eur', label: '€' },
|
|
12
|
+
] as const
|
|
13
|
+
|
|
14
|
+
export const CRYPTO_CURRENCIES = [
|
|
15
|
+
{ value: 'usdc', label: 'USDC' },
|
|
16
|
+
{ value: 'eurc', label: 'EURC' },
|
|
17
|
+
] as const
|
|
18
|
+
|
|
19
|
+
/** The closed currency union, derived from the arrays so it can't fall out of sync. */
|
|
20
|
+
export type DelegationCurrency =
|
|
21
|
+
| (typeof FIAT_CURRENCIES)[number]['value']
|
|
22
|
+
| (typeof CRYPTO_CURRENCIES)[number]['value']
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { DEFAULT_ENCRYPTION_METHOD, NETWORK_FEE_DENOMINATOR } from './AssetConstants.js'
|
|
2
2
|
export type { EncryptionMethod } from './AssetConstants.js'
|
|
3
|
+
export { FIAT_CURRENCIES, CRYPTO_CURRENCIES } from './DelegationCurrencies.js'
|
|
4
|
+
export type { DelegationCurrency } from './DelegationCurrencies.js'
|