@@ -50,15 +50,15 @@ public void callback(int xcommandHandle, int err, String reqWithFeesJson, String
5050 };
5151
5252 /**
53- * Callback used when buildGetUtxoRequest completes.
53+ * Callback used when buildGetSourcesRequest completes.
5454 */
55- private static Callback buildGetUtxoRequestCb = new Callback () {
55+ private static Callback buildGetSourcesRequestCb = new Callback () {
5656 @ SuppressWarnings ({"unused" , "unchecked" })
57- public void callback (int xcommandHandle , int err , String utxoJson , String paymentMethod ) {
58- CompletableFuture <BuildGetUtxoRequestResult > future = (CompletableFuture <BuildGetUtxoRequestResult >) removeFuture (xcommandHandle );
57+ public void callback (int xcommandHandle , int err , String sourcesJson , String paymentMethod ) {
58+ CompletableFuture <BuildGetSourcesRequestResult > future = (CompletableFuture <BuildGetSourcesRequestResult >) removeFuture (xcommandHandle );
5959 if (!checkCallback (future , err )) return ;
6060
61- BuildGetUtxoRequestResult addRequestFeesResult = new BuildGetUtxoRequestResult ( utxoJson , paymentMethod );
61+ BuildGetSourcesRequestResult addRequestFeesResult = new BuildGetSourcesRequestResult ( sourcesJson , paymentMethod );
6262
6363 future .complete (addRequestFeesResult );
6464 }
@@ -175,11 +175,9 @@ public static CompletableFuture<String> listPaymentAddresses(
175175
176176 /**
177177 * Modifies Indy request by adding information how to pay fees for this transaction
178- * according to selected payment method.
179- *
180- * Payment selection is performed by looking to o
178+ * according to this payment method.
181179 *
182- * This method consumes set of UTXO inputs and outputs. The difference between inputs balance
180+ * This method consumes set of inputs and outputs. The difference between inputs balance
183181 * and outputs balance is the fee for this transaction.
184182 *
185183 * Not that this method also produces correct fee signatures.
@@ -189,20 +187,20 @@ public static CompletableFuture<String> listPaymentAddresses(
189187 *
190188 * Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
191189 * in the future releases.
190+ *
192191 * @param wallet The wallet.
193192 * @param submitterDid DID of request sender
194193 * @param reqJson initial transaction request as json
195- * @param inputsJson The list of UTXO inputs as json array:
196- * ["input1", ...]
197- * Notes:
198- * - each input should reference paymentAddress
199- * - this param will be used to determine payment_method
200- * @param outputsJson The list of UTXO outputs as json array:
201- * [{
202- * paymentAddress: <str>, // payment address used as output
203- * amount: <int>, // amount of tokens to transfer to this payment address
204- * extra: <str>, // optional data
205- * }]
194+ * @param inputsJson The list of payment sources as json array:
195+ * ["source1", ...]
196+ * - each input should reference paymentAddress
197+ * - this param will be used to determine payment_method
198+ * @param outputsJson The list of outputs as json array:
199+ * [{
200+ * recipient: <str>, // payment address of recipient
201+ * amount: <int>, // amount
202+ * extra: <str>, // optional data
203+ * }]
206204 * @return modified Indy request with added fees info
207205 * @throws IndyException
208206 */
@@ -244,12 +242,13 @@ public static CompletableFuture<AddRequestFeesResult> addRequestFees(
244242 * in the future releases.
245243 * @param paymentMethod
246244 * @param respJson response for Indy request with fees
247- * @return parsed (payment method and node version agnostic) utxo info as json:
248- * [{
249- * input: <str>, // UTXO input
250- * amount: <int>, // amount of tokens in this input
251- * extra: <str>, // optional data from payment transaction
252- * }]
245+ * @return receiptsJson - parsed (payment method and node version agnostic) receipts info as json:
246+ * [{
247+ * receipt: <str>, // receipt that can be used for payment referencing and verification
248+ * recipient: <str>, //payment address of recipient
249+ * amount: <int>, // amount
250+ * extra: <str>, // optional data from payment transaction
251+ * }]
253252 * @throws IndyException
254253 */
255254 public static CompletableFuture <String > parseResponseWithFees (
@@ -260,89 +259,91 @@ public static CompletableFuture<String> parseResponseWithFees(
260259 }
261260
262261 /**
263- * Builds Indy request for getting UTXO list for payment address
262+ * Builds Indy request for getting sources list for payment address
264263 * according to this payment method.
265264 *
266265 * Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
267266 * in the future releases.
267+ *
268268 * @param wallet The wallet.
269269 * @param submitterDid DID of request sender
270270 * @param paymentAddress target payment address
271- * @return Indy request for getting UTXO list for payment address
271+ * @return Indy request for getting sources list for payment address
272272 * @throws IndyException
273273 */
274- public static CompletableFuture <BuildGetUtxoRequestResult > buildGetUtxoRequest (
274+ public static CompletableFuture <BuildGetSourcesRequestResult > buildGetSourcesRequest (
275275 Wallet wallet ,
276276 String submitterDid ,
277277 String paymentAddress
278278 ) throws IndyException {
279279 ParamGuard .notNullOrWhiteSpace (submitterDid , "submitterDid" );
280280 ParamGuard .notNullOrWhiteSpace (paymentAddress , "paymentAddress" );
281281
282- CompletableFuture <BuildGetUtxoRequestResult > future = new CompletableFuture <>();
282+ CompletableFuture <BuildGetSourcesRequestResult > future = new CompletableFuture <>();
283283 int commandHandle = addFuture (future );
284284
285285 int walletHandle = wallet .getWalletHandle ();
286286
287- int result = LibIndy .api .indy_build_get_utxo_request (
287+ int result = LibIndy .api .indy_build_get_sources_request (
288288 commandHandle ,
289289 walletHandle ,
290290 submitterDid ,
291291 paymentAddress ,
292- buildGetUtxoRequestCb );
292+ buildGetSourcesRequestCb );
293293
294294 checkResult (result );
295295
296296 return future ;
297297 }
298298
299299 /**
300- * Parses response for Indy request for getting UTXO list.
300+ * Parses response for Indy request for getting sources list.
301301 *
302302 * Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
303303 * in the future releases.
304- * @param paymentMethod
305- * @param respJson response for Indy request for getting UTXO list
306- * @return parsed (payment method and node version agnostic) utxo info as json:
307- * [{
308- * input: <str>, // UTXO input
309- * amount: <int>, // amount of tokens in this input
310- * extra: <str>, // optional data from payment transaction
311- * }]
304+ *
305+ * @param paymentMethod payment method to use.
306+ * @param respJson response for Indy request for getting sources list
307+ * @return parsed (payment method and node version agnostic) sources info as json:
308+ * [{
309+ * source: <str>, // source input
310+ * paymentAddress: <str>, //payment address for this source
311+ * amount: <int>, // amount
312+ * extra: <str>, // optional data from payment transaction
313+ * }]
312314 * @throws IndyException
313315 */
314- public static CompletableFuture <String > parseGetUtxoResponse (
316+ public static CompletableFuture <String > parseGetSourcesResponse (
315317 String paymentMethod ,
316318 String respJson
317319 ) throws IndyException {
318- return parseResponse (paymentMethod , respJson , LibIndy .api ::indy_parse_get_utxo_response );
320+ return parseResponse (paymentMethod , respJson , LibIndy .api ::indy_parse_get_sources_response );
319321 }
320322
321323 /**
322- * Builds Indy request for doing tokens payment
324+ * Builds Indy request for doing payment
323325 * according to this payment method.
324326 *
325- * This method consumes set of UTXO inputs and outputs.
327+ * This method consumes set of inputs and outputs.
326328 *
327329 * Format of inputs is specific for payment method. Usually it should reference payment transaction
328330 * with at least one output that corresponds to payment address that user owns.
329331 *
330332 * Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
331333 * in the future releases.
334+ *
332335 * @param wallet The wallet.
333336 * @param submitterDid DID of request sender
334- * @param inputsJson The list of UTXO inputs as json array:
335- * ["input1", ...]
336- * Note that each input should reference paymentAddress
337- * @param outputsJson The list of UTXO outputs as json array:
338- * [{
339- * paymentAddress: <str>, // payment address used as output
340- * amount: <int>, // amount of tokens to transfer to this payment address
341- * extra: <str>, // optional data
342- * }]
343- * @return
344- * payment_req_json - Indy request for doing tokens payment
345- * payment_method
337+ * @param inputsJson The list of payment sources as json array:
338+ * ["source1", ...]
339+ * Note that each source should reference payment address
340+ * @param outputsJson The list of outputs as json array:
341+ * [{
342+ * recipient: <str>, // payment address of recipient
343+ * amount: <int>, // amount
344+ * extra: <str>, // optional data
345+ * }]
346+ * @return Indy request for doing payment
346347 * @throws IndyException
347348 */
348349 public static CompletableFuture <BuildPaymentReqResult > buildPaymentRequest (
@@ -378,14 +379,15 @@ public static CompletableFuture<BuildPaymentReqResult> buildPaymentRequest(
378379 *
379380 * Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
380381 * in the future releases.
381- * @param paymentMethod
382+ * @param paymentMethod payment method to use
382383 * @param respJson response for Indy request for payment txn
383- * @return parsed (payment method and node version agnostic) utxo info as json:
384- * [{
385- * input: <str>, // UTXO input
386- * amount: <int>, // amount of tokens in this input
387- * extra: <str>, // optional data from payment transaction
388- * }]
384+ * @return parsed (payment method and node version agnostic) receipts info as json:
385+ * [{
386+ * receipt: <str>, // receipt that can be used for payment referencing and verification
387+ * recipient: <str>, // payment address of recipient
388+ * amount: <int>, // amount
389+ * extra: <str>, // optional data from payment transaction
390+ * }]
389391 * @throws IndyException
390392 */
391393 public static CompletableFuture <String > parsePaymentResponse (
@@ -396,21 +398,21 @@ public static CompletableFuture<String> parsePaymentResponse (
396398 }
397399
398400 /**
399- * Builds Indy request for doing tokens minting
401+ * Builds Indy request for doing minting
400402 * according to this payment method.
401403 *
402404 * Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
403405 * in the future releases.
404406 *
405407 * @param wallet The wallet.
406408 * @param submitterDid DID of request sender
407- * @param outputsJson The list of UTXO outputs as json array:
408- * [{
409- * paymentAddress : <str>, // payment address used as output
410- * amount: <int>, // amount of tokens to transfer to this payment address
411- * extra: <str>, // optional data
412- * }]
413- * @return Indy request for doing tokens minting
409+ * @param outputsJson The list of outputs as json array:
410+ * [{
411+ * recipient : <str>, // payment address of recipient
412+ * amount: <int>, // amount
413+ * extra: <str>, // optional data
414+ * }]
415+ * @return Indy request for doing minting
414416 * @throws IndyException
415417 */
416418 public static CompletableFuture <BuildMintReqResult > buildMintRequest (
@@ -445,7 +447,7 @@ public static CompletableFuture<BuildMintReqResult> buildMintRequest(
445447 * in the future releases.
446448 * @param wallet The wallet.
447449 * @param submitterDid DID of request sender
448- * @param paymentMethod
450+ * @param paymentMethod payment method to use
449451 * @param feesJson {
450452 * txnType1: amount1,
451453 * txnType2: amount2,
@@ -490,7 +492,7 @@ public static CompletableFuture<String> buildSetTxnFeesRequest(
490492 * in the future releases.
491493 * @param wallet The wallet.
492494 * @param submitterDid DID of request sender
493- * @param paymentMethod
495+ * @param paymentMethod payment method to use
494496 * @return Indy request for getting fees for transactions in the ledger
495497 * @throws IndyException
496498 */
@@ -524,7 +526,7 @@ public static CompletableFuture<String> buildGetTxnFeesRequest(
524526 *
525527 * Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
526528 * in the future releases.
527- * @param paymentMethod
529+ * @param paymentMethod payment method to use
528530 * @param respJson response for Indy request for getting fees
529531 * @return fees_json {
530532 * txnType1: amount1,
0 commit comments