Skip to content

Stanislav-Povolotsky/ton--sbt-offchain

Repository files navigation

TON SBT with offchain metadata

test workflow result

This is an off-chain implementation (all collection and token metadata is stored at a specific URL), you can find the on-chain implementation here.

Based on Getgems NFT contracts.

Project structure

  • contracts - source code of all the smart contracts of the project and their dependencies.
  • wrappers - wrapper classes (implementing Contract from @ton/core) for the contracts, including any [de]serialization primitives and compilation functions.
  • tests - tests for the contracts.
  • scripts - scripts used by the project, mainly the deployment scripts.

How to use

Install all packages

npm install

Build

npx blueprint build or yarn blueprint build

Test

npx blueprint test or yarn blueprint test

Deploy or run another script

npx blueprint run or yarn blueprint run

Scripts

  1. Deploy collection:
    npx blueprint run collectionDeploy
    Using file: collectionDeploy
    ? Which network do you want to use? testnet
    ? Which wallet are you using? TON Connect compatible mobile wallet (example: Tonkeeper)
    Connected to wallet at address: EQD9Ahgp6Uxa-uFn01oyxoHPX70j1eR51BB2lsnZFVardfyn
    Collection address:  EQDaQtD9BdjdvcwYt7Xk_HEHZA8AC-30yp29nTHuFHtubwjN
    Collection info saved to  collection.jso
    Deploy request sent
    Awaiting contract deployment...
    Collection deployed: EQDaQtD9BdjdvcwYt7Xk_HEHZA8AC-30yp29nTHuFHtubwjN
  2. Mint SBT for deployed collection:
    npx blueprint run collectionMintSbt
    Using file: collectionMintSbt
    ? Which network do you want to use? testnet
    ? Which wallet are you using? TON Connect compatible mobile wallet (example: Tonkeeper)
    Connected to wallet at address: EQD9Ahgp6Uxa-uFn01oyxoHPX70j1eR51BB2lsnZFVardfyn
    Collection address: EQDaQtD9BdjdvcwYt7Xk_HEHZA8AC-30yp29nTHuFHtubwjN
    Next item ID: 2
    Next item index: 2  address: EQD_oYRLexX9NEwvtH7JIMKEFqQrboA_bFIV2Yd8KyQZsqGW
    Sending transaction. Approve in your wallet...[TON_CONNECT_SDK] Send http-bridge request: {method: 'sendTransaction',...}
    [TON_CONNECT_SDK] Wallet message received: {...}
    Sent transaction
    Sent collection mint request
    Awaiting contract deployment...
    Sent collection mint request
    Item deployed: EQD_oYRLexX9NEwvtH7JIMKEFqQrboA_bFIV2Yd8KyQZsqGW
  3. Display information for deployed SBT token:
    npx blueprint run collectionGetAllInfo
    Using file: collectionGetAllInfo
    ? Which network do you want to use? testnet
    ? Which wallet are you using? TON Connect compatible mobile wallet (example: Tonkeeper)
    Connected to wallet at address: EQD9Ahgp6Uxa-uFn01oyxoHPX70j1eR51BB2lsnZFVardfyn
    ? Item Index 2
    Collection address: EQDaQtD9BdjdvcwYt7Xk_HEHZA8AC-30yp29nTHuFHtubwjN
    Collection data:
            Next item ID: 3
            Owner address: EQD9Ahgp6Uxa-uFn01oyxoHPX70j1eR51BB2lsnZFVardfyn
            Content: https://nft.ton.diamonds/diamonds.json
    Item data:
            Item index: 2
            Item address: EQD_oYRLexX9NEwvtH7JIMKEFqQrboA_bFIV2Yd8KyQZsqGW
    Item nft data:
            Initialized: true
            Collection address: EQDaQtD9BdjdvcwYt7Xk_HEHZA8AC-30yp29nTHuFHtubwjN
            Owner address: EQD9Ahgp6Uxa-uFn01oyxoHPX70j1eR51BB2lsnZFVardfyn
            Content: 2/2.json
    Full nft data:
            Content: https://nft.ton.diamonds/nft/2/2.json

Useful links

About

TON SBT Token collection, offchain data implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published