@shapeshiftoss/types 2.10.1 → 3.0.1

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 CHANGED
@@ -38,8 +38,10 @@ export declare enum AssetDataSource {
38
38
  YearnFinance = "yearnfinance"
39
39
  }
40
40
  declare type AbstractAsset = {
41
- caip19: string;
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, S extends SwapperType> = {
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, S>;
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, S extends SwapperType> = {
155
- quote: Quote<C, S>;
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, S extends SwapperType> = {
162
- quote: Quote<C, S>;
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,8 +169,8 @@ export declare type ApprovalNeededOutput = {
167
169
  gas?: string;
168
170
  gasPrice?: string;
169
171
  };
170
- export declare type ApproveInfiniteInput<C extends ChainTypes, S extends SwapperType> = {
171
- quote: Quote<C, S>;
172
+ export declare type ApproveInfiniteInput<C extends ChainTypes> = {
173
+ quote: Quote<C>;
172
174
  wallet: HDWallet;
173
175
  };
174
176
  export {};
@@ -9,7 +9,7 @@ export declare type Info = {
9
9
  export declare type Validator = {
10
10
  address: string;
11
11
  moniker: string;
12
- tokens: string;
12
+ tokens?: string;
13
13
  apr: string;
14
14
  commission: string;
15
15
  };
@@ -1,6 +1,6 @@
1
1
  import { BTCSignTx, CosmosSignTx, ETHSignTx, HDWallet } from '@shapeshiftoss/hdwallet-core';
2
- import { BIP44Params, ChainTypes, SwapperType, UtxoAccountType } from '../base';
3
- import { ChainAndSwapperSpecific, ChainSpecific } from '../utility';
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, T2> = ChainAndSwapperSpecific<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, T2 extends SwapperType> = {
39
+ export declare type QuoteFeeData<T1 extends ChainTypes> = {
44
40
  fee: string;
45
- } & ChainSpecificQuoteFeeData<T1, T2>;
41
+ } & ChainSpecificQuoteFeeData<T1>;
46
42
  export declare type FeeData<T extends ChainTypes> = {
47
43
  txFee: string;
48
44
  } & ChainSpecificFeeData<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/types",
3
- "version": "2.10.1",
3
+ "version": "3.0.1",
4
4
  "description": "Common types shared across packages",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",
@@ -13,11 +13,13 @@
13
13
  "access": "public"
14
14
  },
15
15
  "scripts": {
16
- "build": "yarn clean && tsc --project tsconfig.build.json",
16
+ "build": "yarn clean && yarn compile",
17
17
  "dev": "tsc --watch",
18
- "clean": "rm -rf dist",
18
+ "clean": "rm -rf dist && rm -rf tsconfig.build.tsbuildinfo",
19
+ "compile": "tsc -p tsconfig.build.json",
20
+ "prepare": "yarn build",
19
21
  "test": "jest test",
20
- "type-check": "tsc --project ./tsconfig.json --noEmit"
22
+ "type-check": "tsc --project ./tsconfig.build.json --noEmit"
21
23
  },
22
24
  "devDependencies": {
23
25
  "@shapeshiftoss/hdwallet-core": "^1.20.0"