@leather.io/constants 0.10.0 → 0.11.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.10.0 build /home/runner/work/mono/mono/packages/constants
2
+ > @leather.io/constants@0.11.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.68 KB
12
- ESM dist/index.js.map 2.64 KB
11
+ ESM dist/index.js 2.09 KB
12
+ ESM dist/index.js.map 3.48 KB
13
13
  ESM ⚡️ Build success in 14ms
14
14
  DTS Build start
15
- DTS ⚡️ Build success in 1158ms
16
- DTS dist/index.d.ts 1.85 KB
15
+ DTS ⚡️ Build success in 1127ms
16
+ DTS dist/index.d.ts 2.06 KB
package/CHANGELOG.md CHANGED
@@ -25,6 +25,20 @@
25
25
  * devDependencies
26
26
  * @leather.io/eslint-config bumped to 0.7.0
27
27
 
28
+ ## [0.11.0](https://github.com/leather-io/mono/compare/@leather.io/constants-v0.10.0...@leather.io/constants-v0.11.0) (2024-09-20)
29
+
30
+
31
+ ### Features
32
+
33
+ * settings account identifier, closes leather-io/issues[#205](https://github.com/leather-io/mono/issues/205) ([711c5a9](https://github.com/leather-io/mono/commit/711c5a96beff24130d82c733ebd8a111861c2efa))
34
+
35
+
36
+ ### Dependencies
37
+
38
+ * The following workspace dependencies were updated
39
+ * dependencies
40
+ * @leather.io/models bumped to 0.15.0
41
+
28
42
  ## [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
43
 
30
44
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BitcoinUnit, BitcoinUnitInfo } from '@leather.io/models';
1
+ import { BitcoinUnit, BitcoinUnitInfo, AccountDisplayPreference, AccountDisplayPreferenceInfo } from '@leather.io/models';
2
2
 
3
3
  declare const gaiaUrl = "https://hub.blockstack.org";
4
4
  declare const ZERO_INDEX = 0;
@@ -39,5 +39,6 @@ declare const DEFAULT_LIST_LIMIT = 50;
39
39
  declare const TOKEN_NAME_LENGTH = 4;
40
40
  declare const LEATHER_SUPPORT_URL = "https://leather.io/contact";
41
41
  declare const bitcoinUnitsKeyedByName: Record<BitcoinUnit, BitcoinUnitInfo>;
42
+ declare const accountDisplayPreferencesKeyedByType: Record<AccountDisplayPreference, AccountDisplayPreferenceInfo>;
42
43
 
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 };
44
+ 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, accountDisplayPreferencesKeyedByType, bitcoinUnitsKeyedByName, currencyDecimalsMap, currencyNameMap, gaiaUrl };
package/dist/index.js CHANGED
@@ -49,6 +49,28 @@ var bitcoinUnitsKeyedByName = {
49
49
  decimal: "0.00000001"
50
50
  }
51
51
  };
52
+ var accountDisplayPreferencesKeyedByType = {
53
+ ns: {
54
+ type: "ns",
55
+ blockchain: "bitcoin",
56
+ name: "Native SegWit"
57
+ },
58
+ tr: {
59
+ type: "tr",
60
+ blockchain: "bitcoin",
61
+ name: "Taproot address"
62
+ },
63
+ bns: {
64
+ type: "bns",
65
+ blockchain: "stacks",
66
+ name: "BNS name"
67
+ },
68
+ stacks: {
69
+ type: "stacks",
70
+ blockchain: "stacks",
71
+ name: "Stacks address"
72
+ }
73
+ };
52
74
  export {
53
75
  BTC_DECIMALS,
54
76
  BTC_P2WPKH_DUST_AMOUNT,
@@ -65,6 +87,7 @@ export {
65
87
  STX_DECIMALS,
66
88
  TOKEN_NAME_LENGTH,
67
89
  ZERO_INDEX,
90
+ accountDisplayPreferencesKeyedByType,
68
91
  bitcoinUnitsKeyedByName,
69
92
  currencyDecimalsMap,
70
93
  currencyNameMap,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type {\n AccountDisplayPreference,\n AccountDisplayPreferenceInfo,\n BitcoinUnit,\n BitcoinUnitInfo,\n} 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\nexport const accountDisplayPreferencesKeyedByType: Record<\n AccountDisplayPreference,\n AccountDisplayPreferenceInfo\n> = {\n ns: {\n type: 'ns',\n blockchain: 'bitcoin',\n name: 'Native SegWit',\n },\n tr: {\n type: 'tr',\n blockchain: 'bitcoin',\n name: 'Taproot address',\n },\n bns: {\n type: 'bns',\n blockchain: 'stacks',\n name: 'BNS name',\n },\n stacks: {\n type: 'stacks',\n blockchain: 'stacks',\n name: 'Stacks address',\n },\n};\n"],"mappings":";AAOO,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;AAEO,IAAM,uCAGT;AAAA,EACF,IAAI;AAAA,IACF,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AAAA,EACA,IAAI;AAAA,IACF,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;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.10.0",
5
+ "version": "0.11.0",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/leather-io/mono/tree/dev/packages/constants",
8
8
  "repository": {
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "bugs": "https://github.com/leather-io/mono/issues",
18
18
  "dependencies": {
19
- "@leather.io/models": "0.14.0"
19
+ "@leather.io/models": "0.15.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "concurrently": "8.2.2",
package/src/index.ts CHANGED
@@ -1,4 +1,9 @@
1
- import type { BitcoinUnit, BitcoinUnitInfo } from '@leather.io/models';
1
+ import type {
2
+ AccountDisplayPreference,
3
+ AccountDisplayPreferenceInfo,
4
+ BitcoinUnit,
5
+ BitcoinUnitInfo,
6
+ } from '@leather.io/models';
2
7
 
3
8
  export const gaiaUrl = 'https://hub.blockstack.org';
4
9
 
@@ -68,3 +73,29 @@ export const bitcoinUnitsKeyedByName: Record<BitcoinUnit, BitcoinUnitInfo> = {
68
73
  decimal: '0.00000001',
69
74
  },
70
75
  };
76
+
77
+ export const accountDisplayPreferencesKeyedByType: Record<
78
+ AccountDisplayPreference,
79
+ AccountDisplayPreferenceInfo
80
+ > = {
81
+ ns: {
82
+ type: 'ns',
83
+ blockchain: 'bitcoin',
84
+ name: 'Native SegWit',
85
+ },
86
+ tr: {
87
+ type: 'tr',
88
+ blockchain: 'bitcoin',
89
+ name: 'Taproot address',
90
+ },
91
+ bns: {
92
+ type: 'bns',
93
+ blockchain: 'stacks',
94
+ name: 'BNS name',
95
+ },
96
+ stacks: {
97
+ type: 'stacks',
98
+ blockchain: 'stacks',
99
+ name: 'Stacks address',
100
+ },
101
+ };