@funkit/api-base 1.12.8 → 1.12.9

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @funkit/api-base
2
2
 
3
+ ## 1.12.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 96408f4: feat(api-base): added endpoint handlers for `/bluvo` frog routes, re-exported bunch of types from `@bluvo/sdk`
8
+
3
9
  ## 1.12.8
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/consts/api.ts
2
2
  var API_BASE_URL = "https://api.fun.xyz/v1";
3
- var MESH_API_BASE_URL = "https://frog.fun.xyz";
3
+ var FROG_API_BASE_URL = "https://frog.fun.xyz";
4
4
  var FUN_FAUCET_URL = "https://api.fun.xyz/demo-faucet";
5
5
 
6
6
  // src/utils/error.ts
@@ -364,7 +364,7 @@ async function getFrogAccount({
364
364
  subAccountType
365
365
  });
366
366
  return sendGetRequest({
367
- uri: `${MESH_API_BASE_URL}/api/account?${search}`,
367
+ uri: `${FROG_API_BASE_URL}/api/account?${search}`,
368
368
  ...options
369
369
  });
370
370
  }
@@ -374,7 +374,7 @@ async function createFrogAccount({
374
374
  ...options
375
375
  }) {
376
376
  return sendPostRequest({
377
- uri: `${MESH_API_BASE_URL}/api/account`,
377
+ uri: `${FROG_API_BASE_URL}/api/account`,
378
378
  body: {
379
379
  subAccountId,
380
380
  subAccountType
@@ -387,7 +387,7 @@ async function getBridgeCustomer({
387
387
  ...options
388
388
  }) {
389
389
  return sendGetRequest({
390
- uri: `${MESH_API_BASE_URL}/api/bridge?guid=${guid}`,
390
+ uri: `${FROG_API_BASE_URL}/api/bridge?guid=${guid}`,
391
391
  ...options
392
392
  });
393
393
  }
@@ -399,7 +399,7 @@ async function createBridgeCustomer({
399
399
  ...options
400
400
  }) {
401
401
  return sendPostRequest({
402
- uri: `${MESH_API_BASE_URL}/api/bridge`,
402
+ uri: `${FROG_API_BASE_URL}/api/bridge`,
403
403
  body: {
404
404
  guid,
405
405
  name,
@@ -414,7 +414,7 @@ async function getBridgeBankAccounts({
414
414
  ...options
415
415
  }) {
416
416
  return sendGetRequest({
417
- uri: `${MESH_API_BASE_URL}/api/bridge/bank?subAccountId=${subAccountId}`,
417
+ uri: `${FROG_API_BASE_URL}/api/bridge/bank?subAccountId=${subAccountId}`,
418
418
  ...options
419
419
  });
420
420
  }
@@ -427,7 +427,7 @@ async function createBridgeBankAccount({
427
427
  ...options
428
428
  }) {
429
429
  return sendPostRequest({
430
- uri: `${MESH_API_BASE_URL}/api/bridge/bank`,
430
+ uri: `${FROG_API_BASE_URL}/api/bridge/bank`,
431
431
  body: {
432
432
  subAccountId,
433
433
  tokenName,
@@ -443,7 +443,7 @@ function getBridgeKycLink({
443
443
  ...options
444
444
  }) {
445
445
  return sendGetRequest({
446
- uri: `${MESH_API_BASE_URL}/api/bridge/kyclink?guid=${guid}`,
446
+ uri: `${FROG_API_BASE_URL}/api/bridge/kyclink?guid=${guid}`,
447
447
  ...options
448
448
  });
449
449
  }
@@ -1260,7 +1260,7 @@ async function getMeldSupportedFiat({
1260
1260
  ...options
1261
1261
  }) {
1262
1262
  return sendGetRequest({
1263
- uri: `${MESH_API_BASE_URL}/api/meld/fiat`,
1263
+ uri: `${FROG_API_BASE_URL}/api/meld/fiat`,
1264
1264
  ...options,
1265
1265
  retryOptions: { maxAttempts: 2 }
1266
1266
  });
@@ -1270,7 +1270,7 @@ async function getMeldQuotes({
1270
1270
  ...options
1271
1271
  }) {
1272
1272
  return sendPostRequest({
1273
- uri: `${MESH_API_BASE_URL}/api/meld/quote`,
1273
+ uri: `${FROG_API_BASE_URL}/api/meld/quote`,
1274
1274
  body: params,
1275
1275
  retryOptions: { maxAttempts: 2 },
1276
1276
  ...options
@@ -1281,7 +1281,7 @@ async function startMeldSession({
1281
1281
  ...options
1282
1282
  }) {
1283
1283
  return sendPostRequest({
1284
- uri: `${MESH_API_BASE_URL}/api/meld/session`,
1284
+ uri: `${FROG_API_BASE_URL}/api/meld/session`,
1285
1285
  body: {
1286
1286
  sessionData: params,
1287
1287
  sessionType: "BUY"
@@ -1301,7 +1301,7 @@ async function getMeldDefaultFiat({
1301
1301
  ...categories ? { categories } : {}
1302
1302
  });
1303
1303
  return sendGetRequest({
1304
- uri: `${MESH_API_BASE_URL}/api/meld/defaultFiat?${urlParams}`,
1304
+ uri: `${FROG_API_BASE_URL}/api/meld/defaultFiat?${urlParams}`,
1305
1305
  ...options,
1306
1306
  retryOptions: { maxAttempts: 2 }
1307
1307
  });
@@ -1321,7 +1321,7 @@ async function getMeldFiatLimits({
1321
1321
  ...categories ? { categories } : {}
1322
1322
  });
1323
1323
  return sendGetRequest({
1324
- uri: `${MESH_API_BASE_URL}/api/meld/fiatLimit?${urlParams}`,
1324
+ uri: `${FROG_API_BASE_URL}/api/meld/fiatLimit?${urlParams}`,
1325
1325
  ...options,
1326
1326
  retryOptions: { maxAttempts: 2 }
1327
1327
  });
@@ -1525,13 +1525,74 @@ async function getFiatExchangeRates({
1525
1525
  ...options
1526
1526
  } = {}) {
1527
1527
  return sendGetRequest({
1528
- uri: `${MESH_API_BASE_URL}/api/exchange-rates`,
1528
+ uri: `${FROG_API_BASE_URL}/api/exchange-rates`,
1529
1529
  apiKey: "",
1530
1530
  // Just a hack to make typescript happy as we don't require an API Key for this endpoint
1531
1531
  ...options,
1532
1532
  retryOptions: { maxAttempts: 2 }
1533
1533
  });
1534
1534
  }
1535
+
1536
+ // src/services/bluvo/endpoints.ts
1537
+ async function bluvoGetWithdrawableBalanceById({
1538
+ id,
1539
+ logger
1540
+ }) {
1541
+ return sendPostRequest({
1542
+ uri: `${FROG_API_BASE_URL}/api/bluvo/balance`,
1543
+ body: { id },
1544
+ logger,
1545
+ apiKey: ""
1546
+ });
1547
+ }
1548
+ async function bluvoListExchanges({
1549
+ status,
1550
+ logger
1551
+ }) {
1552
+ return sendPostRequest({
1553
+ uri: `${FROG_API_BASE_URL}/api/bluvo/exchanges`,
1554
+ body: { status },
1555
+ logger,
1556
+ apiKey: ""
1557
+ });
1558
+ }
1559
+ async function bluvoGetWalletById({
1560
+ id,
1561
+ logger
1562
+ }) {
1563
+ return sendPostRequest({
1564
+ uri: `${FROG_API_BASE_URL}/api/bluvo/walletId`,
1565
+ body: { id },
1566
+ logger,
1567
+ apiKey: ""
1568
+ });
1569
+ }
1570
+ async function bluvoRequestQuotation({
1571
+ id,
1572
+ params,
1573
+ logger
1574
+ }) {
1575
+ return sendPostRequest({
1576
+ uri: `${FROG_API_BASE_URL}/api/bluvo/quote`,
1577
+ body: { id, params },
1578
+ logger,
1579
+ apiKey: ""
1580
+ });
1581
+ }
1582
+ async function bluvoExecuteWithdrawal({
1583
+ id,
1584
+ idempotencyKey,
1585
+ quoteId,
1586
+ params,
1587
+ logger
1588
+ }) {
1589
+ return sendPostRequest({
1590
+ uri: `${FROG_API_BASE_URL}/api/bluvo/withdrawal`,
1591
+ body: { id, idempotencyKey, quoteId, params },
1592
+ logger,
1593
+ apiKey: ""
1594
+ });
1595
+ }
1535
1596
  export {
1536
1597
  API_BASE_URL,
1537
1598
  AuthType,
@@ -1554,6 +1615,7 @@ export {
1554
1615
  DirectExecutionType,
1555
1616
  ETHEREAL_API_KEY,
1556
1617
  FELIX_API_KEY,
1618
+ FROG_API_BASE_URL,
1557
1619
  FROM_PROGRESS_CHECKOUT_STATES,
1558
1620
  FUN_FAUCET_URL,
1559
1621
  HYENA_API_KEY,
@@ -1563,7 +1625,6 @@ export {
1563
1625
  IN_PROGRESS_CHECKOUT_STATES,
1564
1626
  KATANA_API_KEY,
1565
1627
  MELD_PROVIDER_CATEGORIES,
1566
- MESH_API_BASE_URL,
1567
1628
  MONKEY_TILT_API_KEY,
1568
1629
  MeldServiceProvider,
1569
1630
  OSTIUM_API_KEY,
@@ -1579,6 +1640,11 @@ export {
1579
1640
  VENTUALS_API_KEY,
1580
1641
  addTransaction,
1581
1642
  addUserToWallet,
1643
+ bluvoExecuteWithdrawal,
1644
+ bluvoGetWalletById,
1645
+ bluvoGetWithdrawableBalanceById,
1646
+ bluvoListExchanges,
1647
+ bluvoRequestQuotation,
1582
1648
  checkWalletAccessInitialization,
1583
1649
  createBridgeBankAccount,
1584
1650
  createBridgeBankAccountRequestChainNames,
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/consts/api.ts", "../src/utils/error.ts", "../src/consts/retry.ts", "../src/consts/customers.ts", "../src/utils/checkout.ts", "../src/utils/request.ts", "../src/services/assets/endpoints.ts", "../src/services/bridge/endpoints.ts", "../src/services/bridge/types.ts", "../src/services/checkout/endpoints.ts", "../src/services/checkout/types.ts", "../src/services/direct-execution/endpoints.ts", "../src/services/direct-execution/types.ts", "../src/services/faucet/endpoints.ts", "../src/services/fw-access/endpoints.ts", "../src/services/fw-group/endpoints.ts", "../src/services/fw-info/endpoints.ts", "../src/services/fw-operation/endpoints.ts", "../src/services/fw-operation/types.ts", "../src/services/fw-paymaster/endpoints.ts", "../src/services/fw-paymaster/types.ts", "../src/services/fw-user/endpoints.ts", "../src/services/meld/endpoints.ts", "../src/services/meld/types.ts", "../src/services/moonpay/endpoints.ts", "../src/services/organization/endpoints.ts", "../src/services/stripe/endpoints.ts", "../src/services/support/endpoints.ts", "../src/services/exchange-rates/endpoints.ts"],
4
- "sourcesContent": ["export const API_BASE_URL = process.env.API_BASE_URL || 'https://api.fun.xyz/v1' // Production\n\nexport const MESH_API_BASE_URL =\n process.env.MESH_API_BASE_URL || 'https://frog.fun.xyz'\n\nexport const FUN_FAUCET_URL = 'https://api.fun.xyz/demo-faucet'\n", "import {\n InvalidParameterError,\n ResourceNotFoundError,\n UserOpFailureError,\n} from '@funkit/utils'\nimport type { AttemptContext } from '@lifeomic/attempt'\n\nexport const errorAbortHandler = (err: Error, context: AttemptContext) => {\n if (\n err instanceof ResourceNotFoundError ||\n err instanceof InvalidParameterError ||\n err instanceof UserOpFailureError\n ) {\n context.abort()\n }\n}\n", "import type { PartialAttemptOptions } from '@lifeomic/attempt'\n\nimport { errorAbortHandler } from '../utils/error'\n\nexport type BaseResponse = unknown\n\nexport type RetryOptions<T = BaseResponse> = PartialAttemptOptions<T>\n\nexport const DEFAULT_RETRY_OPTIONS = {\n delay: 100,\n initialDelay: 0,\n maxDelay: 3000,\n factor: 2,\n maxAttempts: 2,\n timeout: 0,\n jitter: true,\n minDelay: 0,\n handleError: errorAbortHandler,\n handleTimeout: null,\n beforeAttempt: null,\n calculateDelay: null,\n} as RetryOptions\n", "export const DEGEN_API_KEY = 'm4iHIILHcL4gN8EXCMzGe8zIdhuCXxck49mWajzJ'\nexport const POLYMARKET_API_KEY = 'Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6'\nexport const OSTIUM_API_KEY = 'SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN'\nexport const DEV_API_KEY = 'Z9SZaOwpmE40KX61mUKWm5hrpGh7WHVkaTvQJpQk'\nexport const BANKR_API_KEY = 'vWe20Dfyui2ouvfOhtSTY3Czeo8lFdbo5xXQBALZ'\nexport const QUICKSWAP_API_KEY = 'sdbYyJRkXz7uuCCiA7KDu2SzYknwgwCN5rgBllKR'\nexport const BSX_API_KEY = 'zN1zrkmLQn4oZtLUW9Qt02uuBI3Jvrgj8Ni40Gf1'\nexport const BENQI_API_KEY = 'q8qZWLvviLaOaG4bX3w2v6zLN9uxNPaU6CX8I0Gd'\nexport const ETHEREAL_API_KEY = 'M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um'\nexport const KATANA_API_KEY = 'OXLUmejkh9PlNDS4gSvi9gcEWacOpTz2KUVepVf4'\nexport const SUSHI_API_KEY = 'HKHvPSPDezaxsTohFgDuG4WpKW6hB4SFYyztm9vc'\nexport const HYPERBEAT_API_KEY = 'lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau'\nexport const HYPERSWAP_API_KEY = 'AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK'\nexport const FELIX_API_KEY = 'cGlmpTmNh657m8TiV5RFdwna6FG5pxM6ajiNHvw3'\nexport const CAMBRIA_API_KEY = 'BPVeP8zThG467vVIYzuiu5aVWAkS9KiR6tT1TdTP'\nexport const HYPERDASH_API_KEY = 'di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe'\nexport const MONKEY_TILT_API_KEY = '2SrxurU07T2XPDxCAItjj4yYEMXlwV8K2kJB78AX'\nexport const BASED_API_KEY = 'clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e'\nexport const VENTUALS_API_KEY = '5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2'\nexport const HYENA_API_KEY = 'pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW'\n", "import { toHex } from 'viem'\n\nexport function randomBytes(length: number) {\n const bytes = new Uint8Array(length)\n for (let i = 0; i < length; i++) {\n bytes[i] = Math.floor(Math.random() * 256)\n }\n return toHex(bytes)\n}\n\nexport function generateRandomCheckoutSalt() {\n return toHex(BigInt(randomBytes(32)))\n}\n\nexport function roundToNearestBottomTenth(n: number) {\n return Math.floor(n / 10) * 10\n}\n", "import { retry } from '@lifeomic/attempt'\n\nimport type { BaseRequest } from '../consts/request'\nimport {\n type BaseResponse,\n DEFAULT_RETRY_OPTIONS,\n type RetryOptions,\n} from '../consts/retry'\n\nimport {\n AccessDeniedError,\n ErrorCode,\n InternalFailureError,\n InvalidParameterError,\n ResourceNotFoundError,\n ThrottlingError,\n UserOpFailureError,\n jsonStringifyWithBigIntSanitization,\n} from '@funkit/utils'\nimport type {\n DeleteRequest,\n GetRequest,\n PostRequest,\n PutRequest,\n} from './../consts/request'\n\ntype RequestError = {\n errorMsg: string\n errorCode: string\n}\n\nexport async function sendRequest<T = BaseResponse>({\n uri,\n method,\n apiKey,\n body = {},\n logger,\n retryOptions = {},\n signal,\n}: BaseRequest): Promise<T> {\n const headers = {\n 'Content-Type': 'application/json',\n ...(apiKey ? { 'X-Api-Key': apiKey } : {}),\n }\n\n try {\n const finalRetryOptions = {\n ...DEFAULT_RETRY_OPTIONS,\n ...retryOptions,\n } as RetryOptions<T>\n\n return await retry<T>(async (context) => {\n const startTimeMs = Date.now()\n const fetchParams = {\n method,\n headers,\n redirect: 'follow',\n signal,\n body:\n method !== 'GET'\n ? jsonStringifyWithBigIntSanitization(body)\n : undefined,\n } as RequestInit\n\n logger?.info('api-base:sendRequest_before', {\n uri,\n fetchParams,\n startTimeMs,\n })\n const response = await fetch(uri, fetchParams)\n const json = await response.json()\n const endTimeMs = Date.now()\n logger?.info('api-base:sendRequest_after', {\n url: uri,\n fetchParams,\n endTimeMs,\n response: {\n body: json,\n status: response.status,\n },\n durationMs: endTimeMs - startTimeMs,\n retries: context.attemptNum,\n })\n\n if (response.ok) {\n return json\n }\n\n const { errorMsg, errorCode } = json as RequestError\n\n if (response.status === 400) {\n throw new InvalidParameterError(\n ErrorCode.InvalidParameter,\n `bad request ${JSON.stringify(json)}`,\n errorMsg,\n { body },\n 'check the api call parameters. its mostly because some call parameters are wrong',\n 'https://docs.fun.xyz',\n )\n }\n if (response.status === 403) {\n throw new AccessDeniedError(\n ErrorCode.Unauthorized,\n 'Invalid API key or insufficient access.',\n errorMsg,\n { apiKey },\n 'Check your api key at https://app.fun.xyz and check with fun team if you believe something is off',\n 'https://docs.fun.xyz',\n )\n }\n if (response.status === 404) {\n throw new ResourceNotFoundError(\n ErrorCode.ServerMissingData,\n JSON.stringify(json),\n errorMsg,\n { body },\n 'check the api call parameters. its mostly because some call parameters are wrong',\n 'https://docs.fun.xyz',\n )\n }\n if (response.status === 429) {\n throw new ThrottlingError(\n ErrorCode.RequestLimitExceeded,\n `too many requests ${JSON.stringify(json)}`,\n 'Too many requests',\n { body },\n 'you are making too many requests. please slow down. Reach out to fun team if you need more quota',\n 'https://docs.fun.xyz',\n )\n }\n if (response.status === 500) {\n if (errorCode === ErrorCode.UserOpFailureError) {\n throw new UserOpFailureError(\n ErrorCode.UserOpFailureError,\n JSON.stringify(json), // UserOpFailureError may JSON.parse this! Do not modify!\n errorMsg,\n { body },\n 'fix user op failure. Most of the time this is due to invalid parameters',\n 'https://docs.fun.xyz',\n )\n }\n throw new InternalFailureError(\n ErrorCode.ServerFailure,\n `server failure ${JSON.stringify(json)}`,\n errorMsg,\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n }\n if (response.status === 504) {\n throw new InternalFailureError(\n ErrorCode.ServerTimeout,\n `server timeout failure ${JSON.stringify(json)}`,\n errorMsg,\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n }\n if (!response.ok) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n `unknown server failure ${JSON.stringify(json)}`,\n errorMsg,\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n }\n return {}\n }, finalRetryOptions)\n } catch (err) {\n logger?.error('api-base:fetch_error', {\n url: uri,\n method,\n request: {\n body,\n headers,\n },\n error: err,\n })\n\n // Rethrow the error to match existing behavior\n if (err instanceof Error) {\n throw err\n }\n\n throw new InternalFailureError(\n ErrorCode.ServerConnectionError,\n `Cannot connect to Fun API Service ${err}`,\n '',\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n }\n}\n\nexport async function sendGetRequest<T = BaseResponse>(\n options: GetRequest,\n): Promise<T> {\n return await sendRequest({ ...options, method: 'GET' })\n}\n\nexport async function sendPostRequest<T = BaseResponse>(\n options: PostRequest,\n): Promise<T> {\n return await sendRequest({ ...options, method: 'POST' })\n}\n\nexport async function sendPutRequest<T = BaseResponse>(\n options: PutRequest,\n): Promise<T> {\n return await sendRequest({ ...options, method: 'PUT' })\n}\n\nexport async function sendDeleteRequest(options: DeleteRequest): Promise<void> {\n await sendRequest({ ...options, method: 'DELETE' })\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport type {\n Erc20AssetInfo,\n GetAllWalletNFTsByChainIdRequest,\n GetAllWalletNFTsByChainIdResponse,\n GetAllWalletNFTsRequest,\n GetAllWalletNFTsResponse,\n GetAllWalletTokensByChainIdRequest,\n GetAllWalletTokensByChainIdResponse,\n GetAllWalletTokensRequest,\n GetAllWalletTokensResponse,\n GetAllowedAssetsRequest,\n GetAllowedAssetsResponse,\n GetAssetErc20ByChainAndSymbolRequest,\n GetAssetPriceInfoRequest,\n GetAssetPriceInfoResponse,\n GetNftAddressRequest,\n GetNftNameRequest,\n GetWalletLidoWithdrawalsByChainId,\n GetWalletLidoWithdrawalsByChainIdResponse,\n NftAssetInfo,\n} from './types'\n\n/**\n * Gets the estimated dollar unit price of a tokenAddress for checkout\n * @param chainId https://chainlist.org/ e.g. \"1\" for ethereum\n * @param assetTokenAddress tokenAddress of the asset on the given chain\n * @param apiKey\n * @returns only `unitPrice` is relevant, since amount is not customizable (1 by default)\n */\nexport async function getAssetPriceInfo({\n chainId,\n assetTokenAddress,\n ...options\n}: GetAssetPriceInfoRequest): Promise<GetAssetPriceInfoResponse> {\n const priceInfo: GetAssetPriceInfoResponse = await sendGetRequest({\n uri: `${API_BASE_URL}/asset/erc20/price/${chainId}/${assetTokenAddress}`,\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n return priceInfo\n}\n\n/**\n * Gets the ERC20 asset info by chain and symbol\n * @param chainId https://chainlist.org/ e.g. \"1\" for ethereum\n * @param symbol symbol of the asset\n * @param apiKey\n */\nexport async function getAssetErc20ByChainAndSymbol({\n chainId,\n symbol,\n ...options\n}: GetAssetErc20ByChainAndSymbolRequest): Promise<Erc20AssetInfo> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/asset/erc20/${chainId}/${symbol}`,\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\n/**\n * Get all tokens for a given wallet address\n * @param walletAddress\n * @param onlyVerifiedTokens If true, only return alchemy tokens that are verified(filters spam)\n * @param apiKey\n * @param signal AbortSignal to cancel the request when no longer needed\n */\nexport async function getAllWalletTokens({\n walletAddress,\n onlyVerifiedTokens,\n ...options\n}: GetAllWalletTokensRequest): Promise<GetAllWalletTokensResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/erc20s/${walletAddress}?onlyVerifiedTokens=${onlyVerifiedTokens}`,\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\n/**\n * Get all tokens for a given wallet address on a specific chain\n * @param chainId https://chainlist.org/\n * @param walletAddress\n * @param onlyVerifiedTokens If true, only return alchemy tokens that are verified(filters spam)\n * @param apiKey\n */\nexport async function getAllWalletTokensByChainId({\n chainId,\n walletAddress,\n onlyVerifiedTokens,\n ...options\n}: GetAllWalletTokensByChainIdRequest): Promise<GetAllWalletTokensByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/erc20s/${walletAddress}/${chainId}?onlyVerifiedTokens=${onlyVerifiedTokens}`,\n\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\n/**\n * Get list of assets that are allowed to be used for checkout\n * @param apiKey\n */\nexport async function getAllowedAssets(\n options: GetAllowedAssetsRequest,\n): Promise<GetAllowedAssetsResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/allow`,\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\n/**=======================\n * POTENTIAL DEPRECATION\n *=======================*/\n\n/**\n * Get all the NFTs owned by a wallet\n * @param walletAddress\n * @param apiKey\n */\nexport async function getAllWalletNFTs({\n walletAddress,\n ...options\n}: GetAllWalletNFTsRequest): Promise<GetAllWalletNFTsResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/nfts/${walletAddress}`,\n ...options,\n })\n}\n\n/**\n * Get all the NFTs owned by a wallet on a specific chain\n * @param chainId From https://chainlist.org/\n * @param walletAddress Address of holder\n * @param apiKey\n */\nexport async function getAllWalletNFTsByChainId({\n chainId,\n walletAddress,\n ...options\n}: GetAllWalletNFTsByChainIdRequest): Promise<GetAllWalletNFTsByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/nfts/${walletAddress}/${chainId}`,\n ...options,\n })\n}\n\n/**\n * Get all lido withdrawal request ids for a wallet address on a specific chain\n * @param {string} chainId https://chainlist.org/ ie \"1\" for ethereum\n * @param {string} holderAddr Address of holder\n * @returns [readyToWithdrawRequestIds, notReadyToWithdrawRequestIds]\n */\nexport async function getWalletLidoWithdrawalsByChainId({\n chainId,\n walletAddress,\n ...options\n}: GetWalletLidoWithdrawalsByChainId): Promise<GetWalletLidoWithdrawalsByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/lido-withdrawals/${walletAddress}/${chainId}`,\n ...options,\n })\n}\n\n/**\n * Get the name of an NFT collection\n * @param {string} chainId https://chainlist.org/\n * @param {string} nftAddress Address of NFT\n */\nexport async function getNftName({\n chainId,\n nftAddress,\n ...options\n}: GetNftNameRequest): Promise<NftAssetInfo> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/asset/nft/${chainId}/${nftAddress}`,\n ...options,\n })\n}\n\n/**\n * Get the address and chainId of an NFT collection\n * @param {string} name Name of NFT\n */\nexport async function getNftAddress({\n name,\n ...options\n}: GetNftAddressRequest): Promise<NftAssetInfo> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/asset/nft?name=${name}`,\n ...options,\n })\n}\n", "import { MESH_API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n CreateBridgeBankAccountRequest,\n CreateBridgeBankAccountResponse,\n CreateFrogAndBridgeAccountRequest,\n CreateFrogAndBridgeAccountResponse,\n FindBridgeKycLinkRequest,\n FindBridgeKycLinkResponse,\n GetBridgeBankAccountRequest,\n GetBridgeBankAccountResponse,\n GetBridgeCustomerRequest,\n GetBridgeCustomerResponse,\n GetOrCreateFrogAccountRequest,\n GetOrCreateFrogAccountResponse,\n} from './types'\n\nexport async function getFrogAccount({\n subAccountId,\n subAccountType,\n ...options\n}: GetOrCreateFrogAccountRequest): Promise<GetOrCreateFrogAccountResponse> {\n const search = new URLSearchParams({\n subAccountId,\n subAccountType,\n })\n return sendGetRequest({\n uri: `${MESH_API_BASE_URL}/api/account?${search}`,\n ...options,\n })\n}\n\nexport async function createFrogAccount({\n subAccountId,\n subAccountType,\n ...options\n}: GetOrCreateFrogAccountRequest): Promise<GetOrCreateFrogAccountResponse> {\n return sendPostRequest({\n uri: `${MESH_API_BASE_URL}/api/account`,\n body: {\n subAccountId,\n subAccountType,\n },\n ...options,\n })\n}\n\nexport async function getBridgeCustomer({\n guid,\n ...options\n}: GetBridgeCustomerRequest): Promise<GetBridgeCustomerResponse> {\n return sendGetRequest({\n uri: `${MESH_API_BASE_URL}/api/bridge?guid=${guid}`,\n ...options,\n })\n}\n\nexport async function createBridgeCustomer({\n guid,\n name,\n email,\n endorsement,\n ...options\n}: CreateFrogAndBridgeAccountRequest): Promise<CreateFrogAndBridgeAccountResponse> {\n return sendPostRequest({\n uri: `${MESH_API_BASE_URL}/api/bridge`,\n body: {\n guid,\n name,\n email,\n endorsement,\n },\n ...options,\n })\n}\n\nexport async function getBridgeBankAccounts({\n subAccountId,\n ...options\n}: GetBridgeBankAccountRequest): Promise<GetBridgeBankAccountResponse> {\n return sendGetRequest({\n uri: `${MESH_API_BASE_URL}/api/bridge/bank?subAccountId=${subAccountId}`,\n ...options,\n })\n}\n\nexport async function createBridgeBankAccount({\n tokenName,\n chainName,\n destinationAddress,\n subAccountId,\n sourceCurrency,\n ...options\n}: CreateBridgeBankAccountRequest): Promise<CreateBridgeBankAccountResponse> {\n return sendPostRequest({\n uri: `${MESH_API_BASE_URL}/api/bridge/bank`,\n body: {\n subAccountId,\n tokenName,\n chainName,\n destinationAddress,\n sourceCurrency,\n },\n ...options,\n })\n}\n\nexport function getBridgeKycLink({\n guid,\n ...options\n}: FindBridgeKycLinkRequest): Promise<FindBridgeKycLinkResponse> {\n return sendGetRequest({\n uri: `${MESH_API_BASE_URL}/api/bridge/kyclink?guid=${guid}`,\n ...options,\n })\n}\n", "import type { Address } from 'viem'\nimport type { BaseApiRequest } from '../../consts'\n\ndeclare const brand: unique symbol\n\nexport type BridgeCustomerId = string & { [brand]: 'BridgeCustomerId' }\nexport type Guid = string & { [brand]: 'Guid' }\n\ntype DateString = `${number}-${number}-${number}T${number}:${number}:${number}Z`\n\nexport enum BridgeCustomerStatus {\n ACTIVE = 'active',\n AWAITING_QUESTIONNAIRE = 'awaiting_questionnaire',\n /** Ultimate Beneficial Owner - only relevant for business customers https://apidocs.bridge.xyz/docs/business-ownership-documents */\n AWAITING_UBO = 'awaiting_ubo',\n INCOMPLETE = 'incomplete',\n NOT_STARTED = 'not_started',\n OFFBOARDED = 'offboarded',\n PAUSED = 'paused',\n REJECTED = 'rejected',\n UNDER_REVIEW = 'under_review',\n}\n\n// https://apidocs.bridge.xyz/docs/rejection-reasons\nexport interface RejectionReason {\n created_at: DateString\n developer_reason: string\n reason: string\n}\n\nexport interface BridgeCustomer {\n id: BridgeCustomerId\n first_name: string\n last_name: string\n rejection_reasons: RejectionReason[]\n status: BridgeCustomerStatus\n}\n\nexport enum BridgeKycStatus {\n APPROVED = 'approved',\n INCOMPLETE = 'incomplete',\n NOT_STARTED = 'not_started',\n REJECTED = 'rejected',\n UNDER_REVIEW = 'under_review',\n}\n\nexport enum BridgeTosStatus {\n APPROVED = 'approved',\n PENDING = 'pending',\n}\n\nexport enum BridgeCustomerType {\n BUSINESS = 'business',\n INDIVIDUAL = 'individual',\n}\n\nexport interface BridgeKYCLinks {\n id: string\n customer_id: BridgeCustomerId\n created_at: DateString\n email: string\n kyc_link: string\n kyc_status: BridgeKycStatus\n tos_link: string\n tos_status: BridgeTosStatus\n type: BridgeCustomerType\n}\n\nexport interface SubAccountBase {\n id: number\n createdAt: DateString\n updatedAt: DateString\n guid: Guid\n subAccountType: string\n subAccountId: string\n isDeleted: boolean\n}\n\nexport interface WalletSubAccount extends SubAccountBase {\n subAccountType: 'wallet'\n subAccountId: Address\n}\n\nexport interface BridgeSubAccount extends SubAccountBase {\n subAccountType: 'bridge'\n subAccountId: BridgeCustomerId\n}\n\nexport type SubAccount = WalletSubAccount | BridgeSubAccount\n\nexport interface GetOrCreateFrogAccountRequest extends BaseApiRequest {\n subAccountType: 'wallet'\n subAccountId: Address\n}\n\nexport interface GetOrCreateFrogAccountResponse {\n accounts: SubAccount[]\n}\n\nexport interface GetBridgeCustomerRequest extends BaseApiRequest {\n guid: Guid\n}\n\nexport interface GetBridgeCustomerResponse {\n account: SubAccount\n bridgeCustomer: BridgeCustomer\n}\n\nexport enum BridgeEndorsement {\n BASE = 'base',\n SEPA = 'sepa',\n}\n\nexport type BridgeAccount = {\n guid: Guid\n name: string\n email: string\n endorsement: BridgeEndorsement\n}\nexport type CreateFrogAndBridgeAccountRequest = BaseApiRequest & BridgeAccount\n\nexport type CreateFrogAndBridgeAccountResponse =\n | {\n newCreated: true\n /** kyc link info will be present only when create new customer */\n kycLinks: BridgeKYCLinks\n }\n | {\n newCreated: false\n kycLink: string\n }\n\nexport type BridgeVirtualAcountId = string & {\n [brand]: 'BridgeVirtualAcountId'\n}\n\nexport interface BridgeDestination {\n address: `0x${string}`\n currency: 'usdc' | 'usdt' | 'usdb' | 'dai'\n payment_rail: 'ethereum' | 'arbitrum' | 'base' | 'polygon' | 'solana'\n}\n\nexport enum BridgeVirtualBankAccountStatus {\n ACTIVATED = 'activated',\n DEACTIVATED = 'deactivated',\n}\n\nexport interface BridgeVirtualBankAccount {\n id: BridgeVirtualAcountId\n destination: BridgeDestination\n developer_fee_percent: `${number}`\n source_deposit_instructions: {\n payment_rails: string[]\n currency: string\n bank_name: string\n bank_address: string\n bank_beneficiary_name?: string\n bank_beneficiary_address?: string\n // only us bank accounts have routing and account numbers\n bank_routing_number?: string\n bank_account_number?: string\n // https://wise.com/us/iban/ IBAN stands for International Bank Account Number.\n // It\u2019s an internationally-agreed code made up of up to 34 letters and numbers\n // that helps banks to process transfers around the world.\n account_holder_name?: string\n iban?: string\n bic?: string\n }\n status: BridgeVirtualBankAccountStatus\n}\n\nexport interface GetBridgeBankAccountRequest extends BaseApiRequest {\n subAccountId: BridgeCustomerId\n}\n\nexport interface GetBridgeBankAccountResponse {\n bankAccounts: BridgeVirtualBankAccount[]\n}\n\nexport const createBridgeBankAccountRequestChainNames = [\n 'arbitrum',\n 'base',\n 'ethereum',\n 'polygon',\n 'solana',\n] as const\n\nexport interface CreateBridgeBankAccountRequest extends BaseApiRequest {\n subAccountId: BridgeCustomerId\n sourceCurrency: 'usd' | 'eur'\n tokenName: 'usdb' | 'usdc' | 'usdt' | 'dai'\n chainName: (typeof createBridgeBankAccountRequestChainNames)[number]\n destinationAddress: Address\n}\n\nexport interface CreateBridgeBankAccountResponse {\n bankAccount: BridgeVirtualBankAccount\n}\n\nexport interface FindBridgeKycLinkRequest extends BaseApiRequest {\n guid: Guid\n}\n\nexport interface FindBridgeKycLinkResponse {\n kycLink: string\n}\n", "import Big from 'big.js'\nimport type { Address } from 'viem'\n\nimport { ErrorCode, ResourceNotFoundError } from '@funkit/utils'\nimport type {\n CheckoutApiQuoteResponse,\n CheckoutQuoteResponse,\n} from '@funkit/utils'\nimport { API_BASE_URL, type BaseApiRequest } from '../../consts'\nimport {\n generateRandomCheckoutSalt,\n roundToNearestBottomTenth,\n sendGetRequest,\n sendPostRequest,\n} from '../../utils'\nimport {\n type CheckoutApiInitParams,\n type CheckoutApiQuoteParams,\n type CheckoutDeactivateParams,\n type CheckoutHistoryItem,\n type CheckoutInitParams,\n type CheckoutInitResponse,\n type CheckoutInitTokenTransferAddressParams,\n type CheckoutInitTokenTransferResponse,\n type CheckoutQuoteParams,\n type CheckoutQuoteRequestV2,\n type CheckoutQuoteResponseV2,\n CheckoutState,\n type CheckoutTransferSponsorshipApiParams,\n type CheckoutTransferSponsorshipParams,\n type CheckoutTransferSponsorshipResponse,\n type RiskAssessmentParams,\n type RiskAssessmentResponse,\n} from './types'\n\nconst DEFAULT_EXPIRATION_TIMESTAMP_MS = 15 * 60 * 1000 // 15 minutes\n\n/**\n * Gets a checkout quote (estimation).\n * @param fromChainId The ID of the chain where funds will be provided from.\n * @param fromTokenAddress The asset to fund the checkout. This must be either a chain native token or an ERC-20, on the fromChainId.\n * @param fromTokenDecimals The number of decimals for the fromTokenAddress.\n * @param toChainId The ID of the chain where the checkout operation is to be performed.\n * @param toTokenAddress The wanted asset for the checkout operation. This must be either a chain native token or an ERC-20, on the target chain.\n * @param toTokenAmount The amount of wanted asset for the checkout operation in base units.\n * @param toTokenDecimals The number of decimals for the toTokenAddress.\n * @param apiKey A valid fun api key.\n * @param signal AbortSignal to cancel the request when no longer needed\n * @return {Promise<CheckoutCoreQuoteResponse>} The formatted quote object\n */\nexport async function getCheckoutQuote({\n fromChainId,\n fromTokenAddress,\n fromTokenDecimals,\n toChainId,\n toTokenAddress,\n toTokenDecimals,\n toTokenAmount,\n sponsorInitialTransferGasLimit,\n recipientAddr,\n userId,\n ...options\n}: CheckoutQuoteParams): Promise<CheckoutQuoteResponse> {\n try {\n const toMultipler = 10 ** toTokenDecimals\n const toAmountBaseUnitBI = BigInt(Math.floor(toTokenAmount * toMultipler))\n const queryParams: CheckoutApiQuoteParams = {\n userId,\n fromChainId,\n fromTokenAddress,\n toChainId,\n toTokenAddress,\n toAmountBaseUnit: toAmountBaseUnitBI.toString(),\n // Only pass in recipientAddr if specified\n ...(recipientAddr ? { recipientAddr } : {}),\n // Rounding nearest tenth second (instead of seconds) to better support backend quote caching feature\n // Reference: https://vintage-heaven-3cd.notion.site/API-Gateway-Caching-and-Pre-Warming-System-Draft-ee7909d9b85f43c793ce7bd2607bec02?pvs=4\n // Note: Rounding *down* instead of a regular round to safeguard against edge case of timing passing frontend range validation but failing backend range validation\n checkoutExpirationTimestampSeconds: roundToNearestBottomTenth(\n Math.round((Date.now() + DEFAULT_EXPIRATION_TIMESTAMP_MS) / 1000),\n ).toString(),\n sponsorInitialTransferGasLimit,\n }\n\n const searchParams = new URLSearchParams(queryParams)\n const quoteRes = (await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/quote?${searchParams}`,\n ...options,\n })) as CheckoutApiQuoteResponse\n\n const fromMultipler = 10 ** fromTokenDecimals\n // Format the response for frontend usage\n return {\n quoteId: quoteRes.quoteId,\n fromTokenAddress: quoteRes.fromTokenAddress,\n estFeesUsd: quoteRes.estFeesUsd,\n estSubtotalUsd: quoteRes.estSubtotalUsd,\n estTotalUsd: quoteRes.estTotalUsd,\n estCheckoutTimeMs: quoteRes.estCheckoutTimeMs,\n estTotalFromAmountBaseUnit: quoteRes.estTotalFromAmountBaseUnit,\n estSubtotalFromAmountBaseUnit: quoteRes.estSubtotalFromAmountBaseUnit,\n estFeesFromAmountBaseUnit: quoteRes.estFeesFromAmountBaseUnit,\n estMarketMakerGasUsd: quoteRes.estMarketMakerGasUsd,\n lpFeePercentage: quoteRes.lpFeePercentage,\n lpFeeUsd: quoteRes.lpFeeUsd,\n // Added fields\n estFeesFromAmount: new Big(quoteRes.estFeesFromAmountBaseUnit)\n .div(fromMultipler)\n .toString(),\n estSubtotalFromAmount: new Big(quoteRes.estSubtotalFromAmountBaseUnit)\n .div(fromMultipler)\n .toString(),\n estTotalFromAmount: new Big(quoteRes.estTotalFromAmountBaseUnit)\n .div(fromMultipler)\n .toString(),\n }\n } catch (err: unknown) {\n throw new Error(\n `An error occurred trying to generate a checkout quote: ${\n err instanceof Error ? err.message : JSON.stringify(err)\n }`,\n )\n }\n}\n\n/**\n * Gets a checkout quote (estimation).\n */\nexport async function getCheckoutQuoteV2({\n actionParams,\n fromAmountBaseUnit,\n fromChainId,\n fromTokenAddress,\n recipientAddress,\n toAmountBaseUnit,\n toChainId,\n toTokenAddress,\n userAddress,\n usePermit,\n ...options\n}: BaseApiRequest & CheckoutQuoteRequestV2): Promise<CheckoutQuoteResponse> {\n try {\n return await sendPostRequest<CheckoutQuoteResponseV2>({\n uri: `${API_BASE_URL}/checkout/quoteV2`,\n body: {\n actionParams,\n fromAmountBaseUnit,\n fromChainId,\n fromTokenAddress,\n recipientAddress,\n toAmountBaseUnit,\n toChainId,\n toTokenAddress,\n userAddress,\n usePermit,\n },\n ...options,\n })\n } catch (err: unknown) {\n throw new Error(\n `An error occurred trying to generate a checkout quote: ${\n err instanceof Error ? err.message : JSON.stringify(err)\n }`,\n )\n }\n}\n\n/**\n * Initializes a checkout\n * @param userOp The checkout UserOp, signed.\n * @param quoteId The quoteId specific to the checkout.\n * @param apiKey A valid fun api key.\n * @return {Address} The generated deposit address\n */\nexport async function initializeCheckout({\n userOp,\n quoteId,\n sourceOfFund,\n clientMetadata,\n ...options\n}: CheckoutInitParams): Promise<CheckoutInitResponse> {\n const body = {\n ...(userOp ? { userOp } : {}),\n quoteId,\n sourceOfFund,\n salt: generateRandomCheckoutSalt(),\n clientMetadata,\n } as CheckoutApiInitParams\n const res: { depositAddr?: Address } = await sendPostRequest({\n uri: `${API_BASE_URL}/checkout`,\n body,\n ...options,\n })\n if (!res?.depositAddr) {\n throw new ResourceNotFoundError(\n ErrorCode.CheckoutInitDepositAddrNotFound,\n 'Unable to initialize checkout',\n 'Unable to initialize checkout',\n body,\n '',\n 'https://docs.fun.xyz',\n )\n }\n return { depositAddr: res.depositAddr }\n}\n\nexport async function deactivateCheckout({\n depositAddress,\n ...options\n}: CheckoutDeactivateParams) {\n try {\n await sendPostRequest({\n uri: `${API_BASE_URL}/checkout/update/${depositAddress}`,\n body: {\n // Fixed state to cancel the checkout\n state: CheckoutState.CANCELLED,\n },\n ...options,\n })\n return true\n } catch (_err) {\n throw new Error('Unable to deactivate checkout')\n }\n}\n\n/**\n * Gets a checkout given a depositAddress\n * @param depositAddress A unique deposit address associated with a backend checkout item.\n * @param apiKey A valid fun api key.\n * @param signal AbortSignal to cancel the request when no longer needed\n * @returns The checkout object if exists. Otherwise, null.\n */\nexport async function getCheckoutByDepositAddress({\n depositAddress,\n ...options\n}: BaseApiRequest & {\n depositAddress: Address\n}): Promise<CheckoutHistoryItem | null> {\n try {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/${depositAddress}`,\n ...options,\n })\n } catch (err) {\n if (err instanceof ResourceNotFoundError) {\n return null\n }\n throw err\n }\n}\n\n/**\n * Gets all checkouts associated with a funWallet\n * @param funWalletAddress A funWallet address.\n * @param apiKey A valid fun api key.\n * @param signal AbortSignal to cancel the request when no longer needed\n * @returns A list of checkout objects if exists. Otherwise, an empty array.\n */\nexport async function getCheckoutsByFunWalletAddress({\n funWalletAddress,\n ...options\n}: BaseApiRequest & { funWalletAddress: Address }): Promise<\n CheckoutHistoryItem[]\n> {\n const res: CheckoutHistoryItem[] = await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/fun-wallet/${funWalletAddress}`,\n ...options,\n })\n return res || []\n}\n\n/**\n * Gets all checkouts associated with a recipient address\n * @param recipientAddress A wallet address.\n * @param apiKey A valid fun api key.\n * @param signal AbortSignal to cancel the request when no longer needed\n * @returns A list of checkout objects if exists. Otherwise, an empty array.\n */\nexport async function getCheckoutsByRecipientAddress({\n recipientAddress,\n ...options\n}: BaseApiRequest & { recipientAddress: Address }): Promise<\n CheckoutHistoryItem[]\n> {\n const res = await sendGetRequest<CheckoutHistoryItem[] | null>({\n uri: `${API_BASE_URL}/checkout/recipient/${recipientAddress}`,\n ...options,\n })\n return res || []\n}\n\nexport interface GetCheckoutsByUserIdParams extends BaseApiRequest {\n userId: string\n limit?: number\n}\n\n/**\n * Gets all checkouts associated with a funkit userId string\n * @param userId A userId string.\n * @param apiKey A valid fun api key.\n * @param signal AbortSignal to cancel the request when no longer needed\n * @returns A list of checkout objects if exists. Otherwise, an empty array.\n */\nexport async function getCheckoutsByUserId({\n userId,\n limit,\n ...options\n}: GetCheckoutsByUserIdParams): Promise<CheckoutHistoryItem[]> {\n const query = limit\n ? new URLSearchParams({\n limit: limit.toString(),\n })\n : ''\n const res = await sendGetRequest<CheckoutHistoryItem[] | null>({\n uri: `${API_BASE_URL}/checkout/userId/${userId}?${query}`,\n ...options,\n })\n return res || []\n}\n\nexport async function getPaymasterDataForCheckoutSponsoredTransfer({\n depositAddress,\n transferUserOp,\n ...options\n}: CheckoutTransferSponsorshipParams): Promise<CheckoutTransferSponsorshipResponse> {\n const body = {\n depositAddress,\n userOp: transferUserOp,\n } as CheckoutTransferSponsorshipApiParams\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/checkout/sponsor-transfer`,\n body,\n ...options,\n })\n if (!res) {\n // TODO: Better error handling\n throw new Error('Unable to get sponsorship information')\n }\n return res as CheckoutTransferSponsorshipResponse\n}\n\nexport async function getRiskAssessmentForAddress({\n address,\n ...options\n}: RiskAssessmentParams) {\n const response = (await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/risk-assessment?address=${address}`,\n ...options,\n // Protect us against chainalysis ratelimiting\n retryOptions: { maxAttempts: 2 },\n })) as RiskAssessmentResponse\n\n return response\n}\n\nexport async function initializeCheckoutTokenTransferAddress({\n apiKey,\n logger,\n signal,\n ...body\n}: CheckoutInitTokenTransferAddressParams): Promise<CheckoutInitTokenTransferResponse> {\n const res = await sendPostRequest<CheckoutInitTokenTransferResponse | null>({\n uri: `${API_BASE_URL}/eoa`,\n body,\n apiKey,\n logger,\n signal,\n })\n if (!res?.depositAddr) {\n throw new ResourceNotFoundError(\n ErrorCode.CheckoutInitDepositAddrNotFound,\n 'Unable to initialize checkout token transfer address',\n 'Unable to initialize checkout token transfer address',\n body,\n '',\n 'https://docs.fun.xyz',\n )\n }\n return {\n depositAddr: res.depositAddr,\n solanaAddr: res.solanaAddr,\n btcAddrSegwit: res.btcAddrSegwit,\n btcAddrTaproot: res.btcAddrTaproot,\n btcDepositAddr: res.btcDepositAddr,\n }\n}\n", "import type { Address, Hex } from 'viem'\n\nimport type {\n ApiCheckoutClientMetadata,\n ApiFunkitCheckoutActionParams,\n CheckoutQuoteResponse,\n} from '@funkit/utils'\nimport type { BaseApiRequest } from '../../consts'\nimport type { UserOperation } from '../fw-operation'\n\n// The params required for the actual /checkout/quote api\nexport type CheckoutApiQuoteParams = {\n fromChainId: string\n fromTokenAddress: Address\n toChainId: string\n toTokenAddress: Address\n toAmountBaseUnit: string\n /** @deprecated */\n checkoutExpirationTimestampSeconds: string\n sponsorInitialTransferGasLimit: string\n userId: string\n recipientAddr?: Address\n}\n\nexport type CheckoutQuoteParams = BaseApiRequest &\n Omit<\n CheckoutApiQuoteParams,\n 'toAmountBaseUnit' | 'checkoutExpirationTimestampSeconds'\n > & {\n fromTokenDecimals: number\n toTokenDecimals: number\n toTokenAmount: number\n /** @deprecated */\n expirationTimestampMs?: number\n }\n\nexport type CheckoutQuoteRequestV2 = {\n actionParams?: ApiFunkitCheckoutActionParams[]\n fromChainId: string\n fromTokenAddress: Address\n recipientAddress?: Address\n toChainId: string\n toTokenAddress: Address\n userAddress: Address\n usePermit?: boolean\n} & (\n | {\n fromAmountBaseUnit: bigint\n toAmountBaseUnit?: never\n }\n | {\n fromAmountBaseUnit?: never\n toAmountBaseUnit: bigint\n }\n)\n\nexport interface FeeBreakdownV2 {\n gasUsd: number\n fillCostUsd: number\n fillCostPercent: number\n totalImpactUsd: number\n totalImpact: number\n swapImpact: number\n swapImpactUsd: number\n appFeePercent: number\n appFeeUsd: number\n maxSlippage: number\n minReceived: number\n exchangeRate?: number // only available for swapping\n appFeeLabel?: string\n}\n\nexport type CheckoutQuoteResponseV2 = CheckoutQuoteResponse & {\n metadata: {\n feeBreakdown: FeeBreakdownV2\n }\n}\n\n/**===============*\n * CHECKOUT INIT *\n *================*/\n\nexport type CheckoutApiInitParams = {\n userOp?: UserOperation\n quoteId: string\n sourceOfFund: string\n salt: Hex\n // TODO: Proper typing wrt _generateClientMetadata() logic\n clientMetadata: object\n}\n\nexport type CheckoutInitParams = BaseApiRequest &\n Omit<CheckoutApiInitParams, 'salt'>\n\nexport type CheckoutInitResponse = {\n depositAddr: Address\n}\n\nexport type CheckoutInitTokenTransferResponse = CheckoutInitResponse & {\n solanaAddr: SolanaAddress\n btcAddrSegwit: BitcoinAddress\n btcAddrTaproot: BitcoinAddress\n btcDepositAddr: BitcoinAddress\n}\n\n/**=====================*\n * CHECKOUT DEACTIVATE *\n *======================*/\n\nexport type CheckoutDeactivateParams = BaseApiRequest & {\n depositAddress: Address\n}\n\n// Reference from api server: https://github.com/fun-xyz/fun-api-server/blob/main/src/tables/FunWalletCheckout.ts#L11C1-L21C2\nexport enum CheckoutState {\n // In-progress States\n FROM_UNFUNDED = 'FROM_UNFUNDED',\n FROM_FUNDED = 'FROM_FUNDED',\n FROM_POOLED = 'FROM_POOLED',\n TO_UNFUNDED = 'TO_UNFUNDED',\n TO_FUNDED = 'TO_FUNDED',\n TO_POOLED = 'TO_POOLED',\n TO_READY = 'TO_READY',\n PENDING_RECEIVAL = 'PENDING_RECEIVAL',\n // Terminal States\n COMPLETED = 'COMPLETED',\n CHECKOUT_ERROR = 'CHECKOUT_ERROR',\n EXPIRED = 'EXPIRED',\n CANCELLED = 'CANCELLED',\n}\n\n// Checkout state categorizations\nexport const FROM_PROGRESS_CHECKOUT_STATES = [\n CheckoutState.FROM_UNFUNDED,\n CheckoutState.FROM_FUNDED,\n CheckoutState.FROM_POOLED,\n]\n\nexport const TO_PROGRESS_CHECKOUT_STATES = [\n CheckoutState.TO_UNFUNDED,\n CheckoutState.TO_FUNDED,\n CheckoutState.TO_POOLED,\n CheckoutState.TO_READY,\n CheckoutState.PENDING_RECEIVAL,\n]\n\nexport const IN_PROGRESS_CHECKOUT_STATES = [\n ...TO_PROGRESS_CHECKOUT_STATES,\n ...FROM_PROGRESS_CHECKOUT_STATES,\n]\n\nexport const TERMINAL_CHECKOUT_STATES = [\n CheckoutState.EXPIRED,\n CheckoutState.CHECKOUT_ERROR,\n CheckoutState.COMPLETED,\n CheckoutState.CANCELLED,\n]\n\nexport enum CheckoutRefundState {\n INITIATED = 'INITIATED',\n ERROR = 'ERROR',\n REFUNDED = 'REFUNDED',\n PROCEEDED = 'PROCEEDED',\n WAITING_FOR_FULFILLMENT = 'WAITING_FOR_FULFILLMENT',\n FULFILLED = 'FULFILLED',\n}\n\nexport type CheckoutHistoryItem = {\n createdTimeMs: number\n depositAddr: Address\n currentDepositAddr: Address\n recipientAddr: Address\n expirationTimestampSeconds: number\n fromAmountBaseUnit: string\n fromChainId: string\n fromTokenAddress: Address\n funWalletAddr: Address\n lastUpdatedTimeMs: number\n salt: Hex\n state: CheckoutState\n toAmountBaseUnit: string\n toChainId: string\n toTokenAddress: Address\n userOp?: UserOperation\n version: number\n sourceOfFund: string\n clientMetadata: ApiCheckoutClientMetadata\n refundState?: CheckoutRefundState\n // Note: Optional, because BE does not retroactively update existing CheckoutHistoryItem entries\n stateTimestampMs?: Partial<Record<CheckoutState, number>>\n}\n\n/**===============================*\n * CHECKOUT TRANSFER SPONSORSHIP *\n *================================*/\n\nexport type CheckoutTransferSponsorshipParams = BaseApiRequest & {\n transferUserOp: UserOperation\n depositAddress: Address\n}\n\nexport type CheckoutTransferSponsorshipApiParams = {\n userOp: UserOperation\n depositAddress: Address\n}\n\nexport type CheckoutTransferSponsorshipResponse = {\n signerAddress: Address\n signature: Hex\n deadline: number\n paymasterAndData: Hex\n}\n\n/**===============================*\n * RISK ASSESSMENT *\n *================================*/\n\nexport type RiskAssessmentParams = BaseApiRequest & {\n address: FunAddress\n}\n\ntype AddressIdentification = {\n name: string\n address: FunAddress\n category: string\n description: string\n url: string | null\n createdAt: number\n}\n\ntype Cluster = {\n name: string\n category: string\n}\n\nexport type RiskValues = 'Severe' | 'High' | 'Medium' | 'Low'\n\ntype ExposureType = 'direct' | 'indirect'\n\ntype Exposure = {\n category: string\n value: number\n exposureType: ExposureType\n direction: string\n}\n\ntype RiskTrigger = {\n risk: string\n minThreshold: number\n maxThreshold: number\n exposureType: string\n direction: string\n}\n\ntype Trigger = {\n category: string\n percentage: number\n message: string\n ruleTriggered?: RiskTrigger\n}\n\ntype PoolMetadata = {\n fees?: number\n tokens: string[]\n}\n\ntype Base58 =\n | '1'\n | '2'\n | '3'\n | '4'\n | '5'\n | '6'\n | '7'\n | '8'\n | '9'\n | 'A'\n | 'B'\n | 'C'\n | 'D'\n | 'E'\n | 'F'\n | 'G'\n | 'H'\n | 'J'\n | 'K'\n | 'L'\n | 'M'\n | 'N'\n | 'P'\n | 'Q'\n | 'R'\n | 'S'\n | 'T'\n | 'U'\n | 'V'\n | 'W'\n | 'X'\n | 'Y'\n | 'Z'\n | 'a'\n | 'b'\n | 'c'\n | 'd'\n | 'e'\n | 'f'\n | 'g'\n | 'h'\n | 'i'\n | 'j'\n | 'k'\n | 'm'\n | 'n'\n | 'o'\n | 'p'\n | 'q'\n | 'r'\n | 's'\n | 't'\n | 'u'\n | 'v'\n | 'w'\n | 'x'\n | 'y'\n | 'z'\nexport type SolanaAddress = `${Base58}${string}`\nexport type BitcoinAddress =\n | `1${string}`\n | `3${string}`\n | `bc1${string}`\n | `bc1p${string}`\nexport type FunAddress = Address | SolanaAddress | BitcoinAddress\n\nexport type RiskAssessmentResponse = {\n address: FunAddress\n risk: RiskValues\n riskReason: string | null\n cluster?: Cluster\n addressType: string\n addressIdentifications: AddressIdentification[]\n exposures: Exposure[]\n triggers: Trigger[]\n status: string\n poolMetadata: PoolMetadata\n}\n\nexport type CheckoutInitTokenTransferAddressParams = BaseApiRequest & {\n toChainId: string\n toTokenAddress: Address\n userId: string\n clientMetadata: NonNullable<object>\n sourceOfFund?: string\n recipientAddr: string\n actionType?: string\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n DirectExecution,\n GetDirectExecutionByTxHashRequest,\n GetDirectExecutionsByUserIdRequest,\n PostDirectExecutionRequest,\n} from './types'\n\nexport async function getDirectExecutionByTxHash({\n txHash,\n apiKey,\n logger,\n signal,\n}: GetDirectExecutionByTxHashRequest): Promise<DirectExecution> {\n return sendGetRequest<DirectExecution>({\n uri: `${API_BASE_URL}/direct-execution/${txHash}`,\n apiKey,\n logger,\n signal,\n })\n}\n\nexport async function getDirectExecutionsByUserId({\n userId,\n apiKey,\n logger,\n limit,\n signal,\n}: GetDirectExecutionsByUserIdRequest): Promise<DirectExecution[]> {\n const query = limit\n ? new URLSearchParams({\n limit: limit.toString(),\n })\n : ''\n return sendGetRequest<DirectExecution[]>({\n uri: `${API_BASE_URL}/direct-execution/userId/${userId}?${query}`,\n apiKey,\n logger,\n signal,\n })\n}\n\nexport async function createDirectExecution({\n txHash,\n userId,\n recipientAddr,\n fromChainId,\n fromTokenAddress,\n toChainId,\n toTokenAddress,\n fromAmountBaseUnit,\n toAmountBaseUnit,\n estTotalUsd,\n sourceOfFund,\n clientMetadata,\n apiKey,\n logger,\n signal,\n type,\n}: PostDirectExecutionRequest): Promise<{ txHash: DirectExecution['txHash'] }> {\n const body = {\n txHash,\n sourceOfFund,\n userId,\n recipientAddr,\n fromChainId,\n fromTokenAddress,\n toChainId,\n toTokenAddress,\n fromAmountBaseUnit,\n toAmountBaseUnit,\n estTotalUsd,\n clientMetadata,\n type,\n }\n\n return sendPostRequest<{ txHash: DirectExecution['txHash'] }>({\n uri: `${API_BASE_URL}/direct-execution`,\n body,\n apiKey,\n logger,\n signal,\n })\n}\n", "import type { ApiCheckoutClientMetadata } from '@funkit/utils'\nimport type { Address, Hex } from 'viem'\nimport type { BaseApiRequest } from '../../consts'\n\nexport interface GetDirectExecutionByTxHashRequest extends BaseApiRequest {\n txHash: Hex\n}\n\nexport interface GetDirectExecutionsByUserIdRequest extends BaseApiRequest {\n userId: string\n limit?: number\n}\n\n// Reference: https://github.com/fun-xyz/fun-backend/blob/main/packages/types/src/system/direct-execution.ts#L1\nexport enum DirectExecutionType {\n TEST_EXECUTION = 'TEST_EXECUTION', // For UT purposes only, should never show up in prod table\n /** @deprecated All vertex direct exec flows will go to Relay now */\n VERTEX_DEPOSIT_COLLATERAL_WITH_REFERRAL = 'VERTEX_DEPOSIT_COLLATERAL_WITH_REFERRAL', // Vertex deposit collateral with referral\n RELAY = 'RELAY', // Relay checkout UI execution\n}\n\n// Reference: https://github.com/reservoirprotocol/relay-kit/blob/211c645f9702a3b459ff545aa4e2e9d536c38455/packages/sdk/src/types/Execute.ts#L54-L61\nexport enum RelayExecutionStatus {\n DELAYED = 'delayed',\n FAILURE = 'failure',\n PENDING = 'pending',\n REFUND = 'refund',\n SUCCESS = 'success',\n WAITING = 'waiting',\n UNKNOWN = 'unknown',\n}\n\nexport interface RelayExecutionRequestFeeData {\n fees: Fee\n feesUsd: Fee\n metadata: RelayExecutionRequestMetadata\n appFees?: RelayExecutionRequestFeeDataAppFees[]\n}\n\nexport interface RelayExecutionRequestFeeDataAppFees {\n recipient?: Address\n amount?: string\n amountUsd?: string\n}\n\nexport interface RelayExecutionRequestMetadata {\n currencyIn: RelayExecutionRequestMetadataCurrency\n currencyOut: RelayExecutionRequestMetadataCurrency\n rate: string\n recipient: Address\n sender: Address\n}\n\nexport interface RelayExecutionRequestMetadataCurrency {\n amount: string\n amountFormatted: string\n amountUsd: string\n amountUsdCurrent: string\n currency: {\n address: Address\n chainId: number\n decimals: number\n metadata: {\n logoURI: string\n verified: boolean\n }\n name: string\n symbol: string\n }\n minimumAmount: string\n}\n\nexport interface Fee {\n gas: bigint\n fixed: bigint\n price: bigint\n}\n\n// Reference: https://github.com/fun-xyz/fun-backend/blob/main/packages/types/src/system/tables/DirectExecution.ts#L7\nexport interface DirectExecution {\n txHash: Hex\n customerId: string\n userId: string\n recipientAddr: Address\n type: DirectExecutionType\n\n fromChainId: string\n fromTokenAddress: Address\n toChainId: string\n toTokenAddress: Address\n\n fromAmountBaseUnit: string\n toAmountBaseUnit: string\n estTotalUsd: number\n\n clientMetadata: ApiCheckoutClientMetadata\n isIntermediaryPhase?: boolean\n sourceOfFund: string\n toTxId?: string\n triggeringTxHash?: string\n\n createdTimeMs: number\n updatedTimeMs?: number\n\n listenerInfo?: {\n destinationChainId: number\n inTxHashes: string[]\n originChainId: number\n status: RelayExecutionStatus\n time: number\n txHashes: string[]\n\n relayExecutionRequestDetails?: {\n id: Hex\n status: RelayExecutionStatus\n createdAt: Date\n updatedAt: Date\n data: RelayExecutionRequestFeeData\n }\n }\n}\n\nexport interface PostDirectExecutionRequest\n extends BaseApiRequest,\n Omit<DirectExecution, 'customerId' | 'createdTimeMs'> {}\n", "import { FUN_FAUCET_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport type { GetAssetFromFaucetRequest } from './types'\n\nexport async function getAssetFromFaucet({\n token,\n chain,\n walletAddress,\n ...options\n}: GetAssetFromFaucetRequest) {\n return await sendGetRequest({\n uri: `${FUN_FAUCET_URL}/get-faucet?token=${token}&testnet=${chain}&addr=${walletAddress}`,\n ...options,\n })\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n CheckWalletAccessInitializationRequest,\n InitializeWalletAccessRequest,\n} from './types'\n\nexport async function initializeWalletAccess({\n walletAddr,\n creatorAddr,\n ...options\n}: InitializeWalletAccessRequest): Promise<void> {\n await sendPostRequest({\n uri: `${API_BASE_URL}/access/wallet`,\n body: { walletAddr, creatorAddr },\n ...options,\n })\n}\n\nexport async function checkWalletAccessInitialization({\n walletAddr,\n ...options\n}: CheckWalletAccessInitializationRequest): Promise<boolean> {\n return (\n await sendGetRequest<{ initialized: boolean }>({\n uri: `${API_BASE_URL}/access/wallet/${walletAddr}`,\n ...options,\n })\n ).initialized\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendPostRequest } from '../../utils'\nimport type { GetGroupsRequest, GroupMetadata } from './types'\n\nexport async function getGroups({\n groupIds,\n chainId,\n ...options\n}: GetGroupsRequest): Promise<GroupMetadata[]> {\n return (\n await sendPostRequest<{ groups: GroupMetadata[] }>({\n uri: `${API_BASE_URL}/group/get-groups`,\n body: { groupIds, chainId },\n ...options,\n })\n ).groups\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport type {\n GetChainFromIdRequest,\n GetChainFromNameRequest,\n ServerChainInfo,\n} from './types'\n\nexport async function getChainFromId({\n chainId,\n ...options\n}: GetChainFromIdRequest): Promise<ServerChainInfo> {\n const res = await sendGetRequest<ServerChainInfo>({\n uri: `${API_BASE_URL}/chain-info/${chainId}`,\n ...options,\n })\n if (!res) {\n throw new Error(JSON.stringify(res))\n }\n return res\n}\n\nexport async function getChainFromName({\n name,\n ...options\n}: GetChainFromNameRequest): Promise<ServerChainInfo> {\n const res = await sendGetRequest<ServerChainInfo>({\n uri: `${API_BASE_URL}/chain-info?name=${name}`,\n ...options,\n })\n if (!res) {\n throw new Error(JSON.stringify(res))\n }\n return res\n}\n", "import type { Address } from 'viem'\nimport { API_BASE_URL } from '../../consts'\nimport { sendDeleteRequest, sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n CreateOpRequest,\n DeleteOpRequest,\n EstimateOpInput,\n EstimatedGas,\n ExecuteOpInput,\n ExecutionReceipt,\n GetFullReceiptRequest,\n GetOpsOfWalletRequest,\n GetOpsRequest,\n GetUserOpGasPriceRequest,\n OpRequest,\n OperationData,\n ScheduleOpInput,\n SignOpRequest,\n UserOperationGasPrice,\n} from './types'\n\nexport async function createOp({\n op,\n ...options\n}: CreateOpRequest): Promise<string> {\n return (\n await sendPostRequest<{ opId: string }>({\n uri: `${API_BASE_URL}/operation`,\n body: { ...op },\n ...options,\n })\n ).opId\n}\n\ninterface OpsOfWalletResponse {\n operations: OperationData[]\n}\n\nexport async function getOpsOfWallet({\n walletAddr,\n chainId,\n status,\n ...options\n}: GetOpsOfWalletRequest): Promise<OperationData[]> {\n const endpoint = status\n ? `${API_BASE_URL}/operation/wallet/${walletAddr}/chain/${chainId}?status=${status}`\n : `${API_BASE_URL}/operation/wallet/${walletAddr}/chain/${chainId}`\n return (\n await sendGetRequest<OpsOfWalletResponse>({ uri: endpoint, ...options })\n ).operations\n}\n\nexport async function getOps({\n opIds,\n chainId,\n ...options\n}: GetOpsRequest): Promise<OperationData[]> {\n return (\n await sendPostRequest<OpsOfWalletResponse>({\n uri: `${API_BASE_URL}/operation/get-operations`,\n body: {\n opIds,\n chainId,\n },\n ...options,\n })\n ).operations\n}\n\nexport async function deleteOp({\n opId,\n chainId,\n ...options\n}: DeleteOpRequest): Promise<void> {\n await sendDeleteRequest({\n uri: `${API_BASE_URL}/operation/${opId}/chain/${chainId}`,\n ...options,\n })\n}\n\nexport async function signOp({\n opId,\n chainId,\n signature,\n signedBy,\n threshold,\n ...options\n}: SignOpRequest): Promise<void> {\n await sendPostRequest({\n uri: `${API_BASE_URL}/operation/sign`,\n body: {\n opId,\n chainId,\n signature,\n signedBy,\n threshold,\n },\n ...options,\n })\n}\n\nexport async function executeOp({\n input,\n ...options\n}: OpRequest<ExecuteOpInput>): Promise<ExecutionReceipt> {\n return await sendPostRequest({\n uri: `${API_BASE_URL}/operation/execute`,\n body: input,\n ...options,\n })\n}\n\nexport async function estimateOp({\n input,\n ...options\n}: OpRequest<EstimateOpInput>): Promise<EstimatedGas> {\n return await sendPostRequest({\n uri: `${API_BASE_URL}/operation/estimate`,\n body: input,\n ...options,\n })\n}\n\nexport async function scheduleOp({\n input,\n ...options\n}: OpRequest<ScheduleOpInput>): Promise<void> {\n await sendPostRequest({\n uri: `${API_BASE_URL}/operation/schedule`,\n body: input,\n ...options,\n })\n}\n\nexport const getFullReceipt = async ({\n opId,\n chainId,\n userOpHash,\n ...options\n}: GetFullReceiptRequest): Promise<ExecutionReceipt> => {\n const retries = 20\n let result: { status: string; receipt?: ExecutionReceipt } = {\n status: 'pending',\n }\n for (let i = 0; i < retries; i++) {\n try {\n result = await sendGetRequest({\n uri: `${API_BASE_URL}/operation/${opId}/chain/${chainId}/receipt?userOpHash=${userOpHash}`,\n ...options,\n })\n if (result.status === 'included') {\n break\n }\n } catch (_err) {\n /* empty */\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2500))\n }\n if (!result.receipt) {\n result.receipt = {\n // TODO: this is obviously wrong but it was what we had before\n txId: 'Failed to find.' as Address,\n gasUsed: 'Failed to find.',\n opFeeUSD: 'Failed to find.',\n opFee: 'Failed to find.',\n userOpHash: 'Failed to find.',\n }\n }\n return {\n ...result.receipt,\n }\n}\n\nexport const getUserOpGasPrice = async ({\n chainId,\n ...options\n}: GetUserOpGasPriceRequest): Promise<UserOperationGasPrice> => {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/operation/chain/${chainId}/gas-price`,\n ...options,\n })\n}\n", "import type { Address, Hex } from 'viem'\n\nimport type { BaseApiRequest } from '../../consts'\n\nexport enum OperationStatus {\n ALL = '',\n PENDING_APPROVED = 'PENDING_APPROVED',\n APPROVED = 'APPROVED',\n PENDING = 'PENDING',\n OP_SUCCEED = 'OP_SUCCEED',\n OP_REVERTED = 'OP_REVERTED',\n SCHEDULED = 'SCHEDULED',\n}\n\nexport type OperationMetadata = {\n opId?: Hex\n chainId: string\n opType: OperationType\n authType: AuthType\n groupId?: Hex\n message?: string\n walletAddr: Address\n status?: OperationStatus\n proposer: string // do not use address in case we later use non-address data as the proposer\n proposedTime?: number\n executedBy?: string\n executedTime?: number\n relatedOpIds?: Hex[]\n signatures?: Signature[]\n txid?: string\n gasUsed?: string\n opFeeUSD?: string\n opFee?: string\n executedBlockNumber?: number\n executedBlockTimeStamp?: number\n}\n\nexport interface OperationData extends OperationMetadata {\n userOp: UserOperation\n}\n\nexport enum AuthType {\n ECDSA = 0,\n MULTI_SIG = 1,\n}\n\nexport type Signature = {\n userId: Hex\n signature: Hex\n signedTime: number\n}\n\nexport enum OperationType {\n SINGLE_OPERATION = 'SINGLE_OPERATION',\n GROUP_OPERATION = 'GROUP_OPERATION',\n REJECTION = 'REJECTION',\n}\n\nexport type GroupInfo = {\n threshold: number\n memberIds: Hex[]\n}\n\nexport type UserOperation = {\n sender: string\n nonce: bigint\n initCode?: string\n callData: string\n callGasLimit: bigint\n verificationGasLimit: bigint\n preVerificationGas?: bigint\n maxFeePerGas: bigint\n maxPriorityFeePerGas: bigint\n paymasterAndData?: string\n signature?: string\n}\n\nexport interface ExecutionReceipt {\n userOpHash: string\n txId?: Hex\n gasUsed?: string\n opFeeUSD?: string\n opFee?: string\n}\n\nexport type EstimatedGas = {\n preVerificationGas: bigint\n callGasLimit: bigint\n verificationGasLimit: bigint\n}\n\nexport interface CreateOpRequest extends BaseApiRequest {\n op: OperationData\n}\n\nexport interface GetOpsOfWalletRequest extends BaseApiRequest {\n walletAddr: Address\n chainId: string\n status?: OperationStatus\n}\n\nexport interface GetOpsRequest extends BaseApiRequest {\n opIds: Hex[]\n chainId: string\n}\n\nexport interface DeleteOpRequest extends BaseApiRequest {\n opId: Hex\n chainId: string\n}\n\nexport interface SignOpRequest extends BaseApiRequest {\n opId: Hex\n chainId: string\n signature: Hex\n signedBy: Address\n threshold?: number\n}\n\nexport type OpRequest<T> = BaseApiRequest & {\n input: T\n}\n\nexport type ExecuteOpInput = {\n opId: Hex\n chainId: string\n executedBy: string\n entryPointAddress: Address\n signature: Hex\n userOp?: UserOperation\n groupInfo?: GroupInfo\n}\n\nexport type EstimateOpInput = {\n opId?: Hex\n chainId: string\n entryPointAddress?: Address\n signature?: Hex\n userOp?: UserOperation\n}\n\nexport type ScheduleOpInput = {\n opId: Hex\n chainId: string\n scheduledBy: string\n entryPointAddress: Address\n signature: Hex\n userOp?: UserOperation\n groupInfo?: GroupInfo\n}\n\nexport interface GetFullReceiptRequest extends BaseApiRequest {\n opId: string\n chainId: string\n userOpHash: string\n}\n\nexport interface GetUserOpGasPriceRequest extends BaseApiRequest {\n chainId: string\n}\n\nexport type UserOperationGasPrice = {\n maxFeePerGas: bigint\n maxPriorityFeePerGas: bigint\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendPostRequest } from '../../utils'\nimport type { AddPaymasterTransactionRequest } from './types'\n\nexport async function addTransaction({\n chainId,\n timestamp,\n txid,\n transaction,\n paymasterType,\n sponsorAddress,\n ...options\n}: AddPaymasterTransactionRequest): Promise<unknown> {\n return await sendPostRequest({\n uri: `${API_BASE_URL}/dashboard/paymasters/add-transaction`,\n body: {\n chain: chainId,\n sponsorAddress,\n type: paymasterType,\n timestamp,\n transaction,\n txid,\n },\n ...options,\n }).catch(() => {\n /* empty */\n })\n}\n", "import type { BaseApiRequest } from '../../consts'\nimport type { ExecutionReceipt } from '../fw-operation'\n\nexport interface PaymasterTransaction {\n action: string\n amount: number\n from: string\n to: string\n token: string\n txid?: string\n}\n\nexport interface AddPaymasterTransactionRequest extends BaseApiRequest {\n chainId: string\n timestamp: number\n txid: ExecutionReceipt['txId'] | string\n transaction: PaymasterTransaction\n paymasterType: PaymasterType\n sponsorAddress: string\n}\n\nexport enum PaymasterType {\n BaseSponsor = 'base',\n GaslessSponsor = 'gasless',\n TokenSponsor = 'token',\n CheckoutSponsor = 'checkout',\n}\n", "import { ResourceNotFoundError } from '@funkit/utils'\nimport { type Hex, InvalidParameterError } from 'viem'\nimport { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n AddUserToWalletRequest,\n CreateUserRequest,\n GetUserUniqueIdRequest,\n GetUserWalletIdentitiesRequest,\n GetUserWalletsByAddrRequest,\n Wallet,\n} from './types'\n\nexport async function createUser({\n authId,\n addr,\n method,\n userUniqueId,\n ...options\n}: CreateUserRequest): Promise<void> {\n await sendPostRequest({\n uri: `${API_BASE_URL}/user`,\n body: {\n authId,\n addr,\n method,\n userUniqueId,\n },\n ...options,\n })\n}\n\nexport async function getUserUniqueId({\n authId,\n ...options\n}: GetUserUniqueIdRequest): Promise<string> {\n try {\n return (\n await sendGetRequest<{ userUniqueId: string }>({\n uri: `${API_BASE_URL}/user/auth/${authId}/unique-id`,\n ...options,\n })\n ).userUniqueId\n } catch (err) {\n if (err instanceof ResourceNotFoundError) {\n return ''\n }\n throw err\n }\n}\n\nexport async function getUserWalletsByAddr({\n addr,\n chainId,\n ...options\n}: GetUserWalletsByAddrRequest): Promise<Wallet[]> {\n const endpoint = chainId\n ? `${API_BASE_URL}/user/addr/${addr}/wallets?chainId=${chainId}`\n : `${API_BASE_URL}/user/addr/${addr}/wallets`\n return (\n await sendGetRequest<{ wallets: Wallet[] }>({ uri: endpoint, ...options })\n ).wallets\n}\n\nexport async function addUserToWallet({\n authId,\n chainId,\n walletAddr,\n userIds,\n walletUniqueId,\n ...options\n}: AddUserToWalletRequest): Promise<void> {\n try {\n await sendPostRequest({\n uri: `${API_BASE_URL}/user/auth/${authId}/chain/${chainId}/wallet`,\n body: { walletAddr, userIds, walletUniqueId },\n ...options,\n })\n } catch (err) {\n if (err instanceof InvalidParameterError) {\n // TODO: What about any other cause of InvalidParameterError???\n // swallow the error if the wallet already exists.\n return\n }\n\n throw err\n }\n}\n\n/**\n * @returns userIds of the specified Wallet.\n */\nexport async function getUserWalletIdentities({\n authId,\n chainId,\n walletAddr,\n ...options\n}: GetUserWalletIdentitiesRequest): Promise<Hex[]> {\n return (\n (\n await sendGetRequest<{ ids: Hex[] }>({\n uri: `${API_BASE_URL}/user/auth/${authId}/chain/${chainId}/wallet/${walletAddr}/identities`,\n ...options,\n })\n ).ids ?? []\n )\n}\n", "import { type BaseApiRequest, MESH_API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n GetCryptoPurchaseLimitsParams,\n MeldCreateCryptoQuoteParams,\n MeldCreateCryptoQuoteResponse,\n MeldCreateCryptoWidgetParams,\n MeldCreateCryptoWidgetResponse,\n MeldDefaultFiatResponse,\n MeldFiatLimitResponse,\n MeldSupportedFiatResponse,\n SearchDefaultFiatParams,\n} from './types'\n\nexport async function getMeldSupportedFiat({\n ...options\n}: BaseApiRequest): Promise<MeldSupportedFiatResponse> {\n return sendGetRequest({\n uri: `${MESH_API_BASE_URL}/api/meld/fiat`,\n ...options,\n retryOptions: { maxAttempts: 2 },\n })\n}\n\nexport async function getMeldQuotes({\n params,\n ...options\n}: BaseApiRequest & {\n params: MeldCreateCryptoQuoteParams\n}): Promise<MeldCreateCryptoQuoteResponse> {\n return sendPostRequest({\n uri: `${MESH_API_BASE_URL}/api/meld/quote`,\n body: params,\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\nexport async function startMeldSession({\n params,\n ...options\n}: BaseApiRequest & {\n params: MeldCreateCryptoWidgetParams['sessionData']\n}): Promise<MeldCreateCryptoWidgetResponse> {\n return sendPostRequest({\n uri: `${MESH_API_BASE_URL}/api/meld/session`,\n body: {\n sessionData: params,\n sessionType: 'BUY',\n },\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\nexport async function getMeldDefaultFiat({\n params,\n ...options\n}: BaseApiRequest & {\n params: SearchDefaultFiatParams\n}): Promise<MeldDefaultFiatResponse> {\n const countries = params.countries?.join(',') ?? ''\n const categories = params.categories?.join(',') ?? ''\n const urlParams = new URLSearchParams({\n ...(countries ? { countries } : {}),\n ...(categories ? { categories } : {}),\n })\n\n return sendGetRequest({\n uri: `${MESH_API_BASE_URL}/api/meld/defaultFiat?${urlParams}`,\n ...options,\n retryOptions: { maxAttempts: 2 },\n })\n}\n\nexport async function getMeldFiatLimits({\n params,\n ...options\n}: BaseApiRequest & {\n params: GetCryptoPurchaseLimitsParams\n}): Promise<MeldFiatLimitResponse> {\n const countries = params.countries.join(',')\n const cryptoCurrencies = params.cryptoCurrencies.join(',')\n const fiatCurrencies = params.fiatCurrencies.join(',')\n const categories = params.categories?.join(',') ?? ''\n const urlParams = new URLSearchParams({\n countries,\n cryptoCurrencies,\n fiatCurrencies,\n ...(categories ? { categories } : {}),\n })\n\n return sendGetRequest({\n uri: `${MESH_API_BASE_URL}/api/meld/fiatLimit?${urlParams}`,\n ...options,\n retryOptions: { maxAttempts: 2 },\n })\n}\n", "export enum MeldServiceProvider {\n ALCHEMYPAY = 'ALCHEMYPAY',\n BANXA = 'BANXA',\n BILIRA = 'BILIRA',\n BINANCECONNECT = 'BINANCECONNECT',\n BLOCKCHAINDOTCOM = 'BLOCKCHAINDOTCOM',\n BTCDIRECT = 'BTCDIRECT',\n COINBASEPAY = 'COINBASEPAY',\n MOONPAY = 'MOONPAY',\n FONBNK = 'FONBNK',\n GUARDARIAN = 'GUARDARIAN',\n KOYWE = 'KOYWE',\n MERCURYO = 'MERCURYO',\n MESH = 'MESH',\n MESO = 'MESO',\n ONMETA = 'ONMETA',\n ONRAMPMONEY = 'ONRAMPMONEY',\n PAYBIS = 'PAYBIS',\n PAYPAL = 'PAYPAL',\n RAMP = 'RAMP',\n REVOLUT = 'REVOLUT',\n ROBINHOOD = 'ROBINHOOD',\n SARDINE = 'SARDINE',\n SHIFT4 = 'SHIFT4',\n SIMPLEX = 'SIMPLEX',\n SKRILLCRYPTO = 'SKRILLCRYPTO',\n STRIPE = 'STRIPE',\n TOPPER = 'TOPPER',\n TRANSAK = 'TRANSAK',\n TRANSFI = 'TRANSFI',\n UNLIMIT = 'UNLIMIT',\n YELLOWCARD = 'YELLOWCARD',\n}\n\nexport const MELD_PROVIDER_CATEGORIES = [\n 'BANK_LINKING',\n 'CRYPTO_ONRAMP',\n 'CRYPTO_OFFRAMP',\n 'CRYPTO_TRANSFER',\n 'FIAT_PAYMENTS',\n] as const\n\nexport type MeldFiatCurrency = {\n /** fiat code. e.g. USD/EUR */\n currencyCode: string\n /** fiat name. e.g. United State Dollar */\n name: string\n /** image URL for the currency symbol provided by meld */\n symbolImageUrl: string\n}\n\nexport type MeldDefaultFiatCurrency = {\n /** Two-letter code (ISO 3166-1 alpha-2) for the Country. */\n countryCode: string\n /** fiat code. e.g. USD/EUR */\n defaultCurrencyCode: string\n /** The identifier for the Payment Method */\n defaultPaymentMethods: MeldQuote['paymentMethodType'][]\n}\n\nexport type MeldCreateCryptoQuoteParams = {\n /**\n * Two-letter country code (ISO 3166-1 alpha-2)\n */\n countryCode: string\n\n /**\n * Meld generated unique identifier for your customer. This should be used to track customer activity.\n */\n customerId?: string\n\n /**\n * The cryptocurrency the customer is buying (e.g. BTC, ETH).\n */\n destinationCurrencyCode: string\n\n /**\n * Your unique identifier for your customer. If maintaining your own customer management system this can also be used for tracking customer activity.\n */\n externalCustomerId?: string\n\n /**\n * Payment Method Type or SubType\n */\n paymentMethodType?: string\n\n /**\n * An optional list of Strings representing the Service Providers for this Quote\n */\n serviceProviders?: MeldServiceProvider[]\n\n /**\n * The amount of source currency your customer wants tosend in this transaction (e.g., 50.05)\n */\n sourceAmount: `${number}`\n\n /**\n * The fiat currency the user is buying crypto with (e.g. USD, EUR)\n */\n sourceCurrencyCode: string\n\n /**\n * Subdivision is a optional parameter Only applicable if the country code is US or CA (e.g. US-CA).\n */\n subdivision?: string\n\n /**\n * Your customer's wallet address\n */\n walletAddress?: `0x${string}`\n}\n\nexport type MeldQuote = {\n /**\n * Two-letter country code (ISO 3166-1 alpha-2)\n */\n countryCode: string\n\n /**\n * A numerical score representing the expectation a Customer will convert\n */\n customerScore?: number\n\n /**\n * Destination currency amount to be received for this quote\n */\n destinationAmount: number\n\n /**\n * Code of currency being quoted: BTC, ETH, ...\n */\n destinationCurrencyCode: string\n\n /**\n * The exchange rate at the time the request is sent\n */\n exchangeRate: number\n\n /**\n * The fiat amount exchanged when buying or selling crypto, excluding fees\n */\n fiatAmountWithoutFees: number\n\n /**\n * The name of the institution or broker used for this quote, if present\n */\n institutionName?: string | null\n\n /**\n * LowKYC indicates if the quote amount is below the provider's low KYC threshold, meaning the user may not need to upload documents, which can increase conversion.\n */\n lowKyc?: boolean | null\n\n /**\n * The network fee applied to a crypto transaction\n */\n networkFee?: number | null\n\n /**\n * The fee amount charged by the partner to process your customer's purchase\n */\n partnerFee?: number | null\n\n /**\n * Payment Method Type used for this quote\n */\n paymentMethodType: 'APPLE_PAY' | 'MASTERCARD' | 'SEPA' | 'VISA'\n\n /**\n * The service provider used for this transaction\n */\n serviceProvider: MeldServiceProvider\n\n /**\n * Amount requested + fees\n */\n sourceAmount: number\n\n /**\n * The fiat currency the user is buying crypto with (e.g. USD, EUR)\n */\n sourceCurrencyCode: string\n\n /**\n * The total amount of fees that will be charged\n */\n totalFee?: number | null\n\n /**\n * The fee amount charged by the service provider to process your customer's purchase\n */\n transactionFee?: number | null\n\n /**\n * The type of crypto transaction\n */\n transactionType: 'CRYPTO_PURCHASE' // | 'CRYPTO_SELL', but only care about buying atm\n}\n\nexport type MeldCreateCryptoQuoteResponse = {\n quotes: MeldQuote[]\n}\n\nexport type MeldCreateCryptoWidgetParams = {\n /**\n * Meld generated unique identifier for your customer. This should be used to track customer activity.\n */\n customerId?: string\n\n /**\n * Your unique identifier for your customer. If maintaining your own customer management system this can also be used for tracking customer activity.\n */\n externalCustomerId?: string\n\n /**\n * Your reference Id for your widget session\n */\n externalSessionId?: string\n\n sessionData: {\n /**\n * Two-letter country code (ISO 3166-1 alpha-2)\n */\n countryCode: string\n\n /**\n * The cryptocurrency the customer is buying (e.g. BTC, ETH).\n */\n destinationCurrencyCode: string\n\n /**\n * If provided, the institution to bypass the institution selection screen in the service provider's widget. Currently this is only supported for MESH widget sessions.\n */\n institutionId?: string\n\n /**\n * Where supported by the Service Provider, Meld can help you lock the cryptocurrency and/or wallet address fields within the widget.\n */\n lockFields?: ('destinationCurrencyCode' | 'walletAddress')[]\n\n /**\n * Payment Method Type or SubType\n */\n paymentMethodType?: string\n\n /**\n * The url to redirect to following completion of the widget flow\n */\n redirectUrl?: string\n\n /**\n * The service provider used for this transaction\n */\n serviceProvider: MeldServiceProvider\n\n /**\n * The amount of source currency your customer wants to send in this transaction (e.g., 50.05)\n */\n sourceAmount: `${number}`\n\n /**\n * The fiat currency the user is buying crypto with (e.g. USD, EUR)\n */\n sourceCurrencyCode: string\n\n /**\n * Your customer's wallet address\n */\n walletAddress: `0x${string}`\n\n /**\n * Your customer's wallet tag/destination tag/memo. This field is required for certain cryptocurrencies.\n */\n walletTag?: string\n }\n\n sessionType: 'BUY' // | 'SELL' | 'TRANSFER' - We only care about BUY atm\n\n /**\n * For MESH only. Details about a previously authenticated crypto session or bank-linking connection.\n * If provided, the widget will not require the customer to authenticate again as long as the authentication is still valid.\n * The scope of these authentication bypass details are restricted to the same customer, service provider, and institution that were used in the original connection.\n */\n authenticationBypassDetails?: {\n /**\n * The widget type associated with the previously authenticated session/connection.\n */\n category: string\n\n /**\n * The Meld id of the crypto session or bank-linking connection in which the customer has already authenticated with their institution.\n * The auth tied to this session/connection will be used to bypass the authentication process for the current session, if it is still valid.\n * This id may pertain to the initial session/connection in which the customer authenticated, or any subsequent session that used this prior authentication successfully.\n */\n previouslyAuthenticatedId: string\n }\n}\n\nexport type MeldCreateCryptoWidgetResponse = {\n /**\n * Meld generated unique identifier for your customer. This should be used to track customer activity.\n */\n customerId?: string | null\n\n /**\n * Your unique identifier for your customer. If maintaining your own customer management system this can also be used for tracking customer activity.\n */\n externalCustomerId?: string | null\n\n /**\n * Your reference Id for your widget session\n */\n externalSessionId?: string | null\n\n /**\n * Unique identifier for this session\n */\n id: string\n\n /**\n * The session token\n */\n token: string\n\n /**\n * The crypto widget URL\n */\n widgetUrl: string\n}\n\nexport interface MeldError extends Error {\n /**\n * A categorization of the error\n */\n code: string\n\n /**\n * A user-friendly representation of the error code.\n * This may change over time and is not safe for programmatic use.\n */\n errors?: string[] | null\n\n /**\n * A developer-friendly representation of the error code.\n * This may change over time and is not safe for programmatic use.\n */\n message: string\n\n /**\n * The request Id\n */\n requestId: string\n\n /**\n * The date and time when the request was made (ISO)\n */\n timestamp: string | null\n}\n\nexport interface MeldSupportedFiatResponse {\n currencies: MeldFiatCurrency[]\n /** Irrelevant */\n preferred: string[]\n}\n\nexport type SearchDefaultFiatParams = {\n countries: string[]\n categories?: (typeof MELD_PROVIDER_CATEGORIES)[number][]\n}\n\nexport interface MeldDefaultFiatResponse {\n currencies: MeldDefaultFiatCurrency[]\n}\n\nexport interface GetCryptoPurchaseLimitsParams {\n /**\n * The two-letter country code (ISO 3166-1 alpha-2) to search for supported fiat currencies.\n * A comma separated list of countries.\n */\n countries: string[]\n\n /**\n * The crypto currencies to search for limits\n */\n cryptoCurrencies: string[]\n\n /**\n * The fiat currencies to search for limits\n */\n fiatCurrencies: string[]\n\n /**\n * The categories to search for limits\n */\n categories?: (typeof MELD_PROVIDER_CATEGORIES)[number][]\n}\n\nexport interface MeldFiatCurrencyLimit {\n currencyCode: string\n defaultAmount: number | null\n minimumAmount: number\n maximumAmount: number\n}\n\nexport interface MeldFiatLimitResponse {\n limits: MeldFiatCurrencyLimit[]\n}\n", "import { ErrorCode, InternalFailureError } from '@funkit/utils'\nimport { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n GetMoonpayBuyQuoteForCreditCardRequest,\n GetMoonpayBuyQuoteForCreditCardResponse,\n GetMoonpayUrlSignatureRequest,\n} from './types'\n\ninterface GetMoonpayUrlSignatureResponse {\n url: string\n}\n\nexport async function getMoonpayUrlSignature({\n url,\n isSandbox,\n ...options\n}: GetMoonpayUrlSignatureRequest): Promise<string> {\n const signature = await sendPostRequest<GetMoonpayUrlSignatureResponse>({\n uri: `${API_BASE_URL}/on-ramp/moonpay-signature/`,\n body: { url, isSandbox },\n ...options,\n })\n if (!signature || !signature?.url) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n 'No onramp url found.',\n '',\n { url },\n 'This is an internal error, please contact support.',\n 'https://docs.fun.xyz',\n )\n }\n return signature.url\n}\n\nexport async function getMoonpayBuyQuoteForCreditCard({\n currencyCode,\n baseCurrencyCode,\n quoteCurrencyAmount,\n baseCurrencyAmount,\n extraFeePercentage,\n areFeesIncluded,\n ...options\n}: GetMoonpayBuyQuoteForCreditCardRequest): Promise<GetMoonpayBuyQuoteForCreditCardResponse> {\n const params = new URLSearchParams({\n currencyCode,\n baseCurrencyCode,\n quoteCurrencyAmount,\n paymentMethod: 'credit_debit_card',\n ...(baseCurrencyAmount == null\n ? {}\n : { baseCurrencyAmount: baseCurrencyAmount.toString() }),\n ...(extraFeePercentage == null\n ? {}\n : { extraFeePercentage: extraFeePercentage.toString() }),\n ...(areFeesIncluded == null\n ? {}\n : { areFeesIncluded: areFeesIncluded.toString() }),\n }).toString()\n\n return sendGetRequest({\n uri: `${API_BASE_URL}/on-ramp/moonpay-buy-quote?${params}`,\n retryOptions: { maxAttempts: 1 },\n ...options,\n })\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport type { GetOrganizationIdRequest } from './types'\n\nexport async function getOrganizationIdByApiKey({\n apiKey,\n}: GetOrganizationIdRequest) {\n return await sendGetRequest<{ id: string }>({\n uri: `${API_BASE_URL}/organization`,\n apiKey,\n })\n}\n", "import { API_BASE_URL, type BaseApiRequest } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n CreateStripeBuySessionBody,\n CreateStripeBuySessionResponse,\n GetStripeBuyQuoteRequest,\n GetStripeBuyQuoteResponse,\n} from './types'\n\nexport async function getStripeBuyQuote({\n sourceCurrency,\n destinationAmount,\n destinationCurrency,\n destinationNetwork,\n isSandbox,\n ...options\n}: GetStripeBuyQuoteRequest): Promise<GetStripeBuyQuoteResponse> {\n const params = new URLSearchParams({\n isSandbox: isSandbox.toString(),\n sourceCurrency,\n destinationAmount: destinationAmount.toString(),\n // Only allow one currency in this SDK\n destinationCurrencies: destinationCurrency,\n // Only allow one network in this SDK\n destinationNetworks: destinationNetwork,\n }).toString()\n const buyQuoteResp = await sendGetRequest({\n uri: `${API_BASE_URL}/on-ramp/stripe-buy-quote?${params}`,\n retryOptions: { maxAttempts: 1 },\n ...options,\n })\n return buyQuoteResp as GetStripeBuyQuoteResponse\n}\n\nexport async function createStripeBuySession({\n sourceCurrency,\n destinationAmount,\n destinationCurrency,\n destinationNetwork,\n walletAddress,\n customerIpAddress,\n isSandbox,\n ...options\n}: CreateStripeBuySessionBody): Promise<CreateStripeBuySessionResponse> {\n const body = {\n isSandbox: isSandbox.toString(),\n sourceCurrency,\n destinationAmount: destinationAmount.toString(),\n // Only allow one currency in this SDK\n destinationCurrency,\n destinationCurrencies: [destinationCurrency],\n // Only allow one network in this SDK\n destinationNetwork,\n destinationNetworks: [destinationNetwork],\n // Only allow one wallet address in this SDK, and it must correspond to the destination network\n walletAddresses: {\n [destinationNetwork]: walletAddress,\n },\n ...(customerIpAddress ? { customerIpAddress } : {}),\n }\n const newBuySessionResp = await sendPostRequest({\n uri: `${API_BASE_URL}/on-ramp/stripe-checkout`,\n body,\n retryOptions: { maxAttempts: 1 },\n ...options,\n })\n return newBuySessionResp as CreateStripeBuySessionResponse\n}\n\nexport async function getStripeBuySession({\n sessionId,\n ...options\n}: BaseApiRequest & {\n sessionId: string\n}): Promise<CreateStripeBuySessionResponse> {\n const buySessionResp = await sendGetRequest({\n uri: `${API_BASE_URL}/on-ramp/stripe-checkout-session/${sessionId}`,\n retryOptions: { maxAttempts: 1 },\n ...options,\n })\n return buySessionResp as CreateStripeBuySessionResponse\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendPostRequest } from '../../utils'\nimport type { SendSupportMessageRequest } from './types'\n\nexport async function sendSupportMessage({\n title,\n description,\n userEmail,\n ...options\n}: SendSupportMessageRequest): Promise<boolean> {\n try {\n await sendPostRequest({\n uri: `${API_BASE_URL}/support/send-message`,\n body: { title, description, userEmail },\n retryOptions: { maxAttempts: 1 },\n ...options,\n })\n return true\n } catch (_err) {\n return false\n }\n}\n", "import { type BaseApiRequest, MESH_API_BASE_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport type { ExchangeRates } from './types'\n\n/**\n * Get the exchange rates for all fiat currencies\n * @returns The exchange rates for all fiat currencies\n */\nexport async function getFiatExchangeRates({\n ...options\n}: Omit<BaseApiRequest, 'apiKey'> = {}): Promise<ExchangeRates> {\n return sendGetRequest({\n uri: `${MESH_API_BASE_URL}/api/exchange-rates`,\n apiKey: '', // Just a hack to make typescript happy as we don't require an API Key for this endpoint\n ...options,\n retryOptions: { maxAttempts: 2 },\n })\n}\n"],
5
- "mappings": ";AAAO,IAAM,eAA2C;AAEjD,IAAM,oBACsB;AAE5B,IAAM,iBAAiB;;;ACL9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGA,IAAM,oBAAoB,CAAC,KAAY,YAA4B;AACxE,MACE,e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consts/api.ts", "../src/utils/error.ts", "../src/consts/retry.ts", "../src/consts/customers.ts", "../src/utils/checkout.ts", "../src/utils/request.ts", "../src/services/assets/endpoints.ts", "../src/services/bridge/endpoints.ts", "../src/services/bridge/types.ts", "../src/services/checkout/endpoints.ts", "../src/services/checkout/types.ts", "../src/services/direct-execution/endpoints.ts", "../src/services/direct-execution/types.ts", "../src/services/faucet/endpoints.ts", "../src/services/fw-access/endpoints.ts", "../src/services/fw-group/endpoints.ts", "../src/services/fw-info/endpoints.ts", "../src/services/fw-operation/endpoints.ts", "../src/services/fw-operation/types.ts", "../src/services/fw-paymaster/endpoints.ts", "../src/services/fw-paymaster/types.ts", "../src/services/fw-user/endpoints.ts", "../src/services/meld/endpoints.ts", "../src/services/meld/types.ts", "../src/services/moonpay/endpoints.ts", "../src/services/organization/endpoints.ts", "../src/services/stripe/endpoints.ts", "../src/services/support/endpoints.ts", "../src/services/exchange-rates/endpoints.ts", "../src/services/bluvo/endpoints.ts"],
4
+ "sourcesContent": ["export const API_BASE_URL = process.env.API_BASE_URL || 'https://api.fun.xyz/v1' // Production\n\nexport const FROG_API_BASE_URL =\n process.env.FROG_API_BASE_URL || 'https://frog.fun.xyz'\n\nexport const FUN_FAUCET_URL = 'https://api.fun.xyz/demo-faucet'\n", "import {\n InvalidParameterError,\n ResourceNotFoundError,\n UserOpFailureError,\n} from '@funkit/utils'\nimport type { AttemptContext } from '@lifeomic/attempt'\n\nexport const errorAbortHandler = (err: Error, context: AttemptContext) => {\n if (\n err instanceof ResourceNotFoundError ||\n err instanceof InvalidParameterError ||\n err instanceof UserOpFailureError\n ) {\n context.abort()\n }\n}\n", "import type { PartialAttemptOptions } from '@lifeomic/attempt'\n\nimport { errorAbortHandler } from '../utils/error'\n\nexport type BaseResponse = unknown\n\nexport type RetryOptions<T = BaseResponse> = PartialAttemptOptions<T>\n\nexport const DEFAULT_RETRY_OPTIONS = {\n delay: 100,\n initialDelay: 0,\n maxDelay: 3000,\n factor: 2,\n maxAttempts: 2,\n timeout: 0,\n jitter: true,\n minDelay: 0,\n handleError: errorAbortHandler,\n handleTimeout: null,\n beforeAttempt: null,\n calculateDelay: null,\n} as RetryOptions\n", "export const DEGEN_API_KEY = 'm4iHIILHcL4gN8EXCMzGe8zIdhuCXxck49mWajzJ'\nexport const POLYMARKET_API_KEY = 'Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6'\nexport const OSTIUM_API_KEY = 'SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN'\nexport const DEV_API_KEY = 'Z9SZaOwpmE40KX61mUKWm5hrpGh7WHVkaTvQJpQk'\nexport const BANKR_API_KEY = 'vWe20Dfyui2ouvfOhtSTY3Czeo8lFdbo5xXQBALZ'\nexport const QUICKSWAP_API_KEY = 'sdbYyJRkXz7uuCCiA7KDu2SzYknwgwCN5rgBllKR'\nexport const BSX_API_KEY = 'zN1zrkmLQn4oZtLUW9Qt02uuBI3Jvrgj8Ni40Gf1'\nexport const BENQI_API_KEY = 'q8qZWLvviLaOaG4bX3w2v6zLN9uxNPaU6CX8I0Gd'\nexport const ETHEREAL_API_KEY = 'M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um'\nexport const KATANA_API_KEY = 'OXLUmejkh9PlNDS4gSvi9gcEWacOpTz2KUVepVf4'\nexport const SUSHI_API_KEY = 'HKHvPSPDezaxsTohFgDuG4WpKW6hB4SFYyztm9vc'\nexport const HYPERBEAT_API_KEY = 'lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau'\nexport const HYPERSWAP_API_KEY = 'AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK'\nexport const FELIX_API_KEY = 'cGlmpTmNh657m8TiV5RFdwna6FG5pxM6ajiNHvw3'\nexport const CAMBRIA_API_KEY = 'BPVeP8zThG467vVIYzuiu5aVWAkS9KiR6tT1TdTP'\nexport const HYPERDASH_API_KEY = 'di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe'\nexport const MONKEY_TILT_API_KEY = '2SrxurU07T2XPDxCAItjj4yYEMXlwV8K2kJB78AX'\nexport const BASED_API_KEY = 'clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e'\nexport const VENTUALS_API_KEY = '5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2'\nexport const HYENA_API_KEY = 'pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW'\n", "import { toHex } from 'viem'\n\nexport function randomBytes(length: number) {\n const bytes = new Uint8Array(length)\n for (let i = 0; i < length; i++) {\n bytes[i] = Math.floor(Math.random() * 256)\n }\n return toHex(bytes)\n}\n\nexport function generateRandomCheckoutSalt() {\n return toHex(BigInt(randomBytes(32)))\n}\n\nexport function roundToNearestBottomTenth(n: number) {\n return Math.floor(n / 10) * 10\n}\n", "import { retry } from '@lifeomic/attempt'\n\nimport type { BaseRequest } from '../consts/request'\nimport {\n type BaseResponse,\n DEFAULT_RETRY_OPTIONS,\n type RetryOptions,\n} from '../consts/retry'\n\nimport {\n AccessDeniedError,\n ErrorCode,\n InternalFailureError,\n InvalidParameterError,\n ResourceNotFoundError,\n ThrottlingError,\n UserOpFailureError,\n jsonStringifyWithBigIntSanitization,\n} from '@funkit/utils'\nimport type {\n DeleteRequest,\n GetRequest,\n PostRequest,\n PutRequest,\n} from './../consts/request'\n\ntype RequestError = {\n errorMsg: string\n errorCode: string\n}\n\nexport async function sendRequest<T = BaseResponse>({\n uri,\n method,\n apiKey,\n body = {},\n logger,\n retryOptions = {},\n signal,\n}: BaseRequest): Promise<T> {\n const headers = {\n 'Content-Type': 'application/json',\n ...(apiKey ? { 'X-Api-Key': apiKey } : {}),\n }\n\n try {\n const finalRetryOptions = {\n ...DEFAULT_RETRY_OPTIONS,\n ...retryOptions,\n } as RetryOptions<T>\n\n return await retry<T>(async (context) => {\n const startTimeMs = Date.now()\n const fetchParams = {\n method,\n headers,\n redirect: 'follow',\n signal,\n body:\n method !== 'GET'\n ? jsonStringifyWithBigIntSanitization(body)\n : undefined,\n } as RequestInit\n\n logger?.info('api-base:sendRequest_before', {\n uri,\n fetchParams,\n startTimeMs,\n })\n const response = await fetch(uri, fetchParams)\n const json = await response.json()\n const endTimeMs = Date.now()\n logger?.info('api-base:sendRequest_after', {\n url: uri,\n fetchParams,\n endTimeMs,\n response: {\n body: json,\n status: response.status,\n },\n durationMs: endTimeMs - startTimeMs,\n retries: context.attemptNum,\n })\n\n if (response.ok) {\n return json\n }\n\n const { errorMsg, errorCode } = json as RequestError\n\n if (response.status === 400) {\n throw new InvalidParameterError(\n ErrorCode.InvalidParameter,\n `bad request ${JSON.stringify(json)}`,\n errorMsg,\n { body },\n 'check the api call parameters. its mostly because some call parameters are wrong',\n 'https://docs.fun.xyz',\n )\n }\n if (response.status === 403) {\n throw new AccessDeniedError(\n ErrorCode.Unauthorized,\n 'Invalid API key or insufficient access.',\n errorMsg,\n { apiKey },\n 'Check your api key at https://app.fun.xyz and check with fun team if you believe something is off',\n 'https://docs.fun.xyz',\n )\n }\n if (response.status === 404) {\n throw new ResourceNotFoundError(\n ErrorCode.ServerMissingData,\n JSON.stringify(json),\n errorMsg,\n { body },\n 'check the api call parameters. its mostly because some call parameters are wrong',\n 'https://docs.fun.xyz',\n )\n }\n if (response.status === 429) {\n throw new ThrottlingError(\n ErrorCode.RequestLimitExceeded,\n `too many requests ${JSON.stringify(json)}`,\n 'Too many requests',\n { body },\n 'you are making too many requests. please slow down. Reach out to fun team if you need more quota',\n 'https://docs.fun.xyz',\n )\n }\n if (response.status === 500) {\n if (errorCode === ErrorCode.UserOpFailureError) {\n throw new UserOpFailureError(\n ErrorCode.UserOpFailureError,\n JSON.stringify(json), // UserOpFailureError may JSON.parse this! Do not modify!\n errorMsg,\n { body },\n 'fix user op failure. Most of the time this is due to invalid parameters',\n 'https://docs.fun.xyz',\n )\n }\n throw new InternalFailureError(\n ErrorCode.ServerFailure,\n `server failure ${JSON.stringify(json)}`,\n errorMsg,\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n }\n if (response.status === 504) {\n throw new InternalFailureError(\n ErrorCode.ServerTimeout,\n `server timeout failure ${JSON.stringify(json)}`,\n errorMsg,\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n }\n if (!response.ok) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n `unknown server failure ${JSON.stringify(json)}`,\n errorMsg,\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n }\n return {}\n }, finalRetryOptions)\n } catch (err) {\n logger?.error('api-base:fetch_error', {\n url: uri,\n method,\n request: {\n body,\n headers,\n },\n error: err,\n })\n\n // Rethrow the error to match existing behavior\n if (err instanceof Error) {\n throw err\n }\n\n throw new InternalFailureError(\n ErrorCode.ServerConnectionError,\n `Cannot connect to Fun API Service ${err}`,\n '',\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n }\n}\n\nexport async function sendGetRequest<T = BaseResponse>(\n options: GetRequest,\n): Promise<T> {\n return await sendRequest({ ...options, method: 'GET' })\n}\n\nexport async function sendPostRequest<T = BaseResponse>(\n options: PostRequest,\n): Promise<T> {\n return await sendRequest({ ...options, method: 'POST' })\n}\n\nexport async function sendPutRequest<T = BaseResponse>(\n options: PutRequest,\n): Promise<T> {\n return await sendRequest({ ...options, method: 'PUT' })\n}\n\nexport async function sendDeleteRequest(options: DeleteRequest): Promise<void> {\n await sendRequest({ ...options, method: 'DELETE' })\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport type {\n Erc20AssetInfo,\n GetAllWalletNFTsByChainIdRequest,\n GetAllWalletNFTsByChainIdResponse,\n GetAllWalletNFTsRequest,\n GetAllWalletNFTsResponse,\n GetAllWalletTokensByChainIdRequest,\n GetAllWalletTokensByChainIdResponse,\n GetAllWalletTokensRequest,\n GetAllWalletTokensResponse,\n GetAllowedAssetsRequest,\n GetAllowedAssetsResponse,\n GetAssetErc20ByChainAndSymbolRequest,\n GetAssetPriceInfoRequest,\n GetAssetPriceInfoResponse,\n GetNftAddressRequest,\n GetNftNameRequest,\n GetWalletLidoWithdrawalsByChainId,\n GetWalletLidoWithdrawalsByChainIdResponse,\n NftAssetInfo,\n} from './types'\n\n/**\n * Gets the estimated dollar unit price of a tokenAddress for checkout\n * @param chainId https://chainlist.org/ e.g. \"1\" for ethereum\n * @param assetTokenAddress tokenAddress of the asset on the given chain\n * @param apiKey\n * @returns only `unitPrice` is relevant, since amount is not customizable (1 by default)\n */\nexport async function getAssetPriceInfo({\n chainId,\n assetTokenAddress,\n ...options\n}: GetAssetPriceInfoRequest): Promise<GetAssetPriceInfoResponse> {\n const priceInfo: GetAssetPriceInfoResponse = await sendGetRequest({\n uri: `${API_BASE_URL}/asset/erc20/price/${chainId}/${assetTokenAddress}`,\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n return priceInfo\n}\n\n/**\n * Gets the ERC20 asset info by chain and symbol\n * @param chainId https://chainlist.org/ e.g. \"1\" for ethereum\n * @param symbol symbol of the asset\n * @param apiKey\n */\nexport async function getAssetErc20ByChainAndSymbol({\n chainId,\n symbol,\n ...options\n}: GetAssetErc20ByChainAndSymbolRequest): Promise<Erc20AssetInfo> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/asset/erc20/${chainId}/${symbol}`,\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\n/**\n * Get all tokens for a given wallet address\n * @param walletAddress\n * @param onlyVerifiedTokens If true, only return alchemy tokens that are verified(filters spam)\n * @param apiKey\n * @param signal AbortSignal to cancel the request when no longer needed\n */\nexport async function getAllWalletTokens({\n walletAddress,\n onlyVerifiedTokens,\n ...options\n}: GetAllWalletTokensRequest): Promise<GetAllWalletTokensResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/erc20s/${walletAddress}?onlyVerifiedTokens=${onlyVerifiedTokens}`,\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\n/**\n * Get all tokens for a given wallet address on a specific chain\n * @param chainId https://chainlist.org/\n * @param walletAddress\n * @param onlyVerifiedTokens If true, only return alchemy tokens that are verified(filters spam)\n * @param apiKey\n */\nexport async function getAllWalletTokensByChainId({\n chainId,\n walletAddress,\n onlyVerifiedTokens,\n ...options\n}: GetAllWalletTokensByChainIdRequest): Promise<GetAllWalletTokensByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/erc20s/${walletAddress}/${chainId}?onlyVerifiedTokens=${onlyVerifiedTokens}`,\n\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\n/**\n * Get list of assets that are allowed to be used for checkout\n * @param apiKey\n */\nexport async function getAllowedAssets(\n options: GetAllowedAssetsRequest,\n): Promise<GetAllowedAssetsResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/allow`,\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\n/**=======================\n * POTENTIAL DEPRECATION\n *=======================*/\n\n/**\n * Get all the NFTs owned by a wallet\n * @param walletAddress\n * @param apiKey\n */\nexport async function getAllWalletNFTs({\n walletAddress,\n ...options\n}: GetAllWalletNFTsRequest): Promise<GetAllWalletNFTsResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/nfts/${walletAddress}`,\n ...options,\n })\n}\n\n/**\n * Get all the NFTs owned by a wallet on a specific chain\n * @param chainId From https://chainlist.org/\n * @param walletAddress Address of holder\n * @param apiKey\n */\nexport async function getAllWalletNFTsByChainId({\n chainId,\n walletAddress,\n ...options\n}: GetAllWalletNFTsByChainIdRequest): Promise<GetAllWalletNFTsByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/nfts/${walletAddress}/${chainId}`,\n ...options,\n })\n}\n\n/**\n * Get all lido withdrawal request ids for a wallet address on a specific chain\n * @param {string} chainId https://chainlist.org/ ie \"1\" for ethereum\n * @param {string} holderAddr Address of holder\n * @returns [readyToWithdrawRequestIds, notReadyToWithdrawRequestIds]\n */\nexport async function getWalletLidoWithdrawalsByChainId({\n chainId,\n walletAddress,\n ...options\n}: GetWalletLidoWithdrawalsByChainId): Promise<GetWalletLidoWithdrawalsByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/lido-withdrawals/${walletAddress}/${chainId}`,\n ...options,\n })\n}\n\n/**\n * Get the name of an NFT collection\n * @param {string} chainId https://chainlist.org/\n * @param {string} nftAddress Address of NFT\n */\nexport async function getNftName({\n chainId,\n nftAddress,\n ...options\n}: GetNftNameRequest): Promise<NftAssetInfo> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/asset/nft/${chainId}/${nftAddress}`,\n ...options,\n })\n}\n\n/**\n * Get the address and chainId of an NFT collection\n * @param {string} name Name of NFT\n */\nexport async function getNftAddress({\n name,\n ...options\n}: GetNftAddressRequest): Promise<NftAssetInfo> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/asset/nft?name=${name}`,\n ...options,\n })\n}\n", "import { FROG_API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n CreateBridgeBankAccountRequest,\n CreateBridgeBankAccountResponse,\n CreateFrogAndBridgeAccountRequest,\n CreateFrogAndBridgeAccountResponse,\n FindBridgeKycLinkRequest,\n FindBridgeKycLinkResponse,\n GetBridgeBankAccountRequest,\n GetBridgeBankAccountResponse,\n GetBridgeCustomerRequest,\n GetBridgeCustomerResponse,\n GetOrCreateFrogAccountRequest,\n GetOrCreateFrogAccountResponse,\n} from './types'\n\nexport async function getFrogAccount({\n subAccountId,\n subAccountType,\n ...options\n}: GetOrCreateFrogAccountRequest): Promise<GetOrCreateFrogAccountResponse> {\n const search = new URLSearchParams({\n subAccountId,\n subAccountType,\n })\n return sendGetRequest({\n uri: `${FROG_API_BASE_URL}/api/account?${search}`,\n ...options,\n })\n}\n\nexport async function createFrogAccount({\n subAccountId,\n subAccountType,\n ...options\n}: GetOrCreateFrogAccountRequest): Promise<GetOrCreateFrogAccountResponse> {\n return sendPostRequest({\n uri: `${FROG_API_BASE_URL}/api/account`,\n body: {\n subAccountId,\n subAccountType,\n },\n ...options,\n })\n}\n\nexport async function getBridgeCustomer({\n guid,\n ...options\n}: GetBridgeCustomerRequest): Promise<GetBridgeCustomerResponse> {\n return sendGetRequest({\n uri: `${FROG_API_BASE_URL}/api/bridge?guid=${guid}`,\n ...options,\n })\n}\n\nexport async function createBridgeCustomer({\n guid,\n name,\n email,\n endorsement,\n ...options\n}: CreateFrogAndBridgeAccountRequest): Promise<CreateFrogAndBridgeAccountResponse> {\n return sendPostRequest({\n uri: `${FROG_API_BASE_URL}/api/bridge`,\n body: {\n guid,\n name,\n email,\n endorsement,\n },\n ...options,\n })\n}\n\nexport async function getBridgeBankAccounts({\n subAccountId,\n ...options\n}: GetBridgeBankAccountRequest): Promise<GetBridgeBankAccountResponse> {\n return sendGetRequest({\n uri: `${FROG_API_BASE_URL}/api/bridge/bank?subAccountId=${subAccountId}`,\n ...options,\n })\n}\n\nexport async function createBridgeBankAccount({\n tokenName,\n chainName,\n destinationAddress,\n subAccountId,\n sourceCurrency,\n ...options\n}: CreateBridgeBankAccountRequest): Promise<CreateBridgeBankAccountResponse> {\n return sendPostRequest({\n uri: `${FROG_API_BASE_URL}/api/bridge/bank`,\n body: {\n subAccountId,\n tokenName,\n chainName,\n destinationAddress,\n sourceCurrency,\n },\n ...options,\n })\n}\n\nexport function getBridgeKycLink({\n guid,\n ...options\n}: FindBridgeKycLinkRequest): Promise<FindBridgeKycLinkResponse> {\n return sendGetRequest({\n uri: `${FROG_API_BASE_URL}/api/bridge/kyclink?guid=${guid}`,\n ...options,\n })\n}\n", "import type { Address } from 'viem'\nimport type { BaseApiRequest } from '../../consts'\n\ndeclare const brand: unique symbol\n\nexport type BridgeCustomerId = string & { [brand]: 'BridgeCustomerId' }\nexport type Guid = string & { [brand]: 'Guid' }\n\ntype DateString = `${number}-${number}-${number}T${number}:${number}:${number}Z`\n\nexport enum BridgeCustomerStatus {\n ACTIVE = 'active',\n AWAITING_QUESTIONNAIRE = 'awaiting_questionnaire',\n /** Ultimate Beneficial Owner - only relevant for business customers https://apidocs.bridge.xyz/docs/business-ownership-documents */\n AWAITING_UBO = 'awaiting_ubo',\n INCOMPLETE = 'incomplete',\n NOT_STARTED = 'not_started',\n OFFBOARDED = 'offboarded',\n PAUSED = 'paused',\n REJECTED = 'rejected',\n UNDER_REVIEW = 'under_review',\n}\n\n// https://apidocs.bridge.xyz/docs/rejection-reasons\nexport interface RejectionReason {\n created_at: DateString\n developer_reason: string\n reason: string\n}\n\nexport interface BridgeCustomer {\n id: BridgeCustomerId\n first_name: string\n last_name: string\n rejection_reasons: RejectionReason[]\n status: BridgeCustomerStatus\n}\n\nexport enum BridgeKycStatus {\n APPROVED = 'approved',\n INCOMPLETE = 'incomplete',\n NOT_STARTED = 'not_started',\n REJECTED = 'rejected',\n UNDER_REVIEW = 'under_review',\n}\n\nexport enum BridgeTosStatus {\n APPROVED = 'approved',\n PENDING = 'pending',\n}\n\nexport enum BridgeCustomerType {\n BUSINESS = 'business',\n INDIVIDUAL = 'individual',\n}\n\nexport interface BridgeKYCLinks {\n id: string\n customer_id: BridgeCustomerId\n created_at: DateString\n email: string\n kyc_link: string\n kyc_status: BridgeKycStatus\n tos_link: string\n tos_status: BridgeTosStatus\n type: BridgeCustomerType\n}\n\nexport interface SubAccountBase {\n id: number\n createdAt: DateString\n updatedAt: DateString\n guid: Guid\n subAccountType: string\n subAccountId: string\n isDeleted: boolean\n}\n\nexport interface WalletSubAccount extends SubAccountBase {\n subAccountType: 'wallet'\n subAccountId: Address\n}\n\nexport interface BridgeSubAccount extends SubAccountBase {\n subAccountType: 'bridge'\n subAccountId: BridgeCustomerId\n}\n\nexport type SubAccount = WalletSubAccount | BridgeSubAccount\n\nexport interface GetOrCreateFrogAccountRequest extends BaseApiRequest {\n subAccountType: 'wallet'\n subAccountId: Address\n}\n\nexport interface GetOrCreateFrogAccountResponse {\n accounts: SubAccount[]\n}\n\nexport interface GetBridgeCustomerRequest extends BaseApiRequest {\n guid: Guid\n}\n\nexport interface GetBridgeCustomerResponse {\n account: SubAccount\n bridgeCustomer: BridgeCustomer\n}\n\nexport enum BridgeEndorsement {\n BASE = 'base',\n SEPA = 'sepa',\n}\n\nexport type BridgeAccount = {\n guid: Guid\n name: string\n email: string\n endorsement: BridgeEndorsement\n}\nexport type CreateFrogAndBridgeAccountRequest = BaseApiRequest & BridgeAccount\n\nexport type CreateFrogAndBridgeAccountResponse =\n | {\n newCreated: true\n /** kyc link info will be present only when create new customer */\n kycLinks: BridgeKYCLinks\n }\n | {\n newCreated: false\n kycLink: string\n }\n\nexport type BridgeVirtualAcountId = string & {\n [brand]: 'BridgeVirtualAcountId'\n}\n\nexport interface BridgeDestination {\n address: `0x${string}`\n currency: 'usdc' | 'usdt' | 'usdb' | 'dai'\n payment_rail: 'ethereum' | 'arbitrum' | 'base' | 'polygon' | 'solana'\n}\n\nexport enum BridgeVirtualBankAccountStatus {\n ACTIVATED = 'activated',\n DEACTIVATED = 'deactivated',\n}\n\nexport interface BridgeVirtualBankAccount {\n id: BridgeVirtualAcountId\n destination: BridgeDestination\n developer_fee_percent: `${number}`\n source_deposit_instructions: {\n payment_rails: string[]\n currency: string\n bank_name: string\n bank_address: string\n bank_beneficiary_name?: string\n bank_beneficiary_address?: string\n // only us bank accounts have routing and account numbers\n bank_routing_number?: string\n bank_account_number?: string\n // https://wise.com/us/iban/ IBAN stands for International Bank Account Number.\n // It\u2019s an internationally-agreed code made up of up to 34 letters and numbers\n // that helps banks to process transfers around the world.\n account_holder_name?: string\n iban?: string\n bic?: string\n }\n status: BridgeVirtualBankAccountStatus\n}\n\nexport interface GetBridgeBankAccountRequest extends BaseApiRequest {\n subAccountId: BridgeCustomerId\n}\n\nexport interface GetBridgeBankAccountResponse {\n bankAccounts: BridgeVirtualBankAccount[]\n}\n\nexport const createBridgeBankAccountRequestChainNames = [\n 'arbitrum',\n 'base',\n 'ethereum',\n 'polygon',\n 'solana',\n] as const\n\nexport interface CreateBridgeBankAccountRequest extends BaseApiRequest {\n subAccountId: BridgeCustomerId\n sourceCurrency: 'usd' | 'eur'\n tokenName: 'usdb' | 'usdc' | 'usdt' | 'dai'\n chainName: (typeof createBridgeBankAccountRequestChainNames)[number]\n destinationAddress: Address\n}\n\nexport interface CreateBridgeBankAccountResponse {\n bankAccount: BridgeVirtualBankAccount\n}\n\nexport interface FindBridgeKycLinkRequest extends BaseApiRequest {\n guid: Guid\n}\n\nexport interface FindBridgeKycLinkResponse {\n kycLink: string\n}\n", "import Big from 'big.js'\nimport type { Address } from 'viem'\n\nimport { ErrorCode, ResourceNotFoundError } from '@funkit/utils'\nimport type {\n CheckoutApiQuoteResponse,\n CheckoutQuoteResponse,\n} from '@funkit/utils'\nimport { API_BASE_URL, type BaseApiRequest } from '../../consts'\nimport {\n generateRandomCheckoutSalt,\n roundToNearestBottomTenth,\n sendGetRequest,\n sendPostRequest,\n} from '../../utils'\nimport {\n type CheckoutApiInitParams,\n type CheckoutApiQuoteParams,\n type CheckoutDeactivateParams,\n type CheckoutHistoryItem,\n type CheckoutInitParams,\n type CheckoutInitResponse,\n type CheckoutInitTokenTransferAddressParams,\n type CheckoutInitTokenTransferResponse,\n type CheckoutQuoteParams,\n type CheckoutQuoteRequestV2,\n type CheckoutQuoteResponseV2,\n CheckoutState,\n type CheckoutTransferSponsorshipApiParams,\n type CheckoutTransferSponsorshipParams,\n type CheckoutTransferSponsorshipResponse,\n type RiskAssessmentParams,\n type RiskAssessmentResponse,\n} from './types'\n\nconst DEFAULT_EXPIRATION_TIMESTAMP_MS = 15 * 60 * 1000 // 15 minutes\n\n/**\n * Gets a checkout quote (estimation).\n * @param fromChainId The ID of the chain where funds will be provided from.\n * @param fromTokenAddress The asset to fund the checkout. This must be either a chain native token or an ERC-20, on the fromChainId.\n * @param fromTokenDecimals The number of decimals for the fromTokenAddress.\n * @param toChainId The ID of the chain where the checkout operation is to be performed.\n * @param toTokenAddress The wanted asset for the checkout operation. This must be either a chain native token or an ERC-20, on the target chain.\n * @param toTokenAmount The amount of wanted asset for the checkout operation in base units.\n * @param toTokenDecimals The number of decimals for the toTokenAddress.\n * @param apiKey A valid fun api key.\n * @param signal AbortSignal to cancel the request when no longer needed\n * @return {Promise<CheckoutCoreQuoteResponse>} The formatted quote object\n */\nexport async function getCheckoutQuote({\n fromChainId,\n fromTokenAddress,\n fromTokenDecimals,\n toChainId,\n toTokenAddress,\n toTokenDecimals,\n toTokenAmount,\n sponsorInitialTransferGasLimit,\n recipientAddr,\n userId,\n ...options\n}: CheckoutQuoteParams): Promise<CheckoutQuoteResponse> {\n try {\n const toMultipler = 10 ** toTokenDecimals\n const toAmountBaseUnitBI = BigInt(Math.floor(toTokenAmount * toMultipler))\n const queryParams: CheckoutApiQuoteParams = {\n userId,\n fromChainId,\n fromTokenAddress,\n toChainId,\n toTokenAddress,\n toAmountBaseUnit: toAmountBaseUnitBI.toString(),\n // Only pass in recipientAddr if specified\n ...(recipientAddr ? { recipientAddr } : {}),\n // Rounding nearest tenth second (instead of seconds) to better support backend quote caching feature\n // Reference: https://vintage-heaven-3cd.notion.site/API-Gateway-Caching-and-Pre-Warming-System-Draft-ee7909d9b85f43c793ce7bd2607bec02?pvs=4\n // Note: Rounding *down* instead of a regular round to safeguard against edge case of timing passing frontend range validation but failing backend range validation\n checkoutExpirationTimestampSeconds: roundToNearestBottomTenth(\n Math.round((Date.now() + DEFAULT_EXPIRATION_TIMESTAMP_MS) / 1000),\n ).toString(),\n sponsorInitialTransferGasLimit,\n }\n\n const searchParams = new URLSearchParams(queryParams)\n const quoteRes = (await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/quote?${searchParams}`,\n ...options,\n })) as CheckoutApiQuoteResponse\n\n const fromMultipler = 10 ** fromTokenDecimals\n // Format the response for frontend usage\n return {\n quoteId: quoteRes.quoteId,\n fromTokenAddress: quoteRes.fromTokenAddress,\n estFeesUsd: quoteRes.estFeesUsd,\n estSubtotalUsd: quoteRes.estSubtotalUsd,\n estTotalUsd: quoteRes.estTotalUsd,\n estCheckoutTimeMs: quoteRes.estCheckoutTimeMs,\n estTotalFromAmountBaseUnit: quoteRes.estTotalFromAmountBaseUnit,\n estSubtotalFromAmountBaseUnit: quoteRes.estSubtotalFromAmountBaseUnit,\n estFeesFromAmountBaseUnit: quoteRes.estFeesFromAmountBaseUnit,\n estMarketMakerGasUsd: quoteRes.estMarketMakerGasUsd,\n lpFeePercentage: quoteRes.lpFeePercentage,\n lpFeeUsd: quoteRes.lpFeeUsd,\n // Added fields\n estFeesFromAmount: new Big(quoteRes.estFeesFromAmountBaseUnit)\n .div(fromMultipler)\n .toString(),\n estSubtotalFromAmount: new Big(quoteRes.estSubtotalFromAmountBaseUnit)\n .div(fromMultipler)\n .toString(),\n estTotalFromAmount: new Big(quoteRes.estTotalFromAmountBaseUnit)\n .div(fromMultipler)\n .toString(),\n }\n } catch (err: unknown) {\n throw new Error(\n `An error occurred trying to generate a checkout quote: ${\n err instanceof Error ? err.message : JSON.stringify(err)\n }`,\n )\n }\n}\n\n/**\n * Gets a checkout quote (estimation).\n */\nexport async function getCheckoutQuoteV2({\n actionParams,\n fromAmountBaseUnit,\n fromChainId,\n fromTokenAddress,\n recipientAddress,\n toAmountBaseUnit,\n toChainId,\n toTokenAddress,\n userAddress,\n usePermit,\n ...options\n}: BaseApiRequest & CheckoutQuoteRequestV2): Promise<CheckoutQuoteResponse> {\n try {\n return await sendPostRequest<CheckoutQuoteResponseV2>({\n uri: `${API_BASE_URL}/checkout/quoteV2`,\n body: {\n actionParams,\n fromAmountBaseUnit,\n fromChainId,\n fromTokenAddress,\n recipientAddress,\n toAmountBaseUnit,\n toChainId,\n toTokenAddress,\n userAddress,\n usePermit,\n },\n ...options,\n })\n } catch (err: unknown) {\n throw new Error(\n `An error occurred trying to generate a checkout quote: ${\n err instanceof Error ? err.message : JSON.stringify(err)\n }`,\n )\n }\n}\n\n/**\n * Initializes a checkout\n * @param userOp The checkout UserOp, signed.\n * @param quoteId The quoteId specific to the checkout.\n * @param apiKey A valid fun api key.\n * @return {Address} The generated deposit address\n */\nexport async function initializeCheckout({\n userOp,\n quoteId,\n sourceOfFund,\n clientMetadata,\n ...options\n}: CheckoutInitParams): Promise<CheckoutInitResponse> {\n const body = {\n ...(userOp ? { userOp } : {}),\n quoteId,\n sourceOfFund,\n salt: generateRandomCheckoutSalt(),\n clientMetadata,\n } as CheckoutApiInitParams\n const res: { depositAddr?: Address } = await sendPostRequest({\n uri: `${API_BASE_URL}/checkout`,\n body,\n ...options,\n })\n if (!res?.depositAddr) {\n throw new ResourceNotFoundError(\n ErrorCode.CheckoutInitDepositAddrNotFound,\n 'Unable to initialize checkout',\n 'Unable to initialize checkout',\n body,\n '',\n 'https://docs.fun.xyz',\n )\n }\n return { depositAddr: res.depositAddr }\n}\n\nexport async function deactivateCheckout({\n depositAddress,\n ...options\n}: CheckoutDeactivateParams) {\n try {\n await sendPostRequest({\n uri: `${API_BASE_URL}/checkout/update/${depositAddress}`,\n body: {\n // Fixed state to cancel the checkout\n state: CheckoutState.CANCELLED,\n },\n ...options,\n })\n return true\n } catch (_err) {\n throw new Error('Unable to deactivate checkout')\n }\n}\n\n/**\n * Gets a checkout given a depositAddress\n * @param depositAddress A unique deposit address associated with a backend checkout item.\n * @param apiKey A valid fun api key.\n * @param signal AbortSignal to cancel the request when no longer needed\n * @returns The checkout object if exists. Otherwise, null.\n */\nexport async function getCheckoutByDepositAddress({\n depositAddress,\n ...options\n}: BaseApiRequest & {\n depositAddress: Address\n}): Promise<CheckoutHistoryItem | null> {\n try {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/${depositAddress}`,\n ...options,\n })\n } catch (err) {\n if (err instanceof ResourceNotFoundError) {\n return null\n }\n throw err\n }\n}\n\n/**\n * Gets all checkouts associated with a funWallet\n * @param funWalletAddress A funWallet address.\n * @param apiKey A valid fun api key.\n * @param signal AbortSignal to cancel the request when no longer needed\n * @returns A list of checkout objects if exists. Otherwise, an empty array.\n */\nexport async function getCheckoutsByFunWalletAddress({\n funWalletAddress,\n ...options\n}: BaseApiRequest & { funWalletAddress: Address }): Promise<\n CheckoutHistoryItem[]\n> {\n const res: CheckoutHistoryItem[] = await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/fun-wallet/${funWalletAddress}`,\n ...options,\n })\n return res || []\n}\n\n/**\n * Gets all checkouts associated with a recipient address\n * @param recipientAddress A wallet address.\n * @param apiKey A valid fun api key.\n * @param signal AbortSignal to cancel the request when no longer needed\n * @returns A list of checkout objects if exists. Otherwise, an empty array.\n */\nexport async function getCheckoutsByRecipientAddress({\n recipientAddress,\n ...options\n}: BaseApiRequest & { recipientAddress: Address }): Promise<\n CheckoutHistoryItem[]\n> {\n const res = await sendGetRequest<CheckoutHistoryItem[] | null>({\n uri: `${API_BASE_URL}/checkout/recipient/${recipientAddress}`,\n ...options,\n })\n return res || []\n}\n\nexport interface GetCheckoutsByUserIdParams extends BaseApiRequest {\n userId: string\n limit?: number\n}\n\n/**\n * Gets all checkouts associated with a funkit userId string\n * @param userId A userId string.\n * @param apiKey A valid fun api key.\n * @param signal AbortSignal to cancel the request when no longer needed\n * @returns A list of checkout objects if exists. Otherwise, an empty array.\n */\nexport async function getCheckoutsByUserId({\n userId,\n limit,\n ...options\n}: GetCheckoutsByUserIdParams): Promise<CheckoutHistoryItem[]> {\n const query = limit\n ? new URLSearchParams({\n limit: limit.toString(),\n })\n : ''\n const res = await sendGetRequest<CheckoutHistoryItem[] | null>({\n uri: `${API_BASE_URL}/checkout/userId/${userId}?${query}`,\n ...options,\n })\n return res || []\n}\n\nexport async function getPaymasterDataForCheckoutSponsoredTransfer({\n depositAddress,\n transferUserOp,\n ...options\n}: CheckoutTransferSponsorshipParams): Promise<CheckoutTransferSponsorshipResponse> {\n const body = {\n depositAddress,\n userOp: transferUserOp,\n } as CheckoutTransferSponsorshipApiParams\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/checkout/sponsor-transfer`,\n body,\n ...options,\n })\n if (!res) {\n // TODO: Better error handling\n throw new Error('Unable to get sponsorship information')\n }\n return res as CheckoutTransferSponsorshipResponse\n}\n\nexport async function getRiskAssessmentForAddress({\n address,\n ...options\n}: RiskAssessmentParams) {\n const response = (await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/risk-assessment?address=${address}`,\n ...options,\n // Protect us against chainalysis ratelimiting\n retryOptions: { maxAttempts: 2 },\n })) as RiskAssessmentResponse\n\n return response\n}\n\nexport async function initializeCheckoutTokenTransferAddress({\n apiKey,\n logger,\n signal,\n ...body\n}: CheckoutInitTokenTransferAddressParams): Promise<CheckoutInitTokenTransferResponse> {\n const res = await sendPostRequest<CheckoutInitTokenTransferResponse | null>({\n uri: `${API_BASE_URL}/eoa`,\n body,\n apiKey,\n logger,\n signal,\n })\n if (!res?.depositAddr) {\n throw new ResourceNotFoundError(\n ErrorCode.CheckoutInitDepositAddrNotFound,\n 'Unable to initialize checkout token transfer address',\n 'Unable to initialize checkout token transfer address',\n body,\n '',\n 'https://docs.fun.xyz',\n )\n }\n return {\n depositAddr: res.depositAddr,\n solanaAddr: res.solanaAddr,\n btcAddrSegwit: res.btcAddrSegwit,\n btcAddrTaproot: res.btcAddrTaproot,\n btcDepositAddr: res.btcDepositAddr,\n }\n}\n", "import type { Address, Hex } from 'viem'\n\nimport type {\n ApiCheckoutClientMetadata,\n ApiFunkitCheckoutActionParams,\n CheckoutQuoteResponse,\n} from '@funkit/utils'\nimport type { BaseApiRequest } from '../../consts'\nimport type { UserOperation } from '../fw-operation'\n\n// The params required for the actual /checkout/quote api\nexport type CheckoutApiQuoteParams = {\n fromChainId: string\n fromTokenAddress: Address\n toChainId: string\n toTokenAddress: Address\n toAmountBaseUnit: string\n /** @deprecated */\n checkoutExpirationTimestampSeconds: string\n sponsorInitialTransferGasLimit: string\n userId: string\n recipientAddr?: Address\n}\n\nexport type CheckoutQuoteParams = BaseApiRequest &\n Omit<\n CheckoutApiQuoteParams,\n 'toAmountBaseUnit' | 'checkoutExpirationTimestampSeconds'\n > & {\n fromTokenDecimals: number\n toTokenDecimals: number\n toTokenAmount: number\n /** @deprecated */\n expirationTimestampMs?: number\n }\n\nexport type CheckoutQuoteRequestV2 = {\n actionParams?: ApiFunkitCheckoutActionParams[]\n fromChainId: string\n fromTokenAddress: Address\n recipientAddress?: Address\n toChainId: string\n toTokenAddress: Address\n userAddress: Address\n usePermit?: boolean\n} & (\n | {\n fromAmountBaseUnit: bigint\n toAmountBaseUnit?: never\n }\n | {\n fromAmountBaseUnit?: never\n toAmountBaseUnit: bigint\n }\n)\n\nexport interface FeeBreakdownV2 {\n gasUsd: number\n fillCostUsd: number\n fillCostPercent: number\n totalImpactUsd: number\n totalImpact: number\n swapImpact: number\n swapImpactUsd: number\n appFeePercent: number\n appFeeUsd: number\n maxSlippage: number\n minReceived: number\n exchangeRate?: number // only available for swapping\n appFeeLabel?: string\n}\n\nexport type CheckoutQuoteResponseV2 = CheckoutQuoteResponse & {\n metadata: {\n feeBreakdown: FeeBreakdownV2\n }\n}\n\n/**===============*\n * CHECKOUT INIT *\n *================*/\n\nexport type CheckoutApiInitParams = {\n userOp?: UserOperation\n quoteId: string\n sourceOfFund: string\n salt: Hex\n // TODO: Proper typing wrt _generateClientMetadata() logic\n clientMetadata: object\n}\n\nexport type CheckoutInitParams = BaseApiRequest &\n Omit<CheckoutApiInitParams, 'salt'>\n\nexport type CheckoutInitResponse = {\n depositAddr: Address\n}\n\nexport type CheckoutInitTokenTransferResponse = CheckoutInitResponse & {\n solanaAddr: SolanaAddress\n btcAddrSegwit: BitcoinAddress\n btcAddrTaproot: BitcoinAddress\n btcDepositAddr: BitcoinAddress\n}\n\n/**=====================*\n * CHECKOUT DEACTIVATE *\n *======================*/\n\nexport type CheckoutDeactivateParams = BaseApiRequest & {\n depositAddress: Address\n}\n\n// Reference from api server: https://github.com/fun-xyz/fun-api-server/blob/main/src/tables/FunWalletCheckout.ts#L11C1-L21C2\nexport enum CheckoutState {\n // In-progress States\n FROM_UNFUNDED = 'FROM_UNFUNDED',\n FROM_FUNDED = 'FROM_FUNDED',\n FROM_POOLED = 'FROM_POOLED',\n TO_UNFUNDED = 'TO_UNFUNDED',\n TO_FUNDED = 'TO_FUNDED',\n TO_POOLED = 'TO_POOLED',\n TO_READY = 'TO_READY',\n PENDING_RECEIVAL = 'PENDING_RECEIVAL',\n // Terminal States\n COMPLETED = 'COMPLETED',\n CHECKOUT_ERROR = 'CHECKOUT_ERROR',\n EXPIRED = 'EXPIRED',\n CANCELLED = 'CANCELLED',\n}\n\n// Checkout state categorizations\nexport const FROM_PROGRESS_CHECKOUT_STATES = [\n CheckoutState.FROM_UNFUNDED,\n CheckoutState.FROM_FUNDED,\n CheckoutState.FROM_POOLED,\n]\n\nexport const TO_PROGRESS_CHECKOUT_STATES = [\n CheckoutState.TO_UNFUNDED,\n CheckoutState.TO_FUNDED,\n CheckoutState.TO_POOLED,\n CheckoutState.TO_READY,\n CheckoutState.PENDING_RECEIVAL,\n]\n\nexport const IN_PROGRESS_CHECKOUT_STATES = [\n ...TO_PROGRESS_CHECKOUT_STATES,\n ...FROM_PROGRESS_CHECKOUT_STATES,\n]\n\nexport const TERMINAL_CHECKOUT_STATES = [\n CheckoutState.EXPIRED,\n CheckoutState.CHECKOUT_ERROR,\n CheckoutState.COMPLETED,\n CheckoutState.CANCELLED,\n]\n\nexport enum CheckoutRefundState {\n INITIATED = 'INITIATED',\n ERROR = 'ERROR',\n REFUNDED = 'REFUNDED',\n PROCEEDED = 'PROCEEDED',\n WAITING_FOR_FULFILLMENT = 'WAITING_FOR_FULFILLMENT',\n FULFILLED = 'FULFILLED',\n}\n\nexport type CheckoutHistoryItem = {\n createdTimeMs: number\n depositAddr: Address\n currentDepositAddr: Address\n recipientAddr: Address\n expirationTimestampSeconds: number\n fromAmountBaseUnit: string\n fromChainId: string\n fromTokenAddress: Address\n funWalletAddr: Address\n lastUpdatedTimeMs: number\n salt: Hex\n state: CheckoutState\n toAmountBaseUnit: string\n toChainId: string\n toTokenAddress: Address\n userOp?: UserOperation\n version: number\n sourceOfFund: string\n clientMetadata: ApiCheckoutClientMetadata\n refundState?: CheckoutRefundState\n // Note: Optional, because BE does not retroactively update existing CheckoutHistoryItem entries\n stateTimestampMs?: Partial<Record<CheckoutState, number>>\n}\n\n/**===============================*\n * CHECKOUT TRANSFER SPONSORSHIP *\n *================================*/\n\nexport type CheckoutTransferSponsorshipParams = BaseApiRequest & {\n transferUserOp: UserOperation\n depositAddress: Address\n}\n\nexport type CheckoutTransferSponsorshipApiParams = {\n userOp: UserOperation\n depositAddress: Address\n}\n\nexport type CheckoutTransferSponsorshipResponse = {\n signerAddress: Address\n signature: Hex\n deadline: number\n paymasterAndData: Hex\n}\n\n/**===============================*\n * RISK ASSESSMENT *\n *================================*/\n\nexport type RiskAssessmentParams = BaseApiRequest & {\n address: FunAddress\n}\n\ntype AddressIdentification = {\n name: string\n address: FunAddress\n category: string\n description: string\n url: string | null\n createdAt: number\n}\n\ntype Cluster = {\n name: string\n category: string\n}\n\nexport type RiskValues = 'Severe' | 'High' | 'Medium' | 'Low'\n\ntype ExposureType = 'direct' | 'indirect'\n\ntype Exposure = {\n category: string\n value: number\n exposureType: ExposureType\n direction: string\n}\n\ntype RiskTrigger = {\n risk: string\n minThreshold: number\n maxThreshold: number\n exposureType: string\n direction: string\n}\n\ntype Trigger = {\n category: string\n percentage: number\n message: string\n ruleTriggered?: RiskTrigger\n}\n\ntype PoolMetadata = {\n fees?: number\n tokens: string[]\n}\n\ntype Base58 =\n | '1'\n | '2'\n | '3'\n | '4'\n | '5'\n | '6'\n | '7'\n | '8'\n | '9'\n | 'A'\n | 'B'\n | 'C'\n | 'D'\n | 'E'\n | 'F'\n | 'G'\n | 'H'\n | 'J'\n | 'K'\n | 'L'\n | 'M'\n | 'N'\n | 'P'\n | 'Q'\n | 'R'\n | 'S'\n | 'T'\n | 'U'\n | 'V'\n | 'W'\n | 'X'\n | 'Y'\n | 'Z'\n | 'a'\n | 'b'\n | 'c'\n | 'd'\n | 'e'\n | 'f'\n | 'g'\n | 'h'\n | 'i'\n | 'j'\n | 'k'\n | 'm'\n | 'n'\n | 'o'\n | 'p'\n | 'q'\n | 'r'\n | 's'\n | 't'\n | 'u'\n | 'v'\n | 'w'\n | 'x'\n | 'y'\n | 'z'\nexport type SolanaAddress = `${Base58}${string}`\nexport type BitcoinAddress =\n | `1${string}`\n | `3${string}`\n | `bc1${string}`\n | `bc1p${string}`\nexport type FunAddress = Address | SolanaAddress | BitcoinAddress\n\nexport type RiskAssessmentResponse = {\n address: FunAddress\n risk: RiskValues\n riskReason: string | null\n cluster?: Cluster\n addressType: string\n addressIdentifications: AddressIdentification[]\n exposures: Exposure[]\n triggers: Trigger[]\n status: string\n poolMetadata: PoolMetadata\n}\n\nexport type CheckoutInitTokenTransferAddressParams = BaseApiRequest & {\n toChainId: string\n toTokenAddress: Address\n userId: string\n clientMetadata: NonNullable<object>\n sourceOfFund?: string\n recipientAddr: string\n actionType?: string\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n DirectExecution,\n GetDirectExecutionByTxHashRequest,\n GetDirectExecutionsByUserIdRequest,\n PostDirectExecutionRequest,\n} from './types'\n\nexport async function getDirectExecutionByTxHash({\n txHash,\n apiKey,\n logger,\n signal,\n}: GetDirectExecutionByTxHashRequest): Promise<DirectExecution> {\n return sendGetRequest<DirectExecution>({\n uri: `${API_BASE_URL}/direct-execution/${txHash}`,\n apiKey,\n logger,\n signal,\n })\n}\n\nexport async function getDirectExecutionsByUserId({\n userId,\n apiKey,\n logger,\n limit,\n signal,\n}: GetDirectExecutionsByUserIdRequest): Promise<DirectExecution[]> {\n const query = limit\n ? new URLSearchParams({\n limit: limit.toString(),\n })\n : ''\n return sendGetRequest<DirectExecution[]>({\n uri: `${API_BASE_URL}/direct-execution/userId/${userId}?${query}`,\n apiKey,\n logger,\n signal,\n })\n}\n\nexport async function createDirectExecution({\n txHash,\n userId,\n recipientAddr,\n fromChainId,\n fromTokenAddress,\n toChainId,\n toTokenAddress,\n fromAmountBaseUnit,\n toAmountBaseUnit,\n estTotalUsd,\n sourceOfFund,\n clientMetadata,\n apiKey,\n logger,\n signal,\n type,\n}: PostDirectExecutionRequest): Promise<{ txHash: DirectExecution['txHash'] }> {\n const body = {\n txHash,\n sourceOfFund,\n userId,\n recipientAddr,\n fromChainId,\n fromTokenAddress,\n toChainId,\n toTokenAddress,\n fromAmountBaseUnit,\n toAmountBaseUnit,\n estTotalUsd,\n clientMetadata,\n type,\n }\n\n return sendPostRequest<{ txHash: DirectExecution['txHash'] }>({\n uri: `${API_BASE_URL}/direct-execution`,\n body,\n apiKey,\n logger,\n signal,\n })\n}\n", "import type { ApiCheckoutClientMetadata } from '@funkit/utils'\nimport type { Address, Hex } from 'viem'\nimport type { BaseApiRequest } from '../../consts'\n\nexport interface GetDirectExecutionByTxHashRequest extends BaseApiRequest {\n txHash: Hex\n}\n\nexport interface GetDirectExecutionsByUserIdRequest extends BaseApiRequest {\n userId: string\n limit?: number\n}\n\n// Reference: https://github.com/fun-xyz/fun-backend/blob/main/packages/types/src/system/direct-execution.ts#L1\nexport enum DirectExecutionType {\n TEST_EXECUTION = 'TEST_EXECUTION', // For UT purposes only, should never show up in prod table\n /** @deprecated All vertex direct exec flows will go to Relay now */\n VERTEX_DEPOSIT_COLLATERAL_WITH_REFERRAL = 'VERTEX_DEPOSIT_COLLATERAL_WITH_REFERRAL', // Vertex deposit collateral with referral\n RELAY = 'RELAY', // Relay checkout UI execution\n}\n\n// Reference: https://github.com/reservoirprotocol/relay-kit/blob/211c645f9702a3b459ff545aa4e2e9d536c38455/packages/sdk/src/types/Execute.ts#L54-L61\nexport enum RelayExecutionStatus {\n DELAYED = 'delayed',\n FAILURE = 'failure',\n PENDING = 'pending',\n REFUND = 'refund',\n SUCCESS = 'success',\n WAITING = 'waiting',\n UNKNOWN = 'unknown',\n}\n\nexport interface RelayExecutionRequestFeeData {\n fees: Fee\n feesUsd: Fee\n metadata: RelayExecutionRequestMetadata\n appFees?: RelayExecutionRequestFeeDataAppFees[]\n}\n\nexport interface RelayExecutionRequestFeeDataAppFees {\n recipient?: Address\n amount?: string\n amountUsd?: string\n}\n\nexport interface RelayExecutionRequestMetadata {\n currencyIn: RelayExecutionRequestMetadataCurrency\n currencyOut: RelayExecutionRequestMetadataCurrency\n rate: string\n recipient: Address\n sender: Address\n}\n\nexport interface RelayExecutionRequestMetadataCurrency {\n amount: string\n amountFormatted: string\n amountUsd: string\n amountUsdCurrent: string\n currency: {\n address: Address\n chainId: number\n decimals: number\n metadata: {\n logoURI: string\n verified: boolean\n }\n name: string\n symbol: string\n }\n minimumAmount: string\n}\n\nexport interface Fee {\n gas: bigint\n fixed: bigint\n price: bigint\n}\n\n// Reference: https://github.com/fun-xyz/fun-backend/blob/main/packages/types/src/system/tables/DirectExecution.ts#L7\nexport interface DirectExecution {\n txHash: Hex\n customerId: string\n userId: string\n recipientAddr: Address\n type: DirectExecutionType\n\n fromChainId: string\n fromTokenAddress: Address\n toChainId: string\n toTokenAddress: Address\n\n fromAmountBaseUnit: string\n toAmountBaseUnit: string\n estTotalUsd: number\n\n clientMetadata: ApiCheckoutClientMetadata\n isIntermediaryPhase?: boolean\n sourceOfFund: string\n toTxId?: string\n triggeringTxHash?: string\n\n createdTimeMs: number\n updatedTimeMs?: number\n\n listenerInfo?: {\n destinationChainId: number\n inTxHashes: string[]\n originChainId: number\n status: RelayExecutionStatus\n time: number\n txHashes: string[]\n\n relayExecutionRequestDetails?: {\n id: Hex\n status: RelayExecutionStatus\n createdAt: Date\n updatedAt: Date\n data: RelayExecutionRequestFeeData\n }\n }\n}\n\nexport interface PostDirectExecutionRequest\n extends BaseApiRequest,\n Omit<DirectExecution, 'customerId' | 'createdTimeMs'> {}\n", "import { FUN_FAUCET_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport type { GetAssetFromFaucetRequest } from './types'\n\nexport async function getAssetFromFaucet({\n token,\n chain,\n walletAddress,\n ...options\n}: GetAssetFromFaucetRequest) {\n return await sendGetRequest({\n uri: `${FUN_FAUCET_URL}/get-faucet?token=${token}&testnet=${chain}&addr=${walletAddress}`,\n ...options,\n })\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n CheckWalletAccessInitializationRequest,\n InitializeWalletAccessRequest,\n} from './types'\n\nexport async function initializeWalletAccess({\n walletAddr,\n creatorAddr,\n ...options\n}: InitializeWalletAccessRequest): Promise<void> {\n await sendPostRequest({\n uri: `${API_BASE_URL}/access/wallet`,\n body: { walletAddr, creatorAddr },\n ...options,\n })\n}\n\nexport async function checkWalletAccessInitialization({\n walletAddr,\n ...options\n}: CheckWalletAccessInitializationRequest): Promise<boolean> {\n return (\n await sendGetRequest<{ initialized: boolean }>({\n uri: `${API_BASE_URL}/access/wallet/${walletAddr}`,\n ...options,\n })\n ).initialized\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendPostRequest } from '../../utils'\nimport type { GetGroupsRequest, GroupMetadata } from './types'\n\nexport async function getGroups({\n groupIds,\n chainId,\n ...options\n}: GetGroupsRequest): Promise<GroupMetadata[]> {\n return (\n await sendPostRequest<{ groups: GroupMetadata[] }>({\n uri: `${API_BASE_URL}/group/get-groups`,\n body: { groupIds, chainId },\n ...options,\n })\n ).groups\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport type {\n GetChainFromIdRequest,\n GetChainFromNameRequest,\n ServerChainInfo,\n} from './types'\n\nexport async function getChainFromId({\n chainId,\n ...options\n}: GetChainFromIdRequest): Promise<ServerChainInfo> {\n const res = await sendGetRequest<ServerChainInfo>({\n uri: `${API_BASE_URL}/chain-info/${chainId}`,\n ...options,\n })\n if (!res) {\n throw new Error(JSON.stringify(res))\n }\n return res\n}\n\nexport async function getChainFromName({\n name,\n ...options\n}: GetChainFromNameRequest): Promise<ServerChainInfo> {\n const res = await sendGetRequest<ServerChainInfo>({\n uri: `${API_BASE_URL}/chain-info?name=${name}`,\n ...options,\n })\n if (!res) {\n throw new Error(JSON.stringify(res))\n }\n return res\n}\n", "import type { Address } from 'viem'\nimport { API_BASE_URL } from '../../consts'\nimport { sendDeleteRequest, sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n CreateOpRequest,\n DeleteOpRequest,\n EstimateOpInput,\n EstimatedGas,\n ExecuteOpInput,\n ExecutionReceipt,\n GetFullReceiptRequest,\n GetOpsOfWalletRequest,\n GetOpsRequest,\n GetUserOpGasPriceRequest,\n OpRequest,\n OperationData,\n ScheduleOpInput,\n SignOpRequest,\n UserOperationGasPrice,\n} from './types'\n\nexport async function createOp({\n op,\n ...options\n}: CreateOpRequest): Promise<string> {\n return (\n await sendPostRequest<{ opId: string }>({\n uri: `${API_BASE_URL}/operation`,\n body: { ...op },\n ...options,\n })\n ).opId\n}\n\ninterface OpsOfWalletResponse {\n operations: OperationData[]\n}\n\nexport async function getOpsOfWallet({\n walletAddr,\n chainId,\n status,\n ...options\n}: GetOpsOfWalletRequest): Promise<OperationData[]> {\n const endpoint = status\n ? `${API_BASE_URL}/operation/wallet/${walletAddr}/chain/${chainId}?status=${status}`\n : `${API_BASE_URL}/operation/wallet/${walletAddr}/chain/${chainId}`\n return (\n await sendGetRequest<OpsOfWalletResponse>({ uri: endpoint, ...options })\n ).operations\n}\n\nexport async function getOps({\n opIds,\n chainId,\n ...options\n}: GetOpsRequest): Promise<OperationData[]> {\n return (\n await sendPostRequest<OpsOfWalletResponse>({\n uri: `${API_BASE_URL}/operation/get-operations`,\n body: {\n opIds,\n chainId,\n },\n ...options,\n })\n ).operations\n}\n\nexport async function deleteOp({\n opId,\n chainId,\n ...options\n}: DeleteOpRequest): Promise<void> {\n await sendDeleteRequest({\n uri: `${API_BASE_URL}/operation/${opId}/chain/${chainId}`,\n ...options,\n })\n}\n\nexport async function signOp({\n opId,\n chainId,\n signature,\n signedBy,\n threshold,\n ...options\n}: SignOpRequest): Promise<void> {\n await sendPostRequest({\n uri: `${API_BASE_URL}/operation/sign`,\n body: {\n opId,\n chainId,\n signature,\n signedBy,\n threshold,\n },\n ...options,\n })\n}\n\nexport async function executeOp({\n input,\n ...options\n}: OpRequest<ExecuteOpInput>): Promise<ExecutionReceipt> {\n return await sendPostRequest({\n uri: `${API_BASE_URL}/operation/execute`,\n body: input,\n ...options,\n })\n}\n\nexport async function estimateOp({\n input,\n ...options\n}: OpRequest<EstimateOpInput>): Promise<EstimatedGas> {\n return await sendPostRequest({\n uri: `${API_BASE_URL}/operation/estimate`,\n body: input,\n ...options,\n })\n}\n\nexport async function scheduleOp({\n input,\n ...options\n}: OpRequest<ScheduleOpInput>): Promise<void> {\n await sendPostRequest({\n uri: `${API_BASE_URL}/operation/schedule`,\n body: input,\n ...options,\n })\n}\n\nexport const getFullReceipt = async ({\n opId,\n chainId,\n userOpHash,\n ...options\n}: GetFullReceiptRequest): Promise<ExecutionReceipt> => {\n const retries = 20\n let result: { status: string; receipt?: ExecutionReceipt } = {\n status: 'pending',\n }\n for (let i = 0; i < retries; i++) {\n try {\n result = await sendGetRequest({\n uri: `${API_BASE_URL}/operation/${opId}/chain/${chainId}/receipt?userOpHash=${userOpHash}`,\n ...options,\n })\n if (result.status === 'included') {\n break\n }\n } catch (_err) {\n /* empty */\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2500))\n }\n if (!result.receipt) {\n result.receipt = {\n // TODO: this is obviously wrong but it was what we had before\n txId: 'Failed to find.' as Address,\n gasUsed: 'Failed to find.',\n opFeeUSD: 'Failed to find.',\n opFee: 'Failed to find.',\n userOpHash: 'Failed to find.',\n }\n }\n return {\n ...result.receipt,\n }\n}\n\nexport const getUserOpGasPrice = async ({\n chainId,\n ...options\n}: GetUserOpGasPriceRequest): Promise<UserOperationGasPrice> => {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/operation/chain/${chainId}/gas-price`,\n ...options,\n })\n}\n", "import type { Address, Hex } from 'viem'\n\nimport type { BaseApiRequest } from '../../consts'\n\nexport enum OperationStatus {\n ALL = '',\n PENDING_APPROVED = 'PENDING_APPROVED',\n APPROVED = 'APPROVED',\n PENDING = 'PENDING',\n OP_SUCCEED = 'OP_SUCCEED',\n OP_REVERTED = 'OP_REVERTED',\n SCHEDULED = 'SCHEDULED',\n}\n\nexport type OperationMetadata = {\n opId?: Hex\n chainId: string\n opType: OperationType\n authType: AuthType\n groupId?: Hex\n message?: string\n walletAddr: Address\n status?: OperationStatus\n proposer: string // do not use address in case we later use non-address data as the proposer\n proposedTime?: number\n executedBy?: string\n executedTime?: number\n relatedOpIds?: Hex[]\n signatures?: Signature[]\n txid?: string\n gasUsed?: string\n opFeeUSD?: string\n opFee?: string\n executedBlockNumber?: number\n executedBlockTimeStamp?: number\n}\n\nexport interface OperationData extends OperationMetadata {\n userOp: UserOperation\n}\n\nexport enum AuthType {\n ECDSA = 0,\n MULTI_SIG = 1,\n}\n\nexport type Signature = {\n userId: Hex\n signature: Hex\n signedTime: number\n}\n\nexport enum OperationType {\n SINGLE_OPERATION = 'SINGLE_OPERATION',\n GROUP_OPERATION = 'GROUP_OPERATION',\n REJECTION = 'REJECTION',\n}\n\nexport type GroupInfo = {\n threshold: number\n memberIds: Hex[]\n}\n\nexport type UserOperation = {\n sender: string\n nonce: bigint\n initCode?: string\n callData: string\n callGasLimit: bigint\n verificationGasLimit: bigint\n preVerificationGas?: bigint\n maxFeePerGas: bigint\n maxPriorityFeePerGas: bigint\n paymasterAndData?: string\n signature?: string\n}\n\nexport interface ExecutionReceipt {\n userOpHash: string\n txId?: Hex\n gasUsed?: string\n opFeeUSD?: string\n opFee?: string\n}\n\nexport type EstimatedGas = {\n preVerificationGas: bigint\n callGasLimit: bigint\n verificationGasLimit: bigint\n}\n\nexport interface CreateOpRequest extends BaseApiRequest {\n op: OperationData\n}\n\nexport interface GetOpsOfWalletRequest extends BaseApiRequest {\n walletAddr: Address\n chainId: string\n status?: OperationStatus\n}\n\nexport interface GetOpsRequest extends BaseApiRequest {\n opIds: Hex[]\n chainId: string\n}\n\nexport interface DeleteOpRequest extends BaseApiRequest {\n opId: Hex\n chainId: string\n}\n\nexport interface SignOpRequest extends BaseApiRequest {\n opId: Hex\n chainId: string\n signature: Hex\n signedBy: Address\n threshold?: number\n}\n\nexport type OpRequest<T> = BaseApiRequest & {\n input: T\n}\n\nexport type ExecuteOpInput = {\n opId: Hex\n chainId: string\n executedBy: string\n entryPointAddress: Address\n signature: Hex\n userOp?: UserOperation\n groupInfo?: GroupInfo\n}\n\nexport type EstimateOpInput = {\n opId?: Hex\n chainId: string\n entryPointAddress?: Address\n signature?: Hex\n userOp?: UserOperation\n}\n\nexport type ScheduleOpInput = {\n opId: Hex\n chainId: string\n scheduledBy: string\n entryPointAddress: Address\n signature: Hex\n userOp?: UserOperation\n groupInfo?: GroupInfo\n}\n\nexport interface GetFullReceiptRequest extends BaseApiRequest {\n opId: string\n chainId: string\n userOpHash: string\n}\n\nexport interface GetUserOpGasPriceRequest extends BaseApiRequest {\n chainId: string\n}\n\nexport type UserOperationGasPrice = {\n maxFeePerGas: bigint\n maxPriorityFeePerGas: bigint\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendPostRequest } from '../../utils'\nimport type { AddPaymasterTransactionRequest } from './types'\n\nexport async function addTransaction({\n chainId,\n timestamp,\n txid,\n transaction,\n paymasterType,\n sponsorAddress,\n ...options\n}: AddPaymasterTransactionRequest): Promise<unknown> {\n return await sendPostRequest({\n uri: `${API_BASE_URL}/dashboard/paymasters/add-transaction`,\n body: {\n chain: chainId,\n sponsorAddress,\n type: paymasterType,\n timestamp,\n transaction,\n txid,\n },\n ...options,\n }).catch(() => {\n /* empty */\n })\n}\n", "import type { BaseApiRequest } from '../../consts'\nimport type { ExecutionReceipt } from '../fw-operation'\n\nexport interface PaymasterTransaction {\n action: string\n amount: number\n from: string\n to: string\n token: string\n txid?: string\n}\n\nexport interface AddPaymasterTransactionRequest extends BaseApiRequest {\n chainId: string\n timestamp: number\n txid: ExecutionReceipt['txId'] | string\n transaction: PaymasterTransaction\n paymasterType: PaymasterType\n sponsorAddress: string\n}\n\nexport enum PaymasterType {\n BaseSponsor = 'base',\n GaslessSponsor = 'gasless',\n TokenSponsor = 'token',\n CheckoutSponsor = 'checkout',\n}\n", "import { ResourceNotFoundError } from '@funkit/utils'\nimport { type Hex, InvalidParameterError } from 'viem'\nimport { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n AddUserToWalletRequest,\n CreateUserRequest,\n GetUserUniqueIdRequest,\n GetUserWalletIdentitiesRequest,\n GetUserWalletsByAddrRequest,\n Wallet,\n} from './types'\n\nexport async function createUser({\n authId,\n addr,\n method,\n userUniqueId,\n ...options\n}: CreateUserRequest): Promise<void> {\n await sendPostRequest({\n uri: `${API_BASE_URL}/user`,\n body: {\n authId,\n addr,\n method,\n userUniqueId,\n },\n ...options,\n })\n}\n\nexport async function getUserUniqueId({\n authId,\n ...options\n}: GetUserUniqueIdRequest): Promise<string> {\n try {\n return (\n await sendGetRequest<{ userUniqueId: string }>({\n uri: `${API_BASE_URL}/user/auth/${authId}/unique-id`,\n ...options,\n })\n ).userUniqueId\n } catch (err) {\n if (err instanceof ResourceNotFoundError) {\n return ''\n }\n throw err\n }\n}\n\nexport async function getUserWalletsByAddr({\n addr,\n chainId,\n ...options\n}: GetUserWalletsByAddrRequest): Promise<Wallet[]> {\n const endpoint = chainId\n ? `${API_BASE_URL}/user/addr/${addr}/wallets?chainId=${chainId}`\n : `${API_BASE_URL}/user/addr/${addr}/wallets`\n return (\n await sendGetRequest<{ wallets: Wallet[] }>({ uri: endpoint, ...options })\n ).wallets\n}\n\nexport async function addUserToWallet({\n authId,\n chainId,\n walletAddr,\n userIds,\n walletUniqueId,\n ...options\n}: AddUserToWalletRequest): Promise<void> {\n try {\n await sendPostRequest({\n uri: `${API_BASE_URL}/user/auth/${authId}/chain/${chainId}/wallet`,\n body: { walletAddr, userIds, walletUniqueId },\n ...options,\n })\n } catch (err) {\n if (err instanceof InvalidParameterError) {\n // TODO: What about any other cause of InvalidParameterError???\n // swallow the error if the wallet already exists.\n return\n }\n\n throw err\n }\n}\n\n/**\n * @returns userIds of the specified Wallet.\n */\nexport async function getUserWalletIdentities({\n authId,\n chainId,\n walletAddr,\n ...options\n}: GetUserWalletIdentitiesRequest): Promise<Hex[]> {\n return (\n (\n await sendGetRequest<{ ids: Hex[] }>({\n uri: `${API_BASE_URL}/user/auth/${authId}/chain/${chainId}/wallet/${walletAddr}/identities`,\n ...options,\n })\n ).ids ?? []\n )\n}\n", "import { type BaseApiRequest, FROG_API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n GetCryptoPurchaseLimitsParams,\n MeldCreateCryptoQuoteParams,\n MeldCreateCryptoQuoteResponse,\n MeldCreateCryptoWidgetParams,\n MeldCreateCryptoWidgetResponse,\n MeldDefaultFiatResponse,\n MeldFiatLimitResponse,\n MeldSupportedFiatResponse,\n SearchDefaultFiatParams,\n} from './types'\n\nexport async function getMeldSupportedFiat({\n ...options\n}: BaseApiRequest): Promise<MeldSupportedFiatResponse> {\n return sendGetRequest({\n uri: `${FROG_API_BASE_URL}/api/meld/fiat`,\n ...options,\n retryOptions: { maxAttempts: 2 },\n })\n}\n\nexport async function getMeldQuotes({\n params,\n ...options\n}: BaseApiRequest & {\n params: MeldCreateCryptoQuoteParams\n}): Promise<MeldCreateCryptoQuoteResponse> {\n return sendPostRequest({\n uri: `${FROG_API_BASE_URL}/api/meld/quote`,\n body: params,\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\nexport async function startMeldSession({\n params,\n ...options\n}: BaseApiRequest & {\n params: MeldCreateCryptoWidgetParams['sessionData']\n}): Promise<MeldCreateCryptoWidgetResponse> {\n return sendPostRequest({\n uri: `${FROG_API_BASE_URL}/api/meld/session`,\n body: {\n sessionData: params,\n sessionType: 'BUY',\n },\n retryOptions: { maxAttempts: 2 },\n ...options,\n })\n}\n\nexport async function getMeldDefaultFiat({\n params,\n ...options\n}: BaseApiRequest & {\n params: SearchDefaultFiatParams\n}): Promise<MeldDefaultFiatResponse> {\n const countries = params.countries?.join(',') ?? ''\n const categories = params.categories?.join(',') ?? ''\n const urlParams = new URLSearchParams({\n ...(countries ? { countries } : {}),\n ...(categories ? { categories } : {}),\n })\n\n return sendGetRequest({\n uri: `${FROG_API_BASE_URL}/api/meld/defaultFiat?${urlParams}`,\n ...options,\n retryOptions: { maxAttempts: 2 },\n })\n}\n\nexport async function getMeldFiatLimits({\n params,\n ...options\n}: BaseApiRequest & {\n params: GetCryptoPurchaseLimitsParams\n}): Promise<MeldFiatLimitResponse> {\n const countries = params.countries.join(',')\n const cryptoCurrencies = params.cryptoCurrencies.join(',')\n const fiatCurrencies = params.fiatCurrencies.join(',')\n const categories = params.categories?.join(',') ?? ''\n const urlParams = new URLSearchParams({\n countries,\n cryptoCurrencies,\n fiatCurrencies,\n ...(categories ? { categories } : {}),\n })\n\n return sendGetRequest({\n uri: `${FROG_API_BASE_URL}/api/meld/fiatLimit?${urlParams}`,\n ...options,\n retryOptions: { maxAttempts: 2 },\n })\n}\n", "export enum MeldServiceProvider {\n ALCHEMYPAY = 'ALCHEMYPAY',\n BANXA = 'BANXA',\n BILIRA = 'BILIRA',\n BINANCECONNECT = 'BINANCECONNECT',\n BLOCKCHAINDOTCOM = 'BLOCKCHAINDOTCOM',\n BTCDIRECT = 'BTCDIRECT',\n COINBASEPAY = 'COINBASEPAY',\n MOONPAY = 'MOONPAY',\n FONBNK = 'FONBNK',\n GUARDARIAN = 'GUARDARIAN',\n KOYWE = 'KOYWE',\n MERCURYO = 'MERCURYO',\n MESH = 'MESH',\n MESO = 'MESO',\n ONMETA = 'ONMETA',\n ONRAMPMONEY = 'ONRAMPMONEY',\n PAYBIS = 'PAYBIS',\n PAYPAL = 'PAYPAL',\n RAMP = 'RAMP',\n REVOLUT = 'REVOLUT',\n ROBINHOOD = 'ROBINHOOD',\n SARDINE = 'SARDINE',\n SHIFT4 = 'SHIFT4',\n SIMPLEX = 'SIMPLEX',\n SKRILLCRYPTO = 'SKRILLCRYPTO',\n STRIPE = 'STRIPE',\n TOPPER = 'TOPPER',\n TRANSAK = 'TRANSAK',\n TRANSFI = 'TRANSFI',\n UNLIMIT = 'UNLIMIT',\n YELLOWCARD = 'YELLOWCARD',\n}\n\nexport const MELD_PROVIDER_CATEGORIES = [\n 'BANK_LINKING',\n 'CRYPTO_ONRAMP',\n 'CRYPTO_OFFRAMP',\n 'CRYPTO_TRANSFER',\n 'FIAT_PAYMENTS',\n] as const\n\nexport type MeldFiatCurrency = {\n /** fiat code. e.g. USD/EUR */\n currencyCode: string\n /** fiat name. e.g. United State Dollar */\n name: string\n /** image URL for the currency symbol provided by meld */\n symbolImageUrl: string\n}\n\nexport type MeldDefaultFiatCurrency = {\n /** Two-letter code (ISO 3166-1 alpha-2) for the Country. */\n countryCode: string\n /** fiat code. e.g. USD/EUR */\n defaultCurrencyCode: string\n /** The identifier for the Payment Method */\n defaultPaymentMethods: MeldQuote['paymentMethodType'][]\n}\n\nexport type MeldCreateCryptoQuoteParams = {\n /**\n * Two-letter country code (ISO 3166-1 alpha-2)\n */\n countryCode: string\n\n /**\n * Meld generated unique identifier for your customer. This should be used to track customer activity.\n */\n customerId?: string\n\n /**\n * The cryptocurrency the customer is buying (e.g. BTC, ETH).\n */\n destinationCurrencyCode: string\n\n /**\n * Your unique identifier for your customer. If maintaining your own customer management system this can also be used for tracking customer activity.\n */\n externalCustomerId?: string\n\n /**\n * Payment Method Type or SubType\n */\n paymentMethodType?: string\n\n /**\n * An optional list of Strings representing the Service Providers for this Quote\n */\n serviceProviders?: MeldServiceProvider[]\n\n /**\n * The amount of source currency your customer wants tosend in this transaction (e.g., 50.05)\n */\n sourceAmount: `${number}`\n\n /**\n * The fiat currency the user is buying crypto with (e.g. USD, EUR)\n */\n sourceCurrencyCode: string\n\n /**\n * Subdivision is a optional parameter Only applicable if the country code is US or CA (e.g. US-CA).\n */\n subdivision?: string\n\n /**\n * Your customer's wallet address\n */\n walletAddress?: `0x${string}`\n}\n\nexport type MeldQuote = {\n /**\n * Two-letter country code (ISO 3166-1 alpha-2)\n */\n countryCode: string\n\n /**\n * A numerical score representing the expectation a Customer will convert\n */\n customerScore?: number\n\n /**\n * Destination currency amount to be received for this quote\n */\n destinationAmount: number\n\n /**\n * Code of currency being quoted: BTC, ETH, ...\n */\n destinationCurrencyCode: string\n\n /**\n * The exchange rate at the time the request is sent\n */\n exchangeRate: number\n\n /**\n * The fiat amount exchanged when buying or selling crypto, excluding fees\n */\n fiatAmountWithoutFees: number\n\n /**\n * The name of the institution or broker used for this quote, if present\n */\n institutionName?: string | null\n\n /**\n * LowKYC indicates if the quote amount is below the provider's low KYC threshold, meaning the user may not need to upload documents, which can increase conversion.\n */\n lowKyc?: boolean | null\n\n /**\n * The network fee applied to a crypto transaction\n */\n networkFee?: number | null\n\n /**\n * The fee amount charged by the partner to process your customer's purchase\n */\n partnerFee?: number | null\n\n /**\n * Payment Method Type used for this quote\n */\n paymentMethodType: 'APPLE_PAY' | 'MASTERCARD' | 'SEPA' | 'VISA'\n\n /**\n * The service provider used for this transaction\n */\n serviceProvider: MeldServiceProvider\n\n /**\n * Amount requested + fees\n */\n sourceAmount: number\n\n /**\n * The fiat currency the user is buying crypto with (e.g. USD, EUR)\n */\n sourceCurrencyCode: string\n\n /**\n * The total amount of fees that will be charged\n */\n totalFee?: number | null\n\n /**\n * The fee amount charged by the service provider to process your customer's purchase\n */\n transactionFee?: number | null\n\n /**\n * The type of crypto transaction\n */\n transactionType: 'CRYPTO_PURCHASE' // | 'CRYPTO_SELL', but only care about buying atm\n}\n\nexport type MeldCreateCryptoQuoteResponse = {\n quotes: MeldQuote[]\n}\n\nexport type MeldCreateCryptoWidgetParams = {\n /**\n * Meld generated unique identifier for your customer. This should be used to track customer activity.\n */\n customerId?: string\n\n /**\n * Your unique identifier for your customer. If maintaining your own customer management system this can also be used for tracking customer activity.\n */\n externalCustomerId?: string\n\n /**\n * Your reference Id for your widget session\n */\n externalSessionId?: string\n\n sessionData: {\n /**\n * Two-letter country code (ISO 3166-1 alpha-2)\n */\n countryCode: string\n\n /**\n * The cryptocurrency the customer is buying (e.g. BTC, ETH).\n */\n destinationCurrencyCode: string\n\n /**\n * If provided, the institution to bypass the institution selection screen in the service provider's widget. Currently this is only supported for MESH widget sessions.\n */\n institutionId?: string\n\n /**\n * Where supported by the Service Provider, Meld can help you lock the cryptocurrency and/or wallet address fields within the widget.\n */\n lockFields?: ('destinationCurrencyCode' | 'walletAddress')[]\n\n /**\n * Payment Method Type or SubType\n */\n paymentMethodType?: string\n\n /**\n * The url to redirect to following completion of the widget flow\n */\n redirectUrl?: string\n\n /**\n * The service provider used for this transaction\n */\n serviceProvider: MeldServiceProvider\n\n /**\n * The amount of source currency your customer wants to send in this transaction (e.g., 50.05)\n */\n sourceAmount: `${number}`\n\n /**\n * The fiat currency the user is buying crypto with (e.g. USD, EUR)\n */\n sourceCurrencyCode: string\n\n /**\n * Your customer's wallet address\n */\n walletAddress: `0x${string}`\n\n /**\n * Your customer's wallet tag/destination tag/memo. This field is required for certain cryptocurrencies.\n */\n walletTag?: string\n }\n\n sessionType: 'BUY' // | 'SELL' | 'TRANSFER' - We only care about BUY atm\n\n /**\n * For MESH only. Details about a previously authenticated crypto session or bank-linking connection.\n * If provided, the widget will not require the customer to authenticate again as long as the authentication is still valid.\n * The scope of these authentication bypass details are restricted to the same customer, service provider, and institution that were used in the original connection.\n */\n authenticationBypassDetails?: {\n /**\n * The widget type associated with the previously authenticated session/connection.\n */\n category: string\n\n /**\n * The Meld id of the crypto session or bank-linking connection in which the customer has already authenticated with their institution.\n * The auth tied to this session/connection will be used to bypass the authentication process for the current session, if it is still valid.\n * This id may pertain to the initial session/connection in which the customer authenticated, or any subsequent session that used this prior authentication successfully.\n */\n previouslyAuthenticatedId: string\n }\n}\n\nexport type MeldCreateCryptoWidgetResponse = {\n /**\n * Meld generated unique identifier for your customer. This should be used to track customer activity.\n */\n customerId?: string | null\n\n /**\n * Your unique identifier for your customer. If maintaining your own customer management system this can also be used for tracking customer activity.\n */\n externalCustomerId?: string | null\n\n /**\n * Your reference Id for your widget session\n */\n externalSessionId?: string | null\n\n /**\n * Unique identifier for this session\n */\n id: string\n\n /**\n * The session token\n */\n token: string\n\n /**\n * The crypto widget URL\n */\n widgetUrl: string\n}\n\nexport interface MeldError extends Error {\n /**\n * A categorization of the error\n */\n code: string\n\n /**\n * A user-friendly representation of the error code.\n * This may change over time and is not safe for programmatic use.\n */\n errors?: string[] | null\n\n /**\n * A developer-friendly representation of the error code.\n * This may change over time and is not safe for programmatic use.\n */\n message: string\n\n /**\n * The request Id\n */\n requestId: string\n\n /**\n * The date and time when the request was made (ISO)\n */\n timestamp: string | null\n}\n\nexport interface MeldSupportedFiatResponse {\n currencies: MeldFiatCurrency[]\n /** Irrelevant */\n preferred: string[]\n}\n\nexport type SearchDefaultFiatParams = {\n countries: string[]\n categories?: (typeof MELD_PROVIDER_CATEGORIES)[number][]\n}\n\nexport interface MeldDefaultFiatResponse {\n currencies: MeldDefaultFiatCurrency[]\n}\n\nexport interface GetCryptoPurchaseLimitsParams {\n /**\n * The two-letter country code (ISO 3166-1 alpha-2) to search for supported fiat currencies.\n * A comma separated list of countries.\n */\n countries: string[]\n\n /**\n * The crypto currencies to search for limits\n */\n cryptoCurrencies: string[]\n\n /**\n * The fiat currencies to search for limits\n */\n fiatCurrencies: string[]\n\n /**\n * The categories to search for limits\n */\n categories?: (typeof MELD_PROVIDER_CATEGORIES)[number][]\n}\n\nexport interface MeldFiatCurrencyLimit {\n currencyCode: string\n defaultAmount: number | null\n minimumAmount: number\n maximumAmount: number\n}\n\nexport interface MeldFiatLimitResponse {\n limits: MeldFiatCurrencyLimit[]\n}\n", "import { ErrorCode, InternalFailureError } from '@funkit/utils'\nimport { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n GetMoonpayBuyQuoteForCreditCardRequest,\n GetMoonpayBuyQuoteForCreditCardResponse,\n GetMoonpayUrlSignatureRequest,\n} from './types'\n\ninterface GetMoonpayUrlSignatureResponse {\n url: string\n}\n\nexport async function getMoonpayUrlSignature({\n url,\n isSandbox,\n ...options\n}: GetMoonpayUrlSignatureRequest): Promise<string> {\n const signature = await sendPostRequest<GetMoonpayUrlSignatureResponse>({\n uri: `${API_BASE_URL}/on-ramp/moonpay-signature/`,\n body: { url, isSandbox },\n ...options,\n })\n if (!signature || !signature?.url) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n 'No onramp url found.',\n '',\n { url },\n 'This is an internal error, please contact support.',\n 'https://docs.fun.xyz',\n )\n }\n return signature.url\n}\n\nexport async function getMoonpayBuyQuoteForCreditCard({\n currencyCode,\n baseCurrencyCode,\n quoteCurrencyAmount,\n baseCurrencyAmount,\n extraFeePercentage,\n areFeesIncluded,\n ...options\n}: GetMoonpayBuyQuoteForCreditCardRequest): Promise<GetMoonpayBuyQuoteForCreditCardResponse> {\n const params = new URLSearchParams({\n currencyCode,\n baseCurrencyCode,\n quoteCurrencyAmount,\n paymentMethod: 'credit_debit_card',\n ...(baseCurrencyAmount == null\n ? {}\n : { baseCurrencyAmount: baseCurrencyAmount.toString() }),\n ...(extraFeePercentage == null\n ? {}\n : { extraFeePercentage: extraFeePercentage.toString() }),\n ...(areFeesIncluded == null\n ? {}\n : { areFeesIncluded: areFeesIncluded.toString() }),\n }).toString()\n\n return sendGetRequest({\n uri: `${API_BASE_URL}/on-ramp/moonpay-buy-quote?${params}`,\n retryOptions: { maxAttempts: 1 },\n ...options,\n })\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport type { GetOrganizationIdRequest } from './types'\n\nexport async function getOrganizationIdByApiKey({\n apiKey,\n}: GetOrganizationIdRequest) {\n return await sendGetRequest<{ id: string }>({\n uri: `${API_BASE_URL}/organization`,\n apiKey,\n })\n}\n", "import { API_BASE_URL, type BaseApiRequest } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport type {\n CreateStripeBuySessionBody,\n CreateStripeBuySessionResponse,\n GetStripeBuyQuoteRequest,\n GetStripeBuyQuoteResponse,\n} from './types'\n\nexport async function getStripeBuyQuote({\n sourceCurrency,\n destinationAmount,\n destinationCurrency,\n destinationNetwork,\n isSandbox,\n ...options\n}: GetStripeBuyQuoteRequest): Promise<GetStripeBuyQuoteResponse> {\n const params = new URLSearchParams({\n isSandbox: isSandbox.toString(),\n sourceCurrency,\n destinationAmount: destinationAmount.toString(),\n // Only allow one currency in this SDK\n destinationCurrencies: destinationCurrency,\n // Only allow one network in this SDK\n destinationNetworks: destinationNetwork,\n }).toString()\n const buyQuoteResp = await sendGetRequest({\n uri: `${API_BASE_URL}/on-ramp/stripe-buy-quote?${params}`,\n retryOptions: { maxAttempts: 1 },\n ...options,\n })\n return buyQuoteResp as GetStripeBuyQuoteResponse\n}\n\nexport async function createStripeBuySession({\n sourceCurrency,\n destinationAmount,\n destinationCurrency,\n destinationNetwork,\n walletAddress,\n customerIpAddress,\n isSandbox,\n ...options\n}: CreateStripeBuySessionBody): Promise<CreateStripeBuySessionResponse> {\n const body = {\n isSandbox: isSandbox.toString(),\n sourceCurrency,\n destinationAmount: destinationAmount.toString(),\n // Only allow one currency in this SDK\n destinationCurrency,\n destinationCurrencies: [destinationCurrency],\n // Only allow one network in this SDK\n destinationNetwork,\n destinationNetworks: [destinationNetwork],\n // Only allow one wallet address in this SDK, and it must correspond to the destination network\n walletAddresses: {\n [destinationNetwork]: walletAddress,\n },\n ...(customerIpAddress ? { customerIpAddress } : {}),\n }\n const newBuySessionResp = await sendPostRequest({\n uri: `${API_BASE_URL}/on-ramp/stripe-checkout`,\n body,\n retryOptions: { maxAttempts: 1 },\n ...options,\n })\n return newBuySessionResp as CreateStripeBuySessionResponse\n}\n\nexport async function getStripeBuySession({\n sessionId,\n ...options\n}: BaseApiRequest & {\n sessionId: string\n}): Promise<CreateStripeBuySessionResponse> {\n const buySessionResp = await sendGetRequest({\n uri: `${API_BASE_URL}/on-ramp/stripe-checkout-session/${sessionId}`,\n retryOptions: { maxAttempts: 1 },\n ...options,\n })\n return buySessionResp as CreateStripeBuySessionResponse\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendPostRequest } from '../../utils'\nimport type { SendSupportMessageRequest } from './types'\n\nexport async function sendSupportMessage({\n title,\n description,\n userEmail,\n ...options\n}: SendSupportMessageRequest): Promise<boolean> {\n try {\n await sendPostRequest({\n uri: `${API_BASE_URL}/support/send-message`,\n body: { title, description, userEmail },\n retryOptions: { maxAttempts: 1 },\n ...options,\n })\n return true\n } catch (_err) {\n return false\n }\n}\n", "import { type BaseApiRequest, FROG_API_BASE_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport type { ExchangeRates } from './types'\n\n/**\n * Get the exchange rates for all fiat currencies\n * @returns The exchange rates for all fiat currencies\n */\nexport async function getFiatExchangeRates({\n ...options\n}: Omit<BaseApiRequest, 'apiKey'> = {}): Promise<ExchangeRates> {\n return sendGetRequest({\n uri: `${FROG_API_BASE_URL}/api/exchange-rates`,\n apiKey: '', // Just a hack to make typescript happy as we don't require an API Key for this endpoint\n ...options,\n retryOptions: { maxAttempts: 2 },\n })\n}\n", "import { FROG_API_BASE_URL } from '../../consts'\nimport { sendPostRequest } from '../../utils'\nimport type {\n BluvoExecuteWithdrawalRequest,\n BluvoExecuteWithdrawalResponse,\n BluvoGetWalletByIdRequest,\n BluvoGetWalletByIdResponse,\n BluvoGetWithdrawableBalanceByIdRequest,\n BluvoGetWithdrawableBalanceByIdResponse,\n BluvoListExchangesRequest,\n BluvoListExchangesResponse,\n BluvoRequestQuotationRequest,\n BluvoRequestQuotationResponse,\n} from './types'\n\nexport async function bluvoGetWithdrawableBalanceById({\n id,\n logger,\n}: BluvoGetWithdrawableBalanceByIdRequest): Promise<BluvoGetWithdrawableBalanceByIdResponse> {\n return sendPostRequest({\n uri: `${FROG_API_BASE_URL}/api/bluvo/balance`,\n body: { id },\n logger,\n apiKey: '',\n })\n}\n\nexport async function bluvoListExchanges({\n status,\n logger,\n}: BluvoListExchangesRequest): Promise<BluvoListExchangesResponse> {\n return sendPostRequest({\n uri: `${FROG_API_BASE_URL}/api/bluvo/exchanges`,\n body: { status },\n logger,\n apiKey: '',\n })\n}\n\nexport async function bluvoGetWalletById({\n id,\n logger,\n}: BluvoGetWalletByIdRequest): Promise<BluvoGetWalletByIdResponse> {\n return sendPostRequest({\n uri: `${FROG_API_BASE_URL}/api/bluvo/walletId`,\n body: { id },\n logger,\n apiKey: '',\n })\n}\n\nexport async function bluvoRequestQuotation({\n id,\n params,\n logger,\n}: BluvoRequestQuotationRequest): Promise<BluvoRequestQuotationResponse> {\n return sendPostRequest({\n uri: `${FROG_API_BASE_URL}/api/bluvo/quote`,\n body: { id, params },\n logger,\n apiKey: '',\n })\n}\n\nexport async function bluvoExecuteWithdrawal({\n id,\n idempotencyKey,\n quoteId,\n params,\n logger,\n}: BluvoExecuteWithdrawalRequest): Promise<BluvoExecuteWithdrawalResponse> {\n return sendPostRequest({\n uri: `${FROG_API_BASE_URL}/api/bluvo/withdrawal`,\n body: { id, idempotencyKey, quoteId, params },\n logger,\n apiKey: '',\n })\n}\n"],
5
+ "mappings": ";AAAO,IAAM,eAA2C;AAEjD,IAAM,oBACsB;AAE5B,IAAM,iBAAiB;;;ACL9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGA,IAAM,oBAAoB,CAAC,KAAY,YAA4B;AACxE,MACE,eAAe,yBACf,eAAe,yBACf,eAAe,oBACf;AACA,YAAQ,MAAM;AAAA,EAChB;AACF;;;ACPO,IAAM,wBAAwB;AAAA,EACnC,OAAO;AAAA,EACP,cAAc;AAAA,EACd,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AAAA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,GAAG,iBAAiB;AAAA,IACzB,MAAM,EAAE,OAAO;AAAA,IACf;AAAA,IACA,QAAQ;AAAA,EACV,CAAC;AACH;AAEA,eAAsB,mBAAmB;AAAA,EACvC;AAAA,EACA;AACF,GAAmE;AACjE,SAAO,gBAAgB;AAAA,IACrB,KAAK,GAAG,iBAAiB;AAAA,IACzB,MAAM,EAAE,GAAG;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,EACV,CAAC;AACH;AAEA,eAAsB,sBAAsB;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AACF,GAAyE;AACvE,SAAO,gBAAgB;AAAA,IACrB,KAAK,GAAG,iBAAiB;AAAA,IACzB,MAAM,EAAE,IAAI,OAAO;AAAA,IACnB;AAAA,IACA,QAAQ;AAAA,EACV,CAAC;AACH;AAEA,eAAsB,uBAAuB;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA2E;AACzE,SAAO,gBAAgB;AAAA,IACrB,KAAK,GAAG,iBAAiB;AAAA,IACzB,MAAM,EAAE,IAAI,gBAAgB,SAAS,OAAO;AAAA,IAC5C;AAAA,IACA,QAAQ;AAAA,EACV,CAAC;AACH;",
6
6
  "names": ["InvalidParameterError", "ResourceNotFoundError", "UserOpFailureError", "BridgeCustomerStatus", "BridgeKycStatus", "BridgeTosStatus", "BridgeCustomerType", "BridgeEndorsement", "BridgeVirtualBankAccountStatus", "ErrorCode", "ResourceNotFoundError", "CheckoutState", "CheckoutRefundState", "ResourceNotFoundError", "ErrorCode", "DirectExecutionType", "RelayExecutionStatus", "OperationStatus", "AuthType", "OperationType", "PaymasterType", "ResourceNotFoundError", "InvalidParameterError", "ResourceNotFoundError", "InvalidParameterError", "MeldServiceProvider", "ErrorCode", "InternalFailureError", "InternalFailureError", "ErrorCode"]
7
7
  }
@@ -1,4 +1,4 @@
1
1
  export declare const API_BASE_URL: string;
2
- export declare const MESH_API_BASE_URL: string;
2
+ export declare const FROG_API_BASE_URL: string;
3
3
  export declare const FUN_FAUCET_URL = "https://api.fun.xyz/demo-faucet";
4
4
  //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { BluvoExecuteWithdrawalRequest, BluvoExecuteWithdrawalResponse, BluvoGetWalletByIdRequest, BluvoGetWalletByIdResponse, BluvoGetWithdrawableBalanceByIdRequest, BluvoGetWithdrawableBalanceByIdResponse, BluvoListExchangesRequest, BluvoListExchangesResponse, BluvoRequestQuotationRequest, BluvoRequestQuotationResponse } from './types';
2
+ export declare function bluvoGetWithdrawableBalanceById({ id, logger, }: BluvoGetWithdrawableBalanceByIdRequest): Promise<BluvoGetWithdrawableBalanceByIdResponse>;
3
+ export declare function bluvoListExchanges({ status, logger, }: BluvoListExchangesRequest): Promise<BluvoListExchangesResponse>;
4
+ export declare function bluvoGetWalletById({ id, logger, }: BluvoGetWalletByIdRequest): Promise<BluvoGetWalletByIdResponse>;
5
+ export declare function bluvoRequestQuotation({ id, params, logger, }: BluvoRequestQuotationRequest): Promise<BluvoRequestQuotationResponse>;
6
+ export declare function bluvoExecuteWithdrawal({ id, idempotencyKey, quoteId, params, logger, }: BluvoExecuteWithdrawalRequest): Promise<BluvoExecuteWithdrawalResponse>;
7
+ //# sourceMappingURL=endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../../src/services/bluvo/endpoints.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,6BAA6B,EAC7B,8BAA8B,EAC9B,yBAAyB,EACzB,0BAA0B,EAC1B,sCAAsC,EACtC,uCAAuC,EACvC,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,SAAS,CAAA;AAEhB,wBAAsB,+BAA+B,CAAC,EACpD,EAAE,EACF,MAAM,GACP,EAAE,sCAAsC,GAAG,OAAO,CAAC,uCAAuC,CAAC,CAO3F;AAED,wBAAsB,kBAAkB,CAAC,EACvC,MAAM,EACN,MAAM,GACP,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAOjE;AAED,wBAAsB,kBAAkB,CAAC,EACvC,EAAE,EACF,MAAM,GACP,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAOjE;AAED,wBAAsB,qBAAqB,CAAC,EAC1C,EAAE,EACF,MAAM,EACN,MAAM,GACP,EAAE,4BAA4B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAOvE;AAED,wBAAsB,sBAAsB,CAAC,EAC3C,EAAE,EACF,cAAc,EACd,OAAO,EACP,MAAM,EACN,MAAM,GACP,EAAE,6BAA6B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAOzE"}
@@ -0,0 +1,3 @@
1
+ export * from './endpoints';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/bluvo/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,46 @@
1
+ import type { BluvoClient } from '@bluvo/sdk-ts';
2
+ export interface BluvoBalanceSchema {
3
+ id: string;
4
+ }
5
+ export interface BluvoExchangesSchema {
6
+ status: 'live' | 'offline' | 'maintenance' | 'coming_soon';
7
+ }
8
+ export interface BluvoQuoteSchema {
9
+ id: string;
10
+ params: {
11
+ asset: string;
12
+ amount: string;
13
+ address: string;
14
+ tag?: string | undefined;
15
+ network?: string | undefined;
16
+ includeFee?: boolean | undefined;
17
+ };
18
+ }
19
+ export interface BluvoWalletIdSchema {
20
+ id: string;
21
+ }
22
+ export interface BluvoWithdrawalSchema {
23
+ id: string;
24
+ idempotencyKey: string;
25
+ quoteId: string;
26
+ params?: {
27
+ twofa?: string | undefined;
28
+ } | undefined;
29
+ }
30
+ import type { BaseApiRequest } from '../../consts';
31
+ export interface BluvoGetWithdrawableBalanceByIdRequest extends Partial<BaseApiRequest>, BluvoBalanceSchema {
32
+ }
33
+ export type BluvoGetWithdrawableBalanceByIdResponse = Awaited<ReturnType<BluvoClient['wallet']['withdrawals']['getWithdrawableBalance']>>;
34
+ export interface BluvoListExchangesRequest extends Partial<BaseApiRequest>, BluvoExchangesSchema {
35
+ }
36
+ export type BluvoListExchangesResponse = Awaited<ReturnType<BluvoClient['oauth2']['listExchanges']>>;
37
+ export interface BluvoGetWalletByIdRequest extends Partial<BaseApiRequest>, BluvoWalletIdSchema {
38
+ }
39
+ export type BluvoGetWalletByIdResponse = Awaited<ReturnType<BluvoClient['wallet']['get']>>;
40
+ export interface BluvoRequestQuotationRequest extends Partial<BaseApiRequest>, BluvoQuoteSchema {
41
+ }
42
+ export type BluvoRequestQuotationResponse = Awaited<ReturnType<BluvoClient['wallet']['withdrawals']['requestQuotation']>>;
43
+ export interface BluvoExecuteWithdrawalRequest extends Partial<BaseApiRequest>, BluvoWithdrawalSchema {
44
+ }
45
+ export type BluvoExecuteWithdrawalResponse = Awaited<ReturnType<BluvoClient['wallet']['withdrawals']['executeWithdrawal']>>;
46
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/bluvo/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,aAAa,CAAA;CAC3D;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;QACd,OAAO,EAAE,MAAM,CAAA;QACf,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QACxB,OAA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AC,CAAC,CACrE,CAAA;AAED,MAAM,WAAW,6BACf,SAAQ,OAAO,CAAC,cAAc,CAAC,EAC7B,qBAAqB;CAAG;AAC5B,MAAM,MAAM,8BAA8B,GAAG,OAAO,CAClD,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,mBAAmB,CAAC,CAAC,CACtE,CAAA"}
@@ -15,4 +15,5 @@ export * from './organization';
15
15
  export * from './stripe';
16
16
  export * from './support';
17
17
  export * from './exchange-rates';
18
+ export * from './bluvo';
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/api-base",
3
- "version": "1.12.8",
3
+ "version": "1.12.9",
4
4
  "description": "Base API for Funkit",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -17,6 +17,7 @@
17
17
  "viem": "2.x"
18
18
  },
19
19
  "devDependencies": {
20
+ "@bluvo/sdk-ts": "1.2.2",
20
21
  "@types/big.js": "^6.2.2",
21
22
  "typescript": "^5.8.2",
22
23
  "vitest": "^3.0.9"