-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor refinance data types (#250)
- Loading branch information
Showing
41 changed files
with
358 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
sdk/sdk-common/src/orders/implementation/RefinanceParameters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { SerializationService } from '../../services/SerializationService' | ||
import { IRefinanceParameters } from '../interfaces' | ||
import { IPosition } from '../../common/interfaces/IPosition' | ||
import { IPercentage } from '../../common/interfaces/IPercentage' | ||
import { ILendingPool } from '../../protocols' | ||
|
||
/** | ||
* @name RefinanceParameters | ||
* @see IRefinanceParameters | ||
*/ | ||
export class RefinanceParameters implements IRefinanceParameters { | ||
readonly sourcePosition: IPosition | ||
readonly targetPool: ILendingPool | ||
readonly slippage: IPercentage | ||
|
||
/** Factory method */ | ||
static createFrom(params: IRefinanceParameters): RefinanceParameters { | ||
return new RefinanceParameters(params) | ||
} | ||
|
||
/** Sealed constructor */ | ||
private constructor(params: IRefinanceParameters) { | ||
this.sourcePosition = params.sourcePosition | ||
this.targetPool = params.targetPool | ||
this.slippage = params.slippage | ||
} | ||
|
||
toString(): string { | ||
return `Refinance Parameters (source: ${this.sourcePosition}, target: ${this.targetPool}, slippage: ${this.slippage})` | ||
} | ||
} | ||
|
||
SerializationService.registerClass(RefinanceParameters) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './PositionsManager' | ||
export * from './RefinanceParameters' |
Oops, something went wrong.