Documentation ¶
Index ¶
- Constants
- func Bech32ToEdAddr(bech32 string) (*iotago.Address, error)
- func CheckBalance(url string, edAddr *iotago.Ed25519Address, amount uint64) (uint64, error)
- func CommitMessage(url string, message *iotago.Message) (string, error)
- func ConvertMessageID(txHash string) ([32]byte, error)
- func ConvertPubKeyToAddr(addrPubKey string) *iotago.Ed25519Address
- func ConvertStringToAddress(edAddr string) *iotago.Ed25519Address
- func GetLatestBlockNumber(url string) (uint64, error)
- func GetOutPutByID(url string, outputID iotago.UTXOInputID, needValue uint64, finish bool) (*iotago.UTXOInput, uint64, uint64, error)
- func GetOutPutIDs(url string, edAddr *iotago.Ed25519Address) ([]iotago.OutputIDHex, error)
- func GetStubChainID(network string) *big.Int
- func GetTransactionByHash(url string, msgID [32]byte) (*iotago.Message, error)
- func GetTransactionMetadata(url string, msgID [32]byte) (*iotago.MessageMetadataResponse, error)
- func ParseIndexPayload(payload Payload) (string, string, error)
- func ProofOfWork(url string, message *iotago.MessageBuilder) (*iotago.Message, error)
- func SupportsChainID(chainID *big.Int) bool
- func VerifyMPCPubKey(mpcAddress, mpcPubkey string) error
- type Address
- type Bridge
- func (b *Bridge) BuildRawTransaction(args *tokens.BuildTxArgs) (rawTx interface{}, err error)
- func (b *Bridge) CheckBalance(edAddr *iotago.Ed25519Address, amount uint64) (uint64, error)
- func (b *Bridge) GetLatestBlockNumber() (num uint64, err error)
- func (b *Bridge) GetLatestBlockNumberOf(url string) (num uint64, err error)
- func (b *Bridge) GetOutPutByID(id iotago.OutputIDHex, needValue uint64, finish bool) (*iotago.UTXOInput, uint64, uint64, error)
- func (b *Bridge) GetOutPutIDs(addr *iotago.Ed25519Address) ([]iotago.OutputIDHex, 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 *iotago.Message, err error)
- func (b *Bridge) GetTransactionMetadata(txHash string) (txRes *iotago.MessageMetadataResponse, err error)
- func (b *Bridge) GetTransactionStatus(txHash string) (status *tokens.TxStatus, err error)
- func (b *Bridge) InitRouterInfo(routerContract string, 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) ParseMessagePayload(swapInfo *tokens.SwapTxInfo, payload []byte) error
- func (b *Bridge) ProofOfWork(messageBuilder *iotago.MessageBuilder) (*iotago.Message, 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) 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 Essence
- type Input
- type MessageBuilder
- type MessagePayload
- type Output
- type Payload
- type RawType
Constants ¶
const (
KeepAlive uint64 = 1000000
)
const (
SWAPOUT = "swapOut"
)
Variables ¶
This section is empty.
Functions ¶
func CheckBalance ¶
func ConvertMessageID ¶
func ConvertPubKeyToAddr ¶
func ConvertPubKeyToAddr(addrPubKey string) *iotago.Ed25519Address
func ConvertStringToAddress ¶
func ConvertStringToAddress(edAddr string) *iotago.Ed25519Address
func GetLatestBlockNumber ¶
func GetOutPutByID ¶
func GetOutPutIDs ¶
func GetOutPutIDs(url string, edAddr *iotago.Ed25519Address) ([]iotago.OutputIDHex, error)
func GetTransactionByHash ¶
func GetTransactionMetadata ¶
func GetTransactionMetadata(url string, msgID [32]byte) (*iotago.MessageMetadataResponse, error)
func ProofOfWork ¶
func VerifyMPCPubKey ¶
VerifyMPCPubKey verify mpc address and public key is matching
Types ¶
type Bridge ¶
type Bridge struct {
*base.NonceSetterBase
}
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) CheckBalance ¶
GetTransactionStatus impl
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) GetOutPutByID ¶
func (*Bridge) GetOutPutIDs ¶
func (b *Bridge) GetOutPutIDs(addr *iotago.Ed25519Address) ([]iotago.OutputIDHex, error)
GetTxBlockInfo impl NonceSetter interface
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 ¶
GetTransactionByHash call eth_getTransactionByHash
func (*Bridge) GetTransactionMetadata ¶
func (b *Bridge) GetTransactionMetadata(txHash string) (txRes *iotago.MessageMetadataResponse, err error)
GetTransactionByHash call eth_getTransactionByHash
func (*Bridge) GetTransactionStatus ¶
GetTransactionStatus impl
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) ParseMessagePayload ¶
func (b *Bridge) ParseMessagePayload(swapInfo *tokens.SwapTxInfo, payload []byte) error
func (*Bridge) ProofOfWork ¶
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) 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 MessageBuilder ¶
type MessageBuilder struct { TransactionBuilder *iotago.TransactionBuilder `json:"transactionBuilder"` Essence *iotago.TransactionEssence `json:"essence"` }
func BuildMessage ¶
func BuildMessage(inputs []*iotago.ToBeSignedUTXOInput, outputs []*iotago.SigLockedSingleOutput, indexationPayload *iotago.Indexation) *MessageBuilder
func NewMessageBuilder ¶
func NewMessageBuilder() *MessageBuilder