Documentation ¶
Overview ¶
Package gobcy implements a wrapper for the http://www.blockcypher.com API. You can use it to interact with addresses, transactions, and blocks from various blockchains, including Bitcoin's main and test3 chains, and the BlockCypher test chain.
Please note: we assume you use are using a 64-bit architecture for deployment, which automatically makes `int` types 64-bit. Without 64-bit ints, some values might overflow on certain calls, depending on the blockchain you are querying. If you are using a 32-bit system, you can change all `int` types to `int64` to explicitly work around this issue.
Index ¶
- type API
- func (api *API) AddAddrWallet(name string, addrs []string, omitAddr bool) (wal Wallet, err error)
- func (api *API) CheckUsage() (usage TokenUsage, err error)
- func (api *API) CreateHDWallet(req HDWallet) (wal HDWallet, err error)
- func (api *API) CreateHook(hook Hook) (result Hook, err error)
- func (api *API) CreatePayFwd(payment PayFwd) (result PayFwd, err error)
- func (api *API) CreateWallet(req Wallet) (wal Wallet, err error)
- func (api *API) DecodeTX(hex string) (trans TX, err error)
- func (api *API) DeleteAddrWallet(name string, addrs []string) (err error)
- func (api *API) DeleteHDWallet(name string) (err error)
- func (api *API) DeleteHook(id string) (err error)
- func (api *API) DeleteMeta(hash string, kind string) (err error)
- func (api *API) DeletePayFwd(id string) (err error)
- func (api *API) DeleteWallet(name string) (err error)
- func (api *API) DeriveAddrHDWallet(name string, params map[string]string) (wal HDWallet, err error)
- func (api *API) Faucet(a AddrKeychain, amount int) (txhash string, err error)
- func (api *API) GenAddrKeychain() (pair AddrKeychain, err error)
- func (api *API) GenAddrMultisig(multi AddrKeychain) (addr AddrKeychain, err error)
- func (api *API) GenAddrWallet(name string) (wal Wallet, addr AddrKeychain, err error)
- func (api *API) GenAssetKeychain() (pair AddrKeychain, err error)
- func (api *API) GetAddr(hash string, params map[string]string) (addr Addr, err error)
- func (api *API) GetAddrBal(hash string, params map[string]string) (addr Addr, err error)
- func (api *API) GetAddrFull(hash string, params map[string]string) (addr Addr, err error)
- func (api *API) GetAddrFullNext(this Addr) (next Addr, err error)
- func (api *API) GetAddrHDWallet(name string, params map[string]string) (addrs HDWallet, err error)
- func (api *API) GetAddrNext(this Addr) (next Addr, err error)
- func (api *API) GetAddrWallet(name string, params map[string]string) (addrs []string, err error)
- func (api *API) GetAssetAddr(assetID, oapAddr string) (addr Addr, err error)
- func (api *API) GetAssetTX(assetID, hash string) (tx OAPTX, err error)
- func (api *API) GetBlock(height int, hash string, params map[string]string) (block Block, err error)
- func (api *API) GetBlockNextTXs(this Block) (next Block, err error)
- func (api *API) GetChain() (chain Blockchain, err error)
- func (api *API) GetHDWallet(name string) (wal HDWallet, err error)
- func (api *API) GetHook(id string) (hook Hook, err error)
- func (api *API) GetMeta(hash string, kind string, private bool) (meta map[string]string, err error)
- func (api *API) GetPayFwd(id string) (payment PayFwd, err error)
- func (api *API) GetTX(hash string, params map[string]string) (tx TX, err error)
- func (api *API) GetTXConf(hash string) (conf TXConf, err error)
- func (api *API) GetUnTX() (txs []TX, err error)
- func (api *API) GetWallet(name string) (wal Wallet, err error)
- func (api *API) IssueAsset(issue OAPIssue) (tx OAPTX, err error)
- func (api *API) ListAssetTXs(assetID string) (txs []string, err error)
- func (api *API) ListHooks() (hooks []Hook, err error)
- func (api *API) ListPayFwds() (payments []PayFwd, err error)
- func (api *API) ListPayFwdsPage(start int) (payments []PayFwd, err error)
- func (api *API) ListWallets() (names []string, err error)
- func (api *API) NewTX(trans TX, verify bool) (skel TXSkel, err error)
- func (api *API) PushTX(hex string) (trans TXSkel, err error)
- func (api *API) PutMeta(hash string, kind string, private bool, meta map[string]string) (err error)
- func (api *API) SendTX(skel TXSkel) (trans TXSkel, err error)
- func (api *API) TransferAsset(issue OAPIssue, assetID string) (tx OAPTX, err error)
- type Addr
- type AddrKeychain
- type Block
- type Blockchain
- type HDWallet
- type Hook
- type NullData
- type OAPIssue
- type OAPTX
- type PayFwd
- type Payback
- type TX
- type TXConf
- type TXInput
- type TXOutput
- type TXRef
- type TXSkel
- type TokenUsage
- type Usage
- type UsageHistory
- type Wallet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
Token, Coin, Chain string
}
API stores your BlockCypher Token, and the coin/chain you're querying. Coins can be "btc","bcy","ltc", and "doge". Chains can be "main", "test3", or "test", depending on the Coin. Check http://dev.blockcypher.com/ for more information. All your credentials are stored within an API struct, as are many of the API methods. You can allocate an API struct like so:
bc = gobcy.API{"your-api-token","btc","main"}
Then query as you like:
chain = bc.GetChain()
func (*API) AddAddrWallet ¶
AddAddrWallet adds a slice of addresses to a named Wallet, associated with the API token/coin/chain. In addition to your list of addresses to add, takes one additional parameter:
"omitAddr," if true will omit wallet addresses in your response. Useful to speed up the API call for larger wallets.
func (*API) CheckUsage ¶
func (api *API) CheckUsage() (usage TokenUsage, err error)
CheckUsage checks token usage
func (*API) CreateHDWallet ¶
CreateHDWallet creates a public-address watching HDWallet associated with this token/coin/chain, usable anywhere in the API where an Address might be used (just use the wallet name instead). For example, with checking a wallet name balance:
addr, err := api.GetAddrBal("your-hd-wallet-name")
func (*API) CreateHook ¶
CreateHook creates a new WebHook associated with your API.Token, and returns a WebHook with a BlockCypher-assigned id.
func (*API) CreatePayFwd ¶
CreatePayFwd creates a new PayFwd forwarding request associated with your API.Token, and returns a PayFwd with a BlockCypher-assigned id.
func (*API) CreateWallet ¶
CreateWallet creates a public-address watching wallet associated with this token/coin/chain, usable anywhere in the API where an Address might be used (just use the wallet name instead). For example, with checking a wallet name balance:
addr, err := api.GetAddrBal("your-wallet-name", nil)
func (*API) DecodeTX ¶
DecodeTX takes a hex-encoded transaction string and decodes it into a TX object, without sending it along to the Coin/Chain network.
func (*API) DeleteAddrWallet ¶
DeleteAddrWallet deletes a slice of addresses associated with a named Wallet, associated with the API token/coin/chain.
func (*API) DeleteHDWallet ¶
DeleteHDWallet deletes a named HDWallet associated with the API token/coin/chain.
func (*API) DeleteHook ¶
DeleteHook deletes a WebHook notification from BlockCypher's database, based on its id.
func (*API) DeleteMeta ¶
DeleteMeta deletes ALL PRIVATE BlockCypher-stored metadata associated with the hash of the given blockchain object. "Kind" describes the blockchain object you're querying:
"addr" (for an address) "tx" (for a transaction) "block" (for a block)
Public metadata cannot be deleted; it is immutable.
func (*API) DeletePayFwd ¶
DeletePayFwd deletes a PayFwd request from BlockCypher's database, based on its id.
func (*API) DeleteWallet ¶
DeleteWallet deletes a named wallet associated with the API token/coin/chain.
func (*API) DeriveAddrHDWallet ¶
DeriveAddrHDWallet derives a new address within the named Wallet, associated with the API token/coin/chain. It will only return a partial HDWallet, ONLY containing the new address derived.
func (*API) Faucet ¶
func (api *API) Faucet(a AddrKeychain, amount int) (txhash string, err error)
Faucet funds the AddrKeychain with an amount. Only works on BlockCypher's Testnet and Bitcoin Testnet3. Returns the transaction hash funding your AddrKeychain.
func (*API) GenAddrKeychain ¶
func (api *API) GenAddrKeychain() (pair AddrKeychain, err error)
GenAddrKeychain generates a public/private key pair for use with transactions within the specified coin/chain. Please note that this call must be made over SSL, and it is not recommended to keep large amounts in these addresses, or for very long.
func (*API) GenAddrMultisig ¶
func (api *API) GenAddrMultisig(multi AddrKeychain) (addr AddrKeychain, err error)
GenAddrMultisig generates a P2SH multisignature address using an array of PubKeys and the ScriptType from a AddrKeychain. Other fields are ignored, and the ScriptType must be a "multisig-n-of-m" type. Returns an AddrKeychain with the same PubKeys, ScriptType, and the proper P2SH address in the AddrKeychain's address field.
func (*API) GenAddrWallet ¶
func (api *API) GenAddrWallet(name string) (wal Wallet, addr AddrKeychain, err error)
GenAddrWallet generates a new address within the named Wallet, associated with the API token/coin/chain. Also returns the private/WIF/public key of address via an Address Keychain.
func (*API) GenAssetKeychain ¶
func (api *API) GenAssetKeychain() (pair AddrKeychain, err error)
GenAssetKeychain generates a public/private key pair, alongside an associated OAPAddress for use in the Asset API.
func (*API) GetAddr ¶
GetAddr returns information for a given public address, including a slice of confirmed and unconfirmed transaction outpus via the TXRef arrays in the Address type. Returns more information than GetAddrBal, but slightly slower.
func (*API) GetAddrBal ¶
GetAddrBal returns balance information for a given public address. Fastest Address API call, but does not include transaction details.
func (*API) GetAddrFull ¶
GetAddrFull returns information for a given public address, including a slice of TXs associated with this address. Returns more data than GetAddr since it includes full transactions, but slowest Address query.
func (*API) GetAddrFullNext ¶
GetAddrFullNext returns a given Addr's next page of TXs, if Addr.HasMore is true. If HasMore is false, will return an error. It assumes default API URL parameters, like GetAddrFull.
func (*API) GetAddrHDWallet ¶
GetAddrHDWallet returns addresses associated with a named HDWallet, associated with the API token/coin/chain. It also optionally accepts URL parameters.
func (*API) GetAddrNext ¶
GetAddrNext returns a given Addr's next page of TXRefs, if Addr.HasMore is true. If HasMore is false, will return an error. It assumes default API URL parameters.
func (*API) GetAddrWallet ¶
GetAddrWallet returns a slice of addresses associated with a named Wallet, associated with the API token/coin/chain. Takes an optionally-nil URL parameter map.
func (*API) GetAssetAddr ¶
GetAssetAddr returns an Addr associated with the given assetID and oapAddr. Note that while it returns an Address, anything that would have represented "satoshis" now represents "amount of asset."
func (*API) GetAssetTX ¶
GetAssetTX returns a OAPTX associated with the given assetID and transaction hash.
func (*API) GetBlock ¶
func (api *API) GetBlock(height int, hash string, params map[string]string) (block Block, err error)
GetBlock returns a Block based on either height or hash. If both height and hash are sent, it will throw an error.
func (*API) GetBlockNextTXs ¶
GetBlockNextTXs returns the the next page of TXids based on the NextTXs URL in this Block. If NextTXs is empty, this will return an error.
func (*API) GetChain ¶
func (api *API) GetChain() (chain Blockchain, err error)
GetChain returns the current state of the configured Coin/Chain.
func (*API) GetHDWallet ¶
GetHDWallet gets a HDWallet based on its name and the associated API token/coin/chain.
func (*API) GetMeta ¶
GetMeta gets BlockCypher-stored metadata associated with the hash of the given blockchain object. "Kind" describes the blockchain object you're querying:
"addr" (for an address) "tx" (for a transaction) "block" (for a block)
If private is false, will retrieve publicly stored metadata. If private is true, will retrieve privately stored metadata associated with your token.
func (*API) GetTX ¶
GetTX returns a TX represented by the passed hash. Takes an optionally-nil URL parameter map.
func (*API) GetTXConf ¶
GetTXConf returns a TXConf containing a float [0,1] that represents BlockCypher's confidence that an unconfirmed transaction won't be successfully double-spent against. If the confidence is 1, the transaction has already been confirmed.
func (*API) GetWallet ¶
GetWallet gets a Wallet based on its name, the associated API token/coin/chain, and whether it's an HD wallet or not.
func (*API) IssueAsset ¶
IssueAsset issues new assets onto an Open Asset Address, using a private key associated with a funded address on the underlying blockchain.
func (*API) ListAssetTXs ¶
ListAssetTXs lists the transaction hashes associated with the given assetID.
func (*API) ListPayFwds ¶
ListPayFwds returns a PayFwds slice associated with your API.Token.
func (*API) ListPayFwdsPage ¶
ListPayFwdsPage returns a PayFwds slice associated with your API.Token, starting at the start index. Useful for paging past the 200 payment forward limit.
func (*API) ListWallets ¶
ListWallets lists all known Wallets associated with this token/coin/chain.
func (*API) NewTX ¶
NewTX takes a partially formed TX and returns a TXSkel with the data that needs to be signed. Can use TempNewTX or TempMultiTX to streamline input transaction, or customize transaction as described in the BlockCypher docs: http://dev.blockcypher.com/#customizing-transaction-requests If verify is true, will include "ToSignTX," which can be used to locally verify the "ToSign" data is valid.
func (*API) PushTX ¶
PushTX takes a hex-encoded transaction string and pushes it directly to the Coin/Chain network.
func (*API) PutMeta ¶
PutMeta puts BlockCypher-stored metadata associated with the hash of the given blockchain object. "Kind" describes the blockchain object you're querying:
"addr" (for an address) "tx" (for a transaction) "block" (for a block)
If private is false, will set publicly stored metadata. If private is true, will set privately stored metadata associated with your token.
type Addr ¶
type Addr struct { Address string `json:"address,omitempty"` Wallet Wallet `json:"wallet,omitempty"` HDWallet HDWallet `json:"hd_wallet,omitempty"` TotalReceived big.Int `json:"total_received"` TotalSent big.Int `json:"total_sent"` Balance big.Int `json:"balance"` UnconfirmedBalance big.Int `json:"unconfirmed_balance"` FinalBalance big.Int `json:"final_balance"` NumTX int `json:"n_tx"` UnconfirmedNumTX int `json:"unconfirmed_n_tx"` Nonce uint `json:"nonce"` PoolNonce uint `json:"pool_nonce"` FinalNumTX int `json:"final_n_tx"` TXs []TX `json:"txs,omitempty"` TXRefs []TXRef `json:"txrefs,omitempty"` UnconfirmedTXRefs []TXRef `json:"unconfirmed_txrefs,omitempty"` HasMore bool `json:"hasMore,omitempty"` }
Addr represents information about the state of a public address.
type AddrKeychain ¶
type AddrKeychain struct { Address string `json:"address,omitempty"` Private string `json:"private,omitempty"` Public string `json:"public,omitempty"` Wif string `json:"wif,omitempty"` PubKeys []string `json:"pubkeys,omitempty"` ScriptType string `json:"script_type,omitempty"` OriginalAddress string `json:"original_address,omitempty"` OAPAddress string `json:"oap_address,omitempty"` }
AddrKeychain represents information about a generated public-private key pair from BlockCypher's address generation API. Large amounts are not recommended to be stored with these addresses.
type Block ¶
type Block struct { Hash string `json:"hash"` Height int `json:"height"` Depth int `json:"depth"` Chain string `json:"chain"` Total big.Int `json:"total"` Fees big.Int `json:"fees"` Size int `json:"size,omitempty"` VirtualSize int `json:"vsize,omitempty"` Ver int `json:"ver"` Time time.Time `json:"time"` ReceivedTime time.Time `json:"received_time"` RelayedBy string `json:"relayed_by,omitempty"` Bits int `json:"bits"` Nonce int `json:"nonce"` NumTX int `json:"n_tx"` PrevBlock string `json:"prev_block"` MerkleRoot string `json:"mrkl_root"` TXids []string `json:"txids"` NextTXs string `json:"next_txids"` }
Block represents information about the state of a given block in a blockchain.
type Blockchain ¶
type Blockchain struct { Name string `json:"name"` Height int `json:"height"` Hash string `json:"hash"` Time time.Time `json:"time"` PrevHash string `json:"previous_hash"` PeerCount int `json:"peer_count"` HighFee int `json:"high_fee_per_kb"` MediumFee int `json:"medium_fee_per_kb"` LowFee int `json:"low_fee_per_kb"` UnconfirmedCount int `json:"unconfirmed_count"` LastForkHeight int `json:"last_fork_height"` LastForkHash string `json:"last_fork_hash"` }
Blockchain represents information about the state of a blockchain.
type HDWallet ¶
type HDWallet struct { Name string `json:"name,omitempty"` ExtPubKey string `json:"extended_public_key,omitempty"` SubchainIndexes []int `json:"subchain_indexes,omitempty"` Chains []struct { ChainAddr []struct { Address string `json:"address,omitempty"` Path string `json:"path,omitempty"` Public string `json:"public,omitempty"` } `json:"chain_addresses,omitempty"` Index int `json:"index,omitempty"` } `json:"chains,omitempty"` }
HDWallet represents information about a Hierarchical Deterministic (HD) wallet. Like regular Wallets, HDWallets can be used wherever an address can be used within the API.
type Hook ¶
type Hook struct { ID string `json:"id,omitempty"` Event string `json:"event"` Hash string `json:"hash,omitempty"` WalletName string `json:"wallet_name,omitempty"` Address string `json:"address,omitempty"` Confirmations int `json:"confirmations,omitempty"` Confidence float32 `json:"confidence,omitempty"` Script string `json:"script,omitempty"` URL string `json:"url,omitempty"` CallbackErrs int `json:"callback_errors,omitempty"` }
Hook represents a WebHook/WebSockets event. BlockCypher supports the following events:
Event = "unconfirmed-tx" Event = "new-block" Event = "confirmed-tx" Event = "tx-confirmation" Event = "double-spend-tx" Event = "tx-confidence"
Hash, Address, and Script are all optional; creating a WebHook with any of them will filter the resulting notifications, if appropriate. ID is returned by BlockCyphers servers after Posting a new WebHook; you shouldn't manually generate this field.
type NullData ¶
type NullData struct { Data string `json:"data"` Encoding string `json:"encoding,omitempty"` Hash string `json:"hash,omitempty"` }
NullData represents the call and return to BlockCypher's Data API, allowing you to embed up to 80 bytes into a blockchain via an OP_RETURN.
type OAPIssue ¶
type OAPIssue struct { Priv string `json:"from_private"` ToAddr string `json:"to_address"` Amount big.Int `json:"amount"` Metadata string `json:"metadata,omitempty"` }
OAPIssue represents a request for issuance or transfer of an Open Asset on a blockchain.
type OAPTX ¶
type OAPTX struct { Ver int `json:"ver"` AssetID string `json:"assetid"` Hash string `json:"hash"` Confirmed time.Time `json:"confirmed,omitempty"` Received time.Time `json:"received"` Metadata string `json:"oap_meta,omitempty"` DoubleSpend bool `json:"double_spend"` Inputs []struct { PrevHash string `json:"prev_hash"` OutputIndex int `json:"output_index"` OAPAddress string `json:"address"` OutputValue big.Int `json:"output_value"` } `json:"inputs"` Outputs []struct { OAPAddress string `json:"address"` Value big.Int `json:"value"` OrigOutputIndex int `json:"original_output_index"` } `json:"outputs"` }
OAPTX represents an Open Asset protocol transaction, generated when issuing or transferring assets.
type PayFwd ¶
type PayFwd struct { ID string `json:"id,omitempty"` Destination string `json:"destination"` InputAddr string `json:"input_address,omitempty"` ProcessAddr string `json:"process_fees_address,omitempty"` ProcessPercent float64 `json:"process_fees_percent,omitempty"` ProcessValue big.Int `json:"process_fees_satoshis,omitempty"` CallbackURL string `json:"callback_url,omitempty"` EnableConfirm bool `json:"enable_confirmations,omitempty"` MiningFees int `json:"mining_fees_satoshis,omitempty"` TXHistory []string `json:"transactions,omitempty"` }
PayFwd represents a reference to a Payment Forwarding request.
type Payback ¶
type Payback struct { Value big.Int `json:"value"` Destination string `json:"destination"` DestHash string `json:"transaction_hash"` InputAddr string `json:"input_address"` InputHash string `json:"input_transaction_hash"` }
Payback represents a Payment Forwarding Callback. It's more fun to call it a "payback."
type TX ¶
type TX struct { BlockHash string `json:"block_hash,omitempty"` BlockHeight int `json:"block_height,omitempty"` Hash string `json:"hash,omitempty"` Addresses []string `json:"addresses,omitempty"` Total big.Int `json:"total,omitempty"` Fees big.Int `json:"fees,omitempty"` Size int `json:"size"` GasLimit *big.Int `json:"gas_limit,omitempty"` GasUsed *big.Int `json:"gas_used,omitempty"` GasPrice *big.Int `json:"gas_price,omitempty"` GasTipCap *big.Int `json:"gas_tip_cap,omitempty"` GasFeeCap *big.Int `json:"gas_fee_cap,omitempty"` VirtualSize int `json:"vsize,omitempty"` Preference string `json:"preference,omitempty"` RelayedBy string `json:"relayed_by,omitempty"` Received time.Time `json:"received,omitempty"` Confirmed time.Time `json:"confirmed,omitempty"` Confirmations int `json:"confirmations,omitempty"` Confidence float64 `json:"confidence,omitempty"` Ver int `json:"ver,omitempty"` LockTime int `json:"lock_time,omitempty"` DoubleSpend bool `json:"double_spend,omitempty"` DoubleOf string `json:"double_of,omitempty"` ReceiveCount int `json:"receive_count,omitempty"` VinSize int `json:"vin_sz,omitempty"` VoutSize int `json:"vout_sz,omitempty"` Hex string `json:"hex,omitempty"` DataProtocol string `json:"data_protocol,omitempty"` ChangeAddress string `json:"change_address,omitempty"` NextInputs string `json:"next_inputs,omitempty"` NextOutputs string `json:"next_outputs,omitempty"` Inputs []TXInput `json:"inputs"` Outputs []TXOutput `json:"outputs"` }
TX represents information about the state of a given transaction in a blockchain.
func TempMultiTX ¶
func TempMultiTX(inAddr string, outAddr string, amount big.Int, n int, pubkeys []string) (trans TX, err error)
TempMultiTX creates a skeleton multisig transaction, suitable for use in NewTX. If outAddr == "", then the returned TX will be a skeleton to fund a multisig address. If inAddr == "", then the returned TX will be a skeleton to send from a multisig address (/series of public keys). n represents the number of valid signatures required, and m is derived from the number of pubkeys.
type TXConf ¶
type TXConf struct { Age int `json:"age_millis"` ReceiveCount int `json:"receive_count,omitempty"` Confidence float64 `json:"confidence"` TXHash string `json:"txhash"` }
TXConf represents information about the confidence of an unconfirmed transaction.
type TXInput ¶
type TXInput struct { PrevHash string `json:"prev_hash,omitempty"` OutputIndex int `json:"output_index,omitempty"` OutputValue int `json:"output_value,omitempty"` Addresses []string `json:"addresses"` Sequence int `json:"sequence,omitempty"` ScriptType string `json:"script_type,omitempty"` Script string `json:"script,omitempty"` Age int `json:"age,omitempty"` WalletName string `json:"wallet_name,omitempty"` }
TXInput represents the state of a transaction input
type TXOutput ¶
type TXOutput struct { SpentBy string `json:"spent_by,omitempty"` Value big.Int `json:"value"` Addresses []string `json:"addresses"` ScriptType string `json:"script_type,omitempty"` Script string `json:"script,omitempty"` DataHex string `json:"data_hex,omitempty"` DataString string `json:"data_string,omitempty"` }
TXOutput represents the state of a transaction output
type TXRef ¶
type TXRef struct { Address string `json:"address,omitempty"` BlockHeight int `json:"block_height"` TXHash string `json:"tx_hash"` TXInputN int `json:"tx_input_n"` TXOutputN int `json:"tx_output_n"` Value big.Int `json:"value"` Pref string `json:"preference"` Spent bool `json:"spent"` DoubleSpend bool `json:"double_spend"` DoubleOf string `json:"double_of,omitempty"` Confirmations int `json:"confirmations"` Script string `json:"script,omitempty"` RefBalance int `json:"ref_balance,omitempty"` Confidence float64 `json:"confidence,omitempty"` Confirmed time.Time `json:"confirmed,omitempty"` SpentBy string `json:"spent_by,omitempty"` Received time.Time `json:"received,omitempty"` ReceivedCount big.Int `json:"received_count,omitempty"` }
TXRef represents summarized data about a transaction input or output.
type TXSkel ¶
type TXSkel struct { Trans TX `json:"tx"` ToSign []string `json:"tosign"` Signatures []string `json:"signatures"` PubKeys []string `json:"pubkeys,omitempty"` ToSignTX []string `json:"tosign_tx,omitempty"` Errors []struct { Error string `json:"error,omitempty"` } `json:"errors,omitempty"` }
TXSkel represents the return call to BlockCypher's txs/new endpoint, and includes error information, hex transactions that need to be signed, and space for the signed transactions and associated public keys.
type TokenUsage ¶
type TokenUsage struct { Limits Usage `json:"limits"` Hits Usage `json:"hits"` HitsHistory []UsageHistory `json:"hits_history"` }
TokenUsage represents information about the limits and usage against your token.
type Usage ¶
type Usage struct { PerSec int `json:"api/second,omitempty"` PerHour int `json:"api/hour,omitempty"` PerDay int `json:"api/day,omitempty"` HooksPerHour int `json:"hooks/hour,omitempty"` ConfPerHour int `json:"confidence/hour,omitempty"` Hooks int `json:"hooks,omitempty"` PayFwds int `json:"payments,omitempty"` }
Usage defines the usage of the token
type UsageHistory ¶
UsageHistory defines the usage over time