Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chesterton put it there for a reason #97

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions examples/src/cctp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ AutoRelayer takes a 0.1usdc fee when xfering to any chain beside goerli, which i
const wh = new Wormhole("Testnet", [EvmPlatform]);

// Grab chain Contexts
const sendChain = wh.getChain("Avalanche");
const rcvChain = wh.getChain("Ethereum");
const sendChain = wh.getChain("Ethereum");
const rcvChain = wh.getChain("Avalanche");

// Get signer from local key but anything that implements
// Signer interface (e.g. wrapper around web wallet) should work
const source = await getStuff(sendChain);
const destination = await getStuff(rcvChain);

// Manual Circle USDC CCTP Transfer
await cctpTransfer(wh, 1_000_000n, source, destination, false);
// await cctpTransfer(wh, 8_000_000n, source, destination, false);

// Automatic Circle USDC CCTP Transfer
// await cctpTransfer(wh, 19_000_000n, source, destination, true);
Expand All @@ -38,19 +38,18 @@ AutoRelayer takes a 0.1usdc fee when xfering to any chain beside goerli, which i
// This is especially helpful for chains with longer time to finality where you don't want
// to have to wait for the attestation to be generated.

// const xfer = await CCTPTransfer.from(wh, {
// chain: "Ethereum",
// txid: "0xc5c9aaa7ecfc08f54db2674f6575fc00b3d0aa7a30bb6461043ac58e00b0f6f3",
// });
// console.log(xfer);
// console.log(await xfer.fetchAttestation(60 * 60 * 1000));
// console.log(await xfer.completeTransfer(destination.signer));
const xfer = await CCTPTransfer.from(wh, {
chain: "Ethereum",
txid: "0x28054d963e2a671f9e62b9cefa5d67fb857dd8f2259ce645e136bf7957354a09",
});
console.log(xfer);
console.log(await xfer.fetchAttestation(60 * 60 * 1000));
console.log(await xfer.completeTransfer(destination.signer));

//const xfer = await CCTPTransfer.from(wh, {
// message:
// "0000000000000001000000000000000000048de9000000000000000000000000eb08f243e5d3fcff26a9e38ae5520a669f4019d0000000000000000000000000d0c3da58f55358142b8d3e06c1c30c5c6114efe80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005425890298aed601595a70ab815c96711a31bc650000000000000000000000006603b4a7e29dfbdb6159c395a915e74757c1fb1300000000000000000000000000000000000000000000000000000000000f42400000000000000000000000006603b4a7e29dfbdb6159c395a915e74757c1fb13",
// msgHash:
// "0x212cc4cee09b47f84530638474db84832ac9e72f6c264aeca6f53904e352f80a",
// msgHash: "",
//});
//console.log(xfer);
})();
Expand Down
2 changes: 1 addition & 1 deletion examples/src/tokenBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { TransferStuff, getStuff, waitLog } from "./helpers";

// Grab chain Contexts
const sendChain = wh.getChain("Avalanche");
const rcvChain = wh.getChain("Sei");
const rcvChain = wh.getChain("Solana");

// Get signer from local key but anything that implements
// Signer interface (e.g. wrapper around web wallet) should work
Expand Down
4 changes: 2 additions & 2 deletions platforms/solana/src/utils/wormhole/instructions/postVaa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import BN from 'bn.js';
* Make {@link TransactionInstruction} for `post_vaa` instruction.
*
* This is used in {@link createPostSignedVaaTransactions}'s last transaction.
* `signatureSet` is a {@link web3.Keypair} generated outside of this method, which was used
* `signatureSet` is a {@link @solana/web3.Keypair} generated outside of this method, which was used
* to write signatures and the message hash to.
*
* https://github.com/certusone/wormhole/blob/main/solana/bridge/program/src/api/post_vaa.rs
Expand Down Expand Up @@ -53,7 +53,7 @@ export function createPostVaaInstruction(
[...vaa.emitterAddress.toUint8Array()],
new BN(vaa.sequence.toString()),
vaa.consistencyLevel,
serializePayload(vaa.payloadLiteral, vaa.payload),
Buffer.from(serializePayload(vaa.payloadLiteral, vaa.payload)),
);

// @ts-ignore
Expand Down
Loading