@leather.io/constants 0.15.4 → 0.16.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 +20 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +19 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @leather.io/constants@0.
|
|
2
|
+
> @leather.io/constants@0.16.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
|
|
12
|
-
ESM dist/index.js.map 4.
|
|
13
|
-
ESM ⚡️ Build success in
|
|
11
|
+
ESM dist/index.js 3.21 KB
|
|
12
|
+
ESM dist/index.js.map 4.95 KB
|
|
13
|
+
ESM ⚡️ Build success in 14ms
|
|
14
14
|
DTS Build start
|
|
15
|
-
DTS ⚡️ Build success in
|
|
16
|
-
DTS dist/index.d.ts 2.
|
|
15
|
+
DTS ⚡️ Build success in 1165ms
|
|
16
|
+
DTS dist/index.d.ts 2.72 KB
|
package/CHANGELOG.md
CHANGED
|
@@ -115,6 +115,26 @@
|
|
|
115
115
|
* dependencies
|
|
116
116
|
* @leather.io/models bumped to 0.25.0
|
|
117
117
|
|
|
118
|
+
### Dependencies
|
|
119
|
+
|
|
120
|
+
* The following workspace dependencies were updated
|
|
121
|
+
* dependencies
|
|
122
|
+
* @leather.io/models bumped to 0.25.1
|
|
123
|
+
|
|
124
|
+
## [0.16.0](https://github.com/leather-io/mono/compare/@leather.io/constants-v0.15.5...@leather.io/constants-v0.16.0) (2025-02-17)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Features
|
|
128
|
+
|
|
129
|
+
* connect leather api client to backend ([bf94c84](https://github.com/leather-io/mono/commit/bf94c848c465f5f146fdc5508f14bb033b9dc829))
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
### Dependencies
|
|
133
|
+
|
|
134
|
+
* The following workspace dependencies were updated
|
|
135
|
+
* dependencies
|
|
136
|
+
* @leather.io/models bumped to 0.26.0
|
|
137
|
+
|
|
118
138
|
## [0.15.0](https://github.com/leather-io/mono/compare/@leather.io/constants-v0.14.1...@leather.io/constants-v0.15.0) (2024-12-12)
|
|
119
139
|
|
|
120
140
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BitcoinUnit, BitcoinUnitInfo, AccountDisplayPreference, AccountDisplayPreferenceInfo } from '@leather.io/models';
|
|
1
|
+
import { BitcoinUnit, BitcoinUnitInfo, AccountDisplayPreference, AccountDisplayPreferenceInfo, BtcCryptoAssetInfo, StxCryptoAssetInfo } from '@leather.io/models';
|
|
2
2
|
|
|
3
3
|
declare const gaiaUrl = "https://hub.blockstack.org";
|
|
4
4
|
declare const ZERO_INDEX = 0;
|
|
@@ -50,5 +50,7 @@ declare enum AccountDisplayPreferenceType {
|
|
|
50
50
|
Stacks = "stacks"
|
|
51
51
|
}
|
|
52
52
|
declare const accountDisplayPreferencesKeyedByType: Record<AccountDisplayPreference, AccountDisplayPreferenceInfo>;
|
|
53
|
+
declare const btcCryptoAsset: BtcCryptoAssetInfo;
|
|
54
|
+
declare const stxCryptoAsset: StxCryptoAssetInfo;
|
|
53
55
|
|
|
54
|
-
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_CONNECT_DAPPS, 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 };
|
|
56
|
+
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_CONNECT_DAPPS, 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, btcCryptoAsset, currencyDecimalsMap, currencyNameMap, gaiaUrl, stxCryptoAsset };
|
package/dist/index.js
CHANGED
|
@@ -82,6 +82,22 @@ var accountDisplayPreferencesKeyedByType = {
|
|
|
82
82
|
name: "Stacks address"
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
+
var btcCryptoAsset = {
|
|
86
|
+
chain: "bitcoin",
|
|
87
|
+
protocol: "nativeBtc",
|
|
88
|
+
symbol: "BTC",
|
|
89
|
+
category: "fungible",
|
|
90
|
+
decimals: 8,
|
|
91
|
+
hasMemo: false
|
|
92
|
+
};
|
|
93
|
+
var stxCryptoAsset = {
|
|
94
|
+
chain: "stacks",
|
|
95
|
+
protocol: "nativeStx",
|
|
96
|
+
symbol: "STX",
|
|
97
|
+
category: "fungible",
|
|
98
|
+
decimals: 6,
|
|
99
|
+
hasMemo: false
|
|
100
|
+
};
|
|
85
101
|
export {
|
|
86
102
|
AccountDisplayPreferenceType,
|
|
87
103
|
BTC_DECIMALS,
|
|
@@ -105,8 +121,10 @@ export {
|
|
|
105
121
|
ZERO_INDEX,
|
|
106
122
|
accountDisplayPreferencesKeyedByType,
|
|
107
123
|
bitcoinUnitsKeyedByName,
|
|
124
|
+
btcCryptoAsset,
|
|
108
125
|
currencyDecimalsMap,
|
|
109
126
|
currencyNameMap,
|
|
110
|
-
gaiaUrl
|
|
127
|
+
gaiaUrl,
|
|
128
|
+
stxCryptoAsset
|
|
111
129
|
};
|
|
112
130
|
//# sourceMappingURL=index.js.map
|
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;\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_GUIDES_CONNECT_DAPPS = `${LEATHER_GUIDES_URL}/connect-dapps`;\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":";
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type {\n AccountDisplayPreference,\n AccountDisplayPreferenceInfo,\n BitcoinUnit,\n BitcoinUnitInfo,\n BtcCryptoAssetInfo,\n StxCryptoAssetInfo,\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_GUIDES_CONNECT_DAPPS = `${LEATHER_GUIDES_URL}/connect-dapps`;\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\nexport const btcCryptoAsset: BtcCryptoAssetInfo = {\n chain: 'bitcoin',\n protocol: 'nativeBtc',\n symbol: 'BTC',\n category: 'fungible',\n decimals: 8,\n hasMemo: false,\n};\nexport const stxCryptoAsset: StxCryptoAssetInfo = {\n chain: 'stacks',\n protocol: 'nativeStx',\n symbol: 'STX',\n category: 'fungible',\n decimals: 6,\n hasMemo: false,\n};\n"],"mappings":";AASO,IAAM,UAAU;AAEhB,IAAM,aAAa;AAEnB,IAAM,oBAAoB;AAC1B,IAAM,aAAa;AAEnB,IAAM,s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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;AAEO,IAAM,iBAAqC;AAAA,EAChD,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,SAAS;AACX;AACO,IAAM,iBAAqC;AAAA,EAChD,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,SAAS;AACX;","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.16.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/leather-io/mono/tree/dev/packages/constants",
|
|
8
8
|
"repository": {
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
},
|
|
17
17
|
"bugs": "https://github.com/leather-io/mono/issues",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@leather.io/models": "0.
|
|
19
|
+
"@leather.io/models": "0.26.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"concurrently": "8.2.2",
|
|
23
23
|
"prettier": "3.3.3",
|
|
24
24
|
"tsup": "8.1.0",
|
|
25
25
|
"typescript": "5.5.4",
|
|
26
|
-
"@leather.io/
|
|
27
|
-
"@leather.io/
|
|
26
|
+
"@leather.io/prettier-config": "0.6.0",
|
|
27
|
+
"@leather.io/tsconfig-config": "0.6.0"
|
|
28
28
|
},
|
|
29
29
|
"keywords": [
|
|
30
30
|
"constants",
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type {
|
|
|
3
3
|
AccountDisplayPreferenceInfo,
|
|
4
4
|
BitcoinUnit,
|
|
5
5
|
BitcoinUnitInfo,
|
|
6
|
+
BtcCryptoAssetInfo,
|
|
7
|
+
StxCryptoAssetInfo,
|
|
6
8
|
} from '@leather.io/models';
|
|
7
9
|
|
|
8
10
|
export const gaiaUrl = 'https://hub.blockstack.org';
|
|
@@ -112,3 +114,20 @@ export const accountDisplayPreferencesKeyedByType: Record<
|
|
|
112
114
|
name: 'Stacks address',
|
|
113
115
|
},
|
|
114
116
|
};
|
|
117
|
+
|
|
118
|
+
export const btcCryptoAsset: BtcCryptoAssetInfo = {
|
|
119
|
+
chain: 'bitcoin',
|
|
120
|
+
protocol: 'nativeBtc',
|
|
121
|
+
symbol: 'BTC',
|
|
122
|
+
category: 'fungible',
|
|
123
|
+
decimals: 8,
|
|
124
|
+
hasMemo: false,
|
|
125
|
+
};
|
|
126
|
+
export const stxCryptoAsset: StxCryptoAssetInfo = {
|
|
127
|
+
chain: 'stacks',
|
|
128
|
+
protocol: 'nativeStx',
|
|
129
|
+
symbol: 'STX',
|
|
130
|
+
category: 'fungible',
|
|
131
|
+
decimals: 6,
|
|
132
|
+
hasMemo: false,
|
|
133
|
+
};
|