dex_sc

package
v0.0.0-...-a44c12d Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEX_SC_SHA256 = "51f330aeb991da9c845b77daf45304acf6e07a0e87125b8c0b8884dadbbd9dba"

Functions

This section is empty.

Types

type Pair

type Pair struct {
	SCID              string
	NumTrustees       uint64
	Asset1            string
	Asset2            string
	Symbol            string
	Quorum            uint64
	Fee               uint64
	Liquidity1        uint64
	Liquidity2        uint64
	SharesOutstanding uint64
	AddCount          uint64 // liquidity add count
	RemoveCount       uint64 // liquidity remove count
	SwapCount         uint64
}

func (*Pair) CalcOwnership

func (pair *Pair) CalcOwnership(share uint64) float32

func (*Pair) CalcShare

func (pair *Pair) CalcShare(share uint64, reverse bool) (value uint64)

func (*Pair) CalcSwap

func (pair *Pair) CalcSwap(amt uint64, reverse bool) (receive uint64, fee uint64, slip float64)

func (*Pair) Parse

func (pair *Pair) Parse(scId string, values map[string]interface{}) (err error)

type Token

type Token struct {
	SCID           string
	Name           string
	Decimals       uint64
	ImageUrl       string
	Symbol         string
	TotalSupply    uint64
	NativeSymbol   string
	NativeDecimals uint64
	Quorum         uint64
	NumTrustees    uint64
	Version        string
	BridgeOpen     bool
	BridgeFee      uint64
}

func (*Token) Parse

func (token *Token) Parse(scId string, values map[string]interface{}) (err error)

Jump to

Keyboard shortcuts

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