Versions in this module Expand all Collapse all v3 v3.1.0 Dec 18, 2024 Changes in this version + const BASEChain + var BaseETHAsset = Asset type Asset + func NewAssetWithShortCodesV3_1_0(input string) (Asset, error) v3.0.0 Dec 2, 2024 Changes in this version + const AVAXChain + const BCHChain + const BSCChain + const BTCChain + const CurrentChainNetwork + const DOGEChain + const ETHChain + const EVMNullAddress + const EmptyChain + const GAIAChain + const LTCChain + const NoAddress + const NoopAddress + const One + const SigningAlgoEd25519 + const SigningAlgoSecp256k1 + const THORChain + const THORChainDecimals + var ATOMAsset = Asset + var AVAXAsset = Asset + var AllChains = [...]Chain + var BCHAsset = Asset + var BNBBEP20Asset = Asset + var BTCAsset = Asset + var BlankTxID = TxID("0000000000000000000000000000000000000000000000000000000000000000") + var DOGEAsset = Asset + var ETHAsset = Asset + var EmptyAsset = Asset + var EmptyPubKey PubKey + var EmptyPubKeySet PubKeySet + var ErrIntOverflowCommon = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthCommon = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrUnexpectedEndOfGroupCommon = fmt.Errorf("proto: unexpected end of group") + var LTCAsset = Asset + var LatestVersion semver.Version = semver.MustParse("999.0.0") + var NoCoin = Coin + var RuneNative = Asset + var THORBTC = Asset + var TOR = Asset + func Abs[T int | int64](a T) T + func ConvertAndEncode(hrp string, data []byte) (string, error) + func CosmosPrivateKeyToTMPrivateKey(privateKey cryptotypes.PrivKey) crypto.PrivKey + func Entropy(b []byte) float64 + func GetMedianInt64(vals []int64) int64 + func GetMedianUint(vals []cosmos.Uint) cosmos.Uint + func GetSafeShare(part, total, allocation cosmos.Uint) cosmos.Uint + func GetUncappedShare(part, total, allocation cosmos.Uint) (share cosmos.Uint) + func Max[T int | uint | int64 | uint64](a, b T) T + func Min[T int | uint | int64 | uint64](a, b T) T + func RandHexString(n int) string + func RoundSignificantFigures(number uint64, significantDigits int64) uint64 + func SafeSub(input1, input2 cosmos.Uint) cosmos.Uint + func Sign(buf []byte) ([]byte, []byte, error) + func SignBase64(buf []byte) (string, string, error) + func WeightedMean(vals, weights []cosmos.Uint) (cosmos.Uint, error) + type Account struct + AccountNumber int64 + Coins Coins + HasMemoFlag bool + Sequence int64 + func NewAccount(sequence, accountNumber int64, coins Coins, hasMemoFlag bool) Account + type Address string + func ConvertToNewBCHAddressFormat(addr Address) (Address, error) + func NewAddress(address string) (Address, error) + func (addr Address) AccAddress() (cosmos.AccAddress, error) + func (addr Address) Equals(addr2 Address) bool + func (addr Address) GetChain() Chain + func (addr Address) GetNetwork(chain Chain) ChainNetwork + func (addr Address) IsChain(chain Chain) bool + func (addr Address) IsEmpty() bool + func (addr Address) IsNoop() bool + func (addr Address) IsValidBCHAddress() bool + func (addr Address) String() string + type AddressSuite struct + func (s *AddressSuite) TestAddress(c *C) + func (s *AddressSuite) TestConvertToNewBCHAddressFormat(c *C) + type Asset struct + Chain Chain + Secured bool + Symbol Symbol + Synth bool + Ticker Ticker + Trade bool + func NewAsset(input string) (Asset, error) + func NewAssetWithShortCodes(version semver.Version, input string) (Asset, error) + func NewAssetWithShortCodesV3_0_0(input string) (Asset, error) + func RuneAsset() Asset + func (*Asset) Descriptor() ([]byte, []int) + func (*Asset) ProtoMessage() + func (a *Asset) UnmarshalJSON(data []byte) error + func (a *Asset) UnmarshalJSONPB(unmarshal *jsonpb.Unmarshaler, content []byte) error + func (a Asset) Equals(a2 Asset) bool + func (a Asset) GetChain() Chain + func (a Asset) GetDerivedAsset() Asset + func (a Asset) GetLayer1Asset() Asset + func (a Asset) GetSecuredAsset() Asset + func (a Asset) GetSyntheticAsset() Asset + func (a Asset) GetTradeAsset() Asset + func (a Asset) IsDerivedAsset() bool + func (a Asset) IsEmpty() bool + func (a Asset) IsGasAsset() bool + func (a Asset) IsNative() bool + func (a Asset) IsRune() bool + func (a Asset) IsSecuredAsset() bool + func (a Asset) IsSyntheticAsset() bool + func (a Asset) IsTradeAsset() bool + func (a Asset) IsVaultAsset() bool + func (a Asset) MarshalJSON() ([]byte, error) + func (a Asset) MarshalJSONPB(*jsonpb.Marshaler) ([]byte, error) + func (a Asset) MimirString() string + func (a Asset) Native() string + func (a Asset) ShortCode() string + func (a Asset) String() string + func (a Asset) Valid() error + func (m *Asset) Marshal() (dAtA []byte, err error) + func (m *Asset) MarshalTo(dAtA []byte) (int, error) + func (m *Asset) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Asset) Reset() + func (m *Asset) Size() (n int) + func (m *Asset) Unmarshal(dAtA []byte) error + func (m *Asset) XXX_DiscardUnknown() + func (m *Asset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Asset) XXX_Merge(src proto.Message) + func (m *Asset) XXX_Size() int + func (m *Asset) XXX_Unmarshal(b []byte) error + type Chain string + func GetEVMChains() []Chain + func GetUTXOChains() []Chain + func NewChain(chainID string) (Chain, error) + func (c Chain) AddressPrefix(cn ChainNetwork) string + func (c Chain) ApproximateBlockMilliseconds() int64 + func (c Chain) DefaultCoinbase() float64 + func (c Chain) DustThreshold() cosmos.Uint + func (c Chain) Equals(c2 Chain) bool + func (c Chain) GetGasAsset() Asset + func (c Chain) GetGasAssetDecimal() int64 + func (c Chain) GetGasUnits() string + func (c Chain) GetSigningAlgo() SigningAlgo + func (c Chain) InboundNotes() string + func (c Chain) IsBSCChain() bool + func (c Chain) IsEVM() bool + func (c Chain) IsEmpty() bool + func (c Chain) IsTHORChain() bool + func (c Chain) IsUTXO() bool + func (c Chain) IsValidAddress(addr Address) bool + func (c Chain) MaxMemoLength() int + func (c Chain) String() string + func (c Chain) Valid() error + type ChainNetwork uint8 + const MainNet + const MockNet + const StageNet + const TestNet + func (net ChainNetwork) SoftEquals(net2 ChainNetwork) bool + type ChainPoolInfo struct + Chain Chain + PoolAddress Address + PubKey PubKey + var EmptyChainPoolInfo ChainPoolInfo + func NewChainPoolInfo(chain Chain, pubKey PubKey) (ChainPoolInfo, error) + func (cpi ChainPoolInfo) IsEmpty() bool + type Chains []Chain + func NewChains(raw []string) (Chains, error) + func (chains Chains) Distinct() Chains + func (chains Chains) Has(c Chain) bool + func (chains Chains) Strings() []string + type Coin struct + Amount cosmossdk_io_math.Uint + Asset Asset + Decimals int64 + func NewCoin(asset Asset, amount cosmos.Uint) Coin + func ParseCoin(coinStr string) (Coin, error) + func (*Coin) Descriptor() ([]byte, []int) + func (*Coin) ProtoMessage() + func (c Coin) Equals(cc Coin) bool + func (c Coin) IsEmpty() bool + func (c Coin) IsNative() bool + func (c Coin) IsRune() bool + func (c Coin) Native() (cosmos.Coin, error) + func (c Coin) String() string + func (c Coin) Valid() error + func (c Coin) WithDecimals(decimal int64) Coin + func (m *Coin) Marshal() (dAtA []byte, err error) + func (m *Coin) MarshalTo(dAtA []byte) (int, error) + func (m *Coin) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Coin) Reset() + func (m *Coin) Size() (n int) + func (m *Coin) Unmarshal(dAtA []byte) error + func (m *Coin) XXX_DiscardUnknown() + func (m *Coin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Coin) XXX_Merge(src proto.Message) + func (m *Coin) XXX_Size() int + func (m *Coin) XXX_Unmarshal(b []byte) error + type Coins []Coin + func NewCoins(coins ...Coin) Coins + func (cs Coins) Contains(c Coin) bool + func (cs Coins) Copy() Coins + func (cs Coins) Distinct() Coins + func (cs Coins) EqualsEx(cs2 Coins) bool + func (cs Coins) GetCoin(asset Asset) Coin + func (cs Coins) HasSynthetic() bool + func (cs Coins) IsEmpty() bool + func (cs Coins) Native() (cosmos.Coins, error) + func (cs Coins) NoneEmpty() Coins + func (cs Coins) String() string + func (cs Coins) Valid() error + func (oldCoins Coins) Add(addCoins ...Coin) Coins + func (oldCoins Coins) SafeSub(subCoins ...Coin) Coins + type Fee struct + Coins Coins + PoolDeduct cosmossdk_io_math.Uint + func NewFee(coins Coins, poolDeduct cosmos.Uint) Fee + func (*Fee) Descriptor() ([]byte, []int) + func (*Fee) ProtoMessage() + func (f Fee) String() string + func (m *Fee) Marshal() (dAtA []byte, err error) + func (m *Fee) MarshalTo(dAtA []byte) (int, error) + func (m *Fee) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Fee) Reset() + func (m *Fee) Size() (n int) + func (m *Fee) Unmarshal(dAtA []byte) error + func (m *Fee) XXX_DiscardUnknown() + func (m *Fee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Fee) XXX_Merge(src proto.Message) + func (m *Fee) XXX_Size() int + func (m *Fee) XXX_Unmarshal(b []byte) error + type Gas Coins + func GetEVMGasFee(chain Chain, gasPrice *big.Int, msgLen uint64) Gas + func MakeEVMGas(chain Chain, gasPrice *big.Int, gas uint64) Gas + func (g Gas) Adds_deprecated(g2 Gas) Gas + func (g Gas) Equals(gas2 Gas) bool + func (g Gas) IsEmpty() bool + func (g Gas) NoneEmpty() Gas + func (g Gas) ToCoins() Coins + func (g Gas) Valid() error + func (gas Gas) Add(addCoins ...Coin) Gas + func (gas Gas) SafeSub(subCoins ...Coin) Gas + type Invariant func(ctx cosmos.Context) (msg []string, broken bool) + type InvariantRoute struct + Invariant Invariant + Route string + func NewInvariantRoute(route string, invariant Invariant) InvariantRoute + type ProtoUint struct + Value cosmossdk_io_math.Uint + func (*ProtoUint) Descriptor() ([]byte, []int) + func (*ProtoUint) ProtoMessage() + func (m *ProtoUint) Marshal() (dAtA []byte, err error) + func (m *ProtoUint) MarshalTo(dAtA []byte) (int, error) + func (m *ProtoUint) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *ProtoUint) Reset() + func (m *ProtoUint) Size() (n int) + func (m *ProtoUint) Unmarshal(dAtA []byte) error + func (m *ProtoUint) XXX_DiscardUnknown() + func (m *ProtoUint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoUint) XXX_Merge(src proto.Message) + func (m *ProtoUint) XXX_Size() int + func (m *ProtoUint) XXX_Unmarshal(b []byte) error + func (this *ProtoUint) String() string + type PubKey string + func NewPubKey(key string) (PubKey, error) + func NewPubKeyFromCrypto(pk crypto.PubKey) (PubKey, error) + func (p *PubKey) UnmarshalJSON(data []byte) error + func (p PubKey) EVMPubkeyToAddress() (Address, error) + func (p PubKey) Equals(pubKey1 PubKey) bool + func (p PubKey) GetAddress(chain Chain) (Address, error) + func (p PubKey) GetThorAddress() (cosmos.AccAddress, error) + func (p PubKey) IsEmpty() bool + func (p PubKey) MarshalJSON() ([]byte, error) + func (p PubKey) Secp256K1() (*btcec.PublicKey, error) + func (p PubKey) String() string + type PubKeySet struct + Ed25519 PubKey + Secp256k1 PubKey + func NewPubKeySet(secp256k1, ed25519 PubKey) PubKeySet + func (*PubKeySet) Descriptor() ([]byte, []int) + func (*PubKeySet) ProtoMessage() + func (m *PubKeySet) Marshal() (dAtA []byte, err error) + func (m *PubKeySet) MarshalTo(dAtA []byte) (int, error) + func (m *PubKeySet) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *PubKeySet) Reset() + func (m *PubKeySet) Size() (n int) + func (m *PubKeySet) Unmarshal(dAtA []byte) error + func (m *PubKeySet) XXX_DiscardUnknown() + func (m *PubKeySet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *PubKeySet) XXX_Merge(src proto.Message) + func (m *PubKeySet) XXX_Size() int + func (m *PubKeySet) XXX_Unmarshal(b []byte) error + func (p PubKeySet) Contains(pk PubKey) bool + func (p PubKeySet) Equals(pks1 PubKeySet) bool + func (p PubKeySet) GetAddress(chain Chain) (Address, error) + func (p PubKeySet) IsEmpty() bool + func (p PubKeySet) String() string + type PubKeys []PubKey + func (p PubKeys) Addresses() ([]cosmos.AccAddress, error) + func (p PubKeys) Contains(pk PubKey) bool + func (p PubKeys) Equals(newPks PubKeys) bool + func (p PubKeys) String() string + func (p PubKeys) Strings() []string + func (p PubKeys) Valid() error + type SigningAlgo string + type Symbol string + func NewSymbol(input string) (Symbol, error) + func (s Symbol) Equals(s2 Symbol) bool + func (s Symbol) IsEmpty() bool + func (s Symbol) IsMiniToken() bool + func (s Symbol) String() string + func (s Symbol) Ticker() Ticker + func (s Symbol) Valid() error + type Ticker string + func NewTicker(ticker string) (Ticker, error) + func (t Ticker) Equals(t2 Ticker) bool + func (t Ticker) IsEmpty() bool + func (t Ticker) String() string + type Tickers []Ticker + type Tx struct + Chain Chain + Coins Coins + FromAddress Address + Gas Gas + ID TxID + Memo string + ToAddress Address + func GetRagnarokTx(chain Chain, fromAddr, toAddr Address) Tx + func NewTx(txID TxID, from, to Address, coins Coins, gas Gas, memo string) Tx + func (*Tx) Descriptor() ([]byte, []int) + func (*Tx) ProtoMessage() + func (m *Tx) Marshal() (dAtA []byte, err error) + func (m *Tx) MarshalTo(dAtA []byte) (int, error) + func (m *Tx) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Tx) Reset() + func (m *Tx) Size() (n int) + func (m *Tx) Unmarshal(dAtA []byte) error + func (m *Tx) XXX_DiscardUnknown() + func (m *Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Tx) XXX_Merge(src proto.Message) + func (m *Tx) XXX_Size() int + func (m *Tx) XXX_Unmarshal(b []byte) error + func (tx Tx) EqualsEx(tx2 Tx) bool + func (tx Tx) Hash(version semver.Version, blockHeight int64) string + func (tx Tx) IsEmpty() bool + func (tx Tx) String() string + func (tx Tx) ToAttributes() []cosmos.Attribute + func (tx Tx) Valid() error + type TxID string + func NewTxID(hash string) (TxID, error) + func (tx TxID) Equals(tx2 TxID) bool + func (tx TxID) Int64() int64 + func (tx TxID) IsBlank() bool + func (tx TxID) IsEmpty() bool + func (tx TxID) Reverse() TxID + func (tx TxID) String() string + type TxIDs []TxID + type Txs []Tx Other modules containing this package gitlab.com/thorchain/thornode