Documentation ¶
Index ¶
- Variables
- func PublicKeyToAddress(pubKeyHex string) (string, error)
- func SupportChainID(chainID *big.Int) bool
- type Bridge
- func (b *Bridge) AirDrop(publicKey string, amount uint64) (string, error)
- func (b *Bridge) BuildApplyMpcTransaction(routerContract, routerMPC, routerPDA, newMpcAddress string) (*types.Transaction, error)
- func (b *Bridge) BuildChangeMpcTransaction(routerContract, routerMPC, routerPDA, newMpcAddress string) (*types.Transaction, error)
- func (b *Bridge) BuildEnableSwapTransaction(routerContract, routerMPC, routerPDA string, enable bool) (*types.Transaction, error)
- func (b *Bridge) BuildMintSPLTransaction(amount uint64, mintAddr, toAddr, minterAddr string) (*types.Transaction, error)
- func (b *Bridge) BuildRawTransaction(args *tokens.BuildTxArgs) (rawTx interface{}, err error)
- func (b *Bridge) BuildSendSPLTransaction(amount uint64, sourceAddr, destAddr, fromAddr string) (*types.Transaction, error)
- func (b *Bridge) BuildSendSolanaTransaction(lamports uint64, fromAddress, toAddress string) (*types.Transaction, error)
- func (b *Bridge) BuildSwapinMintTransaction(args *tokens.BuildTxArgs, tokenCfg *tokens.TokenConfig) (*types.Transaction, error)
- func (b *Bridge) BuildSwapinNativeTransaction(args *tokens.BuildTxArgs, tokenCfg *tokens.TokenConfig) (*types.Transaction, error)
- func (b *Bridge) BuildSwapinTransferTransaction(args *tokens.BuildTxArgs, tokenCfg *tokens.TokenConfig) (*types.Transaction, error)
- func (b *Bridge) GetAccountInfo(account, encoding string) (result *types.GetAccountInfoResult, err error)
- func (b *Bridge) GetBalance(publicKey string) (*big.Int, error)
- func (b *Bridge) GetBlock(slot uint64, fullTx bool) (result *types.GetBlockResult, err error)
- func (b *Bridge) GetBlockHeight() (uint64, error)
- func (b *Bridge) GetBlocks(start, end uint64) (*[]uint64, error)
- func (b *Bridge) GetCurrentThreshold() (*uint64, error)
- func (b *Bridge) GetEpochInfo() (*types.GetEpochInfoResult, error)
- func (b *Bridge) GetFeeForMessage(blockhash, message string) (result uint64, err error)
- func (b *Bridge) GetFees() (result *types.GetFeesResult, err error)
- func (b *Bridge) GetLatestBlockNumber() (uint64, error)
- func (b *Bridge) GetLatestBlockNumberOf(url string) (uint64, error)
- func (b *Bridge) GetLatestBlockhash() (result *types.GetLatestBlockhashResult, err error)
- func (b *Bridge) GetMPCAddress(programID string) (types.PublicKey, error)
- func (b *Bridge) GetMinimumBalanceForRentExemption(datalength uint64) (uint64, error)
- func (b *Bridge) GetNonceAccountInfo(account string) (result *types.GetNonceAccountInfoResult, err error)
- func (b *Bridge) GetProgramAccounts(account, encoding string, filters []map[string]interface{}) (result types.GetProgramAccountsResult, err error)
- func (b *Bridge) GetRecentBlockhash() (result *types.GetRecentBlockhashResult, err error)
- func (b *Bridge) GetRouterAccount(programID string) (*RouterAccount, error)
- func (b *Bridge) GetSignatureStatuses(sigs []string, searchTransactionHistory bool) (result *types.GetSignatureStatusesResult, err error)
- func (b *Bridge) GetTokenBalance(tokenAccount string) (result *types.GetTokenAmountResult, err error)
- func (b *Bridge) GetTokenDecimals(tokenMint string) (uint8, error)
- func (b *Bridge) GetTokenSupply(tokenMint string) (result *types.GetTokenAmountResult, err error)
- func (b *Bridge) GetTransaction(txHash string) (result interface{}, err error)
- func (b *Bridge) GetTransactionStatus(txHash string) (*tokens.TxStatus, error)
- func (b *Bridge) GetTxBlockInfo(txHash string) (blockHeight, blockTime uint64)
- func (b *Bridge) InitAfterConfig()
- func (b *Bridge) InitRouterInfo(routerContract, routerVersion string) (err error)
- func (b *Bridge) IsBlockhashValid(blockhash string) (bool, error)
- func (b *Bridge) IsMinter(tokenMint, minterAddr string) (bool, error)
- func (b *Bridge) IsNative(address string) bool
- func (b *Bridge) IsValidAddress(address 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) SendSignedTransaction(tx *types.Transaction, opts *types.SendTransactionOptions) (txHash string, err 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) SimulateTransaction(tx *types.Transaction) (result *types.SimulateTransactionResponse, err error)
- func (b *Bridge) VerifyMPCPubKey(mpcAddress, mpcPubkey string) error
- func (b *Bridge) VerifyMsgHash(rawTx interface{}, msgHashes []string) (err error)
- func (b *Bridge) VerifyTransaction(txHash string, args *tokens.VerifyArgs) (*tokens.SwapTxInfo, error)
- type RouterAccount
Constants ¶
This section is empty.
Variables ¶
var ( // RPCCall alias of tokens.RPCCall RPCCall = tokens.RPCCall )
Functions ¶
func PublicKeyToAddress ¶
Types ¶
type Bridge ¶
type Bridge struct { *tokens.CrossChainBridgeBase *base.ReSwapableBridgeBase }
Bridge solana bridge
func (*Bridge) BuildApplyMpcTransaction ¶
func (b *Bridge) BuildApplyMpcTransaction(routerContract, routerMPC, routerPDA, newMpcAddress string) (*types.Transaction, error)
func (*Bridge) BuildChangeMpcTransaction ¶
func (b *Bridge) BuildChangeMpcTransaction(routerContract, routerMPC, routerPDA, newMpcAddress string) (*types.Transaction, error)
func (*Bridge) BuildEnableSwapTransaction ¶
func (*Bridge) BuildMintSPLTransaction ¶
func (b *Bridge) BuildMintSPLTransaction(amount uint64, mintAddr, toAddr, minterAddr string) (*types.Transaction, error)
BuildMintSPLTransaction build mint spl token tx
func (*Bridge) BuildRawTransaction ¶
func (b *Bridge) BuildRawTransaction(args *tokens.BuildTxArgs) (rawTx interface{}, err error)
BuildRawTransaction impl
func (*Bridge) BuildSendSPLTransaction ¶
func (b *Bridge) BuildSendSPLTransaction(amount uint64, sourceAddr, destAddr, fromAddr string) (*types.Transaction, error)
BuildSendSPLTransaction build send spl token tx
func (*Bridge) BuildSendSolanaTransaction ¶
func (b *Bridge) BuildSendSolanaTransaction(lamports uint64, fromAddress, toAddress string) (*types.Transaction, error)
BuildSendSolanaTransaction build send solana tx
func (*Bridge) BuildSwapinMintTransaction ¶
func (b *Bridge) BuildSwapinMintTransaction(args *tokens.BuildTxArgs, tokenCfg *tokens.TokenConfig) (*types.Transaction, error)
BuildSwapinMintTransaction build swapin mint tx
func (*Bridge) BuildSwapinNativeTransaction ¶
func (b *Bridge) BuildSwapinNativeTransaction(args *tokens.BuildTxArgs, tokenCfg *tokens.TokenConfig) (*types.Transaction, error)
BuildSwapinNativeTransaction build swapin native tx
func (*Bridge) BuildSwapinTransferTransaction ¶
func (b *Bridge) BuildSwapinTransferTransaction(args *tokens.BuildTxArgs, tokenCfg *tokens.TokenConfig) (*types.Transaction, error)
BuildSwapinTransferTransaction build swapin transfer tx
func (*Bridge) GetAccountInfo ¶
func (b *Bridge) GetAccountInfo(account, encoding string) (result *types.GetAccountInfoResult, err error)
GetAccountInfo get account info
func (*Bridge) GetBalance ¶
GetBalance get balance
func (*Bridge) GetCurrentThreshold ¶
func (*Bridge) GetEpochInfo ¶
func (b *Bridge) GetEpochInfo() (*types.GetEpochInfoResult, error)
func (*Bridge) GetFeeForMessage ¶
GetFeeForMessage get fee for message This method is only available in solana-core v1.9 or newer. Please use getFees for solana-core v1.8
func (*Bridge) GetFees ¶
func (b *Bridge) GetFees() (result *types.GetFeesResult, err error)
GetFees get fees
func (*Bridge) GetLatestBlockNumber ¶
GetLatestBlockNumber call getSlot
func (*Bridge) GetLatestBlockNumberOf ¶
GetLatestBlockNumberOf call getSlot
func (*Bridge) GetLatestBlockhash ¶
func (b *Bridge) GetLatestBlockhash() (result *types.GetLatestBlockhashResult, err error)
GetLatestBlockhash get latest block hash This method is only available in solana-core v1.9 or newer. Please use getRecentBlockhash for solana-core v1.8
func (*Bridge) GetMPCAddress ¶
GetMPCAddress query
func (*Bridge) GetMinimumBalanceForRentExemption ¶
getMinimumBalanceForRentExemption
func (*Bridge) GetNonceAccountInfo ¶
func (b *Bridge) GetNonceAccountInfo(account string) (result *types.GetNonceAccountInfoResult, err error)
func (*Bridge) GetProgramAccounts ¶
func (b *Bridge) GetProgramAccounts(account, encoding string, filters []map[string]interface{}) (result types.GetProgramAccountsResult, err error)
GetProgramAccounts get program accounts
func (*Bridge) GetRecentBlockhash ¶
func (b *Bridge) GetRecentBlockhash() (result *types.GetRecentBlockhashResult, err error)
GetRecentBlockhash get recent block hash
func (*Bridge) GetRouterAccount ¶
func (b *Bridge) GetRouterAccount(programID string) (*RouterAccount, error)
GetRouterAccount query
func (*Bridge) GetSignatureStatuses ¶
func (b *Bridge) GetSignatureStatuses(sigs []string, searchTransactionHistory bool) (result *types.GetSignatureStatusesResult, err error)
GetSignatureStatuses get signature statuses
func (*Bridge) GetTokenBalance ¶
func (b *Bridge) GetTokenBalance(tokenAccount string) (result *types.GetTokenAmountResult, err error)
GetTokenBalance query
func (*Bridge) GetTokenDecimals ¶
GetTokenDecimals query
func (*Bridge) GetTokenSupply ¶
func (b *Bridge) GetTokenSupply(tokenMint string) (result *types.GetTokenAmountResult, err error)
GetTokenSupply query
func (*Bridge) GetTransaction ¶
GetTransaction impl
func (*Bridge) GetTransactionStatus ¶
GetTransactionStatus impl
func (*Bridge) GetTxBlockInfo ¶
GetTxBlockInfo impl NonceSetter interface
func (*Bridge) InitAfterConfig ¶
func (b *Bridge) InitAfterConfig()
####### NEW IMPLEMENT ###########################################
func (*Bridge) InitRouterInfo ¶
func (*Bridge) IsBlockhashValid ¶
IsBlockhashValid
func (*Bridge) IsValidAddress ¶
IsValidAddress impl check address
func (*Bridge) MPCSignTransaction ¶
func (b *Bridge) MPCSignTransaction(rawTx interface{}, args *tokens.BuildTxArgs) (signTx interface{}, txHash string, err error)
MPCSignTransaction impl
func (*Bridge) PublicKeyToAddress ¶
PublicKeyToAddress impl
func (*Bridge) RegisterSwap ¶
func (b *Bridge) RegisterSwap(txHash string, args *tokens.RegisterArgs) ([]*tokens.SwapTxInfo, []error)
RegisterSwap impl
func (*Bridge) SendSignedTransaction ¶
func (b *Bridge) SendSignedTransaction(tx *types.Transaction, opts *types.SendTransactionOptions) (txHash string, err error)
SendSignedTransaction call sendTransaction
func (*Bridge) SendTransaction ¶
SendTransaction impl
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) SimulateTransaction ¶
func (b *Bridge) SimulateTransaction(tx *types.Transaction) (result *types.SimulateTransactionResponse, err error)
SimulateTransaction simulate tx
func (*Bridge) VerifyMPCPubKey ¶
VerifyMPCPubKey verify mpc address and public key is matching
func (*Bridge) VerifyMsgHash ¶
VerifyMsgHash impl
func (*Bridge) VerifyTransaction ¶
func (b *Bridge) VerifyTransaction(txHash string, args *tokens.VerifyArgs) (*tokens.SwapTxInfo, error)
VerifyTransaction impl
type RouterAccount ¶
RouterAccount struct