Skip to content

Commit

Permalink
Revert "update cjs import"
Browse files Browse the repository at this point in the history
This reverts commit 27ff60e.
  • Loading branch information
coffeexcoin committed Sep 16, 2024
1 parent 27ff60e commit 83a57d5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/agw-react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@abstract-foundation/agw-react",
"description": "Abstract Global Wallet React Components",
"version": "0.0.1-alpha.3",
"version": "0.0.1-alpha.2",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
5 changes: 2 additions & 3 deletions packages/agw-react/src/agwProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use client'
import PrivyAuth from "@privy-io/react-auth";
const {
import {
PrivyProvider
} = PrivyAuth;
} from "@privy-io/react-auth";
import React from "react";
import {
type Chain,
Expand Down
13 changes: 7 additions & 6 deletions packages/agw-react/src/smartAccountContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import {
createAbstractClient,
} from '@abstract-foundation/agw-sdk';
import { toPrivyWalletProvider } from '@privy-io/cross-app-connect';
import PrivyAuth from '@privy-io/react-auth'
const {
import {
type SignTypedDataParams,
useCrossAppAccounts,
usePrivy,
} = PrivyAuth;
type User,
} from '@privy-io/react-auth';
import React, {
createContext,
useContext,
Expand Down Expand Up @@ -55,7 +56,7 @@ export const SmartAccountProvider = ({
const { user, ready, authenticated } = usePrivy();

const account = useMemo(() => {
const getAccountFromCrossAppUser = (user: PrivyAuth.User) => {
const getAccountFromCrossAppUser = (user: User) => {
const crossAppAccount = user.linkedAccounts.find(
(account) => account.type === 'cross_app',
);
Expand Down Expand Up @@ -109,7 +110,7 @@ export const SmartAccountProvider = ({
data,
) => {
sanitizeMessage(data.message);
return signTypedData(data as PrivyAuth.SignTypedDataParams, {
return signTypedData(data as SignTypedDataParams, {
address,
}) as Promise<`0x${string}`>;
};
Expand All @@ -124,7 +125,7 @@ export const SmartAccountProvider = ({

if (!ready) return;
if (!authenticated) return;
return getAccountFromCrossAppUser(user as PrivyAuth.User);
return getAccountFromCrossAppUser(user as User);
}, [ready, authenticated, user, signMessage, signTypedData]);

// States to store the smart account and its status
Expand Down
5 changes: 2 additions & 3 deletions packages/agw-react/src/useLoginWithAbstract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import PrivyAuth from '@privy-io/react-auth';
const { useCrossAppAccounts, usePrivy } = PrivyAuth;
import { useCrossAppAccounts, usePrivy, type User } from '@privy-io/react-auth';
import { useCallback } from 'react';

const AGW_APP_ID = 'cm04asygd041fmry9zmcyn5o5';
Expand All @@ -10,7 +9,7 @@ interface AbstractGlobalWalletInterface {
/** Boolean to indicate whether the user is authenticated */
authenticated: boolean;
/** Privy user object */
user: PrivyAuth.User | undefined;
user: User | undefined;
/** Function to login with the Abstract global wallet */
login: () => Promise<void>;
/** Function to logout of the abstract global wallet */
Expand Down

0 comments on commit 83a57d5

Please sign in to comment.