Versions in this module Expand all Collapse all v0 v0.0.1 Nov 16, 2024 Changes in this version + const ChainName + const HealthBehind + const HealthOk + const HealthUnknown + const MaxBlockRange + func AddressFromPubKey(publicKey solana.PublicKey) string + func GenerateNewKeypair() (*solana.PrivateKey, solana.PublicKey) + func GetSuggestedPriorityFee(fees []PrioritizationFee) uint64 + func NewChainAdaptor(conf *config.Config) (chain.IChainAdaptor, error) + func PrivateKeyFromBase58(privateKeyBase58 string) (*solana.PrivateKey, error) + func PrivateKeyFromByteList(privateKeyByteList []byte) (*solana.PrivateKey, error) + func PrivateKeyFromHex(privateKeyHex string) (*solana.PrivateKey, error) + func PrivateKeyHexToPrivateKey(privateKeyHex string) (*ed25519.PrivateKey, error) + func PrivateKeyHexToPubKey(privateKeyHex string) (*ed25519.PublicKey, error) + func PrivateKeyToBase58(privateKey *solana.PrivateKey) string + func PrivateKeyToPubKey(privateKey *ed25519.PrivateKey) (*ed25519.PublicKey, error) + func PubKeyHexToAddress(publicKeyHex string) (string, error) + func PubKeyHexToPubKey(publicKeyHex string) (*ed25519.PublicKey, error) + func PubKeyToAddress(publicKey *ed25519.PublicKey) (string, error) + func PubKeyToPubKeyHex(publicKey *ed25519.PublicKey) (string, error) + func PublicKeyFromBase58(publicKeyBase58 string) (solana.PublicKey, error) + func PublicKeyFromPrivateKey(privateKey *solana.PrivateKey) solana.PublicKey + func PublicKeyToBase58(publicKey solana.PublicKey) string + type AccountInfo struct + Data []string + Executable bool + Lamports uint64 + Owner string + RentEpoch uint64 + Space uint64 + type AccountsInfo struct + Addresses []string + Encoding string + type BlockHeightResponse struct + Error *RPCError + ID int + JsonRPC string + Result uint64 + type BlockResult struct + BlockHash string + BlockHeight uint64 + BlockTime int64 + ParentSlot uint64 + PreviousBlockhash string + Signatures []string + Transactions []TransactionDetail + type ChainAdaptor struct + func (c *ChainAdaptor) ConvertAddress(req *account.ConvertAddressRequest) (*account.ConvertAddressResponse, error) + func (c *ChainAdaptor) CreateUnSignTransaction(req *account.UnSignTransactionRequest) (*account.UnSignTransactionResponse, error) + func (c *ChainAdaptor) DecodeTransaction(req *account.DecodeTransactionRequest) (*account.DecodeTransactionResponse, error) + func (c *ChainAdaptor) GetAccount(req *account.AccountRequest) (*account.AccountResponse, error) + func (c *ChainAdaptor) GetBlockByHash(req *account.BlockHashRequest) (*account.BlockResponse, error) + func (c *ChainAdaptor) GetBlockByNumber(req *account.BlockNumberRequest) (*account.BlockResponse, error) + func (c *ChainAdaptor) GetBlockByRange(req *account.BlockByRangeRequest) (*account.BlockByRangeResponse, error) + func (c *ChainAdaptor) GetBlockHeaderByHash(req *account.BlockHeaderHashRequest) (*account.BlockHeaderResponse, error) + func (c *ChainAdaptor) GetBlockHeaderByNumber(req *account.BlockHeaderNumberRequest) (*account.BlockHeaderResponse, error) + func (c *ChainAdaptor) GetExtraData(req *account.ExtraDataRequest) (*account.ExtraDataResponse, error) + func (c *ChainAdaptor) GetFee(req *account.FeeRequest) (*account.FeeResponse, error) + func (c *ChainAdaptor) GetSupportChains(req *account.SupportChainsRequest) (*account.SupportChainsResponse, error) + func (c *ChainAdaptor) GetTxByAddress(req *account.TxAddressRequest) (*account.TxAddressResponse, error) + func (c *ChainAdaptor) GetTxByHash(req *account.TxHashRequest) (*account.TxHashResponse, error) + func (c *ChainAdaptor) SendTx(req *account.SendTxRequest) (*account.SendTxResponse, error) + func (c *ChainAdaptor) ValidAddress(req *account.ValidAddressRequest) (*account.ValidAddressResponse, error) + func (c *ChainAdaptor) VerifySignedTransaction(req *account.VerifyTransactionRequest) (*account.VerifyTransactionResponse, error) + func (c ChainAdaptor) BuildSignedTransaction(req *account.SignedTransactionRequest) (*account.SignedTransactionResponse, error) + type CommitmentType string + const Confirmed + const Finalized + const Processed + type CreateNonceAccountRequest struct + Authority solana.PublicKey + Payer solana.PrivateKey + type CreateNonceAccountResponse struct + Nonce string + NonceAccount solana.PublicKey + Signature string + type GetAccountInfoResponse struct + Error *RPCError + ID int + JsonRPC string + Result struct{ ... } + type GetBalanceResponse struct + Error *RPCError + ID int + JsonRPC string + Result struct{ ... } + type GetBlockRequest struct + Commitment CommitmentType + Encoding string + MaxSupportedTransactionVersion int + Rewards bool + TransactionDetails string + type GetBlockResponse struct + Error *RPCError + ID int + JsonRPC string + Result BlockResult + type GetBlocksWithLimitResponse struct + Error *RPCError + ID int + JsonRPC string + Result []uint64 + type GetFeeForMessageRequest struct + Commitment string + MinContextSlot uint64 + type GetFeeForMessageResponse struct + Error *RPCError + ID int + Jsonrpc string + Result struct{ ... } + type GetHealthResponse struct + Error *RPCError + ID int + Jsonrpc string + Result string + type GetLatestBlockhashResponse struct + Error *RPCError + ID int + JsonRPC string + Result struct{ ... } + type GetSignaturesRequest struct + Before string + Commitment string + Limit uint64 + MinContextSlot uint64 + Until string + type GetSignaturesResponse struct + Error *RPCError + ID int + Jsonrpc string + Result []SignatureInfo + type GetSlotRequest struct + Commitment CommitmentType + type GetSlotResponse struct + Error *RPCError + ID int + JsonRPC string + Result uint64 + type GetTransactionResponse struct + Error *RPCError + ID int + Jsonrpc string + Result TransactionResult + type Instruction struct + Accounts []int + Data string + ProgramIdIndex int + StackHeight interface{} + type LoadedAddresses struct + Readonly []string + Writable []string + type PrioritizationFee struct + PrioritizationFee uint64 + Slot uint64 + type RPCError struct + Code int + Message string + type SendTransactionRequest struct + Commitment string + Encoding string + MaxRetries uint64 + MinContextSlot uint64 + PreflightCommitment string + SkipPreflight bool + type SendTransactionResponse struct + Error *RPCError + ID int + Jsonrpc string + Result string + type SignatureInfo struct + BlockTime *int64 + ConfirmationStatus *string + Error interface{} + Memo *string + Signature string + Slot uint64 + type SimulateRequest struct + Accounts *AccountsInfo + Commitment string + Encoding string + MinContextSlot uint64 + ReplaceRecentBlockhash bool + SigVerify bool + type SimulateResult struct + Accounts []struct{ ... } + Err interface{} + InnerInstructions []struct{ ... } + Logs []string + ReturnData ... + UnitsConsumed uint64 + type SimulateTransactionResponse struct + Error *RPCError + ID int + Jsonrpc string + Result SimulateResult + type SolClient interface + GetAccountInfo func(inputAddr string) (*AccountInfo, error) + GetBalance func(inputAddr string) (uint64, error) + GetBlockBySlot func(slot uint64, detailType TransactionDetailsType) (*BlockResult, error) + GetBlocksWithLimit func(startSlot uint64, limit uint64) ([]uint64, error) + GetFeeForMessage func(message string) (uint64, error) + GetHealth func() (string, error) + GetLatestBlockhash func(commitmentType CommitmentType) (string, error) + GetRecentPrioritizationFees func() ([]PrioritizationFee, error) + GetSlot func(commitment CommitmentType) (uint64, error) + GetTransaction func(signature string) (*TransactionResult, error) + GetTransactionRange func(signatures []string) ([]*TransactionResult, error) + GetTxForAddress func(address string, commitment CommitmentType, limit uint64, ...) ([]SignatureInfo, error) + SendTransaction func(signedTx string, config *SendTransactionRequest) (string, error) + SimulateTransaction func(signedTx string, config *SimulateRequest) (*SimulateResult, error) + func NewSolHttpClient(baseUrl string) (SolClient, error) + func NewSolHttpClientAll(baseUrl string, withDebug bool) (SolClient, error) + type SolData struct + SolDataCli *solscan.ChainExplorerAdaptor + func NewSolScanClient(baseUrl, apiKey string, timeout time.Duration) (*SolData, error) + func (ss *SolData) GetTxByAddress(page, pagesize uint64, address string, action account.ActionType) (*account.TransactionResponse[account.AccountTxResponse], error) + type Status struct + Ok interface{} + type Transaction struct + Message TransactionMessage + Signatures []string + type TransactionDetail struct + BlockTime int64 + Message interface{} + Meta *TransactionMeta + RecentBlockhash string + Signature string + Slot uint64 + Version any + type TransactionDetailsType string + const Accounts + const Full + const None + const Signatures + type TransactionHeader struct + NumReadonlySignedAccounts int + NumReadonlyUnsignedAccounts int + NumRequiredSignatures int + type TransactionMessage struct + AccountKeys []string + AddressTableLookups []interface{} + Header TransactionHeader + Instructions []Instruction + RecentBlockhash string + type TransactionMeta struct + ComputeUnitsConsumed uint64 + Err interface{} + Fee uint64 + InnerInstructions []interface{} + LoadedAddresses LoadedAddresses + LogMessages []string + PostBalances []uint64 + PostTokenBalances []interface{} + PreBalances []uint64 + PreTokenBalances []interface{} + Rewards interface{} + Status struct{ ... } + type TransactionResult struct + BlockTime *int64 + Meta TransactionMeta + Slot uint64 + Transaction Transaction + Version any + type TransactionVersion struct + type TxStructure struct + ContractAddress string + FromAddress string + FromPrivateKey string + Gas uint64 + GasFeeCap string + GasPrice string + GasTipCap string + Nonce string + ToAddress string + TokenId string + Value string