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: publish order and sell and repay #101

Merged
merged 5 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 67 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Breaking Changes 0.15.0b1
# Breaking Changes 0.15.0b2

### Important

Expand All @@ -15,7 +15,7 @@ This document outlines the breaking changes introduced in our codebase for versi
- [Get Best Native Sale Offer](#get-best-native-sale-offer) deleted function
- [Buy](#buy) deleted function
- [Leverage Buy](#leverage-buy) deleted function
- [Leverage Sell](#leverage-sell) deleted function
- [Leverage Sell](#replace-leveragesell-with-sellandrepay) function renamed and args argument

---

Expand Down Expand Up @@ -75,11 +75,74 @@ The function `leverageBuy` was deleted

---

## Leverage Sell
## replace leverageSell With sellAndRepay

**Description:**

The function `leverageSell` was deleted (for now)
`leverageSell` was replaced with `sellAndRepay`. The function now expects a single argument `repaymentCalldata` which is the encoded structured data that the `repayLoan` fn expects

`borrowerSignature` must be calculated since `PurchaseBundler` will be the msg.sender of the transaction

```
struct LoanRepaymentData {
SignableRepaymentData data;
Loan loan;
bytes borrowerSignature;
}
```

Internal Types:

```
struct SignableRepaymentData {
uint256 loanId;
bytes callbackData;
bool shouldDelegate;
}

// For Loan type, check the loan version, for V2:
struct Loan {
address borrower;
uint256 nftCollateralTokenId;
address nftCollateralAddress;
address principalAddress;
uint256 principalAmount;
uint256 startTime;
uint256 duration;
Source[] source;
}

struct Source {
uint256 loanId;
address lender;
uint256 principalAmount;
uint256 accruedInterest;
uint256 startTime;
uint256 aprBps;
}

// For V3:
struct Loan {
address borrower;
uint256 nftCollateralTokenId;
address nftCollateralAddress;
address principalAddress;
uint256 principalAmount;
uint256 startTime;
uint256 duration;
Tranche[] tranche;
uint256 protocolFee;
}
struct Tranche {
uint256 loanId;
uint256 floor;
uint256 principalAmount;
address lender;
uint256 accruedInterest;
uint256 startTime;
uint256 aprBps;
}
```

---

Expand Down
1 change: 1 addition & 0 deletions docs/0.15.0b2/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
85 changes: 85 additions & 0 deletions docs/0.15.0b2/assets/highlight.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
:root {
--light-hl-0: #795E26;
--dark-hl-0: #DCDCAA;
--light-hl-1: #000000;
--dark-hl-1: #D4D4D4;
--light-hl-2: #A31515;
--dark-hl-2: #CE9178;
--light-hl-3: #0000FF;
--dark-hl-3: #569CD6;
--light-hl-4: #008000;
--dark-hl-4: #6A9955;
--light-hl-5: #AF00DB;
--dark-hl-5: #C586C0;
--light-hl-6: #001080;
--dark-hl-6: #9CDCFE;
--light-hl-7: #0070C1;
--dark-hl-7: #4FC1FF;
--light-hl-8: #098658;
--dark-hl-8: #B5CEA8;
--light-code-background: #FFFFFF;
--dark-code-background: #1E1E1E;
}

@media (prefers-color-scheme: light) { :root {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--hl-5: var(--light-hl-5);
--hl-6: var(--light-hl-6);
--hl-7: var(--light-hl-7);
--hl-8: var(--light-hl-8);
--code-background: var(--light-code-background);
} }

@media (prefers-color-scheme: dark) { :root {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--hl-5: var(--dark-hl-5);
--hl-6: var(--dark-hl-6);
--hl-7: var(--dark-hl-7);
--hl-8: var(--dark-hl-8);
--code-background: var(--dark-code-background);
} }

:root[data-theme='light'] {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--hl-5: var(--light-hl-5);
--hl-6: var(--light-hl-6);
--hl-7: var(--light-hl-7);
--hl-8: var(--light-hl-8);
--code-background: var(--light-code-background);
}

:root[data-theme='dark'] {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--hl-5: var(--dark-hl-5);
--hl-6: var(--dark-hl-6);
--hl-7: var(--dark-hl-7);
--hl-8: var(--dark-hl-8);
--code-background: var(--dark-code-background);
}

.hl-0 { color: var(--hl-0); }
.hl-1 { color: var(--hl-1); }
.hl-2 { color: var(--hl-2); }
.hl-3 { color: var(--hl-3); }
.hl-4 { color: var(--hl-4); }
.hl-5 { color: var(--hl-5); }
.hl-6 { color: var(--hl-6); }
.hl-7 { color: var(--hl-7); }
.hl-8 { color: var(--hl-8); }
pre, code { background: var(--code-background); }
58 changes: 58 additions & 0 deletions docs/0.15.0b2/assets/main.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/0.15.0b2/assets/search.js

Large diffs are not rendered by default.

Loading
Loading