-
Notifications
You must be signed in to change notification settings - Fork 411
Multichain lp #1810
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
base: release-90
Are you sure you want to change the base?
Multichain lp #1810
Conversation
✅ Deploy Preview for vigilant-albattani-df38ec ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Deploying gmx-interface with
|
| Latest commit: |
eec0d14
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cf8e7a23.gmx-interface.pages.dev |
| Branch Preview URL: | https://multichain-lp.gmx-interface.pages.dev |
bc422b7 to
7927495
Compare
… for ExpressEstimationInsufficientGasPaymentTokenBalanceError. Update BridgeOutModal to remove unused label and modify estimateExpressParams to throw error without message for improved clarity.
…introducing initial wrapped token address handling and updating amount calculations for initial long and short tokens. This improves accuracy in fee estimations for market token deposits and ensures proper handling of wrapped tokens.
…e UI interactions. Replace deprecated icons with updated SVGs, and implement a dropdown menu for deposit and withdrawal actions, improving user experience and accessibility in the pools details view.
…improve clarity. Update stargateTransferFees to return native fees and gas limits directly, enhancing consistency across fee estimation calculations for various token transfers.
| } | ||
|
|
||
| export function getOppositeCollateralFromConfig(marketConfig: MarketConfig, tokenAddress: string) { | ||
| return marketConfig.shortTokenAddress === tokenAddress |
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.
Should we check for getIsEquivalentTokens?
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.
based on usage, no
sdk/src/utils/markets.ts
Outdated
| } | ||
|
|
||
| export function isMarketTokenAddress(chainId: number, marketTokenAddress: string): boolean { | ||
| return Boolean(MARKETS[chainId]?.[marketTokenAddress]); |
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.
let's don't use MARKETS directly and it could be in configs file
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.
moved
sdk/src/utils/markets.ts
Outdated
| } | ||
|
|
||
| export function getMarketIndexTokenSymbol(chainId: number, marketTokenAddress: string): string { | ||
| const indexToken = getMarketIndexToken(chainId, marketTokenAddress); |
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.
redundant function, it could be just getIndexToken().symbol
sdk/src/utils/markets.ts
Outdated
| return indexToken.symbol; | ||
| } | ||
|
|
||
| export function getMarketLongTokenAddress(chainId: number, marketTokenAddress: string): string { |
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.
getTokenAddressByMarket(chain, market, 'long' | 'short' | 'index')
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.
donw
sdk/src/utils/markets.ts
Outdated
| return MARKETS[chainId][marketTokenAddress].shortTokenAddress; | ||
| } | ||
|
|
||
| export function getMarketLongToken(chainId: number, marketTokenAddress: string): Token { |
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.
getToken(getTokenByMarket())
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.
done
| "build:esm": "tsc -p tsconfig.esm.json && echo '{\"type\": \"module\"}' > build/esm/src/package.json", | ||
| "build:types": "tsc -p tsconfig.json --emitDeclarationOnly", | ||
| "build:subsquid": "./node_modules/@graphql-codegen/cli/cjs/bin.js -c subsquid-codegen.ts", | ||
| "build:subsquid": "./node_modules/@graphql-codegen/cli/cjs/bin.js -c subsquid-codegen.ts && npx prettier --write src/types/subsquid.ts", |
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.
👍
|
|
||
| const sourceChainBalancesForSelector: Partial<Record<AnyChainId | 0, bigint>> = | ||
| multichainMarketTokenBalances?.balances | ||
| ? mapValues( |
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.
Obect.entries().filter([balanceChainId] => Number(balanceChainId) != chainId).reduce(...)
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.
done
| ? mapValues( | ||
| pickBy(multichainMarketTokenBalances.balances, (data, chainIdStr) => { | ||
| const chainIdNum = Number(chainIdStr); | ||
| return data && chainIdNum !== chainId && chainIdNum !== 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.
balanceChainId
why !== 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.
to filter out gmx acc, replaced with GMX_ACCOUNT_PSEUDO_CHAIN_ID
| return { | ||
| token: glvOrMarketAddress as Address, | ||
| amount: bridgeOutAmount, | ||
| minAmountOut: 0n, |
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.
let's move outside component
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.
done
| return expressTransactionBuilder; | ||
| }, [account, bridgeOutChain, bridgeOutParams, chainId]); | ||
|
|
||
| const expressTxnParamsAsyncResult = useArbitraryRelayParamsAndPayload({ |
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.
seems not 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.
what do you mean ?
the type returned is
const expressTxnParamsAsyncResult: AsyncResult<ExpressTxnParams>
| ]); | ||
| } | ||
|
|
||
| return getTransferRequests([ |
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.
let's move outside of the component
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.
done
| } | ||
| }, [account, isVisibleOrView, setIsVisibleOrView]); | ||
|
|
||
| // TODO move this out of the abstract gmx account modal in container |
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.
Comment
| balance: walletBalance, | ||
| balanceUsd: walletBalanceUsd, | ||
| }, | ||
| [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.
why 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.
replaced with GMX_ACCOUNT_PSEUDO_CHAIN_ID
| ); | ||
| }); | ||
|
|
||
| it.skip("sepolia glv market buy", { timeout: 30_000 }, 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.
skipped test
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.
unskipped both in that file
…nd efficiency. Remove unused selectors for GLV and market tokens, and streamline logic for updating token inputs based on collateral types. Enhance withdrawal calculations to account for same collateral scenarios, ensuring accurate token amount handling during deposits and withdrawals.
…hain market token balances, improving balance checks for market tokens. Update logic to ensure only tokens with available balances are considered, enhancing accuracy in token option selection.
… state management. Replace dynamic toast ID generation with a constant identifier for better clarity and consistency. Clean up unused state variables and streamline effect dependencies for enhanced performance.
dc21d1d to
638a0b4
Compare
… to enhance multichain support. Update token handling in various components to utilize the new pseudo chain ID, improving balance management and user experience across the application.
638a0b4 to
13bd2f7
Compare
…o getTokenSymbolByMarket. Update related components to utilize the new function for improved clarity and maintainability in token symbol handling across the application.
…retaining the option for future reference.
… for insufficient token balances. Update localization files to include new error message format for various languages.
| [botanix.id]: http(), | ||
| [bsc.id]: http(), | ||
| }, | ||
| transports: [ |
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.
don't we have a mapping of supported chains -> viem chains to not edit this place when we support new chain?
Uh oh!
There was an error while loading. Please reload this page.