Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(DO NOT MERGE) Enable Memeooorr, Modius withdrawals #742

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 4 additions & 25 deletions frontend/components/YourWalletPage/WithdrawFunds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const afterWithdrawing =
'Your agent will not be able to run again until it is refunded.';

const getWithdrawMessage = (agentType: AgentType) => {
//predit
switch (agentType) {
case AgentType.PredictTrader:
return `This will withdraw all OLAS and XDAI from your account. ${afterWithdrawing}`;
Expand All @@ -42,11 +41,6 @@ const getWithdrawMessage = (agentType: AgentType) => {
}
};

const agentsWithWithdrawalsComingSoon: AgentType[] = [
AgentType.Modius,
AgentType.Memeooorr,
];

const ServiceNotRunning = () => (
<div className="mt-8">
<InfoCircleOutlined style={{ color: COLOR.TEXT_LIGHT }} />
Expand Down Expand Up @@ -78,11 +72,7 @@ const CompatibleMessage = () => (
);

export const WithdrawFunds = () => {
const {
selectedService,
refetch: refetchServices,
selectedAgentType,
} = useServices();
const { selectedService, refetch: refetchServices } = useServices();
const { refetch: refetchMasterWallets } = useMasterWalletContext();
const { updateBalances } = useBalanceContext();

Expand All @@ -102,11 +92,6 @@ export const WithdrawFunds = () => {
currentStakingContractInfo: selectedStakingContractDetails,
});

const isComingSoon = useMemo(
() => agentsWithWithdrawalsComingSoon.includes(selectedAgentType),
[selectedAgentType],
);

const showModal = useCallback(() => {
setIsModalVisible(true);
}, []);
Expand Down Expand Up @@ -175,28 +160,22 @@ export const WithdrawFunds = () => {
onClick={showModal}
block
size="large"
disabled={
!service || !isServiceStakedForMinimumDuration || isComingSoon
}
disabled={!service || !isServiceStakedForMinimumDuration}
>
Withdraw all funds
</Button>
),
[showModal, service, isServiceStakedForMinimumDuration, isComingSoon],
[showModal, service, isServiceStakedForMinimumDuration],
);

const withdrawAllTooltip = useMemo(() => {
if (isComingSoon) {
return 'Available soon!';
}

// countdown to withdrawal
if (!isServiceStakedForMinimumDuration) {
return `${minDurationMessage} ${countdownDisplay}`;
}

return null;
}, [countdownDisplay, isComingSoon, isServiceStakedForMinimumDuration]);
}, [countdownDisplay, isServiceStakedForMinimumDuration]);

const modalButtonText = useMemo(() => {
if (isWithdrawalLoading) return 'Loading';
Expand Down
2 changes: 1 addition & 1 deletion frontend/config/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const AGENT_CONFIG: {
'Autonomously posts to Twitter, creates and trades memecoins, and interacts with other agents. Agent is operating on Base chain.',
},
[AgentType.Modius]: {
isAgentEnabled: false,
isAgentEnabled: true,
isComingSoon: false,
requiresSetup: true,
name: 'Modius agent',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"start:frontend": "cd frontend && yarn start",
"test:frontend": "cd frontend && yarn test"
},
"version": "0.2.0-rc147",
"version": "0.2.0-rc156",
"engine": {
"node": ">=20",
"yarn": ">=1.22.0",
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tool.poetry]
name = "olas-operate-app"
version = "0.2.0-rc147"
name = "olas-operate-middleware"
version = "0.2.0-rc156"
description = ""
authors = ["David Vilela <[email protected]>", "Viraj Patel <[email protected]>"]
readme = "README.md"
Expand Down
Loading