Documentation ¶
Index ¶
- Constants
- func GetAddress(k crypto.Key, sequence *uint32) string
- func GetAddressAndTag(s string) (addr string, tag *uint32, err error)
- func GetStubChainID(network string) *big.Int
- func ImportKeyFromSeed(seed, cryptoType string) (crypto.Key, error)
- func ImportPublicKey(pubkey []byte) crypto.Key
- func MakeSignedTransaction(pubkey []byte, rsv string, transaction interface{}) (signedTx data.Transaction, err error)
- func NewUnsignedPaymentTransaction(key crypto.Key, keyseq *uint32, txseq uint32, dest string, ...) (data.Transaction, error)
- func ParsePaths(s string) (*data.PathSet, error)
- func PublicKeyHexToAddress(pubKeyHex string) (string, error)
- func PublicKeyToAddress(pubkey []byte) string
- 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) (acctRes *websockets.AccountInfoResult, err error)
- func (b *Bridge) GetAccountLine(currency, issuer, accountAddress string) (line *data.AccountLine, err error)
- func (b *Bridge) GetBalance(accountAddress string) (*big.Int, error)
- func (b *Bridge) GetFee() (feeRes *websockets.FeeResult, err error)
- func (b *Bridge) GetLatestBlockNumber() (num uint64, err error)
- func (b *Bridge) GetLatestBlockNumberOf(url string) (num uint64, err error)
- func (b *Bridge) GetPoolNonce(address, _height string) (uint64, error)
- func (b *Bridge) GetSeq(args *tokens.BuildTxArgs) (nonceptr *uint64, err error)
- func (b *Bridge) GetTransaction(txHash string) (tx interface{}, err error)
- func (b *Bridge) GetTransactionByHash(txHash string) (txRes *websockets.TxResult, err error)
- func (b *Bridge) GetTransactionStatus(txHash string) (status *tokens.TxStatus, err error)
- func (b *Bridge) GetTxBlockInfo(txHash string) (blockHeight, blockTime uint64)
- func (b *Bridge) InitRouterInfo(routerContract 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(pubKeyHex 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) SignTransactionWithRippleKey(rawTx interface{}, key rcrypto.Key, keyseq *uint32) (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)
- type EcdsaPublic
Constants ¶
const ( // PubKeyBytesLenCompressed is compressed pubkey byte length PubKeyBytesLenCompressed = 33 // PubKeyBytesLenUncompressed is uncompressed pubkey byte length PubKeyBytesLenUncompressed = 65 )
Variables ¶
This section is empty.
Functions ¶
func GetAddress ¶
GetAddress gets address from ripple key
func GetAddressAndTag ¶
GetAddressAndTag get address and tag
func ImportKeyFromSeed ¶
ImportKeyFromSeed converts seed to ripple key
func ImportPublicKey ¶
ImportPublicKey converts pubkey to ripple pubkey
func MakeSignedTransaction ¶
func MakeSignedTransaction(pubkey []byte, rsv string, transaction interface{}) (signedTx data.Transaction, err error)
MakeSignedTransaction make signed transaction
func NewUnsignedPaymentTransaction ¶
func NewUnsignedPaymentTransaction( key crypto.Key, keyseq *uint32, txseq uint32, dest string, destinationTag *uint32, amt, fee, memo, path string, flags uint32, ) (data.Transaction, error)
NewUnsignedPaymentTransaction build ripple payment tx
func PublicKeyHexToAddress ¶
PublicKeyHexToAddress convert public key hex to ripple address
func PublicKeyToAddress ¶
PublicKeyToAddress converts pubkey to ripple 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 { *base.NonceSetterBase RPCClientTimeout int }
Bridge block bridge inherit from btc bridge
func (*Bridge) BuildRawTransaction ¶
func (b *Bridge) BuildRawTransaction(args *tokens.BuildTxArgs) (rawTx interface{}, err error)
BuildRawTransaction build raw tx
func (*Bridge) GetAccount ¶
func (b *Bridge) GetAccount(address string) (acctRes *websockets.AccountInfoResult, err error)
GetAccount returns account
func (*Bridge) GetAccountLine ¶
func (b *Bridge) GetAccountLine(currency, issuer, accountAddress string) (line *data.AccountLine, err error)
GetAccountLine get account line
func (*Bridge) GetBalance ¶
GetBalance gets balance
func (*Bridge) GetFee ¶
func (b *Bridge) GetFee() (feeRes *websockets.FeeResult, err error)
GetFee get fee
func (*Bridge) GetLatestBlockNumber ¶
GetLatestBlockNumber gets latest block number For ripple, GetLatestBlockNumber returns current ledger version
func (*Bridge) GetLatestBlockNumberOf ¶
GetLatestBlockNumberOf gets latest block number from single api For ripple, GetLatestBlockNumberOf returns current ledger version
func (*Bridge) GetPoolNonce ¶
GetPoolNonce impl NonceSetter interface
func (*Bridge) GetSeq ¶
func (b *Bridge) GetSeq(args *tokens.BuildTxArgs) (nonceptr *uint64, err error)
GetSeq returns account tx sequence
func (*Bridge) GetTransaction ¶
GetTransaction impl
func (*Bridge) GetTransactionByHash ¶
func (b *Bridge) GetTransactionByHash(txHash string) (txRes *websockets.TxResult, err error)
GetTransactionByHash call eth_getTransactionByHash
func (*Bridge) GetTransactionStatus ¶
GetTransactionStatus impl
func (*Bridge) GetTxBlockInfo ¶
GetTxBlockInfo impl NonceSetter interface
func (*Bridge) InitRouterInfo ¶
InitRouterInfo init router info (in ripple 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) SignTransactionWithRippleKey ¶
func (b *Bridge) SignTransactionWithRippleKey(rawTx interface{}, key rcrypto.Key, keyseq *uint32) (signTx interface{}, txHash string, err error)
SignTransactionWithRippleKey sign tx with ripple 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
type EcdsaPublic ¶
type EcdsaPublic struct {
// contains filtered or unexported fields
}
EcdsaPublic struct ripple ecdsa pubkey key
func (*EcdsaPublic) Id ¶
func (k *EcdsaPublic) Id(sequence *uint32) []byte
Id returns pubkey bytes from ripple key
func (*EcdsaPublic) Private ¶
func (k *EcdsaPublic) Private(sequence *uint32) []byte
Private not used
func (*EcdsaPublic) Public ¶
func (k *EcdsaPublic) Public(sequence *uint32) []byte
Public returns pubkey bytes
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
rubblelabs
|
|
ripple/config
Package config provides a simple way of signing submitting groups of transactions for the same account.
|
Package config provides a simple way of signing submitting groups of transactions for the same account. |
ripple/data
Package data aims to provides all the data types that are needed to build tools, clients and servers for use on the Ripple network.
|
Package data aims to provides all the data types that are needed to build tools, clients and servers for use on the Ripple network. |
tools
|
|