-
Notifications
You must be signed in to change notification settings - Fork 26
Create Token Attestation guide for Token Bridge #473
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new guide for token attestation in the Token Bridge product. The changes include a new Markdown guide detailing the attestation process using the TypeScript SDK, updates to the navigation and reference files, and accompanying code snippets that demonstrate the attestation flow.
- Added new guide in Markdown with detailed instructions and terminal output examples.
- Updated navigation (.pages) and link references (llms.txt) to include the new guide.
- Introduced TypeScript example files (helper.ts and attest.ts) and HTML snippets to demonstrate attestation transactions.
Reviewed Changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
products/token-bridge/guides/attest-tokens.md | New guide explaining the token attestation process |
products/token-bridge/guides/.pages | Added new navigation entry for Token Attestation |
llms.txt | Updated list of guides to include the Token Attestation guide |
.snippets/code/products/token-bridge/guides/attest-tokens/* | New code snippets for terminal outputs and helper functions for attestation |
.snippets/code/products/token-bridge/guides/attest-tokens/attest.ts | New TypeScript file implementing token attestation logic |
Comments suppressed due to low confidence (2)
products/token-bridge/guides/attest-tokens.md:157
- The placeholder 'TODO: What else should be here?' may confuse readers. Consider either providing additional guidance or removing the TODO if not needed.
TODO: What else should be here?
.snippets/code/products/token-bridge/guides/attest-tokens/attest.ts:76
- The variable 'payer' is declared earlier for the source chain and then re-declared for the destination chain. Consider renaming one of them (e.g. 'destPayer') to avoid confusion and potential scope issues.
const payer = toNative(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! Just some minor adjustments when sharing the snippet. Super clear flow :)
|
||
3. Run the script using the following command: | ||
```bash | ||
npx tsx attest.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get the token address returned when I run the script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried both with attested and non-attested tokens, and it is not returning anything. It doesn't crash either.
You have to take this part out of the function for it to work:
attestToken().catch((e) => { console.error('❌ Error in attestToken', e); process.exit(1); });
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just ran this with a known token:
dawnkelly@Mac attest-token % npx tsx attest.ts
✅ Token already registered on destination: SolanaAddress {
type: 'Native',
address: PublicKey [PublicKey(BQeTpGLxxe7AkwssS1MS242tGguy1TZYNqUkjwuDq3Fr)] {
_bn: <BN: 9aa3962f4d2e7ca7113ffc392540ebef6c02529d258e4f142701c049ed8e71e5>
}
}
dawnkelly@Mac attest-token %
Description
Please explain the changes this PR addresses here.
This guide helps the user check a token to see if a wrapped version exists and do an attestation if it doesn't
Checklist
wormhole-mkdocs
repo