@hashgraphonline/standards-sdk 0.0.21 → 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:
|
|
94
|
+
signer: DAppSigner;
|
|
94
95
|
};
|
|
95
96
|
/**
|
|
96
97
|
* Inscribes a profile picture file to the Hedera network
|
|
@@ -33452,21 +33452,33 @@ 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();
|
|
33456
|
+
this.logger.info(`Creating topic for ${accountId} with memo ${memo}`);
|
|
33457
33457
|
let transaction = new TopicCreateTransaction().setTopicMemo(memo);
|
|
33458
33458
|
if (adminKey) {
|
|
33459
|
-
transaction = transaction.setAutoRenewAccountId(
|
|
33459
|
+
transaction = transaction.setAutoRenewAccountId(
|
|
33460
|
+
AccountId.fromString(accountId)
|
|
33461
|
+
);
|
|
33460
33462
|
}
|
|
33461
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
|
+
);
|
|
33462
33472
|
if (adminKey && publicKey) {
|
|
33463
33473
|
transaction.setAdminKey(publicKey);
|
|
33464
|
-
transaction.setAutoRenewAccountId(accountId);
|
|
33465
33474
|
}
|
|
33466
33475
|
if (submitKey && publicKey) {
|
|
33467
33476
|
transaction.setSubmitKey(publicKey);
|
|
33468
33477
|
}
|
|
33469
|
-
const transactionResponse = await this.hwc.executeTransactionWithErrorHandling(
|
|
33478
|
+
const transactionResponse = await this.hwc.executeTransactionWithErrorHandling(
|
|
33479
|
+
transaction,
|
|
33480
|
+
false
|
|
33481
|
+
);
|
|
33470
33482
|
const error = transactionResponse.error;
|
|
33471
33483
|
if (error) {
|
|
33472
33484
|
this.logger.error(error);
|