swap

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, s *proto.Swap) (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