Skip to content

Commit

Permalink
remove outdated relayer api from cctp example & readme (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniko authored Aug 9, 2024
1 parent faf96ba commit 0bd3898
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 27 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,6 @@ We can also transfer native USDC using [Circle's CCTP](https://www.circle.com/en
const srcTxids = await xfer.initiateTransfer(src.signer);
console.log(`Started Transfer: `, srcTxids);

if (req.automatic) {
const relayStatus = await waitForRelay(srcTxids[srcTxids.length - 1]!);
console.log(`Finished relay: `, relayStatus);
return;
}

// Note: Depending on chain finality, this timeout may need to be increased.
// See https://developers.circle.com/stablecoin/docs/cctp-technical-reference#mainnet for more
console.log("Waiting for Attestation");
Expand Down
8 changes: 1 addition & 7 deletions examples/src/cctp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CircleTransfer, amount, wormhole } from "@wormhole-foundation/sdk";
import evm from "@wormhole-foundation/sdk/evm";
import solana from "@wormhole-foundation/sdk/solana";
import type { SignerStuff } from "./helpers/index.js";
import { getSigner, waitForRelay } from "./helpers/index.js";
import { getSigner } from "./helpers/index.js";

/*
Notes:
Expand Down Expand Up @@ -96,12 +96,6 @@ async function cctpTransfer<N extends Network>(
const srcTxids = await xfer.initiateTransfer(src.signer);
console.log(`Started Transfer: `, srcTxids);

if (req.automatic) {
const relayStatus = await waitForRelay(srcTxids[srcTxids.length - 1]!);
console.log(`Finished relay: `, relayStatus);
return;
}

// Note: Depending on chain finality, this timeout may need to be increased.
// See https://developers.circle.com/stablecoin/docs/cctp-technical-reference#mainnet for more
console.log("Waiting for Attestation");
Expand Down
8 changes: 0 additions & 8 deletions examples/src/helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,3 @@ export async function waitLog<N extends Network = Network>(
}
return receipt;
}

// Note: This API may change but it is currently the best place to pull
// the relay status from
export async function waitForRelay(txid: TxHash): Promise<api.RelayData | null> {
const relayerApi = "https://relayer.dev.stable.io";
const task = () => api.getRelayStatus(relayerApi, txid);
return tasks.retry<api.RelayData>(task, 5000, 60 * 1000, "Wormhole:GetRelayStatus");
}
6 changes: 0 additions & 6 deletions sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,6 @@ We can also transfer native USDC using [Circle's CCTP](https://www.circle.com/en
const srcTxids = await xfer.initiateTransfer(src.signer);
console.log(`Started Transfer: `, srcTxids);

if (req.automatic) {
const relayStatus = await waitForRelay(srcTxids[srcTxids.length - 1]!);
console.log(`Finished relay: `, relayStatus);
return;
}

// Note: Depending on chain finality, this timeout may need to be increased.
// See https://developers.circle.com/stablecoin/docs/cctp-technical-reference#mainnet for more
console.log("Waiting for Attestation");
Expand Down

0 comments on commit 0bd3898

Please sign in to comment.