@cheqd/sdk 3.0.0-develop.1 → 3.0.0-develop.2
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/.github/linters/{.commitlint.rules.js → .commitlint.rules.cjs} +0 -0
- package/.github/workflows/pull-request.yml +1 -1
- package/CHANGELOG.md +2 -0
- package/build/cjs/index.d.ts.map +1 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/modules/_.d.ts.map +1 -1
- package/build/cjs/modules/_.js.map +1 -1
- package/build/cjs/modules/did.d.ts.map +1 -1
- package/build/cjs/modules/did.js.map +1 -1
- package/build/cjs/querier.d.ts.map +1 -1
- package/build/cjs/querier.js.map +1 -1
- package/build/cjs/registry.d.ts.map +1 -1
- package/build/cjs/registry.js.map +1 -1
- package/build/cjs/signer.d.ts +1 -1
- package/build/cjs/signer.d.ts.map +1 -1
- package/build/cjs/signer.js +9 -9
- package/build/cjs/signer.js.map +1 -1
- package/build/cjs/types.d.ts.map +1 -1
- package/build/cjs/types.js.map +1 -1
- package/build/cjs/utils.d.ts.map +1 -1
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.d.ts.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/modules/_.d.ts.map +1 -1
- package/build/esm/modules/_.js.map +1 -1
- package/build/esm/modules/did.d.ts.map +1 -1
- package/build/esm/modules/did.js.map +1 -1
- package/build/esm/querier.d.ts.map +1 -1
- package/build/esm/querier.js.map +1 -1
- package/build/esm/registry.d.ts.map +1 -1
- package/build/esm/registry.js.map +1 -1
- package/build/esm/signer.d.ts +1 -1
- package/build/esm/signer.d.ts.map +1 -1
- package/build/esm/signer.js +1 -1
- package/build/esm/signer.js.map +1 -1
- package/build/esm/types.d.ts.map +1 -1
- package/build/esm/types.js.map +1 -1
- package/build/esm/utils.d.ts.map +1 -1
- package/build/esm/utils.js.map +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/modules/_.d.ts.map +1 -1
- package/build/types/modules/did.d.ts.map +1 -1
- package/build/types/querier.d.ts.map +1 -1
- package/build/types/registry.d.ts.map +1 -1
- package/build/types/signer.d.ts +1 -1
- package/build/types/signer.d.ts.map +1 -1
- package/build/types/types.d.ts.map +1 -1
- package/build/types/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +30 -6
- package/src/modules/_.ts +4 -1
- package/src/modules/did.ts +4 -1
- package/src/querier.ts +4 -1
- package/src/registry.ts +1 -3
- package/src/signer.ts +46 -7
- package/src/types.ts +11 -2
- package/src/utils.ts +9 -2
- package/tests/index.test.ts +24 -5
- package/tests/modules/did.test.ts +25 -5
- package/tests/modules/resource.test.ts +42 -8
- package/tests/signer.test.ts +29 -6
- package/tests/utils.test.ts +14 -3
|
@@ -1,17 +1,51 @@
|
|
|
1
1
|
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"
|
|
2
2
|
import { DeliverTxResponse } from "@cosmjs/stargate"
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
fromString,
|
|
5
|
+
toString
|
|
6
|
+
} from 'uint8arrays'
|
|
7
|
+
import {
|
|
8
|
+
DIDModule,
|
|
9
|
+
ResourceModule
|
|
10
|
+
} from "../../src"
|
|
5
11
|
import { createDefaultCheqdRegistry } from "../../src/registry"
|
|
6
12
|
import { CheqdSigningStargateClient } from "../../src/signer"
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
import {
|
|
14
|
+
ISignInputs,
|
|
15
|
+
MethodSpecificIdAlgo,
|
|
16
|
+
QueryExtensionSetup,
|
|
17
|
+
VerificationMethods,
|
|
18
|
+
CheqdExtensions
|
|
19
|
+
} from '../../src/types';
|
|
20
|
+
import {
|
|
21
|
+
createDidPayload,
|
|
22
|
+
createDidVerificationMethod,
|
|
23
|
+
createKeyPairBase64,
|
|
24
|
+
createVerificationKeys
|
|
25
|
+
} from "../../src/utils"
|
|
26
|
+
import {
|
|
27
|
+
localnet,
|
|
28
|
+
faucet,
|
|
29
|
+
image_content,
|
|
30
|
+
default_content,
|
|
31
|
+
json_content,
|
|
32
|
+
containsAllButOmittedFields
|
|
33
|
+
} from '../testutils.test';
|
|
34
|
+
import {
|
|
35
|
+
AlternativeUri,
|
|
36
|
+
Metadata,
|
|
37
|
+
MsgCreateResourcePayload
|
|
38
|
+
} from '@cheqd/ts-proto/cheqd/resource/v2';
|
|
11
39
|
import { v4 } from "uuid"
|
|
12
40
|
import { CheqdQuerier } from "../../src/querier"
|
|
13
|
-
import {
|
|
14
|
-
|
|
41
|
+
import {
|
|
42
|
+
setupResourceExtension,
|
|
43
|
+
ResourceExtension
|
|
44
|
+
} from '../../src/modules/resource';
|
|
45
|
+
import {
|
|
46
|
+
DidExtension,
|
|
47
|
+
setupDidExtension
|
|
48
|
+
} from "../../src/modules/did"
|
|
15
49
|
import { sha256 } from "@cosmjs/crypto"
|
|
16
50
|
|
|
17
51
|
const defaultAsyncTxTimeout = 30000
|
package/tests/signer.test.ts
CHANGED
|
@@ -1,12 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
MsgCreateDidDoc,
|
|
3
|
+
MsgCreateDidDocPayload,
|
|
4
|
+
VerificationMethod
|
|
5
|
+
} from "@cheqd/ts-proto/cheqd/did/v2"
|
|
6
|
+
import {
|
|
7
|
+
DirectSecp256k1HdWallet,
|
|
8
|
+
Registry
|
|
9
|
+
} from "@cosmjs/proto-signing"
|
|
3
10
|
import { EdDSASigner } from "did-jwt"
|
|
4
11
|
import { typeUrlMsgCreateDidDoc } from '../src/modules/did'
|
|
5
12
|
import { CheqdSigningStargateClient } from "../src/signer"
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
import {
|
|
14
|
+
ISignInputs,
|
|
15
|
+
MethodSpecificIdAlgo,
|
|
16
|
+
VerificationMethods
|
|
17
|
+
} from "../src/types"
|
|
18
|
+
import {
|
|
19
|
+
fromString,
|
|
20
|
+
toString
|
|
21
|
+
} from 'uint8arrays'
|
|
22
|
+
import {
|
|
23
|
+
createDidPayload,
|
|
24
|
+
createDidVerificationMethod,
|
|
25
|
+
createKeyPairBase64,
|
|
26
|
+
createVerificationKeys,
|
|
27
|
+
validateSpecCompliantPayload
|
|
28
|
+
} from '../src/utils';
|
|
29
|
+
import {
|
|
30
|
+
localnet,
|
|
31
|
+
faucet
|
|
32
|
+
} from "./testutils.test"
|
|
10
33
|
import { verify } from "@stablelib/ed25519"
|
|
11
34
|
import { v4 } from "uuid"
|
|
12
35
|
|
package/tests/utils.test.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
TImportableEd25519Key,
|
|
3
|
+
createSignInputsFromImportableEd25519Key
|
|
4
|
+
} from '../src/utils'
|
|
5
|
+
import {
|
|
6
|
+
createDidVerificationMethod,
|
|
7
|
+
createVerificationKeys,
|
|
8
|
+
createKeyPairRaw
|
|
9
|
+
} from '../src/utils'
|
|
3
10
|
import { toString } from 'uint8arrays'
|
|
4
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
IKeyPair,
|
|
13
|
+
MethodSpecificIdAlgo,
|
|
14
|
+
VerificationMethods
|
|
15
|
+
} from '../src/types'
|
|
5
16
|
|
|
6
17
|
describe('createSignInputsFromImportableEd25519Key', () => {
|
|
7
18
|
it('should create a sign input from an importable ed25519 key 2020', async () => {
|