Skip to content

Commit

Permalink
sui: cctp manual support
Browse files Browse the repository at this point in the history
  • Loading branch information
kev1n-peters committed Dec 12, 2024
1 parent 4b43423 commit 01ad39e
Show file tree
Hide file tree
Showing 13 changed files with 143 additions and 101 deletions.
5 changes: 3 additions & 2 deletions connect/src/protocols/cctp/cctpTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export class CircleTransfer<N extends Network = Network>
try {
msgIds = await fromChain.parseTransaction(txid);
} catch (e: any) {
if (e.message.includes("no bridge messages found")) {
if (e.message.includes("no bridge messages found") || e.message.includes("not found")) {
// This means it's a Circle attestation; swallow
} else {
throw e;
Expand Down Expand Up @@ -592,7 +592,8 @@ export namespace CircleTransfer {

// https://developers.circle.com/stablecoins/docs/required-block-confirmations
const eta =
(srcChain.chain === "Polygon" ? 2_000 * 200 : finality.estimateFinalityTime(srcChain.chain)) + guardians.guardianAttestationEta;
(srcChain.chain === "Polygon" ? 2_000 * 200 : finality.estimateFinalityTime(srcChain.chain)) +
guardians.guardianAttestationEta;
if (!transfer.automatic) {
return {
sourceToken: { token: srcToken, amount: transfer.amount },
Expand Down
2 changes: 1 addition & 1 deletion core/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@
"prettier": "prettier --write ./src"
},
"type": "module"
}
}
9 changes: 5 additions & 4 deletions core/base/src/constants/circle.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Column, Flatten, MapLevel} from './../utils/index.js';
import { constMap, zip } from './../utils/index.js';
import type { Chain } from './chains.js';
import type { Network } from './networks.js';
import type { Column, Flatten, MapLevel } from "./../utils/index.js";
import { constMap, zip } from "./../utils/index.js";
import type { Chain } from "./chains.js";
import type { Network } from "./networks.js";

const circleAPIs = [
["Mainnet", "https://iris-api.circle.com/v1/attestations"],
Expand All @@ -19,6 +19,7 @@ const usdcContracts = [[
["Solana", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"],
["Base", "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"],
["Polygon", "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"],
["Sui", "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC"],
]], [
"Testnet", [
["Sepolia", "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"],
Expand Down
8 changes: 4 additions & 4 deletions core/base/src/constants/contracts/circle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export const circleContracts = [[
wormhole: "0x0FF28217dCc90372345954563486528aa865cDd6",
}], [
"Sui", {
tokenMessenger: "",
messageTransmitter: "",
tokenMessenger: "0x2aa6c5d56376c371f88a6cc42e852824994993cb9bab8d3e6450cbe3cb32b94e",
messageTransmitter: "0x08d87d37ba49e785dde270a83f8e979605b03dc552b5548f26fdf2f49bf7ed1b",
wormholeRelayer: "",
wormhole: "",
}],
Expand Down Expand Up @@ -105,8 +105,8 @@ export const circleContracts = [[
wormhole: "0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c",
}], [
"Sui", {
tokenMessenger: "0x4e16078afc5ebfc244a8107ded4044970df5d84db384e7194b7fc444090683fd",
messageTransmitter: "0x4741a96a5903c80613f2d013492a47741cf10c6246ea38a724d354a09895cf8f",
tokenMessenger: "0x31cc14d80c175ae39777c0238f20594c6d4869cfab199f40b69f3319956b8beb",
messageTransmitter: "0x4931e06dce648b3931f890035bd196920770e913e43e45990b383f6486fdd0a5",
wormholeRelayer: "",
wormhole: "",
}],
Expand Down
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@
"dependencies": {
"@wormhole-foundation/sdk": "1.0.3"
}
}
}
18 changes: 18 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"platforms/sui",
"platforms/sui/protocols/core",
"platforms/sui/protocols/tokenBridge",
"platforms/sui/protocols/cctp",
"platforms/aptos",
"platforms/aptos/protocols/core",
"platforms/aptos/protocols/tokenBridge",
Expand Down
2 changes: 1 addition & 1 deletion platforms/solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@
}
}
}
}
}
6 changes: 3 additions & 3 deletions platforms/sui/protocols/cctp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wormhole-foundation/sdk-sui-cctp",
"version": "0.14.0",
"version": "1.0.3",
"repository": {
"type": "git",
"url": "git+https://github.com/wormhole-foundation/wormhole-sdk-ts.git"
Expand Down Expand Up @@ -46,8 +46,8 @@
},
"dependencies": {
"@mysten/sui.js": "^0.50.1",
"@wormhole-foundation/sdk-connect": "0.14.0",
"@wormhole-foundation/sdk-sui": "0.14.0"
"@wormhole-foundation/sdk-connect": "1.0.3",
"@wormhole-foundation/sdk-sui": "1.0.3"
},
"type": "module",
"exports": {
Expand Down
Loading

0 comments on commit 01ad39e

Please sign in to comment.