Documentation ¶
Index ¶
- Variables
- func CheckMemoIsStreamingSwap(memo string) bool
- func CheckUrlEmpty(urlParams url.Values) miderr.Err
- func ConsumeUrlParam(urlParams *url.Values, key string) (value string)
- func ConvertNativePoolToSynth(poolName string) string
- func ConvertSynthPoolToNative(poolName string) string
- func GetMedian(vals []float64) float64
- func IntStr(v int64) string
- func Max[T Number](x, y T) T
- func MustParseInt64(v string) int64
- func ToLowerBytes(b []byte) []byte
- func WrapBoolean(value bool) *bool
- func WrapString(value string) *string
- type Asset
- type NativeDecimalMap
- type NativeDecimalSingle
- type Number
- type TxType
Constants ¶
This section is empty.
Variables ¶
View Source
var StringToTxTypeMap = map[string]TxType{ "add": TxAdd, "+": TxAdd, "withdraw": TxWithdraw, "wd": TxWithdraw, "-": TxWithdraw, "swap": TxSwap, "s": TxSwap, "=": TxSwap, "limito": TxLimitOrder, "lo": TxLimitOrder, "out": TxOutbound, "donate": TxDonate, "d": TxDonate, "bond": TxBond, "unbond": TxUnbond, "leave": TxLeave, "yggdrasil+": TxYggdrasilFund, "yggdrasil-": TxYggdrasilReturn, "reserve": TxReserve, "refund": TxRefund, "migrate": TxMigrate, "ragnarok": TxRagnarok, "switch": TxSwitch, "noop": TxNoOp, "consolidate": TxConsolidate, "name": TxTHORName, "n": TxTHORName, "~": TxTHORName, "$+": TxLoanOpen, "loan+": TxLoanOpen, "$-": TxLoanRepayment, "loan-": TxLoanRepayment, "trade+": TxTradeAccountDeposit, "trade-": TxTradeAccountWithdrawal, }
Functions ¶
func CheckMemoIsStreamingSwap ¶
This function is used for identifying the old swap events without streaming_quantity attribute as streaming swap
func MustParseInt64 ¶
func ToLowerBytes ¶
It's like bytes.ToLower but returns nil for nil.
func WrapBoolean ¶
func WrapString ¶
Types ¶
type Asset ¶
func AssetFromString ¶
type NativeDecimalMap ¶
type NativeDecimalMap map[string]NativeDecimalSingle
Chains work with integers which represent fixed point decimals. E.g. on BTC 1 is 1e-8 bitcoin, but on ETH 1 is 1e-18 ethereum. This information is not important for Midgard, all the values are converted to E8 by ThorNode before they are sent to Midgard. This information is gathered only for clients.
type NativeDecimalSingle ¶
type TxType ¶
type TxType string
From THORNode MEMO: TXTYPE:STATE1:STATE2:STATE3:FINALMEMO
const ( TxUnknown TxType = "unknown" TxAdd TxType = "add" TxWithdraw TxType = "withdraw" TxSwap TxType = "swap" TxLimitOrder TxType = "limitOrder" TxOutbound TxType = "outbound" TxDonate TxType = "donate" TxBond TxType = "bond" TxUnbond TxType = "unbond" TxLeave TxType = "leave" TxYggdrasilFund TxType = "yggdrasilFund" TxYggdrasilReturn TxType = "yggdrasilReturn" TxReserve TxType = "reserve" TxRefund TxType = "refund" TxMigrate TxType = "migrate" TxRagnarok TxType = "ragnarok" TxSwitch TxType = "switch" TxNoOp TxType = "noOp" TxConsolidate TxType = "consolidate" TxTHORName TxType = "thorname" TxLoanOpen TxType = "loanOpen" TxLoanRepayment TxType = "loanRepayment" TxTradeAccountDeposit TxType = "tradeAccountDeposit" TxTradeAccountWithdrawal TxType = "tradeAccountWithdraw" )
func TxTypeFromMemo ¶
Click to show internal directories.
Click to hide internal directories.