Skip to content

Commit

Permalink
Merge pull request #134 from valory-xyz/tanya/contribute-links
Browse files Browse the repository at this point in the history
(operate) feat: update availableOn for contribute contracts
  • Loading branch information
Tanya-atatakai authored Nov 12, 2024
2 parents 91ec7be + d58649e commit 0d2f5d9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
15 changes: 15 additions & 0 deletions apps/operate/components/Contracts/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,21 @@ const STAKING_CONTRACT_DETAILS: Record<Address, StakingContractDetailsInfo> = {
minOperatingBalance: 135,
minOperatingBalanceToken: 'xDAI',
},
'0x00000000000000000000000095146adf659f455f300d7521b3b62a3b6c4aba1f': {
availableOn: 'contribute',
minOperatingBalance: 0,
minOperatingBalanceToken: 'ETH',
},
'0x0000000000000000000000002c8a5ac7b431ce04a037747519ba475884bce2fb': {
availableOn: 'contribute',
minOperatingBalance: 0,
minOperatingBalanceToken: 'ETH',
},
'0x000000000000000000000000708e511d5fcb3bd5a5d42f42aa9a69ec5b0ee2e8': {
availableOn: 'contribute',
minOperatingBalance: 0,
minOperatingBalanceToken: 'ETH',
},
};

const getApy = (
Expand Down
2 changes: 1 addition & 1 deletion apps/operate/components/Contracts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const columns: ColumnsType<StakingContract> = [
key: 'minOperatingBalance',
render: (_, contract) => {
const { minOperatingBalanceHint, minOperatingBalance, minOperatingBalanceToken } = contract;
if (!minOperatingBalance) return <Text>{NA}</Text>;
if (typeof minOperatingBalance !== 'number') return <Text>{NA}</Text>;

const value = `${minOperatingBalance} ${minOperatingBalanceToken}`;
if (!minOperatingBalanceHint) return <Text>{value}</Text>;
Expand Down
6 changes: 6 additions & 0 deletions apps/operate/components/RunAgentButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button, Flex } from 'antd';
import { BaseButtonProps } from 'antd/es/button/button';
import { NotificationOutlined } from '@ant-design/icons';
import Image from 'next/image';
import { StakingContract } from 'types';

Expand Down Expand Up @@ -27,6 +28,11 @@ const props = {
text: 'Quickstart',
href: 'https://github.com/valory-xyz/optimus-quickstart',
},
contribute: {
icon: <NotificationOutlined width={18} height={18} />,
text: 'Contribute',
href: 'https://contribute.olas.network/staking',
},
};
export const RunAgentButton = ({ availableOn, type = 'text', className }: RunAgentButtonProps) => {
if (availableOn === null)
Expand Down
2 changes: 1 addition & 1 deletion apps/operate/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type StakingContract = {
maxSlots: number;
apy: number;
stakeRequired: string;
availableOn: 'pearl' | 'quickstart' | 'optimusQuickstart' | null;
availableOn: 'pearl' | 'quickstart' | 'optimusQuickstart' | 'contribute' | null;
minOperatingBalance: number | null;
minOperatingBalanceToken: string | null;
minOperatingBalanceHint?: string;
Expand Down

0 comments on commit 0d2f5d9

Please sign in to comment.