Skip to content

Commit

Permalink
Merge branch 'stage' into connor/low-price-crash
Browse files Browse the repository at this point in the history
  • Loading branch information
mattupham authored Sep 10, 2024
2 parents e343801 + d1af6ad commit 9278038
Show file tree
Hide file tree
Showing 15 changed files with 238 additions and 45 deletions.
6 changes: 3 additions & 3 deletions packages/bridge/src/__tests__/mock-asset-lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ export const MockAssetLists: AssetList[] = [
sourceDenom: "wmatic-wei",
coinMinimalDenom:
"ibc/AB589511ED0DD5FA56171A39978AFBF1371DB986EC1C3526CE138A16377E39BB",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
logoURIs: {
png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.png",
Expand Down Expand Up @@ -1506,15 +1506,15 @@ export const MockAssetLists: AssetList[] = [
chainType: "evm",
chainId: 137,
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
logoURIs: {
png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.png",
svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.svg",
},
},
],
variantGroupKey: "MATIC",
variantGroupKey: "POL",
name: "Polygon",
isAlloyed: false,
verified: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge/src/squid/__tests__/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ export const MockChains = [
chainId: 137,
nativeCurrency: {
name: "Polygon",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
icon: "https://raw.githubusercontent.com/axelarnetwork/axelar-docs/main/public/images/chains/polygon.svg",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ describe("SquidBridgeProvider", () => {
chainId: 137,
nativeCurrency: {
name: "Polygon",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
icon: "https://raw.githubusercontent.com/axelarnetwork/axelar-docs/main/public/images/chains/polygon.svg",
},
Expand Down
8 changes: 4 additions & 4 deletions packages/server/src/queries/__tests__/mock-asset-lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ export const AssetLists: AssetList[] = [
sourceDenom: "wmatic-wei",
coinMinimalDenom:
"ibc/AB589511ED0DD5FA56171A39978AFBF1371DB986EC1C3526CE138A16377E39BB",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
logoURIs: {
png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.png",
Expand Down Expand Up @@ -1508,22 +1508,22 @@ export const AssetLists: AssetList[] = [
chainType: "evm",
chainId: 137,
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
logoURIs: {
png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.png",
svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.svg",
},
},
],
variantGroupKey: "MATIC",
variantGroupKey: "POL",
name: "Polygon",
isAlloyed: false,
verified: true,
unstable: false,
disabled: false,
preview: false,
relative_image_url: "/tokens/generated/matic.png",
relative_image_url: "/tokens/generated/pol.png",
},
{
chainName: "axelar",
Expand Down
8 changes: 4 additions & 4 deletions packages/stores/src/tests/mock-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,7 @@ export const MockAssetList: AssetList[] = [
sourceDenom: "wmatic-wei",
coinMinimalDenom:
"ibc/AB589511ED0DD5FA56171A39978AFBF1371DB986EC1C3526CE138A16377E39BB",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
logoURIs: {
png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.png",
Expand Down Expand Up @@ -2462,22 +2462,22 @@ export const MockAssetList: AssetList[] = [
chainType: "evm",
chainId: 137,
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
logoURIs: {
png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.png",
svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.svg",
},
},
],
variantGroupKey: "MATIC",
variantGroupKey: "POL",
name: "Polygon",
isAlloyed: false,
verified: true,
unstable: false,
disabled: false,
preview: false,
relative_image_url: "/tokens/generated/matic.png",
relative_image_url: "/tokens/generated/pol.png",
},
{
chainName: "axelar",
Expand Down
8 changes: 4 additions & 4 deletions packages/trpc/src/__tests_e2e__/mock-asset-lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ export const AssetLists: AssetList[] = [
sourceDenom: "wmatic-wei",
coinMinimalDenom:
"ibc/AB589511ED0DD5FA56171A39978AFBF1371DB986EC1C3526CE138A16377E39BB",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
logoURIs: {
png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.png",
Expand Down Expand Up @@ -1508,22 +1508,22 @@ export const AssetLists: AssetList[] = [
chainType: "evm",
chainId: 137,
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
logoURIs: {
png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.png",
svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.svg",
},
},
],
variantGroupKey: "MATIC",
variantGroupKey: "POL",
name: "Polygon",
isAlloyed: false,
verified: true,
unstable: false,
disabled: false,
preview: false,
relative_image_url: "/tokens/generated/matic.png",
relative_image_url: "/tokens/generated/pol.png",
},
{
chainName: "axelar",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/components/complex/orders-history/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const OrderHistory = observer(() => {
} = useOrderbookAllActiveOrders({
userAddress: wallet?.address ?? "",
pageSize: 20,
refetchInterval: 10000,
refetchInterval: featureFlags.sqsActiveOrders ? 10000 : 30000,
});
const groupedOrders = useMemo(() => groupOrdersByStatus(orders), [orders]);
const groups = useMemo(
Expand Down Expand Up @@ -123,7 +123,7 @@ export const OrderHistory = observer(() => {
useOrderbookClaimableOrders({
userAddress: wallet?.address ?? "",
disabled: isLoading || filledOrdersInDisplay.length === 0 || isRefetching,
refetchInterval: 10000,
refetchInterval: featureFlags.sqsActiveOrders ? 10000 : 30000,
});

const claimOrders = useCallback(async () => {
Expand Down
11 changes: 9 additions & 2 deletions packages/web/components/complex/portfolio/historical-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const PortfolioHistoricalChart = ({
setIsChartMinimized,
}: PortfolioHistoricalChartProps) => {
const { t } = useTranslation();
const { logEvent } = useAmplitudeAnalytics();
const { logEvent, getLastEvent } = useAmplitudeAnalytics();

return (
<section className="relative flex h-[468px] max-h-[468px] flex-col justify-between">
Expand All @@ -54,7 +54,14 @@ export const PortfolioHistoricalChart = ({
onPointerHover={(value, time) => {
setShowDate(true);
setDataPoint({ value, time });
logEvent([EventName.Portfolio.chartInteraction]);

const lastEvent = getLastEvent();
// Avoid logging subsequent chartInteraction events to prevent Amplitude overload
if (
lastEvent?.eventName !== EventName.Portfolio.chartInteraction
) {
logEvent([EventName.Portfolio.chartInteraction]);
}
}}
onPointerOut={resetDataPoint}
/>
Expand Down
17 changes: 16 additions & 1 deletion packages/web/components/earn/filters/filter-context.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { createContext, PropsWithChildren, useCallback, useState } from "react";
import { useRouter } from "next/router";
import {
createContext,
PropsWithChildren,
useCallback,
useEffect,
useState,
} from "react";

import {
ListOption,
Expand Down Expand Up @@ -47,6 +54,14 @@ export const FilterProvider = ({
defaultFilters,
}: PropsWithChildren<{ defaultFilters: Filters }>) => {
const [filters, setFilters] = useState<Filters>(defaultFilters);
const router = useRouter();
const { search } = router.query;

useEffect(() => {
if (typeof search === "string" && search !== "") {
setFilters((prev) => ({ ...prev, search }));
}
}, [search]);

const setFilter = useCallback<SetFilterFn>(
(key, value) => {
Expand Down
15 changes: 15 additions & 0 deletions packages/web/config/analytics-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Logged to Amplitude at https://analytics.amplitude.com/osmosis-zone/
*/

import { AllocationOptions } from "~/components/complex/portfolio/types";

// Should be in sync with: https://docs.google.com/spreadsheets/d/18w8VwJmmRdb_E-XkE1UjkqhLxCyhqVVhWlzDgTtbRWo/edit?usp=sharing
// For maintainability - all event logs should be in high level component

Expand Down Expand Up @@ -71,6 +73,19 @@ export type EventProperties = {
walletName: string;
transferDirection: "deposit" | "withdraw";
swapSource: "market" | "swap";
coinDenom: string;
appName: string;
isFeatured: boolean;
isBanner: boolean;
position: number;
allocationType: AllocationOptions;
section: string;
tokenIn: string;
tokenOut: string;
option: string;
numberOfValidators: number;
validatorNames: string[];
squadSize: number;
};

export type UserProperties = {
Expand Down
6 changes: 3 additions & 3 deletions packages/web/config/mock-asset-lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ export const AssetLists: AssetList[] = [
sourceDenom: "wmatic-wei",
coinMinimalDenom:
"ibc/AB589511ED0DD5FA56171A39978AFBF1371DB986EC1C3526CE138A16377E39BB",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
logoURIs: {
png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.png",
Expand Down Expand Up @@ -1506,15 +1506,15 @@ export const AssetLists: AssetList[] = [
chainType: "evm",
chainId: 137,
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
symbol: "MATIC",
symbol: "POL",
decimals: 18,
logoURIs: {
png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.png",
svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polygon/images/matic-purple.svg",
},
},
],
variantGroupKey: "MATIC",
variantGroupKey: "POL",
name: "Polygon",
isAlloyed: false,
verified: true,
Expand Down
Loading

0 comments on commit 9278038

Please sign in to comment.