@xchainjs/xchain-thorchain 0.28.11 → 0.28.13

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
@@ -127,6 +127,10 @@ declare class Client extends BaseXChainClient implements ThorchainClient, XChain
127
127
  * Throws an error if phrase has not been set before
128
128
  **/
129
129
  getPubKey(index?: number): cosmosclient.PubKey;
130
+ /**
131
+ * @deprecated this function eventually will be removed use getAddressAsync instead
132
+ */
133
+ getAddress(index?: number): string;
130
134
  /**
131
135
  * Get the current address.
132
136
  *
@@ -134,7 +138,7 @@ declare class Client extends BaseXChainClient implements ThorchainClient, XChain
134
138
  *
135
139
  * @throws {Error} Thrown if phrase has not been set before. A phrase is needed to create a wallet and to derive an address from it.
136
140
  */
137
- getAddress(index?: number): string;
141
+ getAddressAsync(walletIndex?: number): Promise<Address>;
138
142
  /**
139
143
  * Validate the given address.
140
144
  *
package/lib/index.esm.js CHANGED
@@ -4251,7 +4251,7 @@ Long.fromBytesBE = function fromBytesBE(bytes, unsigned) {
4251
4251
 
4252
4252
  var Long$1 = /*@__PURE__*/getDefaultExportFromCjs(long);
4253
4253
 
4254
- const DEFAULT_EXPLORER_URL = 'https://viewblock.io/thorchain';
4254
+ const DEFAULT_EXPLORER_URL = 'https://runescan.io';
4255
4255
  const txUrl = `${DEFAULT_EXPLORER_URL}/tx`;
4256
4256
  const addressUrl = `${DEFAULT_EXPLORER_URL}/address`;
4257
4257
  const RUNE_TICKER = 'RUNE';
@@ -10156,7 +10156,7 @@ class Client extends BaseXChainClient {
10156
10156
  const messageAction = undefined;
10157
10157
  const offset = (params === null || params === void 0 ? void 0 : params.offset) || 0;
10158
10158
  const limit = (params === null || params === void 0 ? void 0 : params.limit) || 10;
10159
- const address = (params === null || params === void 0 ? void 0 : params.address) || this.getAddress();
10159
+ const address = (params === null || params === void 0 ? void 0 : params.address) || (yield this.getAddressAsync());
10160
10160
  const txMinHeight = undefined;
10161
10161
  const txMaxHeight = undefined;
10162
10162
  if (limit + offset > MAX_PAGES_PER_FUNCTION_CALL * MAX_TX_COUNT_PER_PAGE) {
@@ -10362,11 +10362,7 @@ class Client extends BaseXChainClient {
10362
10362
  return privKey.pubKey();
10363
10363
  }
10364
10364
  /**
10365
- * Get the current address.
10366
- *
10367
- * @returns {Address} The current address.
10368
- *
10369
- * @throws {Error} Thrown if phrase has not been set before. A phrase is needed to create a wallet and to derive an address from it.
10365
+ * @deprecated this function eventually will be removed use getAddressAsync instead
10370
10366
  */
10371
10367
  getAddress(index = 0) {
10372
10368
  const address = this.cosmosClient.getAddressFromMnemonic(this.phrase, this.getFullDerivationPath(index));
@@ -10375,6 +10371,18 @@ class Client extends BaseXChainClient {
10375
10371
  }
10376
10372
  return address;
10377
10373
  }
10374
+ /**
10375
+ * Get the current address.
10376
+ *
10377
+ * @returns {Address} The current address.
10378
+ *
10379
+ * @throws {Error} Thrown if phrase has not been set before. A phrase is needed to create a wallet and to derive an address from it.
10380
+ */
10381
+ getAddressAsync(walletIndex = 0) {
10382
+ return __awaiter(this, void 0, void 0, function* () {
10383
+ return this.getAddress(walletIndex);
10384
+ });
10385
+ }
10378
10386
  /**
10379
10387
  * Validate the given address.
10380
10388
  *
@@ -10658,7 +10666,7 @@ class Client extends BaseXChainClient {
10658
10666
  }
10659
10667
  const privKey = this.getPrivateKey(walletIndex);
10660
10668
  const signerPubkey = privKey.pubKey();
10661
- const fromAddress = this.getAddress(walletIndex);
10669
+ const fromAddress = yield this.getAddressAsync(walletIndex);
10662
10670
  const fromAddressAcc = cosmosclient.AccAddress.fromString(fromAddress);
10663
10671
  const depositTxBody = yield buildDepositTx({
10664
10672
  msgNativeTx: {
@@ -10773,7 +10781,7 @@ class Client extends BaseXChainClient {
10773
10781
  }
10774
10782
  }
10775
10783
  const txBody = yield buildTransferTx({
10776
- fromAddress: this.getAddress(walletIndex),
10784
+ fromAddress: yield this.getAddressAsync(walletIndex),
10777
10785
  toAddress: recipient,
10778
10786
  memo,
10779
10787
  assetAmount: amount,