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

feat: enable memo field on transfers of token #613

Merged
merged 9 commits into from
May 30, 2024

Conversation

moo-onthelawn
Copy link
Contributor

@moo-onthelawn moo-onthelawn commented May 30, 2024

dependent on dydxprotocol/v4-abacus#401. On hold until that gets merged.

flagged behind showMemoTransferField, true everywhere except mainnet

Screenshot 2024-05-30 at 3 38 00 PM

Views

  • TransferForm.ts
    • Behind flag, show a user inputtable memo field when transferring chain token

Functions

  • lib/testFlags.ts
    • flag showing the memo field

Hooks

  • hooks/useSubaccount
    • Update transfer to take in optional memo field, and pass it through to transferNativeToken

Testing

  • Tested locally on testnet by checking memo field on mintscan of transfer transaction
Without Memo field With Memo field
Screenshot 2024-05-30 at 3 47 25 PM Screenshot 2024-05-30 at 3 32 32 PM

Copy link

vercel bot commented May 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
v4-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2024 11:20pm
v4-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2024 11:20pm

Copy link

linear bot commented May 30, 2024

OTE-368 memo UI

const isUSDCSelected = asset === DydxChainAsset.USDC;
const amount = isUSDCSelected ? size?.usdcSize : size?.size;
const showNotEnoughGasWarning = fee && isUSDCSelected && usdcBalance < fee;
const showMemoField = showMemoTransferField && isChainTokenSelected;
const showMemoEmptyWarning = showMemoField && (!memo || memo === '');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mega nit: '' should be falsy, so !memo is enough I think

const isUSDCSelected = asset === DydxChainAsset.USDC;
const amount = isUSDCSelected ? size?.usdcSize : size?.size;
const showNotEnoughGasWarning = fee && isUSDCSelected && usdcBalance < fee;
const showMemoField = showMemoTransferField && isChainTokenSelected;
const showMemoEmptyWarning = showMemoField && !memo;
Copy link
Contributor

@aforaleka aforaleka May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is there a way to only show this after address/amount is filled? i think there were previous complaints when we just say address is invalid when no address has been filled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh hm yeah i can def make edits to do that!

