diff --git a/.changeset/shy-shrimps-clean.md b/.changeset/shy-shrimps-clean.md new file mode 100644 index 0000000..61d06bb --- /dev/null +++ b/.changeset/shy-shrimps-clean.md @@ -0,0 +1,5 @@ +--- +"@mangrovedao/mgv": patch +--- + +Added logic inside of the overlying in `GetBalanceResult` diff --git a/src/actions/balances.ts b/src/actions/balances.ts index 500bbac..2a241ff 100644 --- a/src/actions/balances.ts +++ b/src/actions/balances.ts @@ -10,7 +10,6 @@ import { multicall } from 'viem/actions' import type { Logic, OverlyingResponse } from '../addresses/logics/utils.js' import type { Token } from '../addresses/tokens/utils.js' import type { MarketParams } from '../types/actions/index.js' -import type { Prettify } from '../types/lib.js' import { getAction } from '../utils/getAction.js' /** @@ -29,14 +28,18 @@ export type GetBalancesArgs = GetBalancesParams & Omit -type ExtendedOverlyingResponse = Prettify - export type GetBalanceResult = { tokens: { token: Token balance: bigint }[] - overlying: ExtendedOverlyingResponse[] + overlying: { + type: 'erc20' | 'erc721' + overlying: Address + available: boolean + token: Token + logic: TLogics[number] + }[] logicBalances: { token: Token logic: TLogics[number] @@ -117,7 +120,7 @@ export async function getBalances( overlying: zeroAddress, available: false, } - return { token, ...overlying } + return { token, logic, ...overlying } }), )