Skip to content

Commit

Permalink
feat: sync staging → main
Browse files Browse the repository at this point in the history
Signed-off-by: Griko Nibras <[email protected]>
  • Loading branch information
grikomsn committed Dec 6, 2023
2 parents db9f5d3 + cbbcae5 commit 900e1d7
Show file tree
Hide file tree
Showing 26 changed files with 1,088 additions and 1,941 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Deploy (dev.ibc.fun)
on:
pull_request:
branches: [main]
types: [closed]
push:
branches: [main]
repository_dispatch:
Expand All @@ -25,11 +28,9 @@ jobs:
run: git diff --exit-code origin/main

- id: fast-forward
if: steps.diff-check.outcome == 'failure'
name: Fast forward 'main' → 'dev'
run: git merge --ff-only origin/main

- id: push-dev
if: steps.diff-check.outcome == 'failure'
name: Push latest 'dev'
run: git push --set-upstream origin dev
2 changes: 1 addition & 1 deletion chain-registry
Submodule chain-registry updated 64 files
+32 −0 _IBC/aura-noble.json
+31 −0 _IBC/celestia-composable.json
+31 −0 _IBC/composable-kujira.json
+31 −0 _IBC/dydx-neutron.json
+31 −0 _IBC/dydx-persistence.json
+3 −3 _IBC/kujira-teritori.json
+31 −0 _IBC/neutron-nolus.json
+31 −0 andromeda/assetlist.json
+157 −0 andromeda/chain.json
+ andromeda/images/andromeda-logo.png
+23 −1 bandchain/chain.json
+4 −1 beezee/chain.json
+2 −2 carbon/chain.json
+4 −1 cerberus/chain.json
+25 −1 chain4energy/chain.json
+12 −0 composable/chain.json
+9 −1 cosmoshub/chain.json
+4 −1 decentr/chain.json
+132 −46 gateway/assetlist.json
+2 −2 haqq/assetlist.json
+13 −1 jackal/chain.json
+1 −2 juno/assetlist.json
+25 −0 kujira/assetlist.json
+33 −0 kujira/images/fuziony.svg
+35 −7 kyve/chain.json
+41 −3 lumnetwork/chain.json
+4 −1 microtick/chain.json
+49 −0 neutron/assetlist.json
+31 −0 noble-omniflixhub.json
+13 −0 nolus/chain.json
+12 −0 nyx/chain.json
+27 −50 osmosis/assetlist.json
+8 −0 osmosis/chain.json
+ osmosis/images/levana.png
+10 −0 osmosis/images/levana.svg
+49 −0 persistence/assetlist.json
+12 −0 planq/chain.json
+13 −1 provenance/chain.json
+13 −0 quasar/chain.json
+13 −1 realio/chain.json
+4 −1 rebus/chain.json
+ saga/images/saga.png
+4 −0 saga/images/saga.svg
+4 −1 sommelier/chain.json
+12 −0 source/chain.json
+0 −8 starname/chain.json
+55 −1 terra2/assetlist.json
+ terra2/images/seul.png
+ terra2/images/xseul.png
+31 −0 testnets/_IBC/axelartestnet-sagatestnet.json
+30 −0 testnets/_IBC/neutrontestnet-nolustestnet.json
+32 −0 testnets/_IBC/osmosistestnet-sagatestnet.json
+6 −6 testnets/_IBC/osmosistestnet-xiontestnet.json
+1 −1 testnets/deardogetestnet/assetlist.json
+27 −9 testnets/neutrontestnet/chain.json
+35 −0 testnets/sagatestnet/assetlist.json
+141 −0 testnets/sagatestnet/chain.json
+31 −0 testnets/selfchaindevnet/assetlist.json
+79 −0 testnets/selfchaindevnet/chain.json
+ testnets/selfchaindevnet/images/selfchain.png
+1 −1 testnets/xiontestnet/assetlist.json
+9 −1 umee/chain.json
+28 −4 ununifi/chain.json
+4 −1 vidulum/chain.json
1,974 changes: 779 additions & 1,195 deletions package-lock.json

Large diffs are not rendered by default.

64 changes: 38 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,25 @@
"test": "jest",
"test:e2e": "playwright test --project=chromium"
},
"overrides": {
"@cosmjs/amino": "^0.32.1",
"@cosmjs/cosmwasm-stargate": "^0.32.1",
"@cosmjs/encoding": "^0.32.1",
"@cosmjs/ledger-amino": "^0.32.1",
"@cosmjs/math": "^0.32.1",
"@cosmjs/proto-signing": "^0.32.1",
"@cosmjs/stargate": "^0.32.1",
"@cosmjs/tendermint-rpc": "^0.32.1"
},
"dependencies": {
"@cosmjs/amino": "^0.31.3",
"@cosmjs/cosmwasm-stargate": "^0.31.3",
"@cosmjs/encoding": "^0.31.3",
"@cosmjs/ledger-amino": "^0.31.3",
"@cosmjs/math": "^0.31.3",
"@cosmjs/proto-signing": "^0.31.3",
"@cosmjs/stargate": "^0.31.3",
"@cosmjs/tendermint-rpc": "^0.31.3",
"@cosmjs/amino": "^0.32.1",
"@cosmjs/cosmwasm-stargate": "^0.32.1",
"@cosmjs/encoding": "^0.32.1",
"@cosmjs/ledger-amino": "^0.32.1",
"@cosmjs/math": "^0.32.1",
"@cosmjs/proto-signing": "^0.32.1",
"@cosmjs/stargate": "^0.32.1",
"@cosmjs/tendermint-rpc": "^0.32.1",
"@cosmos-kit/core": "^2.0.3",
"@cosmos-kit/cosmostation-extension": "^2.0.3",
"@cosmos-kit/keplr-extension": "^2.0.3",
Expand All @@ -39,18 +49,19 @@
"@heroicons/react": "^2.0.18",
"@injectivelabs/sdk-ts": "^1.14.4",
"@injectivelabs/utils": "^1.14.4",
"@keplr-wallet/types": "^0.12.44",
"@keplr-wallet/types": "^0.12.46",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-toast": "^1.1.5",
"@radix-ui/react-toggle-group": "^1.0.4",
"@radix-ui/react-tooltip": "^1.0.7",
"@sentry/nextjs": "^7.81.1",
"@skip-router/core": "^0.1.0-rc22",
"@tanstack/react-query": "^5.8.4",
"@types/node": "20.9.4",
"@types/react": "18.2.38",
"@sentry/nextjs": "^7.85.0",
"@skip-router/core": "^1.0.5",
"@tanstack/react-query": "^5.12.2",
"@types/node": "20.10.3",
"@types/react": "18.2.42",
"@types/react-dom": "18.2.17",
"@vercel/analytics": "^1.1.1",
"@web3modal/core": "^2.7.0",
Expand All @@ -64,22 +75,23 @@
"download": "^8.0.0",
"eslint-config-next": "14.0.3",
"ethers": "^6.3.0",
"framer-motion": "^10.16.5",
"framer-motion": "^10.16.14",
"next": "14.0.3",
"pino-pretty": "^10.2.3",
"postcss": "8.4.31",
"postcss": "8.4.32",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.5",
"tailwindcss": "3.3.6",
"tinykeys": "^2.1.0",
"usehooks-ts": "^2.9.1",
"viem": "^1.14.0",
"wagmi": "^1.4.3",
"zod": "^3.22.4",
"zustand": "^4.4.6"
"zustand": "^4.4.7"
},
"devDependencies": {
"@playwright/test": "^1.38.0",
"@tanstack/eslint-plugin-query": "^5.8.4",
"@playwright/test": "^1.40.1",
"@tanstack/eslint-plugin-query": "^5.12.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
Expand All @@ -88,24 +100,24 @@
"@types/http-proxy": "^1.17.14",
"@types/jest": "^29.5.3",
"@types/testing-library__jest-dom": "^5.14.5",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"degit": "npm:tiged@^2.12.5",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"globby": "^14.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"msw": "^1.2.3",
"npm-run-all2": "^6.1.1",
"p-map": "^6.0.0",
"p-map": "^7.0.0",
"patch-package": "^8.0.0",
"prettier": "^3.1.0",
"resize-observer-polyfill": "^1.5.1",
"ts-jest": "^29.1.1",
"tsx": "^4.2.1",
"tsx": "^4.6.2",
"typescript": "5.1.x"
}
}
40 changes: 0 additions & 40 deletions patches/@skip-router+core+1.0.3.patch

This file was deleted.

