@cheqd/sdk 2.0.2-develop.1 → 2.1.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/.github/workflows/test.yml +2 -2
- package/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/build/index.d.ts +7 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +19 -7
- package/build/index.js.map +1 -1
- package/build/modules/_.d.ts +7 -11
- package/build/modules/_.d.ts.map +1 -1
- package/build/modules/_.js +15 -17
- package/build/modules/_.js.map +1 -1
- package/build/modules/did.d.ts +39 -15
- package/build/modules/did.d.ts.map +1 -1
- package/build/modules/did.js +187 -54
- package/build/modules/did.js.map +1 -1
- package/build/modules/resource.d.ts +23 -7
- package/build/modules/resource.d.ts.map +1 -1
- package/build/modules/resource.js +61 -18
- package/build/modules/resource.js.map +1 -1
- package/build/querier.d.ts +11 -0
- package/build/querier.d.ts.map +1 -0
- package/build/querier.js +31 -0
- package/build/querier.js.map +1 -0
- package/build/signer.d.ts +3 -5
- package/build/signer.d.ts.map +1 -1
- package/build/signer.js +13 -13
- package/build/signer.js.map +1 -1
- package/build/types.d.ts +12 -0
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/build/utils.js +13 -15
- package/build/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +22 -10
- package/src/modules/_.ts +13 -21
- package/src/modules/did.ts +207 -51
- package/src/modules/resource.ts +74 -12
- package/src/querier.ts +33 -0
- package/src/signer.ts +3 -6
- package/src/types.ts +17 -1
- package/src/utils.ts +1 -1
- package/tests/index.test.ts +43 -3
- package/tests/modules/did.test.ts +483 -50
- package/tests/modules/resource.test.ts +576 -30
- package/tests/signer.test.ts +2 -2
- package/tests/testutils.test.ts +8 -2
- package/tsconfig.json +1 -1
package/tests/signer.test.ts
CHANGED
|
@@ -133,7 +133,7 @@ describe('CheqdSigningStargateClient', () => {
|
|
|
133
133
|
})
|
|
134
134
|
})
|
|
135
135
|
|
|
136
|
-
describe('
|
|
136
|
+
describe('signcreateDidDocTx', () => {
|
|
137
137
|
it('should sign a did tx with valid signature', async () => {
|
|
138
138
|
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic)
|
|
139
139
|
const signer = await CheqdSigningStargateClient.connectWithSigner(localnet.rpcUrl, wallet)
|
|
@@ -163,7 +163,7 @@ describe('CheqdSigningStargateClient', () => {
|
|
|
163
163
|
alsoKnownAs: <string[]>didPayload.alsoKnownAs,
|
|
164
164
|
versionId: versionId
|
|
165
165
|
})
|
|
166
|
-
const signInfos = await signer.
|
|
166
|
+
const signInfos = await signer.signcreateDidDocTx(signInputs, payload)
|
|
167
167
|
const publicKeyRaw = fromString(keyPair.publicKey, 'base64')
|
|
168
168
|
const messageRaw = MsgCreateDidDocPayload.encode(payload).finish()
|
|
169
169
|
|
package/tests/testutils.test.ts
CHANGED
|
@@ -9,10 +9,16 @@ export const faucet = {
|
|
|
9
9
|
|
|
10
10
|
export const localnet = {
|
|
11
11
|
network: 'testnet',
|
|
12
|
-
rpcUrl: '
|
|
12
|
+
rpcUrl: 'https://rpc.cheqd.network:443',
|
|
13
13
|
gasPrice: GasPrice.fromString( `50${faucet.minimalDenom}` )
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
export const json_content = "{\"message\": \"hello world\"}"
|
|
17
|
+
|
|
16
18
|
export const image_content = 'iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAAQMAAABmvDolAAAAA1BMVEW10NBjBBbqAAAAH0lEQVRoge3BAQ0AAADCoPdPbQ43oAAAAAAAAAAAvg0hAAABmmDh1QAAAABJRU5ErkJggg' as const
|
|
17
19
|
|
|
18
|
-
export const default_content = '<p>Test file content</p>'
|
|
20
|
+
export const default_content = '<p>Test file content</p>'
|
|
21
|
+
|
|
22
|
+
export function containsAll<T>(array: T[], values: T[]): boolean {
|
|
23
|
+
return values.every(value => array.includes(value))
|
|
24
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/* Basic Options */
|
|
6
6
|
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
-
"target": "
|
|
7
|
+
"target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
|
|
8
8
|
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
|
9
9
|
// "lib": [], /* Specify library files to be included in the compilation. */
|
|
10
10
|
// "allowJs": true, /* Allow javascript files to be compiled. */
|