Skip to content

Commit

Permalink
fix approvals
Browse files Browse the repository at this point in the history
  • Loading branch information
FSM1 committed Oct 24, 2023
1 parent 62664bf commit 6e05bbe
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/sdk-manager/src/SdkManagerContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export class SdkManager implements SdkManagerState {

const signer = provider.getSigner();
for (const approval of this.approvalTxs) {
await signer.sendTransaction(approval as TransactionRequest);
await (
await signer.sendTransaction(approval as TransactionRequest)
).wait();
}

const approvals = await this.assetTransfer.buildApprovals(
Expand All @@ -132,12 +134,13 @@ export class SdkManager implements SdkManagerState {
);

this.approvalTxs = approvals;
this.status =
approvals.length > 0 ? 'transferCreated' : 'approvalsCompleted';
this.depositTx = await this.assetTransfer.buildTransferTransaction(
this.transfer,
this.fee
);
if (!approvals || approvals.length === 0) {
this.status = 'approvalsCompleted';
this.depositTx = await this.assetTransfer.buildTransferTransaction(
this.transfer,
this.fee
);
}
}

async performDeposit(provider: Web3Provider) {
Expand Down

0 comments on commit 6e05bbe

Please sign in to comment.