Giter Club home page Giter Club logo

assets-sdk's People

Contributors

barinbritva avatar jokly avatar krigga avatar mkdir98 avatar thekiba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

assets-sdk's Issues

Extend Jetton example

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.

Error deploy-jetton failed: upload image: [object Object]

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

Cannot load metadata of NFT item when use deployNftCollection with not empty commonContent

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,
});
...

Implement Amazon S3 storage

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.

SDK just hangs when creating NFT collection

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.

Create NFT examples

There is currently an example that shows how to create an SDK instance and create a jetton. There is a need for a similar example that would show how to create an NFT collection, mint some items, and transfer an item. Here are the NFT contract wrapper sources with all their methods.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.