@chain-registry/utils 1.19.0 → 1.19.2
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/CHANGELOG.md +265 -0
- package/main/assets.js +16 -31
- package/main/calc.js +7 -13
- package/main/chains.js +9 -17
- package/main/ibc.js +13 -24
- package/package.json +3 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [1.19.2](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.19.1...@chain-registry/utils@1.19.2) (2024-03-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.19.1 (2024-03-20)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [1.19.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.18.2...@chain-registry/utils@1.19.0) (2024-03-19)
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
- add explicit return types ([095175a](https://github.com/cosmology-tech/chain-registry/commit/095175aaa08cbde99052b0bd87e2173c871632f0))
|
|
27
|
+
- rename files ([62aa8d0](https://github.com/cosmology-tech/chain-registry/commit/62aa8d06a99425ba059e3a2b6e1d96ea7a9a2e23))
|
|
28
|
+
- update types ([0537055](https://github.com/cosmology-tech/chain-registry/commit/05370552b73b1e84da952544a34239c7bdefc766))
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
- add new utils ([b922c9d](https://github.com/cosmology-tech/chain-registry/commit/b922c9d5141655b92bdae8d22e1eabb92edfd8ec))
|
|
33
|
+
- add tests for new utils ([c4895a4](https://github.com/cosmology-tech/chain-registry/commit/c4895a469bed3cbe12305de2a99a1004f66efc25))
|
|
34
|
+
|
|
35
|
+
## [1.18.2](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.18.1...@chain-registry/utils@1.18.2) (2024-02-27)
|
|
36
|
+
|
|
37
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
38
|
+
|
|
39
|
+
## [1.18.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.18.0...@chain-registry/utils@1.18.1) (2024-02-26)
|
|
40
|
+
|
|
41
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
42
|
+
|
|
43
|
+
# [1.18.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.17.3...@chain-registry/utils@1.18.0) (2024-01-25)
|
|
44
|
+
|
|
45
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
46
|
+
|
|
47
|
+
## [1.17.3](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.17.2...@chain-registry/utils@1.17.3) (2024-01-19)
|
|
48
|
+
|
|
49
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
50
|
+
|
|
51
|
+
## [1.17.2](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.17.1...@chain-registry/utils@1.17.2) (2024-01-19)
|
|
52
|
+
|
|
53
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
54
|
+
|
|
55
|
+
## [1.17.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.17.0...@chain-registry/utils@1.17.1) (2024-01-19)
|
|
56
|
+
|
|
57
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
58
|
+
|
|
59
|
+
# [1.17.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.16.1...@chain-registry/utils@1.17.0) (2023-12-20)
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
- add chainName as optional param ([d415f33](https://github.com/cosmology-tech/chain-registry/commit/d415f33dc96651e5bb4ede689220d89ad11fe9d9))
|
|
64
|
+
|
|
65
|
+
## [1.16.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.16.0...@chain-registry/utils@1.16.1) (2023-12-15)
|
|
66
|
+
|
|
67
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
68
|
+
|
|
69
|
+
# [1.16.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.15.0...@chain-registry/utils@1.16.0) (2023-12-15)
|
|
70
|
+
|
|
71
|
+
### Features
|
|
72
|
+
|
|
73
|
+
- add getCoinGeckoIdByDenom method ([b05e67b](https://github.com/cosmology-tech/chain-registry/commit/b05e67b4b54258412d359745b1cd095987c67eb6))
|
|
74
|
+
|
|
75
|
+
# [1.15.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.14.0...@chain-registry/utils@1.15.0) (2023-12-15)
|
|
76
|
+
|
|
77
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
78
|
+
|
|
79
|
+
# [1.14.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.13.2...@chain-registry/utils@1.14.0) (2023-09-15)
|
|
80
|
+
|
|
81
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
82
|
+
|
|
83
|
+
## [1.13.2](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.13.1...@chain-registry/utils@1.13.2) (2023-07-30)
|
|
84
|
+
|
|
85
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
86
|
+
|
|
87
|
+
## [1.13.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.13.0...@chain-registry/utils@1.13.1) (2023-07-12)
|
|
88
|
+
|
|
89
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
90
|
+
|
|
91
|
+
# [1.13.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.12.0...@chain-registry/utils@1.13.0) (2023-07-11)
|
|
92
|
+
|
|
93
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
94
|
+
|
|
95
|
+
# [1.12.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.11.0...@chain-registry/utils@1.12.0) (2023-07-08)
|
|
96
|
+
|
|
97
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
98
|
+
|
|
99
|
+
# [1.11.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.10.0...@chain-registry/utils@1.11.0) (2023-06-27)
|
|
100
|
+
|
|
101
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
102
|
+
|
|
103
|
+
# [1.10.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.9.1...@chain-registry/utils@1.10.0) (2023-04-20)
|
|
104
|
+
|
|
105
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
106
|
+
|
|
107
|
+
## [1.9.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.9.0...@chain-registry/utils@1.9.1) (2023-04-18)
|
|
108
|
+
|
|
109
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
110
|
+
|
|
111
|
+
# [1.9.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.8.0...@chain-registry/utils@1.9.0) (2023-04-18)
|
|
112
|
+
|
|
113
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
114
|
+
|
|
115
|
+
# [1.8.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.7.0...@chain-registry/utils@1.8.0) (2023-03-29)
|
|
116
|
+
|
|
117
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
118
|
+
|
|
119
|
+
# [1.7.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.6.0...@chain-registry/utils@1.7.0) (2023-03-02)
|
|
120
|
+
|
|
121
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
122
|
+
|
|
123
|
+
# [1.6.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.5.0...@chain-registry/utils@1.6.0) (2023-02-23)
|
|
124
|
+
|
|
125
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
126
|
+
|
|
127
|
+
# [1.5.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.4.0...@chain-registry/utils@1.5.0) (2023-02-08)
|
|
128
|
+
|
|
129
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
130
|
+
|
|
131
|
+
# [1.4.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.3.0...@chain-registry/utils@1.4.0) (2022-12-08)
|
|
132
|
+
|
|
133
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
134
|
+
|
|
135
|
+
# [1.3.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.2.1...@chain-registry/utils@1.3.0) (2022-11-10)
|
|
136
|
+
|
|
137
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
138
|
+
|
|
139
|
+
## [1.2.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.2.0...@chain-registry/utils@1.2.1) (2022-10-27)
|
|
140
|
+
|
|
141
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
142
|
+
|
|
143
|
+
# [1.2.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.1.0...@chain-registry/utils@1.2.0) (2022-10-20)
|
|
144
|
+
|
|
145
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
146
|
+
|
|
147
|
+
# [1.1.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.0.1...@chain-registry/utils@1.1.0) (2022-10-20)
|
|
148
|
+
|
|
149
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
150
|
+
|
|
151
|
+
## [1.0.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.0.0...@chain-registry/utils@1.0.1) (2022-10-20)
|
|
152
|
+
|
|
153
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
154
|
+
|
|
155
|
+
# [1.0.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.11.0...@chain-registry/utils@1.0.0) (2022-09-29)
|
|
156
|
+
|
|
157
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
158
|
+
|
|
159
|
+
# [0.11.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.10.2...@chain-registry/utils@0.11.0) (2022-09-20)
|
|
160
|
+
|
|
161
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
162
|
+
|
|
163
|
+
## [0.10.2](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.10.1...@chain-registry/utils@0.10.2) (2022-09-19)
|
|
164
|
+
|
|
165
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
166
|
+
|
|
167
|
+
## [0.10.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.10.0...@chain-registry/utils@0.10.1) (2022-09-19)
|
|
168
|
+
|
|
169
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
170
|
+
|
|
171
|
+
# [0.10.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.9.0...@chain-registry/utils@0.10.0) (2022-09-19)
|
|
172
|
+
|
|
173
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
174
|
+
|
|
175
|
+
# [0.9.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.8.0...@chain-registry/utils@0.9.0) (2022-09-16)
|
|
176
|
+
|
|
177
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
178
|
+
|
|
179
|
+
# [0.8.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.7.3...@chain-registry/utils@0.8.0) (2022-09-14)
|
|
180
|
+
|
|
181
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
182
|
+
|
|
183
|
+
## [0.7.3](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.7.2...@chain-registry/utils@0.7.3) (2022-09-08)
|
|
184
|
+
|
|
185
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
186
|
+
|
|
187
|
+
## [0.7.2](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.7.1...@chain-registry/utils@0.7.2) (2022-09-08)
|
|
188
|
+
|
|
189
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
190
|
+
|
|
191
|
+
## [0.7.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.7.0...@chain-registry/utils@0.7.1) (2022-09-07)
|
|
192
|
+
|
|
193
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
194
|
+
|
|
195
|
+
# [0.7.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.6.3...@chain-registry/utils@0.7.0) (2022-09-06)
|
|
196
|
+
|
|
197
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
198
|
+
|
|
199
|
+
## [0.6.3](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.6.2...@chain-registry/utils@0.6.3) (2022-08-31)
|
|
200
|
+
|
|
201
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
202
|
+
|
|
203
|
+
## [0.6.2](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.6.1...@chain-registry/utils@0.6.2) (2022-08-31)
|
|
204
|
+
|
|
205
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
206
|
+
|
|
207
|
+
## [0.6.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.6.0...@chain-registry/utils@0.6.1) (2022-08-31)
|
|
208
|
+
|
|
209
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
210
|
+
|
|
211
|
+
# [0.6.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.5.1...@chain-registry/utils@0.6.0) (2022-08-31)
|
|
212
|
+
|
|
213
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
214
|
+
|
|
215
|
+
## [0.5.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.5.0...@chain-registry/utils@0.5.1) (2022-08-23)
|
|
216
|
+
|
|
217
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
218
|
+
|
|
219
|
+
# [0.5.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.4.0...@chain-registry/utils@0.5.0) (2022-08-23)
|
|
220
|
+
|
|
221
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
222
|
+
|
|
223
|
+
# [0.4.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.3.1...@chain-registry/utils@0.4.0) (2022-08-20)
|
|
224
|
+
|
|
225
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
226
|
+
|
|
227
|
+
## [0.3.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.3.0...@chain-registry/utils@0.3.1) (2022-08-13)
|
|
228
|
+
|
|
229
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
230
|
+
|
|
231
|
+
# [0.3.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.2.1...@chain-registry/utils@0.3.0) (2022-08-13)
|
|
232
|
+
|
|
233
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
234
|
+
|
|
235
|
+
## [0.2.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@0.2.0...@chain-registry/utils@0.2.1) (2022-08-13)
|
|
236
|
+
|
|
237
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
238
|
+
|
|
239
|
+
# 0.2.0 (2022-08-13)
|
|
240
|
+
|
|
241
|
+
**Note:** Version bump only for package @chain-registry/utils
|
|
242
|
+
|
|
243
|
+
# [0.1.0](https://github.com/cosmology-tech/chain-registry/compare/chain-registry-utils@0.0.6...chain-registry-utils@0.1.0) (2022-08-12)
|
|
244
|
+
|
|
245
|
+
**Note:** Version bump only for package chain-registry-utils
|
|
246
|
+
|
|
247
|
+
## 0.0.6 (2022-07-25)
|
|
248
|
+
|
|
249
|
+
**Note:** Version bump only for package chain-registry-utils
|
|
250
|
+
|
|
251
|
+
## [0.0.5](https://github.com/cosmology-tech/chain-registry/compare/chain-registry-utils@0.0.4...chain-registry-utils@0.0.5) (2022-07-14)
|
|
252
|
+
|
|
253
|
+
**Note:** Version bump only for package chain-registry-utils
|
|
254
|
+
|
|
255
|
+
## [0.0.4](https://github.com/cosmology-tech/chain-registry/compare/chain-registry-utils@0.0.3...chain-registry-utils@0.0.4) (2022-07-14)
|
|
256
|
+
|
|
257
|
+
**Note:** Version bump only for package chain-registry-utils
|
|
258
|
+
|
|
259
|
+
## 0.0.3 (2022-07-12)
|
|
260
|
+
|
|
261
|
+
**Note:** Version bump only for package chain-registry-utils
|
|
262
|
+
|
|
263
|
+
## 0.0.2 (2022-07-12)
|
|
264
|
+
|
|
265
|
+
**Note:** Version bump only for package chain-registry-utils
|
package/main/assets.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getTokenNameByDenom = exports.getTokenLogoByDenom = exports.getSymbolByDenom = exports.getNativeTokenByChainName = exports.getExponentFromAsset = exports.getExponentBySymbol = exports.getExponentByDenom = exports.getDenomBySymbol = exports.getDenomByCoinGeckoId = exports.getCoinGeckoIdByDenom = exports.getChainNameByDenom = exports.getChainLogo = exports.getAssetBySymbol = exports.getAssetByDenom = exports.customFind = void 0;
|
|
7
|
-
var customFind = function customFind(array, filterFn) {
|
|
7
|
+
var customFind = exports.customFind = function customFind(array, filterFn) {
|
|
8
8
|
var filteredItems = array.filter(filterFn);
|
|
9
9
|
var filterCount = filteredItems.length;
|
|
10
10
|
if (filterCount > 1) {
|
|
@@ -12,7 +12,6 @@ var customFind = function customFind(array, filterFn) {
|
|
|
12
12
|
}
|
|
13
13
|
return filteredItems[0];
|
|
14
14
|
};
|
|
15
|
-
exports.customFind = customFind;
|
|
16
15
|
var getAssetByKeyValue = function getAssetByKeyValue(assets, key, value, chainName) {
|
|
17
16
|
var filteredAssets = assets.filter(function (_ref) {
|
|
18
17
|
var chain_name = _ref.chain_name;
|
|
@@ -25,20 +24,17 @@ var getAssetByKeyValue = function getAssetByKeyValue(assets, key, value, chainNa
|
|
|
25
24
|
return asset[key] === value;
|
|
26
25
|
});
|
|
27
26
|
};
|
|
28
|
-
var getAssetByDenom = function getAssetByDenom(assets, denom, chainName) {
|
|
27
|
+
var getAssetByDenom = exports.getAssetByDenom = function getAssetByDenom(assets, denom, chainName) {
|
|
29
28
|
return getAssetByKeyValue(assets, 'base', denom, chainName);
|
|
30
29
|
};
|
|
31
|
-
exports.
|
|
32
|
-
var getAssetBySymbol = function getAssetBySymbol(assets, symbol, chainName) {
|
|
30
|
+
var getAssetBySymbol = exports.getAssetBySymbol = function getAssetBySymbol(assets, symbol, chainName) {
|
|
33
31
|
return getAssetByKeyValue(assets, 'symbol', symbol, chainName);
|
|
34
32
|
};
|
|
35
|
-
exports.
|
|
36
|
-
var getDenomByCoinGeckoId = function getDenomByCoinGeckoId(assets, coinGeckoId, chainName) {
|
|
33
|
+
var getDenomByCoinGeckoId = exports.getDenomByCoinGeckoId = function getDenomByCoinGeckoId(assets, coinGeckoId, chainName) {
|
|
37
34
|
var _getAssetByKeyValue;
|
|
38
35
|
return (_getAssetByKeyValue = getAssetByKeyValue(assets, 'coingecko_id', coinGeckoId, chainName)) === null || _getAssetByKeyValue === void 0 ? void 0 : _getAssetByKeyValue.base;
|
|
39
36
|
};
|
|
40
|
-
exports.
|
|
41
|
-
var getCoinGeckoIdByDenom = function getCoinGeckoIdByDenom(assets, denom) {
|
|
37
|
+
var getCoinGeckoIdByDenom = exports.getCoinGeckoIdByDenom = function getCoinGeckoIdByDenom(assets, denom) {
|
|
42
38
|
var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
43
39
|
chainName = _ref3.chainName,
|
|
44
40
|
_ref3$allowTestnet = _ref3.allowTestnet,
|
|
@@ -66,58 +62,48 @@ var getCoinGeckoIdByDenom = function getCoinGeckoIdByDenom(assets, denom) {
|
|
|
66
62
|
});
|
|
67
63
|
return asset === null || asset === void 0 ? void 0 : asset.coingecko_id;
|
|
68
64
|
};
|
|
69
|
-
exports.
|
|
70
|
-
var getSymbolByDenom = function getSymbolByDenom(assets, denom, chainName) {
|
|
65
|
+
var getSymbolByDenom = exports.getSymbolByDenom = function getSymbolByDenom(assets, denom, chainName) {
|
|
71
66
|
var _getAssetByDenom;
|
|
72
67
|
return (_getAssetByDenom = getAssetByDenom(assets, denom, chainName)) === null || _getAssetByDenom === void 0 ? void 0 : _getAssetByDenom.symbol;
|
|
73
68
|
};
|
|
74
|
-
exports.
|
|
75
|
-
var getDenomBySymbol = function getDenomBySymbol(assets, symbol, chainName) {
|
|
69
|
+
var getDenomBySymbol = exports.getDenomBySymbol = function getDenomBySymbol(assets, symbol, chainName) {
|
|
76
70
|
var _getAssetByKeyValue2;
|
|
77
71
|
return (_getAssetByKeyValue2 = getAssetByKeyValue(assets, 'symbol', symbol, chainName)) === null || _getAssetByKeyValue2 === void 0 ? void 0 : _getAssetByKeyValue2.base;
|
|
78
72
|
};
|
|
79
|
-
exports.
|
|
80
|
-
var getExponentFromAsset = function getExponentFromAsset(asset) {
|
|
73
|
+
var getExponentFromAsset = exports.getExponentFromAsset = function getExponentFromAsset(asset) {
|
|
81
74
|
var _asset$denom_units$fi;
|
|
82
75
|
return (_asset$denom_units$fi = asset.denom_units.find(function (_ref8) {
|
|
83
76
|
var denom = _ref8.denom;
|
|
84
77
|
return denom === asset.display;
|
|
85
78
|
})) === null || _asset$denom_units$fi === void 0 ? void 0 : _asset$denom_units$fi.exponent;
|
|
86
79
|
};
|
|
87
|
-
exports.
|
|
88
|
-
var getExponentByDenom = function getExponentByDenom(assets, denom, chainName) {
|
|
80
|
+
var getExponentByDenom = exports.getExponentByDenom = function getExponentByDenom(assets, denom, chainName) {
|
|
89
81
|
var asset = getAssetByDenom(assets, denom, chainName);
|
|
90
82
|
return asset ? getExponentFromAsset(asset) : undefined;
|
|
91
83
|
};
|
|
92
|
-
exports.
|
|
93
|
-
var getExponentBySymbol = function getExponentBySymbol(assets, symbol, chainName) {
|
|
84
|
+
var getExponentBySymbol = exports.getExponentBySymbol = function getExponentBySymbol(assets, symbol, chainName) {
|
|
94
85
|
var asset = getAssetBySymbol(assets, symbol, chainName);
|
|
95
86
|
return asset ? getExponentFromAsset(asset) : undefined;
|
|
96
87
|
};
|
|
97
|
-
exports.
|
|
98
|
-
var getNativeTokenByChainName = function getNativeTokenByChainName(assets, chainName) {
|
|
88
|
+
var getNativeTokenByChainName = exports.getNativeTokenByChainName = function getNativeTokenByChainName(assets, chainName) {
|
|
99
89
|
var assetList = customFind(assets, function (assetList) {
|
|
100
90
|
return assetList.chain_name === chainName && !assetList.assets[0].base.startsWith('ibc/');
|
|
101
91
|
});
|
|
102
92
|
return assetList === null || assetList === void 0 ? void 0 : assetList.assets[0];
|
|
103
93
|
};
|
|
104
|
-
exports.
|
|
105
|
-
var getTokenLogoByDenom = function getTokenLogoByDenom(assets, denom, chainName) {
|
|
94
|
+
var getTokenLogoByDenom = exports.getTokenLogoByDenom = function getTokenLogoByDenom(assets, denom, chainName) {
|
|
106
95
|
var asset = getAssetByDenom(assets, denom, chainName);
|
|
107
96
|
return Object.values((asset === null || asset === void 0 ? void 0 : asset.logo_URIs) || {})[0];
|
|
108
97
|
};
|
|
109
|
-
exports.
|
|
110
|
-
var getChainLogo = function getChainLogo(assets, chainName) {
|
|
98
|
+
var getChainLogo = exports.getChainLogo = function getChainLogo(assets, chainName) {
|
|
111
99
|
var nativeToken = getNativeTokenByChainName(assets, chainName);
|
|
112
100
|
return Object.values((nativeToken === null || nativeToken === void 0 ? void 0 : nativeToken.logo_URIs) || {})[0];
|
|
113
101
|
};
|
|
114
|
-
exports.
|
|
115
|
-
var getTokenNameByDenom = function getTokenNameByDenom(assets, denom, chainName) {
|
|
102
|
+
var getTokenNameByDenom = exports.getTokenNameByDenom = function getTokenNameByDenom(assets, denom, chainName) {
|
|
116
103
|
var asset = getAssetByDenom(assets, denom, chainName);
|
|
117
104
|
return asset === null || asset === void 0 ? void 0 : asset.name;
|
|
118
105
|
};
|
|
119
|
-
exports.
|
|
120
|
-
var getChainNameByDenom = function getChainNameByDenom(assets, denom) {
|
|
106
|
+
var getChainNameByDenom = exports.getChainNameByDenom = function getChainNameByDenom(assets, denom) {
|
|
121
107
|
var _customFind;
|
|
122
108
|
var isIbcDenom = denom.startsWith('ibc/');
|
|
123
109
|
if (isIbcDenom) {
|
|
@@ -132,5 +118,4 @@ var getChainNameByDenom = function getChainNameByDenom(assets, denom) {
|
|
|
132
118
|
return asset.base === denom;
|
|
133
119
|
});
|
|
134
120
|
})) === null || _customFind === void 0 ? void 0 : _customFind.chain_name;
|
|
135
|
-
};
|
|
136
|
-
exports.getChainNameByDenom = getChainNameByDenom;
|
|
121
|
+
};
|
package/main/calc.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.roundDown = exports.mapCoinGeckoPricesToDenoms = exports.convertDollarValueToBaseUnit = exports.convertDisplayUnitToBaseUnit = exports.convertBaseUnitToDollarValue = exports.convertBaseUnitToDisplayUnit = void 0;
|
|
8
8
|
var _bignumber = _interopRequireDefault(require("bignumber.js"));
|
|
9
9
|
var _assets = require("./assets");
|
|
10
|
-
var mapCoinGeckoPricesToDenoms = function mapCoinGeckoPricesToDenoms(assets, prices) {
|
|
10
|
+
var mapCoinGeckoPricesToDenoms = exports.mapCoinGeckoPricesToDenoms = function mapCoinGeckoPricesToDenoms(assets, prices) {
|
|
11
11
|
return Object.keys(prices).reduce(function (res, geckoId) {
|
|
12
12
|
var denom = (0, _assets.getDenomByCoinGeckoId)(assets, geckoId);
|
|
13
13
|
if (!denom) {
|
|
@@ -17,11 +17,9 @@ var mapCoinGeckoPricesToDenoms = function mapCoinGeckoPricesToDenoms(assets, pri
|
|
|
17
17
|
return res;
|
|
18
18
|
}, {});
|
|
19
19
|
};
|
|
20
|
-
exports.
|
|
21
|
-
var roundDown = function roundDown(value) {
|
|
20
|
+
var roundDown = exports.roundDown = function roundDown(value) {
|
|
22
21
|
return new _bignumber["default"](value).decimalPlaces(0, _bignumber["default"].ROUND_DOWN).toString();
|
|
23
22
|
};
|
|
24
|
-
exports.roundDown = roundDown;
|
|
25
23
|
var getAssetInfo = function getAssetInfo(assets, symbol, chainName) {
|
|
26
24
|
var asset = (0, _assets.getAssetBySymbol)(assets, symbol, chainName);
|
|
27
25
|
var denom = asset === null || asset === void 0 ? void 0 : asset.base;
|
|
@@ -38,31 +36,27 @@ var shiftDecimalPlaces = function shiftDecimalPlaces(amount, exponent) {
|
|
|
38
36
|
var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
39
37
|
return new _bignumber["default"](amount).shiftedBy(exponent * direction).toString();
|
|
40
38
|
};
|
|
41
|
-
var convertBaseUnitToDollarValue = function convertBaseUnitToDollarValue(assets, prices, symbol, amount, chainName) {
|
|
39
|
+
var convertBaseUnitToDollarValue = exports.convertBaseUnitToDollarValue = function convertBaseUnitToDollarValue(assets, prices, symbol, amount, chainName) {
|
|
42
40
|
var _getAssetInfo = getAssetInfo(assets, symbol, chainName),
|
|
43
41
|
denom = _getAssetInfo.denom,
|
|
44
42
|
exponent = _getAssetInfo.exponent;
|
|
45
43
|
var baseAmount = shiftDecimalPlaces(amount, exponent, -1);
|
|
46
44
|
return new _bignumber["default"](baseAmount).multipliedBy(prices[denom]).toString();
|
|
47
45
|
};
|
|
48
|
-
exports.
|
|
49
|
-
var convertDollarValueToBaseUnit = function convertDollarValueToBaseUnit(assets, prices, symbol, value, chainName) {
|
|
46
|
+
var convertDollarValueToBaseUnit = exports.convertDollarValueToBaseUnit = function convertDollarValueToBaseUnit(assets, prices, symbol, value, chainName) {
|
|
50
47
|
var _getAssetInfo2 = getAssetInfo(assets, symbol, chainName),
|
|
51
48
|
denom = _getAssetInfo2.denom,
|
|
52
49
|
exponent = _getAssetInfo2.exponent;
|
|
53
50
|
var baseAmount = new _bignumber["default"](value).dividedBy(prices[denom]).toString();
|
|
54
51
|
return roundDown(shiftDecimalPlaces(baseAmount, exponent));
|
|
55
52
|
};
|
|
56
|
-
exports.
|
|
57
|
-
var convertBaseUnitToDisplayUnit = function convertBaseUnitToDisplayUnit(assets, symbol, amount, chainName) {
|
|
53
|
+
var convertBaseUnitToDisplayUnit = exports.convertBaseUnitToDisplayUnit = function convertBaseUnitToDisplayUnit(assets, symbol, amount, chainName) {
|
|
58
54
|
var _getAssetInfo3 = getAssetInfo(assets, symbol, chainName),
|
|
59
55
|
exponent = _getAssetInfo3.exponent;
|
|
60
56
|
return shiftDecimalPlaces(amount, exponent, -1);
|
|
61
57
|
};
|
|
62
|
-
exports.
|
|
63
|
-
var convertDisplayUnitToBaseUnit = function convertDisplayUnitToBaseUnit(assets, symbol, amount, chainName) {
|
|
58
|
+
var convertDisplayUnitToBaseUnit = exports.convertDisplayUnitToBaseUnit = function convertDisplayUnitToBaseUnit(assets, symbol, amount, chainName) {
|
|
64
59
|
var _getAssetInfo4 = getAssetInfo(assets, symbol, chainName),
|
|
65
60
|
exponent = _getAssetInfo4.exponent;
|
|
66
61
|
return roundDown(shiftDecimalPlaces(amount, exponent));
|
|
67
|
-
};
|
|
68
|
-
exports.convertDisplayUnitToBaseUnit = convertDisplayUnitToBaseUnit;
|
|
62
|
+
};
|
package/main/chains.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getGasPriceRangesFromChain = exports.getChainPrettyName = exports.getChainNameByChainId = exports.getChainIdByChainName = exports.getChainGasPriceRanges = exports.getChainByChainName = exports.getChainByChainId = exports.getChainBech32Prefix = void 0;
|
|
7
7
|
var _assets = require("./assets");
|
|
8
|
-
var getGasPriceRangesFromChain = function getGasPriceRangesFromChain(chain) {
|
|
8
|
+
var getGasPriceRangesFromChain = exports.getGasPriceRangesFromChain = function getGasPriceRangesFromChain(chain) {
|
|
9
9
|
var _chain$fees, _chain$fees$fee_token, _feeToken$low_gas_pri, _feeToken$average_gas, _feeToken$high_gas_pr;
|
|
10
10
|
var feeToken = (_chain$fees = chain.fees) === null || _chain$fees === void 0 ? void 0 : (_chain$fees$fee_token = _chain$fees.fee_tokens) === null || _chain$fees$fee_token === void 0 ? void 0 : _chain$fees$fee_token[0];
|
|
11
11
|
return {
|
|
@@ -14,41 +14,33 @@ var getGasPriceRangesFromChain = function getGasPriceRangesFromChain(chain) {
|
|
|
14
14
|
high: (_feeToken$high_gas_pr = feeToken === null || feeToken === void 0 ? void 0 : feeToken.high_gas_price) !== null && _feeToken$high_gas_pr !== void 0 ? _feeToken$high_gas_pr : 0.04
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
exports.
|
|
18
|
-
var getChainByChainName = function getChainByChainName(chains, chainName) {
|
|
17
|
+
var getChainByChainName = exports.getChainByChainName = function getChainByChainName(chains, chainName) {
|
|
19
18
|
return (0, _assets.customFind)(chains, function (chain) {
|
|
20
19
|
return chain.chain_name === chainName;
|
|
21
20
|
});
|
|
22
21
|
};
|
|
23
|
-
exports.
|
|
24
|
-
var getChainByChainId = function getChainByChainId(chains, chainId) {
|
|
22
|
+
var getChainByChainId = exports.getChainByChainId = function getChainByChainId(chains, chainId) {
|
|
25
23
|
return (0, _assets.customFind)(chains, function (chain) {
|
|
26
24
|
return chain.chain_id === chainId;
|
|
27
25
|
});
|
|
28
26
|
};
|
|
29
|
-
exports.
|
|
30
|
-
var getChainNameByChainId = function getChainNameByChainId(chains, chainId) {
|
|
27
|
+
var getChainNameByChainId = exports.getChainNameByChainId = function getChainNameByChainId(chains, chainId) {
|
|
31
28
|
var _getChainByChainId;
|
|
32
29
|
return (_getChainByChainId = getChainByChainId(chains, chainId)) === null || _getChainByChainId === void 0 ? void 0 : _getChainByChainId.chain_name;
|
|
33
30
|
};
|
|
34
|
-
exports.
|
|
35
|
-
var getChainIdByChainName = function getChainIdByChainName(chains, chainName) {
|
|
31
|
+
var getChainIdByChainName = exports.getChainIdByChainName = function getChainIdByChainName(chains, chainName) {
|
|
36
32
|
var _getChainByChainName;
|
|
37
33
|
return (_getChainByChainName = getChainByChainName(chains, chainName)) === null || _getChainByChainName === void 0 ? void 0 : _getChainByChainName.chain_id;
|
|
38
34
|
};
|
|
39
|
-
exports.
|
|
40
|
-
var getChainGasPriceRanges = function getChainGasPriceRanges(chains, chainName) {
|
|
35
|
+
var getChainGasPriceRanges = exports.getChainGasPriceRanges = function getChainGasPriceRanges(chains, chainName) {
|
|
41
36
|
var chain = getChainByChainName(chains, chainName);
|
|
42
37
|
return chain ? getGasPriceRangesFromChain(chain) : undefined;
|
|
43
38
|
};
|
|
44
|
-
exports.
|
|
45
|
-
var getChainPrettyName = function getChainPrettyName(chains, chainName) {
|
|
39
|
+
var getChainPrettyName = exports.getChainPrettyName = function getChainPrettyName(chains, chainName) {
|
|
46
40
|
var _getChainByChainName2;
|
|
47
41
|
return (_getChainByChainName2 = getChainByChainName(chains, chainName)) === null || _getChainByChainName2 === void 0 ? void 0 : _getChainByChainName2.pretty_name;
|
|
48
42
|
};
|
|
49
|
-
exports.
|
|
50
|
-
var getChainBech32Prefix = function getChainBech32Prefix(chains, chainName) {
|
|
43
|
+
var getChainBech32Prefix = exports.getChainBech32Prefix = function getChainBech32Prefix(chains, chainName) {
|
|
51
44
|
var _getChainByChainName3;
|
|
52
45
|
return (_getChainByChainName3 = getChainByChainName(chains, chainName)) === null || _getChainByChainName3 === void 0 ? void 0 : _getChainByChainName3.bech32_prefix;
|
|
53
|
-
};
|
|
54
|
-
exports.getChainBech32Prefix = getChainBech32Prefix;
|
|
46
|
+
};
|
package/main/ibc.js
CHANGED
|
@@ -9,12 +9,12 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _sha = require("sha.js");
|
|
12
|
-
function ownKeys(
|
|
13
|
-
function _objectSpread(
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
15
15
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
16
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
|
-
var ibcDenom = function ibcDenom(paths, coinMinimalDenom) {
|
|
17
|
+
var ibcDenom = exports.ibcDenom = function ibcDenom(paths, coinMinimalDenom) {
|
|
18
18
|
var prefixes = [];
|
|
19
19
|
var _iterator = _createForOfIteratorHelper(paths),
|
|
20
20
|
_step;
|
|
@@ -32,35 +32,30 @@ var ibcDenom = function ibcDenom(paths, coinMinimalDenom) {
|
|
|
32
32
|
var denom = "".concat(prefix, "/").concat(coinMinimalDenom);
|
|
33
33
|
return 'ibc/' + Buffer.from(new Uint8Array(new _sha.sha256().update(Buffer.from(denom)).digest())).toString('hex').toUpperCase();
|
|
34
34
|
};
|
|
35
|
-
exports.ibcDenom = ibcDenom;
|
|
36
35
|
var findInfo = function findInfo(ibc, to, from) {
|
|
37
36
|
return ibc.find(function (i) {
|
|
38
37
|
return i.chain_1.chain_name === from && i.chain_2.chain_name === to;
|
|
39
38
|
});
|
|
40
39
|
};
|
|
41
|
-
var getIbcInfo = function getIbcInfo(ibc, chain, counterparty) {
|
|
40
|
+
var getIbcInfo = exports.getIbcInfo = function getIbcInfo(ibc, chain, counterparty) {
|
|
42
41
|
return findInfo(ibc, chain, counterparty) || findInfo(ibc, counterparty, chain);
|
|
43
42
|
};
|
|
44
|
-
exports.
|
|
45
|
-
var getTransferChannel = function getTransferChannel(info) {
|
|
43
|
+
var getTransferChannel = exports.getTransferChannel = function getTransferChannel(info) {
|
|
46
44
|
return info.channels.find(function (channel) {
|
|
47
45
|
return channel.chain_1.port_id === 'transfer' && channel.chain_2.port_id === 'transfer';
|
|
48
46
|
});
|
|
49
47
|
};
|
|
50
|
-
exports.
|
|
51
|
-
var getNonTransferChannel = function getNonTransferChannel(info) {
|
|
48
|
+
var getNonTransferChannel = exports.getNonTransferChannel = function getNonTransferChannel(info) {
|
|
52
49
|
return info.channels.find(function (channel) {
|
|
53
50
|
return channel.chain_1.port_id !== 'transfer' && channel.chain_2.port_id === 'transfer' || channel.chain_1.port_id === 'transfer' && channel.chain_2.port_id !== 'transfer';
|
|
54
51
|
});
|
|
55
52
|
};
|
|
56
|
-
exports.
|
|
57
|
-
var getWasmChannel = function getWasmChannel(info) {
|
|
53
|
+
var getWasmChannel = exports.getWasmChannel = function getWasmChannel(info) {
|
|
58
54
|
return info.channels.find(function (channel) {
|
|
59
55
|
return channel.chain_1.port_id.startsWith('wasm.') && channel.chain_2.port_id === 'transfer' || channel.chain_1.port_id === 'transfer' && channel.chain_2.port_id.startsWith('wasm');
|
|
60
56
|
});
|
|
61
57
|
};
|
|
62
|
-
exports.
|
|
63
|
-
var getIbcAssetPath = function getIbcAssetPath(ibc, chain, counterparty, assets, base) {
|
|
58
|
+
var getIbcAssetPath = exports.getIbcAssetPath = function getIbcAssetPath(ibc, chain, counterparty, assets, base) {
|
|
64
59
|
var _asset$traces$filter, _asset$traces, _asset$traces$filter2;
|
|
65
60
|
var ibcInfo = getIbcInfo(ibc, chain, counterparty);
|
|
66
61
|
if (!ibcInfo) {
|
|
@@ -107,8 +102,7 @@ var getIbcAssetPath = function getIbcAssetPath(ibc, chain, counterparty, assets,
|
|
|
107
102
|
// base
|
|
108
103
|
)));
|
|
109
104
|
};
|
|
110
|
-
exports.
|
|
111
|
-
var getIbcDenomByBase = function getIbcDenomByBase(ibc, chain, counterparty, assets, base) {
|
|
105
|
+
var getIbcDenomByBase = exports.getIbcDenomByBase = function getIbcDenomByBase(ibc, chain, counterparty, assets, base) {
|
|
112
106
|
var ibcInfo = getIbcInfo(ibc, chain, counterparty);
|
|
113
107
|
if (ibcInfo) {
|
|
114
108
|
var _asset$traces2, _asset$traces2$find, _ibcTrace$counterpart, _ibcTrace$counterpart2;
|
|
@@ -140,8 +134,7 @@ var getIbcDenomByBase = function getIbcDenomByBase(ibc, chain, counterparty, ass
|
|
|
140
134
|
return ibcDenom(ibcPath, baseDenom);
|
|
141
135
|
}
|
|
142
136
|
};
|
|
143
|
-
exports.
|
|
144
|
-
var getIbcAssets = function getIbcAssets(chainName, ibc, assets) {
|
|
137
|
+
var getIbcAssets = exports.getIbcAssets = function getIbcAssets(chainName, ibc, assets) {
|
|
145
138
|
var chainIbcInfo = ibc.filter(function (i) {
|
|
146
139
|
return i.chain_1.chain_name === chainName || i.chain_2.chain_name === chainName;
|
|
147
140
|
});
|
|
@@ -216,7 +209,6 @@ var getIbcAssets = function getIbcAssets(chainName, ibc, assets) {
|
|
|
216
209
|
chain_name: v.counterparty.chain_name
|
|
217
210
|
// port: v.counterparty.port_id
|
|
218
211
|
},
|
|
219
|
-
|
|
220
212
|
chain: {
|
|
221
213
|
// dst_denom
|
|
222
214
|
channel_id: v.chain.channel_id
|
|
@@ -245,8 +237,7 @@ var getIbcAssets = function getIbcAssets(chainName, ibc, assets) {
|
|
|
245
237
|
};
|
|
246
238
|
});
|
|
247
239
|
};
|
|
248
|
-
exports.
|
|
249
|
-
var getCw20Assets = function getCw20Assets(chainName, ibc, assets) {
|
|
240
|
+
var getCw20Assets = exports.getCw20Assets = function getCw20Assets(chainName, ibc, assets) {
|
|
250
241
|
var chainIbcInfo = ibc.filter(function (i) {
|
|
251
242
|
return i.chain_1.chain_name === chainName || i.chain_2.chain_name === chainName;
|
|
252
243
|
});
|
|
@@ -343,8 +334,7 @@ var getCw20Assets = function getCw20Assets(chainName, ibc, assets) {
|
|
|
343
334
|
};
|
|
344
335
|
});
|
|
345
336
|
};
|
|
346
|
-
exports.
|
|
347
|
-
var getAssetLists = function getAssetLists(chainName, ibc, assets) {
|
|
337
|
+
var getAssetLists = exports.getAssetLists = function getAssetLists(chainName, ibc, assets) {
|
|
348
338
|
var ibcAssetLists = getIbcAssets(chainName, ibc, assets);
|
|
349
339
|
var cw20Assets = getCw20Assets(chainName, ibc, assets);
|
|
350
340
|
return ibcAssetLists.reduce(function (m, v) {
|
|
@@ -361,5 +351,4 @@ var getAssetLists = function getAssetLists(chainName, ibc, assets) {
|
|
|
361
351
|
assets: assets
|
|
362
352
|
}].concat((0, _toConsumableArray2["default"])(m));
|
|
363
353
|
}, []);
|
|
364
|
-
};
|
|
365
|
-
exports.getAssetLists = getAssetLists;
|
|
354
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chain-registry/utils",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.2",
|
|
4
4
|
"description": "Chain Registry Utils",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/cosmology-tech/chain-registry",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@babel/runtime": "^7.21.0",
|
|
75
|
-
"@chain-registry/types": "^0.18.
|
|
75
|
+
"@chain-registry/types": "^0.18.3",
|
|
76
76
|
"bignumber.js": "9.1.1",
|
|
77
77
|
"sha.js": "^2.4.11"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "3da58f4178fd61379a8358fca13f9d53f85d25cc"
|
|
80
80
|
}
|