@docknetwork/wallet-sdk-wasm 1.5.14 → 1.7.0
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/generate-docs.js +49 -0
- package/jsdoc.conf.json +29 -6
- package/lib/index.js +8 -1
- package/lib/index.mjs +8 -1
- package/lib/rpc-server.js +10 -1
- package/lib/rpc-server.mjs +10 -1
- package/lib/services/blockchain/cached-did-resolver.js +113 -0
- package/lib/services/blockchain/cached-did-resolver.mjs +109 -0
- package/lib/services/blockchain/index.js +11 -0
- package/lib/services/blockchain/index.mjs +11 -0
- package/lib/services/blockchain/service-rpc.js +12 -0
- package/lib/services/blockchain/service-rpc.mjs +12 -0
- package/lib/services/blockchain/service.js +140 -11
- package/lib/services/blockchain/service.mjs +140 -11
- package/lib/services/credential/bbs-revocation.js +11 -0
- package/lib/services/credential/bbs-revocation.mjs +11 -0
- package/lib/services/credential/config.js +4 -1
- package/lib/services/credential/config.mjs +4 -1
- package/lib/services/credential/index.js +14 -0
- package/lib/services/credential/index.mjs +14 -0
- package/lib/services/credential/sd-jwt.js +214 -0
- package/lib/services/credential/sd-jwt.mjs +200 -0
- package/lib/services/credential/service-rpc.js +9 -0
- package/lib/services/credential/service-rpc.mjs +9 -0
- package/lib/services/credential/service.js +324 -7
- package/lib/services/credential/service.mjs +324 -7
- package/lib/services/edv/service.js +145 -1
- package/lib/services/edv/service.mjs +145 -1
- package/lib/services/index.js +13 -0
- package/lib/services/index.mjs +13 -0
- package/lib/services/relay-service/service.js +124 -1
- package/lib/services/relay-service/service.mjs +124 -1
- package/lib/services/rpc-service-client.js +0 -3
- package/lib/services/rpc-service-client.mjs +0 -3
- package/lib/services/storage/index.js +19 -2
- package/lib/services/storage/index.mjs +24 -1
- package/lib/services/storage/service-rpc.js +7 -3
- package/lib/services/storage/service-rpc.mjs +7 -3
- package/lib/services/storage/service.js +4 -0
- package/lib/services/storage/service.mjs +4 -0
- package/lib/setup-nodejs.js +8 -1
- package/lib/setup-nodejs.mjs +8 -1
- package/lib/setup-tests.js +8 -1
- package/lib/setup-tests.mjs +8 -1
- package/lib/src/services/blockchain/cached-did-resolver.d.ts +28 -0
- package/lib/src/services/blockchain/cached-did-resolver.d.ts.map +1 -0
- package/lib/src/services/blockchain/cached-did-resolver.test.d.ts +2 -0
- package/lib/src/services/blockchain/cached-did-resolver.test.d.ts.map +1 -0
- package/lib/src/services/blockchain/service.d.ts +114 -17
- package/lib/src/services/blockchain/service.d.ts.map +1 -1
- package/lib/src/services/credential/config.d.ts.map +1 -1
- package/lib/src/services/credential/index.d.ts +3 -0
- package/lib/src/services/credential/index.d.ts.map +1 -1
- package/lib/src/services/credential/sd-jwt.test.d.ts +2 -0
- package/lib/src/services/credential/sd-jwt.test.d.ts.map +1 -0
- package/lib/src/services/credential/service.d.ts +274 -4
- package/lib/src/services/credential/service.d.ts.map +1 -1
- package/lib/src/services/edv/service.d.ts +151 -1
- package/lib/src/services/edv/service.d.ts.map +1 -1
- package/lib/src/services/relay-service/service.d.ts +129 -1
- package/lib/src/services/relay-service/service.d.ts.map +1 -1
- package/lib/src/services/rpc-service-client.d.ts +2 -2
- package/lib/src/services/rpc-service-client.d.ts.map +1 -1
- package/lib/src/services/storage/index.d.ts +1 -1
- package/lib/src/services/storage/index.d.ts.map +1 -1
- package/lib/src/services/storage/service-rpc.d.ts +9 -0
- package/lib/src/services/storage/service-rpc.d.ts.map +1 -0
- package/lib/src/services/storage/service.d.ts +1 -0
- package/lib/src/services/storage/service.d.ts.map +1 -1
- package/lib/src/services/util-crypto/service.d.ts +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/wallet/rpc-storage-interface.js +13 -3
- package/lib/wallet/rpc-storage-interface.mjs +11 -1
- package/lib/wallet/rpc-storage-wallet.js +10 -0
- package/lib/wallet/rpc-storage-wallet.mjs +10 -0
- package/package.json +13 -8
- package/src/services/blockchain/cached-did-resolver.test.ts +288 -0
- package/src/services/blockchain/cached-did-resolver.ts +126 -0
- package/src/services/blockchain/service-rpc.js +12 -0
- package/src/services/blockchain/service.ts +142 -11
- package/src/services/credential/config.ts +7 -1
- package/src/services/credential/sd-jwt.test.ts +718 -0
- package/src/services/credential/sd-jwt.ts +231 -0
- package/src/services/credential/service-rpc.js +9 -0
- package/src/services/credential/service.ts +328 -7
- package/src/services/edv/service.ts +153 -1
- package/src/services/relay-service/service.ts +130 -1
- package/src/services/rpc-service-client.js +0 -3
- package/src/services/storage/index.js +15 -1
- package/src/services/storage/service-rpc.js +7 -3
- package/src/services/storage/service.ts +5 -0
|
@@ -13,17 +13,21 @@ class StorageServiceRpc extends RpcService {
|
|
|
13
13
|
super('storage');
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
setItem(...args)
|
|
16
|
+
setItem(...args) {
|
|
17
17
|
return this.call('setItem', ...args);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
removeItem(...args)
|
|
20
|
+
removeItem(...args) {
|
|
21
21
|
return this.call('removeItem', ...args);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
getItem(...args)
|
|
24
|
+
getItem(...args) {
|
|
25
25
|
return this.call('getItem', ...args);
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
getAllKeys() {
|
|
29
|
+
return this.call('getAllKeys');
|
|
30
|
+
}
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
export { StorageServiceRpc };
|
|
@@ -8,6 +8,7 @@ class StorageService {
|
|
|
8
8
|
StorageService.prototype.setItem,
|
|
9
9
|
StorageService.prototype.getItem,
|
|
10
10
|
StorageService.prototype.removeItem,
|
|
11
|
+
StorageService.prototype.getAllKeys,
|
|
11
12
|
];
|
|
12
13
|
constructor() {
|
|
13
14
|
this.name = 'storage';
|
|
@@ -21,6 +22,9 @@ class StorageService {
|
|
|
21
22
|
getItem(...args) {
|
|
22
23
|
return global.localStorage.getItem(...args);
|
|
23
24
|
}
|
|
25
|
+
getAllKeys() {
|
|
26
|
+
return Promise.resolve(Object.keys(global.localStorage));
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
29
|
const storageService = new StorageService();
|
|
26
30
|
|
|
@@ -4,6 +4,7 @@ class StorageService {
|
|
|
4
4
|
StorageService.prototype.setItem,
|
|
5
5
|
StorageService.prototype.getItem,
|
|
6
6
|
StorageService.prototype.removeItem,
|
|
7
|
+
StorageService.prototype.getAllKeys,
|
|
7
8
|
];
|
|
8
9
|
constructor() {
|
|
9
10
|
this.name = 'storage';
|
|
@@ -17,6 +18,9 @@ class StorageService {
|
|
|
17
18
|
getItem(...args) {
|
|
18
19
|
return global.localStorage.getItem(...args);
|
|
19
20
|
}
|
|
21
|
+
getAllKeys() {
|
|
22
|
+
return Promise.resolve(Object.keys(global.localStorage));
|
|
23
|
+
}
|
|
20
24
|
}
|
|
21
25
|
const storageService = new StorageService();
|
|
22
26
|
|
package/lib/setup-nodejs.js
CHANGED
|
@@ -26,6 +26,11 @@ require('@scure/bip39');
|
|
|
26
26
|
require('@scure/bip39/wordlists/english');
|
|
27
27
|
require('./services/util-crypto/configs.js');
|
|
28
28
|
require('@docknetwork/credential-sdk/types');
|
|
29
|
+
require('./services/blockchain/cached-did-resolver.js');
|
|
30
|
+
require('./services/storage/index.js');
|
|
31
|
+
require('./services/storage/service.js');
|
|
32
|
+
require('./services/storage/service-rpc.js');
|
|
33
|
+
require('./services/rpc-service-client.js');
|
|
29
34
|
require('./services/wallet/service.js');
|
|
30
35
|
require('./wallet/memory-storage-wallet.js');
|
|
31
36
|
require('@docknetwork/universal-wallet/storage-wallet');
|
|
@@ -34,7 +39,6 @@ require('@docknetwork/universal-wallet/storage/storage-interface');
|
|
|
34
39
|
require('./services/wallet/configs.js');
|
|
35
40
|
require('./core/validation.js');
|
|
36
41
|
require('./types.js');
|
|
37
|
-
require('./services/storage/service.js');
|
|
38
42
|
require('./services/dids/service.js');
|
|
39
43
|
require('@docknetwork/wallet-sdk-dids/lib');
|
|
40
44
|
require('./services/dids/config.js');
|
|
@@ -61,6 +65,9 @@ require('@docknetwork/crypto-wasm-ts/lib/legosnark');
|
|
|
61
65
|
require('./services/credential/pex-helpers.js');
|
|
62
66
|
require('@astronautlabs/jsonpath');
|
|
63
67
|
require('./services/credential/bbs-revocation.js');
|
|
68
|
+
require('./services/credential/sd-jwt.js');
|
|
69
|
+
require('@sd-jwt/sd-jwt-vc');
|
|
70
|
+
require('@sd-jwt/crypto-nodejs');
|
|
64
71
|
require('./services/relay-service/service.js');
|
|
65
72
|
require('./services/relay-service/configs.js');
|
|
66
73
|
require('@docknetwork/wallet-sdk-relay-service/lib');
|
package/lib/setup-nodejs.mjs
CHANGED
|
@@ -24,6 +24,11 @@ import '@scure/bip39';
|
|
|
24
24
|
import '@scure/bip39/wordlists/english';
|
|
25
25
|
import './services/util-crypto/configs.mjs';
|
|
26
26
|
import '@docknetwork/credential-sdk/types';
|
|
27
|
+
import './services/blockchain/cached-did-resolver.mjs';
|
|
28
|
+
import './services/storage/index.mjs';
|
|
29
|
+
import './services/storage/service.mjs';
|
|
30
|
+
import './services/storage/service-rpc.mjs';
|
|
31
|
+
import './services/rpc-service-client.mjs';
|
|
27
32
|
import './services/wallet/service.mjs';
|
|
28
33
|
import './wallet/memory-storage-wallet.mjs';
|
|
29
34
|
import '@docknetwork/universal-wallet/storage-wallet';
|
|
@@ -32,7 +37,6 @@ import '@docknetwork/universal-wallet/storage/storage-interface';
|
|
|
32
37
|
import './services/wallet/configs.mjs';
|
|
33
38
|
import './core/validation.mjs';
|
|
34
39
|
import './types.mjs';
|
|
35
|
-
import './services/storage/service.mjs';
|
|
36
40
|
import './services/dids/service.mjs';
|
|
37
41
|
import '@docknetwork/wallet-sdk-dids/lib';
|
|
38
42
|
import './services/dids/config.mjs';
|
|
@@ -59,6 +63,9 @@ import '@docknetwork/crypto-wasm-ts/lib/legosnark';
|
|
|
59
63
|
import './services/credential/pex-helpers.mjs';
|
|
60
64
|
import '@astronautlabs/jsonpath';
|
|
61
65
|
import './services/credential/bbs-revocation.mjs';
|
|
66
|
+
import './services/credential/sd-jwt.mjs';
|
|
67
|
+
import '@sd-jwt/sd-jwt-vc';
|
|
68
|
+
import '@sd-jwt/crypto-nodejs';
|
|
62
69
|
import './services/relay-service/service.mjs';
|
|
63
70
|
import './services/relay-service/configs.mjs';
|
|
64
71
|
import '@docknetwork/wallet-sdk-relay-service/lib';
|
package/lib/setup-tests.js
CHANGED
|
@@ -26,6 +26,11 @@ require('@scure/bip39');
|
|
|
26
26
|
require('@scure/bip39/wordlists/english');
|
|
27
27
|
require('./services/util-crypto/configs.js');
|
|
28
28
|
require('@docknetwork/credential-sdk/types');
|
|
29
|
+
require('./services/blockchain/cached-did-resolver.js');
|
|
30
|
+
require('./services/storage/index.js');
|
|
31
|
+
require('./services/storage/service.js');
|
|
32
|
+
require('./services/storage/service-rpc.js');
|
|
33
|
+
require('./services/rpc-service-client.js');
|
|
29
34
|
require('./services/wallet/service.js');
|
|
30
35
|
require('./wallet/memory-storage-wallet.js');
|
|
31
36
|
require('@docknetwork/universal-wallet/storage-wallet');
|
|
@@ -34,7 +39,6 @@ require('@docknetwork/universal-wallet/storage/storage-interface');
|
|
|
34
39
|
require('./services/wallet/configs.js');
|
|
35
40
|
require('./core/validation.js');
|
|
36
41
|
require('./types.js');
|
|
37
|
-
require('./services/storage/service.js');
|
|
38
42
|
require('./services/dids/service.js');
|
|
39
43
|
require('@docknetwork/wallet-sdk-dids/lib');
|
|
40
44
|
require('./services/dids/config.js');
|
|
@@ -61,6 +65,9 @@ require('@docknetwork/crypto-wasm-ts/lib/legosnark');
|
|
|
61
65
|
require('./services/credential/pex-helpers.js');
|
|
62
66
|
require('@astronautlabs/jsonpath');
|
|
63
67
|
require('./services/credential/bbs-revocation.js');
|
|
68
|
+
require('./services/credential/sd-jwt.js');
|
|
69
|
+
require('@sd-jwt/sd-jwt-vc');
|
|
70
|
+
require('@sd-jwt/crypto-nodejs');
|
|
64
71
|
require('./services/relay-service/service.js');
|
|
65
72
|
require('./services/relay-service/configs.js');
|
|
66
73
|
require('@docknetwork/wallet-sdk-relay-service/lib');
|
package/lib/setup-tests.mjs
CHANGED
|
@@ -24,6 +24,11 @@ import '@scure/bip39';
|
|
|
24
24
|
import '@scure/bip39/wordlists/english';
|
|
25
25
|
import './services/util-crypto/configs.mjs';
|
|
26
26
|
import '@docknetwork/credential-sdk/types';
|
|
27
|
+
import './services/blockchain/cached-did-resolver.mjs';
|
|
28
|
+
import './services/storage/index.mjs';
|
|
29
|
+
import './services/storage/service.mjs';
|
|
30
|
+
import './services/storage/service-rpc.mjs';
|
|
31
|
+
import './services/rpc-service-client.mjs';
|
|
27
32
|
import './services/wallet/service.mjs';
|
|
28
33
|
import './wallet/memory-storage-wallet.mjs';
|
|
29
34
|
import '@docknetwork/universal-wallet/storage-wallet';
|
|
@@ -32,7 +37,6 @@ import '@docknetwork/universal-wallet/storage/storage-interface';
|
|
|
32
37
|
import './services/wallet/configs.mjs';
|
|
33
38
|
import './core/validation.mjs';
|
|
34
39
|
import './types.mjs';
|
|
35
|
-
import './services/storage/service.mjs';
|
|
36
40
|
import './services/dids/service.mjs';
|
|
37
41
|
import '@docknetwork/wallet-sdk-dids/lib';
|
|
38
42
|
import './services/dids/config.mjs';
|
|
@@ -59,6 +63,9 @@ import '@docknetwork/crypto-wasm-ts/lib/legosnark';
|
|
|
59
63
|
import './services/credential/pex-helpers.mjs';
|
|
60
64
|
import '@astronautlabs/jsonpath';
|
|
61
65
|
import './services/credential/bbs-revocation.mjs';
|
|
66
|
+
import './services/credential/sd-jwt.mjs';
|
|
67
|
+
import '@sd-jwt/sd-jwt-vc';
|
|
68
|
+
import '@sd-jwt/crypto-nodejs';
|
|
62
69
|
import './services/relay-service/service.mjs';
|
|
63
70
|
import './services/relay-service/configs.mjs';
|
|
64
71
|
import '@docknetwork/wallet-sdk-relay-service/lib';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
interface CacheOptions {
|
|
2
|
+
ttl?: number;
|
|
3
|
+
}
|
|
4
|
+
interface DIDResolver {
|
|
5
|
+
resolve(did: string): Promise<any>;
|
|
6
|
+
supports(id: string): boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class CachedDIDResolver {
|
|
9
|
+
private router;
|
|
10
|
+
private ttl;
|
|
11
|
+
private readonly CACHE_PREFIX;
|
|
12
|
+
constructor(router: DIDResolver, cacheOptions?: CacheOptions);
|
|
13
|
+
private getCacheKey;
|
|
14
|
+
private getCacheEntry;
|
|
15
|
+
private setCacheEntry;
|
|
16
|
+
getCachedDIDs(): Promise<string[]>;
|
|
17
|
+
resolve(did: string): Promise<any>;
|
|
18
|
+
private refreshInBackground;
|
|
19
|
+
/**
|
|
20
|
+
* if the did is provided, it will remove the specific did from the cache
|
|
21
|
+
* otherwise, it will clear the entire cache
|
|
22
|
+
* @param did
|
|
23
|
+
*/
|
|
24
|
+
clearCache(did?: string): Promise<void>;
|
|
25
|
+
supports(id: string): boolean;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=cached-did-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cached-did-resolver.d.ts","sourceRoot":"","sources":["../../../../src/services/blockchain/cached-did-resolver.ts"],"names":[],"mappings":"AAQA,UAAU,YAAY;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,UAAU,WAAW;IACnB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;gBAEjC,MAAM,EAAE,WAAW,EAAE,YAAY,GAAE,YAAiB;IAMhE,OAAO,CAAC,WAAW;YAKL,aAAa;YAYb,aAAa;IAKrB,aAAa,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAalC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;YA0B1B,mBAAmB;IAiBjC;;;;OAIG;IACG,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW7C,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;CAG9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cached-did-resolver.test.d.ts","sourceRoot":"","sources":["../../../../src/services/blockchain/cached-did-resolver.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { ResolverRouter } from '@docknetwork/credential-sdk/resolver';
|
|
2
1
|
import { InitParams } from './configs';
|
|
2
|
+
/**
|
|
3
|
+
* Universal resolver URL for DID resolution fallback
|
|
4
|
+
* @constant {string}
|
|
5
|
+
*/
|
|
3
6
|
export declare const universalResolverUrl = "https://uniresolver.truvera.io";
|
|
4
|
-
|
|
5
|
-
method: any;
|
|
6
|
-
}
|
|
7
|
+
import { CachedDIDResolver } from './cached-did-resolver';
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Main blockchain service class for managing blockchain connections and DID resolution
|
|
10
|
+
* @class
|
|
11
|
+
* @description Provides methods for connecting to Cheqd blockchain, resolving DIDs,
|
|
12
|
+
* and managing blockchain-related operations
|
|
9
13
|
*/
|
|
10
14
|
export declare class BlockchainService {
|
|
11
15
|
dock: any;
|
|
@@ -14,11 +18,30 @@ export declare class BlockchainService {
|
|
|
14
18
|
cheqdApiUrl: any;
|
|
15
19
|
isBlockchainReady: boolean;
|
|
16
20
|
resolver: any;
|
|
21
|
+
/**
|
|
22
|
+
* Event names emitted by the blockchain service
|
|
23
|
+
* @static
|
|
24
|
+
* @readonly
|
|
25
|
+
* @property {string} BLOCKCHAIN_READY - Emitted when blockchain connection is established
|
|
26
|
+
*/
|
|
17
27
|
static Events: {
|
|
18
28
|
BLOCKCHAIN_READY: string;
|
|
19
29
|
};
|
|
20
|
-
rpcMethods: ((
|
|
30
|
+
rpcMethods: ((did: any) => any)[];
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new BlockchainService instance
|
|
33
|
+
* @constructor
|
|
34
|
+
*/
|
|
21
35
|
constructor();
|
|
36
|
+
/**
|
|
37
|
+
* Gets the types and modules needed for DID or accumulator operations
|
|
38
|
+
* @param {string} didOrRegistryId - DID or registry identifier
|
|
39
|
+
* @returns {Object} Object containing accumulator-related types and modules
|
|
40
|
+
* @returns {typeof AccumulatorPublicKey} returns.PublicKey - Accumulator public key type
|
|
41
|
+
* @returns {typeof AccumulatorId} returns.AccumulatorId - Accumulator ID type
|
|
42
|
+
* @returns {typeof AccumulatorCommon} returns.AccumulatorCommon - Common accumulator type
|
|
43
|
+
* @returns {Object} returns.AccumulatorModule - Accumulator module instance
|
|
44
|
+
*/
|
|
22
45
|
getTypesForDIDOrAccumulator(didOrRegistryId: any): {
|
|
23
46
|
PublicKey: any;
|
|
24
47
|
AccumulatorId: any;
|
|
@@ -26,32 +49,106 @@ export declare class BlockchainService {
|
|
|
26
49
|
AccumulatorModule: any;
|
|
27
50
|
};
|
|
28
51
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @returns
|
|
52
|
+
* Ensures the blockchain connection is ready before proceeding
|
|
53
|
+
* @returns {Promise<void>} Resolves when blockchain is ready
|
|
54
|
+
* @example
|
|
55
|
+
* await blockchainService.ensureBlockchainReady();
|
|
56
|
+
* // Blockchain is now connected and ready
|
|
31
57
|
*/
|
|
32
58
|
ensureBlockchainReady(): Promise<unknown>;
|
|
33
|
-
createDIDResolver(): AnyDIDResolver;
|
|
34
59
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @
|
|
37
|
-
|
|
60
|
+
* Gets the cached DIDs
|
|
61
|
+
* @returns {Promise<string[]>} Cached DIDs
|
|
62
|
+
*/
|
|
63
|
+
getCachedDIDs(): any;
|
|
64
|
+
/**
|
|
65
|
+
* Gets the cached DID resolution data
|
|
66
|
+
* @param {string} did - The DID to get the cache entry for
|
|
67
|
+
* @returns {Promise<any>} Cached DID resolution data
|
|
68
|
+
*/
|
|
69
|
+
getCacheEntry(did: any): any;
|
|
70
|
+
/**
|
|
71
|
+
* Clears cached data for a specific DID
|
|
72
|
+
* @param {string} did - The DID to clear from cache
|
|
73
|
+
* @returns {void}
|
|
74
|
+
*/
|
|
75
|
+
clearCache(did: any): any;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a DID resolver with caching support
|
|
78
|
+
* @private
|
|
79
|
+
* @returns {CachedDIDResolver} Cached DID resolver instance
|
|
80
|
+
*/
|
|
81
|
+
createDIDResolver(): CachedDIDResolver;
|
|
82
|
+
/**
|
|
83
|
+
* Initializes the blockchain service with connection parameters
|
|
84
|
+
* @param {InitParams} params - Initialization parameters
|
|
85
|
+
* @param {string} params.cheqdApiUrl - URL of the Cheqd API endpoint
|
|
86
|
+
* @param {string} [params.networkId] - Cheqd network identifier
|
|
87
|
+
* @param {string} [params.cheqdMnemonic] - Mnemonic for Cheqd wallet (auto-generated if not provided)
|
|
88
|
+
* @returns {Promise<boolean>} True if initialization successful
|
|
89
|
+
* @throws {Error} If cheqdApiUrl is not provided
|
|
90
|
+
* @example
|
|
91
|
+
* await blockchainService.init({
|
|
92
|
+
* cheqdApiUrl: 'https://api.cheqd.network',
|
|
93
|
+
* networkId: 'mainnet'
|
|
94
|
+
* });
|
|
38
95
|
*/
|
|
39
96
|
init(params: InitParams): Promise<boolean>;
|
|
40
97
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @returns
|
|
98
|
+
* Disconnects from the blockchain
|
|
99
|
+
* @returns {Promise<void>} Resolves when disconnection is complete
|
|
100
|
+
* @example
|
|
101
|
+
* await blockchainService.disconnect();
|
|
43
102
|
*/
|
|
44
103
|
disconnect(): Promise<any>;
|
|
104
|
+
/**
|
|
105
|
+
* Waits for the blockchain to be ready
|
|
106
|
+
* @returns {Promise<void>} Resolves when blockchain is ready
|
|
107
|
+
* @private
|
|
108
|
+
*/
|
|
45
109
|
waitBlockchainReady(): Promise<unknown>;
|
|
110
|
+
/**
|
|
111
|
+
* Resolves a DID to its document
|
|
112
|
+
* @param {string} did - The DID to resolve
|
|
113
|
+
* @returns {Promise<Object>} The resolved DID document
|
|
114
|
+
* @example
|
|
115
|
+
* const didDoc = await blockchainService.resolveDID('did:key:z6Mk...');
|
|
116
|
+
*/
|
|
46
117
|
resolveDID(did: string): Promise<any>;
|
|
47
118
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @returns
|
|
119
|
+
* Checks if the blockchain API is connected
|
|
120
|
+
* @returns {Promise<boolean>} True if connected, false otherwise
|
|
121
|
+
* @example
|
|
122
|
+
* const isConnected = await blockchainService.isApiConnected();
|
|
50
123
|
*/
|
|
51
124
|
isApiConnected(): Promise<any>;
|
|
125
|
+
/**
|
|
126
|
+
* Gets the current Cheqd API URL
|
|
127
|
+
* @returns {Promise<string>} The Cheqd API URL
|
|
128
|
+
* @example
|
|
129
|
+
* const apiUrl = await blockchainService.getAddress();
|
|
130
|
+
*/
|
|
52
131
|
getAddress(): Promise<any>;
|
|
132
|
+
/**
|
|
133
|
+
* Sets the blockchain ready state and emits events
|
|
134
|
+
* @private
|
|
135
|
+
* @param {boolean} isBlockchainReady - Whether blockchain is ready
|
|
136
|
+
*/
|
|
53
137
|
_setBlockchainReady(isBlockchainReady: any): void;
|
|
54
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Singleton instance of the blockchain service
|
|
141
|
+
* @type {BlockchainService}
|
|
142
|
+
* @example
|
|
143
|
+
* import { blockchainService } from '@docknetwork/wallet-sdk-wasm/services/blockchain';
|
|
144
|
+
*
|
|
145
|
+
* // Initialize the service
|
|
146
|
+
* await blockchainService.init({
|
|
147
|
+
* cheqdApiUrl: 'https://api.cheqd.network'
|
|
148
|
+
* });
|
|
149
|
+
*
|
|
150
|
+
* // Resolve a DID
|
|
151
|
+
* const didDoc = await blockchainService.resolveDID('did:key:z6Mk...');
|
|
152
|
+
*/
|
|
55
153
|
export declare const blockchainService: BlockchainService;
|
|
56
|
-
export {};
|
|
57
154
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/services/blockchain/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/services/blockchain/service.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAErC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,mCAAmC,CAAC;AAOrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAY1D;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,IAAI,MAAC;IACL,OAAO,MAAC;IACR,QAAQ,MAAC;IACT,WAAW,MAAC;IACZ,iBAAiB,UAAS;IAC1B,QAAQ,EAAE,GAAG,CAAC;IACd;;;;;OAKG;IACH,MAAM,CAAC,MAAM;;MAEX;IAEF,UAAU,wBAUR;IAEF;;;OAGG;;IAUH;;;;;;;;OAQG;IACH,2BAA2B,CAAC,eAAe,KAAA;;;;;;IAS3C;;;;;;OAMG;IACG,qBAAqB;IAS3B;;;OAGG;IACH,aAAa;IAIb;;;;OAIG;IACH,aAAa,CAAC,GAAG,KAAA;IAIjB;;;;OAIG;IACH,UAAU,CAAC,GAAG,KAAA;IAId;;;;OAIG;IACH,iBAAiB;IASjB;;;;;;;;;;;;;OAaG;IACG,IAAI,CAAC,MAAM,EAAE,UAAU;IAwD7B;;;;;OAKG;IACG,UAAU;IAYhB;;;;OAIG;IACG,mBAAmB;IAUzB;;;;;;OAMG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM;IAG5B;;;;;OAKG;IACG,cAAc;IAIpB;;;;;OAKG;IACG,UAAU;IAIhB;;;;OAIG;IACH,mBAAmB,CAAC,iBAAiB,KAAA;CAOtC;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAA2C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,UAAU;;;;;;;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,UAAU;;;;;;;CAkDtB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const credentialServiceRPC: {
|
|
2
2
|
rpcMethods: ((params?: {}) => any)[];
|
|
3
|
+
createSDJWTPresentation(params: any): Promise<string>;
|
|
3
4
|
generateCredential(params?: {}): any;
|
|
4
5
|
signCredential(params: any): Promise<any>;
|
|
5
6
|
createPresentation(params: any): Promise<any>;
|
|
@@ -9,6 +10,8 @@ export declare const credentialServiceRPC: {
|
|
|
9
10
|
evaluatePresentation(params: any): import("@sphereon/pex").EvaluationResults;
|
|
10
11
|
isBBSPlusCredential(params: any): any;
|
|
11
12
|
isKvacCredential(params: any): any;
|
|
13
|
+
isSDJWTCredential(params: any): boolean;
|
|
14
|
+
credentialToW3C(params: any): Promise<any>;
|
|
12
15
|
acquireOIDCredential({ uri, authorizationCode, holderKeyDocument, }: {
|
|
13
16
|
uri: string;
|
|
14
17
|
authorizationCode?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sd-jwt.test.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/sd-jwt.test.ts"],"names":[],"mappings":""}
|