| 77 | |
| 78 | // Transaction id is unset until we have funded the create tx, which is dependent on the blob tx |
| 79 | const waitForResult = async () => { |
| 80 | try { |
| 81 | const blobTx = await deployer.sendTransaction(fundedBlobRequest); |
| 82 | const result = await blobTx.waitForResult(); |
| 83 | |
| 84 | if (result.status !== TransactionStatus.success) { |
| 85 | throw new Error(); |
| 86 | } |
| 87 | } catch (err: unknown) { |
| 88 | throw new FuelError(ErrorCode.TRANSACTION_FAILED, 'Failed to deploy predicate chunk'); |
| 89 | } |
| 90 | |
| 91 | return loaderInstance; |
| 92 | }; |
| 93 | |
| 94 | return { |
| 95 | waitForResult, |