add registerMemberFromMembershipKey

This commit is contained in:
weboko 2023-04-17 21:17:08 +02:00
parent fae4bea48d
commit a93be8e797
No known key found for this signature in database

View File

@ -1,7 +1,7 @@
import { ethers } from "ethers";
import { RLN_ABI } from "./constants.js";
import { RLNInstance } from "./rln.js";
import { MembershipKey, RLNInstance } from "./rln.js";
type Member = {
pubkey: string;
@ -91,6 +91,13 @@ export class RLNContract {
const membershipKey = await rlnInstance.generateSeededMembershipKey(
signature
);
return this.registerMemberFromMembershipKey(membershipKey);
}
public async registerMemberFromMembershipKey(
membershipKey: MembershipKey
): Promise<ethers.Event | undefined> {
const depositValue = await this.contract.MEMBERSHIP_DEPOSIT();
const txRegisterResponse: ethers.ContractTransaction =