Skip to content

Commit d3130b5

Browse files
committed
Merge branch 'staging-beta' into songbird-release
2 parents 1d5b3d8 + d00a326 commit d3130b5

File tree

18 files changed

+230
-196
lines changed

18 files changed

+230
-196
lines changed

src/api/agent.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import {
2020
IVaultCollateral,
2121
IOwnerUnderlyingBalance,
2222
IOwnerFassetBalance,
23-
IRedemptionQueueData
23+
IRedemptionQueueData,
24+
IOtherBot
2425
} from "@/types";
2526
import { orderBy } from "lodash";
2627

@@ -43,7 +44,8 @@ const AGENT_KEY = {
4344
UNDERLYING_ADDRESSES: 'agent.underlyingAddresses',
4445
OWNER_UNDERLYING_BALANCE: 'agent.ownerUnderlyingBalance',
4546
OWNER_FASSET_BALANCE: 'agent.ownerFassetBalance',
46-
REDEMPTION_QUEUE_DATA: 'agent.redemptionQueueData'
47+
REDEMPTION_QUEUE_DATA: 'agent.redemptionQueueData',
48+
OTHER_BOTS: 'agent.otherBots'
4749
}
4850

4951
export function useWorkAddress(enabled: boolean = true) {
@@ -389,3 +391,15 @@ export function useRedemptionQueueData(enabled: boolean = true) {
389391
enabled: enabled
390392
})
391393
}
394+
395+
export function useOtherBots(enabled: boolean = true) {
396+
return useQuery({
397+
queryKey: [AGENT_KEY.OTHER_BOTS],
398+
queryFn: async () => {
399+
const response = await apiClient.get(`${resource}/otherBots`);
400+
return response.data.data as IOtherBot[];
401+
},
402+
enabled: enabled
403+
})
404+
}
405+

src/api/agentVault.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const AGENT_VAULT_KEY = {
2424
AMOUNT_FOR_SELF_MINT_FREE_UNDERLYING: 'agentVault.amountForSelfMintFreeUnderlying',
2525
TRANSFERABLE_CV_DATA: 'agentVault.transferableCvData',
2626
REQUESTABLE_CV_DATA: 'agentVault.requestableCvData',
27-
CV_FEE: 'agentVault.cvFee'
2827
}
2928

3029
export function useDepositCollateral() {
@@ -240,16 +239,6 @@ export function useRequestWithdrawalFromCv() {
240239
})
241240
}
242241

243-
export function useCvFee(fAssetSymbol: string, agentVaultAddress: string, amount: number, enabled: boolean = true) {
244-
return useQuery({
245-
queryKey: [AGENT_VAULT_KEY.REQUESTABLE_CV_DATA, fAssetSymbol, agentVaultAddress, amount],
246-
queryFn: async() => {
247-
const response = await apiClient.get(`${resource}/getCVFee/${fAssetSymbol}/${agentVaultAddress}/${amount}`);
248-
return response.data.data as ICvFee;
249-
},
250-
enabled: enabled
251-
})
252-
}
253242

