Loans#
- class defichain.transactions.builder.modules.Loans(builder)#
The methods of this module create loan transactions
takeloan: transaction to take a loan in the desired amount out of the specified vault
paybackloan: transaction to pay back the loan token to the specified vault
- takeloan(vaultId: str, addressTo: str, amounts: str | [str], inputs=[]) Transaction #
Creates a transaction to take a loan in the desired amount out of the specified vault
>>> builder.loans.takeloan("8040fe5eaa75f942dabf57bcdace3a5b71e3eb4fab53467e064e870396913800", "df1qrvrnk0zyaen8x3pfrza3yznwrrrv5y08rkgrk2", ["1@DUSD", "2@COIN"]) # takes loan from a vault
- Parameters:
- Returns:
- paybackloan(vaultId: str, addressFrom: str, amounts: str | [str], inputs=[]) Transaction #
Creates a transaction to pay back the loan token to the specified vault
>>> builder.loans.paybackloan("8040fe5eaa75f942dabf57bcdace3a5b71e3eb4fab53467e064e870396913800", "df1qrvrnk0zyaen8x3pfrza3yznwrrrv5y08rkgrk2", ["1@DUSD", "2@COIN"]) # pay backs loan to a vault
- Parameters:
- Returns: