@shapeshiftoss/types 2.10.0 → 3.0.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/dist/base.d.ts +12 -16
- package/dist/chain-adapters/index.d.ts +5 -9
- package/package.json +1 -1
package/dist/base.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HDWallet } from '@shapeshiftoss/hdwallet-core';
|
|
2
|
-
import {
|
|
2
|
+
import { QuoteFeeData, SignTxInput } from './chain-adapters';
|
|
3
3
|
/** Common */
|
|
4
4
|
export declare type BIP44Params = {
|
|
5
5
|
purpose: number;
|
|
@@ -38,8 +38,10 @@ export declare enum AssetDataSource {
|
|
|
38
38
|
YearnFinance = "yearnfinance"
|
|
39
39
|
}
|
|
40
40
|
declare type AbstractAsset = {
|
|
41
|
-
|
|
41
|
+
assetId: string;
|
|
42
42
|
caip2: string;
|
|
43
|
+
caip19: string;
|
|
44
|
+
chainId: string;
|
|
43
45
|
chain: ChainTypes;
|
|
44
46
|
description?: string;
|
|
45
47
|
isTrustedDescription?: boolean;
|
|
@@ -106,7 +108,7 @@ export declare type ThorVaultInfo = {
|
|
|
106
108
|
timestamp: string;
|
|
107
109
|
};
|
|
108
110
|
export declare type BuildThorTradeOutput = SignTxInput<unknown> & ThorVaultInfo;
|
|
109
|
-
export declare type Quote<C extends ChainTypes
|
|
111
|
+
export declare type Quote<C extends ChainTypes> = {
|
|
110
112
|
success: boolean;
|
|
111
113
|
statusCode?: number;
|
|
112
114
|
statusReason?: string;
|
|
@@ -114,7 +116,7 @@ export declare type Quote<C extends ChainTypes, S extends SwapperType> = {
|
|
|
114
116
|
buyAssetAccountId?: string;
|
|
115
117
|
sellAsset: Asset;
|
|
116
118
|
buyAsset: Asset;
|
|
117
|
-
feeData?: QuoteFeeData<C
|
|
119
|
+
feeData?: QuoteFeeData<C>;
|
|
118
120
|
rate?: string;
|
|
119
121
|
depositAddress?: string;
|
|
120
122
|
receiveAddress?: string;
|
|
@@ -151,15 +153,15 @@ export declare type BuildQuoteTxInput = {
|
|
|
151
153
|
input: GetQuoteInput;
|
|
152
154
|
wallet: HDWallet;
|
|
153
155
|
};
|
|
154
|
-
export declare type ExecQuoteInput<C extends ChainTypes
|
|
155
|
-
quote: Quote<C
|
|
156
|
+
export declare type ExecQuoteInput<C extends ChainTypes> = {
|
|
157
|
+
quote: Quote<C>;
|
|
156
158
|
wallet: HDWallet;
|
|
157
159
|
};
|
|
158
160
|
export declare type ExecQuoteOutput = {
|
|
159
161
|
txid: string;
|
|
160
162
|
};
|
|
161
|
-
export declare type ApprovalNeededInput<C extends ChainTypes
|
|
162
|
-
quote: Quote<C
|
|
163
|
+
export declare type ApprovalNeededInput<C extends ChainTypes> = {
|
|
164
|
+
quote: Quote<C>;
|
|
163
165
|
wallet: HDWallet;
|
|
164
166
|
};
|
|
165
167
|
export declare type ApprovalNeededOutput = {
|
|
@@ -167,14 +169,8 @@ export declare type ApprovalNeededOutput = {
|
|
|
167
169
|
gas?: string;
|
|
168
170
|
gasPrice?: string;
|
|
169
171
|
};
|
|
170
|
-
export declare type ApproveInfiniteInput<C extends ChainTypes
|
|
171
|
-
quote: Quote<C
|
|
172
|
-
wallet: HDWallet;
|
|
173
|
-
};
|
|
174
|
-
export declare type SendMaxAmountInput = {
|
|
172
|
+
export declare type ApproveInfiniteInput<C extends ChainTypes> = {
|
|
173
|
+
quote: Quote<C>;
|
|
175
174
|
wallet: HDWallet;
|
|
176
|
-
quote: Quote<ChainTypes, SwapperType>;
|
|
177
|
-
sellAssetAccountId: string;
|
|
178
|
-
feeEstimateKey?: FeeDataKey;
|
|
179
175
|
};
|
|
180
176
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BTCSignTx, CosmosSignTx, ETHSignTx, HDWallet } from '@shapeshiftoss/hdwallet-core';
|
|
2
|
-
import { BIP44Params, ChainTypes,
|
|
3
|
-
import {
|
|
2
|
+
import { BIP44Params, ChainTypes, UtxoAccountType } from '../base';
|
|
3
|
+
import { ChainSpecific } from '../utility';
|
|
4
4
|
import * as bitcoin from './bitcoin';
|
|
5
5
|
import * as cosmos from './cosmos';
|
|
6
6
|
import * as ethereum from './ethereum';
|
|
@@ -28,21 +28,17 @@ export declare enum FeeDataKey {
|
|
|
28
28
|
Average = "average",
|
|
29
29
|
Fast = "fast"
|
|
30
30
|
}
|
|
31
|
-
declare type ChainSpecificQuoteFeeData<T1
|
|
31
|
+
declare type ChainSpecificQuoteFeeData<T1> = ChainSpecific<T1, {
|
|
32
32
|
[ChainTypes.Ethereum]: ethereum.QuoteFeeData;
|
|
33
|
-
}, T2, {
|
|
34
|
-
[SwapperType.Thorchain]: {
|
|
35
|
-
receiveFee: string;
|
|
36
|
-
};
|
|
37
33
|
}>;
|
|
38
34
|
declare type ChainSpecificFeeData<T> = ChainSpecific<T, {
|
|
39
35
|
[ChainTypes.Ethereum]: ethereum.FeeData;
|
|
40
36
|
[ChainTypes.Bitcoin]: bitcoin.FeeData;
|
|
41
37
|
[ChainTypes.Cosmos]: cosmos.FeeData;
|
|
42
38
|
}>;
|
|
43
|
-
export declare type QuoteFeeData<T1 extends ChainTypes
|
|
39
|
+
export declare type QuoteFeeData<T1 extends ChainTypes> = {
|
|
44
40
|
fee: string;
|
|
45
|
-
} & ChainSpecificQuoteFeeData<T1
|
|
41
|
+
} & ChainSpecificQuoteFeeData<T1>;
|
|
46
42
|
export declare type FeeData<T extends ChainTypes> = {
|
|
47
43
|
txFee: string;
|
|
48
44
|
} & ChainSpecificFeeData<T>;
|