@shapeshiftoss/types 3.1.5 → 4.1.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/README.md +1 -1
- package/dist/base.d.ts +3 -55
- package/dist/base.js +7 -0
- package/dist/chain-adapters/ethereum.d.ts +0 -18
- package/dist/chain-adapters/index.d.ts +0 -6
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/base.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { HDWallet } from '@shapeshiftoss/hdwallet-core';
|
|
2
|
-
import { QuoteFeeData } from './chain-adapters';
|
|
3
1
|
/** Common */
|
|
4
2
|
export declare type BIP44Params = {
|
|
5
3
|
purpose: number;
|
|
@@ -14,6 +12,8 @@ export declare enum ChainTypes {
|
|
|
14
12
|
Cosmos = "cosmos",
|
|
15
13
|
Osmosis = "osmosis"
|
|
16
14
|
}
|
|
15
|
+
declare const supportedChainIds: readonly ["eip155:1", "bip122:000000000019d6689c085ae165831e93", "cosmos:cosmoshub-4", "cosmos:osmosis-1"];
|
|
16
|
+
export declare type SupportedChainIds = typeof supportedChainIds[number];
|
|
17
17
|
export declare enum NetworkTypes {
|
|
18
18
|
MAINNET = "MAINNET",
|
|
19
19
|
TESTNET = "TESTNET",
|
|
@@ -81,61 +81,9 @@ export interface MinMaxOutput {
|
|
|
81
81
|
minimum: string;
|
|
82
82
|
maximum: string;
|
|
83
83
|
}
|
|
84
|
-
export declare type
|
|
85
|
-
price: string;
|
|
86
|
-
to: string;
|
|
87
|
-
data?: string;
|
|
88
|
-
value?: string;
|
|
89
|
-
gas?: string;
|
|
90
|
-
estimatedGas?: string;
|
|
91
|
-
gasPrice?: string;
|
|
92
|
-
protocolFee?: string;
|
|
93
|
-
minimumProtocolFee?: string;
|
|
94
|
-
buyTokenAddress?: string;
|
|
95
|
-
sellTokenAddress?: string;
|
|
96
|
-
buyAmount?: string;
|
|
97
|
-
sellAmount?: string;
|
|
98
|
-
allowanceTarget?: string;
|
|
99
|
-
sources?: Array<SwapSource>;
|
|
100
|
-
};
|
|
101
|
-
export declare type Quote<C extends ChainTypes> = {
|
|
102
|
-
success: boolean;
|
|
103
|
-
statusReason?: string;
|
|
104
|
-
sellAssetAccountId?: string;
|
|
105
|
-
buyAssetAccountId?: string;
|
|
106
|
-
sellAsset: Asset;
|
|
107
|
-
buyAsset: Asset;
|
|
108
|
-
feeData?: QuoteFeeData<C>;
|
|
109
|
-
rate?: string;
|
|
110
|
-
depositAddress?: string;
|
|
111
|
-
receiveAddress?: string;
|
|
112
|
-
buyAmount?: string;
|
|
113
|
-
sellAmount?: string;
|
|
114
|
-
minimum?: string | null;
|
|
115
|
-
maximum?: string | null;
|
|
116
|
-
txData?: string;
|
|
117
|
-
value?: string;
|
|
118
|
-
allowanceContract?: string;
|
|
119
|
-
sources?: Array<SwapSource>;
|
|
120
|
-
};
|
|
121
|
-
export declare type GetQuoteInput = {
|
|
84
|
+
export declare type GetMinMaxInput = {
|
|
122
85
|
sellAsset: Asset;
|
|
123
86
|
buyAsset: Asset;
|
|
124
|
-
sellAmount?: string;
|
|
125
|
-
buyAmount?: string;
|
|
126
|
-
sellAssetAccountId?: string;
|
|
127
|
-
buyAssetAccountId?: string;
|
|
128
|
-
slippage?: string;
|
|
129
|
-
sendMax?: boolean;
|
|
130
|
-
priceImpact?: string;
|
|
131
|
-
};
|
|
132
|
-
export declare type BuildQuoteTxInput = {
|
|
133
|
-
input: GetQuoteInput;
|
|
134
|
-
wallet: HDWallet;
|
|
135
|
-
};
|
|
136
|
-
export declare type ExecQuoteInput<C extends ChainTypes> = {
|
|
137
|
-
quote: Quote<C>;
|
|
138
|
-
wallet: HDWallet;
|
|
139
87
|
};
|
|
140
88
|
export declare type ExecQuoteOutput = {
|
|
141
89
|
txid: string;
|
package/dist/base.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/** Common */
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.SwapperType = exports.AssetDataSource = exports.UtxoAccountType = exports.WithdrawType = exports.NetworkTypes = exports.ChainTypes = void 0;
|
|
4
5
|
var ChainTypes;
|
|
@@ -8,6 +9,12 @@ var ChainTypes;
|
|
|
8
9
|
ChainTypes["Cosmos"] = "cosmos";
|
|
9
10
|
ChainTypes["Osmosis"] = "osmosis";
|
|
10
11
|
})(ChainTypes = exports.ChainTypes || (exports.ChainTypes = {}));
|
|
12
|
+
const supportedChainIds = [
|
|
13
|
+
'eip155:1',
|
|
14
|
+
'bip122:000000000019d6689c085ae165831e93',
|
|
15
|
+
'cosmos:cosmoshub-4',
|
|
16
|
+
'cosmos:osmosis-1'
|
|
17
|
+
];
|
|
11
18
|
var NetworkTypes;
|
|
12
19
|
(function (NetworkTypes) {
|
|
13
20
|
NetworkTypes["MAINNET"] = "MAINNET";
|
|
@@ -9,24 +9,6 @@ export declare type FeeData = {
|
|
|
9
9
|
maxFeePerGas: string;
|
|
10
10
|
maxPriorityFeePerGas: string;
|
|
11
11
|
};
|
|
12
|
-
export declare type QuoteFeeData = {
|
|
13
|
-
/**
|
|
14
|
-
* estimated gas units in gwei
|
|
15
|
-
*/
|
|
16
|
-
estimatedGas?: string;
|
|
17
|
-
/**
|
|
18
|
-
* gas price per gwei
|
|
19
|
-
*/
|
|
20
|
-
gasPrice?: string;
|
|
21
|
-
/**
|
|
22
|
-
* total approval fee in eth
|
|
23
|
-
*/
|
|
24
|
-
approvalFee?: string;
|
|
25
|
-
/**
|
|
26
|
-
* total fee including approval
|
|
27
|
-
*/
|
|
28
|
-
totalFee?: string;
|
|
29
|
-
};
|
|
30
12
|
export declare type BuildTxInput = {
|
|
31
13
|
gasLimit: string;
|
|
32
14
|
erc20ContractAddress?: string;
|
|
@@ -28,17 +28,11 @@ export declare enum FeeDataKey {
|
|
|
28
28
|
Average = "average",
|
|
29
29
|
Fast = "fast"
|
|
30
30
|
}
|
|
31
|
-
declare type ChainSpecificQuoteFeeData<T1> = ChainSpecific<T1, {
|
|
32
|
-
[ChainTypes.Ethereum]: ethereum.QuoteFeeData;
|
|
33
|
-
}>;
|
|
34
31
|
declare type ChainSpecificFeeData<T> = ChainSpecific<T, {
|
|
35
32
|
[ChainTypes.Ethereum]: ethereum.FeeData;
|
|
36
33
|
[ChainTypes.Bitcoin]: bitcoin.FeeData;
|
|
37
34
|
[ChainTypes.Cosmos]: cosmos.FeeData;
|
|
38
35
|
}>;
|
|
39
|
-
export declare type QuoteFeeData<T1 extends ChainTypes> = {
|
|
40
|
-
fee: string;
|
|
41
|
-
} & ChainSpecificQuoteFeeData<T1>;
|
|
42
36
|
export declare type FeeData<T extends ChainTypes> = {
|
|
43
37
|
txFee: string;
|
|
44
38
|
} & ChainSpecificFeeData<T>;
|
package/dist/index.d.ts
CHANGED