Skip to content

Commit

Permalink
fix approve issue (#17)
Browse files Browse the repository at this point in the history
Co-authored-by: yangshan <[email protected]>
  • Loading branch information
shan-57blocks and yangshan authored Jun 27, 2024
1 parent 0fd8bd6 commit 4de7b4d
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 4de7b4d

Please sign in to comment.