@0xpolygonid/js-sdk 1.9.4 → 1.10.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/README.md CHANGED
@@ -14,7 +14,13 @@ Installation:
14
14
  npm install @0xpolygonid/js-sdk
15
15
  ```
16
16
 
17
- See [tests](/tests) for examples on how to use SDK.
17
+ ## Circuits
18
+
19
+ And place actual circuits to `test/proofs/testdata`
20
+
21
+ ```bash
22
+ curl -LO https://iden3-circuits-bucket.s3.eu-west-1.amazonaws.com/latest.zip
23
+ ```
18
24
 
19
25
  ## Tests
20
26
 
@@ -35,10 +41,11 @@ export RHS_URL="..reverse hash service url"
35
41
  export IPFS_URL="url for ipfs"
36
42
  export STATE_CONTRACT_ADDRESS="state contract address"
37
43
  export RHS_CONTRACT_ADDRESS="reverse hash service contract address"
38
-
39
44
  ```
40
45
 
41
- And place actual circuits to `test/proofs/testdata`
46
+ ## Examples
47
+
48
+ Please see [examples](https://github.com/0xPolygonID/js-sdk-examples) for visit examples information.
42
49
 
43
50
  ## Documentation
44
51
 
@@ -5,7 +5,7 @@ import { Path, Merklizer, getDocumentLoader } from '@iden3/js-jsonld-merklizatio
5
5
  import * as jsJsonldMerklization from '@iden3/js-jsonld-merklization';
6
6
  export { jsJsonldMerklization as jsonLDMerklizer };
7
7
  import { PrivateKey, Hex, base58ToBytes as base58ToBytes$2, base58FromBytes, Signature as Signature$5, PublicKey, poseidon, sha256 as sha256$3, getRandomBytes, Poseidon } from '@iden3/js-crypto';
8
- import { Hash as Hash$2, Proof, verifyProof, rootFromProof, ZERO_HASH, swapEndianness as swapEndianness$1, newHashFromString, Merkletree, InMemoryDB, str2Bytes, LocalStorageDB, IndexedDBStorage, testBit, NodeLeaf, NODE_TYPE_LEAF, hashElems } from '@iden3/js-merkletree';
8
+ import { Hash as Hash$2, Proof, verifyProof, rootFromProof, ZERO_HASH, swapEndianness as swapEndianness$1, Merkletree, InMemoryDB, str2Bytes, LocalStorageDB, IndexedDBStorage, testBit, NodeLeaf, NODE_TYPE_LEAF, hashElems } from '@iden3/js-merkletree';
9
9
  import { groth16 } from 'snarkjs';
10
10
  import { getCurveFromName } from 'ffjavascript';
11
11
  import { Token, Header, ProvingMethodAlg, proving } from '@iden3/js-jwz';
@@ -59183,7 +59183,7 @@ class AtomicQuerySigV2OnChainPubSignals extends BaseConfig {
59183
59183
  this.circuitQueryHash = BigInt(sVals[fieldIdx]);
59184
59184
  fieldIdx++;
59185
59185
  // - issuerAuthState
59186
- this.issuerAuthState = newHashFromString(sVals[fieldIdx]);
59186
+ this.issuerAuthState = Hash$2.fromString(sVals[fieldIdx]);
59187
59187
  fieldIdx++;
59188
59188
  // - requestID
59189
59189
  this.requestID = BigInt(sVals[fieldIdx]);
@@ -59192,7 +59192,7 @@ class AtomicQuerySigV2OnChainPubSignals extends BaseConfig {
59192
59192
  this.challenge = BigInt(sVals[fieldIdx]);
59193
59193
  fieldIdx++;
59194
59194
  // - gistRoot
59195
- this.gistRoot = newHashFromString(sVals[fieldIdx]);
59195
+ this.gistRoot = Hash$2.fromString(sVals[fieldIdx]);
59196
59196
  fieldIdx++;
59197
59197
  // - issuerID
59198
59198
  this.issuerID = Id.fromBigInt(BigInt(sVals[fieldIdx]));
@@ -59201,7 +59201,7 @@ class AtomicQuerySigV2OnChainPubSignals extends BaseConfig {
59201
59201
  this.isRevocationChecked = parseInt(sVals[fieldIdx]);
59202
59202
  fieldIdx++;
59203
59203
  // - issuerClaimNonRevState
59204
- this.issuerClaimNonRevState = newHashFromString(sVals[fieldIdx]);
59204
+ this.issuerClaimNonRevState = Hash$2.fromString(sVals[fieldIdx]);
59205
59205
  fieldIdx++;
59206
59206
  // - timestamp
59207
59207
  this.timestamp = parseInt(sVals[fieldIdx]);
@@ -59373,8 +59373,8 @@ class StateTransitionPubSignals {
59373
59373
  throw new Error(`invalid number of Output values expected ${fieldLength} got ${sVals.length}`);
59374
59374
  }
59375
59375
  this.userId = Id.fromBigInt(BigInt(sVals[0]));
59376
- this.oldUserState = newHashFromString(sVals[1]);
59377
- this.newUserState = newHashFromString(sVals[2]);
59376
+ this.oldUserState = Hash$2.fromString(sVals[1]);
59377
+ this.newUserState = Hash$2.fromString(sVals[2]);
59378
59378
  this.isOldStateGenesis = BigInt(sVals[3]) === BigInt(1);
59379
59379
  return this;
59380
59380
  }
@@ -63474,7 +63474,7 @@ class IdentityWallet {
63474
63474
  const tmpIdentifier = opts.seed ? v5(Hex.encode(sha256$3(opts.seed)), nil) : v4();
63475
63475
  opts.method = opts.method ?? DidMethod.Iden3;
63476
63476
  opts.blockchain = opts.blockchain ?? Blockchain.Polygon;
63477
- opts.networkId = opts.networkId ?? NetworkId.Mumbai;
63477
+ opts.networkId = opts.networkId ?? NetworkId.Amoy;
63478
63478
  await this._storage.mt.createIdentityMerkleTrees(tmpIdentifier);
63479
63479
  opts.seed = opts.seed ?? getRandomBytes(32);
63480
63480
  const keyId = await this._kms.createKeyFromSeed(KmsKeyType.BabyJubJub, opts.seed);