-
Notifications
You must be signed in to change notification settings - Fork 2
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
frontend multi-chain multi-agent support #434
base: feat/multi-chain-support-middleware
Are you sure you want to change the base?
frontend multi-chain multi-agent support #434
Conversation
[ContractType.StakingActivity]: new MulticallContract( | ||
'0x7Fd1F4b764fA41d19fe3f63C85d12bf64d2bbf68', | ||
STAKING_TOKEN_PROXY_ABI, | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@truemiller need to move this to activityCheckers config
@@ -7,7 +7,7 @@ | |||
"@tanstack/react-query": "^5.29.0", | |||
"adm-zip": "^0.5.12", | |||
"antd": "^5.14.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a good time to update ant?
abstract getStakingRewardsInfo: Promise<unknown>; | ||
abstract getAvailableRewardsForEpoch: Promise<unknown>; | ||
abstract getStakingContractInfo: Promise<unknown>; | ||
abstract getStakingContractInfoByServiceIdStakingProgramId: Promise<unknown>; | ||
abstract getStakingContractInfoByStakingProgramId: Promise<unknown>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think “Details” would be more accurate than “Info”?
abstract getStakingRewardsInfo: Promise<unknown>; | |
abstract getAvailableRewardsForEpoch: Promise<unknown>; | |
abstract getStakingContractInfo: Promise<unknown>; | |
abstract getStakingContractInfoByServiceIdStakingProgramId: Promise<unknown>; | |
abstract getStakingContractInfoByStakingProgramId: Promise<unknown>; | |
abstract getStakingRewardsInfo: Promise<unknown>; | |
abstract getAvailableRewardsForEpoch: Promise<unknown>; | |
abstract getStakingContractDetails: Promise<unknown>; | |
abstract getStakingContractDetailsByServiceIdStakingProgramId: Promise<unknown>; | |
abstract getStakingContractDetailsByStakingProgramId: Promise<unknown>; |
]; | ||
|
||
const [ | ||
getOperatorBalanceReponse, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be just
getOperatorBalanceReponse, | |
operatorBalanceResponse, |
await OLAS_CONTRACTS[chainId][ContractType.Multicall3].all(contractCalls); | ||
|
||
const [bondValue, depositValue, serviceState] = [ | ||
parseFloat(ethers.utils.formatUnits(getOperatorBalanceReponse, 18)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we create a separate utility for formatting these values? That way, if we decide to migrate to “viem,” we only need to update that utility function.
type supportedFormatValues = string | bigint;
const formatToEth = (x: supportedFormatValues) => ethers.utils.formatUnits(x, 18);
* - depositValue | ||
* - serviceState | ||
*/ | ||
static getServiceRegistryInfo = async ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static getServiceRegistryInfo = async ( | |
static getServiceRegistryDetails = async ( |
static getAvailableRewardsForEpoch = async ( | ||
stakingProgramId: StakingProgramId, | ||
chainId: ChainId = ChainId.Gnosis, | ||
): Promise<number | undefined> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
): Promise<number | undefined> => { | |
): Promise<number> => { |
stakingTokenProxy.minStakingDeposit(), | ||
]; | ||
|
||
const multicallResponse = await multicallProvider.all(contractCalls); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, we can add type here for all multicallResponse
.
// if (!services?.[0]) return; | ||
// const serviceStatus = await ServicesService.getDeployment(services[0].hash); | ||
// setServiceStatuses(serviceStatus.status); | ||
// }, [services]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to keep them commented?
/** | ||
* @note This is a mapping of all native tokens on each chain. | ||
*/ | ||
export const NATIVE_TOKEN_CONFIG = Object.fromEntries( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this now 🤔.
currency: TokenSymbol.XDAI, | ||
middlewareChain: MiddlewareChainId.GNOSIS, | ||
rpc: process.env.GNOSIS_RPC as HttpUrl, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and below as well.
}; | |
} as const; |
refactor balance provider
…ent in BalanceProvider
… and improve balance loading logic
…or low balance specific to selected service
…agentnotrunningbutton refactor AgentNotRunningButton (useBalance consumer) + small changes to serviceTemplate, createService API, support multi-chain service templates and remove
…ce-section GasBalanceSection using service-specific balances, update Olas balance component, add safeWallets to useService
…stead of serviceStatus
…for wallet management
…roved wallet management
…elds Allow update metadata fields (description)
…dleware' into refactor/multi-chain-support-frontend
Co-authored-by: Mohan <[email protected]>
Release/v0.2.0 rc5
…to use selectedAgentConfig for balance calculations
…lance and MasterEoaSignerNativeBalance
release/v0.2.0-rc6
Fix/win env vars build
…middleware Allow multiple services on middleware (Major refactor)
fix zod schema for stakingRewardsDetails
Proposed changes
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that apply