{"version":3,"sources":["/home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins-sdk/dist/index.cjs","../src/actions/createCoin.ts","../src/utils/validateClientNetwork.ts","../src/metadata/cleanAndValidateMetadataURI.ts","../src/metadata/validateMetadataJSON.ts","../src/metadata/validateMetadataURIContent.ts","../src/utils/getChainFromId.ts","../src/client/client.gen.ts","../src/client/sdk.gen.ts","../src/api/api-key.ts","../src/api/explore.ts","../src/api/queries.ts","../src/api/create.ts","../src/api/social.ts","../src/utils/rethrowDecodedRevert.ts","../src/actions/updateCoinURI.ts","../src/utils/attribution.ts","../src/actions/updatePayoutRecipient.ts","../src/actions/tradeCoin.ts","../src/api/api-raw.ts","../src/uploader/metadata.ts","../src/api/internal.ts","../src/uploader/providers/zora.ts"],"names":["base","baseSepolia","getCoin","getCoins","getCoinHolders","getCoinPriceHistory","getCoinSwaps","getCoinComments","getProfile","getProfileCoins","getProfileBalances","getProfileSocial","getTokenInfo","getFeaturedCreators","getTraderLeaderboard","getContentCoinPoolConfig","getCreatorCoinPoolConfig","getCreatorLivestreamComments","getWalletTradeActivity","postCreateContent","getProfileBySocialHandle","parseEventLogs","coinABI","setCreateUploadJwt"],"mappings":"AAAA;ACAA;AACE;AACA;AAAkB,qEACb;AACP;AAKE;AAGA;AAAA,4BACK;AACP,qCAAqB;ADJrB;AACA;AEVA;AAEO,IAAM,sBAAA,EAAwB,CACnC,YAAA,EAAA,GACG;AACH,EAAA,MAAM,cAAA,kBAAgB,YAAA,2BAAc,KAAA,6BAAO,IAAA;AAC3C,EAAA,GAAA,CAAI,cAAA,IAAkB,YAAA,CAAK,EAAA,EAAI;AAC7B,IAAA,MAAA;AAAA,EACF;AACA,EAAA,GAAA,CAAI,cAAA,IAAkB,mBAAA,CAAY,EAAA,EAAI;AACpC,IAAA,MAAA;AAAA,EACF;AAEA,EAAA,MAAM,IAAI,KAAA;AAAA,IACR;AAAA,EACF,CAAA;AACF,CAAA;AFQA;AACA;AGlBO,SAAS,2BAAA,CAA4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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins-sdk/dist/index.cjs","sourcesContent":[null,"import {\n  coinFactoryAddress,\n  coinFactoryABI as zoraFactoryImplABI,\n} from \"@zoralabs/protocol-deployments\";\nimport {\n  Address,\n  TransactionReceipt,\n  WalletClient,\n  ContractEventArgsFromTopics,\n  parseEventLogs,\n  Hex,\n  Account,\n  isAddressEqual,\n} from \"viem\";\nimport { base } from \"viem/chains\";\nimport { validateClientNetwork } from \"../utils/validateClientNetwork\";\nimport { GenericPublicClient } from \"../utils/genericPublicClient\";\nimport { validateMetadataURIContent } from \"../metadata\";\nimport { ValidMetadataURI } from \"../uploader/types\";\nimport { getChainFromId } from \"../utils/getChainFromId\";\nimport { postCreateContent } from \"../api\";\nimport { rethrowDecodedRevert } from \"../utils/rethrowDecodedRevert\";\n\nexport type CoinDeploymentLogArgs = ContractEventArgsFromTopics<\n  typeof zoraFactoryImplABI,\n  \"CoinCreatedV4\"\n>;\n\nconst STARTING_MARKET_CAPS = {\n  LOW: \"LOW\",\n  HIGH: \"HIGH\",\n} as const;\nexport type StartingMarketCap = keyof typeof STARTING_MARKET_CAPS;\n\nexport interface RawUriMetadata {\n  type: \"RAW_URI\";\n  uri: string;\n}\n\nconst CONTENT_COIN_CURRENCIES = {\n  CREATOR_COIN: \"CREATOR_COIN\",\n  ZORA: \"ZORA\",\n  ETH: \"ETH\",\n  CREATOR_COIN_OR_ZORA: \"CREATOR_COIN_OR_ZORA\",\n} as const;\nexport type ContentCoinCurrency = keyof typeof CONTENT_COIN_CURRENCIES;\n\nexport const CreateConstants = {\n  StartingMarketCaps: STARTING_MARKET_CAPS,\n  ContentCoinCurrencies: CONTENT_COIN_CURRENCIES,\n} as const;\n\nexport type CreateCoinArgs = {\n  creator: string;\n  name: string;\n  symbol: string;\n  metadata: RawUriMetadata;\n  currency: ContentCoinCurrency;\n  chainId?: number;\n  startingMarketCap?: StartingMarketCap;\n  platformReferrer?: string;\n  additionalOwners?: Address[];\n  payoutRecipientOverride?: Address;\n  skipMetadataValidation?: boolean;\n};\n\ntype TransactionParameters = {\n  to: Address;\n  data: Hex;\n  value: bigint;\n};\n\ntype CreateCoinCallResponse = {\n  calls: TransactionParameters[];\n  predictedCoinAddress: Address;\n};\n\nexport async function createCoinCall({\n  creator,\n  name,\n  symbol,\n  metadata,\n  currency,\n  chainId = base.id,\n  payoutRecipientOverride,\n  additionalOwners,\n  platformReferrer,\n  skipMetadataValidation = false,\n}: CreateCoinArgs): Promise<CreateCoinCallResponse> {\n  // Validate metadata URI\n  if (!skipMetadataValidation) {\n    await validateMetadataURIContent(metadata.uri as ValidMetadataURI);\n  }\n\n  const createContentRequest = await postCreateContent({\n    currency,\n    chainId,\n    metadata,\n    creator,\n    name,\n    symbol,\n    platformReferrer,\n    additionalOwners,\n    payoutRecipientOverride,\n  });\n\n  if (!createContentRequest.data?.calls) {\n    throw new Error(\"Failed to create content calldata\");\n  }\n\n  return {\n    calls: createContentRequest.data.calls.map((data) => ({\n      to: data.to as Address,\n      data: data.data as Hex,\n      value: BigInt(data.value),\n    })),\n    predictedCoinAddress: createContentRequest.data\n      .predictedCoinAddress as Address,\n  };\n}\n\n/**\n * Gets the deployed coin address from transaction receipt logs\n * @param receipt Transaction receipt containing the CoinCreated event\n * @returns The deployment information if found\n */\nexport function getCoinCreateFromLogs(\n  receipt: TransactionReceipt,\n): CoinDeploymentLogArgs | undefined {\n  const eventLogs = parseEventLogs({\n    abi: zoraFactoryImplABI,\n    logs: receipt.logs,\n  });\n\n  return eventLogs.find((log) => log.eventName === \"CoinCreatedV4\")?.args;\n}\n\n// Update createCoin to return both receipt and coin address\nexport async function createCoin({\n  call,\n  walletClient,\n  publicClient,\n  options,\n}: {\n  call: CreateCoinArgs;\n  walletClient: WalletClient;\n  publicClient: GenericPublicClient;\n  options?: {\n    gasMultiplier?: number;\n    account?: Account | Address;\n    skipValidateTransaction?: boolean;\n  };\n}) {\n  validateClientNetwork(publicClient);\n\n  const chainId = call.chainId ?? publicClient.chain.id;\n\n  const callRequest = await createCoinCall({\n    ...call,\n    chainId,\n  });\n\n  if (callRequest.calls.length !== 1) {\n    throw new Error(\"Only one call is supported for this SDK version\");\n  }\n\n  const createContentCall = callRequest.calls[0];\n\n  if (!createContentCall) {\n    throw new Error(\"Failed to load create content calldata from API\");\n  }\n\n  const coinFactoryAddressForChain =\n    coinFactoryAddress[call.chainId as keyof typeof coinFactoryAddress];\n\n  // Sanity check that the call is for the correct factory contract\n  if (!isAddressEqual(createContentCall.to, coinFactoryAddressForChain)) {\n    throw new Error(\"Creator coin is not supported for this SDK version\");\n  }\n\n  // Sanity check to ensure no buy orders are sent with there parameters\n  if (createContentCall.value !== 0n) {\n    throw new Error(\n      \"Creator coin and purchase is not supported for this SDK version.\",\n    );\n  }\n\n  // Prefer a LocalAccount from the wallet client when available to ensure\n  // offline signing (eth_sendRawTransaction) instead of wallet_sendTransaction\n  // which can error when a `from` field is present.\n  const selectedAccount =\n    (typeof options?.account === \"string\" ? undefined : options?.account) ??\n    walletClient.account;\n\n  if (!selectedAccount) {\n    throw new Error(\"Account is required\");\n  }\n\n  const viemCall = {\n    ...createContentCall,\n    account: selectedAccount,\n  };\n\n  // simulate call\n  if (!options?.skipValidateTransaction) {\n    try {\n      await publicClient.call(viemCall);\n    } catch (err) {\n      rethrowDecodedRevert(err, zoraFactoryImplABI);\n    }\n  }\n\n  const gasEstimate = options?.skipValidateTransaction\n    ? 10_000_000n\n    : await publicClient.estimateGas(viemCall);\n  const gasPrice = await publicClient.getGasPrice();\n\n  const hash = await (async () => {\n    try {\n      return await walletClient.sendTransaction({\n        ...viemCall,\n        gasPrice,\n        gas: gasEstimate,\n        chain: publicClient.chain,\n      });\n    } catch (err) {\n      rethrowDecodedRevert(err, zoraFactoryImplABI);\n    }\n  })();\n\n  const receipt = await publicClient.waitForTransactionReceipt({\n    hash,\n  });\n\n  const deployment = getCoinCreateFromLogs(receipt);\n\n  return {\n    hash,\n    receipt,\n    address: deployment?.coin,\n    deployment,\n    chain: getChainFromId(publicClient.chain.id),\n  };\n}\n","import { PublicClient } from \"viem\";\nimport { base, baseSepolia } from \"viem/chains\";\n\nexport const validateClientNetwork = (\n  publicClient: PublicClient<any, any, any, any>,\n) => {\n  const clientChainId = publicClient?.chain?.id;\n  if (clientChainId === base.id) {\n    return;\n  }\n  if (clientChainId === baseSepolia.id) {\n    return;\n  }\n\n  throw new Error(\n    \"Client network needs to be base or baseSepolia for current coin deployments.\",\n  );\n};\n","import { ValidMetadataURI } from \"../uploader/types\";\n\n/**\n * Clean the metadata URI to HTTPS format\n * @param metadataURI - The metadata URI to clean from IPFS or Arweave\n * @returns The cleaned metadata URI\n * @throws If the metadata URI is a data URI\n */\nexport function cleanAndValidateMetadataURI(uri: ValidMetadataURI) {\n  if (uri.startsWith(\"ipfs://\")) {\n    return uri.replace(\n      \"ipfs://\",\n      \"https://magic.decentralized-content.com/ipfs/\",\n    );\n  }\n  if (uri.startsWith(\"ar://\")) {\n    return uri.replace(\"ar://\", \"http://arweave.net/\");\n  }\n  if (uri.startsWith(\"data:\")) {\n    return uri;\n    // throw new Error(\"Data URIs are not supported\");\n  }\n  if (uri.startsWith(\"http://\") || uri.startsWith(\"https://\")) {\n    return uri;\n  }\n\n  throw new Error(\"Invalid metadata URI\");\n}\n","export type ValidMetadataJSON = {\n  name: string;\n  description: string;\n  image: string;\n  animation_url?: string;\n  content?: { uri: string; mime?: string };\n};\n\nfunction validateURIString(uri: unknown) {\n  if (typeof uri !== \"string\") {\n    throw new Error(\"URI must be a string\");\n  }\n  if (uri.startsWith(\"ipfs://\")) {\n    return true;\n  }\n  if (uri.startsWith(\"ar://\")) {\n    return true;\n  }\n  if (uri.startsWith(\"https://\")) {\n    return true;\n  }\n  if (uri.startsWith(\"data:\")) {\n    return true;\n  }\n\n  return false;\n}\n\n/**\n * Validate the metadata JSON object\n * @param metadata - The metadata object to validate\n */\nexport function validateMetadataJSON(metadata: ValidMetadataJSON | unknown) {\n  if (typeof metadata !== \"object\" || !metadata) {\n    throw new Error(\"Metadata must be an object and exist\");\n  }\n  if (typeof (metadata as { name: unknown }).name !== \"string\") {\n    throw new Error(\"Metadata name is required and must be a string\");\n  }\n  if (typeof (metadata as { description: unknown }).description !== \"string\") {\n    throw new Error(\"Metadata description is required and must be a string\");\n  }\n  if (typeof (metadata as { image: unknown }).image === \"string\") {\n    if (!validateURIString((metadata as { image: string }).image)) {\n      throw new Error(\"Metadata image is not a valid URI\");\n    }\n  } else {\n    throw new Error(\"Metadata image is required and must be a string\");\n  }\n  if (\"animation_url\" in metadata) {\n    if (\n      typeof (metadata as { animation_url?: unknown }).animation_url !==\n      \"string\"\n    ) {\n      throw new Error(\"Metadata animation_url, if provided, must be a string\");\n    }\n    if (!validateURIString(metadata.animation_url)) {\n      throw new Error(\"Metadata animation_url is not a valid URI\");\n    }\n  }\n  const content =\n    \"content\" in metadata && (metadata as { content?: unknown }).content;\n  if (content) {\n    if (typeof (content as { uri?: unknown }).uri !== \"string\") {\n      throw new Error(\"If provided, content.uri must be a string\");\n    }\n    if (!validateURIString((content as { uri: string }).uri)) {\n      throw new Error(\"If provided, content.uri must be a valid URI string\");\n    }\n    if (typeof (content as { mime?: unknown }).mime !== \"string\") {\n      throw new Error(\"If provided, content.mime must be a string\");\n    }\n  }\n\n  return true;\n}\n","import { cleanAndValidateMetadataURI } from \"./cleanAndValidateMetadataURI\";\nimport { ValidMetadataURI } from \"../uploader/types\";\nimport { validateMetadataJSON } from \"./validateMetadataJSON\";\n\n/**\n * Validate the metadata URI Content\n * @param metadataURI - The metadata URI to validate\n * @returns true if the metadata is valid, throws an error otherwise\n */\nexport async function validateMetadataURIContent(\n  metadataURI: ValidMetadataURI,\n) {\n  const cleanedURI = cleanAndValidateMetadataURI(metadataURI);\n  const response = await fetch(cleanedURI);\n  if (!response.ok) {\n    throw new Error(\"Metadata fetch failed\");\n  }\n  if (\n    ![\"application/json\", \"text/plain\"].includes(\n      response.headers.get(\"content-type\") ?? \"\",\n    )\n  ) {\n    throw new Error(\"Metadata is not a valid JSON or plain text response type\");\n  }\n  const metadataJson = await response.json();\n  return validateMetadataJSON(metadataJson);\n}\n","import { base, baseSepolia, Chain } from \"viem/chains\";\n\nexport function getChainFromId(chainId: number): Chain {\n  if (chainId === base.id) {\n    return base;\n  }\n  if (chainId === baseSepolia.id) {\n    return baseSepolia;\n  }\n\n  throw new Error(`Chain ID ${chainId} not supported`);\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { ClientOptions } from \"./types.gen\";\nimport {\n  type Config,\n  type ClientOptions as DefaultClientOptions,\n  createClient,\n  createConfig,\n} from \"@hey-api/client-fetch\";\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> =\n  (\n    override?: Config<DefaultClientOptions & T>,\n  ) => Config<Required<DefaultClientOptions> & T>;\n\nexport const client = createClient(\n  createConfig<ClientOptions>({\n    baseUrl: \"https://api-sdk.zora.engineering/\",\n  }),\n);\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type {\n  Options as ClientOptions,\n  TDataShape,\n  Client,\n} from \"@hey-api/client-fetch\";\nimport type {\n  GetApiKeyData,\n  GetApiKeyResponse,\n  GetCoinData,\n  GetCoinResponse,\n  GetCoinCommentsData,\n  GetCoinCommentsResponse,\n  GetCoinHoldersData,\n  GetCoinHoldersResponse,\n  GetCoinPriceHistoryData,\n  GetCoinPriceHistoryResponse,\n  GetCoinSwapsData,\n  GetCoinSwapsResponse,\n  GetCoinsData,\n  GetCoinsResponse,\n  GetCoinsListData,\n  GetCoinsListResponse,\n  GetContentCoinPoolConfigData,\n  GetContentCoinPoolConfigResponse,\n  SetCreateUploadJwtData,\n  SetCreateUploadJwtResponse,\n  GetCreatorCoinPoolConfigData,\n  GetCreatorCoinPoolConfigResponse,\n  GetCreatorLivestreamCommentsData,\n  GetCreatorLivestreamCommentsResponse,\n  GetExploreData,\n  GetExploreResponse,\n  GetFeaturedCreatorsData,\n  GetFeaturedCreatorsResponse,\n  GetLatestLiveStreamsData,\n  GetLatestLiveStreamsResponse,\n  GetProfileData,\n  GetProfileResponse,\n  GetProfileBalancesData,\n  GetProfileBalancesResponse,\n  GetProfileBySocialHandleData,\n  GetProfileBySocialHandleResponse,\n  GetProfileCoinsData,\n  GetProfileCoinsResponse,\n  GetProfileSocialData,\n  GetProfileSocialResponse,\n  GetTokenInfoData,\n  GetTokenInfoResponse,\n  GetTopLiveStreamsData,\n  GetTopLiveStreamsResponse,\n  GetTraderLeaderboardData,\n  GetTraderLeaderboardResponse,\n  GetTrendCoinData,\n  GetTrendCoinResponse,\n  GetTrendsByNameData,\n  GetTrendsByNameResponse,\n  GetWalletTradeActivityData,\n  GetWalletTradeActivityResponse,\n  PostQuoteData,\n  PostQuoteResponse,\n  PostQuoteError,\n  PostCreateContentData,\n  PostCreateContentResponse,\n  PostCreateContentError,\n} from \"./types.gen\";\nimport { client as _heyApiClient } from \"./client.gen\";\n\nexport type Options<\n  TData extends TDataShape = TDataShape,\n  ThrowOnError extends boolean = boolean,\n> = ClientOptions<TData, ThrowOnError> & {\n  /**\n   * You can provide a client instance returned by `createClient()` instead of\n   * individual options. This might be also useful if you want to implement a\n   * custom client.\n   */\n  client?: Client;\n  /**\n   * You can pass arbitrary values through the `meta` object. This can be\n   * used to access values that aren't defined as part of the SDK function.\n   */\n  meta?: Record<string, unknown>;\n};\n\n/**\n * zoraSDK_apiKey query\n */\nexport const getApiKey = <ThrowOnError extends boolean = false>(\n  options: Options<GetApiKeyData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetApiKeyResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/apiKey\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_coin query\n */\nexport const getCoin = <ThrowOnError extends boolean = false>(\n  options: Options<GetCoinData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetCoinResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/coin\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_coinComments query\n */\nexport const getCoinComments = <ThrowOnError extends boolean = false>(\n  options: Options<GetCoinCommentsData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetCoinCommentsResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/coinComments\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_coinHolders query\n */\nexport const getCoinHolders = <ThrowOnError extends boolean = false>(\n  options: Options<GetCoinHoldersData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetCoinHoldersResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/coinHolders\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_coinPriceHistory query\n */\nexport const getCoinPriceHistory = <ThrowOnError extends boolean = false>(\n  options: Options<GetCoinPriceHistoryData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetCoinPriceHistoryResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/coinPriceHistory\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_coinSwaps query\n */\nexport const getCoinSwaps = <ThrowOnError extends boolean = false>(\n  options: Options<GetCoinSwapsData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetCoinSwapsResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/coinSwaps\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_coins query\n */\nexport const getCoins = <ThrowOnError extends boolean = false>(\n  options: Options<GetCoinsData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetCoinsResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/coins\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_coinsList query\n */\nexport const getCoinsList = <ThrowOnError extends boolean = false>(\n  options?: Options<GetCoinsListData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    GetCoinsListResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/coinsList\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_contentCoinPoolConfig query\n */\nexport const getContentCoinPoolConfig = <ThrowOnError extends boolean = false>(\n  options: Options<GetContentCoinPoolConfigData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetContentCoinPoolConfigResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/contentCoinPoolConfig\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_createUploadJWT mutation\n */\nexport const setCreateUploadJwt = <ThrowOnError extends boolean = false>(\n  options?: Options<SetCreateUploadJwtData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).post<\n    SetCreateUploadJwtResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/createUploadJWT\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options?.headers,\n    },\n  });\n};\n\n/**\n * zoraSDK_creatorCoinPoolConfig query\n */\nexport const getCreatorCoinPoolConfig = <ThrowOnError extends boolean = false>(\n  options?: Options<GetCreatorCoinPoolConfigData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    GetCreatorCoinPoolConfigResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/creatorCoinPoolConfig\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_creatorLivestreamComments query\n */\nexport const getCreatorLivestreamComments = <\n  ThrowOnError extends boolean = false,\n>(\n  options: Options<GetCreatorLivestreamCommentsData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetCreatorLivestreamCommentsResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/creatorLivestreamComments\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_explore query\n */\nexport const getExplore = <ThrowOnError extends boolean = false>(\n  options: Options<GetExploreData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetExploreResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/explore\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_featuredCreators query\n */\nexport const getFeaturedCreators = <ThrowOnError extends boolean = false>(\n  options?: Options<GetFeaturedCreatorsData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    GetFeaturedCreatorsResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/featuredCreators\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_latestLiveStreams query\n */\nexport const getLatestLiveStreams = <ThrowOnError extends boolean = false>(\n  options?: Options<GetLatestLiveStreamsData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    GetLatestLiveStreamsResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/latestLiveStreams\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_profile query\n */\nexport const getProfile = <ThrowOnError extends boolean = false>(\n  options: Options<GetProfileData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetProfileResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/profile\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_profileBalances query\n */\nexport const getProfileBalances = <ThrowOnError extends boolean = false>(\n  options: Options<GetProfileBalancesData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetProfileBalancesResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/profileBalances\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_profileBySocialHandle query\n */\nexport const getProfileBySocialHandle = <ThrowOnError extends boolean = false>(\n  options: Options<GetProfileBySocialHandleData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetProfileBySocialHandleResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/profileBySocialHandle\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_profileCoins query\n */\nexport const getProfileCoins = <ThrowOnError extends boolean = false>(\n  options: Options<GetProfileCoinsData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetProfileCoinsResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/profileCoins\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_profileSocial query\n */\nexport const getProfileSocial = <ThrowOnError extends boolean = false>(\n  options: Options<GetProfileSocialData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetProfileSocialResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/profileSocial\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_tokenInfo query\n */\nexport const getTokenInfo = <ThrowOnError extends boolean = false>(\n  options: Options<GetTokenInfoData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetTokenInfoResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/tokenInfo\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_topLiveStreams query\n */\nexport const getTopLiveStreams = <ThrowOnError extends boolean = false>(\n  options?: Options<GetTopLiveStreamsData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    GetTopLiveStreamsResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/topLiveStreams\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_traderLeaderboard query\n */\nexport const getTraderLeaderboard = <ThrowOnError extends boolean = false>(\n  options?: Options<GetTraderLeaderboardData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    GetTraderLeaderboardResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/traderLeaderboard\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_trendCoin query\n */\nexport const getTrendCoin = <ThrowOnError extends boolean = false>(\n  options: Options<GetTrendCoinData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetTrendCoinResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/trendCoin\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_trendsByName query\n */\nexport const getTrendsByName = <ThrowOnError extends boolean = false>(\n  options: Options<GetTrendsByNameData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetTrendsByNameResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/trendsByName\",\n    ...options,\n  });\n};\n\n/**\n * zoraSDK_walletTradeActivity query\n */\nexport const getWalletTradeActivity = <ThrowOnError extends boolean = false>(\n  options: Options<GetWalletTradeActivityData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    GetWalletTradeActivityResponse,\n    unknown,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/walletTradeActivity\",\n    ...options,\n  });\n};\n\nexport const postQuote = <ThrowOnError extends boolean = false>(\n  options?: Options<PostQuoteData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).post<\n    PostQuoteResponse,\n    PostQuoteError,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/quote\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options?.headers,\n    },\n  });\n};\n\nexport const postCreateContent = <ThrowOnError extends boolean = false>(\n  options?: Options<PostCreateContentData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).post<\n    PostCreateContentResponse,\n    PostCreateContentError,\n    ThrowOnError\n  >({\n    security: [\n      {\n        name: \"api-key\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/create/content\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options?.headers,\n    },\n  });\n};\n","let apiKey: string | undefined;\nexport function setApiKey(key: string | undefined) {\n  apiKey = key;\n}\n\nexport function getApiKey() {\n  return apiKey;\n}\n\nexport function getApiKeyMeta() {\n  if (!apiKey) {\n    return {};\n  }\n  return {\n    headers: {\n      \"api-key\": apiKey,\n    },\n  };\n}\n","import {\n  getExplore as getExploreSDK,\n  getTrendCoin as getTrendCoinSDK,\n  getTrendsByName as getTrendsByNameSDK,\n} from \"../client/sdk.gen\";\nimport type {\n  GetExploreData,\n  GetExploreResponse,\n  GetTrendCoinData,\n  GetTrendCoinResponse,\n  GetTrendsByNameData,\n  GetTrendsByNameResponse,\n} from \"../client/types.gen\";\nimport { getApiKeyMeta } from \"./api-key\";\nimport { RequestOptionsType } from \"./query-types\";\n\n/**\n * The inner type for the explore queries that omits listType.\n * This is used to create the query object for the explore queries.\n */\nexport type QueryRequestType = Omit<GetExploreData[\"query\"], \"listType\">;\n\ntype ExploreResponse = { data?: GetExploreResponse };\n\nexport type ListType = GetExploreData[\"query\"][\"listType\"];\n\nexport type { ExploreResponse };\n\nexport type { GetExploreData };\n\nexport type TrendCoinResponse = { data?: GetTrendCoinResponse };\n\nexport type TrendsByNameResponse = { data?: GetTrendsByNameResponse };\n\n/**\n * Creates an explore query with the specified list type\n */\nconst createExploreQuery = (\n  query: QueryRequestType,\n  listType: ListType,\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  getExploreSDK({\n    ...options,\n    query: { ...query, listType },\n    ...getApiKeyMeta(),\n  });\n\n/** Get top gaining coins */\nexport const getCoinsTopGainers = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"TOP_GAINERS\", options);\n\n/** Get coins with highest 24h volume */\nexport const getCoinsTopVolume24h = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"TOP_VOLUME_24H\", options);\n\n/** Get most valuable coins */\nexport const getCoinsMostValuable = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"MOST_VALUABLE\", options);\n\n/** Get newly created coins */\nexport const getCoinsNew = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> => createExploreQuery(query, \"NEW\", options);\n\n/** Get recently traded coins */\nexport const getCoinsLastTraded = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"LAST_TRADED\", options);\n\n/** Get recently traded unique coins */\nexport const getCoinsLastTradedUnique = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"LAST_TRADED_UNIQUE\", options);\n\nexport const getCreatorCoins = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"NEW_CREATORS\", options);\n\nexport const getMostValuableCreatorCoins = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"MOST_VALUABLE_CREATORS\", options);\n\nexport const getExploreTopVolumeCreators24h = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"TOP_VOLUME_CREATORS_24H\", options);\n\nexport const getExploreTopVolumeAll24h = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"TOP_VOLUME_ALL_24H\", options);\n\nexport const getExploreNewAll = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> => createExploreQuery(query, \"NEW_ALL\", options);\n\nexport const getExploreFeaturedCreators = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"FEATURED_CREATORS\", options);\n\nexport const getExploreFeaturedVideos = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"FEATURED_VIDEOS\", options);\n\n/** Get trending coins across all types */\nexport const getTrendingAll = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"TRENDING_ALL\", options);\n\n/** Get trending creator coins */\nexport const getTrendingCreators = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"TRENDING_CREATORS\", options);\n\n/** Get trending posts */\nexport const getTrendingPosts = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"TRENDING_POSTS\", options);\n\n/** Get most valuable trend coins */\nexport const getMostValuableTrends = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"MOST_VALUABLE_TRENDS\", options);\n\n/** Get new trend coins */\nexport const getNewTrends = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> => createExploreQuery(query, \"NEW_TRENDS\", options);\n\n/** Get top volume trend coins (24h) */\nexport const getTopVolumeTrends24h = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"TOP_VOLUME_TRENDS_24H\", options);\n\n/** Get trending trend coins */\nexport const getTrendingTrends = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"TRENDING_TRENDS\", options);\n\n/** Get most valuable coins across all types */\nexport const getMostValuableAll = (\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> =>\n  createExploreQuery(query, \"MOST_VALUABLE_ALL\", options);\n\n/** Look up a single trend coin by ticker (case-insensitive) */\nexport const getTrend = (\n  query: GetTrendCoinData[\"query\"],\n  options?: RequestOptionsType<GetTrendCoinData>,\n): Promise<TrendCoinResponse> =>\n  getTrendCoinSDK({\n    ...options,\n    query,\n    ...getApiKeyMeta(),\n  });\n\n/** Search trend coins by name, with fuzzy search (paginated) */\nexport const getTrends = (\n  query: GetTrendsByNameData[\"query\"],\n  options?: RequestOptionsType<GetTrendsByNameData>,\n): Promise<TrendsByNameResponse> =>\n  getTrendsByNameSDK({\n    ...options,\n    query,\n    ...getApiKeyMeta(),\n  });\n\n/** Generic explore query for any list type */\nexport const getExploreList = (\n  listType: ListType,\n  query: QueryRequestType = {},\n  options?: RequestOptionsType<GetExploreData>,\n): Promise<ExploreResponse> => createExploreQuery(query, listType, options);\n","import {\n  GetCoinCommentsData,\n  GetCoinCommentsResponse,\n  GetCoinData,\n  GetCoinHoldersData,\n  GetCoinHoldersResponse,\n  GetCoinPriceHistoryData,\n  GetCoinPriceHistoryResponse,\n  GetCoinResponse,\n  GetCoinsData,\n  GetCoinsResponse,\n  GetCoinSwapsData,\n  GetCoinSwapsResponse,\n  GetProfileBalancesData,\n  GetProfileBalancesResponse,\n  GetProfileCoinsData,\n  GetProfileCoinsResponse,\n  GetProfileData,\n  GetProfileResponse,\n  GetFeaturedCreatorsData,\n  GetFeaturedCreatorsResponse,\n  GetTraderLeaderboardData,\n  GetTraderLeaderboardResponse,\n  GetProfileSocialResponse,\n  GetProfileSocialData,\n  GetTokenInfoData,\n  GetTokenInfoResponse,\n  GetContentCoinPoolConfigData,\n  GetContentCoinPoolConfigResponse,\n  GetCreatorCoinPoolConfigData,\n  GetCreatorCoinPoolConfigResponse,\n  GetCreatorLivestreamCommentsData,\n  GetCreatorLivestreamCommentsResponse,\n  GetWalletTradeActivityData,\n  GetWalletTradeActivityResponse,\n} from \"../client/types.gen\";\nimport {\n  getCoin as getCoinSDK,\n  getCoins as getCoinsSDK,\n  getCoinComments as getCoinCommentsSDK,\n  getCoinHolders as getCoinHoldersSDK,\n  getCoinPriceHistory as getCoinPriceHistorySDK,\n  getCoinSwaps as getCoinSwapsSDK,\n  getProfile as getProfileSDK,\n  getProfileBalances as getProfileBalancesSDK,\n  getProfileCoins as getProfileCoinsSDK,\n  getProfileSocial as getProfileSocialSDK,\n  getTokenInfo as getTokenInfoSDK,\n  getFeaturedCreators as getFeaturedCreatorsSDK,\n  getTraderLeaderboard as getTraderLeaderboardSDK,\n  getContentCoinPoolConfig as getContentCoinPoolConfigSDK,\n  getCreatorCoinPoolConfig as getCreatorCoinPoolConfigSDK,\n  getCreatorLivestreamComments as getCreatorLivestreamCommentsSDK,\n  getWalletTradeActivity as getWalletTradeActivitySDK,\n} from \"../client/sdk.gen\";\nimport { getApiKeyMeta } from \"./api-key\";\nimport { RequestOptionsType } from \"./query-types\";\nimport { RequestResult } from \"@hey-api/client-fetch\";\n\nexport type { RequestResult };\n\ntype GetCoinQuery = GetCoinData[\"query\"];\nexport type { GetCoinQuery, GetCoinData };\nexport type { GetCoinResponse } from \"../client/types.gen\";\n\nexport type CoinData = NonNullable<GetCoinResponse[\"zora20Token\"]>;\n\nexport const getCoin = async (\n  query: GetCoinQuery,\n  options?: RequestOptionsType<GetCoinData>,\n): Promise<RequestResult<GetCoinResponse>> => {\n  return await getCoinSDK({\n    ...options,\n    query,\n    ...getApiKeyMeta(),\n  });\n};\n\ntype GetCoinsQuery = GetCoinsData[\"query\"];\nexport type { GetCoinsQuery, GetCoinsData };\nexport type { GetCoinsResponse } from \"../client/types.gen\";\n\nexport const getCoins = async (\n  query: GetCoinsQuery,\n  options?: RequestOptionsType<GetCoinsData>,\n): Promise<RequestResult<GetCoinsResponse>> => {\n  return await getCoinsSDK({\n    query: {\n      coins: query.coins.map((coinData) => JSON.stringify(coinData)) as any,\n    },\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetCoinHoldersQuery = GetCoinHoldersData[\"query\"];\nexport type { GetCoinHoldersQuery, GetCoinHoldersData };\nexport type { GetCoinHoldersResponse } from \"../client/types.gen\";\n\nexport const getCoinHolders = async (\n  query: GetCoinHoldersQuery,\n  options?: RequestOptionsType<GetCoinHoldersData>,\n): Promise<RequestResult<GetCoinHoldersResponse>> => {\n  return await getCoinHoldersSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetCoinPriceHistoryQuery = GetCoinPriceHistoryData[\"query\"];\nexport type { GetCoinPriceHistoryQuery, GetCoinPriceHistoryData };\nexport type { GetCoinPriceHistoryResponse } from \"../client/types.gen\";\n\nexport const getCoinPriceHistory = async (\n  query: GetCoinPriceHistoryQuery,\n  options?: RequestOptionsType<GetCoinPriceHistoryData>,\n): Promise<RequestResult<GetCoinPriceHistoryResponse>> => {\n  return await getCoinPriceHistorySDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetCoinSwapsQuery = GetCoinSwapsData[\"query\"];\nexport type { GetCoinSwapsQuery, GetCoinSwapsData };\nexport type { GetCoinSwapsResponse } from \"../client/types.gen\";\n\nexport const getCoinSwaps = async (\n  query: GetCoinSwapsQuery,\n  options?: RequestOptionsType<GetCoinSwapsData>,\n): Promise<RequestResult<GetCoinSwapsResponse>> => {\n  return await getCoinSwapsSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetCoinCommentsQuery = GetCoinCommentsData[\"query\"];\nexport type { GetCoinCommentsQuery, GetCoinCommentsData };\nexport type { GetCoinCommentsResponse } from \"../client/types.gen\";\n\nexport const getCoinComments = async (\n  query: GetCoinCommentsQuery,\n  options?: RequestOptionsType<GetCoinCommentsData>,\n): Promise<RequestResult<GetCoinCommentsResponse>> => {\n  return await getCoinCommentsSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetProfileQuery = GetProfileData[\"query\"];\nexport type { GetProfileQuery, GetProfileData };\nexport type { GetProfileResponse } from \"../client/types.gen\";\n\nexport const getProfile = async (\n  query: GetProfileQuery,\n  options?: RequestOptionsType<GetProfileData>,\n): Promise<RequestResult<GetProfileResponse>> => {\n  return await getProfileSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetProfileCoinsQuery = GetProfileCoinsData[\"query\"];\nexport type { GetProfileCoinsQuery, GetProfileCoinsData };\nexport type { GetProfileCoinsResponse } from \"../client/types.gen\";\n\nexport const getProfileCoins = async (\n  query: GetProfileCoinsQuery,\n  options?: RequestOptionsType<GetProfileCoinsData>,\n): Promise<RequestResult<GetProfileCoinsResponse>> => {\n  return await getProfileCoinsSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetProfileBalancesQuery = GetProfileBalancesData[\"query\"];\nexport type { GetProfileBalancesQuery, GetProfileBalancesData };\nexport type { GetProfileBalancesResponse } from \"../client/types.gen\";\n\nexport const getProfileBalances = async (\n  query: GetProfileBalancesQuery,\n  options?: RequestOptionsType<GetProfileBalancesData>,\n): Promise<RequestResult<GetProfileBalancesResponse>> => {\n  return await getProfileBalancesSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetProfileSocialQuery = GetProfileSocialData[\"query\"];\nexport type { GetProfileSocialQuery, GetProfileSocialData };\nexport type { GetProfileSocialResponse } from \"../client/types.gen\";\n\nexport const getProfileSocial = async (\n  query: GetProfileSocialQuery,\n  options?: RequestOptionsType<GetProfileSocialData>,\n): Promise<RequestResult<GetProfileSocialResponse>> => {\n  return await getProfileSocialSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetTokenInfoQuery = GetTokenInfoData[\"query\"];\nexport type { GetTokenInfoQuery, GetTokenInfoData };\nexport type { GetTokenInfoResponse } from \"../client/types.gen\";\n\nexport const getTokenInfo = async (\n  query: GetTokenInfoQuery,\n  options?: RequestOptionsType<GetTokenInfoData>,\n): Promise<RequestResult<GetTokenInfoResponse>> => {\n  return await getTokenInfoSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetFeaturedCreatorsQuery = GetFeaturedCreatorsData[\"query\"];\nexport type { GetFeaturedCreatorsQuery, GetFeaturedCreatorsData };\nexport type { GetFeaturedCreatorsResponse } from \"../client/types.gen\";\n\nexport const getFeaturedCreators = async (\n  query: GetFeaturedCreatorsQuery = {},\n  options?: RequestOptionsType<GetFeaturedCreatorsData>,\n): Promise<RequestResult<GetFeaturedCreatorsResponse>> => {\n  return await getFeaturedCreatorsSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetTraderLeaderboardQuery = GetTraderLeaderboardData[\"query\"];\nexport type { GetTraderLeaderboardQuery, GetTraderLeaderboardData };\nexport type { GetTraderLeaderboardResponse } from \"../client/types.gen\";\n\nexport const getTraderLeaderboard = async (\n  query: GetTraderLeaderboardQuery = {},\n  options?: RequestOptionsType<GetTraderLeaderboardData>,\n): Promise<RequestResult<GetTraderLeaderboardResponse>> => {\n  return await getTraderLeaderboardSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetContentCoinPoolConfigQuery = GetContentCoinPoolConfigData[\"query\"];\nexport type { GetContentCoinPoolConfigQuery, GetContentCoinPoolConfigData };\nexport type { GetContentCoinPoolConfigResponse } from \"../client/types.gen\";\n\nexport const getContentCoinPoolConfig = async (\n  query: GetContentCoinPoolConfigQuery,\n  options?: RequestOptionsType<GetContentCoinPoolConfigData>,\n): Promise<RequestResult<GetContentCoinPoolConfigResponse>> => {\n  return await getContentCoinPoolConfigSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetCreatorCoinPoolConfigQuery = GetCreatorCoinPoolConfigData[\"query\"];\nexport type { GetCreatorCoinPoolConfigQuery, GetCreatorCoinPoolConfigData };\nexport type { GetCreatorCoinPoolConfigResponse } from \"../client/types.gen\";\n\nexport const getCreatorCoinPoolConfig = async (\n  query: GetCreatorCoinPoolConfigQuery,\n  options?: RequestOptionsType<GetCreatorCoinPoolConfigData>,\n): Promise<RequestResult<GetCreatorCoinPoolConfigResponse>> => {\n  return await getCreatorCoinPoolConfigSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetCreatorLivestreamCommentsQuery =\n  GetCreatorLivestreamCommentsData[\"query\"];\nexport type {\n  GetCreatorLivestreamCommentsQuery,\n  GetCreatorLivestreamCommentsData,\n};\nexport type { GetCreatorLivestreamCommentsResponse } from \"../client/types.gen\";\n\nexport const getCreatorLivestreamComments = async (\n  query: GetCreatorLivestreamCommentsQuery,\n  options?: RequestOptionsType<GetCreatorLivestreamCommentsData>,\n): Promise<RequestResult<GetCreatorLivestreamCommentsResponse>> => {\n  return await getCreatorLivestreamCommentsSDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n\ntype GetWalletTradeActivityQuery = GetWalletTradeActivityData[\"query\"];\nexport type { GetWalletTradeActivityQuery, GetWalletTradeActivityData };\nexport type { GetWalletTradeActivityResponse } from \"../client/types.gen\";\n\nexport const getWalletTradeActivity = async (\n  query: GetWalletTradeActivityQuery,\n  options?: RequestOptionsType<GetWalletTradeActivityData>,\n): Promise<RequestResult<GetWalletTradeActivityResponse>> => {\n  return await getWalletTradeActivitySDK({\n    query,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n","import {\n  PostCreateContentData,\n  PostCreateContentResponse,\n} from \"../client/types.gen\";\nimport { postCreateContent as postCreateContentSDK } from \"../client/sdk.gen\";\nimport { getApiKeyMeta } from \"./api-key\";\nimport { RequestOptionsType } from \"./query-types\";\nimport { RequestResult } from \"@hey-api/client-fetch\";\n\ntype PostCreateContentQuery = PostCreateContentData[\"body\"];\nexport type { PostCreateContentQuery, PostCreateContentResponse };\n\nexport type CoinCreateData = NonNullable<PostCreateContentResponse>;\n\nexport const postCreateContent = async (\n  body: PostCreateContentQuery,\n  options?: RequestOptionsType<PostCreateContentData>,\n): Promise<RequestResult<PostCreateContentResponse>> => {\n  return await postCreateContentSDK({\n    ...options,\n    body,\n    ...getApiKeyMeta(),\n  });\n};\n","import {\n  GetProfileBySocialHandleData,\n  GetProfileBySocialHandleResponse,\n} from \"../client/types.gen\";\nimport { getProfileBySocialHandle as getProfileBySocialHandleSDK } from \"../client/sdk.gen\";\nimport { getApiKeyMeta } from \"./api-key\";\nimport { RequestOptionsType } from \"./query-types\";\nimport { RequestResult } from \"@hey-api/client-fetch\";\n\ntype GetProfileBySocialHandleQuery = GetProfileBySocialHandleData[\"query\"];\nexport type { GetProfileBySocialHandleQuery, GetProfileBySocialHandleData };\nexport type { GetProfileBySocialHandleResponse } from \"../client/types.gen\";\n\nexport const getProfileBySocialHandle = async (\n  query: GetProfileBySocialHandleQuery,\n  options?: RequestOptionsType<GetProfileBySocialHandleData>,\n): Promise<RequestResult<GetProfileBySocialHandleResponse>> => {\n  return await getProfileBySocialHandleSDK({\n    ...options,\n    query,\n    ...getApiKeyMeta(),\n  });\n};\n","import {\n  Abi,\n  BaseError,\n  ContractFunctionRevertedError,\n  decodeErrorResult,\n  Hex,\n} from \"viem\";\n\nexport function rethrowDecodedRevert(err: unknown, abi: Abi): never {\n  if (err instanceof BaseError) {\n    const revertError = err.walk(\n      (e) => e instanceof ContractFunctionRevertedError,\n    );\n    if (revertError instanceof ContractFunctionRevertedError) {\n      // Try to decode using factory ABI\n      try {\n        const revertData =\n          typeof (revertError as any).data === \"object\" &&\n          (revertError as any).data !== null &&\n          \"data\" in (revertError as any).data\n            ? (revertError as any).data.data\n            : (revertError as any).data;\n        const decoded = decodeErrorResult({\n          abi,\n          data: revertData as Hex,\n        });\n        const name = decoded.errorName;\n        const args = decoded.args as ReadonlyArray<unknown> | undefined;\n        const message =\n          Array.isArray(args) && args.length > 0\n            ? `${name}(${args.map((a) => String(a)).join(\", \")})`\n            : name;\n        throw new Error(`Create coin transaction reverted: ${message}`);\n      } catch {\n        const errorName = (revertError as any).data?.errorName as\n          | string\n          | undefined;\n        if (errorName) {\n          const args = (revertError as any).data?.args as unknown[] | undefined;\n          const message =\n            Array.isArray(args) && args.length > 0\n              ? `${errorName}(${args.map((a) => String(a)).join(\", \")})`\n              : errorName;\n          throw new Error(`Create coin transaction reverted: ${message}`);\n        }\n      }\n    }\n  }\n  throw err;\n}\n","import { coinABI } from \"@zoralabs/protocol-deployments\";\nimport { validateClientNetwork } from \"../utils/validateClientNetwork\";\nimport {\n  Account,\n  Address,\n  parseEventLogs,\n  SimulateContractParameters,\n  WalletClient,\n} from \"viem\";\nimport { GenericPublicClient } from \"../utils/genericPublicClient\";\nimport { getAttribution } from \"../utils/attribution\";\n\nexport type UpdateCoinURIArgs = {\n  coin: Address;\n  newURI: string;\n};\n\nexport function updateCoinURICall({\n  newURI,\n  coin,\n}: UpdateCoinURIArgs): SimulateContractParameters {\n  if (!newURI.startsWith(\"ipfs://\")) {\n    throw new Error(\"URI needs to be an ipfs:// prefix uri\");\n  }\n\n  return {\n    abi: coinABI,\n    address: coin,\n    functionName: \"setContractURI\",\n    args: [newURI],\n    dataSuffix: getAttribution(),\n  };\n}\n\nexport async function updateCoinURI(\n  args: UpdateCoinURIArgs,\n  walletClient: WalletClient,\n  publicClient: GenericPublicClient,\n  account?: Account | Address,\n) {\n  validateClientNetwork(publicClient);\n  const call = updateCoinURICall(args);\n  const { request } = await publicClient.simulateContract({\n    ...call,\n    account: account ?? walletClient.account,\n  });\n  const hash = await walletClient.writeContract(request);\n  const receipt = await publicClient.waitForTransactionReceipt({ hash });\n  const eventLogs = parseEventLogs({ abi: coinABI, logs: receipt.logs });\n  const uriUpdated = eventLogs.find(\n    (log) => log.eventName === \"ContractURIUpdated\",\n  );\n\n  return { hash, receipt, uriUpdated };\n}\n","import { Hex, keccak256, slice, toHex } from \"viem\";\n\nexport function getAttribution(): Hex {\n  const hash = keccak256(toHex(\"api-sdk.zora.engineering\"));\n  return slice(hash, 0, 4) as Hex;\n}\n","import { coinABI } from \"@zoralabs/protocol-deployments\";\nimport { validateClientNetwork } from \"../utils/validateClientNetwork\";\nimport {\n  Account,\n  Address,\n  parseEventLogs,\n  SimulateContractParameters,\n  WalletClient,\n} from \"viem\";\nimport { GenericPublicClient } from \"../utils/genericPublicClient\";\nimport { getAttribution } from \"../utils/attribution\";\n\nexport type UpdatePayoutRecipientArgs = {\n  coin: Address;\n  newPayoutRecipient: string;\n};\n\nexport function updatePayoutRecipientCall({\n  newPayoutRecipient,\n  coin,\n}: UpdatePayoutRecipientArgs): SimulateContractParameters {\n  return {\n    abi: coinABI,\n    address: coin,\n    functionName: \"setPayoutRecipient\",\n    args: [newPayoutRecipient],\n    dataSuffix: getAttribution(),\n  };\n}\n\nexport async function updatePayoutRecipient(\n  args: UpdatePayoutRecipientArgs,\n  walletClient: WalletClient,\n  publicClient: GenericPublicClient,\n  account?: Account | Address,\n) {\n  validateClientNetwork(publicClient);\n  const call = updatePayoutRecipientCall(args);\n  const { request } = await publicClient.simulateContract({\n    ...call,\n    account: account ?? walletClient.account!,\n  });\n  const hash = await walletClient.writeContract(request);\n  const receipt = await publicClient.waitForTransactionReceipt({ hash });\n  const eventLogs = parseEventLogs({ abi: coinABI, logs: receipt.logs });\n  const payoutRecipientUpdated = eventLogs.find(\n    (log) => log.eventName === \"CoinPayoutRecipientUpdated\",\n  );\n\n  return { hash, receipt, payoutRecipientUpdated };\n}\n","import { permit2ABI, permit2Address } from \"@zoralabs/protocol-deployments\";\nimport {\n  Account,\n  Address,\n  erc20Abi,\n  WalletClient,\n  maxUint256,\n  Hex,\n} from \"viem\";\nimport { base } from \"viem/chains\";\nimport { postQuote, PostQuoteResponse } from \"../client\";\nimport { GenericPublicClient } from \"../utils/genericPublicClient\";\n\ntype TradeERC20 = {\n  type: \"erc20\";\n  address: Address;\n};\n\ntype TradeETH = {\n  type: \"eth\";\n};\n\ntype PermitDetails = {\n  token: Address;\n  amount: bigint;\n  expiration: number;\n  nonce: number;\n};\n\ntype Permit = {\n  details: PermitDetails;\n  spender: Address;\n  sigDeadline: bigint;\n};\n\ntype PermitDetailsStringAmounts = {\n  token: Address;\n  amount: string;\n  expiration: number;\n  nonce: number;\n};\n\ntype PermitStringAmounts = {\n  details: PermitDetailsStringAmounts;\n  spender: Address;\n  sigDeadline: string;\n};\n\ntype SignatureWithPermit<TPermit = Permit> = {\n  signature: Hex;\n  permit: TPermit;\n};\n\nfunction convertBigIntToString(permit: Permit): PermitStringAmounts {\n  return {\n    ...permit,\n    details: {\n      ...permit.details,\n      amount: `${permit.details.amount}`,\n    },\n    sigDeadline: `${permit.sigDeadline}`,\n  };\n}\n\nconst PERMIT_SINGLE_TYPES = {\n  PermitSingle: [\n    { name: \"details\", type: \"PermitDetails\" },\n    { name: \"spender\", type: \"address\" },\n    { name: \"sigDeadline\", type: \"uint256\" },\n  ],\n  PermitDetails: [\n    { name: \"token\", type: \"address\" },\n    { name: \"amount\", type: \"uint160\" },\n    { name: \"expiration\", type: \"uint48\" },\n    { name: \"nonce\", type: \"uint48\" },\n  ],\n};\n\ntype TradeCurrency = TradeERC20 | TradeETH;\n\nexport type TradeParameters = {\n  sell: TradeCurrency;\n  buy: TradeCurrency;\n  amountIn: bigint;\n  slippage?: number;\n  // can be smart wallet or EOA here.\n  sender: Address;\n  // needs to be EOA, if signer is blank assumes EOA in sender.\n  signer?: Address;\n  recipient?: Address;\n  signatures?: SignatureWithPermit<PermitStringAmounts>[];\n  permitActiveSeconds?: number;\n};\n\nexport async function tradeCoin({\n  tradeParameters,\n  walletClient,\n  account,\n  publicClient,\n  validateTransaction = true,\n}: {\n  tradeParameters: TradeParameters;\n  walletClient: WalletClient;\n  account?: Account | Address;\n  publicClient: GenericPublicClient;\n  validateTransaction?: boolean;\n}) {\n  const quote = await createTradeCall(tradeParameters);\n\n  if (!account) {\n    account = walletClient.account;\n  }\n  if (!account) {\n    throw new Error(\"Account is required\");\n  }\n\n  // Set default recipient to wallet sender address if not provided\n  if (!tradeParameters.recipient) {\n    tradeParameters.recipient =\n      typeof account === \"string\" ? account : account.address;\n  }\n\n  // todo replace any\n  const signatures: { signature: Hex; permit: any }[] = [];\n  if (quote.permits) {\n    for (const permit of quote.permits) {\n      // return values: amount, expiration, nonce\n      const [, , nonce] = await publicClient.readContract({\n        abi: permit2ABI,\n        address: permit2Address[base.id],\n        functionName: \"allowance\",\n        args: [\n          typeof account === \"string\" ? account : account.address,\n          permit.permit.details.token as Address,\n          permit.permit.spender as Address,\n        ],\n      });\n      const permitToken = permit.permit.details.token as Address;\n      const allowance = await publicClient.readContract({\n        abi: erc20Abi,\n        address: permitToken,\n        functionName: \"allowance\",\n        args: [\n          typeof account === \"string\" ? account : account.address,\n          permit2Address[base.id],\n        ],\n      });\n      if (allowance < BigInt(permit.permit.details.amount)) {\n        const approvalTx = await walletClient.writeContract({\n          abi: erc20Abi,\n          address: permitToken,\n          functionName: \"approve\",\n          chain: base,\n          args: [permit2Address[base.id], maxUint256],\n          account,\n        });\n        await publicClient.waitForTransactionReceipt({\n          hash: approvalTx,\n        });\n      }\n      const message = {\n        details: {\n          token: permit.permit.details.token as Address,\n          amount: BigInt(permit.permit.details.amount!),\n          expiration: Number(permit.permit.details.expiration!),\n          nonce: nonce,\n        },\n        spender: permit.permit.spender as Address,\n        sigDeadline: BigInt(permit.permit.sigDeadline!),\n      };\n      const signature = await walletClient.signTypedData({\n        domain: {\n          name: \"Permit2\",\n          chainId: base.id,\n          verifyingContract: permit2Address[base.id],\n        },\n        primaryType: \"PermitSingle\",\n        types: PERMIT_SINGLE_TYPES,\n        message,\n        account,\n      });\n      signatures.push({\n        signature,\n        permit: convertBigIntToString(message),\n      });\n    }\n  }\n\n  const newQuote = await createTradeCall({\n    ...tradeParameters,\n    signatures,\n  });\n\n  const call = {\n    to: newQuote.call.target as Address,\n    data: newQuote.call.data as Hex,\n    value: BigInt(newQuote.call.value),\n    chain: base,\n    account,\n  };\n\n  // simulate call\n  if (validateTransaction) {\n    await publicClient.call(call);\n  }\n\n  const gasEstimate = validateTransaction\n    ? await publicClient.estimateGas(call)\n    : 10_000_000n;\n  const gasPrice = await publicClient.getGasPrice();\n\n  const tx = await walletClient.sendTransaction({\n    ...call,\n    gasPrice,\n    gas: gasEstimate,\n  });\n\n  const receipt = await publicClient.waitForTransactionReceipt({\n    hash: tx,\n  });\n\n  return receipt;\n}\n\nexport async function createTradeCall(\n  tradeParameters: TradeParameters,\n): Promise<PostQuoteResponse> {\n  if (tradeParameters.slippage && tradeParameters.slippage > 1) {\n    throw new Error(\"Slippage must be less than 1, max 0.99\");\n  }\n  if (tradeParameters.amountIn === BigInt(0)) {\n    throw new Error(\"Amount in must be greater than 0\");\n  }\n\n  const quote = await postQuote({\n    body: {\n      tokenIn: tradeParameters.sell,\n      tokenOut: tradeParameters.buy,\n      amountIn: tradeParameters.amountIn.toString(),\n      slippage: tradeParameters.slippage,\n      chainId: base.id,\n      sender: tradeParameters.sender,\n      recipient: tradeParameters.recipient || tradeParameters.sender,\n      signatures: tradeParameters.signatures,\n    },\n  });\n\n  if (!quote.data) {\n    console.error(quote);\n    const errorBody = quote.error as\n      | { error?: string; errorType?: string }\n      | undefined;\n    const errorMessage = errorBody?.error || \"Quote failed\";\n    const err = new Error(errorMessage);\n    (err as any).errorType = errorBody?.errorType;\n    (err as any).errorBody = errorBody;\n    throw err;\n  }\n\n  return quote.data;\n}\n","import { client } from \"../client/client.gen\";\nimport { createConfig } from \"@hey-api/client-fetch\";\nimport { getApiKeyMeta } from \"./api-key\";\n\nexport const apiGet = (path: string, data?: Record<string, unknown>) =>\n  client.get({ url: path, query: data, ...getApiKeyMeta() });\n\nexport const apiPost = (path: string, data?: Record<string, unknown>) =>\n  client.post({ url: path, body: data, ...getApiKeyMeta() });\n\nexport const setApiBaseUrl = (baseUrl: string) => {\n  client.setConfig(createConfig({ baseUrl }));\n};\n","import {\n  CreateMetadataParameters,\n  Uploader,\n  UploadResult,\n  ValidMetadataURI,\n} from \"./types\";\n\ntype Metadata = {\n  name: string;\n  symbol: string;\n  description: string;\n  image: string;\n  properties?: Record<string, string>;\n  animation_url?: string;\n  content?: {\n    uri: string;\n    mime: string | undefined;\n  };\n};\n\nexport function validateImageMimeType(mimeType: string) {\n  if (\n    ![\n      \"image/png\",\n      \"image/jpeg\",\n      \"image/jpg\",\n      \"image/gif\",\n      \"image/svg+xml\",\n    ].includes(mimeType)\n  ) {\n    throw new Error(\"Image must be a PNG, JPEG, JPG, GIF or SVG\");\n  }\n}\n\nexport function getURLFromUploadResult(uploadResult: UploadResult) {\n  return new URL(uploadResult.url);\n}\n\nexport class CoinMetadataBuilder {\n  private name: string | undefined;\n  private description: string | undefined;\n  private symbol: string | undefined;\n  private imageFile: File | undefined;\n  private imageURL: URL | undefined;\n  private mediaFile: File | undefined;\n  private mediaURL: URL | undefined;\n  private mediaMimeType: string | undefined;\n  private properties: Record<string, string> | undefined;\n\n  withName(name: string) {\n    this.name = name;\n    if (typeof name !== \"string\") {\n      throw new Error(\"Name must be a string\");\n    }\n\n    return this;\n  }\n\n  withSymbol(symbol: string) {\n    this.symbol = symbol;\n    if (typeof symbol !== \"string\") {\n      throw new Error(\"Symbol must be a string\");\n    }\n\n    return this;\n  }\n\n  withDescription(description: string) {\n    this.description = description;\n    if (typeof description !== \"string\") {\n      throw new Error(\"Description must be a string\");\n    }\n\n    return this;\n  }\n\n  withImage(image: File) {\n    if (this.imageURL) {\n      throw new Error(\"Image URL already set\");\n    }\n    if (!(image instanceof File)) {\n      throw new Error(\"Image must be a File\");\n    }\n    validateImageMimeType(image.type);\n    this.imageFile = image;\n\n    return this;\n  }\n\n  withImageURI(imageURI: string) {\n    if (this.imageFile) {\n      throw new Error(\"Image file already set\");\n    }\n    if (typeof imageURI !== \"string\") {\n      throw new Error(\"Image URI must be a string\");\n    }\n    const url = new URL(imageURI);\n    this.imageURL = url;\n\n    return this;\n  }\n\n  withProperties(properties: Record<string, string>) {\n    for (const [key, value] of Object.entries(properties)) {\n      if (typeof key !== \"string\") {\n        throw new Error(\"Property key must be a string\");\n      }\n      if (typeof value !== \"string\") {\n        throw new Error(\"Property value must be a string\");\n      }\n    }\n    if (!this.properties) {\n      this.properties = {};\n    }\n    this.properties = { ...this.properties, ...properties };\n\n    return this;\n  }\n\n  withMedia(media: File) {\n    if (this.mediaURL) {\n      throw new Error(\"Media URL already set\");\n    }\n    if (!(media instanceof File)) {\n      throw new Error(\"Media must be a File\");\n    }\n    this.mediaMimeType = media.type;\n    this.mediaFile = media;\n\n    return this;\n  }\n\n  withMediaURI(mediaURI: string, mediaMimeType: string | undefined) {\n    if (this.mediaFile) {\n      throw new Error(\"Media file already set\");\n    }\n    if (typeof mediaURI !== \"string\") {\n      throw new Error(\"Media URI must be a string\");\n    }\n    const url = new URL(mediaURI);\n    this.mediaURL = url;\n    this.mediaMimeType = mediaMimeType;\n\n    return this;\n  }\n\n  validate() {\n    if (!this.name) {\n      throw new Error(\"Name is required\");\n    }\n    if (!this.symbol) {\n      throw new Error(\"Symbol is required\");\n    }\n    if (!this.imageFile && !this.imageURL) {\n      throw new Error(\"Image is required\");\n    }\n\n    return this;\n  }\n\n  generateMetadata(): Metadata {\n    return {\n      name: this.name!,\n      symbol: this.symbol!,\n      description: this.description!,\n      image: this.imageURL!.toString(),\n      animation_url: this.mediaURL?.toString(),\n      content: this.mediaURL\n        ? {\n            uri: this.mediaURL?.toString(),\n            mime: this.mediaMimeType,\n          }\n        : undefined,\n      properties: this.properties,\n    };\n  }\n\n  async upload(uploader: Uploader): Promise<{\n    url: ValidMetadataURI;\n    createMetadataParameters: CreateMetadataParameters;\n    metadata: Metadata;\n  }> {\n    this.validate();\n\n    if (this.imageFile) {\n      const uploadResult = await uploader.upload(this.imageFile);\n      this.imageURL = getURLFromUploadResult(uploadResult);\n    }\n    if (this.mediaFile) {\n      const uploadResult = await uploader.upload(this.mediaFile);\n      this.mediaURL = getURLFromUploadResult(uploadResult);\n    }\n    const metadata = this.generateMetadata();\n    const uploadResult = await uploader.upload(\n      new File([JSON.stringify(metadata)], \"metadata.json\", {\n        type: \"application/json\",\n      }),\n    );\n\n    return {\n      url: getURLFromUploadResult(uploadResult).toString() as ValidMetadataURI,\n      createMetadataParameters: {\n        name: this.name!,\n        symbol: this.symbol!,\n        metadata: {\n          type: \"RAW_URI\",\n          uri: uploadResult.url,\n        },\n      },\n      metadata,\n    };\n  }\n}\n\nexport function createMetadataBuilder() {\n  return new CoinMetadataBuilder();\n}\n","import {\n  SetCreateUploadJwtData,\n  SetCreateUploadJwtResponse,\n} from \"../client/types.gen\";\nimport { setCreateUploadJwt as setCreateUploadJwtSDK } from \"../client/sdk.gen\";\nimport { getApiKeyMeta } from \"./api-key\";\nimport { RequestOptionsType } from \"./query-types\";\nimport { RequestResult } from \"@hey-api/client-fetch\";\n\ntype SetCreateUploadJwtQuery = SetCreateUploadJwtData[\"body\"];\nexport type { SetCreateUploadJwtQuery, SetCreateUploadJwtData };\nexport type { SetCreateUploadJwtResponse } from \"../client/types.gen\";\n\nexport const setCreateUploadJwt = async (\n  body: SetCreateUploadJwtQuery,\n  options?: RequestOptionsType<SetCreateUploadJwtData>,\n): Promise<RequestResult<SetCreateUploadJwtResponse>> => {\n  return await setCreateUploadJwtSDK({\n    body,\n    ...getApiKeyMeta(),\n    ...options,\n  });\n};\n","import { Address } from \"viem\";\nimport { Uploader, UploadOptions, UploadResult } from \"../types\";\nimport { getApiKey } from \"../../api/api-key\";\nimport { setCreateUploadJwt } from \"../../api/internal\";\n\nconst JWT_TTL_MS = 1000 * 60 * 60; // 1 hour\nconst JWT_FETCH_TIMEOUT_MS = 15_000; // 15 seconds\n\n/**\n * Zora IPFS uploader implementation\n */\nexport class ZoraUploader implements Uploader {\n  constructor(creatorAddress: Address) {\n    this.creatorAddress = creatorAddress;\n    if (!getApiKey()) {\n      throw new Error(\"API key is required for metadata interactions\");\n    }\n  }\n\n  private creatorAddress: Address;\n  private jwtApiKey: string | undefined;\n  private jwtApiKeyExpiresAt: number | undefined;\n\n  private invalidateJwt() {\n    this.jwtApiKey = undefined;\n    this.jwtApiKeyExpiresAt = undefined;\n  }\n\n  private async getJWTApiKey(signal?: AbortSignal) {\n    if (\n      this.jwtApiKey &&\n      this.jwtApiKeyExpiresAt &&\n      this.jwtApiKeyExpiresAt > Date.now()\n    ) {\n      return this.jwtApiKey;\n    }\n\n    const jwtSignal = AbortSignal.timeout(JWT_FETCH_TIMEOUT_MS);\n    const combinedSignal = signal\n      ? AbortSignal.any([signal, jwtSignal])\n      : jwtSignal;\n\n    const response = await setCreateUploadJwt(\n      {\n        creatorAddress: this.creatorAddress,\n      },\n      { signal: combinedSignal },\n    );\n    this.jwtApiKey = response.data?.createUploadJwtFromApiKey;\n    if (!this.jwtApiKey) {\n      throw new Error(\"Failed to create upload JWT\");\n    }\n\n    this.jwtApiKeyExpiresAt = Date.now() + JWT_TTL_MS;\n\n    return this.jwtApiKey;\n  }\n\n  private buildUploadSignal(options?: UploadOptions): AbortSignal | undefined {\n    const { signal, timeout } = options ?? {};\n    if (signal && timeout) {\n      return AbortSignal.any([signal, AbortSignal.timeout(timeout)]);\n    }\n    if (timeout) {\n      return AbortSignal.timeout(timeout);\n    }\n    return signal;\n  }\n\n  private async doUpload(\n    file: File,\n    jwt: string,\n    signal?: AbortSignal,\n  ): Promise<Response> {\n    const formData = new FormData();\n    formData.append(\"file\", file, file.name);\n\n    return fetch(\"https://ipfs-uploader.zora.co/api/v0/add?cid-version=1\", {\n      method: \"POST\",\n      headers: {\n        Authorization: `Bearer ${jwt}`,\n        Accept: \"*/*\",\n      },\n      body: formData,\n      signal,\n    });\n  }\n\n  async upload(file: File, options?: UploadOptions): Promise<UploadResult> {\n    const uploadSignal = this.buildUploadSignal(options);\n\n    const jwt = await this.getJWTApiKey(uploadSignal);\n    let response = await this.doUpload(file, jwt, uploadSignal);\n\n    // On 401, refresh the JWT exactly once and retry\n    if (response.status === 401) {\n      this.invalidateJwt();\n      const freshJwt = await this.getJWTApiKey(uploadSignal);\n      response = await this.doUpload(file, freshJwt, uploadSignal);\n    }\n\n    if (!response.ok) {\n      console.error(await response.text());\n      throw new Error(`Failed to upload file: ${response.statusText}`);\n    }\n\n    const data = (await response.json()) as {\n      cid: string;\n      size: number | undefined;\n      mimeType: string | undefined;\n    };\n\n    return {\n      url: `ipfs://${data.cid}`,\n      size: data.size,\n      mimeType: data.mimeType,\n    };\n  }\n}\n\n/**\n * Create a new Zora IPFS uploader\n */\nexport function createZoraUploaderForCreator(\n  creatorAddress: Address,\n): Uploader {\n  return new ZoraUploader(creatorAddress);\n}\n"]}