cpaper

package
v0.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 4 Imported by: 0

README

Commercial paper Hyperledger Fabric chaincode example

This is an faithful reimplementation of the official example Commercial paper scenario

Original code written in JavaScript using the Fabric Chaincode Node SDK is available here

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCC

func NewCC() *router.Chaincode

Types

type BuyCommercialPaper added in v0.5.2

type BuyCommercialPaper struct {
	Issuer       string    `json:"issuer,omitempty"`
	PaperNumber  string    `json:"paper_number,omitempty"`
	CurrentOwner string    `json:"current_owner,omitempty"`
	NewOwner     string    `json:"new_owner,omitempty"`
	Price        int32     `json:"price,omitempty"`
	PurchaseDate time.Time `json:"purchase_date,omitempty"`
}

type CommercialPaper added in v0.5.2

type CommercialPaper struct {
	Issuer       string    `json:"issuer,omitempty"`
	PaperNumber  string    `json:"paper_number,omitempty"`
	Owner        string    `json:"owner,omitempty"`
	IssueDate    time.Time `json:"issue_date,omitempty"`
	MaturityDate time.Time `json:"maturity_date,omitempty"`
	FaceValue    int32     `json:"face_value,omitempty"`
	State        TaskState `json:"state,omitempty"`
}

func (CommercialPaper) Key added in v0.5.2

func (c CommercialPaper) Key() ([]string, error)

Key commercial paper has a composite key < CommercialPaper, Issuer, PaperNumber >

type IssueCommercialPaper added in v0.5.2

type IssueCommercialPaper struct {
	Issuer       string    `json:"issuer,omitempty"`
	PaperNumber  string    `json:"paper_number,omitempty"`
	IssueDate    time.Time `json:"issue_date,omitempty"`
	MaturityDate time.Time `json:"maturity_date,omitempty"`
	FaceValue    int32     `json:"face_value,omitempty"`
}

type RedeemCommercialPaper added in v0.5.2

type RedeemCommercialPaper struct {
	Issuer         string    `json:"issuer,omitempty"`
	PaperNumber    string    `json:"paper_number,omitempty"`
	RedeemingOwner string    `json:"redeeming_owner,omitempty"`
	RedeemDate     time.Time `json:"redeem_date,omitempty"`
}

type TaskState added in v0.5.2

type TaskState string
const (
	CommercialPaperTypeName = "CommercialPaper"

	CommercialPaperIssued   TaskState = "issued"
	CommercialPaperTrading  TaskState = "trading"
	CommercialPaperRedeemed TaskState = "redeemed"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL