package
0.0.0-20191101094200-9e8562eb8485
Repository: https://github.com/utopiacoinorg/ucwallet.git
Documentation: pkg.go.dev

# README

jsonrpc/types

Build Status ISC License GoDoc

Package types implements concrete types for marshalling to and from the ucwallet JSON-RPC API. A comprehensive suite of tests is provided to ensure proper functionality.

The provided types are automatically registered with ucjson when the package is imported. Although this package was primarily written for ucwallet, it has intentionally been designed so it can be used as a standalone package for any projects needing to marshal to and from ucwallet JSON-RPC requests and responses.

Note that although it's possible to use this package directly to implement an RPC client, it is not recommended since it is only intended as an infrastructure package. Instead, RPC clients should use the rpcclient package which provides a full blown RPC client with many features such as automatic connection management, websocket support, automatic notification re-registration on reconnect, and conversion from the raw underlying RPC types (strings, floats, ints, etc) to higher-level types with many nice and useful properties.

Installation and Updating

$ go get -u github.com/UtopiaCoinOrg/ucwallet/rpc/jsonrpc/types

License

Package types is licensed under the copyfree ISC License.

# Functions

NewAccountAddressIndexCmd creates a new AccountAddressIndexCmd.
NewAccountBalanceNtfn returns a new instance which can be used to issue an accountbalance JSON-RPC notification.
NewAccountSyncAddressIndexCmd creates a new AccountSyncAddressIndexCmd.
NewAddMultisigAddressCmd returns a new instance which can be used to issue a addmultisigaddress JSON-RPC command.
NewAddTicketCmd creates a new AddTicketCmd.
NewConsolidateCmd creates a new ConsolidateCmd.
NewCreateEncryptedWalletCmd returns a new instance which can be used to issue a createencryptedwallet JSON-RPC command.
NewCreateMultisigCmd returns a new instance which can be used to issue a createmultisig JSON-RPC command.
NewCreateNewAccountCmd returns a new instance which can be used to issue a createnewaccount JSON-RPC command.
NewCreateVotingAccountCmd creates a new CreateVotingAccountCmd.
NewDropVotingAccountCmd creates a new DropVotingAccountCmd.
NewDumpPrivKeyCmd returns a new instance which can be used to issue a dumpprivkey JSON-RPC command.
NewEstimatePriorityCmd returns a new instance which can be used to issue a estimatepriority JSON-RPC command.
NewExportWatchingWalletCmd returns a new instance which can be used to issue a exportwatchingwallet JSON-RPC command.
FlashSendToAddressCmd returns a new instance which can be used to issue a flashSendtoaddress JSON-RPC command.
NewFundRawTransactionCmd returns a new instance which can be used to issue a fundrawtransaction JSON-RPC command.
NewGenerateVoteCmd creates a new GenerateVoteCmd.
NewGetAccountAddressCmd returns a new instance which can be used to issue a getaccountaddress JSON-RPC command.
NewGetAccountCmd returns a new instance which can be used to issue a getaccount JSON-RPC command.
NewGetAddressesByAccountCmd returns a new instance which can be used to issue a getaddressesbyaccount JSON-RPC command.
NewGetBalanceCmd returns a new instance which can be used to issue a getbalance JSON-RPC command.
NewGetContractHashCmd returns a new instance which can be used to issue a getcontracthash JSON-RPC command.
NewGetMasterPubkeyCmd creates a new GetMasterPubkeyCmd.
NewGetMultisigOutInfoCmd creates a new GetMultisigOutInfoCmd.
NewGetNewAddressCmd returns a new instance which can be used to issue a getnewaddress JSON-RPC command.
NewGetPayToContractAddressCmd returns a new instance which can be used to issue a getpaytocontractaddress JSON-RPC command.
NewGetRawChangeAddressCmd returns a new instance which can be used to issue a getrawchangeaddress JSON-RPC command.
NewGetReceivedByAccountCmd returns a new instance which can be used to issue a getreceivedbyaccount JSON-RPC command.
NewGetReceivedByAddressCmd returns a new instance which can be used to issue a getreceivedbyaddress JSON-RPC command.
NewGetStakeInfoCmd creates a new GetStakeInfoCmd.
NewGetTicketFeeCmd creates a new GetTicketFeeCmd.
NewGetTicketsCmd returns a new instance which can be used to issue a gettickets JSON-RPC command.
NewGetTransactionCmd returns a new instance which can be used to issue a gettransaction JSON-RPC command.
NewGetUnconfirmedBalanceCmd returns a new instance which can be used to issue a getunconfirmedbalance JSON-RPC command.
NewGetVoteChoicesCmd returns a new instance which can be used to issue a JSON-RPC getvotechoices command.
NewGetWalletFeeCmd returns a new instance which can be used to issue a getwalletfee JSON-RPC command.
NewImportPrivKeyCmd returns a new instance which can be used to issue a importprivkey JSON-RPC command.
NewImportScriptCmd creates a new GetImportScriptCmd.
NewKeyPoolRefillCmd returns a new instance which can be used to issue a keypoolrefill JSON-RPC command.
NewListAccountsCmd returns a new instance which can be used to issue a listaccounts JSON-RPC command.
NewListAddressTransactionsCmd returns a new instance which can be used to issue a listaddresstransactions JSON-RPC command.
NewListAllTransactionsCmd returns a new instance which can be used to issue a listalltransactions JSON-RPC command.
NewListLockUnspentCmd returns a new instance which can be used to issue a listlockunspent JSON-RPC command.
NewListReceivedByAccountCmd returns a new instance which can be used to issue a listreceivedbyaccount JSON-RPC command.
NewListReceivedByAddressCmd returns a new instance which can be used to issue a listreceivedbyaddress JSON-RPC command.
NewListScriptsCmd returns a new instance which can be used to issue a listscripts JSON-RPC command.
NewListSinceBlockCmd returns a new instance which can be used to issue a listsinceblock JSON-RPC command.
NewListTicketsCmd returns a new instance which can be used to issue a listtickets JSON-RPC command.
NewListTransactionsCmd returns a new instance which can be used to issue a listtransactions JSON-RPC command.
NewListUnspentCmd returns a new instance which can be used to issue a listunspent JSON-RPC command.
NewLockUnspentCmd returns a new instance which can be used to issue a lockunspent JSON-RPC command.
NewNewTxNtfn returns a new instance which can be used to issue a newtx JSON-RPC notification.
NewPurchaseTicketCmd creates a new PurchaseTicketCmd.
NewRecoverAddressesCmd returns a new instance which can be used to issue a recoveraddresses JSON-RPC command.
NewRedeemMultiSigOutCmd creates a new RedeemMultiSigOutCmd.
NewRedeemMultiSigOutsCmd creates a new RedeemMultiSigOutsCmd.
NewRenameAccountCmd returns a new instance which can be used to issue a renameaccount JSON-RPC command.
NewRevocationCreatedNtfn creates a new RevocationCreatedNtfn.
NewRevokeTicketsCmd creates a new RevokeTicketsCmd.
NewSendFromCmd returns a new instance which can be used to issue a sendfrom JSON-RPC command.
NewSendManyCmd returns a new instance which can be used to issue a sendmany JSON-RPC command.
NewSendToAddressCmd returns a new instance which can be used to issue a sendtoaddress JSON-RPC command.
NewSendToMultiSigCmd creates a new SendToMultiSigCmd.
NewSetTicketFeeCmd creates a new instance of the setticketfee command.
NewSetTxFeeCmd returns a new instance which can be used to issue a settxfee JSON-RPC command.
NewSetVoteChoiceCmd returns a new instance which can be used to issue a setvotechoice JSON-RPC command.
NewSignMessageCmd returns a new instance which can be used to issue a signmessage JSON-RPC command.
NewSignRawTransactionCmd returns a new instance which can be used to issue a signrawtransaction JSON-RPC command.
NewSignRawTransactionsCmd returns a new instance which can be used to issue a signrawtransactions JSON-RPC command.
NewStakePoolUserInfoCmd returns a new instance which can be used to issue a signrawtransactions JSON-RPC command.
NewStartAutoBuyerCmd creates a new StartAutoBuyerCmd.
NewStopAutoBuyerCmd creates a new StopAutoBuyerCmd.
NewSweepAccountCmd returns a new instance which can be used to issue a JSON-RPC SweepAccountCmd command.
NewTicketPurchasedNtfn creates a new TicketPurchasedNtfn.
NewUcdConnectedNtfn returns a new instance which can be used to issue a ucddconnected JSON-RPC notification.
NewVerifySeedCmd returns a new instance which can be used to issue a walletlock JSON-RPC command.
NewVoteCreatedNtfn creates a new VoteCreatedNtfn.
NewWalletInfoCmd returns a new instance which can be used to issue a walletinfo JSON-RPC command.
NewWalletIsLockedCmd returns a new instance which can be used to issue a walletislocked JSON-RPC command.
NewWalletLockCmd returns a new instance which can be used to issue a walletlock JSON-RPC command.
NewWalletLockStateNtfn returns a new instance which can be used to issue a walletlockstate JSON-RPC notification.
NewWalletPassphraseChangeCmd returns a new instance which can be used to issue a walletpassphrasechange JSON-RPC command.
NewWalletPassphraseCmd returns a new instance which can be used to issue a walletpassphrase JSON-RPC command.

