Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anterior Revisión previa
Próxima revisión
Revisión previa
api-wallet [2021/05/17 15:43]
YerkoBits
api-wallet [2021/12/30 01:21] (actual)
YerkoBits
Línea 1: Línea 1:
-<html> +Habilitar servicio de la billetera:  
-   <br><b>Simplewallet JSON RPC API :</b><br><br> + 
-   To start wallet JSON RPC API server you should specify a port on which server binds (additionally to standard wallet's arguments). You can choose any free port. To do that execute the following command from the command line:<br> +<code>prosus-wallet --rpc-bind-port=16191 --wallet-file=archivowallet --password=clavewallet --rpc-user=usuario --rpc-password=contrasena </code
-   <b>prosus-wallet --wallet-file example_wallet --pass 12345 --rpc-bind-port 16191</b><br+ 
-   Having done that you're ready to operate with the wallet through the following API URLs (e.g., your IP address/domain address is pool.prosus.money):<br> +Para comprobar si el servicio funciona:  
- <b>http://pool.prosus.money:16191/json_rpc<br> +    http://usuario:contrasena@localhost:16191/json_rpc 
- http://localhost:16191/json_rpc</b><br><br> + 
- <b>Available commands :</b> +----
- <ul><ul> +
-</html>+
  
 Los métodos vigentes están en  Los métodos vigentes están en 
Línea 24: Línea 22:
   * query_key   * query_key
   * reset   * reset
 +  * get_paymentid
 +Tenga en cuenta que no existe un método RPC para "actualización". La actualización de los datos RPC de la billetera se realiza automáticamente cada 20 segundos.
  
 +**Para ver ejemplos de uso, en distintos lenguajes de programación, visita nuestro [[https://github.com/ProsusCorp/prosusmoney-api|repositorio GitHub]]**
 +----
 <html> <html>
-<br> +<h3><a id="user-content-getbalance" class="anchor" href="#getbalance" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>getbalance</h3>
-<p>Please note, there is no "refresh" RPC method. RPC wallet refresh is performed automatically each 20 seconds.</p> +
-<h3> +
-<a id="user-content-getbalance" class="anchor" href="#getbalance" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>getbalance</h3>+
 <p>Return balance.</p> <p>Return balance.</p>
 <p>URL:</p> <p>URL:</p>
Línea 371: Línea 370:
 <pre><code> /json_rpc <pre><code> /json_rpc
 </code></pre> </code></pre>
 +
 +<hr></hr>
 +
 <p>Input example:</p> <p>Input example:</p>
 <pre><code>{   <pre><code>{  
Línea 460: Línea 462:
 } }
 </code></pre> </code></pre>
-<h3> +
-<a id="user-content-get_tx_key" class="anchor" href="#get_tx_key" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>get_tx_key</h3> +
-<p>Returns the transaction's secret key if it is stored in wallet's cache; which can be used to prove that you paid the receiver. The transaction ID and the receiver's public address are also needed as a parameter.</p> +
-<p>URL:</p> +
-<pre><code> /json_rpc +
-</code></pre> +
-<p>Input example:</p> +
-<pre><code>+
-  "jsonrpc": "2.0", +
-  "id": "test", +
-  "method": "get_tx_key", +
-  "params":+
-    "tx_hash": "F86EF58C98C724C2261F3EB009B47E475472F75D3B4B2FF0FC749D607367090D" +
-  } +
-+
-</code></pre> +
-<p>Output example:</p> +
-<pre><code>+
-   "id":"test", +
-   "jsonrpc":"2.0", +
-   "result":+
-      "tx_key":"f0eede5679da2c9cfcd06fb1961d64316e0d4dc54a308247319cb25220bf9503" +
-   } +
-+
-</code></pre>+
 <h3> <h3>
 <a id="user-content-query_key" class="anchor" href="#query_key" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>query_key</h3> <a id="user-content-query_key" class="anchor" href="#query_key" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>query_key</h3>
Línea 520: Línea 498:
 } }
 </code></pre> </code></pre>
