Bond Marketplace Contract Methods

The bond marketplace contract includes all the methods that are available in the extended ERC-1155 NFT contract and additional methods that are specific to the bond marketplace scenario.

Solidity Autogenerated Methods

The bond marketplace asset is based on the extended ERC-1155 standard, and supports all of the generic methods for that standard. For more information about the generic ERC-1155 methods, see Digital Assets APIs.
postToken
This method submits a bond token for listing in the marketplace. This method can be called only by a token creator. When a token is created, its status is initially set to created. This method updates the status to posted.
function postToken(uint256 tokenId) public
Parameters:
  • tokenId: uint256 – The ID of the token to post.
purchaseToken
This method purchases a listed bond NFT, transferring it from the creator's accoun to the caller's account and transferring CBDC tokens from the caller's account to the creator's account. This method can be called by any account holder.
This method must be run in the context of an atomic transaction. In the current version, the atomicity must be handled in a single Oracle Blockchain Platform Besu network. In other words, the CBDC and bond contracts must be part of the same Oracle Blockchain Platform Besu network. The contract address of the CBDC token must be set by calling the setTokenContract method. The purchaseToken method automatically calculates the CBDC token transfer value, which is equal to the face value of the bond token multiplied by the quantity being purchased.
function purchaseToken(
        address from,
        address to,
        uint256 tokenId,
        uint256 quantity,
        uint256 additionalFees,
        string calldata orderId
    ) public
Parameters:
  • from: address – The wallet address of the token owner.
  • to: address – The wallet address of the recipient.
  • tokenId: uint256 – The ID of the token to purchase.
  • quantity: uint256 – The amount of tokens to purchase.
  • additionalFees: uint256 – The additional fees to add to the purchase price.
  • orderId: string – The order ID for the purchase operation.
payInterest
This method pays interest earned on a bond token. It can be called only by the token creator. The interest frequency of the token must be monthly, quarterly, or annually. Interest cannot be paid if the interest frequency is at maturity. Interest is calculated by the contract based on the coupon rate of the token.
Because the purchase operation transfers CBDC tokens from the caller's account to the bond owner’s account, this method must be run in the context of an atomic transaction. In the current version, the atomicity must be handled in a single Oracle Blockchain Platform Besu network. In other words, the CBDC and bond contracts must be part of the same Oracle Blockchain Platform Besu network. The contract address of the CBDC token must be set by calling the setTokenContract method.
function payInterest(address userAddress, uint256 tokenId) public
Parameters:
  • userAddress: address – The wallet address of the user.
  • tokenId: uint256 – The ID of the token.
requestTokenRedemption
This method raises a request for the redemption of bond tokens after maturity. It can be called only by the token owner. This method is also used to calculate the redemption price by the contract. Redemption requests can be raised only on the entire quantity of the bond token that the user owns. Users can raise multiple redemption requests based on different settlement IDs but only one can be approved by the token creator.
function requestTokenRedemption(
        string calldata settlementId,
        uint256 tokenId,
        string calldata orderId,
        uint256 additionalFees
    ) public
Parameters:
  • settlementId: string – The settlement ID of the redemption operation.
  • tokenId: uint256 – The ID of the token.
  • additionalFees: uint256 – The additional fees to add to the redemption price.
  • orderId: string – The order ID for the purchase operation.
approveTokenRedemption
This method approves a request for the redemption of bond tokens. It can be called only by the token creator.
Because the redemption operation transfers the bond NFT from the owner's account (the user who raised the request) to the creator’s account, this method must be run in the context of an atomic transaction. In the current version, the atomicity must be handled in a single Oracle Blockchain Platform Besu network. In other words, the CBDC and bond contracts must be part of the same Oracle Blockchain Platform Besu network. The contract address of the CBDC token must be set by calling the setTokenContract method.
function approveTokenRedemption(
        address fromAddress,
        string calldata settlementId,
        uint256 tokenId
    ) public
Parameters:
  • fromAddress: address – The wallet address of the user.
  • settlementId: string – The settlement ID of the redemption operation.
  • tokenId: uint256 – The ID of the token.
rejectTokenRedemption
This method rejects a request for the redemption of bond tokens. It can be called only by the token creator. Token owners can raise a redemption request again by using a different settlement ID.
function rejectTokenRedemption(
        address fromAddress,
        string calldata settlementId,
        uint256 tokenId
    ) public
Parameters:
  • userAddress: address – The wallet address of the user.
  • settlementId: string – The settlement ID of the redemption operation.
  • tokenId: uint256 – The ID of the token.
getTokenRedemptionRequests
This method gets the details of token redemption requests. It can be called by any account holder.
function getTokenRedemptionRequests(
        address userAddress,
        uint256 tokenId,
        string calldata settlementId
    ) public view
Parameters:
  • userAddress: address – The wallet address of the user.
  • tokenId: uint256 – The ID of the token.
  • settlementId: string – The settlement ID of the redemption operation.
getUserBondDetails
This method gets an account summary that includes the details of purchased or redeemed tokens and the purchase price and redemption price. It can be called by any account holder.
function getUserBondDetails(
        address userAddress,
        uint256 tokenId
    ) public view
Parameters:
  • userAddress: address – The wallet address of the user.
  • tokenId: uint256 – The ID of the token.