# Constants

AccountBalanceNtfnMethod is the method used for account balance notifications.
LTTTRegular indicates a regular transaction.
LTTTRevocation indicates a revocation.
LTTTTicket indicates a ticket.
LTTTVote indicates a vote.
NewTicketsNtfnMethod is the method of the daemon newtickets notification.
NewTxNtfnMethod is the method used to notify that a wallet server has added a new transaction to the transaction store.
RevocationCreatedNtfnMethod is the method of the ucwallet revocationcreated notification.
TicketPurchasedNtfnMethod is the method of the ucwallet ticketpurchased notification.
UcdConnectedNtfnMethod is the method used for notifications when a wallet server is connected to a chain server.
VoteCreatedNtfnMethod is the method of the ucwallet votecreated notification.
WalletLockStateNtfnMethod is the method used to notify the lock state of a wallet has changed.
WinningTicketsNtfnMethod is the method of the daemon winningtickets notification.

# Structs

AccountAddressIndexCmd is a type handling custom marshaling and unmarshaling of accountaddressindex JSON wallet extension commands.
AccountBalanceNtfn defines the accountbalance JSON-RPC notification.
AccountSyncAddressIndexCmd is a type handling custom marshaling and unmarshaling of accountsyncaddressindex JSON wallet extension commands.
AddMultisigAddressCmd defines the addmutisigaddress JSON-RPC command.
AddTicketCmd forces a ticket into the wallet stake manager, for example if someone made an invalid ticket for a stake pool and the pool manager wanted to manually add it.
ConsolidateCmd is a type handling custom marshaling and unmarshaling of consolidate JSON wallet extension commands.
CreateEncryptedWalletCmd defines the createencryptedwallet JSON-RPC command.
CreateMultisigCmd defines the createmultisig JSON-RPC command.
CreateMultiSigResult models the data returned from the createmultisig command.
CreateNewAccountCmd defines the createnewaccount JSON-RPC command.
CreateVotingAccountCmd is a type for handling custom marshaling and unmarshalling of createvotingaccount JSON-RPC command.
DropVotingAccountCmd is a type for handling custom marshaling and unmarshalling of dropvotingaccount JSON-RPC command.
DumpPrivKeyCmd defines the dumpprivkey JSON-RPC command.
EstimatePriorityCmd defines the estimatepriority JSON-RPC command.
ExportWatchingWalletCmd defines the exportwatchingwallet JSON-RPC command.
FlashSendToAddressCmd defines the flashSendtoaddress JSON-RPC command.
FundRawTransactionCmd is a type handling custom marshaling and unmarshaling of fundrawtransaction JSON wallet extension commands.
FundRawTransactionOptions represents the optional inputs to fund a raw transaction.
FundRawTransactionResult models the data from the fundrawtransaction command.
GenerateVoteCmd is a type handling custom marshaling and unmarshaling of generatevote JSON wallet extension commands.
GenerateVoteResult models the data from the generatevote command.
GetAccountAddressCmd defines the getaccountaddress JSON-RPC command.
GetAccountBalanceResult models the account data from the getbalance command.
GetAccountCmd defines the getaccount JSON-RPC command.
GetAddressesByAccountCmd defines the getaddressesbyaccount JSON-RPC command.
GetBalanceCmd defines the getbalance JSON-RPC command.
GetBalanceResult models the data from the getbalance command.
GetContractHashCmd defines the getcontracthash JSON-RPC command.
GetContractHashResult models the data from the getcontracthash command.
GetMasterPubkeyCmd is a type handling custom marshaling and unmarshaling of getmasterpubkey JSON wallet extension commands.
GetMultisigOutInfoCmd is a type handling custom marshaling and unmarshaling of getmultisigoutinfo JSON websocket extension commands.
GetMultisigOutInfoResult models the data returned from the getmultisigoutinfo command.
GetNewAddressCmd defines the getnewaddress JSON-RPC command.
GetPayToContractAddressCmd defines the getpaytocontracthash JSON-RPC command.
GetPayToContractHashResult models the data returned from the getpaytocontracthash command.
GetRawChangeAddressCmd defines the getrawchangeaddress JSON-RPC command.
GetReceivedByAccountCmd defines the getreceivedbyaccount JSON-RPC command.
GetReceivedByAddressCmd defines the getreceivedbyaddress JSON-RPC command.
GetStakeInfoCmd is a type handling custom marshaling and unmarshaling of getstakeinfo JSON wallet extension commands.
GetStakeInfoResult models the data returned from the getstakeinfo command.
GetTicketFeeCmd is a type handling custom marshaling and unmarshaling of getticketfee JSON wallet extension commands.
GetTicketsCmd is a type handling custom marshaling and unmarshaling of gettickets JSON wallet extension commands.
GetTicketsResult models the data returned from the gettickets command.
GetTransactionCmd defines the gettransaction JSON-RPC command.
GetTransactionDetailsResult models the details data from the gettransaction command.
GetTransactionResult models the data from the gettransaction command.
GetUnconfirmedBalanceCmd defines the getunconfirmedbalance JSON-RPC command.
GetVoteChoicesCmd returns a new instance which can be used to issue a getvotechoices JSON-RPC command.
GetVoteChoicesResult models the data returned by the getvotechoices command.
GetWalletFeeCmd defines the getwalletfee JSON-RPC command.
ImportPrivKeyCmd defines the importprivkey JSON-RPC command.
ImportScriptCmd is a type for handling custom marshaling and unmarshaling of importscript JSON wallet extension commands.
InfoResult models the data returned by the wallet server getinfo command.
KeyPoolRefillCmd defines the keypoolrefill JSON-RPC command.
ListAccountsCmd defines the listaccounts JSON-RPC command.
ListAddressTransactionsCmd defines the listaddresstransactions JSON-RPC command.
ListAllTransactionsCmd defines the listalltransactions JSON-RPC command.
ListLockUnspentCmd defines the listlockunspent JSON-RPC command.
ListReceivedByAccountCmd defines the listreceivedbyaccount JSON-RPC command.
ListReceivedByAccountResult models the data from the listreceivedbyaccount command.
ListReceivedByAddressCmd defines the listreceivedbyaddress JSON-RPC command.
ListReceivedByAddressResult models the data from the listreceivedbyaddress command.
ListScriptsCmd is a type for handling custom marshaling and unmarshaling of listscripts JSON wallet extension commands.
ListScriptsResult models the data returned from the listscripts command.
ListSinceBlockCmd defines the listsinceblock JSON-RPC command.
ListSinceBlockResult models the data from the listsinceblock command.
ListTicketsCmd defines the listtickets JSON-RPC command.
ListTicketsResult models the data from the listtickets command.
ListTicketsTransactionSummary defines the type used in the listtickets JSON-RPC result for the Ticket and Spender command fields.
ListTicketsTransactionSummaryInput defines the type used in the listtickets JSON-RPC result for the MyInputs field of Ticket and Spender command field.
ListTicketsTransactionSummaryOutput defines the type used in the listtickets JSON-RPC result for the MyOutputs field of Ticket and Spender command field.
ListTransactionsCmd defines the listtransactions JSON-RPC command.
ListTransactionsResult models the data from the listtransactions command.
ListUnspentCmd defines the listunspent JSON-RPC command.
ListUnspentResult models a successful response from the listunspent request.
LockUnspentCmd defines the lockunspent JSON-RPC command.
NewTxNtfn defines the newtx JSON-RPC notification.
PoolUserTicket is the JSON struct corresponding to a stake pool user ticket object.
PurchaseTicketCmd is a type handling custom marshaling and unmarshaling of purchaseticket JSON RPC commands.
RawTxInput models the data needed for raw transaction input that is used in the SignRawTransactionCmd struct.
RecoverAddressesCmd defines the recoveraddresses JSON-RPC command.
RedeemMultiSigOutCmd is a type handling custom marshaling and unmarshaling of redeemmultisigout JSON RPC commands.
RedeemMultiSigOutResult models the data returned from the redeemmultisigout command.
RedeemMultiSigOutsCmd is a type handling custom marshaling and unmarshaling of redeemmultisigout JSON RPC commands.
RedeemMultiSigOutsResult models the data returned from the redeemmultisigouts command.
RenameAccountCmd defines the renameaccount JSON-RPC command.
RescanWalletCmd describes the rescanwallet JSON-RPC request and parameters.
RevocationCreatedNtfn is a type handling custom marshaling and unmarshaling of ticketpurchased JSON websocket notifications.
RevokeTicketsCmd describes the revoketickets JSON-RPC request and parameters.
ScriptInfo is the structure representing a redeem script, its hash, and its address.
SendFromCmd defines the sendfrom JSON-RPC command.
SendManyCmd defines the sendmany JSON-RPC command.
SendToAddressCmd defines the sendtoaddress JSON-RPC command.
SendToMultiSigCmd is a type handling custom marshaling and unmarshaling of sendtomultisig JSON RPC commands.
SendToMultiSigResult models the data returned from the sendtomultisig command.
SetTicketFeeCmd is a type handling custom marshaling and unmarshaling of setticketfee JSON RPC commands.
SetTxFeeCmd defines the settxfee JSON-RPC command.
SetVoteChoiceCmd defines the parameters to the setvotechoice method.
SignedTransaction is a signed transaction resulting from a signrawtransactions command.
SignMessageCmd defines the signmessage JSON-RPC command.
SignRawTransactionCmd defines the signrawtransaction JSON-RPC command.
SignRawTransactionError models the data that contains script verification errors from the signrawtransaction request.
SignRawTransactionResult models the data from the signrawtransaction command.
SignRawTransactionsCmd defines the signrawtransactions JSON-RPC command.
SignRawTransactionsResult models the data returned from the signrawtransactions command.
StakePoolUserInfoCmd defines the stakepooluserinfo JSON-RPC command.
StakePoolUserInfoResult models the data returned from the stakepooluserinfo command.
StartAutoBuyerCmd is a type handling custom marshaling and unmarshaling of startautobuyer JSON RPC commands.
StopAutoBuyerCmd is a type handling custom marshaling and unmarshaling of stopautobuyer JSON RPC commands.
SweepAccountCmd defines the sweep account JSON-RPC command.
SweepAccountResult models the data returned from the sweepaccount command.
TicketPurchasedNtfn is a type handling custom marshaling and unmarshaling of ticketpurchased JSON websocket notifications.
UcdConnectedNtfn defines the ucddconnected JSON-RPC notification.
ValidateAddressResult models the data returned by the wallet server validateaddress command.
VerifySeedCmd defines the verifyseed JSON-RPC command.
VerifySeedResult models the data returned by the wallet server verify seed command.
VoteChoice models the data for a vote choice in the getvotechoices result.
VoteCreatedNtfn is a type handling custom marshaling and unmarshaling of ticketpurchased JSON websocket notifications.
WalletInfoCmd defines the walletinfo JSON-RPC command.
WalletInfoResult models the data returned from the walletinfo command.
WalletIsLockedCmd defines the walletislocked JSON-RPC command.
WalletLockCmd defines the walletlock JSON-RPC command.
WalletLockStateNtfn defines the walletlockstate JSON-RPC notification.
WalletPassphraseChangeCmd defines the walletpassphrase JSON-RPC command.
WalletPassphraseCmd defines the walletpassphrase JSON-RPC command.

# Type aliases

InfoWalletResult aliases InfoResult.
ListTransactionsTxType defines the type used in the listtransactions JSON-RPC result for the TxType command field.
Method describes the exact type used when registering methods with ucjson.
ValidateAddressWalletResult aliases ValidateAddressResult.