Diferencias
Muestra las diferencias entre dos versiones de la página.
Próxima revisión | Revisión previa | ||
api-wallet [2018/12/31 00:01] YerkoBits creado |
api-wallet [2021/12/30 01:21] (actual) YerkoBits |
||
---|---|---|---|
Línea 1: | Línea 1: | ||
- | FIXME | + | Habilitar servicio de la billetera: |
- | To start wallet JSON RPC API server you should specify a port on which server binds (additionally to standard wallet' | + | |
- | ``` | + | < |
- | | + | Para comprobar si el servicio funciona: |
- | ``` | + | http://usuario:contrasena@localhost:16191/json_rpc |
- | Having done that you're ready to operate with the wallet through the following API URLs (e.g., your IP address is 95.46.98.64): | + | |
- | ``` | + | |
- | http://95.46.98.64:32348/ | + | |
- | | + | |
- | ``` | + | |
- | ## Available commands ## | + | |
- | * getbalance | + | ---- |
- | * transfer | + | |
- | * store | + | |
- | * reset | + | |
- | * get_payments | + | |
- | * get_transfers | + | |
- | * get_height | + | |
- | * get_transaction | + | |
- | * get_address | + | |
- | * get_paymentid | + | |
- | * get_tx_key | + | |
- | * query_key | + | |
- | * sign_message | + | |
- | * verify_message | + | |
- | * change_password | + | |
- | * estimate_fusion | + | |
- | * send_fusion | + | |
- | Please note, there is no " | + | Los métodos vigentes están en |
+ | https:// | ||
+ | * getbalance | ||
+ | * transfer | ||
+ | * store | ||
+ | * stop_wallet | ||
+ | * get_payments | ||
+ | * get_transfers | ||
+ | * get_transaction | ||
+ | * get_height | ||
+ | * get_address | ||
+ | * query_key | ||
+ | * reset | ||
+ | * get_paymentid | ||
+ | Tenga en cuenta que no existe un método RPC para " | ||
- | ### getbalance ### | + | **Para ver ejemplos de uso, en distintos lenguajes de programación, |
- | + | ---- | |
- | Return balance. | + | < |
- | + | < | |
- | URL: | + | <p>Return balance.</p> |
- | ``` | + | <p>URL:</p> |
- | /json_rpc | + | < |
- | ``` | + | </ |
- | Input: | + | <p>Input:</p> |
- | ``` | + | < |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 59: | Línea 49: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | Output: | + | <p>Output:</p> |
- | ``` | + | < |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 77: | Línea 66: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | + | <h3> | |
- | ### transfer ### | + | <a id=" |
- | + | <p>Transfer money to several destinations with specified fee, mixin ambiguity degree, and unlock time.</p> | |
- | Transfer money to several destinations with specified fee, mixin ambiguity degree, and unlock time. | + | <p>Please note: fee param is a mandatory and should not be less than current minimal fee which can be obtained from node.</p> |
- | + | <p>URL:</p> | |
- | Please note: fee param is a mandatory and should not be less than current minimal fee which can be obtained from node. | + | < |
- | + | </ | |
- | URL: | + | <p>Input:</p> |
- | ``` | + | < |
- | /json_rpc | + | |
- | ``` | + | |
- | Input: | + | |
- | ``` | + | |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 135: | Línea 119: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | Output: | + | <p>Output:</p> |
- | ``` | + | < |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 153: | Línea 136: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | ### store ### | + | < |
- | + | <a id=" | |
- | Store wallet data. | + | <p>Store wallet data.</p> |
- | + | <p>URL:</p> | |
- | URL: | + | < |
- | ``` | + | </ |
- | / | + | <p>Input:</p> |
- | ``` | + | < |
- | Input: | + | |
- | ``` | + | |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 179: | Línea 159: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | Output: | + | <p>Output:</p> |
- | ``` | + | < |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
| | ||
} | } | ||
- | ``` | + | </ |
- | ### reset ### | + | < |
- | + | <a id=" | |
- | Erases simplewallet' | + | <p>Erases simplewallet' |
- | + | <p>URL:</p> | |
- | URL: | + | < |
- | ``` | + | </ |
- | /json_rpc | + | <p>Input:</p> |
- | ``` | + | < |
- | Input: | + | |
- | ``` | + | |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 216: | Línea 192: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | Output: | + | <p>Output:</p> |
- | ``` | + | < |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
| | ||
} | } | ||
- | ``` | + | </ |
- | + | <h3> | |
- | ### get_payments ### | + | <a id=" |
- | + | <p>Receives all the payments with a corresponding payment_id that were sent to the wallet. This method is used to get the xPR (prosus) | |
- | Receives all the payments with a corresponding payment_id that were sent to the wallet. This method is used to get the BCN payments for the 3rd party services. As Karbowanec | + | <p>URL:</p> |
- | + | < | |
- | URL: | + | </ |
- | ``` | + | <p>Input:</p> |
- | /json_rpc | + | < |
- | ``` | + | |
- | Input: | + | |
- | ``` | + | |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 258: | Línea 229: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | Output: | + | <p>Output:</p> |
- | ``` | + | < |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 287: | Línea 257: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | ### get_transfers ### | + | < |
- | + | <a id=" | |
- | Returns the list of all the wallet' | + | <p>Returns the list of all the wallet' |
- | + | <p>URL:</p> | |
- | URL: | + | < |
- | ``` | + | </ |
- | /json_rpc | + | <p>Input:</p> |
- | ``` | + | < |
- | Input: | + | |
- | ``` | + | |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 313: | Línea 280: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | Output: | + | <p>Output:</p> |
- | ``` | + | < |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 360: | Línea 326: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | ### get_height ### | + | < |
- | + | <a id=" | |
- | Returns the last top known block height for simplewallet. This method can be used to verify that simplewallet is correctly synchronized. | + | <p>Returns the last top known block height for simplewallet. This method can be used to verify that simplewallet is correctly synchronized.</p> |
- | + | <p>URL:</p> | |
- | URL: | + | < |
- | ``` | + | </ |
- | /json_rpc | + | <p>Input:</p> |
- | ``` | + | < |
- | Input: | + | |
- | ``` | + | |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 386: | Línea 349: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | Output: | + | <p>Output:</p> |
- | ``` | + | < |
- | { | + | |
| | ||
- | | + | |
- | | + | |
| | ||
Línea 401: | Línea 363: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | ### get_transaction ### | + | < |
+ | <a id=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
- | Returns the transaction details. | + | < |
- | URL: | + | <p>Input example:</p> |
- | ``` | + | < |
- | / | + | |
- | ``` | + | |
- | Input example: | + | |
- | ``` | + | |
- | { | + | |
" | " | ||
" | " | ||
" | " | ||
" | " | ||
- | " | + | " |
} | } | ||
} | } | ||
- | ``` | + | </ |
- | Output example: | + | <p>Output example:</p> |
- | ``` | + | < |
- | { | + | |
" | " | ||
" | " | ||
Línea 429: | Línea 390: | ||
" | " | ||
{ | { | ||
- | " | + | " |
" | " | ||
}, | }, | ||
{ | { | ||
- | " | + | " |
" | " | ||
} | } | ||
], | ], | ||
" | " | ||
- | " | + | " |
" | " | ||
" | " | ||
Línea 446: | Línea 407: | ||
" | " | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
} | } | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | ### get_address ### | + | < |
- | + | <a id=" | |
- | Returns the wallet' | + | <p>Returns the wallet' |
- | + | <p>URL:</p> | |
- | URL: | + | < |
- | ``` | + | </ |
- | /json_rpc | + | <p>Input example:</p> |
- | ``` | + | < |
- | Input example: | + | |
- | ``` | + | |
- | { | + | |
" | " | ||
" | " | ||
Línea 470: | Línea 428: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | Output example: | + | <p>Output example:</p> |
- | ``` | + | < |
- | { | + | |
" | " | ||
" | " | ||
" | " | ||
- | " | + | " |
} | } | ||
} | } | ||
- | ``` | + | </ |
- | ### get_paymentid ### | + | < |
- | + | <a id=" | |
- | Returns the new randomly generated Payment ID. | + | <p>Returns the new randomly generated Payment ID.</p> |
- | + | <p>URL:</p> | |
- | URL: | + | < |
- | ``` | + | </ |
- | /json_rpc | + | <p>Input example:</p> |
- | ``` | + | < |
- | Input example: | + | |
- | ``` | + | |
- | { | + | |
" | " | ||
" | " | ||
Línea 498: | Línea 452: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | Output example: | + | <p>Output example:</p> |
- | ``` | + | < |
- | { | + | |
" | " | ||
" | " | ||
Línea 508: | Línea 461: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | ### get_tx_key ### | + | |
- | Returns the transaction' | + | <h3> |
- | + | <a id="user-content-query_key" | |
- | URL: | + | <p>Returns the wallets private keys. Key type should be passed in params. Available key types: |
- | ``` | + | <p>URL:</p> |
- | / | + | < |
- | ``` | + | </ |
- | Input example: | + | <p>Input example:</p> |
- | ``` | + | < |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | } | + | |
- | ``` | + | |
- | Output example: | + | |
- | ``` | + | |
- | { | + | |
- | "id":"test", | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | } | + | |
- | } | + | |
- | ``` | + | |
- | ### query_key | + | |
- | + | ||
- | Returns the wallets private keys. Key type should be passed in params. Available key types: | + | |
- | + | ||
- | URL: | + | |
- | ``` | + | |
- | /json_rpc | + | |
- | ``` | + | |
- | Input example: | + | |
- | ``` | + | |
- | { | + | |
" | " | ||
" | " | ||
Línea 556: | Línea 478: | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
- | Error output example: | + | <p>Error output example:</p> |
- | ``` | + | < |
- | { | + | |
" | " | ||
" | " | ||
Línea 567: | Línea 488: | ||
" | " | ||
} | } | ||
- | ``` | + | </ |
- | Output example: | + | <p>Output example:</p> |
- | ``` | + | < |
- | { | + | |
" | " | ||
" | " | ||
Línea 577: | Línea 497: | ||
} | } | ||
} | } | ||
- | ``` | + | </code>< |
- | ### estimate_fusion ### | + | |
- | + | ||
- | Returns the fusion ready outputs count. Parameter `threshold` should be passed with threshold amount to optimize. If it is not passed it will estimate with default dust threshold. | + | |
- | + | ||
- | URL: | + | |
- | ``` | + | |
- | /json_rpc | + | |
- | ``` | + | |
- | Input example: | + | |
- | ``` | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | } | + | |
- | } | + | |
- | ``` | + | |
- | Output example: | + | |
- | ``` | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | } | + | |
- | } | + | |
- | ``` | + | |
- | ### send_fusion ### | + | |
- | + | ||
- | Optimize wallet (fuse many small outputs into fewer larger ones) to be able to send large amounts in a single transaction as with smaller inputs count its size will be smaller. | + | |
- | + | ||
- | URL: | + | |
- | ``` | + | |
- | /json_rpc | + | |
- | ``` | + | |
- | Input: | + | |
- | ``` | + | |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | | + | |
- | | + | |
- | | + | |
- | }, | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | } | + | |
- | } | + | |
- | ``` | + | |
- | Output: | + | |
- | ``` | + | |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | } | + | |
- | } | + | |
- | ``` | + | |
- | + | ||
- | + | ||
- | + | ||
- | ## Examples ## | + | |
- | + | ||
- | ### getbalance ### | + | |
- | ``` | + | |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | ``` | + | |
- | ### transfer ### | + | |
- | + | ||
- | Please note, payment_id is an optional argument and can be left out. | + | |
- | ``` | + | |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | { | + | |
- | | + | |
- | | + | |
- | } | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | } | + | |
- | ``` | + | |
- | ### store ### | + | |
- | ``` | + | |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | ``` | + | |
- | ### reset ### | + | |
- | ``` | + | |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | ``` | + | |
- | ### get_payments ### | + | |
- | ``` | + | |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | } | + | |
- | ``` | + | |
- | ### get_transfers ### | + | |
- | ``` | + | |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | ``` | + | |
- | ### get_height ### | + | |
- | ``` | + | |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | ``` | + | |
- | ### send_fusion ### | + | |
- | + | ||
- | Input example: | + | |
- | ``` | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | } | + | |
- | } | + | |
- | ``` | + | |
- | Output example: | + | |
- | ``` | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | } | + | |
- | } | + | |
- | ``` | + | |
+ | </ | ||