@renown/sdk 6.2.2-dev.26 → 6.2.2-dev.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","names":[],"sources":["../../../src/wallet/privy/adapter.ts","../../../src/wallet/privy/bridge.tsx","../../../src/wallet/privy/provider.tsx","../../../src/wallet/privy/factory.ts"],"mappings":";;;;;;;KASK,GAAA;AAAA,KAcA,oBAAA;AAAA,UAaY,aAAA;EACf,cAAA,GAAiB,OAAA,GAAU,iBAAA;EAC3B,SAAA,GAAY,OAAA;IAAW,QAAA,EAAU,oBAAA;EAAA,MAA2B,OAAA;EAC5D,MAAA,QAAc,OAAA;EACd,aAAA,GACE,IAAA,EAAM,UAAA,CAAW,uBAAA,MACjB,OAAA,EAAS,GAAA,KACN,OAAA,CAAQ,GAAA;AAAA;AAAA,cAUF,SAAA;EAAA,SACF,gBAAA,EAAkB,WAAA;EAAA,QAEnB,QAAA;EAAA,QACA,OAAA;EAAA,QACA,OAAA;EAAA,QACA,SAAA;cAEI,gBAAA,EAAkB,WAAA;EAI9B,IAAA,CAAK,QAAA,EAAU,aAAA;EAOf,UAAA,CAAA,GAAc,aAAA;EAMd,SAAA,CACE,QAAA,GAAW,OAAA,EAAS,aAAA;EAAA,QASd,IAAA;EAMR,sBAAA,CAAuB,MAAA,EAAQ,eAAA;EA8B/B,YAAA,CAAA;EAOA,gBAAA,CAAiB,KAAA;EAOX,OAAA,CAAQ,MAAA,GAAS,WAAA,GAAc,OAAA,CAAQ,aAAA;EAyCvC,UAAA,CAAA,GAAc,OAAA;AAAA;;;UCrKZ,uBAAA;EACR,IAAA,EAAM,SAAA;AAAA;AAAA,iBAKQ,kBAAA,CAAA;EAAqB;AAAA,GAAQ,uBAAA;;;UCbnC,mBAAA;EACR,KAAA;EACA,QAAA;AAAA;AAAA,iBAKc,mBAAA,CACd,IAAA,EAAM,SAAA,EACN,MAAA,EAAQ,mBAAA,GACP,aAAA;EAAgB,QAAA,EAAU,SAAA;EAAW,KAAA,GAAQ,WAAA;AAAA;;;iBCHhC,kBAAA,CACd,MAAA,EAAQ,0BAAA,GACP,iBAAA"}
1
+ {"version":3,"file":"factory.d.ts","names":[],"sources":["../../../src/wallet/privy/adapter.ts","../../../src/wallet/privy/bridge.tsx","../../../src/wallet/privy/provider.tsx","../../../src/wallet/privy/factory.ts"],"mappings":";;;;;;;KASK,GAAA;AAAA,KAcA,oBAAA;AAAA,UAaY,aAAA;EACf,cAAA,GAAiB,OAAA,GAAU,iBAAA;EAC3B,SAAA,GAAY,OAAA;IAAW,QAAA,EAAU,oBAAA;EAAA,MAA2B,OAAA;EAC5D,MAAA,QAAc,OAAA;EACd,aAAA,GACE,IAAA,EAAM,UAAA,CAAW,uBAAA,MACjB,OAAA,EAAS,GAAA,KACN,OAAA,CAAQ,GAAA;AAAA;AAAA,cAUF,SAAA;EAAA,SACF,gBAAA,EAAkB,WAAA;EAAA,QAEnB,QAAA;EAAA,QACA,OAAA;EAAA,QACA,OAAA;EAAA,QACA,SAAA;cAEI,gBAAA,EAAkB,WAAA;EAI9B,IAAA,CAAK,QAAA,EAAU,aAAA;EAOf,UAAA,CAAA,GAAc,aAAA;EAMd,SAAA,CACE,QAAA,GAAW,OAAA,EAAS,aAAA;EAAA,QASd,IAAA;EAMR,sBAAA,CAAuB,MAAA,EAAQ,eAAA;EA8B/B,YAAA,CAAA;EAOA,gBAAA,CAAiB,KAAA;EAOX,OAAA,CAAQ,MAAA,GAAS,WAAA,GAAc,OAAA,CAAQ,aAAA;EAyCvC,UAAA,CAAA,GAAc,OAAA;AAAA;;;UCpJZ,uBAAA;EACR,IAAA,EAAM,SAAA;AAAA;AAAA,iBAKQ,kBAAA,CAAA;EAAqB;AAAA,GAAQ,uBAAA;;;UC9BnC,mBAAA;EACR,KAAA;EACA,QAAA;AAAA;AAAA,iBAKc,mBAAA,CACd,IAAA,EAAM,SAAA,EACN,MAAA,EAAQ,mBAAA,GACP,aAAA;EAAgB,QAAA,EAAU,SAAA;EAAW,KAAA,GAAQ,WAAA;AAAA;;;iBCHhC,kBAAA,CACd,MAAA,EAAQ,0BAAA,GACP,iBAAA"}
@@ -3,7 +3,7 @@ import { n as normalizeWalletTheme, t as LoginMethod } from "../../types-C_qc_62
3
3
  import { r as resolvePrivyMethods } from "../../meta-D-5kvwx8.js";
4
4
  import { useEffect, useMemo, useRef } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
