feat(export): add buffer download methods to ExportBuilder

- Added download() method to get statements as Buffer without saving to disk
- Added downloadAsArrayBuffer() method for web API compatibility
- Enhanced documentation for getAccountStatement() method
- Updated README with comprehensive examples
- No breaking changes, backward compatible
This commit is contained in:
2025-08-02 10:56:17 +00:00
parent 4c0ad95eb1
commit 40f9142d70
8 changed files with 218 additions and 124 deletions

View File

@@ -334,4 +334,24 @@ export class ExportBuilder {
await bunqExport.waitForCompletion();
await bunqExport.saveToFile(filePath);
}
/**
* Create and download export as Buffer
*/
public async download(): Promise<Buffer> {
const bunqExport = await this.create();
await bunqExport.waitForCompletion();
return bunqExport.downloadContent();
}
/**
* Create and download export as ArrayBuffer
*/
public async downloadAsArrayBuffer(): Promise<ArrayBuffer> {
const buffer = await this.download();
return buffer.buffer.slice(
buffer.byteOffset,
buffer.byteOffset + buffer.byteLength
);
}
}