@hashgraphonline/standards-sdk 0.0.26 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31746,7 +31746,8 @@ class HCS11Client {
31746
31746
  }
31747
31747
  const signer = this.auth.signer;
31748
31748
  const result = await transaction.signWithSigner(signer);
31749
- const response = await result.executeWithSigner(signer);
31749
+ const frozenTransaction = await result.freezeWithSigner(signer);
31750
+ const response = await frozenTransaction.executeWithSigner(signer);
31750
31751
  const receipt = await response.getReceiptWithSigner(signer);
31751
31752
  if (receipt.status !== Status.Success) {
31752
31753
  return {
@@ -33334,13 +33335,22 @@ class BrowserHCSClient extends HCS10BaseClient {
33334
33335
  const maxAttempts = (options == null ? void 0 : options.maxAttempts) ?? 60;
33335
33336
  const delayMs = (options == null ? void 0 : options.delayMs) ?? 2e3;
33336
33337
  const progressCallback = options == null ? void 0 : options.progressCallback;
33337
- if (progressCallback) {
33338
- progressCallback({
33339
- stage: "preparing",
33340
- message: "Preparing agent registration",
33341
- progressPercent: 10
33342
- });
33343
- }
33338
+ this.logger.debug(`Progress callback provided: ${!!progressCallback}`);
33339
+ const reportProgress = (progressData) => {
33340
+ try {
33341
+ if (progressCallback) {
33342
+ this.logger.debug(`Reporting progress: ${progressData.stage} - ${progressData.message} (${progressData.progressPercent}%)`);
33343
+ progressCallback(progressData);
33344
+ }
33345
+ } catch (error) {
33346
+ this.logger.error(`Error in progress callback: ${error}`);
33347
+ }
33348
+ };
33349
+ reportProgress({
33350
+ stage: "preparing",
33351
+ message: "Preparing agent registration",
33352
+ progressPercent: 10
33353
+ });
33344
33354
  const registrationResult = await this.executeRegistration(
33345
33355
  accountId,
33346
33356
  inboundTopicId,
@@ -33351,16 +33361,14 @@ class BrowserHCSClient extends HCS10BaseClient {
33351
33361
  if (!registrationResult.success) {
33352
33362
  return registrationResult;
33353
33363
  }
33354
- if (progressCallback) {
33355
- progressCallback({
33356
- stage: "submitting",
33357
- message: "Submitting registration to registry",
33358
- progressPercent: 30,
33359
- details: {
33360
- transactionId: registrationResult.transactionId
33361
- }
33362
- });
33363
- }
33364
+ reportProgress({
33365
+ stage: "submitting",
33366
+ message: "Submitting registration to registry",
33367
+ progressPercent: 30,
33368
+ details: {
33369
+ transactionId: registrationResult.transactionId
33370
+ }
33371
+ });
33364
33372
  if (registrationResult.transaction) {
33365
33373
  const transaction = Transaction.fromBytes(
33366
33374
  Buffer2.from(registrationResult.transaction, "base64")
@@ -33379,18 +33387,16 @@ class BrowserHCSClient extends HCS10BaseClient {
33379
33387
  }
33380
33388
  this.logger.info(`Successfully processed registration transaction`);
33381
33389
  }
33382
- if (progressCallback) {
33383
- progressCallback({
33384
- stage: "confirming",
33385
- message: "Confirming registration transaction",
33386
- progressPercent: 60,
33387
- details: {
33388
- accountId,
33389
- inboundTopicId,
33390
- transactionId: registrationResult.transactionId
33391
- }
33392
- });
33393
- }
33390
+ reportProgress({
33391
+ stage: "confirming",
33392
+ message: "Confirming registration transaction",
33393
+ progressPercent: 60,
33394
+ details: {
33395
+ accountId,
33396
+ inboundTopicId,
33397
+ transactionId: registrationResult.transactionId
33398
+ }
33399
+ });
33394
33400
  const confirmed = await this.waitForRegistrationConfirmation(
33395
33401
  registrationResult.transactionId,
33396
33402
  network,
@@ -33398,22 +33404,21 @@ class BrowserHCSClient extends HCS10BaseClient {
33398
33404
  maxAttempts,
33399
33405
  delayMs
33400
33406
  );
33401
- if (progressCallback) {
33402
- progressCallback({
33403
- stage: "completed",
33404
- message: "Agent registration complete",
33405
- progressPercent: 100,
33406
- details: {
33407
- confirmed,
33408
- transactionId: registrationResult.transactionId
33409
- }
33410
- });
33411
- }
33407
+ reportProgress({
33408
+ stage: "completed",
33409
+ message: "Agent registration complete",
33410
+ progressPercent: 100,
33411
+ details: {
33412
+ confirmed,
33413
+ transactionId: registrationResult.transactionId
33414
+ }
33415
+ });
33412
33416
  return {
33413
33417
  ...registrationResult,
33414
33418
  confirmed
33415
33419
  };
33416
33420
  } catch (error) {
33421
+ this.logger.error(`Registration error: ${error.message}`);
33417
33422
  return {
33418
33423
  error: `Error during registration: ${error.message}`,
33419
33424
  success: false