diff --git a/solend-sdk/package.json b/solend-sdk/package.json index 9d7bb2b4..dec183b0 100644 --- a/solend-sdk/package.json +++ b/solend-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@solendprotocol/solend-sdk", - "version": "0.13.38", + "version": "0.13.39", "private": true, "main": "src/index.ts", "module": "src/index.ts", diff --git a/solend-sdk/src/core/actions.ts b/solend-sdk/src/core/actions.ts index a9423286..0bdd43c2 100644 --- a/solend-sdk/src/core/actions.ts +++ b/solend-sdk/src/core/actions.ts @@ -98,6 +98,7 @@ type ActionConfigType = { type SupportType = | "wrap" | "unwrap" + | "refreshReserve" | "refreshReserves" | "refreshObligation" | "createObligation" @@ -121,7 +122,7 @@ const ACTION_SUPPORT_REQUIREMENTS: { ], repay: ["wsol", "wrap"], mint: ["wsol", "wrap", "cAta"], - redeem: ["wsol", "ata", "refreshReserves", "unwrap"], + redeem: ["wsol", "ata", "refreshReserve", "unwrap"], depositCollateral: ["createObligation"], withdrawCollateral: ["cAta", "refreshReserves", "refreshObligation"], forgive: ["refreshReserves", "refreshObligation"], @@ -1157,6 +1158,9 @@ export class SolendActionCore { await this.addUnwrapIx(); } break; + case "refreshReserve": + await this.addRefreshReservesIxs(true); + break; case "refreshReserves": await this.addRefreshReservesIxs(); break; @@ -1468,7 +1472,7 @@ export class SolendActionCore { } } - private async addRefreshReservesIxs() { + private async addRefreshReservesIxs(singleReserve?: boolean) { // Union of addresses const reserveMap = this.pool.reserves.reduce((acc, reserve) => { acc[reserve.address] = reserve; @@ -1476,7 +1480,7 @@ export class SolendActionCore { }, {} as Record); const allReserveAddresses = Array.from( - new Set([ + new Set(singleReserve ? [this.reserve.address] : [ ...this.depositReserves.map((e) => e.toBase58()), ...this.borrowReserves.map((e) => e.toBase58()), this.reserve.address, diff --git a/solend-sdk/src/core/types.ts b/solend-sdk/src/core/types.ts index 6d7d4f54..1f809e07 100644 --- a/solend-sdk/src/core/types.ts +++ b/solend-sdk/src/core/types.ts @@ -23,6 +23,7 @@ export type TokenMetadata = { symbol: string; logoUri: string | undefined; decimals: number; + underlyingToken?: string; }; }; @@ -41,6 +42,7 @@ export type WalletAssetType = { decimals: number; address: string; logo?: string; + underlyingToken?: string; }; export type WalletType = Array; diff --git a/solend-sdk/src/core/utils/wallet.ts b/solend-sdk/src/core/utils/wallet.ts index 5bb8b103..bd581b0b 100644 --- a/solend-sdk/src/core/utils/wallet.ts +++ b/solend-sdk/src/core/utils/wallet.ts @@ -38,6 +38,7 @@ export function formatWalletAssets( ? `w${nativeTokenSymbol}` : mintAddress, logoUri: tokenMetadata?.logoUri, + underlyingToken: tokenMetadata?.underlyingToken, }; }) .filter(Boolean) as WalletType;