resources

package
v0.0.0-...-3a465d4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

View Source
const (
	SHARED                        OwnershipType          = "SHARED"
	HOLD_BY_SELLER                OwnershipType          = "HOLD_BY_SELLER"
	TRANSFERRED_TO_BUYER          OwnershipType          = "TRANSFERRED_TO_BUYER"
	UNDEFINED                     OwnershipType          = "undefined"
	PROPOSAL                      DataContractStatus     = "PROPOSAL"
	DATASHIPPED                   DataContractStatus     = "DATASHIPPED"
	DATARECEIVED                  DataContractStatus     = "DATARECEIVED"
	CURRENT                       StreamContractStatus   = "CURRENT"
	PAST                          StreamContractStatus   = "PAST"
	PULL                          StreamType             = "PULL"
	PUSH                          StreamType             = "PUSH"
	NOTIFICATION                  StreamType             = "NOTIFICATION"
	FILE                          DataType               = "FILE"
	STREAM                        DataType               = "STREAM"
	FILEQUERYABLE                 DataType               = "FILEQUERYABLE"
	STREAMQUERYABLE               DataType               = "STREAMQUERYABLE"
	ACTIVE                        DataContractTypeStatus = "ACTIVE"
	INACTIVE                      DataContractTypeStatus = "INACTIVE"
	CONSORITUM_ADMIN              Role                   = "CONSORTIUM_ADMIN"
	GROUP_ADMIN                   Role                   = "GROUP_ADMIN"
	DATASET_ADMIN                 Role                   = "DATASET_ADMIN"
	USER                          Role                   = "USER"
	BUSINESS_DOCTYPE              string                 = "com.lge.svl.datamarketplace.contract.Business"
	DATA_CATEGORY_DOCTYPE         string                 = "com.lge.svl.datamarketplace.contract.DataCategory"
	DATA_CONTRACT_DOCTYPE         string                 = "com.lge.svl.datamarketplace.contract.DataContract"
	REVIEW_DOCTYPE                string                 = "com.lge.svl.datamarketplace.contract.Review"
	DATA_CONTRACT_TYPE_DOCTYPE    string                 = "com.lge.svl.datamarketplace.contract.DataContractType"
	SUBMIT_DATA_CONTRACT_PROPOSAL string                 = "com.lge.svl.datamarketplace.contract.SubmitDataContractProposal"
	PERSON_DOCTYPE                string                 = "com.lge.svl.datamarketplace.contract.Person"
	//TOKEN related
	TOKEN_DOCTYPE             string = "com.lge.svl.datamarketplace.contract.Token"
	ACCOUNT_DOCTYPE           string = "com.lge.svl.datamarketplace.contract.Account"
	ALLOWANCE_DOCTYPE         string = "com.lge.svl.datamarketplace.contract.Allowance"
	SET_ACCOUNT_BALANCE_EVENT string = "SetAccountBalance"
	TRANSFER_EVENT            string = "Transfer"
	TRANSFER_FROM_EVENT       string = "TransferFrom"
)

Variables

This section is empty.

Functions

func AddPerson

func AddPerson(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, person Person) pb.Response

func Allowance

func Allowance(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, owner Account, spender Account) (float64, error)

func Approve

func Approve(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, ownerID string, spenderID string, tokens float64) (bool, error)

func BalanceOf

func BalanceOf(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, account Account) (float64, error)

func CreateAccount

func CreateAccount(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, account Account) pb.Response

func CreateBusiness

func CreateBusiness(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, business Business) pb.Response

func CreateDataCategory

func CreateDataCategory(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, category DataCategory) pb.Response

func CreateDataContractType

func CreateDataContractType(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, dataContractType DataContractType) pb.Response

func DeleteDoc

func DeleteDoc(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, doc string) pb.Response

func GetAccount

func GetAccount(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) pb.Response

func GetBusiness

func GetBusiness(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) pb.Response

func GetBusinessState

func GetBusinessState(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) ([]byte, error)

