@leather.io/constants 0.9.1 → 0.10.0

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,5 +1,5 @@
1
1
 
2
- > @leather.io/constants@0.9.1 build /home/runner/work/mono/mono/packages/constants
2
+ > @leather.io/constants@0.10.0 build /home/runner/work/mono/mono/packages/constants
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,9 +8,9 @@ CLI tsup v8.1.0
8
8
  CLI Using tsup config: /home/runner/work/mono/mono/packages/constants/tsup.config.ts
9
9
  CLI Target: es2022
10
10
  ESM Build start
11
- ESM dist/index.js 1.08 KB
12
- ESM dist/index.js.map 1.50 KB
13
- ESM ⚡️ Build success in 20ms
11
+ ESM dist/index.js 1.68 KB
12
+ ESM dist/index.js.map 2.64 KB
13
+ ESM ⚡️ Build success in 14ms
14
14
  DTS Build start
15
- DTS ⚡️ Build success in 1558ms
16
- DTS dist/index.d.ts 1.13 KB
15
+ DTS ⚡️ Build success in 1158ms
16
+ DTS dist/index.d.ts 1.85 KB
package/CHANGELOG.md CHANGED
@@ -25,6 +25,28 @@
25
25
  * devDependencies
26
26
  * @leather.io/eslint-config bumped to 0.7.0
27
27
 
