public class SecuredLoanHelper
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
FIELD_EXPIRES |
|
static java.lang.String |
FIELD_STATUS |
|
static java.lang.String |
PATH_EXPIRES |
|
static java.lang.String |
PATH_STATUS |
|
static java.lang.String |
STATUS_CLOSED |
|
static java.lang.String |
STATUS_DEFAULT |
|
static java.lang.String |
STATUS_IN_PROGRESS |
|
static java.lang.String |
STATUS_INIT |
|
static java.lang.String |
STATUS_REPAID |
Constructor | Description |
---|---|
SecuredLoanHelper() |
Modifier and Type | Method | Description |
---|---|---|
static Contract[] |
closeSecuredLoan(Contract securedLoan) |
Transfers secured loan agreement contract into CLOSED state (repayment becomes owned by lender and collateral by borrower).
|
static Contract[] |
defaultSecuredLoan(Contract securedLoan) |
Transfers secured loan agreement contract into DEFAULT state and transfers collateral to lender.
|
static Contract[] |
initSecuredLoan(java.util.Collection<?> issuerKeys,
net.sergeych.tools.Binder definitionData,
com.icodici.crypto.KeyAddress lenderAddress,
com.icodici.crypto.KeyAddress borrowerAddress,
Contract loan,
java.time.Duration loanDuration,
Contract collateral,
java.lang.String repaymentAmount,
boolean mintable,
HashId repaymentOrigin,
com.icodici.crypto.KeyAddress repaymentIssuer,
java.lang.String repaymentCurrency) |
Prepares secured loan agreement contract and its satellites.
|
static Contract[] |
initSecuredLoan(net.sergeych.tools.Binder definitionData,
com.icodici.crypto.KeyAddress lenderAddress,
com.icodici.crypto.KeyAddress borrowerAddress,
Contract loan,
java.time.Duration loanDuration,
Contract collateral,
java.lang.String repaymentAmount,
boolean mintable,
HashId repaymentOrigin,
com.icodici.crypto.KeyAddress repaymentIssuer,
java.lang.String repaymentCurrency) |
Prepares secured loan agreement contract and its satellites.
|
static Contract[] |
repaySecuredLoan(Contract securedLoan,
Contract repayment) |
Transfers secured loan agreement contract into REPAID state (repayment and collateral aren't owned by neither lender nor borrower at this point).
|
public static final java.lang.String FIELD_STATUS
public static final java.lang.String PATH_STATUS
public static final java.lang.String FIELD_EXPIRES
public static final java.lang.String PATH_EXPIRES
public static final java.lang.String STATUS_INIT
public static final java.lang.String STATUS_IN_PROGRESS
public static final java.lang.String STATUS_DEFAULT
public static final java.lang.String STATUS_REPAID
public static final java.lang.String STATUS_CLOSED
public static Contract[] initSecuredLoan(net.sergeych.tools.Binder definitionData, com.icodici.crypto.KeyAddress lenderAddress, com.icodici.crypto.KeyAddress borrowerAddress, Contract loan, java.time.Duration loanDuration, Contract collateral, java.lang.String repaymentAmount, boolean mintable, HashId repaymentOrigin, com.icodici.crypto.KeyAddress repaymentIssuer, java.lang.String repaymentCurrency)
definitionData
- free-form data to put into loan contract definition.data sectionlenderAddress
- address of lender keyborrowerAddress
- address of borrower keyloan
- contract that is given to borrower by lender. must be owned by lender by this time.loanDuration
- duration of a loancollateral
- contract that is acts as collateral for a loan must be owned by borrower by this time.repaymentAmount
- the amount to be repaid at the end of the loanmintable
- flag indicates if repayment is mintable token. Fixed supply otherwiserepaymentOrigin
- the expected origin of repayment token. passed for fixed supply tokens only. pass null otherwise.repaymentIssuer
- the expected issuer of repayment token. passed for mintable tokens only. pass null otherwise.repaymentCurrency
- the expected currency of repayment token. passed for mintable tokens only. pass null otherwise.public static Contract[] initSecuredLoan(java.util.Collection<?> issuerKeys, net.sergeych.tools.Binder definitionData, com.icodici.crypto.KeyAddress lenderAddress, com.icodici.crypto.KeyAddress borrowerAddress, Contract loan, java.time.Duration loanDuration, Contract collateral, java.lang.String repaymentAmount, boolean mintable, HashId repaymentOrigin, com.icodici.crypto.KeyAddress repaymentIssuer, java.lang.String repaymentCurrency)
issuerKeys
- keys/addresses to set "issuer" of secured loan contract to.definitionData
- free-form data to put into loan contract definition.data sectionlenderAddress
- address of lender keyborrowerAddress
- address of borrower keyloan
- contract that is given to borrower by lender. must be owned by lender by this time.loanDuration
- duration of a loancollateral
- contract that is acts as collateral for a loan must be owned by borrower by this time.repaymentAmount
- the amount to be repaid at the end of the loanmintable
- flag indicates if repayment is mintable token. Fixed supply otherwiserepaymentOrigin
- the expected origin of repayment token. passed for fixed supply tokens only. pass null otherwise.repaymentIssuer
- the expected issuer of repayment token. passed for mintable tokens only. pass null otherwise.repaymentCurrency
- the expected currency of repayment token. passed for mintable tokens only. pass null otherwise.public static Contract[] defaultSecuredLoan(Contract securedLoan)
securedLoan
- secured loan agreement contractpublic static Contract[] repaySecuredLoan(Contract securedLoan, Contract repayment)
securedLoan
- secured loan agreement contractrepayment
- contract owned by burrower by this timepublic static Contract[] closeSecuredLoan(Contract securedLoan)
securedLoan
- secured loan agreement contract