Skip to content

Commit

Permalink
feat: add bridging page and bridging UI (#416)
Browse files Browse the repository at this point in the history
* feat: separate out Bridge page from Portfolio page

* feat: add and style Bridge deposit/withdraw buttons

* feat: make header action buttons on Portfolio cards consistent

* feat: remove default styling of input fields

* feat: add Bridge modal

* feat: allow NumberInput to pass ref for autofocusing

* feat: add token path UI style

* feat: add getIbcDenom util function

* feat: align path-box elements to a grid as expected

* feat: add wallet path

* feat: add transaction info box style

* feat: add Bridge button style

* feat: make dialog smaller

* feat: add chain logo styling

* refactor: remove need for parseAmountDenomString, use cosmjs Coin type

* feat: update dependencies for TypeScript IBC transfer types

* feat: update Keplr types

* feat: add @keplr-wallet/stores dependency:

    - to be able to read currently connected chains

* feat: add @keplr-wallet/stores dependency:

    - to be able to send requests to the background Keplr process

* refactor: split out logic of BridgeDialog:

    - for future logic that occurs on Dialog open

* feat: add Keplr chain isConnected logic for Bridging

* feat: allow formatAddress to be length customizable

* feat: disable bridge button if token addresses aren't resolved

* feat: allow adding of provider chain+assets to token lists

* feat: add dependency to translate to Keplr ChainInfo

* docs: add note about Keplr popup action

* fix: lazy-load App to get around Keplr's usage of Buffer in imports

* feat: add provider chain to Keplr when needed for confirmation popups

* feat: show Chain pretty name in lists

* feat: add basic sent-ibc-transfers logic

* feat: update Duality types to include IBC client queries

* feat: restrict Bridge page token list to tokens connected to Duality

* fix: Slip ID should be ATOM chain

* refactor: rename IBC client states hook

* feat: update Duality types to include other IBC queries

* refactor: abstract out getting IBC client from specific chain

* feat: ensure only open channel tokens are shown in list

* fix: use correct IBC transfer channel and ports from known info

* fix: getIbcDenom with variables

* feat: show user's IBC token amounts on Assets page

* fix: IBC denoms have uppercase hashes when transferred in

* docs: correct comments: clients are listed even when Expired

* feat: only show Deposit/Withdraw buttons for IBC denoms:

    - add IBC info into denoms so that the list may be filtered by it

* feat: list all tokens on asset page by only enable some IBC transfers

* feat: add sorting by chain type

* feat: query local and remote chains for IBC bank balances

* feat: hide fee section for now

* feat: add dynamic REST endpoint searching for all remote IBC queries

* feat: format token amounts in Bridge modal

* feat: allow useRemoteChainRestEndpoint to work with local/native chain

* fix: use best known remote chain REST endpoint for IBC transfer txs

* feat: allow a few seconds for the REST endpoint to be resolved on request

* Revert "feat: allow a few seconds for the REST endpoint to be resolved on request"

This reverts commit f4adcd0.

* feat: allow bridging sendRequest to wait for restEndpointFrom data

* feat: add connection client status check before bridging

* feat: display bridging errors

* feat: provide better default transfer fee and time estimations

* feat: rearrange transfer details for better empty state

* feat: add Bridge withdrawal action

* docs: add todo about where to listen for IBC transfer completion

* docs: add note about IBC send/receive enable check endpoint

* feat: add queries for block chain times for IBC transfer

* fix: QueryConnectionParamsResponseSDKType type is not correct

* feat: update Duality types to include IBC router types

* feat: add IBC transfer fee estimations

* feat: update to NPM package version of duality TypeScript package

* feat: format all Bridge Dialog numbers nicely

* fix: remote chain status should be unconnected when no address

* feat: ensure 0 found tokens is displayed as 0 and not a loading state

* feat: display unconnected tokens for unconnected wallets

* fix: tx IBC client requires an RPC endpoint not REST endpoint

* fix: ensure IBC denoms are sent in IBC Withdraw transactinos

* feat: show better error message than "Tx error: 11"

* feat: allow custom Chain currencies to be used

* refactor: fix implicit "any" type casting

* feat: use consistent chain/asset config from chain-registry types:

    - they are converted to Keplr types when needed by Keplr

* feat: allow Duality Chain config overrides with IBC fee token example

* feat: disallow selecting other tokens in Bridge modal:

    - token has already been selected from the bridgeable assets list

* feat: disallow selecting other wallets for now (only use Keplr)

* feat: replace error messages in modal with error toasts

* feat: split out BridgeCard into its own component

* feat: add warning state for Insufficient Funds while bridging

* fix: use correct token denom to query local chain using IBC balance
  • Loading branch information
dib542 authored Sep 11, 2023
1 parent 8e08f88 commit 7dfd561
Show file tree
Hide file tree
Showing 29 changed files with 5,831 additions and 199 deletions.
9 changes: 9 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ REACT_APP__IS_MAINNET=testnet

# Add prices for development tokens
REACT_APP__DEV_TOKEN_DENOMS=["sdk.coin:token", "sdk.coin:stake"]
REACT_APP__CHAIN_FEE_TOKENS=[{"denom":"sdk.coin:token"}]

# Override chain name
REACT_APP__CHAIN_ID=duality-devnet
REACT_APP__CHAIN_NAME=Duality Devnet

# An example of using bridged IBC tokens as fee tokens in the consumer chain:
# note: IBC denom trace "transfer/channel-1/stake" is
# IBC denom hash "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9"
#
# REACT_APP__CHAIN={"chain_name":"duality"}
# REACT_APP__CHAIN_ASSETS={"chain_name":"duality","assets":[{"description":"Provider token","address":"stake","base":"ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9","name":"Provider Stake","display":"stk","symbol":"STK","denom_units":[{"denom":"ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9","exponent":0,"aliases":["stake"]},{"denom":"stk","exponent":6,"aliases":["provider-stake","STAKE"]}],"logo_URIs":{"svg":"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.svg"}}]}
# REACT_APP__CHAIN_FEE_TOKENS=[{"denom":"ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9"}]
Loading

0 comments on commit 7dfd561

Please sign in to comment.