@xchainjs/xchain-utxo 2.0.8 → 2.0.9

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/lib/client.d.ts CHANGED
@@ -58,7 +58,7 @@ export declare abstract class Client extends BaseXChainClient {
58
58
  *
59
59
  * @returns {Balance[]} BTC balances
60
60
  */
61
- getBalance(address: Address, _assets?: Asset[], confirmedOnly?: boolean): Promise<Balance[]>;
61
+ getBalance(address: Address, _assets?: Asset[], _confirmedOnly?: boolean): Promise<Balance[]>;
62
62
  /**
63
63
  * Scan UTXOs for a given address.
64
64
  *
package/lib/index.esm.js CHANGED
@@ -89,7 +89,7 @@ class Client extends BaseXChainClient {
89
89
  return __awaiter(this, void 0, void 0, function* () {
90
90
  // Filter the parameters for transaction history
91
91
  const filteredParams = {
92
- address: (params === null || params === void 0 ? void 0 : params.address) || (yield this.getAddress()),
92
+ address: (params === null || params === void 0 ? void 0 : params.address) || (yield this.getAddressAsync()),
93
93
  offset: params === null || params === void 0 ? void 0 : params.offset,
94
94
  limit: params === null || params === void 0 ? void 0 : params.limit,
95
95
  startTime: params === null || params === void 0 ? void 0 : params.startTime,
@@ -120,8 +120,9 @@ class Client extends BaseXChainClient {
120
120
  */
121
121
  // TODO (@xchain-team|@veado) Change params to be an object to be extendable more easily
122
122
  // see changes for `xchain-bitcoin` https://github.com/xchainjs/xchainjs-lib/pull/490
123
- getBalance(address, _assets /* not used */, confirmedOnly) {
123
+ getBalance(address, _assets /* not used */, _confirmedOnly) {
124
124
  return __awaiter(this, void 0, void 0, function* () {
125
+ // The actual logic for getting balances
125
126
  return yield this.roundRobinGetBalance(address);
126
127
  });
127
128
  }
@@ -187,19 +188,28 @@ class Client extends BaseXChainClient {
187
188
  const feeRates = yield this.roundRobinGetFeeRates();
188
189
  return feeRates;
189
190
  }
190
- catch (error) {
191
+ catch (_error) {
191
192
  console.warn('Can not retrieve fee rates from provider');
192
193
  }
193
194
  }
194
- if (!protocol || Protocol.THORCHAIN) {
195
+ if (!protocol || protocol === Protocol.THORCHAIN) {
195
196
  try {
196
197
  const feeRate = yield this.getFeeRateFromThorchain();
197
198
  return standardFeeRates(feeRate);
198
199
  }
199
- catch (error) {
200
+ catch (_error) {
200
201
  console.warn(`Can not retrieve fee rates from Thorchain`);
201
202
  }
202
203
  }
204
+ if (protocol === Protocol.MAYACHAIN) {
205
+ try {
206
+ const feeRate = yield this.getFeeRateFromMayachain();
207
+ return standardFeeRates(feeRate);
208
+ }
209
+ catch (_error) {
210
+ console.warn(`Can not retrieve fee rates from Mayachain`);
211
+ }
212
+ }
203
213
  // TODO: Return default value
204
214
  throw Error('Can not retrieve fee rates');
205
215
  });
package/lib/index.js CHANGED
@@ -91,7 +91,7 @@ class Client extends xchainClient.BaseXChainClient {
91
91
  return __awaiter(this, void 0, void 0, function* () {
92
92
  // Filter the parameters for transaction history
93
93
  const filteredParams = {
94
- address: (params === null || params === void 0 ? void 0 : params.address) || (yield this.getAddress()),
94
+ address: (params === null || params === void 0 ? void 0 : params.address) || (yield this.getAddressAsync()),
95
95
  offset: params === null || params === void 0 ? void 0 : params.offset,
96
96
  limit: params === null || params === void 0 ? void 0 : params.limit,
97
97
  startTime: params === null || params === void 0 ? void 0 : params.startTime,
@@ -122,8 +122,9 @@ class Client extends xchainClient.BaseXChainClient {
122
122
  */
123
123
  // TODO (@xchain-team|@veado) Change params to be an object to be extendable more easily
124
124
  // see changes for `xchain-bitcoin` https://github.com/xchainjs/xchainjs-lib/pull/490
125
- getBalance(address, _assets /* not used */, confirmedOnly) {
125
+ getBalance(address, _assets /* not used */, _confirmedOnly) {
126
126
  return __awaiter(this, void 0, void 0, function* () {
127
+ // The actual logic for getting balances
127
128
  return yield this.roundRobinGetBalance(address);
128
129
  });
129
130
  }
@@ -189,19 +190,28 @@ class Client extends xchainClient.BaseXChainClient {
189
190
  const feeRates = yield this.roundRobinGetFeeRates();
190
191
  return feeRates;
191
192
  }
192
- catch (error) {
193
+ catch (_error) {
193
194
  console.warn('Can not retrieve fee rates from provider');
194
195
  }
195
196
  }
196
- if (!protocol || xchainClient.Protocol.THORCHAIN) {
197
+ if (!protocol || protocol === xchainClient.Protocol.THORCHAIN) {
197
198
  try {
198
199
  const feeRate = yield this.getFeeRateFromThorchain();
199
200
  return xchainClient.standardFeeRates(feeRate);
200
201
  }
201
- catch (error) {
202
+ catch (_error) {
202
203
  console.warn(`Can not retrieve fee rates from Thorchain`);
203
204
  }
204
205
  }
206
+ if (protocol === xchainClient.Protocol.MAYACHAIN) {
207
+ try {
208
+ const feeRate = yield this.getFeeRateFromMayachain();
209
+ return xchainClient.standardFeeRates(feeRate);
210
+ }
211
+ catch (_error) {
212
+ console.warn(`Can not retrieve fee rates from Mayachain`);
213
+ }
214
+ }
205
215
  // TODO: Return default value
206
216
  throw Error('Can not retrieve fee rates');
207
217
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-utxo",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "Genereic UTXO client for XChainJS",
5
5
  "keywords": [
6
6
  "XChain",
@@ -27,7 +27,7 @@
27
27
  "clean": "rm -rf .turbo && rm -rf lib",
28
28
  "build": "yarn clean && rollup -c --bundleConfigAsCjs",
29
29
  "build:release": "yarn exec rm -rf release && yarn pack && yarn exec \"mkdir release && tar zxvf package.tgz --directory release && rm package.tgz\"",
30
- "lint": "eslint \"{src,__tests__, __mocks__}/**/*.ts\" --fix --max-warnings 0",
30
+ "lint": "eslint --config ../../eslint.config.mjs \"{src,__tests__, __mocks__}/**/*.ts\" --fix --max-warnings 0",
31
31
  "test": "jest"
32
32
  },
33
33
  "publishConfig": {
@@ -35,8 +35,8 @@
35
35
  "directory": "release/package"
36
36
  },
37
37
  "dependencies": {
38
- "@xchainjs/xchain-client": "2.0.8",
39
- "@xchainjs/xchain-util": "2.0.4",
40
- "@xchainjs/xchain-utxo-providers": "2.0.8"
38
+ "@xchainjs/xchain-client": "2.0.9",
39
+ "@xchainjs/xchain-util": "2.0.5",
40
+ "@xchainjs/xchain-utxo-providers": "2.0.9"
41
41
  }
42
42
  }