Documentation
¶
Index ¶
- func DecodeMemos(memoStr string) (string, *big.Int)
- func EncodeMemo(chainId *big.Int, bindAddr string) (*txnbuild.MemoHash, error)
- func FormatPublicKeyToPureHex(pubKeyHex string) (string, error)
- func GetStubChainID(networkid string) *big.Int
- func MakeSignedTransaction(pubkey *keypair.FromAddress, sig []byte, tx *txnbuild.Transaction) (signedTx *txnbuild.Transaction, err error)
- func NewUnsignedPaymentTransaction(args *tokens.BuildTxArgs, from txnbuild.Account, network, dest, amt string, ...) (*txnbuild.Transaction, error)
- func PublicKeyHexToAddress(pubKeyHex string) (string, error)
- func PublicKeyToAddress(pubkey []byte) (string, error)
- func SetRPCRetryTimes(times int)
- func SupportsChainID(chainID *big.Int) bool
- func VerifyMPCPubKey(mpcAddress, mpcPubkey string) error
- type Bridge
- func (b *Bridge) BuildRawTransaction(args *tokens.BuildTxArgs) (rawTx interface{}, err error)
- func (b *Bridge) GetAccount(address string) (acct *hProtocol.Account, err error)
- func (b *Bridge) GetAsset(code, address string) (acct *hProtocol.AssetStat, err error)
- func (b *Bridge) GetBalance(accountAddress string) (*big.Int, error)
- func (b *Bridge) GetBlockHash(num uint64) (hash string, err error)
- func (b *Bridge) GetBlockTxids(num uint64) (txs []string, err error)
- func (b *Bridge) GetFee() int
- func (b *Bridge) GetLatestBlockNumber() (num uint64, err error)
- func (b *Bridge) GetLatestBlockNumberOf(apiAddress string) (uint64, error)
- func (b *Bridge) GetOperations(txHash string) (opts []interface{}, err error)
- func (b *Bridge) GetTransaction(txHash string) (tx interface{}, err error)
- func (b *Bridge) GetTransactionStatus(txHash string) (status *tokens.TxStatus, err error)
- func (b *Bridge) InitRemotes()
- func (b *Bridge) InitRouterInfo(routerContract, routerVersion string) (err error)
- func (b *Bridge) IsValidAddress(addr string) bool
- func (b *Bridge) MPCSignTransaction(rawTx interface{}, args *tokens.BuildTxArgs) (signTx interface{}, txHash string, err error)
- func (b *Bridge) PublicKeyToAddress(pubKey string) (string, error)
- func (b *Bridge) RegisterSwap(txHash string, args *tokens.RegisterArgs) ([]*tokens.SwapTxInfo, []error)
- func (b *Bridge) SendTransaction(signedTx interface{}) (txHash string, err error)
- func (b *Bridge) SetGatewayConfig(gatewayCfg *tokens.GatewayConfig)
- func (b *Bridge) SetTokenConfig(tokenAddr string, tokenCfg *tokens.TokenConfig)
- func (b *Bridge) SignTransactionWithPrivateKey(rawTx interface{}, privKey string) (signTx interface{}, txHash string, err error)
- func (b *Bridge) SignTransactionWithStellarKey(rawTx interface{}, key *keypair.Full) (signTx interface{}, txHash string, err error)
- func (b *Bridge) VerifyMsgHash(rawTx interface{}, msgHashes []string) (err error)
- func (b *Bridge) VerifyTokenConfig(tokenCfg *tokens.TokenConfig) error
- func (b *Bridge) VerifyTransaction(txHash string, args *tokens.VerifyArgs) (*tokens.SwapTxInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatPublicKeyToPureHex ¶
FormatPublicKeyToPureHex format public key, get rid of hex prefix and ED prefix
func GetStubChainID ¶
GetStubChainID get stub chainID
func MakeSignedTransaction ¶
func MakeSignedTransaction(pubkey *keypair.FromAddress, sig []byte, tx *txnbuild.Transaction) (signedTx *txnbuild.Transaction, err error)
MakeSignedTransaction make signed transaction
func NewUnsignedPaymentTransaction ¶
func NewUnsignedPaymentTransaction(args *tokens.BuildTxArgs, from txnbuild.Account, network, dest, amt string, memo txnbuild.Memo, asset txnbuild.Asset, ) (*txnbuild.Transaction, error)
NewUnsignedPaymentTransaction build stellar payment tx
func PublicKeyHexToAddress ¶
PublicKeyHexToAddress convert public key hex to stellar address
func PublicKeyToAddress ¶
PublicKeyToAddress public key to address
func SetRPCRetryTimes ¶
func SetRPCRetryTimes(times int)
SetRPCRetryTimes set rpc retry times (used in cmd tools)
func VerifyMPCPubKey ¶
VerifyMPCPubKey verify mpc address and public key is matching
Types ¶
type Bridge ¶
type Bridge struct { *tokens.CrossChainBridgeBase NetworkStr string Remotes map[string]*horizonclient.Client }
Bridge block bridge inherit from btc bridge
func NewCrossChainBridge ¶
NewCrossChainBridge new bridge
func (*Bridge) BuildRawTransaction ¶
func (b *Bridge) BuildRawTransaction(args *tokens.BuildTxArgs) (rawTx interface{}, err error)
BuildRawTransaction build raw tx
func (*Bridge) GetAccount ¶
GetAccount returns account
func (*Bridge) GetBalance ¶
GetBalance gets balance
func (*Bridge) GetBlockHash ¶
GetBlockHash gets block hash
func (*Bridge) GetBlockTxids ¶
GetBlockTxids gets block txids
func (*Bridge) GetLatestBlockNumber ¶
GetLatestBlockNumber gets latest block number For stellar, GetLatestBlockNumber returns current ledger version
func (*Bridge) GetLatestBlockNumberOf ¶
GetLatestBlockNumberOf gets latest block number from single api For stellar, GetLatestBlockNumberOf returns current ledger version
func (*Bridge) GetOperations ¶
GetOperations get operations
func (*Bridge) GetTransaction ¶
GetTransaction impl
func (*Bridge) GetTransactionStatus ¶
GetTransactionStatus impl
func (*Bridge) InitRouterInfo ¶
InitRouterInfo init router info (in stellar routerContract is routerMPC)
func (*Bridge) IsValidAddress ¶
IsValidAddress check address
func (*Bridge) MPCSignTransaction ¶
func (b *Bridge) MPCSignTransaction(rawTx interface{}, args *tokens.BuildTxArgs) (signTx interface{}, txHash string, err error)
MPCSignTransaction mpc sign raw tx
func (*Bridge) PublicKeyToAddress ¶
PublicKeyToAddress impl
func (*Bridge) RegisterSwap ¶
func (b *Bridge) RegisterSwap(txHash string, args *tokens.RegisterArgs) ([]*tokens.SwapTxInfo, []error)
RegisterSwap api
func (*Bridge) SendTransaction ¶
SendTransaction send signed tx
func (*Bridge) SetGatewayConfig ¶
func (b *Bridge) SetGatewayConfig(gatewayCfg *tokens.GatewayConfig)
SetGatewayConfig set gateway config
func (*Bridge) SetTokenConfig ¶
func (b *Bridge) SetTokenConfig(tokenAddr string, tokenCfg *tokens.TokenConfig)
SetTokenConfig set token config
func (*Bridge) SignTransactionWithPrivateKey ¶
func (b *Bridge) SignTransactionWithPrivateKey(rawTx interface{}, privKey string) (signTx interface{}, txHash string, err error)
SignTransactionWithPrivateKey sign tx with ECDSA private key
func (*Bridge) SignTransactionWithStellarKey ¶
func (b *Bridge) SignTransactionWithStellarKey(rawTx interface{}, key *keypair.Full) (signTx interface{}, txHash string, err error)
SignTransactionWithStellarKey sign tx with stellar key
func (*Bridge) VerifyMsgHash ¶
VerifyMsgHash verify msg hash
func (*Bridge) VerifyTokenConfig ¶
func (b *Bridge) VerifyTokenConfig(tokenCfg *tokens.TokenConfig) error
VerifyTokenConfig verify token config
func (*Bridge) VerifyTransaction ¶
func (b *Bridge) VerifyTransaction(txHash string, args *tokens.VerifyArgs) (*tokens.SwapTxInfo, error)
VerifyTransaction impl