@docknetwork/wallet-sdk-wasm 1.7.0 → 1.7.7-alpha.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.
Files changed (85) hide show
  1. package/lib/index.js +1 -0
  2. package/lib/index.mjs +1 -0
  3. package/lib/modules/network-manager.js +15 -12
  4. package/lib/modules/network-manager.mjs +15 -12
  5. package/lib/rpc-server.js +1 -0
  6. package/lib/rpc-server.mjs +1 -0
  7. package/lib/services/blockchain/service.js +22 -9
  8. package/lib/services/blockchain/service.mjs +23 -10
  9. package/lib/services/credential/bound-check.js +1 -1
  10. package/lib/services/credential/bound-check.mjs +1 -1
  11. package/lib/services/credential/delegatable-credentials.js +300 -0
  12. package/lib/services/credential/delegatable-credentials.mjs +263 -0
  13. package/lib/services/credential/index.js +39 -0
  14. package/lib/services/credential/index.mjs +4 -0
  15. package/lib/services/credential/pex-helpers.js +4 -4
  16. package/lib/services/credential/pex-helpers.mjs +4 -4
  17. package/lib/services/edv/index.js +1 -0
  18. package/lib/services/edv/index.mjs +1 -0
  19. package/lib/services/edv/service-rpc.js +23 -0
  20. package/lib/services/edv/service-rpc.mjs +23 -0
  21. package/lib/services/edv/service.js +81 -1
  22. package/lib/services/edv/service.mjs +78 -2
  23. package/lib/services/index.js +1 -0
  24. package/lib/services/index.mjs +1 -0
  25. package/lib/services/pex/config.js +4 -0
  26. package/lib/services/pex/config.mjs +4 -0
  27. package/lib/services/pex/service-rpc.js +4 -0
  28. package/lib/services/pex/service-rpc.mjs +4 -0
  29. package/lib/services/pex/service.js +7 -0
  30. package/lib/services/pex/service.mjs +7 -0
  31. package/lib/setup-nodejs.js +1 -0
  32. package/lib/setup-nodejs.mjs +1 -0
  33. package/lib/setup-tests.js +1 -0
  34. package/lib/setup-tests.mjs +1 -0
  35. package/lib/src/modules/event-manager.d.ts +0 -1
  36. package/lib/src/modules/event-manager.d.ts.map +1 -1
  37. package/lib/src/modules/network-manager.d.ts +2 -4
  38. package/lib/src/modules/network-manager.d.ts.map +1 -1
  39. package/lib/src/services/blockchain/configs.d.ts +1 -2
  40. package/lib/src/services/blockchain/configs.d.ts.map +1 -1
  41. package/lib/src/services/blockchain/service.d.ts +4 -3
  42. package/lib/src/services/blockchain/service.d.ts.map +1 -1
  43. package/lib/src/services/credential/bbs-revocation.d.ts +1 -1
  44. package/lib/src/services/credential/bbs-revocation.d.ts.map +1 -1
  45. package/lib/src/services/credential/bound-check.d.ts.map +1 -1
  46. package/lib/src/services/credential/delegatable-credentials.d.ts +272 -0
  47. package/lib/src/services/credential/delegatable-credentials.d.ts.map +1 -0
  48. package/lib/src/services/credential/index.d.ts +1 -0
  49. package/lib/src/services/credential/index.d.ts.map +1 -1
  50. package/lib/src/services/credential/pex-helpers.d.ts +2 -2
  51. package/lib/src/services/credential/pex-helpers.d.ts.map +1 -1
  52. package/lib/src/services/dids/keypair-utils.d.ts +2 -2
  53. package/lib/src/services/dids/keypair-utils.d.ts.map +1 -1
  54. package/lib/src/services/dids/service.d.ts +35 -3
  55. package/lib/src/services/dids/service.d.ts.map +1 -1
  56. package/lib/src/services/edv/service.d.ts +50 -1
  57. package/lib/src/services/edv/service.d.ts.map +1 -1
  58. package/lib/src/services/pex/config.d.ts +1 -0
  59. package/lib/src/services/pex/config.d.ts.map +1 -1
  60. package/lib/src/services/pex/service.d.ts +1 -0
  61. package/lib/src/services/pex/service.d.ts.map +1 -1
  62. package/lib/src/services/relay-service/service.d.ts +19 -7
  63. package/lib/src/services/relay-service/service.d.ts.map +1 -1
  64. package/lib/src/services/storage/service.d.ts.map +1 -1
  65. package/lib/src/services/util-crypto/service.d.ts +2 -2
  66. package/lib/src/services/util-crypto/service.d.ts.map +1 -1
  67. package/lib/tsconfig.tsbuildinfo +1 -1
  68. package/package.json +36 -16
  69. package/rollup.config.mjs +5 -3
  70. package/src/globals.d.ts +3 -0
  71. package/src/modules/network-manager.ts +15 -14
  72. package/src/services/blockchain/configs.ts +1 -2
  73. package/src/services/blockchain/service.ts +26 -10
  74. package/src/services/credential/bound-check.ts +1 -1
  75. package/src/services/credential/delegatable-credentials.ts +409 -0
  76. package/src/services/credential/index.ts +16 -0
  77. package/src/services/credential/pex-helpers.js +4 -4
  78. package/src/services/credential/pex-helpers.test.js +2 -2
  79. package/src/services/edv/index.test.js +229 -0
  80. package/src/services/edv/service-rpc.js +23 -0
  81. package/src/services/edv/service.ts +119 -0
  82. package/src/services/pex/config.ts +4 -0
  83. package/src/services/pex/service-rpc.js +4 -0
  84. package/src/services/pex/service.ts +13 -0
  85. package/src/services/pex/tests/pex-service.test.js +210 -0
