@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.
Files changed (47) hide show
  1. package/.github/workflows/test.yml +2 -2
  2. package/CHANGELOG.md +14 -0
  3. package/README.md +1 -1
  4. package/build/index.d.ts +7 -3
  5. package/build/index.d.ts.map +1 -1
  6. package/build/index.js +19 -7
  7. package/build/index.js.map +1 -1
  8. package/build/modules/_.d.ts +7 -11
  9. package/build/modules/_.d.ts.map +1 -1
  10. package/build/modules/_.js +15 -17
  11. package/build/modules/_.js.map +1 -1
  12. package/build/modules/did.d.ts +39 -15
  13. package/build/modules/did.d.ts.map +1 -1
  14. package/build/modules/did.js +187 -54
  15. package/build/modules/did.js.map +1 -1
  16. package/build/modules/resource.d.ts +23 -7
  17. package/build/modules/resource.d.ts.map +1 -1
  18. package/build/modules/resource.js +61 -18
  19. package/build/modules/resource.js.map +1 -1
  20. package/build/querier.d.ts +11 -0
  21. package/build/querier.d.ts.map +1 -0
  22. package/build/querier.js +31 -0
  23. package/build/querier.js.map +1 -0
  24. package/build/signer.d.ts +3 -5
  25. package/build/signer.d.ts.map +1 -1
  26. package/build/signer.js +13 -13
  27. package/build/signer.js.map +1 -1
  28. package/build/types.d.ts +12 -0
  29. package/build/types.d.ts.map +1 -1
  30. package/build/types.js.map +1 -1
  31. package/build/utils.js +13 -15
  32. package/build/utils.js.map +1 -1
  33. package/package.json +2 -2
  34. package/src/index.ts +22 -10
  35. package/src/modules/_.ts +13 -21
  36. package/src/modules/did.ts +207 -51
  37. package/src/modules/resource.ts +74 -12
  38. package/src/querier.ts +33 -0
  39. package/src/signer.ts +3 -6
  40. package/src/types.ts +17 -1
  41. package/src/utils.ts +1 -1
  42. package/tests/index.test.ts +43 -3
  43. package/tests/modules/did.test.ts +483 -50
  44. package/tests/modules/resource.test.ts +576 -30
  45. package/tests/signer.test.ts +2 -2
  46. package/tests/testutils.test.ts +8 -2
  47. package/tsconfig.json +1 -1
@@ -133,7 +133,7 @@ describe('CheqdSigningStargateClient', () => {
133
133
  })
134
134
  })
135
135
 
136
- describe('signCreateDidTx', () => {
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.signCreateDidTx(signInputs, payload)
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
 
@@ -9,10 +9,16 @@ export const faucet = {
9
9
 
10
10
  export const localnet = {
11
11
  network: 'testnet',
12
- rpcUrl: 'http://localhost:26657',
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": "es2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
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. */