Closed cprcrack closed 2 years ago
Hi there 👋
Yes, that's possible.
It's not documented yet (working on it) but at least we now have API references for most of the SDK modules.
Here's the operation you're looking for: https://metaplex-foundation.github.io/js/classes/js.NftClient.html#createSft
That's great news! So the concept of an SFT in the SDK encompasses the FungibleAsset
and Fungible
token standards described here, with the only difference being the decimals being 0 or >0?
I find that difference a little bit confusing, what if I want to create a Fungible
token with 0 decimals (image a currency with no decimals), I will actually be creating something that is identified as a FungibleAsset
? Why is there a distinction? Is it basically only terminology, or is there an actual difference in the implementation of createSft() depending on the decimals parameter?
The new JS SDK is looking awesome by the way :)
Thanks!
Yes, it's a bit confusing but all that standard is doing on-chain is checking the decimals to distinguish between SFTs that are fractionals and those who are not. That way, apps, wallets, marketplaces, etc. can interpret the JSON metadata of these SFTs slightly differently.
In practice, though it doesn't make that much difference. The most significant difference is between NFTs and SFTs as the edition accounts ensure the non-fungibility of the token. That's why the SDK only separate these two use cases and if you need more distinction you can use mySft.mint.decimals
or mySft.tokenStandard
.
I can easily create an NFT with accompanying metadata like this:
Is there an equivalent easy way for FTs (fungible tokens) that use the new Metaplex Fungible Token Metadata standard as per https://github.com/solana-labs/token-list ?
I was looking for something like
metaplex.tokens().create()
and I have found that there is acreateMint()
andcreateToken()
method but none of those accept auri
,name
etc. where I can define the on-chain and off-chain metadata. Does something like this exist or could this be added as a new feature to thetokens()
module so that it is consistent with thenfts()
module?