Skip to content

Commit

Permalink
fix(deprecation): marked methods and constants as deprecated (LF-766) (
Browse files Browse the repository at this point in the history
…#62)

* fix(deprecation): marked methods and constants as deprecated (tools & types refactoring)

* fix: removed breaking changes

* refactor: added legacy support to avoid types breaking changes
  • Loading branch information
H3xept committed May 23, 2022
1 parent a79e6fa commit 3ac61a3
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 59 deletions.
53 changes: 4 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,9 @@
# Li.Finance - Types
Types for lifi projects
### Installation

### Summary
This package contains all common types for the [LiFi SDK](https://github.com/lifinance/sdk).
Learn more about LiFi on (https://li.finance).


Check out the [Changelog](./CHANGELOG.md) to see what changed in the last releases.

### Install dependencies

Install dependencies with yarn:

```bash
yarn install
```

### Test

Test your code with Jest framework:

```bash
yarn test
npm install --save @lifinance/types
```

**Note:** Example TypeScript Package uses [husky](https://typicode.github.io/husky/), [pinst](https://github.com/typicode/pinst) and [commitlint](https://commitlint.js.org/) to automatically execute test and [lint commit message](https://www.conventionalcommits.org/) before every commit.

### Build

Build production (distribution) files in your **dist** folder:

```bash
yarn build
```


### Release
In order to release a new version of the package you have to run

```bash
yarn release
```

This will
* bump the version number according to the types of the last commits (i.e. if it is a major, minor or bug fix release)
* create a new git tag
* update the CHANGELOG.md

Afterwards, all you have to do is run
### Summary

```bash
git push && git push --tags
```
This package contains type definitions for lifinance projects (https://github.com/lifinance).
54 changes: 54 additions & 0 deletions git.README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Li.Finance - Types
Types for lifi projects

### Summary
This package contains all common types for the [LiFi SDK](https://github.com/lifinance/sdk).
Learn more about LiFi on (https://li.finance).


Check out the [Changelog](./CHANGELOG.md) to see what changed in the last releases.

### Install dependencies

Install dependencies with yarn:

```bash
yarn install
```

### Test

Test your code with Jest framework:

```bash
yarn test
```

**Note:** Example TypeScript Package uses [husky](https://typicode.github.io/husky/), [pinst](https://github.com/typicode/pinst) and [commitlint](https://commitlint.js.org/) to automatically execute test and [lint commit message](https://www.conventionalcommits.org/) before every commit.

### Build

Build production (distribution) files in your **dist** folder:

```bash
yarn build
```


### Release
In order to release a new version of the package you have to run

```bash
yarn release
```

This will
* bump the version number according to the types of the last commits (i.e. if it is a major, minor or bug fix release)
* create a new git tag
* update the CHANGELOG.md

Afterwards, all you have to do is run

```bash
git push && git push --tags
```
9 changes: 0 additions & 9 deletions npm.README.md

This file was deleted.

8 changes: 8 additions & 0 deletions src/bridges.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @deprecated
* These values are now obtainable from the LiFi API
*/
export enum BridgeTool {
connext = 'connext',
hop = 'hop',
Expand All @@ -24,6 +28,10 @@ export interface Bridge {
analyticsUrl?: string
}

/**
* @deprecated
* These values are now obtainable from the LiFi API
*/
export const supportedBridges: Array<Bridge> = [
{
key: BridgeTool.connext,
Expand Down
22 changes: 21 additions & 1 deletion src/exchanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {
Token,
} from '.'

/**
* @deprecated
* These values are now obtainable from the LiFi API
*/
export enum ExchangeTool {
oneinch = '1inch',
paraswap = 'paraswap',
Expand All @@ -14,6 +18,10 @@ export enum ExchangeTool {
dodo = 'dodo',
}

/**
* @deprecated
* These values are now obtainable from the LiFi API
*/
export type ExchangeTools = ExchangeTool | string

export interface ExchangeAggregator {
Expand All @@ -23,6 +31,10 @@ export interface ExchangeAggregator {
webUrl: string
}

/**
* @deprecated
* These values are now obtainable from the LiFi API
*/
export const supportedExchangeAggregators: Array<ExchangeAggregator> = [
{
key: ExchangeTool.oneinch,
Expand Down Expand Up @@ -72,9 +84,13 @@ export interface Exchange {
routerAddress: string
factoryAddress: string
initCodeHash: string
baseTokens: Array<Token>
baseTokens: readonly Token[]
}

/**
* @deprecated
* These values are now obtainable from the LiFi API
*/
export const supportedExchanges: Array<Exchange> = [
// 1 - Ethereum
{
Expand Down Expand Up @@ -1182,6 +1198,10 @@ export const supportedExchanges: Array<Exchange> = [
},
]

/**
* @deprecated
* Available exchanges should be queried from the API
*/
export const getExchangeByKey = (key: string): Exchange => {
const exchange = supportedExchanges.find((exchange) => exchange.key === key)
if (!exchange) {
Expand Down

0 comments on commit 3ac61a3

Please sign in to comment.