Skip to content

Commit

Permalink
update multipass class to use chain ID as a number
Browse files Browse the repository at this point in the history
  • Loading branch information
theKosmoss committed Dec 9, 2024
1 parent 7c1388e commit fe8b2b4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/multipass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
isAddress,
SignTypedDataParameters,
TypedDataDomain,
Chain,
} from "viem";
import { getArtifact, type SupportedChains } from "./utils";
import multipassAbi from "@peeramid-labs/multipass/abi/src/Multipass.sol/Multipass";
Expand All @@ -23,24 +24,24 @@ export type NameQuery = {
};

export default class Multipass {
private chainId: string;
private chainId: number;
private name: string;
private version: string;
private publicClient: PublicClient;
private walletClient: WalletClient;
private instanceAddress: Address;

constructor({
chainName,
chain,
publicClient,
walletClient,
}: {
chainName: SupportedChains;
chain: Chain;
publicClient: PublicClient;
walletClient: WalletClient;
}) {
const artifact = getArtifact(chainName, "Multipass");
this.chainId = chainName;
const artifact = getArtifact(chain.name as SupportedChains, "Multipass");
this.chainId = chain.id;
this.name = artifact.execute.args[0];
this.version = artifact.execute.args[1];
this.instanceAddress = artifact.address;
Expand Down Expand Up @@ -68,7 +69,7 @@ export default class Multipass {
const domain: TypedDataDomain = {
name: this.name,
version: this.version,
chainId: BigInt(this.chainId),
chainId: this.chainId,
verifyingContract: verifierAddress,
};

Expand Down

0 comments on commit fe8b2b4

Please sign in to comment.