Skip to content

Commit b4f3361

Browse files
committed
meta.name change, resume works
1 parent 82011fc commit b4f3361

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

connect/src/routes/tbtc/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The TBTCRoute enables the transfer of both native and Wormhole-wrapped Ethereum TBTC.
22

3-
Arbitrum, Base, Optimism, Polygon, and Solana have a gateway contract. This contract mints native TBTC when it receives a payload3 transfer of Wormhole-wrapped TBTC from the token bridge. Conversely, it burns native TBTC when bridging out, unlocks and bridges Wormhole-wrapped TBTC through the token bridge. Wormhole-wrapped TBTC serves as the "highway" asset for bridging TBTC between chains. Transfers of TBTC to chains without a gateway contract are regular token bridge transfers.
3+
Arbitrum, Base, Optimism, Polygon, and Solana have a gateway contract. This contract mints native TBTC when it receives a payload3 transfer of Wormhole-wrapped TBTC from the token bridge. Conversely, it burns native TBTC, unlocks and bridges Wormhole-wrapped TBTC through the token bridge when bridging out. Wormhole-wrapped TBTC serves as the "highway" asset for bridging TBTC between chains. Transfers of TBTC to chains without a gateway contract are regular token bridge transfers.
44

55
You can view the EVM L2WormholeGateway contract code [here](https://github.com/keep-network/tbtc-v2/blob/main/solidity/contracts/l2/L2WormholeGateway.sol). The Solana program is [here](https://github.com/keep-network/tbtc-v2/tree/main/cross-chain/solana).

connect/src/routes/tbtc/tbtc.ts

+18-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class TBTCRoute<N extends Network>
6868
implements StaticRouteMethods<typeof TBTCRoute>
6969
{
7070
static meta = {
71-
name: "TBTCBridge",
71+
name: "ManualTBTC",
7272
};
7373

7474
static supportedNetworks(): Network[] {
@@ -261,9 +261,23 @@ export class TBTCRoute<N extends Network>
261261
}
262262

263263
async resume(txid: TransactionId): Promise<R> {
264-
//const xfer = await TokenTransfer.from(this.wh, txid, 10 * 1000);
265-
//return TokenTransfer.getReceipt(xfer);
266-
throw new Error("Method not implemented.");
264+
const vaa = await this.wh.getVaa(txid.txid, TBTCBridge.getTransferDiscriminator());
265+
if (!vaa) throw new Error("No VAA found for transaction: " + txid);
266+
267+
return {
268+
originTxs: [txid],
269+
state: TransferState.Attested,
270+
from: vaa.emitterChain,
271+
to: vaa.payload.to.chain,
272+
attestation: {
273+
id: {
274+
chain: vaa.emitterChain,
275+
emitter: vaa.emitterAddress,
276+
sequence: vaa.sequence,
277+
},
278+
attestation: vaa,
279+
},
280+
} satisfies AttestedTransferReceipt<AttestationReceipt<"TBTCBridge">>;
267281
}
268282

269283
async *track(receipt: Receipt, timeout?: number) {

0 commit comments

Comments
 (0)