@xchainjs/xchain-thorchain 0.25.0 → 0.25.2
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/CHANGELOG.md +21 -1
- package/lib/client.d.ts +10 -4
- package/lib/index.esm.js +4267 -44
- package/lib/index.js +4267 -44
- package/lib/types/client-types.d.ts +6 -3
- package/lib/util.d.ts +14 -6
- package/package.json +5 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { cosmosclient } from '@cosmos-client/core';
|
|
2
1
|
import { Network, Tx, TxParams } from '@xchainjs/xchain-client';
|
|
3
2
|
import { Asset, BaseAmount } from '@xchainjs/xchain-util';
|
|
3
|
+
import BigNumber from 'bignumber.js';
|
|
4
|
+
import Long from 'long';
|
|
4
5
|
export declare type NodeUrl = {
|
|
5
6
|
node: string;
|
|
6
7
|
rpc: string;
|
|
@@ -24,6 +25,7 @@ export declare type DepositParam = {
|
|
|
24
25
|
asset?: Asset;
|
|
25
26
|
amount: BaseAmount;
|
|
26
27
|
memo: string;
|
|
28
|
+
gasLimit?: BigNumber;
|
|
27
29
|
};
|
|
28
30
|
export declare type TxData = Pick<Tx, 'from' | 'to' | 'type'>;
|
|
29
31
|
export declare type TxOfflineParams = TxParams & {
|
|
@@ -36,8 +38,9 @@ export declare type TxOfflineParams = TxParams & {
|
|
|
36
38
|
* Optional: It can be ignored if asset to send from is RUNE
|
|
37
39
|
*/
|
|
38
40
|
fromAssetBalance?: BaseAmount;
|
|
39
|
-
fromAccountNumber:
|
|
40
|
-
fromSequence:
|
|
41
|
+
fromAccountNumber: Long;
|
|
42
|
+
fromSequence: Long;
|
|
43
|
+
gasLimit?: BigNumber;
|
|
41
44
|
};
|
|
42
45
|
/**
|
|
43
46
|
* Response from `thorchain/constants` endpoint
|
package/lib/util.d.ts
CHANGED
|
@@ -2,12 +2,13 @@ import { cosmosclient, proto } from '@cosmos-client/core';
|
|
|
2
2
|
import { Address, Balance, Fees, Network, TxHash } from '@xchainjs/xchain-client';
|
|
3
3
|
import { CosmosSDKClient, TxLog } from '@xchainjs/xchain-cosmos';
|
|
4
4
|
import { Asset, BaseAmount } from '@xchainjs/xchain-util';
|
|
5
|
+
import Long from 'long';
|
|
5
6
|
import { ChainId, ChainIds, ClientUrl, ExplorerUrls, TxData } from './types';
|
|
6
7
|
import { MsgNativeTx } from './types/messages';
|
|
7
8
|
export declare const DECIMAL = 8;
|
|
8
9
|
export declare const DEFAULT_GAS_ADJUSTMENT = 2;
|
|
9
10
|
export declare const DEFAULT_GAS_LIMIT_VALUE = "4000000";
|
|
10
|
-
export declare const DEPOSIT_GAS_LIMIT_VALUE = "
|
|
11
|
+
export declare const DEPOSIT_GAS_LIMIT_VALUE = "600000000";
|
|
11
12
|
export declare const MAX_TX_COUNT = 100;
|
|
12
13
|
/**
|
|
13
14
|
* Checks whether an asset is `AssetRuneNative`
|
|
@@ -99,17 +100,24 @@ export declare const buildUnsignedTx: ({ cosmosSdk, txBody, signerPubkey, sequen
|
|
|
99
100
|
cosmosSdk: cosmosclient.CosmosSDK;
|
|
100
101
|
txBody: proto.cosmos.tx.v1beta1.TxBody;
|
|
101
102
|
signerPubkey: proto.google.protobuf.Any;
|
|
102
|
-
sequence:
|
|
103
|
-
gasLimit?:
|
|
103
|
+
sequence: Long;
|
|
104
|
+
gasLimit?: Long.Long | undefined;
|
|
104
105
|
}) => cosmosclient.TxBuilder;
|
|
106
|
+
/**
|
|
107
|
+
* Estimates usage of gas
|
|
108
|
+
*
|
|
109
|
+
* Note: Be careful by using this helper function,
|
|
110
|
+
* it's still experimental and result might be incorrect.
|
|
111
|
+
* Change `multiplier` to get a valid estimation of gas.
|
|
112
|
+
*/
|
|
105
113
|
export declare const getEstimatedGas: ({ cosmosSDKClient, txBody, privKey, accountNumber, accountSequence, multiplier, }: {
|
|
106
114
|
cosmosSDKClient: CosmosSDKClient;
|
|
107
115
|
txBody: proto.cosmos.tx.v1beta1.TxBody;
|
|
108
116
|
privKey: proto.cosmos.crypto.secp256k1.PrivKey;
|
|
109
|
-
accountNumber:
|
|
110
|
-
accountSequence:
|
|
117
|
+
accountNumber: Long;
|
|
118
|
+
accountSequence: Long;
|
|
111
119
|
multiplier?: number | undefined;
|
|
112
|
-
}) => Promise<
|
|
120
|
+
}) => Promise<Long | undefined>;
|
|
113
121
|
/**
|
|
114
122
|
* Structure a MsgDeposit
|
|
115
123
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-thorchain",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.2",
|
|
4
4
|
"description": "Custom Thorchain client and utilities used by XChainJS clients",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"THORChain",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"generate:ThorchainMsgs": "./genMsgs.sh"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@cosmos-client/core": "^0.45.
|
|
37
|
+
"@cosmos-client/core": "^0.45.10",
|
|
38
38
|
"@types/big.js": "^6.0.0",
|
|
39
39
|
"@xchainjs/xchain-client": "^0.11.1",
|
|
40
|
-
"@xchainjs/xchain-cosmos": "^0.
|
|
40
|
+
"@xchainjs/xchain-cosmos": "^0.18.0-alpha.2",
|
|
41
41
|
"@xchainjs/xchain-crypto": "^0.2.4",
|
|
42
42
|
"@xchainjs/xchain-util": "^0.5.1",
|
|
43
43
|
"axios": "^0.25.0",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@cosmos-client/core": "^0.45.
|
|
51
|
+
"@cosmos-client/core": "^0.45.10",
|
|
52
52
|
"@xchainjs/xchain-client": "^0.11.1",
|
|
53
|
-
"@xchainjs/xchain-cosmos": "^0.
|
|
53
|
+
"@xchainjs/xchain-cosmos": "^0.18.0",
|
|
54
54
|
"@xchainjs/xchain-crypto": "^0.2.4",
|
|
55
55
|
"@xchainjs/xchain-util": "^0.5.1",
|
|
56
56
|
"axios": "^0.25.0",
|