@leather.io/models 0.10.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 +263 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/index.d.ts +323 -0
- package/dist/index.js +284 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
- package/src/crypto-assets/bitcoin/inscription.model.ts +158 -0
- package/src/crypto-assets/crypto-asset-balance.model.ts +59 -0
- package/src/crypto-assets/crypto-asset-info.model.ts +68 -0
- package/src/currencies.model.ts +7 -0
- package/src/decoded-auth-request.ts +14 -0
- package/src/fees/bitcoin-fees.model.ts +19 -0
- package/src/fees/fees.model.ts +23 -0
- package/src/fees/stacks-fees.model.ts +6 -0
- package/src/index.ts +15 -0
- package/src/market.model.ts +26 -0
- package/src/money.model.ts +11 -0
- package/src/network.model.ts +169 -0
- package/src/transactions/bitcoin-transaction.model.ts +66 -0
- package/src/transactions/stacks-transaction.model.ts +17 -0
- package/src/types.ts +15 -0
- package/src/types.utils.ts +13 -0
- package/src/utxo.model.ts +11 -0
- package/tsconfig.json +8 -0
- package/tsup.config.ts +9 -0
package/.eslintrc.yml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
> @leather.io/models@0.10.0 build /home/runner/work/mono/mono/packages/models
|
|
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/models/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[32m8.12 KB[39m
|
|
13
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m16.65 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 22ms
|
|
15
|
+
[34mDTS[39m Build start
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 2152ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m11.19 KB[39m
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
### Dependencies
|
|
4
|
+
|
|
5
|
+
* The following workspace dependencies were updated
|
|
6
|
+
* devDependencies
|
|
7
|
+
* @leather.io/eslint-config bumped to 0.5.0
|
|
8
|
+
|
|
9
|
+
## [0.10.0](https://github.com/leather-io/mono/compare/@leather.io/models-v0.9.0...@leather.io/models-v0.10.0) (2024-06-21)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* add decoded auth request model ([d8b06c0](https://github.com/leather-io/mono/commit/d8b06c0a1512bd977b3f78039e2c72855f895c43))
|
|
15
|
+
* add stacks queries ([ba0ab05](https://github.com/leather-io/mono/commit/ba0ab053cf99c4fa5875079e956cdf7f58deb810))
|
|
16
|
+
* add stacks tx and status model ([974aa25](https://github.com/leather-io/mono/commit/974aa2587b25e913421e01f89ada8313255ade09))
|
|
17
|
+
* add turborepo + watch dev mode ([d415d79](https://github.com/leather-io/mono/commit/d415d79394488c0cb74765d367b3af8db1d24772))
|
|
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
|
+
* update bitcoin inscription queries ([d4dc8d9](https://github.com/leather-io/mono/commit/d4dc8d9ea05b746663a859d59949cf1e42789d50))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* [@leather-wallet](https://github.com/leather-wallet) sorting in prettier ([a44b063](https://github.com/leather-io/mono/commit/a44b0631b745c0ca4abe4d36eb5dfc34a33afce8))
|
|
28
|
+
* add contract address to sip10 asset info ([28012c7](https://github.com/leather-io/mono/commit/28012c761766d455cdb157ece54e3a19e20fb458))
|
|
29
|
+
* add contract asset name to model ([cef956e](https://github.com/leather-io/mono/commit/cef956e7690a915ce702dca7d42823d6d1c69f8e))
|
|
30
|
+
* apply queries updates from extension ([c71aa0f](https://github.com/leather-io/mono/commit/c71aa0fba9768a86bfc014c1765a86277d3bac89))
|
|
31
|
+
* apply recent query updates ([892351a](https://github.com/leather-io/mono/commit/892351a71a83ec70d5fcc683113f6590fa63fa66))
|
|
32
|
+
* bundle packages so that those work in node envs too ([02b6347](https://github.com/leather-io/mono/commit/02b63476e4ea4a519718b31bcc1aeb53aae263f0))
|
|
33
|
+
* model enum declaration ([910f98d](https://github.com/leather-io/mono/commit/910f98dc9a0ea85be347b5d4595b582b4cb786d1))
|
|
34
|
+
* react.JSX deprecated ([845efe1](https://github.com/leather-io/mono/commit/845efe1cfaf36e83fef5202b2d86aa03dbe0a70a))
|
|
35
|
+
* stacks contract id on asset info ([29d2b6b](https://github.com/leather-io/mono/commit/29d2b6bbdb3530acb4dbd2ba30c86542acd6e66c))
|
|
36
|
+
* syncpack ([8dcee26](https://github.com/leather-io/mono/commit/8dcee260c8cb7b81028ff8ae70341f88db5d256e))
|
|
37
|
+
* **tokens:** bundle pkg ([75c05e1](https://github.com/leather-io/mono/commit/75c05e1a7ebc4e8fa93254f3cb7e73ba760f76bb))
|
|
38
|
+
* update asset model naming ([9f1c87e](https://github.com/leather-io/mono/commit/9f1c87e54d57353b1400ff4565139b8b7cbf001f))
|
|
39
|
+
* update asset models based on discussion ([2bd453e](https://github.com/leather-io/mono/commit/2bd453ece14942d0e00e5f0f09620935390c42c6))
|
|
40
|
+
* update inscription model and update inscription queries ([657f923](https://github.com/leather-io/mono/commit/657f9238cb2512f345af732cb5e34dd69e674e9f))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Dependencies
|
|
44
|
+
|
|
45
|
+
* The following workspace dependencies were updated
|
|
46
|
+
* devDependencies
|
|
47
|
+
* @leather.io/eslint-config bumped to 0.6.0
|
|
48
|
+
* @leather.io/prettier-config bumped to 0.5.0
|
|
49
|
+
* @leather.io/tsconfig-config bumped to 0.5.0
|
|
50
|
+
|
|
51
|
+
## [0.9.0](https://github.com/leather-io/mono/compare/models-v0.8.0...models-v0.9.0) (2024-06-20)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Features
|
|
55
|
+
|
|
56
|
+
* add decoded auth request model ([d8b06c0](https://github.com/leather-io/mono/commit/d8b06c0a1512bd977b3f78039e2c72855f895c43))
|
|
57
|
+
|
|
58
|
+
## [0.8.0](https://github.com/leather-io/mono/compare/models-v0.7.0...models-v0.8.0) (2024-06-07)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
* add stacks tx and status model ([974aa25](https://github.com/leather-io/mono/commit/974aa2587b25e913421e01f89ada8313255ade09))
|
|
64
|
+
|
|
65
|
+
## [0.7.0](https://github.com/leather-io/mono/compare/models-v0.6.8...models-v0.7.0) (2024-06-07)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Features
|
|
69
|
+
|
|
70
|
+
* add stacks queries ([ba0ab05](https://github.com/leather-io/mono/commit/ba0ab053cf99c4fa5875079e956cdf7f58deb810))
|
|
71
|
+
|
|
72
|
+
## [0.6.7](https://github.com/leather-io/mono/compare/models-v0.6.6...models-v0.6.7) (2024-06-05)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Bug Fixes
|
|
76
|
+
|
|
77
|
+
* [@leather.io](https://github.com/leather-io) sorting in prettier ([a44b063](https://github.com/leather-io/mono/commit/a44b0631b745c0ca4abe4d36eb5dfc34a33afce8))
|
|
78
|
+
* react.JSX deprecated ([845efe1](https://github.com/leather-io/mono/commit/845efe1cfaf36e83fef5202b2d86aa03dbe0a70a))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### Dependencies
|
|
82
|
+
|
|
83
|
+
* The following workspace dependencies were updated
|
|
84
|
+
* devDependencies
|
|
85
|
+
* @leather.io/prettier-config bumped to 0.4.1
|
|
86
|
+
|
|
87
|
+
## [0.6.6](https://github.com/leather-io/mono/compare/models-v0.6.5...models-v0.6.6) (2024-05-30)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* syncpack ([8dcee26](https://github.com/leather-io/mono/commit/8dcee260c8cb7b81028ff8ae70341f88db5d256e))
|
|
93
|
+
|
|
94
|
+
## [0.6.5](https://github.com/leather-io/mono/compare/models-v0.6.4...models-v0.6.5) (2024-05-23)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### Bug Fixes
|
|
98
|
+
|
|
99
|
+
* apply recent query updates ([892351a](https://github.com/leather-io/mono/commit/892351a71a83ec70d5fcc683113f6590fa63fa66))
|
|
100
|
+
|
|
101
|
+
## [0.6.4](https://github.com/leather-io/mono/compare/models-v0.6.3...models-v0.6.4) (2024-05-22)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
### Bug Fixes
|
|
105
|
+
|
|
106
|
+
* update asset models based on discussion ([2bd453e](https://github.com/leather-io/mono/commit/2bd453ece14942d0e00e5f0f09620935390c42c6))
|
|
107
|
+
|
|
108
|
+
## [0.6.3](https://github.com/leather-io/mono/compare/models-v0.6.2...models-v0.6.3) (2024-05-22)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
### Bug Fixes
|
|
112
|
+
|
|
113
|
+
* add contract asset name to model ([cef956e](https://github.com/leather-io/mono/commit/cef956e7690a915ce702dca7d42823d6d1c69f8e))
|
|
114
|
+
|
|
115
|
+
## [0.6.2](https://github.com/leather-io/mono/compare/models-v0.6.1...models-v0.6.2) (2024-05-22)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### Bug Fixes
|
|
119
|
+
|
|
120
|
+
* add contract address to sip10 asset info ([28012c7](https://github.com/leather-io/mono/commit/28012c761766d455cdb157ece54e3a19e20fb458))
|
|
121
|
+
|
|
122
|
+
## [0.6.1](https://github.com/leather-io/mono/compare/models-v0.6.0...models-v0.6.1) (2024-05-20)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### Bug Fixes
|
|
126
|
+
|
|
127
|
+
* bundle packages so that those work in node envs too ([02b6347](https://github.com/leather-io/mono/commit/02b63476e4ea4a519718b31bcc1aeb53aae263f0))
|
|
128
|
+
|
|
129
|
+
## [0.6.0](https://github.com/leather-io/mono/compare/models-v0.5.1...models-v0.6.0) (2024-05-17)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
### Features
|
|
133
|
+
|
|
134
|
+
* add turborepo + watch dev mode ([d415d79](https://github.com/leather-io/mono/commit/d415d79394488c0cb74765d367b3af8db1d24772))
|
|
135
|
+
* bootstrap release-please ([76b995a](https://github.com/leather-io/mono/commit/76b995a37ecfda0aa006b90ab21cadc57dae8e80))
|
|
136
|
+
* move basic bitcoin queries from extension ([7ce5efe](https://github.com/leather-io/mono/commit/7ce5efe5e7383f2245ff3ec90ac429ba898a1410))
|
|
137
|
+
* move basics from extension ([eee8003](https://github.com/leather-io/mono/commit/eee80037a7e0eada5b3c013a74882ca88d1a3cd3))
|
|
138
|
+
* prepare monorepo packages for extension development ([4fb2dbc](https://github.com/leather-io/mono/commit/4fb2dbc786987d50800cb80329c5986a51bec4c2))
|
|
139
|
+
* update bitcoin inscription queries ([d4dc8d9](https://github.com/leather-io/mono/commit/d4dc8d9ea05b746663a859d59949cf1e42789d50))
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
### Bug Fixes
|
|
143
|
+
|
|
144
|
+
* apply queries updates from extension ([c71aa0f](https://github.com/leather-io/mono/commit/c71aa0fba9768a86bfc014c1765a86277d3bac89))
|
|
145
|
+
* model enum declaration ([910f98d](https://github.com/leather-io/mono/commit/910f98dc9a0ea85be347b5d4595b582b4cb786d1))
|
|
146
|
+
* stacks contract id on asset info ([29d2b6b](https://github.com/leather-io/mono/commit/29d2b6bbdb3530acb4dbd2ba30c86542acd6e66c))
|
|
147
|
+
* **tokens:** bundle pkg ([75c05e1](https://github.com/leather-io/mono/commit/75c05e1a7ebc4e8fa93254f3cb7e73ba760f76bb))
|
|
148
|
+
* update asset model naming ([9f1c87e](https://github.com/leather-io/mono/commit/9f1c87e54d57353b1400ff4565139b8b7cbf001f))
|
|
149
|
+
* update inscription model and update inscription queries ([657f923](https://github.com/leather-io/mono/commit/657f9238cb2512f345af732cb5e34dd69e674e9f))
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
### Dependencies
|
|
153
|
+
|
|
154
|
+
* The following workspace dependencies were updated
|
|
155
|
+
* devDependencies
|
|
156
|
+
* @leather.io/eslint-config bumped to 0.4.0
|
|
157
|
+
* @leather.io/prettier-config bumped to 0.4.0
|
|
158
|
+
* @leather.io/tsconfig-config bumped to 0.4.0
|
|
159
|
+
|
|
160
|
+
## [0.5.0](https://github.com/leather-io/mono/compare/models-v0.4.6...models-v0.5.0) (2024-05-17)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
### Features
|
|
164
|
+
|
|
165
|
+
* add turborepo + watch dev mode ([d415d79](https://github.com/leather-io/mono/commit/d415d79394488c0cb74765d367b3af8db1d24772))
|
|
166
|
+
* bootstrap release-please ([76b995a](https://github.com/leather-io/mono/commit/76b995a37ecfda0aa006b90ab21cadc57dae8e80))
|
|
167
|
+
* move basic bitcoin queries from extension ([7ce5efe](https://github.com/leather-io/mono/commit/7ce5efe5e7383f2245ff3ec90ac429ba898a1410))
|
|
168
|
+
* move basics from extension ([eee8003](https://github.com/leather-io/mono/commit/eee80037a7e0eada5b3c013a74882ca88d1a3cd3))
|
|
169
|
+
* prepare monorepo packages for extension development ([4fb2dbc](https://github.com/leather-io/mono/commit/4fb2dbc786987d50800cb80329c5986a51bec4c2))
|
|
170
|
+
* update bitcoin inscription queries ([d4dc8d9](https://github.com/leather-io/mono/commit/d4dc8d9ea05b746663a859d59949cf1e42789d50))
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
### Bug Fixes
|
|
174
|
+
|
|
175
|
+
* apply queries updates from extension ([c71aa0f](https://github.com/leather-io/mono/commit/c71aa0fba9768a86bfc014c1765a86277d3bac89))
|
|
176
|
+
* model enum declaration ([910f98d](https://github.com/leather-io/mono/commit/910f98dc9a0ea85be347b5d4595b582b4cb786d1))
|
|
177
|
+
* stacks contract id on asset info ([29d2b6b](https://github.com/leather-io/mono/commit/29d2b6bbdb3530acb4dbd2ba30c86542acd6e66c))
|
|
178
|
+
* **tokens:** bundle pkg ([75c05e1](https://github.com/leather-io/mono/commit/75c05e1a7ebc4e8fa93254f3cb7e73ba760f76bb))
|
|
179
|
+
* update asset model naming ([9f1c87e](https://github.com/leather-io/mono/commit/9f1c87e54d57353b1400ff4565139b8b7cbf001f))
|
|
180
|
+
* update inscription model and update inscription queries ([657f923](https://github.com/leather-io/mono/commit/657f9238cb2512f345af732cb5e34dd69e674e9f))
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
### Dependencies
|
|
184
|
+
|
|
185
|
+
* The following workspace dependencies were updated
|
|
186
|
+
* devDependencies
|
|
187
|
+
* @leather.io/eslint-config bumped to 0.3.0
|
|
188
|
+
* @leather.io/prettier-config bumped to 0.3.0
|
|
189
|
+
* @leather.io/tsconfig-config bumped to 0.3.0
|
|
190
|
+
|
|
191
|
+
## [0.4.5](https://github.com/leather-io/mono/compare/models-v0.4.4...models-v0.4.5) (2024-05-15)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
### Bug Fixes
|
|
195
|
+
|
|
196
|
+
* apply queries updates from extension ([c71aa0f](https://github.com/leather-io/mono/commit/c71aa0fba9768a86bfc014c1765a86277d3bac89))
|
|
197
|
+
|
|
198
|
+
## [0.4.4](https://github.com/leather-io/mono/compare/models-v0.4.3...models-v0.4.4) (2024-05-14)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
### Bug Fixes
|
|
202
|
+
|
|
203
|
+
* update asset model naming ([9f1c87e](https://github.com/leather-io/mono/commit/9f1c87e54d57353b1400ff4565139b8b7cbf001f))
|
|
204
|
+
|
|
205
|
+
## [0.4.3](https://github.com/leather-io/mono/compare/models-v0.4.2...models-v0.4.3) (2024-05-10)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
### Bug Fixes
|
|
209
|
+
|
|
210
|
+
* stacks contract id on asset info ([29d2b6b](https://github.com/leather-io/mono/commit/29d2b6bbdb3530acb4dbd2ba30c86542acd6e66c))
|
|
211
|
+
|
|
212
|
+
## [0.4.2](https://github.com/leather-io/mono/compare/models-v0.4.1...models-v0.4.2) (2024-05-10)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
### Bug Fixes
|
|
216
|
+
|
|
217
|
+
* update inscription model and update inscription queries ([657f923](https://github.com/leather-io/mono/commit/657f9238cb2512f345af732cb5e34dd69e674e9f))
|
|
218
|
+
|
|
219
|
+
## [0.4.1](https://github.com/leather-io/mono/compare/models-v0.4.0...models-v0.4.1) (2024-05-08)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
### Bug Fixes
|
|
223
|
+
|
|
224
|
+
* model enum declaration ([910f98d](https://github.com/leather-io/mono/commit/910f98dc9a0ea85be347b5d4595b582b4cb786d1))
|
|
225
|
+
|
|
226
|
+
## [0.4.0](https://github.com/leather-io/mono/compare/models-v0.3.0...models-v0.4.0) (2024-05-08)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
### Features
|
|
230
|
+
|
|
231
|
+
* update bitcoin inscription queries ([d4dc8d9](https://github.com/leather-io/mono/commit/d4dc8d9ea05b746663a859d59949cf1e42789d50))
|
|
232
|
+
|
|
233
|
+
## [0.3.0](https://github.com/leather-io/mono/compare/models-v0.2.0...models-v0.3.0) (2024-05-07)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
### Features
|
|
237
|
+
|
|
238
|
+
* prepare monorepo packages for extension development ([4fb2dbc](https://github.com/leather-io/mono/commit/4fb2dbc786987d50800cb80329c5986a51bec4c2))
|
|
239
|
+
|
|
240
|
+
## [0.2.0](https://github.com/leather-io/mono/compare/models-v0.1.0...models-v0.2.0) (2024-04-23)
|
|
241
|
+
|
|
242
|
+
### Features
|
|
243
|
+
|
|
244
|
+
- add turborepo + watch dev mode ([d415d79](https://github.com/leather-io/mono/commit/d415d79394488c0cb74765d367b3af8db1d24772))
|
|
245
|
+
- bootstrap release-please ([76b995a](https://github.com/leather-io/mono/commit/76b995a37ecfda0aa006b90ab21cadc57dae8e80))
|
|
246
|
+
- move basic bitcoin queries from extension ([7ce5efe](https://github.com/leather-io/mono/commit/7ce5efe5e7383f2245ff3ec90ac429ba898a1410))
|
|
247
|
+
- move basics from extension ([eee8003](https://github.com/leather-io/mono/commit/eee80037a7e0eada5b3c013a74882ca88d1a3cd3))
|
|
248
|
+
|
|
249
|
+
### Bug Fixes
|
|
250
|
+
|
|
251
|
+
- **tokens:** bundle pkg ([75c05e1](https://github.com/leather-io/mono/commit/75c05e1a7ebc4e8fa93254f3cb7e73ba760f76bb))
|
|
252
|
+
|
|
253
|
+
## [0.1.0](https://github.com/leather-io/mono/compare/models-v0.0.2...models-v0.1.0) (2024-04-23)
|
|
254
|
+
|
|
255
|
+
### Features
|
|
256
|
+
|
|
257
|
+
- add turborepo + watch dev mode ([d415d79](https://github.com/leather-io/mono/commit/d415d79394488c0cb74765d367b3af8db1d24772))
|
|
258
|
+
- move basic bitcoin queries from extension ([7ce5efe](https://github.com/leather-io/mono/commit/7ce5efe5e7383f2245ff3ec90ac429ba898a1410))
|
|
259
|
+
- move basics from extension ([eee8003](https://github.com/leather-io/mono/commit/eee80037a7e0eada5b3c013a74882ca88d1a3cd3))
|
|
260
|
+
|
|
261
|
+
### Bug Fixes
|
|
262
|
+
|
|
263
|
+
- **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/models
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { MempoolTransaction, Transaction } from '@stacks/stacks-blockchain-api-types';
|
|
3
|
+
|
|
4
|
+
type ValueOf<T> = T[keyof T];
|
|
5
|
+
interface AllowAdditionalProperties {
|
|
6
|
+
[x: string | number | symbol]: unknown;
|
|
7
|
+
}
|
|
8
|
+
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
9
|
+
type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
10
|
+
type Entries<T> = {
|
|
11
|
+
[K in keyof T]: [K, T[K]];
|
|
12
|
+
}[keyof T][];
|
|
13
|
+
|
|
14
|
+
type CryptoCurrencies = LiteralUnion<'BTC' | 'STX', string>;
|
|
15
|
+
type FiatCurrencies = 'USD' | string;
|
|
16
|
+
type Currencies = CryptoCurrencies | FiatCurrencies;
|
|
17
|
+
|
|
18
|
+
type NumType = BigNumber | bigint | number;
|
|
19
|
+
interface Money {
|
|
20
|
+
readonly amount: BigNumber;
|
|
21
|
+
readonly symbol: Currencies;
|
|
22
|
+
readonly decimals: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface BaseCryptoAssetBalance {
|
|
26
|
+
readonly availableBalance: Money;
|
|
27
|
+
}
|
|
28
|
+
interface BtcCryptoAssetBalance extends BaseCryptoAssetBalance {
|
|
29
|
+
readonly protectedBalance: Money;
|
|
30
|
+
readonly uneconomicalBalance: Money;
|
|
31
|
+
}
|
|
32
|
+
interface StxCryptoAssetBalance extends BaseCryptoAssetBalance {
|
|
33
|
+
readonly availableUnlockedBalance: Money;
|
|
34
|
+
readonly inboundBalance: Money;
|
|
35
|
+
readonly lockedBalance: Money;
|
|
36
|
+
readonly outboundBalance: Money;
|
|
37
|
+
readonly pendingBalance: Money;
|
|
38
|
+
readonly totalBalance: Money;
|
|
39
|
+
readonly unlockedBalance: Money;
|
|
40
|
+
}
|
|
41
|
+
type CryptoAssetBalance = BaseCryptoAssetBalance | BtcCryptoAssetBalance | StxCryptoAssetBalance;
|
|
42
|
+
declare function createCryptoAssetBalance(balance: Money): BaseCryptoAssetBalance;
|
|
43
|
+
|
|
44
|
+
declare const inscriptionMimeTypes: readonly ["audio", "gltf", "html", "image", "svg", "text", "video", "other"];
|
|
45
|
+
type InscriptionMimeType = (typeof inscriptionMimeTypes)[number];
|
|
46
|
+
declare function whenInscriptionMimeType<T>(mimeType: string, branches: {
|
|
47
|
+
[k in InscriptionMimeType]?: () => T;
|
|
48
|
+
}): T;
|
|
49
|
+
interface Inscription extends InscriptionCryptoAssetInfo {
|
|
50
|
+
preview: string;
|
|
51
|
+
src: string;
|
|
52
|
+
title: string;
|
|
53
|
+
output: string;
|
|
54
|
+
txid: string;
|
|
55
|
+
offset: string;
|
|
56
|
+
address: string;
|
|
57
|
+
genesisBlockHash: string;
|
|
58
|
+
genesisTimestamp: number;
|
|
59
|
+
genesisBlockHeight: number;
|
|
60
|
+
value: string;
|
|
61
|
+
}
|
|
62
|
+
interface RawInscription {
|
|
63
|
+
id: string;
|
|
64
|
+
number: number;
|
|
65
|
+
output: string;
|
|
66
|
+
contentType: string;
|
|
67
|
+
txid: string;
|
|
68
|
+
offset: string;
|
|
69
|
+
address: string;
|
|
70
|
+
genesisBlockHash: string;
|
|
71
|
+
genesisTimestamp: number;
|
|
72
|
+
genesisBlockHeight: number;
|
|
73
|
+
value: string;
|
|
74
|
+
}
|
|
75
|
+
declare function createInscription(inscription: RawInscription): Inscription;
|
|
76
|
+
|
|
77
|
+
interface BaseCryptoAssetInfo {
|
|
78
|
+
readonly decimals: number;
|
|
79
|
+
readonly hasMemo: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface BtcCryptoAssetInfo extends BaseCryptoAssetInfo {
|
|
82
|
+
readonly name: 'bitcoin';
|
|
83
|
+
readonly symbol: 'BTC';
|
|
84
|
+
}
|
|
85
|
+
interface StxCryptoAssetInfo extends BaseCryptoAssetInfo {
|
|
86
|
+
readonly name: 'stacks';
|
|
87
|
+
readonly symbol: 'STX';
|
|
88
|
+
}
|
|
89
|
+
interface Brc20CryptoAssetInfo extends BaseCryptoAssetInfo {
|
|
90
|
+
readonly name: 'brc-20';
|
|
91
|
+
readonly symbol: string;
|
|
92
|
+
}
|
|
93
|
+
interface InscriptionCryptoAssetInfo {
|
|
94
|
+
readonly id: string;
|
|
95
|
+
readonly mimeType: InscriptionMimeType;
|
|
96
|
+
readonly name: 'inscription';
|
|
97
|
+
readonly number: number;
|
|
98
|
+
}
|
|
99
|
+
interface RuneCryptoAssetInfo extends BaseCryptoAssetInfo {
|
|
100
|
+
readonly name: 'rune';
|
|
101
|
+
readonly spacedRuneName: string;
|
|
102
|
+
readonly runeName: string;
|
|
103
|
+
readonly symbol: string;
|
|
104
|
+
}
|
|
105
|
+
interface StampCryptoAssetInfo {
|
|
106
|
+
readonly name: 'stamp';
|
|
107
|
+
readonly stamp: number;
|
|
108
|
+
readonly stampUrl: string;
|
|
109
|
+
}
|
|
110
|
+
interface Src20CryptoAssetInfo extends BaseCryptoAssetInfo {
|
|
111
|
+
readonly id: string;
|
|
112
|
+
readonly name: 'src-20';
|
|
113
|
+
readonly symbol: string;
|
|
114
|
+
}
|
|
115
|
+
interface Sip9CryptoAssetInfo {
|
|
116
|
+
readonly contractId: string;
|
|
117
|
+
readonly imageCanonicalUri: string;
|
|
118
|
+
readonly name: string;
|
|
119
|
+
}
|
|
120
|
+
interface Sip10CryptoAssetInfo extends BaseCryptoAssetInfo {
|
|
121
|
+
readonly canTransfer: boolean;
|
|
122
|
+
readonly contractId: string;
|
|
123
|
+
readonly imageCanonicalUri: string;
|
|
124
|
+
readonly name: string;
|
|
125
|
+
readonly symbol: string;
|
|
126
|
+
}
|
|
127
|
+
interface Stx20CryptoAssetInfo {
|
|
128
|
+
readonly name: 'stx-20';
|
|
129
|
+
readonly symbol: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
interface AverageBitcoinFeeRates {
|
|
133
|
+
fastestFee: BigNumber;
|
|
134
|
+
halfHourFee: BigNumber;
|
|
135
|
+
hourFee: BigNumber;
|
|
136
|
+
}
|
|
137
|
+
declare const btcTxTimeMap: Record<keyof AverageBitcoinFeeRates, string>;
|
|
138
|
+
declare enum BtcFeeType {
|
|
139
|
+
High = "High",
|
|
140
|
+
Standard = "Standard",
|
|
141
|
+
Low = "Low"
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
type Blockchains = LiteralUnion<'bitcoin' | 'stacks', string>;
|
|
145
|
+
type CryptoAssetType = 'btc' | 'stx' | 'brc-20' | 'inscription' | 'rune' | 'sip-9' | 'sip-10' | 'src-20' | 'stamp' | 'stx-20';
|
|
146
|
+
|
|
147
|
+
interface StacksFeeEstimate {
|
|
148
|
+
fee: Money;
|
|
149
|
+
feeRate: number;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare enum FeeTypes {
|
|
153
|
+
Low = 0,
|
|
154
|
+
Middle = 1,
|
|
155
|
+
High = 2,
|
|
156
|
+
Custom = 3,
|
|
157
|
+
Unknown = 4
|
|
158
|
+
}
|
|
159
|
+
declare enum FeeCalculationTypes {
|
|
160
|
+
Api = "api",
|
|
161
|
+
Default = "default",
|
|
162
|
+
DefaultSimulated = "default-simulated",
|
|
163
|
+
FeesCapped = "fees-capped"
|
|
164
|
+
}
|
|
165
|
+
interface Fees {
|
|
166
|
+
blockchain: Blockchains;
|
|
167
|
+
estimates: StacksFeeEstimate[];
|
|
168
|
+
calculation: FeeCalculationTypes;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
interface MarketPair {
|
|
172
|
+
readonly base: CryptoCurrencies;
|
|
173
|
+
readonly quote: FiatCurrencies;
|
|
174
|
+
}
|
|
175
|
+
declare function createMarketPair(base: CryptoCurrencies, quote: FiatCurrencies): MarketPair;
|
|
176
|
+
declare function formatMarketPair({ base, quote }: MarketPair): string;
|
|
177
|
+
interface MarketData {
|
|
178
|
+
readonly pair: MarketPair;
|
|
179
|
+
readonly price: Money;
|
|
180
|
+
}
|
|
181
|
+
declare function createMarketData(pair: MarketPair, price: Money): MarketData;
|
|
182
|
+
|
|
183
|
+
declare const HIRO_API_BASE_URL_MAINNET = "https://api.hiro.so";
|
|
184
|
+
declare const HIRO_API_BASE_URL_TESTNET = "https://api.testnet.hiro.so";
|
|
185
|
+
declare const HIRO_INSCRIPTIONS_API_URL = "https://api.hiro.so/ordinals/v1/inscriptions";
|
|
186
|
+
declare const HIRO_API_BASE_URL_NAKAMOTO_TESTNET = "https://api.nakamoto.testnet.hiro.so";
|
|
187
|
+
declare const BITCOIN_API_BASE_URL_MAINNET = "https://blockstream.info/api";
|
|
188
|
+
declare const BITCOIN_API_BASE_URL_TESTNET = "https://blockstream.info/testnet/api";
|
|
189
|
+
declare const BITCOIN_API_BASE_URL_SIGNET = "https://mempool.space/signet/api";
|
|
190
|
+
declare const BESTINSLOT_API_BASE_URL_MAINNET = "https://leatherapi.bestinslot.xyz/v3";
|
|
191
|
+
declare const BESTINSLOT_API_BASE_URL_TESTNET = "https://leatherapi_testnet.bestinslot.xyz/v3";
|
|
192
|
+
declare const STX20_API_BASE_URL_MAINNET = "https://api.stx20.com/api/v1";
|
|
193
|
+
declare enum ChainID {
|
|
194
|
+
Testnet = 2147483648,
|
|
195
|
+
Mainnet = 1
|
|
196
|
+
}
|
|
197
|
+
declare enum WalletDefaultNetworkConfigurationIds {
|
|
198
|
+
mainnet = "mainnet",
|
|
199
|
+
testnet = "testnet",
|
|
200
|
+
signet = "signet",
|
|
201
|
+
sbtcDevenv = "sbtcDevenv",
|
|
202
|
+
devnet = "devnet"
|
|
203
|
+
}
|
|
204
|
+
type DefaultNetworkConfigurations = keyof typeof WalletDefaultNetworkConfigurationIds;
|
|
205
|
+
declare const supportedBlockchains: readonly ["stacks", "bitcoin"];
|
|
206
|
+
type SupportedBlockchains = (typeof supportedBlockchains)[number];
|
|
207
|
+
declare const networkModes: readonly ["mainnet", "testnet"];
|
|
208
|
+
type NetworkModes = (typeof networkModes)[number];
|
|
209
|
+
type BitcoinTestnetModes = 'testnet' | 'regtest' | 'signet';
|
|
210
|
+
type BitcoinNetworkModes = NetworkModes | BitcoinTestnetModes;
|
|
211
|
+
interface BaseChainConfig {
|
|
212
|
+
blockchain: Blockchains;
|
|
213
|
+
}
|
|
214
|
+
interface BitcoinChainConfig extends BaseChainConfig {
|
|
215
|
+
blockchain: 'bitcoin';
|
|
216
|
+
bitcoinUrl: string;
|
|
217
|
+
bitcoinNetwork: BitcoinNetworkModes;
|
|
218
|
+
}
|
|
219
|
+
interface StacksChainConfig extends BaseChainConfig {
|
|
220
|
+
blockchain: 'stacks';
|
|
221
|
+
url: string;
|
|
222
|
+
chainId: ChainID;
|
|
223
|
+
subnetChainId?: ChainID;
|
|
224
|
+
}
|
|
225
|
+
interface NetworkConfiguration {
|
|
226
|
+
name: string;
|
|
227
|
+
id: DefaultNetworkConfigurations;
|
|
228
|
+
chain: {
|
|
229
|
+
bitcoin: BitcoinChainConfig;
|
|
230
|
+
stacks: StacksChainConfig;
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
declare const defaultCurrentNetwork: NetworkConfiguration;
|
|
234
|
+
declare const defaultNetworksKeyedById: Record<WalletDefaultNetworkConfigurationIds, NetworkConfiguration>;
|
|
235
|
+
|
|
236
|
+
interface BitcoinTransactionIssuance {
|
|
237
|
+
asset_id: string;
|
|
238
|
+
is_reissuance: boolean;
|
|
239
|
+
asset_blinding_nonce: number;
|
|
240
|
+
asset_entropy: number;
|
|
241
|
+
contract_hash: string;
|
|
242
|
+
assetamount?: number;
|
|
243
|
+
assetamountcommitment?: number;
|
|
244
|
+
tokenamount?: number;
|
|
245
|
+
tokenamountcommitment?: number;
|
|
246
|
+
}
|
|
247
|
+
interface BitcoinTransactionPegOut {
|
|
248
|
+
genesis_hash: string;
|
|
249
|
+
scriptpubkey: string;
|
|
250
|
+
scriptpubkey_asm: string;
|
|
251
|
+
scriptpubkey_address: string;
|
|
252
|
+
}
|
|
253
|
+
interface BitcoinTransactionStatus {
|
|
254
|
+
confirmed: boolean;
|
|
255
|
+
block_height?: number | null;
|
|
256
|
+
block_hash?: string | null;
|
|
257
|
+
block_time?: number | null;
|
|
258
|
+
}
|
|
259
|
+
interface BitcoinTransactionVectorOutput {
|
|
260
|
+
scriptpubkey: string;
|
|
261
|
+
scriptpubkey_asm: string;
|
|
262
|
+
scriptpubkey_type: string;
|
|
263
|
+
scriptpubkey_address: string;
|
|
264
|
+
value: number;
|
|
265
|
+
valuecommitment?: number;
|
|
266
|
+
asset?: string;
|
|
267
|
+
assetcommitment?: number;
|
|
268
|
+
pegout?: BitcoinTransactionPegOut | null;
|
|
269
|
+
}
|
|
270
|
+
interface BitcoinTransactionVectorInput {
|
|
271
|
+
inner_redeemscript_asm?: string;
|
|
272
|
+
inner_witnessscript_asm?: string;
|
|
273
|
+
is_coinbase: boolean;
|
|
274
|
+
is_pegin?: boolean;
|
|
275
|
+
issuance?: BitcoinTransactionIssuance | null;
|
|
276
|
+
prevout: BitcoinTransactionVectorOutput;
|
|
277
|
+
scriptsig: string;
|
|
278
|
+
scriptsig_asm: string;
|
|
279
|
+
sequence: number;
|
|
280
|
+
txid: string;
|
|
281
|
+
vout: number;
|
|
282
|
+
witness: string[];
|
|
283
|
+
}
|
|
284
|
+
interface BitcoinTx {
|
|
285
|
+
fee: number;
|
|
286
|
+
locktime: number;
|
|
287
|
+
size: number;
|
|
288
|
+
status: BitcoinTransactionStatus;
|
|
289
|
+
tx_type?: string;
|
|
290
|
+
txid: string;
|
|
291
|
+
version: number;
|
|
292
|
+
vin: BitcoinTransactionVectorInput[];
|
|
293
|
+
vout: BitcoinTransactionVectorOutput[];
|
|
294
|
+
weight: number;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
type StacksTx = MempoolTransaction | Transaction;
|
|
298
|
+
type StacksTxStatus = 'failed' | 'pending' | 'success';
|
|
299
|
+
interface StxTransfer {
|
|
300
|
+
amount: string;
|
|
301
|
+
sender?: string;
|
|
302
|
+
recipient?: string;
|
|
303
|
+
}
|
|
304
|
+
interface FtTransfer {
|
|
305
|
+
asset_identifier: string;
|
|
306
|
+
amount: string;
|
|
307
|
+
sender?: string;
|
|
308
|
+
recipient?: string;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
interface UtxoItem {
|
|
312
|
+
txid: string;
|
|
313
|
+
vout: number;
|
|
314
|
+
status: {
|
|
315
|
+
confirmed: boolean;
|
|
316
|
+
block_height: number;
|
|
317
|
+
block_hash: string;
|
|
318
|
+
block_time: number;
|
|
319
|
+
};
|
|
320
|
+
value: number;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export { type AllowAdditionalProperties, type AverageBitcoinFeeRates, BESTINSLOT_API_BASE_URL_MAINNET, BESTINSLOT_API_BASE_URL_TESTNET, BITCOIN_API_BASE_URL_MAINNET, BITCOIN_API_BASE_URL_SIGNET, BITCOIN_API_BASE_URL_TESTNET, type BaseCryptoAssetBalance, type BaseCryptoAssetInfo, type BitcoinChainConfig, type BitcoinNetworkModes, type BitcoinTransactionVectorInput, type BitcoinTransactionVectorOutput, type BitcoinTx, type Blockchains, type Brc20CryptoAssetInfo, type BtcCryptoAssetBalance, type BtcCryptoAssetInfo, BtcFeeType, ChainID, type CryptoAssetBalance, type CryptoAssetType, type CryptoCurrencies, type Currencies, type DefaultNetworkConfigurations, type Entries, FeeCalculationTypes, FeeTypes, type Fees, type FiatCurrencies, type FtTransfer, HIRO_API_BASE_URL_MAINNET, HIRO_API_BASE_URL_NAKAMOTO_TESTNET, HIRO_API_BASE_URL_TESTNET, HIRO_INSCRIPTIONS_API_URL, type Inscription, type InscriptionCryptoAssetInfo, type InscriptionMimeType, type LiteralUnion, type MarketData, type Money, type NetworkConfiguration, type NetworkModes, type NumType, type RuneCryptoAssetInfo, STX20_API_BASE_URL_MAINNET, type Sip10CryptoAssetInfo, type Sip9CryptoAssetInfo, type Src20CryptoAssetInfo, type StacksChainConfig, type StacksFeeEstimate, type StacksTx, type StacksTxStatus, type StampCryptoAssetInfo, type Stx20CryptoAssetInfo, type StxCryptoAssetBalance, type StxCryptoAssetInfo, type StxTransfer, type SupportedBlockchains, type UtxoItem, type ValueOf, WalletDefaultNetworkConfigurationIds, btcTxTimeMap, createCryptoAssetBalance, createInscription, createMarketData, createMarketPair, defaultCurrentNetwork, defaultNetworksKeyedById, formatMarketPair, whenInscriptionMimeType };
|