-
Notifications
You must be signed in to change notification settings - Fork 129
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
My First NFT Guide Update #838
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
1. Create a new file called `index.ts` in your project folder: | ||
|
||
To read a token's metadata: | ||
|
||
```python filename="example.py" | ||
async def get_token_data( | ||
token_client: AptosTokenClient, token_addr: AccountAddress | ||
) -> dict[str, str]: | ||
token = (await token_client.read_object(token_addr)).resources[Token] | ||
return { | ||
"collection": str(token.collection), | ||
"description": str(token.description), | ||
"name": str(token.name), | ||
"uri": str(token.uri), | ||
"index": str(token.index), | ||
} | ||
```bash filename="Terminal" | ||
touch index.ts | ||
``` | ||
|
||
</Tabs.Tab> | ||
</Tabs> | ||
<Callout type="info"> | ||
**Windows users:** Use `type nul > index.ts` in Command Prompt. | ||
</Callout> |
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.
Can we use Tabs here? one for mac / linux and another for windows?
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.
Great idea, I've just updated and replaced three sections with the Tabs component:
- In the "Create tsconfig.json" section
- In the "Configure Environment Variables" section
- In the "Adding index.ts" section
<Callout type="warning"> | ||
Remember to save your file after adding the configuration! | ||
</Callout> |
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.
Nit: Remove
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.
We did a couple user interviews and found that several folks we interviewed forgot to save and ended up confused, so that's what inspired that callout. I think it's worth keeping in the "Your First NFT" especially since NFT creators aren't necessarily technical, but may be using AI to help them get by (meaning when they miss small steps like this it's hard for them to notice why if they've already refocused on another file).
1. Create a new TypeScript configuration file: | ||
|
||
const committedTxn = await aptos.signAndSubmitTransaction({ | ||
signer: alice, | ||
transaction: mintTokenTransaction, | ||
}); | ||
```bash filename="Terminal" | ||
touch tsconfig.json | ||
``` |
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.
Can we use Tabs here, one tab for mac os / linux and another for windows?
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.
Yes, thank you
- **Collection Creation**: A "collection" is a grouping of digital assets. We'll create a new collection under Alice's account. | ||
- **Minting a Digital Asset**: Once the collection is in place, we'll mint a new digital asset (NFT) under that collection. | ||
- **Transferring a Digital Asset**: Finally, we'll transfer the newly minted asset from Alice to Bob. |
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.
Nit: remove these steps are mentioned above already, repetitive to have both
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.
Done
Thanks Co-authored-by: Andrew Hariri <[email protected]>
Co-authored-by: Andrew Hariri <[email protected]>
Description
This PR reorganizes Your First NFT into a more streamlined, tutorial-style page. Key changes include:
Step-by-step flow: Converted to a single, cohesive “Steps” tutorial with clear headings and callouts.
Single TypeScript example: Consolidated the instructions into one TS project for easier setup and execution, removing Python snippets from the main guide.
Overall walkthrough: We explain the code before presenting the step by step how to do it and example code.
Readability and structure: Added environment variable configuration, tsconfig.json setup, code explanations, and direct links to the Aptos Explorer to simplify the user onboarding experience.
Should help our developers go faster 🚀
Checklist
pnpm fmt
?pnpm lint
?