Documentation ¶
Overview ¶
manage_assets is a chaincode that contains all the code related to asset management operations (e.g., Lock, Unlock, Claim) and any related utility functions
manage_assets is a chaincode that contains all the code related to asset management operations (e.g., Lock, Unlock, Claim) and any related utility functions
manage_assets is a chaincode that contains all the code related to asset management operations (e.g., Lock, Unlock, Claim) and any related utility functions
manage_assets is a chaincode that contains all the code related to asset management operations (e.g., Lock, Unlock, Claim) and any related utility functions
manage_assets is a chaincode that contains all the code related to asset management operations (e.g., Lock, Unlock, Claim) and any related utility functions
Index ¶
- func ClaimAsset(ctx contractapi.TransactionContextInterface, ...) (string, error)
- func ClaimAssetUsingContractId(ctx contractapi.TransactionContextInterface, ...) error
- func ClaimFungibleAsset(ctx contractapi.TransactionContextInterface, ...) error
- func GenerateAssetLockKeyAndContractId(ctx contractapi.TransactionContextInterface, chaincodeId string, ...) (string, string, error)
- func GenerateClaimAssetLockKey(ctx contractapi.TransactionContextInterface, chaincodeId string, ...) (string, error)
- func GenerateFungibleAssetLockContractId(ctx contractapi.TransactionContextInterface, chaincodeId string, ...) string
- func GenerateSHA256HashInBase64Form(preimage string) string
- func GenerateSHA512HashInBase64Form(preimage string) string
- func GetHTLCHash(ctx contractapi.TransactionContextInterface, ...) (string, error)
- func GetHTLCHashByContractId(ctx contractapi.TransactionContextInterface, contractId string) (string, error)
- func GetHTLCHashPreImage(ctx contractapi.TransactionContextInterface, ...) (string, error)
- func GetHTLCHashPreImageByContractId(ctx contractapi.TransactionContextInterface, contractId string) (string, error)
- func IsAssetLocked(ctx contractapi.TransactionContextInterface, ...) (bool, error)
- func IsAssetLockedQueryUsingContractId(ctx contractapi.TransactionContextInterface, contractId string) (bool, error)
- func IsFungibleAssetLocked(ctx contractapi.TransactionContextInterface, contractId string) (bool, error)
- func LockAsset(ctx contractapi.TransactionContextInterface, ...) (string, error)
- func LockFungibleAsset(ctx contractapi.TransactionContextInterface, ...) (string, error)
- func UnlockAsset(ctx contractapi.TransactionContextInterface, ...) (string, error)
- func UnlockAssetUsingContractId(ctx contractapi.TransactionContextInterface, contractId string) error
- func UnlockFungibleAsset(ctx contractapi.TransactionContextInterface, contractId string) error
- type AssetLockInterface
- type AssetLockValue
- type FungibleAssetLockValue
- type HashLock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClaimAsset ¶
func ClaimAsset(ctx contractapi.TransactionContextInterface, callerChaincodeID, assetAgreementBytesBase64, claimInfoBytesBase64 string) (string, error)
Claim Functions ClaimAsset cc is used to record claim of an asset on the ledger
func ClaimAssetUsingContractId ¶
func ClaimAssetUsingContractId(ctx contractapi.TransactionContextInterface, contractId, claimInfoBytesBase64 string) error
ClaimAsset cc is used to record claim of an asset on the ledger (this uses the contractId)
func ClaimFungibleAsset ¶
func ClaimFungibleAsset(ctx contractapi.TransactionContextInterface, contractId, claimInfoBytesBase64 string) error
ClaimFungibleAsset cc is used to record claim of a fungible asset on the ledger
func GenerateAssetLockKeyAndContractId ¶
func GenerateAssetLockKeyAndContractId(ctx contractapi.TransactionContextInterface, chaincodeId string, assetAgreement *common.AssetExchangeAgreement) (string, string, error)
* Function to generate asset-lock key (which is combination of asset-type and asset-id) * and contract-id (which is a hash on asset-lock key) for the non-fungible asset locking on the ledger
func GenerateClaimAssetLockKey ¶
func GenerateClaimAssetLockKey(ctx contractapi.TransactionContextInterface, chaincodeId string, assetAgreement *common.AssetExchangeAgreement) (string, error)
* Function to generate asset-lock key (which is combination of asset-type and asset-id) * and contract-id (which is a hash on asset-lock key) for the non-fungible asset locking on the ledger
func GenerateFungibleAssetLockContractId ¶
func GenerateFungibleAssetLockContractId(ctx contractapi.TransactionContextInterface, chaincodeId string, assetAgreement *common.FungibleAssetExchangeAgreement) string
* Function to generate contract-id for fungible asset-locking on the ledger (which is * a hash on the attributes of the fungible asset exchange agreement)
func GenerateSHA256HashInBase64Form ¶
function to generate a "SHA256" hash in base64 format for a given preimage
func GenerateSHA512HashInBase64Form ¶
function to generate a "SHA512" hash in base64 format for a given preimage
func GetHTLCHash ¶
func GetHTLCHash(ctx contractapi.TransactionContextInterface, callerChaincodeID, assetAgreementBytesBase64 string) (string, error)
func GetHTLCHashByContractId ¶
func GetHTLCHashByContractId(ctx contractapi.TransactionContextInterface, contractId string) (string, error)
func GetHTLCHashPreImage ¶
func GetHTLCHashPreImage(ctx contractapi.TransactionContextInterface, callerChaincodeID, assetAgreementBytesBase64 string) (string, error)
func GetHTLCHashPreImageByContractId ¶
func GetHTLCHashPreImageByContractId(ctx contractapi.TransactionContextInterface, contractId string) (string, error)
func IsAssetLocked ¶
func IsAssetLocked(ctx contractapi.TransactionContextInterface, callerChaincodeID, assetAgreementBytesBase64 string) (bool, error)
IsLocked Query Functions IsAssetLocked cc is used to query the ledger and findout if an asset is locked or not
func IsAssetLockedQueryUsingContractId ¶
func IsAssetLockedQueryUsingContractId(ctx contractapi.TransactionContextInterface, contractId string) (bool, error)
IsAssetLocked cc is used to query the ledger and find out if an asset is locked or not (this uses the contractId)
func IsFungibleAssetLocked ¶
func IsFungibleAssetLocked(ctx contractapi.TransactionContextInterface, contractId string) (bool, error)
IsFungibleAssetLocked cc is used to query the ledger and find out if a fungible asset is locked or not
func LockAsset ¶
func LockAsset(ctx contractapi.TransactionContextInterface, callerChaincodeID, assetAgreementBytesBase64, lockInfoBytesBase64 string) (string, error)
Lock Functions LockAsset cc is used to record locking of an asset on the ledger
func LockFungibleAsset ¶
func LockFungibleAsset(ctx contractapi.TransactionContextInterface, callerChaincodeID, fungibleAssetAgreementBytesBase64, lockInfoBytesBase64 string) (string, error)
LockFungibleAsset cc is used to record locking of a group of fungible assets of an asset-type on the ledger
func UnlockAsset ¶
func UnlockAsset(ctx contractapi.TransactionContextInterface, callerChaincodeID, assetAgreementBytesBase64 string) (string, error)
Unlock Functions UnlockAsset cc is used to record unlocking of an asset on the ledger
func UnlockAssetUsingContractId ¶
func UnlockAssetUsingContractId(ctx contractapi.TransactionContextInterface, contractId string) error
UnlockAssetUsingContractId cc is used to record unlocking of an asset on the ledger (this uses the contractId)
func UnlockFungibleAsset ¶
func UnlockFungibleAsset(ctx contractapi.TransactionContextInterface, contractId string) error
UnlockFungibleAsset cc is used to record unlocking of a fungible asset on the ledger
Types ¶
type AssetLockInterface ¶
type AssetLockValue ¶
type AssetLockValue struct { ContractId string `json:"contractId"` Locker string `json:"locker"` Recipient string `json:"recipient"` LockInfo interface{} `json:"lockInfo"` ExpiryTimeSecs uint64 `json:"expiryTimeSecs"` }
Object used in the map, <asset-type, asset-id> --> <contractId, locker, recipient, ...> (for non-fungible assets)
func (AssetLockValue) GetExpiryTimeSecs ¶
func (a AssetLockValue) GetExpiryTimeSecs() uint64
func (AssetLockValue) GetLockInfo ¶
func (a AssetLockValue) GetLockInfo() interface{}
func (AssetLockValue) GetLocker ¶
func (a AssetLockValue) GetLocker() string
func (AssetLockValue) GetRecipient ¶
func (a AssetLockValue) GetRecipient() string
type FungibleAssetLockValue ¶
type FungibleAssetLockValue struct { Type string `json:"type"` NumUnits uint64 `json:"numUnits"` Locker string `json:"locker"` Recipient string `json:"recipient"` LockInfo interface{} `json:"lockInfo"` ExpiryTimeSecs uint64 `json:"expiryTimeSecs"` }
Object used in the map, contractId --> <asset-type, num-units, locker, ...> (for fungible assets)
func (FungibleAssetLockValue) GetExpiryTimeSecs ¶
func (a FungibleAssetLockValue) GetExpiryTimeSecs() uint64
func (FungibleAssetLockValue) GetLockInfo ¶
func (a FungibleAssetLockValue) GetLockInfo() interface{}
func (FungibleAssetLockValue) GetLocker ¶
func (a FungibleAssetLockValue) GetLocker() string
func (FungibleAssetLockValue) GetRecipient ¶
func (a FungibleAssetLockValue) GetRecipient() string
type HashLock ¶
type HashLock struct { HashMechanism common.HashMechanism `json:"hashMechanism"` HashBase64 string `json:"hashBase64"` }
Object used to capture the HashLock details used in Asset Locking