Skip to content

Commit

Permalink
allow adjustable tips
Browse files Browse the repository at this point in the history
  • Loading branch information
0xodia committed Aug 22, 2024
1 parent 3cd8e9f commit 1d8a9c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion solend-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solendprotocol/solend-sdk",
"version": "0.13.0",
"version": "0.13.1",
"private": true,
"main": "src/index.ts",
"module": "src/index.ts",
Expand Down
20 changes: 10 additions & 10 deletions solend-sdk/src/core/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ import {

const SOL_PADDING_FOR_INTEREST = "1000000";

const MAPPING_2022 = {
"123": "321",
};

type SupportType =
| "wrap"
| "unwrap"
Expand Down Expand Up @@ -247,7 +243,7 @@ export class SolendActionCore {
this.depositReserves = depositReserves;
this.borrowReserves = borrowReserves;
this.lookupTableAccount = lookupTableAccount;
this.jitoTipAmount = tipAmount ?? 1000;
this.jitoTipAmount = tipAmount ?? 9000;
this.wallet = wallet;
this.repayInfo = repayInfo;
this.token2022Mint = token2022Mint;
Expand Down Expand Up @@ -407,7 +403,8 @@ export class SolendActionCore {
wallet: Wallet,
obligationAddress: PublicKey,
environment: EnvironmentType = "production",
lookupTableAddress?: PublicKey
lookupTableAddress?: PublicKey,
tipAmount?: number,
) {
const axn = await SolendActionCore.initialize(
pool,
Expand All @@ -420,7 +417,8 @@ export class SolendActionCore {
obligationAddress,
undefined,
undefined,
lookupTableAddress
lookupTableAddress,
tipAmount
);

await axn.addSupportIxs("forgive");
Expand All @@ -439,6 +437,7 @@ export class SolendActionCore {
obligationAddress?: PublicKey,
obligationSeed?: string,
lookupTableAddress?: PublicKey,
tipAmount?: number,
token2022Mint?: string
) {
const axn = await SolendActionCore.initialize(
Expand All @@ -453,7 +452,7 @@ export class SolendActionCore {
undefined,
obligationSeed,
lookupTableAddress,
undefined,
tipAmount,
undefined,
token2022Mint
);
Expand Down Expand Up @@ -597,7 +596,7 @@ export class SolendActionCore {
wallet: Wallet,
environment: EnvironmentType = "production",
lookupTableAddress?: PublicKey,
customObligationAddress?: PublicKey
customObligationAddress?: PublicKey,
) {
const axn = await SolendActionCore.initialize(
pool,
Expand Down Expand Up @@ -664,6 +663,7 @@ export class SolendActionCore {
environment: EnvironmentType = "production",
customObligationAddress?: PublicKey,
lookupTableAddress?: PublicKey,
tipAmount?: number,
token2022Mint?: string
) {
const axn = await SolendActionCore.initialize(
Expand All @@ -678,7 +678,7 @@ export class SolendActionCore {
undefined,
undefined,
lookupTableAddress,
undefined,
tipAmount,
undefined,
token2022Mint
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const withdrawObligationCollateralAndRedeemReserveLiquidity = (
Layout.uint64("collateralAmount"),
]);

console.log(new BN(collateralAmount).toString())
const data = Buffer.alloc(dataLayout.span);
dataLayout.encode(
{
Expand Down

0 comments on commit 1d8a9c9

Please sign in to comment.