web-dc-api 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/dist/dc.min.js +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +22 -21
- package/dist/index.esm.js +1 -1
- package/lib/common/define.ts +1 -1
- package/lib/common/types/types.ts +13 -67
- package/lib/dc.ts +14 -2
- package/lib/implements/wallet/manager.ts +6 -1
- package/lib/interfaces/DCContext.ts +4 -1
- package/lib/interfaces/auth-interface.ts +2 -2
- package/lib/modules/auth-module.ts +9 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -218,6 +218,7 @@ interface Account {
|
|
|
218
218
|
ethAccount: string;
|
|
219
219
|
chainId: string;
|
|
220
220
|
chainName: string;
|
|
221
|
+
accountInfo?: AccountInfo;
|
|
221
222
|
}
|
|
222
223
|
declare enum AIStreamResponseFlag {
|
|
223
224
|
/** 流式响应进行中 */
|
|
@@ -265,20 +266,6 @@ declare enum UploadStatus {
|
|
|
265
266
|
FILECOUNTERROR = 7,// 文件总数错误
|
|
266
267
|
NOSPACE = 8
|
|
267
268
|
}
|
|
268
|
-
type ConnectReqMessage = {
|
|
269
|
-
type?: string;
|
|
270
|
-
origin: string;
|
|
271
|
-
data?: {
|
|
272
|
-
appId: string;
|
|
273
|
-
appName: string;
|
|
274
|
-
appIcon?: string;
|
|
275
|
-
appUrl: string;
|
|
276
|
-
appVersion: string;
|
|
277
|
-
account?: string;
|
|
278
|
-
chainId?: string;
|
|
279
|
-
};
|
|
280
|
-
};
|
|
281
|
-
declare function isConnectReqMessage(obj: any): obj is ConnectReqMessage;
|
|
282
269
|
type SignReqMessageData = {
|
|
283
270
|
appUrl: string;
|
|
284
271
|
ethAccount: string;
|
|
@@ -290,7 +277,6 @@ type SignReqMessage = {
|
|
|
290
277
|
origin: string;
|
|
291
278
|
data: SignReqMessageData;
|
|
292
279
|
};
|
|
293
|
-
declare function isSignReqMessage(obj: any): obj is SignReqMessage;
|
|
294
280
|
type SignResponseMessage = {
|
|
295
281
|
success: boolean;
|
|
296
282
|
signature: string;
|
|
@@ -307,7 +293,6 @@ type EIP712SignReqMessage = {
|
|
|
307
293
|
message: any;
|
|
308
294
|
};
|
|
309
295
|
};
|
|
310
|
-
declare function isEIP712SignReqMessage(obj: any): obj is EIP712SignReqMessage;
|
|
311
296
|
type SendMessage<T> = {
|
|
312
297
|
type: string;
|
|
313
298
|
data?: T;
|
|
@@ -349,6 +334,17 @@ interface IAppInfo {
|
|
|
349
334
|
rewarder: string;
|
|
350
335
|
fid: string;
|
|
351
336
|
}
|
|
337
|
+
type AccountInfo = {
|
|
338
|
+
url?: string;
|
|
339
|
+
name: string;
|
|
340
|
+
nftAccount: string;
|
|
341
|
+
account: string;
|
|
342
|
+
credentialId: string;
|
|
343
|
+
iv: Uint8Array;
|
|
344
|
+
mnemonic: ArrayBuffer;
|
|
345
|
+
timeStamp: number;
|
|
346
|
+
type: string;
|
|
347
|
+
};
|
|
352
348
|
|
|
353
349
|
/**
|
|
354
350
|
* 区块链相关的方法
|
|
@@ -3803,7 +3799,7 @@ interface IAuthOperations {
|
|
|
3803
3799
|
* 账户登录通过钱包
|
|
3804
3800
|
* @returns 是否登录成功
|
|
3805
3801
|
*/
|
|
3806
|
-
accountLoginWithWallet(): Promise<[Account | null, Error | null]>;
|
|
3802
|
+
accountLoginWithWallet(accountInfo?: AccountInfo): Promise<[Account | null, Error | null]>;
|
|
3807
3803
|
/**
|
|
3808
3804
|
* 账户登录
|
|
3809
3805
|
* @param nftAccount NFT账户
|
|
@@ -27328,6 +27324,7 @@ interface DCContext {
|
|
|
27328
27324
|
connectedDc: DCConnectInfo;
|
|
27329
27325
|
AccountBackupDc: DCConnectInfo;
|
|
27330
27326
|
appInfo: APPInfo;
|
|
27327
|
+
accountInfo: AccountInfo;
|
|
27331
27328
|
dbManager?: DBManager;
|
|
27332
27329
|
publicKey: Ed25519PubKey | undefined;
|
|
27333
27330
|
ethAddress: string | undefined;
|
|
@@ -27572,12 +27569,12 @@ declare class AuthModule implements DCModule, IAuthOperations {
|
|
|
27572
27569
|
* 账户登录
|
|
27573
27570
|
* @returns 是否登录成功
|
|
27574
27571
|
*/
|
|
27575
|
-
accountLoginWithWalletCall(): Promise<Account | null>;
|
|
27572
|
+
accountLoginWithWalletCall(accountInfo?: AccountInfo): Promise<Account | null>;
|
|
27576
27573
|
/**
|
|
27577
27574
|
* 账户登录(钱包登录)不抛出异常
|
|
27578
27575
|
* @returns [账户信息, 错误信息]
|
|
27579
27576
|
*/
|
|
27580
|
-
accountLoginWithWallet(): Promise<[
|
|
27577
|
+
accountLoginWithWallet(accountInfo?: AccountInfo): Promise<[
|
|
27581
27578
|
Account | null,
|
|
27582
27579
|
Error | null
|
|
27583
27580
|
]>;
|
|
@@ -28300,6 +28297,8 @@ declare class DC implements DCContext {
|
|
|
28300
28297
|
Blockheight: number;
|
|
28301
28298
|
grpcServer: DCGrpcServer;
|
|
28302
28299
|
appInfo: APPInfo;
|
|
28300
|
+
shouldReturnUserInfo: boolean;
|
|
28301
|
+
accountInfo: AccountInfo;
|
|
28303
28302
|
dbManager: any;
|
|
28304
28303
|
swUrl: string;
|
|
28305
28304
|
swInited: boolean;
|
|
@@ -28334,6 +28333,8 @@ declare class DC implements DCContext {
|
|
|
28334
28333
|
*/
|
|
28335
28334
|
init: (backStep?: (step: number) => Promise<void>) => Promise<boolean>;
|
|
28336
28335
|
setAppInfo(appInfo: APPInfo): void;
|
|
28336
|
+
setAccountInfo(accountInfo: AccountInfo): void;
|
|
28337
|
+
setShouldReturnUserInfo(shouldReturnUserInfo: boolean): void;
|
|
28337
28338
|
/**
|
|
28338
28339
|
* 获取当前用户的去中心数据库信息,如果用户数据库不存在,则会自动创建
|
|
28339
28340
|
* @param collections 集合配置数组,定义数据库中的集合结构
|
|
@@ -28551,5 +28552,5 @@ declare global {
|
|
|
28551
28552
|
}
|
|
28552
28553
|
}
|
|
28553
28554
|
|
|
28554
|
-
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,
|
|
28555
|
-
export type { AIChatMessage, AIChatMessageRequest, AIMessageContent, AIMessageMediaSource, AIProxyConfig, APPInfo, Account,
|
|
28555
|
+
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 };
|
|
28556
|
+
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 };
|