Struct indy::payments::Payment

source ·
pub struct Payment {}

Implementations

  • timeout - the maximum time this function waits for a response
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Create the payment address for specified payment method

This method generates private part of payment address and stores it in a secure place. Ideally it should be secret in libindy wallet (see crypto module).

Note that payment method should be able to resolve this secret by fully resolvable payment address format.

Arguments
  • wallet_handle - wallet handle where to save new address
  • payment_method - payment method to use (for example, ‘sov’)
  • config - payment address config as json
Example

config { seed: , // allows deterministic creation of payment address }

Returns
  • payment_address - public identifier of payment address in fully resolvable payment address format

Create the payment address for specified payment method

This method generates private part of payment address and stores it in a secure place. Ideally it should be secret in libindy wallet (see crypto module).

Note that payment method should be able to resolve this secret by fully resolvable payment address format.

Arguments
  • wallet_handle - wallet handle where to save new address
  • payment_method - payment method to use (for example, ‘sov’)
  • config - payment address config as json
  • timeout - the maximum time this function waits for a response
Example

config { seed: , // allows deterministic creation of payment address }

Returns
  • payment_address - public identifier of payment address in fully resolvable payment address format

Create the payment address for specified payment method

This method generates private part of payment address and stores it in a secure place. Ideally it should be secret in libindy wallet (see crypto module).

Note that payment method should be able to resolve this secret by fully resolvable payment address format.

Arguments
  • wallet_handle - wallet handle where to save new address
  • payment_method - payment method to use (for example, ‘sov’)
  • config - payment address config as json
  • closure - the closure that is called when finished
Example

config { seed: , // allows deterministic creation of payment address }

Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Lists all payment addresses that are stored in the wallet

Arguments
  • wallet_handle - wallet to search for payment_addresses
Returns
  • payment_addresses_json - json array of string with json addresses

Lists all payment addresses that are stored in the wallet

Arguments
  • wallet_handle - wallet to search for payment_addresses
  • timeout - the maximum time this function waits for a response
Returns
  • payment_addresses_json - json array of string with json addresses

Lists all payment addresses that are stored in the wallet

Arguments
  • wallet_handle - wallet to search for payment_addresses
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Modifies Indy request by adding information how to pay fees for this transaction according to selected payment method.

Payment selection is performed by looking to o

This method consumes set of UTXO inputs and outputs. The difference between inputs balance and outputs balance is the fee for this transaction.

Not that this method also produces correct fee signatures.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • req_json - initial transaction request as json
  • inputs_json - the list of UTXO inputs as json array
Examples

inputs_json: [“input1”, …] Notes: - each input should reference paymentAddress - this param will be used to determine payment_method outputs_json: The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]

Returns
  • req_with_fees_json - modified Indy request with added fees info
  • payment_method

Modifies Indy request by adding information how to pay fees for this transaction according to selected payment method.

Payment selection is performed by looking to o

This method consumes set of UTXO inputs and outputs. The difference between inputs balance and outputs balance is the fee for this transaction.

Not that this method also produces correct fee signatures.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • req_json - initial transaction request as json
  • inputs_json - the list of UTXO inputs as json array
  • timeout - the maximum time this function waits for a response
Examples

inputs_json: [“input1”, …] Notes: - each input should reference paymentAddress - this param will be used to determine payment_method outputs_json: The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]

Returns
  • req_with_fees_json - modified Indy request with added fees info
  • payment_method

Modifies Indy request by adding information how to pay fees for this transaction according to selected payment method.

Payment selection is performed by looking to o

This method consumes set of UTXO inputs and outputs. The difference between inputs balance and outputs balance is the fee for this transaction.

Not that this method also produces correct fee signatures.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • req_json - initial transaction request as json
  • inputs_json - the list of UTXO inputs as json array
  • closure - the closure that is called when finished
Examples

inputs_json: [“input1”, …] Notes: - each input should reference paymentAddress - this param will be used to determine payment_method outputs_json: The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]

Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Parses response for Indy request with fees.

Arguments
  • payment_method
  • resp_json: response for Indy request with fees Note: this param will be used to determine payment_method
Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as json
Example

