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

frontend multi-chain multi-agent support #434

Draft
wants to merge 550 commits into
base: feat/multi-chain-support-middleware
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
550 commits
Select commit Hold shift + click to select a range
ba5ff06
Merge pull request #465 from valory-xyz/refactor/balance-provider-hooks
truemiller Nov 20, 2024
bfc988d
fix: remove merge conflict markers and clean up walletAddress assignm…
truemiller Nov 20, 2024
23f5c6d
feat: refactor GasBalanceSection to utilize service-specific balances…
truemiller Nov 20, 2024
dfa62b3
feat: update BalanceStatus component to accept serviceConfigId prop f…
truemiller Nov 20, 2024
9886961
fix: update BalanceStatus prop to use serviceConfigId for consistency
truemiller Nov 20, 2024
cbe5a0d
fix: rename balance loading state variable for clarity in OlasBalance…
truemiller Nov 20, 2024
fa40f18
Merge pull request #467 from valory-xyz/refactor/usebalance-consumer-…
truemiller Nov 20, 2024
e5073b4
Merge pull request #468 from valory-xyz/refactor/usebalance-gas-balan…
truemiller Nov 20, 2024
4b1f03b
fix: services types
truemiller Nov 20, 2024
06ca2d5
chore: not convinced this provider is needed
truemiller Nov 20, 2024
ea9c2e3
refactor: remove unused MasterSafeProvider from App component
truemiller Nov 20, 2024
708688d
refactor: update SystemNotificationTriggers to use selectedService in…
truemiller Nov 20, 2024
34e989b
refactor: wallet types, organize, add more
truemiller Nov 20, 2024
d164d9b
refactor: remove unused MasterSafeProvider component
truemiller Nov 20, 2024
2002704
refactor: add multisig query key for retrieving owners
truemiller Nov 20, 2024
41f157a
refactor: remove GnosisSafe service file
truemiller Nov 20, 2024
82f8963
refactor: update useMasterSafe hook to use react-query for fetching o…
truemiller Nov 20, 2024
f986a5a
refactor: replace useMasterSafe with useMultisig for more generic app…
truemiller Nov 20, 2024
42c4204
fix: replace add backup wallet alert
truemiller Nov 20, 2024
d22c91e
refactor: migrate from useMasterSafe to useMultisig for improved func…
truemiller Nov 20, 2024
64d4abb
refactor: rename WalletProvider to MasterWalletProvider for clarity
truemiller Nov 20, 2024
de7834c
refactor: update AgentNotRunningButton to use useMasterWalletContext …
truemiller Nov 20, 2024
8601847
refactor: update AddFundsSection to use useMasterWalletContext for wa…
truemiller Nov 20, 2024
0692f00
refactor: update AddBackupWalletViaSafePage to use masterSafe for imp…
truemiller Nov 20, 2024
2ad650a
refactor: debug section
truemiller Nov 20, 2024
f8d8a31
feat/simple backup owner update
jmoreira-valory Nov 20, 2024
bebc919
chore: import updates
truemiller Nov 20, 2024
5e7537c
chore: change eth balance threshold keys to ChainId
truemiller Nov 20, 2024
1b6dbfb
refactor: update BalanceProvider to use MasterWalletContext for walle…
truemiller Nov 20, 2024
47ffacf
refactor: change Wallet provider to MasterWallet provider (poor naming)
truemiller Nov 20, 2024
d8137eb
chore: delete WalletProvider
truemiller Nov 20, 2024
722c110
feat: chain name by chainId
truemiller Nov 20, 2024
76dd098
chore: remove unneeded destructure
truemiller Nov 20, 2024
8e1b388
chore: refactor import names
truemiller Nov 20, 2024
1aac95f
refactor: update MasterWalletProvider import path
truemiller Nov 20, 2024
9a9f145
feat: resolve errors to ensure the app runs (part 1) (#466)
mohandast52 Nov 20, 2024
cbafa62
refactor: move useAddress hook to backup and update import path
truemiller Nov 21, 2024
393b51e
feat: add useMultisigs hook to fetch owners from multiple multisigs
truemiller Nov 21, 2024
de0a55e
chore: comment out unused hooks and functions in useLogs for future r…
truemiller Nov 21, 2024
2cd0db3
feat: add masterEoa computation to useService hook for fetching EOA w…
truemiller Nov 21, 2024
907c8a6
feat: add functions to retrieve service templates from SERVICE_TEMPLATES
truemiller Nov 21, 2024
efcc19b
feat: add functions to retrieve native token symbol and ERC20 tokens …
truemiller Nov 21, 2024
dc7b25b
feat: add useMasterBalances hook to compute balances for master walle…
truemiller Nov 21, 2024
10b5da1
chore: update import statement for useLogs in HelpAndSupportPage comp…
truemiller Nov 21, 2024
9146e1b
chore: remove unused useLogs hook and related code
truemiller Nov 21, 2024
2e2b67e
chore: remove unused useServiceTemplates hook and related code; refac…
truemiller Nov 21, 2024
ca26658
Update frontend/hooks/useBalanceContext.ts
truemiller Nov 21, 2024
3c6b9d6
chore: lint fixes, export `masterWallets` to avoid confusion
truemiller Nov 21, 2024
095c640
fix: useService should only expect service wallets, not master safes/…
truemiller Nov 21, 2024
7b829d7
Merge pull request #471 from valory-xyz/refactor/review-all-contexts
truemiller Nov 21, 2024
ac35504
fix: update useMasterBalances to filter balances based on master safe…
truemiller Nov 21, 2024
3feb3d4
docs: add notes to useMasterBalances about master wallets and safes
truemiller Nov 21, 2024
7fb1c99
fix: add TODO comment for future refactor of serviceWallets logic
truemiller Nov 21, 2024
535a0a6
fix: rename masterSafes to serviceSafes for clarity in useService and…
truemiller Nov 21, 2024
88da4b1
fix: remove masterSafes alias in GasBalanceSection and useServiceBala…
truemiller Nov 21, 2024
8c9ca07
chore: lint fix
truemiller Nov 21, 2024
57d3f86
Merge remote-tracking branch 'origin/refactor/multi-chain-support-fro…
truemiller Nov 21, 2024
c3c01f2
Merge pull request #472 from valory-xyz/refactor/hooks
truemiller Nov 21, 2024
0f16cb8
fix: temporarily disable environment validation during refactor
truemiller Nov 21, 2024
3967b51
fix: enhance useServiceBalances to include service EOA and improve ba…
truemiller Nov 21, 2024
209fa1d
refactor: simplify balance calculations and add master EOA balances
truemiller Nov 21, 2024
a927426
feat: enhance OLAS balance calculations by integrating master and ser…
truemiller Nov 21, 2024
c5388ad
fix: remove unused masterStakedBalances from useMasterBalances function
truemiller Nov 21, 2024
30d0a8a
refactor: reorganize low balance calculations in useMasterBalances fo…
truemiller Nov 21, 2024
c64ecee
fix: comment out duplicate MainOlasBalance component in MainPage for …
truemiller Nov 21, 2024
2baf40c
fix: comment out GasBalanceSection in MainPage for clarity
truemiller Nov 21, 2024
079247f
Merge pull request #473 from valory-xyz/refactor/balances-feature
truemiller Nov 21, 2024
cd3aacb
feat: add agenttype to service templates
truemiller Nov 21, 2024
33a5097
feat: add mechType to GNOSIS staking programs configuration
truemiller Nov 21, 2024
699660b
feat: enhance useActiveStakingContractInfo with service staking state…
truemiller Nov 21, 2024
f38092b
feat: add ServiceStakingState enum to improve clarity of staking states
truemiller Nov 21, 2024
9b325dd
feat: refactor AgentButton and AgentNotRunningButton to use useActive…
truemiller Nov 21, 2024
2157686
refactor: finalize useNeedsFunds hook, update MainNeedsFunds
Tanya-atatakai Nov 21, 2024
038f35e
feat: rename ServiceStakingState to StakingState for consistency and …
truemiller Nov 21, 2024
9e4f2da
Merge pull request #475 from valory-xyz/refactor/agent-buttons
truemiller Nov 21, 2024
96cafe0
Merge pull request #476 from valory-xyz/tanya/needs-funds-main
Tanya-atatakai Nov 21, 2024
e4fd942
chore: bump autonomy
jmoreira-valory Nov 21, 2024
38c4127
feat: refactor SettingsPage to use master wallet context and improve …
truemiller Nov 21, 2024
f6c75d9
feat: refactor logging hooks by removing deprecated useLogs and intro…
truemiller Nov 21, 2024
e470a3a
Merge pull request #477 from valory-xyz/refactor/backup-wallet-settings
truemiller Nov 21, 2024
6454287
Merge remote-tracking branch 'origin/refactor/multi-chain-support-fro…
truemiller Nov 21, 2024
69601fc
feat: update safes multiple chains
jmoreira-valory Nov 21, 2024
7e1ba46
fix: linters
jmoreira-valory Nov 21, 2024
5c232ab
chore: update api
jmoreira-valory Nov 21, 2024
e6269ac
refactor: update YourWalletPage to use updated types, contexts, hooks
truemiller Nov 21, 2024
2af6dc1
refactor: specify type for masterEoaBalance in YourWalletPage component
truemiller Nov 21, 2024
2ae151a
fix: review comments
truemiller Nov 21, 2024
4c80e72
feat: refactor onboarding (#478)
mohandast52 Nov 21, 2024
023164b
refactor: add funds section
Tanya-atatakai Nov 22, 2024
f615fb5
refactor: remove commented code, add todo
Tanya-atatakai Nov 22, 2024
ae81ebd
feat: last transaction (#481)
mohandast52 Nov 22, 2024
34b0bbf
Merge pull request #483 from valory-xyz/tanya/add-funds
Tanya-atatakai Nov 22, 2024
39ec47f
Merge pull request #480 from valory-xyz/fix/your-wallet-page
truemiller Nov 22, 2024
84b260a
refactor: start refactoring useMigrate
Tanya-atatakai Nov 21, 2024
e1432df
refactor: fix useMigrate hook with agent type and balance calculation…
truemiller Nov 21, 2024
6e02571
refactor: update useMigrate and related components
Tanya-atatakai Nov 21, 2024
84838a2
refactor: main alerts and modals
Tanya-atatakai Nov 22, 2024
ff8d311
refactor: change agentSafe to masterSafe
Tanya-atatakai Nov 22, 2024
673458d
refactor: remove service check
Tanya-atatakai Nov 22, 2024
8a20583
Merge pull request #482 from valory-xyz/tanya/migration
Tanya-atatakai Nov 22, 2024
0b5b88c
Merge remote-tracking branch 'origin/refactor/multi-chain-support-fro…
truemiller Nov 22, 2024
7cf3170
refactor: enhance query enabling conditions in useMultisig hook
truemiller Nov 22, 2024
333d4d1
Update frontend/hooks/useLogs.ts
truemiller Nov 22, 2024
4360dd2
Update frontend/hooks/useLogs.ts
truemiller Nov 22, 2024
6a11b72
Merge pull request #479 from valory-xyz/fix/uselogs
truemiller Nov 22, 2024
9d194c4
feat: add middleware deployment status enums and refactor service hoo…
truemiller Nov 22, 2024
f729346
chore: remove TODO comment
truemiller Nov 22, 2024
7931a36
refactor: Staking rewards (main page) (#485)
mohandast52 Nov 22, 2024
7fa15f7
refactor: update AddBackupWalletViaSafePage to use context and handle…
truemiller Nov 22, 2024
2486f9d
Update frontend/client/enums.ts
truemiller Nov 22, 2024
a6b3c4c
Update frontend/hooks/useService.ts
truemiller Nov 22, 2024
eb7d8ce
refactor: enhance AddBackupWalletViaSafePage to utilize services and …
truemiller Nov 22, 2024
477ccec
Merge pull request #487 from valory-xyz/fix/use-notify-on-new-epoch
truemiller Nov 22, 2024
ca5b524
chore: update cli
jmoreira-valory Nov 22, 2024
d0c3058
doc: typo
jmoreira-valory Nov 22, 2024
228bfcd
chore: updates
jmoreira-valory Nov 22, 2024
8af9e30
refactor: integrate services into YourWalletPage and enhance token sy…
truemiller Nov 22, 2024
9b68d86
refactor: update comment formatting for accruedServiceStakingRewards …
truemiller Nov 22, 2024
a2d4ae2
refactor: Rewards History (#486)
mohandast52 Nov 22, 2024
8af742d
Merge pull request #488 from valory-xyz/fix/add-backup-wallet-safe-page
truemiller Nov 22, 2024
5283e18
refactor: enhance YourAgentWallet to include serviceSafeRewards and i…
truemiller Nov 22, 2024
daa1256
refactor: clean up unused comment for accruedServiceStakingRewards in…
truemiller Nov 22, 2024
8074c9d
fix: linters
jmoreira-valory Nov 22, 2024
12c331c
Merge pull request #470 from valory-xyz/feat/swap_owner_multi_chain
jmoreira-valory Nov 22, 2024
23d8990
refactor: bulk rename to remove "Optimus" from various files
truemiller Nov 22, 2024
e8f8a30
refactor: update appId from "optimus" to "operate-app" in build scripts
truemiller Nov 22, 2024
68785d5
refactor: update download_binaries.sh to use trader version instead o…
truemiller Nov 22, 2024
02d9b5d
refactor: debug section
Tanya-atatakai Nov 22, 2024
9141cf7
refactor: magic moment popup and few other components (#491)
mohandast52 Nov 22, 2024
04093cf
Merge pull request #492 from valory-xyz/chore/rename-to-pearl
truemiller Nov 22, 2024
4ea9941
Merge pull request #490 from valory-xyz/fix/your-agent
truemiller Nov 22, 2024
bc14382
Merge pull request #493 from valory-xyz/tanya/debug-window
Tanya-atatakai Nov 22, 2024
82b62e6
refactor: update staking program handling and improve logs mapping
truemiller Nov 22, 2024
33bb1af
Merge pull request #494 from valory-xyz/fix/errors-fixed-to-load-login
truemiller Nov 22, 2024
9b1be7a
Merge remote-tracking branch 'origin/feat/allow-multiple-services-mid…
truemiller Nov 22, 2024
1c395c3
fix: quick fixes
truemiller Nov 22, 2024
6831a66
feat: integrate master wallet context and update multisig address ret…
truemiller Nov 22, 2024
a86cdfd
feat: chain conversion helper
truemiller Nov 22, 2024
858dd47
chore: add enriched endpoint
jmoreira-valory Nov 22, 2024
8e29636
chore: doc
jmoreira-valory Nov 22, 2024
5842c86
refactor: rename parameter
jmoreira-valory Nov 22, 2024
ea8381f
chore: add all_chains_same_safe_address
jmoreira-valory Nov 22, 2024
741787d
chore: update
jmoreira-valory Nov 22, 2024
6c3e9d3
doc: fix doc
jmoreira-valory Nov 22, 2024
11c5ea4
fix: resolve all build errors
truemiller Nov 23, 2024
a3d9b0f
refactor: remove unused chain-related logic and clean up ServicesProv…
truemiller Nov 23, 2024
f4d47a6
fix: use ledger_type not chain
truemiller Nov 24, 2024
637bcc0
refactor: remove chain parameter from createEoa function
truemiller Nov 24, 2024
ce36f22
refactor: large fix
truemiller Nov 25, 2024
bb9b298
fix: further fixes for refactor
truemiller Nov 25, 2024
4f48bbe
refactor: update ServiceAndNftDetails to use serviceNftTokenId instea…
truemiller Nov 25, 2024
8efbaab
fix: lint
truemiller Nov 25, 2024
0dcfc2e
refactor: streamline RewardsHistory and Settings components for impro…
truemiller Nov 25, 2024
2e2ba2e
refactor: implement extractFunctionsFromAbi utility and update contra…
mohandast52 Nov 25, 2024
8605280
Merge pull request #498 from valory-xyz/fix/user-onboarding-path
truemiller Nov 25, 2024
457bf39
Merge pull request #495 from valory-xyz/chore/merge-latest-middleware
truemiller Nov 25, 2024
f444ba8
Merge pull request #500 from valory-xyz/mohan/errors-on-rewards
Tanya-atatakai Nov 25, 2024
8eaee8b
refactor: rename owner parameter to backup_owner in createSafe and ad…
truemiller Nov 25, 2024
3d03cf2
fix: backup wallets
truemiller Nov 25, 2024
1082651
refactor: clean up imports and simplify useMultisig hook usage in Add…
truemiller Nov 25, 2024
1e37db2
fix: add missing semicolon in AddBackupWalletViaSafePage component
truemiller Nov 25, 2024
a2cb7a0
refactor: needs funds and migrate sections
Tanya-atatakai Nov 25, 2024
b51e008
feat: return token balances
jmoreira-valory Nov 25, 2024
2f36d4c
chore: update api.md
jmoreira-valory Nov 25, 2024
cf68e3d
Merge pull request #496 from valory-xyz/feat/return_safe_owners
jmoreira-valory Nov 25, 2024
1fd4615
fix: correct method name and update parameters in setErc20Balance fun…
truemiller Nov 25, 2024
ad01baf
fix: update dotenv path resolution and adjust environment variable or…
truemiller Nov 25, 2024
34a52ec
feat: add service status fetching and update context for selected ser…
truemiller Nov 25, 2024
8928e65
Merge branch 'fix/backup-wallet-onboarding' into fix/service-statuses
truemiller Nov 25, 2024
3c4244f
chore: review fixes
Tanya-atatakai Nov 26, 2024
c4b7188
refactor: support creating service when switching contract after onbo…
Tanya-atatakai Nov 26, 2024
79d33d2
Update frontend/context/StakingProgramProvider.tsx
Tanya-atatakai Nov 26, 2024
f175b40
fix: refactor AgentButton to use selectedService's deployment status …
truemiller Nov 26, 2024
f3ece89
fix: template hash
truemiller Nov 26, 2024
554b39c
Update frontend/components/MainPage/sections/AlertSections/AddBackupW…
truemiller Nov 26, 2024
45d846b
Update frontend/components/MainPage/sections/AlertSections/AddBackupW…
truemiller Nov 26, 2024
587d0a1
fix: update lodash import to use isEmpty instead of isArray in AddBac…
truemiller Nov 26, 2024
05a22b9
Merge pull request #501 from valory-xyz/fix/backup-wallet-onboarding
truemiller Nov 26, 2024
2f8be05
Merge remote-tracking branch 'origin/refactor/multi-chain-support-fro…
truemiller Nov 26, 2024
aada92f
refactor: update staking program loading state
Tanya-atatakai Nov 26, 2024
54f3fa2
refactor: fix logs
Tanya-atatakai Nov 26, 2024
2b17774
chore: review fixes
Tanya-atatakai Nov 26, 2024
b608acb
Merge pull request #502 from valory-xyz/tanya/fixes
Tanya-atatakai Nov 26, 2024
11bfac3
Merge remote-tracking branch 'origin/refactor/multi-chain-support-fro…
truemiller Nov 26, 2024
778af62
fix: incorrect dependency
Tanya-atatakai Nov 26, 2024
9f35db3
Merge pull request #505 from valory-xyz/tanya/logs
Tanya-atatakai Nov 26, 2024
07935a7
fix: ensure service creation only occurs if it does not already exist
truemiller Nov 26, 2024
92dac1a
Merge remote-tracking branch 'origin/refactor/multi-chain-support-fro…
truemiller Nov 26, 2024
8bb1c65
fix: update release rpcs
truemiller Nov 26, 2024
bef7772
fix: has enough service slots
truemiller Nov 26, 2024
007e347
fix: progress on agent buttons, still glitchy
truemiller Nov 26, 2024
1dd5c80
fix: remove unused service hook and handle undefined serviceConfigId
truemiller Nov 26, 2024
7b57b6d
fix: update version to 0.2.0-rc1 in package.json and pyproject.toml
truemiller Nov 26, 2024
374a1d3
fix: refactor service configuration handling and improve type definit…
truemiller Nov 26, 2024
37bb16d
fix: add missing import for useMasterWalletContext in useMultisig hook
truemiller Nov 26, 2024
053c5e1
fix: add masterEoa to useMasterWalletContext and update backupOwners …
truemiller Nov 26, 2024
5a8c30e
fix: update version to 0.2.0-rc2 in package.json and pyproject.toml
truemiller Nov 26, 2024
9502847
fix: simplify release workflow by removing redundant environment vari…
truemiller Nov 26, 2024
fe9d889
fix: chain_config undefined errors
Tanya-atatakai Nov 27, 2024
4fe6a41
fix: safe creation multiple times, incorrect button state after onboa…
Tanya-atatakai Nov 27, 2024
4248503
chore: review fixes
Tanya-atatakai Nov 27, 2024
54eb359
fix: logs export
Tanya-atatakai Nov 27, 2024
741f5d4
refactor: update selectedService logic, fix floating numbers displayi…
Tanya-atatakai Nov 27, 2024
f026860
fix: streak infinite loading after onboarding
Tanya-atatakai Nov 28, 2024
8c30546
refactor: update refetch interval for rewards
Tanya-atatakai Nov 28, 2024
8724ecc
refactor: review fixes
Tanya-atatakai Nov 28, 2024
b389a4c
Merge pull request #508 from valory-xyz/tanya/fixes
Tanya-atatakai Nov 28, 2024
a337d5a
Merge pull request #504 from valory-xyz/fix/service-statuses
Tanya-atatakai Nov 28, 2024
435e8f4
chore: fix wallet migration
jmoreira-valory Nov 28, 2024
9191ba7
Merge remote-tracking branch 'origin/feat/allow-multiple-services-mid…
truemiller Nov 28, 2024
d0d15ad
fix: app fails to start (#514)
mohandast52 Nov 28, 2024
4c663b3
refactor: fix balances request
Tanya-atatakai Nov 28, 2024
e9808a4
Merge pull request #515 from valory-xyz/tanya/balance-fix
Tanya-atatakai Nov 28, 2024
2912a97
refactor: separate staking contract details and service info
Tanya-atatakai Nov 28, 2024
98c79a8
refactor: fix balance issues, review comments
Tanya-atatakai Nov 29, 2024
edb7acf
Merge pull request #517 from valory-xyz/tanya/fixes
Tanya-atatakai Nov 29, 2024
3a065fa
fix: wallet balances to include service wallets (#519)
Tanya-atatakai Nov 29, 2024
8a422c0
feat: add dynamic token swap link for selected EVM chain (#518)
mohandast52 Nov 29, 2024
8434828
feat: allow update metadata fields
jmoreira-valory Nov 29, 2024
d19585e
refactor: improve address validation and migration logic in staking c…
truemiller Nov 29, 2024
f194df5
chore: bump version to 0.2.0-rc5 in package.json and pyproject.toml
truemiller Nov 29, 2024
1debf31
refactor: remove redundant tendermint installation logic for Windows
truemiller Nov 29, 2024
7f5c44e
refactor: enhance type definitions for staking components and address…
truemiller Nov 29, 2024
5047f43
fix: missing getWallets response
truemiller Dec 1, 2024
6da9cc4
chore: add placeholder
jmoreira-valory Dec 1, 2024
5d478ee
fix: correct casing in Gnosis staking program contract addresses
truemiller Dec 2, 2024
be0e505
Merge pull request #522 from valory-xyz/feat/allow_update_metadata_fi…
OjusWiZard Dec 2, 2024
7fabab3
chore: revert getWallets change
truemiller Dec 2, 2024
492bec6
fix: replace 0xstring
truemiller Dec 2, 2024
fedc083
Merge remote-tracking branch 'origin/feat/allow-multiple-services-mid…
truemiller Dec 2, 2024
a2f8f12
Update frontend/context/StakingProgramProvider.tsx
truemiller Dec 2, 2024
b48280b
Merge pull request #525 from valory-xyz/release/v0.2.0-rc5
truemiller Dec 2, 2024
d02ab73
fix: migrate CannotMigrate logic
truemiller Dec 2, 2024
e73fe3f
fix: update MasterSafeNativeBalance and MasterEoaSignerNativeBalance …
truemiller Dec 2, 2024
93f38b7
fix: add TODO comments for multi-chain refactor in MasterSafeNativeBa…
truemiller Dec 2, 2024
c579838
fix: your wallet info breakdowns as per figma
truemiller Dec 2, 2024
ca2ecef
fix: staking history headers
truemiller Dec 2, 2024
c7a5dcc
fix: bump version to 0.2.0-rc6 in package.json and pyproject.toml
truemiller Dec 2, 2024
ca7deae
fix: replace Paragraph with Text in AgentRunningButton for better typ…
truemiller Dec 3, 2024
95d6ae3
chore: skeleton for async Earned tags
truemiller Dec 3, 2024
004c19b
Merge pull request #534 from valory-xyz/release/v0.2.0-rc6
truemiller Dec 4, 2024
c4b15dc
fix: bump version to 0.2.0-rc7 in package.json and pyproject.toml
truemiller Dec 5, 2024
3f18e5a
fix: remove truemiller-stack subproject reference
truemiller Dec 5, 2024
f05a500
fix: update build function to return promise and log results
truemiller Dec 5, 2024
e6ee5b0
win build: env fixes
solarw Dec 8, 2024
b63c99b
fix: enhance error handling and validation in staking rewards details
truemiller Dec 9, 2024
cdd08b4
Merge pull request #556 from valory-xyz/fix/win-env-vars-build
solarw Dec 9, 2024
ecaa225
doc: minor fixes
jmoreira-valory Dec 9, 2024
ffe432e
Merge pull request #428 from valory-xyz/feat/allow-multiple-services-…
truemiller Dec 9, 2024
95fbbe8
Merge pull request #557 from valory-xyz/fix/optimistic-rewards
truemiller Dec 9, 2024
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
6 changes: 6 additions & 0 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const os = require('os');
const next = require('next/dist/server/next');
const http = require('http');
const AdmZip = require('adm-zip');
const { validateEnv } = require('./utils/env-validation');

const { setupDarwin, setupUbuntu, setupWindows, Env } = require('./install');

Expand All @@ -25,6 +26,11 @@ const { logger } = require('./logger');
const { isDev } = require('./constants');
const { PearlTray } = require('./components/PearlTray');

// Validates environment variables required for Pearl
// kills the app/process if required environment variables are unavailable
// mostly RPC URLs and NODE_ENV
validateEnv();

// Attempt to acquire the single instance lock
const singleInstanceLock = app.requestSingleInstanceLock();
if (!singleInstanceLock) {
Expand Down
49 changes: 49 additions & 0 deletions electron/utils/env-validation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Validates environment variables
*/

require('dotenv').config();
const { z, ZodError } = require('zod');
const { app } = require('electron');

const nodeEnvRegex = new RegExp(/^(development|production)$/);

// Update z.object keys if env variable names change
const envSchema = z.object({
NODE_ENV: z
.string()
.regex(
nodeEnvRegex,
'Invalid NODE_ENV, must be `development` or `production`',
),
BASE_DEV_RPC: z.string().url('Invalid BASE_DEV_RPC must be a valid URL'),
ETHEREUM_DEV_RPC: z
.string()
.url('Invalid ETHEREUM_DEV_RPC_URL must be a valid URL'),
GNOSIS_DEV_RPC: z.string().url('Invalid GNOSIS_DEV_RPC must be a valid URL'),
OPTIMISM_DEV_RPC: z
.string()
.url('Invalid OPTIMISM_DEV_RPC must be a valid URL'),
});

const validateEnv = () => {
const { env } = process;
try {
envSchema.parse(env);
} catch (error) {
console.error(`Invalid environment variables in .env file`);
console.log(JSON.stringify(error, null, 2));

if (error instanceof ZodError) {
for (const issue of error.errors) {
console.error(issue.message);
}
} else {
console.error('An unexpected error occurred:', error);
}

app.quit();
}
};

module.exports = { validateEnv };
4 changes: 3 additions & 1 deletion frontend/abis/agentMech.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const AGENT_MECH_ABI = [
import { Abi } from '@/types/Abi';

export const AGENT_MECH_ABI: Abi = [
{
inputs: [
{ internalType: 'address', name: '_token', type: 'address' },
Expand Down
4 changes: 3 additions & 1 deletion frontend/abis/erc20.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const ERC20_BALANCEOF_FRAGMENT = [
import { Abi } from '@/types/Abi';

export const ERC20_BALANCEOF_STRING_FRAGMENT: Abi = [
'function balanceOf(address owner) view returns (uint256)',
];
4 changes: 3 additions & 1 deletion frontend/abis/gnosisSafe.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const GNOSIS_SAFE_ABI = [
import { Abi } from '@/types/Abi';

export const GNOSIS_SAFE_ABI: Abi = [
{ inputs: [], stateMutability: 'nonpayable', type: 'constructor' },
{
anonymous: false,
Expand Down
4 changes: 3 additions & 1 deletion frontend/abis/mechActivityChecker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const MECH_ACTIVITY_CHECKER_ABI = [
import { Abi } from '@/types/Abi';

export const MECH_ACTIVITY_CHECKER_ABI: Abi = [
{
inputs: [
{ internalType: 'address', name: '_agentMech', type: 'address' },
Expand Down
4 changes: 3 additions & 1 deletion frontend/abis/serviceRegistryL2.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const SERVICE_REGISTRY_L2_ABI = [
import { Abi } from '@/types/Abi';

export const SERVICE_REGISTRY_L2_ABI: Abi = [
{
inputs: [
{ internalType: 'string', name: '_name', type: 'string' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const SERVICE_STAKING_TOKEN_MECH_USAGE_ABI = [
import { JsonFragment } from '@ethersproject/abi';

export const STAKING_TOKEN_PROXY_ABI: JsonFragment[] = [
{
inputs: [],
name: 'AlreadyInitialized',
Expand Down
8 changes: 4 additions & 4 deletions frontend/client/enums.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export enum Action {
export enum MiddlewareAction {
STATUS = 0,
BUILD = 1,
DEPLOY = 2,
Expand All @@ -15,12 +15,12 @@ export enum MiddlewareChain {
MODE = 6,
}

export enum Ledger {
export enum MiddlewareLedger {
ETHEREUM = 0,
SOLANA = 1,
}

export enum DeploymentStatus {
export enum MiddlewareDeploymentStatus {
CREATED = 0,
BUILT = 1,
DEPLOYING = 2,
Expand All @@ -30,7 +30,7 @@ export enum DeploymentStatus {
DELETED = 6,
}

export enum AccountIsSetup {
export enum MiddlewareAccountIsSetup {
True,
False,
Loading,
Expand Down
14 changes: 9 additions & 5 deletions frontend/client/types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { StakingProgramId } from '@/enums/StakingProgram';
import { Address } from '@/types/Address';

import { DeploymentStatus, Ledger, MiddlewareChain } from './enums';
import {
MiddlewareChain,
MiddlewareDeploymentStatus,
MiddlewareLedger,
} from './enums';

export type ServiceHash = string;

export type LedgerConfig = {
rpc: string;
type: Ledger;
type: MiddlewareLedger;
chain: MiddlewareChain;
};

Expand Down Expand Up @@ -36,7 +40,7 @@ export type ChainData = {
};
};

export type Service = {
export type MiddlewareServiceResponse = {
name: string;
hash: string;
keys: ServiceKeys[];
Expand Down Expand Up @@ -84,7 +88,7 @@ export type DeployedNodes = {
};

export type Deployment = {
status: DeploymentStatus;
status: MiddlewareDeploymentStatus;
nodes: DeployedNodes;
};

Expand Down Expand Up @@ -128,7 +132,7 @@ export type AppInfo = {
export type WalletResponse = {
address: Address;
safe_chains: MiddlewareChain[];
ledger_type: Ledger;
ledger_type: MiddlewareLedger;
safes: {
[middlewareChainId in (typeof MiddlewareChain)[keyof typeof MiddlewareChain]]: Address;
};
Expand Down
1 change: 0 additions & 1 deletion frontend/components/MainPage/MainHeader/FirstRunModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { FC } from 'react';

import { MODAL_WIDTH } from '@/constants/width';
import { useServiceTemplates } from '@/hooks/useServiceTemplates';
import { getMinimumStakedAmountRequired } from '@/utils/service';

type FirstRunModalProps = { open: boolean; onClose: () => void };

Expand Down
34 changes: 16 additions & 18 deletions frontend/components/MainPage/header/AgentButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { InfoCircleOutlined } from '@ant-design/icons';
import { Button, ButtonProps, Flex, Popover, Tooltip, Typography } from 'antd';
import { useCallback, useMemo } from 'react';

import { DeploymentStatus, MiddlewareChain } from '@/client';
import { MiddlewareChain, MiddlewareDeploymentStatus } from '@/client';
import { COLOR } from '@/constants/colors';
import { DEFAULT_STAKING_PROGRAM_ID } from '@/context/StakingProgramProvider';
import { StakingProgramId } from '@/enums/StakingProgram';
Expand All @@ -18,7 +18,6 @@ import { useWallet } from '@/hooks/useWallet';
import { ServicesService } from '@/service/Services';
import { WalletService } from '@/service/Wallet';
import { delayInSeconds } from '@/utils/delay';
import { getMinimumStakedAmountRequired } from '@/utils/service';

import {
CannotStartAgentDueToUnexpectedError,
Expand Down Expand Up @@ -85,7 +84,7 @@ const AgentRunningButton = () => {
setIsServicePollingPaused(true);

// Optimistically update service status
setServiceStatus(DeploymentStatus.STOPPING);
setServiceStatus(MiddlewareDeploymentStatus.STOPPING);
try {
await ServicesService.stopDeployment(service.hash);
} catch (error) {
Expand Down Expand Up @@ -178,7 +177,7 @@ const AgentNotRunningButton = () => {
setIsStakingContractInfoPollingPaused(true);

// Mock "DEPLOYING" status (service polling will update this once resumed)
setServiceStatus(DeploymentStatus.DEPLOYING);
setServiceStatus(MiddlewareDeploymentStatus.DEPLOYING);

// Get the active staking program id; default id if there's no agent yet
const stakingProgramId: StakingProgramId =
Expand Down Expand Up @@ -206,7 +205,6 @@ const AgentNotRunningButton = () => {
serviceTemplate,
deploy: true,
useMechMarketplace: false,
// stakingProgramId === StakingProgramId.BetaMechMarketplace,
});
} catch (error) {
console.error(error);
Expand All @@ -227,7 +225,7 @@ const AgentNotRunningButton = () => {
}

// Can assume successful deployment
setServiceStatus(DeploymentStatus.DEPLOYED);
setServiceStatus(MiddlewareDeploymentStatus.DEPLOYED);

// TODO: remove this workaround, middleware should respond when agent is staked & confirmed running after `createService` call
await delayInSeconds(5);
Expand Down Expand Up @@ -265,15 +263,15 @@ const AgentNotRunningButton = () => {
// if the agent is NOT running and the balance is too low,
// user should not be able to start the agent
const isServiceInactive =
serviceStatus === DeploymentStatus.BUILT ||
serviceStatus === DeploymentStatus.STOPPED;
serviceStatus === MiddlewareDeploymentStatus.BUILT ||
serviceStatus === MiddlewareDeploymentStatus.STOPPED;
if (isServiceInactive && isLowBalance) {
return false;
}

if (serviceStatus === DeploymentStatus.DEPLOYED) return false;
if (serviceStatus === DeploymentStatus.DEPLOYING) return false;
if (serviceStatus === DeploymentStatus.STOPPING) return false;
if (serviceStatus === MiddlewareDeploymentStatus.DEPLOYED) return false;
if (serviceStatus === MiddlewareDeploymentStatus.DEPLOYING) return false;
if (serviceStatus === MiddlewareDeploymentStatus.STOPPING) return false;

if (!requiredOlas) return false;

Expand Down Expand Up @@ -324,15 +322,15 @@ export const AgentButton = () => {
return <Button type="primary" size="large" disabled loading />;
}

if (serviceStatus === DeploymentStatus.STOPPING) {
if (serviceStatus === MiddlewareDeploymentStatus.STOPPING) {
return <AgentStoppingButton />;
}

if (serviceStatus === DeploymentStatus.DEPLOYING) {
if (serviceStatus === MiddlewareDeploymentStatus.DEPLOYING) {
return <AgentStartingButton />;
}

if (serviceStatus === DeploymentStatus.DEPLOYED) {
if (serviceStatus === MiddlewareDeploymentStatus.DEPLOYED) {
return <AgentRunningButton />;
}

Expand All @@ -341,10 +339,10 @@ export const AgentButton = () => {

if (
!service ||
serviceStatus === DeploymentStatus.STOPPED ||
serviceStatus === DeploymentStatus.CREATED ||
serviceStatus === DeploymentStatus.BUILT ||
serviceStatus === DeploymentStatus.DELETED
serviceStatus === MiddlewareDeploymentStatus.STOPPED ||
serviceStatus === MiddlewareDeploymentStatus.CREATED ||
serviceStatus === MiddlewareDeploymentStatus.BUILT ||
serviceStatus === MiddlewareDeploymentStatus.DELETED
) {
return <AgentNotRunningButton />;
}
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/MainPage/header/AgentHead.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Badge } from 'antd';
import Image from 'next/image';

import { DeploymentStatus } from '@/client';
import { MiddlewareDeploymentStatus } from '@/client';
import { useReward } from '@/hooks/useReward';
import { useServices } from '@/hooks/useServices';

Expand Down Expand Up @@ -36,13 +36,13 @@ export const AgentHead = () => {
const { isEligibleForRewards } = useReward();

if (
serviceStatus === DeploymentStatus.DEPLOYING ||
serviceStatus === DeploymentStatus.STOPPING
serviceStatus === MiddlewareDeploymentStatus.DEPLOYING ||
serviceStatus === MiddlewareDeploymentStatus.STOPPING
) {
return <TransitionalAgentHead />;
}

if (serviceStatus === DeploymentStatus.DEPLOYED) {
if (serviceStatus === MiddlewareDeploymentStatus.DEPLOYED) {
// If the agent is eligible for rewards, agent is idle
return isEligibleForRewards ? <IdleAgentHead /> : <DeployedAgentHead />;
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/MainPage/header/constants.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { formatUnits } from 'ethers/lib/utils';

import { CHAINS } from '@/constants/chains';
import { CHAIN_CONFIG } from '@/config/chains';
import { SERVICE_TEMPLATES } from '@/constants/serviceTemplates';

export const requiredGas = Number(
formatUnits(
`${SERVICE_TEMPLATES[0].configurations[CHAINS.OPTIMISM.chainId].monthly_gas_estimate}`,
`${SERVICE_TEMPLATES[0].configurations[CHAIN_CONFIG.OPTIMISM.chainId].monthly_gas_estimate}`,
18,
),
);
8 changes: 4 additions & 4 deletions frontend/components/MainPage/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Flex } from 'antd';
import { useCallback, useEffect, useState } from 'react';

import { DeploymentStatus } from '@/client';
import { MiddlewareDeploymentStatus } from '@/client';
import { useBalance } from '@/hooks/useBalance';
import { useElectronApi } from '@/hooks/useElectronApi';
import { useServices } from '@/hooks/useServices';
Expand All @@ -18,11 +18,11 @@ const useSetupTrayIcon = () => {
useEffect(() => {
if (isLowBalance) {
setTrayIcon?.('low-gas');
} else if (serviceStatus === DeploymentStatus.DEPLOYED) {
} else if (serviceStatus === MiddlewareDeploymentStatus.DEPLOYED) {
setTrayIcon?.('running');
} else if (serviceStatus === DeploymentStatus.STOPPED) {
} else if (serviceStatus === MiddlewareDeploymentStatus.STOPPED) {
setTrayIcon?.('paused');
} else if (serviceStatus === DeploymentStatus.BUILT) {
} else if (serviceStatus === MiddlewareDeploymentStatus.BUILT) {
setTrayIcon?.('logged-out');
}
}, [isLowBalance, serviceStatus, setTrayIcon]);
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/MainPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { QuestionCircleOutlined, SettingOutlined } from '@ant-design/icons';
import { Button, Card, Flex } from 'antd';
import { useEffect } from 'react';

import { Pages } from '@/enums/PageState';
import { Pages } from '@/enums/Pages';
// import { StakingProgramId } from '@/enums/StakingProgram';
import { useBalance } from '@/hooks/useBalance';
// import { useMasterSafe } from '@/hooks/useMasterSafe';
Expand Down
1 change: 0 additions & 1 deletion frontend/components/MainPage/modals/FirstRunModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { FC } from 'react';

import { MODAL_WIDTH } from '@/constants/width';
import { useServiceTemplates } from '@/hooks/useServiceTemplates';
import { getMinimumStakedAmountRequired } from '@/utils/service';

const { Title, Paragraph } = Typography;

Expand Down
Loading
Loading