ton-community / assets-sdk Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
There is currently an example showing how to create a jetton using the SDK. However, it doesn't show all the features that the SDK offers when it comes to jettons, for example it doesn't show how to open an existing jetton, how to mint more tokens, how to transfer tokens, etc, so help is needed to add these features to the example.
I have an error when I run assets-cli deploy-jetton
Attempt 1 failed: upload image: [object Object]
Attempt 2 failed: upload image: [object Object]
Attempt 3 failed: upload image: [object Object]
Error: Exceeded number of retries
at retry (C:..\npm\node_modules@ton-community\assets-sdk\dist\cli\common.js:176:11)
at async Object.main (C:..\npm\node_modules@ton-community\assets-sdk\dist\cli\deploy-jetton.js:79:23)
I use pinata storage and IPFS gateway
I have a problem with commonContent
. I cannot load metadata of NFT item when use deployNftCollection
with NOT empty commonContent
, but it work when commonContent = ''
.
Can you guy help me explain about this case? Many thanks :)
Here is my code:
Deploy NFT Collection
...
const commonContent = await sdk.storage.uploadFile(
Buffer.from(JSON.stringify(content), "utf-8")
);
const collection = await sdk.deployNftCollection(
{
collectionContent: content,
commonContent: commonContent, // Issue here
},
{
adminAddress: adminAddress,
}
);
...
Deploy NFT Item:
...
const collection = sdk.openNftCollection(Address.parse(COLLECTION));
const content = Buffer.from(
JSON.stringify({
name: "Test NFT 1",
description: "This is a test NFT 1",
image: uploadedImageURL,
"attributes":[{"trait_type":"Awesomeness","value":"Super cool"}],
}), "utf-8"
);
const metadataURL = await sdk.storage.uploadFile(content);
const { nextItemIndex: index } = await collection.getData();
await collection.sendMint(sender, {
index: index,
owner: sdk.sender?.address!,
individualContent: metadataURL,
});
...
I try code transfer-jettons.ts and get this error.
npx ts-node .\transfer-jettons.ts
Error: Cannot find module 'boxen'
I'm using TonCenter. and i want to be able to set my TonCenter Api key to use it as the client
This SDK is storage-agnostic thanks to this interface, however, currently only Pinata is implemented as a storage provider. Amazon S3 is another popular storage provider, and help is needed to implement the Storage
interface using it.
When runnnig:
const result = await sdk.deployNftCollection(
{
collectionContent: {
name: collectionName,
description: 'An event',
},
commonContent: baseUrl,
},
{ adminAddress, value: toNano(0.03) }
The code just hangs. It hangs on the following line:
async deployNftCollection(content, options) {
if (!this.sender) {
throw new Error('Sender must be defined');
}
const adminAddress = options?.adminAddress ?? this.sender?.address;
if (adminAddress === undefined) {
throw new Error('Admin address must be defined in options or be available in Sender');
}
console.log("before open")
const collection = this.api.open(NftCollection_1.NftCollection.createFromConfig({
admin: adminAddress,
content: (0, core_1.beginCell)()
.storeRef(await this.contentToCell((0, content_2.nftContentToInternal)(content.collectionContent), options?.onchainContent ?? false))
.storeRef((0, core_1.beginCell)().storeStringTail(content.commonContent))
.endCell(),
royalty: options?.royaltyParams,
}, NftCollection_1.NftCollection.code, WORKCHAIN, this.contentResolver));
console.log("after open")
if (typeof options?.premintItems?.length === 'number' && options?.premintItems.length > 0) {
await collection.sendBatchMint(this.sender, options?.premintItems, {
value: options?.value,
queryId: options?.queryId
});
}
else {
console.log("before sendDeploy")
await collection.sendDeploy(this.sender, options?.value); // Here
console.log("after sendDeploy")
}
return collection;
}
I am using testnet.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.