Skip to main content

src/lib/identity/creatorIdentity

creatorvault-miniapp


creatorvault-miniapp / src/lib/identity/creatorIdentity

src/lib/identity/creatorIdentity

Type Aliases

CreatorIdentityResolution

CreatorIdentityResolution = object

Defined in: lib/identity/creatorIdentity.ts:18

Properties

blockingReason

blockingReason: string | null

Defined in: lib/identity/creatorIdentity.ts:31

Block irreversible actions when true; caller should present UI guidance.

canonicalIdentity

canonicalIdentity: object

Defined in: lib/identity/creatorIdentity.ts:20

Canonical creator identity wallet (the identity that must not fragment).

address

address: Address | null

source

source: CreatorIdentitySource

execution

execution: object

Defined in: lib/identity/creatorIdentity.ts:25

Currently connected wallet/account (execution context for the current session).

address

address: Address | null

hasExistingCreatorCoinIdentity

hasExistingCreatorCoinIdentity: boolean

Defined in: lib/identity/creatorIdentity.ts:29

Whether we have an existing creator coin identity we should enforce.

warnings

warnings: CreatorIdentityWarningCode[]

Defined in: lib/identity/creatorIdentity.ts:33

Non-blocking warnings to show in UI.


CreatorIdentitySource

CreatorIdentitySource = "zoraCoinCreatorAddress" | "privySmartWallet" | "farcasterCustody" | "zoraProfilePublicWallet" | "connectedWallet" | "unknown"

Defined in: lib/identity/creatorIdentity.ts:5


CreatorIdentityWarningCode

CreatorIdentityWarningCode = "CUSTODY_MISMATCH" | "CONNECTED_WALLET_MISMATCH" | "CUSTODY_UNAVAILABLE"

Defined in: lib/identity/creatorIdentity.ts:13

Functions

resolveCreatorIdentity()

resolveCreatorIdentity(params): CreatorIdentityResolution

Defined in: lib/identity/creatorIdentity.ts:53

Resolve canonical creator identity in a way that prevents fragmentation.

Rules (Privy-first approach):

  • If Privy smart wallet is available and matches the creator coin's creator address, use it (no blocking).
  • If a creator coin exists and Privy smart wallet doesn't match, block (wrong account).
  • If no creator coin exists, use Privy smart wallet as the canonical identity for new deployments.
  • Fallback to connected wallet only if Privy is unavailable.

Parameters

params
connectedWallet

`0x${string}` | null

farcasterCustodyAddress?

`0x${string}` | null

farcasterZoraProfile?

ZoraProfile | null

privySmartWallet?

`0x${string}` | null

zoraCoin?

ZoraCoin | null

Returns

CreatorIdentityResolution