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

Overhaul state and hooks with SDK types/constants and zustand #4

Merged
merged 60 commits into from
Nov 18, 2022

Conversation

zkSoju
Copy link
Collaborator

@zkSoju zkSoju commented Nov 17, 2022

No description provided.

Base automatically changed from polygon to damn-hooks November 17, 2022 14:48
@zkSoju zkSoju merged commit e9c688b into damn-hooks Nov 18, 2022
@zkSoju zkSoju deleted the use-sdk branch November 18, 2022 22:18
zkSoju added a commit that referenced this pull request Nov 19, 2022
* vercel tab animation

* add decimals to mint

* useBalance hook

* fix padding

* wip setup l2 sync

* hardcode lz fees and chainid

* add l1 sync hooks

* equal size tabs

* cap at 6 decimals

* Update InteractButton.tsx

* add insufficient balance error handling

* add error handling to swap tab

* dove supremacy

* hide slider on mouse leave

* damm:provide: adapats amount0/1 depending on the other

* damm: providing liquidity works

* damm:withdraw: halfway

* fix types ?

* damm: display correct reserves

* damm: withdraw hook + function works

* amm: supports swapping

* amm: burn vouchers tab

* useApproveToken hook and use BigNumberish for hooks (#2)

* wip approve hooks

* clear inputs on clear and request input

* re-add error handling

* use bignumberish

* clean up and use number as bignumberish

* cleanup

* return formatted and value from balance hook

* improve button ordering

* disable input on wrong chain to prevent errors

* clean up type assertions

* swap button and favicon

* Delete Satoshi_Complete.zip

* navbar styling

* fix max button

* fix types

* fix insufficient balance check

* Update SwapTabContent.tsx

* fix stirng | number ambiguity

* Fixed input with balance + renamed useAMM + WIP for correct LP withdrawign

* damm: withdrawing handles decimals

* fix swap tokens and approvals

* hide approval if no amount entered

* toast + trigger toast for core hooks

* fixed swap inversion

* voucher toast + watch for new blocks

* add block explorer redirect for toast

* shorten toast msg

* polygon amm replacing avax

* bug executes swap auto

* updated wagmi and rainbowkit version

* add sdk entities (#3)

* shorten toast msg

* add sdk/entities

* Burn sync check

* added reserves for amm

* temporary convert wrapper for vouchers burn

* amm: shows available marked tokens on damm

* updated contracts.ts

* Overhaul state and hooks with SDK types/constants and zustand (#4)

* wip sdk overhaul

* clean up all hooks

* fix errors

* load default tokens

* setup user input

* change to currency a/b

* validate input

* update naming

* add provide liq hook

* sort out state + display balances

* abstract tab slider

* add mint + withdraw with sdk

* add damn data hook

* add sync l2 hooks

* fix error when data contents null

* setup swap store

* add swap + sync l1

* add burn + swap callback hooks

* set voucher currencies

* update contracts

* updated addresses

* fetch reserves for damm

* typo

* move tabs

* display correct LP

* add toast hook

* setup approvals and require sync under marked

* reactive swap

* disable input if wrong chain

* check insufficient balance

* fix allowance check

* setup reactive provide

* use parsed amounts as display to handle reactiveness

* fix parsed output using wrong currency

* make swap reactive as well

* remove unused calculation

* fix error when hook is enabled before args defined

* make swap async

* only fetch token on the chain it lives on

* fix isApproved allowance check

* ayo fix calc?

* using amm data for virtual reserves

* fix input not being called

* fix approvals somehow wtf

* revert changes but still works wtf

* move tab data to separate folder

* clean up tabs

* fix input error with default state

* provide: allow typing from both sides

* fix display and input display

* fix reactive swap inputs

* use uniswap formatting

Co-authored-by: exp_table <exp.table@protonmail.com>

* clear fields after chain change

* don't need to format independent fields

* fix withdraw field

* Make callback hooks async and trigger toasts (#6)

* make async + add toasts

* add toasts and swap currencies

* shorten toast msg

* view virt reserves from any tab

* swap: hardcode routing to match swap args

* restyle

* advance slider

* Update globals.css

* move tabs

* Single tab (#7)

* simplify

* collapse into one tab

* use autoswitch only for damm

Co-authored-by: exp_table <exp.table@protonmail.com>
Co-authored-by: exp_table <76456212+exp-table@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants