@xchainjs/xchain-thorchain 2.0.13 → 2.0.15
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/LICENSE +1 -1
- package/lib/clientKeystore.d.ts +7 -0
- package/lib/index.esm.js +36 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +35 -0
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
package/lib/clientKeystore.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Account } from '@cosmjs/stargate';
|
|
1
2
|
import { BigNumber } from 'bignumber.js';
|
|
2
3
|
import { Client } from './client';
|
|
3
4
|
import { DepositParam, TxOfflineParams, TxParams } from './types';
|
|
@@ -17,6 +18,12 @@ export declare class ClientKeystore extends Client {
|
|
|
17
18
|
* @returns {string} The user address at the specified walletIndex.
|
|
18
19
|
*/
|
|
19
20
|
getAddress(walletIndex?: number): string;
|
|
21
|
+
/**
|
|
22
|
+
* Get the Account frmom Address.
|
|
23
|
+
* @param {number | undefined} walletIndex The index of the address derivation path. Default is 0.
|
|
24
|
+
* @returns {Account} The Account holder details or error if account does not exist
|
|
25
|
+
*/
|
|
26
|
+
getAccountDetails(walletIndex?: number): Promise<Account>;
|
|
20
27
|
/**
|
|
21
28
|
* Returns the private key associated with an index
|
|
22
29
|
*
|
package/lib/index.esm.js
CHANGED
|
@@ -15,7 +15,7 @@ import { BigNumber } from 'bignumber.js';
|
|
|
15
15
|
import { toWords, encode } from 'bech32';
|
|
16
16
|
import { fromSeed } from 'bip32';
|
|
17
17
|
import { publicKeyCreate } from 'secp256k1';
|
|
18
|
-
import { assetToString, isSynthAsset, AssetType, assetToBase, assetAmount, eqAsset, assetFromString, assetFromStringEx } from '@xchainjs/xchain-util';
|
|
18
|
+
import { assetToString, isSynthAsset, isSecuredAsset, AssetType, assetToBase, assetAmount, eqAsset, assetFromString, assetFromStringEx } from '@xchainjs/xchain-util';
|
|
19
19
|
import { Network } from '@xchainjs/xchain-client';
|
|
20
20
|
import THORChainApp, { extractSignatureFromTLV } from '@xchainjs/ledger-thorchain';
|
|
21
21
|
|
|
@@ -127729,6 +127729,7 @@ function requireMsgCompiled () {
|
|
|
127729
127729
|
* @property {string|null} [ticker] Asset ticker
|
|
127730
127730
|
* @property {boolean|null} [synth] Asset synth
|
|
127731
127731
|
* @property {boolean|null} [trade] Asset trade
|
|
127732
|
+
* @property {boolean|null} [secured] Asset secured
|
|
127732
127733
|
*/
|
|
127733
127734
|
|
|
127734
127735
|
/**
|
|
@@ -127786,6 +127787,14 @@ function requireMsgCompiled () {
|
|
|
127786
127787
|
*/
|
|
127787
127788
|
Asset.prototype.trade = false;
|
|
127788
127789
|
|
|
127790
|
+
/**
|
|
127791
|
+
* Asset secured.
|
|
127792
|
+
* @member {boolean} secured
|
|
127793
|
+
* @memberof common.Asset
|
|
127794
|
+
* @instance
|
|
127795
|
+
*/
|
|
127796
|
+
Asset.prototype.secured = false;
|
|
127797
|
+
|
|
127789
127798
|
/**
|
|
127790
127799
|
* Creates a new Asset instance using the specified properties.
|
|
127791
127800
|
* @function create
|
|
@@ -127820,6 +127829,8 @@ function requireMsgCompiled () {
|
|
|
127820
127829
|
writer.uint32(/* id 4, wireType 0 =*/32).bool(message.synth);
|
|
127821
127830
|
if (message.trade != null && Object.hasOwnProperty.call(message, "trade"))
|
|
127822
127831
|
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.trade);
|
|
127832
|
+
if (message.secured != null && Object.hasOwnProperty.call(message, "secured"))
|
|
127833
|
+
writer.uint32(/* id 6, wireType 0 =*/48).bool(message.secured);
|
|
127823
127834
|
return writer;
|
|
127824
127835
|
};
|
|
127825
127836
|
|
|
@@ -127869,6 +127880,9 @@ function requireMsgCompiled () {
|
|
|
127869
127880
|
case 5:
|
|
127870
127881
|
message.trade = reader.bool();
|
|
127871
127882
|
break;
|
|
127883
|
+
case 6:
|
|
127884
|
+
message.secured = reader.bool();
|
|
127885
|
+
break;
|
|
127872
127886
|
default:
|
|
127873
127887
|
reader.skipType(tag & 7);
|
|
127874
127888
|
break;
|
|
@@ -127919,6 +127933,9 @@ function requireMsgCompiled () {
|
|
|
127919
127933
|
if (message.trade != null && message.hasOwnProperty("trade"))
|
|
127920
127934
|
if (typeof message.trade !== "boolean")
|
|
127921
127935
|
return "trade: boolean expected";
|
|
127936
|
+
if (message.secured != null && message.hasOwnProperty("secured"))
|
|
127937
|
+
if (typeof message.secured !== "boolean")
|
|
127938
|
+
return "secured: boolean expected";
|
|
127922
127939
|
return null;
|
|
127923
127940
|
};
|
|
127924
127941
|
|
|
@@ -127944,6 +127961,8 @@ function requireMsgCompiled () {
|
|
|
127944
127961
|
message.synth = Boolean(object.synth);
|
|
127945
127962
|
if (object.trade != null)
|
|
127946
127963
|
message.trade = Boolean(object.trade);
|
|
127964
|
+
if (object.secured != null)
|
|
127965
|
+
message.secured = Boolean(object.secured);
|
|
127947
127966
|
return message;
|
|
127948
127967
|
};
|
|
127949
127968
|
|
|
@@ -127966,6 +127985,7 @@ function requireMsgCompiled () {
|
|
|
127966
127985
|
object.ticker = "";
|
|
127967
127986
|
object.synth = false;
|
|
127968
127987
|
object.trade = false;
|
|
127988
|
+
object.secured = false;
|
|
127969
127989
|
}
|
|
127970
127990
|
if (message.chain != null && message.hasOwnProperty("chain"))
|
|
127971
127991
|
object.chain = message.chain;
|
|
@@ -127977,6 +127997,8 @@ function requireMsgCompiled () {
|
|
|
127977
127997
|
object.synth = message.synth;
|
|
127978
127998
|
if (message.trade != null && message.hasOwnProperty("trade"))
|
|
127979
127999
|
object.trade = message.trade;
|
|
128000
|
+
if (message.secured != null && message.hasOwnProperty("secured"))
|
|
128001
|
+
object.secured = message.secured;
|
|
127980
128002
|
return object;
|
|
127981
128003
|
};
|
|
127982
128004
|
|
|
@@ -130686,6 +130708,8 @@ const getDenom = (asset) => {
|
|
|
130686
130708
|
return RUNE_DENOM;
|
|
130687
130709
|
if (isSynthAsset(asset))
|
|
130688
130710
|
return assetToString(asset).toLowerCase();
|
|
130711
|
+
if (isSecuredAsset(asset))
|
|
130712
|
+
return assetToString(asset).toLowerCase();
|
|
130689
130713
|
return asset.symbol.toLowerCase();
|
|
130690
130714
|
};
|
|
130691
130715
|
/**
|
|
@@ -131051,6 +131075,17 @@ class ClientKeystore extends Client {
|
|
|
131051
131075
|
const address = encode(this.prefix, words);
|
|
131052
131076
|
return address;
|
|
131053
131077
|
}
|
|
131078
|
+
/**
|
|
131079
|
+
* Get the Account frmom Address.
|
|
131080
|
+
* @param {number | undefined} walletIndex The index of the address derivation path. Default is 0.
|
|
131081
|
+
* @returns {Account} The Account holder details or error if account does not exist
|
|
131082
|
+
*/
|
|
131083
|
+
getAccountDetails(walletIndex) {
|
|
131084
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131085
|
+
const account = yield this.getAccount(this.getAddress(walletIndex));
|
|
131086
|
+
return account;
|
|
131087
|
+
});
|
|
131088
|
+
}
|
|
131054
131089
|
/**
|
|
131055
131090
|
* Returns the private key associated with an index
|
|
131056
131091
|
*
|