Skip to content

Commit

Permalink
Merge branch 'main' into env/testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrsoares committed Jan 15, 2024
2 parents 261d18c + 4cf6ec3 commit ac462dd
Show file tree
Hide file tree
Showing 14 changed files with 860 additions and 732 deletions.
14 changes: 7 additions & 7 deletions apps/maestro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@
"@trpc/server": "^10.45.0",
"@vercel/kv": "^1.0.1",
"@vercel/postgres": "^0.5.1",
"@web3modal/wagmi": "^3.5.5",
"@web3modal/wagmi": "^3.5.6",
"drizzle-orm": "^0.29.3",
"lucide-react": "^0.265.0",
"next": "^14.0.4",
"nextjs-cors": "^2.2.0",
"nprogress": "^0.2.0",
"openai": "^4.24.1",
"openai": "^4.24.7",
"pg": "^8.11.3",
"rambda": "^8.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.49.2",
"react-hook-form": "^7.49.3",
"react-jazzicon": "^1.0.4",
"react-markdown": "^9.0.1",
"react-spinners": "^0.13.8",
"redoc": "^2.1.3",
"superjson": "^2.2.1",
"swagger-ui-react": "^5.10.5",
"swagger-ui-react": "^5.11.0",
"tailwind-styled-components": "^2.2.0",
"trpc-openapi": "^1.2.0",
"unfetch": "^4.2.0",
Expand All @@ -76,12 +76,12 @@
"@babel/core": "^7.23.7",
"@next/bundle-analyzer": "^14.0.4",
"@playwright/test": "^1.40.1",
"@sentry/cli": "^2.23.2",
"@sentry/cli": "^2.25.0",
"@tanstack/react-query-devtools": "^4.36.1",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.2",
"@types/node": "^20.10.6",
"@types/node": "^20.11.2",
"@types/nprogress": "^0.2.3",
"@types/react": "18.2.21",
"@types/react-dom": "^18.2.18",
Expand All @@ -105,7 +105,7 @@
"matchers": "link:@testing-library/jest-dom/matchers",
"next-auth": "^4.24.5",
"postcss": "^8.4.32",
"tailwindcss": "^3.4.0",
"tailwindcss": "^3.4.1",
"tsx": "^4.7.0",
"typescript": "^5.3.3",
"vitest": "^0.34.6",
Expand Down
10 changes: 10 additions & 0 deletions apps/maestro/src/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,13 @@ export const NEXT_PUBLIC_DISABLED_WALLET_IDS = Maybe.of(
)
.map(split(","))
.mapOr([], map(trim));

