cpaper

package
v0.6.10 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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)

Comercial 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