Documentation ¶
Index ¶
- Variables
- type ChainService
- type EthChainInterface
- type EthChainService
- func (eth *EthChainService) DeriveAddress(p *model.Phonon) (address string, err error)
- func (eth *EthChainService) RedeemPhonon(p *model.Phonon, privKey *ecdsa.PrivateKey, redeemAddress string) (transactionData string, err error)
- func (eth *EthChainService) ValidateRedeemData(p *model.Phonon, privKey *ecdsa.PrivateKey, redeemAddress string) (err error)
- type MultiChainRouter
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCurrencyTypeUnsupported = errors.New("currency type is not supported")
View Source
var ErrMissingKeyIndex = errors.New("phonon missing KeyIndex")
View Source
var ErrMissingPubKey = errors.New("phonon missing pubKey")
View Source
var ErrUnknownCurrencyType = errors.New("unknown currency type")
Functions ¶
This section is empty.
Types ¶
type ChainService ¶
type EthChainInterface ¶
type EthChainInterface interface { bind.ContractTransactor ethereum.ChainStateReader }
Composite interface supporting all needed EVM RPC calls
type EthChainService ¶
type EthChainService struct {
// contains filtered or unexported fields
}
func NewEthChainService ¶
func NewEthChainService() (*EthChainService, error)
func (*EthChainService) DeriveAddress ¶
func (eth *EthChainService) DeriveAddress(p *model.Phonon) (address string, err error)
Derives an ETH address from a phonon's ECDSA Public Key
func (*EthChainService) RedeemPhonon ¶
func (eth *EthChainService) RedeemPhonon(p *model.Phonon, privKey *ecdsa.PrivateKey, redeemAddress string) (transactionData string, err error)
func (*EthChainService) ValidateRedeemData ¶
func (eth *EthChainService) ValidateRedeemData(p *model.Phonon, privKey *ecdsa.PrivateKey, redeemAddress string) (err error)
ReconcileRedeemData validates the input data to ensure it contains all that's needed for a successful redemption. It will update the phonon data structure with a derived address if necessary
type MultiChainRouter ¶
type MultiChainRouter struct {
// contains filtered or unexported fields
}
MultiChainRouter is a ChainService supporting multiple currencyTypes by encapsulating a specific hardcoded collection of ChainServices keyed by CurrencyType
func NewMultiChainRouter ¶
func NewMultiChainRouter() (*MultiChainRouter, error)
Initialize all supported chain services at start
func (*MultiChainRouter) DeriveAddress ¶
func (mcr *MultiChainRouter) DeriveAddress(p *model.Phonon) (address string, err error)
ChainService interface methods
func (*MultiChainRouter) RedeemPhonon ¶
func (mcr *MultiChainRouter) RedeemPhonon(p *model.Phonon, privKey *ecdsa.PrivateKey, redeemAddress string) (transactionData string, err error)
Click to show internal directories.
Click to hide internal directories.