export const shouldDisableSend = (
axelarChainId: string,
tokenAddress: `0x${string}`
) => {
const shouldDisable: Record<string, Record<`0x${string}`, boolean>> = {
optimism: { "0x4200000000000000000000000000000000000042": true },
};
return shouldDisable[axelarChainId]?.[tokenAddress];
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Link from "next/link";
import { TransactionExecutionError } from "viem";
import { useAccount, useChainId, useSwitchNetwork } from "wagmi";

import { shouldDisableSend } from "~/config/env";
import { useInterchainTokenBalanceForOwnerQuery } from "~/services/interchainToken/hooks";
import BigNumberText from "~/ui/components/BigNumberText";
import { ChainIcon } from "~/ui/components/EVMChainsDropdown";
Expand Down Expand Up @@ -233,7 +234,13 @@ export const RegisteredInterchainTokenCard: FC<Props> = (props) => {
size="xs"
variant="primary"
className="absolute right-6"
disabled={!props.hasRemoteTokens}
disabled={
!props.hasRemoteTokens ||
shouldDisableSend(
props.axelarChainId,
props.tokenAddress
)
}
>
Transfer
</Button>
Expand Down
1 change: 1 addition & 0 deletions apps/maestro/src/features/InterchainTokenList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { ExtendedWagmiChainConfig } from "~/config/wagmi";
type Kind = "canonical" | "interchain";

export type TokenInfo = {
axelarChainId: string;
chainId: number;
isRegistered: boolean;
isOriginToken: boolean;
Expand Down
22 changes: 18 additions & 4 deletions apps/maestro/src/server/routers/erc20/getERC20TokenDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ import { ExtendedWagmiChainConfig } from "~/config/evm-chains";
import { hex40Literal } from "~/lib/utils/validation";
import { publicProcedure } from "~/server/trpc";

//TODO: migrate to kv store?
const overrides: Record<`0x${string}`, Record<string, string>> = {
"0x4200000000000000000000000000000000000042": {
symbol: "axlOP",
},
};

export const getERC20TokenDetails = publicProcedure
.input(
z.object({
Expand All @@ -32,7 +39,11 @@ export const getERC20TokenDetails = publicProcedure
);

try {
const details = await getTokenPublicDetails(client, config);
const details = await getTokenPublicDetails(
client,
config,
input.tokenAddress
);

if (details) {
return details;
Expand All @@ -55,7 +66,7 @@ export const getERC20TokenDetails = publicProcedure
input.tokenAddress
);

return getTokenPublicDetails(client, chainConfig);
return getTokenPublicDetails(client, chainConfig, input.tokenAddress);
} catch (error) {
// If we get a TRPC error, we throw it
if (error instanceof TRPCError) {
Expand All @@ -71,7 +82,8 @@ export const getERC20TokenDetails = publicProcedure

async function getTokenPublicDetails(
client: IERC20BurnableMintableClient,
chainConfig: ExtendedWagmiChainConfig
chainConfig: ExtendedWagmiChainConfig,
tokenAddress: `0x${string}`
) {
invariant(client.chain, "client.chain must be defined");

Expand All @@ -83,13 +95,15 @@ async function getTokenPublicDetails(
client.read("pendingOwner").catch(always(null)),
]);

const override = overrides[tokenAddress];

return {
chainId: client.chain.id,
chainName: client.chain.name,
axelarChainId: chainConfig.axelarChainId,
axelarChainName: chainConfig.axelarChainName,
name,
symbol,
symbol: override?.symbol ?? symbol,
decimals,
owner,
pendingOwner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ const TokenDetailsSection: FC<TokenDetailsSectionProps> = (props) => {
<section className="grid gap-6">
<div className="flex items-center justify-between">
<div className="flex flex-wrap items-center gap-2 text-2xl font-bold">
<span className="hidden sm:inline">
{props.kind === "canonical" && "Canonical"} Interchain Token{" "}
</span>
<span className="hidden sm:inline">Interchain Token </span>
{Boolean(props.name && props.symbol) && (
<>
<span className="hidden sm:inline">&middot;</span>
Expand All @@ -90,6 +88,13 @@ const TokenDetailsSection: FC<TokenDetailsSectionProps> = (props) => {
<ExternalLinkIcon className="h-4 w-4 translate-x-1" />
</LinkButton>
</div>

{props.kind === "canonical" && (
<div className="italic">
{" "}
This is a wrapped token deployed via ITS, powered by Axelar
</div>
)}
<ul className="grid gap-1.5">
{sanitizedTokenDetails.map(([label, value]) => (
<li key={String(label)} className="flex items-center gap-2 text-sm">
Expand Down
4 changes: 2 additions & 2 deletions apps/registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"tailwind-styled-components": "^2.2.0"
},
"devDependencies": {
"@types/node": "^20.10.6",
"@types/node": "^20.11.2",
"@types/react": "18.2.21",
"@types/react-dom": "^18.2.18",
"autoprefixer": "^10.4.16",
"eslint": "^8.56.0",
"eslint-config-next": "^14.0.4",
"postcss": "8.4.27",
"tailwindcss": "^3.4.0",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@
"@commitlint/config-conventional": "^17.8.1",
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
"@tsconfig/strictest": "^2.0.2",
"@types/node": "^20.10.6",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"@types/node": "^20.11.2",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"eslint": "^8.56.0",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"package-json": "^8.1.1",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"rimraf": "^5.0.5",
"turbo": "^1.11.2",
"turbo": "^1.11.3",
"typescript": "^5.3.3"
},
"pnpm": {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"devDependencies": {
"@axelarjs/config": "workspace:*",
"@axelarjs/utils": "workspace:*",
"@types/node": "^20.10.6",
"@types/node": "^20.11.2",
"fast-check": "^3.15.0",
"happy-dom": "^9.20.3",
"matchers": "link:@testing-library/jest-dom/matchers",
Expand Down
2 changes: 1 addition & 1 deletion packages/evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"devDependencies": {
"@axelar-network/interchain-token-service": "^1.2.1",
"@axelarjs/config": "workspace:*",
"@types/node": "^20.10.6",
"@types/node": "^20.11.2",
"@types/prettier": "^2.7.3",
"commander": "^11.1.0",
"prettier": "^2.8.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/proto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"devDependencies": {
"@axelarjs/config": "workspace:*",
"@types/node": "^20.10.6",
"@types/node": "^20.11.2",
"degit": "^2.8.4",
"prettier": "^2.8.8",
"rimraf": "^5.0.5",
Expand Down
32 changes: 16 additions & 16 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"dependencies": {
"@axelarjs/config": "workspace:*",
"@axelarjs/utils": "workspace:*",
"@headlessui/react": "^1.7.17",
"@headlessui/react": "^1.7.18",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-portal": "^1.0.4",
Expand All @@ -86,25 +86,25 @@
},
"devDependencies": {
"@inquirer/prompts": "^3.3.0",
"@storybook/addon-essentials": "^7.6.7",
"@storybook/addon-interactions": "^7.6.7",
"@storybook/addon-links": "^7.6.7",
"@storybook/addons": "^7.6.7",
"@storybook/blocks": "^7.6.7",
"@storybook/client-logger": "^7.6.7",
"@storybook/preview-api": "^7.6.7",
"@storybook/react": "^7.6.7",
"@storybook/react-vite": "^7.6.7",
"@storybook/addon-essentials": "^7.6.8",
"@storybook/addon-interactions": "^7.6.8",
"@storybook/addon-links": "^7.6.8",
"@storybook/addons": "^7.6.8",
"@storybook/blocks": "^7.6.8",
"@storybook/client-logger": "^7.6.8",
"@storybook/preview-api": "^7.6.8",
"@storybook/react": "^7.6.8",
"@storybook/react-vite": "^7.6.8",
"@storybook/testing-library": "^0.2.2",
"@storybook/theming": "^7.6.7",
"@storybook/types": "^7.6.7",
"@storybook/theming": "^7.6.8",
"@storybook/types": "^7.6.8",
"@svgr/cli": "^7.0.0",
"@tailwindcss/typography": "^0.5.10",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.2",
"@tsconfig/strictest": "^2.0.2",
"@types/node": "^20.10.6",
"@types/node": "^20.11.2",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"@types/testing-library__jest-dom": "^5.14.9",
Expand All @@ -117,13 +117,13 @@
"happy-dom": "^9.20.3",
"husky": "^8.0.3",
"matchers": "link:@testing-library/jest-dom/matchers",
"postcss": "^8.4.32",
"postcss": "^8.4.33",
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.3.0",
"pretty-quick": "^3.1.3",
"prop-types": "^15.8.1",
"storybook": "^7.6.7",
"tailwindcss": "^3.4.0",
"storybook": "^7.6.8",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
"tailwindcss-radix": "^2.8.0",
"tsup": "^8.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@tsconfig/strictest": "^2.0.2",
"@types/lodash.debounce": "^4.0.9",
"@types/lodash.throttle": "^4.1.9",
"@types/node": "^20.10.6",
"@types/node": "^20.11.2",
"@types/ramda": "^0.29.9",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
Expand Down
Loading

0 comments on commit ac462dd

Please sign in to comment.