@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.
@@ -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: balance.asset,
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(balance.asset);
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
  ]