@hashgraphonline/standards-sdk 0.0.20 → 0.0.22

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.
@@ -4,6 +4,7 @@ import { Logger, LogLevel } from '../utils/logger';
4
4
  import { RetrievedInscriptionResult } from '@kiloscribe/inscription-sdk';
5
5
  import { HCS10BaseClient } from './base-client';
6
6
  import { AgentConfig, NetworkType } from './types.d';
7
+ import { DAppSigner } from '@hashgraph/hedera-wallet-connect';
7
8
  export type BrowserHCSClientConfig = {
8
9
  network: 'mainnet' | 'testnet';
9
10
  hwc: HashinalsWalletConnectSDK;
@@ -90,7 +91,7 @@ export declare class BrowserHCSClient extends HCS10BaseClient {
90
91
  inscribeFile(buffer: Buffer, fileName: string): Promise<RetrievedInscriptionResult>;
91
92
  getAccountAndSigner(): {
92
93
  accountId: string;
93
- signer: any;
94
+ signer: DAppSigner;
94
95
  };
95
96
  /**
96
97
  * Inscribes a profile picture file to the Hedera network
@@ -33452,13 +33452,25 @@ class BrowserHCSClient extends HCS10BaseClient {
33452
33452
  }
33453
33453
  }
33454
33454
  async createTopic(memo, adminKey, submitKey) {
33455
- this.logger.info("Creating topic");
33456
33455
  const { accountId, signer } = this.getAccountAndSigner();
33457
- const transaction = new TopicCreateTransaction().setTopicMemo(memo);
33456
+ this.logger.info(`Creating topic for ${accountId} with memo ${memo}`);
33457
+ let transaction = new TopicCreateTransaction().setTopicMemo(memo);
33458
+ if (adminKey) {
33459
+ transaction = transaction.setAutoRenewAccountId(
33460
+ AccountId.fromString(accountId)
33461
+ );
33462
+ }
33458
33463
  const publicKey = await this.mirrorNode.getPublicKey(accountId);
33464
+ transaction._setOperatorWith(
33465
+ AccountId.fromString(accountId),
33466
+ publicKey,
33467
+ async (message) => {
33468
+ const signed = await signer.sign([message]);
33469
+ return new Uint8Array(signed[0].signature);
33470
+ }
33471
+ );
33459
33472
  if (adminKey && publicKey) {
33460
33473
  transaction.setAdminKey(publicKey);
33461
- transaction.setAutoRenewAccountId(accountId);
33462
33474
  }
33463
33475
  if (submitKey && publicKey) {
33464
33476
  transaction.setSubmitKey(publicKey);