Skip to content

Instantly share code, notes, and snippets.

@travisdmathis
Created June 22, 2018 18:35
Show Gist options
  • Save travisdmathis/8f1976480671c9d6b9ca0c4506fee6d3 to your computer and use it in GitHub Desktop.
Save travisdmathis/8f1976480671c9d6b9ca0c4506fee6d3 to your computer and use it in GitHub Desktop.
let debtRequest = this.state.debtRequest;
let payload = {
amortizationUnit: debtRequest.amortizationUnit,
collateralAmount: new BigNumber(debtRequest.collateralAmount),
collateralTokenSymbol: debtRequest.collateralTokenSymbol,
description: '',
gracePeriodInDays: new BigNumber(debtRequest.gracePeriodInDays),
interestRate: new BigNumber(debtRequest.interestRate),
principalAmount: new BigNumber(debtRequest.principalAmount),
principalTokenSymbol: debtRequest.principalTokenSymbol,
termLength: new BigNumber(debtRequest.termLength),
};
console.log(
'dharma',
dharma,
'debtRequest',
debtRequest,
'payLoad',
payload,
'account',
this.props.account,
);
let debtOrderInstance = await dharma.adapters.collateralizedSimpleInterestLoan.toDebtOrder(
payload,
);
debtOrderInstance.debtor = this.props.account.accountAddress;
let issuanceHash = await dharma.order.getIssuanceHash(debtOrderInstance);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment