Skip to content

Commit

Permalink
Update WC package with sui cctp beta support (#1214)
Browse files Browse the repository at this point in the history
* Update WC package with sui cctp beta support

* Add any type

* Manual route USDC (#1213)

* Update version

* Include worldchain

* Fix

* Fix

* Delete pack

* Fix

---------

Co-authored-by: yuli-ferna <[email protected]>
Co-authored-by: yuli-ferna <[email protected]>
  • Loading branch information
3 people authored Dec 16, 2024
1 parent a4f4141 commit d62a974
Show file tree
Hide file tree
Showing 10 changed files with 2,719 additions and 162 deletions.
2 changes: 1 addition & 1 deletion apps/connect-v1/package-lock.json

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

Binary file modified apps/connect-v1/wormhole-foundation-wormhole-connect-0.3.7.tgz
Binary file not shown.
2,862 changes: 2,706 additions & 156 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": "file:wormhole-foundation-wormhole-connect-1.0.0.tgz",
"@wormhole-foundation/wormhole-connect": "^1.1.8-beta.2-development",
"aptos": "^1.21.0",
"bech32": "^2.0.0",
"dompurify": "^3.0.6",
Expand Down
1 change: 1 addition & 0 deletions 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 Down
2 changes: 1 addition & 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
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.

0 comments on commit d62a974

Please sign in to comment.