@waku/rln 0.1.5-76f86de.0 → 0.1.5-861a776.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/bundle/index.js +2 -0
- package/bundle/packages/rln/dist/contract/constants.js +1 -1
- package/bundle/packages/rln/dist/contract/rln_contract.js +8 -8
- package/bundle/packages/rln/dist/contract/rln_light_contract.js +477 -0
- package/bundle/packages/rln/dist/identity.js +9 -0
- package/bundle/packages/rln/dist/keystore/keystore.js +15 -25
- package/bundle/packages/rln/dist/rln.js +4 -4
- package/bundle/packages/rln/dist/rln_light.js +149 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/_assert.js +43 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/_sha2.js +116 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/hmac.js +79 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/sha256.js +126 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/utils.js +43 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/contract/constants.d.ts +1 -1
- package/dist/contract/constants.js +1 -1
- package/dist/contract/constants.js.map +1 -1
- package/dist/contract/rln_contract.js +8 -8
- package/dist/contract/rln_contract.js.map +1 -1
- package/dist/contract/rln_light_contract.d.ts +124 -0
- package/dist/contract/rln_light_contract.js +460 -0
- package/dist/contract/rln_light_contract.js.map +1 -0
- package/dist/contract/test-utils.js +1 -1
- package/dist/contract/test-utils.js.map +1 -1
- package/dist/identity.d.ts +1 -0
- package/dist/identity.js +9 -0
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/keystore/keystore.d.ts +0 -1
- package/dist/keystore/keystore.js +15 -25
- package/dist/keystore/keystore.js.map +1 -1
- package/dist/keystore/types.d.ts +1 -1
- package/dist/rln.js +4 -4
- package/dist/rln.js.map +1 -1
- package/dist/rln_light.d.ts +64 -0
- package/dist/rln_light.js +144 -0
- package/dist/rln_light.js.map +1 -0
- package/package.json +1 -1
- package/src/contract/constants.ts +1 -1
- package/src/contract/rln_contract.ts +8 -8
- package/src/contract/rln_light_contract.ts +725 -0
- package/src/contract/test-utils.ts +1 -1
- package/src/identity.ts +10 -0
- package/src/index.ts +4 -0
- package/src/keystore/keystore.ts +27 -43
- package/src/keystore/types.ts +1 -1
- package/src/rln.ts +4 -4
- package/src/rln_light.ts +235 -0
@@ -152,7 +152,7 @@ export class RLNContract {
|
|
152
152
|
*/
|
153
153
|
public async getMinRateLimit(): Promise<number> {
|
154
154
|
const minRate = await this.contract.minMembershipRateLimit();
|
155
|
-
return minRate.toNumber();
|
155
|
+
return ethers.BigNumber.from(minRate).toNumber();
|
156
156
|
}
|
157
157
|
|
158
158
|
/**
|
@@ -161,7 +161,7 @@ export class RLNContract {
|
|
161
161
|
*/
|
162
162
|
public async getMaxRateLimit(): Promise<number> {
|
163
163
|
const maxRate = await this.contract.maxMembershipRateLimit();
|
164
|
-
return maxRate.toNumber();
|
164
|
+
return ethers.BigNumber.from(maxRate).toNumber();
|
165
165
|
}
|
166
166
|
|
167
167
|
/**
|
@@ -470,14 +470,14 @@ export class RLNContract {
|
|
470
470
|
|
471
471
|
const network = await this.contract.provider.getNetwork();
|
472
472
|
const address = this.contract.address;
|
473
|
-
const membershipId =
|
473
|
+
const membershipId = decodedData.index.toString();
|
474
474
|
|
475
475
|
return {
|
476
476
|
identity,
|
477
477
|
membership: {
|
478
478
|
address,
|
479
|
-
treeIndex: membershipId,
|
480
|
-
chainId: network.chainId,
|
479
|
+
treeIndex: parseInt(membershipId),
|
480
|
+
chainId: network.chainId.toString(),
|
481
481
|
rateLimit: decodedData.membershipRateLimit.toNumber()
|
482
482
|
}
|
483
483
|
};
|
@@ -596,14 +596,14 @@ export class RLNContract {
|
|
596
596
|
|
597
597
|
const network = await this.contract.provider.getNetwork();
|
598
598
|
const address = this.contract.address;
|
599
|
-
const membershipId =
|
599
|
+
const membershipId = decodedData.index.toString();
|
600
600
|
|
601
601
|
return {
|
602
602
|
identity,
|
603
603
|
membership: {
|
604
604
|
address,
|
605
|
-
treeIndex: membershipId,
|
606
|
-
chainId: network.chainId,
|
605
|
+
treeIndex: parseInt(membershipId),
|
606
|
+
chainId: network.chainId.toString(),
|
607
607
|
rateLimit: decodedData.membershipRateLimit.toNumber()
|
608
608
|
}
|
609
609
|
};
|