Documentation ¶
Index ¶
- Variables
- type APICardanoClient
- type APIClientOptions
- type APIError
- type APISolanaClient
- type AddrSumary
- type BlochainNet
- type CABalance
- type CAChainTip
- type CATxList
- type CtbPut
- type Header
- type HttpRequestDoer
- type Instruction
- type LastTxByAddr
- type Message
- type Meta
- type PayloadReqJSONRPC
- type ResultTxByAddressSOL
- type ResultTxInfo
- type Right
- type Status
- type Transaction
- type TxInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CardanoTestNet = BlochainNet{ NameNet: "CardanoTestNet", ApiURL: "https://explorer-api.testnet.dandelion.link", ExplorerURL: "https://explorer.cardano-testnet.iohkdev.io/en/transaction?id=%s", } SolanaDevNet = BlochainNet{ NameNet: "SolanaDevNet", ApiURL: "https://api.devnet.solana.com", ExplorerURL: "https://explorer.solana.com/tx/%s?cluster=devnet", } )
Functions ¶
This section is empty.
Types ¶
type APICardanoClient ¶
type APICardanoClient interface { // InfoByAddress ... InfoByAddress(ctx context.Context, address string) (AddrSumary, error) }
func NewAPICardanoClient ¶
func NewAPICardanoClient(options APIClientOptions) (APICardanoClient, error)
NewAPICardanoClient ...
type APIClientOptions ¶
type APIClientOptions struct { // Server url to use Server string // Max number of routines to use for *All methods MaxRoutines int RetryWaitMin time.Duration // Minimum time to wait RetryWaitMax time.Duration // Maximum time to wait RetryMax int // Maximum number of retries }
APIClientOptions ...
type APIError ¶
type APIError struct {
Response interface{}
}
APIError is used to describe errors from the API.
type APISolanaClient ¶
type APISolanaClient interface { // LastTxByAddress ... LastTxByAddress(ctx context.Context, payload PayloadReqJSONRPC) (LastTxByAddr, error) // InfoByTx ... InfoByTx(ctx context.Context, payload PayloadReqJSONRPC) (TxInfo, error) }
func NewAPISolanaClient ¶
func NewAPISolanaClient(options APIClientOptions) (APISolanaClient, error)
NewAPISolanaClient ...
type AddrSumary ¶
type AddrSumary struct {
Result Right `json:"Right"`
}
type BlochainNet ¶
type CAChainTip ¶
type HttpRequestDoer ¶
type Instruction ¶
type LastTxByAddr ¶
type LastTxByAddr struct { Jsonrpc string `json:"jsonrpc"` Result []ResultTxByAddressSOL `json:"result"` ID int64 `json:"id"` }
type Message ¶
type Message struct { AccountKeys []string `json:"accountKeys"` Header Header `json:"header"` Instructions []Instruction `json:"instructions"` RecentBlockhash string `json:"recentBlockhash"` }
type Meta ¶
type Meta struct { Err interface{} `json:"err"` Fee int64 `json:"fee"` InnerInstructions []interface{} `json:"innerInstructions"` LogMessages []string `json:"logMessages"` PostBalances []int64 `json:"postBalances"` PostTokenBalances []interface{} `json:"postTokenBalances"` PreBalances []int64 `json:"preBalances"` PreTokenBalances []interface{} `json:"preTokenBalances"` Rewards []interface{} `json:"rewards"` Status Status `json:"status"` }
type PayloadReqJSONRPC ¶
type PayloadReqJSONRPC struct { Jsonrpc string `json:"jsonrpc"` Method string `json:"method"` Params []interface{} `json:"params"` ID int64 `json:"id"` }
func (*PayloadReqJSONRPC) ToReader ¶
func (p *PayloadReqJSONRPC) ToReader() *strings.Reader
type ResultTxByAddressSOL ¶
type ResultTxByAddressSOL struct { BlockTime int64 `json:"blockTime"` ConfirmationStatus string `json:"confirmationStatus"` Err interface{} `json:"err"` Memo interface{} `json:"memo"` Signature string `json:"signature"` Slot int64 `json:"slot"` }
func (*ResultTxByAddressSOL) ToJSON ¶
func (r *ResultTxByAddressSOL) ToJSON() string
type ResultTxInfo ¶
type ResultTxInfo struct { BlockTime int64 `json:"blockTime"` Meta Meta `json:"meta"` Slot int64 `json:"slot"` Transaction Transaction `json:"transaction"` }
type Right ¶
type Right struct { CAAddress string `json:"caAddress"` CAType string `json:"caType"` CAChainTip CAChainTip `json:"caChainTip"` CATxNum int64 `json:"caTxNum"` CABalance CABalance `json:"caBalance"` CATotalInput CABalance `json:"caTotalInput"` CATotalOutput CABalance `json:"caTotalOutput"` CATotalFee CABalance `json:"caTotalFee"` CATxList []CATxList `json:"caTxList"` }
type Transaction ¶
Click to show internal directories.
Click to hide internal directories.