Documentation
¶
Index ¶
- func WithBaseURL(url *url.URL) rpcinterface.ClientOptionFunc
- func WithCache(validTime time.Duration) rpcinterface.ClientOptionFunc
- func WithTimeout(timeout time.Duration) rpcinterface.ClientOptionFunc
- type AddKeyOptions
- type AddKeyResponse
- type CatSpendOptions
- type CatSpendResponse
- type Client
- func (c *Client) AddDisconnectHandler(onDisconnect rpcinterface.DisconnectHandler)
- func (c *Client) AddHandler(handler rpcinterface.WebsocketResponseHandler) error
- func (c *Client) AddReconnectHandler(onReconnect rpcinterface.ReconnectHandler)
- func (c *Client) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (c *Client) ListenSync(handler rpcinterface.WebsocketResponseHandler) error
- func (c *Client) NewRequest(service rpcinterface.ServiceType, rpcEndpoint rpcinterface.Endpoint, ...) (*rpcinterface.Request, error)
- func (c *Client) Subscribe(service string) error
- func (c *Client) SubscribeSelf() error
- type ConnectionMode
- type CrawlerService
- func (s *CrawlerService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (s *CrawlerService) GetIPsAfterTimestamp(opts *GetIPsAfterTimestampOptions) (*GetIPsAfterTimestampResponse, *http.Response, error)
- func (s *CrawlerService) GetPeerCounts() (*GetPeerCountsResponse, *http.Response, error)
- func (s *CrawlerService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
- type CreateSignedTransactionOptions
- type CreateSignedTransactionResponse
- type DeleteAllKeysResponse
- type FullNodePushTXOptions
- type FullNodePushTXResponse
- type FullNodeService
- func (s *FullNodeService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (s *FullNodeService) GetBlock(opts *GetBlockOptions) (*GetBlockResponse, *http.Response, error)
- func (s *FullNodeService) GetBlockByHeight(opts *GetBlockByHeightOptions) (*GetBlockResponse, *http.Response, error)
- func (s *FullNodeService) GetBlockCountMetrics() (*GetBlockCountMetricsResponse, *http.Response, error)
- func (s *FullNodeService) GetBlockRecordByHeight(opts *GetBlockByHeightOptions) (*GetBlockRecordResponse, *http.Response, error)
- func (s *FullNodeService) GetBlockchainState() (*GetBlockchainStateResponse, *http.Response, error)
- func (s *FullNodeService) GetBlocks(opts *GetBlocksOptions) (*GetBlocksResponse, *http.Response, error)
- func (s *FullNodeService) GetCoinRecordByName(opts *GetCoinRecordByNameOptions) (*GetCoinRecordByNameResponse, *http.Response, error)
- func (s *FullNodeService) GetConnections(opts *GetConnectionsOptions) (*GetConnectionsResponse, *http.Response, error)
- func (s *FullNodeService) GetFeeEstimate(opts *GetFeeEstimateOptions) (*GetFeeEstimateResponse, *http.Response, error)
- func (s *FullNodeService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
- func (s *FullNodeService) PushTX(opts *FullNodePushTXOptions) (*FullNodePushTXResponse, *http.Response, error)
- type GenerateMnemonicResponse
- type GetBlockByHeightOptions
- type GetBlockCountMetricsResponse
- type GetBlockOptions
- type GetBlockRecordResponse
- type GetBlockResponse
- type GetBlockchainStateResponse
- type GetBlocksOptions
- type GetBlocksResponse
- type GetCoinRecordByNameOptions
- type GetCoinRecordByNameResponse
- type GetConnectionsOptions
- type GetConnectionsResponse
- type GetFeeEstimateOptions
- type GetFeeEstimateResponse
- type GetIPsAfterTimestampOptions
- type GetIPsAfterTimestampResponse
- type GetNFTInfoOptions
- type GetNFTInfoResponse
- type GetNFTsOptions
- type GetNFTsResponse
- type GetNextAddressOptions
- type GetNextAddressResponse
- type GetPeerCountsResponse
- type GetPublicKeysResponse
- type GetSpendableCoinsOptions
- type GetSpendableCoinsResponse
- type GetWalletBalanceOptions
- type GetWalletBalanceResponse
- type GetWalletHeightInfoResponse
- type GetWalletNetworkInfoResponse
- type GetWalletSyncStatusResponse
- type GetWalletTransactionCountOptions
- type GetWalletTransactionCountResponse
- type GetWalletTransactionOptions
- type GetWalletTransactionResponse
- type GetWalletTransactionsOptions
- type GetWalletTransactionsResponse
- type GetWalletsOptions
- type GetWalletsResponse
- type HarvesterGetPlotsResponse
- type HarvesterService
- func (s *HarvesterService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (s *HarvesterService) GetPlots() (*HarvesterGetPlotsResponse, *http.Response, error)
- func (s *HarvesterService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
- type MintNFTOptions
- type MintNFTResponse
- type NFTAddURIOptions
- type NFTAddURIResponse
- type SendTransactionMultiResponse
- type SendTransactionOptions
- type SendTransactionResponse
- type TransferNFTOptions
- type TransferNFTResponse
- type WalletService
- func (s *WalletService) AddKey(options *AddKeyOptions) (*AddKeyResponse, *http.Response, error)
- func (s *WalletService) CatSpend(opts *CatSpendOptions) (*CatSpendResponse, *http.Response, error)
- func (s *WalletService) CreateSignedTransaction(opts *CreateSignedTransactionOptions) (*CreateSignedTransactionResponse, *http.Response, error)
- func (s *WalletService) DeleteAllKeys() (*DeleteAllKeysResponse, *http.Response, error)
- func (s *WalletService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (s *WalletService) GenerateMnemonic() (*GenerateMnemonicResponse, *http.Response, error)
- func (s *WalletService) GetHeightInfo() (*GetWalletHeightInfoResponse, *http.Response, error)
- func (s *WalletService) GetNFTInfo(opts *GetNFTInfoOptions) (*GetNFTInfoResponse, *http.Response, error)
- func (s *WalletService) GetNFTs(opts *GetNFTsOptions) (*GetNFTsResponse, *http.Response, error)
- func (s *WalletService) GetNetworkInfo() (*GetWalletNetworkInfoResponse, *http.Response, error)
- func (s *WalletService) GetNextAddress(options *GetNextAddressOptions) (*GetNextAddressResponse, *http.Response, error)
- func (s *WalletService) GetPublicKeys() (*GetPublicKeysResponse, *http.Response, error)
- func (s *WalletService) GetSpendableCoins(opts *GetSpendableCoinsOptions) (*GetSpendableCoinsResponse, *http.Response, error)
- func (s *WalletService) GetSyncStatus() (*GetWalletSyncStatusResponse, *http.Response, error)
- func (s *WalletService) GetTransaction(opts *GetWalletTransactionOptions) (*GetWalletTransactionResponse, *http.Response, error)
- func (s *WalletService) GetTransactionCount(opts *GetWalletTransactionCountOptions) (*GetWalletTransactionCountResponse, *http.Response, error)
- func (s *WalletService) GetTransactions(opts *GetWalletTransactionsOptions) (*GetWalletTransactionsResponse, *http.Response, error)
- func (s *WalletService) GetWalletBalance(opts *GetWalletBalanceOptions) (*GetWalletBalanceResponse, *http.Response, error)
- func (s *WalletService) GetWallets(opts *GetWalletsOptions) (*GetWalletsResponse, *http.Response, error)
- func (s *WalletService) MintNFT(opts *MintNFTOptions) (*MintNFTResponse, *http.Response, error)
- func (s *WalletService) NFTAddURI(opts *NFTAddURIOptions) (*NFTAddURIResponse, *http.Response, error)
- func (s *WalletService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
- func (s *WalletService) SendTransaction(opts *SendTransactionOptions) (*SendTransactionResponse, *http.Response, error)
- func (s *WalletService) SendTransactionMulti(opts *CreateSignedTransactionOptions) (*SendTransactionMultiResponse, *http.Response, error)
- func (s *WalletService) TransferNFT(opts *TransferNFTOptions) (*TransferNFTResponse, *http.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBaseURL ¶
func WithBaseURL(url *url.URL) rpcinterface.ClientOptionFunc
WithBaseURL sets the host for RPC requests
func WithCache ¶
func WithCache(validTime time.Duration) rpcinterface.ClientOptionFunc
WithCache specify a duration http requests should be cached for If unset, cache will not be used
func WithTimeout ¶ added in v0.0.20
func WithTimeout(timeout time.Duration) rpcinterface.ClientOptionFunc
WithTimeout sets the timeout for the requests
Types ¶
type AddKeyOptions ¶ added in v0.0.20
type AddKeyOptions struct {
Mnemonic []string `json:"mnemonic"`
}
AddKeyOptions options for the add_key endpoint
type AddKeyResponse ¶ added in v0.0.20
type AddKeyResponse struct {
Success bool `json:"success"`
Error string `json:"error"`
Word string `json:"word,omitempty"`
Fingerprint int `json:"fingerprint,omitempty"`
}
AddKeyResponse response from the add_key endpoint
type CatSpendOptions ¶ added in v0.0.4
type CatSpendOptions struct {
WalletID uint32 `json:"wallet_id"`
Amount uint64 `json:"amount"`
Address string `json:"inner_address"`
Fee uint64 `json:"fee"`
}
CatSpendOptions represents the options for cat_spend
type CatSpendResponse ¶ added in v0.0.4
type CatSpendResponse struct {
Success bool `json:"success"`
TransactionID string `json:"transaction_id"`
Transaction types.TransactionRecord `json:"transaction"`
}
CatSpendResponse represents the response from cat_spend
type Client ¶
type Client struct {
// Services for the different chia services
FullNodeService *FullNodeService
WalletService *WalletService
HarvesterService *HarvesterService
CrawlerService *CrawlerService
// contains filtered or unexported fields
}
Client is the RPC client
func NewClient ¶
func NewClient(connectionMode ConnectionMode, options ...rpcinterface.ClientOptionFunc) (*Client, error)
NewClient returns a new RPC Client
func (*Client) AddDisconnectHandler ¶
func (c *Client) AddDisconnectHandler(onDisconnect rpcinterface.DisconnectHandler)
AddDisconnectHandler the function to call when the client is disconnected
func (*Client) AddHandler ¶
func (c *Client) AddHandler(handler rpcinterface.WebsocketResponseHandler) error
AddHandler adds a handler function to call when a message is received over the websocket This is expected to NOT be used in conjunction with ListenSync This will run in the background, and allow other things to happen in the foreground while ListenSync will take over the foreground process
func (*Client) AddReconnectHandler ¶ added in v0.0.12
func (c *Client) AddReconnectHandler(onReconnect rpcinterface.ReconnectHandler)
AddReconnectHandler the function to call when the client is disconnected
func (*Client) ListenSync ¶
func (c *Client) ListenSync(handler rpcinterface.WebsocketResponseHandler) error
ListenSync Listens for async responses over the connection in a synchronous fashion, blocking anything else
func (*Client) NewRequest ¶
func (c *Client) NewRequest(service rpcinterface.ServiceType, rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
NewRequest is a helper that wraps the activeClient's NewRequest method
func (*Client) Subscribe ¶
Subscribe adds a subscription to events from a particular service This is currently only useful for websocket mode
func (*Client) SubscribeSelf ¶
SubscribeSelf subscribes to responses to requests from this service This is currently only useful for websocket mode
type ConnectionMode ¶
type ConnectionMode uint8
ConnectionMode specifies the method used to connect to the server (HTTP or Websocket)
const ( // ConnectionModeHTTP uses HTTP for requests to the RPC server ConnectionModeHTTP ConnectionMode = iota // ConnectionModeWebsocket uses websockets for requests to the RPC server ConnectionModeWebsocket )
type CrawlerService ¶
type CrawlerService struct {
// contains filtered or unexported fields
}
CrawlerService encapsulates crawler RPC methods
func (*CrawlerService) Do ¶
func (s *CrawlerService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
Do is just a shortcut to the client's Do method
func (*CrawlerService) GetIPsAfterTimestamp ¶
func (s *CrawlerService) GetIPsAfterTimestamp(opts *GetIPsAfterTimestampOptions) (*GetIPsAfterTimestampResponse, *http.Response, error)
GetIPsAfterTimestamp Returns IP addresses seen by the network after a particular timestamp
func (*CrawlerService) GetPeerCounts ¶
func (s *CrawlerService) GetPeerCounts() (*GetPeerCountsResponse, *http.Response, error)
GetPeerCounts crawler rpc -> get_peer_counts
func (*CrawlerService) NewRequest ¶
func (s *CrawlerService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
NewRequest returns a new request specific to the crawler service
type CreateSignedTransactionOptions ¶ added in v0.0.20
type CreateSignedTransactionOptions struct {
WalletID *uint32 `json:"wallet_id,omitempty"`
Additions []types.Addition `json:"additions"`
Fee *uint64 `json:"fee,omitempty"`
MinCoinAmount *uint64 `json:"min_coin_amount,omitempty"`
MaxCoinAmount *uint64 `json:"max_coin_amount,omitempty"`
ExcludeCoinAmounts []*uint64 `json:"exclude_coin_amounts,omitempty"`
Coins []types.Coin `json:"Coins,omitempty"`
ExcludeCoins []types.Coin `json:"exclude_coins,omitempty"`
}
CreateSignedTransactionOptions Options for create_signed_transaction endpoint
type CreateSignedTransactionResponse ¶ added in v0.0.20
type CreateSignedTransactionResponse struct {
SignedTXs []types.TransactionRecord `json:"signed_txs"`
SignedTX types.TransactionRecord `json:"signed_tx"`
}
CreateSignedTransactionResponse Response from create_signed_transaction
type DeleteAllKeysResponse ¶ added in v0.0.22
DeleteAllKeysResponse Delete keys response
type FullNodePushTXOptions ¶ added in v0.0.22
type FullNodePushTXOptions struct {
SpendBundle types.SpendBundle `json:"spend_bundle"`
}
FullNodePushTXOptions options for pushing tx to full node mempool
type FullNodePushTXResponse ¶ added in v0.0.22
type FullNodePushTXResponse struct {
Status string `json:"status"`
Success bool `json:"success"`
Error string `json:"error"`
}
FullNodePushTXResponse Response from full node push_tx
type FullNodeService ¶
type FullNodeService struct {
// contains filtered or unexported fields
}
FullNodeService encapsulates full node RPC methods
func (*FullNodeService) Do ¶
func (s *FullNodeService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
Do is just a shortcut to the client's Do method
func (*FullNodeService) GetBlock ¶
func (s *FullNodeService) GetBlock(opts *GetBlockOptions) (*GetBlockResponse, *http.Response, error)
GetBlock full_node->get_block RPC method
func (*FullNodeService) GetBlockByHeight ¶
func (s *FullNodeService) GetBlockByHeight(opts *GetBlockByHeightOptions) (*GetBlockResponse, *http.Response, error)
GetBlockByHeight helper function to get a full block by height, calls full_node->get_block_record_by_height RPC method then full_node->get_block RPC method
func (*FullNodeService) GetBlockCountMetrics ¶
func (s *FullNodeService) GetBlockCountMetrics() (*GetBlockCountMetricsResponse, *http.Response, error)
GetBlockCountMetrics gets metrics about blocks
func (*FullNodeService) GetBlockRecordByHeight ¶
func (s *FullNodeService) GetBlockRecordByHeight(opts *GetBlockByHeightOptions) (*GetBlockRecordResponse, *http.Response, error)
GetBlockRecordByHeight full_node->get_block_record_by_height RPC method
func (*FullNodeService) GetBlockchainState ¶
func (s *FullNodeService) GetBlockchainState() (*GetBlockchainStateResponse, *http.Response, error)
GetBlockchainState returns blockchain state
func (*FullNodeService) GetBlocks ¶
func (s *FullNodeService) GetBlocks(opts *GetBlocksOptions) (*GetBlocksResponse, *http.Response, error)
GetBlocks full_node->get_blocks RPC method
func (*FullNodeService) GetCoinRecordByName ¶ added in v0.0.19
func (s *FullNodeService) GetCoinRecordByName(opts *GetCoinRecordByNameOptions) (*GetCoinRecordByNameResponse, *http.Response, error)
GetCoinRecordByName request to get_coin_record_by_name endpoint
func (*FullNodeService) GetConnections ¶
func (s *FullNodeService) GetConnections(opts *GetConnectionsOptions) (*GetConnectionsResponse, *http.Response, error)
GetConnections returns connections
func (*FullNodeService) GetFeeEstimate ¶ added in v0.0.21
func (s *FullNodeService) GetFeeEstimate(opts *GetFeeEstimateOptions) (*GetFeeEstimateResponse, *http.Response, error)
GetFeeEstimate endpoint
func (*FullNodeService) NewRequest ¶
func (s *FullNodeService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
NewRequest returns a new request specific to the wallet service
func (*FullNodeService) PushTX ¶ added in v0.0.22
func (s *FullNodeService) PushTX(opts *FullNodePushTXOptions) (*FullNodePushTXResponse, *http.Response, error)
PushTX pushes a transaction to the full node
type GenerateMnemonicResponse ¶ added in v0.0.20
type GenerateMnemonicResponse struct {
Mnemonic []string `json:"mnemonic"`
Success bool `json:"success"`
}
GenerateMnemonicResponse Random new 24 words response
type GetBlockByHeightOptions ¶
type GetBlockByHeightOptions struct {
BlockHeight int `json:"height"`
}
GetBlockByHeightOptions options for get_block_record_by_height and get_block rpc call
type GetBlockCountMetricsResponse ¶
type GetBlockCountMetricsResponse struct {
Success bool `json:"success"`
Metrics *types.BlockCountMetrics `json:"metrics"`
}
GetBlockCountMetricsResponse response for get_block_count_metrics rpc call
type GetBlockOptions ¶
type GetBlockOptions struct {
HeaderHash string `json:"header_hash"`
}
GetBlockOptions options for get_block rpc call
type GetBlockRecordResponse ¶
type GetBlockRecordResponse struct {
Success bool `json:"success"`
BlockRecord *types.BlockRecord `json:"block_record"`
}
GetBlockRecordResponse response from get_block_record_by_height
type GetBlockResponse ¶
type GetBlockResponse struct {
Success bool `json:"success"`
Block *types.FullBlock `json:"block"`
}
GetBlockResponse response for get_block rpc call
type GetBlockchainStateResponse ¶
type GetBlockchainStateResponse struct {
Success bool `json:"success"`
BlockchainState *types.BlockchainState `json:"blockchain_state"`
}
GetBlockchainStateResponse is the blockchain state RPC response
type GetBlocksOptions ¶
GetBlocksOptions options for get_blocks rpc call
type GetBlocksResponse ¶
type GetBlocksResponse struct {
Success bool `json:"success"`
Blocks []*types.FullBlock `json:"blocks"`
}
GetBlocksResponse response for get_blocks rpc call
type GetCoinRecordByNameOptions ¶ added in v0.0.19
type GetCoinRecordByNameOptions struct {
Name string `json:"name"`
}
GetCoinRecordByNameOptions request options for /get_coin_record_by_name
type GetCoinRecordByNameResponse ¶ added in v0.0.19
type GetCoinRecordByNameResponse struct {
CoinRecord types.CoinRecord `json:"coin_record"`
}
GetCoinRecordByNameResponse response from get_coin_record_by_name endpoint
type GetConnectionsOptions ¶
GetConnectionsOptions options to filter get_connections
type GetConnectionsResponse ¶
type GetConnectionsResponse struct {
Success bool `json:"success"`
Connections []*types.Connection `json:"connections"`
}
GetConnectionsResponse get_connections response format
type GetFeeEstimateOptions ¶ added in v0.0.21
type GetFeeEstimateOptions struct {
SpendBundle *types.SpendBundle `json:"spend_bundle,omitempty"`
Cost uint64 `json:"cost,omitempty"`
TargetTimes []uint64 `json:"target_times"`
}
GetFeeEstimateOptions inputs to get a fee estimate TargetTimes is a list of values corresponding to "seconds from now" to get a fee estimate for The estimated fee is the estimate of the fee required to complete the TX by the target time seconds
type GetFeeEstimateResponse ¶ added in v0.0.21
type GetFeeEstimateResponse struct {
Estimates []uint64 `json:"estimates"`
TargetTimes []uint64 `json:"target_times"`
CurrentFeeRate uint64 `json:"current_fee_rate"`
MempoolSize uint64 `json:"mempool_size"`
MempoolMaxSize uint64 `json:"mempool_max_size"`
FullNodeSynced bool `json:"full_node_synced"`
PeakHeight uint32 `json:"peak_height"`
LastPeakTimestamp uint64 `json:"last_peak_timestamp"`
NodeTimeUTC uint64 `json:"node_time_utc"`
}
GetFeeEstimateResponse response for get_fee_estimate
type GetIPsAfterTimestampOptions ¶
type GetIPsAfterTimestampOptions struct {
After int64 `json:"after"`
Offset uint `json:"offset"`
Limit uint `json:"limit"`
}
GetIPsAfterTimestampOptions Options for the get_ips_after_timestamp RPC call
type GetIPsAfterTimestampResponse ¶
type GetIPsAfterTimestampResponse struct {
Success bool `json:"success"`
IPs []string `json:"ips"`
Total int `json:"total"`
}
GetIPsAfterTimestampResponse Response for get_ips_after_timestamp
type GetNFTInfoOptions ¶ added in v0.0.14
GetNFTInfoOptions represents the options for nft_get_info
type GetNFTInfoResponse ¶ added in v0.0.14
type GetNFTInfoResponse struct {
NFTInfo types.NFT `json:"nft_info"`
Success bool `json:"success"`
}
GetNFTInfoResponse represents the response from nft_get_info
type GetNFTsOptions ¶ added in v0.0.14
type GetNFTsOptions struct {
WalletID uint32 `json:"wallet_id"`
}
GetNFTsOptions represents the options for nft_get_nfts
type GetNFTsResponse ¶ added in v0.0.14
type GetNFTsResponse struct {
Success bool `json:"success"`
WalletID uint32 `json:"wallet_id"`
NFTList []types.NFT `json:"nft_list"`
}
GetNFTsResponse represents the response from nft_get_nfts
type GetNextAddressOptions ¶ added in v0.0.20
type GetNextAddressOptions struct {
NewAddress bool `json:"new_address"`
WalletID uint32 `json:"wallet_id"`
}
GetNextAddressOptions options for get_next_address endpoint
type GetNextAddressResponse ¶ added in v0.0.20
type GetNextAddressResponse struct {
WalletID uint32 `json:"wallet_id"`
Address string `json:"address"`
}
GetNextAddressResponse response from get next address
type GetPeerCountsResponse ¶
type GetPeerCountsResponse struct {
Success bool `json:"success"`
PeerCounts *types.CrawlerPeerCounts `json:"peer_counts"`
}
GetPeerCountsResponse Response for get_get_peer_counts on crawler
type GetPublicKeysResponse ¶ added in v0.0.20
type GetPublicKeysResponse struct {
PublicKeyFingerprints []int `json:"public_key_fingerprints"`
}
GetPublicKeysResponse response from get_public_keys
type GetSpendableCoinsOptions ¶ added in v0.0.20
type GetSpendableCoinsOptions struct {
WalletID uint32 `json:"wallet_id"`
MinCoinAmount *uint64 `json:"min_coin_amount,omitempty"`
MaxCoinAmount *uint64 `json:"max_coin_amount,omitempty"`
ExcludedCoinAmounts []uint64 `json:"excluded_coin_amounts,omitempty"`
}
GetSpendableCoinsOptions Options for get_spendable_coins
type GetSpendableCoinsResponse ¶ added in v0.0.20
type GetSpendableCoinsResponse struct {
ConfirmedRecords []types.CoinRecord `json:"confirmed_records"`
UnconfirmedRemovals []types.CoinRecord `json:"unconfirmed_removals"`
UnconfirmedAdditions []types.CoinRecord `json:"unconfirmed_additions"`
}
GetSpendableCoinsResponse response from get_spendable_coins
type GetWalletBalanceOptions ¶
type GetWalletBalanceOptions struct {
WalletID uint32 `json:"wallet_id"`
}
GetWalletBalanceOptions request options for get_wallet_balance
type GetWalletBalanceResponse ¶
type GetWalletBalanceResponse struct {
Success bool `json:"success"`
Balance *types.WalletBalance `json:"wallet_balance"`
}
GetWalletBalanceResponse is the wallet balance RPC response
type GetWalletHeightInfoResponse ¶
type GetWalletHeightInfoResponse struct {
Success bool `json:"success"`
Height uint32 `json:"height"`
}
GetWalletHeightInfoResponse response for get_height_info on wallet
type GetWalletNetworkInfoResponse ¶
type GetWalletNetworkInfoResponse struct {
Success bool `json:"success"`
NetworkName string `json:"network_name"`
NetworkPrefix string `json:"network_prefix"`
}
GetWalletNetworkInfoResponse response for get_height_info on wallet
type GetWalletSyncStatusResponse ¶
type GetWalletSyncStatusResponse struct {
Success bool `json:"success"`
GenesisInitialized bool `json:"genesis_initialized"`
Synced bool `json:"synced"`
Syncing bool `json:"syncing"`
}
GetWalletSyncStatusResponse Response for get_sync_status on wallet
type GetWalletTransactionCountOptions ¶
type GetWalletTransactionCountOptions struct {
WalletID uint32 `json:"wallet_id"`
}
GetWalletTransactionCountOptions options for get transaction count
type GetWalletTransactionCountResponse ¶
type GetWalletTransactionCountResponse struct {
Success bool `json:"success"`
WalletID uint32 `json:"wallet_id"`
Count int `json:"count"`
}
GetWalletTransactionCountResponse response for get_transaction_count
type GetWalletTransactionOptions ¶
type GetWalletTransactionOptions struct {
WalletID uint32 `json:"wallet_id"`
TransactionID string `json:"transaction_id"`
}
GetWalletTransactionOptions options for getting a single wallet transaction
type GetWalletTransactionResponse ¶
type GetWalletTransactionResponse struct {
Success bool `json:"success"`
Transaction *types.TransactionRecord `json:"transaction"`
TransactionID string `json:"transaction_id"`
}
GetWalletTransactionResponse response for get_wallet_transactions
type GetWalletTransactionsOptions ¶
type GetWalletTransactionsOptions struct {
WalletID uint32 `json:"wallet_id"`
Start *int `json:"start,omitempty"`
End *int `json:"end,omitempty"`
ToAddress string `json:"to_address,omitempty"`
}
GetWalletTransactionsOptions options for get wallet transactions
type GetWalletTransactionsResponse ¶
type GetWalletTransactionsResponse struct {
Success bool `json:"success"`
WalletID uint32 `json:"wallet_id"`
Transactions []*types.TransactionRecord `json:"transactions"`
}
GetWalletTransactionsResponse response for get_wallet_transactions
type GetWalletsOptions ¶ added in v0.0.17
type GetWalletsOptions struct {
Type types.WalletType `json:"type"`
}
GetWalletsOptions wallet rpc -> get_wallets
type GetWalletsResponse ¶
type GetWalletsResponse struct {
Success bool `json:"success"`
Fingerprint int `json:"fingerprint"`
Wallets []*types.WalletInfo `json:"wallets"`
}
GetWalletsResponse wallet rpc -> get_wallets
type HarvesterGetPlotsResponse ¶ added in v0.0.6
type HarvesterGetPlotsResponse struct {
Success bool `json:"success"`
Plots []*types.PlotInfo `json:"plots"`
FailedToOpenFilenames []string `json:"failed_to_open_filenames"`
NotFoundFilenames []string `json:"not_found_filenames"`
}
HarvesterGetPlotsResponse get_plots response format
type HarvesterService ¶ added in v0.0.6
type HarvesterService struct {
// contains filtered or unexported fields
}
HarvesterService encapsulates harvester RPC methods
func (*HarvesterService) Do ¶ added in v0.0.6
func (s *HarvesterService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
Do is just a shortcut to the client's Do method
func (*HarvesterService) GetPlots ¶ added in v0.0.6
func (s *HarvesterService) GetPlots() (*HarvesterGetPlotsResponse, *http.Response, error)
GetPlots returns connections
func (*HarvesterService) NewRequest ¶ added in v0.0.6
func (s *HarvesterService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
NewRequest returns a new request specific to the wallet service
type MintNFTOptions ¶ added in v0.0.14
type MintNFTOptions struct {
DidID string `json:"did_id"` // not required
EditionNumber uint32 `json:"edition_number"` // not required
EditionCount uint32 `json:"edition_count"` // not required
Fee uint64 `json:"fee"` // not required
LicenseHash string `json:"license_hash"` //not required
LicenseURIs []string `json:"license_uris"` // not required
MetaHash string `json:"meta_hash"` // not required
MetaURIs []string `json:"meta_uris"` // not required
RoyaltyAddress string `json:"royalty_address"` // not required
RoyaltyPercentage uint32 `json:"royalty_percentage"` // not required
TargetAddress string `json:"target_address"` // not required
Hash string `json:"hash"`
URIs []string `json:"uris"`
WalletID uint32 `json:"wallet_id"`
}
MintNFTOptions represents the options for nft_get_info
type MintNFTResponse ¶ added in v0.0.14
type MintNFTResponse struct {
SpendBundle types.SpendBundle `json:"spend_bundle"`
Success bool `json:"success"`
WalletID uint32 `json:"wallet_id"`
}
MintNFTResponse represents the response from nft_get_info
type NFTAddURIOptions ¶ added in v0.0.14
type NFTAddURIOptions struct {
Fee uint64 `json:"fee"` // not required
Key string `json:"key"`
NFTCoinID string `json:"nft_coin_id"`
URI string `json:"uri"`
WalletID uint32 `json:"wallet_id"`
}
NFTAddURIOptions represents the options for nft_add_uri
type NFTAddURIResponse ¶ added in v0.0.14
type NFTAddURIResponse struct {
SpendBundle types.SpendBundle `json:"spend_bundle"`
Success bool `json:"success"`
WalletID uint32 `json:"wallet_id"`
}
NFTAddURIResponse represents the response from nft_add_uri
type SendTransactionMultiResponse ¶ added in v0.0.20
type SendTransactionMultiResponse struct {
Transaction types.TransactionRecord `json:"transaction"`
TransactionID string `json:"transaction_id"`
}
SendTransactionMultiResponse Response from send_transaction_multi
type SendTransactionOptions ¶
type SendTransactionOptions struct {
WalletID uint32 `json:"wallet_id"`
Amount uint64 `json:"amount"`
Address string `json:"address"`
Memos []byte `json:"memos,omitempty"`
Fee uint64 `json:"fee"`
Coins []types.Coin `json:"coins,omitempty"`
}
SendTransactionOptions represents the options for send_transaction
type SendTransactionResponse ¶
type SendTransactionResponse struct {
Success bool `json:"success"`
TransactionID string `json:"transaction_id"`
Transaction types.TransactionRecord `json:"transaction"`
}
SendTransactionResponse represents the response from send_transaction
type TransferNFTOptions ¶ added in v0.0.14
type TransferNFTOptions struct {
Fee uint64 `json:"fee"` // not required
NFTCoinID string `json:"nft_coin_id"`
TargetAddress string `json:"target_address"`
WalletID uint32 `json:"wallet_id"`
}
TransferNFTOptions represents the options for nft_get_info
type TransferNFTResponse ¶ added in v0.0.14
type TransferNFTResponse struct {
SpendBundle types.SpendBundle `json:"spend_bundle"`
Success bool `json:"success"`
WalletID uint32 `json:"wallet_id"`
}
TransferNFTResponse represents the response from nft_get_info
type WalletService ¶
type WalletService struct {
// contains filtered or unexported fields
}
WalletService encapsulates wallet RPC methods
func (*WalletService) AddKey ¶ added in v0.0.20
func (s *WalletService) AddKey(options *AddKeyOptions) (*AddKeyResponse, *http.Response, error)
AddKey Adds a new key from 24 words to the keychain
func (*WalletService) CatSpend ¶ added in v0.0.4
func (s *WalletService) CatSpend(opts *CatSpendOptions) (*CatSpendResponse, *http.Response, error)
CatSpend sends a transaction
func (*WalletService) CreateSignedTransaction ¶ added in v0.0.20
func (s *WalletService) CreateSignedTransaction(opts *CreateSignedTransactionOptions) (*CreateSignedTransactionResponse, *http.Response, error)
CreateSignedTransaction generates a signed transaction based on the specified options
func (*WalletService) DeleteAllKeys ¶ added in v0.0.22
func (s *WalletService) DeleteAllKeys() (*DeleteAllKeysResponse, *http.Response, error)
DeleteAllKeys deletes all keys from the keychain
func (*WalletService) Do ¶
func (s *WalletService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
Do is just a shortcut to the client's Do method
func (*WalletService) GenerateMnemonic ¶ added in v0.0.20
func (s *WalletService) GenerateMnemonic() (*GenerateMnemonicResponse, *http.Response, error)
GenerateMnemonic Endpoint for generating a new random 24 words
func (*WalletService) GetHeightInfo ¶
func (s *WalletService) GetHeightInfo() (*GetWalletHeightInfoResponse, *http.Response, error)
GetHeightInfo wallet rpc -> get_height_info
func (*WalletService) GetNFTInfo ¶ added in v0.0.14
func (s *WalletService) GetNFTInfo(opts *GetNFTInfoOptions) (*GetNFTInfoResponse, *http.Response, error)
GetNFTInfo Get info about an NFT
func (*WalletService) GetNFTs ¶ added in v0.0.14
func (s *WalletService) GetNFTs(opts *GetNFTsOptions) (*GetNFTsResponse, *http.Response, error)
GetNFTs Show all NFTs in a given wallet
func (*WalletService) GetNetworkInfo ¶
func (s *WalletService) GetNetworkInfo() (*GetWalletNetworkInfoResponse, *http.Response, error)
GetNetworkInfo wallet rpc -> get_network_info
func (*WalletService) GetNextAddress ¶ added in v0.0.20
func (s *WalletService) GetNextAddress(options *GetNextAddressOptions) (*GetNextAddressResponse, *http.Response, error)
GetNextAddress returns the current address for the wallet. If NewAddress is true, it moves to the next address before responding
func (*WalletService) GetPublicKeys ¶ added in v0.0.20
func (s *WalletService) GetPublicKeys() (*GetPublicKeysResponse, *http.Response, error)
GetPublicKeys endpoint
func (*WalletService) GetSpendableCoins ¶ added in v0.0.20
func (s *WalletService) GetSpendableCoins(opts *GetSpendableCoinsOptions) (*GetSpendableCoinsResponse, *http.Response, error)
GetSpendableCoins returns information about the coins in the wallet
func (*WalletService) GetSyncStatus ¶
func (s *WalletService) GetSyncStatus() (*GetWalletSyncStatusResponse, *http.Response, error)
GetSyncStatus wallet rpc -> get_sync_status
func (*WalletService) GetTransaction ¶
func (s *WalletService) GetTransaction(opts *GetWalletTransactionOptions) (*GetWalletTransactionResponse, *http.Response, error)
GetTransaction returns a single transaction record
func (*WalletService) GetTransactionCount ¶
func (s *WalletService) GetTransactionCount(opts *GetWalletTransactionCountOptions) (*GetWalletTransactionCountResponse, *http.Response, error)
GetTransactionCount returns the total count of transactions for the specific wallet ID
func (*WalletService) GetTransactions ¶
func (s *WalletService) GetTransactions(opts *GetWalletTransactionsOptions) (*GetWalletTransactionsResponse, *http.Response, error)
GetTransactions wallet rpc -> get_transactions
func (*WalletService) GetWalletBalance ¶
func (s *WalletService) GetWalletBalance(opts *GetWalletBalanceOptions) (*GetWalletBalanceResponse, *http.Response, error)
GetWalletBalance returns wallet balance
func (*WalletService) GetWallets ¶
func (s *WalletService) GetWallets(opts *GetWalletsOptions) (*GetWalletsResponse, *http.Response, error)
GetWallets wallet rpc -> get_wallets
func (*WalletService) MintNFT ¶ added in v0.0.14
func (s *WalletService) MintNFT(opts *MintNFTOptions) (*MintNFTResponse, *http.Response, error)
MintNFT Mint a new NFT
func (*WalletService) NFTAddURI ¶ added in v0.0.14
func (s *WalletService) NFTAddURI(opts *NFTAddURIOptions) (*NFTAddURIResponse, *http.Response, error)
NFTAddURI Get info about an NFT
func (*WalletService) NewRequest ¶
func (s *WalletService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
NewRequest returns a new request specific to the wallet service
func (*WalletService) SendTransaction ¶
func (s *WalletService) SendTransaction(opts *SendTransactionOptions) (*SendTransactionResponse, *http.Response, error)
SendTransaction sends a transaction
func (*WalletService) SendTransactionMulti ¶ added in v0.0.20
func (s *WalletService) SendTransactionMulti(opts *CreateSignedTransactionOptions) (*SendTransactionMultiResponse, *http.Response, error)
SendTransactionMulti allows sending a more detailed transaction with multiple inputs/outputs. Options are the same as create signed transaction since this is ultimately just a wrapper around that in Chia
func (*WalletService) TransferNFT ¶ added in v0.0.14
func (s *WalletService) TransferNFT(opts *TransferNFTOptions) (*TransferNFTResponse, *http.Response, error)
TransferNFT Get info about an NFT