- import { PrivyProvider, getEmbeddedConnectedWallet, useLogin, useLoginWithOAuth, useLogout, usePrivy, useSignTypedData, useWallets } from "@privy-io/react-auth";
6
+ import { PrivyProvider, getEmbeddedConnectedWallet, useCreateWallet, useLogin, useLoginWithOAuth, useLogout, usePrivy, useSignTypedData, useWallets } from "@privy-io/react-auth";
7
7
  //#region src/wallet/privy/adapter.ts
8
8
  const PRIVY_METHOD_MAP = {
9
9
  [LoginMethod.WALLET]: "wallet",
@@ -112,32 +112,44 @@ function parseCaip2ChainId(caip2) {
112
112
  }
113
113
  //#endregion
114
114
  //#region src/wallet/privy/bridge.tsx
115
+ const EMBEDDED_WALLET_ALREADY_EXISTS = "embedded_wallet_already_exists";
116
+ function isAlreadyExistsError(error) {
117
+ if (error === EMBEDDED_WALLET_ALREADY_EXISTS) return true;
118
+ return typeof error === "object" && error !== null && error.privyErrorCode === EMBEDDED_WALLET_ALREADY_EXISTS;
119
+ }
115
120
  function PrivyAdapterBridge({ core }) {
116
121
  const { ready, authenticated } = usePrivy();
117
122
  const { wallets } = useWallets();
118
123
  const { signTypedData } = useSignTypedData();
119
124
  const { logout } = useLogout();
125
+ const { createWallet } = useCreateWallet({ onError: (error) => {
126
+ if (!isAlreadyExistsError(error)) core.handleLoginError(error);
127
+ } });
120
128
  const { login: openLoginModal } = useLogin({ onError: (error) => core.handleLoginError(error) });
121
129
  const { initOAuth } = useLoginWithOAuth({ onError: (error) => core.handleLoginError(error) });
122
130
  const fnsRef = useRef({
123
131
  openLoginModal,
124
132
  initOAuth,
125
133
  logout,
126
- signTypedData
134
+ signTypedData,
135
+ createWallet
127
136
  });
128
137
  useEffect(() => {
129
138
  fnsRef.current = {
130
139
  openLoginModal,
131
140
  initOAuth,
132
141
  logout,
133
- signTypedData
142
+ signTypedData,
143
+ createWallet
134
144
  };
135
145
  }, [
136
146
  openLoginModal,
137
147
  initOAuth,
138
148
  logout,
139
- signTypedData
149
+ signTypedData,
150
+ createWallet
140
151
  ]);
152
+ const creatingWalletRef = useRef(false);
141
153
  useEffect(() => {
142
154
  return core.bind({
143
155
  openLoginModal: (opts) => fnsRef.current.openLoginModal(opts),
@@ -155,10 +167,17 @@ function PrivyAdapterBridge({ core }) {
155
167
  if (!ready) return;
156
168
  if (!authenticated) {
157
169
  core.clearSession();
170
+ creatingWalletRef.current = false;
158
171
  return;
159
172
  }
160
173
  const embedded = getEmbeddedConnectedWallet(wallets);
161
- if (embedded) core.syncFromEmbeddedWallet(embedded);
174
+ if (embedded) {
175
+ core.syncFromEmbeddedWallet(embedded);
176
+ return;
177
+ }
178
+ if (creatingWalletRef.current) return;
179
+ creatingWalletRef.current = true;
180
+ fnsRef.current.createWallet().catch(() => void 0);
162
181
  }, [
163
182
  core,
164
183
  ready,
@@ -1 +1 @@
1
- {"version":3,"file":"factory.js","names":[],"sources":["../../../src/wallet/privy/adapter.ts","../../../src/wallet/privy/bridge.tsx","../../../src/wallet/privy/theme.ts","../../../src/wallet/privy/provider.tsx","../../../src/wallet/privy/factory.ts"],"sourcesContent":["import type {\n ConnectedWallet,\n LoginModalOptions,\n SignTypedDataParams,\n} from \"@privy-io/react-auth\";\nimport type { SignCredentialTypedData } from \"../../credential.js\";\nimport { LoginMethod, type WalletSession } from \"../types.js\";\nimport type { PrivyLoginMethod } from \"./meta.js\";\n\ntype Hex = `0x${string}`;\ntype PrivyLoginMethodId = NonNullable<\n LoginModalOptions[\"loginMethods\"]\n>[number];\n\n// Exhaustive over PrivyLoginMethod, so widening that union without adding the\n// Privy id here is a compile error.\nconst PRIVY_METHOD_MAP: Record<PrivyLoginMethod, PrivyLoginMethodId> = {\n [LoginMethod.WALLET]: \"wallet\",\n [LoginMethod.GOOGLE]: \"google\",\n [LoginMethod.APPLE]: \"apple\",\n [LoginMethod.EMAIL]: \"email\",\n};\n\ntype PrivyOAuthProviderId = \"google\" | \"apple\";\n\n// Methods Privy can start headlessly with initOAuth. Opening the modal for these\n// would only render a single button for a provider the caller already picked.\nconst PRIVY_OAUTH_PROVIDERS: Partial<\n Record<LoginMethod, PrivyOAuthProviderId>\n> = {\n [LoginMethod.GOOGLE]: \"google\",\n [LoginMethod.APPLE]: \"apple\",\n};\n\n// Privy React functions captured by <PrivyAdapterBridge> via bind(). Until bind\n// runs, connect/disconnect calls throw.\nexport interface PrivyBindings {\n openLoginModal: (options?: LoginModalOptions) => void;\n initOAuth: (options: { provider: PrivyOAuthProviderId }) => Promise<void>;\n logout: () => Promise<void>;\n signTypedData: (\n args: Parameters<SignCredentialTypedData>[0],\n address: Hex,\n ) => Promise<Hex>;\n}\n\ninterface PendingLogin {\n resolve(session: WalletSession): void;\n reject(error: Error): void;\n}\n\n// Framework-agnostic core the bridge drives. Holds the session and pending\n// login promise so the class can operate Privy without owning React state.\nexport class PrivyCore {\n readonly supportedMethods: LoginMethod[];\n\n private bindings: PrivyBindings | null = null;\n private pending: PendingLogin | null = null;\n private session: WalletSession | undefined = undefined;\n private listeners = new Set<(session: WalletSession | undefined) => void>();\n\n constructor(supportedMethods: LoginMethod[]) {\n this.supportedMethods = supportedMethods;\n }\n\n bind(bindings: PrivyBindings): () => void {\n this.bindings = bindings;\n return () => {\n if (this.bindings === bindings) this.bindings = null;\n };\n }\n\n getSession(): WalletSession | undefined {\n return this.session;\n }\n\n // Push session changes to subscribers, replaying the current one on subscribe.\n // Lets the host complete sign-in when a session arrives with no pending connect().\n subscribe(\n listener: (session: WalletSession | undefined) => void,\n ): () => void {\n this.listeners.add(listener);\n if (this.session) listener(this.session);\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n private emit(session: WalletSession | undefined): void {\n for (const listener of this.listeners) listener(session);\n }\n\n // Called by the bridge when the embedded wallet is available. Builds the\n // session and resolves any pending login promise.\n syncFromEmbeddedWallet(wallet: ConnectedWallet): void {\n const address = wallet.address as Hex;\n const chainId = parseCaip2ChainId(wallet.chainId);\n\n const signTypedData: SignCredentialTypedData = async (args) => {\n if (!this.bindings) {\n throw new Error(\"PrivyAdapter not bound (bridge not mounted)\");\n }\n return this.bindings.signTypedData(args, address);\n };\n\n // Privy's embedded wallet signs without a prompt, so a host may auto-complete\n // sign-in with this session after a full-page OAuth redirect return.\n const session: WalletSession = {\n address,\n chainId,\n signTypedData,\n canSignSilently: true,\n };\n this.session = session;\n // A live connect() (in-page popup flow) consumes the session via its promise;\n // otherwise the promise died with the pre-redirect page, so emit to subscribers.\n if (this.pending) {\n this.pending.resolve(session);\n this.pending = null;\n } else {\n this.emit(session);\n }\n }\n\n clearSession(): void {\n this.session = undefined;\n this.emit(undefined);\n }\n\n // Called by the bridge on Privy's onError. String codes like `exited_auth_flow`\n // mean the user dismissed the modal.\n handleLoginError(error: unknown): void {\n if (!this.pending) return;\n const err = error instanceof Error ? error : new Error(String(error));\n this.pending.reject(err);\n this.pending = null;\n }\n\n async connect(method?: LoginMethod): Promise<WalletSession> {\n if (this.session) return this.session;\n if (!this.bindings) {\n throw new Error(\n \"PrivyAdapter not bound. Ensure the adapter Provider wraps the app.\",\n );\n }\n\n const chosen = method ?? this.supportedMethods.at(0);\n if (!chosen) {\n throw new Error(\"PrivyAdapter has no supported login methods configured\");\n }\n // PRIVY_METHOD_MAP is total over the methods Privy can drive, so only the\n // configured subset needs checking here.\n if (!this.supportedMethods.includes(chosen)) {\n throw new Error(`PrivyAdapter does not support login method \"${chosen}\"`);\n }\n const privyMethod = PRIVY_METHOD_MAP[chosen];\n\n const bindings = this.bindings;\n const oauthProvider = PRIVY_OAUTH_PROVIDERS[chosen];\n return new Promise<WalletSession>((resolve, reject) => {\n this.pending = { resolve, reject };\n const fail = (error: unknown) => {\n this.pending = null;\n reject(error instanceof Error ? error : new Error(String(error)));\n };\n try {\n // initOAuth navigates away, so this promise stays pending until the page\n // unloads; syncFromEmbeddedWallet emits the session on the redirect back.\n if (oauthProvider) {\n bindings.initOAuth({ provider: oauthProvider }).catch(fail);\n } else {\n bindings.openLoginModal({ loginMethods: [privyMethod] });\n }\n } catch (error) {\n fail(error);\n }\n });\n }\n\n async disconnect(): Promise<void> {\n this.clearSession();\n if (!this.bindings) return;\n await this.bindings.logout();\n }\n}\n\nfunction parseCaip2ChainId(caip2: string): number {\n const last = caip2.split(\":\").at(-1);\n const n = Number(last);\n if (!Number.isFinite(n)) {\n throw new Error(\n `PrivyAdapter: could not parse chainId from CAIP-2 \"${caip2}\"`,\n );\n }\n return n;\n}\n\nexport type { SignTypedDataParams };\n","import { useEffect, useRef } from \"react\";\nimport {\n getEmbeddedConnectedWallet,\n useLogin,\n useLoginWithOAuth,\n useLogout,\n usePrivy,\n useSignTypedData,\n useWallets,\n} from \"@privy-io/react-auth\";\nimport type { PrivyCore, SignTypedDataParams } from \"./adapter.js\";\n\ntype Hex = `0x${string}`;\n\ninterface PrivyAdapterBridgeProps {\n core: PrivyCore;\n}\n\n// Captures the React-only Privy hooks and wires them into PrivyCore so the\n// class can drive Privy without owning React state. Mounted inside PrivyProvider.\nexport function PrivyAdapterBridge({ core }: PrivyAdapterBridgeProps) {\n const { ready, authenticated } = usePrivy();\n const { wallets } = useWallets();\n const { signTypedData } = useSignTypedData();\n const { logout } = useLogout();\n const { login: openLoginModal } = useLogin({\n onError: (error) => core.handleLoginError(error),\n });\n // Also mounts this hook on the page Privy redirects back to, which is what\n // lets it finish the OAuth flow there.\n const { initOAuth } = useLoginWithOAuth({\n onError: (error) => core.handleLoginError(error),\n });\n\n // Privy returns fresh function references each render. A ref keeps the bind\n // stable so we bind once per core instead of re-binding every render.\n const fnsRef = useRef({ openLoginModal, initOAuth, logout, signTypedData });\n useEffect(() => {\n fnsRef.current = { openLoginModal, initOAuth, logout, signTypedData };\n }, [openLoginModal, initOAuth, logout, signTypedData]);\n\n useEffect(() => {\n return core.bind({\n openLoginModal: (opts) => fnsRef.current.openLoginModal(opts),\n initOAuth: (opts) => fnsRef.current.initOAuth(opts),\n logout: () => fnsRef.current.logout(),\n // Privy owns the embedded wallet keys, so showWalletUIs:false signs the\n // credential typed-data silently as part of login.\n signTypedData: async (args, address) => {\n const result = await fnsRef.current.signTypedData(\n args as unknown as SignTypedDataParams,\n { address, uiOptions: { showWalletUIs: false } },\n );\n return result.signature as Hex;\n },\n });\n }, [core]);\n\n useEffect(() => {\n if (!ready) return;\n if (!authenticated) {\n core.clearSession();\n return;\n }\n const embedded = getEmbeddedConnectedWallet(wallets);\n if (embedded) core.syncFromEmbeddedWallet(embedded);\n }, [core, ready, authenticated, wallets]);\n\n return null;\n}\n","const HEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;\nconst RGB = /^rgba?\\(\\s*(-?[\\d.]+)[\\s,]+(-?[\\d.]+)[\\s,]+(-?[\\d.]+)/i;\n\nfunction channel(value: string): string {\n const byte = Math.round(Number(value));\n return Math.min(255, Math.max(0, byte)).toString(16).padStart(2, \"0\");\n}\n\n/** Convert a host theme accent color to the hex Privy's `appearance` requires, or `undefined` if it is not expressible. Hosts resolve CSS tokens through `getComputedStyle`, which yields `rgb(...)`, so plain pass-through would be rejected. Alpha is dropped: Privy derives its own variants. */\nexport function toPrivyAccentColor(\n color: string | undefined,\n): `#${string}` | undefined {\n if (!color) return undefined;\n const value = color.trim();\n if (HEX.test(value)) return value as `#${string}`;\n const rgb = RGB.exec(value);\n if (!rgb) return undefined;\n return `#${channel(rgb[1])}${channel(rgb[2])}${channel(rgb[3])}`;\n}\n","import { useMemo, type ComponentType, type ReactNode } from \"react\";\nimport { PrivyProvider, type PrivyClientConfig } from \"@privy-io/react-auth\";\nimport { normalizeWalletTheme, type WalletTheme } from \"../types.js\";\nimport type { PrivyCore } from \"./adapter.js\";\nimport { PrivyAdapterBridge } from \"./bridge.js\";\nimport { toPrivyAccentColor } from \"./theme.js\";\n\ninterface PrivyProviderConfig {\n appId: string;\n clientId?: string;\n}\n\n// Build the adapter Provider bound to a specific core + config. Mounts\n// PrivyProvider with embedded wallets + showWalletUIs:false for silent signing.\nexport function createPrivyProvider(\n core: PrivyCore,\n config: PrivyProviderConfig,\n): ComponentType<{ children: ReactNode; theme?: WalletTheme }> {\n return function PrivyAuthProvider({\n children,\n theme,\n }: {\n children: ReactNode;\n theme?: WalletTheme;\n }) {\n const { mode, accentColor } = normalizeWalletTheme(theme);\n const accent = toPrivyAccentColor(accentColor);\n // Memoize so a new config object per render doesn't rebuild PrivyProvider's\n // context and cascade re-renders into descendants.\n const privyConfig = useMemo<PrivyClientConfig>(\n () => ({\n // Privy generates its own light/dark variants from the accent.\n appearance: { theme: mode, ...(accent ? { accentColor: accent } : {}) },\n embeddedWallets: {\n ethereum: { createOnLogin: \"users-without-wallets\" as const },\n showWalletUIs: false,\n },\n // Social/email adapter only (external wallets go through the rainbow\n // adapter), so don't init WalletConnect / fetch its registry on mount.\n externalWallets: {\n disableAllExternalWallets: true,\n walletConnect: { enabled: false },\n },\n }),\n [mode, accent],\n );\n\n return (\n <PrivyProvider\n appId={config.appId}\n clientId={config.clientId}\n config={privyConfig}\n >\n <PrivyAdapterBridge core={core} />\n {children}\n </PrivyProvider>\n );\n };\n}\n","// Renders React (PrivyProvider + hooks), so RSC hosts must treat this as a\n// client module even though the descriptor entry reaches it lazily.\n\"use client\";\n\nimport type { WalletAdapterImpl, WalletController } from \"../types.js\";\nimport { PrivyCore } from \"./adapter.js\";\nimport {\n resolvePrivyMethods,\n type PHRenownPrivyAdapterConfig,\n} from \"./meta.js\";\nimport { createPrivyProvider } from \"./provider.js\";\n\n// Build the Privy adapter. Provider mounts PrivyProvider + a bridge;\n// useController exposes imperative connect/disconnect over the shared core.\nexport function createPrivyAdapter(\n config: PHRenownPrivyAdapterConfig,\n): WalletAdapterImpl {\n const core = new PrivyCore(resolvePrivyMethods(config.methods));\n const Provider = createPrivyProvider(core, {\n appId: config.appId,\n clientId: config.clientId,\n });\n\n function useController(): WalletController {\n return {\n connect: (method) => core.connect(method),\n disconnect: () => core.disconnect(),\n getSession: () => core.getSession(),\n subscribe: (listener) => core.subscribe(listener),\n };\n }\n\n return { Provider, useController };\n}\n\nexport { PrivyCore } from \"./adapter.js\";\nexport type { PrivyBindings } from \"./adapter.js\";\nexport { PrivyAdapterBridge } from \"./bridge.js\";\nexport { createPrivyProvider } from \"./provider.js\";\n"],"mappings":";;;;;;;AAgBA,MAAM,mBAAiE;EACpE,YAAY,SAAS;EACrB,YAAY,SAAS;EACrB,YAAY,QAAQ;EACpB,YAAY,QAAQ;CACtB;AAMD,MAAM,wBAEF;EACD,YAAY,SAAS;EACrB,YAAY,QAAQ;CACtB;AAqBD,IAAa,YAAb,MAAuB;CACrB;CAEA,WAAyC;CACzC,UAAuC;CACvC,UAA6C,KAAA;CAC7C,4BAAoB,IAAI,KAAmD;CAE3E,YAAY,kBAAiC;AAC3C,OAAK,mBAAmB;;CAG1B,KAAK,UAAqC;AACxC,OAAK,WAAW;AAChB,eAAa;AACX,OAAI,KAAK,aAAa,SAAU,MAAK,WAAW;;;CAIpD,aAAwC;AACtC,SAAO,KAAK;;CAKd,UACE,UACY;AACZ,OAAK,UAAU,IAAI,SAAS;AAC5B,MAAI,KAAK,QAAS,UAAS,KAAK,QAAQ;AACxC,eAAa;AACX,QAAK,UAAU,OAAO,SAAS;;;CAInC,KAAa,SAA0C;AACrD,OAAK,MAAM,YAAY,KAAK,UAAW,UAAS,QAAQ;;CAK1D,uBAAuB,QAA+B;EACpD,MAAM,UAAU,OAAO;EACvB,MAAM,UAAU,kBAAkB,OAAO,QAAQ;EAEjD,MAAM,gBAAyC,OAAO,SAAS;AAC7D,OAAI,CAAC,KAAK,SACR,OAAM,IAAI,MAAM,8CAA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d,QACmB;CACnB,MAAM,OAAO,IAAI,UAAU,oBAAoB,OAAO,QAAQ,CAAC;CAC/D,MAAM,WAAW,oBAAoB,MAAM;EACzC,OAAO,OAAO;EACd,UAAU,OAAO;EAClB,CAAC;CAEF,SAAS,gBAAkC;AACzC,SAAO;GACL,UAAU,WAAW,KAAK,QAAQ,OAAO;GACzC,kBAAkB,KAAK,YAAY;GACnC,kBAAkB,KAAK,YAAY;GACnC,YAAY,aAAa,KAAK,UAAU,SAAS;GAClD;;AAGH,QAAO;EAAE;EAAU;EAAe"}
1
+ {"version":3,"file":"factory.js","names":[],"sources":["../../../src/wallet/privy/adapter.ts","../../../src/wallet/privy/bridge.tsx","../../../src/wallet/privy/theme.ts","../../../src/wallet/privy/provider.tsx","../../../src/wallet/privy/factory.ts"],"sourcesContent":["import type {\n ConnectedWallet,\n LoginModalOptions,\n SignTypedDataParams,\n} from \"@privy-io/react-auth\";\nimport type { SignCredentialTypedData } from \"../../credential.js\";\nimport { LoginMethod, type WalletSession } from \"../types.js\";\nimport type { PrivyLoginMethod } from \"./meta.js\";\n\ntype Hex = `0x${string}`;\ntype PrivyLoginMethodId = NonNullable<\n LoginModalOptions[\"loginMethods\"]\n>[number];\n\n// Exhaustive over PrivyLoginMethod, so widening that union without adding the\n// Privy id here is a compile error.\nconst PRIVY_METHOD_MAP: Record<PrivyLoginMethod, PrivyLoginMethodId> = {\n [LoginMethod.WALLET]: \"wallet\",\n [LoginMethod.GOOGLE]: \"google\",\n [LoginMethod.APPLE]: \"apple\",\n [LoginMethod.EMAIL]: \"email\",\n};\n\ntype PrivyOAuthProviderId = \"google\" | \"apple\";\n\n// Methods Privy can start headlessly with initOAuth. Opening the modal for these\n// would only render a single button for a provider the caller already picked.\nconst PRIVY_OAUTH_PROVIDERS: Partial<\n Record<LoginMethod, PrivyOAuthProviderId>\n> = {\n [LoginMethod.GOOGLE]: \"google\",\n [LoginMethod.APPLE]: \"apple\",\n};\n\n// Privy React functions captured by <PrivyAdapterBridge> via bind(). Until bind\n// runs, connect/disconnect calls throw.\nexport interface PrivyBindings {\n openLoginModal: (options?: LoginModalOptions) => void;\n initOAuth: (options: { provider: PrivyOAuthProviderId }) => Promise<void>;\n logout: () => Promise<void>;\n signTypedData: (\n args: Parameters<SignCredentialTypedData>[0],\n address: Hex,\n ) => Promise<Hex>;\n}\n\ninterface PendingLogin {\n resolve(session: WalletSession): void;\n reject(error: Error): void;\n}\n\n// Framework-agnostic core the bridge drives. Holds the session and pending\n// login promise so the class can operate Privy without owning React state.\nexport class PrivyCore {\n readonly supportedMethods: LoginMethod[];\n\n private bindings: PrivyBindings | null = null;\n private pending: PendingLogin | null = null;\n private session: WalletSession | undefined = undefined;\n private listeners = new Set<(session: WalletSession | undefined) => void>();\n\n constructor(supportedMethods: LoginMethod[]) {\n this.supportedMethods = supportedMethods;\n }\n\n bind(bindings: PrivyBindings): () => void {\n this.bindings = bindings;\n return () => {\n if (this.bindings === bindings) this.bindings = null;\n };\n }\n\n getSession(): WalletSession | undefined {\n return this.session;\n }\n\n // Push session changes to subscribers, replaying the current one on subscribe.\n // Lets the host complete sign-in when a session arrives with no pending connect().\n subscribe(\n listener: (session: WalletSession | undefined) => void,\n ): () => void {\n this.listeners.add(listener);\n if (this.session) listener(this.session);\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n private emit(session: WalletSession | undefined): void {\n for (const listener of this.listeners) listener(session);\n }\n\n // Called by the bridge when the embedded wallet is available. Builds the\n // session and resolves any pending login promise.\n syncFromEmbeddedWallet(wallet: ConnectedWallet): void {\n const address = wallet.address as Hex;\n const chainId = parseCaip2ChainId(wallet.chainId);\n\n const signTypedData: SignCredentialTypedData = async (args) => {\n if (!this.bindings) {\n throw new Error(\"PrivyAdapter not bound (bridge not mounted)\");\n }\n return this.bindings.signTypedData(args, address);\n };\n\n // Privy's embedded wallet signs without a prompt, so a host may auto-complete\n // sign-in with this session after a full-page OAuth redirect return.\n const session: WalletSession = {\n address,\n chainId,\n signTypedData,\n canSignSilently: true,\n };\n this.session = session;\n // A live connect() (in-page popup flow) consumes the session via its promise;\n // otherwise the promise died with the pre-redirect page, so emit to subscribers.\n if (this.pending) {\n this.pending.resolve(session);\n this.pending = null;\n } else {\n this.emit(session);\n }\n }\n\n clearSession(): void {\n this.session = undefined;\n this.emit(undefined);\n }\n\n // Called by the bridge on Privy's onError. String codes like `exited_auth_flow`\n // mean the user dismissed the modal.\n handleLoginError(error: unknown): void {\n if (!this.pending) return;\n const err = error instanceof Error ? error : new Error(String(error));\n this.pending.reject(err);\n this.pending = null;\n }\n\n async connect(method?: LoginMethod): Promise<WalletSession> {\n if (this.session) return this.session;\n if (!this.bindings) {\n throw new Error(\n \"PrivyAdapter not bound. Ensure the adapter Provider wraps the app.\",\n );\n }\n\n const chosen = method ?? this.supportedMethods.at(0);\n if (!chosen) {\n throw new Error(\"PrivyAdapter has no supported login methods configured\");\n }\n // PRIVY_METHOD_MAP is total over the methods Privy can drive, so only the\n // configured subset needs checking here.\n if (!this.supportedMethods.includes(chosen)) {\n throw new Error(`PrivyAdapter does not support login method \"${chosen}\"`);\n }\n const privyMethod = PRIVY_METHOD_MAP[chosen];\n\n const bindings = this.bindings;\n const oauthProvider = PRIVY_OAUTH_PROVIDERS[chosen];\n return new Promise<WalletSession>((resolve, reject) => {\n this.pending = { resolve, reject };\n const fail = (error: unknown) => {\n this.pending = null;\n reject(error instanceof Error ? error : new Error(String(error)));\n };\n try {\n // initOAuth navigates away, so this promise stays pending until the page\n // unloads; syncFromEmbeddedWallet emits the session on the redirect back.\n if (oauthProvider) {\n bindings.initOAuth({ provider: oauthProvider }).catch(fail);\n } else {\n bindings.openLoginModal({ loginMethods: [privyMethod] });\n }\n } catch (error) {\n fail(error);\n }\n });\n }\n\n async disconnect(): Promise<void> {\n this.clearSession();\n if (!this.bindings) return;\n await this.bindings.logout();\n }\n}\n\nfunction parseCaip2ChainId(caip2: string): number {\n const last = caip2.split(\":\").at(-1);\n const n = Number(last);\n if (!Number.isFinite(n)) {\n throw new Error(\n `PrivyAdapter: could not parse chainId from CAIP-2 \"${caip2}\"`,\n );\n }\n return n;\n}\n\nexport type { SignTypedDataParams };\n","import { useEffect, useRef } from \"react\";\nimport {\n getEmbeddedConnectedWallet,\n useCreateWallet,\n useLogin,\n useLoginWithOAuth,\n useLogout,\n usePrivy,\n useSignTypedData,\n useWallets,\n} from \"@privy-io/react-auth\";\nimport type { PrivyCore, SignTypedDataParams } from \"./adapter.js\";\n\ntype Hex = `0x${string}`;\n\n// PrivyErrorCode is declared in the types but not exported at runtime, so match\n// the code by value.\nconst EMBEDDED_WALLET_ALREADY_EXISTS = \"embedded_wallet_already_exists\";\n\n// onError is typed as the bare code, but Privy's error class carries it on\n// `privyErrorCode`, so accept either rather than trusting toString().\nfunction isAlreadyExistsError(error: unknown): boolean {\n if (error === EMBEDDED_WALLET_ALREADY_EXISTS) return true;\n return (\n typeof error === \"object\" &&\n error !== null &&\n (error as { privyErrorCode?: unknown }).privyErrorCode ===\n EMBEDDED_WALLET_ALREADY_EXISTS\n );\n}\n\ninterface PrivyAdapterBridgeProps {\n core: PrivyCore;\n}\n\n// Captures the React-only Privy hooks and wires them into PrivyCore so the\n// class can drive Privy without owning React state. Mounted inside PrivyProvider.\nexport function PrivyAdapterBridge({ core }: PrivyAdapterBridgeProps) {\n const { ready, authenticated } = usePrivy();\n const { wallets } = useWallets();\n const { signTypedData } = useSignTypedData();\n const { logout } = useLogout();\n const { createWallet } = useCreateWallet({\n // A wallet that already exists still arrives through useWallets(), so that\n // code is not a login failure.\n onError: (error) => {\n if (!isAlreadyExistsError(error)) core.handleLoginError(error);\n },\n });\n const { login: openLoginModal } = useLogin({\n onError: (error) => core.handleLoginError(error),\n });\n // Also mounts this hook on the page Privy redirects back to, which is what\n // lets it finish the OAuth flow there.\n const { initOAuth } = useLoginWithOAuth({\n onError: (error) => core.handleLoginError(error),\n });\n\n // Privy returns fresh function references each render. A ref keeps the bind\n // stable so we bind once per core instead of re-binding every render.\n const fnsRef = useRef({\n openLoginModal,\n initOAuth,\n logout,\n signTypedData,\n createWallet,\n });\n useEffect(() => {\n fnsRef.current = {\n openLoginModal,\n initOAuth,\n logout,\n signTypedData,\n createWallet,\n };\n }, [openLoginModal, initOAuth, logout, signTypedData, createWallet]);\n\n // One attempt per authenticated session, reset on logout.\n const creatingWalletRef = useRef(false);\n\n useEffect(() => {\n return core.bind({\n openLoginModal: (opts) => fnsRef.current.openLoginModal(opts),\n initOAuth: (opts) => fnsRef.current.initOAuth(opts),\n logout: () => fnsRef.current.logout(),\n // Privy owns the embedded wallet keys, so showWalletUIs:false signs the\n // credential typed-data silently as part of login.\n signTypedData: async (args, address) => {\n const result = await fnsRef.current.signTypedData(\n args as unknown as SignTypedDataParams,\n { address, uiOptions: { showWalletUIs: false } },\n );\n return result.signature as Hex;\n },\n });\n }, [core]);\n\n useEffect(() => {\n if (!ready) return;\n if (!authenticated) {\n core.clearSession();\n creatingWalletRef.current = false;\n return;\n }\n const embedded = getEmbeddedConnectedWallet(wallets);\n if (embedded) {\n core.syncFromEmbeddedWallet(embedded);\n return;\n }\n // `createOnLogin` only fires for Privy's own modal, so initOAuth logins\n // reach here with no wallet. Privy's docs prescribe creating it manually.\n if (creatingWalletRef.current) return;\n creatingWalletRef.current = true;\n // Failures are reported through useCreateWallet's onError; this only keeps\n // the rejection from surfacing as an unhandled one.\n void fnsRef.current.createWallet().catch(() => undefined);\n }, [core, ready, authenticated, wallets]);\n\n return null;\n}\n","const HEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;\nconst RGB = /^rgba?\\(\\s*(-?[\\d.]+)[\\s,]+(-?[\\d.]+)[\\s,]+(-?[\\d.]+)/i;\n\nfunction channel(value: string): string {\n const byte = Math.round(Number(value));\n return Math.min(255, Math.max(0, byte)).toString(16).padStart(2, \"0\");\n}\n\n/** Convert a host theme accent color to the hex Privy's `appearance` requires, or `undefined` if it is not expressible. Hosts resolve CSS tokens through `getComputedStyle`, which yields `rgb(...)`, so plain pass-through would be rejected. Alpha is dropped: Privy derives its own variants. */\nexport function toPrivyAccentColor(\n color: string | undefined,\n): `#${string}` | undefined {\n if (!color) return undefined;\n const value = color.trim();\n if (HEX.test(value)) return value as `#${string}`;\n const rgb = RGB.exec(value);\n if (!rgb) return undefined;\n return `#${channel(rgb[1])}${channel(rgb[2])}${channel(rgb[3])}`;\n}\n","import { useMemo, type ComponentType, type ReactNode } from \"react\";\nimport { PrivyProvider, type PrivyClientConfig } from \"@privy-io/react-auth\";\nimport { normalizeWalletTheme, type WalletTheme } from \"../types.js\";\nimport type { PrivyCore } from \"./adapter.js\";\nimport { PrivyAdapterBridge } from \"./bridge.js\";\nimport { toPrivyAccentColor } from \"./theme.js\";\n\ninterface PrivyProviderConfig {\n appId: string;\n clientId?: string;\n}\n\n// Build the adapter Provider bound to a specific core + config. Mounts\n// PrivyProvider with embedded wallets + showWalletUIs:false for silent signing.\nexport function createPrivyProvider(\n core: PrivyCore,\n config: PrivyProviderConfig,\n): ComponentType<{ children: ReactNode; theme?: WalletTheme }> {\n return function PrivyAuthProvider({\n children,\n theme,\n }: {\n children: ReactNode;\n theme?: WalletTheme;\n }) {\n const { mode, accentColor } = normalizeWalletTheme(theme);\n const accent = toPrivyAccentColor(accentColor);\n // Memoize so a new config object per render doesn't rebuild PrivyProvider's\n // context and cascade re-renders into descendants.\n const privyConfig = useMemo<PrivyClientConfig>(\n () => ({\n // Privy generates its own light/dark variants from the accent.\n appearance: { theme: mode, ...(accent ? { accentColor: accent } : {}) },\n embeddedWallets: {\n ethereum: { createOnLogin: \"users-without-wallets\" as const },\n showWalletUIs: false,\n },\n // Social/email adapter only (external wallets go through the rainbow\n // adapter), so don't init WalletConnect / fetch its registry on mount.\n externalWallets: {\n disableAllExternalWallets: true,\n walletConnect: { enabled: false },\n },\n }),\n [mode, accent],\n );\n\n return (\n <PrivyProvider\n appId={config.appId}\n clientId={config.clientId}\n config={privyConfig}\n >\n <PrivyAdapterBridge core={core} />\n {children}\n </PrivyProvider>\n );\n };\n}\n","// Renders React (PrivyProvider + hooks), so RSC hosts must treat this as a\n// client module even though the descriptor entry reaches it lazily.\n\"use client\";\n\nimport type { WalletAdapterImpl, WalletController } from \"../types.js\";\nimport { PrivyCore } from \"./adapter.js\";\nimport {\n resolvePrivyMethods,\n type PHRenownPrivyAdapterConfig,\n} from \"./meta.js\";\nimport { createPrivyProvider } from \"./provider.js\";\n\n// Build the Privy adapter. Provider mounts PrivyProvider + a bridge;\n// useController exposes imperative connect/disconnect over the shared core.\nexport function createPrivyAdapter(\n config: PHRenownPrivyAdapterConfig,\n): WalletAdapterImpl {\n const core = new PrivyCore(resolvePrivyMethods(config.methods));\n const Provider = createPrivyProvider(core, {\n appId: config.appId,\n clientId: config.clientId,\n });\n\n function useController(): WalletController {\n return {\n connect: (method) => core.connect(method),\n disconnect: () => core.disconnect(),\n getSession: () => core.getSession(),\n subscribe: (listener) => core.subscribe(listener),\n };\n }\n\n return { Provider, useController };\n}\n\nexport { PrivyCore } from \"./adapter.js\";\nexport type { PrivyBindings } from \"./adapter.js\";\nexport { PrivyAdapterBridge } from \"./bridge.js\";\nexport { createPrivyProvider } from \"./provider.js\";\n"],"mappings":";;;;;;;AAgBA,MAAM,mBAAiE;EACpE,YAAY,SAAS;EACrB,YAAY,SAAS;EACrB,YAAY,QAAQ;EACpB,YAAY,QAAQ;CACtB;AAMD,MAAM,wBAEF;EACD,YAAY,SAAS;EACrB,YAAY,QAAQ;CACtB;AAqBD,IAAa,YAAb,MAAuB;CACrB;CAEA,WAAyC;CACzC,UAAuC;CACvC,UAA6C,KAAA;CAC7C,4BAAoB,IAAI,KAAmD;CAE3E,YAAY,kBAAiC;AAC3C,OAAK,mBAAmB;;CAG1B,KAAK,UAAqC;AACxC,OAAK,WAAW;AAChB,eAAa;AACX,OAAI,KAAK,aAAa,SAAU,MAAK,WAAW;;;CAIpD,aAAwC;AACtC,SAAO,KAAK;;CAKd,UACE,UACY;AACZ,OAAK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
4
  "description": "Renown SDK — wallet-based authentication and user identity management for Powerhouse React applications.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "private": false,
@@ -88,7 +88,7 @@
88
88
  "dist"
89
89
  ],
90
90
  "devDependencies": {
91
- "@privy-io/react-auth": "^3.25.0",
91
+ "@privy-io/react-auth": "3.35.0",
92
92
  "@rainbow-me/rainbowkit": "^2.2.11",
93
93
  "@tanstack/react-query": "^5.90.2",
94
94
  "@types/react": "19.2.14",
@@ -104,7 +104,7 @@
104
104
  "key-did-resolver": "^4.0.0",
105
105
  "uint8arrays": "^5.1.0",
106
106
  "viem": "~2.50.4",
107
- "@powerhousedao/shared": "6.2.2-dev.26"
107
+ "@powerhousedao/shared": "6.2.2-dev.27"
108
108
  },
109
109
  "peerDependencies": {
110
110
  "@privy-io/react-auth": "^3.25.0",