@hashgraphonline/standards-sdk 0.0.43 → 0.0.45
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.
- package/LICENSE +189 -0
- package/README.md +81 -208
- package/dist/es/hcs-10/base-client.d.ts +21 -1
- package/dist/es/standards-sdk.es.js +116 -19
- package/dist/es/standards-sdk.es.js.map +1 -1
- package/dist/es/utils/sleep.d.ts +1 -0
- package/dist/umd/hcs-10/base-client.d.ts +21 -1
- package/dist/umd/standards-sdk.umd.js +3 -3
- package/dist/umd/standards-sdk.umd.js.map +1 -1
- package/dist/umd/utils/sleep.d.ts +1 -0
- package/package.json +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
@@ -9,7 +9,7 @@ export interface HCS10Config {
|
|
|
9
9
|
}
|
|
10
10
|
export interface HCSMessage {
|
|
11
11
|
p: 'hcs-10';
|
|
12
|
-
op: 'connection_request' | 'connection_created' | 'message';
|
|
12
|
+
op: 'connection_request' | 'connection_created' | 'message' | 'close_connection';
|
|
13
13
|
data: string;
|
|
14
14
|
created?: Date;
|
|
15
15
|
consensus_timestamp?: string;
|
|
@@ -24,6 +24,7 @@ export interface HCSMessage {
|
|
|
24
24
|
connection_id?: number;
|
|
25
25
|
sequence_number: number;
|
|
26
26
|
operator_id?: string;
|
|
27
|
+
reason?: string;
|
|
27
28
|
}
|
|
28
29
|
export interface ProfileResponse {
|
|
29
30
|
profile: any;
|
|
@@ -40,6 +41,25 @@ export declare abstract class HCS10BaseClient extends Registration {
|
|
|
40
41
|
accountId: string;
|
|
41
42
|
signer: any;
|
|
42
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Get a stream of messages from a connection topic
|
|
46
|
+
* @param topicId The connection topic ID to get messages from
|
|
47
|
+
* @returns A stream of filtered messages valid for connection topics
|
|
48
|
+
*/
|
|
49
|
+
getMessageStream(topicId: string): Promise<{
|
|
50
|
+
messages: HCSMessage[];
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Validates if an operator_id follows the correct format (agentTopicId@accountId)
|
|
54
|
+
* @param operatorId The operator ID to validate
|
|
55
|
+
* @returns True if the format is valid, false otherwise
|
|
56
|
+
*/
|
|
57
|
+
protected isValidOperatorId(operatorId: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Get all messages from a topic
|
|
60
|
+
* @param topicId The topic ID to get messages from
|
|
61
|
+
* @returns All messages from the topic
|
|
62
|
+
*/
|
|
43
63
|
getMessages(topicId: string): Promise<{
|
|
44
64
|
messages: HCSMessage[];
|
|
45
65
|
}>;
|