@hashgraphonline/standards-sdk 0.0.25 → 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.
@@ -31744,9 +31744,11 @@ class HCS11Client {
31744
31744
  if (!this.auth.signer) {
31745
31745
  throw new Error("No valid authentication method provided");
31746
31746
  }
31747
- const result = await this.auth.signer.signTransaction(transaction);
31748
- const response = await result.execute(this.client);
31749
- const receipt = await response.getReceipt(this.client);
31747
+ const signer = this.auth.signer;
31748
+ const result = await transaction.signWithSigner(signer);
31749
+ const frozenTransaction = await result.freezeWithSigner(signer);
31750
+ const response = await frozenTransaction.executeWithSigner(signer);
31751
+ const receipt = await response.getReceiptWithSigner(signer);
31750
31752
  if (receipt.status !== Status.Success) {
31751
31753
  return {
31752
31754
  success: false,
@@ -33333,13 +33335,22 @@ class BrowserHCSClient extends HCS10BaseClient {
33333
33335
  const maxAttempts = (options == null ? void 0 : options.maxAttempts) ?? 60;
33334
33336
  const delayMs = (options == null ? void 0 : options.delayMs) ?? 2e3;
33335
33337
  const progressCallback = options == null ? void 0 : options.progressCallback;
33336
- if (progressCallback) {
33337
- progressCallback({
33338
- stage: "preparing",
33339
- message: "Preparing agent registration",
33340
- progressPercent: 10
33341
- });
33342
- }
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
+ });
33343
33354
  const registrationResult = await this.executeRegistration(
33344
33355
  accountId,
33345
33356
  inboundTopicId,
@@ -33350,16 +33361,14 @@ class BrowserHCSClient extends HCS10BaseClient {
33350
33361
  if (!registrationResult.success) {
33351
33362
  return registrationResult;
33352
33363
  }
33353
- if (progressCallback) {
33354
- progressCallback({
33355
- stage: "submitting",
33356
- message: "Submitting registration to registry",
33357
- progressPercent: 30,
33358
- details: {
33359
- transactionId: registrationResult.transactionId
33360
- }
33361
- });
33362
- }
33364
+ reportProgress({
33365
+ stage: "submitting",
33366
+ message: "Submitting registration to registry",
33367
+ progressPercent: 30,
33368
+ details: {
33369
+ transactionId: registrationResult.transactionId
33370
+ }
33371
+ });
33363
33372
  if (registrationResult.transaction) {
33364
33373
  const transaction = Transaction.fromBytes(
33365
33374
  Buffer2.from(registrationResult.transaction, "base64")
@@ -33378,18 +33387,16 @@ class BrowserHCSClient extends HCS10BaseClient {
33378
33387
  }
33379
33388
  this.logger.info(`Successfully processed registration transaction`);
33380
33389
  }
33381
- if (progressCallback) {
33382
- progressCallback({
33383
- stage: "confirming",
33384
- message: "Confirming registration transaction",
33385
- progressPercent: 60,
33386
- details: {
33387
- accountId,
33388
- inboundTopicId,
33389
- transactionId: registrationResult.transactionId
33390
- }
33391
- });
33392
- }
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
+ });
33393
33400
  const confirmed = await this.waitForRegistrationConfirmation(
33394
33401
  registrationResult.transactionId,
33395
33402
  network,
@@ -33397,22 +33404,21 @@ class BrowserHCSClient extends HCS10BaseClient {
33397
33404
  maxAttempts,
33398
33405
  delayMs
33399
33406
  );
33400
- if (progressCallback) {
33401
- progressCallback({
33402
- stage: "completed",
33403
- message: "Agent registration complete",
33404
- progressPercent: 100,
33405
- details: {
33406
- confirmed,
33407
- transactionId: registrationResult.transactionId
33408
- }
33409
- });
33410
- }
33407
+ reportProgress({
33408
+ stage: "completed",
33409
+ message: "Agent registration complete",
33410
+ progressPercent: 100,
33411
+ details: {
33412
+ confirmed,
33413
+ transactionId: registrationResult.transactionId
33414
+ }
33415
+ });
33411
33416
  return {
33412
33417
  ...registrationResult,
33413
33418
  confirmed
33414
33419
  };
33415
33420
  } catch (error) {
33421
+ this.logger.error(`Registration error: ${error.message}`);
33416
33422
  return {
33417
33423
  error: `Error during registration: ${error.message}`,
33418
33424
  success: false