Documentation ¶
Index ¶
- Constants
- Variables
- func CreateRadixCoreApiClient(baseUrl string) (*apiclient.RadixCoreApiClient, error)
- func GetTotalTxnFee(receipt models.TransactionReceiptable) (common.Gas, error)
- func MayaSubunitsToXrd(value cosmos.Uint) cosmos.Uint
- func XrdSubunitsToMayaRoundingDown(value cosmos.Uint) cosmos.Uint
- func XrdSubunitsToMayaRoundingUp(value cosmos.Uint) cosmos.Uint
- type Client
- func (c *Client) BroadcastTx(txOutItem stypes.TxOutItem, notarizedTransactionBytes []byte) (string, error)
- func (c *Client) ConfirmationCountReady(txIn stypes.TxIn) bool
- func (c *Client) GetAccount(pkey common.PubKey, height *big.Int) (common.Account, error)
- func (c *Client) GetAccountByAddress(address string, height *big.Int) (common.Account, error)
- func (c *Client) GetAddress(poolPubKey common.PubKey) string
- func (c *Client) GetBlockScannerHeight() (int64, error)
- func (c *Client) GetChain() common.Chain
- func (c *Client) GetConfig() config.BifrostChainConfiguration
- func (c *Client) GetConfirmationCount(txIn stypes.TxIn) int64
- func (c *Client) GetHeight() (int64, error)
- func (c *Client) GetLatestTxForVault(vault string) (string, string, error)
- func (c *Client) IsBlockScannerHealthy() bool
- func (c *Client) OnObservedTxIn(txIn stypes.TxInItem, blockHeight int64)
- func (c *Client) ReportSolvency(xrdHeight int64) error
- func (c *Client) ShouldReportSolvency(xrdHeight int64) bool
- func (c *Client) SignTx(tx stypes.TxOutItem, height int64) ([]byte, []byte, *stypes.TxInItem, error)
- func (c *Client) Start(globalTxsQueue chan stypes.TxIn, globalErrataQueue chan stypes.ErrataBlock, ...)
- func (c *Client) Stop()
- type RadixScanner
- type SignerHelper
- type SolvencyReporter
Constants ¶
View Source
const ( OneOnRadix = 1000000000000000000 OneOnMaya = common.One ScalingFactor = OneOnRadix / OneOnMaya )
Variables ¶
View Source
var ( XrdFeeEstimateInRadixSubunits = cosmos.NewUint(5000000000000000000) // 5 XRD XrdFeeEstimateInMayaSubunits = XrdSubunitsToMayaRoundingDown(XrdFeeEstimateInRadixSubunits) )
Functions ¶
func CreateRadixCoreApiClient ¶
func CreateRadixCoreApiClient(baseUrl string) (*apiclient.RadixCoreApiClient, error)
func GetTotalTxnFee ¶
func GetTotalTxnFee(receipt models.TransactionReceiptable) (common.Gas, error)
func XrdSubunitsToMayaRoundingDown ¶
XrdSubunitsToMayaRoundingDown Returns the value converted from Radix (18 decimals) to Maya (8 decimals) rounded down, if needed. This is used for conversions that affect deposits from vault accounts, so that the protocol's books are always less or equal to the actual balance on-chain.
func XrdSubunitsToMayaRoundingUp ¶
XrdSubunitsToMayaRoundingUp Returns the value converted from Radix (18 decimals) to Maya (8 decimals) rounded up, if needed. This is used for conversions that affect withdrawals from vault accounts (incl. fee payments), so that the protocol's books are always less or equal to the actual balance on-chain.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient( mayaKeys *mayaclient.Keys, cfg config.BifrostChainConfiguration, tssServer *tssp.TssServer, mayaBridge mayaclient.MayachainBridge, metrics *metrics.Metrics, pubKeyValidator pubkeymanager.PubKeyValidator, ) (*Client, error)
func (*Client) BroadcastTx ¶
func (*Client) ConfirmationCountReady ¶
func (*Client) GetAccount ¶
func (*Client) GetAccountByAddress ¶
func (*Client) GetBlockScannerHeight ¶
func (*Client) GetConfig ¶
func (c *Client) GetConfig() config.BifrostChainConfiguration
func (*Client) GetLatestTxForVault ¶
func (*Client) IsBlockScannerHealthy ¶
func (*Client) OnObservedTxIn ¶
func (*Client) ReportSolvency ¶
func (*Client) ShouldReportSolvency ¶
type RadixScanner ¶
type RadixScanner struct {
// contains filtered or unexported fields
}
func NewRadixScanner ¶
func NewRadixScanner( cfg config.BifrostBlockScannerConfiguration, scannerStorage blockscanner.ScannerStorage, coreApiWrapper *coreapi.CoreApiWrapper, mayaBridge mayaclient.MayachainBridge, metrics *metrics.Metrics, pubKeyValidator pubkeymanager.PubKeyValidator, network types.Network, xrdAddress string, ) (*RadixScanner, error)
func (*RadixScanner) FetchMemPool ¶
func (e *RadixScanner) FetchMemPool(_ int64) (stypes.TxIn, error)
func (*RadixScanner) FetchTxs ¶
func (e *RadixScanner) FetchTxs(fetchHeight, chainHeight int64) (stypes.TxIn, error)
func (*RadixScanner) GetHeight ¶
func (e *RadixScanner) GetHeight() (int64, error)
type SignerHelper ¶
type SignerHelper struct {
// contains filtered or unexported fields
}
func NewSignerHelper ¶
func NewSignerHelper(privateKey *ecdsa.PrivateKey, pubKey common.PubKey, keyManager tss.ThorchainKeyManager, mayaBridge mayaclient.MayachainBridge) *SignerHelper
func (*SignerHelper) Sign ¶
func (h *SignerHelper) Sign(txOutItem stypes.TxOutItem, signedIntent *ret.SignedIntent, poolPubKey common.PubKey, mayaHeight int64) (*ret.NotarizedTransaction, error)
type SolvencyReporter ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.