¡Esta es una revisión vieja del documento!


Prosus-Wallet commands & JSON RPC API


General options:
--help   =   Produce help message
--version   =   Output version information
--config-file arg   =   Specify configuration file

Wallet options :
--wallet-file arg   =   Use wallet
--generate-new-wallet arg   =   Generate new wallet and save it to
--restore-deterministic-wallet   =   Recover wallet using electrum-style mnemonic
--non-deterministic   =   Creates non-deterministic (classic) view and spend keys
--mnemonic-seed arg   =   Specify mnemonic seed for wallet recovery/creation
--password arg   =   Wallet password
--change-password arg   =   Change wallet password and exit
--daemon-address arg   =   Use daemon instance at :
--daemon-host arg   =   Use daemon instance at host instead of localhost
--daemon-port arg (=0)   =   Use daemon instance at port instead of 18230
--command arg
--log-file arg   =   Set the log file location
--log-level arg   =   Set the log verbosity level
--testnet   =   Used to deploy test nets. The daemon must be launched with --testnet flag
--reset   =   Discard cache data and start synchronizing from scratch
--rpc-bind-ip arg (=127.0.0.1)   =   Specify IP to bind RPC server to.
--rpc-bind-port arg   =   Starts wallet as RPC server for wallet operations, sets bind port for server.
--rpc-user arg   =   Username to use with the RPC server. If empty, no server authorization will be done.
--rpc-password arg   =   Password to use with the RPC server. If empty, no server authorization will be done.

Commands :
address   =   Show current wallet public address
balance   =   Show current wallet balance
bc_height   =   Show blockchain height
exit   =   Close wallet
export_keys   =   Show the secret keys of the opened wallet
help   =   Show help
incoming_transfers   =   Show incoming transfers
list_transfers   =   Show all known transfers
outgoing_transfers   =   Show outgoing transfers
password   =   Change password
payment_id   =   Generate random Payment ID
payments   =   payments [ ... ] - Show payments , ...
reset   =   Discard cache data and start synchronizing from the start
save   =   Save wallet synchronized data
set_log   =   set_log - Change current log level, is a number 0-4
show_seed   =   Get wallet recovery phrase (deterministic seed)
sweep_dust   =   Sweep unmixable dust
tracking_key   =   Show the tracking key of the opened wallet
transfer   =   transfer [ ... ] [-p payment_id] [-f fee] - Transfer ,... to ,... , respectively. is the number of transactions yours is indistinguishable from (from 0 to maximum available)



Simplewallet JSON RPC API :

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:
prosus-wallet --wallet-file example_wallet --pass 12345 --rpc-bind-port 16191
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):
http://pool.prosus.money:16191/json_rpc
http://localhost:16191/json_rpc


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 "refresh" RPC method. RPC wallet refresh is performed automatically each 20 seconds.

      getbalance

      Return balance.

      URL:

       /json_rpc
      

      Input:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object", 
       	
       	"properties" : {
       		"jsonrpc" : {
       			"type" : "string"
       		}, 
       		"method" : {
       			"type" : "string"
       		}
       	}
       }
      

      Output:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       	
       	"properties" : {
       		"locked_amount" : {
       			"type" : "integer"
       		},
       		"available_balance" : {
       			"type" : "integer"
       		}
       	}
       }
      

      transfer

      Transfer money to several destinations with specified fee, mixin ambiguity degree, and unlock time.

      Please note: fee param is a mandatory and should not be less than current minimal fee which can be obtained from node.

      URL:

       /json_rpc
      

      Input:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       	
       	"properties" : {
       		"jsonrpc" : {
       			"type" : "string"
       		}, 
       		"method" : {
       			"type" : "string"
       		},
       		"destinations" : {
       			"type" : "array",
       			"items" : {
       				"amount" : {
       					"type" : "integer"
       				},
       				"address" : {
       					"type" : "string"
       				}
       			},
       			"minItems" : 1
       		},
       
       		"payment_id": {
       			"type" : "string"
       		}
       	
       		"fee" : {
       			"type" : "integer"
       		},
       		
       		"mixin" : {
       			"type" : "integer"
       		},
       		
       		"unlock_time" : { 
       			"type" : "integer"
       			"description" : "Unix timestamp"
       		}
       	}
       }
      

      Output:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       	
       	"properties" : {
       		"tx_hash" : {
       			"type" : "string"
       		}, 
       		"tx_key" : {
       			"type" : "string"
       		},
       	}
       }
      

      store

      Store wallet data.

      URL:

        /json_rpc
      

      Input:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       	
       	"properties" : {
       		"jsonrpc" : {
       			"type" : "string"
       		}, 
       		"method" : {
       			"type" : "string"
       		}
       	}
       }
      

      Output:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       	
       	"properties" : {}
       }
      

      reset

      Erases simplewallet's internal state but keeps safe the wallet.bin. The method should be used to re-synchronize the wallet from scratch. The next refresh (which is automatically called each 20 seconds) will update the simplewallet state.

      URL:

       /json_rpc
      

      Input:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       	
       	"properties" : {
       		"jsonrpc" : {
       			"type" : "string"
       		}, 
       		"method" : {
       			"type" : "string"
       		}
       	}
       }
      

      Output:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       	
       	"properties" : {}
       }
      

      get_payments

      Receives all the payments with a corresponding payment_id that were sent to the wallet. This method is used to get the xPR (prosus) payments for the 3rd party services. As Prosus.Money uses only one address to receive xPR deposits, a unique payment_id should be assigned and shown to each user. The method will return all the payments for this user.

      URL:

       /json_rpc
      

      Input:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object", 
       
       	"properties" : {
       		"jsonrpc" : {
       			"type" : "string"
       		}, 
       		"method" : {
       			"type" : "string"
       		},
       
       		"payment_id" :  {
       			"type" : "string"
       		}
       	}
       }
      

      Output:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       
       	"properties" : {
       		"payments" : {
       			"type" : "array",
       			"items" : {
       				"amount" : {
       					"type" : "integer"
       				},
       				"block_height" : {
       					"type" : "integer"
       				},
       				"tx_hash" : {
       					"type" : "string"
       				},
       				"unlock_time" : {
       					"type" : "integer"
       				}
       			}
       		}
       	}
       }
      

      get_transfers

      Returns the list of all the wallet's incoming and outgoing transfers. This data is available starting from v.1.0.2 build. For the transfers created by simplewallet of previous versions this method returns not exact transfers amounts but the transaction amounts (transfer amount + change).

      URL:

       /json_rpc
      

      Input:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       	
       	"properties" : {
       		"jsonrpc" : {
       			"type" : "string"
       		}, 
       		"method" : {
       			"type" : "string"
       		}
       	}
       }
      

      Output:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       
       	"properties" : {
       		"result" : {
       			"type" : "transfers"
       			"transfers" : {
       				"type" : "array",
       				"items" : {
       					"address" : {
       						"type" : "string"
       					},
       					"amount" : {
       						"type" : "integer"
       					},
       					"blockIndex" : {
       						"type" : "integer"
       					},
       					"fee" : {
       						"type" : "integer"
       					},
       					"output" : {
       						"type" : "boolean"
       					},
       					"paymentId" : {
       						"type" : "string"
       					},
       					"time" : {
       						"type" : "integer"
       					},
       					"transactionHash" : {
       						"type" : "string"
       					},
       					"unlockTime" : {
       						"type" : "integer"
       					},
       				}				
       			}				
       		}
       	}
       }
      

      get_height

      Returns the last top known block height for simplewallet. This method can be used to verify that simplewallet is correctly synchronized.

      URL:

       /json_rpc
      

      Input:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       	
       	"properties" : {
       		"jsonrpc" : {
       			"type" : "string"
       		}, 
       		"method" : {
       			"type" : "string"
       		}
       	}
       }
      

      Output:

       {
       	"$schema": "http://json-schema.org/draft-04/schema#",
       	"title": "Prosus.Money wallet api",
       	"description": "Schema for transfer method in Prosus.Money wallet",
       	"type": "object",
       	
       	"properties" : {
       		"height" : {
       			"type" : "integer"
       		}
       	}
       }
      

      get_transaction

      Returns the transaction details.

      URL:

       /json_rpc
      

      Input example:

      {  
         "jsonrpc":"2.0",
         "id":"test",
         "method":"get_transaction",
        "params":{  
            "tx_hash":"b0285cacb20ec402d56e4b87f629afc5ee6b19cf7a790a226173cb03c2615a31"
         }
       }
      

      Output example:

      {
         "id":"test",
         "jsonrpc":"2.0",
         "result":{
            "destinations":[
               {
                 "address":"Prosus2uvk3GCQ2SSHd3w9RjKRjkcHPJL7mKSy25twnH5nxSxehzad7WSUTfZob83dU59K8ojrd3PidXSkMDfrj1KhkJ4Lpt5e14A",
                  "amount":2010542676062
               },
               {
                  "address":"Prosus1EFCREFuMHPwWTJ217xsTcEdgqqTBsnuvZtk6ujYnXBkwHSNHAgH3ajVGRJLTfSAKLRxDH4EdVNQtYcNJM97ycCSJCSwA4pA",
                  "amount":57000000000
               }
            ],
            "transaction_details":{
               "address":"Prosus23GCQ2SSHd3w9RjKRjkcHPJL7mKSyuvk25twnH5nxSxehzad7WSUTfZob83dU59K8ojrd3PidXSkMDfrj1KhkJ4Lpt5e14",
               "amount":2124542676062,
               "blockIndex":271652,
               "confirmations":25433,
               "fee":57000000000,
               "output":true,
               "paymentId":"",
               "time":1536706367,
               "transactionHash":"b0285cacb20ec402d56e4b87f629afc5ee6b19cf7a790a226173cb03c2615a31",
               "txKey":"d2854e0414154881005254e6a80f94db7248712a7f4e212c1100519a673a48a3",
               "unlockTime":0
            }
         }
      }
      

      get_address

      Returns the wallet's public address.

      URL:

       /json_rpc
      

      Input example:

      {  
         "jsonrpc":"2.0",
         "id":"test",
         "method":"get_address",
        "params":{  
         }
       }
      

      Output example:

      {
         "id":"test",
         "jsonrpc":"2.0",
         "result":{
            "address":"Prosus1uvk3GCQ2SSHd3w9RjKRjkcHPJL7mKSy25twnH5nxSxehzad7WSUTfZob83dU59K8ojrd3PidXSkMDfrj1KhkJ4Lpt5e14"
         }
      }
      

      get_paymentid

      Returns the new randomly generated Payment ID.

      URL:

       /json_rpc
      

      Input example:

      {  
         "jsonrpc":"2.0",
         "id":"test",
         "method":"get_paymentid",
        "params":{  
         }
       }
      

      Output example:

      {
         "id":"test",
         "jsonrpc":"2.0",
         "result":{
            "payment_id":"f373ff6def6499f7984d448808f5f24221fc690c231b76e6916b4c00cffe439b"
         }
      }
      

      get_tx_key

      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.

      URL:

       /json_rpc
      

      Input example:

      {
        "jsonrpc": "2.0",
        "id": "test",
        "method": "get_tx_key",
        "params": {
          "tx_hash": "F86EF58C98C724C2261F3EB009B47E475472F75D3B4B2FF0FC749D607367090D"
        }
      }
      

      Output example:

      {
         "id":"test",
         "jsonrpc":"2.0",
         "result":{
            "tx_key":"f0eede5679da2c9cfcd06fb1961d64316e0d4dc54a308247319cb25220bf9503"
         }
      }
      

      query_key

      Returns the wallets private keys. Key type should be passed in params. Available key types: paperwallet and mnemonic.

      URL:

       /json_rpc
      

      Input example:

      {
        "jsonrpc": "2.0",
        "id": "test",
        "method": "query_key",
        "params": {
          "key_type": "mnemonic"
        }
      }
      

      Error output example:

      {
         "error":{
            "code":-1,
            "message":"The wallet is non-deterministic. Cannot display seed."
         },
         "id":"test",
         "jsonrpc":"2.0"
      }
      

      Output example:

      {
         "id":"test",
         "jsonrpc":"2.0",
         "result":{
            "key":"KaqCQ..."
         }
      }
      

      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:

      {
        "jsonrpc": "2.0",
        "id": "test",
        "method": "estimate_fusion",
        "params": {
          "threshold":100000000
        }
      }
      

      Output example:

      {
        "id": "test",
        "jsonrpc": "2.0",
        "result": {
          "fusion_ready_count": 101
        }
      }
      

      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:

       {
       	"$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"
       		}
       	}
       }
      

      Output:

       {
       	"$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"
       		}
       	}
       }
      

      Examples

      getbalance

       {
       	"jsonrpc": "2.0", 
       	"method": "getbalance", 
       	"params": {}
       }
      

      transfer

      Please note, payment_id is an optional argument and can be left out.

       {
       	"jsonrpc":"2.0",
       	"method":"transfer",
       	"params":{
       		"destinations":[
       		{
       			"amount":11111,
       			"address":"Prosus1uvk3GCQ2SSHd3w9RjKRjkcHPJL7mKSy25twnH5nxSxehzad7WSUTfZob83dU59K8ojrd3PidXSkMDfrj1KhkJ4Lpt5e14"
       		},
       		{
       			"amount":22222,
       			"address":"Prosus2GCQ2SSHd3w9RjKRjkcHPJL7mKSy25twnH5nuvk3xSxehzad7WSUTfZob83dU59K8ojrd3PidXSkMDfrj1KhkJ4Lpt5e14"
       		}
       		],
       		"payment_id":"", 
       		"fee":1000000,
       		"mixin":0,
       		"unlock_time":0
       	}
       }
      

      store

       {
       	"jsonrpc": "2.0", 
       	"method": "store", 
       	"params": {}
       }
      

      reset

       {
       	"jsonrpc": "2.0", 
       	"method": "reset", 
       	"params": {}
       }
      

      get_payments

       {
       	"jsonrpc":"2.0",
       	"method":"get_payments",
       	"params":{
       		"payment_id": "78cc4b76a48bd50ab955ac61a0c04e4a82079fbcf27298f87b39c76aefccbcc9"
       	}
       }
      

      get_transfers

       {
       	"jsonrpc": "2.0", 
       	"method": "get_transfers", 
       	"params": {}
       }
      

      get_height

       {
       	"jsonrpc": "2.0", 
       	"method": "get_height", 
       	"params": {}
       }
      

      send_fusion

      Input example:

      {
        "jsonrpc": "2.0",
        "id": "test",
        "method": "send_fusion",
        "params": {
          "threshold":100000000,
          "mixin":3,
          "unlock_time":0
        }
      }
      

      Output example:

      {
        "id": "test",
        "jsonrpc": "2.0",
        "result": {
          "tx_hash": "2bc081ba8fcd29ce254d0db28c5568489be19121be74d5a2577dbf969330eb30"
        }
      }