{"version":3,"file":"getFundedBy.cjs","sources":["../../../../src/wallet/getFundedBy.ts"],"sourcesContent":["import {\n  BASE_URL,\n  buildQueryString,\n  handleResponse,\n  getHeaders,\n} from \"./utils\";\nimport type { GetFundedByRequest, GetFundedByResponse } from \"./types\";\n\n/**\n * Get the original funding source of a given wallet\n *\n * Discovers the original funding source of a wallet by analyzing its first incoming\n * SOL transfer. Useful for identifying if a wallet was funded by an exchange, another\n * wallet, etc.\n *\n * @beta The Wallet API is currently in beta. APIs and response formats may change.\n *\n * @param apiKey - Helius API key\n * @param params - Request parameters including wallet address\n * @returns Funding source information\n * @throws Error if HTTP error, wallet not found, or no funding transaction found (404)\n *\n * @example\n * ```ts\n * const fundedBy = await helius.wallet.getFundedBy({\n *   wallet: \"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY\"\n * });\n *\n * console.log(`Funded by: ${fundedBy.funder}`);\n * if (fundedBy.funderName) {\n *   console.log(`Funder name: ${fundedBy.funderName}`);\n *   console.log(`Funder type: ${fundedBy.funderType}`);\n * }\n * console.log(`Initial funding: ${fundedBy.amount} ${fundedBy.symbol}`);\n * console.log(`Explorer: ${fundedBy.explorerUrl}`);\n * ```\n */\nexport const getFundedBy = async (\n  apiKey: string,\n  params: GetFundedByRequest,\n  userAgent?: string\n): Promise<GetFundedByResponse> => {\n  const { wallet } = params;\n\n  const queryParams = {\n    \"api-key\": apiKey,\n  };\n\n  const url = `${BASE_URL}/${wallet}/funded-by${buildQueryString(queryParams)}`;\n\n  const response = await fetch(url, {\n    method: \"GET\",\n    headers: getHeaders(false, userAgent),\n  });\n\n  return handleResponse<GetFundedByResponse>(response);\n};\n"],"names":["BASE_URL","buildQueryString","getHeaders","handleResponse"],"mappings":";;;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACI,MAAM,WAAW,GAAG,OACzB,MAAc,EACd,MAA0B,EAC1B,SAAkB,KACc;AAChC,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM;AAEzB,IAAA,MAAM,WAAW,GAAG;AAClB,QAAA,SAAS,EAAE,MAAM;KAClB;AAED,IAAA,MAAM,GAAG,GAAG,CAAA,EAAGA,cAAQ,CAAA,CAAA,EAAI,MAAM,CAAA,UAAA,EAAaC,sBAAgB,CAAC,WAAW,CAAC,CAAA,CAAE;AAE7E,IAAA,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;AAChC,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,OAAO,EAAEC,gBAAU,CAAC,KAAK,EAAE,SAAS,CAAC;AACtC,KAAA,CAAC;AAEF,IAAA,OAAOC,oBAAc,CAAsB,QAAQ,CAAC;AACtD;;;;"}