債券市集鏈碼套件

Oracle Blockchain Platform Digital Assets Edition 包含債券 NFT 市集情境的樣本鏈碼。

債券市場鏈碼支援管理和交易債券,以分數非可行權杖 (NFT) 表示。您可以使用鏈碼方法在分散式環境中核發、購買、兌換及交易債券 NFT。

債券市場鏈碼套件可從 Oracle Blockchain Platform 主控台下載,並包含下列元件。
  • BondMarketplace.zip,包含用於部署之封裝鏈碼的封存檔案。
  • BondMarketplace.yaml,您可以搭配 Blockchain App Builder 使用以編排 WholesaleCBDC 鏈碼的規格檔案。
  • BondMarketplace_postman_collection.json - Postman 集合,可讓您測試鏈碼中的 API。
  • README.md - 使用鏈碼的逐步指南。

若要取得債券市場鏈碼套件,請在 Oracle Blockchain Platform Digital Assets 主控台中按一下數位資產頁籤,然後選取債券市集應用程式

規格檔案

債券市集規格檔案 (Bond_Marketplace.yml) 是以延伸的 ERC-1155 規格檔案為基礎。它包含產生應用程式特定鏈碼的 model 屬性。在此情況下,model: bond 會在產生鏈碼時,為債券市集應用程式建立其他方法。此外,必須在檔案的描述資料區段中設定特定參數。
#
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
#
 
# Token asset to manage the complete lifecycle of a Bond in a primary Bond marketplace.  

assets:
    - name: Bond #Asset name
      type: token #Asset type
      standard: erc1155+   # Token standard
      events: true # Supports event code generation for non-GET methods
      model: bond # Supports creation of additional methods for Primary Bond marketplace
      
      anatomy:
          type: nonfungible # Token type
          unit: fractional  #Token unit
      
      behavior: # Bond token behaviors
        - divisible:                                  
        - mintable:                   
        - transferable
        - burnable                
        - roles:
            minter_role_name: minter
            burner_role_name: burner
      
      properties:  # Custom asset attributes for non-fungible Bond token.

          - name: status # Custom asset attribute maintains the status of the Bond.
            type: string
            mandatory: true
               
            
      metadata: # To maintain the metadata on-chain, this tag will be used. Users won't be able to update the metadata attribute values after the bond token is minted.
          
          - name: ISIN # A unique alphanumeric code that identifies a specific bond internationally.
            type: string
            mandatory: true
 
          - name: Segment # The classification of bonds based on issuer type or purpose, such as corporate, government, sovereign, or green bonds.
            type: string
 
          - name: Issuer # The entity, such as a corporation or government, that issues the bond.
            type: string
            mandatory: true
          
          - name: FaceValue # The principal amount of the bond that will be repaid at maturity.
            type: number
            mandatory: true

          - name: IssueSize # The total monetary value or quantity of bonds issued by the issuer.
            type: number
            mandatory: true

          - name: CouponRate # The annual interest rate that the bond pays, typically as a percentage of the face value.
            type: float 
            mandatory: true 

          - name: InterestPaymentType # Specifies whether the bond pays simple or compound interest.
            type: string
            mandatory: true
            validate: /^\\s*(simple)\\s*$/

          - name: InterestFrequency # The regularity with which interest payments are made, such as monthly, quarterly, annually or at maturity.
            type: string
            mandatory: true
            validate: /^\s*["]?((monthly|quarterly|annually|at maturity)\s*)["]?\s*$/

          - name: IssueDate # The date when the bond was initially issued.
            type: date
            mandatory: true 

          - name: MaturityDate # The date on which the bond’s principal amount will be repaid to the bondholder.
            type: date
            mandatory: true    
 
customMethods:

表格 4-1 債券市集規格檔案的中繼資料參數

進入 描述
name: ISIN

識別連結的唯一 12 個字元英數字元代碼字串。

name: Segment

代表連結之區段類型的字串。

name: Issuer

代表債券發行者的字串。

name: FaceValue

代表連結記號面值 (價格) 的數字。

name: IssueSize

代表債券發行大小 (總數量) 的數字。

name: CouponRate 代表債券息票利率 (利率) 的數字。它必須是年利率。
name: InterestRateType 代表利息付款類型的字串。唯一支援的值為 simple
name: InterestFrequency 代表債券權杖利息頻率的字串。下列清單顯示支援的值。
  • monthly
  • quarterly
  • annually
  • at maturity
name: IssueDate 代表債券發行日期的日期。
name: MaturityDate 代表債券到期日的日期。