UNPKG

@abstract-foundation/agw-react

Version:
23 lines 889 B
import { createSession as client_createSession, } from "@abstract-foundation/agw-client/actions"; import { getConnectorClient } from "@wagmi/core"; import { getAction } from "viem/utils"; export async function createSession(config, parameters) { const { account, chainId, connector, ...rest } = parameters; let client; if (typeof account === "object" && account?.type === "local") client = config.getClient({ chainId }); else client = await getConnectorClient(config, { account: account ?? undefined, chainId, connector, }); const action = getAction(client, client_createSession, "createSession"); const result = await action({ ...rest, ...(account ? { account } : {}), chain: chainId ? { id: chainId } : null, }); return result; } //# sourceMappingURL=createSession.js.map