Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic wallet test #1210

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/connect-v1/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/connect-v1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@mui/icons-material": "^5.14.11",
"@mui/material": "^5.12.1",
"@tanstack/react-query": "^5.14.2",
"@wormhole-foundation/wormhole-connect": "^0.3.22-beta.6-development",
"@wormhole-foundation/wormhole-connect": "file:wormhole-foundation-wormhole-connect-0.3.7.tgz",
"aptos": "^1.21.0",
"bech32": "^2.0.0",
"dompurify": "^3.0.6",
Expand Down
Binary file not shown.
15,476 changes: 10,781 additions & 4,695 deletions apps/connect/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@mui/material": "^5.12.1",
"@tanstack/react-query": "^5.14.2",
"@wormhole-foundation/sdk": "^1.0.0",
"@wormhole-foundation/wormhole-connect": "^1.1.6",
"@wormhole-foundation/wormhole-connect": "file:wormhole-foundation-wormhole-connect-1.0.0.tgz",
"aptos": "^1.21.0",
"bech32": "^2.0.0",
"dompurify": "^3.0.6",
Expand Down
3 changes: 2 additions & 1 deletion apps/connect/src/env/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const chains = [
"Scroll",
"Xlayer",
"Mantle",
"Worldchain",
];

export const MAINNET_RPCS = {
Expand All @@ -48,7 +49,7 @@ export const wormholeConnectConfigCommon: Partial<WormholeConnectConfig> = {
href: `https://wormholescan.io/#/txs?address={:address}&network=${CLUSTER}`,
},
menu: [],
// showInProgressWidget: true,
showInProgressWidget: true,
},
network: CLUSTER,
rpcs: {},
Expand Down
35 changes: 34 additions & 1 deletion apps/connect/src/env/token-bridge.mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const ENV: Env = {
rpcs: MAINNET_RPCS,
routes: [
...DEFAULT_ROUTES,
MayanRouteWH,
MayanRouteWH as any, // FIXME: Remove this any and fix wh connect type issues
MayanRouteMCTP,
MayanRouteSWIFT,
...nttRoutes({
Expand Down Expand Up @@ -684,6 +684,26 @@ export const ENV: Env = {
Lumos: {
Solana: "6xTAKg6SQejorPyubo3asYY1sLco66DA5vDbfZbheVub",
},
Worldcoin: {
Ethereum: "0xE0A18B60BeBEdcb788585b01ab23439fD6b70F0c",
Solana: "WSgvEfWpAUg5xACJkc1dakYAqJm8eGge3U7LGs7oqqJ",
Arbitrum: "0x662565cb134881D6F7C2b104143E6217555A5628",
Base: "0xDDF45E2B3256b2c89551c418f9b2A47d04e0F391",
Sui: "0xc2ef84967f43f447e76be144cc44ebd69ddf85a0ae612101af780ec251d2f15d::coin::COIN",
Bsc: "0x0d330283e8F3414D44Afd0796C50cf1FF04982d6",
Optimism: "0xED6Ce6D7c5c623D605caf4b9e3967BabCB069D34",
Fantom: "0x1fd9c1F569fb3bbD6ad4dfA4ABAeF8b269EC3339",
Polygon: "0x30aD88e1C594F13B43aa1e53c526D0ab4b2077d0",
Celo: "0x9836c625210389a05e1d7473Cf82AC3c627f61A4",
Moonbeam: "0x341d95086ec63A08836dcE66FAd837aA49995B7D",
Klaytn: "0xf1503817FE623438bBF0A8E03258b5eDcdaFd214",
Aptos:
"0x01aad41572eb11435df33d6d4a605814a4b6ee73fc2d566204220d8f4bfee7fe::coin::T",
Avalanche: "0x768a15C2942880A997594eb1451D8950367A2184",
Scroll: "0x2b02D2c8F44e982b462fee4B97fa6bD49388bEc3",
Mantle: "0x2a76b7dE7902BA089EdD39C17Df38c4a2CdDAd0B",
Xlayer: "0x8173Aba689eC001af9918B170a3946826212A366",
},
},
tokensConfig: {
stBTC: {
Expand Down Expand Up @@ -1407,6 +1427,19 @@ export const ENV: Env = {
coinGeckoId: "lumoscoin",
decimals: 18,
},
Worldcoin: {
key: "Worldcoin",
symbol: "WLD",
displayName: "Worldcoin",
nativeChain: "Worldchain",
tokenId: {
chain: "Worldchain",
address: "0x2cFc85d8E48F8EAB294be644d9E25C3030863003",
},
icon: "https://assets.coingecko.com/coins/images/31069/large/worldcoin.jpeg?1696529903",
coinGeckoId: "worldcoin-wld",
decimals: 18,
},
},
}
),
Expand Down
1 change: 1 addition & 0 deletions apps/connect/src/env/usdc-bridge.mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const ENV: Env = {
"Base",
"Polygon",
"Solana",
"Sui",
],
}
),
Expand Down
1 change: 1 addition & 0 deletions apps/connect/src/env/usdc-bridge.testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const ENV: Env = {
"BaseSepolia",
"PolygonSepolia",
"Solana",
"Sui",
],
}
),
Expand Down
1 change: 1 addition & 0 deletions apps/connect/src/env/usdc-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const ENV: Env = {
"USDCbase",
"USDCpolygon",
"USDCsol",
"USDCsui",
],
}
),
Expand Down
7 changes: 5 additions & 2 deletions apps/connect/src/providers/sanctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export const getTrmChainName = (chain: Chain) => {

if (trmChainNames[id]) return trmChainNames[id];
if (isCosmWasmChain(toChainNameFormat(chain))) return "cosmos";
if (isEVMChain(toChainNameFormat(chain))) return "ethereum";
// TO DO: Add support for other evm chains with the new sdk
if (isEVMChain(toChainNameFormat(chain)) || chain === "Worldchain")
return "ethereum";

return "";
};
Expand Down Expand Up @@ -97,7 +99,8 @@ export const isSanctionedAddress = async (
address: transferDetails.toWalletAddress,
}),
...(transferDetails.toChain !== "Ethereum" &&
isEVMChain(toChainNameFormat(transferDetails.toChain))
(isEVMChain(toChainNameFormat(transferDetails.toChain)) ||
transferDetails.toChain === "Worldchain")
? [
isSanctioned({
chain: "ethereum",
Expand Down
2 changes: 2 additions & 0 deletions apps/connect/src/utils/getSortedChains.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe("getSortedChains", () => {
"Scroll",
"Xlayer" as any,
"Mantle",
"Worldchain",
"Solana",
"Injective",
"Klaytn",
Expand Down Expand Up @@ -60,6 +61,7 @@ describe("getSortedChains", () => {
"Kujira",
"Evmos",
"Xlayer",
"Worldchain",
]);
});

Expand Down
3 changes: 2 additions & 1 deletion apps/connect/src/utils/isValidAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export const isValidAddress = async (
address: string,
chain: Chain
): Promise<boolean> => {
if (isEVMChain(toChainNameFormat(chain)))
// TO DO: Add support for other evm chains with the new sdk
if (isEVMChain(toChainNameFormat(chain)) || chain === "Worldchain")
return isValidEthereumAddress(address);
if (chain === "Solana") return isValidSolanaAddress(address);
if (chain === "Aptos") return isValidAptosAddress(address);
Expand Down
Binary file not shown.
Loading