@compass-labs/widgets 0.1.44 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -465,6 +465,11 @@ interface EarnAccountProps {
|
|
|
465
465
|
* Pass an empty array to hide all fixed markets.
|
|
466
466
|
*/
|
|
467
467
|
allowedFixedMarkets?: string[];
|
|
468
|
+
/**
|
|
469
|
+
* Filter markets by underlying token symbol (e.g., ['USDC', 'USDT']).
|
|
470
|
+
* Case-insensitive. If undefined or empty, all markets are shown.
|
|
471
|
+
*/
|
|
472
|
+
tokenSymbols?: string[];
|
|
468
473
|
/**
|
|
469
474
|
* Lock the widget to a specific chain.
|
|
470
475
|
* When provided, the chain selector is hidden and the widget uses this chain.
|
|
@@ -478,7 +483,7 @@ interface EarnAccountProps {
|
|
|
478
483
|
/**
|
|
479
484
|
* EarnAccount widget - A beautiful banking-style USDC savings account.
|
|
480
485
|
*/
|
|
481
|
-
declare function EarnAccount({ showHeader, showInterestRate, showTopUpButton, compact, title, onDeposit, onWithdraw, defaultMarketTab, allowedVariableMarkets, allowedFixedMarkets, chain: chainProp, height, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
|
|
486
|
+
declare function EarnAccount({ showHeader, showInterestRate, showTopUpButton, compact, title, onDeposit, onWithdraw, defaultMarketTab, allowedVariableMarkets, allowedFixedMarkets, tokenSymbols, chain: chainProp, height, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
|
|
482
487
|
|
|
483
488
|
interface CreditAccountProps {
|
|
484
489
|
/** Custom title for the header @default "Credit Account" */
|
package/dist/index.d.ts
CHANGED
|
@@ -465,6 +465,11 @@ interface EarnAccountProps {
|
|
|
465
465
|
* Pass an empty array to hide all fixed markets.
|
|
466
466
|
*/
|
|
467
467
|
allowedFixedMarkets?: string[];
|
|
468
|
+
/**
|
|
469
|
+
* Filter markets by underlying token symbol (e.g., ['USDC', 'USDT']).
|
|
470
|
+
* Case-insensitive. If undefined or empty, all markets are shown.
|
|
471
|
+
*/
|
|
472
|
+
tokenSymbols?: string[];
|
|
468
473
|
/**
|
|
469
474
|
* Lock the widget to a specific chain.
|
|
470
475
|
* When provided, the chain selector is hidden and the widget uses this chain.
|
|
@@ -478,7 +483,7 @@ interface EarnAccountProps {
|
|
|
478
483
|
/**
|
|
479
484
|
* EarnAccount widget - A beautiful banking-style USDC savings account.
|
|
480
485
|
*/
|
|
481
|
-
declare function EarnAccount({ showHeader, showInterestRate, showTopUpButton, compact, title, onDeposit, onWithdraw, defaultMarketTab, allowedVariableMarkets, allowedFixedMarkets, chain: chainProp, height, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
|
|
486
|
+
declare function EarnAccount({ showHeader, showInterestRate, showTopUpButton, compact, title, onDeposit, onWithdraw, defaultMarketTab, allowedVariableMarkets, allowedFixedMarkets, tokenSymbols, chain: chainProp, height, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
|
|
482
487
|
|
|
483
488
|
interface CreditAccountProps {
|
|
484
489
|
/** Custom title for the header @default "Credit Account" */
|
package/dist/index.js
CHANGED
|
@@ -4962,6 +4962,7 @@ function EarnAccount({
|
|
|
4962
4962
|
defaultMarketTab = "variable",
|
|
4963
4963
|
allowedVariableMarkets,
|
|
4964
4964
|
allowedFixedMarkets,
|
|
4965
|
+
tokenSymbols,
|
|
4965
4966
|
chain: chainProp,
|
|
4966
4967
|
height = "600px"
|
|
4967
4968
|
}) {
|
|
@@ -5195,7 +5196,11 @@ function EarnAccount({
|
|
|
5195
5196
|
...pendleMarketsQuery.data || [],
|
|
5196
5197
|
...vaultsQuery.data || []
|
|
5197
5198
|
];
|
|
5198
|
-
const
|
|
5199
|
+
const tokenFilteredMarkets = tokenSymbols && tokenSymbols.length > 0 ? (() => {
|
|
5200
|
+
const allowed = new Set(tokenSymbols.map((s) => s.toUpperCase()));
|
|
5201
|
+
return allMarkets.filter((m) => allowed.has(m.underlyingToken.toUpperCase()));
|
|
5202
|
+
})() : allMarkets;
|
|
5203
|
+
const filteredTabMarkets = tokenFilteredMarkets.filter((m) => {
|
|
5199
5204
|
if (marketTab === "variable") {
|
|
5200
5205
|
if (m.type === "pendle") return false;
|
|
5201
5206
|
if (allowedVariableMarkets && !allowedVariableMarkets.includes(m.id)) return false;
|