public class EscrowHelper
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
FIELD_CONTRACTOR_ASSIGNMENT_INFO |
|
static java.lang.String |
FIELD_CONTRACTOR_COMPLETION_INFO |
|
static java.lang.String |
FIELD_CUSTOMER_ESCROW_INFO |
|
static java.lang.String |
FIELD_ESCROW_EXPIRES |
|
static java.lang.String |
FIELD_PAYMENT |
|
static java.lang.String |
FIELD_STATUS |
|
static java.lang.String |
FIELD_VERSION |
|
static java.lang.String |
PATH_ESCROW_EXPIRES |
|
static java.lang.String |
PATH_STATUS |
|
static java.lang.String |
STATUS_ASSIGNED |
|
static java.lang.String |
STATUS_CANCELED |
|
static java.lang.String |
STATUS_CLOSED |
|
static java.lang.String |
STATUS_COMPLETE |
|
static java.lang.String |
STATUS_INIT |
|
static java.lang.String |
STATUS_OPEN |
Constructor | Description |
---|---|
EscrowHelper() |
Modifier and Type | Method | Description |
---|---|---|
static Contract[] |
assignEscrow(Contract escrow,
com.icodici.crypto.KeyAddress contractorAddress,
net.sergeych.tools.Binder assignData) |
Assigns escrow agreement contract to a contractor
Contract returned is not signed/registered.
|
static Contract[] |
cancelEscrow(Contract escrow) |
Cancels escrow agreement and returns payment to customer
Contract returned is not signed/registered.
|
static Contract[] |
closeByArbitration(Contract escrow) |
Contractor closes an escrow by arbitration
Contract returned is not signed/registered.
|
static Contract[] |
closeByCustomer(Contract escrow) |
Customer accepts word and closes an escrow
Contract returned is not signed/registered.
|
static Contract[] |
closeEscrow(Contract escrow,
java.util.Collection<?> creatorKeys) |
Closes escrow agreement
Contract returned is not signed/registered.
|
static Contract[] |
completeEscrow(Contract escrow,
net.sergeych.tools.Binder completionData) |
Complete escrow agreement and add details on completion to state.data.contractor_completion_info
Contract returned is not signed/registered.
|
static Contract[] |
initEscrow(java.util.Collection<?> issuerKeys,
net.sergeych.tools.Binder definitionData,
net.sergeych.tools.Binder escrowData,
com.icodici.crypto.KeyAddress customerAddress,
com.icodici.crypto.KeyAddress arbitratorAddress,
com.icodici.crypto.KeyAddress storageServiceAddress,
java.time.Duration escrowDuration,
Contract payment) |
Prepares escrow agreement contract and its satellites (payment contract with ownership that depends on status of escrow)
Contract returned is not signed/registered.
|
static Contract[] |
obtainPaymentOnClosedEscrow(Contract escrow) |
Transfers payment of closed escrow to contractor
Contract returned is not signed/registered.
|
public static final java.lang.String FIELD_VERSION
public static final java.lang.String FIELD_PAYMENT
public static final java.lang.String FIELD_CUSTOMER_ESCROW_INFO
public static final java.lang.String FIELD_CONTRACTOR_ASSIGNMENT_INFO
public static final java.lang.String FIELD_CONTRACTOR_COMPLETION_INFO
public static final java.lang.String FIELD_ESCROW_EXPIRES
public static final java.lang.String PATH_ESCROW_EXPIRES
public static final java.lang.String FIELD_STATUS
public static final java.lang.String PATH_STATUS
public static final java.lang.String STATUS_INIT
public static final java.lang.String STATUS_OPEN
public static final java.lang.String STATUS_ASSIGNED
public static final java.lang.String STATUS_CANCELED
public static final java.lang.String STATUS_COMPLETE
public static final java.lang.String STATUS_CLOSED
public static Contract[] initEscrow(java.util.Collection<?> issuerKeys, net.sergeych.tools.Binder definitionData, net.sergeych.tools.Binder escrowData, com.icodici.crypto.KeyAddress customerAddress, com.icodici.crypto.KeyAddress arbitratorAddress, com.icodici.crypto.KeyAddress storageServiceAddress, java.time.Duration escrowDuration, Contract payment)
issuerKeys
- public keys/addresses to issue escrow withdefinitionData
- free-form data to put into loan contract definition.data sectionescrowData
- escrow description data to put into definitioncustomerAddress
- escrow customerarbitratorAddress
- escrow arbitratorstorageServiceAddress
- storage service is responsible for holding revision of an escrow.
Applicable when only one of customer/contractor signatures is required
to change state of escrow contract. Used to avoid situations when new
revision registered by one of the sides is not being sent to the otherescrowDuration
- duration of an escrowpayment
- payment contract. Must be owned by customer at this point.public static Contract[] assignEscrow(Contract escrow, com.icodici.crypto.KeyAddress contractorAddress, net.sergeych.tools.Binder assignData)
escrow
- escrow agreement contractcontractorAddress
- contractor of an escrowassignData
- free-form data from the contractor to put into escrow contractpublic static Contract[] cancelEscrow(Contract escrow)
escrow
- escrow agreement contractpublic static Contract[] completeEscrow(Contract escrow, net.sergeych.tools.Binder completionData)
escrow
- escrow agreement contractcompletionData
- free-form data on escrow completion to put into escrow contractpublic static Contract[] closeEscrow(Contract escrow, java.util.Collection<?> creatorKeys)
escrow
- escrow agreement contractcreatorKeys
- public keys/addresses escrow closing will be signed bypublic static Contract[] closeByCustomer(Contract escrow)
escrow
- escrow agreement contractpublic static Contract[] closeByArbitration(Contract escrow)
escrow
- escrow agreement contractpublic static Contract[] obtainPaymentOnClosedEscrow(Contract escrow)
escrow
- escrow agreement contract