Skip to content

Commit 5750d80

Browse files
author
Your Name
committed
fix: Resolve TypeScript build errors in config-loader and payments modules
- config-loader.ts line 238: Add type assertion for cachedMandateToken return (guaranteed non-null) - payments.ts line 218: Fix submitTxHash parameter order (add undefined for txHashCommission)
1 parent 3bc8de3 commit 5750d80

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

javascript/src/config-loader.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ export class ConfigLoader {
235235
const expiresDate = new Date(this.mandateExpiresAt);
236236
console.log(`✓ Mandate created successfully (expires: ${expiresDate.toISOString()})`);
237237

238-
return this.cachedMandateToken;
238+
// TypeScript: cachedMandateToken is guaranteed to be set at this point
239+
return this.cachedMandateToken as string;
239240
}
240241

241242
/**

javascript/src/modules/payments.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ export class PaymentsModule {
214214
await tx.wait();
215215
console.log('Transaction confirmed!');
216216

217-
// Submit to AgentPay
218-
return await this.submitTxHash(mandate, tx.hash, chain, token);
217+
// Submit to AgentPay (txHashCommission = undefined for this simple flow)
218+
return await this.submitTxHash(mandate, tx.hash, undefined, chain, token);
219219

220220
} catch (error: any) {
221221
throw new Error(`Failed to send transaction: ${error.message}`);

0 commit comments

Comments
 (0)