Skip to content

Commit d818e02

Browse files
committed
feat: documentation update
Signed-off-by: rozekmichal <michal.rozek@blockydevs.com>
1 parent 52022fe commit d818e02

File tree

2 files changed

+35
-10
lines changed

2 files changed

+35
-10
lines changed

skills/hiero-cli/references/topic.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Import an existing topic into local state.
4444
hcli topic import --topic 0.0.123456 --name importedTopic
4545
```
4646

47-
**Output:** `{ topicId, name }`
47+
**Output:** `{ topicId, name?, network, memo?, adminKeyPresent, submitKeyPresent }`
4848

4949
---
5050

@@ -66,13 +66,13 @@ hcli topic list
6666

6767
Submit a message to a Hedera Consensus Service topic.
6868

69-
| Option | Short | Type | Required | Default | Description |
70-
| --------------- | ----- | ------ | -------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
71-
| `--topic` | `-t` | string | **yes** || Topic ID or alias |
72-
| `--message` | `-m` | string | **yes** || Message content to submit |
73-
| `--signer` | `-s` | string | no || Key to sign with (required if topic has submit-key): `accountId:privateKey`, `{ed25519\|ecdsa}:private:{hex}`, key reference, or alias |
74-
| `--key-manager` | `-k` | string | no | config default | Key manager: `local` or `local_encrypted` |
75-
| `--batch` | `-B` | string | no || Queue into a named batch instead of executing immediately |
69+
| Option | Short | Type | Required | Default | Description |
70+
| --------------- | ----- | ------ | -------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
71+
| `--topic` | `-t` | string | **yes** || Topic ID or alias |
72+
| `--message` | `-m` | string | **yes** || Message content to submit |
73+
| `--signer` | `-s` | string | no || Key to sign with (required if topic has submit-key). For threshold topics (e.g. 2-of-3), pass `--signer` multiple times for each required signer. Formats: `accountId:privateKey`, `{ed25519\|ecdsa}:private:{hex}`, key reference, or alias |
74+
| `--key-manager` | `-k` | string | no | config default | Key manager: `local` or `local_encrypted` |
75+
| `--batch` | `-B` | string | no || Queue into a named batch instead of executing immediately |
7676

7777
**Example:**
7878

src/plugins/topic/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ src/plugins/topic/
2222
│ │ ├── handler.ts # Create topic
2323
│ │ ├── output.ts # Output schema & template
2424
│ │ └── index.ts
25+
│ ├── import/
26+
│ │ ├── handler.ts # Import topic from mirror node
27+
│ │ ├── output.ts
28+
│ │ └── index.ts
2529
│ ├── list/
2630
│ │ ├── handler.ts # List topics from state
2731
│ │ ├── output.ts
@@ -69,6 +73,17 @@ hcli topic create \
6973
--submit-key 302e020100300506032b6570...
7074
```
7175

76+
### Topic Import
77+
78+
Import an existing topic into local state by topic ID. Fetches topic info from
79+
mirror node, extracts admin/submit keys (including KeyList and ThresholdKey),
80+
matches them with KMS via `findByPublicKey`, and stores `adminKeyRefIds`,
81+
`submitKeyRefIds`, and thresholds for use with submit-message.
82+
83+
```bash
84+
hcli topic import --topic 0.0.123456 --name importedTopic
85+
```
86+
7287
### Topic List
7388

7489
List topics stored in the CLI state (filtered by network if needed) with quick stats about memos and attached keys.
@@ -80,7 +95,9 @@ hcli topic list --network testnet
8095

8196
### Topic Submit Message
8297

83-
Submit a message to a topic using an alias or topic ID. Handles signing with the stored submit key when required.
98+
Submit a message to a topic using an alias or topic ID. Handles signing with
99+
the stored submit key when required. For threshold topics (e.g. 2-of-3), pass
100+
`--signer` multiple times to meet the required signature count.
84101

85102
```bash
86103
# Using alias registered during topic creation
@@ -92,6 +109,12 @@ hcli topic submit-message \
92109
hcli topic submit-message \
93110
--topic 0.0.900123 \
94111
--message '{"event":"mint","amount":10}'
112+
113+
# Threshold topic (2-of-3): provide 2 signers
114+
hcli topic submit-message \
115+
--topic multi-sig-topic \
116+
--message "Approved" \
117+
--signer alice --signer bob
95118
```
96119

97120
### Topic Find Message
@@ -152,11 +175,13 @@ Topics are stored under `topic-topics` with the schema defined in `schema.ts`:
152175

153176
```ts
154177
interface TopicData {
155-
name: string;
178+
name?: string;
156179
topicId: string;
157180
memo?: string;
158181
adminKeyRefIds?: string[];
159182
submitKeyRefIds?: string[];
183+
adminKeyThreshold?: number; // M-of-N for admin (from KeyList/ThresholdKey)
184+
submitKeyThreshold?: number; // M-of-N for submit (from KeyList/ThresholdKey)
160185
autoRenewAccount?: string;
161186
autoRenewPeriod?: number;
162187
expirationTime?: string;

0 commit comments

Comments
 (0)