254243
export function useCancelTransferToCoreVault() {
255244
return useMutation({

src/components/cards/AgentBotsCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ export default function AgentBotsCard({ className, balances}: IAgentBotsCard) {
8888
<span className="status-dot mr-2"
8989
style={{backgroundColor: textColorStatus}}></span>
9090
<span style={{color: textColorStatus}}>
91-
{t(`agent_bots_card.table.agent_${botStatus.data ? 'live' : 'offline'}_label`)}
92-
</span>
91+
{t(`agent_bots_card.table.agent_${botStatus.data ? 'live' : 'offline'}_label`)}
92+
</span>
9393
</div>
9494
</Badge>
9595
</div>
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import { Badge, Loader, Paper, Table } from "@mantine/core";
2+
import { useTranslation } from "react-i18next";
3+
import { truncateString } from "@/utils";
4+
import CopyIcon from "@/components/icons/CopyIcon";
5+
import { IOtherBot } from "@/types";
6+
7+
interface IOtherBotsCard {
8+
className?: string;
9+
otherBots: IOtherBot[];
10+
}
11+
12+
export default function OtherBotsCard({ otherBots, className }: IOtherBotsCard) {
13+
const { t } = useTranslation();
14+
15+
const tokenColumns: string[] = otherBots[0]
16+
? otherBots[0].balances.map(balance => balance.symbol)
17+
: [];
18+
19+
return (
20+
<Paper
21+
className={`${className}`}
22+
withBorder
23+
>
24+
<Table.ScrollContainer minWidth={470}>
25+
<Table
26+
verticalSpacing="md"
27+
>
28+
<Table.Thead>
29+
<Table.Tr>
30+
<Table.Th className="uppercase">#</Table.Th>
31+
<Table.Th className="uppercase">{t('other_bots_card.table.type_label')}</Table.Th>
32+
<Table.Th className="uppercase">{t('other_bots_card.table.status_label')}</Table.Th>
33+
<Table.Th className="uppercase">{t('other_bots_card.table.working_address_label')}</Table.Th>
34+
{tokenColumns.map(column => (
35+
<Table.Th
36+
key={column}
37+
className="uppercase"
38+
>
39+
{column}
40+
</Table.Th>
41+
))}
42+
</Table.Tr>
43+
</Table.Thead>
44+
<Table.Tbody>
45+
{otherBots.map(((bot, index) => (
46+
<Table.Tr key={index}>
47+
<Table.Td>
48+
{index + 1}
49+
</Table.Td>
50+
<Table.Td>
51+
{bot.type}
52+
</Table.Td>
53+
<Table.Td>
54+
<div className="flex items-center mb-1">
55+
<Badge
56+
variant="outline"
57+
color={bot.status ? 'var(--green-default)' : 'var(--dark-red-default)'}
58+
radius="xs"
59+
className={`font-normal`}
60+
>
61+
<div className="flex items-center">
62+
<span
63+
className="status-dot mr-2"
64+
style={{
65+
backgroundColor: bot.status ? 'var(--green-default)' : 'var(--dark-red-default)'
66+
}}
67+
/>
68+
<span style={{color: bot.status ? 'var(--green-default)' : 'var(--dark-red-default)'}}>
69+
{t(`other_bots_card.table.agent_${bot.status ? 'live' : 'offline'}_label`)}
70+
</span>
71+
</div>
72+
</Badge>
73+
</div>
74+
</Table.Td>
75+
<Table.Td>
76+
<div className="flex items-center">
77+
{truncateString(bot.address ?? '', 5, 5)}
78+
<CopyIcon
79+
text={bot.address ?? ''}
80+
/>
81+
</div>
82+
</Table.Td>
83+
{bot.balances.map(balance => (
84+
<Table.Td key={balance.symbol}>
85+
{balance.balance}
86+
</Table.Td>
87+
))}
88+
</Table.Tr>
89+
)))}
90+
</Table.Tbody>
91+
</Table>
92+
</Table.ScrollContainer>
93+
</Paper>
94+
);
95+
}

src/components/cards/VaultsCard.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ export default function VaultsCard({ className, collateral }: IVaultsCard) {
131131
height="26"
132132
className="mr-1 self-center shrink-0"
133133
/>
134-
135134
},
136135
{
137136
id: 'address',
@@ -388,20 +387,6 @@ export default function VaultsCard({ className, collateral }: IVaultsCard) {
388387
);
389388
}
390389
},
391-
{
392-
id: 'handshakeType',
393-
label: t('vaults_card.table.handshake_label'),
394-
sorted: true,
395-
render: (vault: IVault) => {
396-
return (
397-
<Text
398-
size="sm"
399-
>
400-
{vault.handshakeType === 0 ? t('vaults_card.no_label') : t('vaults_card.yes_label')}
401-
</Text>
402-
);
403-
}
404-
},
405390
{
406391
id: 'delegationPercentage',
407392
label: t('vaults_card.table.delegated_label'),

src/components/elements/CurrencyIcon.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import React from "react";
22
import CflrIcon from "@/components/icons/CflrIcon";
33
import UsdtIcon from "@/components/icons/UsdtIcon";
4+
import Usdt0Icon from "@/components/icons/Usdt0Icon";
45
import UsdcIcon from "@/components/icons/UsdcIcon";
56
import EthIcon from "@/components/icons/EthIcon";
67
import FTestDogeIcon from "@/components/icons/FTestDogeIcon";
78
import FTestXrpIcon from "@/components/icons/FTestXrpIcon";
89
import FTestBtcIcon from "@/components/icons/FTestBtcIcon";
910
import SgbIcon from "@/components/icons/SgbIcon";
11+
import C2FlrIcon from "@/components/icons/C2FlrIcon";
1012

1113
export default function CurrencyIcon({ currency, width = '40', height = '40', className }: { currency: string, width?: string, height?: string, className?: string, style?: any }) {
1214
if (!currency) {
@@ -15,13 +17,17 @@ export default function CurrencyIcon({ currency, width = '40', height = '40', cl
1517

1618
switch (currency.toLowerCase()) {
1719
case 'testusdt':
18-
return <UsdtIcon width={width} height={height} className={className} />;
20+
return process.env.NATIVE_TOKEN === 'CFLR'
21+
? <UsdtIcon width={width} height={height} className={className} />
22+
: <Usdt0Icon width={width} height={height} className={className} />;
1923
case 'testusdc':
2024
return <UsdcIcon width={width} height={height} className={className} />;
2125
case 'testeth':
2226
return <EthIcon width={width} height={height} className={className} />;
2327
case 'cflr':
2428
return <CflrIcon width={width} height={height} className={className} />;
29+
case 'c2flr':
30+
return <C2FlrIcon width={width} height={height} className={className} />;
2531
case 'ftestxrp':
2632
return <FTestXrpIcon width={width} height={height} className={className} />;
2733
case 'ftestbtc':

0 commit comments

Comments
 (0)