Documentation
¶
Overview ¶
Package whatsonchain is the unofficial golang implementation for the whatsonchain.com API
Example:
``` // Create a client client := whatsonchain.NewClient(whatsonchain.NetworkMain, nil, nil)
// Get a balance for an address balance, _ := client.AddressBalance("16ZqP5Tb22KJuvSAbjNkoiZs13mmRmexZA") fmt.Println("confirmed balance", balance.Confirmed) ```
Index ¶
- Constants
- type AddressBalance
- type AddressHistory
- type AddressInfo
- type BlockInfo
- type BlockPagesInfo
- type BulkBroadcastResponse
- type ChainInfo
- type CirculatingSupply
- type Client
- func (c *Client) AddressBalance(address string) (balance *AddressBalance, err error)
- func (c *Client) AddressHistory(address string) (history AddressHistory, err error)
- func (c *Client) AddressInfo(address string) (addressInfo *AddressInfo, err error)
- func (c *Client) AddressUnspentTransactionDetails(address string, maxTransactions int) (history AddressHistory, err error)
- func (c *Client) AddressUnspentTransactions(address string) (history AddressHistory, err error)
- func (c *Client) BroadcastTx(txHex string) (txID string, err error)
- func (c *Client) BulkBroadcastTx(rawTxs []string, feedback bool) (response *BulkBroadcastResponse, err error)
- func (c *Client) BulkTransactionDetails(hashes *TxHashes) (txList TxList, err error)
- func (c *Client) DecodeTransaction(txHex string) (txInfo *TxInfo, err error)
- func (c *Client) DownloadReceipt(hash string) (string, error)
- func (c *Client) DownloadStatement(address string) (string, error)
- func (c *Client) GetBlockByHash(hash string) (blockInfo *BlockInfo, err error)
- func (c *Client) GetBlockByHeight(height int64) (blockInfo *BlockInfo, err error)
- func (c *Client) GetBlockPages(hash string, page int) (txList BlockPagesInfo, err error)
- func (c *Client) GetChainInfo() (chainInfo *ChainInfo, err error)
- func (c *Client) GetCirculatingSupply() (supply float64, err error)
- func (c *Client) GetExchangeRate() (rate *ExchangeRate, err error)
- func (c *Client) GetExplorerLinks(query string) (results SearchResults, err error)
- func (c *Client) GetFeeQuotes() (quotes *FeeQuotes, err error)
- func (c *Client) GetHeaderByHash(hash string) (headerInfo *BlockInfo, err error)
- func (c *Client) GetHeaders() (blockHeaders []*BlockInfo, err error)
- func (c *Client) GetHealth() (status string, err error)
- func (c *Client) GetMempoolInfo() (info *MempoolInfo, err error)
- func (c *Client) GetMempoolTransactions() (transactions []string, err error)
- func (c *Client) GetMerkleProof(hash string) (merkleResults MerkleResults, err error)
- func (c *Client) GetRawTransactionData(hash string) (string, error)
- func (c *Client) GetRawTransactionOutputData(hash string, vOutIndex int) (string, error)
- func (c *Client) GetScriptHistory(scriptHash string) (history ScriptList, err error)
- func (c *Client) GetScriptUnspentTransactions(scriptHash string) (scriptList ScriptList, err error)
- func (c *Client) GetTxByHash(hash string) (txInfo *TxInfo, err error)
- func (c *Client) SubmitTransaction(provider string, txHex string) (response *SubmissionResponse, err error)
- func (c *Client) TransactionStatus(provider string, txID string) (status *StatusResponse, err error)
- type CoinbaseTxInfo
- type ExchangeRate
- type Fee
- type FeeQuote
- type FeeQuotes
- type HistoryRecord
- type LastRequest
- type MempoolInfo
- type MerchantError
- type MerchantResponse
- type MerchantStatus
- type MerkleBranch
- type MerkleInfo
- type MerkleResults
- type NetworkType
- type Options
- type Page
- type Quote
- type QuoteProvider
- type ScriptList
- type ScriptPubKeyInfo
- type ScriptRecord
- type ScriptSigInfo
- type SearchResult
- type SearchResults
- type StatusResponse
- type SubmissionResponse
- type TxHashes
- type TxInfo
- type TxList
- type VinInfo
- type VoutInfo
Examples ¶
Constants ¶
const ( // NetworkMain is for main-net NetworkMain NetworkType = "main" // NetworkTest is for test-net NetworkTest NetworkType = "test" // NetworkStn is for the stn-net NetworkStn NetworkType = "stn" // MaxTransactionsUTXO is the max allowed in the request MaxTransactionsUTXO int = 20 // MaxBroadcastTransactions is the max transactions for Bulk Broadcast MaxBroadcastTransactions = 100 // MaxSingleTransactionSize is the max single TX size for Bulk Broadcast MaxSingleTransactionSize = 102400 // MaxCombinedTransactionSize is the max of all transactions combined MaxCombinedTransactionSize = 1e+7 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressBalance ¶
type AddressBalance struct { Confirmed int64 `json:"confirmed"` Unconfirmed int64 `json:"unconfirmed"` }
AddressBalance is the address balance (unconfirmed and confirmed)
type AddressHistory ¶
type AddressHistory []*HistoryRecord
AddressHistory is the history of transactions for an address
type AddressInfo ¶
type AddressInfo struct { Address string `json:"address"` IsMine bool `json:"ismine"` IsScript bool `json:"isscript"` IsValid bool `json:"isvalid"` IsWatchOnly bool `json:"iswatchonly"` ScriptPubKey string `json:"scriptPubKey"` }
AddressInfo is the address info for a returned address request
type BlockInfo ¶
type BlockInfo struct { Bits string `json:"bits"` ChainWork string `json:"chainwork"` CoinbaseTx CoinbaseTxInfo `json:"coinbaseTx"` Confirmations int64 `json:"confirmations"` Difficulty float64 `json:"difficulty"` Hash string `json:"hash"` Height int64 `json:"height"` MedianTime int64 `json:"mediantime"` MerkleRoot string `json:"merkleroot"` Miner string `json:"Bmgpool"` NextBlockHash string `json:"nextblockhash"` Nonce int64 `json:"nonce"` Pages Page `json:"pages"` PreviousBlockHash string `json:"previousblockhash"` Size int64 `json:"size"` Time int64 `json:"time"` TotalFees float64 `json:"totalFees"` Tx []string `json:"tx"` TxCount int64 `json:"txcount"` Version int64 `json:"version"` VersionHex string `json:"versionHex"` }
BlockInfo is the response info about a returned block
type BlockPagesInfo ¶
type BlockPagesInfo []string
BlockPagesInfo is the response from the page request
type BulkBroadcastResponse ¶ added in v0.0.5
type BulkBroadcastResponse struct { Feedback bool `json:"feedback"` StatusURL string `json:"statusUrl"` }
BulkBroadcastResponse is the response from a bulk broadcast request
type ChainInfo ¶
type ChainInfo struct { BestBlockHash string `json:"bestblockhash"` Blocks int64 `json:"blocks"` Chain string `json:"chain"` ChainWork string `json:"chainwork"` Difficulty float64 `json:"difficulty"` Headers int64 `json:"headers"` MedianTime int64 `json:"mediantime"` Pruned bool `json:"pruned"` VerificationProgress float64 `json:"verificationprogress"` }
ChainInfo is the structure response from getting info about the chain
type CirculatingSupply ¶ added in v0.2.4
type CirculatingSupply float64
CirculatingSupply is the structure response
type Client ¶
type Client struct { LastRequest *LastRequest // is the raw information from the last request Network NetworkType // is the BitcoinSV network to use UserAgent string // optional for changing user agents // contains filtered or unexported fields }
Client is the parent struct that wraps the heimdall client
func NewClient ¶
func NewClient(network NetworkType, clientOptions *Options, customHTTPClient *http.Client) *Client
NewClient creates a new client for WOC requests
Example ¶
ExampleNewClient example using NewClient()
client := NewClient(NetworkTest, nil, nil) fmt.Println(client.UserAgent)
Output: go-whatsonchain: v0.6.1
func (*Client) AddressBalance ¶
func (c *Client) AddressBalance(address string) (balance *AddressBalance, err error)
AddressBalance this endpoint retrieves confirmed and unconfirmed address balance.
For more information: https://developers.whatsonchain.com/#get-balance
func (*Client) AddressHistory ¶
func (c *Client) AddressHistory(address string) (history AddressHistory, err error)
AddressHistory this endpoint retrieves confirmed and unconfirmed address transactions.
For more information: https://developers.whatsonchain.com/#get-history
func (*Client) AddressInfo ¶
func (c *Client) AddressInfo(address string) (addressInfo *AddressInfo, err error)
AddressInfo this endpoint retrieves various address info.
For more information: https://developers.whatsonchain.com/#address
func (*Client) AddressUnspentTransactionDetails ¶ added in v0.2.3
func (c *Client) AddressUnspentTransactionDetails(address string, maxTransactions int) (history AddressHistory, err error)
AddressUnspentTransactionDetails this endpoint retrieves transaction details for a given address Use max transactions to filter if there are more UTXOs returned than needed by the user
For more information: (custom request for this go package)
func (*Client) AddressUnspentTransactions ¶
func (c *Client) AddressUnspentTransactions(address string) (history AddressHistory, err error)
AddressUnspentTransactions this endpoint retrieves ordered list of UTXOs.
For more information: https://developers.whatsonchain.com/#get-unspent-transactions
func (*Client) BroadcastTx ¶
BroadcastTx will broadcast transaction using this endpoint. Get tx_id in response or error msg from node.
For more information: https://developers.whatsonchain.com/#broadcast-transaction
func (*Client) BulkBroadcastTx ¶ added in v0.0.5
func (c *Client) BulkBroadcastTx(rawTxs []string, feedback bool) (response *BulkBroadcastResponse, err error)
BulkBroadcastTx will broadcast many transactions at once You can bulk broadcast transactions using this endpoint.
Size per transaction should be less than 100KB Overall payload per request should be less than 10MB Max 100 transactions per request Only available for mainnet
Tip: First transaction in the list should have an output to WOC tip address '16ZqP5Tb22KJuvSAbjNkoiZs13mmRmexZA'
Feedback: true/false: true if response from the node is required for each transaction, otherwise, set it to false. (For stress testing set it to false). When set to true a unique url is provided to check the progress of the submitted transactions, eg 'QUEUED' or 'PROCESSED', with response data from node. You can poll the provided unique url until all transactions are marked as 'PROCESSED'. Progress of the transactions are tracked on this unique url for up to 5 hours.
For more information: https://developers.whatsonchain.com/#bulk-broadcast
func (*Client) BulkTransactionDetails ¶ added in v0.4.0
BulkTransactionDetails this fetches details for multiple transactions in single request Max 20 transactions per request
For more information: https://developers.whatsonchain.com/#bulk-transaction-details
func (*Client) DecodeTransaction ¶ added in v0.4.0
DecodeTransaction this endpoint decodes raw transaction
For more information: https://developers.whatsonchain.com/#decode-transaction
func (*Client) DownloadReceipt ¶ added in v0.4.0
DownloadReceipt this endpoint downloads a transaction receipt (PDF) The contents will be returned in plain-text and need to be converted to a file.pdf
For more information: https://developers.whatsonchain.com/#download-receipt
func (*Client) DownloadStatement ¶ added in v0.4.0
DownloadStatement this endpoint downloads an address statement (PDF) The contents will be returned in plain-text and need to be converted to a file.pdf
For more information: https://developers.whatsonchain.com/#download-statement
func (*Client) GetBlockByHash ¶
GetBlockByHash this endpoint retrieves block details with given hash.
For more information: https://developers.whatsonchain.com/#get-by-hash
func (*Client) GetBlockByHeight ¶
GetBlockByHeight this endpoint retrieves block details with given block height.
For more information: https://developers.whatsonchain.com/#get-by-height
func (*Client) GetBlockPages ¶
func (c *Client) GetBlockPages(hash string, page int) (txList BlockPagesInfo, err error)
GetBlockPages If the block has more that 1000 transactions the page URIs will be provided in the pages element when getting a block by hash or height.
For more information: https://developers.whatsonchain.com/#get-block-pages
func (*Client) GetChainInfo ¶
GetChainInfo this endpoint retrieves various state info of the chain for the selected network.
For more information: https://developers.whatsonchain.com/#chain-info
func (*Client) GetCirculatingSupply ¶ added in v0.2.4
GetCirculatingSupply this endpoint retrieves the current circulating supply
For more information: (undocumented) //todo: add link once in documentation
func (*Client) GetExchangeRate ¶ added in v0.4.0
func (c *Client) GetExchangeRate() (rate *ExchangeRate, err error)
GetExchangeRate this endpoint provides exchange rate for BSV
For more information: https://developers.whatsonchain.com/#get-exchange-rate
func (*Client) GetExplorerLinks ¶ added in v0.4.0
func (c *Client) GetExplorerLinks(query string) (results SearchResults, err error)
GetExplorerLinks this endpoint identifies whether the posted query text is a block hash, txid or address and responds with WoC links. Ideal for extending customized search in apps.
For more information: https://developers.whatsonchain.com/#get-history
func (*Client) GetFeeQuotes ¶ added in v0.5.0
GetFeeQuotes this endpoint provides fee quotes from multiple transaction processors. Each quote also contains transaction processor specific txSubmissionUrl and txStatusUrl. These unique URLs can be used to submit transactions to the selected transaction processor and check the status of the submitted transaction. Any post request to txSubmissionUrl is forwarded to the selected transaction processor ‘AS IS’ and is ‘NOT’ broadcast from any WoC nodes.
For more information: https://developers.whatsonchain.com/#fee-quotes
func (*Client) GetHeaderByHash ¶ added in v0.6.1
GetHeaderByHash this endpoint retrieves block header details with given hash.
For more information: https://developers.whatsonchain.com/#get-header-by-hash
func (*Client) GetHeaders ¶ added in v0.6.1
GetHeaders this endpoint retrieves last 10 block headers.
For more information: https://developers.whatsonchain.com/#get-headers
func (*Client) GetHealth ¶
GetHealth simple endpoint to show API server is up and running
For more information: https://developers.whatsonchain.com/#health
func (*Client) GetMempoolInfo ¶ added in v0.4.0
func (c *Client) GetMempoolInfo() (info *MempoolInfo, err error)
GetMempoolInfo this endpoint retrieves various info about the node's mempool for the selected network
For more information: https://developers.whatsonchain.com/#get-mempool-info
func (*Client) GetMempoolTransactions ¶ added in v0.4.0
GetMempoolTransactions this endpoint endpoint retrieve list of transaction ids from the node's mempool for the selected network
For more information: https://developers.whatsonchain.com/#get-mempool-transactions
func (*Client) GetMerkleProof ¶ added in v0.0.4
func (c *Client) GetMerkleProof(hash string) (merkleResults MerkleResults, err error)
GetMerkleProof this endpoint returns merkle branch to a confirmed transaction
For more information: https://developers.whatsonchain.com/#get-merkle-proof
func (*Client) GetRawTransactionData ¶ added in v0.3.0
GetRawTransactionData this endpoint returns raw hex for the transaction with given hash
For more information: https://developers.whatsonchain.com/#get-raw-transaction-data
func (*Client) GetRawTransactionOutputData ¶ added in v0.3.0
GetRawTransactionOutputData this endpoint returns raw hex for the transaction output with given hash and index
For more information: https://developers.whatsonchain.com/#get-raw-transaction-output-data
func (*Client) GetScriptHistory ¶ added in v0.4.0
func (c *Client) GetScriptHistory(scriptHash string) (history ScriptList, err error)
GetScriptHistory this endpoint retrieves confirmed and unconfirmed script transactions
For more information: https://developers.whatsonchain.com/#get-script-history
func (*Client) GetScriptUnspentTransactions ¶ added in v0.4.0
func (c *Client) GetScriptUnspentTransactions(scriptHash string) (scriptList ScriptList, err error)
GetScriptUnspentTransactions this endpoint retrieves ordered list of UTXOs
For more information: https://developers.whatsonchain.com/#get-script-unspent-transactions
func (*Client) GetTxByHash ¶
GetTxByHash this endpoint retrieves transaction details with given transaction hash
For more information: https://developers.whatsonchain.com/#get-by-tx-hash
func (*Client) SubmitTransaction ¶ added in v0.5.0
func (c *Client) SubmitTransaction(provider string, txHex string) (response *SubmissionResponse, err error)
SubmitTransaction this endpoint submits a transaction to a specific transaction processor using the txSubmissionUrl provided with each quote in the Fee quotes response.
For more information: https://developers.whatsonchain.com/#submit-transaction
func (*Client) TransactionStatus ¶ added in v0.5.0
func (c *Client) TransactionStatus(provider string, txID string) (status *StatusResponse, err error)
TransactionStatus gets a transaction's status from a specific transaction processor using the txStatusUrl provided with each quote in Fee quotes response.
For more information: https://developers.whatsonchain.com/#transaction-status
type CoinbaseTxInfo ¶
type CoinbaseTxInfo struct { BlockHash string `json:"blockhash"` BlockTime int64 `json:"blocktime"` Confirmations int64 `json:"confirmations"` Hash string `json:"hash"` Hex string `json:"hex"` LockTime int64 `json:"locktime"` Size int64 `json:"size"` Time int64 `json:"time"` TxID string `json:"txid"` Version int64 `json:"version"` Vin []VinInfo `json:"vin"` Vout []VoutInfo `json:"vout"` }
CoinbaseTxInfo is the coinbase tx info inside the BlockInfo
type ExchangeRate ¶ added in v0.4.0
ExchangeRate is the response from getting the current exchange rate
type FeeQuote ¶ added in v0.5.0
type FeeQuote struct { FeeType string `json:"feeType"` MiningFee *Fee `json:"miningFee"` RelayFee *Fee `json:"relayFee"` }
FeeQuote is the structure response for a fee in a quote
type FeeQuotes ¶ added in v0.5.0
type FeeQuotes struct {
Quotes []*QuoteProvider `json:"quotes"`
}
FeeQuotes is the structure response from getting quotes from Merchant API
type HistoryRecord ¶
type HistoryRecord struct { Height int64 `json:"height"` Info *TxInfo `json:"info,omitempty"` // Custom for our wrapper TxHash string `json:"tx_hash"` TxPos int64 `json:"tx_pos"` Value int64 `json:"value"` }
HistoryRecord is an internal record of AddressHistory
type LastRequest ¶
type LastRequest struct { Method string `json:"method"` // method is the HTTP method used PostData string `json:"post_data"` // postData is the post data submitted if POST/PUT request StatusCode int `json:"status_code"` // statusCode is the last code from the request URL string `json:"url"` // url is the url used for the request }
LastRequest is used to track what was submitted via the request()
type MempoolInfo ¶ added in v0.4.0
type MempoolInfo struct { Bytes int64 `json:"bytes"` MaxMempool int64 `json:"maxmempool"` MempoolMinFee int64 `json:"mempoolminfee"` Size int64 `json:"size"` Usage int64 `json:"usage"` }
MempoolInfo is the response for the get mempool info request
type MerchantError ¶ added in v0.5.0
type MerchantError struct { Code int `json:"code"` Error string `json:"error"` Status int `json:"status"` }
MerchantError is the error response from a bad tx submission
type MerchantResponse ¶ added in v0.5.0
type MerchantResponse struct { APIVersion string `json:"apiVersion"` CurrentHighestBlockHash string `json:"currentHighestBlockHash"` CurrentHighestBlockHeight int64 `json:"currentHighestBlockHeight"` MinerID string `json:"minerId"` ResultDescription string `json:"resultDescription"` ReturnResult string `json:"returnResult"` Timestamp string `json:"timestamp"` TxID string `json:"txid"` TxSecondMempoolExpiry int `json:"txSecondMempoolExpiry"` }
MerchantResponse is the response from a tx submission
type MerchantStatus ¶ added in v0.5.0
type MerchantStatus struct { APIVersion string `json:"apiVersion"` BlockHash string `json:"blockHash"` BlockHeight int64 `json:"blockHeight"` Confirmations int64 `json:"confirmations"` MinerID string `json:"minerId"` ResultDescription string `json:"resultDescription"` ReturnResult string `json:"returnResult"` Timestamp string `json:"timestamp"` TxSecondMempoolExpiry int `json:"txSecondMempoolExpiry"` }
MerchantStatus is the response from a status request
type MerkleBranch ¶ added in v0.3.0
MerkleBranch is a merkle branch
type MerkleInfo ¶ added in v0.0.4
type MerkleInfo struct { BlockHash string `json:"blockHash"` Branches []*MerkleBranch `json:"branches"` Hash string `json:"hash"` MerkleRoot string `json:"merkleRoot"` }
MerkleInfo is the response for the get merkle request
type MerkleResults ¶ added in v0.3.0
type MerkleResults []*MerkleInfo
MerkleResults is the results from the proof request
type NetworkType ¶
type NetworkType string
NetworkType is used internally to represent the possible values for network in queries to be submitted: {"main", "test", "stn"}
type Options ¶ added in v0.2.0
type Options struct { BackOffExponentFactor float64 `json:"back_off_exponent_factor"` BackOffInitialTimeout time.Duration `json:"back_off_initial_timeout"` BackOffMaximumJitterInterval time.Duration `json:"back_off_maximum_jitter_interval"` BackOffMaxTimeout time.Duration `json:"back_off_max_timeout"` DialerKeepAlive time.Duration `json:"dialer_keep_alive"` DialerTimeout time.Duration `json:"dialer_timeout"` RequestRetryCount int `json:"request_retry_count"` RequestTimeout time.Duration `json:"request_timeout"` TransportExpectContinueTimeout time.Duration `json:"transport_expect_continue_timeout"` TransportIdleTimeout time.Duration `json:"transport_idle_timeout"` TransportMaxIdleConnections int `json:"transport_max_idle_connections"` TransportTLSHandshakeTimeout time.Duration `json:"transport_tls_handshake_timeout"` UserAgent string `json:"user_agent"` }
Options holds all the configuration for connection, dialer and transport
func ClientDefaultOptions ¶ added in v0.2.0
func ClientDefaultOptions() (clientOptions *Options)
ClientDefaultOptions will return an Options struct with the default settings Useful for starting with the default and then modifying as needed
type Quote ¶ added in v0.5.0
type Quote struct { APIVersion string `json:"apiVersion"` CurrentHighestBlockHash string `json:"currentHighestBlockHash"` CurrentHighestBlockHeight int64 `json:"currentHighestBlockHeight"` ExpiryTime string `json:"expiryTime"` Fees []*FeeQuote `json:"fees"` MinerID string `json:"minerId"` MinerReputation interface{} `json:"minerReputation"` Timestamp string `json:"timestamp"` }
Quote is the structure response for a quote
type QuoteProvider ¶ added in v0.5.0
type QuoteProvider struct { Payload string `json:"payload"` ProviderID string `json:"providerId"` ProviderName string `json:"providerName"` PublicKey string `json:"publicKey"` Quote *Quote `json:"quote"` Signature string `json:"signature"` TxStatusURL string `json:"txStatusUrl"` TxSubmissionURL string `json:"txSubmissionUrl"` }
QuoteProvider is the structure response for a quote provider (which has quotes)
type ScriptList ¶ added in v0.4.0
type ScriptList []*ScriptRecord
ScriptList is the list of script history records
type ScriptPubKeyInfo ¶
type ScriptPubKeyInfo struct { Addresses []string `json:"addresses"` Asm string `json:"asm"` Hex string `json:"hex"` IsTruncated bool `json:"isTruncated"` OpReturn string `json:"-"` // todo: support this (can be an object of key/vals based on the op return data) ReqSigs int64 `json:"reqSigs"` Type string `json:"type"` }
ScriptPubKeyInfo is the scriptPubKey info inside the VoutInfo
type ScriptRecord ¶ added in v0.4.0
type ScriptRecord struct { Height int64 `json:"height"` TxHash string `json:"tx_hash"` TxPos int64 `json:"tx_pos"` Value int64 `json:"value"` }
ScriptRecord is the script history record
type ScriptSigInfo ¶
ScriptSigInfo is the scriptSig info inside the VinInfo
type SearchResult ¶ added in v0.4.0
SearchResult is the actual result for the search (included in SearchResults)
type SearchResults ¶ added in v0.4.0
type SearchResults struct {
Results []*SearchResult `json:"results"`
}
SearchResults is the response from searching for explorer links
type StatusResponse ¶ added in v0.5.0
type StatusResponse struct { Payload string `json:"payload"` ProviderID string `json:"providerId"` ProviderName string `json:"providerName"` PublicKey string `json:"publicKey"` Signature string `json:"signature"` Status *MerchantStatus `json:"status"` }
StatusResponse is the response from requesting a status update
type SubmissionResponse ¶ added in v0.5.0
type SubmissionResponse struct { Error *MerchantError `json:"error"` Payload string `json:"payload"` ProviderID string `json:"providerId"` ProviderName string `json:"providerName"` PublicKey string `json:"publicKey"` Response *MerchantResponse `json:"response"` Signature string `json:"signature"` }
SubmissionResponse is the response from submitting a tx via Merchant API
type TxHashes ¶ added in v0.2.2
type TxHashes struct {
TxIDs []string `json:"txids"`
}
TxHashes is the list of tx hashes for the post request
type TxInfo ¶
type TxInfo struct { BlockHash string `json:"blockhash"` BlockTime int64 `json:"blocktime"` Confirmations int64 `json:"confirmations"` Hash string `json:"hash"` Hex string `json:"hex"` LockTime int64 `json:"locktime"` Size int64 `json:"size"` Time int64 `json:"time"` TxID string `json:"txid"` Version int64 `json:"version"` Vin []VinInfo `json:"vin"` Vout []VoutInfo `json:"vout"` }
TxInfo is the response info about a returned tx
type TxList ¶ added in v0.2.2
type TxList []*TxInfo
TxList is the list of tx info structs returned from the /txs post response
type VinInfo ¶
type VinInfo struct { Coinbase string `json:"coinbase"` ScriptSig ScriptSigInfo `json:"scriptSig"` Sequence int64 `json:"sequence"` TxID string `json:"txid"` Vout int64 `json:"vout"` }
VinInfo is the vin info inside the CoinbaseTxInfo
type VoutInfo ¶
type VoutInfo struct { N int64 `json:"n"` ScriptPubKey ScriptPubKeyInfo `json:"scriptPubKey"` Value float64 `json:"value"` }
VoutInfo is the vout info inside the CoinbaseTxInfo