@leather.io/constants 0.13.7 → 0.14.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.
- package/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @leather.io/constants@0.
|
|
2
|
+
> @leather.io/constants@0.14.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 2.
|
|
12
|
-
ESM dist/index.js.map 4.
|
|
13
|
-
ESM ⚡️ Build success in
|
|
11
|
+
ESM dist/index.js 2.65 KB
|
|
12
|
+
ESM dist/index.js.map 4.05 KB
|
|
13
|
+
ESM ⚡️ Build success in 11ms
|
|
14
14
|
DTS Build start
|
|
15
|
-
DTS ⚡️ Build success in
|
|
16
|
-
DTS dist/index.d.ts 2.
|
|
15
|
+
DTS ⚡️ Build success in 1122ms
|
|
16
|
+
DTS dist/index.d.ts 2.28 KB
|
package/CHANGELOG.md
CHANGED
|
@@ -91,6 +91,13 @@
|
|
|
91
91
|
* dependencies
|
|
92
92
|
* @leather.io/models bumped to 0.24.0
|
|
93
93
|
|
|
94
|
+
## [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)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### Features
|
|
98
|
+
|
|
99
|
+
* add psbt functionality ([6b676a9](https://github.com/leather-io/mono/commit/6b676a971fbd7497e6c285a818374f13745b032c))
|
|
100
|
+
|
|
94
101
|
## [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
102
|
|
|
96
103
|
|
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;
|
|
@@ -47,4 +48,4 @@ declare enum AccountDisplayPreferenceType {
|
|
|
47
48
|
}
|
|
48
49
|
declare const accountDisplayPreferencesKeyedByType: Record<AccountDisplayPreference, AccountDisplayPreferenceInfo>;
|
|
49
50
|
|
|
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 };
|
|
51
|
+
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, 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,
|
|
@@ -92,6 +93,7 @@ export {
|
|
|
92
93
|
LEATHER_SUPPORT_URL,
|
|
93
94
|
ORD_IO_URL,
|
|
94
95
|
PERSISTENCE_CACHE_TIME,
|
|
96
|
+
SATS_IN_BTC,
|
|
95
97
|
STX_DECIMALS,
|
|
96
98
|
TOKEN_NAME_LENGTH,
|
|
97
99
|
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;
|
|
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 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;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;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.
|
|
5
|
+
"version": "0.14.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/leather-io/mono/tree/dev/packages/constants",
|
|
8
8
|
"repository": {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"prettier": "3.3.3",
|
|
25
25
|
"tsup": "8.1.0",
|
|
26
26
|
"typescript": "5.5.4",
|
|
27
|
+
"@leather.io/eslint-config": "0.7.0",
|
|
27
28
|
"@leather.io/prettier-config": "0.6.0",
|
|
28
|
-
"@leather.io/tsconfig-config": "0.6.0"
|
|
29
|
-
"@leather.io/eslint-config": "0.7.0"
|
|
29
|
+
"@leather.io/tsconfig-config": "0.6.0"
|
|
30
30
|
},
|
|
31
31
|
"keywords": [
|
|
32
32
|
"constants",
|
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
|