@leather.io/constants 0.13.7 → 0.14.1

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.13.7 build /home/runner/work/mono/mono/packages/constants
2
+ > @leather.io/constants@0.14.1 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 2.61 KB
12
- ESM dist/index.js.map 4.00 KB
13
- ESM ⚡️ Build success in 15ms
11
+ ESM dist/index.js 2.79 KB
12
+ ESM dist/index.js.map 4.21 KB
13
+ ESM ⚡️ Build success in 13ms
14
14
  DTS Build start
15
- DTS ⚡️ Build success in 1130ms
16
- DTS dist/index.d.ts 2.23 KB
15
+ DTS ⚡️ Build success in 1645ms
16
+ DTS dist/index.d.ts 2.44 KB
package/CHANGELOG.md CHANGED
@@ -91,6 +91,21 @@
91
91
  * dependencies
92
92
  * @leather.io/models bumped to 0.24.0
93
93
 
94
+ ## [0.14.1](https://github.com/leather-io/mono/compare/@leather.io/constants-v0.14.0...@leather.io/constants-v0.14.1) (2024-12-09)
95
+
96
+
97
+ ### Bug Fixes
98
+
99
+ * add support links and text updates, ref #LEA-1835 ([8103cac](https://github.com/leather-io/mono/commit/8103cac687c2df10a8df81d511c43e38bb11c92b))
100
+ * only show support links if they go somewhere, ref #LEA-1835 ([83caa84](https://github.com/leather-io/mono/commit/83caa84a7f247c4438719e6cd3625b200ab203fd))
101
+
102
+ ## [0.14.0](https://github.com/leather-io/mono/compare/@leather.io/constants-v0.13.7...@leather.io/constants-v0.14.0) (2024-12-04)
103
+
104
+
105
+ ### Features
106
+
107
+ * add psbt functionality ([6b676a9](https://github.com/leather-io/mono/commit/6b676a971fbd7497e6c285a818374f13745b032c))
108
+
94
109
  ## [0.13.0](https://github.com/leather-io/mono/compare/@leather.io/constants-v0.12.5...@leather.io/constants-v0.13.0) (2024-10-30)
95
110
 
96
111
 
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ declare const DEFAULT_FEE_RATE = 400;
11
11
  declare const PERSISTENCE_CACHE_TIME: number;
12
12
  declare const BTC_DECIMALS = 8;
13
13
  declare const STX_DECIMALS = 6;
14
+ declare const SATS_IN_BTC = 100000000;
14
15
  declare const currencyDecimalsMap: {
15
16
  readonly BTC: 8;
16
17
  readonly STX: 6;
@@ -38,6 +39,8 @@ declare const KEBAB_REGEX: RegExp;
38
39
  declare const DEFAULT_LIST_LIMIT = 50;
39
40
  declare const TOKEN_NAME_LENGTH = 4;
40
41
  declare const LEATHER_SUPPORT_URL = "https://leather.io/contact";
42
+ declare const LEATHER_GUIDES_URL = "https://leather.io/guides";
43
+ declare const LEATHER_LEARN_URL = "https://leather.io/learn";
41
44
  declare const bitcoinUnitsKeyedByName: Record<BitcoinUnit, BitcoinUnitInfo>;
42
45
  declare enum AccountDisplayPreferenceType {
43
46
  NativeSegwit = "native-segwit",
@@ -47,4 +50,4 @@ declare enum AccountDisplayPreferenceType {
47
50
  }
48
51
  declare const accountDisplayPreferencesKeyedByType: Record<AccountDisplayPreference, AccountDisplayPreferenceInfo>;
49
52
 
50
- export { AccountDisplayPreferenceType, 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 };
53
+ export { AccountDisplayPreferenceType, 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_GUIDES_URL, LEATHER_LEARN_URL, LEATHER_SUPPORT_URL, ORD_IO_URL, PERSISTENCE_CACHE_TIME, SATS_IN_BTC, STX_DECIMALS, TOKEN_NAME_LENGTH, ZERO_INDEX, accountDisplayPreferencesKeyedByType, bitcoinUnitsKeyedByName, currencyDecimalsMap, currencyNameMap, gaiaUrl };
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ var DEFAULT_FEE_RATE = 400;
10
10
  var PERSISTENCE_CACHE_TIME = 1e3 * 60 * 60 * 12;
11
11
  var BTC_DECIMALS = 8;
12
12
  var STX_DECIMALS = 6;
13
+ var SATS_IN_BTC = 1e8;
13
14
  var currencyDecimalsMap = {
14
15
  BTC: BTC_DECIMALS,
15
16
  STX: STX_DECIMALS,
@@ -37,6 +38,8 @@ var KEBAB_REGEX = /[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;
37
38
  var DEFAULT_LIST_LIMIT = 50;
38
39
  var TOKEN_NAME_LENGTH = 4;
39
40
  var LEATHER_SUPPORT_URL = "https://leather.io/contact";
41
+ var LEATHER_GUIDES_URL = "https://leather.io/guides";
42
+ var LEATHER_LEARN_URL = "https://leather.io/learn";
40
43
  var bitcoinUnitsKeyedByName = {
41
44
  bitcoin: {
42
45
  name: "bitcoin",
@@ -89,9 +92,12 @@ export {
89
92
  HIGH_FEE_WARNING_LEARN_MORE_URL_STX,
90
93
  HIRO_EXPLORER_URL,
91
94
  KEBAB_REGEX,
95
+ LEATHER_GUIDES_URL,
96
+ LEATHER_LEARN_URL,
92
97
  LEATHER_SUPPORT_URL,
93
98
  ORD_IO_URL,
94
99
  PERSISTENCE_CACHE_TIME,
100
+ SATS_IN_BTC,
95
101
  STX_DECIMALS,
96
102
  TOKEN_NAME_LENGTH,
97
103
  ZERO_INDEX,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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 enum AccountDisplayPreferenceType {\n NativeSegwit = 'native-segwit',\n Taproot = 'taproot',\n Bns = 'bns',\n Stacks = 'stacks',\n}\n\nexport const accountDisplayPreferencesKeyedByType: Record<\n AccountDisplayPreference,\n AccountDisplayPreferenceInfo\n> = {\n [AccountDisplayPreferenceType.NativeSegwit]: {\n type: 'native-segwit',\n blockchain: 'bitcoin',\n name: 'Native Segwit address',\n },\n [AccountDisplayPreferenceType.Taproot]: {\n type: 'taproot',\n blockchain: 'bitcoin',\n name: 'Taproot address',\n },\n [AccountDisplayPreferenceType.Bns]: {\n type: 'bns',\n blockchain: 'stacks',\n name: 'BNS name',\n },\n [AccountDisplayPreferenceType.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,IAAK,+BAAL,kBAAKA,kCAAL;AACL,EAAAA,8BAAA,kBAAe;AACf,EAAAA,8BAAA,aAAU;AACV,EAAAA,8BAAA,SAAM;AACN,EAAAA,8BAAA,YAAS;AAJC,SAAAA;AAAA,GAAA;AAOL,IAAM,uCAGT;AAAA,EACF,CAAC,kCAAyC,GAAG;AAAA,IAC3C,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AAAA,EACA,CAAC,uBAAoC,GAAG;AAAA,IACtC,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AAAA,EACA,CAAC,eAAgC,GAAG;AAAA,IAClC,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AAAA,EACA,CAAC,qBAAmC,GAAG;AAAA,IACrC,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AACF;","names":["AccountDisplayPreferenceType"]}
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;\nexport const SATS_IN_BTC = 100_000_000;\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 LEATHER_GUIDES_URL = 'https://leather.io/guides';\n\nexport const LEATHER_LEARN_URL = 'https://leather.io/learn';\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 enum AccountDisplayPreferenceType {\n NativeSegwit = 'native-segwit',\n Taproot = 'taproot',\n Bns = 'bns',\n Stacks = 'stacks',\n}\n\nexport const accountDisplayPreferencesKeyedByType: Record<\n AccountDisplayPreference,\n AccountDisplayPreferenceInfo\n> = {\n [AccountDisplayPreferenceType.NativeSegwit]: {\n type: 'native-segwit',\n blockchain: 'bitcoin',\n name: 'Native Segwit address',\n },\n [AccountDisplayPreferenceType.Taproot]: {\n type: 'taproot',\n blockchain: 'bitcoin',\n name: 'Taproot address',\n },\n [AccountDisplayPreferenceType.Bns]: {\n type: 'bns',\n blockchain: 'stacks',\n name: 'BNS name',\n },\n [AccountDisplayPreferenceType.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;AACrB,IAAM,cAAc;AAIpB,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,qBAAqB;AAE3B,IAAM,oBAAoB;AAC1B,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,IAAK,+BAAL,kBAAKA,kCAAL;AACL,EAAAA,8BAAA,kBAAe;AACf,EAAAA,8BAAA,aAAU;AACV,EAAAA,8BAAA,SAAM;AACN,EAAAA,8BAAA,YAAS;AAJC,SAAAA;AAAA,GAAA;AAOL,IAAM,uCAGT;AAAA,EACF,CAAC,kCAAyC,GAAG;AAAA,IAC3C,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AAAA,EACA,CAAC,uBAAoC,GAAG;AAAA,IACtC,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AAAA,EACA,CAAC,eAAgC,GAAG;AAAA,IAClC,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AAAA,EACA,CAAC,qBAAmC,GAAG;AAAA,IACrC,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AACF;","names":["AccountDisplayPreferenceType"]}
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.13.7",
5
+ "version": "0.14.1",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/leather-io/mono/tree/dev/packages/constants",
8
8
  "repository": {
@@ -24,8 +24,8 @@
24
24
  "prettier": "3.3.3",
25
25
  "tsup": "8.1.0",
26
26
  "typescript": "5.5.4",
27
- "@leather.io/prettier-config": "0.6.0",
28
27
  "@leather.io/tsconfig-config": "0.6.0",
28
+ "@leather.io/prettier-config": "0.6.0",
29
29
  "@leather.io/eslint-config": "0.7.0"
30
30
  },
31
31
  "keywords": [
package/src/index.ts CHANGED
@@ -23,6 +23,7 @@ export const PERSISTENCE_CACHE_TIME = 1000 * 60 * 60 * 12; // 12 hours
23
23
 
24
24
  export const BTC_DECIMALS = 8;
25
25
  export const STX_DECIMALS = 6;
26
+ export const SATS_IN_BTC = 100_000_000;
26
27
 
27
28
  // Units of `Money` should be declared in their smallest unit. Similar to
28
29
  // Rosetta, we model currencies with their respective resolution
@@ -61,6 +62,9 @@ export const TOKEN_NAME_LENGTH = 4;
61
62
 
62
63
  export const LEATHER_SUPPORT_URL = 'https://leather.io/contact';
63
64
 
65
+ export const LEATHER_GUIDES_URL = 'https://leather.io/guides';
66
+
67
+ export const LEATHER_LEARN_URL = 'https://leather.io/learn';
64
68
  export const bitcoinUnitsKeyedByName: Record<BitcoinUnit, BitcoinUnitInfo> = {
65
69
  bitcoin: {
66
70
  name: 'bitcoin',