swap

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SwapCompositeType is a composite key for swap
	SwapCompositeType = "swaps"
	// SwapKeyEvent is a reason for swap
	SwapKeyEvent = "key"

	// ErrIncorrectSwap is a reason for multiswap
	ErrIncorrectSwap = "incorrect swap"
	// ErrIncorrectKey is a reason for multiswap
	ErrIncorrectKey = "incorrect key"
)

Variables

This section is empty.

Functions

func Answer

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

func Delete

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

Delete deletes swap

func Load

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

Load returns swap by id

func RobotDone

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

func Save

func Save(stub shim.ChaincodeStubInterface, swapID string, s *proto.Swap) error

Save saves swap

func UserDone

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

Types

type BaseContractInterface

type BaseContractInterface interface {
	GetStub() shim.ChaincodeStubInterface
	AllowedBalanceAdd(token string, address *types.Address, amount *big.Int, reason string) error
	TokenBalanceAdd(address *types.Address, amount *big.Int, reason string) error
}

BaseContractInterface represents BaseContract interface

type OnSwapDoneEventListener added in v0.0.3

type OnSwapDoneEventListener interface {
	OnSwapDoneEvent(
		token string,
		owner *types.Address,
		amount *big.Int,
	)
}

Jump to

Keyboard shortcuts

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