web-dc-api 0.1.5 → 0.1.6

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.
Files changed (148) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/dc.min.js +1 -1
  3. package/dist/esm/index.js +1 -1
  4. package/dist/index.d.ts +934 -878
  5. package/package.json +4 -8
  6. package/dist/cjs/helia-core-B1Xqha7a.js +0 -1
  7. package/dist/cjs/helia-core-D8Uv1KjQ.js +0 -1
  8. package/dist/cjs/polkadot-api-7PhQf3ws.js +0 -1
  9. package/dist/cjs/polkadot-api-CtrJVWuZ.js +0 -1
  10. package/dist/esm/chunks/helia-core-BxMqyK2Y.js +0 -1
  11. package/dist/esm/chunks/helia-core-DMXRpcO-.js +0 -1
  12. package/dist/esm/chunks/polkadot-api-5Y9Bw8VT.js +0 -1
  13. package/dist/esm/chunks/polkadot-api-D69Ioun_.js +0 -1
  14. package/lib/common/blowfish/block.ts +0 -259
  15. package/lib/common/blowfish/cipher.ts +0 -144
  16. package/lib/common/blowfish/const.ts +0 -195
  17. package/lib/common/chain.ts +0 -469
  18. package/lib/common/commonclient.ts +0 -202
  19. package/lib/common/constants.ts +0 -55
  20. package/lib/common/dc-key/ed25519.ts +0 -343
  21. package/lib/common/dc-key/keyManager.ts +0 -424
  22. package/lib/common/dcapi.ts +0 -98
  23. package/lib/common/dcutil.ts +0 -627
  24. package/lib/common/define.ts +0 -70
  25. package/lib/common/error.ts +0 -67
  26. package/lib/common/grpc-dc.ts +0 -104
  27. package/lib/common/module-system.ts +0 -184
  28. package/lib/common/service-worker.ts +0 -234
  29. package/lib/common/types/types.ts +0 -344
  30. package/lib/dc.ts +0 -701
  31. package/lib/implements/account/client.ts +0 -185
  32. package/lib/implements/account/manager.ts +0 -683
  33. package/lib/implements/aiproxy/client.ts +0 -357
  34. package/lib/implements/aiproxy/manager.ts +0 -670
  35. package/lib/implements/cache/client.ts +0 -105
  36. package/lib/implements/cache/manager.ts +0 -127
  37. package/lib/implements/comment/client.ts +0 -982
  38. package/lib/implements/comment/manager.ts +0 -1151
  39. package/lib/implements/dc/client.ts +0 -51
  40. package/lib/implements/dc/manager.ts +0 -33
  41. package/lib/implements/file/client.ts +0 -253
  42. package/lib/implements/file/file-cache-manager.ts +0 -142
  43. package/lib/implements/file/manager.ts +0 -1240
  44. package/lib/implements/file/seekableFileStream.ts +0 -344
  45. package/lib/implements/file/streamwriter.ts +0 -322
  46. package/lib/implements/keyvalue/client.ts +0 -376
  47. package/lib/implements/keyvalue/manager.ts +0 -759
  48. package/lib/implements/message/client.ts +0 -250
  49. package/lib/implements/message/manager.ts +0 -215
  50. package/lib/implements/threaddb/cbor/coding.ts +0 -62
  51. package/lib/implements/threaddb/cbor/event.ts +0 -336
  52. package/lib/implements/threaddb/cbor/node.ts +0 -542
  53. package/lib/implements/threaddb/cbor/record.ts +0 -398
  54. package/lib/implements/threaddb/common/AsyncMutex.ts +0 -24
  55. package/lib/implements/threaddb/common/addrinfo.ts +0 -135
  56. package/lib/implements/threaddb/common/dispatcher.ts +0 -81
  57. package/lib/implements/threaddb/common/idbstore-adapter.ts +0 -260
  58. package/lib/implements/threaddb/common/json-patcher.ts +0 -204
  59. package/lib/implements/threaddb/common/key.ts +0 -290
  60. package/lib/implements/threaddb/common/level-adapter.ts +0 -235
  61. package/lib/implements/threaddb/common/lineReader.ts +0 -79
  62. package/lib/implements/threaddb/common/logstore.ts +0 -215
  63. package/lib/implements/threaddb/common/transformed-datastore.ts +0 -308
  64. package/lib/implements/threaddb/core/app.ts +0 -206
  65. package/lib/implements/threaddb/core/core.ts +0 -230
  66. package/lib/implements/threaddb/core/db.ts +0 -249
  67. package/lib/implements/threaddb/core/event.ts +0 -54
  68. package/lib/implements/threaddb/core/head.ts +0 -89
  69. package/lib/implements/threaddb/core/identity.ts +0 -171
  70. package/lib/implements/threaddb/core/logstore.ts +0 -137
  71. package/lib/implements/threaddb/core/options.ts +0 -14
  72. package/lib/implements/threaddb/core/record.ts +0 -54
  73. package/lib/implements/threaddb/db/collection.ts +0 -1910
  74. package/lib/implements/threaddb/db/db.ts +0 -698
  75. package/lib/implements/threaddb/db/json2Query.ts +0 -192
  76. package/lib/implements/threaddb/db/query.ts +0 -524
  77. package/lib/implements/threaddb/dbclient.ts +0 -543
  78. package/lib/implements/threaddb/dbmanager.ts +0 -1906
  79. package/lib/implements/threaddb/lsstoreds/addr_book.ts +0 -549
  80. package/lib/implements/threaddb/lsstoreds/cache.ts +0 -36
  81. package/lib/implements/threaddb/lsstoreds/cyclic_batch.ts +0 -87
  82. package/lib/implements/threaddb/lsstoreds/global.ts +0 -151
  83. package/lib/implements/threaddb/lsstoreds/headbook.ts +0 -373
  84. package/lib/implements/threaddb/lsstoreds/keybook.ts +0 -297
  85. package/lib/implements/threaddb/lsstoreds/logstore.ts +0 -29
  86. package/lib/implements/threaddb/lsstoreds/metadata.ts +0 -223
  87. package/lib/implements/threaddb/net/define.ts +0 -149
  88. package/lib/implements/threaddb/net/grpcClient.ts +0 -589
  89. package/lib/implements/threaddb/net/grpcserver.ts +0 -146
  90. package/lib/implements/threaddb/net/net.ts +0 -2047
  91. package/lib/implements/threaddb/pb/lstore.proto +0 -38
  92. package/lib/implements/threaddb/pb/lstore.ts +0 -393
  93. package/lib/implements/threaddb/pb/lstore_pb.d.ts +0 -433
  94. package/lib/implements/threaddb/pb/lstore_pb.js +0 -1085
  95. package/lib/implements/threaddb/pb/net.proto +0 -194
  96. package/lib/implements/threaddb/pb/net_pb.d.ts +0 -2349
  97. package/lib/implements/threaddb/pb/net_pb.js +0 -5525
  98. package/lib/implements/threaddb/pb/proto-custom-types.ts +0 -212
  99. package/lib/implements/util/client.ts +0 -72
  100. package/lib/implements/util/manager.ts +0 -146
  101. package/lib/implements/wallet/manager.ts +0 -671
  102. package/lib/index.ts +0 -57
  103. package/lib/interfaces/DCContext.ts +0 -51
  104. package/lib/interfaces/aiproxy-interface.ts +0 -145
  105. package/lib/interfaces/auth-interface.ts +0 -118
  106. package/lib/interfaces/cache-interface.ts +0 -22
  107. package/lib/interfaces/client-interface.ts +0 -11
  108. package/lib/interfaces/comment-interface.ts +0 -167
  109. package/lib/interfaces/components/news-component.ts +0 -0
  110. package/lib/interfaces/database-interface.ts +0 -169
  111. package/lib/interfaces/file-interface.ts +0 -120
  112. package/lib/interfaces/index.ts +0 -10
  113. package/lib/interfaces/keyvalue-interface.ts +0 -156
  114. package/lib/interfaces/message-interface.ts +0 -22
  115. package/lib/interfaces/util-interface.ts +0 -31
  116. package/lib/modules/aiproxy-module.ts +0 -246
  117. package/lib/modules/auth-module.ts +0 -753
  118. package/lib/modules/cache-module.ts +0 -99
  119. package/lib/modules/client-module.ts +0 -71
  120. package/lib/modules/comment-module.ts +0 -429
  121. package/lib/modules/components/news-components.ts +0 -390
  122. package/lib/modules/database-module.ts +0 -598
  123. package/lib/modules/file-module.ts +0 -291
  124. package/lib/modules/index.ts +0 -13
  125. package/lib/modules/keyvalue-module.ts +0 -379
  126. package/lib/modules/message-module.ts +0 -107
  127. package/lib/modules/util-module.ts +0 -148
  128. package/lib/polyfills/process-env-browser.ts +0 -1
  129. package/lib/proto/datasource.ts +0 -93
  130. package/lib/proto/dcnet.proto +0 -1601
  131. package/lib/proto/dcnet_proto.d.ts +0 -22857
  132. package/lib/proto/dcnet_proto.js +0 -55204
  133. package/lib/proto/dcnet_proto_sparse.js +0 -55166
  134. package/lib/proto/oidfetch.proto +0 -25
  135. package/lib/proto/oidfetch_proto.d.ts +0 -585
  136. package/lib/proto/oidfetch_proto.js +0 -1247
  137. package/lib/serverless/babel-browser.ts +0 -39
  138. package/lib/serverless/base_entity.ts +0 -78
  139. package/lib/serverless/base_repository.ts +0 -414
  140. package/lib/serverless/browser_schema_extractor.ts +0 -283
  141. package/lib/serverless/decorator_factory.ts +0 -322
  142. package/lib/util/BrowserLineReader.ts +0 -73
  143. package/lib/util/base64.ts +0 -105
  144. package/lib/util/bcrypt.ts +0 -206
  145. package/lib/util/curve25519Encryption.ts +0 -418
  146. package/lib/util/dccrypt.ts +0 -73
  147. package/lib/util/logger.ts +0 -104
  148. package/lib/util/utils.ts +0 -289
