@docknetwork/wallet-sdk-wasm 0.4.22 → 1.5.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/lib/{account-614e6414.js → account-bf00e5c0.js} +5 -5
- package/lib/{account-ee524484.js → account-e48dc9b6.js} +5 -5
- package/lib/core/polkadot-utils.js +18 -4
- package/lib/core/polkadot-utils.mjs +15 -2
- package/lib/index.js +16 -19
- package/lib/index.mjs +20 -23
- package/lib/modules/account.js +10 -5
- package/lib/modules/account.mjs +10 -5
- package/lib/modules/accounts.js +10 -5
- package/lib/modules/accounts.mjs +10 -5
- package/lib/modules/network-manager.js +4 -2
- package/lib/modules/network-manager.mjs +4 -2
- package/lib/modules/wallet.js +13 -8
- package/lib/modules/wallet.mjs +13 -8
- package/lib/rpc-server.js +16 -19
- package/lib/rpc-server.mjs +20 -23
- package/lib/services/blockchain/configs.js +7 -0
- package/lib/services/blockchain/configs.mjs +3 -0
- package/lib/services/{dock → blockchain}/index.android.js +3 -4
- package/lib/services/{dock → blockchain}/index.android.mjs +3 -4
- package/lib/services/{dock → blockchain}/index.ios.js +3 -4
- package/lib/services/{dock → blockchain}/index.ios.mjs +3 -4
- package/lib/services/blockchain/index.js +30 -0
- package/lib/services/blockchain/index.mjs +22 -0
- package/lib/services/{dock → blockchain}/service-rpc.js +5 -7
- package/lib/services/{dock → blockchain}/service-rpc.mjs +5 -7
- package/lib/services/blockchain/service.js +212 -0
- package/lib/services/blockchain/service.mjs +206 -0
- package/lib/services/credential/bbs-revocation.js +41 -60
- package/lib/services/credential/bbs-revocation.mjs +42 -57
- package/lib/services/credential/bound-check.js +0 -8
- package/lib/services/credential/bound-check.mjs +1 -5
- package/lib/services/credential/index.js +21 -24
- package/lib/services/credential/index.mjs +22 -25
- package/lib/services/credential/pex-helpers.js +134 -34
- package/lib/services/credential/pex-helpers.mjs +133 -35
- package/lib/services/credential/service.js +55 -56
- package/lib/services/credential/service.mjs +45 -43
- package/lib/services/credential/utils.js +12 -18
- package/lib/services/credential/utils.mjs +11 -14
- package/lib/services/dids/config.js +8 -0
- package/lib/services/dids/config.mjs +8 -0
- package/lib/services/dids/index.js +11 -10
- package/lib/services/dids/index.mjs +12 -11
- package/lib/services/dids/service-rpc.js +2 -2
- package/lib/services/dids/service-rpc.mjs +2 -2
- package/lib/services/dids/service.js +28 -36
- package/lib/services/dids/service.mjs +27 -33
- package/lib/services/edv/hmac.js +5 -0
- package/lib/services/edv/hmac.mjs +5 -0
- package/lib/services/edv/index.js +13 -11
- package/lib/services/edv/index.mjs +16 -14
- package/lib/services/edv/service-rpc.js +4 -0
- package/lib/services/edv/service-rpc.mjs +4 -0
- package/lib/services/edv/service.js +29 -13
- package/lib/services/edv/service.mjs +31 -16
- package/lib/services/example/service.js +3 -1
- package/lib/services/example/service.mjs +3 -1
- package/lib/services/index.js +14 -17
- package/lib/services/index.mjs +18 -21
- package/lib/services/keyring/configs.js +12 -0
- package/lib/services/keyring/configs.mjs +12 -0
- package/lib/services/keyring/service.js +5 -0
- package/lib/services/keyring/service.mjs +5 -0
- package/lib/services/pex/service.js +17 -15
- package/lib/services/pex/service.mjs +17 -15
- package/lib/services/relay-service/index.mjs +1 -1
- package/lib/services/relay-service/service.mjs +2 -2
- package/lib/services/substrate/api-utils.js +19 -6
- package/lib/services/substrate/api-utils.mjs +19 -6
- package/lib/services/substrate/index.js +14 -6
- package/lib/services/substrate/index.mjs +14 -6
- package/lib/services/substrate/service.js +17 -9
- package/lib/services/substrate/service.mjs +17 -9
- package/lib/services/test-utils.js +27 -17
- package/lib/services/test-utils.mjs +27 -17
- package/lib/services/trust-registry/index.js +17 -5
- package/lib/services/trust-registry/index.mjs +17 -5
- package/lib/services/trust-registry/service.js +27 -10
- package/lib/services/trust-registry/service.mjs +27 -10
- package/lib/services/util-crypto/configs.js +3 -0
- package/lib/services/util-crypto/configs.mjs +3 -0
- package/lib/services/util-crypto/service-rpc.js +6 -0
- package/lib/services/util-crypto/service-rpc.mjs +6 -0
- package/lib/services/util-crypto/service.js +5 -0
- package/lib/services/util-crypto/service.mjs +6 -1
- package/lib/setup-nodejs.js +16 -19
- package/lib/setup-nodejs.mjs +20 -23
- package/lib/setup-tests.js +16 -19
- package/lib/setup-tests.mjs +20 -23
- package/lib/src/core/polkadot-utils.d.ts +1 -0
- package/lib/src/core/polkadot-utils.d.ts.map +1 -1
- package/lib/src/modules/network-manager.d.ts +1 -0
- package/lib/src/modules/network-manager.d.ts.map +1 -1
- package/lib/src/services/blockchain/configs.d.ts +8 -0
- package/lib/src/services/blockchain/configs.d.ts.map +1 -0
- package/lib/src/services/blockchain/index.d.ts +2 -0
- package/lib/src/services/blockchain/index.d.ts.map +1 -0
- package/lib/src/services/blockchain/service.d.ts +52 -0
- package/lib/src/services/blockchain/service.d.ts.map +1 -0
- package/lib/src/services/credential/bbs-revocation.d.ts.map +1 -1
- package/lib/src/services/credential/bound-check.d.ts +0 -4
- package/lib/src/services/credential/bound-check.d.ts.map +1 -1
- package/lib/src/services/credential/index.d.ts +2 -7
- package/lib/src/services/credential/index.d.ts.map +1 -1
- package/lib/src/services/credential/pex-helpers.d.ts +5 -3
- package/lib/src/services/credential/pex-helpers.d.ts.map +1 -1
- package/lib/src/services/credential/service.d.ts +2 -7
- package/lib/src/services/credential/service.d.ts.map +1 -1
- package/lib/src/services/credential/utils.d.ts.map +1 -1
- package/lib/src/services/dids/config.d.ts +5 -0
- package/lib/src/services/dids/config.d.ts.map +1 -1
- package/lib/src/services/dids/service-rpc.d.ts +1 -1
- package/lib/src/services/dids/service-rpc.d.ts.map +1 -1
- package/lib/src/services/dids/service.d.ts +9 -4
- package/lib/src/services/dids/service.d.ts.map +1 -1
- package/lib/src/services/edv/hmac.d.ts +1 -0
- package/lib/src/services/edv/hmac.d.ts.map +1 -1
- package/lib/src/services/edv/service.d.ts +5 -0
- package/lib/src/services/edv/service.d.ts.map +1 -1
- package/lib/src/services/example/service.d.ts.map +1 -1
- package/lib/src/services/keyring/configs.d.ts +6 -0
- package/lib/src/services/keyring/configs.d.ts.map +1 -1
- package/lib/src/services/pex/service.d.ts.map +1 -1
- package/lib/src/services/trust-registry/service.d.ts.map +1 -1
- package/lib/src/services/util-crypto/configs.d.ts +1 -0
- package/lib/src/services/util-crypto/configs.d.ts.map +1 -1
- package/lib/src/services/util-crypto/service.d.ts +1 -0
- package/lib/src/services/util-crypto/service.d.ts.map +1 -1
- package/lib/test/setup-test-state.js +11 -6
- package/lib/test/setup-test-state.mjs +11 -6
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -4
- package/src/core/polkadot-utils.js +14 -3
- package/src/modules/network-manager.ts +5 -2
- package/src/modules/wallet.ts +5 -5
- package/src/services/blockchain/configs.ts +11 -0
- package/src/services/blockchain/index.android.js +3 -0
- package/src/services/blockchain/index.ios.js +3 -0
- package/src/services/blockchain/index.js +1 -0
- package/src/services/blockchain/index.test.js +34 -0
- package/src/services/{dock → blockchain}/service-rpc.js +5 -6
- package/src/services/blockchain/service.ts +261 -0
- package/src/services/credential/bbs-revocation.ts +41 -85
- package/src/services/credential/bound-check.test.ts +2 -5
- package/src/services/credential/bound-check.ts +0 -5
- package/src/services/credential/index.test.js +148 -7
- package/src/services/credential/pex-helpers.js +132 -34
- package/src/services/credential/pex-helpers.test.js +284 -27
- package/src/services/credential/service.ts +44 -27
- package/src/services/credential/utils.js +5 -14
- package/src/services/dids/config.ts +15 -0
- package/src/services/dids/index.test.js +5 -23
- package/src/services/dids/service-rpc.ts +2 -2
- package/src/services/dids/service.ts +34 -44
- package/src/services/edv/hmac.ts +13 -0
- package/src/services/edv/index.test.js +22 -0
- package/src/services/edv/service-rpc.js +4 -0
- package/src/services/edv/service.ts +22 -0
- package/src/services/example/service.ts +3 -1
- package/src/services/index.js +2 -2
- package/src/services/keyring/configs.ts +21 -0
- package/src/services/keyring/service.ts +13 -0
- package/src/services/pex/service.ts +29 -18
- package/src/services/pex/tests/pex-service.test.js +163 -6
- package/src/services/substrate/api-utils.test.js +7 -7
- package/src/services/substrate/api-utils.ts +3 -3
- package/src/services/substrate/service.ts +6 -6
- package/src/services/test-utils.js +13 -11
- package/src/services/trust-registry/index.test.js +6 -4
- package/src/services/trust-registry/service.ts +13 -7
- package/src/services/util-crypto/configs.ts +4 -0
- package/src/services/util-crypto/service-rpc.js +6 -0
- package/src/services/util-crypto/service.ts +8 -0
- package/src/test/setup-test-state.js +2 -2
- package/lib/services/dock/configs.js +0 -18
- package/lib/services/dock/configs.mjs +0 -10
- package/lib/services/dock/index.js +0 -17
- package/lib/services/dock/index.mjs +0 -9
- package/lib/services/dock/service.js +0 -138
- package/lib/services/dock/service.mjs +0 -126
- package/lib/src/services/dock/configs.d.ts +0 -7
- package/lib/src/services/dock/configs.d.ts.map +0 -1
- package/lib/src/services/dock/index.d.ts +0 -2
- package/lib/src/services/dock/index.d.ts.map +0 -1
- package/lib/src/services/dock/service.d.ts +0 -44
- package/lib/src/services/dock/service.d.ts.map +0 -1
- package/src/services/dock/configs.ts +0 -12
- package/src/services/dock/index.android.js +0 -3
- package/src/services/dock/index.ios.js +0 -3
- package/src/services/dock/index.js +0 -1
- package/src/services/dock/index.test.js +0 -48
- package/src/services/dock/service.ts +0 -154
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing';
|
|
2
|
+
import { CheqdAPI } from '@docknetwork/cheqd-blockchain-api';
|
|
3
|
+
import { CheqdCoreModules } from '@docknetwork/cheqd-blockchain-modules';
|
|
4
|
+
import { MultiApiCoreModules } from '@docknetwork/credential-sdk/modules';
|
|
5
|
+
import { DIDKeyResolver, CoreResolver, UniversalResolver, ResolverRouter, WILDCARD } from '@docknetwork/credential-sdk/resolver';
|
|
6
|
+
import { initializeWasm } from '@docknetwork/crypto-wasm-ts/lib/index';
|
|
7
|
+
import { DockAPI } from '@docknetwork/dock-blockchain-api';
|
|
8
|
+
import { DockDIDModule, DockCoreModules } from '@docknetwork/dock-blockchain-modules';
|
|
9
|
+
import { EventEmitter } from 'events';
|
|
10
|
+
import { Logger } from '../../core/logger.mjs';
|
|
11
|
+
import { once } from '../../modules/event-manager.mjs';
|
|
12
|
+
import { utilCryptoService } from '../util-crypto/service.mjs';
|
|
13
|
+
import { DockAccumulatorPublicKey, DockAccumulatorId, DockAccumulatorCommon, CheqdAccumulatorPublicKey, CheqdAccumulatorId, CheqdAccumulatorCommon } from '@docknetwork/credential-sdk/types';
|
|
14
|
+
import 'assert';
|
|
15
|
+
import '@polkadot/keyring';
|
|
16
|
+
import '@polkadot/util';
|
|
17
|
+
import '@polkadot/util-crypto';
|
|
18
|
+
import '../util-crypto/configs.mjs';
|
|
19
|
+
import '../../core/validation.mjs';
|
|
20
|
+
import 'bignumber.js';
|
|
21
|
+
import '../../types.mjs';
|
|
22
|
+
|
|
23
|
+
// @ts-nocheck
|
|
24
|
+
const universalResolverUrl = 'https://uniresolver.truvera.io';
|
|
25
|
+
class AnyDIDResolver extends ResolverRouter {
|
|
26
|
+
method = WILDCARD;
|
|
27
|
+
}
|
|
28
|
+
const { AccumulatorModule: AccumulatorModuleDock } = DockCoreModules;
|
|
29
|
+
const { AccumulatorModule: AccumulatorModuleCheqd } = CheqdCoreModules;
|
|
30
|
+
const TYPES_FOR_DID = {
|
|
31
|
+
dock: {
|
|
32
|
+
PublicKey: DockAccumulatorPublicKey,
|
|
33
|
+
AccumulatorId: DockAccumulatorId,
|
|
34
|
+
AccumulatorCommon: DockAccumulatorCommon,
|
|
35
|
+
AccumulatorModule: AccumulatorModuleDock,
|
|
36
|
+
},
|
|
37
|
+
cheqd: {
|
|
38
|
+
PublicKey: CheqdAccumulatorPublicKey,
|
|
39
|
+
AccumulatorId: CheqdAccumulatorId,
|
|
40
|
+
AccumulatorCommon: CheqdAccumulatorCommon,
|
|
41
|
+
AccumulatorModule: AccumulatorModuleCheqd,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
class BlockchainService {
|
|
48
|
+
dock;
|
|
49
|
+
modules;
|
|
50
|
+
didModule;
|
|
51
|
+
cheqdApi;
|
|
52
|
+
isBlockchainReady = false;
|
|
53
|
+
resolver;
|
|
54
|
+
dockEnabled;
|
|
55
|
+
static Events = {
|
|
56
|
+
BLOCKCHAIN_READY: 'blockchain-ready',
|
|
57
|
+
};
|
|
58
|
+
rpcMethods = [
|
|
59
|
+
BlockchainService.prototype.disconnect,
|
|
60
|
+
BlockchainService.prototype.ensureBlockchainReady,
|
|
61
|
+
BlockchainService.prototype.init,
|
|
62
|
+
BlockchainService.prototype.isApiConnected,
|
|
63
|
+
BlockchainService.prototype.getAddress,
|
|
64
|
+
];
|
|
65
|
+
constructor() {
|
|
66
|
+
this.name = 'blockchain';
|
|
67
|
+
this.dock = new DockAPI();
|
|
68
|
+
this.cheqdApi = new CheqdAPI();
|
|
69
|
+
this.didModule = new DockDIDModule(this.dock);
|
|
70
|
+
this.dockModules = new DockCoreModules(this.dock);
|
|
71
|
+
this.cheqdModules = new CheqdCoreModules(this.cheqdApi);
|
|
72
|
+
this.modules = new MultiApiCoreModules(this.dockEnabled
|
|
73
|
+
? [this.dockModules, this.cheqdModules]
|
|
74
|
+
: [this.cheqdModules]);
|
|
75
|
+
this.emitter = new EventEmitter();
|
|
76
|
+
this.resolver = this.createDIDResolver();
|
|
77
|
+
}
|
|
78
|
+
getTypesForDIDOrAccumulator(didOrRegistryId) {
|
|
79
|
+
const didType = didOrRegistryId
|
|
80
|
+
.replace('dock:accumulator:', 'accumulator:dock:')
|
|
81
|
+
.split(':')[1];
|
|
82
|
+
const chainDidType = !this.dock && didType === 'dock' ? 'cheqd' : didType;
|
|
83
|
+
const types = TYPES_FOR_DID[chainDidType];
|
|
84
|
+
if (!types) {
|
|
85
|
+
throw new APIError(`Unable to use DID type ${didType} for this operation`);
|
|
86
|
+
}
|
|
87
|
+
return types;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
*
|
|
91
|
+
* @returns
|
|
92
|
+
*/
|
|
93
|
+
async ensureBlockchainReady() {
|
|
94
|
+
if (this.isBlockchainReady) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
return once(this.emitter, BlockchainService.Events.BLOCKCHAIN_READY);
|
|
98
|
+
}
|
|
99
|
+
createDIDResolver() {
|
|
100
|
+
return new AnyDIDResolver([
|
|
101
|
+
new DIDKeyResolver(),
|
|
102
|
+
new CoreResolver(this.modules),
|
|
103
|
+
new UniversalResolver(universalResolverUrl),
|
|
104
|
+
]);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* @param {*} params
|
|
109
|
+
* @returns
|
|
110
|
+
*/
|
|
111
|
+
async init(params) {
|
|
112
|
+
if (this.dock.isConnected) {
|
|
113
|
+
await this.dock.disconnect();
|
|
114
|
+
}
|
|
115
|
+
if (this.cheqdApi && this.cheqdApi.isInitialized()) {
|
|
116
|
+
await this.cheqdApi.disconnect();
|
|
117
|
+
}
|
|
118
|
+
Logger.info(`Attempt to initialized substrate at: ${params.address}`);
|
|
119
|
+
this.dockEnabled = !!params.substrateUrl;
|
|
120
|
+
if (this.dockEnabled) {
|
|
121
|
+
await this.dock.init({
|
|
122
|
+
address: params.substrateUrl,
|
|
123
|
+
});
|
|
124
|
+
Logger.info(`Substrate initialized at: ${params.address}`);
|
|
125
|
+
}
|
|
126
|
+
this.modules = new MultiApiCoreModules(this.dockEnabled
|
|
127
|
+
? [this.dockModules, this.cheqdModules]
|
|
128
|
+
: [this.cheqdModules]);
|
|
129
|
+
if (params?.cheqdApiUrl) {
|
|
130
|
+
const checkdApiUrl = params?.cheqdApiUrl;
|
|
131
|
+
const cheqdNetworkId = params?.networkId;
|
|
132
|
+
const cheqdMnemonic = params?.cheqdMnemonic || (await utilCryptoService.mnemonicGenerate(12));
|
|
133
|
+
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(cheqdMnemonic, {
|
|
134
|
+
prefix: 'cheqd',
|
|
135
|
+
});
|
|
136
|
+
const walletAccounts = await wallet.getAccounts();
|
|
137
|
+
const [{ address }] = walletAccounts;
|
|
138
|
+
console.log('Using cheqd account:', address);
|
|
139
|
+
Logger.info(`Attempt to initialized cheqd at: ${checkdApiUrl} with networkId: ${cheqdNetworkId}`);
|
|
140
|
+
Logger.info(`Using cheqd account: ${address}`);
|
|
141
|
+
try {
|
|
142
|
+
await this.cheqdApi.init({
|
|
143
|
+
wallet,
|
|
144
|
+
url: checkdApiUrl,
|
|
145
|
+
network: cheqdNetworkId,
|
|
146
|
+
});
|
|
147
|
+
Logger.info(`Cheqd initialized at: ${checkdApiUrl}`);
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
Logger.error(`Failed to initialize cheqd at: ${checkdApiUrl}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
this.address = params.address;
|
|
154
|
+
this.resolver = this.createDIDResolver();
|
|
155
|
+
if (process.env.NODE_ENV !== 'test' ||
|
|
156
|
+
process.env.API_MOCK_DISABLED === 'true') {
|
|
157
|
+
await initializeWasm();
|
|
158
|
+
}
|
|
159
|
+
this._setBlockchainReady(true);
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
* @returns
|
|
165
|
+
*/
|
|
166
|
+
async disconnect() {
|
|
167
|
+
let result;
|
|
168
|
+
if (this.dockEnabled) {
|
|
169
|
+
result = await this.dock.disconnect();
|
|
170
|
+
}
|
|
171
|
+
if (this.cheqdApi && this.cheqdApi.isInitialized()) {
|
|
172
|
+
result = await this.cheqdApi.disconnect();
|
|
173
|
+
}
|
|
174
|
+
this._setBlockchainReady(false);
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
async waitBlockchainReady() {
|
|
178
|
+
return new Promise(resolve => {
|
|
179
|
+
if (this.isBlockchainReady) {
|
|
180
|
+
resolve();
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
this.emitter.once(BlockchainService.Events.BLOCKCHAIN_READY, resolve);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
*
|
|
189
|
+
* @returns
|
|
190
|
+
*/
|
|
191
|
+
async isApiConnected() {
|
|
192
|
+
return this.cheqdApi.isInitialized();
|
|
193
|
+
}
|
|
194
|
+
async getAddress() {
|
|
195
|
+
return this.dock.address;
|
|
196
|
+
}
|
|
197
|
+
_setBlockchainReady(isBlockchainReady) {
|
|
198
|
+
this.isBlockchainReady = isBlockchainReady;
|
|
199
|
+
if (isBlockchainReady) {
|
|
200
|
+
this.emitter.emit(BlockchainService.Events.BLOCKCHAIN_READY);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const blockchainService = new BlockchainService();
|
|
205
|
+
|
|
206
|
+
export { BlockchainService, blockchainService, universalResolverUrl };
|
|
@@ -3,85 +3,66 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var cryptoWasmTs = require('@docknetwork/crypto-wasm-ts');
|
|
6
|
-
var dock = require('@docknetwork/sdk');
|
|
7
6
|
var util = require('@polkadot/util');
|
|
7
|
+
var services_blockchain_service = require('../blockchain/service.js');
|
|
8
|
+
require('@cosmjs/proto-signing');
|
|
9
|
+
require('@docknetwork/cheqd-blockchain-api');
|
|
10
|
+
require('@docknetwork/cheqd-blockchain-modules');
|
|
11
|
+
require('@docknetwork/credential-sdk/modules');
|
|
12
|
+
require('@docknetwork/credential-sdk/resolver');
|
|
13
|
+
require('@docknetwork/crypto-wasm-ts/lib/index');
|
|
14
|
+
require('@docknetwork/dock-blockchain-api');
|
|
15
|
+
require('@docknetwork/dock-blockchain-modules');
|
|
16
|
+
require('events');
|
|
17
|
+
require('../../core/logger.js');
|
|
18
|
+
require('../../modules/event-manager.js');
|
|
19
|
+
require('assert');
|
|
20
|
+
require('../util-crypto/service.js');
|
|
21
|
+
require('@polkadot/keyring');
|
|
22
|
+
require('@polkadot/util-crypto');
|
|
23
|
+
require('../util-crypto/configs.js');
|
|
24
|
+
require('../../core/validation.js');
|
|
25
|
+
require('bignumber.js');
|
|
26
|
+
require('../../types.js');
|
|
27
|
+
require('@docknetwork/credential-sdk/types');
|
|
8
28
|
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var dock__default = /*#__PURE__*/_interopDefaultLegacy(dock);
|
|
12
|
-
|
|
13
|
-
// "-32000: Client error: UnknownBlock: State already discarded for BlockId::Hash(<hash>)"
|
|
14
|
-
// This means that the node has discarded old blocks to preserve space. This should not happen with a full node
|
|
15
|
-
const UnknownBlockErrorCode = -32000;
|
|
16
|
-
async function updateMembershipWitness({ credential, membershipWitness, registryId, blockNo, }) {
|
|
17
|
-
const revocationId = credential.credentialStatus.revocationId;
|
|
18
|
-
const member = cryptoWasmTs.Accumulator.encodePositiveNumberAsAccumulatorMember(Number(revocationId));
|
|
19
|
-
let updates = [];
|
|
20
|
-
try {
|
|
21
|
-
updates = await dock__default["default"].accumulatorModule.getUpdatesFromBlock(registryId, blockNo);
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
if (err.code === UnknownBlockErrorCode) {
|
|
25
|
-
console.error(err);
|
|
26
|
-
updates = [];
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
throw err;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const additions = [];
|
|
33
|
-
const removals = [];
|
|
34
|
-
if (updates.length && updates[0].additions !== null) {
|
|
35
|
-
for (const a of updates[0].additions) {
|
|
36
|
-
additions.push(util.hexToU8a(a));
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
if (updates.length && updates[0].removals !== null) {
|
|
40
|
-
for (const a of updates[0].removals) {
|
|
41
|
-
removals.push(util.hexToU8a(a));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const queriedWitnessInfo = new cryptoWasmTs.VBWitnessUpdateInfo(util.hexToU8a(updates[0].witnessUpdateInfo));
|
|
45
|
-
const witness = new cryptoWasmTs.VBMembershipWitness(util.hexToU8a(membershipWitness));
|
|
46
|
-
witness.updateUsingPublicInfoPostBatchUpdate(member, additions, removals, queriedWitnessInfo);
|
|
47
|
-
return witness;
|
|
48
|
-
}
|
|
49
29
|
const getWitnessDetails = async (credential, _membershipWitness) => {
|
|
50
30
|
let witness = _membershipWitness;
|
|
51
31
|
let blockNo;
|
|
52
32
|
try {
|
|
53
|
-
({
|
|
33
|
+
({ witness, blockNo } = JSON.parse(_membershipWitness));
|
|
54
34
|
}
|
|
55
35
|
catch (err) {
|
|
56
36
|
console.error(err);
|
|
57
37
|
}
|
|
58
38
|
const { credentialStatus } = credential;
|
|
59
|
-
const registryId = credentialStatus?.id
|
|
39
|
+
const registryId = credentialStatus?.id;
|
|
60
40
|
const revocationIndex = credentialStatus.revocationId;
|
|
61
|
-
const queriedAccumulator = await
|
|
41
|
+
const queriedAccumulator = await services_blockchain_service.blockchainService.modules.accumulator.getAccumulator(registryId, false);
|
|
62
42
|
if (!queriedAccumulator) {
|
|
63
43
|
throw new Error('Accumulator not found');
|
|
64
44
|
}
|
|
65
|
-
const accumulator = cryptoWasmTs.PositiveAccumulator.fromAccumulated(
|
|
45
|
+
const accumulator = cryptoWasmTs.PositiveAccumulator.fromAccumulated(queriedAccumulator.accumulated.bytes);
|
|
66
46
|
const encodedRevId = cryptoWasmTs.Encoder.defaultEncodeFunc()(revocationIndex.toString());
|
|
67
|
-
const publicKey = await
|
|
47
|
+
const publicKey = await services_blockchain_service.blockchainService.modules.accumulator.getPublicKey(queriedAccumulator.keyRef[0], queriedAccumulator.keyRef[1]);
|
|
68
48
|
const params = cryptoWasmTs.dockAccumulatorParams();
|
|
69
|
-
const pk = new cryptoWasmTs.AccumulatorPublicKey(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
catch (err) {
|
|
82
|
-
console.error(err);
|
|
49
|
+
const pk = new cryptoWasmTs.AccumulatorPublicKey(publicKey.bytes);
|
|
50
|
+
const membershipWitness = new cryptoWasmTs.VBMembershipWitness(util.hexToU8a(witness));
|
|
51
|
+
try {
|
|
52
|
+
const credentialStatusId = credential.credentialStatus.id;
|
|
53
|
+
const accumulatorId = services_blockchain_service.blockchainService
|
|
54
|
+
.getTypesForDIDOrAccumulator(credentialStatusId)
|
|
55
|
+
.AccumulatorId.from(credentialStatusId);
|
|
56
|
+
const history = await services_blockchain_service.blockchainService.modules.accumulator.accumulatorHistory(accumulatorId);
|
|
57
|
+
const blockNoIndex = history.updates.findIndex(update => update.id.toString() === blockNo);
|
|
58
|
+
const nextBlockNo = history.updates[blockNoIndex + 1]?.id?.toString();
|
|
59
|
+
if (nextBlockNo) {
|
|
60
|
+
await services_blockchain_service.blockchainService.modules.accumulator.updateWitness(registryId, encodedRevId, membershipWitness, nextBlockNo, queriedAccumulator.lastModified);
|
|
83
61
|
}
|
|
84
62
|
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
console.error(err);
|
|
65
|
+
}
|
|
85
66
|
return {
|
|
86
67
|
encodedRevId,
|
|
87
68
|
membershipWitness,
|
|
@@ -1,79 +1,64 @@
|
|
|
1
|
-
import { PositiveAccumulator, Encoder, dockAccumulatorParams, AccumulatorPublicKey, VBMembershipWitness
|
|
2
|
-
import dock from '@docknetwork/sdk';
|
|
1
|
+
import { PositiveAccumulator, Encoder, dockAccumulatorParams, AccumulatorPublicKey, VBMembershipWitness } from '@docknetwork/crypto-wasm-ts';
|
|
3
2
|
import { hexToU8a } from '@polkadot/util';
|
|
3
|
+
import { blockchainService } from '../blockchain/service.mjs';
|
|
4
|
+
import '@cosmjs/proto-signing';
|
|
5
|
+
import '@docknetwork/cheqd-blockchain-api';
|
|
6
|
+
import '@docknetwork/cheqd-blockchain-modules';
|
|
7
|
+
import '@docknetwork/credential-sdk/modules';
|
|
8
|
+
import '@docknetwork/credential-sdk/resolver';
|
|
9
|
+
import '@docknetwork/crypto-wasm-ts/lib/index';
|
|
10
|
+
import '@docknetwork/dock-blockchain-api';
|
|
11
|
+
import '@docknetwork/dock-blockchain-modules';
|
|
12
|
+
import 'events';
|
|
13
|
+
import '../../core/logger.mjs';
|
|
14
|
+
import '../../modules/event-manager.mjs';
|
|
15
|
+
import 'assert';
|
|
16
|
+
import '../util-crypto/service.mjs';
|
|
17
|
+
import '@polkadot/keyring';
|
|
18
|
+
import '@polkadot/util-crypto';
|
|
19
|
+
import '../util-crypto/configs.mjs';
|
|
20
|
+
import '../../core/validation.mjs';
|
|
21
|
+
import 'bignumber.js';
|
|
22
|
+
import '../../types.mjs';
|
|
23
|
+
import '@docknetwork/credential-sdk/types';
|
|
4
24
|
|
|
5
|
-
// "-32000: Client error: UnknownBlock: State already discarded for BlockId::Hash(<hash>)"
|
|
6
|
-
// This means that the node has discarded old blocks to preserve space. This should not happen with a full node
|
|
7
|
-
const UnknownBlockErrorCode = -32000;
|
|
8
|
-
async function updateMembershipWitness({ credential, membershipWitness, registryId, blockNo, }) {
|
|
9
|
-
const revocationId = credential.credentialStatus.revocationId;
|
|
10
|
-
const member = Accumulator.encodePositiveNumberAsAccumulatorMember(Number(revocationId));
|
|
11
|
-
let updates = [];
|
|
12
|
-
try {
|
|
13
|
-
updates = await dock.accumulatorModule.getUpdatesFromBlock(registryId, blockNo);
|
|
14
|
-
}
|
|
15
|
-
catch (err) {
|
|
16
|
-
if (err.code === UnknownBlockErrorCode) {
|
|
17
|
-
console.error(err);
|
|
18
|
-
updates = [];
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
throw err;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
const additions = [];
|
|
25
|
-
const removals = [];
|
|
26
|
-
if (updates.length && updates[0].additions !== null) {
|
|
27
|
-
for (const a of updates[0].additions) {
|
|
28
|
-
additions.push(hexToU8a(a));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (updates.length && updates[0].removals !== null) {
|
|
32
|
-
for (const a of updates[0].removals) {
|
|
33
|
-
removals.push(hexToU8a(a));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
const queriedWitnessInfo = new VBWitnessUpdateInfo(hexToU8a(updates[0].witnessUpdateInfo));
|
|
37
|
-
const witness = new VBMembershipWitness(hexToU8a(membershipWitness));
|
|
38
|
-
witness.updateUsingPublicInfoPostBatchUpdate(member, additions, removals, queriedWitnessInfo);
|
|
39
|
-
return witness;
|
|
40
|
-
}
|
|
41
25
|
const getWitnessDetails = async (credential, _membershipWitness) => {
|
|
42
26
|
let witness = _membershipWitness;
|
|
43
27
|
let blockNo;
|
|
44
28
|
try {
|
|
45
|
-
({
|
|
29
|
+
({ witness, blockNo } = JSON.parse(_membershipWitness));
|
|
46
30
|
}
|
|
47
31
|
catch (err) {
|
|
48
32
|
console.error(err);
|
|
49
33
|
}
|
|
50
34
|
const { credentialStatus } = credential;
|
|
51
|
-
const registryId = credentialStatus?.id
|
|
35
|
+
const registryId = credentialStatus?.id;
|
|
52
36
|
const revocationIndex = credentialStatus.revocationId;
|
|
53
|
-
const queriedAccumulator = await
|
|
37
|
+
const queriedAccumulator = await blockchainService.modules.accumulator.getAccumulator(registryId, false);
|
|
54
38
|
if (!queriedAccumulator) {
|
|
55
39
|
throw new Error('Accumulator not found');
|
|
56
40
|
}
|
|
57
|
-
const accumulator = PositiveAccumulator.fromAccumulated(
|
|
41
|
+
const accumulator = PositiveAccumulator.fromAccumulated(queriedAccumulator.accumulated.bytes);
|
|
58
42
|
const encodedRevId = Encoder.defaultEncodeFunc()(revocationIndex.toString());
|
|
59
|
-
const publicKey = await
|
|
43
|
+
const publicKey = await blockchainService.modules.accumulator.getPublicKey(queriedAccumulator.keyRef[0], queriedAccumulator.keyRef[1]);
|
|
60
44
|
const params = dockAccumulatorParams();
|
|
61
|
-
const pk = new AccumulatorPublicKey(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
catch (err) {
|
|
74
|
-
console.error(err);
|
|
45
|
+
const pk = new AccumulatorPublicKey(publicKey.bytes);
|
|
46
|
+
const membershipWitness = new VBMembershipWitness(hexToU8a(witness));
|
|
47
|
+
try {
|
|
48
|
+
const credentialStatusId = credential.credentialStatus.id;
|
|
49
|
+
const accumulatorId = blockchainService
|
|
50
|
+
.getTypesForDIDOrAccumulator(credentialStatusId)
|
|
51
|
+
.AccumulatorId.from(credentialStatusId);
|
|
52
|
+
const history = await blockchainService.modules.accumulator.accumulatorHistory(accumulatorId);
|
|
53
|
+
const blockNoIndex = history.updates.findIndex(update => update.id.toString() === blockNo);
|
|
54
|
+
const nextBlockNo = history.updates[blockNoIndex + 1]?.id?.toString();
|
|
55
|
+
if (nextBlockNo) {
|
|
56
|
+
await blockchainService.modules.accumulator.updateWitness(registryId, encodedRevId, membershipWitness, nextBlockNo, queriedAccumulator.lastModified);
|
|
75
57
|
}
|
|
76
58
|
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
console.error(err);
|
|
61
|
+
}
|
|
77
62
|
return {
|
|
78
63
|
encodedRevId,
|
|
79
64
|
membershipWitness,
|
|
@@ -62,16 +62,8 @@ async function fetchProvingKey(proofRequest) {
|
|
|
62
62
|
const provingKey = new legosnark.LegoProvingKey(blob);
|
|
63
63
|
return { provingKey, provingKeyId: 'key0' };
|
|
64
64
|
}
|
|
65
|
-
const MAX_DATE_PLACEHOLDER = 884541351600000;
|
|
66
|
-
const MIN_DATE_PLACEHOLDER = -17592186044415;
|
|
67
|
-
const MAX_NUMBER = Math.pow(100, 9);
|
|
68
|
-
const MIN_INTEGER = -4294967295;
|
|
69
65
|
const hasProvingKey = (proofRequest) => !!proofRequest.boundCheckSnarkKey;
|
|
70
66
|
|
|
71
|
-
exports.MAX_DATE_PLACEHOLDER = MAX_DATE_PLACEHOLDER;
|
|
72
|
-
exports.MAX_NUMBER = MAX_NUMBER;
|
|
73
|
-
exports.MIN_DATE_PLACEHOLDER = MIN_DATE_PLACEHOLDER;
|
|
74
|
-
exports.MIN_INTEGER = MIN_INTEGER;
|
|
75
67
|
exports.applyEnforceBounds = applyEnforceBounds;
|
|
76
68
|
exports.blobFromBase64 = blobFromBase64;
|
|
77
69
|
exports.fetchBlobFromUrl = fetchBlobFromUrl;
|
|
@@ -54,10 +54,6 @@ async function fetchProvingKey(proofRequest) {
|
|
|
54
54
|
const provingKey = new LegoProvingKey(blob);
|
|
55
55
|
return { provingKey, provingKeyId: 'key0' };
|
|
56
56
|
}
|
|
57
|
-
const MAX_DATE_PLACEHOLDER = 884541351600000;
|
|
58
|
-
const MIN_DATE_PLACEHOLDER = -17592186044415;
|
|
59
|
-
const MAX_NUMBER = Math.pow(100, 9);
|
|
60
|
-
const MIN_INTEGER = -4294967295;
|
|
61
57
|
const hasProvingKey = (proofRequest) => !!proofRequest.boundCheckSnarkKey;
|
|
62
58
|
|
|
63
|
-
export {
|
|
59
|
+
export { applyEnforceBounds, blobFromBase64, fetchBlobFromUrl, fetchProvingKey, hasProvingKey, isBase64OrDataUrl };
|
|
@@ -8,27 +8,35 @@ require('assert');
|
|
|
8
8
|
require('@docknetwork/crypto-wasm-ts');
|
|
9
9
|
require('@sphereon/oid4vci-client');
|
|
10
10
|
require('@sphereon/oid4vci-common');
|
|
11
|
-
require('@docknetwork/sdk/verifiable-credential');
|
|
12
11
|
require('@docknetwork/universal-wallet/methods/keypairs');
|
|
13
|
-
require('@docknetwork/sdk/
|
|
14
|
-
require('@docknetwork/sdk/verifiable-presentation');
|
|
15
|
-
require('@docknetwork/sdk/presentation');
|
|
16
|
-
require('@docknetwork/sdk/utils/vc/credentials');
|
|
12
|
+
require('@docknetwork/credential-sdk/vc');
|
|
17
13
|
require('@sphereon/pex');
|
|
18
14
|
require('./utils.js');
|
|
19
15
|
require('base58-universal');
|
|
20
|
-
require('@docknetwork/sdk/
|
|
16
|
+
require('@docknetwork/credential-sdk/vc/crypto');
|
|
17
|
+
require('../keyring/service.js');
|
|
18
|
+
require('@polkadot/keyring');
|
|
21
19
|
require('@polkadot/util-crypto');
|
|
22
|
-
require('
|
|
23
|
-
require('
|
|
24
|
-
require('
|
|
25
|
-
require('
|
|
26
|
-
require('
|
|
20
|
+
require('../keyring/configs.js');
|
|
21
|
+
require('../../core/validation.js');
|
|
22
|
+
require('bignumber.js');
|
|
23
|
+
require('../../types.js');
|
|
24
|
+
require('../blockchain/service.js');
|
|
25
|
+
require('@cosmjs/proto-signing');
|
|
26
|
+
require('@docknetwork/cheqd-blockchain-api');
|
|
27
|
+
require('@docknetwork/cheqd-blockchain-modules');
|
|
28
|
+
require('@docknetwork/credential-sdk/modules');
|
|
29
|
+
require('@docknetwork/credential-sdk/resolver');
|
|
27
30
|
require('@docknetwork/crypto-wasm-ts/lib/index');
|
|
31
|
+
require('@docknetwork/dock-blockchain-api');
|
|
32
|
+
require('@docknetwork/dock-blockchain-modules');
|
|
28
33
|
require('events');
|
|
29
34
|
require('../../core/logger.js');
|
|
30
35
|
require('../../modules/event-manager.js');
|
|
31
|
-
require('../
|
|
36
|
+
require('../util-crypto/service.js');
|
|
37
|
+
require('@polkadot/util');
|
|
38
|
+
require('../util-crypto/configs.js');
|
|
39
|
+
require('@docknetwork/credential-sdk/types');
|
|
32
40
|
require('./bound-check.js');
|
|
33
41
|
require('@docknetwork/crypto-wasm-ts/lib/legosnark');
|
|
34
42
|
require('base64url');
|
|
@@ -38,20 +46,9 @@ require('./bbs-revocation.js');
|
|
|
38
46
|
require('../dids/service.js');
|
|
39
47
|
require('@docknetwork/wallet-sdk-dids/lib');
|
|
40
48
|
require('../dids/config.js');
|
|
41
|
-
require('../keyring/service.js');
|
|
42
|
-
require('@polkadot/keyring');
|
|
43
|
-
require('../keyring/configs.js');
|
|
44
|
-
require('../../core/validation.js');
|
|
45
|
-
require('bignumber.js');
|
|
46
|
-
require('../../types.js');
|
|
47
|
-
require('../util-crypto/service.js');
|
|
48
|
-
require('../util-crypto/configs.js');
|
|
49
|
-
require('@docknetwork/sdk/utils/did');
|
|
50
|
-
require('@docknetwork/sdk/public-keys');
|
|
51
49
|
require('../../core/polkadot-utils.js');
|
|
50
|
+
require('@docknetwork/credential-sdk/keypairs');
|
|
52
51
|
require('@polkadot/keyring/pair/decode');
|
|
53
|
-
require('@docknetwork/sdk/utils/vc/crypto/Ed25519Signature2020');
|
|
54
|
-
require('@docknetwork/sdk/utils/vc/crypto/EcdsaSecp256k1Signature2019');
|
|
55
52
|
|
|
56
53
|
// @ts-nocheck
|
|
57
54
|
// TODO: rename it to credentialService, will need to update dock-app
|
|
@@ -4,27 +4,35 @@ import 'assert';
|
|
|
4
4
|
import '@docknetwork/crypto-wasm-ts';
|
|
5
5
|
import '@sphereon/oid4vci-client';
|
|
6
6
|
import '@sphereon/oid4vci-common';
|
|
7
|
-
import '@docknetwork/sdk/verifiable-credential';
|
|
8
7
|
import '@docknetwork/universal-wallet/methods/keypairs';
|
|
9
|
-
import '@docknetwork/sdk/
|
|
10
|
-
import '@docknetwork/sdk/verifiable-presentation';
|
|
11
|
-
import '@docknetwork/sdk/presentation';
|
|
12
|
-
import '@docknetwork/sdk/utils/vc/credentials';
|
|
8
|
+
import '@docknetwork/credential-sdk/vc';
|
|
13
9
|
import '@sphereon/pex';
|
|
14
10
|
import './utils.mjs';
|
|
15
11
|
import 'base58-universal';
|
|
16
|
-
import '@docknetwork/sdk/
|
|
12
|
+
import '@docknetwork/credential-sdk/vc/crypto';
|
|
13
|
+
import '../keyring/service.mjs';
|
|
14
|
+
import '@polkadot/keyring';
|
|
17
15
|
import '@polkadot/util-crypto';
|
|
18
|
-
import '
|
|
19
|
-
import '
|
|
20
|
-
import '
|
|
21
|
-
import '
|
|
22
|
-
import '
|
|
16
|
+
import '../keyring/configs.mjs';
|
|
17
|
+
import '../../core/validation.mjs';
|
|
18
|
+
import 'bignumber.js';
|
|
19
|
+
import '../../types.mjs';
|
|
20
|
+
import '../blockchain/service.mjs';
|
|
21
|
+
import '@cosmjs/proto-signing';
|
|
22
|
+
import '@docknetwork/cheqd-blockchain-api';
|
|
23
|
+
import '@docknetwork/cheqd-blockchain-modules';
|
|
24
|
+
import '@docknetwork/credential-sdk/modules';
|
|
25
|
+
import '@docknetwork/credential-sdk/resolver';
|
|
23
26
|
import '@docknetwork/crypto-wasm-ts/lib/index';
|
|
27
|
+
import '@docknetwork/dock-blockchain-api';
|
|
28
|
+
import '@docknetwork/dock-blockchain-modules';
|
|
24
29
|
import 'events';
|
|
25
30
|
import '../../core/logger.mjs';
|
|
26
31
|
import '../../modules/event-manager.mjs';
|
|
27
|
-
import '../
|
|
32
|
+
import '../util-crypto/service.mjs';
|
|
33
|
+
import '@polkadot/util';
|
|
34
|
+
import '../util-crypto/configs.mjs';
|
|
35
|
+
import '@docknetwork/credential-sdk/types';
|
|
28
36
|
import './bound-check.mjs';
|
|
29
37
|
import '@docknetwork/crypto-wasm-ts/lib/legosnark';
|
|
30
38
|
import 'base64url';
|
|
@@ -32,22 +40,11 @@ import './pex-helpers.mjs';
|
|
|
32
40
|
import '@astronautlabs/jsonpath';
|
|
33
41
|
import './bbs-revocation.mjs';
|
|
34
42
|
import '../dids/service.mjs';
|
|
35
|
-
import '@docknetwork/wallet-sdk-dids/
|
|
43
|
+
import '@docknetwork/wallet-sdk-dids/lib';
|
|
36
44
|
import '../dids/config.mjs';
|
|
37
|
-
import '../keyring/service.mjs';
|
|
38
|
-
import '@polkadot/keyring';
|
|
39
|
-
import '../keyring/configs.mjs';
|
|
40
|
-
import '../../core/validation.mjs';
|
|
41
|
-
import 'bignumber.js';
|
|
42
|
-
import '../../types.mjs';
|
|
43
|
-
import '../util-crypto/service.mjs';
|
|
44
|
-
import '../util-crypto/configs.mjs';
|
|
45
|
-
import '@docknetwork/sdk/utils/did';
|
|
46
|
-
import '@docknetwork/sdk/public-keys';
|
|
47
45
|
import '../../core/polkadot-utils.mjs';
|
|
46
|
+
import '@docknetwork/credential-sdk/keypairs';
|
|
48
47
|
import '@polkadot/keyring/pair/decode';
|
|
49
|
-
import '@docknetwork/sdk/utils/vc/crypto/Ed25519Signature2020';
|
|
50
|
-
import '@docknetwork/sdk/utils/vc/crypto/EcdsaSecp256k1Signature2019';
|
|
51
48
|
|
|
52
49
|
// @ts-nocheck
|
|
53
50
|
// TODO: rename it to credentialService, will need to update dock-app
|