@moo-onthelawn moo-onthelawn merged commit c3db2c5 into main May 30, 2024
6 checks passed
@moo-onthelawn moo-onthelawn deleted the mulan/ote-368-memo-ui branch May 30, 2024 23:29
DavideSegullo added a commit to nabla-studio/v4-web that referenced this pull request Jun 28, 2024
chore: show all markets w/o pagination on market page (dydxprotocol#573)

chore: run auto fix on /views/forms (dydxprotocol#561)

fix: clear inputs on close position click to avoid subsequent place orders (dydxprotocol#577)

chore: make trade form footer not sticky depending on screen height + table column header nits (dydxprotocol#576)

chore: enable traders to cancel "BEST_EFFORT_CANCELED" stateful orders (dydxprotocol#574)

chore: move rewards history start date into env feature flag (dydxprotocol#578)

chore: finish fixing lint errors in /views (dydxprotocol#562)

chore: eslint everywhere else (dydxprotocol#567)

chore: remove all other index files with exports (dydxprotocol#571)

chore: pnpm cleanup tasks: prune, dedupe (dydxprotocol#575)

chore: remove unused types, exports, variables, functions, etc (dydxprotocol#579)

chore: add lint to pr actions (dydxprotocol#586)

fix: Update mintscanBase and add android force update test data (dydxprotocol#583)

fix: type check records correctly (dydxprotocol#589)

chore(incentives): Update notification for incentives season 5 (dydxprotocol#590)

chore: create historical rewards chart (dydxprotocol#591)

chore: properly type more style mixins (dydxprotocol#595)

chore: upgrade react query to v5 (dydxprotocol#568)

Co-authored-by: aleka <[email protected]>

feat: add W metadata (dydxprotocol#608)

feat: update fills tab number logic to count unseen fills only (dydxprotocol#606)

chore: type custom events (dydxprotocol#565)

feat: enable memo field on transfers of token (dydxprotocol#613)

chore: fix super zoomed out orderbook (dydxprotocol#614)

chore: upgrade and fix redux typings (dydxprotocol#604)

feat: add equity tiers to portfolio (dydxprotocol#597)

chore: bump eslint and friends (dydxprotocol#609)

chore: learn more link in equity tier broadcast error (dydxprotocol#603)

fix: clean up selector console errors (dydxprotocol#619)

feat: implement basic Staking/unstaking (dydxprotocol#611)

chore: update trading rewards table styling, pr followups (dydxprotocol#602)

chore: clean remaining redux uses from main (dydxprotocol#621)

chore: update trading rewards faq (dydxprotocol#622)

fix: switch market selector dropdown to infinite scroll (dydxprotocol#624)

chore: migrate governance + market pages onto trading rewards page (flagged) (dydxprotocol#605)

chore: deprecate fok (dydxprotocol#627)

feat: Self-served MFA modal (dydxprotocol#612)

Signed-off-by: Yuyo <[email protected]>

feat: Prompt MFA after sign up (dydxprotocol#620)

Signed-off-by: Yuyo <[email protected]>

chore: make sl/tp rectangles clickable (dydxprotocol#628)

chore: padding / real estate (dydxprotocol#629)

feat: pipe unbondingDelegations and stakingRewards from abacus (dydxprotocol#631)

feat(staking): add in geoblock panel, rearrange widgets (dydxprotocol#626)

chore: script to cut new tags (dydxprotocol#517)

feat: update validation flow to finish despite errors (dydxprotocol#635)

feat(staking): implement claim rewards panel + dialog (dydxprotocol#632)

feat(new market widget): fix long type of validation script (dydxprotocol#640)

feat: Enable Compliance (dydxprotocol#642)

chore: audit all typecasts, make safer where possible (dydxprotocol#633)

feat: add UI for unbonding delegations (dydxprotocol#639)

chore(staking): merge tradingrewardsrehaul + enablestaking flags (dydxprotocol#641)

chore: season 4 reward distributed notification (dydxprotocol#645)

chore: market wind down notifications (dydxprotocol#644)

chore: add min fraction digits to price for page title (dydxprotocol#650)

fix: update markets fee estimation (dydxprotocol#652)

fix(staking): fix up staking panel colors (dydxprotocol#655)

chore(abacusv2): update to asyncAbacusStateManagerV2 (dydxprotocol#580)

Co-authored-by: Jeremy Lee <[email protected]>
Co-authored-by: Bill He <[email protected]>

feat(isolated-markets): Enable Isolated Margin Trading (dydxprotocol#541)

Co-authored-by: tyleroooo <[email protected]>
Co-authored-by: Jeremy Lee <[email protected]>
Co-authored-by: moo-onthelawn <[email protected]>
Co-authored-by: Bill He <[email protected]>
Co-authored-by: aleka <[email protected]>
Co-authored-by: Prashan Dharmasena <[email protected]>

feat(isolated-margin-live): Add notification for Isolated Margin (dydxprotocol#662)

Co-authored-by: tyleroooo <[email protected]>
Co-authored-by: Jeremy Lee <[email protected]>
Co-authored-by: moo-onthelawn <[email protected]>
Co-authored-by: Bill He <[email protected]>
Co-authored-by: aleka <[email protected]>
Co-authored-by: Prashan Dharmasena <[email protected]>

fix(staking): fix unstaking validator names not showing on initial render (dydxprotocol#661)

chore(sltp): update trigger edit button flow/styling (dydxprotocol#643)

chore: make almost everything selectable (dydxprotocol#665)

fix: orderbook price -> input conversion (dydxprotocol#666)

chore(liquidation-price): use tickSizeDecimals (dydxprotocol#667)

chore(gas): reserve 0.50 usdc (dydxprotocol#669)

feat(rebalance-wallet): rebalance wallet if usdcBalance is low (dydxprotocol#672)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants