Skip to content

Commit de9d252

Browse files
author
Griko Nibras
authored
chore: sync staging → main (#126)
2 parents 1c286d4 + dfd1e94 commit de9d252

20 files changed

+717
-941
lines changed

Diff for: .env.example

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ NEXT_PUBLIC_API_URL=https://api.skip.money
44
# development API
55
# NEXT_PUBLIC_API_URL=https://solve-dev.skip.money
66

7+
CORS_EDGE_CONFIG=
78
POLKACHU_USER=
89
POLKACHU_PASSWORD=

Diff for: env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ declare namespace NodeJS {
22
interface ProcessEnv {
33
readonly APP_URL?: string;
44
readonly NEXT_PUBLIC_API_URL?: string;
5+
readonly CORS_EDGE_CONFIG?: string;
56
readonly POLKACHU_USER?: string;
67
readonly POLKACHU_PASSWORD?: string;
78
}

Diff for: package-lock.json

+506-853
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+42-31
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@
1313
"test": "node --experimental-vm-modules --no-warnings ./node_modules/.bin/jest",
1414
"test:e2e": "playwright test --project=chromium"
1515
},
16+
"overrides": {
17+
"@cosmjs/amino": "0.31.x",
18+
"@cosmjs/cosmwasm-stargate": "0.31.x",
19+
"@cosmjs/encoding": "0.31.x",
20+
"@cosmjs/ledger-amino": "0.31.x",
21+
"@cosmjs/math": "0.31.x",
22+
"@cosmjs/proto-signing": "0.31.x",
23+
"@cosmjs/stargate": "0.31.x",
24+
"@cosmjs/tendermint-rpc": "0.31.x",
25+
"cosmjs-types": "0.8.x"
26+
},
1627
"dependencies": {
1728
"@cosmjs/amino": "0.31.x",
1829
"@cosmjs/cosmwasm-stargate": "0.31.x",
@@ -22,57 +33,57 @@
2233
"@cosmjs/proto-signing": "0.31.x",
2334
"@cosmjs/stargate": "0.31.x",
2435
"@cosmjs/tendermint-rpc": "0.31.x",
25-
"@cosmos-kit/core": "^2.7.10",
26-
"@cosmos-kit/cosmostation": "^2.4.14",
27-
"@cosmos-kit/keplr": "^2.4.15",
28-
"@cosmos-kit/leap": "^2.4.16",
29-
"@cosmos-kit/okxwallet": "^2.3.11",
30-
"@cosmos-kit/react": "^2.9.14",
31-
"@cosmos-kit/react-lite": "^2.5.12",
32-
"@cosmos-kit/station": "^2.4.10",
33-
"@cosmos-kit/vectis": "^2.4.10",
34-
"@cosmos-kit/xdefi": "^2.4.12",
36+
"@cosmos-kit/core": "^2.7.11",
37+
"@cosmos-kit/cosmostation": "^2.5.1",
38+
"@cosmos-kit/keplr": "^2.5.1",
39+
"@cosmos-kit/leap": "^2.5.1",
40+
"@cosmos-kit/okxwallet": "^2.3.12",
41+
"@cosmos-kit/react": "^2.9.16",
42+
"@cosmos-kit/react-lite": "^2.5.13",
43+
"@cosmos-kit/station": "^2.4.11",
44+
"@cosmos-kit/vectis": "^2.5.1",
45+
"@cosmos-kit/xdefi": "^2.4.13",
3546
"@evmos/proto": "^0.2.1",
3647
"@evmos/provider": "^0.3.1",
3748
"@evmos/transactions": "^0.3.2",
3849
"@graz-sh/types": "^0.0.14",
3950
"@headlessui/react": "^1.7.17",
40-
"@heroicons/react": "^2.0.18",
51+
"@heroicons/react": "^2.1.1",
4152
"@injectivelabs/sdk-ts": "^1.14.4",
4253
"@injectivelabs/utils": "^1.14.4",
43-
"@keplr-wallet/types": "^0.12.52",
54+
"@keplr-wallet/types": "^0.12.54",
4455
"@radix-ui/react-accordion": "^1.1.2",
4556
"@radix-ui/react-collapsible": "^1.0.3",
4657
"@radix-ui/react-dialog": "^1.0.5",
4758
"@radix-ui/react-scroll-area": "^1.0.5",
4859
"@radix-ui/react-toast": "^1.1.5",
4960
"@radix-ui/react-toggle-group": "^1.0.4",
5061
"@radix-ui/react-tooltip": "^1.0.7",
51-
"@sentry/nextjs": "^7.87.0",
52-
"@skip-router/core": "^1.1.1",
53-
"@tanstack/react-query": "^5.13.4",
54-
"@types/node": "^20.10.4",
62+
"@sentry/nextjs": "^7.90.0",
63+
"@skip-router/core": "^1.1.2",
64+
"@tanstack/react-query": "^5.14.2",
65+
"@types/node": "^20.10.5",
5566
"@types/react": "^18.2.45",
56-
"@types/react-dom": "^18.2.17",
67+
"@types/react-dom": "^18.2.18",
5768
"@vercel/analytics": "^1.1.1",
58-
"@web3modal/core": "^3.5.0",
59-
"@web3modal/ui": "^3.5.0",
69+
"@vercel/edge-config": "^0.4.1",
70+
"@web3modal/core": "^3.5.1",
71+
"@web3modal/ui": "^3.5.1",
6072
"autoprefixer": "^10.4.16",
6173
"axios": "^1.6.2",
6274
"clsx": "^2.0.0",
63-
"cosmjs-types": "^0.9.0",
64-
"date-fns": "^2.30.0",
75+
"cosmjs-types": "0.8.x",
76+
"date-fns": "^3.0.1",
6577
"download": "^8.0.0",
66-
"ethers": "^6.9.0",
67-
"framer-motion": "^10.16.16",
78+
"ethers": "^6.9.1",
6879
"next": "^14.0.4",
6980
"postcss": "^8.4.32",
7081
"react": "^18.2.0",
7182
"react-dom": "^18.2.0",
72-
"tailwindcss": "^3.3.6",
83+
"tailwindcss": "^3.4.0",
7384
"tinykeys": "^2.1.0",
74-
"undici": "^6.0.1",
75-
"viem": "^1.19.15",
85+
"undici": "^6.2.0",
86+
"viem": "^1.20.3",
7687
"wagmi": "^1.4.12",
7788
"zod": "^3.22.4",
7889
"zustand": "^4.4.7"
@@ -86,12 +97,12 @@
8697
"@types/download": "^8.0.5",
8798
"@types/jest": "^29.5.11",
8899
"@types/testing-library__jest-dom": "^5.14.9",
89-
"@typescript-eslint/eslint-plugin": "^6.14.0",
90-
"@typescript-eslint/parser": "^6.14.0",
91-
"eslint": "^8.55.0",
100+
"@typescript-eslint/eslint-plugin": "^6.15.0",
101+
"@typescript-eslint/parser": "^6.15.0",
102+
"eslint": "^8.56.0",
92103
"eslint-config-next": "^14.0.4",
93104
"eslint-config-prettier": "^9.1.0",
94-
"eslint-plugin-prettier": "^5.0.1",
105+
"eslint-plugin-prettier": "^5.1.0",
95106
"eslint-plugin-simple-import-sort": "^10.0.0",
96107
"globby": "^14.0.0",
97108
"jest": "^29.7.0",
@@ -103,7 +114,7 @@
103114
"prettier": "^3.1.1",
104115
"resize-observer-polyfill": "^1.5.1",
105116
"ts-jest": "^29.1.1",
106-
"tsx": "^4.6.2",
117+
"tsx": "^4.7.0",
107118
"typed-query-selector": "^2.11.0",
108119
"typescript": "5.2.x"
109120
}

Diff for: sentry.client.config.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44

55
import * as Sentry from "@sentry/nextjs";
66

7-
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
8-
97
Sentry.init({
10-
dsn:
11-
SENTRY_DSN ||
12-
"https://93370ce893e0f946e344a7cc2a74a1d6@o4504768725909504.ingest.sentry.io/4506180860968960",
8+
dsn: process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN,
139

1410
// Adjust this value in production, or use tracesSampler for greater control
1511
tracesSampleRate: 1,
@@ -27,8 +23,8 @@ Sentry.init({
2723
integrations: [
2824
new Sentry.Replay({
2925
// Additional Replay configuration goes in here, for example:
30-
maskAllText: true,
31-
blockAllMedia: true,
26+
maskAllText: false,
27+
blockAllMedia: false,
3228
}),
3329
],
3430
});

Diff for: sentry.edge.config.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@
55

66
import * as Sentry from "@sentry/nextjs";
77

8-
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
9-
108
Sentry.init({
11-
dsn:
12-
SENTRY_DSN ||
13-
"https://93370ce893e0f946e344a7cc2a74a1d6@o4504768725909504.ingest.sentry.io/4506180860968960",
9+
dsn: process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN,
1410

1511
// Adjust this value in production, or use tracesSampler for greater control
1612
tracesSampleRate: 1,

Diff for: sentry.server.config.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44

55
import * as Sentry from "@sentry/nextjs";
66

7-
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
8-
97
Sentry.init({
10-
dsn:
11-
SENTRY_DSN ||
12-
"https://93370ce893e0f946e344a7cc2a74a1d6@o4504768725909504.ingest.sentry.io/4506180860968960",
8+
dsn: process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN,
139

1410
// Adjust this value in production, or use tracesSampler for greater control
1511
tracesSampleRate: 1,

Diff for: src/components/AssetInput.tsx

+24-14
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { getFee, useBalancesByChain } from "@/utils/utils";
1414

1515
import AssetSelect from "./AssetSelect";
1616
import ChainSelect from "./ChainSelect";
17+
import { ClientOnly } from "./ClientOnly";
1718
import { SimpleTooltip } from "./SimpleTooltip";
1819
import { UsdDiff, UsdValue, useUsdDiffReset } from "./UsdValue";
1920

@@ -27,6 +28,7 @@ interface Props {
2728
chains: Chain[];
2829
showBalance?: boolean;
2930
showSlippage?: boolean;
31+
context?: "src" | "dest";
3032
}
3133

3234
const AssetInput: FC<Props> = ({
@@ -39,6 +41,7 @@ const AssetInput: FC<Props> = ({
3941
onChainChange,
4042
showBalance,
4143
showSlippage,
44+
context,
4245
}) => {
4346
const [isError, setIsError] = useState(false);
4447

@@ -56,7 +59,12 @@ const AssetInput: FC<Props> = ({
5659

5760
const { address } = useAccount(chain?.chainID ?? "cosmoshub-4");
5861

59-
const { data: balances } = useBalancesByChain(address, chain, showBalance);
62+
const { data: balances } = useBalancesByChain(
63+
address,
64+
chain,
65+
assets,
66+
showBalance,
67+
);
6068

6169
const selectedAssetBalance = useMemo(() => {
6270
if (!asset || !balances) return undefined;
@@ -188,11 +196,11 @@ const AssetInput: FC<Props> = ({
188196
denom={asset.originDenom}
189197
coingeckoID={asset.coingeckoID}
190198
value={amount}
191-
context={onAmountChange ? "src" : "dest"}
199+
context={context}
192200
/>
193201
</div>
194202
)}
195-
{!onAmountChange && (
203+
{context === "dest" && (
196204
<UsdDiff.Value>
197205
{({ isLoading, percentage }) => (
198206
<div
@@ -256,17 +264,19 @@ const AssetInput: FC<Props> = ({
256264
</button>
257265
</div>
258266
)}
259-
{showSlippage && (
260-
<SimpleTooltip label="Click to change max slippage">
261-
<button
262-
className="text-neutral-400 text-sm hover:underline"
263-
onClick={() => disclosure.open("settingsDialog")}
264-
>
265-
Max Slippage: {slippage}%{" "}
266-
<PencilSquareIcon className="w-3 h-3 inline mb-1" />
267-
</button>
268-
</SimpleTooltip>
269-
)}
267+
<ClientOnly>
268+
{showSlippage && (
269+
<SimpleTooltip label="Click to change max slippage">
270+
<button
271+
className="text-neutral-400 text-sm hover:underline"
272+
onClick={() => disclosure.open("settingsDialog")}
273+
>
274+
Max Slippage: {slippage}%{" "}
275+
<PencilSquareIcon className="w-3 h-3 inline mb-1" />
276+
</button>
277+
</SimpleTooltip>
278+
)}
279+
</ClientOnly>
270280
</div>
271281
</div>
272282
</div>

Diff for: src/components/AssetValue.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ export const AssetValue = ({ chainId, denom, value }: Props) => {
1919
}, [chainId, denom, getAsset]);
2020

2121
const formattedValue = useMemo(() => {
22-
const v = formatUnits(value, decimals);
23-
const w = 9;
24-
if (v.length > w) return v.slice(0, w) + "…";
22+
let v = formatUnits(value, decimals);
23+
v = format(parseFloat(v));
2524
return v;
2625
}, [decimals, value]);
2726

@@ -31,3 +30,5 @@ export const AssetValue = ({ chainId, denom, value }: Props) => {
3130
</span>
3231
);
3332
};
33+
34+
const { format } = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });

Diff for: src/components/ClientOnly.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { ReactNode, useEffect, useState } from "react";
2+
3+
export function ClientOnly({ children }: { children: ReactNode }) {
4+
const [state, setState] = useState(false);
5+
useEffect(() => setState(true), []);
6+
return state ? <>{children}</> : null;
7+
}

Diff for: src/components/HistoryDialog/HistoryList.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,22 @@ export const Item = forwardRef<HTMLDivElement, ItemProps>(
9191
ref={headingRef}
9292
>
9393
<div className="flex items-center space-x-4 text-start">
94-
<time className="uppercase text-center text-sm opacity-60 tabular-nums">
94+
<time className="uppercase text-center text-sm opacity-60 tabular-nums whitespace-nowrap">
9595
<RenderDate date={data.timestamp} />
9696
</time>
9797
<div className="flex-grow">
98-
<div className="font-medium text-sm flex items-center space-x-1">
98+
<div className="font-medium text-sm flex items-center">
9999
<ChainSymbol chainId={data.route.sourceAssetChainID} />
100-
<ArrowRightIcon className="w-4 h-4" />
100+
<ArrowRightIcon className="w-4 h-4 mx-1" />
101101
<ChainSymbol chainId={data.route.destAssetChainID} />
102102
</div>
103-
<div className="opacity-60 text-sm flex items-center space-x-1">
103+
<div className="opacity-60 text-sm flex items-center">
104104
<AssetValue
105105
chainId={data.route.sourceAssetChainID}
106106
denom={data.route.sourceAssetDenom}
107107
value={data.route.amountIn}
108108
/>
109-
<ArrowRightIcon className="w-3 h-3" />
109+
<ArrowRightIcon className="w-3 h-3 mx-1" />
110110
<AssetValue
111111
chainId={data.route.destAssetChainID}
112112
denom={data.route.destAssetDenom}
@@ -168,10 +168,10 @@ export const Item = forwardRef<HTMLDivElement, ItemProps>(
168168
<DescriptionList.Root className="pt-2">
169169
<DescriptionList.Row>
170170
<DescriptionList.Dt>Chain Route</DescriptionList.Dt>
171-
<DescriptionList.Dd className="flex flex-wrap items-center space-x-1">
171+
<DescriptionList.Dd className="flex flex-wrap items-center">
172172
{data.route.chainIDs.map((chainId, i) => (
173173
<Fragment key={i}>
174-
{i > 0 && <ArrowRightIcon className="w-4 h-4" />}
174+
{i > 0 && <ArrowRightIcon className="w-4 h-4 mx-1" />}
175175
<ChainSymbol chainId={chainId} />
176176
</Fragment>
177177
))}

Diff for: src/components/SwapWidget/SwapWidget.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export const SwapWidget: FC = () => {
123123
onAssetChange={onSourceAssetChange}
124124
onChainChange={onSourceChainChange}
125125
showBalance
126+
context="src"
126127
/>
127128
</div>
128129
<div className="relative">
@@ -182,6 +183,7 @@ export const SwapWidget: FC = () => {
182183
onAssetChange={onDestinationAssetChange}
183184
onChainChange={onDestinationChainChange}
184185
showSlippage={!isSwapDetailsOpen}
186+
context="dest"
185187
/>
186188
</div>
187189
{route && (

Diff for: src/components/SwapWidget/useSwapWidget.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,17 @@ export function useSwapWidget() {
122122

123123
const { address } = useAccount(sourceChain?.chainID ?? "cosmoshub-4");
124124

125-
const { data: balances } = useBalancesByChain(address, sourceChain);
125+
const { assetsByChainID } = useAssets();
126+
127+
const sourceChainAssets = assetsByChainID(
128+
sourceChain?.chainID ?? "cosmoshub-4",
129+
);
130+
131+
const { data: balances } = useBalancesByChain(
132+
address,
133+
sourceChain,
134+
sourceChainAssets,
135+
);
126136

127137
const insufficientBalance = useMemo(() => {
128138
if (!sourceAsset || !balances) {

Diff for: src/components/TransactionDialog/TransactionDialogContent.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useToast } from "@/context/toast";
1111
import {
1212
addTxHistory,
1313
addTxStatus,
14-
removeTxHistory,
14+
failTxHistory,
1515
successTxHistory,
1616
} from "@/context/tx-history";
1717
import Toast from "@/elements/Toast";
@@ -219,7 +219,7 @@ const TransactionDialogContent: FC<Props> = ({
219219
setTxError(err.message);
220220
setIsError(true);
221221
}
222-
removeTxHistory(historyId);
222+
failTxHistory(historyId);
223223
setTxStatuses((statuses) => {
224224
const newStatuses = [...statuses];
225225
return newStatuses.map((status) => {

0 commit comments

Comments
 (0)