{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.1.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package main\n\n## Constants\n\n```go\nconst (\n\tAESKeyLength = 32 // AESKeyLength is the default AES key length\n\tNonceSize    = 24 // NonceSize is the default NonceSize\n)\n```\n\n## Variables\n\n```go\nvar Objects = []string{\"PARTY\", \"CASHTXN\", \"User\", \"UserCat\", \"Item\", \"ItemCat\", \"ItemHistory\", \"Auction\", \"AucInit\", \"AucOpen\", \"Bid\", \"Trans\"}\n```\n//////////////////////////////////////////////////////////////////////////////////////////////// The following array holds the list of tables that should be created The deploy/init deletes the tables and recreates them every time a deploy is invoked ////////////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nvar PictureMap = map[string]string{\n\t\"art1.png\":     \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/art1.png\",\n\t\"art2.png\":     \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/art2.png\",\n\t\"art3.png\":     \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/art3.png\",\n\t\"art4.png\":     \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/art4.png\",\n\t\"art5.png\":     \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/art5.png\",\n\t\"art6.png\":     \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/art6.png\",\n\t\"art7.png\":     \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/art7.png\",\n\t\"item-001.jpg\": \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/item-001.jpg\",\n\t\"item-002.jpg\": \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/item-002.jpg\",\n\t\"item-003.jpg\": \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/item-003.jpg\",\n\t\"item-004.jpg\": \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/item-004.jpg\",\n\t\"item-005.jpg\": \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/item-005.jpg\",\n\t\"item-006.jpg\": \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/item-006.jpg\",\n\t\"item-007.jpg\": \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/item-007.jpg\",\n\t\"item-008.jpg\": \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/item-008.jpg\",\n\t\"people.gif\":   \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/people.gif\",\n\t\"mad-fb.jpg\":   \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/mad-fb.gif\",\n\t\"sample.png\":   \"https://raw.githubusercontent.com/ITPeople-Blockchain/auction/v0.6/art/artchaincode/sample.png\",\n}\n```\nfunc GetPictureUrl(picname string) string {\n\n## Functions\n\n```go\nfunc ARtoJSON(ar ItemObject) ([]byte, error)\n```\n//////////////////////////////////////////////////////// Converts an ART Object to a JSON String ////////////////////////////////////////////////////////\n\n```go\nfunc AucReqtoJSON(ar AuctionRequest) ([]byte, error)\n```\n//////////////////////////////////////////////////////// Converts an Auction Request to a JSON String ////////////////////////////////////////////////////////\n\n```go\nfunc BidtoJSON(myHand Bid) ([]byte, error)\n```\n//////////////////////////////////////////////////////// Converts an BID to a JSON String ////////////////////////////////////////////////////////\n\n```go\nfunc BuyItNow(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n\n```go\nfunc ByteArrayToImage(imgByte []byte, imageFile string) error\n```\n////////////////////////////////////////////////////////// Converts a byteArray into an image and saves it into an appropriate file It is important to get the file type before saving the file by call the GetImageType //////////////////////////////////////////////////////////\n\n```go\nfunc CheckRecType(rt string) bool\n```\n/////////////////////////////////////////////////////////////// Checks if the incoming invoke has a valid requesType The Request type is used to process the record accordingly Old Logic (see new logic up) ///////////////////////////////////////////////////////////////\n\n```go\nfunc ChkRecType(args []string) bool\n```\n/////////////////////////////////////////////////////////////// This function checks the incoming args for a valid record type entry as per the declared array recType\\[] The rectType attribute can be anywhere in the args or struct not necessarily in args\\[1] as per my old logic The Request type is used to direct processing the record accordingly e: recType is \"USER\" \"Args\":\\[\"PostUser\",\"100\", \"USER\", \"Ashley Hart\", \"TRD\",  \"Morrisville Parkway, #216, Morrisville, NC 27560\",\n\n\t\"9198063535\", \"ashley@it people.com\", \"SUNTRUST\", \"0001732345\", \"0234678\", \"2017-01-02 15:04:05\"]}'\n\n///////////////////////////////////////////////////////////////\n\n```go\nfunc CloseAuction(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n\n```go\nfunc CloseOpenAuctions(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n\n```go\nfunc Decrypt(key []byte, ciphertext []byte) []byte\n```\n\n```go\nfunc DeleteAllObjects(stub shim.ChaincodeStubInterface, objectType string) error\n```\n////////////////////////////////////////////////////////////////////////////////////////////////////////// Delete all objects of ObjectType\n\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc DeleteObject(stub shim.ChaincodeStubInterface, objectType string, keys []string) error\n```\n////////////////////////////////////////////////////////////////////////////////////////////////////////// Retrieve the object based on the key and simply delete it\n\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc DownloadImages(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n//////////////////////////////////////////////////////////////////////////////////////// Download Images into Peer ////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc Encrypt(key []byte, ba []byte) []byte\n```\n\n```go\nfunc GenAESKey() ([]byte, error)\n```\n////////////////////////////////////////////////////////// GenAESKey returns a random AES key of length AESKeyLength 3 Functions to support Encryption and Decryption GENAESKey() - Generates AES symmetric key Encrypt() Encrypts a \\[] byte Decrypt() Decryts a \\[] byte //////////////////////////////////////////////////////////\n\n```go\nfunc GetAuctionRequest(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n/////////////////////////////////////////////////////////////////////////////////////////////////// Retrieve Auction Information This query runs against the AuctionTable ./peer chaincode query -l golang -n mycc -c '{\"Function\": \"GetAuctionRequest\", \"Args\": \\[\"1111\"]}' There are two other tables just for query purposes - AucInitTable, AucOpenTable\n\n///////////////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetBid(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n///////////////////////////////////////////////////////////////////////////////////////////////// Retrieve a Bid based on two keys - AucID, BidNo A Bid has two Keys - The Auction Request Number and Bid Number ./peer chaincode query -l golang -n mycc -c '{\"Function\": \"GetLastBid\", \"Args\": \\[\"1111\", \"1\"]}'\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetHighestBid(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n////////////////////////////////////////////////////////////////////////// Get the Highest Bid in the List\n\n//////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetImageType(buff []byte) string\n```\n//////////////////////////////////////////////////// If Valid fileType, will have \"image\" as first word ////////////////////////////////////////////////////\n\n```go\nfunc GetItem(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n/////////////////////////////////////////////////////////////////////////////////////// Query callback representing the query of a chaincode Retrieve a Item by Item ID QueryObjectWithProcessingFunction takes a post processing function as argument peer chaincode query -l golang -n mycc -c '{\"Args\": \\[\"qGetItem\", \"1000\"]}\n\n///////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetItemListByCat(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n////////////////////////////////////////////////////////////////////////// Get a List of Items by Category in the block-chain Input is 2016 + Category Categories include whatever has been defined in the Item Tables - Landscape, Modern, ... See Sample data ./peer chaincode query -l golang -n mycc -c '{\"Function\": \"GetItemListByCat\", \"Args\": \\[\"2016\", \"Modern\"]}' //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetItemLog(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n////////////////////////////////////////////////////////////////////////// Get the Item History for an Item in the block-chain .. Pass the Item ID ./peer chaincode query -l golang -n mycc -c '{\"Function\": \"GetItemLog\", \"Args\": \\[\"1000\"]}' //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetKeyList(stub shim.ChaincodeStubInterface, args []string) (shim.StateQueryIteratorInterface, error)\n```\n////////////////////////////////////////////////////////////////////////// Get a List of Rows based on query criteria from the OBC The getList Function //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetKeyValue(Avalbytes []byte, key string) string\n```\n\n```go\nfunc GetLastBid(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n////////////////////////////////////////////////////////////////////////// Get The Highest Bid Received so far for an Auction in the block-chain //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetList(stub shim.ChaincodeStubInterface, objectType string, keys []string) (shim.StateQueryIteratorInterface, error)\n```\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Retrieve a list of Objects from the Query The function returns an iterator from which objects can be retrieved.\n\n\tdefer rs.Close()\n\n\t// Iterate through result set\n\tvar i int\n\tfor i = 0; rs.HasNext(); i++ {\n\n\t        // We can process whichever return value is of interest\n\t        myKey , myKeyVal , err := rs.Next()\n\t        if err != nil {\n\t                return shim.Success(nil)\n\t        }\n\t        bob, _ := JSONtoUser(myKeyVal)\n\t        fmt.Println(\"GetList() : my Value : \", bob)\n\t}\n\neg: Args\":\\[\"fetchlist\", \"PARTY\",\"CHK\"]} fetchList is the function that calls getList : ObjectType = \"Party\" and key is \"CHK\" ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetListOfBids(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n/////////////////////////////////////////////////////////////////////////////////////////////////// Get List of Bids for an Auction in the block-chain -- ./peer chaincode query -l golang -n mycc -c '{\"Function\": \"GetListOfBids\", \"Args\": \\[\"1111\"]}' ./peer chaincode query -l golang -n mycc -c '{\"Function\": \"GetLastBid\", \"Args\": \\[\"1111\"]}' ./peer chaincode query -l golang -n mycc -c '{\"Function\": \"GetHighestBid\", \"Args\": \\[\"1111\"]}' ///////////////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetListOfInitAucs(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n////////////////////////////////////////////////////////////////////////////////////////////////////// Get List of Auctions that have been initiated in the block-chain This is a fixed Query to be issued as below peer chaincode query -l golang -n mycc -c '{\"Args\": \\[\"qGetListOfInitAucs\", \"2016\"]}' //////////////////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetListOfOpenAucs(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n////////////////////////////////////////////////////////////////////////// Get List of Open Auctions  for which bids can be supplied in the block-chain This is a fixed Query to be issued as below peer chaincode query -l golang -n mycc -c '{\"Args\": \\[\"qGetListOfOpenAucs\", \"2016\"]}' //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetNoOfBidsReceived(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n////////////////////////////////////////////////////////////////////////// Get The Highest Bid Received so far for an Auction in the block-chain //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetNumberOfKeys(tname string) int\n```\n\n```go\nfunc GetQueryResultForQueryString(stub shim.ChaincodeStubInterface, queryString string) ([]byte, error)\n```\n///////////////////////////////////////////////////////////////////////////////////////// GetQueryResultForQueryString executes the passed in query string. Result set is built and returned as a byte array containing the JSON results. /////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetRandomBytes(len int) ([]byte, error)\n```\n///////////////////////////////////////////////// GetRandomBytes returns len random looking bytes /////////////////////////////////////////////////\n\n```go\nfunc GetTransaction(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n///////////////////////////////////////////////////////////////////////////////////////////////// Retrieve Auction Closeout Information. When an Auction closes The highest bid is retrieved and converted to a Transaction\n\n\t./peer chaincode query -l golang -n mycc -c '{\"Function\": \"GetTransaction\", \"Args\": [\"1111\"]}'\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetUser(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n//////////////////////////////////////////////////////////////////////////////////////// Retrieve User Information example: ./peer chaincode query -l golang -n mycc -c '{\"Function\": \"GetUser\", \"Args\": \\[\"100\"]}'\n\n////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc GetUserListByCat(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n////////////////////////////////////////////////////////////////////////// Get a List of Users by Category in the block-chain //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc IdentifyObjectType(args []string) (string, error)\n```\n/////////////////////////////////////////////////////////////// Checks if the args contain a valid Object Type. Typically, this model expects the Object Type to be args\\[0] but for the sake of flexibility, it scans the input data for a valid type if available ///////////////////////////////////////////////////////////////\n\n```go\nfunc IdentifyRecType(args []string) (string, error)\n```\n/////////////////////////////////////////////////////////////// Checks if the args contain a valid Record Type. Typically, this model expects the Object Type to be args\\[2] but for the sake of flexibility, it scans the input data for a valid type if available ///////////////////////////////////////////////////////////////\n\n```go\nfunc ImageToByteArray(imageFile string) ([]byte, string)\n```\n///////////////////////////////////////////////////////// Convert Image to \\[]bytes and viceversa Detect Image Filetype Image Function to read an image and create a byte array Currently only PNG images are supported /////////////////////////////////////////////////////////\n\n```go\nfunc InitObject(stub shim.ChaincodeStubInterface, objectType string, keys []string) error\n```\n////////////////////////////////////////////////////////////////////////// Open a Ledgers if one does not exist These ledgers will be used to write /  read data //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc InvokeFunction(fname string) func(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n//////////////////////////////////////////////////////////// Invoke Functions based on Function name The function name gets resolved to one of the following calls during an invoke\n\n////////////////////////////////////////////////////////////\n\n```go\nfunc ItemLogtoJSON(item ItemLog) ([]byte, error)\n```\n//////////////////////////////////////////////////////// Converts an BID to a JSON String ////////////////////////////////////////////////////////\n\n```go\nfunc JSONtoArgs(Avalbytes []byte) (map[string]interface{}, error)\n```\n//////////////////////////////////////////////////////// JSON To args\\[] - return a map of the JSON string ////////////////////////////////////////////////////////\n\n```go\nfunc OpenAuctionForBids(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n\n```go\nfunc PKCS5Pad(src []byte) []byte\n```\n\n```go\nfunc PKCS5Unpad(src []byte) []byte\n```\n\n```go\nfunc PostAuctionRequest(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n\n```go\nfunc PostBid(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n\n```go\nfunc PostItem(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n\n```go\nfunc PostItemLog(stub shim.ChaincodeStubInterface, item ItemObject, status string, ah string, currentDateTime string) pb.Response\n```\n\n```go\nfunc PostTransaction(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n//////////////////////////////////////////////////////// Create an Item Transaction record to process Request This is invoked by the CloseAuctionRequest\n\n//////////////////////////////////////////////////////////\n\n```go\nfunc PostUser(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n\n```go\nfunc ProcessQueryResult(stub shim.ChaincodeStubInterface, Avalbytes []byte, args []string) error\n```\n\n```go\nfunc QueryFunction(fname string) func(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n//////////////////////////////////////////////////////////// Query Functions based on Function name\n\n////////////////////////////////////////////////////////////\n\n```go\nfunc QueryObject(stub shim.ChaincodeStubInterface, objectType string, keys []string) ([]byte, error)\n```\n////////////////////////////////////////////////////////////////////////// Query a User Object by Object Name and Key This has to be a full key and should return only one unique object //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc QueryObjectWithProcessingFunction(stub shim.ChaincodeStubInterface, objectType string, keys []string, fname func(shim.ChaincodeStubInterface, []byte, []string) error) ([]byte, error)\n```\n////////////////////////////////////////////////////////////////////////// Query a User Object by Object Name and Key This has to be a full key and should return only one unique object //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc ReplaceObject(stub shim.ChaincodeStubInterface, objectType string, keys []string, objectData []byte) error\n```\n////////////////////////////////////////////////////////////////////////////////////////////////////////// Replaces the Entry in the Ledger The existing object is simply queried and the data contents is replaced with new content //////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc TransferItem(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Obtain Asset Details and Validate Item Transfer Item to new owner - no change in price  - In the example XFER is the recType ./peer chaincode invoke -l golang -n mycc -c '{\"Function\": \"TransferItem\", \"Args\": \\[\"1000\", \"100\", \"tGEBaZuKUBmwTjzNEyd+nr/fPUASuVJAZ1u7gha5fJg=\", \"300\", \"XFER\"]}' /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc TrantoJSON(at ItemTransaction) ([]byte, error)\n```\n//////////////////////////////////////////////////////// Converts an Item Transaction to a JSON String ////////////////////////////////////////////////////////\n\n```go\nfunc UpdateAuctionStatus(stub shim.ChaincodeStubInterface, tableName string, ar AuctionRequest) pb.Response\n```\n\n```go\nfunc UpdateItemObject(stub shim.ChaincodeStubInterface, ar []byte, hammerPrice string, buyer string) pb.Response\n```\n\n```go\nfunc UpdateObject(stub shim.ChaincodeStubInterface, objectType string, keys []string, objectData []byte) error\n```\n////////////////////////////////////////////////////////////////////////// Update the Object - Replace current data with replacement Register users into this table //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc UsertoJSON(user UserObject) ([]byte, error)\n```\n//////////////////////////////////////////////////////// Converts an User Object to a JSON String ////////////////////////////////////////////////////////\n\n```go\nfunc ValidateItemOwnership(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response\n```\n/////////////////////////////////////////////////////////////////////////////////////// Validates The Ownership of an Asset using ItemID, OwnerID, and HashKey\n\npeer chaincode query -l golang -n mycc -c '{\"Function\": \"ValidateItemOwnership\", \"Args\": \\[\"1000\", \"100\", \"tGEBaZuKUBmwTjzNEyd+nr/fPUASuVJAZ1u7gha5fJg=\"]}'\n\n///////////////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc ValidateItemSubmission(stub shim.ChaincodeStubInterface, artId string) pb.Response\n```\n////////////////////////////////////////////////////////////////////////// Validate if the User Information Exists in the block-chain //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc ValidateMember(stub shim.ChaincodeStubInterface, owner string) pb.Response\n```\n////////////////////////////////////////////////////////////////////////// Validate if the User Information Exists in the block-chain //////////////////////////////////////////////////////////////////////////\n\n```go\nfunc VerifyAtLeastOneKeyIsPresent(objectType string, args []string) error\n```\n\n```go\nfunc VerifyIfItemIsOnAuction(stub shim.ChaincodeStubInterface, itemID string) error\n```\n\n## Types\n\n```go\ntype AuctionRequest struct {\n\tAuctionID      string\n\tRecType        string // AUCREQ\n\tItemID         string\n\tAuctionHouseID string // ID of the Auction House managing the auction\n\tSellerID       string // ID Of Seller - to verified against the Item CurrentOwnerId\n\tRequestDate    string // Date on which Auction Request was filed\n\tReservePrice   string // reserver price \u003e previous purchase price\n\tBuyItNowPrice  string // 0 (Zero) if not applicable else specify price\n\tStatus         string // INIT, OPEN, CLOSED (To be Updated by Trgger Auction)\n\tOpenDate       string // Date on which auction will occur (To be Updated by Trigger Auction)\n\tCloseDate      string // Date and time when Auction will close (To be Updated by Trigger Auction)\n\tTimeStamp      string // The transaction Date and Time\n}\n```\n\n```go\nfunc CreateAuctionRequest(args []string) (AuctionRequest, error)\n```\n\n```go\nfunc JSONtoAucReq(areq []byte) (AuctionRequest, error)\n```\n//////////////////////////////////////////////////////// Converts an User Object to a JSON String ////////////////////////////////////////////////////////\n\n```go\ntype Bid struct {\n\tAuctionID string\n\tRecType   string // BID\n\tBidNo     string\n\tItemID    string\n\tBuyerID   string // ID Of Buyer - to be verified against the Item CurrentOwnerId\n\tBidPrice  string // BidPrice \u003e Previous Bid\n\tBidTime   string // Time the bid was received\n}\n```\n\n```go\nfunc CreateBidObject(args []string) (Bid, error)\n```\n\n```go\nfunc JSONtoBid(areq []byte) (Bid, error)\n```\n//////////////////////////////////////////////////////// Converts an User Object to a JSON String ////////////////////////////////////////////////////////\n\n```go\ntype ItemLog struct {\n\tItemID       string // PRIMARY KEY\n\tStatus       string // SECONDARY KEY - OnAuc, OnSale, NA\n\tAuctionedBy  string // SECONDARY KEY - Auction House ID if applicable\n\tRecType      string // ITEMHIS\n\tItemDesc     string\n\tCurrentOwner string\n\tDate         string // Date when status changed\n}\n```\n////////////////////////////////////////////////////////////////////////////// Has an item entry every time the item changes hands //////////////////////////////////////////////////////////////////////////////\n\n```go\nfunc ItemToItemLog(io ItemObject, cdt string) ItemLog\n```\n\n```go\nfunc JSONtoItemLog(ithis []byte) (ItemLog, error)\n```\n//////////////////////////////////////////////////////// Converts an User Object to a JSON String ////////////////////////////////////////////////////////\n\n```go\ntype ItemObject struct {\n\tItemID         string\n\tRecType        string\n\tItemDesc       string\n\tItemDetail     string // Could included details such as who created the Art work if item is a Painting\n\tItemDate       string\n\tItemType       string\n\tItemSubject    string\n\tItemMedia      string\n\tItemSize       string\n\tItemPicFN      string\n\tItemImage      []byte // This has to be generated AES encrypted using the file name\n\tAES_Key        []byte // This is generated by the AES Algorithms\n\tItemImageType  string // should be used to regenerate the appropriate image type\n\tItemBasePrice  string // Reserve Price at Auction must be greater than this price\n\tCurrentOwnerID string // This is validated for a user registered record\n\tTimeStamp      string // This is the time stamp\n}\n```\n\n```go\nfunc CreateItemObject(args []string) (ItemObject, error)\n```\n\n```go\nfunc JSONtoAR(data []byte) (ItemObject, error)\n```\n//////////////////////////////////////////////////////// Converts JSON String to an ART Object ////////////////////////////////////////////////////////\n\n```go\ntype ItemTransaction struct {\n\tAuctionID   string\n\tRecType     string // POSTTRAN\n\tItemID      string\n\tTransType   string // Sale, Buy, Commission\n\tUserId      string // Buyer or Seller ID\n\tTransDate   string // Date of Settlement (Buyer or Seller)\n\tHammerTime  string // Time of hammer strike - SOLD\n\tHammerPrice string // Total Settlement price\n\tDetails     string // Details about the Transaction\n}\n```\n\n```go\nfunc BidtoTransaction(bid Bid) ItemTransaction\n```\n\n```go\nfunc CreateTransactionRequest(args []string) (ItemTransaction, error)\n```\n\n```go\nfunc JSONtoTran(areq []byte) (ItemTransaction, error)\n```\n//////////////////////////////////////////////////////// Converts an Trans Object to a JSON String ////////////////////////////////////////////////////////\n\n```go\ntype SimpleChaincode struct {\n}\n```\n\n```go\nfunc (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response\n```\n\n```go\nfunc (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response\n```\n\n```go\ntype UserObject struct {\n\tUserID    string\n\tRecType   string // Type = USER\n\tName      string\n\tUserType  string // Auction House (AH), Bank (BK), Buyer or Seller (TR), Shipper (SH), Appraiser (AP)\n\tAddress   string\n\tPhone     string\n\tEmail     string\n\tBank      string\n\tAccountNo string\n\tRoutingNo string\n\tTimestamp string\n}\n```\n/////////////////////////////////////////////////////////// Create Buyer, Seller , Auction House, Authenticator Could establish valid UserTypes - AH (Auction House) TR (Buyer or Seller) AP (Appraiser) IN (Insurance) BK (bank) SH (Shipper) ///////////////////////////////////////////////////////////\n\n```go\nfunc CreateUserObject(args []string) (UserObject, error)\n```\n\n```go\nfunc JSONtoUser(user []byte) (UserObject, error)\n```\n//////////////////////////////////////////////////////// Converts an User Object to a JSON String ////////////////////////////////////////////////////////\n\n","path":"github.com/eric-erki/https-hyperledger.org/test/chaincodes/AuctionApp","name":"main","synopsis":"","isRedistributable":true}