@@ -1,212 +0,0 @@
1
- // proto-custom-types.ts
2
- import { Multiaddr,multiaddr } from '@multiformats/multiaddr'
3
- import { CID } from 'multiformats/cid'
4
- import { keys } from '@libp2p/crypto'
5
- import { PeerId } from "@libp2p/interface";
6
- import type { PrivateKey, PublicKey, KeyType, RSAPrivateKey, Secp256k1PrivateKey, Ed25519PrivateKey, Secp256k1PublicKey, Ed25519PublicKey } from '@libp2p/interface'
7
- import { Key} from '../common/key'
8
- import { ThreadID } from '@textile/threads-id';
9
- import { peerIdFromCID, peerIdFromMultihash, peerIdFromString } from '@libp2p/peer-id'
10
- import { decode } from 'multiformats/hashes/digest';
11
-
12
- // Base Types ================================================================
13
- type BrandedString<T extends string> = string & { readonly __brand: T }
14
-
15
-
16
- export type ProtoKey = BrandedString<'ProtoKey'>
17
-
18
- // Peer ID ===================================================================
19
- export class PeerIDConverter {
20
- static fromBytes(ibytes: Uint8Array): PeerId {
21
- try {
22
- const multihash = decode(ibytes);
23
- const peerID = peerIdFromMultihash(multihash);
24
- if (peerID == null) {
25
- throw new Error('Invalid Peer ID')
26
- }
27
- return peerID
28
- } catch (err: any) {
29
- throw new Error('Invalid Peer ID')
30
- }
31
- }
32
-
33
- static toBytes(id: string): Uint8Array {
34
- const peerID = peerIdFromString(id)
35
- if (peerID == null) {
36
- throw new Error('Invalid Peer ID')
37
- }
38
- const peerIDBytes = peerID.toMultihash().bytes
39
- return peerIDBytes
40
- }
41
-
42
-
43
-
44
- }
45
-
46
- // Multiaddr =================================================================
47
- export class MultiaddrConverter {
48
- static fromBytes(bytes: Uint8Array): Multiaddr {
49
- try {
50
- return multiaddr(bytes)
51
- } catch {
52
- throw new Error('Invalid multiaddr bytes')
53
- }
54
- }
55
-
56
- static toBytes(addr: Multiaddr): Uint8Array {
57
- return addr.bytes
58
- }
59
-
60
- /**
61
- * Convert from protobuf address info array to Multiaddr array
62
- *
63
- * @param addrs Array of protobuf address info objects
64
- * @returns Array of valid multiaddrs
65
- */
66
- static addrsFromProtobuf(addrs: Uint8Array[]): Multiaddr[] {
67
- const out: Multiaddr[] = [];
68
-
69
- for (const addr of addrs) {
70
- try {
71
- const a = multiaddr(addr);
72
- out.push(a);
73
- } catch (err) {
74
- // Skip invalid addresses
75
- continue;
76
- }
77
- }
78
-
79
- return out;
80
- }
81
-
82
- /**
83
- * Convert from Multiaddr array to protobuf address info array
84
- *
85
- * @param addrs Array of multiaddrs
86
- * @returns Array of protobuf address info objects
87
- */
88
- static addrsToProtobuf(addrs: Multiaddr[]): Uint8Array[] {
89
- const out: Uint8Array [] = [];
90
-
91
- for (const addr of addrs) {
92
- out.push( addr.bytes );
93
- }
94
-
95
- return out;
96
- }
97
- }
98
-
99
- // CID =======================================================================
100
- export class CidConverter {
101
- static fromBytes(bytes: Uint8Array): CID {
102
- try {
103
- return CID.decode(bytes)
104
- } catch {
105
- return CID.parse('bafkqaaa') // Undefined CID
106
- }
107
- }
108
-
109
- static toBytes(c: CID): Uint8Array {
110
- if (c == null) {
111
- return new Uint8Array() // Undefined CID
112
- }
113
- return c.bytes
114
- }
115
- }
116
-
117
- // Thread ID =================================================================
118
- export class ThreadIDConverter {
119
- static fromBytes(bytes: Uint8Array): string {
120
- const id = ThreadID.fromBytes(bytes).toString()
121
-
122
- return id
123
- }
124
-
125
- static toBytes(id: string): Uint8Array {
126
- const threadID = ThreadID.fromString(id)
127
- return threadID.toBytes()
128
- }
129
- }
130
-
131
- // Cryptographic Keys ========================================================
132
- export class KeyConverter {
133
-
134
-
135
- // Public Key
136
- static async publicFromBytes<T extends PublicKey >(bytes: Uint8Array): Promise<T> {
137
- try {
138
- return keys.publicKeyFromProtobuf(bytes) as T
139
- } catch {
140
- throw new Error('Invalid public key')
141
- }
142
- }
143
-
144
- // Private Key
145
- static async privateFromBytes(bytes: Uint8Array): Promise<PrivateKey> {
146
- try {
147
- return keys.privateKeyFromProtobuf(bytes)
148
- } catch {
149
- throw new Error('Invalid private key')
150
- }
151
- }
152
- static async toBytes(key: PrivateKey): Promise<Uint8Array> {
153
- try {
154
- return keys.privateKeyToProtobuf(key)
155
- } catch {
156
- throw new Error('Invalid private key')
157
- }
158
- }
159
-
160
- static async publicToBytes(key: PublicKey): Promise<Uint8Array> {
161
- try {
162
- return keys.publicKeyToProtobuf(key)
163
- } catch {
164
- throw new Error('Invalid public key')
165
- }
166
- }
167
- }
168
-
169
-
170
- // ProtoKey is a custom type used to serialize and deserialize raw keys into the symmetric.Key type, and back.
171
-
172
- export class ProtoKeyConverter {
173
- static fromBytes(bytes: Uint8Array): string {
174
- const key = Key.fromBytes(bytes)
175
- return key.toString()
176
- }
177
-
178
- static toBytes(pkey: string): Uint8Array {
179
- const key = Key.fromString(pkey)
180
- return key.toBytes()
181
- }
182
- }
183
-
184
-
185
- // JSON Utilities ============================================================
186
- export const json = {
187
- parseBytes: (json: string): Uint8Array => {
188
- const arr = JSON.parse(json)
189
- if (!Array.isArray(arr)) throw new Error('Invalid JSON array')
190
- return new Uint8Array(arr)
191
- },
192
- stringifyBytes: (bytes: Uint8Array): string =>
193
- JSON.stringify(Array.from(bytes))
194
- }
195
-
196
- // Example Usage =============================================================
197
- /*
198
- // 在另一个文件中导入使用:
199
- import {
200
- PeerIDConverter,
201
- MultiaddrConverter,
202
- CidConverter,
203
- ThreadIDConverter,
204
- KeyConverter,
205
- json
206
- } from './proto-custom-types'
207
-
208
- // 转换PeerID
209
- const peerBytes = new TextEncoder().encode('QmPNgojgxaxfLh2dfJXPs6f8qHgLueL5t7Yzoe6qkHkJXZ')
210
- const peerId = PeerIDConverter.fromBytes(peerBytes)
211
- const restoredBytes = PeerIDConverter.toBytes(peerId)
212
- */
@@ -1,72 +0,0 @@
1
- import type { Multiaddr } from "@multiformats/multiaddr";
2
- import type { Client } from "../../common/dcapi";
3
- import { Libp2pGrpcClient } from "grpc-libp2p-client";
4
- import { dcnet } from "../../proto/dcnet_proto";
5
- import { DCContext } from "../../../lib/interfaces/DCContext";
6
- import { uint32ToLittleEndianBytes } from "../../util/utils";
7
- import { Errors } from "../../common/error";
8
- import { Ed25519PrivKey, Ed25519PubKey } from "../../common/dc-key/ed25519";
9
- import { KeyManager } from "../../common/dc-key/keyManager";
10
-
11
- export class UtilClient {
12
- client: Client;
13
-
14
- constructor(dcClient: Client) {
15
- this.client = dcClient;
16
- }
17
-
18
- /**
19
- * 设置应用信息
20
- * @param context DCContext 上下文对象
21
- * @param threadId 数据库ID
22
- * @param rk 读取密钥,主要用来加解密真正的数据
23
- * @param sk 服务密钥,主要用来处理传输过程加解密
24
- * @param remark 备注信息
25
- * @returns Promise resolving when operation completes
26
- */
27
- async setAppInfo(appId: Uint8Array,owner: Uint8Array,rewarder: Uint8Array,domain: Uint8Array,blockHeight: number,peerId: string,fid:string,signature: Uint8Array): Promise<void> {
28
- if (this.client.p2pNode == null) {
29
- throw new Error("p2pNode is null");
30
- }
31
- try {
32
- // Create gRPC client
33
- const grpcClient = new Libp2pGrpcClient(
34
- this.client.p2pNode,
35
- this.client.peerAddr,
36
- this.client.token,
37
- this.client.protocol
38
- );
39
-
40
- // Create request message
41
- const message = new dcnet.pb.SetAppInfoRequest();
42
- message.appId = appId;
43
- message.ownerAccount = owner;
44
- message.rewardAccount = rewarder;
45
- message.domain = domain;
46
- message.blockheight = blockHeight;
47
- message.peerid = new TextEncoder().encode(peerId);
48
- message.fid = new TextEncoder().encode(fid);
49
- message.signature = signature;
50
-
51
-
52
- const messageBytes = dcnet.pb.SetAppInfoRequest.encode(message).finish();
53
-
54
- try {
55
- // Make RPC call
56
- await grpcClient.unaryCall(
57
- "/dcnet.pb.Service/SetAppInfo",
58
- messageBytes,
59
- 30000
60
- );
61
- return;
62
- } catch (error) {
63
- throw error;
64
- }
65
- } catch (error) {
66
- console.error("设置APP信息失败:", error);
67
- throw error;
68
- }
69
- }
70
- }
71
-
72
-
@@ -1,146 +0,0 @@
1
- import type { Multiaddr } from "@multiformats/multiaddr";
2
- import { ChainUtil } from "../../common/chain";
3
- import { DcUtil } from "../../common/dcutil";
4
- import { DCConnectInfo, IAppInfo, NFTBindStatus, User } from "../../common/types/types";
5
- import { UtilClient } from "./client";
6
- import { sha256, uint32ToLittleEndianBytes } from "../../util/utils";
7
- import { Ed25519PrivKey, Ed25519PubKey } from "../../common/dc-key/ed25519";
8
- import { DCContext } from "../../../lib/interfaces/DCContext";
9
- import { PeerId } from "@libp2p/interface";
10
- import {
11
- extractPublicKeyFromPeerId,
12
- generateSymKeyForPrikey,
13
- KeyManager,
14
- } from "../../common/dc-key/keyManager";
15
- import { SymmetricKey } from "../threaddb/common/key";
16
- import { peerIdFromString } from "@libp2p/peer-id";
17
- import { request } from "http";
18
- import { Errors } from "../../../lib/common/error";
19
- import { hexToBytes } from "@noble/curves/abstract/utils";
20
-
21
-
22
- export class UtilManager {
23
- dc: DcUtil;
24
- chainUtil: ChainUtil | undefined;
25
- connectedDc: DCConnectInfo = {};
26
- context: DCContext;
27
- constructor(context: DCContext) {
28
- this.connectedDc = context.connectedDc;
29
- this.dc = context.dcutil;
30
- this.chainUtil = context.dcChain;
31
- this.context = context;
32
- }
33
-
34
-
35
- /**
36
- * 设置应用信息
37
- * @param appId 应用ID
38
- * @param domain 应用域名
39
- * @param owner 应用所有者公钥
40
- * @param rewarder 应用奖励者公钥
41
- * @returns 用户默认数据库信息
42
- */
43
- async setAppInfo(
44
- appId: string,
45
- domain: string,
46
- owner: string,
47
- rewarder: string,
48
- fid: string = "",
49
- ): Promise<void> {
50
-
51
- if(!this.context.publicKey || !this.context.ethAddress){
52
- throw Errors.NO_USER_INFO;
53
- }
54
- if(!this.connectedDc.client){
55
- throw Errors.NO_DC_PEER_CONNECTED;
56
- }
57
- if(!this.connectedDc.nodeAddr){
58
- throw Errors.NO_DC_PEER_CONNECTED;
59
- }
60
-
61
- const blockHeight = await this.chainUtil?.getBlockHeight();
62
- if (blockHeight === undefined) {
63
- throw Errors.FAIL_TO_GET_BLOCKHEIGHT;
64
- }
65
- let ownerAccount = this.context.publicKey.bytes()
66
- if (owner && owner.length > 10) {
67
- ownerAccount = Ed25519PubKey.unmarshalString(owner).bytes();
68
- }
69
- let rewardAccount = hexToBytes(this.context.ethAddress.slice(2));
70
- if (rewarder && rewarder.length > 10) {
71
- rewardAccount = hexToBytes(rewarder.slice(2));
72
- }
73
- if (this.connectedDc.client.token == "") {
74
- const token = await this.connectedDc.client.GetToken(
75
- this.context.appInfo.appId || "",
76
- this.context.publicKey.string(),
77
- async (payload: Uint8Array): Promise<Uint8Array> => {
78
- return this.context.sign(payload);
79
- }
80
- );
81
- if (!token) {
82
- throw Errors.FAIL_TO_GET_TOKEN;
83
- }
84
- }
85
- const utilClient = new UtilClient(this.connectedDc.client);
86
- const serverPidStr = this.connectedDc.nodeAddr.getPeerId() || "";
87
- const serverPidBytes = new TextEncoder().encode(serverPidStr);
88
- const appIdBytes = new TextEncoder().encode(appId);
89
- const domainBytes = new TextEncoder().encode(domain);
90
- // 生成签名数据
91
- const hvalue = uint32ToLittleEndianBytes(blockHeight);
92
- const preSign = new Uint8Array(
93
- appIdBytes.length +
94
- domainBytes.length +
95
- ownerAccount.length +
96
- rewardAccount.length +
97
- hvalue.length +
98
- serverPidBytes.length+
99
- fid.length
100
- );
101
- let offset = 0;
102
- preSign.set(appIdBytes, offset);
103
- offset += appIdBytes.length;
104
- preSign.set(ownerAccount, offset);
105
- offset += ownerAccount.length;
106
- preSign.set(rewardAccount, offset);
107
- offset += rewardAccount.length;
108
- preSign.set(domainBytes, offset);
109
- offset += domainBytes.length;
110
- preSign.set(hvalue, offset);
111
- offset += hvalue.length;
112
- preSign.set(serverPidBytes, offset);
113
- offset += serverPidBytes.length;
114
- preSign.set(new TextEncoder().encode(fid), offset);
115
- // 使用私钥签名
116
- const signature = await this.context.sign(preSign);
117
-
118
- await utilClient.setAppInfo(
119
- appIdBytes,
120
- ownerAccount,
121
- rewardAccount,
122
- domainBytes,
123
- blockHeight,
124
- serverPidStr,
125
- fid,
126
- signature
127
- );
128
- return;
129
- }
130
-
131
- async getAppInfo( appId: string): Promise<IAppInfo> {
132
- if (!this.connectedDc.client) {
133
- throw Errors.NO_DC_PEER_CONNECTED;
134
- }
135
- if (!this.chainUtil) {
136
- throw Errors.NO_CHAIN_UTIL;
137
- }
138
- const appInfo = await this.chainUtil.getAPPInfo(
139
- appId
140
- );
141
- return appInfo;
142
- }
143
-
144
-
145
-
146
- }