@shapeshiftoss/types 4.0.0 → 4.2.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
@@ -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 QuoteResponse = {
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;
@@ -1,4 +1,4 @@
1
- import { BTCSignTx, CosmosSignTx, ETHSignTx, HDWallet } from '@shapeshiftoss/hdwallet-core';
1
+ import { BTCSignTx, CosmosSignTx, ETHSignTx, HDWallet, OsmosisSignTx } from '@shapeshiftoss/hdwallet-core';
2
2
  import { BIP44Params, ChainTypes, UtxoAccountType } from '../base';
3
3
  import { ChainSpecific } from '../utility';
4
4
  import * as bitcoin from './bitcoin';
@@ -28,17 +28,12 @@ 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;
35
+ [ChainTypes.Osmosis]: osmosis.FeeData;
38
36
  }>;
39
- export declare type QuoteFeeData<T1 extends ChainTypes> = {
40
- fee: string;
41
- } & ChainSpecificQuoteFeeData<T1>;
42
37
  export declare type FeeData<T extends ChainTypes> = {
43
38
  txFee: string;
44
39
  } & ChainSpecificFeeData<T>;
@@ -115,6 +110,7 @@ declare type ChainTxTypeInner = {
115
110
  [ChainTypes.Ethereum]: ETHSignTx;
116
111
  [ChainTypes.Bitcoin]: BTCSignTx;
117
112
  [ChainTypes.Cosmos]: CosmosSignTx;
113
+ [ChainTypes.Osmosis]: OsmosisSignTx;
118
114
  };
119
115
  export declare type ChainTxType<T> = T extends keyof ChainTxTypeInner ? ChainTxTypeInner[T] : never;
120
116
  export declare type BuildDelegateTxInput<T extends ChainTypes> = {
@@ -1,6 +1,3 @@
1
- export declare type BuildTxInput = {
2
- gas: string;
3
- };
4
- export declare type Account = {
5
- sequence: number;
6
- };
1
+ import { cosmos } from '.';
2
+ export declare type Account = cosmos.Account;
3
+ export declare type FeeData = cosmos.FeeData;
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ import * as chainAdapters from './chain-adapters';
2
2
  export { chainAdapters };
3
3
  export * from './base';
4
4
  export * from './market';
5
+ export { ChainSpecific } from './utility';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/types",
3
- "version": "4.0.0",
3
+ "version": "4.2.0",
4
4
  "description": "Common types shared across packages",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",