Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jellyfish-api-core): listVaultHistory RPC #834

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
52 changes: 52 additions & 0 deletions docs/node/CATEGORIES/16-loan.md
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ interface HighestBid {
owner: string
}
```

## listAuctionHistory

Returns information about auction history.
Expand All @@ -728,4 +729,55 @@ interface ListAuctionHistoryDetail {
auctionBid: string
auctionWon: string[]
}
```

## listVaultHistory

Returns the history of the specified vault.

```ts title="client.loan.listVaultHistory()"
interface loan {
listVaultHistory (vaultId: string, pagination?: ListVaultHistoryPagination): Promise<ListVaultHistory[]>
}

interface ListVaultHistoryPagination {
maxBlockHeight?: number
depth?: number
token?: string
txType?: string
limit?: number
}

interface ListVaultHistory {
blockHeight: number
blockHash: string
blockTime: number
type: string
txid: string
address?: string,
amounts?: string[], // amount@symbol
loanScheme?: CreateLoanScheme
vaultSnapshot?: VaultHistorySnapshot
}

interface CreateLoanScheme {
minColRatio: number
Copy link
Contributor Author

@jingyi2811 jingyi2811 Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ side return this as ratio. Need to tell them to use minColRatio like how other RPC does

interestRate: BigNumber
Copy link
Contributor Author

@jingyi2811 jingyi2811 Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ side return this as rate. Need to tell them to use interestRate like how other RPC does

Copy link
Contributor Author

@jingyi2811 jingyi2811 Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interestRate currently is a whole number. Need to tell C++ side to change to the number with 8 decimal places.

id: string
}

interface VaultHistorySnapshot {
state: 'inLiquidation' | 'active'
collateralAmounts: string[], // amount@symbol
collateralValue: number,
collateralRatio: number,
batches?: VaultLiquidationBatch[]
}

interface VaultLiquidationBatch {
index: number
collaterals: string[]
loan: string
highestBid?: HighestBid
}
```
Loading