|
| 1 | +## Check documentation against Core help output |
| 2 | + |
| 3 | +Compare this documentation |
| 4 | +``` |
| 5 | +INSERT MARKDOWN TABLE FROM DOCS HERE |
| 6 | +``` |
| 7 | + |
| 8 | +With the actual help output |
| 9 | +``` |
| 10 | +INSERT "HELP <RPCNAME>" OUTPUT HERE |
| 11 | +``` |
| 12 | + |
| 13 | +Only list any discrepancies (including parameters and/or response fields that have changed to be deprecated) and output markdown table entries in a copyable code block for items missing from the documentation. Use field descriptions from the provided help output without modifying them. |
| 14 | + |
| 15 | +## Remove the excess whitespace at the end of tables |
| 16 | + |
| 17 | +Remove the whitespace padding from the last column of this markdown table. do not worry about alignment of the end of the line but do include the ending "|" with a single space before it |
| 18 | + |
| 19 | +## Create documentation for a new RPC |
| 20 | + |
| 21 | +Use this RPC documentation as a template to create documentation for new RPCs: |
| 22 | + |
| 23 | +```## ImportMulti |
| 24 | +
|
| 25 | +:::{note} |
| 26 | +Requires [wallet](../resources/glossary.md#wallet) support (**unavailable on masternodes**). Wallet must be unlocked. |
| 27 | +::: |
| 28 | +
|
| 29 | +_Added in Dash Core 0.12.3 / Bitcoin Core 0.14.0_ |
| 30 | +
|
| 31 | +The [`importmulti` RPC](../api/remote-procedure-calls-wallet.md#importmulti) imports addresses or scripts (with private keys, public keys, or P2SH redeem scripts) and optionally performs the minimum necessary rescan for all imports. |
| 32 | +
|
| 33 | +_Parameter #1---the addresses/scripts to import_ |
| 34 | +
|
| 35 | +| Name | Type | Presence | Description| |
| 36 | +| --------------------- | --------------------- | ----------------------- | -----------| |
| 37 | +| Imports | array | Required<br>(exactly 1) | An array of JSON objects, each one being an address or script to be imported | |
| 38 | +| → Import | object | Required<br>(1 or more) | A JSON object describing a particular import | |
| 39 | +| → →<br>`scriptPubKey` | string (hex) | Optional<br>(0 or 1) | The script (string) to be imported. Must have either this field or `address` below | |
| 40 | +| → →<br>`address` | string (base58) | Optional<br>(0 or 1) | The P2PKH or P2SH address to be imported. Must have either this field or `scriptPubKey` above | |
| 41 | +| → →<br>`timestamp` | number (int) / string | Required<br>(exactly 1) | The creation time of the key in Unix epoch time or the string “now” to substitute the current synced block chain time. The timestamp of the oldest key will determine how far back block chain rescans need to begin. Specify `now` to bypass scanning for keys which are known to never have been used. Specify `0` to scan the entire block chain. Blocks up to 2 hours before the earliest key creation time will be scanned | |
| 42 | +| → →<br>`redeemscript` | string | Optional<br>(0 or 1) | A redeem script. Only allowed if either the `address` field is a P2SH address or the `scriptPubKey` field is a P2SH scriptPubKey | |
| 43 | +| → →<br>`pubkeys` | array | Optional<br>(0 or 1) | Array of strings giving pubkeys that must occur in the scriptPubKey or redeemscript | |
| 44 | +| → →<br>`keys` | array | Optional<br>(0 or 1) | Array of strings giving private keys whose corresponding public keys must occur in the scriptPubKey or redeemscript | |
| 45 | +| → →<br>`internal` | bool | Optional<br>(0 or 1) | Stating whether matching outputs should be treated as change rather than incoming payments. The default is `false` | |
| 46 | +| → →<br>`watchonly` | bool | Optional<br>(0 or 1) | Stating whether matching outputs should be considered watched even when they're not spendable. This is only allowed if keys are empty. The default is `false` | |
| 47 | +| → →<br>`label` | string | Optional<br>(0 or 1) | Label to assign to the address, only allowed with `internal` set to `false`. The default is an empty string (“”) | |
| 48 | +
|
| 49 | +_Parameter #2---options regarding the import_ |
| 50 | +
|
| 51 | +| Name | Type | Presence | Description | |
| 52 | +| -------------- | ------ | -------------------- | ----------- | |
| 53 | +| Option | object | Optional<br>(0 or 1) | JSON object with options regarding the import | |
| 54 | +| → <br>`rescan` | bool | Optional<br>(0 or 1) | Set to `true` (the default) to rescan the entire local block chain for transactions affecting any imported address or script. Set to `false` to not rescan after the import. Rescanning may take a considerable amount of time and may require re-downloading blocks if using block chain pruning | |
| 55 | +
|
| 56 | +_Result---execution result_ |
| 57 | +
|
| 58 | +| Name | Type | Presence | Description | |
| 59 | +| ------------------- | --------------- | ----------------------- | ----------------------------------------------------------------------------------------- | |
| 60 | +| `result` | array | Required<br>(exactly 1) | An array of JSON objects, with each object describing the execution result of each import | |
| 61 | +| → Result | object | Required<br>(1 or more) | A JSON object describing the execution result of an imported address or script | |
| 62 | +| → → <br>`success` | string | Required<br>(exactly 1) | Displays `true` if the import has been successful or `false` if it failed | |
| 63 | +| → → <br>`error` | string : object | Optional<br>(0 or 1) | A JSON object containing details about the error. Only displayed if the import fails | |
| 64 | +| → → → <br>`code` | number (int) | Optional<br>(0 or 1) | The error code | |
| 65 | +| → → → <br>`message` | string | Optional<br>(0 or 1) | The error message | |
| 66 | +
|
| 67 | +_Example from Dash Core 0.12.3_ |
| 68 | +
|
| 69 | +Import the address `ycCsAUKsjdmoP4qAXiS1cjYA4ixM48zJWe` (giving it a label and scanning the entire block chain) and the scriptPubKey `76a9146cf5870411edc31ba5630d61c7cddff55b884fda88ac` (giving a specific timestamp and label): |
| 70 | +
|
| 71 | +```bash |
| 72 | +dash-cli importmulti ' |
| 73 | + [ |
| 74 | + { |
| 75 | + "scriptPubKey" : { "address": "ycCsAUKsjdmoP4qAXiS1cjYA4ixM48zJWe" }, |
| 76 | + "timestamp" : 0, |
| 77 | + "label" : "Personal" |
| 78 | + }, |
| 79 | + { |
| 80 | + "scriptPubKey" : "76a9146cf5870411edc31ba5630d61c7cddff55b884fda88ac", |
| 81 | + "timestamp" : 1493912405, |
| 82 | + "label" : "TestFailure" |
| 83 | + } |
| 84 | + ]' '{ "rescan": true }' |
| 85 | +``` |
| 86 | + |
| 87 | +Result (scriptPubKey import failed because `internal` was not set to `true`): |
| 88 | + |
| 89 | +```json |
| 90 | +[ |
| 91 | + { |
| 92 | + "success": true |
| 93 | + }, |
| 94 | + { |
| 95 | + "success": false, |
| 96 | + "error": { |
| 97 | + "code": -8, |
| 98 | + "message": "Internal must be set for hex scriptPubKey" |
| 99 | + } |
| 100 | + } |
| 101 | +] |
| 102 | +``` |
| 103 | + |
| 104 | +_See also_ |
| 105 | + |
| 106 | +* [ImportPrivKey](../api/remote-procedure-calls-wallet.md#importprivkey): adds a private key to your wallet. The key should be formatted in the wallet import format created by the [`dumpprivkey` RPC](../api/remote-procedure-calls-wallet.md#dumpprivkey). |
| 107 | +* [ImportAddress](../api/remote-procedure-calls-wallet.md#importaddress): adds an address or pubkey script to the wallet without the associated private key, allowing you to watch for transactions affecting that address or pubkey script without being able to spend any of its outputs. |
| 108 | +* [ImportWallet](../api/remote-procedure-calls-wallet.md#importwallet): imports private keys from a file in wallet dump file format (see the [`dumpwallet` RPC](../api/remote-procedure-calls-wallet.md#dumpwallet)). These keys will be added to the keys currently in the wallet. This call may need to rescan all or parts of the block chain for transactions affecting the newly-added keys, which may take several minutes. |
| 109 | +``` |
| 110 | +
|
| 111 | +
|
| 112 | +Create documentation for the following new RPC using the style of previously provided RPC documentation as a template: |
| 113 | +
|
| 114 | +``` |
| 115 | +INSERT "HELP <RPCNAME>" OUTPUT HERE |
| 116 | +``` |
0 commit comments