mayaclient

package
v1.103.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthAccountEndpoint      = "/auth/accounts"
	BroadcastTxsEndpoint     = "/"
	KeygenEndpoint           = "/mayachain/keygen"
	KeysignEndpoint          = "/mayachain/keysign"
	LastBlockEndpoint        = "/mayachain/lastblock"
	NodeAccountEndpoint      = "/mayachain/node"
	SignerMembershipEndpoint = "/mayachain/vaults/%s/signers"
	StatusEndpoint           = "/status"
	AsgardVault              = "/mayachain/vaults/asgard"
	PubKeysEndpoint          = "/mayachain/vaults/pubkeys"
	MayachainConstants       = "/mayachain/constants"
	RagnarokEndpoint         = "/mayachain/ragnarok"
	MimirEndpoint            = "/mayachain/mimir"
	ChainVersionEndpoint     = "/mayachain/version"
	InboundAddressesEndpoint = "/mayachain/inbound_addresses"
	PoolsEndpoint            = "/mayachain/pools"
	MAYANameEndpoint         = "/mayachain/mayaname/%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

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 mayachain

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 MayachainBridge

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

MayachainBridge will be used to send tx to BASEChain

func NewMayachainBridge

func NewMayachainBridge(cfg config.BifrostClientConfiguration, m *metrics.Metrics, k *Keys) (*MayachainBridge, error)

NewMayachainBridge create a new instance of MayachainBridge

func (*MayachainBridge) Broadcast

func (b *MayachainBridge) Broadcast(msgs ...stypes.Msg) (common.TxID, error)

Broadcast Broadcasts tx to mayachain

func (*MayachainBridge) EnsureNodeWhitelisted

func (b *MayachainBridge) EnsureNodeWhitelisted() error

EnsureNodeWhitelisted will call to mayachain to check whether the observer had been whitelist or not

func (*MayachainBridge) EnsureNodeWhitelistedWithTimeout

func (b *MayachainBridge) EnsureNodeWhitelistedWithTimeout() error

EnsureNodeWhitelistedWithTimeout check node is whitelisted with timeout retry

func (*MayachainBridge) FetchNodeStatus

func (b *MayachainBridge) FetchNodeStatus() (stypes.NodeStatus, error)

FetchNodeStatus get current node status from mayachain

func (*MayachainBridge) GetAsgards

func (b *MayachainBridge) GetAsgards() (stypes.Vaults, error)

GetAsgards retrieve all the asgard vaults from mayachain

func (*MayachainBridge) GetBlockHeight

func (b *MayachainBridge) GetBlockHeight() (int64, error)

GetBlockHeight returns the current height for mayachain blocks

func (*MayachainBridge) GetConfig

GetConfig return the configuration

func (*MayachainBridge) GetConstants

func (b *MayachainBridge) GetConstants() (map[string]int64, error)

GetConstants from thornode

func (*MayachainBridge) GetContext

func (b *MayachainBridge) GetContext() client.Context

GetContext return a valid context with all relevant values set

func (*MayachainBridge) GetContractAddress

func (b *MayachainBridge) GetContractAddress() ([]PubKeyContractAddressPair, error)

GetContractAddress retrieve the contract address from asgard

func (*MayachainBridge) GetErrataMsg

func (b *MayachainBridge) GetErrataMsg(txID common.TxID, chain common.Chain) sdk.Msg

GetErrataMsg get errata tx from params

func (*MayachainBridge) GetKeygenBlock

func (b *MayachainBridge) GetKeygenBlock(blockHeight int64, pk string) (types.KeygenBlock, error)

GetKeygenBlock retrieves keygen request for the given block height from mayachain

func (*MayachainBridge) GetKeygenStdTx

func (b *MayachainBridge) GetKeygenStdTx(poolPubKey common.PubKey, blame stypes.Blame, inputPks common.PubKeys, keygenType stypes.KeygenType, chains common.Chains, height, keygenTime int64) (sdk.Msg, error)

GetKeygenStdTx get keygen tx from params

