@xchainjs/xchain-thorchain 3.0.7 → 3.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/clientKeystore.d.ts +1 -1
- package/lib/index.esm.js +5 -5
- package/lib/index.js +9 -8
- package/lib/types/client-types.d.ts +2 -2
- package/package.json +8 -8
package/lib/clientKeystore.d.ts
CHANGED
package/lib/index.esm.js
CHANGED
|
@@ -4,8 +4,8 @@ import { decodeTxRaw, DirectSecp256k1HdWallet, encodePubkey, makeAuthInfoBytes }
|
|
|
4
4
|
import { SigningStargateClient, AminoTypes } from '@cosmjs/stargate';
|
|
5
5
|
import { Client as Client$1, bech32ToBase64, MsgTypes, makeClientPath, base64ToBech32 } from '@xchainjs/xchain-cosmos-sdk';
|
|
6
6
|
import { getSeed } from '@xchainjs/xchain-crypto';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
7
|
+
import { bech32 } from '@scure/base';
|
|
8
|
+
import BigNumber from 'bignumber.js';
|
|
9
9
|
import { HDKey } from '@scure/bip32';
|
|
10
10
|
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx';
|
|
11
11
|
import { createHash } from 'crypto';
|
|
@@ -3513,9 +3513,9 @@ class ClientKeystore extends Client {
|
|
|
3513
3513
|
const pubKey = secp.pointFromScalar(child.privateKey, true);
|
|
3514
3514
|
if (!pubKey)
|
|
3515
3515
|
throw new Error('pubKey is null');
|
|
3516
|
-
const rawAddress = this.hash160(
|
|
3517
|
-
const words = toWords(
|
|
3518
|
-
const address = encode(this.prefix, words);
|
|
3516
|
+
const rawAddress = this.hash160(pubKey);
|
|
3517
|
+
const words = bech32.toWords(new Uint8Array(rawAddress));
|
|
3518
|
+
const address = bech32.encode(this.prefix, words);
|
|
3519
3519
|
return address;
|
|
3520
3520
|
}
|
|
3521
3521
|
/**
|
package/lib/index.js
CHANGED
|
@@ -6,8 +6,8 @@ var protoSigning = require('@cosmjs/proto-signing');
|
|
|
6
6
|
var stargate = require('@cosmjs/stargate');
|
|
7
7
|
var xchainCosmosSdk = require('@xchainjs/xchain-cosmos-sdk');
|
|
8
8
|
var xchainCrypto = require('@xchainjs/xchain-crypto');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var base = require('@scure/base');
|
|
10
|
+
var BigNumber = require('bignumber.js');
|
|
11
11
|
var bip32 = require('@scure/bip32');
|
|
12
12
|
var tx = require('cosmjs-types/cosmos/tx/v1beta1/tx');
|
|
13
13
|
var crypto = require('crypto');
|
|
@@ -40,6 +40,7 @@ function _interopNamespace(e) {
|
|
|
40
40
|
return Object.freeze(n);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
var BigNumber__default = /*#__PURE__*/_interopDefault(BigNumber);
|
|
43
44
|
var secp__namespace = /*#__PURE__*/_interopNamespace(secp);
|
|
44
45
|
var minimal__namespace = /*#__PURE__*/_interopNamespace(minimal);
|
|
45
46
|
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
@@ -3540,9 +3541,9 @@ class ClientKeystore extends Client {
|
|
|
3540
3541
|
const pubKey = secp__namespace.pointFromScalar(child.privateKey, true);
|
|
3541
3542
|
if (!pubKey)
|
|
3542
3543
|
throw new Error('pubKey is null');
|
|
3543
|
-
const rawAddress = this.hash160(
|
|
3544
|
-
const words = bech32.toWords(
|
|
3545
|
-
const address = bech32.encode(this.prefix, words);
|
|
3544
|
+
const rawAddress = this.hash160(pubKey);
|
|
3545
|
+
const words = base.bech32.toWords(new Uint8Array(rawAddress));
|
|
3546
|
+
const address = base.bech32.encode(this.prefix, words);
|
|
3546
3547
|
return address;
|
|
3547
3548
|
}
|
|
3548
3549
|
/**
|
|
@@ -3621,7 +3622,7 @@ class ClientKeystore extends Client {
|
|
|
3621
3622
|
* value of 600000000 will be used
|
|
3622
3623
|
* @returns {string} The deposit hash
|
|
3623
3624
|
*/
|
|
3624
|
-
deposit({ walletIndex = 0, asset = AssetRuneNative, amount, memo, gasLimit = new
|
|
3625
|
+
deposit({ walletIndex = 0, asset = AssetRuneNative, amount, memo, gasLimit = new BigNumber__default.default(DEPOSIT_GAS_LIMIT_VALUE), }) {
|
|
3625
3626
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3626
3627
|
// Get sender address
|
|
3627
3628
|
const sender = yield this.getAddressAsync(walletIndex);
|
|
@@ -3639,7 +3640,7 @@ class ClientKeystore extends Client {
|
|
|
3639
3640
|
*
|
|
3640
3641
|
* @deprecated Use prepare Tx instead
|
|
3641
3642
|
*/
|
|
3642
|
-
transferOffline({ walletIndex = 0, recipient, asset, amount, memo, gasLimit = new
|
|
3643
|
+
transferOffline({ walletIndex = 0, recipient, asset, amount, memo, gasLimit = new BigNumber__default.default(DEFAULT_GAS_LIMIT_VALUE), }) {
|
|
3643
3644
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3644
3645
|
// Get sender address
|
|
3645
3646
|
const sender = yield this.getAddressAsync(walletIndex);
|
|
@@ -3841,7 +3842,7 @@ class ClientLedger extends Client {
|
|
|
3841
3842
|
* value of 600000000 will be used
|
|
3842
3843
|
* @returns {string} The deposit hash
|
|
3843
3844
|
*/
|
|
3844
|
-
deposit({ walletIndex = 0, asset = AssetRuneNative, amount, memo, gasLimit = new
|
|
3845
|
+
deposit({ walletIndex = 0, asset = AssetRuneNative, amount, memo, gasLimit = new BigNumber__default.default(DEPOSIT_GAS_LIMIT_VALUE), }) {
|
|
3845
3846
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3846
3847
|
const sender = yield this.getAddressAsync(walletIndex || 0);
|
|
3847
3848
|
const account = yield this.getAccount(sender);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CompatibleAsset, Tx, TxParams as BaseTxParams } from '@xchainjs/xchain-cosmos-sdk';
|
|
2
2
|
import { BaseAmount } from '@xchainjs/xchain-util';
|
|
3
|
-
import
|
|
3
|
+
import type BigNumber from 'bignumber.js';
|
|
4
4
|
export type DepositParam = {
|
|
5
5
|
walletIndex?: number;
|
|
6
6
|
asset?: CompatibleAsset;
|
|
@@ -16,4 +16,4 @@ export type TxParams = BaseTxParams & {
|
|
|
16
16
|
export type TxOfflineParams = TxParams & {
|
|
17
17
|
gasLimit?: BigNumber;
|
|
18
18
|
};
|
|
19
|
-
export { CompatibleAsset };
|
|
19
|
+
export type { CompatibleAsset };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-thorchain",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"description": "Custom Thorchain client and utilities used by XChainJS clients",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"THORChain",
|
|
@@ -28,7 +28,7 @@
|
|
|
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
30
|
"test": "jest",
|
|
31
|
-
"e2e": "jest --config jest.config.e2e.
|
|
31
|
+
"e2e": "jest --config jest.config.e2e.mjs",
|
|
32
32
|
"lint": "eslint \"{src,__tests__}/**/*.ts\" --fix --max-warnings 0",
|
|
33
33
|
"start:example": "ts-node example/index.ts",
|
|
34
34
|
"generate:ThorchainMsgs": "./genMsgs.sh"
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"@cosmjs/proto-signing": "0.33.1",
|
|
43
43
|
"@cosmjs/stargate": "0.33.1",
|
|
44
44
|
"@ledgerhq/hw-transport": "^6.31.6",
|
|
45
|
+
"@scure/base": "^1.2.6",
|
|
45
46
|
"@scure/bip32": "^1.7.0",
|
|
46
|
-
"@xchainjs/ledger-thorchain": "0.3.
|
|
47
|
-
"@xchainjs/xchain-client": "2.0.
|
|
48
|
-
"@xchainjs/xchain-cosmos-sdk": "2.0.
|
|
49
|
-
"@xchainjs/xchain-crypto": "1.0.
|
|
50
|
-
"@xchainjs/xchain-util": "2.0.
|
|
47
|
+
"@xchainjs/ledger-thorchain": "^0.3.1",
|
|
48
|
+
"@xchainjs/xchain-client": "2.0.5",
|
|
49
|
+
"@xchainjs/xchain-cosmos-sdk": "2.0.5",
|
|
50
|
+
"@xchainjs/xchain-crypto": "1.0.3",
|
|
51
|
+
"@xchainjs/xchain-util": "2.0.3",
|
|
51
52
|
"axios": "1.8.4",
|
|
52
|
-
"bech32": "^1.1.3",
|
|
53
53
|
"bignumber.js": "^9.0.0",
|
|
54
54
|
"cosmjs-types": "0.9.0",
|
|
55
55
|
"protobufjs": "6.11.4"
|