Versions in this module Expand all Collapse all v0 v0.0.1 May 4, 2024 Changes in this version + const BalanceAllowedLockedEvent + const BalanceAllowedUnlockedEvent + const BalanceTokenLockedEvent + const BalanceTokenUnlockedEvent + const BatchExecute + const CancelCCTransferFrom + const CancelFrom + const CommitCCTransferFrom + const CreateCCTransferTo + const CreateFrom + const CreateIndex + const CreateTo + const DeleteCCTransferFrom + const DeleteCCTransferTo + const DocsKey + const ErrMethodNotImplemented + const LenTimeInMilliseconds + const MultiSwapDone + const SetIndexCreatedFlag + const StateKeyNonce + const SwapDone + var ErrAddressRequired = errors.New("address required") + var ErrAdminNotSet = errors.New("admin is not set in contract config") + var ErrAlreadyExist = errors.New("lock already exist") + var ErrAmountRequired = errors.New("amount required") + var ErrBigIntFromString = errors.New("big int from string") + var ErrEmptyLockID = errors.New("empty lock id") + var ErrInsufficientFunds = errors.New("insufficient balance") + var ErrLockNotExists = errors.New("lock not exists") + var ErrMethodAlreadyDefined = errors.New("pure method has already defined") + var ErrMultiSwapDisabled = errors.New("multi-swap is disabled") + var ErrPlatformAdminOnly = errors.New("platform admin only") + var ErrReason = errors.New("empty reason") + var ErrSwapDisabled = errors.New("swap is disabled") + var ErrTokenTickerRequired = errors.New("token ticker required") + var ErrUnauthorisedNotAdmin = errors.New("unauthorised, sender is not an admin") + func AddDocs(stub shim.ChaincodeStubInterface, rawDocs string) error + func CheckSign(stub shim.ChaincodeStubInterface, fn string, args []string, auth []string) (*types.Address, string, error) + func DeleteDoc(stub shim.ChaincodeStubInterface, docID string) error + func Logger() *logging.Logger + type BaseContract struct + func (bc *BaseContract) AllowedBalanceAdd(token string, address *types.Address, amount *big.Int, reason string) error + func (bc *BaseContract) AllowedBalanceBurnLocked(token string, address *types.Address, amount *big.Int, reason string) error + func (bc *BaseContract) AllowedBalanceGet(token string, address *types.Address) (*big.Int, error) + func (bc *BaseContract) AllowedBalanceGetAll(address *types.Address) (map[string]string, error) + func (bc *BaseContract) AllowedBalanceLock(token string, address *types.Address, amount *big.Int) error + func (bc *BaseContract) AllowedBalanceSub(token string, address *types.Address, amount *big.Int, reason string) error + func (bc *BaseContract) AllowedBalanceTransfer(token string, from *types.Address, to *types.Address, amount *big.Int, ...) error + func (bc *BaseContract) AllowedBalanceTransferLocked(token string, from *types.Address, to *types.Address, amount *big.Int, ...) error + func (bc *BaseContract) AllowedBalanceUnLock(token string, address *types.Address, amount *big.Int) error + func (bc *BaseContract) AllowedIndustrialBalanceAdd(address *types.Address, industrialAssets []*pb.Asset, reason string) error + func (bc *BaseContract) AllowedIndustrialBalanceSub(address *types.Address, industrialAssets []*pb.Asset, reason string) error + func (bc *BaseContract) AllowedIndustrialBalanceTransfer(from *types.Address, to *types.Address, industrialAssets []*pb.Asset, ...) error + func (bc *BaseContract) ApplyContractConfig(config *pb.ContractConfig) error + func (bc *BaseContract) ContractConfig() *pb.ContractConfig + func (bc *BaseContract) GetID() string + func (bc *BaseContract) GetMethods(bci BaseContractInterface) []string + func (bc *BaseContract) GetStub() shim.ChaincodeStubInterface + func (bc *BaseContract) GetTraceContext() telemetry.TraceContext + func (bc *BaseContract) IndustrialBalanceAdd(token string, address *types.Address, amount *big.Int, reason string) error + func (bc *BaseContract) IndustrialBalanceBurnLocked(token string, address *types.Address, amount *big.Int, reason string) error + func (bc *BaseContract) IndustrialBalanceGet(address *types.Address) (map[string]string, error) + func (bc *BaseContract) IndustrialBalanceGetLocked(address *types.Address) (map[string]string, error) + func (bc *BaseContract) IndustrialBalanceLock(token string, address *types.Address, amount *big.Int) error + func (bc *BaseContract) IndustrialBalanceSub(token string, address *types.Address, amount *big.Int, reason string) error + func (bc *BaseContract) IndustrialBalanceTransfer(token string, from *types.Address, to *types.Address, amount *big.Int, ...) error + func (bc *BaseContract) IndustrialBalanceTransferLocked(token string, from *types.Address, to *types.Address, amount *big.Int, ...) error + func (bc *BaseContract) IndustrialBalanceUnLock(token string, address *types.Address, amount *big.Int) error + func (bc *BaseContract) NBTxCommitCCTransferFrom(id string) error + func (bc *BaseContract) NBTxDeleteCCTransferFrom(id string) error + func (bc *BaseContract) NBTxDeleteCCTransferTo(id string) error + func (bc *BaseContract) NBTxHealthCheckNb(_ *types.Sender) error + func (bc *BaseContract) QueryBuildInfo() (*debug.BuildInfo, error) + func (bc *BaseContract) QueryChannelTransferFrom(id string) (*pb.CCTransfer, error) + func (bc *BaseContract) QueryChannelTransferTo(id string) (*pb.CCTransfer, error) + func (bc *BaseContract) QueryChannelTransfersFrom(pageSize int64, bookmark string) (*pb.CCTransfers, error) + func (bc *BaseContract) QueryCoreChaincodeIDName() (string, error) + func (bc *BaseContract) QueryGetLockedAllowedBalance(lockID string) (*proto.AllowedBalanceLock, error) + func (bc *BaseContract) QueryGetLockedTokenBalance(lockID string) (*proto.TokenBalanceLock, error) + func (bc *BaseContract) QueryGetNonce(owner *types.Address) (string, error) + func (bc *BaseContract) QueryGroupBalanceOf(address *types.Address) (map[string]string, error) + func (bc *BaseContract) QueryMultiSwapGet(swapID string) (*proto.MultiSwap, error) + func (bc *BaseContract) QueryNameOfFiles() ([]string, error) + func (bc *BaseContract) QuerySrcFile(name string) (string, error) + func (bc *BaseContract) QuerySrcPartFile(name string, start int, end int) (string, error) + func (bc *BaseContract) QuerySwapGet(swapID string) (*proto.Swap, error) + func (bc *BaseContract) QuerySystemEnv() (map[string]string, error) + func (bc *BaseContract) TokenBalanceAdd(address *types.Address, amount *big.Int, reason string) error + func (bc *BaseContract) TokenBalanceAddWithTicker(address *types.Address, amount *big.Int, ticker string, reason string) error + func (bc *BaseContract) TokenBalanceBurnLocked(address *types.Address, amount *big.Int, reason string) error + func (bc *BaseContract) TokenBalanceGet(address *types.Address) (*big.Int, error) + func (bc *BaseContract) TokenBalanceGetLocked(address *types.Address) (*big.Int, error) + func (bc *BaseContract) TokenBalanceLock(address *types.Address, amount *big.Int) error + func (bc *BaseContract) TokenBalanceSub(address *types.Address, amount *big.Int, reason string) error + func (bc *BaseContract) TokenBalanceSubWithTicker(address *types.Address, amount *big.Int, ticker string, reason string) error + func (bc *BaseContract) TokenBalanceTransfer(from *types.Address, to *types.Address, amount *big.Int, reason string) error + func (bc *BaseContract) TokenBalanceTransferLocked(from *types.Address, to *types.Address, amount *big.Int, reason string) error + func (bc *BaseContract) TokenBalanceUnlock(address *types.Address, amount *big.Int) error + func (bc *BaseContract) TracingHandler() *telemetry.TracingHandler + func (bc *BaseContract) TxCancelCCTransferFrom(id string) error + func (bc *BaseContract) TxChannelTransferByAdmin(sender *types.Sender, idTransfer string, to string, idUser *types.Address, ...) (string, error) + func (bc *BaseContract) TxChannelTransferByCustomer(sender *types.Sender, idTransfer string, to string, token string, ...) (string, error) + func (bc *BaseContract) TxCreateCCTransferTo(dataIn string) (string, error) + func (bc *BaseContract) TxHealthCheck(_ *types.Sender) error + func (bc *BaseContract) TxLockAllowedBalance(sender *types.Sender, req *proto.BalanceLockRequest) error + func (bc *BaseContract) TxLockTokenBalance(sender *types.Sender, req *proto.BalanceLockRequest) error + func (bc *BaseContract) TxMultiSwapBegin(sender *types.Sender, token string, multiSwapAssets types.MultiSwapAssets, ...) (string, error) + func (bc *BaseContract) TxMultiSwapCancel(sender *types.Sender, swapID string) error + func (bc *BaseContract) TxSwapBegin(sender *types.Sender, token string, contractTo string, amount *big.Int, ...) (string, error) + func (bc *BaseContract) TxSwapCancel(_ *types.Sender, swapID string) error + func (bc *BaseContract) TxUnlockAllowedBalance(sender *types.Sender, req *proto.BalanceLockRequest) error + func (bc *BaseContract) TxUnlockTokenBalance(sender *types.Sender, req *proto.BalanceLockRequest) error + func (bc *BaseContract) ValidateConfig(config []byte) error + type BaseContractInterface interface + AllowedBalanceAdd func(token string, address *types.Address, amount *big.Int, reason string) error + AllowedBalanceGet func(token string, address *types.Address) (*big.Int, error) + AllowedBalanceGetAll func(address *types.Address) (map[string]string, error) + AllowedBalanceSub func(token string, address *types.Address, amount *big.Int, reason string) error + AllowedBalanceTransfer func(token string, from *types.Address, to *types.Address, amount *big.Int, ...) error + AllowedIndustrialBalanceAdd func(address *types.Address, industrialAssets []*pb.Asset, reason string) error + AllowedIndustrialBalanceSub func(address *types.Address, industrialAssets []*pb.Asset, reason string) error + AllowedIndustrialBalanceTransfer func(from *types.Address, to *types.Address, industrialAssets []*pb.Asset, ...) error + GetID func() string + GetStub func() shim.ChaincodeStubInterface + GetTraceContext func() telemetry.TraceContext + IndustrialBalanceAdd func(token string, address *types.Address, amount *big.Int, reason string) error + IndustrialBalanceGet func(address *types.Address) (map[string]string, error) + IndustrialBalanceSub func(token string, address *types.Address, amount *big.Int, reason string) error + IndustrialBalanceTransfer func(token string, from *types.Address, to *types.Address, amount *big.Int, ...) error + TokenBalanceAdd func(address *types.Address, amount *big.Int, reason string) error + TokenBalanceAddWithTicker func(address *types.Address, amount *big.Int, ticker string, reason string) error + TokenBalanceGet func(address *types.Address) (*big.Int, error) + TokenBalanceSub func(address *types.Address, amount *big.Int, reason string) error + TokenBalanceSubWithTicker func(address *types.Address, amount *big.Int, ticker string, reason string) error + TokenBalanceTransfer func(from *types.Address, to *types.Address, amount *big.Int, reason string) error + TracingHandler func() *telemetry.TracingHandler + type ChainCode struct + func NewCC(cc BaseContractInterface, chOptions ...ChaincodeOption) (*ChainCode, error) + func (cc *ChainCode) BatchHandler(traceCtx telemetry.TraceContext, stub shim.ChaincodeStubInterface, ...) peer.Response + func (cc *ChainCode) Init(stub shim.ChaincodeStubInterface) peer.Response + func (cc *ChainCode) Invoke(stub shim.ChaincodeStubInterface) (r peer.Response) + func (cc *ChainCode) Start() error + func (cc *ChainCode) ValidateTxID(stub shim.ChaincodeStubInterface) error + type ChaincodeOption func(opts *chaincodeOptions) error + func WithSrcFS(fs *embed.FS) ChaincodeOption + func WithTLS(tls *TLS) ChaincodeOption + func WithTLSFromFiles(keyPath, certPath, clientCACertPath string) (ChaincodeOption, error) + type ContractConfigurable interface + ApplyContractConfig func(config *pb.ContractConfig) error + ContractConfig func() *pb.ContractConfig + ValidateConfig func(config []byte) error + type ContractMethods map[string]*Fn + func (cm *ContractMethods) Method(name string) (*Fn, error) + type Doc struct + Hash string + ID string + func DocumentsList(stub shim.ChaincodeStubInterface) ([]Doc, error) + type ExternalConfigurable interface + ApplyExtConfig func(cfgBytes []byte) error + ValidateExtConfig func(cfgBytes []byte) error + type Fn struct + type In struct + type TLS struct + Cert []byte + ClientCACerts []byte + Key []byte + type TokenConfigurable interface + ApplyTokenConfig func(config *proto.TokenConfig) error + TokenConfig func() *proto.TokenConfig + ValidateTokenConfig func(config []byte) error + type TxResponse struct + Accounting []*proto.AccountingRecord + Error string + Events map[string][]byte + Method string + Result string