@leather.io/constants 0.8.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/.eslintrc.yml +4 -0
- package/.turbo/turbo-build.log +17 -0
- package/CHANGELOG.md +172 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
- package/src/index.ts +35 -0
- package/tsconfig.json +8 -0
- package/tsup.config.ts +9 -0
package/.eslintrc.yml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
> @leather.io/constants@0.8.0 build /home/runner/work/mono/mono/packages/constants
|
|
3
|
+
> tsup
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.1.0
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/mono/mono/packages/constants/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: es2022
|
|
10
|
+
[34mCLI[39m Cleaning output folder
|
|
11
|
+
[34mESM[39m Build start
|
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m1.08 KB[39m
|
|
13
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m1.50 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 32ms
|
|
15
|
+
[34mDTS[39m Build start
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 1684ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.13 KB[39m
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Dependencies
|
|
5
|
+
|
|
6
|
+
* The following workspace dependencies were updated
|
|
7
|
+
* devDependencies
|
|
8
|
+
* @leather.io/eslint-config bumped to 0.5.0
|
|
9
|
+
|
|
10
|
+
## [0.8.0](https://github.com/leather-io/mono/compare/@leather.io/constants-v0.7.0...@leather.io/constants-v0.8.0) (2024-06-21)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add decoded auth request model ([d8b06c0](https://github.com/leather-io/mono/commit/d8b06c0a1512bd977b3f78039e2c72855f895c43))
|
|
16
|
+
* add turborepo + watch dev mode ([d415d79](https://github.com/leather-io/mono/commit/d415d79394488c0cb74765d367b3af8db1d24772))
|
|
17
|
+
* add web and mobile design system with storybook ([0769902](https://github.com/leather-io/mono/commit/076990210312448d583905ac78448ff5068c1f1e))
|
|
18
|
+
* bootstrap release-please ([76b995a](https://github.com/leather-io/mono/commit/76b995a37ecfda0aa006b90ab21cadc57dae8e80))
|
|
19
|
+
* move basic bitcoin queries from extension ([7ce5efe](https://github.com/leather-io/mono/commit/7ce5efe5e7383f2245ff3ec90ac429ba898a1410))
|
|
20
|
+
* move basics from extension ([eee8003](https://github.com/leather-io/mono/commit/eee80037a7e0eada5b3c013a74882ca88d1a3cd3))
|
|
21
|
+
* prepare monorepo packages for extension development ([4fb2dbc](https://github.com/leather-io/mono/commit/4fb2dbc786987d50800cb80329c5986a51bec4c2))
|
|
22
|
+
* reset to pnpm workspaces ([fa7de49](https://github.com/leather-io/mono/commit/fa7de49928ee099419db9ff3e91c7dc7b15a4ffa))
|
|
23
|
+
* tweak bitcoin queries for extension ([dc92174](https://github.com/leather-io/mono/commit/dc9217421593ce35d809d5f555f055b716792837))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* [@leather-wallet](https://github.com/leather-wallet) sorting in prettier ([a44b063](https://github.com/leather-io/mono/commit/a44b0631b745c0ca4abe4d36eb5dfc34a33afce8))
|
|
29
|
+
* bundle packages so that those work in node envs too ([02b6347](https://github.com/leather-io/mono/commit/02b63476e4ea4a519718b31bcc1aeb53aae263f0))
|
|
30
|
+
* high fee warning link ([d60c888](https://github.com/leather-io/mono/commit/d60c8884e24e015f5297992d4416e51eaa295ef7))
|
|
31
|
+
* **tokens:** bundle pkg ([75c05e1](https://github.com/leather-io/mono/commit/75c05e1a7ebc4e8fa93254f3cb7e73ba760f76bb))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Dependencies
|
|
35
|
+
|
|
36
|
+
* The following workspace dependencies were updated
|
|
37
|
+
* devDependencies
|
|
38
|
+
* @leather.io/eslint-config bumped to 0.6.0
|
|
39
|
+
* @leather.io/prettier-config bumped to 0.5.0
|
|
40
|
+
* @leather.io/tsconfig-config bumped to 0.5.0
|
|
41
|
+
|
|
42
|
+
## [0.7.0](https://github.com/leather-io/mono/compare/constants-v0.6.4...constants-v0.7.0) (2024-06-20)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Features
|
|
46
|
+
|
|
47
|
+
* add decoded auth request model ([d8b06c0](https://github.com/leather-io/mono/commit/d8b06c0a1512bd977b3f78039e2c72855f895c43))
|
|
48
|
+
|
|
49
|
+
## [0.6.4](https://github.com/leather-io/mono/compare/constants-v0.6.3...constants-v0.6.4) (2024-06-17)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
* high fee warning link ([d60c888](https://github.com/leather-io/mono/commit/d60c8884e24e015f5297992d4416e51eaa295ef7))
|
|
55
|
+
|
|
56
|
+
## [0.6.2](https://github.com/leather-io/mono/compare/constants-v0.6.1...constants-v0.6.2) (2024-06-05)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Bug Fixes
|
|
60
|
+
|
|
61
|
+
* [@leather.io](https://github.com/leather-io) sorting in prettier ([a44b063](https://github.com/leather-io/mono/commit/a44b0631b745c0ca4abe4d36eb5dfc34a33afce8))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Dependencies
|
|
65
|
+
|
|
66
|
+
* The following workspace dependencies were updated
|
|
67
|
+
* devDependencies
|
|
68
|
+
* @leather.io/prettier-config bumped to 0.4.1
|
|
69
|
+
|
|
70
|
+
## [0.6.1](https://github.com/leather-io/mono/compare/constants-v0.6.0...constants-v0.6.1) (2024-05-20)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Bug Fixes
|
|
74
|
+
|
|
75
|
+
* bundle packages so that those work in node envs too ([02b6347](https://github.com/leather-io/mono/commit/02b63476e4ea4a519718b31bcc1aeb53aae263f0))
|
|
76
|
+
|
|
77
|
+
## [0.6.0](https://github.com/leather-io/mono/compare/constants-v0.5.1...constants-v0.6.0) (2024-05-17)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
### Features
|
|
81
|
+
|
|
82
|
+
* add turborepo + watch dev mode ([d415d79](https://github.com/leather-io/mono/commit/d415d79394488c0cb74765d367b3af8db1d24772))
|
|
83
|
+
* add web and mobile design system with storybook ([0769902](https://github.com/leather-io/mono/commit/076990210312448d583905ac78448ff5068c1f1e))
|
|
84
|
+
* bootstrap release-please ([76b995a](https://github.com/leather-io/mono/commit/76b995a37ecfda0aa006b90ab21cadc57dae8e80))
|
|
85
|
+
* move basic bitcoin queries from extension ([7ce5efe](https://github.com/leather-io/mono/commit/7ce5efe5e7383f2245ff3ec90ac429ba898a1410))
|
|
86
|
+
* move basics from extension ([eee8003](https://github.com/leather-io/mono/commit/eee80037a7e0eada5b3c013a74882ca88d1a3cd3))
|
|
87
|
+
* prepare monorepo packages for extension development ([4fb2dbc](https://github.com/leather-io/mono/commit/4fb2dbc786987d50800cb80329c5986a51bec4c2))
|
|
88
|
+
* reset to pnpm workspaces ([fa7de49](https://github.com/leather-io/mono/commit/fa7de49928ee099419db9ff3e91c7dc7b15a4ffa))
|
|
89
|
+
* tweak bitcoin queries for extension ([dc92174](https://github.com/leather-io/mono/commit/dc9217421593ce35d809d5f555f055b716792837))
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
### Bug Fixes
|
|
93
|
+
|
|
94
|
+
* **tokens:** bundle pkg ([75c05e1](https://github.com/leather-io/mono/commit/75c05e1a7ebc4e8fa93254f3cb7e73ba760f76bb))
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### Dependencies
|
|
98
|
+
|
|
99
|
+
* The following workspace dependencies were updated
|
|
100
|
+
* devDependencies
|
|
101
|
+
* @leather.io/eslint-config bumped to 0.4.0
|
|
102
|
+
* @leather.io/prettier-config bumped to 0.4.0
|
|
103
|
+
* @leather.io/tsconfig-config bumped to 0.4.0
|
|
104
|
+
|
|
105
|
+
## [0.5.0](https://github.com/leather-io/mono/compare/constants-v0.4.1...constants-v0.5.0) (2024-05-17)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### Features
|
|
109
|
+
|
|
110
|
+
* add turborepo + watch dev mode ([d415d79](https://github.com/leather-io/mono/commit/d415d79394488c0cb74765d367b3af8db1d24772))
|
|
111
|
+
* add web and mobile design system with storybook ([0769902](https://github.com/leather-io/mono/commit/076990210312448d583905ac78448ff5068c1f1e))
|
|
112
|
+
* bootstrap release-please ([76b995a](https://github.com/leather-io/mono/commit/76b995a37ecfda0aa006b90ab21cadc57dae8e80))
|
|
113
|
+
* move basic bitcoin queries from extension ([7ce5efe](https://github.com/leather-io/mono/commit/7ce5efe5e7383f2245ff3ec90ac429ba898a1410))
|
|
114
|
+
* move basics from extension ([eee8003](https://github.com/leather-io/mono/commit/eee80037a7e0eada5b3c013a74882ca88d1a3cd3))
|
|
115
|
+
* prepare monorepo packages for extension development ([4fb2dbc](https://github.com/leather-io/mono/commit/4fb2dbc786987d50800cb80329c5986a51bec4c2))
|
|
116
|
+
* reset to pnpm workspaces ([fa7de49](https://github.com/leather-io/mono/commit/fa7de49928ee099419db9ff3e91c7dc7b15a4ffa))
|
|
117
|
+
* tweak bitcoin queries for extension ([dc92174](https://github.com/leather-io/mono/commit/dc9217421593ce35d809d5f555f055b716792837))
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### Bug Fixes
|
|
121
|
+
|
|
122
|
+
* **tokens:** bundle pkg ([75c05e1](https://github.com/leather-io/mono/commit/75c05e1a7ebc4e8fa93254f3cb7e73ba760f76bb))
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### Dependencies
|
|
126
|
+
|
|
127
|
+
* The following workspace dependencies were updated
|
|
128
|
+
* devDependencies
|
|
129
|
+
* @leather.io/eslint-config bumped to 0.3.0
|
|
130
|
+
* @leather.io/prettier-config bumped to 0.3.0
|
|
131
|
+
* @leather.io/tsconfig-config bumped to 0.3.0
|
|
132
|
+
|
|
133
|
+
## [0.4.0](https://github.com/leather-io/mono/compare/constants-v0.3.0...constants-v0.4.0) (2024-05-07)
|
|
134
|
+
|
|
135
|
+
* refactor: pkg org and asset data models ([a46a82c](https://github.com/leather-io/mono/commit/4fb2dbc786987d50800cb80329c5986a51bec4c2))
|
|
136
|
+
|
|
137
|
+
## [0.3.0](https://github.com/leather-io/mono/compare/constants-v0.2.0...constants-v0.3.0) (2024-05-07)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Features
|
|
141
|
+
|
|
142
|
+
* prepare monorepo packages for extension development ([4fb2dbc](https://github.com/leather-io/mono/commit/4fb2dbc786987d50800cb80329c5986a51bec4c2))
|
|
143
|
+
* tweak bitcoin queries for extension ([dc92174](https://github.com/leather-io/mono/commit/dc9217421593ce35d809d5f555f055b716792837))
|
|
144
|
+
|
|
145
|
+
## [0.2.0](https://github.com/leather-io/mono/compare/constants-v0.1.0...constants-v0.2.0) (2024-04-23)
|
|
146
|
+
|
|
147
|
+
### Features
|
|
148
|
+
|
|
149
|
+
- add turborepo + watch dev mode ([d415d79](https://github.com/leather-io/mono/commit/d415d79394488c0cb74765d367b3af8db1d24772))
|
|
150
|
+
- add web and mobile design system with storybook ([0769902](https://github.com/leather-io/mono/commit/076990210312448d583905ac78448ff5068c1f1e))
|
|
151
|
+
- bootstrap release-please ([76b995a](https://github.com/leather-io/mono/commit/76b995a37ecfda0aa006b90ab21cadc57dae8e80))
|
|
152
|
+
- move basic bitcoin queries from extension ([7ce5efe](https://github.com/leather-io/mono/commit/7ce5efe5e7383f2245ff3ec90ac429ba898a1410))
|
|
153
|
+
- move basics from extension ([eee8003](https://github.com/leather-io/mono/commit/eee80037a7e0eada5b3c013a74882ca88d1a3cd3))
|
|
154
|
+
- reset to pnpm workspaces ([fa7de49](https://github.com/leather-io/mono/commit/fa7de49928ee099419db9ff3e91c7dc7b15a4ffa))
|
|
155
|
+
|
|
156
|
+
### Bug Fixes
|
|
157
|
+
|
|
158
|
+
- **tokens:** bundle pkg ([75c05e1](https://github.com/leather-io/mono/commit/75c05e1a7ebc4e8fa93254f3cb7e73ba760f76bb))
|
|
159
|
+
|
|
160
|
+
## [0.1.0](https://github.com/leather-io/mono/compare/constants-v0.0.2...constants-v0.1.0) (2024-04-23)
|
|
161
|
+
|
|
162
|
+
### Features
|
|
163
|
+
|
|
164
|
+
- add turborepo + watch dev mode ([d415d79](https://github.com/leather-io/mono/commit/d415d79394488c0cb74765d367b3af8db1d24772))
|
|
165
|
+
- add web and mobile design system with storybook ([0769902](https://github.com/leather-io/mono/commit/076990210312448d583905ac78448ff5068c1f1e))
|
|
166
|
+
- move basic bitcoin queries from extension ([7ce5efe](https://github.com/leather-io/mono/commit/7ce5efe5e7383f2245ff3ec90ac429ba898a1410))
|
|
167
|
+
- move basics from extension ([eee8003](https://github.com/leather-io/mono/commit/eee80037a7e0eada5b3c013a74882ca88d1a3cd3))
|
|
168
|
+
- reset to pnpm workspaces ([fa7de49](https://github.com/leather-io/mono/commit/fa7de49928ee099419db9ff3e91c7dc7b15a4ffa))
|
|
169
|
+
|
|
170
|
+
### Bug Fixes
|
|
171
|
+
|
|
172
|
+
- **tokens:** bundle pkg ([75c05e1](https://github.com/leather-io/mono/commit/75c05e1a7ebc4e8fa93254f3cb7e73ba760f76bb))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Leather Wallet LLC [a subsidiary of Nassau Machines]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @leather.io/constants
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const gaiaUrl = "https://hub.blockstack.org";
|
|
2
|
+
declare const ZERO_INDEX = 0;
|
|
3
|
+
declare const HIRO_EXPLORER_URL = "https://explorer.hiro.so";
|
|
4
|
+
declare const ORD_IO_URL = "https://ord.io";
|
|
5
|
+
declare const HIGH_FEE_AMOUNT_STX = 5;
|
|
6
|
+
declare const HIGH_FEE_WARNING_LEARN_MORE_URL_BTC = "https://bitcoinfees.earn.com/";
|
|
7
|
+
declare const HIGH_FEE_WARNING_LEARN_MORE_URL_STX = "https://leather.gitbook.io/guides/transactions/fees";
|
|
8
|
+
declare const DEFAULT_FEE_RATE = 400;
|
|
9
|
+
declare const PERSISTENCE_CACHE_TIME: number;
|
|
10
|
+
declare const BTC_DECIMALS = 8;
|
|
11
|
+
declare const STX_DECIMALS = 6;
|
|
12
|
+
declare const currencyDecimalsMap: {
|
|
13
|
+
readonly BTC: 8;
|
|
14
|
+
readonly STX: 6;
|
|
15
|
+
readonly USD: 2;
|
|
16
|
+
};
|
|
17
|
+
declare const BTC_P2WPKH_DUST_AMOUNT = 294;
|
|
18
|
+
declare const KEBAB_REGEX: RegExp;
|
|
19
|
+
declare const DEFAULT_LIST_LIMIT = 50;
|
|
20
|
+
declare const TOKEN_NAME_LENGTH = 4;
|
|
21
|
+
|
|
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 };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
var gaiaUrl = "https://hub.blockstack.org";
|
|
3
|
+
var ZERO_INDEX = 0;
|
|
4
|
+
var HIRO_EXPLORER_URL = "https://explorer.hiro.so";
|
|
5
|
+
var ORD_IO_URL = "https://ord.io";
|
|
6
|
+
var HIGH_FEE_AMOUNT_STX = 5;
|
|
7
|
+
var HIGH_FEE_WARNING_LEARN_MORE_URL_BTC = "https://bitcoinfees.earn.com/";
|
|
8
|
+
var HIGH_FEE_WARNING_LEARN_MORE_URL_STX = "https://leather.gitbook.io/guides/transactions/fees";
|
|
9
|
+
var DEFAULT_FEE_RATE = 400;
|
|
10
|
+
var PERSISTENCE_CACHE_TIME = 1e3 * 60 * 60 * 12;
|
|
11
|
+
var BTC_DECIMALS = 8;
|
|
12
|
+
var STX_DECIMALS = 6;
|
|
13
|
+
var currencyDecimalsMap = {
|
|
14
|
+
BTC: BTC_DECIMALS,
|
|
15
|
+
STX: STX_DECIMALS,
|
|
16
|
+
USD: 2
|
|
17
|
+
};
|
|
18
|
+
var BTC_P2WPKH_DUST_AMOUNT = 294;
|
|
19
|
+
var KEBAB_REGEX = /[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;
|
|
20
|
+
var DEFAULT_LIST_LIMIT = 50;
|
|
21
|
+
var TOKEN_NAME_LENGTH = 4;
|
|
22
|
+
export {
|
|
23
|
+
BTC_DECIMALS,
|
|
24
|
+
BTC_P2WPKH_DUST_AMOUNT,
|
|
25
|
+
DEFAULT_FEE_RATE,
|
|
26
|
+
DEFAULT_LIST_LIMIT,
|
|
27
|
+
HIGH_FEE_AMOUNT_STX,
|
|
28
|
+
HIGH_FEE_WARNING_LEARN_MORE_URL_BTC,
|
|
29
|
+
HIGH_FEE_WARNING_LEARN_MORE_URL_STX,
|
|
30
|
+
HIRO_EXPLORER_URL,
|
|
31
|
+
KEBAB_REGEX,
|
|
32
|
+
ORD_IO_URL,
|
|
33
|
+
PERSISTENCE_CACHE_TIME,
|
|
34
|
+
STX_DECIMALS,
|
|
35
|
+
TOKEN_NAME_LENGTH,
|
|
36
|
+
ZERO_INDEX,
|
|
37
|
+
currencyDecimalsMap,
|
|
38
|
+
gaiaUrl
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@leather.io/constants",
|
|
3
|
+
"author": "Leather.io contact@leather.io",
|
|
4
|
+
"description": "Shared bitcoin utilities",
|
|
5
|
+
"version": "0.8.0",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/leather-io/mono/tree/dev/packages/constants",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git@github.com:leather-io/mono.git",
|
|
11
|
+
"directory": "packages/constants"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"bugs": "https://github.com/leather-io/mono/issues",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"concurrently": "8.2.2",
|
|
20
|
+
"eslint": "8.53.0",
|
|
21
|
+
"prettier": "3.3.0",
|
|
22
|
+
"tsup": "8.1.0",
|
|
23
|
+
"typescript": "5.4.5",
|
|
24
|
+
"@leather.io/prettier-config": "0.5.0",
|
|
25
|
+
"@leather.io/eslint-config": "0.6.0",
|
|
26
|
+
"@leather.io/tsconfig-config": "0.5.0"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"constants",
|
|
30
|
+
"leather",
|
|
31
|
+
"leather wallet"
|
|
32
|
+
],
|
|
33
|
+
"prettier": "@leather.io/prettier-config",
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsup ",
|
|
39
|
+
"build:watch": "tsup --watch",
|
|
40
|
+
"format": "prettier . --write --ignore-path ../../.prettierignore",
|
|
41
|
+
"format:check": "prettier . --check --ignore-path ../../.prettierignore",
|
|
42
|
+
"lint": "eslint . --ignore-path ../../.eslintignore",
|
|
43
|
+
"lint:fix": "eslint . --fix --ignore-path ../../.eslintignore",
|
|
44
|
+
"typecheck": "tsc --noEmit"
|
|
45
|
+
}
|
|
46
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const gaiaUrl = 'https://hub.blockstack.org';
|
|
2
|
+
|
|
3
|
+
export const ZERO_INDEX = 0;
|
|
4
|
+
|
|
5
|
+
export const HIRO_EXPLORER_URL = 'https://explorer.hiro.so';
|
|
6
|
+
export const ORD_IO_URL = 'https://ord.io';
|
|
7
|
+
|
|
8
|
+
export const HIGH_FEE_AMOUNT_STX = 5;
|
|
9
|
+
export const HIGH_FEE_WARNING_LEARN_MORE_URL_BTC = 'https://bitcoinfees.earn.com/';
|
|
10
|
+
export const HIGH_FEE_WARNING_LEARN_MORE_URL_STX =
|
|
11
|
+
'https://leather.gitbook.io/guides/transactions/fees';
|
|
12
|
+
|
|
13
|
+
export const DEFAULT_FEE_RATE = 400;
|
|
14
|
+
|
|
15
|
+
export const PERSISTENCE_CACHE_TIME = 1000 * 60 * 60 * 12; // 12 hours
|
|
16
|
+
|
|
17
|
+
export const BTC_DECIMALS = 8;
|
|
18
|
+
export const STX_DECIMALS = 6;
|
|
19
|
+
|
|
20
|
+
// Units of `Money` should be declared in their smallest unit. Similar to
|
|
21
|
+
// Rosetta, we model currencies with their respective resolution
|
|
22
|
+
export const currencyDecimalsMap = {
|
|
23
|
+
BTC: BTC_DECIMALS,
|
|
24
|
+
STX: STX_DECIMALS,
|
|
25
|
+
USD: 2,
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
28
|
+
// https://bitcoin.stackexchange.com/a/41082/139277
|
|
29
|
+
export const BTC_P2WPKH_DUST_AMOUNT = 294;
|
|
30
|
+
|
|
31
|
+
export const KEBAB_REGEX = /[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;
|
|
32
|
+
|
|
33
|
+
export const DEFAULT_LIST_LIMIT = 50;
|
|
34
|
+
|
|
35
|
+
export const TOKEN_NAME_LENGTH = 4;
|
package/tsconfig.json
ADDED