-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add TS component of the First NFT with SDK tutorial #3428
Conversation
649df61
to
8f8a7af
Compare
* Official Aptos Rust SDK -- TBA | ||
|
||
## Step 2: Run the Example | ||
|
||
Each SDK provides an examples directory. This tutorial covers the `simple-nft` example. | ||
|
||
<Tabs> | ||
Clone `aptos-core`: |
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 curious why we add a new doc instead of revising existing first_nft doc using the SDK? eventually, I expect we will only have one first_nft.
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.
@davidiw could probably speak more about the decision to write a new tutorial. I can see that the new tutorial is heavily inspired by the old one, but I think the intent is to focus less on theory and internals. I suppose it was easier to write a new tutorial afresh in this case.
ec66762
to
a345cc7
Compare
a345cc7
to
ce75bb5
Compare
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.
Looking great, thanks for migrating to SDK
@@ -321,7 +397,7 @@ export class TokenClient { | |||
*/ | |||
async getTokenForAccount(account: MaybeHexString, tokenId: TokenTypes.TokenId): Promise<TokenTypes.Token> { | |||
const tokenStore: { type: Gen.MoveStructTag; data: any } = await this.aptosClient.getAccountResource( | |||
account, | |||
account instanceof HexString ? account.hex() : account, |
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.
why is this? aptosClient handles this already by ensuring hex string is used.
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.
Well without this it was failing if I used account
instead of account.hex()
when calling this function. Or perhaps it was the other one for which that was true, in which case this is just for uniformity. I'll investigate AptosClient.
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.
interesting. please investigate.
"multisig_transaction": "ts-node multisig_transaction.ts", | ||
"transfer_coin": "ts-node transfer_coin.ts", | ||
"simple_nft": "ts-node simple_nft.ts", | ||
"test": "run-s transfer_coin bcs_transaction multisig_transaction" |
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.
add simple_nft to test?
4853f8a
to
859065e
Compare
ce75bb5
to
be81838
Compare
859065e
to
fbfd761
Compare
be81838
to
51f0e85
Compare
51f0e85
to
c416eff
Compare
Forge is running with
|
Description
This PR updates the first NFT with SDK example to include Typescript. To facilitate this, I've done some other stuff:
directTransferToken
function to the TokenClient.Test Plan
SDK tests:
Examples:
Docs site:
This change is