Documentation ¶
Index ¶
- func WithAutoConfig() rpcinterface.ConfigOptionFunc
- func WithBaseURL(url *url.URL) rpcinterface.ClientOptionFunc
- func WithCache(validTime time.Duration) rpcinterface.ClientOptionFunc
- func WithLogHandler(handler slog.Handler) rpcinterface.ClientOptionFunc
- func WithManualConfig(cfg config.ChiaConfig) rpcinterface.ConfigOptionFunc
- func WithSyncWebsocket() 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) (uuid.UUID, error)
- func (c *Client) AddReconnectHandler(onReconnect rpcinterface.ReconnectHandler)
- func (c *Client) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (c *Client) NewRequest(service rpcinterface.ServiceType, rpcEndpoint rpcinterface.Endpoint, ...) (*rpcinterface.Request, error)
- func (c *Client) RemoveHandler(handlerID uuid.UUID)
- func (c *Client) SetAsyncMode()
- func (c *Client) SetSyncMode()
- 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) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
- func (s *CrawlerService) GetPeerCounts() (*GetPeerCountsResponse, *http.Response, error)
- func (s *CrawlerService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
- func (s *CrawlerService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
- type CreateSignedTransactionOptions
- type CreateSignedTransactionResponse
- type DaemonDeleteAllKeysOpts
- type DaemonDeleteAllKeysResponse
- type DaemonService
- func (s *DaemonService) DeleteAllKeys(opts *DaemonDeleteAllKeysOpts) (*DaemonDeleteAllKeysResponse, *http.Response, error)
- func (s *DaemonService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (s *DaemonService) GetKeys(opts *GetKeysOptions) (*GetKeysResponse, *http.Response, error)
- func (s *DaemonService) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
- func (s *DaemonService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
- func (s *DaemonService) IsRunning(opts *IsRunningOptions) (*IsRunningResponse, *http.Response, error)
- func (s *DaemonService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
- func (s *DaemonService) StartService(opts *StartServiceOptions) (*StartServiceResponse, *http.Response, error)
- func (s *DaemonService) StopService(opts *StopServiceOptions) (*StopServiceResponse, *http.Response, error)
- type DataLayerService
- func (s *DataLayerService) AddMirror(opts *DatalayerAddMirrorOptions) (*DatalayerAddMirrorResponse, *http.Response, error)
- func (s *DataLayerService) DeleteMirror(opts *DatalayerDeleteMirrorOptions) (*DatalayerDeleteMirrorResponse, *http.Response, error)
- func (s *DataLayerService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (s *DataLayerService) GetMirrors(opts *DatalayerGetMirrorsOptions) (*DatalayerGetMirrorsResponse, *http.Response, error)
- func (s *DataLayerService) GetOwnedStores(opts *DatalayerGetOwnedStoresOptions) (*DatalayerGetOwnedStoresResponse, *http.Response, error)
- func (s *DataLayerService) GetSubscriptions(opts *DatalayerGetSubscriptionsOptions) (*DatalayerGetSubscriptionsResponse, *http.Response, error)
- func (s *DataLayerService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
- func (s *DataLayerService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
- func (s *DataLayerService) Subscriptions(opts *DatalayerGetSubscriptionsOptions) (*DatalayerGetSubscriptionsResponse, *http.Response, error)
- func (s *DataLayerService) Unsubscribe(opts *DatalayerUnsubscribeOptions) (*DatalayerUnsubscribeResponse, *http.Response, error)
- type DatalayerAddMirrorOptions
- type DatalayerAddMirrorResponse
- type DatalayerDeleteMirrorOptions
- type DatalayerDeleteMirrorResponse
- type DatalayerGetMirrorsOptions
- type DatalayerGetMirrorsResponse
- type DatalayerGetOwnedStoresOptions
- type DatalayerGetOwnedStoresResponse
- type DatalayerGetSubscriptionsOptions
- type DatalayerGetSubscriptionsResponse
- type DatalayerUnsubscribeOptions
- type DatalayerUnsubscribeResponse
- type DeleteAllKeysResponse
- type FarmerGetHarvestersOptions
- type FarmerGetHarvestersResponse
- type FarmerHarvester
- type FarmerService
- func (s *FarmerService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (s *FarmerService) GetConnections(opts *GetConnectionsOptions) (*GetConnectionsResponse, *http.Response, error)
- func (s *FarmerService) GetHarvesters(opts *FarmerGetHarvestersOptions) (*FarmerGetHarvestersResponse, *http.Response, error)
- func (s *FarmerService) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
- func (s *FarmerService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
- func (s *FarmerService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
- type FullNodePushTXOptions
- type FullNodePushTXResponse
- type FullNodeService
- func (s *FullNodeService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (s *FullNodeService) GetAdditionsAndRemovals(opts *GetAdditionsAndRemovalsOptions) (*GetAdditionsAndRemovalsResponse, *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) GetCoinRecordsByHint(opts *GetCoinRecordsByHintOptions) (*GetCoinRecordsByHintResponse, *http.Response, error)
- func (s *FullNodeService) GetCoinRecordsByPuzzleHash(opts *GetCoinRecordsByPuzzleHashOptions) (*GetCoinRecordsByPuzzleHashResponse, *http.Response, error)
- func (s *FullNodeService) GetCoinRecordsByPuzzleHashes(opts *GetCoinRecordsByPuzzleHashesOptions) (*GetCoinRecordsByPuzzleHashesResponse, *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) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
- func (s *FullNodeService) GetPuzzleAndSolution(opts *GetPuzzleAndSolutionOptions) (*GetPuzzleAndSolutionResponse, *http.Response, error)
- func (s *FullNodeService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *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 GetAdditionsAndRemovalsOptions
- type GetAdditionsAndRemovalsResponse
- type GetBlockByHeightOptions
- type GetBlockCountMetricsResponse
- type GetBlockOptions
- type GetBlockRecordResponse
- type GetBlockResponse
- type GetBlockchainStateResponse
- type GetBlocksOptions
- type GetBlocksResponse
- type GetCoinRecordByNameOptions
- type GetCoinRecordByNameResponse
- type GetCoinRecordsByHintOptions
- type GetCoinRecordsByHintResponse
- type GetCoinRecordsByPuzzleHashOptions
- type GetCoinRecordsByPuzzleHashResponse
- type GetCoinRecordsByPuzzleHashesOptions
- type GetCoinRecordsByPuzzleHashesResponse
- type GetConnectionsOptions
- type GetConnectionsResponse
- type GetFeeEstimateOptions
- type GetFeeEstimateResponse
- type GetIPsAfterTimestampOptions
- type GetIPsAfterTimestampResponse
- type GetKeysOptions
- type GetKeysResponse
- type GetNFTInfoOptions
- type GetNFTInfoResponse
- type GetNFTsOptions
- type GetNFTsResponse
- type GetNetworkInfoOptions
- type GetNetworkInfoResponse
- type GetNextAddressOptions
- type GetNextAddressResponse
- type GetPeerCountsResponse
- type GetPublicKeysResponse
- type GetPuzzleAndSolutionOptions
- type GetPuzzleAndSolutionResponse
- type GetSpendableCoinsOptions
- type GetSpendableCoinsResponse
- type GetVersionOptions
- type GetVersionResponse
- type GetWalletBalanceOptions
- type GetWalletBalanceResponse
- type GetWalletHeightInfoResponse
- 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) GetConnections(opts *GetConnectionsOptions) (*GetConnectionsResponse, *http.Response, error)
- func (s *HarvesterService) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
- func (s *HarvesterService) GetPlots() (*HarvesterGetPlotsResponse, *http.Response, error)
- func (s *HarvesterService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
- func (s *HarvesterService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
- type IsRunningOptions
- type IsRunningResponse
- type MintNFTOptions
- type MintNFTResponse
- type NFTAddURIOptions
- type NFTAddURIResponse
- type NFTGetByDidOptions
- type NFTGetByDidResponse
- type Response
- type SendTransactionMultiResponse
- type SendTransactionOptions
- type SendTransactionResponse
- type ServiceFullName
- type StartServiceOptions
- type StartServiceResponse
- type StopServiceOptions
- type StopServiceResponse
- type TimelordService
- func (s *TimelordService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (s *TimelordService) GetConnections(opts *GetConnectionsOptions) (*GetConnectionsResponse, *http.Response, error)
- func (s *TimelordService) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
- func (s *TimelordService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
- func (s *TimelordService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
- 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) GetConnections(opts *GetConnectionsOptions) (*GetConnectionsResponse, *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(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *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) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *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) NFTGetByDid(opts *NFTGetByDidOptions) (*NFTGetByDidResponse, *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)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAutoConfig ¶ added in v0.2.0
func WithAutoConfig() rpcinterface.ConfigOptionFunc
WithAutoConfig automatically loads chia config from CHIA_ROOT
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 WithLogHandler ¶ added in v0.7.0
func WithLogHandler(handler slog.Handler) rpcinterface.ClientOptionFunc
WithLogHandler sets a slog compatible log handler to be used for logging
func WithManualConfig ¶ added in v0.2.0
func WithManualConfig(cfg config.ChiaConfig) rpcinterface.ConfigOptionFunc
WithManualConfig allows supplying a manual configuration for the RPC client
func WithSyncWebsocket ¶ added in v0.7.0
func WithSyncWebsocket() rpcinterface.ClientOptionFunc
WithSyncWebsocket is a helper to making the client and calling SetSyncMode to set the client to sync mode by default
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 { Response Word mo.Option[string] `json:"word,omitempty"` // This is part of a unique error response Fingerprint mo.Option[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 { Response TransactionID mo.Option[string] `json:"transaction_id"` Transaction mo.Option[types.TransactionRecord] `json:"transaction"` }
CatSpendResponse represents the response from cat_spend
type Client ¶
type Client struct { // Services for the different chia services DaemonService *DaemonService FullNodeService *FullNodeService WalletService *WalletService FarmerService *FarmerService HarvesterService *HarvesterService CrawlerService *CrawlerService DataLayerService *DataLayerService TimelordService *TimelordService // contains filtered or unexported fields }
Client is the RPC client
func NewClient ¶
func NewClient(connectionMode ConnectionMode, configOption rpcinterface.ConfigOptionFunc, options ...rpcinterface.ClientOptionFunc) (*Client, error)
NewClient returns a new RPC Client
Example ¶
package main import ( "bytes" "crypto/rand" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "fmt" "math/big" "net" "net/http" "net/http/httptest" "net/url" "os" "strconv" "testing" "time" "github.com/chia-network/go-chia-libs/pkg/config" "github.com/chia-network/go-chia-libs/pkg/types" "github.com/stretchr/testify/require" ) var ( tmpDir string crtFilename = "host.crt" keyFilename = "host.key" ) func setup(t *testing.T) (*http.ServeMux, *httptest.Server, *Client) { mux := http.NewServeMux() server := httptest.NewTLSServer(mux) // Get port from server u, err := url.Parse(server.URL) if err != nil { t.Fatal(err) } p, err := strconv.ParseUint(u.Port(), 10, 16) if err != nil { t.Fatal(err) } // Get temp directory used for this test back tmpDir, err = generateSSLFiles() if err != nil { t.Fatal(err) } // Set port config to the port of this test server portConf := config.PortConfig{ RPCPort: uint16(p), } // Set SSL config for the fake cert and key we just made sslConf := config.SSLConfig{ PrivateCRT: crtFilename, PrivateKey: keyFilename, } client, err := NewClient(ConnectionModeHTTP, WithManualConfig(config.ChiaConfig{ ChiaRoot: tmpDir, DaemonPort: portConf.RPCPort, DaemonSSL: sslConf, Farmer: config.FarmerConfig{ PortConfig: portConf, SSL: sslConf, }, FullNode: config.FullNodeConfig{ PortConfig: portConf, SSL: sslConf, }, Harvester: config.HarvesterConfig{ PortConfig: portConf, SSL: sslConf, }, Wallet: config.WalletConfig{ PortConfig: portConf, SSL: sslConf, }, Seeder: config.SeederConfig{ CrawlerConfig: config.CrawlerConfig{ PortConfig: portConf, SSL: sslConf, }, }, DataLayer: config.DataLayerConfig{ PortConfig: portConf, SSL: sslConf, }, })) if err != nil { t.Fatal(err) } return mux, server, client } func generateSSLFiles() (string, error) { dir, err := os.MkdirTemp("", "*-chia") if err != nil { return "", err } key, crt, err := generateSSL() if err != nil { return dir, err } err = os.WriteFile(fmt.Sprintf("%s/%s", dir, keyFilename), key.Bytes(), 0755) if err != nil { return dir, err } err = os.WriteFile(fmt.Sprintf("%s/%s", dir, crtFilename), crt.Bytes(), 0755) if err != nil { return dir, err } return dir, nil } func generateSSL() (*bytes.Buffer, *bytes.Buffer, error) { crtTemplate := &x509.Certificate{ SerialNumber: big.NewInt(2019), Subject: pkix.Name{ Organization: []string{"Testing, Inc."}, Country: []string{"US"}, Province: []string{"Missouri"}, Locality: []string{"St Louis"}, StreetAddress: []string{"111 St Louis St"}, PostalCode: []string{"69420"}, }, IPAddresses: []net.IP{net.IPv4(127, 0, 0, 1), net.IPv6loopback}, NotBefore: time.Now(), NotAfter: time.Now().AddDate(10, 0, 0), SubjectKeyId: []byte{1, 2, 3, 4, 6}, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, KeyUsage: x509.KeyUsageDigitalSignature, } key, err := rsa.GenerateKey(rand.Reader, 4096) if err != nil { return nil, nil, err } keyPEM := new(bytes.Buffer) err = pem.Encode(keyPEM, &pem.Block{ Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(key), }) if err != nil { return nil, nil, err } crt, err := x509.CreateCertificate(rand.Reader, crtTemplate, crtTemplate, &key.PublicKey, key) if err != nil { return nil, nil, err } crtPEM := new(bytes.Buffer) err = pem.Encode(crtPEM, &pem.Block{ Type: "CERTIFICATE", Bytes: crt, }) if err != nil { return nil, nil, err } return keyPEM, crtPEM, nil } func teardown(server *httptest.Server) { server.Close() err := os.RemoveAll(tmpDir) if err != nil { panic(err) } } func fixture(path string) string { b, err := os.ReadFile("testdata/" + path) if err != nil { panic(err) } return string(b) } func getBytesFromHexString(t *testing.T, hex string) types.Bytes { b, err := types.BytesFromHexString(hex) require.NoError(t, err) return b } func getBytes32FromHexString(t *testing.T, hex string) types.Bytes32 { b, err := types.Bytes32FromHexString(hex) require.NoError(t, err) return b } func main() { client, err := NewClient(ConnectionModeHTTP, WithAutoConfig()) if err != nil { panic(err) } state, _, err := client.FullNodeService.GetBlockchainState() if err != nil { panic(err) } if state.BlockchainState.IsPresent() { fmt.Println(state.BlockchainState.MustGet().Space) } }
Output:
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) (uuid.UUID, 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) 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) RemoveHandler ¶ added in v0.7.0
RemoveHandler removes the handler from the list of active response handlers
func (*Client) SetAsyncMode ¶ added in v0.7.0
func (c *Client) SetAsyncMode()
SetAsyncMode sets the client to async mode This does not apply to the HTTP client For the websocket client, this is the default mode and means that RPC function calls return immediate with empty versions of the structs that would otherwise contain the response, and you should have an async handler defined to receive the response
func (*Client) SetSyncMode ¶ added in v0.7.0
func (c *Client) SetSyncMode()
SetSyncMode sets the client to wait for responses before returning This is default (and only option) for HTTP client Websocket client defaults to async mode
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) GetNetworkInfo ¶ added in v0.6.0
func (s *CrawlerService) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
GetNetworkInfo gets the network name and prefix from the full node
func (*CrawlerService) GetPeerCounts ¶
func (s *CrawlerService) GetPeerCounts() (*GetPeerCountsResponse, *http.Response, error)
GetPeerCounts crawler rpc -> get_peer_counts
func (*CrawlerService) GetVersion ¶ added in v0.8.5
func (s *CrawlerService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
GetVersion returns the application version for the service
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 { Response SignedTXs mo.Option[[]types.TransactionRecord] `json:"signed_txs"` SignedTX mo.Option[types.TransactionRecord] `json:"signed_tx"` }
CreateSignedTransactionResponse Response from create_signed_transaction
type DaemonDeleteAllKeysOpts ¶ added in v0.9.1
type DaemonDeleteAllKeysOpts struct{}
DaemonDeleteAllKeysOpts options for delete all keys request
type DaemonDeleteAllKeysResponse ¶ added in v0.9.1
type DaemonDeleteAllKeysResponse struct {
Response
}
DaemonDeleteAllKeysResponse response when deleting all keys
type DaemonService ¶ added in v0.7.0
type DaemonService struct {
// contains filtered or unexported fields
}
DaemonService encapsulates direct daemon RPC methods
func (*DaemonService) DeleteAllKeys ¶ added in v0.9.1
func (s *DaemonService) DeleteAllKeys(opts *DaemonDeleteAllKeysOpts) (*DaemonDeleteAllKeysResponse, *http.Response, error)
DeleteAllKeys deletes all keys from the keychain
func (*DaemonService) Do ¶ added in v0.7.0
func (s *DaemonService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
Do is just a shortcut to the client's Do method
func (*DaemonService) GetKeys ¶ added in v0.7.1
func (s *DaemonService) GetKeys(opts *GetKeysOptions) (*GetKeysResponse, *http.Response, error)
GetKeys returns key information
func (*DaemonService) GetNetworkInfo ¶ added in v0.7.0
func (s *DaemonService) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
GetNetworkInfo gets the network name and prefix from the full node
func (*DaemonService) GetVersion ¶ added in v0.8.5
func (s *DaemonService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
GetVersion returns the application version for the service
func (*DaemonService) IsRunning ¶ added in v0.9.0
func (s *DaemonService) IsRunning(opts *IsRunningOptions) (*IsRunningResponse, *http.Response, error)
IsRunning returns whether a service is running
func (*DaemonService) NewRequest ¶ added in v0.7.0
func (s *DaemonService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
NewRequest returns a new request specific to the crawler service
func (*DaemonService) StartService ¶ added in v0.9.0
func (s *DaemonService) StartService(opts *StartServiceOptions) (*StartServiceResponse, *http.Response, error)
StartService starts the given service
func (*DaemonService) StopService ¶ added in v0.9.0
func (s *DaemonService) StopService(opts *StopServiceOptions) (*StopServiceResponse, *http.Response, error)
StopService stops the given service
type DataLayerService ¶ added in v0.4.0
type DataLayerService struct {
// contains filtered or unexported fields
}
DataLayerService encapsulates data layer RPC methods
func (*DataLayerService) AddMirror ¶ added in v0.8.6
func (s *DataLayerService) AddMirror(opts *DatalayerAddMirrorOptions) (*DatalayerAddMirrorResponse, *http.Response, error)
AddMirror deletes a datalayer mirror
func (*DataLayerService) DeleteMirror ¶ added in v0.8.6
func (s *DataLayerService) DeleteMirror(opts *DatalayerDeleteMirrorOptions) (*DatalayerDeleteMirrorResponse, *http.Response, error)
DeleteMirror deletes a datalayer mirror
func (*DataLayerService) Do ¶ added in v0.4.0
func (s *DataLayerService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
Do is just a shortcut to the client's Do method
func (*DataLayerService) GetMirrors ¶ added in v0.8.6
func (s *DataLayerService) GetMirrors(opts *DatalayerGetMirrorsOptions) (*DatalayerGetMirrorsResponse, *http.Response, error)
GetMirrors lists the mirrors for the given datalayer store
func (*DataLayerService) GetOwnedStores ¶ added in v0.8.6
func (s *DataLayerService) GetOwnedStores(opts *DatalayerGetOwnedStoresOptions) (*DatalayerGetOwnedStoresResponse, *http.Response, error)
GetOwnedStores RPC endpoint get_owned_stores
func (*DataLayerService) GetSubscriptions ¶ added in v0.8.6
func (s *DataLayerService) GetSubscriptions(opts *DatalayerGetSubscriptionsOptions) (*DatalayerGetSubscriptionsResponse, *http.Response, error)
GetSubscriptions is just an alias for Subscriptions, since the CLI command is get_subscriptions Makes this easier to find
func (*DataLayerService) GetVersion ¶ added in v0.8.5
func (s *DataLayerService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
GetVersion returns the application version for the service
func (*DataLayerService) NewRequest ¶ added in v0.4.0
func (s *DataLayerService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
NewRequest returns a new request specific to the wallet service
func (*DataLayerService) Subscriptions ¶ added in v0.8.6
func (s *DataLayerService) Subscriptions(opts *DatalayerGetSubscriptionsOptions) (*DatalayerGetSubscriptionsResponse, *http.Response, error)
Subscriptions calls the subscriptions endpoint to list all subscriptions
func (*DataLayerService) Unsubscribe ¶ added in v0.8.6
func (s *DataLayerService) Unsubscribe(opts *DatalayerUnsubscribeOptions) (*DatalayerUnsubscribeResponse, *http.Response, error)
Unsubscribe deletes a datalayer mirror
type DatalayerAddMirrorOptions ¶ added in v0.8.6
type DatalayerAddMirrorOptions struct { ID string `json:"id"` // hex string datastore ID URLs []string `json:"urls"` Amount uint64 `json:"amount"` Fee uint64 `json:"fee"` }
DatalayerAddMirrorOptions options for delete_mirror RPC call
type DatalayerAddMirrorResponse ¶ added in v0.8.6
type DatalayerAddMirrorResponse struct {
Response
}
DatalayerAddMirrorResponse response data for add_mirror
type DatalayerDeleteMirrorOptions ¶ added in v0.8.6
type DatalayerDeleteMirrorOptions struct { CoinID string `json:"coin_id"` // hex string Fee uint64 `json:"fee"` // not required }
DatalayerDeleteMirrorOptions options for delete_mirror RPC call
type DatalayerDeleteMirrorResponse ¶ added in v0.8.6
type DatalayerDeleteMirrorResponse struct {
Response
}
DatalayerDeleteMirrorResponse response data for delete_mirror
type DatalayerGetMirrorsOptions ¶ added in v0.8.6
type DatalayerGetMirrorsOptions struct {
ID string `json:"id"` // Hex String
}
DatalayerGetMirrorsOptions Options for get_mirrors
type DatalayerGetMirrorsResponse ¶ added in v0.8.6
type DatalayerGetMirrorsResponse struct { Response Mirrors []types.DatalayerMirror `json:"mirrors"` }
DatalayerGetMirrorsResponse Response from the get_mirrors RPC
type DatalayerGetOwnedStoresOptions ¶ added in v0.8.6
type DatalayerGetOwnedStoresOptions struct{}
DatalayerGetOwnedStoresOptions Options for get_owned_stores
type DatalayerGetOwnedStoresResponse ¶ added in v0.8.6
DatalayerGetOwnedStoresResponse Response for get_owned_stores
type DatalayerGetSubscriptionsOptions ¶ added in v0.8.6
type DatalayerGetSubscriptionsOptions struct{}
DatalayerGetSubscriptionsOptions options for get_subscriptions
type DatalayerGetSubscriptionsResponse ¶ added in v0.8.6
DatalayerGetSubscriptionsResponse response for get_subscriptions
type DatalayerUnsubscribeOptions ¶ added in v0.8.6
type DatalayerUnsubscribeOptions struct { ID string `json:"id"` // hex string datastore id RetainData bool `json:"retain"` }
DatalayerUnsubscribeOptions options for unsubscribing to a datastore
type DatalayerUnsubscribeResponse ¶ added in v0.8.6
type DatalayerUnsubscribeResponse struct {
Response
}
DatalayerUnsubscribeResponse response data for unsubscribe
type DeleteAllKeysResponse ¶ added in v0.0.22
type DeleteAllKeysResponse struct {
Response
}
DeleteAllKeysResponse Delete keys response
type FarmerGetHarvestersOptions ¶ added in v0.5.0
type FarmerGetHarvestersOptions struct{}
FarmerGetHarvestersOptions optoins for get_harvesters endpoint. Currently, accepts no options
type FarmerGetHarvestersResponse ¶ added in v0.5.0
type FarmerGetHarvestersResponse struct { Response Harvesters []FarmerHarvester `json:"harvesters"` }
FarmerGetHarvestersResponse get_harvesters response format
type FarmerHarvester ¶ added in v0.5.0
type FarmerHarvester struct { Connection struct { NodeID types.Bytes32 `json:"node_id"` Host string `json:"host"` Port uint16 `json:"port"` } `json:"connection"` Plots []protocols.Plot `json:"plots"` FailedToOpenFilenames []string `json:"failed_to_open_filenames"` NoKeyFilenames []string `json:"no_key_filenames"` Duplicates []string `json:"duplicates"` TotalPlotSize int `json:"total_plot_size"` TotalEffectivePlotSize int `json:"total_effective_plot_size"` Syncing mo.Option[struct { Initial bool `json:"initial"` PlotFilesProcessed uint32 `json:"plot_files_processed"` PlotFilesTotal uint32 `json:"plot_files_total"` }] `json:"syncing"` LastSyncTime types.Timestamp `json:"last_sync_time"` HarvestingMode mo.Option[types.HarvestingMode] `json:"harvesting_mode"` }
FarmerHarvester is a single harvester record returned by the farmer's get_harvesters endpoint
type FarmerService ¶ added in v0.2.1
type FarmerService struct {
// contains filtered or unexported fields
}
FarmerService encapsulates farmer RPC methods
func (*FarmerService) Do ¶ added in v0.2.1
func (s *FarmerService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
Do is just a shortcut to the client's Do method
func (*FarmerService) GetConnections ¶ added in v0.2.1
func (s *FarmerService) GetConnections(opts *GetConnectionsOptions) (*GetConnectionsResponse, *http.Response, error)
GetConnections returns connections
func (*FarmerService) GetHarvesters ¶ added in v0.5.0
func (s *FarmerService) GetHarvesters(opts *FarmerGetHarvestersOptions) (*FarmerGetHarvestersResponse, *http.Response, error)
GetHarvesters returns all harvester details for the farmer
func (*FarmerService) GetNetworkInfo ¶ added in v0.7.0
func (s *FarmerService) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
GetNetworkInfo gets the network name and prefix from the farmer
func (*FarmerService) GetVersion ¶ added in v0.8.5
func (s *FarmerService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
GetVersion returns the application version for the service
func (*FarmerService) NewRequest ¶ added in v0.2.1
func (s *FarmerService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
NewRequest returns a new request specific to the wallet service
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
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) GetAdditionsAndRemovals ¶ added in v0.2.2
func (s *FullNodeService) GetAdditionsAndRemovals(opts *GetAdditionsAndRemovalsOptions) (*GetAdditionsAndRemovalsResponse, *http.Response, error)
GetAdditionsAndRemovals Gets additions and removals for a particular block hash
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) GetCoinRecordsByHint ¶ added in v0.3.0
func (s *FullNodeService) GetCoinRecordsByHint(opts *GetCoinRecordsByHintOptions) (*GetCoinRecordsByHintResponse, *http.Response, error)
GetCoinRecordsByHint returns coin records for a specified puzzle hash
func (*FullNodeService) GetCoinRecordsByPuzzleHash ¶ added in v0.2.2
func (s *FullNodeService) GetCoinRecordsByPuzzleHash(opts *GetCoinRecordsByPuzzleHashOptions) (*GetCoinRecordsByPuzzleHashResponse, *http.Response, error)
GetCoinRecordsByPuzzleHash returns coin records for a specified puzzle hash
func (*FullNodeService) GetCoinRecordsByPuzzleHashes ¶ added in v0.2.2
func (s *FullNodeService) GetCoinRecordsByPuzzleHashes(opts *GetCoinRecordsByPuzzleHashesOptions) (*GetCoinRecordsByPuzzleHashesResponse, *http.Response, error)
GetCoinRecordsByPuzzleHashes returns coin records for a specified list of puzzle hashes
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) GetNetworkInfo ¶ added in v0.6.0
func (s *FullNodeService) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
GetNetworkInfo gets the network name and prefix from the full node
func (*FullNodeService) GetPuzzleAndSolution ¶ added in v0.1.0
func (s *FullNodeService) GetPuzzleAndSolution(opts *GetPuzzleAndSolutionOptions) (*GetPuzzleAndSolutionResponse, *http.Response, error)
GetPuzzleAndSolution full_node-> get_puzzle_and_solution RPC method
func (*FullNodeService) GetVersion ¶ added in v0.8.5
func (s *FullNodeService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
GetVersion returns the application version for the service
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
GenerateMnemonicResponse Random new 24 words response
type GetAdditionsAndRemovalsOptions ¶ added in v0.2.2
GetAdditionsAndRemovalsOptions options for get_additions_and_removals
type GetAdditionsAndRemovalsResponse ¶ added in v0.2.2
type GetAdditionsAndRemovalsResponse struct { Response Additions []types.CoinRecord `json:"additions"` Removals []types.CoinRecord `json:"removals"` }
GetAdditionsAndRemovalsResponse response for get_additions_and_removals
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 { Response Metrics mo.Option[types.BlockCountMetrics] `json:"metrics"` }
GetBlockCountMetricsResponse response for get_block_count_metrics rpc call
type GetBlockOptions ¶
GetBlockOptions options for get_block rpc call
type GetBlockRecordResponse ¶
type GetBlockRecordResponse struct { Response BlockRecord mo.Option[types.BlockRecord] `json:"block_record"` }
GetBlockRecordResponse response from get_block_record_by_height
type GetBlockResponse ¶
GetBlockResponse response for get_block rpc call
type GetBlockchainStateResponse ¶
type GetBlockchainStateResponse struct { Response BlockchainState mo.Option[types.BlockchainState] `json:"blockchain_state,omitempty"` }
GetBlockchainStateResponse is the blockchain state RPC response
type GetBlocksOptions ¶
type GetBlocksOptions struct { Start int `json:"start"` End int `json:"end"` // ExcludeHeaderHash if set to true, omits the `header_hash` key from the response ExcludeHeaderHash bool `json:"exclude_header_hash"` // ExcludeReorged if set to true, excludes reorged blocks from the response ExcludeReorged bool `json:"exclude_reorged"` }
GetBlocksOptions options for get_blocks rpc call
type GetBlocksResponse ¶
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 { Response CoinRecord mo.Option[types.CoinRecord] `json:"coin_record"` }
GetCoinRecordByNameResponse response from get_coin_record_by_name endpoint
type GetCoinRecordsByHintOptions ¶ added in v0.3.0
type GetCoinRecordsByHintOptions struct { Hint types.Bytes32 `json:"hint"` IncludeSpentCoins bool `json:"include_spent_coins"` StartHeight uint32 `json:"start_height,omitempty"` EndHeight uint32 `json:"end_height,omitempty"` }
GetCoinRecordsByHintOptions options for get_coin_records_by_hint
type GetCoinRecordsByHintResponse ¶ added in v0.3.0
type GetCoinRecordsByHintResponse struct { Response CoinRecords []types.CoinRecord `json:"coin_records"` }
GetCoinRecordsByHintResponse Response for /get_coin_records_by_hint
type GetCoinRecordsByPuzzleHashOptions ¶ added in v0.2.2
type GetCoinRecordsByPuzzleHashOptions struct { PuzzleHash types.Bytes32 `json:"puzzle_hash"` IncludeSpentCoins bool `json:"include_spent_coins"` StartHeight uint32 `json:"start_height,omitempty"` EndHeight uint32 `json:"end_height,omitempty"` }
GetCoinRecordsByPuzzleHashOptions request options for /get_coin_records_by_puzzle_hash
type GetCoinRecordsByPuzzleHashResponse ¶ added in v0.2.2
type GetCoinRecordsByPuzzleHashResponse struct { Response CoinRecords []types.CoinRecord `json:"coin_records"` }
GetCoinRecordsByPuzzleHashResponse Response for /get_coin_records_by_puzzle_hash
type GetCoinRecordsByPuzzleHashesOptions ¶ added in v0.2.2
type GetCoinRecordsByPuzzleHashesOptions struct { PuzzleHash []types.Bytes32 `json:"puzzle_hashes"` IncludeSpentCoins bool `json:"include_spent_coins"` StartHeight uint32 `json:"start_height,omitempty"` EndHeight uint32 `json:"end_height,omitempty"` }
GetCoinRecordsByPuzzleHashesOptions request options for /get_coin_records_by_puzzle_hash
type GetCoinRecordsByPuzzleHashesResponse ¶ added in v0.2.2
type GetCoinRecordsByPuzzleHashesResponse struct { Response CoinRecords []types.CoinRecord `json:"coin_records"` }
GetCoinRecordsByPuzzleHashesResponse Response for /get_coin_records_by_puzzle_hashes
type GetConnectionsOptions ¶
GetConnectionsOptions options to filter get_connections
type GetConnectionsResponse ¶
type GetConnectionsResponse struct { Response Connections mo.Option[[]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 { Response Estimates mo.Option[[]float64] `json:"estimates"` TargetTimes mo.Option[[]uint64] `json:"target_times"` CurrentFeeRate mo.Option[float64] `json:"current_fee_rate"` MempoolSize mo.Option[uint64] `json:"mempool_size"` MempoolMaxSize mo.Option[uint64] `json:"mempool_max_size"` FullNodeSynced mo.Option[bool] `json:"full_node_synced"` PeakHeight mo.Option[uint32] `json:"peak_height"` LastPeakTimestamp mo.Option[uint64] `json:"last_peak_timestamp"` NodeTimeUTC mo.Option[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 { Response IPs mo.Option[[]string] `json:"ips"` Total mo.Option[int] `json:"total"` }
GetIPsAfterTimestampResponse Response for get_ips_after_timestamp
type GetKeysOptions ¶ added in v0.7.1
type GetKeysOptions struct {
IncludeSecrets bool `json:"include_secrets"`
}
GetKeysOptions configures how keys are returned in get_keys
type GetKeysResponse ¶ added in v0.7.1
GetKeysResponse response from get_keys RPC call
type GetNFTInfoOptions ¶ added in v0.0.14
GetNFTInfoOptions represents the options for nft_get_info
type GetNFTInfoResponse ¶ added in v0.0.14
GetNFTInfoResponse represents the response from nft_get_info
type GetNFTsOptions ¶ added in v0.0.14
type GetNFTsOptions struct { WalletID uint32 `json:"wallet_id"` StartIndex mo.Option[int] `json:"start_index"` Num mo.Option[int] `json:"num"` }
GetNFTsOptions represents the options for nft_get_nfts
type GetNFTsResponse ¶ added in v0.0.14
type GetNFTsResponse struct { Response WalletID mo.Option[uint32] `json:"wallet_id"` NFTList mo.Option[[]types.NFTInfo] `json:"nft_list"` }
GetNFTsResponse represents the response from nft_get_nfts
type GetNetworkInfoOptions ¶ added in v0.6.0
type GetNetworkInfoOptions struct{}
GetNetworkInfoOptions options for the get_network_info rpc calls
type GetNetworkInfoResponse ¶ added in v0.6.0
type GetNetworkInfoResponse struct { Response NetworkName mo.Option[string] `json:"network_name"` NetworkPrefix mo.Option[string] `json:"network_prefix"` }
GetNetworkInfoResponse common get_network_info response from all RPC services
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 { Response WalletID mo.Option[uint32] `json:"wallet_id"` Address mo.Option[string] `json:"address"` }
GetNextAddressResponse response from get next address
type GetPeerCountsResponse ¶
type GetPeerCountsResponse struct { Response PeerCounts mo.Option[types.CrawlerPeerCounts] `json:"peer_counts"` }
GetPeerCountsResponse Response for get_get_peer_counts on crawler
type GetPublicKeysResponse ¶ added in v0.0.20
type GetPublicKeysResponse struct { Response PublicKeyFingerprints mo.Option[[]int] `json:"public_key_fingerprints"` }
GetPublicKeysResponse response from get_public_keys
type GetPuzzleAndSolutionOptions ¶ added in v0.1.0
type GetPuzzleAndSolutionOptions struct { CoinID types.Bytes32 `json:"coin_id"` Height uint32 `json:"height"` }
GetPuzzleAndSolutionOptions options for get_puzzle_and_solution rpc call
type GetPuzzleAndSolutionResponse ¶ added in v0.1.0
type GetPuzzleAndSolutionResponse struct { Response CoinSolution mo.Option[types.CoinSpend] `json:"coin_solution"` }
GetPuzzleAndSolutionResponse response from get_puzzle_and_solution
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 { Response ConfirmedRecords mo.Option[[]types.CoinRecord] `json:"confirmed_records"` UnconfirmedRemovals mo.Option[[]types.CoinRecord] `json:"unconfirmed_removals"` UnconfirmedAdditions mo.Option[[]types.CoinRecord] `json:"unconfirmed_additions"` }
GetSpendableCoinsResponse response from get_spendable_coins
type GetVersionOptions ¶ added in v0.8.5
type GetVersionOptions struct{}
GetVersionOptions options for the get_version rpc calls
type GetVersionResponse ¶ added in v0.8.5
GetVersionResponse is the response of get_version from all RPC services
type GetWalletBalanceOptions ¶
type GetWalletBalanceOptions struct {
WalletID uint32 `json:"wallet_id"`
}
GetWalletBalanceOptions request options for get_wallet_balance
type GetWalletBalanceResponse ¶
type GetWalletBalanceResponse struct { Response Balance mo.Option[types.WalletBalance] `json:"wallet_balance"` }
GetWalletBalanceResponse is the wallet balance RPC response
type GetWalletHeightInfoResponse ¶
GetWalletHeightInfoResponse response for get_height_info on wallet
type GetWalletSyncStatusResponse ¶
type GetWalletSyncStatusResponse struct { Response GenesisInitialized mo.Option[bool] `json:"genesis_initialized"` Synced mo.Option[bool] `json:"synced"` Syncing mo.Option[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 { Response WalletID mo.Option[uint32] `json:"wallet_id"` Count mo.Option[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 { Response Transaction mo.Option[types.TransactionRecord] `json:"transaction"` TransactionID mo.Option[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 { Response WalletID mo.Option[uint32] `json:"wallet_id"` Transactions mo.Option[[]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 { Response Fingerprint mo.Option[int] `json:"fingerprint"` Wallets mo.Option[[]types.WalletInfo] `json:"wallets"` }
GetWalletsResponse wallet rpc -> get_wallets
type HarvesterGetPlotsResponse ¶ added in v0.0.6
type HarvesterGetPlotsResponse struct { Response Plots mo.Option[[]protocols.Plot] `json:"plots"` FailedToOpenFilenames mo.Option[[]string] `json:"failed_to_open_filenames"` NotFoundFilenames mo.Option[[]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) GetConnections ¶ added in v0.2.1
func (s *HarvesterService) GetConnections(opts *GetConnectionsOptions) (*GetConnectionsResponse, *http.Response, error)
GetConnections returns connections
func (*HarvesterService) GetNetworkInfo ¶ added in v0.7.0
func (s *HarvesterService) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
GetNetworkInfo gets the network name and prefix from the harvester
func (*HarvesterService) GetPlots ¶ added in v0.0.6
func (s *HarvesterService) GetPlots() (*HarvesterGetPlotsResponse, *http.Response, error)
GetPlots returns connections
func (*HarvesterService) GetVersion ¶ added in v0.8.5
func (s *HarvesterService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
GetVersion returns the application version for the service
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 IsRunningOptions ¶ added in v0.9.0
type IsRunningOptions struct {
Service ServiceFullName `json:"service"`
}
IsRunningOptions is service running options
type IsRunningResponse ¶ added in v0.9.0
type IsRunningResponse struct { Response ServiceName ServiceFullName `json:"service_name"` IsRunning bool `json:"is_running"` }
IsRunningResponse is service running response
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 { Response SpendBundle mo.Option[types.SpendBundle] `json:"spend_bundle"` WalletID mo.Option[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 { Response SpendBundle mo.Option[types.SpendBundle] `json:"spend_bundle"` WalletID mo.Option[uint32] `json:"wallet_id"` }
NFTAddURIResponse represents the response from nft_add_uri
type NFTGetByDidOptions ¶ added in v0.1.0
NFTGetByDidOptions represents the options for nft_get_by_did
type NFTGetByDidResponse ¶ added in v0.1.0
NFTGetByDidResponse represents the response from nft_get_by_did
type Response ¶ added in v0.1.1
type Response struct { Success bool `json:"success"` Error mo.Option[string] `json:"error,omitempty"` }
Response is the base response elements that may be in any response from an RPC server in Chia
type SendTransactionMultiResponse ¶ added in v0.0.20
type SendTransactionMultiResponse struct { Response Transaction mo.Option[types.TransactionRecord] `json:"transaction"` TransactionID mo.Option[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 []types.Bytes `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 { Response TransactionID mo.Option[string] `json:"transaction_id"` Transaction mo.Option[types.TransactionRecord] `json:"transaction"` }
SendTransactionResponse represents the response from send_transaction
type ServiceFullName ¶ added in v0.9.0
type ServiceFullName string
ServiceFullName are the full names to services that things like the daemon will recognize
const ( // ServiceFullNameDaemon name of the daemon service ServiceFullNameDaemon ServiceFullName = "daemon" // ServiceFullNameDataLayer name of the data layer service ServiceFullNameDataLayer ServiceFullName = "chia_data_layer" // ServiceFullNameDataLayerHTTP name of data layer http service ServiceFullNameDataLayerHTTP ServiceFullName = "chia_data_layer_http" // ServiceFullNameWallet name of the wallet service ServiceFullNameWallet ServiceFullName = "chia_wallet" // ServiceFullNameNode name of the full node service ServiceFullNameNode ServiceFullName = "chia_full_node" // ServiceFullNameHarvester name of the harvester service ServiceFullNameHarvester ServiceFullName = "chia_harvester" // ServiceFullNameFarmer name of the farmer service ServiceFullNameFarmer ServiceFullName = "chia_farmer" // ServiceFullNameIntroducer name of the introducer service ServiceFullNameIntroducer ServiceFullName = "chia_introducer" // ServiceFullNameTimelord name of the timelord service ServiceFullNameTimelord ServiceFullName = "chia_timelord" // ServiceFullNameTimelordLauncher name of the timelord launcher service ServiceFullNameTimelordLauncher ServiceFullName = "chia_timelord_launcher" // ServiceFullNameSimulator name of the simulator service ServiceFullNameSimulator ServiceFullName = "chia_full_node_simulator" // ServiceFullNameSeeder name of the seeder service ServiceFullNameSeeder ServiceFullName = "chia_seeder" // ServiceFullNameCrawler name of the crawler service ServiceFullNameCrawler ServiceFullName = "chia_crawler" )
type StartServiceOptions ¶ added in v0.9.0
type StartServiceOptions struct {
Service ServiceFullName `json:"service"`
}
StartServiceOptions start service options
type StartServiceResponse ¶ added in v0.9.0
type StartServiceResponse struct { Response Service ServiceFullName `json:"service"` }
StartServiceResponse start service response
type StopServiceOptions ¶ added in v0.9.0
type StopServiceOptions struct {
Service ServiceFullName `json:"service"`
}
StopServiceOptions start service options
type StopServiceResponse ¶ added in v0.9.0
type StopServiceResponse struct { Response Service ServiceFullName `json:"service"` }
StopServiceResponse stop service response
type TimelordService ¶ added in v0.7.0
type TimelordService struct {
// contains filtered or unexported fields
}
TimelordService encapsulates timelord RPC methods
func (*TimelordService) Do ¶ added in v0.7.0
func (s *TimelordService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
Do is just a shortcut to the client's Do method
func (*TimelordService) GetConnections ¶ added in v0.7.0
func (s *TimelordService) GetConnections(opts *GetConnectionsOptions) (*GetConnectionsResponse, *http.Response, error)
GetConnections returns connections
func (*TimelordService) GetNetworkInfo ¶ added in v0.7.0
func (s *TimelordService) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error)
GetNetworkInfo gets the network name and prefix from the full node
func (*TimelordService) GetVersion ¶ added in v0.8.5
func (s *TimelordService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
GetVersion returns the application version for the service
func (*TimelordService) NewRequest ¶ added in v0.7.0
func (s *TimelordService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
NewRequest returns a new request specific to the crawler service
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 { Response SpendBundle mo.Option[types.SpendBundle] `json:"spend_bundle"` WalletID mo.Option[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) GetConnections ¶ added in v0.2.1
func (s *WalletService) GetConnections(opts *GetConnectionsOptions) (*GetConnectionsResponse, *http.Response, error)
GetConnections returns connections
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(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *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) GetVersion ¶ added in v0.8.5
func (s *WalletService) GetVersion(opts *GetVersionOptions) (*GetVersionResponse, *http.Response, error)
GetVersion returns the application version for the service
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) NFTGetByDid ¶ added in v0.1.0
func (s *WalletService) NFTGetByDid(opts *NFTGetByDidOptions) (*NFTGetByDidResponse, *http.Response, error)
NFTGetByDid Get wallet ID by DID
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