@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 +5 -1
- package/lib/index.esm.js +17 -9
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +17 -9
- package/lib/index.js.map +1 -1
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -4279,7 +4279,7 @@ Long.fromBytesBE = function fromBytesBE(bytes, unsigned) {
|
|
|
4279
4279
|
|
|
4280
4280
|
var Long$1 = /*@__PURE__*/getDefaultExportFromCjs(long);
|
|
4281
4281
|
|
|
4282
|
-
const DEFAULT_EXPLORER_URL = 'https://
|
|
4282
|
+
const DEFAULT_EXPLORER_URL = 'https://runescan.io';
|
|
4283
4283
|
const txUrl = `${DEFAULT_EXPLORER_URL}/tx`;
|
|
4284
4284
|
const addressUrl = `${DEFAULT_EXPLORER_URL}/address`;
|
|
4285
4285
|
const RUNE_TICKER = 'RUNE';
|
|
@@ -10184,7 +10184,7 @@ class Client extends xchainClient.BaseXChainClient {
|
|
|
10184
10184
|
const messageAction = undefined;
|
|
10185
10185
|
const offset = (params === null || params === void 0 ? void 0 : params.offset) || 0;
|
|
10186
10186
|
const limit = (params === null || params === void 0 ? void 0 : params.limit) || 10;
|
|
10187
|
-
const address = (params === null || params === void 0 ? void 0 : params.address) || this.
|
|
10187
|
+
const address = (params === null || params === void 0 ? void 0 : params.address) || (yield this.getAddressAsync());
|
|
10188
10188
|
const txMinHeight = undefined;
|
|
10189
10189
|
const txMaxHeight = undefined;
|
|
10190
10190
|
if (limit + offset > MAX_PAGES_PER_FUNCTION_CALL * MAX_TX_COUNT_PER_PAGE) {
|
|
@@ -10390,11 +10390,7 @@ class Client extends xchainClient.BaseXChainClient {
|
|
|
10390
10390
|
return privKey.pubKey();
|
|
10391
10391
|
}
|
|
10392
10392
|
/**
|
|
10393
|
-
*
|
|
10394
|
-
*
|
|
10395
|
-
* @returns {Address} The current address.
|
|
10396
|
-
*
|
|
10397
|
-
* @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.
|
|
10393
|
+
* @deprecated this function eventually will be removed use getAddressAsync instead
|
|
10398
10394
|
*/
|
|
10399
10395
|
getAddress(index = 0) {
|
|
10400
10396
|
const address = this.cosmosClient.getAddressFromMnemonic(this.phrase, this.getFullDerivationPath(index));
|
|
@@ -10403,6 +10399,18 @@ class Client extends xchainClient.BaseXChainClient {
|
|
|
10403
10399
|
}
|
|
10404
10400
|
return address;
|
|
10405
10401
|
}
|
|
10402
|
+
/**
|
|
10403
|
+
* Get the current address.
|
|
10404
|
+
*
|
|
10405
|
+
* @returns {Address} The current address.
|
|
10406
|
+
*
|
|
10407
|
+
* @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.
|
|
10408
|
+
*/
|
|
10409
|
+
getAddressAsync(walletIndex = 0) {
|
|
10410
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10411
|
+
return this.getAddress(walletIndex);
|
|
10412
|
+
});
|
|
10413
|
+
}
|
|
10406
10414
|
/**
|
|
10407
10415
|
* Validate the given address.
|
|
10408
10416
|
*
|
|
@@ -10686,7 +10694,7 @@ class Client extends xchainClient.BaseXChainClient {
|
|
|
10686
10694
|
}
|
|
10687
10695
|
const privKey = this.getPrivateKey(walletIndex);
|
|
10688
10696
|
const signerPubkey = privKey.pubKey();
|
|
10689
|
-
const fromAddress = this.
|
|
10697
|
+
const fromAddress = yield this.getAddressAsync(walletIndex);
|
|
10690
10698
|
const fromAddressAcc = cosmosclient__default["default"].AccAddress.fromString(fromAddress);
|
|
10691
10699
|
const depositTxBody = yield buildDepositTx({
|
|
10692
10700
|
msgNativeTx: {
|
|
@@ -10801,7 +10809,7 @@ class Client extends xchainClient.BaseXChainClient {
|
|
|
10801
10809
|
}
|
|
10802
10810
|
}
|
|
10803
10811
|
const txBody = yield buildTransferTx({
|
|
10804
|
-
fromAddress: this.
|
|
10812
|
+
fromAddress: yield this.getAddressAsync(walletIndex),
|
|
10805
10813
|
toAddress: recipient,
|
|
10806
10814
|
memo,
|
|
10807
10815
|
assetAmount: amount,
|