web-dc-api 0.0.48 → 0.0.50

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/dist/index.d.ts CHANGED
@@ -266,6 +266,15 @@ declare enum UploadStatus {
266
266
  FILECOUNTERROR = 7,// 文件总数错误
267
267
  NOSPACE = 8
268
268
  }
269
+ declare enum PeerStatus {
270
+ PeerStatusOffline = 1,
271
+ PeerStatusJoining = 2,//Joining the network
272
+ PeerStatusOnline = 3,
273
+ PeerStatusStaked = 4,
274
+ PeerStatusErr = 5,
275
+ PeerStatusClose = 6,
276
+ PeerStatusDiscard = 7
277
+ }
269
278
  type SignReqMessageData = {
270
279
  appUrl: string;
271
280
  ethAccount: string;
@@ -375,7 +384,7 @@ declare class ChainUtil {
375
384
  getUserWalletAccount(nftAccount: string): Promise<string | null>;
376
385
  getObjNodes: (cid: string) => Promise<string[] | undefined>;
377
386
  getAccountPeers: (account: Uint8Array) => Promise<string[] | null>;
378
- getDcNodeWebrtcDirectAddr: (peerid: string) => Promise<Multiaddr | null>;
387
+ getDcNodeWebrtcDirectAddr: (peerid: string) => Promise<[Multiaddr | null, PeerStatus]>;
379
388
  getDcNodeList: () => Promise<string[]>;
380
389
  objectState: (cid: string) => Promise<[StoreunitInfo | null, Error | null]>;
381
390
  ifEnoughUserSpace: (pubkeyRaw: Uint8Array, needSize?: number) => Promise<boolean>;
@@ -28574,5 +28583,5 @@ declare global {
28574
28583
  }
28575
28584
  }
28576
28585
 
28577
- export { AIProxyModule, AIStreamResponseFlag, AuthModule, CacheModule, ClientModule, CommentModule, CommentType, CoreModuleName, DC, DatabaseModule, Direction, Ed25519PrivKey, Ed25519PubKey, Errors, FileModule, KeyManager, KeyValueModule, LogLevel, MessageModule, ModuleSystem, NFTBindStatus, OffChainOpTimes, OffChainOpTimesLimit, OffChainSpaceLimit, ThemePermission, UploadStatus, UtilModule, configureLogger, createLogger, dc_protocol, dial_timeout, isServiceWorkerActive, keyExpire, registerServiceWorker, updateServiceWorker, walletOrigin, walletUrl, walletWindowName };
28586
+ export { AIProxyModule, AIStreamResponseFlag, AuthModule, CacheModule, ClientModule, CommentModule, CommentType, CoreModuleName, DC, DatabaseModule, Direction, Ed25519PrivKey, Ed25519PubKey, Errors, FileModule, KeyManager, KeyValueModule, LogLevel, MessageModule, ModuleSystem, NFTBindStatus, OffChainOpTimes, OffChainOpTimesLimit, OffChainSpaceLimit, PeerStatus, ThemePermission, UploadStatus, UtilModule, configureLogger, createLogger, dc_protocol, dial_timeout, isServiceWorkerActive, keyExpire, registerServiceWorker, updateServiceWorker, walletOrigin, walletUrl, walletWindowName };
28578
28587
  export type { AIChatMessage, AIChatMessageRequest, AIMessageContent, AIMessageMediaSource, AIProxyConfig, APPInfo, Account, AccountInfo, DCConnectInfo, DCContext, DCModule, EIP712SignReqMessage, FileTransmit, FunctionDef, IAICallConfig, IAppInfo, IAuthOperations, ICacheOperations, IClientOperations, ICommentOperations, IDatabaseOperations, IFileOperations, IKeyValueOperations, IMessageOperations, IUtilOperations, ModelConfig, OnStreamResponseType, ProxyCallConfig, ResponseMessage, SendMessage, SignHandler, SignReqMessage, SignReqMessageData, SignResponseMessage, ThemeAuthInfo, ThemeComment, ThemeObj, ToolDefinition, User, UserProxyCallConfig };