walletsvrwscmds.go raw

   1  package btcjson
   2  
   3  // CreateEncryptedWalletCmd is a jsonrpc command message to create a new encrypted wallet
   4  type CreateEncryptedWalletCmd struct {
   5  	Passphrase string
   6  }
   7  
   8  // NewCreateEncryptedWalletCmd returns a new instance which can be used to issue a createencryptedwallet JSON-RPC
   9  // command.
  10  func NewCreateEncryptedWalletCmd(passphrase string) *CreateEncryptedWalletCmd {
  11  	return &CreateEncryptedWalletCmd{
  12  		Passphrase: passphrase,
  13  	}
  14  }
  15  
  16  // ExportWatchingWalletCmd defines the exportwatchingwallet JSON-RPC command.
  17  type ExportWatchingWalletCmd struct {
  18  	Account  *string
  19  	Download *bool `jsonrpcdefault:"false"`
  20  }
  21  
  22  // NewExportWatchingWalletCmd returns a new instance which can be used to issue a exportwatchingwallet JSON-RPC command.
  23  // The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the
  24  // default value.
  25  func NewExportWatchingWalletCmd(account *string, download *bool) *ExportWatchingWalletCmd {
  26  	return &ExportWatchingWalletCmd{
  27  		Account:  account,
  28  		Download: download,
  29  	}
  30  }
  31  
  32  // GetUnconfirmedBalanceCmd defines the getunconfirmedbalance JSON-RPC command.
  33  type GetUnconfirmedBalanceCmd struct {
  34  	Account *string
  35  }
  36  
  37  // NewGetUnconfirmedBalanceCmd returns a new instance which can be used to issue a getunconfirmedbalance JSON-RPC
  38  // command. The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use
  39  // the default value.
  40  func NewGetUnconfirmedBalanceCmd(account *string) *GetUnconfirmedBalanceCmd {
  41  	return &GetUnconfirmedBalanceCmd{
  42  		Account: account,
  43  	}
  44  }
  45  
  46  // ListAddressTransactionsCmd defines the listaddresstransactions JSON-RPC command.
  47  type ListAddressTransactionsCmd struct {
  48  	Addresses []string
  49  	Account   *string
  50  }
  51  
  52  // NewListAddressTransactionsCmd returns a new instance which can be used to issue a listaddresstransactions JSON-RPC
  53  // command. The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use
  54  // the default value.
  55  func NewListAddressTransactionsCmd(addresses []string, account *string) *ListAddressTransactionsCmd {
  56  	return &ListAddressTransactionsCmd{
  57  		Addresses: addresses,
  58  		Account:   account,
  59  	}
  60  }
  61  
  62  // ListAllTransactionsCmd defines the listalltransactions JSON-RPC command.
  63  type ListAllTransactionsCmd struct {
  64  	Account *string
  65  }
  66  
  67  // NewListAllTransactionsCmd returns a new instance which can be used to issue a listalltransactions JSON-RPC command.
  68  // The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the
  69  // default value.
  70  func NewListAllTransactionsCmd(account *string) *ListAllTransactionsCmd {
  71  	return &ListAllTransactionsCmd{
  72  		Account: account,
  73  	}
  74  }
  75  
  76  // RecoverAddressesCmd defines the recoveraddresses JSON-RPC command.
  77  type RecoverAddressesCmd struct {
  78  	Account string
  79  	N       int
  80  }
  81  
  82  // NewRecoverAddressesCmd returns a new instance which can be used to issue a recoveraddresses JSON-RPC command.
  83  func NewRecoverAddressesCmd(account string, n int) *RecoverAddressesCmd {
  84  	return &RecoverAddressesCmd{
  85  		Account: account,
  86  		N:       n,
  87  	}
  88  }
  89  
  90  // WalletIsLockedCmd defines the walletislocked JSON-RPC command.
  91  type WalletIsLockedCmd struct{}
  92  
  93  // NewWalletIsLockedCmd returns a new instance which can be used to issue a walletislocked JSON-RPC command.
  94  func NewWalletIsLockedCmd() *WalletIsLockedCmd {
  95  	return &WalletIsLockedCmd{}
  96  }
  97  func init() {
  98  	
  99  	// The commands in this file are only usable with a wallet server via websockets.
 100  	flags := UFWalletOnly | UFWebsocketOnly
 101  	MustRegisterCmd("createencryptedwallet", (*CreateEncryptedWalletCmd)(nil), flags)
 102  	MustRegisterCmd("exportwatchingwallet", (*ExportWatchingWalletCmd)(nil), flags)
 103  	MustRegisterCmd("getunconfirmedbalance", (*GetUnconfirmedBalanceCmd)(nil), flags)
 104  	MustRegisterCmd("listaddresstransactions", (*ListAddressTransactionsCmd)(nil), flags)
 105  	MustRegisterCmd("listalltransactions", (*ListAllTransactionsCmd)(nil), flags)
 106  	MustRegisterCmd("recoveraddresses", (*RecoverAddressesCmd)(nil), flags)
 107  	MustRegisterCmd("walletislocked", (*WalletIsLockedCmd)(nil), flags)
 108  }
 109