@cheqd/sdk 1.2.4 → 1.2.7
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/CHANGELOG.md +16 -0
- package/README.md +46 -2
- package/build/utils.d.ts +9 -1
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +92 -1
- package/build/utils.js.map +1 -1
- package/package.json +5 -6
- package/src/utils.ts +108 -1
- package/tests/modules/did.test.ts +1 -0
- package/tests/testutils.test.ts +30 -0
- package/diagrams/sdk-modules.drawio +0 -152
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.2.7](https://github.com/cheqd/sdk/compare/1.2.6...1.2.7) (2022-08-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **tests:** Removed experimental versioning ([93b714c](https://github.com/cheqd/sdk/commit/93b714c538cdd10f67385b19a33d284f042bc6c4))
|
|
9
|
+
|
|
10
|
+
## [1.2.6](https://github.com/cheqd/sdk/compare/1.2.5...1.2.6) (2022-08-09)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Performance Improvements
|
|
14
|
+
|
|
15
|
+
* **helpers:** Added env-specific utils exports ([4957f44](https://github.com/cheqd/sdk/commit/4957f445734380c0bb6758c16096cd25978c7cac))
|
|
16
|
+
|
|
17
|
+
## [1.2.5](https://github.com/cheqd/sdk/compare/1.2.4...1.2.5) (2022-08-09)
|
|
18
|
+
|
|
3
19
|
## [1.2.4](https://github.com/cheqd/sdk/compare/1.2.3...1.2.4) (2022-08-08)
|
|
4
20
|
|
|
5
21
|
## [1.2.3](https://github.com/cheqd/sdk/compare/1.2.2...1.2.3) (2022-08-05)
|
package/README.md
CHANGED
|
@@ -1,3 +1,47 @@
|
|
|
1
|
-
#
|
|
1
|
+
# TypeScript SDK for cheqd
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/cheqd/sdk/actions/workflows/dispatch.yml) [](https://www.npmjs.com/package/@cheqd/sdk)
|
|
4
|
+
|
|
5
|
+
[](https://github.com/cheqd/sdk/releases/latest) 
|
|
6
|
+
|
|
7
|
+
[](https://github.com/cheqd/sdk/releases/) 
|
|
8
|
+
|
|
9
|
+
[](https://github.com/cheqd/sdk/graphs/contributors) 
|
|
10
|
+
|
|
11
|
+
## ℹ️ Overview
|
|
12
|
+
|
|
13
|
+
The purpose of this [`@cheqd/sdk` NPM package](https://www.npmjs.com/package/@cheqd/sdk) is to provide a mechanism of integrating cheqd functionality in an application *without* using a 3rd-party SDK like [Veramo SDK for cheqd](https://docs.cheqd.io/identity/using-decentralised-identity-in-apps/veramo-sdk-for-cheqd).
|
|
14
|
+
|
|
15
|
+
This package includes:
|
|
16
|
+
|
|
17
|
+
* [TypeScript Protobuf definitions](https://github.com/cheqd/ts-proto) for custom cheqd Cosmos SDK modules
|
|
18
|
+
* [CosmJS](https://github.com/cosmos/cosmjs), for base Cosmos SDK module functions
|
|
19
|
+
|
|
20
|
+
If you are using [Versmo SDK for cheqd](https://docs.cheqd.io/identity/using-decentralised-identity-in-apps/veramo-sdk-for-cheqd), this SDK package is automatically installed and consumed by the [`@cheqd/did-provider-cheqd` Veramo plugin](https://github.com/cheqd/did-provider-cheqd).
|
|
21
|
+
|
|
22
|
+
## 🆔 Features
|
|
23
|
+
|
|
24
|
+
With this SDK, developers are able to:
|
|
25
|
+
|
|
26
|
+
* ✅ Create a `did:cheqd` method DID
|
|
27
|
+
* ✅ Update a `did:cheqd` method DID
|
|
28
|
+
* 🚧 Create Resource within a `did:cheqd` method DID
|
|
29
|
+
|
|
30
|
+
### 🧰 Tooling
|
|
31
|
+
|
|
32
|
+
* ✅ **Raw payload creator**: Enables users to generate a valid raw DID payload which is ready to be populated, depending on the use case. For example, `did-provider-cheqd` leverages this helper in the CLI application.
|
|
33
|
+
* ✅ **Identity key converter**: Enables users to convert specific key formats from different kinds of SDKs, by transforming the input keys into valid sign inputs for a cheqd specific DID transaction (e.g. `createDidTx`, `UpdateDidTx`). For example, the Veramo SDK for cheqd uses this helper to enable users to pass a key in a Veramo SDK specific format to a cheqd sign input keys interface.
|
|
34
|
+
|
|
35
|
+
## 📖 Documentation
|
|
36
|
+
|
|
37
|
+
Our [identity documentation site](https://docs.cheqd.io/identity/) explains how `@cheqd/sdk` is [consumed in Veramo SDK for cheqd](https://docs.cheqd.io/identity/using-decentralised-identity-in-apps/veramo-sdk-for-cheqd) (as an example of how this package can be consumed).
|
|
38
|
+
|
|
39
|
+
## 💬 Community
|
|
40
|
+
|
|
41
|
+
The [**cheqd Community Slack**](http://cheqd.link/join-cheqd-slack) is our primary chat channel for the open-source community, software developers, and node operators.
|
|
42
|
+
|
|
43
|
+
Please reach out to us there for discussions, help, and feedback on the project.
|
|
44
|
+
|
|
45
|
+
## 🙋 Find us elsewhere
|
|
46
|
+
|
|
47
|
+
[](https://t.me/cheqd) [](http://cheqd.link/discord-github) [](https://twitter.com/intent/follow?screen\_name=cheqd\_io) [](http://cheqd.link/linkedin) [](http://cheqd.link/join-cheqd-slack) [](https://blog.cheqd.io) [](https://www.youtube.com/channel/UCBUGvvH6t3BAYo5u41hJPzw/)
|
package/build/utils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { VerificationMethod } from "@cheqd/ts-proto/cheqd/v1/did";
|
|
2
|
-
import { IKeyValuePair, ISignInputs } from "./types";
|
|
2
|
+
import { IKeyPair, IKeyValuePair, ISignInputs, VerificationMethods, MethodSpecificIdAlgo, TVerificationKey, TVerificationKeyPrefix, CheqdNetwork, IVerificationKeys } from "./types";
|
|
3
|
+
import { KeyPair } from '@stablelib/ed25519';
|
|
4
|
+
import { MsgCreateDidPayload } from "@cheqd/ts-proto/cheqd/v1/tx";
|
|
3
5
|
export declare type TImportableEd25519Key = {
|
|
4
6
|
publicKeyHex: string;
|
|
5
7
|
privateKeyHex: string;
|
|
@@ -10,4 +12,10 @@ export declare function parseToKeyValuePair(object: {
|
|
|
10
12
|
[key: string]: any;
|
|
11
13
|
}): IKeyValuePair[];
|
|
12
14
|
export declare function createSignInputsFromImportableEd25519Key(key: TImportableEd25519Key, verificationMethod: VerificationMethod[]): ISignInputs;
|
|
15
|
+
export declare function createKeyPairRaw(): KeyPair;
|
|
16
|
+
export declare function createKeyPairBase64(): IKeyPair;
|
|
17
|
+
export declare function createKeyPairHex(): IKeyPair;
|
|
18
|
+
export declare function createVerificationKeys(keyPair: IKeyPair, algo: MethodSpecificIdAlgo, key: TVerificationKey<TVerificationKeyPrefix, number>, length?: number, network?: CheqdNetwork): IVerificationKeys;
|
|
19
|
+
export declare function createDidVerificationMethod(verificationMethodTypes: VerificationMethods[], verificationKeys: IVerificationKeys[]): VerificationMethod[];
|
|
20
|
+
export declare function createDidPayload(verificationMethods: VerificationMethod[], verificationKeys: IVerificationKeys[]): MsgCreateDidPayload;
|
|
13
21
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EACH,QAAQ,EACR,aAAa,EACb,WAAW,EACX,mBAAmB,EAEnB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,EACpB,MAAM,SAAS,CAAA;AAIhB,OAAO,EAAmB,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAGjE,oBAAY,qBAAqB,GAAG;IAChC,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,aAAa,EAAE,CAEnF;AAED,wBAAgB,wCAAwC,CAAC,GAAG,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,GAAG,WAAW,CAgC1I;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED,wBAAgB,mBAAmB,IAAI,QAAQ,CAM9C;AAED,wBAAgB,gBAAgB,IAAI,QAAQ,CAM3C;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,oBAAoB,EAAE,GAAG,EAAE,gBAAgB,CAAC,sBAAsB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAE,MAAW,EAAE,OAAO,GAAE,YAAmC,GAAG,iBAAiB,CAuBjO;AAED,wBAAgB,2BAA2B,CAAC,uBAAuB,EAAE,mBAAmB,EAAE,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,kBAAkB,EAAE,CA4BvJ;AAED,wBAAgB,gBAAgB,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,mBAAmB,CAetI"}
|
package/build/utils.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSignInputsFromImportableEd25519Key = exports.parseToKeyValuePair = void 0;
|
|
3
|
+
exports.createDidPayload = exports.createDidVerificationMethod = exports.createVerificationKeys = exports.createKeyPairHex = exports.createKeyPairBase64 = exports.createKeyPairRaw = exports.createSignInputsFromImportableEd25519Key = exports.parseToKeyValuePair = void 0;
|
|
4
4
|
const types_1 = require("./types");
|
|
5
5
|
const uint8arrays_1 = require("uint8arrays");
|
|
6
6
|
const basics_1 = require("multiformats/basics");
|
|
7
|
+
const did_jwt_1 = require("did-jwt");
|
|
8
|
+
const ed25519_1 = require("@stablelib/ed25519");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
const tx_1 = require("@cheqd/ts-proto/cheqd/v1/tx");
|
|
7
11
|
function parseToKeyValuePair(object) {
|
|
8
12
|
return Object.entries(object).map(([key, value]) => ({ key, value }));
|
|
9
13
|
}
|
|
@@ -39,4 +43,91 @@ function createSignInputsFromImportableEd25519Key(key, verificationMethod) {
|
|
|
39
43
|
throw new Error('No verification method type provided');
|
|
40
44
|
}
|
|
41
45
|
exports.createSignInputsFromImportableEd25519Key = createSignInputsFromImportableEd25519Key;
|
|
46
|
+
function createKeyPairRaw() {
|
|
47
|
+
return (0, ed25519_1.generateKeyPair)();
|
|
48
|
+
}
|
|
49
|
+
exports.createKeyPairRaw = createKeyPairRaw;
|
|
50
|
+
function createKeyPairBase64() {
|
|
51
|
+
const keyPair = (0, ed25519_1.generateKeyPair)();
|
|
52
|
+
return {
|
|
53
|
+
publicKey: (0, uint8arrays_1.toString)(keyPair.publicKey, 'base64'),
|
|
54
|
+
privateKey: (0, uint8arrays_1.toString)(keyPair.secretKey, 'base64'),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
exports.createKeyPairBase64 = createKeyPairBase64;
|
|
58
|
+
function createKeyPairHex() {
|
|
59
|
+
const keyPair = (0, ed25519_1.generateKeyPair)();
|
|
60
|
+
return {
|
|
61
|
+
publicKey: (0, uint8arrays_1.toString)(keyPair.publicKey, 'hex'),
|
|
62
|
+
privateKey: (0, uint8arrays_1.toString)(keyPair.secretKey, 'hex'),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
exports.createKeyPairHex = createKeyPairHex;
|
|
66
|
+
function createVerificationKeys(keyPair, algo, key, length = 32, network = types_1.CheqdNetwork.Testnet) {
|
|
67
|
+
let methodSpecificId;
|
|
68
|
+
let didUrl;
|
|
69
|
+
switch (algo) {
|
|
70
|
+
case types_1.MethodSpecificIdAlgo.Base58:
|
|
71
|
+
methodSpecificId = basics_1.bases['base58btc'].encode((0, did_jwt_1.base64ToBytes)(keyPair.publicKey));
|
|
72
|
+
didUrl = `did:cheqd:${network}:${methodSpecificId.substring(0, length)}`;
|
|
73
|
+
return {
|
|
74
|
+
methodSpecificId,
|
|
75
|
+
didUrl,
|
|
76
|
+
keyId: `${didUrl}#${key}`,
|
|
77
|
+
publicKey: keyPair.publicKey,
|
|
78
|
+
};
|
|
79
|
+
case types_1.MethodSpecificIdAlgo.Uuid:
|
|
80
|
+
methodSpecificId = basics_1.bases['base58btc'].encode((0, did_jwt_1.base64ToBytes)(keyPair.publicKey));
|
|
81
|
+
didUrl = `did:cheqd:${network}:${(0, uuid_1.v4)()}`;
|
|
82
|
+
return {
|
|
83
|
+
methodSpecificId,
|
|
84
|
+
didUrl,
|
|
85
|
+
keyId: `${didUrl}#${key}`,
|
|
86
|
+
publicKey: keyPair.publicKey,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.createVerificationKeys = createVerificationKeys;
|
|
91
|
+
function createDidVerificationMethod(verificationMethodTypes, verificationKeys) {
|
|
92
|
+
var _a;
|
|
93
|
+
return (_a = verificationMethodTypes.map((type, _) => {
|
|
94
|
+
switch (type) {
|
|
95
|
+
case types_1.VerificationMethods.Base58:
|
|
96
|
+
return {
|
|
97
|
+
id: verificationKeys[_].keyId,
|
|
98
|
+
type: type,
|
|
99
|
+
controller: verificationKeys[_].didUrl,
|
|
100
|
+
publicKeyMultibase: verificationKeys[_].methodSpecificId,
|
|
101
|
+
publicKeyJwk: []
|
|
102
|
+
};
|
|
103
|
+
case types_1.VerificationMethods.JWK:
|
|
104
|
+
return {
|
|
105
|
+
id: verificationKeys[_].keyId,
|
|
106
|
+
type: type,
|
|
107
|
+
controller: verificationKeys[_].didUrl,
|
|
108
|
+
publicKeyJwk: parseToKeyValuePair({
|
|
109
|
+
crv: 'Ed25519',
|
|
110
|
+
kty: 'OKP',
|
|
111
|
+
x: (0, uint8arrays_1.toString)((0, uint8arrays_1.fromString)(verificationKeys[_].publicKey, 'base64pad'), 'base64url')
|
|
112
|
+
}),
|
|
113
|
+
publicKeyMultibase: ''
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
})) !== null && _a !== void 0 ? _a : [];
|
|
117
|
+
}
|
|
118
|
+
exports.createDidVerificationMethod = createDidVerificationMethod;
|
|
119
|
+
function createDidPayload(verificationMethods, verificationKeys) {
|
|
120
|
+
if (!verificationMethods || verificationMethods.length === 0)
|
|
121
|
+
throw new Error('No verification methods provided');
|
|
122
|
+
if (!verificationKeys || verificationKeys.length === 0)
|
|
123
|
+
throw new Error('No verification keys provided');
|
|
124
|
+
const did = verificationKeys[0].didUrl;
|
|
125
|
+
return tx_1.MsgCreateDidPayload.fromPartial({
|
|
126
|
+
id: did,
|
|
127
|
+
controller: verificationKeys.map(key => key.didUrl),
|
|
128
|
+
verificationMethod: verificationMethods,
|
|
129
|
+
authentication: verificationKeys.map(key => key.keyId)
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
exports.createDidPayload = createDidPayload;
|
|
42
133
|
//# sourceMappingURL=utils.js.map
|
package/build/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AACA,mCAWgB;AAChB,6CAAkD;AAClD,gDAA2C;AAC3C,qCAAuC;AACvC,gDAA6D;AAC7D,+BAAyB;AACzB,oDAAiE;AAUjE,SAAgB,mBAAmB,CAAC,MAA8B;IAC9D,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,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AAkB,EAAE,EAAE;iBACzB,CAAA;SACR;IACL,CAAC,CAAC,mCAAI,EAAE,CAAA;AACZ,CAAC;AA5BD,kEA4BC;AAED,SAAgB,gBAAgB,CAAC,mBAAyC,EAAE,gBAAqC;IAC7G,IAAI,CAAC,mBAAmB,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAA;IACvD,IAAI,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;IAEpD,MAAM,GAAG,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;IACtC,OAAO,wBAAmB,CAAC,WAAW,CAClC;QACI,EAAE,EAAE,GAAG;QACP,UAAU,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;QACnD,kBAAkB,EAAE,mBAAmB;QACvC,cAAc,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC;KACzD,CACJ,CAAA;AACL,CAAC;AAfD,4CAeC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cheqd/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"description": "A TypeScript SDK built with CosmJS to interact with cheqd network ledger",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Cheqd Foundation Limited (https://github.com/cheqd)",
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
"@semantic-release/npm": "^9.0.1",
|
|
34
34
|
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
35
35
|
"@types/jest": "^28.1.6",
|
|
36
|
-
"@types/
|
|
37
|
-
"@types/node": "^18.6.4",
|
|
36
|
+
"@types/node": "^18.6.5",
|
|
38
37
|
"@types/uuid": "^8.3.4",
|
|
39
38
|
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
40
39
|
"jest": "^28.1.3",
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
"typescript": "^4.7.4"
|
|
44
43
|
},
|
|
45
44
|
"dependencies": {
|
|
46
|
-
"@cheqd/ts-proto": "^1.0.
|
|
45
|
+
"@cheqd/ts-proto": "^1.0.12",
|
|
47
46
|
"@cosmjs/amino": "^0.28.11",
|
|
48
47
|
"@cosmjs/encoding": "^0.28.11",
|
|
49
48
|
"@cosmjs/math": "^0.28.11",
|
|
@@ -53,9 +52,9 @@
|
|
|
53
52
|
"@cosmjs/utils": "^0.28.11",
|
|
54
53
|
"@stablelib/ed25519": "^1.0.2",
|
|
55
54
|
"cosmjs-types": "^0.5.0",
|
|
56
|
-
"did-jwt": "^6.
|
|
55
|
+
"did-jwt": "^6.3.0",
|
|
57
56
|
"multiformats": "^9.7.1",
|
|
58
|
-
"uint8arrays": "^3.
|
|
57
|
+
"uint8arrays": "^3.1.0",
|
|
59
58
|
"uuid": "^8.3.2"
|
|
60
59
|
},
|
|
61
60
|
"publishConfig": {
|
package/src/utils.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { VerificationMethod } from "@cheqd/ts-proto/cheqd/v1/did"
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
IKeyPair,
|
|
4
|
+
IKeyValuePair,
|
|
5
|
+
ISignInputs,
|
|
6
|
+
VerificationMethods,
|
|
7
|
+
TMethodSpecificId,
|
|
8
|
+
MethodSpecificIdAlgo,
|
|
9
|
+
TVerificationKey,
|
|
10
|
+
TVerificationKeyPrefix,
|
|
11
|
+
CheqdNetwork,
|
|
12
|
+
IVerificationKeys
|
|
13
|
+
} from "./types"
|
|
3
14
|
import { fromString, toString } from 'uint8arrays'
|
|
4
15
|
import { bases } from "multiformats/basics"
|
|
16
|
+
import { base64ToBytes } from "did-jwt"
|
|
17
|
+
import { generateKeyPair, KeyPair } from '@stablelib/ed25519'
|
|
18
|
+
import { v4 } from 'uuid'
|
|
19
|
+
import { MsgCreateDidPayload } from "@cheqd/ts-proto/cheqd/v1/tx"
|
|
5
20
|
|
|
6
21
|
|
|
7
22
|
export type TImportableEd25519Key = {
|
|
@@ -47,4 +62,96 @@ export function createSignInputsFromImportableEd25519Key(key: TImportableEd25519
|
|
|
47
62
|
}
|
|
48
63
|
|
|
49
64
|
throw new Error('No verification method type provided')
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function createKeyPairRaw(): KeyPair {
|
|
68
|
+
return generateKeyPair()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function createKeyPairBase64(): IKeyPair {
|
|
72
|
+
const keyPair = generateKeyPair()
|
|
73
|
+
return {
|
|
74
|
+
publicKey: toString(keyPair.publicKey, 'base64'),
|
|
75
|
+
privateKey: toString(keyPair.secretKey, 'base64'),
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function createKeyPairHex(): IKeyPair {
|
|
80
|
+
const keyPair = generateKeyPair()
|
|
81
|
+
return {
|
|
82
|
+
publicKey: toString(keyPair.publicKey, 'hex'),
|
|
83
|
+
privateKey: toString(keyPair.secretKey, 'hex'),
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function createVerificationKeys(keyPair: IKeyPair, algo: MethodSpecificIdAlgo, key: TVerificationKey<TVerificationKeyPrefix, number>, length: number = 32, network: CheqdNetwork = CheqdNetwork.Testnet): IVerificationKeys {
|
|
88
|
+
let methodSpecificId: TMethodSpecificId
|
|
89
|
+
let didUrl: IVerificationKeys['didUrl']
|
|
90
|
+
switch (algo) {
|
|
91
|
+
case MethodSpecificIdAlgo.Base58:
|
|
92
|
+
methodSpecificId = bases['base58btc'].encode(base64ToBytes(keyPair.publicKey))
|
|
93
|
+
didUrl = `did:cheqd:${network}:${methodSpecificId.substring(0, length)}`
|
|
94
|
+
return {
|
|
95
|
+
methodSpecificId,
|
|
96
|
+
didUrl,
|
|
97
|
+
keyId: `${didUrl}#${key}`,
|
|
98
|
+
publicKey: keyPair.publicKey,
|
|
99
|
+
}
|
|
100
|
+
case MethodSpecificIdAlgo.Uuid:
|
|
101
|
+
methodSpecificId = bases['base58btc'].encode(base64ToBytes(keyPair.publicKey))
|
|
102
|
+
didUrl = `did:cheqd:${network}:${v4()}`
|
|
103
|
+
return {
|
|
104
|
+
methodSpecificId,
|
|
105
|
+
didUrl,
|
|
106
|
+
keyId: `${didUrl}#${key}`,
|
|
107
|
+
publicKey: keyPair.publicKey,
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function createDidVerificationMethod(verificationMethodTypes: VerificationMethods[], verificationKeys: IVerificationKeys[]): VerificationMethod[] {
|
|
113
|
+
return verificationMethodTypes.map((type, _) => {
|
|
114
|
+
switch (type) {
|
|
115
|
+
case VerificationMethods.Base58:
|
|
116
|
+
return {
|
|
117
|
+
id: verificationKeys[_].keyId,
|
|
118
|
+
type: type,
|
|
119
|
+
controller: verificationKeys[_].didUrl,
|
|
120
|
+
publicKeyMultibase: verificationKeys[_].methodSpecificId,
|
|
121
|
+
publicKeyJwk: []
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
case VerificationMethods.JWK:
|
|
125
|
+
return {
|
|
126
|
+
id: verificationKeys[_].keyId,
|
|
127
|
+
type: type,
|
|
128
|
+
controller: verificationKeys[_].didUrl,
|
|
129
|
+
publicKeyJwk: parseToKeyValuePair(
|
|
130
|
+
{
|
|
131
|
+
crv: 'Ed25519',
|
|
132
|
+
kty: 'OKP',
|
|
133
|
+
x: toString( fromString( verificationKeys[_].publicKey, 'base64pad' ), 'base64url' )
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
publicKeyMultibase: ''
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}) ?? []
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function createDidPayload(verificationMethods: VerificationMethod[], verificationKeys: IVerificationKeys[]): MsgCreateDidPayload {
|
|
143
|
+
if (!verificationMethods || verificationMethods.length === 0)
|
|
144
|
+
throw new Error('No verification methods provided')
|
|
145
|
+
if (!verificationKeys || verificationKeys.length === 0)
|
|
146
|
+
throw new Error('No verification keys provided')
|
|
147
|
+
|
|
148
|
+
const did = verificationKeys[0].didUrl
|
|
149
|
+
return MsgCreateDidPayload.fromPartial(
|
|
150
|
+
{
|
|
151
|
+
id: did,
|
|
152
|
+
controller: verificationKeys.map(key => key.didUrl),
|
|
153
|
+
verificationMethod: verificationMethods,
|
|
154
|
+
authentication: verificationKeys.map(key => key.keyId)
|
|
155
|
+
}
|
|
156
|
+
)
|
|
50
157
|
}
|
|
@@ -30,6 +30,7 @@ describe('DIDModule', () => {
|
|
|
30
30
|
const verificationKeys = createVerificationKeys(keyPair, MethodSpecificIdAlgo.Base58, 'key-1', 16)
|
|
31
31
|
const verificationMethods = createDidVerificationMethod([VerificationMethods.Base58], [verificationKeys])
|
|
32
32
|
const didPayload = createDidPayload(verificationMethods, [verificationKeys])
|
|
33
|
+
|
|
33
34
|
const signInputs: ISignInputs[] = [
|
|
34
35
|
{
|
|
35
36
|
verificationMethodId: didPayload.verificationMethod[0].id,
|
package/tests/testutils.test.ts
CHANGED
|
@@ -22,10 +22,20 @@ export const exampleCheqdNetwork = {
|
|
|
22
22
|
gasPrice: GasPrice.fromString( `25${faucet.minimalDenom}` )
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
*? General test utils. Look for src/utils.ts for stable utils exports.
|
|
27
|
+
*? Used for testing purposes.
|
|
28
|
+
** NOTE: The following utils are stable but subject to change at any given moment.
|
|
29
|
+
*/
|
|
25
30
|
export function createKeyPairRaw(): KeyPair {
|
|
26
31
|
return generateKeyPair()
|
|
27
32
|
}
|
|
28
33
|
|
|
34
|
+
/**
|
|
35
|
+
*? General test utils. Look for src/utils.ts for stable utils exports.
|
|
36
|
+
*? Used for testing purposes.
|
|
37
|
+
** NOTE: The following utils are stable but subject to change at any given moment.
|
|
38
|
+
*/
|
|
29
39
|
export function createKeyPairBase64(): IKeyPair {
|
|
30
40
|
const keyPair = generateKeyPair()
|
|
31
41
|
return {
|
|
@@ -34,6 +44,11 @@ export function createKeyPairBase64(): IKeyPair {
|
|
|
34
44
|
}
|
|
35
45
|
}
|
|
36
46
|
|
|
47
|
+
/**
|
|
48
|
+
*? General test utils. Look for src/utils.ts for stable utils exports.
|
|
49
|
+
*? Used for testing purposes.
|
|
50
|
+
** NOTE: The following utils are stable but subject to change at any given moment.
|
|
51
|
+
*/
|
|
37
52
|
export function createKeyPairHex(): IKeyPair {
|
|
38
53
|
const keyPair = generateKeyPair()
|
|
39
54
|
return {
|
|
@@ -42,6 +57,11 @@ export function createKeyPairHex(): IKeyPair {
|
|
|
42
57
|
}
|
|
43
58
|
}
|
|
44
59
|
|
|
60
|
+
/**
|
|
61
|
+
*? General test utils. Look for src/utils.ts for stable utils exports.
|
|
62
|
+
*? Used for testing purposes.
|
|
63
|
+
** NOTE: The following utils are stable but subject to change at any given moment.
|
|
64
|
+
*/
|
|
45
65
|
export function createVerificationKeys(keyPair: IKeyPair, algo: MethodSpecificIdAlgo, key: TVerificationKey<TVerificationKeyPrefix, number>, length: number = 32, network: CheqdNetwork = CheqdNetwork.Testnet): IVerificationKeys {
|
|
46
66
|
let methodSpecificId: TMethodSpecificId
|
|
47
67
|
let didUrl: IVerificationKeys['didUrl']
|
|
@@ -67,6 +87,11 @@ export function createVerificationKeys(keyPair: IKeyPair, algo: MethodSpecificId
|
|
|
67
87
|
}
|
|
68
88
|
}
|
|
69
89
|
|
|
90
|
+
/**
|
|
91
|
+
*? General test utils. Look for src/utils.ts for stable utils exports.
|
|
92
|
+
*? Used for testing purposes.
|
|
93
|
+
** NOTE: The following utils are stable but subject to change at any given moment.
|
|
94
|
+
*/
|
|
70
95
|
export function createDidVerificationMethod(verificationMethodTypes: VerificationMethods[], verificationKeys: IVerificationKeys[]): VerificationMethod[] {
|
|
71
96
|
return verificationMethodTypes.map((type, _) => {
|
|
72
97
|
switch (type) {
|
|
@@ -97,6 +122,11 @@ export function createDidVerificationMethod(verificationMethodTypes: Verificatio
|
|
|
97
122
|
}) ?? []
|
|
98
123
|
}
|
|
99
124
|
|
|
125
|
+
/**
|
|
126
|
+
*? General test utils. Look for src/utils.ts for stable utils exports.
|
|
127
|
+
*? Used for testing purposes.
|
|
128
|
+
** NOTE: The following utils are stable but subject to change at any given moment.
|
|
129
|
+
*/
|
|
100
130
|
export function createDidPayload(verificationMethods: VerificationMethod[], verificationKeys: IVerificationKeys[]): MsgCreateDidPayload {
|
|
101
131
|
if (!verificationMethods || verificationMethods.length === 0)
|
|
102
132
|
throw new Error('No verification methods provided')
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
<mxfile host="65bd71144e">
|
|
2
|
-
<diagram id="KFYoYz0UW_bgJBK5556Q" name="Page-1">
|
|
3
|
-
<mxGraphModel dx="6170" dy="3536" grid="0" gridSize="10" guides="0" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
|
|
4
|
-
<root>
|
|
5
|
-
<mxCell id="0"/>
|
|
6
|
-
<mxCell id="1" parent="0"/>
|
|
7
|
-
<mxCell id="2" value="<font style="font-size: 30px"><br></font>" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
8
|
-
<mxGeometry x="-790" y="90" width="1590" height="1000" as="geometry"/>
|
|
9
|
-
</mxCell>
|
|
10
|
-
<mxCell id="3" value="" style="rounded=1;whiteSpace=wrap;html=1;fontSize=30;" vertex="1" parent="1">
|
|
11
|
-
<mxGeometry x="-710" y="160" width="1420" height="330" as="geometry"/>
|
|
12
|
-
</mxCell>
|
|
13
|
-
<mxCell id="15" style="edgeStyle=none;rounded=1;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;dashed=1;fontSize=30;" edge="1" parent="1" source="4" target="11">
|
|
14
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
15
|
-
</mxCell>
|
|
16
|
-
<mxCell id="4" value="DID<br>Module" style="rounded=1;whiteSpace=wrap;html=1;fontSize=30;" vertex="1" parent="1">
|
|
17
|
-
<mxGeometry x="-620" y="230" width="210" height="180" as="geometry"/>
|
|
18
|
-
</mxCell>
|
|
19
|
-
<mxCell id="6" value="Modules" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=30;" vertex="1" parent="1">
|
|
20
|
-
<mxGeometry x="-165" y="90" width="320" height="70" as="geometry"/>
|
|
21
|
-
</mxCell>
|
|
22
|
-
<mxCell id="17" style="edgeStyle=none;rounded=1;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;dashed=1;fontSize=30;" edge="1" parent="1" source="7">
|
|
23
|
-
<mxGeometry relative="1" as="geometry">
|
|
24
|
-
<mxPoint y="620" as="targetPoint"/>
|
|
25
|
-
</mxGeometry>
|
|
26
|
-
</mxCell>
|
|
27
|
-
<mxCell id="7" value="Resources<br>Module" style="rounded=1;whiteSpace=wrap;html=1;fontSize=30;" vertex="1" parent="1">
|
|
28
|
-
<mxGeometry x="60" y="230" width="210" height="180" as="geometry"/>
|
|
29
|
-
</mxCell>
|
|
30
|
-
<mxCell id="18" style="edgeStyle=none;rounded=1;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;dashed=1;fontSize=30;" edge="1" parent="1" source="8" target="11">
|
|
31
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
32
|
-
</mxCell>
|
|
33
|
-
<mxCell id="8" value="Revocation<br>Module" style="rounded=1;whiteSpace=wrap;html=1;fontSize=30;" vertex="1" parent="1">
|
|
34
|
-
<mxGeometry x="400" y="230" width="210" height="180" as="geometry"/>
|
|
35
|
-
</mxCell>
|
|
36
|
-
<mxCell id="16" style="edgeStyle=none;rounded=1;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;dashed=1;fontSize=30;" edge="1" parent="1" source="9">
|
|
37
|
-
<mxGeometry relative="1" as="geometry">
|
|
38
|
-
<mxPoint y="620" as="targetPoint"/>
|
|
39
|
-
</mxGeometry>
|
|
40
|
-
</mxCell>
|
|
41
|
-
<mxCell id="9" value="Credentials<br>Module" style="rounded=1;whiteSpace=wrap;html=1;fontSize=30;" vertex="1" parent="1">
|
|
42
|
-
<mxGeometry x="-280" y="230" width="210" height="180" as="geometry"/>
|
|
43
|
-
</mxCell>
|
|
44
|
-
<mxCell id="21" style="edgeStyle=none;rounded=1;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;dashed=1;fontSize=30;" edge="1" parent="1" source="10" target="20">
|
|
45
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
46
|
-
</mxCell>
|
|
47
|
-
<mxCell id="23" style="edgeStyle=none;rounded=1;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;dashed=1;fontSize=30;" edge="1" parent="1" source="10" target="22">
|
|
48
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
49
|
-
</mxCell>
|
|
50
|
-
<mxCell id="10" value="Senders" style="rounded=1;whiteSpace=wrap;html=1;fontSize=30;" vertex="1" parent="1">
|
|
51
|
-
<mxGeometry x="-215" y="870" width="430" height="120" as="geometry"/>
|
|
52
|
-
</mxCell>
|
|
53
|
-
<mxCell id="19" style="edgeStyle=none;rounded=1;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;dashed=1;fontSize=30;" edge="1" parent="1" source="11" target="10">
|
|
54
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
55
|
-
</mxCell>
|
|
56
|
-
<mxCell id="11" value="Signers" style="rounded=1;whiteSpace=wrap;html=1;fontSize=30;" vertex="1" parent="1">
|
|
57
|
-
<mxGeometry x="-215" y="620" width="430" height="120" as="geometry"/>
|
|
58
|
-
</mxCell>
|
|
59
|
-
<mxCell id="14" value="..." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=30;" vertex="1" parent="1">
|
|
60
|
-
<mxGeometry x="-165" y="420" width="320" height="70" as="geometry"/>
|
|
61
|
-
</mxCell>
|
|
62
|
-
<mxCell id="20" value="Ledger" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fontSize=30;" vertex="1" parent="1">
|
|
63
|
-
<mxGeometry x="1150" y="90" width="300" height="990" as="geometry"/>
|
|
64
|
-
</mxCell>
|
|
65
|
-
<mxCell id="22" value="Revocation<br>Registry" style="shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;darkOpacity=0.05;fontSize=30;" vertex="1" parent="1">
|
|
66
|
-
<mxGeometry x="870" y="795" width="190" height="270" as="geometry"/>
|
|
67
|
-
</mxCell>
|
|
68
|
-
<mxCell id="25" value="<h1><span>API Class</span></h1><h1><span style="font-weight: 400"><font style="font-size: 35px">Faster development.</font></span></h1>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;fontSize=30;align=center;" vertex="1" parent="1">
|
|
69
|
-
<mxGeometry x="-195" y="-220" width="400" height="330" as="geometry"/>
|
|
70
|
-
</mxCell>
|
|
71
|
-
<mxCell id="26" value="<b><font style="font-size: 60px">VS</font></b>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=35;" vertex="1" parent="1">
|
|
72
|
-
<mxGeometry x="1700" y="-220" width="340" height="200" as="geometry"/>
|
|
73
|
-
</mxCell>
|
|
74
|
-
<mxCell id="27" value="<h1><span>Modular Signer, Sender, Message</span></h1><h1><span style="font-weight: 400"><font style="font-size: 35px">Modular development.</font></span></h1>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;fontSize=30;align=center;" vertex="1" parent="1">
|
|
75
|
-
<mxGeometry x="2755" y="-285" width="540" height="330" as="geometry"/>
|
|
76
|
-
</mxCell>
|
|
77
|
-
<mxCell id="28" value="ISigner" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
78
|
-
<mxGeometry x="2180" y="90" width="510" height="255" as="geometry"/>
|
|
79
|
-
</mxCell>
|
|
80
|
-
<mxCell id="29" value="ISender" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
81
|
-
<mxGeometry x="2770" y="90" width="510" height="255" as="geometry"/>
|
|
82
|
-
</mxCell>
|
|
83
|
-
<mxCell id="30" value="AbstractMessage" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
84
|
-
<mxGeometry x="3360" y="90" width="510" height="255" as="geometry"/>
|
|
85
|
-
</mxCell>
|
|
86
|
-
<mxCell id="31" value="<font style="font-size: 40px">MsgCreateDID</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
87
|
-
<mxGeometry x="3360" y="450" width="510" height="100" as="geometry"/>
|
|
88
|
-
</mxCell>
|
|
89
|
-
<mxCell id="32" value="<font style="font-size: 40px">MsgUpdateDID</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
90
|
-
<mxGeometry x="3360" y="600" width="510" height="100" as="geometry"/>
|
|
91
|
-
</mxCell>
|
|
92
|
-
<mxCell id="33" value="<font style="font-size: 40px">...</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
93
|
-
<mxGeometry x="3360" y="750" width="510" height="100" as="geometry"/>
|
|
94
|
-
</mxCell>
|
|
95
|
-
<mxCell id="36" style="edgeStyle=none;rounded=1;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;dashed=1;fontSize=40;" edge="1" parent="1" source="34" target="32">
|
|
96
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
97
|
-
</mxCell>
|
|
98
|
-
<mxCell id="37" style="edgeStyle=none;rounded=1;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;dashed=1;fontSize=40;" edge="1" parent="1" source="34" target="31">
|
|
99
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
100
|
-
</mxCell>
|
|
101
|
-
<mxCell id="38" style="edgeStyle=none;rounded=1;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;dashed=1;fontSize=40;" edge="1" parent="1" source="34" target="33">
|
|
102
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
103
|
-
</mxCell>
|
|
104
|
-
<mxCell id="34" value="DID<br>Module" style="rhombus;whiteSpace=wrap;html=1;fontSize=40;" vertex="1" parent="1">
|
|
105
|
-
<mxGeometry x="4070" y="435" width="430" height="430" as="geometry"/>
|
|
106
|
-
</mxCell>
|
|
107
|
-
<mxCell id="39" value="<font style="font-size: 40px">MsgCreateResource</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
108
|
-
<mxGeometry x="3360" y="925" width="510" height="100" as="geometry"/>
|
|
109
|
-
</mxCell>
|
|
110
|
-
<mxCell id="40" value="<font style="font-size: 40px">MsgUpdateResource</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
111
|
-
<mxGeometry x="3360" y="1075" width="510" height="100" as="geometry"/>
|
|
112
|
-
</mxCell>
|
|
113
|
-
<mxCell id="41" value="<font style="font-size: 40px">...</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
114
|
-
<mxGeometry x="3360" y="1225" width="510" height="100" as="geometry"/>
|
|
115
|
-
</mxCell>
|
|
116
|
-
<mxCell id="42" style="edgeStyle=none;rounded=1;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;dashed=1;fontSize=40;" edge="1" parent="1" source="45" target="40">
|
|
117
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
118
|
-
</mxCell>
|
|
119
|
-
<mxCell id="43" style="edgeStyle=none;rounded=1;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;dashed=1;fontSize=40;" edge="1" parent="1" source="45" target="39">
|
|
120
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
121
|
-
</mxCell>
|
|
122
|
-
<mxCell id="44" style="edgeStyle=none;rounded=1;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;dashed=1;fontSize=40;" edge="1" parent="1" source="45" target="41">
|
|
123
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
124
|
-
</mxCell>
|
|
125
|
-
<mxCell id="45" value="Resources<br>Module" style="rhombus;whiteSpace=wrap;html=1;fontSize=40;" vertex="1" parent="1">
|
|
126
|
-
<mxGeometry x="4070" y="910" width="430" height="430" as="geometry"/>
|
|
127
|
-
</mxCell>
|
|
128
|
-
<mxCell id="46" value="<font style="font-size: 40px">MsgXa</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
129
|
-
<mxGeometry x="3360" y="1395" width="510" height="100" as="geometry"/>
|
|
130
|
-
</mxCell>
|
|
131
|
-
<mxCell id="47" value="<font style="font-size: 40px">MsgXb</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
132
|
-
<mxGeometry x="3360" y="1545" width="510" height="100" as="geometry"/>
|
|
133
|
-
</mxCell>
|
|
134
|
-
<mxCell id="48" value="<font style="font-size: 40px">...</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=60;" vertex="1" parent="1">
|
|
135
|
-
<mxGeometry x="3360" y="1695" width="510" height="100" as="geometry"/>
|
|
136
|
-
</mxCell>
|
|
137
|
-
<mxCell id="49" style="edgeStyle=none;rounded=1;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;dashed=1;fontSize=40;" edge="1" parent="1" source="52" target="47">
|
|
138
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
139
|
-
</mxCell>
|
|
140
|
-
<mxCell id="50" style="edgeStyle=none;rounded=1;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;dashed=1;fontSize=40;" edge="1" parent="1" source="52" target="46">
|
|
141
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
142
|
-
</mxCell>
|
|
143
|
-
<mxCell id="51" style="edgeStyle=none;rounded=1;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;dashed=1;fontSize=40;" edge="1" parent="1" source="52" target="48">
|
|
144
|
-
<mxGeometry relative="1" as="geometry"/>
|
|
145
|
-
</mxCell>
|
|
146
|
-
<mxCell id="52" value="X<br>Module" style="rhombus;whiteSpace=wrap;html=1;fontSize=40;" vertex="1" parent="1">
|
|
147
|
-
<mxGeometry x="4070" y="1380" width="430" height="430" as="geometry"/>
|
|
148
|
-
</mxCell>
|
|
149
|
-
</root>
|
|
150
|
-
</mxGraphModel>
|
|
151
|
-
</diagram>
|
|
152
|
-
</mxfile>
|