-<h3> 
-<a id="user-content-estimate_fusion" class="anchor" href="#estimate_fusion" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>estimate_fusion</h3> 
-<p>Returns the fusion ready outputs count. Parameter <code>threshold</code> should be passed with threshold amount to optimize. If it is not passed it will estimate with default dust threshold.</p> 
-<p>URL:</p> 
-<pre><code> /json_rpc 
-</code></pre> 
-<p>Input example:</p> 
-<pre><code>{ 
-  "jsonrpc": "2.0", 
-  "id": "test", 
-  "method": "estimate_fusion", 
-  "params": { 
-    "threshold":100000000 
-  } 
-} 
-</code></pre> 
-<p>Output example:</p> 
-<pre><code>{ 
-  "id": "test", 
-  "jsonrpc": "2.0", 
-  "result": { 
-    "fusion_ready_count": 101 
-  } 
-} 
-</code></pre> 
-<h3> 
-<a id="user-content-send_fusion" class="anchor" href="#send_fusion" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>send_fusion</h3> 
-<p>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.</p> 
-<p>URL:</p> 
-<pre><code> /json_rpc 
-</code></pre> 
-<p>Input:</p> 
-<pre><code> { 
-  "$schema": "http://json-schema.org/draft-04/schema#", 
-  "title": "Prosus.Money wallet api", 
-  "description": "Schema for send fusion transaction method in Prosus.Money wallet", 
-  "type": "object", 
-   
-  "properties" : { 
-  "jsonrpc" : { 
-  "type" : "string" 
-  },  
-  "method" : { 
-  "type" : "string" 
-  }, 
-   
-  "threshold" : { 
-  "type" : "integer" 
-  }, 
- 
-  "mixin" : { 
-  "type" : "integer" 
-  }, 
-   
-  "unlock_time" : {  
-  "type" : "integer" 
-  "description" : "Unix timestamp" 
-  } 
-  } 
- } 
-</code></pre> 
-<p>Output:</p> 
-<pre><code> { 
-  "$schema": "http://json-schema.org/draft-04/schema#", 
-  "title": "Prosus.Money wallet api", 
-  "description": "Schema for send fusion transaction method in Prosus.Money wallet", 
-  "type": "object", 
-   
-  "properties" : { 
-  "tx_hash" : { 
-  "type" : "string" 
-  } 
-  } 
- } 
-</code></pre> 
-<h2> 
-<a id="user-content-examples" class="anchor" href="#examples" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Examples</h2> 
-<h3> 
-<a id="user-content-getbalance-1" class="anchor" href="#getbalance-1" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>getbalance</h3> 
-<pre><code> { 
-  "jsonrpc": "2.0",  
-  "method": "getbalance",  
-  "params": {} 
- } 
-</code></pre> 
-<h3> 
-<a id="user-content-transfer-1" class="anchor" href="#transfer-1" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>transfer</h3> 
-<p>Please note, payment_id is an optional argument and can be left out.</p> 
-<pre><code> { 
-  "jsonrpc":"2.0", 
-  "method":"transfer", 
-  "params":{ 
-  "destinations":[ 
-  { 
-  "amount":11111, 
-  "address":"Prosus1uvk3GCQ2SSHd3w9RjKRjkcHPJL7mKSy25twnH5nxSxehzad7WSUTfZob83dU59K8ojrd3PidXSkMDfrj1KhkJ4Lpt5e14" 
-  }, 
-  { 
-  "amount":22222, 
-  "address":"Prosus2GCQ2SSHd3w9RjKRjkcHPJL7mKSy25twnH5nuvk3xSxehzad7WSUTfZob83dU59K8ojrd3PidXSkMDfrj1KhkJ4Lpt5e14" 
-  } 
-  ], 
-  "payment_id":"",  
-  "fee":1000000, 
-  "mixin":0, 
-  "unlock_time":0 
-  } 
- } 
-</code></pre> 
-<h3> 
-<a id="user-content-store-1" class="anchor" href="#store-1" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>store</h3> 
-<pre><code> { 
-  "jsonrpc": "2.0",  
-  "method": "store",  
-  "params": {} 
- } 
-</code></pre> 
-<h3> 
-<a id="user-content-reset-1" class="anchor" href="#reset-1" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>reset</h3> 
-<pre><code> { 
-  "jsonrpc": "2.0",  
-  "method": "reset",  
-  "params": {} 
- } 
-</code></pre> 
-<h3> 
-<a id="user-content-get_payments-1" class="anchor" href="#get_payments-1" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>get_payments</h3> 
-<pre><code> { 
-  "jsonrpc":"2.0", 
-  "method":"get_payments", 
-  "params":{ 
-  "payment_id": "78cc4b76a48bd50ab955ac61a0c04e4a82079fbcf27298f87b39c76aefccbcc9" 
-  } 
- } 
-</code></pre> 
-<h3> 
-<a id="user-content-get_transfers-1" class="anchor" href="#get_transfers-1" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>get_transfers</h3> 
-<pre><code> { 
-  "jsonrpc": "2.0",  
-  "method": "get_transfers",  
-  "params": {} 
- } 
-</code></pre> 
-<h3> 
-<a id="user-content-get_height-1" class="anchor" href="#get_height-1" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>get_height</h3> 
-<pre><code> { 
-  "jsonrpc": "2.0",  
-  "method": "get_height",  
-  "params": {} 
- } 
-</code></pre> 
-<h3> 
-<a id="user-content-send_fusion-1" class="anchor" href="#send_fusion-1" aria-hidden="true"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>send_fusion</h3> 
-<p>Input example:</p> 
-<pre><code>{ 
-  "jsonrpc": "2.0", 
-  "id": "test", 
-  "method": "send_fusion", 
-  "params": { 
-    "threshold":100000000, 
-    "mixin":3, 
-    "unlock_time":0 
-  } 
-} 
-</code></pre> 
-<p>Output example:</p> 
-<pre><code>{ 
-  "id": "test", 
-  "jsonrpc": "2.0", 
-  "result": { 
-    "tx_hash": "2bc081ba8fcd29ce254d0db28c5568489be19121be74d5a2577dbf969330eb30" 
-  } 
-} 
-</code></pre> 
-                             
  
-                    <!-- END ARTICLE --> 
 </html> </html>