From f215c8f28fc6dc1d86192d86358c628368f47f4b Mon Sep 17 00:00:00 2001 From: gidonkatten Date: Thu, 19 Sep 2024 14:26:02 +0100 Subject: [PATCH] feat: add addresses to fee data --- .changeset/nice-houses-flow.md | 5 +++++ src/chains/evm/hub/modules/folks-hub-pool.ts | 7 ++++++- src/chains/evm/hub/types/pool.ts | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/nice-houses-flow.md diff --git a/.changeset/nice-houses-flow.md b/.changeset/nice-houses-flow.md new file mode 100644 index 0000000..dc79200 --- /dev/null +++ b/.changeset/nice-houses-flow.md @@ -0,0 +1,5 @@ +--- +"@folks-finance/xchain-sdk": patch +--- + +add addresses to fee data diff --git a/src/chains/evm/hub/modules/folks-hub-pool.ts b/src/chains/evm/hub/modules/folks-hub-pool.ts index ec02c00..fc54d35 100644 --- a/src/chains/evm/hub/modules/folks-hub-pool.ts +++ b/src/chains/evm/hub/modules/folks-hub-pool.ts @@ -5,6 +5,7 @@ import { compoundEveryHour, compoundEverySecond } from "../../../../common/utils import { getHubTokenData } from "../utils/chain.js"; import { getHubPoolContract } from "../utils/contract.js"; +import type { EvmAddress, GenericAddress } from "../../../../common/types/address.js"; import type { NetworkType } from "../../../../common/types/chain.js"; import type { FolksTokenId } from "../../../../common/types/token.js"; import type { PoolInfo } from "../types/pool.js"; @@ -77,7 +78,8 @@ export async function getPoolInfo( allowFailure: false, }); - const { flashLoanFee, retentionRate, totalRetainedAmount } = feeData; + const { flashLoanFee, retentionRate, fTokenFeeRecipient, tokenFeeClaimer, totalRetainedAmount, tokenFeeRecipient } = + feeData; const { optimalUtilisationRatio, totalAmount: depositTotalAmount, @@ -117,6 +119,9 @@ export async function getPoolInfo( flashLoanFee: [BigInt(flashLoanFee), 6], retentionRate: [BigInt(retentionRate), 6], totalRetainedAmount, + fTokenFeeRecipient: fTokenFeeRecipient as EvmAddress, + tokenFeeClaimer: tokenFeeClaimer as EvmAddress, + tokenFeeRecipient: tokenFeeRecipient as GenericAddress, }, depositData: { optimalUtilisationRatio: [BigInt(optimalUtilisationRatio), 4], diff --git a/src/chains/evm/hub/types/pool.ts b/src/chains/evm/hub/types/pool.ts index 18b2df1..c369474 100644 --- a/src/chains/evm/hub/types/pool.ts +++ b/src/chains/evm/hub/types/pool.ts @@ -1,10 +1,14 @@ +import type { EvmAddress, GenericAddress } from "../../../../common/types/address.js"; import type { FolksTokenId } from "../../../../common/types/token.js"; import type { Dnum } from "dnum"; type FeeData = { flashLoanFee: Dnum; retentionRate: Dnum; + fTokenFeeRecipient: EvmAddress; + tokenFeeClaimer: EvmAddress; totalRetainedAmount: bigint; + tokenFeeRecipient: GenericAddress; }; type DepositData = {