Documentation
¶
Index ¶
- type AddressDelta
- type Block
- type BlockReward
- type BlockRewardKernelScript
- type BlockRewardOutput
- type BlockRewardOutputScript
- type BlockchainInfo
- type ColdStakeUnspent
- type NetworkInfo
- type ParticlRpc
- func (rpc *ParticlRpc) CallRpc(cmd string, wallet string, args []interface{}, res interface{}) error
- func (rpc *ParticlRpc) GetBlockchainInfo() (*BlockchainInfo, error)
- func (rpc *ParticlRpc) GetNetworkInfo() (*NetworkInfo, error)
- func (rpc *ParticlRpc) GetStakingInfo(wallet string) (*StakingInfo, error)
- func (rpc *ParticlRpc) GetStakingOptions(wallet string) (*Stakingoptions, error)
- func (rpc *ParticlRpc) GetUptime() (int64, error)
- func (rpc *ParticlRpc) ReadConfig(filename string) error
- func (rpc *ParticlRpc) ReadPartRpcCookie() error
- func (rpc *ParticlRpc) SetDataDirectoy(dir string)
- func (rpc *ParticlRpc) SetRpcHost(host string)
- func (rpc *ParticlRpc) SetRpcPort(port int)
- func (rpc *ParticlRpc) SetStakingOptions(enabled bool, rewardaddress string, smsgfeeratetarget float64, wallet string) (*Stakingoptions, error)
- type Sat
- type ScriptPubKey
- type SetStakingoptions
- type StakingInfo
- type Stakingoptions
- type Tx
- type TxVin
- type TxVout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressDelta ¶
type BlockReward ¶
type BlockReward struct {
Blockhash string `json:"blockhash"`
Coinstake string `json:"coinstake"`
Stakereward float64 `json:"stakereward"`
Blockreward float64 `json:"blockreward"`
Kernelscript BlockRewardKernelScript `json:"kernelscript"`
Outputs []BlockRewardOutput `json:"outputs"`
}
type BlockRewardKernelScript ¶
type BlockRewardKernelScript struct {
Spendaddr string `json:"spendaddr"`
}
type BlockRewardOutput ¶
type BlockRewardOutput struct {
Script BlockRewardOutputScript `json:"script"`
Value float64 `json:"value"`
}
type BlockRewardOutputScript ¶
type BlockchainInfo ¶
type BlockchainInfo struct {
Blocks int `json:"blocks"`
}
type ColdStakeUnspent ¶
type NetworkInfo ¶
type ParticlRpc ¶
type ParticlRpc struct {
// contains filtered or unexported fields
}
func NewParticlRpc ¶
func NewParticlRpc() *ParticlRpc
NewParticlRpc creates a new ParticlRpc instance with default settings: dataDir: ".", rpcHost: "localhost", rpcPort: 51735
func (*ParticlRpc) CallRpc ¶
func (rpc *ParticlRpc) CallRpc(cmd string, wallet string, args []interface{}, res interface{}) error
CallRpc executes rpc command <cmd> with arguments <args> at the particl daemon. Returned data is written to <res>, which must be a pointer to a data structure matching the command. If rpc command is wallet specific, the wallet name can be passed in <wallet>, otherwise an empty string must be passed.
func (*ParticlRpc) GetBlockchainInfo ¶
func (rpc *ParticlRpc) GetBlockchainInfo() (*BlockchainInfo, error)
GetBlockchainInfo executes the "getnetworkinfo" command and returns results.
func (*ParticlRpc) GetNetworkInfo ¶
func (rpc *ParticlRpc) GetNetworkInfo() (*NetworkInfo, error)
GetNetworkInfo executes the "getnetworkinfo" command and returns results.
func (*ParticlRpc) GetStakingInfo ¶
func (rpc *ParticlRpc) GetStakingInfo(wallet string) (*StakingInfo, error)
GetStakingInfo executes the "getnetworkinfo" command and returns results.
func (*ParticlRpc) GetStakingOptions ¶
func (rpc *ParticlRpc) GetStakingOptions(wallet string) (*Stakingoptions, error)
GetStakingOptions retuns currently set staking options
func (*ParticlRpc) GetUptime ¶
func (rpc *ParticlRpc) GetUptime() (int64, error)
GetStakingInfo executes the "getnetworkinfo" command and returns results.
func (*ParticlRpc) ReadConfig ¶
func (rpc *ParticlRpc) ReadConfig(filename string) error
ReadConfig reads a JSON config file defining data dir (data_dir), rpc host ("rpc_host") and rpc port ("rpc_port").
func (*ParticlRpc) ReadPartRpcCookie ¶
func (rpc *ParticlRpc) ReadPartRpcCookie() error
ReadPartRpcCookie reads an rpc authorization .cookie file from the data directory.
func (*ParticlRpc) SetDataDirectoy ¶
func (rpc *ParticlRpc) SetDataDirectoy(dir string)
SetDataDirectoy sets the particld data directory. An emptry string is interepreted as "."
func (*ParticlRpc) SetRpcHost ¶
func (rpc *ParticlRpc) SetRpcHost(host string)
SetRpcHost sets the host to which the RPC call will connect. An empty string is interpreted as "localhost"
func (*ParticlRpc) SetRpcPort ¶
func (rpc *ParticlRpc) SetRpcPort(port int)
SetRpcPort sets the port to which the RPC call will connect. Value <= 0 will be interpreted as 51735.
func (*ParticlRpc) SetStakingOptions ¶
func (rpc *ParticlRpc) SetStakingOptions(enabled bool, rewardaddress string, smsgfeeratetarget float64, wallet string) (*Stakingoptions, error)
SetStakingOptions sets staking options (staking enabled, reward address) for specified wallet and returns current settings.
type ScriptPubKey ¶
type SetStakingoptions ¶
type StakingInfo ¶
type StakingInfo struct {
Staking bool `json:"staking"`
Errors string `json:"errors"`
Weight int64 `json:"weight"`
Percentyearreward float64 `json:"percentyearreward"`
Moneysupply float64 `json:"moneysupply"`
Treasurydonationpercent float64 `json:"treasurydonationpercent"`
Netstakeweight int64 `json:"netstakeweight"`
Expectedtime int64 `json:"expectedtime"`
}
type Stakingoptions ¶
type TxVout ¶
type TxVout struct {
Type string `json:"type"`
ValueSat Sat `json:"valueSat"`
ScriptPubKey ScriptPubKey `json:"scriptPubKey"`
}