cpaper

package
v0.6.3-kompitech1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 5 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

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

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

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

Comercial paper has a composite key <`CommercialPaper`, Issuer, PaperNumber>

type IssueCommercialPaper

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

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

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