utxo_json [{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]

Parses response for Indy request with fees.

Arguments
  • payment_method
  • resp_json: response for Indy request with fees
  • timeout - the maximum time this function waits for a response Note: this param will be used to determine payment_method
Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as json
Example

utxo_json [{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]

Parses response for Indy request with fees.

Arguments
  • payment_method
  • resp_json: response for Indy request with fees
  • closure - the closure that is called when finished Note: this param will be used to determine payment_method
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Builds Indy request for getting UTXO list for payment address according to this payment method.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_address -: target payment address
Returns
  • get_utxo_txn_json - Indy request for getting UTXO list for payment address
  • payment_method

Builds Indy request for getting UTXO list for payment address according to this payment method.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_address -: target payment address
  • timeout - the maximum time this function waits for a response
Returns
  • get_utxo_txn_json - Indy request for getting UTXO list for payment address
  • payment_method

Builds Indy request for getting UTXO list for payment address according to this payment method.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_address -: target payment address
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Parses response for Indy request for getting UTXO list.

Arguments
  • payment_method
  • resp_json - response for Indy request for getting UTXO list Note: this param will be used to determine payment_method
Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as json:
Examples:

[{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]

Parses response for Indy request for getting UTXO list.

Arguments
  • payment_method
  • resp_json - response for Indy request for getting UTXO list
  • timeout - the maximum time this function waits for a response Note: this param will be used to determine payment_method
Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as json:
Examples:

[{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]

Parses response for Indy request for getting UTXO list.

Arguments
  • payment_method
  • resp_json - response for Indy request for getting UTXO list
  • closure - the closure that is called when finished Note: this param will be used to determine payment_method
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Builds Indy request for doing tokens payment according to this payment method.

This method consumes set of UTXO inputs and outputs.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • inputs_json - The list of UTXO inputs as json array: [“input1”, …] Note that each input should reference paymentAddress
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
Returns
  • payment_req_json - Indy request for doing tokens payment
  • payment_method

Builds Indy request for doing tokens payment according to this payment method.

This method consumes set of UTXO inputs and outputs.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • inputs_json - The list of UTXO inputs as json array: [“input1”, …] Note that each input should reference paymentAddress
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
  • timeout - the maximum time this function waits for a response
Returns
  • payment_req_json - Indy request for doing tokens payment
  • payment_method

Builds Indy request for doing tokens payment according to this payment method.

This method consumes set of UTXO inputs and outputs.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • inputs_json - The list of UTXO inputs as json array: [“input1”, …] Note that each input should reference paymentAddress
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Parses response for Indy request for payment txn.

Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for payment txn Note: this param will be used to determine payment_method
Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as jso-n [{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]

Parses response for Indy request for payment txn.

Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for payment txn
  • timeout - the maximum time this function waits for a response Note: this param will be used to determine payment_method
Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as jso-n [{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]

Parses response for Indy request for payment txn.

Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for payment txn
  • closure - the closure that is called when finished Note: this param will be used to determine payment_method
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Builds Indy request for doing tokens minting according to this payment method.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
Returns
  • mint_req_json - Indy request for doing tokens minting
  • payment_method

Builds Indy request for doing tokens minting according to this payment method.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
  • timeout - the maximum time this function waits for a response
Returns
  • mint_req_json - Indy request for doing tokens minting
  • payment_method

Builds Indy request for doing tokens minting according to this payment method.

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Builds Indy request for setting fees for transactions in the ledger

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
  • fees_json - { txnType1: amount1, txnType2: amount2, …………….. txnTypeN: amountN, }
Returns
  • set_txn_fees_json - Indy request for setting fees for transactions in the ledger

Builds Indy request for setting fees for transactions in the ledger

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
  • fees_json - { txnType1: amount1, txnType2: amount2, …………….. txnTypeN: amountN, }
  • timeout - the maximum time this function waits for a response
Returns
  • set_txn_fees_json - Indy request for setting fees for transactions in the ledger

Builds Indy request for setting fees for transactions in the ledger

Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
  • fees_json - { txnType1: amount1, txnType2: amount2, …………….. txnTypeN: amountN, }
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Builds Indy get request for getting fees for transactions in the ledger

Arguments
  • command_handle
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
Returns
  • get_txn_fees_json - Indy request for getting fees for transactions in the ledger

Builds Indy get request for getting fees for transactions in the ledger

Arguments
  • command_handle
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
  • timeout - the maximum time this function waits for a response
Returns
  • get_txn_fees_json - Indy request for getting fees for transactions in the ledger

Builds Indy get request for getting fees for transactions in the ledger

Arguments
  • command_handle
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Parses response for Indy request for getting fees

Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for getting fees
Returns
  • fees_json { txnType1: amount1, txnType2: amount2, …………….. txnTypeN: amountN, }

Parses response for Indy request for getting fees

Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for getting fees
  • timeout - the maximum time this function waits for a response
Returns
  • fees_json { txnType1: amount1, txnType2: amount2, …………….. txnTypeN: amountN, }

Parses response for Indy request for getting fees

Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for getting fees
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
  • timeout - the maximum time this function waits for a response
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
  • timeout - the maximum time this function waits for a response
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.