func GetBusinesses

func GetBusinesses(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface) pb.Response

func GetBusinessesWithPagination

func GetBusinessesWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, pageSize int32, bookmark string) pb.Response

func GetDataCategories

func GetDataCategories(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface) pb.Response

func GetDataCategoriesWithPagination

func GetDataCategoriesWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, pageSize int32, bookmark string) pb.Response

func GetDataCategory

func GetDataCategory(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) pb.Response

func GetDataCategoryState

func GetDataCategoryState(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) ([]byte, error)

func GetDataContract

func GetDataContract(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) pb.Response

func GetDataContractState

func GetDataContractState(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) ([]byte, error)

func GetDataContractType

func GetDataContractType(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) pb.Response

func GetDataContractTypeState

func GetDataContractTypeState(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) ([]byte, error)

func GetDataContractTypes

func GetDataContractTypes(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface) pb.Response

func GetDataContractTypesAfterTimeStamp

func GetDataContractTypesAfterTimeStamp(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, timestamp string) pb.Response

func GetDataContractTypesByCategory

func GetDataContractTypesByCategory(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, categoryId string) pb.Response

func GetDataContractTypesByCategoryWithPagination

func GetDataContractTypesByCategoryWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, categoryId string, pageSize int32, bookmark string) pb.Response

func GetDataContractTypesByProvider

func GetDataContractTypesByProvider(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, providerId string) pb.Response

func GetDataContractTypesByProviderWithPagination

func GetDataContractTypesByProviderWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, providerId string, pageSize int32, bookmark string) pb.Response

func GetDataContractTypesWithPagination

func GetDataContractTypesWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, pageSize int32, bookmark string) pb.Response

func GetDataContracts

func GetDataContracts(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface) pb.Response

func GetDataContractsByConsumer

func GetDataContractsByConsumer(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, consumerId string) pb.Response

func GetDataContractsByConsumerWithPagination

func GetDataContractsByConsumerWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, consumerId string, pageSize int32, bookmark string) pb.Response

func GetDataContractsByProvider

func GetDataContractsByProvider(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, providerId string) pb.Response

func GetDataContractsByProviderWithPagination

func GetDataContractsByProviderWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, providerId string, pageSize int32, bookmark string) pb.Response

func GetDataContractsWithPagination

func GetDataContractsWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, pageSize int32, bookmark string) pb.Response

func GetPerson

func GetPerson(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) pb.Response

func GetPersonState

func GetPersonState(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) ([]byte, error)

func GetPersons

func GetPersons(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface) pb.Response

func GetPersonsWithPagination

func GetPersonsWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, pageSize int32, bookmark string) pb.Response

func GetPopularDataCategories

func GetPopularDataCategories(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, size int32) pb.Response

func GetPopularDataContractTypes

func GetPopularDataContractTypes(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, size int32) pb.Response

func GetRecommendedDataContractType

func GetRecommendedDataContractType(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface) pb.Response

func GetReview

func GetReview(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) pb.Response

func GetReviewState

func GetReviewState(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) ([]byte, error)

func GetReviews

func GetReviews(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface) pb.Response

func GetReviewsWithPagination

func GetReviewsWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, pageSize int32, bookmark string) pb.Response

func SelectBusinessDataSetsPurchasedDownloaded

func SelectBusinessDataSetsPurchasedDownloaded(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, consumerId string, today string) pb.Response

func SelectBusinessDataSetsPurchasedDownloadedWithPagination

func SelectBusinessDataSetsPurchasedDownloadedWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, consumerId string, today string, pageSize int32, bookmark string) pb.Response

func SelectBusinessDataSetsPurchasedNotUploaded

func SelectBusinessDataSetsPurchasedNotUploaded(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, consumer string) pb.Response

func SelectBusinessDataSetsPurchasedNotUploadedWithPagination

func SelectBusinessDataSetsPurchasedNotUploadedWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, consumer string, pageSize int32, bookmark string) pb.Response

