@xchainjs/xchain-thorchain 0.27.11 → 0.28.0
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 +223 -223
- package/lib/const.d.ts +51 -51
- package/lib/index.d.ts +4 -4
- package/lib/index.esm.js +6652 -6622
- package/lib/index.esm.js.map +1 -0
- package/lib/index.js +6668 -6619
- package/lib/index.js.map +1 -0
- package/lib/types/client-types.d.ts +92 -92
- package/lib/types/index.d.ts +2 -2
- package/lib/types/messages.d.ts +63 -63
- package/lib/utils.d.ts +196 -196
- package/package.json +12 -12
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import { Network, Tx, TxParams } from '@xchainjs/xchain-client';
|
|
2
|
-
import { Asset, BaseAmount } from '@xchainjs/xchain-util';
|
|
3
|
-
import BigNumber from 'bignumber.js';
|
|
4
|
-
import Long from 'long';
|
|
5
|
-
export
|
|
6
|
-
node: string;
|
|
7
|
-
rpc: string;
|
|
8
|
-
};
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
root: ExplorerUrl;
|
|
12
|
-
tx: ExplorerUrl;
|
|
13
|
-
address: ExplorerUrl;
|
|
14
|
-
};
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
clientUrl?: ClientUrl;
|
|
20
|
-
explorerUrls?: ExplorerUrls;
|
|
21
|
-
chainIds?: ChainIds;
|
|
22
|
-
};
|
|
23
|
-
export
|
|
24
|
-
walletIndex?: number;
|
|
25
|
-
asset?: Asset;
|
|
26
|
-
amount: BaseAmount;
|
|
27
|
-
memo: string;
|
|
28
|
-
gasLimit?: BigNumber;
|
|
29
|
-
sequence?: number;
|
|
30
|
-
};
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
/**
|
|
34
|
-
* Balance of Rune to send from
|
|
35
|
-
*/
|
|
36
|
-
fromRuneBalance: BaseAmount;
|
|
37
|
-
/**
|
|
38
|
-
* Balance of asset to send from
|
|
39
|
-
* Optional: It can be ignored if asset to send from is RUNE
|
|
40
|
-
*/
|
|
41
|
-
fromAssetBalance?: BaseAmount;
|
|
42
|
-
fromAccountNumber: Long;
|
|
43
|
-
fromSequence: Long;
|
|
44
|
-
gasLimit?: BigNumber;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Response from `thorchain/constants` endpoint
|
|
48
|
-
*/
|
|
49
|
-
export
|
|
50
|
-
int_64_values: {
|
|
51
|
-
NativeTransactionFee: number;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Response of `/cosmos/base/tendermint/v1beta1/node_info`
|
|
56
|
-
* Note: We are interested in `network` (aka chain id) only
|
|
57
|
-
*/
|
|
58
|
-
export
|
|
59
|
-
default_node_info: {
|
|
60
|
-
network: string;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Response of `/cosmos/tx/v1beta1/simulateo`
|
|
65
|
-
* Note: We are interested in `network` (aka chain id) only
|
|
66
|
-
*/
|
|
67
|
-
export
|
|
68
|
-
gas_info: {
|
|
69
|
-
gas_used: string;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
export
|
|
73
|
-
'@type': string;
|
|
74
|
-
from_address: string;
|
|
75
|
-
to_address: string;
|
|
76
|
-
amount: Amount;
|
|
77
|
-
};
|
|
78
|
-
export
|
|
79
|
-
denom: string;
|
|
80
|
-
amount: string;
|
|
81
|
-
};
|
|
82
|
-
export
|
|
83
|
-
'@type': string;
|
|
84
|
-
coins: Coins[];
|
|
85
|
-
memo: string;
|
|
86
|
-
signer: string;
|
|
87
|
-
};
|
|
88
|
-
export
|
|
89
|
-
asset: string;
|
|
90
|
-
amount: number;
|
|
91
|
-
decimals: number;
|
|
92
|
-
};
|
|
1
|
+
import { Network, Tx, TxParams } from '@xchainjs/xchain-client';
|
|
2
|
+
import { Asset, BaseAmount } from '@xchainjs/xchain-util';
|
|
3
|
+
import BigNumber from 'bignumber.js';
|
|
4
|
+
import Long from 'long';
|
|
5
|
+
export type NodeUrl = {
|
|
6
|
+
node: string;
|
|
7
|
+
rpc: string;
|
|
8
|
+
};
|
|
9
|
+
export type ClientUrl = Record<Network, NodeUrl>;
|
|
10
|
+
export type ExplorerUrls = {
|
|
11
|
+
root: ExplorerUrl;
|
|
12
|
+
tx: ExplorerUrl;
|
|
13
|
+
address: ExplorerUrl;
|
|
14
|
+
};
|
|
15
|
+
export type ExplorerUrl = Record<Network, string>;
|
|
16
|
+
export type ChainId = string;
|
|
17
|
+
export type ChainIds = Record<Network, ChainId>;
|
|
18
|
+
export type ThorchainClientParams = {
|
|
19
|
+
clientUrl?: ClientUrl;
|
|
20
|
+
explorerUrls?: ExplorerUrls;
|
|
21
|
+
chainIds?: ChainIds;
|
|
22
|
+
};
|
|
23
|
+
export type DepositParam = {
|
|
24
|
+
walletIndex?: number;
|
|
25
|
+
asset?: Asset;
|
|
26
|
+
amount: BaseAmount;
|
|
27
|
+
memo: string;
|
|
28
|
+
gasLimit?: BigNumber;
|
|
29
|
+
sequence?: number;
|
|
30
|
+
};
|
|
31
|
+
export type TxData = Pick<Tx, 'from' | 'to' | 'type'>;
|
|
32
|
+
export type TxOfflineParams = TxParams & {
|
|
33
|
+
/**
|
|
34
|
+
* Balance of Rune to send from
|
|
35
|
+
*/
|
|
36
|
+
fromRuneBalance: BaseAmount;
|
|
37
|
+
/**
|
|
38
|
+
* Balance of asset to send from
|
|
39
|
+
* Optional: It can be ignored if asset to send from is RUNE
|
|
40
|
+
*/
|
|
41
|
+
fromAssetBalance?: BaseAmount;
|
|
42
|
+
fromAccountNumber: Long;
|
|
43
|
+
fromSequence: Long;
|
|
44
|
+
gasLimit?: BigNumber;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Response from `thorchain/constants` endpoint
|
|
48
|
+
*/
|
|
49
|
+
export type ThorchainConstantsResponse = {
|
|
50
|
+
int_64_values: {
|
|
51
|
+
NativeTransactionFee: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Response of `/cosmos/base/tendermint/v1beta1/node_info`
|
|
56
|
+
* Note: We are interested in `network` (aka chain id) only
|
|
57
|
+
*/
|
|
58
|
+
export type NodeInfoResponse = {
|
|
59
|
+
default_node_info: {
|
|
60
|
+
network: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Response of `/cosmos/tx/v1beta1/simulateo`
|
|
65
|
+
* Note: We are interested in `network` (aka chain id) only
|
|
66
|
+
*/
|
|
67
|
+
export type SimulateResponse = {
|
|
68
|
+
gas_info: {
|
|
69
|
+
gas_used: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export type MessageSend = {
|
|
73
|
+
'@type': string;
|
|
74
|
+
from_address: string;
|
|
75
|
+
to_address: string;
|
|
76
|
+
amount: Amount;
|
|
77
|
+
};
|
|
78
|
+
export type Amount = {
|
|
79
|
+
denom: string;
|
|
80
|
+
amount: string;
|
|
81
|
+
};
|
|
82
|
+
export type MessageDeposit = {
|
|
83
|
+
'@type': string;
|
|
84
|
+
coins: Coins[];
|
|
85
|
+
memo: string;
|
|
86
|
+
signer: string;
|
|
87
|
+
};
|
|
88
|
+
export type Coins = {
|
|
89
|
+
asset: string;
|
|
90
|
+
amount: number;
|
|
91
|
+
decimals: number;
|
|
92
|
+
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './client-types';
|
|
2
|
-
export * from './messages';
|
|
1
|
+
export * from './client-types';
|
|
2
|
+
export * from './messages';
|
package/lib/types/messages.d.ts
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import cosmosclient from '@cosmos-client/core';
|
|
2
|
-
import { Asset } from '@xchainjs/xchain-util';
|
|
3
|
-
export
|
|
4
|
-
asset: Asset;
|
|
5
|
-
amount: string;
|
|
6
|
-
};
|
|
7
|
-
export declare class MsgNativeTx {
|
|
8
|
-
coins: MsgCoin[];
|
|
9
|
-
memo: string;
|
|
10
|
-
signer: cosmosclient.AccAddress;
|
|
11
|
-
constructor(coins: MsgCoin[], memo: string, signer: cosmosclient.AccAddress);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* This creates MsgNativeTx from json.
|
|
15
|
-
*
|
|
16
|
-
* @param value
|
|
17
|
-
* @returns {MsgNativeTx}
|
|
18
|
-
*/
|
|
19
|
-
export declare const msgNativeTxFromJson: (value: {
|
|
20
|
-
coins: MsgCoin[];
|
|
21
|
-
memo: string;
|
|
22
|
-
signer: string;
|
|
23
|
-
}) => MsgNativeTx;
|
|
24
|
-
export
|
|
25
|
-
type: string;
|
|
26
|
-
value: T;
|
|
27
|
-
};
|
|
28
|
-
export
|
|
29
|
-
msg: AminoWrapping<{
|
|
30
|
-
coins: MsgCoin[];
|
|
31
|
-
memo: string;
|
|
32
|
-
signer: string;
|
|
33
|
-
}>[];
|
|
34
|
-
fee: cosmosclient.proto.cosmos.tx.v1beta1.Fee;
|
|
35
|
-
signatures: string[];
|
|
36
|
-
memo: string;
|
|
37
|
-
timeout_height: string;
|
|
38
|
-
}>;
|
|
39
|
-
export
|
|
40
|
-
observed_tx: {
|
|
41
|
-
tx: {
|
|
42
|
-
id: string;
|
|
43
|
-
chain: string;
|
|
44
|
-
from_address: string;
|
|
45
|
-
to_address: string;
|
|
46
|
-
coins: {
|
|
47
|
-
asset: string;
|
|
48
|
-
amount: string;
|
|
49
|
-
}[];
|
|
50
|
-
gas: {
|
|
51
|
-
asset: string;
|
|
52
|
-
amount: string;
|
|
53
|
-
}[];
|
|
54
|
-
memo: string;
|
|
55
|
-
};
|
|
56
|
-
status: string;
|
|
57
|
-
signers: string[];
|
|
58
|
-
};
|
|
59
|
-
keysign_metric: {
|
|
60
|
-
tx_id: string;
|
|
61
|
-
node_tss_times: null;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
1
|
+
import cosmosclient from '@cosmos-client/core';
|
|
2
|
+
import { Asset } from '@xchainjs/xchain-util';
|
|
3
|
+
export type MsgCoin = {
|
|
4
|
+
asset: Asset;
|
|
5
|
+
amount: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class MsgNativeTx {
|
|
8
|
+
coins: MsgCoin[];
|
|
9
|
+
memo: string;
|
|
10
|
+
signer: cosmosclient.AccAddress;
|
|
11
|
+
constructor(coins: MsgCoin[], memo: string, signer: cosmosclient.AccAddress);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* This creates MsgNativeTx from json.
|
|
15
|
+
*
|
|
16
|
+
* @param value
|
|
17
|
+
* @returns {MsgNativeTx}
|
|
18
|
+
*/
|
|
19
|
+
export declare const msgNativeTxFromJson: (value: {
|
|
20
|
+
coins: MsgCoin[];
|
|
21
|
+
memo: string;
|
|
22
|
+
signer: string;
|
|
23
|
+
}) => MsgNativeTx;
|
|
24
|
+
export type AminoWrapping<T> = {
|
|
25
|
+
type: string;
|
|
26
|
+
value: T;
|
|
27
|
+
};
|
|
28
|
+
export type ThorchainDepositResponse = AminoWrapping<{
|
|
29
|
+
msg: AminoWrapping<{
|
|
30
|
+
coins: MsgCoin[];
|
|
31
|
+
memo: string;
|
|
32
|
+
signer: string;
|
|
33
|
+
}>[];
|
|
34
|
+
fee: cosmosclient.proto.cosmos.tx.v1beta1.Fee;
|
|
35
|
+
signatures: string[];
|
|
36
|
+
memo: string;
|
|
37
|
+
timeout_height: string;
|
|
38
|
+
}>;
|
|
39
|
+
export type TxResult = {
|
|
40
|
+
observed_tx: {
|
|
41
|
+
tx: {
|
|
42
|
+
id: string;
|
|
43
|
+
chain: string;
|
|
44
|
+
from_address: string;
|
|
45
|
+
to_address: string;
|
|
46
|
+
coins: {
|
|
47
|
+
asset: string;
|
|
48
|
+
amount: string;
|
|
49
|
+
}[];
|
|
50
|
+
gas: {
|
|
51
|
+
asset: string;
|
|
52
|
+
amount: string;
|
|
53
|
+
}[];
|
|
54
|
+
memo: string;
|
|
55
|
+
};
|
|
56
|
+
status: string;
|
|
57
|
+
signers: string[];
|
|
58
|
+
};
|
|
59
|
+
keysign_metric: {
|
|
60
|
+
tx_id: string;
|
|
61
|
+
node_tss_times: null;
|
|
62
|
+
};
|
|
63
|
+
};
|