Skip to content

Commit

Permalink
allow approve allowance
Browse files Browse the repository at this point in the history
  • Loading branch information
shan57blocks committed Jul 17, 2024
1 parent e4b8494 commit 460afb0
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions packages/sdk/src/helpers/CreditContractHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export async function drawdown(
throw new Error('Could not find credit contract for pool')
}

// await approveAllowanceForSentinel(poolName, network, wallet)
await approveAllowanceForSentinel(poolName, network, wallet)
const tx = await poolCreditClient.drawdown(
{
borrower: wallet.userInfo.publicKey,
Expand Down Expand Up @@ -273,22 +273,22 @@ export async function makePayment(
throw new Error('Could not find pool storage contract for pool')
}

// await approveAllowanceForSentinel(poolName, network, wallet)
// const [{ result: underlyingToken }, { result: sentinel }] = await Promise.all(
// [
// poolStorageClient.get_underlying_token(),
// poolStorageClient.get_sentinel(),
// ],
// )
await approveAllowanceForSentinel(poolName, network, wallet)
const [{ result: underlyingToken }, { result: sentinel }] = await Promise.all(
[
poolStorageClient.get_underlying_token(),
poolStorageClient.get_sentinel(),
],
)

let tx
// tx = await approveSep41AllowanceIfInsufficient(
// network,
// wallet,
// underlyingToken,
// sentinel,
// paymentAmount,
// )
tx = await approveSep41AllowanceIfInsufficient(
network,
wallet,
underlyingToken,
sentinel,
paymentAmount,
)

if (principalOnly) {
tx = await poolCreditClient.make_principal_payment(
Expand Down

0 comments on commit 460afb0

Please sign in to comment.