func SelectBusinessDataSetsPurchasedUploadedNotDownloaded

func SelectBusinessDataSetsPurchasedUploadedNotDownloaded(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, consumerId string, today string) pb.Response

func SelectBusinessDataSetsPurchasedUploadedNotDownloadedWithPagination

func SelectBusinessDataSetsPurchasedUploadedNotDownloadedWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, consumerId string, today string, pageSize int32, bookmark string) pb.Response

func SelectBusinessDataSetsSoldAndDownloaded

func SelectBusinessDataSetsSoldAndDownloaded(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, providerId string, today string) pb.Response

func SelectBusinessDataSetsSoldAndDownloadedWithPagination

func SelectBusinessDataSetsSoldAndDownloadedWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, providerId string, today string, pageSize int32, bookmark string) pb.Response

func SelectBusinessDataSetsSoldShippedNotDownloaded

func SelectBusinessDataSetsSoldShippedNotDownloaded(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, providerId string, today string) pb.Response

func SelectBusinessDataSetsSoldShippedNotDownloadedWithPagination

func SelectBusinessDataSetsSoldShippedNotDownloadedWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, providerId string, today string, pageSize int32, bookmark string) pb.Response

func SelectBusinessDataSetsToUpload

func SelectBusinessDataSetsToUpload(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, provider string) pb.Response

func SelectBusinessDataSetsToUploadByContractType

func SelectBusinessDataSetsToUploadByContractType(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, dataContractTypeID string) pb.Response

func SelectBusinessDataSetsToUploadByContractTypeWithPagination

func SelectBusinessDataSetsToUploadByContractTypeWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, dataContractTypeID string, pageSize int32, bookmark string) pb.Response

func SelectBusinessDataSetsToUploadWithPagination

func SelectBusinessDataSetsToUploadWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, provider string, pageSize int32, bookmark string) pb.Response

func SelectDataContractsByDataContractType

func SelectDataContractsByDataContractType(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, dataContractTypeID string) pb.Response

func SelectDataContractsByDataContractTypeWithPagination

func SelectDataContractsByDataContractTypeWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, dataContractTypeID string, pageSize int32, bookmark string) pb.Response

func SelectDataSetContractsToUpload

func SelectDataSetContractsToUpload(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, dataContractTypeId string) pb.Response

func SelectDataSetContractsToUploadWithPagination

func SelectDataSetContractsToUploadWithPagination(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, dataContractTypeId string, pageSize int32, bookmark string) pb.Response

func SelectNumberOfBusinessDataSetsToUpload

func SelectNumberOfBusinessDataSetsToUpload(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, provider string) pb.Response

func SetAccountState

func SetAccountState(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, account Account) error

func SetDataInfoSentToConsumer

func SetDataInfoSentToConsumer(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, dataInfo DataInfoSentToConsumer) pb.Response

func SetDataReceivedByConsumer

func SetDataReceivedByConsumer(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, dataReceived DataReceivedByConsumer) pb.Response

func SetTokenState

func SetTokenState(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, token Token) error

func SubmitDataContractProposal

func SubmitDataContractProposal(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, dataContractProposal DataContractProposal) pb.Response

func SubmitReview

func SubmitReview(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, review Review) pb.Response

func TransferFrom

func TransferFrom(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, sourceID string, destinationID string, tokens float64) (bool, error)

Types

type Account

type Account struct {
	DocType         string             `json:"docType"`
	ID              string             `json:"id"`
	Owner           string             `json:"owner"`
	Balance         float64            `json:"balance"`
	TotalAllowances float64            `json:"totalAllowances"`
	Allowances      map[string]float64 `json:"allowances"`
}

func GetAccountState

func GetAccountState(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) (Account, error)

func (*Account) AddFunds

func (a *Account) AddFunds(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, tokens float64) (float64, error)

func (*Account) ReduceAllowance

func (a *Account) ReduceAllowance(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, spenderID string, tokens float64) (float64, error)

func (*Account) RetrieveFunds

func (a *Account) RetrieveFunds(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, tokens float64) (float64, error)

func (*Account) SetBalance

func (a *Account) SetBalance(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, tokens float64) (float64, error)

func (*Account) Transfer

func (a *Account) Transfer(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, to Account, tokens float64) (bool, error)

type Address

type Address struct {
	City    string `json:"city"`
	Country string `json:"country"`
	Street  string `json:"street"`
	Zip     string `json:"zip"`
}

Address this is the address for users

type Business

type Business struct {
	DocType           string   `json:"docType"`
	ID                string   `json:"id"`
	EmailDomain       string   `json:"emailDomain"`
	OpenIDProviderURL string   `json:"openIdProviderURL"`
	Name              string   `json:"name"`
	Address           Address  `json:"address"`
	AccountBalance    float64  `json:"accountBalance"`
	PublicKey         string   `json:"publicKey"`
	Reviews           []Review `json:"reviews"`
	Score             float32  `json:"score"`
	NumberOfReviews   int      `json:"numberOfReviews"`
	Persons           []Person `json:"persons"`
}

func (*Business) AddPerson

func (b *Business) AddPerson(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, person Person) error

func (*Business) AddReview

func (b *Business) AddReview(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, review Review) error

type ContractExtras

type ContractExtras struct {
	DefinitionFormat string             `json:"definition_format"`
	FileHash         Hash               `json:"fileHash"`
	FileStatus       DataContractStatus `json:"fileStatus"`
	EndDateTime      time.Time          `json:"endDateTime"`
}

type ContractTypeExtras

type ContractTypeExtras struct {
	DefinitionFormat     string     `json:"definition_format"`
	Frequency            int        `json:"frequency"`
	StreamType           StreamType `json:"streamType"`
	StreamSourceEndpoint string     `json:"streamSourceEndPoint"`
	StreamTargetEndpoint string     `json:"streamTargetEndPoint"`
	StreamTopic          string     `json:"streamTopic"`
	StartTime            time.Time  `json:"startTime"`
	EndTime              time.Time  `json:"endTime"`
	Hash                 Hash       `json:"hash"`
}

type DataCategory

type DataCategory struct {
	DocType          string         `json:"docType"`
	ID               string         `json:"id"`
	Name             string         `json:"name"`
	DefinitionFormat string         `json:"definition_format"`
	Children         []DataCategory `json:"children"`
}

type DataContract

type DataContract struct {
	DocType            string         `json:"docType"`
	ID                 string         `json:"id"`
	ProviderID         string         `json:"provider"`
	ConsumerID         string         `json:"consumer"`
	CreationDateTime   time.Time      `json:"creationDateTime"`
	Extras             ContractExtras `json:"extras"`
	DataContractTypeID string         `json:"dataContractType"`
}

func (*DataContract) SetFileStatus

func (d *DataContract) SetFileStatus(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, status DataContractStatus, hash Hash, setHash bool) error

type DataContractProposal

type DataContractProposal struct {
	DataContractID        string         `json:"dataContractId"`
	ConsumerID            string         `json:"consumer"`
	DataContractTypeID    string         `json:"dataContractType"`
	DataContractTimestamp time.Time      `json:"dataContractTimestamp"`
	Extras                ContractExtras `json:"extras"`
}

type DataContractStatus

type DataContractStatus string

type DataContractType

type DataContractType struct {
	DocType          string                 `json:"docType"`
	ID               string                 `json:"id"`
	ThumbnailURL     string                 `json:"thumbnailURL"`
	Name             string                 `json:"name"`
	Description      string                 `json:"description"`
	Status           DataContractTypeStatus `json:"dataContractTypeStatus"`
	CreationDateTime time.Time              `json:"creationDateTime"`
	CategoryID       string                 `json:"categoryId"`
	DataType         DataType               `json:"dataType"`
	PriceType        PriceType              `json:"priceType"`
	Ownership        Ownership              `json:"ownership"`
	ProviderID       string                 `json:"provider"`
	Extras           ContractTypeExtras     `json:"extras"`
	DefinitionFormat string                 `json:"definition_format"`
	Reviews          []Review               `json:"reviews"`
	Score            float32                `json:"score"`
	NumberOfReviews  int                    `json:"numberOfReviews"`
}

