Versions in this module Expand all Collapse all v0 v0.0.1 Nov 1, 2023 Changes in this version + const BalanceAllowedLockedEvent + const BalanceAllowedUnlockedEvent + const BalanceTokenLockedEvent + const BalanceTokenUnlockedEvent + const CancelFrom + const CreateFrom + const CreateTo + const DocsKey + const ErrIncorrectKey + const ErrIncorrectSwap + const ErrMethodAlreadyDefined + const ErrMethodNotImplemented + const MultiSwapCompositeType + const MultiSwapKeyEvent + const MultiSwapReason + var ErrAddressRequired = errors.New("address required") + var ErrAlredyExist = errors.New("lock alredy 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 funds to process") + var ErrLockNotExists = errors.New("lock not exists") + var ErrPlatformAdminOnly = errors.New("platform admin only") + var ErrReason = errors.New("empty reason") + var ErrTokenTickerRequired = errors.New("token ticker required") + 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 GivenBalanceAdd(stub shim.ChaincodeStubInterface, contract string, amount *big.Int) error + func GivenBalanceSub(stub shim.ChaincodeStubInterface, contract string, amount *big.Int) error + func Logger() *logging.Logger + func MultiSwapDel(stub shim.ChaincodeStubInterface, swapID string) error + func MultiSwapLoad(stub shim.ChaincodeStubInterface, swapID string) (*proto.MultiSwap, error) + func MultiSwapSave(stub shim.ChaincodeStubInterface, swapID string, swap *proto.MultiSwap) ([]byte, error) + func ParseContract(in BaseContractInterface, options *ContractOptions) (map[string]*Fn, error) + func SwapDel(stub shim.ChaincodeStubInterface, swapID string) error + func SwapLoad(stub shim.ChaincodeStubInterface, swapID string) (*proto.Swap, error) + func SwapSave(stub shim.ChaincodeStubInterface, swapID string, s *proto.Swap) ([]byte, error) + func ToLowerFirstLetter(in string) string + 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(addr *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) GetAtomyzeSKI() []byte + func (bc *BaseContract) GetInitArg(idx int) string + func (bc *BaseContract) GetInitArgsLen() int + func (bc *BaseContract) GetMethods() []string + func (bc *BaseContract) GetStub() shim.ChaincodeStubInterface + 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) 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) 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) 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) 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 + 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 + 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 + TokenBalanceGet func(address *types.Address) (*big.Int, error) + TokenBalanceSub func(address *types.Address, amount *big.Int, reason string) error + TokenBalanceTransfer func(from *types.Address, to *types.Address, amount *big.Int, reason string) error + type BatchTxStub struct + func (bts *BatchTxStub) AddAccountingRecord(token string, from *types.Address, to *types.Address, amount *big.Int, ...) + func (bts *BatchTxStub) Commit() ([]*proto.WriteElement, []*proto.Event) + func (bts *BatchTxStub) DelState(key string) error + func (bts *BatchTxStub) GetState(key string) ([]byte, error) + func (bts *BatchTxStub) GetTxID() string + func (bts *BatchTxStub) PutState(key string, value []byte) error + func (bts *BatchTxStub) SetEvent(name string, payload []byte) error + type ChainCode struct + func NewCC(cc BaseContractInterface, options *ContractOptions, ...) (*ChainCode, error) + func (cc *ChainCode) BatchHandler(stub shim.ChaincodeStubInterface, funcName string, fn *Fn, args []string) peer.Response + func (cc *ChainCode) FetchFnByName(f string) (*Fn, error) + 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 + type ContractOptions struct + BatchPrefix string + DisableMultiSwaps bool + DisableSwaps bool + DisabledFunctions []string + IsOtherNoncePrefix bool + NonceTTL uint + TxTTL uint + type Doc struct + Hash string + ID string + func DocumentsList(stub shim.ChaincodeStubInterface) ([]Doc, error) + type Fn struct + type In struct + type NonceCheckFn func(shim.ChaincodeStubInterface, *types.Sender, uint64) error + type StateKey byte + const StateKeyAllowedBalance + const StateKeyExternalLockedAllowed + const StateKeyExternalLockedToken + const StateKeyGivenBalance + const StateKeyLockedAllowedBalance + const StateKeyLockedTokenBalance + const StateKeyNonce + const StateKeyPassedNonce + const StateKeyTokenBalance + type TxResponse struct + Accounting []*proto.AccountingRecord + Error string + Events map[string][]byte + Method string + Result string