Skip to content

Commit

Permalink
feat: add portal to aa-signers
Browse files Browse the repository at this point in the history
  • Loading branch information
avasisht23 committed Dec 4, 2023
1 parent 9c12c73 commit 33bc19c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/signers/src/portal/__tests__/signer.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { type RequestArguments } from "@fireblocks/fireblocks-web3-provider";
import Portal from "@portal-hq/web";
import { sepolia } from "viem/chains";
import { PortalSigner } from "../signer.js";

// taken from Portal SDK since not exported
interface RequestArguments {
method: string;
params?: unknown[];
}

describe("Portal Signer Tests", () => {
it("should correctly get address", async () => {
const signer = await givenSigner();
Expand Down Expand Up @@ -100,7 +105,7 @@ const givenSigner = async (auth = true) => {
signingStatus: null,
});

inner.provider.request = vi.fn(async <T, R>(args: RequestArguments<T>) => {
inner.provider.request = vi.fn(async <R>(args: RequestArguments) => {
switch (args.method) {
case "eth_accounts":
return Promise.resolve([
Expand Down
1 change: 1 addition & 0 deletions packages/signers/src/portal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Address } from "viem";

export interface PortalAuthenticationParams {}

// taken from Portal SDK since not exported
export type PortalUserInfo = {
id: string;
address: Address;
Expand Down

0 comments on commit 33bc19c

Please sign in to comment.