func GetDataContractTypeStructState

func GetDataContractTypeStructState(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) (DataContractType, error)

func (*DataContractType) AddReview

func (d *DataContractType) AddReview(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, review Review) error

type DataContractTypeStatus

type DataContractTypeStatus string

type DataInfoSentToConsumer

type DataInfoSentToConsumer struct {
	Hash           Hash   `json:"hash"`
	DataContractID string `json:"dataContract"`
}

type DataReceivedByConsumer

type DataReceivedByConsumer struct {
	DataContractID string `json:"dataContract"`
}

type DataType

type DataType string

type Hash

type Hash struct {
	Method string `json:"method"`
	Value  string `json:"value"`
}

type Ownership

type Ownership struct {
	OwnershipType               OwnershipType               `json:"ownershipType"`
	OwnershipRevocation         OwnershipRevocation         `json:"revocation"`
	OwnershipVerificationMethod OwnershipVerificationMethod `json:"ownershipVerificationMethod"`
}

Ownership describes the data ownership

type OwnershipRevocation

type OwnershipRevocation struct {
	RevocationTime string `json:"revocationTime"`
	RefundPolicy   string `json:"refundPolicy"`
}

type OwnershipType

type OwnershipType string

type OwnershipVerificationMethod

type OwnershipVerificationMethod struct {
	AttributeName string `json:"attributeName"`
	Hash          Hash   `json:"hash"`
}

OwnershipVerificationMethod todo

type Person

type Person struct {
	DocType    string `json:"docType"`
	ID         string `json:"id"`
	BusinessID string `json:"businessID"`
	Role       Role   `json:"role"`
}

type PopularDataCategory

type PopularDataCategory struct {
	DataCategoryId string `json:"dataCategoryId"`
	Number         int32  `json:"number"`
}

type PopularDataContractType

type PopularDataContractType struct {
	DataContractType DataContractType `json:"dataContractType"`
	Number           int32            `json:"number"`
}

type PriceType

type PriceType struct {
	DefinitionFormat string  `json:"definition_format"`
	Amount           float64 `json:"amount"`
	Currency         string  `json:"currency"`
}

type Review

type Review struct {
	DocType            string `json:"docType"`
	ID                 string `json:"id"`
	ReviewText         string `json:"reviewText"`
	Score              int    `json:"score"`
	DataContractID     string `json:"dataContract"`
	ReviewerID         string `json:"reviewer"`
	DataContractTypeID string `json:"dataContractType"`
}

type Role

type Role string

type StreamContractStatus

type StreamContractStatus string

type StreamType

type StreamType string

type Token

type Token struct {
	DocType           string  `json:"docType"`
	ID                string  `json:"id"`
	TotalTokensSupply float64 `json:"totalTokensSupply"`
	RemainingSupply   float64 `json:"remainingSupply"`
}

func GetTokenState

func GetTokenState(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) (Token, error)

func NewToken

func NewToken(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string) (Token, error)

func NewTokenWithSupply

func NewTokenWithSupply(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, id string, ts float64) (Token, error)

func (*Token) AvailableSupply

func (t *Token) AvailableSupply(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface) (float64, error)

func (*Token) SetAccountBalance

func (t *Token) SetAccountBalance(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface, account Account, tokens float64) (bool, error)

func (*Token) TotalSupply

func (t *Token) TotalSupply(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface) (float64, error)

type Transfer

type Transfer struct {
	From  string  `json:""from`
	To    string  `json:"to"`
	Value float64 `json:"value"`
}

Jump to

Keyboard shortcuts

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