@shapeshiftoss/types 1.15.0 → 1.17.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 CHANGED
@@ -36,6 +36,7 @@ export declare enum AssetDataSource {
36
36
  declare type AbstractAsset = {
37
37
  caip19: string;
38
38
  chain: ChainTypes;
39
+ description?: string;
39
40
  dataSource: AssetDataSource;
40
41
  network: NetworkTypes;
41
42
  symbol: string;
package/dist/base.js CHANGED
@@ -26,6 +26,7 @@ var UtxoAccountType;
26
26
  UtxoAccountType["SegwitP2sh"] = "SegwitP2sh";
27
27
  UtxoAccountType["P2pkh"] = "P2pkh";
28
28
  })(UtxoAccountType = exports.UtxoAccountType || (exports.UtxoAccountType = {}));
29
+ // TODO(0xdef1cafe): remove this, client should not be aware of where data is from
29
30
  // Describes the data source for where to get the asset details or asset description.
30
31
  var AssetDataSource;
31
32
  (function (AssetDataSource) {
@@ -13,9 +13,6 @@ export declare type Token = {
13
13
  export declare type TokenWithBalance = Token & {
14
14
  balance: string;
15
15
  };
16
- export declare type TxTransfer = {
17
- token?: Token;
18
- };
19
16
  export declare type FeeData = {
20
17
  gasPrice: string;
21
18
  gasLimit: string;
@@ -66,13 +66,13 @@ export declare type SubscribeTxsInput = {
66
66
  accountType?: UtxoAccountType;
67
67
  };
68
68
  export declare type TxFee = {
69
- symbol: string;
69
+ caip19: string;
70
70
  value: string;
71
71
  };
72
72
  export declare enum TxType {
73
73
  Send = "send",
74
74
  Receive = "receive",
75
- Trade = "trade"
75
+ Unknown = "unknown"
76
76
  }
77
77
  export declare enum TxStatus {
78
78
  Confirmed = "confirmed",
@@ -86,31 +86,30 @@ export declare type SubscribeTxsMessage<T extends ChainTypes> = {
86
86
  blockHeight: number;
87
87
  blockTime: number;
88
88
  chain: T;
89
+ caip2: string;
89
90
  confirmations: number;
90
- network: NetworkTypes;
91
91
  txid: string;
92
- to?: string;
93
- from?: string;
94
92
  fee?: TxFee;
95
93
  status: TxStatus;
96
94
  tradeDetails?: TradeDetails;
97
- } & TxTransfer<T>;
95
+ transfers: Array<TxTransfer>;
96
+ };
97
+ export declare enum TradeType {
98
+ Trade = "trade",
99
+ Refund = "refund"
100
+ }
98
101
  export declare type TradeDetails = {
99
- buyAmount: string;
100
- buyAsset: string;
101
102
  dexName: string;
102
- feeAmount: string;
103
- sellAmount: string;
104
- sellAsset: string;
103
+ memo?: string;
104
+ type: TradeType;
105
105
  };
106
- declare type ChainSpecificTxTransfer<T> = ChainSpecific<T, {
107
- [ChainTypes.Ethereum]: ethereum.TxTransfer;
108
- }>;
109
- export declare type TxTransfer<T extends ChainTypes> = {
110
- asset: string;
106
+ export declare type TxTransfer = {
107
+ caip19: string;
108
+ from: string;
109
+ to: string;
111
110
  type: TxType;
112
111
  value: string;
113
- } & ChainSpecificTxTransfer<T>;
112
+ };
114
113
  export declare type SubscribeError = {
115
114
  message: string;
116
115
  };
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.ValidAddressResultType = exports.TxStatus = exports.TxType = exports.FeeDataKey = exports.ethereum = exports.bitcoin = void 0;
22
+ exports.ValidAddressResultType = exports.TradeType = exports.TxStatus = exports.TxType = exports.FeeDataKey = exports.ethereum = exports.bitcoin = void 0;
23
23
  const base_1 = require("../base");
24
24
  const bitcoin = __importStar(require("./bitcoin"));
25
25
  exports.bitcoin = bitcoin;
@@ -35,7 +35,7 @@ var TxType;
35
35
  (function (TxType) {
36
36
  TxType["Send"] = "send";
37
37
  TxType["Receive"] = "receive";
38
- TxType["Trade"] = "trade";
38
+ TxType["Unknown"] = "unknown";
39
39
  })(TxType = exports.TxType || (exports.TxType = {}));
40
40
  var TxStatus;
41
41
  (function (TxStatus) {
@@ -44,6 +44,11 @@ var TxStatus;
44
44
  TxStatus["Failed"] = "failed";
45
45
  TxStatus["Unknown"] = "unknown";
46
46
  })(TxStatus = exports.TxStatus || (exports.TxStatus = {}));
47
+ var TradeType;
48
+ (function (TradeType) {
49
+ TradeType["Trade"] = "trade";
50
+ TradeType["Refund"] = "refund";
51
+ })(TradeType = exports.TradeType || (exports.TradeType = {}));
47
52
  var ValidAddressResultType;
48
53
  (function (ValidAddressResultType) {
49
54
  ValidAddressResultType["Valid"] = "valid";
package/dist/market.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { ChainTypes } from '.';
2
1
  export declare type MarketData = {
3
2
  price: string;
4
3
  marketCap: string;
@@ -18,54 +17,19 @@ export declare type HistoryData = {
18
17
  date: string;
19
18
  };
20
19
  export declare type PriceHistoryArgs = {
21
- chain: ChainTypes;
20
+ caip19: string;
22
21
  timeframe: HistoryTimeframe;
23
- tokenId?: string;
24
22
  };
25
23
  export declare type MarketDataArgs = {
26
- chain: ChainTypes;
27
- tokenId?: string;
24
+ caip19: string;
28
25
  };
29
- export declare type MarketDataType = (args: MarketDataArgs) => Promise<MarketData>;
26
+ export declare type FindAllMarketType = (args: FindAllMarketArgs) => Promise<MarketCapResult>;
27
+ export declare type FindByCaip19MarketType = (args: MarketDataArgs) => Promise<MarketData>;
30
28
  export declare type PriceHistoryType = (args: PriceHistoryArgs) => Promise<HistoryData[]>;
31
- export declare type GetByMarketCapArgs = {
29
+ export declare type FindAllMarketArgs = {
32
30
  pages: number;
33
31
  perPage: number;
34
32
  };
35
- export declare type CoinGeckoMarketCapNoId = Omit<CoinGeckoMarketCap, 'id'>;
36
- export declare type CoinGeckoMarketCapResult = {
37
- [k: string]: CoinGeckoMarketCapNoId;
38
- };
39
- export declare type GetByMarketCapType = (args?: GetByMarketCapArgs) => Promise<CoinGeckoMarketCapResult>;
40
- export declare type CoinGeckoMarketCap = {
41
- id: string;
42
- symbol: string;
43
- name: string;
44
- image: string;
45
- current_price: number;
46
- market_cap: number;
47
- market_cap_rank: number;
48
- fully_diluted_valuation: number | null;
49
- total_volume: number;
50
- high_24h: number;
51
- low_24h: number;
52
- price_change_24h: number;
53
- price_change_percentage_24h: number;
54
- market_cap_change_24h: number;
55
- market_cap_change_percentage_24h: number;
56
- circulating_supply: number;
57
- total_supply: number | null;
58
- max_supply: number | null;
59
- ath: number;
60
- ath_change_percentage: number;
61
- ath_date: string;
62
- atl: number;
63
- atl_change_percentage: number;
64
- atl_date: string;
65
- roi: null | {
66
- times: number;
67
- currency: string;
68
- percentage: number;
69
- };
70
- last_updated: string;
33
+ export declare type MarketCapResult = {
34
+ [k: string]: MarketData;
71
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/types",
3
- "version": "1.15.0",
3
+ "version": "1.17.0",
4
4
  "description": "Common types shared across packages",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",