@shapeshiftoss/types 1.6.0 → 1.9.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
@@ -24,6 +24,11 @@ export declare enum NetworkTypes {
24
24
  ETH_ROPSTEN = "ETH_ROPSTEN",
25
25
  ETH_RINKEBY = "ETH_RINKEBY"
26
26
  }
27
+ export declare enum UtxoAccountType {
28
+ SegwitNative = "SegwitNative",
29
+ SegwitP2sh = "SegwitP2sh",
30
+ P2pkh = "P2pkh"
31
+ }
27
32
  declare type AbstractAsset = {
28
33
  caip19: string;
29
34
  chain: ChainTypes;
@@ -50,35 +55,6 @@ export declare type BaseAsset = AbstractAsset & {
50
55
  tokens?: TokenAsset[];
51
56
  };
52
57
  export declare type Asset = AbstractAsset & Partial<TokenAssetFields>;
53
- export declare type MarketData = {
54
- price: string;
55
- marketCap: string;
56
- volume: string;
57
- changePercent24Hr: number;
58
- };
59
- export declare enum HistoryTimeframe {
60
- HOUR = "1H",
61
- DAY = "24H",
62
- WEEK = "1W",
63
- MONTH = "1M",
64
- YEAR = "1Y",
65
- ALL = "All"
66
- }
67
- export declare type HistoryData = {
68
- price: number;
69
- date: string;
70
- };
71
- export declare type PriceHistoryArgs = {
72
- chain: ChainTypes;
73
- timeframe: HistoryTimeframe;
74
- tokenId?: string;
75
- };
76
- export declare type MarketDataArgs = {
77
- chain: ChainTypes;
78
- tokenId?: string;
79
- };
80
- export declare type MarketDataType = (args: MarketDataArgs) => Promise<MarketData>;
81
- export declare type PriceHistoryType = (args: PriceHistoryArgs) => Promise<HistoryData[]>;
82
58
  export declare enum SwapperType {
83
59
  Zrx = "0x",
84
60
  Thorchain = "Thorchain"
package/dist/base.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SwapperType = exports.HistoryTimeframe = exports.NetworkTypes = exports.ChainTypes = exports.ContractTypes = void 0;
3
+ exports.SwapperType = exports.UtxoAccountType = exports.NetworkTypes = exports.ChainTypes = exports.ContractTypes = void 0;
4
4
  var ContractTypes;
5
5
  (function (ContractTypes) {
6
6
  ContractTypes["ERC20"] = "ERC20";
@@ -20,15 +20,12 @@ var NetworkTypes;
20
20
  NetworkTypes["ETH_ROPSTEN"] = "ETH_ROPSTEN";
21
21
  NetworkTypes["ETH_RINKEBY"] = "ETH_RINKEBY";
22
22
  })(NetworkTypes = exports.NetworkTypes || (exports.NetworkTypes = {}));
23
- var HistoryTimeframe;
24
- (function (HistoryTimeframe) {
25
- HistoryTimeframe["HOUR"] = "1H";
26
- HistoryTimeframe["DAY"] = "24H";
27
- HistoryTimeframe["WEEK"] = "1W";
28
- HistoryTimeframe["MONTH"] = "1M";
29
- HistoryTimeframe["YEAR"] = "1Y";
30
- HistoryTimeframe["ALL"] = "All";
31
- })(HistoryTimeframe = exports.HistoryTimeframe || (exports.HistoryTimeframe = {}));
23
+ var UtxoAccountType;
24
+ (function (UtxoAccountType) {
25
+ UtxoAccountType["SegwitNative"] = "SegwitNative";
26
+ UtxoAccountType["SegwitP2sh"] = "SegwitP2sh";
27
+ UtxoAccountType["P2pkh"] = "P2pkh";
28
+ })(UtxoAccountType = exports.UtxoAccountType || (exports.UtxoAccountType = {}));
32
29
  // swapper
33
30
  var SwapperType;
34
31
  (function (SwapperType) {
@@ -54,3 +54,7 @@ export declare type NodeTransaction = {
54
54
  time: number;
55
55
  blocktime: number;
56
56
  };
57
+ export declare type FeeData = {
58
+ feePerTx: string;
59
+ byteCount: string;
60
+ };
@@ -47,6 +47,7 @@ declare type ChainSpecificQuoteFeeData<T1, T2> = ChainAndSwapperSpecific<T1, {
47
47
  }>;
48
48
  declare type ChainSpecificFeeData<T> = ChainSpecific<T, {
49
49
  [ChainTypes.Ethereum]: ethereum.FeeData;
50
+ [ChainTypes.Bitcoin]: bitcoin.FeeData;
50
51
  }>;
51
52
  export declare type QuoteFeeData<T1 extends ChainTypes, T2 extends SwapperType> = {
52
53
  fee: string;
@@ -139,6 +140,10 @@ export interface TxHistoryInput {
139
140
  export declare type GetAddressInputBase = {
140
141
  wallet: HDWallet;
141
142
  bip32Params?: BIP32Params;
143
+ /**
144
+ * Request that the address be shown to the user by the device, if supported
145
+ */
146
+ showOnDevice?: boolean;
142
147
  };
143
148
  export declare type GetAddressInput = GetAddressInputBase | bitcoin.GetAddressInput;
144
149
  export declare type GetFeeDataInput = {
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import * as chainAdapters from './chain-adapters';
2
2
  export { chainAdapters };
3
3
  export * from './base';
4
+ export * from './market';
package/dist/index.js CHANGED
@@ -26,3 +26,4 @@ exports.chainAdapters = void 0;
26
26
  const chainAdapters = __importStar(require("./chain-adapters"));
27
27
  exports.chainAdapters = chainAdapters;
28
28
  __exportStar(require("./base"), exports);
29
+ __exportStar(require("./market"), exports);
@@ -0,0 +1,71 @@
1
+ import { ChainTypes } from '.';
2
+ export declare type MarketData = {
3
+ price: string;
4
+ marketCap: string;
5
+ volume: string;
6
+ changePercent24Hr: number;
7
+ };
8
+ export declare enum HistoryTimeframe {
9
+ HOUR = "1H",
10
+ DAY = "24H",
11
+ WEEK = "1W",
12
+ MONTH = "1M",
13
+ YEAR = "1Y",
14
+ ALL = "All"
15
+ }
16
+ export declare type HistoryData = {
17
+ price: number;
18
+ date: string;
19
+ };
20
+ export declare type PriceHistoryArgs = {
21
+ chain: ChainTypes;
22
+ timeframe: HistoryTimeframe;
23
+ tokenId?: string;
24
+ };
25
+ export declare type MarketDataArgs = {
26
+ chain: ChainTypes;
27
+ tokenId?: string;
28
+ };
29
+ export declare type MarketDataType = (args: MarketDataArgs) => Promise<MarketData>;
30
+ export declare type PriceHistoryType = (args: PriceHistoryArgs) => Promise<HistoryData[]>;
31
+ export declare type GetByMarketCapArgs = {
32
+ pages: number;
33
+ perPage: number;
34
+ };
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;
71
+ };
package/dist/market.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HistoryTimeframe = void 0;
4
+ var HistoryTimeframe;
5
+ (function (HistoryTimeframe) {
6
+ HistoryTimeframe["HOUR"] = "1H";
7
+ HistoryTimeframe["DAY"] = "24H";
8
+ HistoryTimeframe["WEEK"] = "1W";
9
+ HistoryTimeframe["MONTH"] = "1M";
10
+ HistoryTimeframe["YEAR"] = "1Y";
11
+ HistoryTimeframe["ALL"] = "All";
12
+ })(HistoryTimeframe = exports.HistoryTimeframe || (exports.HistoryTimeframe = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/types",
3
- "version": "1.6.0",
3
+ "version": "1.9.1",
4
4
  "description": "Common types shared across packages",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",