@cityofzion/bs-neo-legacy 0.9.0 → 0.9.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/.eslintignore +13 -0
- package/.eslintrc.cjs +22 -0
- package/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/package-deps_build.json +12 -10
- package/.rush/temp/shrinkwrap-deps.json +126 -43
- package/CHANGELOG.json +30 -0
- package/CHANGELOG.md +15 -1
- package/dist/BSNeoLegacy.js +3 -3
- package/dist/DoraBDSNeoLegacy.js +7 -4
- package/dist/assets/tokens/common.json +2 -6
- package/dist/assets/tokens/mainnet.json +77 -231
- package/dist/constants.d.ts +0 -2
- package/package.json +12 -7
- package/src/BSNeoLegacy.ts +4 -4
- package/src/DoraBDSNeoLegacy.ts +8 -5
- package/src/__tests__/BDSNeoLegacy.spec.ts +5 -2
- package/src/__tests__/BSNeoLegacy.spec.ts +0 -1
- package/src/assets/tokens/common.json +3 -7
- package/src/assets/tokens/mainnet.json +78 -232
package/dist/DoraBDSNeoLegacy.js
CHANGED
|
@@ -115,7 +115,7 @@ class DoraBDSNeoLegacy {
|
|
|
115
115
|
if (!data || 'error' in data)
|
|
116
116
|
throw new Error(`Token ${tokenHash} not found`);
|
|
117
117
|
const token = {
|
|
118
|
-
decimals: data.decimals,
|
|
118
|
+
decimals: Number(data.decimals),
|
|
119
119
|
symbol: data.symbol,
|
|
120
120
|
hash: data.scripthash,
|
|
121
121
|
name: data.name,
|
|
@@ -128,16 +128,19 @@ class DoraBDSNeoLegacy {
|
|
|
128
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
129
129
|
const data = yield dora_ts_1.api.NeoLegacyREST.balance(address, this.network.type);
|
|
130
130
|
const promises = data.map((balance) => __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
const hash = balance.asset.replace('0x', '');
|
|
131
132
|
let token = {
|
|
132
|
-
hash
|
|
133
|
+
hash,
|
|
133
134
|
name: balance.asset_name,
|
|
134
135
|
symbol: balance.symbol,
|
|
135
136
|
decimals: 8,
|
|
136
137
|
};
|
|
137
138
|
try {
|
|
138
|
-
token = yield this.getTokenInfo(
|
|
139
|
+
token = yield this.getTokenInfo(hash);
|
|
140
|
+
}
|
|
141
|
+
catch (_a) {
|
|
142
|
+
// Empty block
|
|
139
143
|
}
|
|
140
|
-
catch (_a) { }
|
|
141
144
|
return {
|
|
142
145
|
amount: Number(balance.balance).toFixed(token.decimals),
|
|
143
146
|
token,
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"symbol": "GAS",
|
|
4
|
-
"type": "UtilityToken",
|
|
5
4
|
"name": "GAS",
|
|
6
5
|
"hash": "602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7",
|
|
7
|
-
"decimals": 8
|
|
8
|
-
"blockchain": "neoLegacy"
|
|
6
|
+
"decimals": 8
|
|
9
7
|
},
|
|
10
8
|
{
|
|
11
9
|
"symbol": "NEO",
|
|
12
|
-
"type": "GoverningToken",
|
|
13
10
|
"name": "NEO",
|
|
14
11
|
"hash": "c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",
|
|
15
|
-
"decimals": 0
|
|
16
|
-
"blockchain": "neoLegacy"
|
|
12
|
+
"decimals": 0
|
|
17
13
|
}
|
|
18
14
|
]
|