func (*MayachainBridge) GetKeysign

func (b *MayachainBridge) GetKeysign(blockHeight int64, pk string) (types.TxOut, error)

GetKeysign retrieves txout from this block height from mayachain

func (*MayachainBridge) GetKeysignParty

func (b *MayachainBridge) GetKeysignParty(vaultPubKey common.PubKey) (common.PubKeys, error)

GetKeysignParty call into mayachain to get the node accounts that should be join together to sign the message

func (*MayachainBridge) GetLastObservedInHeight

func (b *MayachainBridge) GetLastObservedInHeight(chain common.Chain) (int64, error)

GetLastObservedInHeight returns the lastobservedin value for the chain past in

func (*MayachainBridge) GetLastSignedOutHeight

func (b *MayachainBridge) GetLastSignedOutHeight(chain common.Chain) (int64, error)

GetLastSignedOutHeight returns the lastsignedout value for mayachain

func (*MayachainBridge) GetMAYAName

func (b *MayachainBridge) GetMAYAName(name string) (stypes.MAYAName, error)

GetMAYAName get MAYAName from BASEChain

func (*MayachainBridge) GetMayachainVersion

func (b *MayachainBridge) GetMayachainVersion() (semver.Version, error)

GetMayachainVersion retrieve mayachain version

func (*MayachainBridge) GetMimir

func (b *MayachainBridge) GetMimir(key string) (int64, error)

GetMimir - get mimir settings

func (*MayachainBridge) GetNodeAccount

func (b *MayachainBridge) GetNodeAccount(thorAddr string) (*types.NodeAccount, error)

GetNodeAccount retrieves node account for this address from mayachain

func (*MayachainBridge) GetObservationsStdTx

func (b *MayachainBridge) GetObservationsStdTx(txIns stypes.ObservedTxs) ([]cosmos.Msg, error)

GetObservationsStdTx get observations tx from txIns

func (*MayachainBridge) GetPools

func (b *MayachainBridge) GetPools() (stypes.Pools, error)

GetPools get pools from BASEChain

func (*MayachainBridge) GetPubKeys

func (b *MayachainBridge) GetPubKeys() ([]PubKeyContractAddressPair, error)

GetPubKeys retrieve asgard vaults and yggdrasil vaults , and it's relevant smart contracts

func (*MayachainBridge) GetSolvencyMsg

func (b *MayachainBridge) GetSolvencyMsg(height int64, chain common.Chain, pubKey common.PubKey, coins common.Coins) sdk.Msg

GetSolvencyMsg create MsgSolvency from the given parameters

func (*MayachainBridge) IsCatchingUp

func (b *MayachainBridge) IsCatchingUp() (bool, error)

IsCatchingUp returns bool for if mayachain is catching up to the rest of the nodes. Returns yes, if it is, false if it is caught up.

func (*MayachainBridge) PostKeysignFailure

func (b *MayachainBridge) PostKeysignFailure(blame stypes.Blame, height int64, memo string, coins common.Coins, pubkey common.PubKey) (common.TxID, error)

PostKeysignFailure generate and post a keysign fail tx to thorchan

func (*MayachainBridge) PostNetworkFee

func (b *MayachainBridge) PostNetworkFee(height int64, chain common.Chain, transactionSize, transactionRate uint64) (common.TxID, error)

PostNetworkFee send network fee message to THORNode

func (*MayachainBridge) RagnarokInProgress

func (b *MayachainBridge) RagnarokInProgress() (bool, error)

RagnarokInProgress is to query mayachain to check whether ragnarok had been triggered

func (*MayachainBridge) WaitToCatchUp

func (b *MayachainBridge) WaitToCatchUp() error

WaitToCatchUp wait for mayachain to catch up

type PoolManager

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

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

PoolMgr implement PoolManager interface

func NewPoolMgr

func NewPoolMgr(bridge *MayachainBridge) *PoolMgr

NewPoolMgr create a new instance of PoolMgr

func (*PoolMgr) GetValue

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

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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