38 changes: 35 additions & 3 deletions src/components/AssetInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PencilSquareIcon } from "@heroicons/react/20/solid";
import { BigNumber } from "bignumber.js";
import { clsx } from "clsx";
import { ethers } from "ethers";
import { FC, Fragment, useEffect, useMemo, useRef, useState } from "react";
Expand Down Expand Up @@ -153,9 +154,40 @@ const AssetInput: FC<Props> = ({

onAmountChange?.(latest);
}}
onKeyDown={(e) => {
if (e.key === "Escape") {
onKeyDown={(event) => {
if (!onAmountChange) return;

if (event.key === "Escape") {
onAmountChange?.("");
return;
}

if (event.key === "ArrowUp" || event.key === "ArrowDown") {
let value = new BigNumber(event.currentTarget.value || "0");
if (event.key === "ArrowUp") {
event.preventDefault();
if (event.shiftKey) {
value = value.plus(10);
} else if (event.altKey || event.ctrlKey || event.metaKey) {
value = value.plus(0.1);
} else {
value = value.plus(1);
}
}
if (event.key === "ArrowDown") {
event.preventDefault();
if (event.shiftKey) {
value = value.minus(10);
} else if (event.altKey || event.ctrlKey || event.metaKey) {
value = value.minus(0.1);
} else {
value = value.minus(1);
}
}
if (value.isNegative()) {
value = new BigNumber(0);
}
onAmountChange(value.toString());
}
}}
ref={inputRef}
Expand All @@ -168,7 +200,7 @@ const AssetInput: FC<Props> = ({
error={null}
chainId={asset.originChainID}
denom={asset.originDenom}
coingeckoId={asset.coingeckoId}
coingeckoID={asset.coingeckoID}
value={amount}
context={onAmountChange ? "src" : "dest"}
/>
Expand Down
40 changes: 0 additions & 40 deletions src/components/BetaBanner.tsx

This file was deleted.

22 changes: 11 additions & 11 deletions src/components/BuildInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { clsx } from "clsx";
import { ReactNode, useEffect, useState } from "react";
import { tinykeys } from "tinykeys";

import { API_URL } from "@/constants/api";

const githubUrl = "https://github.com/skip-mev/ibc-dot-fun";

const buildInfo: [string, ReactNode][] = [
["node env", process.env.NODE_ENV],
["vercel env", process.env.NEXT_PUBLIC_VERCEL_ENV ? "true" : "false"],
["api url", API_URL],
[
"commit",
Expand All @@ -29,13 +29,9 @@ export const BuildInfo = () => {
);

useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === "Escape" && e.shiftKey) {
setShow((prev) => !prev);
}
};
window.addEventListener("keydown", handleKeyDown);
return () => window.removeEventListener("keydown", handleKeyDown);
return tinykeys(window, {
"Shift+Escape": () => setShow((prev) => !prev),
});
}, []);

if (!show) return null;
Expand Down Expand Up @@ -71,9 +67,13 @@ export const BuildInfo = () => {
),
)}
</dl>
<div className="text-end text-xs text-neutral-500">
shift+esc to toggle
</div>
<hr />
<button
className="text-center text-xs text-neutral-500 w-full relative before:absolute before:-inset-1 before:content-['']"
onClick={() => setShow((prev) => !prev)}
>
shift+esc to toggle, click here to close
</button>
</div>
);
};
62 changes: 62 additions & 0 deletions src/components/ConversionRate.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { ReactNode, useCallback, useMemo, useState } from "react";

import { AssetWithMetadata } from "@/context/assets";

export interface Props {
srcAsset: AssetWithMetadata;
destAsset: AssetWithMetadata;
amountIn: string;
amountOut: string;
defaultDirection?: ConvDirection;

children: (args: RenderArgs) => ReactNode;
}

interface RenderArgs {
left: AssetWithMetadata;
right: AssetWithMetadata;
conversion: number;
toggle: () => void;
}

export const ConversionRate = ({
srcAsset: src,
destAsset: dest,
amountIn,
amountOut,
defaultDirection = ConvDirection.DEST_SRC,
children,
}: Props) => {
const [direction, setState] = useState<ConvDirection>(() => defaultDirection);

const toggle = useCallback(() => {
setState((prev) => {
return prev === ConvDirection.DEST_SRC
? ConvDirection.SRC_DEST
: ConvDirection.DEST_SRC;
});
}, []);

const left = direction === ConvDirection.DEST_SRC ? dest : src;
const right = direction === ConvDirection.DEST_SRC ? src : dest;

const conversion = useMemo(() => {
if (direction === ConvDirection.DEST_SRC) {
return +amountIn / +amountOut;
} else {
return +amountOut / +amountIn;
}
}, [amountIn, amountOut, direction]);

const renderArgs: RenderArgs = useMemo(
() => ({ left, right, conversion, toggle }),
[conversion, left, right, toggle],
);

return children(renderArgs);
};

export enum ConvDirection {
DEST_SRC = "dest-src",
SRC_DEST = "src-dest",
}
Loading

1 comment on commit 900e1d7

@vercel
Copy link

@vercel vercel bot commented on 900e1d7 Dec 6, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.