utils

package module
v2.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 14 Imported by: 3

README

Utils Library

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAccessIfRelayClient

func CheckAccessIfRelayClient(stub shim.ChaincodeStubInterface) (bool, error)

Access guard for Weaver relay requests: return 'true' only if access should be permitted

func ClaimRemoteAsset

func ClaimRemoteAsset(ctx contractapi.TransactionContextInterface, pledgeId, remoteNetworkId, pledgeBytes64 string) ([]byte, error)

ClaimRemoteAsset gets ownership of an asset transferred from a different ledger/network.

func GetAssetClaimStatus

func GetAssetClaimStatus(ctx contractapi.TransactionContextInterface, pledgeId, recipientCert, pledger, pledgerNetworkId string, pledgeExpiryTimeSecs uint64, blankAssetJSON []byte) ([]byte, string, string, error)

GetAssetClaimStatus returns the asset claim status and present time (of invocation).

func GetAssetPledgeDetails

func GetAssetPledgeDetails(ctx contractapi.TransactionContextInterface, pledgeId string) ([]byte, string, error)

GetAssetPledgeDetails returns the asset pledge details for local network.

func GetAssetPledgeStatus

func GetAssetPledgeStatus(ctx contractapi.TransactionContextInterface, pledgeId, recipientNetworkId, recipientCert string, blankAssetJSON []byte) ([]byte, string, string, error)

GetAssetPledgeStatus returns the asset pledge status.

func GetECertOfTxCreatorBase64

func GetECertOfTxCreatorBase64(ctx contractapi.TransactionContextInterface) (string, error)

func GetInteropChaincodeIDKey

func GetInteropChaincodeIDKey() string

func GetLocalChaincodeID

func GetLocalChaincodeID(stub shim.ChaincodeStubInterface) (string, error)

GetLocalChaincodeID extracts chaincode id from stub

func GetLocalChaincodeIDKey

func GetLocalChaincodeIDKey() string

func GetLocalNetworkIDKey

func GetLocalNetworkIDKey() string

func IsCallerInteropChaincode

func IsCallerInteropChaincode(stub shim.ChaincodeStubInterface) (bool, error)

Check if the caller is the Interop Chaincode

func IsClientIINAgent

func IsClientIINAgent(ctx contractapi.TransactionContextInterface) (bool, error)

Check if the calling client has an IIN Agent attribute in its signing certificate

func IsClientNetworkAdmin

func IsClientNetworkAdmin(ctx contractapi.TransactionContextInterface) (bool, error)

Check if the calling client has an attribute in its signing certificate indicating that it is a privileged network administrator

func IsClientRelay

func IsClientRelay(stub shim.ChaincodeStubInterface) (bool, error)

Check if the calling client has a relay attribute in its signing certificate

func PledgeAsset

func PledgeAsset(ctx contractapi.TransactionContextInterface, assetJSON []byte, assetType, assetIdOrQuantity, remoteNetworkId, recipientCert string, expiryTimeSecs uint64) (string, error)

PledgeAsset locks an asset for transfer to a different ledger/network.

func ReclaimAsset

func ReclaimAsset(ctx contractapi.TransactionContextInterface, pledgeId, recipientCert, remoteNetworkId, claimStatusBytes64 string) ([]byte, []byte, error)

ReclaimAsset gets back the ownership of an asset pledged for transfer to a different ledger/network.

Types

This section is empty.

Jump to

Keyboard shortcuts

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