28
+ ## [0.10.0](https://github.com/leather-io/mono/compare/@leather.io/constants-v0.9.2...@leather.io/constants-v0.10.0) (2024-09-17)
29
+
30
+
31
+ ### Features
32
+
33
+ * settings bitcoin unit, closes leather-io/issues[#201](https://github.com/leather-io/mono/issues/201) ([bfe44f9](https://github.com/leather-io/mono/commit/bfe44f92ed31e342a69b63a3d20a7ef07fb5cb75))
34
+ * settings conversion unit, closes leather-io/issues[#200](https://github.com/leather-io/mono/issues/200) ([676683a](https://github.com/leather-io/mono/commit/676683a1a074f5ff2bd4b4f656ffb7c9c50d8a3f))
35
+
36
+
37
+ ### Dependencies
38
+
39
+ * The following workspace dependencies were updated
40
+ * dependencies
41
+ * @leather.io/models bumped to 0.14.0
42
+
43
+ ## [0.9.2](https://github.com/leather-io/mono/compare/@leather.io/constants-v0.9.1...@leather.io/constants-v0.9.2) (2024-09-04)
44
+
45
+
46
+ ### Bug Fixes
47
+
48
+ * update support links, ref leather-io/extension[#5813](https://github.com/leather-io/mono/issues/5813) ([d182c0a](https://github.com/leather-io/mono/commit/d182c0a0794fb18becc43699685a1e59bc3aff90))
49
+
28
50
  ## [0.9.0](https://github.com/leather-io/mono/compare/@leather.io/constants-v0.8.3...@leather.io/constants-v0.9.0) (2024-08-15)
29
51
 
30
52
 
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { BitcoinUnit, BitcoinUnitInfo } from '@leather.io/models';
2
+
1
3
  declare const gaiaUrl = "https://hub.blockstack.org";
2
4
  declare const ZERO_INDEX = 0;
3
5
  declare const HIRO_EXPLORER_URL = "https://explorer.hiro.so";
@@ -13,10 +15,29 @@ declare const currencyDecimalsMap: {
13
15
  readonly BTC: 8;
14
16
  readonly STX: 6;
15
17
  readonly USD: 2;
18
+ readonly EUR: 2;
19
+ readonly GBP: 2;
20
+ readonly AUD: 2;
21
+ readonly CAD: 2;
22
+ readonly CNY: 2;
23
+ readonly JPY: 0;
24
+ readonly KRW: 0;
25
+ };
26
+ declare const currencyNameMap: {
27
+ readonly USD: "united states dollar";
28
+ readonly EUR: "euro";
29
+ readonly GBP: "british pound";
30
+ readonly AUD: "australian dollar";
31
+ readonly CAD: "canadian dollar";
32
+ readonly CNY: "chinese yuan";
33
+ readonly JPY: "japanese yen";
34
+ readonly KRW: "south korean won";
16
35
  };
17
36
  declare const BTC_P2WPKH_DUST_AMOUNT = 294;
18
37
  declare const KEBAB_REGEX: RegExp;
19
38
  declare const DEFAULT_LIST_LIMIT = 50;
20
39
  declare const TOKEN_NAME_LENGTH = 4;
40
+ declare const LEATHER_SUPPORT_URL = "https://leather.io/contact";
41
+ declare const bitcoinUnitsKeyedByName: Record<BitcoinUnit, BitcoinUnitInfo>;
21
42
 
22
- export { BTC_DECIMALS, BTC_P2WPKH_DUST_AMOUNT, DEFAULT_FEE_RATE, DEFAULT_LIST_LIMIT, HIGH_FEE_AMOUNT_STX, HIGH_FEE_WARNING_LEARN_MORE_URL_BTC, HIGH_FEE_WARNING_LEARN_MORE_URL_STX, HIRO_EXPLORER_URL, KEBAB_REGEX, ORD_IO_URL, PERSISTENCE_CACHE_TIME, STX_DECIMALS, TOKEN_NAME_LENGTH, ZERO_INDEX, currencyDecimalsMap, gaiaUrl };
43
+ export { BTC_DECIMALS, BTC_P2WPKH_DUST_AMOUNT, DEFAULT_FEE_RATE, DEFAULT_LIST_LIMIT, HIGH_FEE_AMOUNT_STX, HIGH_FEE_WARNING_LEARN_MORE_URL_BTC, HIGH_FEE_WARNING_LEARN_MORE_URL_STX, HIRO_EXPLORER_URL, KEBAB_REGEX, LEATHER_SUPPORT_URL, ORD_IO_URL, PERSISTENCE_CACHE_TIME, STX_DECIMALS, TOKEN_NAME_LENGTH, ZERO_INDEX, bitcoinUnitsKeyedByName, currencyDecimalsMap, currencyNameMap, gaiaUrl };
package/dist/index.js CHANGED
@@ -13,12 +13,42 @@ var STX_DECIMALS = 6;
13
13
  var currencyDecimalsMap = {
14
14
  BTC: BTC_DECIMALS,
15
15
  STX: STX_DECIMALS,
16
- USD: 2
16
+ USD: 2,
17
+ EUR: 2,
18
+ GBP: 2,
19
+ AUD: 2,
20
+ CAD: 2,
21
+ CNY: 2,
22
+ JPY: 0,
23
+ KRW: 0
24
+ };
25
+ var currencyNameMap = {
26
+ USD: "united states dollar",
27
+ EUR: "euro",
28
+ GBP: "british pound",
29
+ AUD: "australian dollar",
30
+ CAD: "canadian dollar",
31
+ CNY: "chinese yuan",
32
+ JPY: "japanese yen",
33
+ KRW: "south korean won"
17
34
  };
18
35
  var BTC_P2WPKH_DUST_AMOUNT = 294;
19
36
  var KEBAB_REGEX = /[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;
20
37
  var DEFAULT_LIST_LIMIT = 50;
21
38
  var TOKEN_NAME_LENGTH = 4;
39
+ var LEATHER_SUPPORT_URL = "https://leather.io/contact";
40
+ var bitcoinUnitsKeyedByName = {
41
+ bitcoin: {
42
+ name: "bitcoin",
43
+ symbol: "BTC",
44
+ decimal: "1"
45
+ },
46
+ satoshi: {
47
+ name: "satoshi",
48
+ symbol: "sat",
49
+ decimal: "0.00000001"
50
+ }
51
+ };
22
52
  export {
23
53
  BTC_DECIMALS,
24
54
  BTC_P2WPKH_DUST_AMOUNT,
@@ -29,12 +59,15 @@ export {
29
59
  HIGH_FEE_WARNING_LEARN_MORE_URL_STX,
30
60
  HIRO_EXPLORER_URL,
31
61
  KEBAB_REGEX,
62
+ LEATHER_SUPPORT_URL,
32
63
  ORD_IO_URL,
33
64
  PERSISTENCE_CACHE_TIME,
34
65
  STX_DECIMALS,
35
66
  TOKEN_NAME_LENGTH,
36
67
  ZERO_INDEX,
68
+ bitcoinUnitsKeyedByName,
37
69
  currencyDecimalsMap,
70
+ currencyNameMap,
38
71
  gaiaUrl
39
72
  };
40
73
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const gaiaUrl = 'https://hub.blockstack.org';\n\nexport const ZERO_INDEX = 0;\n\nexport const HIRO_EXPLORER_URL = 'https://explorer.hiro.so';\nexport const ORD_IO_URL = 'https://ord.io';\n\nexport const HIGH_FEE_AMOUNT_STX = 5;\nexport const HIGH_FEE_WARNING_LEARN_MORE_URL_BTC = 'https://bitcoinfees.earn.com/';\nexport const HIGH_FEE_WARNING_LEARN_MORE_URL_STX =\n 'https://leather.gitbook.io/guides/transactions/fees';\n\nexport const DEFAULT_FEE_RATE = 400;\n\nexport const PERSISTENCE_CACHE_TIME = 1000 * 60 * 60 * 12; // 12 hours\n\nexport const BTC_DECIMALS = 8;\nexport const STX_DECIMALS = 6;\n\n// Units of `Money` should be declared in their smallest unit. Similar to\n// Rosetta, we model currencies with their respective resolution\nexport const currencyDecimalsMap = {\n BTC: BTC_DECIMALS,\n STX: STX_DECIMALS,\n USD: 2,\n} as const;\n\n// https://bitcoin.stackexchange.com/a/41082/139277\nexport const BTC_P2WPKH_DUST_AMOUNT = 294;\n\nexport const KEBAB_REGEX = /[A-Z\\u00C0-\\u00D6\\u00D8-\\u00DE]/g;\n\nexport const DEFAULT_LIST_LIMIT = 50;\n\nexport const TOKEN_NAME_LENGTH = 4;\n"],"mappings":";AAAO,IAAM,UAAU;AAEhB,IAAM,aAAa;AAEnB,IAAM,oBAAoB;AAC1B,IAAM,aAAa;AAEnB,IAAM,sBAAsB;AAC5B,IAAM,sCAAsC;AAC5C,IAAM,sCACX;AAEK,IAAM,mBAAmB;AAEzB,IAAM,yBAAyB,MAAO,KAAK,KAAK;AAEhD,IAAM,eAAe;AACrB,IAAM,eAAe;AAIrB,IAAM,sBAAsB;AAAA,EACjC,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAGO,IAAM,yBAAyB;AAE/B,IAAM,cAAc;AAEpB,IAAM,qBAAqB;AAE3B,IAAM,oBAAoB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { BitcoinUnit, BitcoinUnitInfo } from '@leather.io/models';\n\nexport const gaiaUrl = 'https://hub.blockstack.org';\n\nexport const ZERO_INDEX = 0;\n\nexport const HIRO_EXPLORER_URL = 'https://explorer.hiro.so';\nexport const ORD_IO_URL = 'https://ord.io';\n\nexport const HIGH_FEE_AMOUNT_STX = 5;\nexport const HIGH_FEE_WARNING_LEARN_MORE_URL_BTC = 'https://bitcoinfees.earn.com/';\nexport const HIGH_FEE_WARNING_LEARN_MORE_URL_STX =\n 'https://leather.gitbook.io/guides/transactions/fees';\n\nexport const DEFAULT_FEE_RATE = 400;\n\nexport const PERSISTENCE_CACHE_TIME = 1000 * 60 * 60 * 12; // 12 hours\n\nexport const BTC_DECIMALS = 8;\nexport const STX_DECIMALS = 6;\n\n// Units of `Money` should be declared in their smallest unit. Similar to\n// Rosetta, we model currencies with their respective resolution\nexport const currencyDecimalsMap = {\n BTC: BTC_DECIMALS,\n STX: STX_DECIMALS,\n USD: 2,\n EUR: 2,\n GBP: 2,\n AUD: 2,\n CAD: 2,\n CNY: 2,\n JPY: 0,\n KRW: 0,\n} as const;\n\nexport const currencyNameMap = {\n USD: 'united states dollar',\n EUR: 'euro',\n GBP: 'british pound',\n AUD: 'australian dollar',\n CAD: 'canadian dollar',\n CNY: 'chinese yuan',\n JPY: 'japanese yen',\n KRW: 'south korean won',\n} as const;\n\n// https://bitcoin.stackexchange.com/a/41082/139277\nexport const BTC_P2WPKH_DUST_AMOUNT = 294;\n\nexport const KEBAB_REGEX = /[A-Z\\u00C0-\\u00D6\\u00D8-\\u00DE]/g;\n\nexport const DEFAULT_LIST_LIMIT = 50;\n\nexport const TOKEN_NAME_LENGTH = 4;\n\nexport const LEATHER_SUPPORT_URL = 'https://leather.io/contact';\n\nexport const bitcoinUnitsKeyedByName: Record<BitcoinUnit, BitcoinUnitInfo> = {\n bitcoin: {\n name: 'bitcoin',\n symbol: 'BTC',\n decimal: '1',\n },\n satoshi: {\n name: 'satoshi',\n symbol: 'sat',\n decimal: '0.00000001',\n },\n};\n"],"mappings":";AAEO,IAAM,UAAU;AAEhB,IAAM,aAAa;AAEnB,IAAM,oBAAoB;AAC1B,IAAM,aAAa;AAEnB,IAAM,sBAAsB;AAC5B,IAAM,sCAAsC;AAC5C,IAAM,sCACX;AAEK,IAAM,mBAAmB;AAEzB,IAAM,yBAAyB,MAAO,KAAK,KAAK;AAEhD,IAAM,eAAe;AACrB,IAAM,eAAe;AAIrB,IAAM,sBAAsB;AAAA,EACjC,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAEO,IAAM,kBAAkB;AAAA,EAC7B,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAGO,IAAM,yBAAyB;AAE/B,IAAM,cAAc;AAEpB,IAAM,qBAAqB;AAE3B,IAAM,oBAAoB;AAE1B,IAAM,sBAAsB;AAE5B,IAAM,0BAAgE;AAAA,EAC3E,SAAS;AAAA,IACP,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AACF;","names":[]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@leather.io/constants",
3
3
  "author": "Leather.io contact@leather.io",
4
4
  "description": "Shared bitcoin utilities",
5
- "version": "0.9.1",
5
+ "version": "0.10.0",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/leather-io/mono/tree/dev/packages/constants",
8
8
  "repository": {
@@ -15,6 +15,9 @@
15
15
  ".": "./dist/index.js"
16
16
  },
17
17
  "bugs": "https://github.com/leather-io/mono/issues",
18
+ "dependencies": {
19
+ "@leather.io/models": "0.14.0"
20
+ },
18
21
  "devDependencies": {
19
22
  "concurrently": "8.2.2",
20
23
  "eslint": "8.53.0",
package/src/index.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { BitcoinUnit, BitcoinUnitInfo } from '@leather.io/models';
2
+
1
3
  export const gaiaUrl = 'https://hub.blockstack.org';
2
4
 
3
5
  export const ZERO_INDEX = 0;
@@ -23,6 +25,24 @@ export const currencyDecimalsMap = {
23
25
  BTC: BTC_DECIMALS,
24
26
  STX: STX_DECIMALS,
25
27
  USD: 2,
28
+ EUR: 2,
29
+ GBP: 2,
30
+ AUD: 2,
31
+ CAD: 2,
32
+ CNY: 2,
33
+ JPY: 0,
34
+ KRW: 0,
35
+ } as const;
36
+
37
+ export const currencyNameMap = {
38
+ USD: 'united states dollar',
39
+ EUR: 'euro',
40
+ GBP: 'british pound',
41
+ AUD: 'australian dollar',
42
+ CAD: 'canadian dollar',
43
+ CNY: 'chinese yuan',
44
+ JPY: 'japanese yen',
45
+ KRW: 'south korean won',
26
46
  } as const;
27
47
 
28
48
  // https://bitcoin.stackexchange.com/a/41082/139277
@@ -33,3 +53,18 @@ export const KEBAB_REGEX = /[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;
33
53
  export const DEFAULT_LIST_LIMIT = 50;
34
54
 
35
55
  export const TOKEN_NAME_LENGTH = 4;
56
+
57
+ export const LEATHER_SUPPORT_URL = 'https://leather.io/contact';
58
+
59
+ export const bitcoinUnitsKeyedByName: Record<BitcoinUnit, BitcoinUnitInfo> = {
60
+ bitcoin: {
61
+ name: 'bitcoin',
62
+ symbol: 'BTC',
63
+ decimal: '1',
64
+ },
65
+ satoshi: {
66
+ name: 'satoshi',
67
+ symbol: 'sat',
68
+ decimal: '0.00000001',
69
+ },
70
+ };