결합된 토큰 프레임워크 체인코드 패키지

결합된 토큰 프레임워크는 블록체인 앱 빌더가 지원하는 확장된 ERC-1155 표준을 사용합니다.

NFT Art Collection Marketplace 샘플은 결합된 토큰 일반 프레임워크의 사용을 보여줍니다. 이 샘플에는 예술 작품과 관련된 고정 불가능 토큰(NFT)을 구매 및 판매하기 위한 마켓플레이스를 나타내는 체인코드가 포함됩니다. 이 샘플에서 NFT 플랫폼 제공 업체는 블록 체인 네트워크에서 예술 작품을 위해 NFT를 민트 (작성) 할 수있는 박물관을 온보드합니다. 그런 다음 소비자는 Eth 동전이나 ERC-20 동전을 사용하여 박물관에서 NFT를 구입할 수 있습니다. 소비자가 NFT를 구매하면 박물관은 대체 가능한 토큰 계정에 충성도 토큰을 수여합니다. 소비자는 NFT를 판매할 수도 있습니다. 체인코드는 토큰 초기화, 계정 운영, 역할 할당, 민팅, 전송, 레코딩 등 토큰 수명 주기를 관리하는 데 필요한 방법을 구현합니다. 또한 민팅, 이전 및 레코딩 작업을 승인하기 위한 공증 계정을 제공하고 일일 한도 및 감사 절차를 통한 규정 준수를 지원합니다. NFT Art Collection Marketplace 샘플은 TypeScript에서 체인코드 개발을 위해 설계되었습니다.

결합된 토큰 프레임워크는 Oracle Blockchain Platform 콘솔에서 다운로드할 수 있으며 다음 구성요소를 포함합니다.

  • NFTCollectiblesWithERC1155.zip - 배치를 위해 패키지화된 체인코드를 포함하는 아카이브 파일입니다.
  • NFTCollectiblesWithERC1155-TypeScript.yaml - 블록체인 앱 빌더와 함께 사용하여 NFTCollectiblesWithERC1155 체인코드를 스캐폴딩할 수 있는 사양 파일입니다.
  • NFTCollectiblesWithERC1155_postman_collection.json - 체인 코드에서 API를 테스트할 수 있는 Postman 모음입니다.
  • README.md - 체인코드 작업을 위한 단계별 가이드입니다.

대체 가능한 토큰 프레임워크를 가져오려면 Oracle Blockchain Platform Digital Assets 콘솔에서 디지털 자산 탭을 누른 다음 결합된 토큰 프레임워크를 선택합니다.

Postman 컬렉션 사용에 대한 자세한 내용은 Oracle Blockchain Platform용 블록체인 앱 빌더에서 다음 항목을 참조하십시오.

사양 파일

아트 컬렉션 마켓플레이스 체인코드를 생성하는 데 사용되는 사양 파일에는 events 속성이 포함됩니다. 체인코드 이벤트 함수는 생성된 체인코드의 이벤트 콜백을 지원하여 실시간 알림을 활성화하고 워크플로를 트리거합니다. 사양 파일 및 사양 파일에 사용되는 매개변수에 대한 자세한 내용은 Oracle Blockchain Platform용 블록체인 앱 빌더결합 토큰에 대한 입력 사양 파일을 참조하십시오.

아트 컬렉션 마켓플레이스 체인코드는 다음 사양 파일과 같이 확장된 ERC-1155 표준을 기반으로 합니다.
#
# Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
#
 
# This specification file is an example how to build any whole combined token application that includes fungible and non-fungible tokens together.
# For a combined token application, art collection marketplace with loyalty token has been used as an example.
# Art collection marketplace is a digital marketplace for buying and selling NFT art that rewards users with fungible loyalty tokens for their participation.
 
assets:
    - name: ArtCollection #Asset name
      type: token #Asset type
      symbol: ART         # Token symbol
      standard: erc721+   # Token standard
      events: true # Supports event code generation for non-GET methods
 
      anatomy:
          type: nonfungible # Token type
          unit: whole  #Token unit
       
      behavior:
        - indivisible
        - singleton                               
        - mintable:                  
            max_mint_quantity: 20000
        - transferable               
        - lockable
        - roles:
            minter_role_name: minter
       
      properties:  # Custom asset attributes for non-fungible token
           
          - name: Price # Custom asset attribute to set the price of a non-fungible token in the marketplace
            type: float
           
          - name: On_Sale_Flag # Custom asset attribute to maintain non-fungible token selling status in the marketplace
            type: boolean
       
      metadata: # To maintain the metadata on-chain, this tag will be used. Users won't be able to update the metadata attribute values after an NFT is minted.
           
          - name: Painting_Name # Custom asset attribute to represent the title given to a piece of artwork.
            type: string
           
          - name: Description # Custom asset attribute to represent a detailed explanation or interpretation of the painting's concept, style, or message.
            type: string
           
          - name: Painter_Name # Custom asset attribute to represent the name of the artist who created the painting.
            type: string

    - name: Loyalty #Asset name
      type: token #Asset type
      standard: erc1155+   # Token standard
      events: true # Supports event code generation for non-GET methods
 
      anatomy:
          type: fungible # Token type
          unit: fractional  #Token unit
       
      behavior: # Token behaviors
        - divisible:
              decimal: 2
        - mintable:                  
            max_mint_quantity: 100000
        - transferable               
        - burnable
        - roles:
            minter_role_name: minter

      properties:
          - name: Token_Name # Custom attribute to represent the token name.
            type: string
           
          - name: Token_to_Currency_Ratio # Custom attribute to specify the token to currency ratio. This attribute is helpful for exchanging the tokens with fiat currency.
            type: number

customMethods:
    - executeQuery
    - "post(token_id: string, selling_price: number)" # Post the non-fungible token for selling in the marketplace
    - "buyWithEthCoin(from_org_id: string, from_user_id: string, to_org_id: string, to_user_id: string, nft_id: string[], loyalty_id: string[], eth_qty: number[], loyalty_reward_quantity: number[])"  # Buy the non-fungible token after paying the amount using Eth Coin and receive loyalty points in return