github.com/Synthesix/Sia@v1.3.3-0.20180413141344-f863baeed3ca/doc/api/Wallet.md (about)

     1  Wallet
     2  ======
     3  
     4  This document contains detailed descriptions of the wallet's API routes. For an
     5  overview of the wallet's API routes, see [API.md#wallet](/doc/API.md#wallet).
     6  For an overview of all API routes, see [API.md](/doc/API.md)
     7  
     8  There may be functional API calls which are not documented. These are not
     9  guaranteed to be supported beyond the current release, and should not be used
    10  in production.
    11  
    12  Overview
    13  --------
    14  
    15  The wallet stores and manages siacoins and siafunds. The wallet's API endpoints
    16  expose methods for creating and loading wallets, locking and unlocking, sending
    17  siacoins and siafunds, and getting the wallet's balance.
    18  
    19  You must create a wallet before you can use the wallet's API endpoints. You can
    20  create a wallet with the `/wallet/init` endpoint. Wallets are always encrypted
    21  on disk. Calls to some wallet API endpoints will fail until the wallet is
    22  unlocked. The wallet can be unlocked with the `/wallet/unlock` endpoint. Once
    23  the wallet is unlocked calls to the API endpoints will succeed until the wallet
    24  is locked again with `/wallet/lock`, or Siad is restarted. The host and renter
    25  require the miner to be unlocked.
    26  
    27  Index
    28  -----
    29  
    30  | Route                                                           | HTTP verb |
    31  | --------------------------------------------------------------- | --------- |
    32  | [/wallet](#wallet-get)                                          | GET       |
    33  | [/wallet/033x](#wallet033x-post)                                | POST      |
    34  | [/wallet/address](#walletaddress-get)                           | GET       |
    35  | [/wallet/addresses](#walletaddresses-get)                       | GET       |
    36  | [/wallet/backup](#walletbackup-get)                             | GET       |
    37  | [/wallet/init](#walletinit-post)                                | POST      |
    38  | [/wallet/init/seed](#walletinitseed-post)                       | POST      |
    39  | [/wallet/lock](#walletlock-post)                                | POST      |
    40  | [/wallet/seed](#walletseed-post)                                | POST      |
    41  | [/wallet/seeds](#walletseeds-get)                               | GET       |
    42  | [/wallet/siacoins](#walletsiacoins-post)                        | POST      |
    43  | [/wallet/siafunds](#walletsiafunds-post)                        | POST      |
    44  | [/wallet/siagkey](#walletsiagkey-post)                          | POST      |
    45  | [/wallet/sweep/seed](#walletsweepseed-post)                     | POST      |
    46  | [/wallet/transaction/___:id___](#wallettransactionid-get)       | GET       |
    47  | [/wallet/transactions](#wallettransactions-get)                 | GET       |
    48  | [/wallet/transactions/___:addr___](#wallettransactionsaddr-get) | GET       |
    49  | [/wallet/unlock](#walletunlock-post)                            | POST      |
    50  | [/wallet/verify/address/:___addr___](#walletverifyaddress-get)  | GET       |
    51  | [/wallet/changepassword](#walletchangepassword-post)            | POST      |
    52  
    53  #### /wallet [GET]
    54  
    55  returns basic information about the wallet, such as whether the wallet is
    56  locked or unlocked.
    57  
    58  ###### JSON Response
    59  ```javascript
    60  {
    61    // Indicates whether the wallet has been encrypted or not. If the wallet
    62    // has not been encrypted, then no data has been generated at all, and the
    63    // first time the wallet is unlocked, the password given will be used as
    64    // the password for encrypting all of the data. 'encrypted' will only be
    65    // set to false if the wallet has never been unlocked before (the unlocked
    66    // wallet is still encryped - but the encryption key is in memory).
    67    "encrypted": true,
    68  
    69    // Indicates whether the wallet is currently locked or unlocked. Some calls
    70    // become unavailable when the wallet is locked.
    71    "unlocked": true,
    72  
    73    // Indicates whether the wallet is currently rescanning the blockchain. This
    74    // will be true for the duration of calls to /unlock, /seeds, /init/seed,
    75    // and /sweep/seed.
    76    "rescanning": false,
    77  
    78    // Number of siacoins, in hastings, available to the wallet as of the most
    79    // recent block in the blockchain.
    80    "confirmedsiacoinbalance": "123456", // hastings, big int
    81  
    82    // Number of siacoins, in hastings, that are leaving the wallet according
    83    // to the set of unconfirmed transactions. Often this number appears
    84    // inflated, because outputs are frequently larger than the number of coins
    85    // being sent, and there is a refund. These coins are counted as outgoing,
    86    // and the refund is counted as incoming. The difference in balance can be
    87    // calculated using 'unconfirmedincomingsiacoins' - 'unconfirmedoutgoingsiacoins'
    88    "unconfirmedoutgoingsiacoins": "0", // hastings, big int
    89  
    90    // Number of siacoins, in hastings, are entering the wallet according to
    91    // the set of unconfirmed transactions. This number is often inflated by
    92    // outgoing siacoins, because outputs are frequently larger than the amount
    93    // being sent. The refund will be included in the unconfirmed incoming
    94    // siacoins balance.
    95    "unconfirmedincomingsiacoins": "789", // hastings, big int
    96  
    97    // Number of siafunds available to the wallet as of the most recent block
    98    // in the blockchain.
    99    "siafundbalance": "1", // big int
   100  
   101    // Number of siacoins, in hastings, that can be claimed from the siafunds
   102    // as of the most recent block. Because the claim balance increases every
   103    // time a file contract is created, it is possible that the balance will
   104    // increase before any claim transaction is confirmed.
   105    "siacoinclaimbalance": "9001", // hastings, big int
   106  
   107    // Number of siacoins, in hastings per byte, below which a transaction output
   108    // cannot be used because the wallet considers it a dust output
   109    "dustthreshold": "1234", // hastings / byte, big int
   110  }
   111  ```
   112  
   113  #### /wallet/033x [POST]
   114  
   115  loads a v0.3.3.x wallet into the current wallet, harvesting all of the secret
   116  keys. All spendable addresses in the loaded wallet will become spendable from
   117  the current wallet. An error will be returned if the given `encryptionpassword`
   118  is incorrect.
   119  
   120  ###### Query String Parameters
   121  ```
   122  // Path on disk to the v0.3.3.x wallet to be loaded.
   123  source
   124  
   125  // Encryption key of the wallet.
   126  encryptionpassword
   127  ```
   128  
   129  ###### Response
   130  standard success or error response. See
   131  [API.md#standard-responses](/doc/API.md#standard-responses).
   132  
   133  #### /wallet/address [GET]
   134  
   135  gets a new address from the wallet generated by the primary seed. An error will
   136  be returned if the wallet is locked.
   137  
   138  ###### JSON Response
   139  ```javascript
   140  {
   141    // Wallet address that can receive siacoins or siafunds. Addresses are 76 character long hex strings.
   142    "address": "1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab"
   143  }
   144  ```
   145  
   146  #### /wallet/addresses [GET]
   147  
   148  fetches the list of addresses from the wallet. If the wallet has not been
   149  created or unlocked, no addresses will be returned. After the wallet is
   150  unlocked, this call will continue to return its addresses even after the
   151  wallet is locked again.
   152  
   153  ###### JSON Response
   154  ```javascript
   155  {
   156    // Array of wallet addresses owned by the wallet.
   157    "addresses": [
   158      "1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   159      "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
   160      "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
   161    ]
   162  }
   163  ```
   164  
   165  #### /wallet/backup [GET]
   166  
   167  creates a backup of the wallet settings file. Though this can easily be done
   168  manually, the settings file is often in an unknown or difficult to find
   169  location. The /wallet/backup call can spare users the trouble of needing to
   170  find their wallet file. The destination file is overwritten if it already
   171  exists.
   172  
   173  ###### Query String Parameters
   174  ```
   175  // path to the location on disk where the backup file will be saved.
   176  destination
   177  ```
   178  
   179  ###### Response
   180  standard success or error response. See
   181  [API.md#standard-responses](/doc/API.md#standard-responses).
   182  
   183  #### /wallet/init [POST]
   184  
   185  initializes the wallet. After the wallet has been initialized once, it does not
   186  need to be initialized again, and future calls to /wallet/init will return an
   187  error, unless the force flag is set. The encryption password is provided by the
   188  api call. If the password is blank, then the password will be set to the same
   189  as the seed.
   190  
   191  ###### Query String Parameters
   192  ```
   193  // Password that will be used to encrypt the wallet. All subsequent calls
   194  // should use this password. If left blank, the seed that gets returned will
   195  // also be the encryption password.
   196  encryptionpassword
   197  
   198  // Name of the dictionary that should be used when encoding the seed. 'english'
   199  // is the most common choice when picking a dictionary.
   200  dictionary // Optional, default is english.
   201  
   202  // boolean, when set to true /wallet/init will Reset the wallet if one exists
   203  // instead of returning an error. This allows API callers to reinitialize a new
   204  // wallet.
   205  force
   206  ```
   207  
   208  ###### JSON Response
   209  ```javascript
   210  {
   211    // Wallet seed used to generate addresses that the wallet is able to spend.
   212    "primaryseed": "hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello"
   213  }
   214  ```
   215  
   216  #### /wallet/init/seed [POST]
   217  
   218  initializes the wallet using a preexisting seed. After the wallet has been
   219  initialized once, it does not need to be initialized again, and future calls to
   220  /wallet/init/seed will return an error unless the force flag is set. The
   221  encryption password is provided by the api call. If the password is blank, then
   222  the password will be set to the same as the seed. Note that loading a
   223  preexisting seed requires scanning the blockchain to determine how many keys
   224  have been generated from the seed.  For this reason, /wallet/init/seed can only
   225  be called if the blockchain is synced.
   226  
   227  ###### Query String Parameters
   228  ```
   229  // Password that will be used to encrypt the wallet. All subsequent calls
   230  // should use this password. If left blank, the seed that gets returned will
   231  // also be the encryption password.
   232  encryptionpassword
   233  
   234  // Name of the dictionary that should be used when encoding the seed. 'english'
   235  // is the most common choice when picking a dictionary.
   236  dictionary // Optional, default is english.
   237  
   238  // Dictionary-encoded phrase that corresponds to the seed being used to
   239  // initialize the wallet.
   240  seed
   241  
   242  // boolean, when set to true /wallet/init will Reset the wallet if one exists
   243  // instead of returning an error. This allows API callers to reinitialize a new
   244  // wallet.
   245  force
   246  ```
   247  
   248  ###### Response
   249  standard success or error response. See
   250  [API.md#standard-responses](/doc/API.md#standard-responses).
   251  
   252  #### /wallet/seed [POST]
   253  
   254  gives the wallet a seed to track when looking for incoming transactions. The
   255  wallet will be able to spend outputs related to addresses created by the seed.
   256  The seed is added as an auxiliary seed, and does not replace the primary seed.
   257  Only the primary seed will be used for generating new addresses.
   258  
   259  ###### Query String Parameters
   260  ```
   261  // Key used to encrypt the new seed when it is saved to disk.
   262  encryptionpassword
   263  
   264  // Name of the dictionary that should be used when encoding the seed. 'english'
   265  // is the most common choice when picking a dictionary.
   266  dictionary
   267  
   268  // Dictionary-encoded phrase that corresponds to the seed being added to the
   269  // wallet.
   270  seed
   271  ```
   272  
   273  ###### Response
   274  standard success or error response. See
   275  [API.md#standard-responses](/doc/API.md#standard-responses).
   276  
   277  #### /wallet/seeds [GET]
   278  
   279  returns a list of seeds in use by the wallet. The primary seed is the only seed
   280  that gets used to generate new addresses. This call is unavailable when the
   281  wallet is locked.
   282  
   283  A seed is an encoded version of a 128 bit random seed. The output is 15 words
   284  chosen from a small dictionary as indicated by the input. The most common
   285  choice for the dictionary is going to be 'english'. The underlying seed is the
   286  same no matter what dictionary is used for the encoding. The encoding also
   287  contains a small checksum of the seed, to help catch simple mistakes when
   288  copying. The library
   289  [entropy-mnemonics](https://github.com/NebulousLabs/entropy-mnemonics) is used
   290  when encoding.
   291  
   292  ###### Query String Parameters
   293  ```
   294  // Name of the dictionary that should be used when encoding the seed. 'english'
   295  // is the most common choice when picking a dictionary.
   296  dictionary
   297  ```
   298  
   299  ###### JSON Response
   300  ```javascript
   301  {
   302    // Seed that is actively being used to generate new addresses for the wallet.
   303    "primaryseed": "hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello",
   304  
   305    // Number of addresses that remain in the primary seed until exhaustion has
   306    // been reached. Once exhaustion has been reached, new addresses will
   307    // continue to be generated but they will be more difficult to recover in the
   308    // event of a lost wallet file or encryption password.
   309    "addressesremaining": 2500,
   310  
   311    // Array of all seeds that the wallet references when scanning the blockchain
   312    // for outputs. The wallet is able to spend any output generated by any of
   313    // the seeds, however only the primary seed is being used to generate new
   314    // addresses.
   315    "allseeds": [
   316      "hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello",
   317      "foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo",
   318    ]
   319  }
   320  ```
   321  
   322  #### /wallet/siacoins [POST]
   323  
   324  Function: Send siacoins to an address or set of addresses. The outputs are
   325  arbitrarily selected from addresses in the wallet. If 'outputs' is supplied,
   326  'amount' and 'destination' must be empty. The number of outputs should not
   327  exceed 400; this may result in a transaction too large to fit in the
   328  transaction pool.
   329  
   330  ###### Query String Parameters
   331  ```
   332  // Number of hastings being sent. A hasting is the smallest unit in Sia. There
   333  // are 10^24 hastings in a siacoin.
   334  amount      // hastings
   335  
   336  // Address that is receiving the coins.
   337  destination // address
   338  
   339  // JSON array of outputs. The structure of each output is:
   340  // {"unlockhash": "<destination>", "value": "<amount>"}
   341  outputs
   342  ```
   343  
   344  ###### JSON Response
   345  ```javascript
   346  {
   347    // Array of IDs of the transactions that were created when sending the coins.
   348    // The last transaction contains the output headed to the 'destination'.
   349    // Transaction IDs are 64 character long hex strings.
   350    transactionids [
   351      "1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
   352      "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
   353      "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
   354    ]
   355  }
   356  ```
   357  
   358  ### Examples
   359  
   360  #### Send to single address
   361  
   362  ###### Example POST Request
   363  Use _amount_ and _destination_ parameters.
   364  ```
   365  /wallet/siacoins?amount=1000000000000000000000000&destination=1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab
   366  ```
   367  
   368  ###### Expected Response Code
   369  ```
   370  200 OK
   371  ```
   372  
   373  ###### Example Response Body
   374  ```json
   375  {
   376    "transactionids": [
   377      "3918e4a4b4cee46b3e5b28b8a1cc41c064a6f6002d162d396f296c201e6edc13",
   378      "18b85b7d20f8a87bdadacf11e135ad44db1d93efd0613d23116e8cf255502762"
   379    ]
   380  }
   381  ```
   382  
   383  
   384  #### Send to set of addresses
   385  Use _outputs_ parameter in the form of a JSON array. _amount_ and _destination_ parameters must be empty.
   386  
   387  
   388  ###### Example POST Request
   389  ```
   390  /wallet/siacoins?outputs=[{"unlockhash":"1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab","value":"1000000000000000000000000"},{"unlockhash":"abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab1234567890","value":"8000000000000000000000000"},{"unlockhash":"cdef0123456789abcdef0123456789abcdef0123456789ab1234567890abcdef0123456789ab","value":"5000000000000000000000000"}]
   391  ```
   392  
   393  ###### (sample JSON request body for reference)
   394  ```json
   395  {
   396    "outputs": [
   397      {
   398        "unlockhash":
   399  "1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   400        "value": "1000000000000000000000000"
   401      },
   402      {
   403        "unlockhash":
   404  "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab1234567890",
   405        "value": "8000000000000000000000000"
   406      },
   407      {
   408        "unlockhash":
   409  "cdef0123456789abcdef0123456789abcdef0123456789ab1234567890abcdef0123456789ab",
   410        "value": "20000000000000000000000000"
   411      }
   412    ]
   413  }
   414  
   415  ```
   416  
   417  ###### Expected Response Code
   418  ```
   419  200 OK
   420  ```
   421  
   422  ###### Example Response Body
   423  ```json
   424  {
   425    "transactionids": [
   426      "21962e0118f3ca5d6fab0262c65bca0220fbcc828c499974d86e7cc4047a0ce5",
   427      "f2471d550823f2c0616565d8476a7fea5f2b9a841612bf109923c3a54e760721"
   428    ]
   429  }
   430  ```
   431  
   432  #### /wallet/siafunds [POST]
   433  
   434  sends siafunds to an address. The outputs are arbitrarily selected from
   435  addresses in the wallet. Any siacoins available in the siafunds being sent (as
   436  well as the siacoins available in any siafunds that end up in a refund address)
   437  will become available to the wallet as siacoins after 144 confirmations. To
   438  access all of the siacoins in the siacoin claim balance, send all of the
   439  siafunds to an address in your control (this will give you all the siacoins,
   440  while still letting you control the siafunds).
   441  
   442  ###### Query String Parameters
   443  ```
   444  // Number of siafunds being sent.
   445  amount      // siafunds
   446  
   447  // Address that is receiving the funds.
   448  destination // address
   449  ```
   450  
   451  ###### JSON Response
   452  ```javascript
   453  {
   454    // Array of IDs of the transactions that were created when sending the coins.
   455    // The last transaction contains the output headed to the 'destination'.
   456    // Transaction IDs are 64 character long hex strings.
   457    "transactionids": [
   458      "1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
   459      "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
   460      "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
   461    ]
   462  }
   463  ```
   464  
   465  #### /wallet/siagkey [POST]
   466  
   467  Function: Load a key into the wallet that was generated by siag. Most siafunds
   468  are currently in addresses created by siag.
   469  
   470  ###### Query String Parameters
   471  ```
   472  // Key that is used to encrypt the siag key when it is imported to the wallet.
   473  encryptionpassword
   474  
   475  // List of filepaths that point to the keyfiles that make up the siag key.
   476  // There should be at least one keyfile per required signature. The filenames
   477  // need to be commna separated (no spaces), which means filepaths that contain
   478  // a comma are not allowed.
   479  keyfiles
   480  ```
   481  
   482  ###### Response
   483  standard success or error response. See
   484  [API.md#standard-responses](/doc/API.md#standard-responses).
   485  
   486  #### /wallet/sweep/seed [POST]
   487  
   488  Function: Scan the blockchain for outputs belonging to a seed and send them to
   489  an address owned by the wallet.
   490  
   491  ###### Query String Parameters
   492  ```
   493  // Name of the dictionary that should be used when decoding the seed. 'english'
   494  // is the most common choice when picking a dictionary.
   495  dictionary // Optional, default is english.
   496  
   497  // Dictionary-encoded phrase that corresponds to the seed being added to the
   498  // wallet.
   499  seed
   500  ```
   501  
   502  ###### JSON Response
   503  ```javascript
   504  {
   505    // Number of siacoins, in hastings, transferred to the wallet as a result of
   506    // the sweep.
   507    "coins": "123456", // hastings, big int
   508  
   509    // Number of siafunds transferred to the wallet as a result of the sweep.
   510    "funds": "1", // siafunds, big int
   511  }
   512  ```
   513  
   514  #### /wallet/lock [POST]
   515  
   516  locks the wallet, wiping all secret keys. After being locked, the keys are
   517  encrypted. Queries for the seed, to send siafunds, and related queries become
   518  unavailable. Queries concerning transaction history and balance are still
   519  available.
   520  
   521  ###### Response
   522  standard success or error response. See
   523  [API.md#standard-responses](/doc/API.md#standard-responses).
   524  
   525  #### /wallet/transaction/___:id___ [GET]
   526  
   527  gets the transaction associated with a specific transaction id.
   528  
   529  ###### Path Parameters
   530  ```
   531  // ID of the transaction being requested.
   532  :id
   533  ```
   534  
   535  ###### JSON Response
   536  ```javascript
   537  {
   538    "transaction": {
   539      // Raw transaction. The rest of the fields in the resposne are determined
   540      // from this raw transaction. It is left undocumented here as the processed
   541      // transaction (the rest of the fields in this object) are usually what is
   542      // desired.
   543      "transaction": {
   544        // See types.Transaction in https://github.com/Synthesix/Sia/blob/master/types/transactions.go
   545      },
   546  
   547      // ID of the transaction from which the wallet transaction was derived.
   548      "transactionid": "1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
   549  
   550      // Block height at which the transaction was confirmed. If the transaction
   551      // is unconfirmed the height will be the max value of an unsigned 64-bit
   552      // integer.
   553      "confirmationheight": 50000,
   554  
   555      // Time, in unix time, at which a transaction was confirmed. If the
   556      // transaction is unconfirmed the timestamp will be the max value of an
   557      // unsigned 64-bit integer.
   558      "confirmationtimestamp": 1257894000,
   559  
   560      // Array of processed inputs detailing the inputs to the transaction.
   561      "inputs": [
   562        {
   563          // The id of the output being spent.
   564          "parentid": "1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
   565  
   566          // Type of fund represented by the input. Possible values are
   567          // 'siacoin input' and 'siafund input'.
   568          "fundtype": "siacoin input",
   569  
   570          // true if the address is owned by the wallet.
   571          "walletaddress": false,
   572  
   573          // Address that is affected. For inputs (outgoing money), the related
   574          // address is usually not important because the wallet arbitrarily
   575          // selects which addresses will fund a transaction.
   576          "relatedaddress": "1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   577  
   578          // Amount of funds that have been moved in the input.
   579          "value": "1234", // hastings or siafunds, depending on fundtype, big int
   580        }
   581      ],
   582      // Array of processed outputs detailing the outputs of the transaction.
   583      // Outputs related to file contracts are excluded.
   584      "outputs": [
   585        {
   586          // The id of the output that was created.
   587          "id": "1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
   588  
   589          // Type of fund is represented by the output. Possible values are
   590          // 'siacoin output', 'siafund output', 'claim output', and 'miner
   591          // payout'. Siacoin outputs and claim outputs both relate to siacoins.
   592          // Siafund outputs relate to siafunds. Miner payouts point to siacoins
   593          // that have been spent on a miner payout. Because the destination of
   594          // the miner payout is determined by the block and not the transaction,
   595          // the data 'maturityheight', 'walletaddress', and 'relatedaddress' are
   596          // left blank.
   597          "fundtype": "siacoin output",
   598  
   599          // Block height the output becomes available to be spent. Siacoin
   600          // outputs and siafund outputs mature immediately - their maturity
   601          // height will always be the confirmation height of the transaction.
   602          // Claim outputs cannot be spent until they have had 144 confirmations,
   603          // thus the maturity height of a claim output will always be 144 larger
   604          // than the confirmation height of the transaction.
   605          "maturityheight": 50000,
   606  
   607          // true if the address is owned by the wallet.
   608          "walletaddress": false,
   609  
   610          // Address that is affected. For outputs (incoming money), the related
   611          // address field can be used to determine who has sent money to the
   612          // wallet.
   613          "relatedaddress": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
   614  
   615          // Amount of funds that have been moved in the output.
   616          "value": "1234", // hastings or siafunds, depending on fundtype, big int
   617        }
   618      ]
   619    }
   620  }
   621  ```
   622  
   623  #### /wallet/transactions [GET]
   624  
   625  returns a list of transactions related to the wallet.
   626  
   627  ###### Query String Parameters
   628  ```
   629  // Height of the block where transaction history should begin.
   630  startheight // block height
   631  
   632  // Height of of the block where the transaction history should end. If
   633  // 'endheight' is greater than the current height, all transactions up to and
   634  // including the most recent block will be provided.
   635  endheight // block height
   636  ```
   637  
   638  ###### JSON Response
   639  ```javascript
   640  {
   641    // All of the confirmed transactions appearing between height 'startheight'
   642    // and height 'endheight' (inclusive).
   643    "confirmedtransactions": [
   644      {
   645        // See the documentation for '/wallet/transaction/:id' for more information.
   646      }
   647    ],
   648  
   649    // All of the unconfirmed transactions.
   650    "unconfirmedtransactions": [
   651      {
   652        // See the documentation for '/wallet/transaction/:id' for more information.
   653      }
   654    ]
   655  }
   656  ```
   657  
   658  #### /wallet/transactions/___:addr___ [GET]
   659  
   660  returns all of the transactions related to a specific address.
   661  
   662  ###### Path Parameters
   663  ```
   664  // Unlock hash (i.e. wallet address) whose transactions are being requested.
   665  :addr
   666  ```
   667  
   668  ###### JSON Response
   669  ```javascript
   670  {
   671    // Array of processed transactions that relate to the supplied address.
   672    "transactions": [
   673      {
   674        // See the documentation for '/wallet/transaction/:id' for more information.
   675      }
   676    ]
   677  }
   678  ```
   679  
   680  #### /wallet/unlock [POST]
   681  
   682  unlocks the wallet. The wallet is capable of knowing whether the correct
   683  password was provided.
   684  
   685  ###### Query String Parameters
   686  ```
   687  // Password that gets used to decrypt the file. Most frequently, the encryption
   688  // password is the same as the primary wallet seed.
   689  encryptionpassword string
   690  ```
   691  
   692  ###### Response
   693  standard success or error response. See
   694  [API.md#standard-responses](/doc/API.md#standard-responses).
   695  
   696  #### /wallet/verify/address/:addr [GET]
   697  
   698  takes the address specified by :addr and returns a JSON response indicating if the address is valid.
   699  
   700  ###### JSON Response
   701  ```javascript
   702  {
   703  	// valid indicates if the address supplied to :addr is a valid UnlockHash.
   704  	"valid": true
   705  }
   706  ```
   707  
   708  #### /wallet/changepassword [POST]
   709  
   710  changes the wallet's encryption password.
   711  
   712  ###### Query String Parameter
   713  ```
   714  // encryptionpassword is the wallet's current encryption password.
   715  encryptionpassword
   716  // newpassword is the new password for the wallet.
   717  newpassword
   718  ```
   719  
   720  ###### Response
   721  standard success or error response. See
   722  [#standard-responses](#standard-responses).