@@ -75,6 +75,7 @@ import './edv/hmac.mjs';
75
75
  import 'base64url-universal';
76
76
  import '@docknetwork/universal-wallet/crypto';
77
77
  import '@docknetwork/wallet-sdk-data-store/lib/logger';
78
+ import 'futoin-hkdf';
78
79
 
79
80
  var services = [
80
81
  blockchainService,
@@ -15,6 +15,10 @@ const validation = {
15
15
  assert__default["default"](params.credentials, 'credentials is required');
16
16
  assert__default["default"](params.presentationDefinition, 'presentationDefinition is required');
17
17
  },
18
+ evaluateCredentials: (params) => {
19
+ assert__default["default"](params.credentials, 'credentials is required');
20
+ assert__default["default"](params.presentationDefinition, 'presentationDefinition is required');
21
+ },
18
22
  evaluatePresentation: (params) => {
19
23
  assert__default["default"](params.presentation, 'presentation is required');
20
24
  assert__default["default"](params.presentationDefinition, 'presentationDefinition is required');
@@ -7,6 +7,10 @@ const validation = {
7
7
  assert(params.credentials, 'credentials is required');
8
8
  assert(params.presentationDefinition, 'presentationDefinition is required');
9
9
  },
10
+ evaluateCredentials: (params) => {
11
+ assert(params.credentials, 'credentials is required');
12
+ assert(params.presentationDefinition, 'presentationDefinition is required');
13
+ },
10
14
  evaluatePresentation: (params) => {
11
15
  assert(params.presentation, 'presentation is required');
12
16
  assert(params.presentationDefinition, 'presentationDefinition is required');
@@ -30,6 +30,10 @@ class PEXServiceRPC extends services_rpcServiceClient.RpcService {
30
30
  async presentationFrom(params ) {
31
31
  return this.call('presentationFrom', params);
32
32
  }
33
+
34
+ async isCredentialSelectionValid(params ) {
35
+ return this.call('isCredentialSelectionValid', params);
36
+ }
33
37
  }
34
38
 
35
39
  exports.PEXServiceRPC = PEXServiceRPC;
@@ -26,6 +26,10 @@ class PEXServiceRPC extends RpcService {
26
26
  async presentationFrom(params ) {
27
27
  return this.call('presentationFrom', params);
28
28
  }
29
+
30
+ async isCredentialSelectionValid(params ) {
31
+ return this.call('isCredentialSelectionValid', params);
32
+ }
29
33
  }
30
34
 
31
35
  export { PEXServiceRPC };
@@ -58,6 +58,7 @@ class PEXService {
58
58
  PEXService.prototype.filterCredentials,
59
59
  PEXService.prototype.evaluatePresentation,
60
60
  PEXService.prototype.presentationFrom,
61
+ PEXService.prototype.isCredentialSelectionValid,
61
62
  ];
62
63
  filterCredentials(params) {
63
64
  services_pex_config.validation.filterCredentials(params);
@@ -65,6 +66,12 @@ class PEXService {
65
66
  const result = pex.selectFrom(removeOptionalAttribute(presentationDefinition), credentials, holderDIDs);
66
67
  return result;
67
68
  }
69
+ isCredentialSelectionValid(params) {
70
+ services_pex_config.validation.evaluateCredentials(params);
71
+ const { credentials, presentationDefinition, holderDIDs } = params;
72
+ const result = pex.selectFrom(removeOptionalAttribute(presentationDefinition), credentials, holderDIDs);
73
+ return result.errors.length === 0;
74
+ }
68
75
  evaluatePresentation(params) {
69
76
  services_pex_config.validation.evaluatePresentation(params);
70
77
  const { presentation, presentationDefinition } = params;
@@ -54,6 +54,7 @@ class PEXService {
54
54
  PEXService.prototype.filterCredentials,
55
55
  PEXService.prototype.evaluatePresentation,
56
56
  PEXService.prototype.presentationFrom,
57
+ PEXService.prototype.isCredentialSelectionValid,
57
58
  ];
58
59
  filterCredentials(params) {
59
60
  validation.filterCredentials(params);
@@ -61,6 +62,12 @@ class PEXService {
61
62
  const result = pex.selectFrom(removeOptionalAttribute(presentationDefinition), credentials, holderDIDs);
62
63
  return result;
63
64
  }
65
+ isCredentialSelectionValid(params) {
66
+ validation.evaluateCredentials(params);
67
+ const { credentials, presentationDefinition, holderDIDs } = params;
68
+ const result = pex.selectFrom(removeOptionalAttribute(presentationDefinition), credentials, holderDIDs);
69
+ return result.errors.length === 0;
70
+ }
64
71
  evaluatePresentation(params) {
65
72
  validation.evaluatePresentation(params);
66
73
  const { presentation, presentationDefinition } = params;
@@ -80,6 +80,7 @@ require('./services/edv/hmac.js');
80
80
  require('base64url-universal');
81
81
  require('@docknetwork/universal-wallet/crypto');
82
82
  require('@docknetwork/wallet-sdk-data-store/lib/logger');
83
+ require('futoin-hkdf');
83
84
 
84
85
  global.localStorage = new nodeLocalstorage.LocalStorage('./local-storage');
85
86
 
@@ -78,6 +78,7 @@ import './services/edv/hmac.mjs';
78
78
  import 'base64url-universal';
79
79
  import '@docknetwork/universal-wallet/crypto';
80
80
  import '@docknetwork/wallet-sdk-data-store/lib/logger';
81
+ import 'futoin-hkdf';
81
82
 
82
83
  global.localStorage = new LocalStorage('./local-storage');
83
84
 
@@ -80,6 +80,7 @@ require('./services/edv/hmac.js');
80
80
  require('base64url-universal');
81
81
  require('@docknetwork/universal-wallet/crypto');
82
82
  require('@docknetwork/wallet-sdk-data-store/lib/logger');
83
+ require('futoin-hkdf');
83
84
 
84
85
  core_storage.setStorage(global.localStorage);
85
86
 
@@ -78,6 +78,7 @@ import './services/edv/hmac.mjs';
78
78
  import 'base64url-universal';
79
79
  import '@docknetwork/universal-wallet/crypto';
80
80
  import '@docknetwork/wallet-sdk-data-store/lib/logger';
81
+ import 'futoin-hkdf';
81
82
 
82
83
  setStorage(global.localStorage);
83
84
 
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { EventEmitter } from 'events';
3
2
  export declare function once(emitter: EventEmitter, eventName: string): Promise<unknown>;
4
3
  export declare class EventManager {
@@ -1 +1 @@
1
- {"version":3,"file":"event-manager.d.ts","sourceRoot":"","sources":["../../../src/modules/event-manager.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAIpC,wBAAgB,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAE5D;AAGD,qBAAa,YAAY;IACvB,YAAY,EAAE,YAAY,CAAC;;IAK3B,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;IAMrC,cAAc,CAAC,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKlC,gBAAgB,CAAC,SAAS,KAAA,EAAE,QAAQ,KAAA;IAIpC,EAAE,CAAC,SAAS,KAAA,EAAE,QAAQ,KAAA;IAMtB,OAAO,CAAC,SAAS,KAAA;CAGlB"}
1
+ {"version":3,"file":"event-manager.d.ts","sourceRoot":"","sources":["../../../src/modules/event-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAIpC,wBAAgB,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAE5D;AAGD,qBAAa,YAAY;IACvB,YAAY,EAAE,YAAY,CAAC;;IAK3B,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;IAMrC,cAAc,CAAC,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKlC,gBAAgB,CAAC,SAAS,KAAA,EAAE,QAAQ,KAAA;IAIpC,EAAE,CAAC,SAAS,KAAA,EAAE,QAAQ,KAAA;IAMtB,OAAO,CAAC,SAAS,KAAA;CAGlB"}
@@ -1,11 +1,9 @@
1
1
  export type NetworkInfo = {
2
2
  name: string;
3
- substrateUrl: string | string[];
4
- addressPrefix: number;
5
- cheqdApiUrl: string;
3
+ cheqdApiUrl: string | string[];
6
4
  };
7
5
  export type NetworkId = 'mainnet' | 'testnet' | 'local' | 'custom';
8
- export declare const SUBSTRATE_NETWORKS: Record<NetworkId, NetworkInfo>;
6
+ export declare const BLOCKCHAIN_NETWORKS: Record<NetworkId, NetworkInfo>;
9
7
  /**
10
8
  * NetworkManager
11
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"network-manager.d.ts","sourceRoot":"","sources":["../../../src/modules/network-manager.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEnE,eAAO,MAAM,kBAAkB,EAAG,MAAM,CAAC,SAAS,EAAE,WAAW,CAkB9D,CAAC;AAUF;;GAEG;AACH,qBAAa,cAAc;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;;IAQlB;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,SAAS;IAMjC;;;OAGG;IACH,cAAc;IAId;;;;OAIG;IACH,MAAM,CAAC,WAAW,IAAI,cAAc;CAOrC"}
1
+ {"version":3,"file":"network-manager.d.ts","sourceRoot":"","sources":["../../../src/modules/network-manager.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEnE,eAAO,MAAM,mBAAmB,EAAG,MAAM,CAAC,SAAS,EAAE,WAAW,CAqB/D,CAAC;AAUF;;GAEG;AACH,qBAAa,cAAc;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;;IAQlB;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,SAAS;IAMjC;;;OAGG;IACH,cAAc;IAId;;;;OAIG;IACH,MAAM,CAAC,WAAW,IAAI,cAAc;CAOrC"}
@@ -1,7 +1,6 @@
1
1
  export declare const validation: {};
2
2
  export type InitParams = {
3
- substrateUrl: string;
4
- cheqdApiUrl?: string;
3
+ cheqdApiUrl?: string | string[];
5
4
  networkId?: string;
6
5
  cheqdMnemonic?: string;
7
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../../../src/services/blockchain/configs.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,IAAK,CAAC;AAE7B,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../../../src/services/blockchain/configs.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,IAAK,CAAC;AAE7B,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -17,7 +17,8 @@ export declare class BlockchainService {
17
17
  cheqdApi: any;
18
18
  cheqdApiUrl: any;
19
19
  isBlockchainReady: boolean;
20
- resolver: any;
20
+ private _resolver;
21
+ get resolver(): any;
21
22
  /**
22
23
  * Event names emitted by the blockchain service
23
24
  * @static
@@ -78,7 +79,7 @@ export declare class BlockchainService {
78
79
  * @private
79
80
  * @returns {CachedDIDResolver} Cached DID resolver instance
80
81
  */
81
- createDIDResolver(): CachedDIDResolver;
82
+ createDIDResolver(isBlockchainReady: boolean): CachedDIDResolver;
82
83
  /**
83
84
  * Initializes the blockchain service with connection parameters
84
85
  * @param {InitParams} params - Initialization parameters
@@ -128,7 +129,7 @@ export declare class BlockchainService {
128
129
  * @example
129
130
  * const apiUrl = await blockchainService.getAddress();
130
131
  */
131
- getAddress(): Promise<any>;
132
+ getAddress(): Promise<string | string[]>;
132
133
  /**
133
134
  * Sets the blockchain ready state and emits events
134
135
  * @private
@@ -1 +1 @@
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
+ {"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,OAAO,CAAC,SAAS,CAAM;IAEvB,IAAI,QAAQ,IAAI,GAAG,CAElB;IACD;;;;;OAKG;IACH,MAAM,CAAC,MAAM;;MAEX;IAEF,UAAU,wBAUR;IAEF;;;OAGG;;IAWH;;;;;;;;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,CAAC,iBAAiB,EAAE,OAAO;IAkB5C;;;;;;;;;;;;;OAaG;IACG,IAAI,CAAC,MAAM,EAAE,UAAU;IA0D7B;;;;;OAKG;IACG,UAAU;IAYhB;;;;OAIG;IACG,mBAAmB;IAUzB;;;;;;OAMG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM;IAG5B;;;;;OAKG;IACG,cAAc;IAIpB;;;;;OAKG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC;IAI9C;;;;OAIG;IACH,mBAAmB,CAAC,iBAAiB,KAAA;CAOtC;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAA2C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { PositiveAccumulator, AccumulatorPublicKey, VBMembershipWitness } from '@docknetwork/crypto-wasm-ts';
2
2
  export declare const getWitnessDetails: (credential: any, _membershipWitness: any) => Promise<{
3
- encodedRevId: Uint8Array;
3
+ encodedRevId: Uint8Array<ArrayBufferLike>;
4
4
  membershipWitness: VBMembershipWitness;
5
5
  pk: AccumulatorPublicKey;
6
6
  params: import("@docknetwork/crypto-wasm-ts").AccumulatorParams;
@@ -1 +1 @@
1
- {"version":3,"file":"bbs-revocation.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/bbs-revocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,oBAAoB,EAEpB,mBAAmB,EAGpB,MAAM,6BAA6B,CAAC;AAgBrC,eAAO,MAAM,iBAAiB;;;;;;EA6E7B,CAAC;AAEF,eAAO,MAAM,YAAY,gEAexB,CAAC"}
1
+ {"version":3,"file":"bbs-revocation.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/bbs-revocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,oBAAoB,EAEpB,mBAAmB,EAGpB,MAAM,6BAA6B,CAAC;AAgBrC,eAAO,MAAM,iBAAiB,GAAU,eAAU,EAAE,uBAAkB;;;;;;EA6ErE,CAAC;AAEF,eAAO,MAAM,YAAY,GAAU,eAAU,EAAE,uBAAkB,qBAehE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"bound-check.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/bound-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AAKpE,UAAU,MAAM;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,KAAK;IACb,IAAI,EAA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C,OAAO,CAAC,CAKrE;AAED,wBAAsB,eAAe,CAAC,YAAY,EAAE,YAAY;;;GAa/D;AAED,eAAO,MAAM,aAAa,iBAAkB,YAAY,YACrB,CAAC"}
1
+ {"version":3,"file":"bound-check.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/bound-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AAKpE,UAAU,MAAM;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,WAAW;IACnB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB,EAAE,eAAe,EAAE,CAAC;CACtC;AAED,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,mBAAmB,GACpB,EAAE;IACD,OAAO,EAAE,mBAAmB,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,mBAAmB,EAAE,GAAG,EAAE,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,cAAc,CAAC;CAC5B,SA0BA;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAQvE;AAED,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,CAM/D;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKrE;AAED,wBAAsB,eAAe,CAAC,YAAY,EAAE,YAAY;;;GAa/D;AAED,eAAO,MAAM,aAAa,GAAI,cAAc,YAAY,YACrB,CAAC"}
@@ -0,0 +1,272 @@
1
+ import * as cedar from '@cedar-policy/cedar-wasm/nodejs';
2
+ import { MAY_CLAIM_IRI } from '@docknetwork/vc-delegation-engine';
3
+ export interface VerificationResult {
4
+ verified: boolean;
5
+ credentialResults?: any[];
6
+ delegationResult?: {
7
+ decision: string;
8
+ summaries?: any[];
9
+ authorizations?: any[];
10
+ failures?: any[];
11
+ };
12
+ error?: any;
13
+ }
14
+ export interface CedarPolicies {
15
+ staticPolicies: string;
16
+ }
17
+ export interface VerifiablePresentation {
18
+ '@context': any[];
19
+ type: string[];
20
+ proof?: any;
21
+ verifiableCredential?: any[];
22
+ }
23
+ export interface DelegationCredential {
24
+ '@context': any[];
25
+ id: string;
26
+ type: string[];
27
+ issuer: string;
28
+ issuanceDate: string;
29
+ previousCredentialId: string | null;
30
+ rootCredentialId: string;
31
+ credentialSubject: {
32
+ id: string;
33
+ [key: string]: any;
34
+ };
35
+ proof?: any;
36
+ }
37
+ export interface VerifyDelegationOptions {
38
+ challenge?: string;
39
+ domain?: string;
40
+ unsignedPresentation?: boolean;
41
+ failOnUnauthorizedClaims?: boolean;
42
+ policies?: CedarPolicies;
43
+ }
44
+ export interface KeyPair {
45
+ type: string;
46
+ id?: string;
47
+ controller?: string;
48
+ publicKeyJwk?: any;
49
+ privateKeyJwk?: any;
50
+ publicKeyBase58?: string;
51
+ privateKeyBase58?: string;
52
+ }
53
+ /**
54
+ * W3C Credentials V1 context URL
55
+ */
56
+ export declare const W3C_CREDENTIALS_V1 = "https://www.w3.org/2018/credentials/v1";
57
+ /**
58
+ * Re-export MAY_CLAIM_IRI for use in credentials
59
+ */
60
+ export { MAY_CLAIM_IRI };
61
+ /**
62
+ * Namespace used by the vc-delegation-engine for delegation properties
63
+ */
64
+ export declare const DELEGATION_ENGINE_NS = "https://ld.truvera.io/credentials/delegation#";
65
+ /**
66
+ * Base delegation context terms required for delegation credentials.
67
+ * These terms define the JSON-LD mappings needed for the vc-delegation-engine
68
+ * to properly process delegation chains.
69
+ *
70
+ * Use this as a base and extend with your own application-specific terms:
71
+ * @example
72
+ * const myContext = [
73
+ * W3C_CREDENTIALS_V1,
74
+ * {
75
+ * ...DELEGATION_CONTEXT_TERMS,
76
+ * // Add your custom terms here
77
+ * MyCredentialType: 'https://example.org/MyCredentialType',
78
+ * myField: 'https://example.org/myField',
79
+ * },
80
+ * ];
81
+ */
82
+ export declare const DELEGATION_CONTEXT_TERMS: {
83
+ '@version': number;
84
+ '@protected': boolean;
85
+ DelegationCredential: string;
86
+ mayClaim: {
87
+ '@id': "https://rdf.dock.io/alpha/2021#mayClaim";
88
+ '@container': string;
89
+ };
90
+ rootCredentialId: {
91
+ '@id': string;
92
+ '@type': string;
93
+ };
94
+ previousCredentialId: {
95
+ '@id': string;
96
+ '@type': string;
97
+ };
98
+ };
99
+ /**
100
+ * Default context for verifiable presentations
101
+ */
102
+ export declare const PRESENTATION_CONTEXT: string[];
103
+ /**
104
+ * Issues a delegation credential that grants authority to a delegate
105
+ * @param keyPair - The key pair to sign the credential
106
+ * @param params - Delegation parameters
107
+ * @returns Signed delegation credential
108
+ */
109
+ export declare function issueDelegationCredential(keyPair: KeyPair, credential: any): Promise<DelegationCredential>;
110
+ /**
111
+ * Issues a credential as a delegate (with delegation chain reference)
112
+ * @param keyPair - The delegate's key pair to sign the credential
113
+ * @param params - Credential parameters
114
+ * @returns Signed credential
115
+ */
116
+ export declare function issueDelegatedCredential(keyPair: KeyPair, credential: any): Promise<any>;
117
+ /**
118
+ * Creates and signs a verifiable presentation with delegation credentials
119
+ * @param keyPair - The key pair to sign the presentation
120
+ * @param params - Presentation parameters
121
+ * @returns Signed verifiable presentation
122
+ */
123
+ export declare function createSignedPresentation(keyPair: KeyPair, params: {
124
+ credentials: any[];
125
+ holderDid: string;
126
+ challenge: string;
127
+ domain: string;
128
+ context?: any[];
129
+ }): Promise<VerifiablePresentation>;
130
+ /**
131
+ * Verifies a verifiable presentation with optional delegation chain validation
132
+ * Uses the credential-sdk's verifyPresentation which automatically:
133
+ * 1. Verifies the presentation signature
134
+ * 2. Verifies all credentials
135
+ * 3. Detects delegation credentials
136
+ * 4. Validates the delegation chain
137
+ * 5. Applies Cedar policies if provided
138
+ *
139
+ * @param vp - The verifiable presentation to verify
140
+ * @param options - Verification options
141
+ * @returns Verification result with delegation info if applicable
142
+ */
143
+ export declare function verifyDelegatablePresentation(vp: VerifiablePresentation, options?: VerifyDelegationOptions): Promise<VerificationResult>;
144
+ /**
145
+ * Creates a Cedar policy for delegation verification
146
+ * @param config - Policy configuration
147
+ * @returns Cedar policy object
148
+ */
149
+ export declare function createCedarPolicy(config: {
150
+ maxDepth?: number;
151
+ rootIssuer: string;
152
+ requiredClaims?: Record<string, any>;
153
+ }): CedarPolicies;
154
+ /**
155
+ * Creates an unsigned verifiable presentation (for testing)
156
+ * @param credentials - Array of credentials to include
157
+ * @param proof - Optional proof object
158
+ * @param context - Optional context
159
+ * @returns Verifiable presentation object
160
+ */
161
+ export declare function createUnsignedPresentation(credentials: any[], proof?: any, context?: any[]): VerifiablePresentation;
162
+ /**
163
+ * Re-export cedar for use in tests and external code
164
+ */
165
+ export { cedar };
166
+ /**
167
+ * Service class for delegatable credentials operations
168
+ */
169
+ declare class DelegatableCredentialsService {
170
+ name: string;
171
+ rpcMethods: (((params: {
172
+ keyPair: KeyPair;
173
+ id: string;
174
+ issuerDid: string;
175
+ delegateDid: string;
176
+ mayClaim: string[];
177
+ context: any[];
178
+ types: string[];
179
+ additionalSubjectProperties?: Record<string, any>;
180
+ previousCredentialId?: string | null;
181
+ rootCredentialId?: string;
182
+ }) => Promise<DelegationCredential>) | ((params: {
183
+ keyPair: KeyPair;
184
+ id: string;
185
+ issuerDid: string;
186
+ subjectDid: string;
187
+ claims: Record<string, any>;
188
+ rootCredentialId: string;
189
+ previousCredentialId: string;
190
+ context: any[];
191
+ types: string[];
192
+ }) => Promise<any>) | ((params: {
193
+ keyPair: KeyPair;
194
+ credentials: any[];
195
+ holderDid: string;
196
+ challenge: string;
197
+ domain: string;
198
+ context?: any[];
199
+ }) => Promise<VerifiablePresentation>) | ((params: {
200
+ presentation: VerifiablePresentation;
201
+ challenge?: string;
202
+ domain?: string;
203
+ unsignedPresentation?: boolean;
204
+ failOnUnauthorizedClaims?: boolean;
205
+ policies?: CedarPolicies;
206
+ }) => Promise<VerificationResult>) | ((params: {
207
+ maxDepth?: number;
208
+ rootIssuer: string;
209
+ requiredClaims?: Record<string, any>;
210
+ }) => CedarPolicies))[];
211
+ /**
212
+ * Issues a delegation credential
213
+ */
214
+ issueDelegation(params: {
215
+ keyPair: KeyPair;
216
+ id: string;
217
+ issuerDid: string;
218
+ delegateDid: string;
219
+ mayClaim: string[];
220
+ context: any[];
221
+ types: string[];
222
+ additionalSubjectProperties?: Record<string, any>;
223
+ previousCredentialId?: string | null;
224
+ rootCredentialId?: string;
225
+ }): Promise<DelegationCredential>;
226
+ /**
227
+ * Issues a credential as a delegate
228
+ */
229
+ issueDelegatedCredential(params: {
230
+ keyPair: KeyPair;
231
+ id: string;
232
+ issuerDid: string;
233
+ subjectDid: string;
234
+ claims: Record<string, any>;
235
+ rootCredentialId: string;
236
+ previousCredentialId: string;
237
+ context: any[];
238
+ types: string[];
239
+ }): Promise<any>;
240
+ /**
241
+ * Creates and signs a verifiable presentation
242
+ */
243
+ createPresentation(params: {
244
+ keyPair: KeyPair;
245
+ credentials: any[];
246
+ holderDid: string;
247
+ challenge: string;
248
+ domain: string;
249
+ context?: any[];
250
+ }): Promise<VerifiablePresentation>;
251
+ /**
252
+ * Verifies a verifiable presentation with delegation chain
253
+ */
254
+ verifyPresentation(params: {
255
+ presentation: VerifiablePresentation;
256
+ challenge?: string;
257
+ domain?: string;
258
+ unsignedPresentation?: boolean;
259
+ failOnUnauthorizedClaims?: boolean;
260
+ policies?: CedarPolicies;
261
+ }): Promise<VerificationResult>;
262
+ /**
263
+ * Creates a Cedar policy for delegation verification
264
+ */
265
+ createPolicy(params: {
266
+ maxDepth?: number;
267
+ rootIssuer: string;
268
+ requiredClaims?: Record<string, any>;
269
+ }): CedarPolicies;
270
+ }
271
+ export declare const delegatableCredentialsService: DelegatableCredentialsService;
272
+ //# sourceMappingURL=delegatable-credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegatable-credentials.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/delegatable-credentials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,iCAAiC,CAAC;AAQzD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAsBlE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;QAClB,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC;QACvB,QAAQ,CAAC,EAAE,GAAG,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AAE,CAAC;QACf,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,GAAG,OAAO,CAAC,GAAG,CAAC;IAIhB;;OAEG;IACG,kBAAkB,CAAC,MAAM,EAAE;QAC/B,OAAO,EAAE,OAAO,CAAC;QACjB,WAAW,EAAE,GAAG,EAAE,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;KACjB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAInC;;OAEG;IACG,kBAAkB,CAAC,MAAM,EAAE;QAC/B,YAAY,EAAE,sBAAsB,CAAC;QACrC,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,wBAAwB,CAAC,EAAE,OAAO,CAAC;QACnC,QAAQ,CAAC,EAAE,aAAa,CAAC;KAC1B,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAU/B;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACtC,GAAG,aAAa;CAGlB;AAED,eAAO,MAAM,6BAA6B,+BAAsC,CAAC"}
@@ -31,4 +31,5 @@ export declare const credentialServiceRPC: {
31
31
  deriveVCFromPresentation(params: any): Promise<any>;
32
32
  testRangeProof(): Promise<void>;
33
33
  };
34
+ export { delegatableCredentialsService, verifyDelegatablePresentation, issueDelegationCredential, issueDelegatedCredential, createSignedPresentation, createUnsignedPresentation, createCedarPolicy, cedar, MAY_CLAIM_IRI, W3C_CREDENTIALS_V1, DELEGATION_ENGINE_NS, DELEGATION_CONTEXT_TERMS, PRESENTATION_CONTEXT, } from './delegatable-credentials';
34
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;yBAiB8sc,CAAC;;;;;;;;;;;;;;;;CAjB3rc,CAAC;AAEtD,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,EACL,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC"}
@@ -16,8 +16,8 @@ export const EPSILON_INT: 1;
16
16
  export const MAX_DATE_PLACEHOLDER: 884541351600000;
17
17
  export const MIN_DATE_PLACEHOLDER: -17592186044415;
18
18
  export const MAX_INTEGER: number;
19
- export const MIN_INTEGER: -4294967295;
19
+ export const MIN_INTEGER: number;
20
20
  export const MAX_NUMBER: number;
21
- export const MIN_NUMBER: -4294967294;
21
+ export const MIN_NUMBER: number;
22
22
  export function shouldSkipAttribute(attributeName: any): boolean;
23
23
  //# sourceMappingURL=pex-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pex-helpers.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/pex-helpers.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;GAUG;AACH,wGAqMC;AAcD,4FAgCC;AA1TD,mCAAoC;AACpC,4BAA6B;AAE7B,mDAAoD;AACpD,mDAAoD;AACpD,iCAAoC;AACpC,sCAAuC;AACvC,gCAAmC;AACnC,qCAAsC;AA+Q/B,iEACoD"}
1
+ {"version":3,"file":"pex-helpers.d.ts","sourceRoot":"","sources":["../../../../src/services/credential/pex-helpers.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;GAUG;AACH,wCATW,GAAC,wBACD,GAAC,sBACD,GAAC,SA4MX;AAcD,4FAgCC;AA1TD,6BAA8B,KAAK,CAAC;AACpC,0BAA2B,CAAC,CAAC;AAE7B,mCAAoC,eAAe,CAAC;AACpD,mCAAoC,CAAC,cAAc,CAAC;AACpD,iCAAmD;AACnD,iCAAmD;AACnD,gCAAkD;AAClD,gCAAkD;AA+Q3C,iEACoD"}
@@ -10,6 +10,6 @@ export function keypairToKeydoc(key: any, controller: any, id?: any): {
10
10
  publicKeyBase58: any;
11
11
  };
12
12
  export const MULTIBASE_BASE58BTC_HEADER: "z";
13
- export const MULTICODEC_ED25519_PUB_HEADER: Uint8Array;
14
- export const MULTICODEC_ED25519_PRIV_HEADER: Uint8Array;
13
+ export const MULTICODEC_ED25519_PUB_HEADER: Uint8Array<ArrayBuffer>;
14
+ export const MULTICODEC_ED25519_PRIV_HEADER: Uint8Array<ArrayBuffer>;
15
15
  //# sourceMappingURL=keypair-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keypair-utils.d.ts","sourceRoot":"","sources":["../../../../src/services/dids/keypair-utils.js"],"names":[],"mappings":"AASA,8CAWC;AAMD,2DAKC;AAeD;;;;;;;;EAgEC;AAxFD,6CAA8C;AAC9C,uDAA0E;AAC1E,wDAA2E"}
1
+ {"version":3,"file":"keypair-utils.d.ts","sourceRoot":"","sources":["../../../../src/services/dids/keypair-utils.js"],"names":[],"mappings":"AASA,8CAWC;AAMD,2DAKC;AAeD;;;;;;;;EAgEC;AAxFD,yCAA0C,GAAG,CAAC;AAC9C,oEAA0E;AAC1E,qEAA2E"}
@@ -2,13 +2,45 @@ import { KeypairToDIDKeyDocumentParams, GetDIDResolutionParams } from './config'
2
2
  declare class DIDService {
3
3
  name: string;
4
4
  constructor();
5
- rpcMethods: (((params: KeypairToDIDKeyDocumentParams) => any) | ((params: GetDIDResolutionParams) => any) | (({ payload, privateKeyDoc, headerInput }: {
5
+ rpcMethods: (((params: KeypairToDIDKeyDocumentParams) => Promise<{
6
+ didDocument: any;
7
+ keyDoc: any;
8
+ }>) | ((params: GetDIDResolutionParams) => {
9
+ '@context': string[];
10
+ id: string;
11
+ type: string;
12
+ correlation: any[];
13
+ created: string;
14
+ expires: string;
15
+ name: any;
16
+ didDocument: any;
17
+ }) | ((params: any) => Promise<{
18
+ controller: any;
19
+ type: any;
20
+ id: any;
21
+ publicKeyMultibase: string;
22
+ privateKeyMultibase: string;
23
+ privateKeyBase58: any;
24
+ publicKeyBase58: any;
25
+ }>) | (({ payload, privateKeyDoc, headerInput }: {
6
26
  payload: any;
7
27
  privateKeyDoc: any;
8
28
  headerInput: any;
9
29
  }) => Promise<string>))[];
10
- keypairToDIDKeyDocument(params: KeypairToDIDKeyDocumentParams): any;
11
- getDIDResolution(params: GetDIDResolutionParams): any;
30
+ keypairToDIDKeyDocument(params: KeypairToDIDKeyDocumentParams): Promise<{
31
+ didDocument: any;
32
+ keyDoc: any;
33
+ }>;
34
+ getDIDResolution(params: GetDIDResolutionParams): {
35
+ '@context': string[];
36
+ id: string;
37
+ type: string;
38
+ correlation: any[];
39
+ created: string;
40
+ expires: string;
41
+ name: any;
42
+ didDocument: any;
43
+ };
12
44
  generateKeyDoc(params: any): Promise<{
13
45
  controller: any;
14
46
  type: any;
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/services/dids/service.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,6BAA6B,EAC7B,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAkDlB,cAAM,UAAU;IACd,IAAI,EAAE,MAAM,CAAC;;IAKb,UAAU,aAOsB,6BAA6B,sBAMpC,sBAAsB;;;;8BAP7C;IACF,uBAAuB,CAAC,MAAM,EAAE,6BAA6B;IAM7D,gBAAgB,CAAC,MAAM,EAAE,sBAAsB;IAMzC,cAAc,CAAC,MAAM,KAAA;;;;;;;;;IAOrB,YAAY,CAAC,MAAM,KAAA;;;;;;;;;IAOnB,eAAe,CAAC,EAAC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAC;;;;KAAA;CAmB5D;AAED,eAAO,MAAM,UAAU,YAAmB,CAAC"}
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/services/dids/service.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,6BAA6B,EAC7B,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAkDlB,cAAM,UAAU;IACd,IAAI,EAAE,MAAM,CAAC;;IAKb,UAAU,aAOsB,6BAA6B;;;oBAMpC,sBAAsB;;;;;;;;;;;;;;;;;;;;;8BAP7C;IACF,uBAAuB,CAAC,MAAM,EAAE,6BAA6B;;;;IAM7D,gBAAgB,CAAC,MAAM,EAAE,sBAAsB;;;;;;;;;;IAMzC,cAAc,CAAC,MAAM,KAAA;;;;;;;;;IAOrB,YAAY,CAAC,MAAM,KAAA;;;;;;;;;IAOnB,eAAe,CAAC,EAAC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAC;;;;KAAA;CAmB5D;AAED,eAAO,MAAM,UAAU,YAAmB,CAAC"}