Documentation ¶
Index ¶
- Constants
- Variables
- func CreateTransaction(signerAddress sdk.Address, signerIndex int, signerSequence uint64, gas uint64, ...) (*sdk.Transaction, error)
- func GetAccount(url, address string) (*sdk.Account, error)
- func GetBlockNumberByHash(url string, blockId sdk.Identifier) (uint64, error)
- func GetLatestBlock(url string) (*sdk.Block, error)
- func GetStubChainID(network string) *big.Int
- func GetTransactionByHash(url, txHash string) (*sdk.TransactionResult, error)
- func ParseFlowNumber(amount *big.Int) string
- func SupportsChainID(chainID *big.Int) bool
- type Bridge
- func (b *Bridge) BroadcastTxCommit(signedTx *sdk.Transaction) (txHash string, err error)
- func (b *Bridge) BuildRawTransaction(args *tokens.BuildTxArgs) (rawTx interface{}, err error)
- func (b *Bridge) GetAccountIndex(address, pubKey string) (int, error)
- func (b *Bridge) GetAccountNonce(address, pubKey string) (uint64, error)
- func (b *Bridge) GetBlockNumberByHash(blockId sdk.Identifier) (uint64, error)
- func (b *Bridge) GetLatestBlockID() (sdk.Identifier, error)
- func (b *Bridge) GetLatestBlockNumber() (uint64, error)
- func (b *Bridge) GetLatestBlockNumberOf(apiAddress string) (uint64, error)
- func (b *Bridge) GetMPCAddress() (string, error)
- func (b *Bridge) GetPoolNonce(address, _height string) (uint64, error)
- func (b *Bridge) GetSeq(args *tokens.BuildTxArgs) (nonceptr *uint64, err error)
- func (b *Bridge) GetTokenDecimals(tokenAddr string) (uint8, error)
- func (b *Bridge) GetTransaction(txHash string) (tx interface{}, err error)
- func (b *Bridge) GetTransactionByHash(txHash string) (result *sdk.TransactionResult, 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) GetUnderlyingAddress(contractAddr string) (string, error)
- func (b *Bridge) InitAfterConfig()
- func (b *Bridge) InitRouterInfo(routerContract, routerVersion string) (err error)
- func (b *Bridge) IsValidAddress(address string) bool
- func (b *Bridge) MPCSignTransaction(rawTx interface{}, args *tokens.BuildTxArgs) (signedTx interface{}, txHash string, err error)
- func (b *Bridge) PubKeyToAccountKey(pubKey string) (string, error)
- func (b *Bridge) PubKeyToMpcPubKey(pubKey string) (string, 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) SetTokenConfig(tokenAddr string, tokenCfg *tokens.TokenConfig)
- func (b *Bridge) SignTransactionWithPrivateKey(rawTx interface{}, privKey string) (signedTx interface{}, txHash string, err error)
- func (b *Bridge) VerifyMsgHash(rawTx interface{}, msgHashes []string) (err error)
- func (b *Bridge) VerifyPubKey(address, pubKey string) error
- func (b *Bridge) VerifyTokenConfig(tokenCfg *tokens.TokenConfig) error
- func (b *Bridge) VerifyTransaction(txHash string, args *tokens.VerifyArgs) (*tokens.SwapTxInfo, error)
- type EcdsaPublic
- type SwapIn
Constants ¶
const ( // PubKeyBytesLenCompressed is compressed pubkey byte length PubKeyBytesLenCompressed = 33 // PubKeyBytesLenUncompressed is uncompressed pubkey byte length PubKeyBytesLenUncompressed = 65 )
const (
Success_Status = "SEALED"
)
Variables ¶
var ( LenForPubKey = 128 AddressLength = 16 )
var (
Event_Type = "A.%s.Router.LogSwapOut"
)
var (
FixLen = 8
)
Functions ¶
func CreateTransaction ¶
func GetAccount ¶
GetLatestBlockNumber get latest block height
func GetBlockNumberByHash ¶
func GetBlockNumberByHash(url string, blockId sdk.Identifier) (uint64, error)
func GetLatestBlock ¶
GetLatestBlockNumber get latest block height
func GetTransactionByHash ¶
func GetTransactionByHash(url, txHash string) (*sdk.TransactionResult, error)
GetTransactionByHash get tx by hash
func ParseFlowNumber ¶
Types ¶
type Bridge ¶
type Bridge struct {
*base.NonceSetterBase
}
Bridge near bridge
func (*Bridge) BroadcastTxCommit ¶
func (b *Bridge) BroadcastTxCommit(signedTx *sdk.Transaction) (txHash string, err error)
func (*Bridge) BuildRawTransaction ¶
func (b *Bridge) BuildRawTransaction(args *tokens.BuildTxArgs) (rawTx interface{}, err error)
BuildRawTransaction build raw tx
func (*Bridge) GetAccountIndex ¶
func (*Bridge) GetAccountNonce ¶
func (*Bridge) GetBlockNumberByHash ¶
func (b *Bridge) GetBlockNumberByHash(blockId sdk.Identifier) (uint64, error)
func (*Bridge) GetLatestBlockID ¶
func (b *Bridge) GetLatestBlockID() (sdk.Identifier, error)
func (*Bridge) GetLatestBlockNumber ¶
GetLatestBlockNumber gets latest block number
func (*Bridge) GetLatestBlockNumberOf ¶
GetLatestBlockNumberOf gets latest block number from single api
func (*Bridge) GetMPCAddress ¶
GetMPCAddress query mpc address
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) GetTokenDecimals ¶
GetTokenDecimals query token decimals
func (*Bridge) GetTransaction ¶
GetTransaction impl
func (*Bridge) GetTransactionByHash ¶
func (b *Bridge) GetTransactionByHash(txHash string) (result *sdk.TransactionResult, err error)
GetTransactionByHash get tx response by hash
func (*Bridge) GetTransactionStatus ¶
GetTransactionStatus impl
func (*Bridge) GetTxBlockInfo ¶
GetTxBlockInfo impl NonceSetter interface
func (*Bridge) GetUnderlyingAddress ¶
GetUnderlyingAddress query underlying address
func (*Bridge) InitAfterConfig ¶
func (b *Bridge) InitAfterConfig()
InitAfterConfig init variables (ie. extra members) after loading config
func (*Bridge) InitRouterInfo ¶
InitRouterInfo init router info
func (*Bridge) IsValidAddress ¶
func (*Bridge) MPCSignTransaction ¶
func (b *Bridge) MPCSignTransaction(rawTx interface{}, args *tokens.BuildTxArgs) (signedTx interface{}, txHash string, err error)
MPCSignTransaction mpc sign raw tx
func (*Bridge) PubKeyToAccountKey ¶
func (*Bridge) PubKeyToMpcPubKey ¶
func (*Bridge) PublicKeyToAddress ¶
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) SetTokenConfig ¶
func (b *Bridge) SetTokenConfig(tokenAddr string, tokenCfg *tokens.TokenConfig)
SetTokenConfig set and verify token config
func (*Bridge) SignTransactionWithPrivateKey ¶
func (b *Bridge) SignTransactionWithPrivateKey(rawTx interface{}, privKey string) (signedTx interface{}, txHash string, err error)
SignTransactionWithPrivateKey sign tx with ECDSA private key string
func (*Bridge) VerifyMsgHash ¶
VerifyMsgHash verify msg hash
func (*Bridge) VerifyPubKey ¶
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) 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