thorclient

package
v1.134.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 45 Imported by: 18

Documentation

Index

Constants

View Source
const (
	AuthAccountEndpoint      = "/auth/accounts"
	BroadcastTxsEndpoint     = "/"
	KeygenEndpoint           = "/thorchain/keygen"
	KeysignEndpoint          = "/thorchain/keysign"
	LastBlockEndpoint        = "/thorchain/lastblock"
	NodeAccountEndpoint      = "/thorchain/node"
	SignerMembershipEndpoint = "/thorchain/vaults/%s/signers"
	StatusEndpoint           = "/status"
	VaultEndpoint            = "/thorchain/vault/%s"
	AsgardVault              = "/thorchain/vaults/asgard"
	PubKeysEndpoint          = "/thorchain/vaults/pubkeys"
	ThorchainConstants       = "/thorchain/constants"
	RagnarokEndpoint         = "/thorchain/ragnarok"
	MimirEndpoint            = "/thorchain/mimir"
	ChainVersionEndpoint     = "/thorchain/version"
	InboundAddressesEndpoint = "/thorchain/inbound_addresses"
	PoolsEndpoint            = "/thorchain/pools"
	THORNameEndpoint         = "/thorchain/thorname/%s"
)

Endpoint urls

Variables

View Source
var ErrNotFound = fmt.Errorf("not found")

Functions

func GetKeyringKeybase

func GetKeyringKeybase(chainHomeFolder, signerName, password string) (ckeys.Keyring, ckeys.Info, error)

GetKeyringKeybase return keyring and key info

func MakeCodec

func MakeCodec() codec.ProtoCodecMarshaler

func MakeLegacyCodec added in v0.41.0

func MakeLegacyCodec() *codec.LegacyAmino

MakeLegacyCodec creates codec

Types

type Keys

type Keys struct {
	// contains filtered or unexported fields
}

Keys manages all the keys used by thorchain

func NewKeysWithKeybase

func NewKeysWithKeybase(kb ckeys.Keyring, name, password string) *Keys

NewKeysWithKeybase create a new instance of Keys

func (*Keys) GetKeybase

func (k *Keys) GetKeybase() ckeys.Keyring

GetKeybase return the keybase

func (*Keys) GetPrivateKey

func (k *Keys) GetPrivateKey() (cryptotypes.PrivKey, error)

GetPrivateKey return the private key

func (*Keys) GetSignerInfo

func (k *Keys) GetSignerInfo() ckeys.Info

GetSignerInfo return signer info

type PoolManager added in v0.41.0

type PoolManager interface {
	GetValue(source, target common.Asset, amount cosmos.Uint) (cosmos.Uint, error)
}

PoolManager provide all the functionalities need to deal with pool

type PoolMgr added in v0.41.0

type PoolMgr struct {
	// contains filtered or unexported fields
}

PoolMgr implement PoolManager interface

func NewPoolMgr added in v0.41.0

func NewPoolMgr(bridge ThorchainBridge) *PoolMgr

NewPoolMgr create a new instance of PoolMgr

func (*PoolMgr) GetValue added in v0.41.0

func (pm *PoolMgr) GetValue(source, target common.Asset, amount cosmos.Uint) (cosmos.Uint, error)

GetValue is to convert source asset into target , and return the value for example, we could ask PoolManager, how much TKN asset in ETH?

type PubKeyContractAddressPair added in v0.41.0

type PubKeyContractAddressPair struct {
	PubKey    common.PubKey
	Contracts map[common.Chain]common.Address
}

PubKeyContractAddressPair is an entry to map pubkey and contract addresses

type QueryKeysign

type QueryKeysign struct {
	Keysign   types.TxOut `json:"keysign"`
	Signature string      `json:"signature"`
}

type ThorchainBridge

type ThorchainBridge interface {
	EnsureNodeWhitelisted() error
	EnsureNodeWhitelistedWithTimeout() error
	FetchNodeStatus() (stypes.NodeStatus, error)
	GetAsgards() (stypes.Vaults, error)
	GetVault(pubkey string) (stypes.Vault, error)
	GetConfig() config.BifrostClientConfiguration
	GetConstants() (map[string]int64, error)
	GetContext() client.Context
	GetContractAddress() ([]PubKeyContractAddressPair, error)
	GetErrataMsg(txID common.TxID, chain common.Chain) sdk.Msg
	GetKeygenStdTx(poolPubKey common.PubKey, keysharesBackup []byte, blame stypes.Blame, inputPks common.PubKeys, keygenType stypes.KeygenType, chains common.Chains, height, keygenTime int64) (sdk.Msg, error)
	GetKeysignParty(vaultPubKey common.PubKey) (common.PubKeys, error)
	GetMimir(key string) (int64, error)
	GetMimirWithRef(template, ref string) (int64, error)
	GetObservationsStdTx(txIns stypes.ObservedTxs) ([]cosmos.Msg, error)
	GetPools() (stypes.Pools, error)
	GetPubKeys() ([]PubKeyContractAddressPair, error)
	GetAsgardPubKeys() ([]PubKeyContractAddressPair, error)
	GetSolvencyMsg(height int64, chain common.Chain, pubKey common.PubKey, coins common.Coins) sdk.Msg
	GetTHORName(name string) (stypes.THORName, error)
	GetThorchainVersion() (semver.Version, error)
	IsCatchingUp() (bool, error)
	HasNetworkFee(chain common.Chain) (bool, error)
	PostKeysignFailure(blame stypes.Blame, height int64, memo string, coins common.Coins, pubkey common.PubKey) (common.TxID, error)
	PostNetworkFee(height int64, chain common.Chain, transactionSize, transactionRate uint64) (common.TxID, error)
	RagnarokInProgress() (bool, error)
	WaitToCatchUp() error
	GetBlockHeight() (int64, error)
	GetLastObservedInHeight(chain common.Chain) (int64, error)
	GetLastSignedOutHeight(chain common.Chain) (int64, error)
	Broadcast(msgs ...sdk.Msg) (common.TxID, error)
	GetKeysign(blockHeight int64, pk string) (types.TxOut, error)
	GetNodeAccount(string) (*stypes.NodeAccount, error)
	GetKeygenBlock(int64, string) (stypes.KeygenBlock, error)
}

func NewThorchainBridge

func NewThorchainBridge(cfg config.BifrostClientConfiguration, m *metrics.Metrics, k *Keys) (ThorchainBridge, error)

NewThorchainBridge create a new instance of ThorchainBridge

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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