@@ -37,6 +37,7 @@ import type {
37
37
import { TransferState , isAttested , isSourceFinalized , isSourceInitiated } from "../../types.js" ;
38
38
import { Wormhole } from "../../wormhole.js" ;
39
39
import type { WormholeTransfer } from "../wormholeTransfer.js" ;
40
+ import { finality } from "@wormhole-foundation/sdk-base" ;
40
41
41
42
export class CircleTransfer < N extends Network = Network >
42
43
implements WormholeTransfer < CircleTransfer . Protocol >
@@ -225,10 +226,10 @@ export class CircleTransfer<N extends Network = Network>
225
226
try {
226
227
msgIds = await fromChain . parseTransaction ( txid ) ;
227
228
} catch ( e : any ) {
228
- if ( e . message . includes ( ' no bridge messages found' ) ) {
229
+ if ( e . message . includes ( " no bridge messages found" ) ) {
229
230
// This means it's a Circle attestation; swallow
230
231
} else {
231
- throw e
232
+ throw e ;
232
233
}
233
234
}
234
235
@@ -584,10 +585,14 @@ export namespace CircleTransfer {
584
585
const dstToken = Wormhole . chainAddress ( dstChain . chain , dstUsdcAddress ) ;
585
586
const srcToken = Wormhole . chainAddress ( srcChain . chain , srcUsdcAddress ) ;
586
587
588
+ // https://developers.circle.com/stablecoins/docs/required-block-confirmations
589
+ const eta =
590
+ srcChain . chain === "Polygon" ? 2_000 * 200 : finality . estimateFinalityTime ( srcChain . chain ) ;
587
591
if ( ! transfer . automatic ) {
588
592
return {
589
593
sourceToken : { token : srcToken , amount : transfer . amount } ,
590
594
destinationToken : { token : dstToken , amount : transfer . amount } ,
595
+ eta,
591
596
} ;
592
597
}
593
598
@@ -619,6 +624,7 @@ export namespace CircleTransfer {
619
624
destinationToken : { token : dstToken , amount : dstAmount } ,
620
625
relayFee : { token : srcToken , amount : fee } ,
621
626
destinationNativeGas,
627
+ eta,
622
628
} ;
623
629
}
624
630
0 commit comments