multiswap

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MultiSwapCompositeType is a composite key for multiswap
	MultiSwapCompositeType = "multi_swap"
	// MultiSwapKeyEvent is a reason for multiswap
	MultiSwapKeyEvent = "multi_swap_key"

	// ErrIncorrectMultiSwap is a reason for multiswap
	ErrIncorrectMultiSwap = "incorrect swap"
	// ErrIncorrectMultiSwapKey is a reason for multiswap
	ErrIncorrectMultiSwapKey = "incorrect key"
)

Variables

This section is empty.

Functions

func Answer

func Answer(stub *cachestub.BatchCacheStub, swap *proto.MultiSwap, robotSideTimeout int64) (r *proto.SwapResponse)

func Delete

func Delete(stub shim.ChaincodeStubInterface, swapID string) error

Delete deletes multiswap from the ledger

func Load

func Load(stub shim.ChaincodeStubInterface, swapID string) (*proto.MultiSwap, error)

Load loads multiswap from the ledger

func RobotDone

func RobotDone(stub *cachestub.BatchCacheStub, swapID []byte, key string) (r *proto.SwapResponse)

func Save

func Save(stub shim.ChaincodeStubInterface, swapID string, swap *proto.MultiSwap) error

Save saves multiswap to the ledger

func UserDone

func UserDone(bci any, stub shim.ChaincodeStubInterface, symbol string, swapID string, key string) peer.Response

Types

type BaseContractInterface

type BaseContractInterface interface {
	GetStub() shim.ChaincodeStubInterface
	TokenBalanceAddWithTicker(address *types.Address, amount *big.Int, ticker string, reason string) error
	AllowedIndustrialBalanceAdd(address *types.Address, industrialAssets []*proto.Asset, reason string) error
}

BaseContractInterface represents BaseContract interface

type OnMultiSwapDoneEventListener added in v0.0.3

type OnMultiSwapDoneEventListener interface {
	OnMultiSwapDoneEvent(
		token string,
		owner *types.Address,
		assets []*proto.Asset,
	)
}

Jump to

Keyboard shortcuts

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