债券市场连锁代码包

Oracle Blockchain Platform Digital Assets Edition 包含债券 NFT 市场场景的示例链代码。

债券市场链代码支持管理和交易债券,以小数非实物代币 (NFT) 为代表。您可以使用链代码方法在分散的环境中发行、购买、兑换和交易债券 NFT。

债券市场链代码包可从 Oracle Blockchain Platform 控制台下载,并包含以下组件。
  • BondMarketplace.zip,包含用于部署的打包链代码的归档文件。
  • BondMarketplace.yaml,一个规范文件,可以与区块链应用程序构建器一起使用来支架 WholesaleCBDC 链代码。
  • BondMarketplace_postman_collection.json,一个 Postman 集合,用于测试链代码中的 API。
  • README.md 是使用链代码的分步指南。

要获取债券市场链代码包,请在 Oracle Blockchain Platform Digital Assets 控制台中单击数字资产选项卡,然后选择债券市场应用程序

规范文件

债券市场规范文件 (Bond_Marketplace.yml) 基于扩展的 ERC-1155 规范文件。它包括一个 model 属性,用于生成特定于应用程序的链代码。在这种情况下,在生成链代码时,model: bond 会为债券市场应用程序创建其他方法。此外,还必须在文件的元数据部分设置特定参数。
#
# Copyright (c) 2026, 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:

表 5-1 债券市场规范文件的元数据参数

进入 说明
name: ISIN

一个字符串,它是标识键的唯一 12 个字符的字母数字代码。

name: Segment

表示债券的段类型的字符串。

name: Issuer

表示债券发行人的字符串。

name: FaceValue

表示债券代币的面值(价格)的数字。

name: IssueSize

表示债券的问题大小(总数量)的数字。

name: CouponRate 表示债券的息票利率(利率)的数字。它必须是年薪。
name: InterestPaymentType 表示利息付款类型的字符串。唯一支持的值为 simple
name: InterestFrequency 表示债券令牌的利息频率的字符串。以下列表显示了支持的值。
  • monthly
  • quarterly
  • annually
  • at maturity
name: IssueDate 表示债券签发日期的日期。
name: MaturityDate 表示债券的到期日的日期。