@sundaeswap/wallet-lite 0.0.20 → 0.0.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sundaeswap/wallet-lite",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -138,50 +138,55 @@ export class WalletObserver<
138
138
  );
139
139
  }
140
140
 
141
- this._performingSync = true;
142
- this.dispatch(EWalletObserverEvents.SYNCING_WALLET_START);
143
-
144
- let newNetwork: number;
145
141
  try {
146
- newNetwork = await this.getNetwork();
147
- } catch (e) {
142
+ this._performingSync = true;
143
+ this.dispatch(EWalletObserverEvents.SYNCING_WALLET_START);
144
+
145
+ let newNetwork: number;
148
146
  try {
149
- await this.syncApi();
150
147
  newNetwork = await this.getNetwork();
151
148
  } catch (e) {
152
- this.dispatch(EWalletObserverEvents.SYNCING_WALLET_END);
153
- this._performingSync = false;
154
- throw e;
149
+ try {
150
+ await this.syncApi();
151
+ newNetwork = await this.getNetwork();
152
+ } catch (e) {
153
+ this.dispatch(EWalletObserverEvents.SYNCING_WALLET_END);
154
+ this._performingSync = false;
155
+ throw e;
156
+ }
155
157
  }
156
- }
157
158
 
158
- const [
159
- newBalanceMap,
160
- newUsedAddresses,
161
- newUnusedAddresses,
162
- newOutputs,
163
- newCollateral,
164
- ] = await Promise.all([
165
- this.getBalanceMap(),
166
- this.getUsedAddresses(),
167
- this.getUnusedAddresses(),
168
- this.getUtxos(),
169
- this.getCollateral(),
170
- ]);
171
-
172
- const result = {
173
- balanceMap: newBalanceMap,
174
- usedAddresses: newUsedAddresses,
175
- unusedAddresses: newUnusedAddresses,
176
- utxos: newOutputs,
177
- collateral: newCollateral,
178
- network: newNetwork,
179
- };
159
+ const [
160
+ newBalanceMap,
161
+ newUsedAddresses,
162
+ newUnusedAddresses,
163
+ newOutputs,
164
+ newCollateral,
165
+ ] = await Promise.all([
166
+ this.getBalanceMap(),
167
+ this.getUsedAddresses(),
168
+ this.getUnusedAddresses(),
169
+ this.getUtxos(),
170
+ this.getCollateral(),
171
+ ]);
172
+
173
+ const result = {
174
+ balanceMap: newBalanceMap,
175
+ usedAddresses: newUsedAddresses,
176
+ unusedAddresses: newUnusedAddresses,
177
+ utxos: newOutputs,
178
+ collateral: newCollateral,
179
+ network: newNetwork,
180
+ };
180
181
 
181
- this.dispatch(EWalletObserverEvents.SYNCING_WALLET_END, result);
182
- this._performingSync = false;
182
+ this.dispatch(EWalletObserverEvents.SYNCING_WALLET_END, result);
183
+ this._performingSync = false;
183
184
 
184
- return result;
185
+ return result;
186
+ } catch (e) {
187
+ this._performingSync = false;
188
+ throw e;
189
+ }
185
190
  };
186
191
 
187
192
  /**