@funkit/api-base 1.0.2 → 1.1.0

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,17 @@
1
1
  # @funkit/api-base
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1836ec2: Removes unused turnkey endpoints
8
+
9
+ ## 1.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 9e46890: feat: abort controller for asset calls
14
+
3
15
  ## 1.0.2
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -912,7 +912,8 @@ var sendRequest = async ({
912
912
  method,
913
913
  apiKey,
914
914
  body = {},
915
- retryOptions = {}
915
+ retryOptions = {},
916
+ signal
916
917
  }) => {
917
918
  try {
918
919
  const headers = {
@@ -928,6 +929,7 @@ var sendRequest = async ({
928
929
  method,
929
930
  headers,
930
931
  redirect: "follow",
932
+ signal,
931
933
  body: method !== "GET" ? stringifyWithBigIntSanitization(body) : void 0
932
934
  });
933
935
  const json = await response.json();
@@ -1015,12 +1017,14 @@ var sendRequest = async ({
1015
1017
  async function sendGetRequest({
1016
1018
  uri,
1017
1019
  apiKey,
1018
- retryOptions
1020
+ retryOptions,
1021
+ signal
1019
1022
  }) {
1020
1023
  return await sendRequest({
1021
1024
  uri,
1022
1025
  apiKey,
1023
1026
  retryOptions,
1027
+ signal,
1024
1028
  method: "GET"
1025
1029
  });
1026
1030
  }
@@ -1028,39 +1032,45 @@ async function sendPostRequest({
1028
1032
  uri,
1029
1033
  body,
1030
1034
  apiKey,
1031
- retryOptions
1035
+ retryOptions,
1036
+ signal
1032
1037
  }) {
1033
1038
  return await sendRequest({
1034
1039
  uri,
1035
1040
  apiKey,
1036
1041
  body,
1037
1042
  retryOptions,
1043
+ signal,
1038
1044
  method: "POST"
1039
1045
  });
1040
1046
  }
1041
1047
  async function sendDeleteRequest({
1042
1048
  uri,
1043
1049
  apiKey,
1044
- retryOptions
1050
+ retryOptions,
1051
+ signal
1045
1052
  }) {
1046
1053
  await sendRequest({
1047
1054
  uri,
1048
1055
  method: "DELETE",
1049
1056
  apiKey,
1050
- retryOptions
1057
+ retryOptions,
1058
+ signal
1051
1059
  });
1052
1060
  }
1053
1061
  async function sendPutRequest({
1054
1062
  uri,
1055
1063
  body,
1056
1064
  apiKey,
1057
- retryOptions
1065
+ retryOptions,
1066
+ signal
1058
1067
  }) {
1059
1068
  return await sendRequest({
1060
1069
  uri,
1061
1070
  apiKey,
1062
1071
  body,
1063
1072
  retryOptions,
1073
+ signal,
1064
1074
  method: "PUT"
1065
1075
  });
1066
1076
  }
@@ -1081,11 +1091,13 @@ async function getAssetPriceInfo({
1081
1091
  async function getAllWalletTokens({
1082
1092
  walletAddress,
1083
1093
  onlyVerifiedTokens,
1084
- apiKey
1094
+ apiKey,
1095
+ signal
1085
1096
  }) {
1086
1097
  return await sendGetRequest({
1087
1098
  uri: `${API_BASE_URL}/assets/erc20s/${walletAddress}?onlyVerifiedTokens=${onlyVerifiedTokens}`,
1088
1099
  apiKey,
1100
+ signal,
1089
1101
  retryOptions: { maxAttempts: 2 }
1090
1102
  });
1091
1103
  }
@@ -1266,12 +1278,14 @@ async function deactivateCheckout({
1266
1278
  }
1267
1279
  async function getCheckoutByDepositAddress({
1268
1280
  depositAddress,
1269
- apiKey
1281
+ apiKey,
1282
+ signal
1270
1283
  }) {
1271
1284
  try {
1272
1285
  return await sendGetRequest({
1273
1286
  uri: `${API_BASE_URL}/checkout/${depositAddress}`,
1274
- apiKey
1287
+ apiKey,
1288
+ signal
1275
1289
  });
1276
1290
  } catch (err) {
1277
1291
  if (err instanceof ResourceNotFoundError) {
@@ -1282,31 +1296,37 @@ async function getCheckoutByDepositAddress({
1282
1296
  }
1283
1297
  async function getCheckoutsByFunWalletAddress({
1284
1298
  funWalletAddress,
1285
- apiKey
1299
+ apiKey,
1300
+ signal
1286
1301
  }) {
1287
1302
  const res = await sendGetRequest({
1288
1303
  uri: `${API_BASE_URL}/checkout/fun-wallet/${funWalletAddress}`,
1289
- apiKey
1304
+ apiKey,
1305
+ signal
1290
1306
  });
1291
1307
  return res || [];
1292
1308
  }
1293
1309
  async function getCheckoutsByRecipientAddress({
1294
1310
  recipientAddress,
1295
- apiKey
1311
+ apiKey,
1312
+ signal
1296
1313
  }) {
1297
1314
  const res = await sendGetRequest({
1298
1315
  uri: `${API_BASE_URL}/checkout/recipient/${recipientAddress}`,
1299
- apiKey
1316
+ apiKey,
1317
+ signal
1300
1318
  });
1301
1319
  return res || [];
1302
1320
  }
1303
1321
  async function getCheckoutsByUserId({
1304
1322
  userId,
1305
- apiKey
1323
+ apiKey,
1324
+ signal
1306
1325
  }) {
1307
1326
  const res = await sendGetRequest({
1308
1327
  uri: `${API_BASE_URL}/checkout/userId/${userId}`,
1309
- apiKey
1328
+ apiKey,
1329
+ signal
1310
1330
  });
1311
1331
  return res || [];
1312
1332
  }
@@ -1673,33 +1693,6 @@ async function sendSupportMessage({
1673
1693
  return false;
1674
1694
  }
1675
1695
  }
1676
-
1677
- // src/services/turnkey/endpoints.ts
1678
- async function createTurnkeySubOrg({
1679
- createSubOrgRequest,
1680
- apiKey
1681
- }) {
1682
- const res = await sendPostRequest({
1683
- uri: `${API_BASE_URL}/turnkey/sub-org`,
1684
- body: createSubOrgRequest,
1685
- apiKey
1686
- });
1687
- return res;
1688
- }
1689
- async function createTurnkeyPrivateKey({
1690
- signedRequest,
1691
- apiKey
1692
- }) {
1693
- const res = await sendPostRequest({
1694
- uri: `${API_BASE_URL}/turnkey/private-key`,
1695
- body: signedRequest,
1696
- apiKey
1697
- });
1698
- return {
1699
- id: res.id,
1700
- address: res.address
1701
- };
1702
- }
1703
1696
  export {
1704
1697
  API_BASE_URL,
1705
1698
  AccessDeniedError,
@@ -1721,8 +1714,6 @@ export {
1721
1714
  ThrottlingError,
1722
1715
  UserOpFailureError,
1723
1716
  createStripeBuySession,
1724
- createTurnkeyPrivateKey,
1725
- createTurnkeySubOrg,
1726
1717
  deactivateCheckout,
1727
1718
  errorAbortHandler,
1728
1719
  generateRandomCheckoutSalt,
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/consts/api.ts", "../src/errors/BaseError.ts", "../src/errors/errors.json", "../src/errors/types.ts", "../src/errors/ClientError.ts", "../src/errors/ServerError.ts", "../src/utils/error.ts", "../src/consts/retry.ts", "../src/utils/checkout.ts", "../src/utils/request.ts", "../src/services/assets/endpoints.ts", "../src/services/checkout/endpoints.ts", "../src/services/checkout/types.ts", "../src/services/faucet/endpoints.ts", "../src/services/mesh/endpoints.ts", "../src/services/mesh/types.ts", "../src/services/moonpay/endpoints.ts", "../src/services/stripe/endpoints.ts", "../src/services/support/endpoints.ts", "../src/services/turnkey/endpoints.ts"],
4
- "sourcesContent": ["export const API_BASE_URL =\n process.env.NODE_ENV === 'staging'\n ? 'https://api.fun.xyz/staging/v1'\n : process.env.NODE_ENV === 'testing'\n ? 'https://api.fun.xyz/testing/v1'\n : process.env.NODE_ENV === 'local'\n ? 'http://127.0.0.1:3000'\n : // Production\n 'https://api.fun.xyz/v1'\n\nexport const FUN_FAUCET_URL = 'https://api.fun.xyz/demo-faucet'\n", "const discord = 'https://discord.gg/mvQunrx6NG'\nexport class BaseError extends Error {\n timestamp: string\n\n constructor(\n public baseType: string,\n public type: string,\n public code: string,\n msg: string,\n\n public paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n isInternal = false,\n ) {\n super(`${msg}\\n\\n${fixSuggestion}\\nDocs: ${docLink}\\nDiscord: ${discord}`)\n if (isInternal) {\n this.loadEnd()\n }\n this.message += '\\n\\nTrace:'\n this.timestamp = new Date().toUTCString()\n }\n\n loadEnd() {\n this.message +=\n '\\n\\nThis is an internal sdk error. Please contact the fun team at our Discord for the fastest response.'\n }\n}\n", "{\n \"AA21\": {\n \"info\": \" Your wallet lacks funds for this transaction.\",\n \"suggestion\": \"To fix this error, make sure you have enough funds in your wallet to cover the transaction fee.\"\n },\n \"FW000\": {\n \"info\": \" Create3Deployer.requireDeployerOnly() - Signatures were not sorted before being passed in\",\n \"suggestion\": \"To fix this error, make sure to short sigs before passing them into `requireDeployerOnly`. You can do this by calling `sigs.sort()` before passing them in. It is also possible to run into this error if the hash that was signed was not the correct hash.\"\n },\n \"FW001\": {\n \"info\": \" Create3Deployer.requireDeployerOnly() - Signature failed to be recovered. ercrecover returned the zero address\",\n \"suggestion\": \"To fix this error, make sure to pass in enough valid signatures that sign the `hash` in the `sigs` array\"\n },\n \"FW002\": {\n \"info\": \" Create3Deployer.addDeployer() - Invalid Hash\",\n \"suggestion\": \"To fix this error, make sure `hash` is equal to `hashAddDeployer()`\"\n },\n \"FW003\": {\n \"info\": \" Create3Deployer.removeDeployer() - Invalid Hash\",\n \"suggestion\": \"To fix this error, make sure `hash` is equal to `hashRemoveDeployer()`\"\n },\n \"FW004\": {\n \"info\": \" Create3Deployer.setThreshold() - Threshold must be greater than 1\",\n \"suggestion\": \"To fix this error, `threshold` is greater than 1\"\n },\n \"FW005\": {\n \"info\": \" Create3Deployer.setThreshold() - Invalid Hash\",\n \"suggestion\": \"To fix this error, make sure `hash` is equal to `keccak256(abi.encodePacked(_threshold))`\"\n },\n \"FW006\": {\n \"info\": \" Create3Deployer.callChild() - Invalid Hash\",\n \"suggestion\": \"To fix this error, make sure `hash` is equal to `keccak256(abi.encodePacked(child, data, _nonce, block.chainid))`\"\n },\n \"FW007\": {\n \"info\": \" Create3Deployer.callChild() - Invalid Nonce, nonce must be 1 greater than the current nonce\",\n \"suggestion\": \"To fix this error, make sure `_nonce` is equal to the current nonce + 1\"\n },\n \"FW008\": {\n \"info\": \" Create3Deployer.callChild() - call to child failed\",\n \"suggestion\": \"To fix this error, check to see what is making the call to the child fail\"\n },\n \"FW009\": {\n \"info\": \" Create3Deployer.deploy() - Invalid Hash\",\n \"suggestion\": \"To fix this error, make sure `hash` is equal to `keccak256(abi.encodePacked(_salt, _creationCode))`\"\n },\n \"FW010\": {\n \"info\": \" FunWalletFactory.constructor() - Invalid Address, cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_deployer` is not equal to the zero address\"\n },\n \"FW011\": {\n \"info\": \" FunWalletFactory.constructor() - Invalid Address, cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_funWalletImpAddress` is not equal to the zero address\"\n },\n \"FW012\": {\n \"info\": \" FunWalletFactory.constructor() - Invalid Address, cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_feeOracle` is not equal to the zero address\"\n },\n \"FW013\": {\n \"info\": \" FunWalletFactory.constructor() - Invalid Address, cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_walletInit` is not equal to the zero address\"\n },\n \"FW014\": {\n \"info\": \" FunWalletFactory.constructor() - Unable to generate the address from this deployerSalt\",\n \"suggestion\": \"To fix this error, make sure `FunWalletFactoryV1` has not already been deployed from the given create3deployer contract. If it has been, change `FunWalletFactoryV1` to `FunWalletFactoryV2` or another version.\"\n },\n \"FW015\": {\n \"info\": \" FunWalletFactory.constructor() - Generated the wrong address from this deployerSalt\",\n \"suggestion\": \"To fix this error, make sure `FunWalletFactoryV1` has not already been deployed from the given create3deployer contract. If it has been, change `FunWalletFactoryV1` to `FunWalletFactoryV2` or another version.\"\n },\n \"FW016\": {\n \"info\": \" FunWalletFactory.createAccount() - Call to initialize failed on the deployed proxy\",\n \"suggestion\": \"To fix this error, make sure the `initializerCallData` is formatted correctly\"\n },\n \"FW017\": {\n \"info\": \" FunWalletFactory - Caller must be deployer\",\n \"suggestion\": \"To fix this error, make sure to call the function from the deployer address\"\n },\n \"FW018\": {\n \"info\": \" WalletInit.commit() - The previous commit has not expired\",\n \"suggestion\": \"To fix this error, wait for the previous commit with this `commitKey` to expire. This should take at most 10 minutes.\"\n },\n \"FW019\": {\n \"info\": \" WalletInit.validateSalt() - The hash at the commitKey does not match `keccak256(abi.encode(seed, owner, initializerCallData))`\",\n \"suggestion\": \"To fix this error, make sure the seed, owner, and initializerCallData are hashed and stored in commits at the corresponding `commitKey`\"\n },\n \"FW020\": {\n \"info\": \" WalletInit.validateSalt() - The new owner of the funwallet must match data.newFunWalletOwner from loginData\",\n \"suggestion\": \"To fix this error, make sure the owner set in `loginData` matches the owner address returned from the tweet.\"\n },\n \"FW021\": {\n \"info\": \" WalletInit.setOracle() - The address of the new `_oracle` must not be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_oracle` is not the zero address\"\n },\n \"FW022\": {\n \"info\": \" Create3Deployer.deployFromChild() - Invalid Child Address\",\n \"suggestion\": \"To fix this error, make sure the caller is a contract deployed from the Create3Deployer\"\n },\n \"FW023\": {\n \"info\": \" ImplementationRegistry.verifyIsValidContractAndImplementation() - Invalid Target Code Hash\",\n \"suggestion\": \"To fix this error, make sure the caller is a contract targeted is a ERC1967ProxyData contract\"\n },\n \"FW024\": {\n \"info\": \" ImplementationRegistry.verifyIsValidContractAndImplementation() - Invalid Contract Implementation Address\",\n \"suggestion\": \"To fix this error, make sure you have the minimun threshold amount of valid signatures.\"\n },\n \"FW025\": {\n \"info\": \" ImplementationRegistry.addImplementation() - Invalid Signature Amount\",\n \"suggestion\": \"To fix this error, make sure you have the minimun threshold amount of valid signatures.\"\n },\n \"FW026\": {\n \"info\": \" ImplementationRegistry.removeImplementation() - Invalid Signature Amount\",\n \"suggestion\": \"To fix this error, make sure you have the minimun threshold amount of valid signatures.\"\n },\n \"FW027\": {\n \"info\": \" WalletInit.commit() - Unable to commit with a previously used commit hash\",\n \"suggestion\": \"To fix this error, make sure you are not reusing someone else's commit hash. If there are conflicts, just regenerate the seed randomly\"\n },\n \"FW028\": {\n \"info\": \" MultiSigDeployer.constructor() - Threshold can't be greater than deployers length\",\n \"suggestion\": \"To fix this error, make sure the threshold value is not 0\"\n },\n \"FW029\": {\n \"info\": \" WalletInit.invalidateUsedSeed() - msg.sender must equal funwalletfactory\",\n \"suggestion\": \"To fix this error, make sure you are calling this function from the FunWalletFactory contract\"\n },\n \"FW030\": {\n \"info\": \" WalletInit.setFunWalletFactory() - funwalletfactory address cannot be set to 0\",\n \"suggestion\": \"To fix this error, make sure you are passing in the valid funwalletfactory address\"\n },\n \"FW031\": {\n \"info\": \" WalletInit.validateSalt() - seed has already been used\",\n \"suggestion\": \"To fix this error, make sure you are not using an existing salt\"\n },\n \"FW032\": {\n \"info\": \" FunWalletFactory.setFeeOracle() - Cannot set the fee oracle address to 0\",\n \"suggestion\": \"To fix this error, make sure you are using the correct address of the fee oracle\"\n },\n \"FW033\": {\n \"info\": \" FunWalletFactory.constructor() - Invalid Address, cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_entryPoint` is not equal to the zero address\"\n },\n \"FW034\": {\n \"info\": \" Create3Deployer.callChild() - Value not equal to msg.value\",\n \"suggestion\": \"To fix this error, make sure `msg.value` is equal to the `value` parameter.\"\n },\n \"FW100\": {\n \"info\": \" Module.execute() - execute() needs to be overriden\",\n \"suggestion\": \"To fix this error, make sure you are overriding the execute method in your module\"\n },\n \"FW101\": {\n \"info\": \" ApproveAndExec.approveAndExecute() - the approveData's first four bytes must be the approve() function selector\",\n \"suggestion\": \"To fix this error, change `approveData` such that the first four bytes are `bytes4(keccak256('approve(address,uint256)'))`\"\n },\n \"FW102\": {\n \"info\": \" ApproveAndSwap.constructor() - `_wethAddr` cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_wethAddr` is not set to the zero address\"\n },\n \"FW103\": {\n \"info\": \" ApproveAndSwap.constructor() - `_router` cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_router` is not set to the zero address\"\n },\n \"FW104\": {\n \"info\": \" ApproveAndSwap.executeSwapEth() - msg.sender does not have enough weth\",\n \"suggestion\": \"To fix this error, make sure msg.sender has a weth balance >= `amount`\"\n },\n \"FW105\": {\n \"info\": \" ApproveAndSwap.\\\\_internalSwap() - Approve failed\",\n \"suggestion\": \"To fix this error, make sure you have formatted approve correctly\"\n },\n \"FW106\": {\n \"info\": \" AaveWithdraw.execute() - Withdrawing a zero balance\",\n \"suggestion\": \"You are trying to withdraw from aave but don't have a balance\"\n },\n \"FW107\": {\n \"info\": \" ApproveAndExec.approveAndExecute() - Approve failed\",\n \"suggestion\": \"The token you tried to approve failed\"\n },\n \"FW108\": {\n \"info\": \" UniswapV3LimitOrder.execute() - Approval Failed\",\n \"suggestion\": \"You are trying to withdraw from aave but don't have a balance\"\n },\n \"FW109\": {\n \"info\": \" UniswapV3LimitOrder.constructor() - Router cannot be address zero\",\n \"suggestion\": \"Make sure you are not passing in the zero address when initializing the module\"\n },\n \"FW110\": {\n \"info\": \" UniswapV3LimitOrder.constructor() - Quoter cannot be zero address\",\n \"suggestion\": \"Make sure you are not passing in the zero address when initializing the module\"\n },\n \"FW200\": {\n \"info\": \" FeePercentOracle.setValues() - feepercent must be less than or equals to 100%\",\n \"suggestion\": \"To fix this error, `_feepercent` must be less than or equals to `10 ** _decimals`\"\n },\n \"FW201\": {\n \"info\": \" FeePercentOracle.withdrawEth() - eth transfer failed\",\n \"suggestion\": \"To fix this error, investigate why the eth withdrawal failed. This is likely because `amount` was greater than the eth balance in the FeePercentOracle\"\n },\n \"FW202\": {\n \"info\": \" TokenPriceOracle.getTokenValueOfEth() - chainlink aggregator price must be greater than 0\",\n \"suggestion\": \"To fix this error, retry the call and make sure price is greater than 0\"\n },\n \"FW203\": {\n \"info\": \" TokenPriceOracle.getTokenValueOfEth() - chainlink aggregator updatedAt must be greater than 0\",\n \"suggestion\": \"To fix this error, retry the call and make sure updatedAt is greater than 0\"\n },\n \"FW204\": {\n \"info\": \" TokenPriceOracle.getTokenValueOfEth() - chainlink aggregator answeredInRound must be greater than or equal to roundId\",\n \"suggestion\": \"To fix this error, retry the call and make sure answeredInRound must be greater than or equal to roundId\"\n },\n \"FW205\": {\n \"info\": \" TwitterOracle.batchSetTweet() - socialHandles, loginTypes, seeds, owners length must match in length\",\n \"suggestion\": \"To fix this error, make sure all arrays passed into this function are the same length.\"\n },\n \"FW206\": {\n \"info\": \" TwitterOracle.setTweet() - the seed from twitter cannot be empty\",\n \"suggestion\": \"To fix this error, make sure the seed you post on twitter is not empty {}\"\n },\n \"FW207\": {\n \"info\": \" TwitterOracle.setTweet() - the address from twitter cannot be 0\",\n \"suggestion\": \"To fix this error, make sure the address you post on twitter for the new owner is not the zero address, otherwise you would be unable to claim ownership of the funwallet\"\n },\n \"FW208\": {\n \"info\": \" TwitterOracle.batchSetTweet() - the seed from twitter cannot be empty\",\n \"suggestion\": \"To fix this error, make sure the seed you post on twitter is not empty {}\"\n },\n \"FW209\": {\n \"info\": \" TwitterOracle.batchSetTweet() - the address from twitter cannot be 0\",\n \"suggestion\": \"To fix this error, make sure the address you post on twitter for the new owner is not the zero address, otherwise you would be unable to claim ownership of the funwallet\"\n },\n \"FW210\": {\n \"info\": \" TwitterOracle.fetchTweet() - the seed from twitter cannot be empty\",\n \"suggestion\": \"To fix this error, make sure the seed you post on twitter is not empty {}\"\n },\n \"FW211\": {\n \"info\": \" TwitterOracle.fetchTweet() - the address from twitter cannot be 0\",\n \"suggestion\": \"To fix this error, make sure the address you post on twitter for the new owner is not the zero address, otherwise you would be unable to claim ownership of the funwallet\"\n },\n \"FW300\": {\n \"info\": \" BasePaymaster.constructor() - entrypoint address cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure entrypoint address is not the zero address\"\n },\n \"FW301\": {\n \"info\": \" BasePaymaster.\\\\_requireFromEntryPoint() - the msg.sender must be from the entrypoint\",\n \"suggestion\": \"To fix this error, make sure the msg.sender must be from the entrypoint\"\n },\n \"FW302\": {\n \"info\": \" GaslessPaymaster.batchActions() - the ith delegate call failed\",\n \"suggestion\": \"To fix this error, make sure the calldata for `data[i]` is a valid call\"\n },\n \"FW303\": {\n \"info\": \" GaslessPaymaster.batchActions() - batchActions consumed more eth than `msg.value` allocated\",\n \"suggestion\": \"To fix this error, increase the amount of msg.value you are passing to this function\"\n },\n \"FW304\": {\n \"info\": \" GaslessPaymaster.\\\\_withdrawDepositTo() - the withdrawal has not been unlocked\",\n \"suggestion\": \"To fix this error, wait till block.number is greater than the unlockBlock for the sender and make sure `unlockBlock[sender]` is nonzero\"\n },\n \"FW305\": {\n \"info\": \" GaslessPaymaster.\\\\_withdrawDepositTo() - the balances of the sender must be greater than the withdrawal amount\",\n \"suggestion\": \"To fix this error, decrease the amount you are trying to withdraw\"\n },\n \"FW306\": {\n \"info\": \" GaslessPaymaster.\\\\_validatePaymasterUserOp() - the userOp.paymasterAndData must have a length of 40\",\n \"suggestion\": \"To fix this error, change the `paymasterAndData` field in the `userOp` such that the length is 40\"\n },\n \"FW307\": {\n \"info\": \" GaslessPaymaster.\\\\_validatePaymasterUserOp() - the verificationGasLimit must be greater than the `COST_OF_POST` variable in GaslessPaymaster\",\n \"suggestion\": \"To fix this error, increase the `verificationGasLimit` in the `userOp`\"\n },\n \"FW308\": {\n \"info\": \" GaslessPaymaster.\\\\_validatePaymasterUserOp() - the sponsor's eth is not locked for use\",\n \"suggestion\": \"To fix this error, make sure the sponsor's eth is locked using `lockDeposit()`\"\n },\n \"FW309\": {\n \"info\": \" GaslessPaymaster.\\\\_validatePaymasterUserOp() - The sponsor needs to approve the spender\",\n \"suggestion\": \"To fix this error, make sure to approve the spender using `setSpenderWhitelistMode()` or `setSpenderBlacklistMode()` and the sponsor's list mode is set to whitelist mode or blacklist mode using `setListMode()\"\n },\n \"FW310\": {\n \"info\": \" GaslessPaymaster.\\\\_validatePaymasterUserOp() - The sponsor does not have sufficient eth in the paymaster to cover this operation\",\n \"suggestion\": \"To fix this error, make sure to stake enough eth from the sponsor's address using `addDepositTo()`\"\n },\n \"FW311\": {\n \"info\": \" GaslessPaymaster.addDepositTo() - `msg.value` must be greater than or equal to amount\",\n \"suggestion\": \"To fix this error, make sure `msg.value` must be greater than or equal to amount\"\n },\n \"FW312\": {\n \"info\": \" TokenPaymaster.batchActions() - the ith delegate call failed\",\n \"suggestion\": \"To fix this error, make sure the calldata for `data[i]` is a valid call\"\n },\n \"FW313\": {\n \"info\": \" TokenPaymaster.batchActions() - batchActions consumed more eth than `msg.value` allocated\",\n \"suggestion\": \"To fix this error, increase the amount of msg.value you are passing to this function\"\n },\n \"FW314\": {\n \"info\": \" TokenPaymaster.\\\\_addTokenDepositTo() - token decimals must be greater than 0\",\n \"suggestion\": \"To fix this error, change the decimals in token using `setTokenData()`\"\n },\n \"FW315\": {\n \"info\": \" TokenPaymaster.\\\\_withdrawTokenDepositTo() - token is not unlocked for withdrawal\",\n \"suggestion\": \"To fix this error, call `unlockTokenDepositAfter()`\"\n },\n \"FW316\": {\n \"info\": \" TokenPaymaster.\\\\_withdrawTokenDepositTo() - you are withdrawing more tokens that you have in balance\",\n \"suggestion\": \"To fix this error, call `getTokenBalance()` to check how many tokens you have and make sure `amount` is less than that\"\n },\n \"FW317\": {\n \"info\": \" TokenPaymaster.\\\\_withdrawEthDepositTo() - token is not unlocked for withdrawal\",\n \"suggestion\": \"To fix this error, call `unlockTokenDepositAfter()` with `ETH` as the token\"\n },\n \"FW318\": {\n \"info\": \" TokenPaymaster.\\\\_withdrawEthDepositTo() - you are withdrawing more ether that you have in balance\",\n \"suggestion\": \"To fix this error, call `getTokenBalance()` with `ETH` as the token to check how many tokens you have and make sure `amount` is less than that\"\n },\n \"FW319\": {\n \"info\": \" TokenPaymaster.\\\\_getTokenValueOfEth() - call to token oracle failed\",\n \"suggestion\": \"To fix this error, check the token oracle and call `setTokenData()` to change the oracle if it is broken\"\n },\n \"FW320\": {\n \"info\": \" TokenPaymaster.\\\\_reimbursePaymaster() - failed to reimbursePaymaster with tokens via `permitTransfer()`\",\n \"suggestion\": \"To fix this **error**, make sure you have permitted the paymaster to spend your tokens\"\n },\n \"FW321\": {\n \"info\": \" TokenPaymaster.\\\\_reimbursePaymaster() - spender doesn't have enough tokens\",\n \"suggestion\": \"To fix this error, make sure to add more tokens to the token paymaster via `addTokenDepositTo()`\"\n },\n \"FW322\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - `paymasterAndData` length must be 60\",\n \"suggestion\": \"To fix this error, make sure to set `paymasterAndData` length to be 60\"\n },\n \"FW323\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - `verificationGasLimit` must be greater than `COST_OF_POST`\",\n \"suggestion\": \"To fix this error, make sure to set the userOp's `verificationGasLimit` to be greater than `COST_OF_POST`\"\n },\n \"FW324\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the sponsor must lock their ETH\",\n \"suggestion\": \"To fix this error, make sure the sponsor has locked their eth by calling `lockTokenDeposit()` from the sponsor address\"\n },\n \"FW325\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the account must lock their tokens\",\n \"suggestion\": \"To fix this error, make sure the user of the token paymaster has locked their tokens by calling `lockTokenDeposit()` from their address\"\n },\n \"FW326\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the sponsor eth balance must be greater than maxCost\",\n \"suggestion\": \"To fix this error, make sure the sponsor eth balance is greater than maxCost\"\n },\n \"FW327\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the sponsor must approve the spender\",\n \"suggestion\": \"To fix this error, make sure the sponsor has approved the spender by calling `setSpenderWhitelistMode()` or `setSpenderBlacklistMode()` and the sponsor's list mode is set to whitelist mode or blacklist mode using `setListMode()`\"\n },\n \"FW328\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the sponsor must have approved the token to the paymaster\",\n \"suggestion\": \"To fix this error, make sure the sponsor has approved the spender by calling `setTokenWhitelistMode()` or `setTokenBlacklistMode()` and the sponsor's list mode is set to whitelist mode or blacklist mode using `setTokenListMode()`\"\n },\n \"FW329\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the permitted token must be equal to the token you are trying to pay with if using permit\",\n \"suggestion\": \"To fix this error, make sure the permitted token is equal to the token you are trying to pay with if using permit\"\n },\n \"FW330\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the permitted transfer recipient must be the token paymaster\",\n \"suggestion\": \"To fix this error, make sure to permit the token paymaster to spend your tokens\"\n },\n \"FW331\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the permitted transfer amount must be greater than or equal to the maxTokenCost\",\n \"suggestion\": \"To fix this error, make sure the permitted transfer amount is greater than or equal to the maxTokenCost\"\n },\n \"FW332\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - if permit was not used, make sure the tokenPaymaster was approved to spend tokens by the sponsor or enough tokens were deposited into the TokenPaymaster\",\n \"suggestion\": \"To fix this error, make sure the tokenPaymaster was approved(`approve()`) to spend tokens by the sponsor or enough tokens were deposited into the TokenPaymaster via `addTokenDepositTo()`\"\n },\n \"FW333\": {\n \"info\": \" TokenPaymaster.addEthDepositTo() - make sure msg.value is greater than or equal to amount\",\n \"suggestion\": \"To fix this error, make sure that the msg.value is greater than or equal to amount\"\n },\n \"FW334\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - sponsor cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the sponsor is not the zero address\"\n },\n \"FW335\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - target cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the target is not the zero address\"\n },\n \"FW336\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - token address cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the token address is not the zero address\"\n },\n \"FW337\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - spender address cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the spender address is not the zero address\"\n },\n \"FW338\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - the token oracle cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the token oracle is not the zero address\"\n },\n \"FW339\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - the tokenAddress cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the tokenAddress is not the zero address\"\n },\n \"FW340\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - the token decimals must be greater than 0\",\n \"suggestion\": \"To fix this error, make sure the token decimals is greater than 0\"\n },\n \"FW341\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - the chainlink aggregator cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the chainlink aggregator is not the zero address\"\n },\n \"FW342\": {\n \"info\": \" TokenPaymaster.removeTokenData() - The token doesn't exist in tokens\",\n \"suggestion\": \"To fix this error, make sure the token address is not the zero address\"\n },\n \"FW343\": {\n \"info\": \" TokenPaymaster.removeTokenData() - The tokenListIndex doesn't match with the tokenAddress\",\n \"suggestion\": \"To fix this error, make sure the token at tokenList[tokenListIndex] is the same as the tokenAddress\"\n },\n \"FW344\": {\n \"info\": \" GaslessPaymaster.batchActions() - Cannot recursively call batchActions from within batchActions\",\n \"suggestion\": \"To fix this error, make sure you are not recursively calling batchActions from within batchActions\"\n },\n \"FW345\": {\n \"info\": \" TokenPaymaster.batchActions() - Cannot recursively call batchActions from within batchActions\",\n \"suggestion\": \"To fix this error, make sure you are not recursively calling batchActions from within batchActions\"\n },\n \"FW346\": {\n \"info\": \" TokenPaymaster.postOp() - Invalid Permit transfer amount\",\n \"suggestion\": \"To fix this error, make sure your permit transfer has transfered the correct amount of tokens\"\n },\n \"FW347\": {\n \"info\": \" TokenPaymaster.\\\\_reimbursePaymaster() - Invalid amount of tokens transferred\",\n \"suggestion\": \"The likely cause of this error is using a deflationary token that charges a tax when you transfer tokens. To fix this error, make sure you are transferring the correct amount of tokens and to account for the tax/deflation.\"\n },\n \"FW348\": {\n \"info\": \" UserAuthentication.init() - groupId count must be equal to groups length\",\n \"suggestion\": \"Make sure the number of groupIds equals the number of groups.\"\n },\n \"FW349\": {\n \"info\": \" TokenPaymaster.calculatePostOpGas() - Invalid Auth Type\",\n \"suggestion\": \"Make sure the authtype is correct\"\n },\n \"FW350\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - Does not have enough balance of token\",\n \"suggestion\": \"To fix this error, make sure your has enough tokens to permit transfer\"\n },\n \"FW351\": {\n \"info\": \" BasePaymaster.\\\\withdrawStakeFromEntryPoint() - Cannot withdraw to address zero\",\n \"suggestion\": \"To fix this error, make sure you are not withdrawing to address zero\"\n },\n \"FW401\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"### `FW402`: RoleBasedAccessControl.isValidAction(), isValidActionAndFee() - Invalid Target\"\n },\n \"FW402\": {\n \"info\": \" RoleBasedAccessControl.isValidAction(), isValidActionAndFee() - Invalid Target\",\n \"suggestion\": \"To fix this error, make sure the target that you are calling is in the merkle root of allowed targets verified by the rule. If this does not work make sure you are using the correct merkle root implementation.\"\n },\n \"FW403\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the selector that you are calling is in the merkle root of allowed selector verified by the rule. If this does not work make sure you are using the correct merkle root implementation.\"\n },\n \"FW404\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the ownerId is not 0 or an existing owner\"\n },\n \"FW405\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the ruleId is not 0\"\n },\n \"FW406\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the rule that you are using has a deadline that has passed.\"\n },\n \"FW408\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"### `FW410`: RoleBasedAccessControl: isValidAction(), isValidActionAndFee() - Rule not added to role\"\n },\n \"FW410\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the rule is added to the role\"\n },\n \"FW411\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the value for the execution call is less than the limit\"\n },\n \"FW412\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the fee value for the execution call is less than the limit\"\n },\n \"FW413\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the fee recipient is in the rule fee merkle root\"\n },\n \"FW414\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the fee token is in the rule fee merkle root\"\n },\n \"FW417\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the rule you are using exists\"\n },\n \"FW418\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the user is in the role\"\n },\n \"FW419\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the feeRecipientTokenMerkleRootHash is not zero\"\n },\n \"FW420\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the targetSelectorMerkleRootHash is not zero\"\n },\n \"FW421\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"### `FW422`: RoleBasedAccessControl: init() - Wallet has not been initialized\"\n },\n \"FW422\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the wallet has not initialized the validation contract\"\n },\n \"FW500\": {\n \"info\": \" FunWallet.initialize() - the entrypoint cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the entrypoint is not the zero address\"\n },\n \"FW501\": {\n \"info\": \" FunWallet.initialize() - the msg.sender cannot be the address of the Funwallet contract\",\n \"suggestion\": \"To fix this error, make sure the msg.sender is not the address of the Funwallet contract\"\n },\n \"FW502\": {\n \"info\": \" FunWallet.\\\\_requireFromFunWalletProxy() - the function must be called from the funwallet proxy\",\n \"suggestion\": \"To fix this error, make sure the msg.sender == funwallet\"\n },\n \"FW503\": {\n \"info\": \" FunWallet.updateEntryPoint() - the new entrypoint address cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the new entrypoint address is not the zero address\"\n },\n \"FW504\": {\n \"info\": \" FunWallet.depositToEntryPoint() - not enough eth in the funwallet\",\n \"suggestion\": \"To fix this error, make sure the funwallet has more than the amount of eth you are trying to deposit\"\n },\n \"FW505\": {\n \"info\": \" FunWallet.\\\\_transferEthFromEntrypoint() - withdrawing eth from the entrypoint failed\",\n \"suggestion\": \"To fix this error, retry the operation and make sure you have greater than amount balance in the entrypoint\"\n },\n \"FW506\": {\n \"info\": \" FunWallet.\\\\_requireFromModule() - make sure a funwalletfactory deployed the module\",\n \"suggestion\": \"To fix this error, make sure the msg.sender is the module\"\n },\n \"FW507\": {\n \"info\": \" FunWallet.\\\\_requireFromEntryPoint() - the msg.sender must be the entrypoint\",\n \"suggestion\": \"To fix this error, make sure the msg.sender is the entrypoint\"\n },\n \"FW508\": {\n \"info\": \" WalletFee.\\\\_transferEth() - the eth transfer failed\",\n \"suggestion\": \"To fix this error, retry the operation and make sure you have greater than amount balance in the wallet\"\n },\n \"FW509\": {\n \"info\": \" WalletFee.\\\\_handleFee() - the developer eth transfer failed\",\n \"suggestion\": \"To fix this error, retry the operation and make sure you have greater than amount balance in the wallet\"\n },\n \"FW510\": {\n \"info\": \" WalletFee.\\\\_handleFee() - the funOracle eth transfer failed\",\n \"suggestion\": \"To fix this error, retry the operation and make sure you have greater than amount balance in the wallet\"\n },\n \"FW511\": {\n \"info\": \" WalletValidation.initValidations() - the WalletValidations contract has already been initialized\",\n \"suggestion\": \"Don't call initValidations() more than once\"\n },\n \"FW512\": {\n \"info\": \" WalletValidation.initValidations() - make sure there are more than zero validations\",\n \"suggestion\": \"To fix this error, make sure there are more than zero validations and the number of validation contract addresses are equal to the number of `initCallData` elements\"\n },\n \"FW513\": {\n \"info\": \" WalletValidation.initValidations() - make sure there are no duplicate validation contract addresses\",\n \"suggestion\": \"To fix this error, make sure there are no duplicate validation contract addresses in `validationData`\"\n },\n \"FW514\": {\n \"info\": \" WalletValidation.\\\\_validateUserOp() - make sure the signature length is greater than 0\",\n \"suggestion\": \"To fix this error, make sure the signature length is greater than 0\"\n },\n \"FW515\": {\n \"info\": \" WalletValidation.isValidSignature() - make sure the number of validations is greater than zero\",\n \"suggestion\": \"To fix this error, make sure the number of validations is greater than zero\"\n },\n \"FW516\": {\n \"info\": \" WalletValidation.\\\\_requireValidValidation() - the validation failed\",\n \"suggestion\": \"To fix this error, make sure the validation contract returns true\"\n },\n \"FW517\": {\n \"info\": \" WalletValidation.\\\\_requireValidValidationFormat() - the validation was incorrectly formatted\",\n \"suggestion\": \"To fix this error, make sure the validation contract address is not the zero address and the validation is valid and the address is not the zero address\"\n },\n \"FW518\": {\n \"info\": \" WalletValidation.\\\\_requireValidPrevValidation() - the previous validation must be linked to this validation\",\n \"suggestion\": \"To fix this error, make sure the previous validation is linked to this validation when adding or removing the validation\"\n },\n \"FW519\": {\n \"info\": \" WalletValidation.getValidations() - you must have more than zero validations to get validations\",\n \"suggestion\": \"To fix this error, make sure there are a nonzero amount of validations\"\n },\n \"FW520\": {\n \"info\": \" WalletValidation.addValidation() - The caller must be this wallet.\",\n \"suggestion\": \"To fix this error, make sure you are calling addValidation() from your funwallet.\"\n },\n \"FW521\": {\n \"info\": \" WalletValidation.removeValidation() - The caller must be this wallet.\",\n \"suggestion\": \"To fix this error, make sure you are calling removeValidation() from your funwallet.\"\n },\n \"FW522\": {\n \"info\": \" WalletValidation.updateValidation() - The caller must be this wallet.\",\n \"suggestion\": \"To fix this error, make sure you are calling updateValidation() from your funwallet.\"\n },\n \"FW523\": {\n \"info\": \" WalletModules.permitTransfer() - Invalid Permit Signature.\",\n \"suggestion\": \"To fix this error, make sure you have a valid permit signature.\"\n },\n \"FW524\": {\n \"info\": \" WalletValidation.getValidations() - No Validations in the wallet\",\n \"suggestion\": \"To fix this error, make sure the wallet has validation contracts\"\n },\n \"FW600\": {\n \"info\": \" DataLib\",\n \"suggestion\": \"To fix this error, make sure you are calling either execFromEntryPoint() or execFromEntryPointWithFee() from your funwallet.\"\n },\n \"FW601\": {\n \"info\": \" Ownable2StepNoRenounce\",\n \"suggestion\": \"To fix this error, don't call this function.\"\n }\n}\n", "export type ErrorData = {\n location: string\n error?: {\n txDetails?: ErrorTransactionDetails\n reasonData?: {\n title: string\n reasons: string[]\n }\n }\n}\n\nexport type ErrorTransactionDetails = {\n method: string\n params: any[]\n contractAddress?: string\n chainId?: number | string\n}\n\nexport enum ErrorBaseType {\n ClientError = 'ClientError',\n ServerError = 'ServerError',\n}\n\nexport enum ErrorType {\n InvalidParameter = 'InvalidParameter',\n InternalServerFailure = 'InternalServerFailure',\n ResourceNotFound = 'ResourceNotFound',\n InvalidAction = 'InvalidAction',\n ThrottlingError = 'ThrottlingError',\n AccessDeniedError = 'AccessDeniedError',\n UserOpFailureError = 'UserOpFailureError',\n}\n\nexport enum ErrorCode {\n MissingParameter = 'MissingParameter',\n InvalidParameter = 'InvalidParameter',\n InvalidThreshold = 'InvalidThreshold',\n InvalidChainIdentifier = 'InvalidChainIdentifier',\n InvalidNFTIdentifier = 'InvalidNFTIdentifier',\n InsufficientSignatures = 'InsufficientSignatures',\n InvalidParameterCombination = 'InvalidParameterCombination',\n CheckPointHintsNotFound = 'CheckPointHintsNotFound',\n GroupNotFound = 'GroupNotFound',\n TokenNotFound = 'TokenNotFound',\n AddressNotFound = 'AddressNotFound',\n UserAlreadyExists = 'UserAlreadyExists',\n UserNotFound = 'UserNotFound',\n ChainNotSupported = 'ChainNotSupported',\n ServerMissingData = 'ServerMissingData',\n ServerFailure = 'ServerFailure',\n ServerTimeout = 'ServerTimeout',\n UnknownServerError = 'UnknownServerError',\n ServerConnectionError = 'ServerConnectionError',\n UserOpFailureError = 'UserOpFailureError',\n Unauthorized = 'Unauthorized',\n RequestLimitExceeded = 'RequestLimitExceeded',\n WalletPrefundError = 'PrefundError',\n GasSponsorFundError = 'GasSponsorFundError',\n FunWalletErrorCode = 'FunWalletErrorCode',\n BridgeRouteNotFound = 'BridgeRouteNotFound',\n BridgeAllowanceDataNotFound = 'BridgeAllowanceDataNotFound',\n BridgeApproveTxDataNotFound = 'BridgeApproveTxDataNotFound',\n CheckoutInitDepositAddrNotFound = 'CheckoutInitDepositAddrNotFound',\n}\n", "import { BaseError } from './BaseError'\nimport FWErrors from './errors.json'\nimport { ErrorBaseType, ErrorCode, ErrorType } from './types'\nexport class ClientError extends BaseError {\n constructor(\n type: string,\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorBaseType.ClientError,\n type,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n false,\n )\n }\n}\n\nexport class InvalidParameterError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorType.InvalidParameter,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n}\n\nexport class ResourceNotFoundError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n if (msg.includes('Chain name not found')) {\n const { reqId } = JSON.parse(msg)\n msg = ': Chain name not found or not supported.'\n fixSuggestion = 'Change your EnvOptions to the correct chain identifier.'\n super(\n ErrorType.ResourceNotFound,\n ErrorCode.ChainNotSupported,\n msg,\n { reqId },\n fixSuggestion,\n docLink,\n )\n } else {\n super(\n ErrorType.ResourceNotFound,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n }\n}\n\nexport class InvalidActionError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorType.InvalidAction,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n}\n\nexport class ThrottlingError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorType.ThrottlingError,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n}\n\nexport class AccessDeniedError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorType.AccessDeniedError,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n}\n\nexport class UserOpFailureError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n const FWCode = findFWContractError(msg)\n if (FWCode) {\n const { reqId } = JSON.parse(msg)\n msg = FWErrors[FWCode].info\n fixSuggestion = FWErrors[FWCode].suggestion\n super(\n ErrorType.UserOpFailureError,\n ErrorCode.FunWalletErrorCode,\n msg,\n { reqId },\n fixSuggestion,\n docLink,\n )\n } else {\n super(\n ErrorType.UserOpFailureError,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n }\n}\n\nconst findFWContractError = (msg: string) => {\n let match = msg.match(/FW\\d{3}/)\n if (!match) {\n match = msg.match(/AA\\d./)\n }\n return match?.[0]\n}\n", "import { BaseError } from './BaseError'\nimport { ErrorBaseType, ErrorType } from './types'\n\nexport class ServerError extends BaseError {\n constructor(\n type: string,\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorBaseType.ServerError,\n type,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n true,\n )\n }\n}\n\nexport class InternalFailureError extends ServerError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorType.InternalServerFailure,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n}\n", "import {\n InvalidParameterError,\n ResourceNotFoundError,\n UserOpFailureError,\n} from '../errors'\n\nexport const errorAbortHandler = (err: any, context: any) => {\n if (\n err instanceof ResourceNotFoundError ||\n err instanceof InvalidParameterError ||\n err instanceof UserOpFailureError\n ) {\n context.abort()\n }\n}\n", "import { PartialAttemptOptions } from '@lifeomic/attempt'\n\nimport { errorAbortHandler } from '../utils/error'\n\nexport type BaseResponse = any // TODO:\n\nexport type RetryOptions = PartialAttemptOptions<BaseResponse>\n\nexport const DEFAULT_RETRY_OPTIONS = {\n delay: 100,\n initialDelay: 0,\n maxDelay: 3000,\n factor: 2,\n maxAttempts: 5,\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", "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'\nimport { toHex } from 'viem'\n\nimport { BaseRequest } from '../consts/request'\nimport {\n BaseResponse,\n DEFAULT_RETRY_OPTIONS,\n RetryOptions,\n} from '../consts/retry'\nimport {\n AccessDeniedError,\n ErrorCode,\n InternalFailureError,\n InvalidParameterError,\n ResourceNotFoundError,\n ThrottlingError,\n UserOpFailureError,\n} from '../errors'\nimport {\n DeleteRequest,\n GetRequest,\n PostRequest,\n PutRequest,\n} from './../consts/request'\n\nconst stringifyWithBigIntSanitization = (object: any) => {\n return JSON.stringify(\n object,\n (_, value) => (typeof value === 'bigint' ? toHex(value) : value), // return everything else unchanged\n )\n}\n\nexport const sendRequest = async ({\n uri,\n method,\n apiKey,\n body = {},\n retryOptions = {},\n}: BaseRequest): Promise<BaseResponse> => {\n try {\n const headers = {\n 'Content-Type': 'application/json',\n ...(apiKey ? { 'X-Api-Key': apiKey } : {}),\n }\n\n const finalRetryOptions = {\n ...DEFAULT_RETRY_OPTIONS,\n ...(retryOptions || {}),\n } as RetryOptions\n\n return retry(async function () {\n const response = await fetch(uri, {\n method,\n headers,\n redirect: 'follow',\n body:\n method !== 'GET' ? stringifyWithBigIntSanitization(body) : undefined,\n })\n const json = await response.json()\n if (response.ok) {\n return json\n } else if (response.status === 400) {\n throw new InvalidParameterError(\n ErrorCode.InvalidParameter,\n `bad request ${JSON.stringify(json)}`,\n { body },\n 'check the api call parameters. its mostly because some call parameters are wrong',\n 'https://docs.fun.xyz',\n )\n } else if (response.status === 403) {\n throw new AccessDeniedError(\n ErrorCode.Unauthorized,\n 'Invalid API key or insufficient access.',\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 } else if (response.status === 404) {\n throw new ResourceNotFoundError(\n ErrorCode.ServerMissingData,\n JSON.stringify(json),\n { body },\n 'check the api call parameters. its mostly because some call parameters are wrong',\n 'https://docs.fun.xyz',\n )\n } else if (response.status === 429) {\n throw new ThrottlingError(\n ErrorCode.RequestLimitExceeded,\n `too many requests ${JSON.stringify(json)}`,\n\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 } else if (response.status === 500) {\n if ((json as any).errorCode === ErrorCode.UserOpFailureError) {\n throw new UserOpFailureError(\n ErrorCode.UserOpFailureError,\n JSON.stringify(json),\n { body },\n 'fix user op failure. Most of the time this is due to invalid parameters',\n 'https://docs.fun.xyz',\n )\n } else {\n throw new InternalFailureError(\n ErrorCode.ServerFailure,\n `server failure ${JSON.stringify(json)}`,\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n }\n } else if (response.status === 504) {\n throw new InternalFailureError(\n ErrorCode.ServerTimeout,\n `server timeout failure ${JSON.stringify(json)}`,\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n } else if (!response.ok) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n `unknown server failure ${JSON.stringify(json)}`,\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 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({\n uri,\n apiKey,\n retryOptions,\n}: GetRequest): Promise<BaseResponse> {\n return await sendRequest({\n uri,\n apiKey,\n retryOptions,\n method: 'GET',\n })\n}\n\nexport async function sendPostRequest({\n uri,\n body,\n apiKey,\n retryOptions,\n}: PostRequest): Promise<BaseResponse> {\n return await sendRequest({\n uri,\n apiKey,\n body,\n retryOptions,\n method: 'POST',\n })\n}\n\nexport async function sendDeleteRequest({\n uri,\n apiKey,\n retryOptions,\n}: DeleteRequest): Promise<void> {\n await sendRequest({\n uri,\n method: 'DELETE',\n apiKey,\n retryOptions,\n })\n}\n\nexport async function sendPutRequest({\n uri,\n body,\n apiKey,\n retryOptions,\n}: PutRequest): Promise<BaseResponse> {\n return await sendRequest({\n uri,\n apiKey,\n body,\n retryOptions,\n method: 'PUT',\n })\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport {\n GetAllWalletNFTsByChainIdRequest,\n GetAllWalletNFTsByChainIdResponse,\n GetAllWalletNFTsRequest,\n GetAllWalletNFTsResponse,\n GetAllWalletTokensByChainIdRequest,\n GetAllWalletTokensByChainIdResponse,\n GetAllWalletTokensRequest,\n GetAllWalletTokensResponse,\n GetAssetPriceInfoRequest,\n GetAssetPriceInfoResponse,\n GetWalletLidoWithdrawalsByChainId,\n GetWalletLidoWithdrawalsByChainIdResponse,\n} from './types'\n\n/**===========================================================\n * REFERENCE CORE FILE: /packages/core/src/apis/AssetApis.ts\n * TODO: Remove this comment once migration is complete\n *===========================================================*/\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 */\nexport async function getAssetPriceInfo({\n chainId,\n assetTokenAddress,\n apiKey,\n}: GetAssetPriceInfoRequest): Promise<GetAssetPriceInfoResponse> {\n const priceInfo = await sendGetRequest({\n uri: `${API_BASE_URL}/asset/erc20/price/${chainId}/${assetTokenAddress}`,\n apiKey,\n retryOptions: { maxAttempts: 2 },\n })\n return priceInfo\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 */\nexport async function getAllWalletTokens({\n walletAddress,\n onlyVerifiedTokens,\n apiKey,\n}: GetAllWalletTokensRequest): Promise<GetAllWalletTokensResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/erc20s/${walletAddress}?onlyVerifiedTokens=${onlyVerifiedTokens}`,\n apiKey,\n retryOptions: { maxAttempts: 2 },\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 apiKey,\n}: GetAllWalletTokensByChainIdRequest): Promise<GetAllWalletTokensByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/erc20s/${walletAddress}/${chainId}?onlyVerifiedTokens=${onlyVerifiedTokens}`,\n apiKey,\n retryOptions: { maxAttempts: 2 },\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 apiKey,\n}: GetAllWalletNFTsRequest): Promise<GetAllWalletNFTsResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/nfts/${walletAddress}`,\n apiKey,\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 apiKey,\n}: GetAllWalletNFTsByChainIdRequest): Promise<GetAllWalletNFTsByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/nfts/${walletAddress}/${chainId}`,\n apiKey,\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 apiKey,\n}: GetWalletLidoWithdrawalsByChainId): Promise<GetWalletLidoWithdrawalsByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/lido-withdrawals/${walletAddress}/${chainId}`,\n apiKey,\n })\n}\n", "import Big from 'big.js'\nimport { Address } from 'viem'\n\nimport { API_BASE_URL } from '../../consts'\nimport { ErrorCode, ResourceNotFoundError } from '../../errors'\nimport {\n generateRandomCheckoutSalt,\n roundToNearestBottomTenth,\n sendGetRequest,\n sendPostRequest,\n} from '../../utils'\nimport {\n CheckoutApiInitParams,\n CheckoutApiQuoteParams,\n CheckoutApiQuoteResponse,\n CheckoutDeactivateParams,\n CheckoutHistoryItem,\n CheckoutInitParams,\n CheckoutInitResponse,\n CheckoutQuoteParams,\n CheckoutQuoteResponse,\n CheckoutState,\n CheckoutTransferSponsorshipApiParams,\n CheckoutTransferSponsorshipParams,\n CheckoutTransferSponsorshipResponse,\n} from './types'\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 expirationTimestampMs The amount of time (duration) from now before the checkout operation expires.\n * @param apiKey A valid fun api key.\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 expirationTimestampMs,\n sponsorInitialTransferGasLimit,\n recipientAddr,\n needsRefuel,\n userId,\n apiKey,\n}: CheckoutQuoteParams): Promise<CheckoutQuoteResponse> {\n try {\n const toMultipler = 10 ** toTokenDecimals\n const toAmountBaseUnitBI = BigInt(Math.floor(toTokenAmount * toMultipler))\n const queryParams = {\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() + expirationTimestampMs) / 1000),\n ).toString(),\n sponsorInitialTransferGasLimit,\n // @deprecated Not in use\n refuel: needsRefuel.toString(),\n } as CheckoutApiQuoteParams\n\n const searchParams = new URLSearchParams(queryParams)\n const quoteRes = (await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/quote?${searchParams}`,\n apiKey,\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 // 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 } as CheckoutQuoteResponse\n } catch (err: any) {\n throw new Error(\n `An error occured trying to generate a checkout quote: ${err.message}`,\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 apiKey,\n clientMetadata,\n}: CheckoutInitParams): Promise<Address> {\n const body = {\n ...(userOp ? { userOp } : {}),\n quoteId,\n sourceOfFund,\n salt: generateRandomCheckoutSalt(),\n clientMetadata,\n } as CheckoutApiInitParams\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/checkout`,\n body,\n apiKey,\n })\n if (!res?.depositAddr) {\n throw new ResourceNotFoundError(\n ErrorCode.CheckoutInitDepositAddrNotFound,\n 'Unable to initialize checkout',\n body,\n '',\n 'https://docs.fun.xyz',\n )\n }\n return res.depositAddr as CheckoutInitResponse\n}\n\nexport async function deactivateCheckout({\n depositAddress,\n apiKey,\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 apiKey,\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 * @returns The checkout object if exists. Otherwise, null.\n */\nexport async function getCheckoutByDepositAddress({\n depositAddress,\n apiKey,\n}: {\n depositAddress: Address\n apiKey: string\n}): Promise<CheckoutHistoryItem | null> {\n try {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/${depositAddress}`,\n apiKey,\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 * @returns A list of checkout objects if exists. Otherwise, an empty array.\n */\nexport async function getCheckoutsByFunWalletAddress({\n funWalletAddress,\n apiKey,\n}: {\n funWalletAddress: Address\n apiKey: string\n}): Promise<CheckoutHistoryItem[]> {\n const res = await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/fun-wallet/${funWalletAddress}`,\n apiKey,\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 * @returns A list of checkout objects if exists. Otherwise, an empty array.\n */\nexport async function getCheckoutsByRecipientAddress({\n recipientAddress,\n apiKey,\n}: {\n recipientAddress: Address\n apiKey: string\n}): Promise<CheckoutHistoryItem[]> {\n const res = await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/recipient/${recipientAddress}`,\n apiKey,\n })\n return res || []\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 * @returns A list of checkout objects if exists. Otherwise, an empty array.\n */\nexport async function getCheckoutsByUserId({\n userId,\n apiKey,\n}: {\n userId: string\n apiKey: string\n}): Promise<CheckoutHistoryItem[]> {\n const res = await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/userId/${userId}`,\n apiKey,\n })\n return res || []\n}\n\nexport async function getPaymasterDataForCheckoutSponsoredTransfer({\n depositAddress,\n transferUserOp,\n apiKey,\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 apiKey,\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", "/**===============*\n * CHECKOUT QUOTE *\n *================*/\nimport { Address, Hex } from 'viem'\n\n// TODO: Define the UserOperation type\ntype UserOperation = any\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 checkoutExpirationTimestampSeconds: string\n sponsorInitialTransferGasLimit: string\n refuel: string\n userId: string\n recipientAddr?: Address\n}\n\nexport type CheckoutQuoteParams = Omit<\n CheckoutApiQuoteParams,\n 'toAmountBaseUnit' | 'checkoutExpirationTimestampSeconds' | 'refuel'\n> & {\n fromTokenDecimals: number\n toTokenDecimals: number\n toTokenAmount: number\n expirationTimestampMs: number\n needsRefuel: boolean\n apiKey: string\n}\n\n// The response of the actual /checkout/quote api\nexport type CheckoutApiQuoteResponse = {\n quoteId: string\n estTotalFromAmountBaseUnit: string\n estSubtotalFromAmountBaseUnit: string\n estFeesFromAmountBaseUnit: string\n fromTokenAddress: Address\n estFeesUsd: number\n estSubtotalUsd: number\n estTotalUsd: number\n estCheckoutTimeMs: number\n}\n\n// The formatted response quote interface from the core sdk\nexport type CheckoutQuoteResponse = CheckoutApiQuoteResponse & {\n estTotalFromAmount: string\n estSubtotalFromAmount: string\n estFeesFromAmount: string\n}\n\n/**===============*\n * CHECKOUT INIT *\n *================*/\n\nexport type CheckoutApiInitParams = {\n userOp?: UserOperation\n quoteId: string\n sourceOfFund: string\n salt: Hex\n clientMetadata: object\n}\n\nexport type CheckoutInitParams = Omit<CheckoutApiInitParams, 'salt'> & {\n apiKey: string\n}\n\nexport type CheckoutInitResponse = Address\n\n/**=====================*\n * CHECKOUT DEACTIVATE *\n *======================*/\n\nexport type CheckoutDeactivateParams = {\n depositAddress: Address\n apiKey: string\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\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 clientMetadata: object\n}\n\n/**===============================*\n * CHECKOUT TRANSFER SPONSORSHIP *\n *================================*/\n\nexport type CheckoutTransferSponsorshipParams = {\n transferUserOp: UserOperation\n depositAddress: Address\n apiKey: string\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", "import { FUN_FAUCET_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport { GetAssetFromFaucetRequest } from './types'\n\nexport async function getAssetFromFaucet({\n token,\n chain,\n walletAddress,\n apiKey,\n}: GetAssetFromFaucetRequest) {\n return await sendGetRequest({\n uri: `${FUN_FAUCET_URL}/get-faucet?token=${token}&testnet=${chain}&addr=${walletAddress}`,\n apiKey,\n })\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport {\n GetCryptocurrencyHoldingsRequest,\n GetLinkTokenRequest,\n GetLinkTokenResponse,\n GetTransferIntegrationsRequest,\n GetTransferIntegrationsResponse,\n MeshExecuteTransferRequest,\n MeshExecuteTransferResponse,\n PreviewTransferRequest,\n} from './types'\n\n/**\n * @param authToken The authentication token to send the asset from.\n * @param type The type of the integration to send the asset from.\n * @return https://docs.meshconnect.com/reference/post_api-v1-holdings-get\n */\nexport async function meshGetCryptocurrencyHoldings({\n authToken,\n type,\n apiKey,\n}: GetCryptocurrencyHoldingsRequest): Promise<any> {\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/mesh/holdings/get`,\n body: { authToken, type },\n apiKey,\n })\n return res\n}\n\n/**\n * @return https://docs.meshconnect.com/reference/get_api-v1-transfers-managed-integrations\n */\nexport async function meshGetTransferIntegrations({\n apiKey,\n}: GetTransferIntegrationsRequest): Promise<GetTransferIntegrationsResponse> {\n const res = await sendGetRequest({\n uri: `${API_BASE_URL}/mesh/transfers/managed/integrations`,\n apiKey,\n })\n return res\n}\n\n/**\n * @param userId A unique Id representing the end user. Typically this will be a user Id from the\nclient application. Personally identifiable information, such as an email address or phone number,\nshould not be used. 50 characters length maximum.\n * @param integrationId A unique identifier representing a specific integration obtained from the list of available integrations.\n * @param restrictMultipleAccounts The final screen of Link allows users to \u201Ccontinue\u201D back to your app or \u201CLink another account.\u201D\nIf this param is present then this button will be hidden.\n * @param transferOptions Encapsulates transaction-related parameters, including destination addresses and the amount to transfer in fiat currency.\n * @return https://docs.meshconnect.com/reference/post_api-v1-linktoken\n */\nexport async function meshGetLinkToken({\n userId,\n integrationId,\n restrictMultipleAccounts,\n transferOptions,\n apiKey,\n}: GetLinkTokenRequest): Promise<GetLinkTokenResponse> {\n let body: any = { userId }\n if (integrationId) {\n body = { ...body, integrationId }\n }\n if (restrictMultipleAccounts) {\n body = { ...body, restrictMultipleAccounts }\n }\n if (transferOptions) {\n body = { ...body, transferOptions }\n }\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/mesh/linktoken`,\n body,\n apiKey,\n })\n return res\n}\n\n/**\n * @param fromAuthToken The authentication token to send the asset from.\n * @param fromType The type of the integration to send the asset from.\n * @param toAuthToken The authentication token of the target integration. Can be used alternatively to the address in the ToAddress field. If used, toType should also be provided.\n * @param toType The type of the target integration to send assets to. Used along with the toAuthToken alternatively to ToAddress.\n * @param networkId The network to send the asset over. This is generated by Mesh, it isn't a chainId or chain name.\n * @param symbol The symbol of the digital asset to send.\n * @param toAddress The target address to send the asset to.\n * @param amount The amount to send, in crypto.\n * @param amountInFiat The amount to send, in fiat currency. Can be used alternatively to Amount.\n * @param fiatCurrency Fiat currency that is to get corresponding converted fiat values of transfer and fee amounts. If not provided, defaults to USD.\n * @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-preview\n */\nexport async function meshPreviewTransfer({\n fromAuthToken,\n fromType,\n toAuthToken,\n toType,\n networkId,\n symbol,\n toAddress,\n amount,\n amountInFiat,\n fiatCurrency,\n apiKey,\n}: PreviewTransferRequest): Promise<any> {\n let body: any = { fromAuthToken, fromType }\n if (toAuthToken) {\n body = { ...body, toAuthToken }\n }\n if (toType) {\n body = { ...body, toType }\n }\n if (networkId) {\n body = { ...body, networkId }\n }\n if (symbol) {\n body = { ...body, symbol }\n }\n if (toAddress) {\n body = { ...body, toAddress }\n }\n if (amount) {\n body = { ...body, amount }\n }\n if (amountInFiat) {\n body = { ...body, amountInFiat }\n }\n if (fiatCurrency) {\n body = { ...body, fiatCurrency }\n }\n\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/mesh/transfers/managed/preview`,\n body,\n apiKey,\n retryOptions: { maxAttempts: 1 },\n })\n return res\n}\n/**\n *\n * @param fromAuthToken The authentication token to send the asset from.\n * @param fromType The type of the integration to send the asset from.\n * @param previewId The preview ID of the transfer to execute.\n * @param mfaCode Multi-factor auth code that should be provided if the status of the transfer was MfaRequired.\n * @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-execute\n */\nexport async function meshExecuteTransfer({\n fromAuthToken,\n fromType,\n previewId,\n mfaCode,\n apiKey,\n}: MeshExecuteTransferRequest): Promise<MeshExecuteTransferResponse> {\n let body: any = { fromAuthToken, fromType, previewId }\n if (mfaCode) {\n body = { ...body, mfaCode }\n }\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/mesh/transfers/managed/execute`,\n body,\n apiKey,\n })\n return res\n}\n", "export interface GetCryptocurrencyHoldingsRequest {\n authToken: string\n type: string\n apiKey: string\n}\n\nexport interface GetTransferIntegrationsRequest {\n apiKey: string\n}\n\nexport interface IntegrationNetworkInfo {\n chainId: string\n id: string\n logoUrl: string\n name: string\n nativeSymbol: string\n supportedTokens: string[]\n}\n\nexport interface TransferIntegration {\n networks: IntegrationNetworkInfo[]\n supportsIncomingTransfers: boolean\n supportsOutgoingTransfers: boolean\n type: string\n}\n\nexport interface GetTransferIntegrationsResponse {\n integrations: TransferIntegration[]\n}\n\nexport interface GetLinkTokenRequest {\n userId: string\n integrationId?: string | null\n restrictMultipleAccounts?: boolean\n transferOptions?: any | null\n apiKey: string\n}\n\nexport interface GetLinkTokenResponse {\n linkToken: string\n}\n\nexport interface PreviewTransferRequest {\n apiKey: string\n fromAuthToken: string\n fromType: string\n toAuthToken?: string | null\n toType?: string | null\n networkId?: string\n symbol?: string | null\n toAddress?: string | null\n amount?: string | null\n amountInFiat?: string | null\n fiatCurrency?: string | null\n}\n\nexport interface MeshExecuteTransferRequest {\n apiKey: string\n fromAuthToken: string\n fromType: string\n previewId: string\n mfaCode?: string | null\n}\n\n// Reference: https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-execute\nexport enum MeshExecuteTransferStatus {\n succeeded = 'succeeded',\n failed = 'failed',\n mfaRequired = 'mfaRequired',\n emailConfirmationRequired = 'emailConfirmationRequired',\n deviceConfirmationRequired = 'deviceConfirmationRequired',\n mfaFailed = 'mfaFailed',\n addressWhitelistRequired = 'addressWhitelistRequired',\n secondMfaRequired = 'secondMfaRequired',\n}\n\nexport enum MeshExecuteTransferMfaType {\n unspecified = 'unspecified',\n phone = 'phone',\n email = 'email',\n otp = 'otp',\n}\n\nexport interface MeshExecuteTransferContent {\n status: MeshExecuteTransferStatus\n mfaType: MeshExecuteTransferMfaType\n errorMessage: string | null\n executeTransferResult: object | null\n}\n\nexport interface MeshExecuteTransferResponse {\n status: MeshExecuteTransferStatus\n mfaType: MeshExecuteTransferMfaType\n errorMessage: string | null\n executeTransferResult: object | null\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { ErrorCode, InternalFailureError } from '../../errors'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport {\n GetMoonpayBuyQuoteForCreditCardRequest,\n GetMoonpayOffRampUrlRequest,\n GetMoonpayOnRampUrlRequest,\n GetMoonpayUrlSignatureRequest,\n MoonpayCurrency,\n} from './types'\n\nexport async function getMoonpayUrlSignature({\n url,\n isSandbox,\n apiKey,\n}: GetMoonpayUrlSignatureRequest): Promise<string> {\n const signature = await sendPostRequest({\n uri: `${API_BASE_URL}/on-ramp/moonpay-signature/`,\n body: { url, isSandbox },\n apiKey,\n })\n if (!signature || !signature?.url) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n 'No onramp url found.',\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 apiKey,\n}: GetMoonpayBuyQuoteForCreditCardRequest): Promise<any> {\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 const res = await sendGetRequest({\n uri: `${API_BASE_URL}/on-ramp/moonpay-buy-quote?${params}`,\n apiKey,\n retryOptions: { maxAttempts: 1 },\n })\n return res\n}\n\n/**=======================\n * POTENTIAL DEPRECATION\n *=======================*/\n\nexport async function getMoonpayOnRampUrl({\n apiKey,\n walletAddr,\n currencyCode,\n}: GetMoonpayOnRampUrlRequest): Promise<string> {\n const endpoint = `on-ramp/${walletAddr}?provider=moonpay`\n if (currencyCode) {\n endpoint.concat(`&currencyCode=${currencyCode}`)\n }\n const url: string = (\n await sendGetRequest({\n uri: `${API_BASE_URL}/${endpoint}`,\n apiKey,\n })\n )?.url\n if (!url) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n 'No onramp url found.',\n { walletAddr },\n 'This is an internal error, please contact support.',\n 'https://docs.fun.xyz',\n )\n }\n return url\n}\n\nexport async function getMoonpayOffRampUrl({\n walletAddr,\n apiKey,\n}: GetMoonpayOffRampUrlRequest): Promise<string> {\n const url: string = (\n await sendGetRequest({\n uri: `${API_BASE_URL}/off-ramp/${walletAddr}?provider=moonpay`,\n apiKey,\n })\n )?.url\n if (!url) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n 'No offramp url found.',\n { walletAddr },\n 'This is an internal error, please contact support.',\n 'https://docs.fun.xyz',\n )\n }\n return url\n}\n\nexport async function getMoonpayOnRampSupportedCurrencies({\n apiKey,\n}: {\n apiKey: string\n}): Promise<MoonpayCurrency[]> {\n const currencies: MoonpayCurrency[] = await sendGetRequest({\n uri: `${API_BASE_URL}/on-ramp/moonpay-currencies`,\n apiKey,\n })\n if (!currencies || !currencies.length) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n 'No supported currencies found.',\n {},\n 'This is an internal error, please contact support.',\n 'https://docs.fun.xyz',\n )\n }\n return currencies\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport {\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 apiKey,\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 apiKey,\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 apiKey,\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 apiKey,\n })\n return newBuySessionResp as CreateStripeBuySessionResponse\n}\n\nexport async function getStripeBuySession({\n sessionId,\n apiKey,\n}: {\n sessionId: string\n apiKey: 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 apiKey,\n })\n return buySessionResp as CreateStripeBuySessionResponse\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendPostRequest } from '../../utils'\nimport { SendSupportMessageRequest } from './types'\n\nexport async function sendSupportMessage({\n title,\n description,\n userEmail,\n apiKey,\n}: SendSupportMessageRequest): Promise<boolean> {\n try {\n await sendPostRequest({\n uri: `${API_BASE_URL}/support/send-message`,\n body: { title, description, userEmail },\n apiKey,\n retryOptions: { maxAttempts: 1 },\n })\n return true\n } catch (err) {\n return false\n }\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendPostRequest } from '../../utils'\nimport {\n CreateTurnkeyPrivateKeyRequest,\n CreateTurnkeyPrivateKeyResponse,\n CreateTurnkeySubOrgRequest,\n} from './types'\n\nexport async function createTurnkeySubOrg({\n createSubOrgRequest,\n apiKey,\n}: CreateTurnkeySubOrgRequest): Promise<string> {\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/turnkey/sub-org`,\n body: createSubOrgRequest,\n apiKey,\n })\n return res\n}\n\nexport async function createTurnkeyPrivateKey({\n signedRequest,\n apiKey,\n}: CreateTurnkeyPrivateKeyRequest): Promise<CreateTurnkeyPrivateKeyResponse> {\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/turnkey/private-key`,\n body: signedRequest,\n apiKey,\n })\n return {\n id: res.id,\n address: res.address,\n }\n}\n"],
5
- "mappings": ";AAAO,IAAM,eACX,QACI,mCACA,QACA,mCACA,QACA;AAAA;AAAA,EAEA;AAAA;AAEC,IAAM,iBAAiB;;;ACV9B,IAAM,UAAU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,EACA;AACF,GAAgD;AAC9C,MAAI;AACF,UAAM,gBAAgB;AAAA,MACpB,KAAK,GAAG,YAAY;AAAA,MACpB,MAAM,EAAE,OAAO,aAAa,UAAU;AAAA,MACtC;AAAA,MACA,cAAc,EAAE,aAAa,EAAE;AAAA,IACjC,CAAC;AACD,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,WAAO;AAAA,EACT;AACF;;;ACbA,eAAsB,oBAAoB;AAAA,EACxC;AAAA,EACA;AACF,GAAgD;AAC9C,QAAM,MAAM,MAAM,gBAAgB;AAAA,IAChC,KAAK,GAAG,YAAY;AAAA,IACpB,MAAM;AAAA,IACN;AAAA,EACF,CAAC;AACD,SAAO;AACT;AAEA,eAAsB,wBAAwB;AAAA,EAC5C;AAAA,EACA;AACF,GAA6E;AAC3E,QAAM,MAAM,MAAM,gBAAgB;AAAA,IAChC,KAAK,GAAG,YAAY;AAAA,IACpB,MAAM;AAAA,IACN;AAAA,EACF,CAAC;AACD,SAAO;AAAA,IACL,IAAI,IAAI;AAAA,IACR,SAAS,IAAI;AAAA,EACf;AACF;",
3
+ "sources": ["../src/consts/api.ts", "../src/errors/BaseError.ts", "../src/errors/errors.json", "../src/errors/types.ts", "../src/errors/ClientError.ts", "../src/errors/ServerError.ts", "../src/utils/error.ts", "../src/consts/retry.ts", "../src/utils/checkout.ts", "../src/utils/request.ts", "../src/services/assets/endpoints.ts", "../src/services/checkout/endpoints.ts", "../src/services/checkout/types.ts", "../src/services/faucet/endpoints.ts", "../src/services/mesh/endpoints.ts", "../src/services/mesh/types.ts", "../src/services/moonpay/endpoints.ts", "../src/services/stripe/endpoints.ts", "../src/services/support/endpoints.ts"],
4
+ "sourcesContent": ["export const API_BASE_URL =\n process.env.NODE_ENV === 'staging'\n ? 'https://api.fun.xyz/staging/v1'\n : process.env.NODE_ENV === 'testing'\n ? 'https://api.fun.xyz/testing/v1'\n : process.env.NODE_ENV === 'local'\n ? 'http://127.0.0.1:3000'\n : // Production\n 'https://api.fun.xyz/v1'\n\nexport const FUN_FAUCET_URL = 'https://api.fun.xyz/demo-faucet'\n", "const discord = 'https://discord.gg/mvQunrx6NG'\nexport class BaseError extends Error {\n timestamp: string\n\n constructor(\n public baseType: string,\n public type: string,\n public code: string,\n msg: string,\n\n public paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n isInternal = false,\n ) {\n super(`${msg}\\n\\n${fixSuggestion}\\nDocs: ${docLink}\\nDiscord: ${discord}`)\n if (isInternal) {\n this.loadEnd()\n }\n this.message += '\\n\\nTrace:'\n this.timestamp = new Date().toUTCString()\n }\n\n loadEnd() {\n this.message +=\n '\\n\\nThis is an internal sdk error. Please contact the fun team at our Discord for the fastest response.'\n }\n}\n", "{\n \"AA21\": {\n \"info\": \" Your wallet lacks funds for this transaction.\",\n \"suggestion\": \"To fix this error, make sure you have enough funds in your wallet to cover the transaction fee.\"\n },\n \"FW000\": {\n \"info\": \" Create3Deployer.requireDeployerOnly() - Signatures were not sorted before being passed in\",\n \"suggestion\": \"To fix this error, make sure to short sigs before passing them into `requireDeployerOnly`. You can do this by calling `sigs.sort()` before passing them in. It is also possible to run into this error if the hash that was signed was not the correct hash.\"\n },\n \"FW001\": {\n \"info\": \" Create3Deployer.requireDeployerOnly() - Signature failed to be recovered. ercrecover returned the zero address\",\n \"suggestion\": \"To fix this error, make sure to pass in enough valid signatures that sign the `hash` in the `sigs` array\"\n },\n \"FW002\": {\n \"info\": \" Create3Deployer.addDeployer() - Invalid Hash\",\n \"suggestion\": \"To fix this error, make sure `hash` is equal to `hashAddDeployer()`\"\n },\n \"FW003\": {\n \"info\": \" Create3Deployer.removeDeployer() - Invalid Hash\",\n \"suggestion\": \"To fix this error, make sure `hash` is equal to `hashRemoveDeployer()`\"\n },\n \"FW004\": {\n \"info\": \" Create3Deployer.setThreshold() - Threshold must be greater than 1\",\n \"suggestion\": \"To fix this error, `threshold` is greater than 1\"\n },\n \"FW005\": {\n \"info\": \" Create3Deployer.setThreshold() - Invalid Hash\",\n \"suggestion\": \"To fix this error, make sure `hash` is equal to `keccak256(abi.encodePacked(_threshold))`\"\n },\n \"FW006\": {\n \"info\": \" Create3Deployer.callChild() - Invalid Hash\",\n \"suggestion\": \"To fix this error, make sure `hash` is equal to `keccak256(abi.encodePacked(child, data, _nonce, block.chainid))`\"\n },\n \"FW007\": {\n \"info\": \" Create3Deployer.callChild() - Invalid Nonce, nonce must be 1 greater than the current nonce\",\n \"suggestion\": \"To fix this error, make sure `_nonce` is equal to the current nonce + 1\"\n },\n \"FW008\": {\n \"info\": \" Create3Deployer.callChild() - call to child failed\",\n \"suggestion\": \"To fix this error, check to see what is making the call to the child fail\"\n },\n \"FW009\": {\n \"info\": \" Create3Deployer.deploy() - Invalid Hash\",\n \"suggestion\": \"To fix this error, make sure `hash` is equal to `keccak256(abi.encodePacked(_salt, _creationCode))`\"\n },\n \"FW010\": {\n \"info\": \" FunWalletFactory.constructor() - Invalid Address, cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_deployer` is not equal to the zero address\"\n },\n \"FW011\": {\n \"info\": \" FunWalletFactory.constructor() - Invalid Address, cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_funWalletImpAddress` is not equal to the zero address\"\n },\n \"FW012\": {\n \"info\": \" FunWalletFactory.constructor() - Invalid Address, cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_feeOracle` is not equal to the zero address\"\n },\n \"FW013\": {\n \"info\": \" FunWalletFactory.constructor() - Invalid Address, cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_walletInit` is not equal to the zero address\"\n },\n \"FW014\": {\n \"info\": \" FunWalletFactory.constructor() - Unable to generate the address from this deployerSalt\",\n \"suggestion\": \"To fix this error, make sure `FunWalletFactoryV1` has not already been deployed from the given create3deployer contract. If it has been, change `FunWalletFactoryV1` to `FunWalletFactoryV2` or another version.\"\n },\n \"FW015\": {\n \"info\": \" FunWalletFactory.constructor() - Generated the wrong address from this deployerSalt\",\n \"suggestion\": \"To fix this error, make sure `FunWalletFactoryV1` has not already been deployed from the given create3deployer contract. If it has been, change `FunWalletFactoryV1` to `FunWalletFactoryV2` or another version.\"\n },\n \"FW016\": {\n \"info\": \" FunWalletFactory.createAccount() - Call to initialize failed on the deployed proxy\",\n \"suggestion\": \"To fix this error, make sure the `initializerCallData` is formatted correctly\"\n },\n \"FW017\": {\n \"info\": \" FunWalletFactory - Caller must be deployer\",\n \"suggestion\": \"To fix this error, make sure to call the function from the deployer address\"\n },\n \"FW018\": {\n \"info\": \" WalletInit.commit() - The previous commit has not expired\",\n \"suggestion\": \"To fix this error, wait for the previous commit with this `commitKey` to expire. This should take at most 10 minutes.\"\n },\n \"FW019\": {\n \"info\": \" WalletInit.validateSalt() - The hash at the commitKey does not match `keccak256(abi.encode(seed, owner, initializerCallData))`\",\n \"suggestion\": \"To fix this error, make sure the seed, owner, and initializerCallData are hashed and stored in commits at the corresponding `commitKey`\"\n },\n \"FW020\": {\n \"info\": \" WalletInit.validateSalt() - The new owner of the funwallet must match data.newFunWalletOwner from loginData\",\n \"suggestion\": \"To fix this error, make sure the owner set in `loginData` matches the owner address returned from the tweet.\"\n },\n \"FW021\": {\n \"info\": \" WalletInit.setOracle() - The address of the new `_oracle` must not be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_oracle` is not the zero address\"\n },\n \"FW022\": {\n \"info\": \" Create3Deployer.deployFromChild() - Invalid Child Address\",\n \"suggestion\": \"To fix this error, make sure the caller is a contract deployed from the Create3Deployer\"\n },\n \"FW023\": {\n \"info\": \" ImplementationRegistry.verifyIsValidContractAndImplementation() - Invalid Target Code Hash\",\n \"suggestion\": \"To fix this error, make sure the caller is a contract targeted is a ERC1967ProxyData contract\"\n },\n \"FW024\": {\n \"info\": \" ImplementationRegistry.verifyIsValidContractAndImplementation() - Invalid Contract Implementation Address\",\n \"suggestion\": \"To fix this error, make sure you have the minimun threshold amount of valid signatures.\"\n },\n \"FW025\": {\n \"info\": \" ImplementationRegistry.addImplementation() - Invalid Signature Amount\",\n \"suggestion\": \"To fix this error, make sure you have the minimun threshold amount of valid signatures.\"\n },\n \"FW026\": {\n \"info\": \" ImplementationRegistry.removeImplementation() - Invalid Signature Amount\",\n \"suggestion\": \"To fix this error, make sure you have the minimun threshold amount of valid signatures.\"\n },\n \"FW027\": {\n \"info\": \" WalletInit.commit() - Unable to commit with a previously used commit hash\",\n \"suggestion\": \"To fix this error, make sure you are not reusing someone else's commit hash. If there are conflicts, just regenerate the seed randomly\"\n },\n \"FW028\": {\n \"info\": \" MultiSigDeployer.constructor() - Threshold can't be greater than deployers length\",\n \"suggestion\": \"To fix this error, make sure the threshold value is not 0\"\n },\n \"FW029\": {\n \"info\": \" WalletInit.invalidateUsedSeed() - msg.sender must equal funwalletfactory\",\n \"suggestion\": \"To fix this error, make sure you are calling this function from the FunWalletFactory contract\"\n },\n \"FW030\": {\n \"info\": \" WalletInit.setFunWalletFactory() - funwalletfactory address cannot be set to 0\",\n \"suggestion\": \"To fix this error, make sure you are passing in the valid funwalletfactory address\"\n },\n \"FW031\": {\n \"info\": \" WalletInit.validateSalt() - seed has already been used\",\n \"suggestion\": \"To fix this error, make sure you are not using an existing salt\"\n },\n \"FW032\": {\n \"info\": \" FunWalletFactory.setFeeOracle() - Cannot set the fee oracle address to 0\",\n \"suggestion\": \"To fix this error, make sure you are using the correct address of the fee oracle\"\n },\n \"FW033\": {\n \"info\": \" FunWalletFactory.constructor() - Invalid Address, cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_entryPoint` is not equal to the zero address\"\n },\n \"FW034\": {\n \"info\": \" Create3Deployer.callChild() - Value not equal to msg.value\",\n \"suggestion\": \"To fix this error, make sure `msg.value` is equal to the `value` parameter.\"\n },\n \"FW100\": {\n \"info\": \" Module.execute() - execute() needs to be overriden\",\n \"suggestion\": \"To fix this error, make sure you are overriding the execute method in your module\"\n },\n \"FW101\": {\n \"info\": \" ApproveAndExec.approveAndExecute() - the approveData's first four bytes must be the approve() function selector\",\n \"suggestion\": \"To fix this error, change `approveData` such that the first four bytes are `bytes4(keccak256('approve(address,uint256)'))`\"\n },\n \"FW102\": {\n \"info\": \" ApproveAndSwap.constructor() - `_wethAddr` cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_wethAddr` is not set to the zero address\"\n },\n \"FW103\": {\n \"info\": \" ApproveAndSwap.constructor() - `_router` cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure `_router` is not set to the zero address\"\n },\n \"FW104\": {\n \"info\": \" ApproveAndSwap.executeSwapEth() - msg.sender does not have enough weth\",\n \"suggestion\": \"To fix this error, make sure msg.sender has a weth balance >= `amount`\"\n },\n \"FW105\": {\n \"info\": \" ApproveAndSwap.\\\\_internalSwap() - Approve failed\",\n \"suggestion\": \"To fix this error, make sure you have formatted approve correctly\"\n },\n \"FW106\": {\n \"info\": \" AaveWithdraw.execute() - Withdrawing a zero balance\",\n \"suggestion\": \"You are trying to withdraw from aave but don't have a balance\"\n },\n \"FW107\": {\n \"info\": \" ApproveAndExec.approveAndExecute() - Approve failed\",\n \"suggestion\": \"The token you tried to approve failed\"\n },\n \"FW108\": {\n \"info\": \" UniswapV3LimitOrder.execute() - Approval Failed\",\n \"suggestion\": \"You are trying to withdraw from aave but don't have a balance\"\n },\n \"FW109\": {\n \"info\": \" UniswapV3LimitOrder.constructor() - Router cannot be address zero\",\n \"suggestion\": \"Make sure you are not passing in the zero address when initializing the module\"\n },\n \"FW110\": {\n \"info\": \" UniswapV3LimitOrder.constructor() - Quoter cannot be zero address\",\n \"suggestion\": \"Make sure you are not passing in the zero address when initializing the module\"\n },\n \"FW200\": {\n \"info\": \" FeePercentOracle.setValues() - feepercent must be less than or equals to 100%\",\n \"suggestion\": \"To fix this error, `_feepercent` must be less than or equals to `10 ** _decimals`\"\n },\n \"FW201\": {\n \"info\": \" FeePercentOracle.withdrawEth() - eth transfer failed\",\n \"suggestion\": \"To fix this error, investigate why the eth withdrawal failed. This is likely because `amount` was greater than the eth balance in the FeePercentOracle\"\n },\n \"FW202\": {\n \"info\": \" TokenPriceOracle.getTokenValueOfEth() - chainlink aggregator price must be greater than 0\",\n \"suggestion\": \"To fix this error, retry the call and make sure price is greater than 0\"\n },\n \"FW203\": {\n \"info\": \" TokenPriceOracle.getTokenValueOfEth() - chainlink aggregator updatedAt must be greater than 0\",\n \"suggestion\": \"To fix this error, retry the call and make sure updatedAt is greater than 0\"\n },\n \"FW204\": {\n \"info\": \" TokenPriceOracle.getTokenValueOfEth() - chainlink aggregator answeredInRound must be greater than or equal to roundId\",\n \"suggestion\": \"To fix this error, retry the call and make sure answeredInRound must be greater than or equal to roundId\"\n },\n \"FW205\": {\n \"info\": \" TwitterOracle.batchSetTweet() - socialHandles, loginTypes, seeds, owners length must match in length\",\n \"suggestion\": \"To fix this error, make sure all arrays passed into this function are the same length.\"\n },\n \"FW206\": {\n \"info\": \" TwitterOracle.setTweet() - the seed from twitter cannot be empty\",\n \"suggestion\": \"To fix this error, make sure the seed you post on twitter is not empty {}\"\n },\n \"FW207\": {\n \"info\": \" TwitterOracle.setTweet() - the address from twitter cannot be 0\",\n \"suggestion\": \"To fix this error, make sure the address you post on twitter for the new owner is not the zero address, otherwise you would be unable to claim ownership of the funwallet\"\n },\n \"FW208\": {\n \"info\": \" TwitterOracle.batchSetTweet() - the seed from twitter cannot be empty\",\n \"suggestion\": \"To fix this error, make sure the seed you post on twitter is not empty {}\"\n },\n \"FW209\": {\n \"info\": \" TwitterOracle.batchSetTweet() - the address from twitter cannot be 0\",\n \"suggestion\": \"To fix this error, make sure the address you post on twitter for the new owner is not the zero address, otherwise you would be unable to claim ownership of the funwallet\"\n },\n \"FW210\": {\n \"info\": \" TwitterOracle.fetchTweet() - the seed from twitter cannot be empty\",\n \"suggestion\": \"To fix this error, make sure the seed you post on twitter is not empty {}\"\n },\n \"FW211\": {\n \"info\": \" TwitterOracle.fetchTweet() - the address from twitter cannot be 0\",\n \"suggestion\": \"To fix this error, make sure the address you post on twitter for the new owner is not the zero address, otherwise you would be unable to claim ownership of the funwallet\"\n },\n \"FW300\": {\n \"info\": \" BasePaymaster.constructor() - entrypoint address cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure entrypoint address is not the zero address\"\n },\n \"FW301\": {\n \"info\": \" BasePaymaster.\\\\_requireFromEntryPoint() - the msg.sender must be from the entrypoint\",\n \"suggestion\": \"To fix this error, make sure the msg.sender must be from the entrypoint\"\n },\n \"FW302\": {\n \"info\": \" GaslessPaymaster.batchActions() - the ith delegate call failed\",\n \"suggestion\": \"To fix this error, make sure the calldata for `data[i]` is a valid call\"\n },\n \"FW303\": {\n \"info\": \" GaslessPaymaster.batchActions() - batchActions consumed more eth than `msg.value` allocated\",\n \"suggestion\": \"To fix this error, increase the amount of msg.value you are passing to this function\"\n },\n \"FW304\": {\n \"info\": \" GaslessPaymaster.\\\\_withdrawDepositTo() - the withdrawal has not been unlocked\",\n \"suggestion\": \"To fix this error, wait till block.number is greater than the unlockBlock for the sender and make sure `unlockBlock[sender]` is nonzero\"\n },\n \"FW305\": {\n \"info\": \" GaslessPaymaster.\\\\_withdrawDepositTo() - the balances of the sender must be greater than the withdrawal amount\",\n \"suggestion\": \"To fix this error, decrease the amount you are trying to withdraw\"\n },\n \"FW306\": {\n \"info\": \" GaslessPaymaster.\\\\_validatePaymasterUserOp() - the userOp.paymasterAndData must have a length of 40\",\n \"suggestion\": \"To fix this error, change the `paymasterAndData` field in the `userOp` such that the length is 40\"\n },\n \"FW307\": {\n \"info\": \" GaslessPaymaster.\\\\_validatePaymasterUserOp() - the verificationGasLimit must be greater than the `COST_OF_POST` variable in GaslessPaymaster\",\n \"suggestion\": \"To fix this error, increase the `verificationGasLimit` in the `userOp`\"\n },\n \"FW308\": {\n \"info\": \" GaslessPaymaster.\\\\_validatePaymasterUserOp() - the sponsor's eth is not locked for use\",\n \"suggestion\": \"To fix this error, make sure the sponsor's eth is locked using `lockDeposit()`\"\n },\n \"FW309\": {\n \"info\": \" GaslessPaymaster.\\\\_validatePaymasterUserOp() - The sponsor needs to approve the spender\",\n \"suggestion\": \"To fix this error, make sure to approve the spender using `setSpenderWhitelistMode()` or `setSpenderBlacklistMode()` and the sponsor's list mode is set to whitelist mode or blacklist mode using `setListMode()\"\n },\n \"FW310\": {\n \"info\": \" GaslessPaymaster.\\\\_validatePaymasterUserOp() - The sponsor does not have sufficient eth in the paymaster to cover this operation\",\n \"suggestion\": \"To fix this error, make sure to stake enough eth from the sponsor's address using `addDepositTo()`\"\n },\n \"FW311\": {\n \"info\": \" GaslessPaymaster.addDepositTo() - `msg.value` must be greater than or equal to amount\",\n \"suggestion\": \"To fix this error, make sure `msg.value` must be greater than or equal to amount\"\n },\n \"FW312\": {\n \"info\": \" TokenPaymaster.batchActions() - the ith delegate call failed\",\n \"suggestion\": \"To fix this error, make sure the calldata for `data[i]` is a valid call\"\n },\n \"FW313\": {\n \"info\": \" TokenPaymaster.batchActions() - batchActions consumed more eth than `msg.value` allocated\",\n \"suggestion\": \"To fix this error, increase the amount of msg.value you are passing to this function\"\n },\n \"FW314\": {\n \"info\": \" TokenPaymaster.\\\\_addTokenDepositTo() - token decimals must be greater than 0\",\n \"suggestion\": \"To fix this error, change the decimals in token using `setTokenData()`\"\n },\n \"FW315\": {\n \"info\": \" TokenPaymaster.\\\\_withdrawTokenDepositTo() - token is not unlocked for withdrawal\",\n \"suggestion\": \"To fix this error, call `unlockTokenDepositAfter()`\"\n },\n \"FW316\": {\n \"info\": \" TokenPaymaster.\\\\_withdrawTokenDepositTo() - you are withdrawing more tokens that you have in balance\",\n \"suggestion\": \"To fix this error, call `getTokenBalance()` to check how many tokens you have and make sure `amount` is less than that\"\n },\n \"FW317\": {\n \"info\": \" TokenPaymaster.\\\\_withdrawEthDepositTo() - token is not unlocked for withdrawal\",\n \"suggestion\": \"To fix this error, call `unlockTokenDepositAfter()` with `ETH` as the token\"\n },\n \"FW318\": {\n \"info\": \" TokenPaymaster.\\\\_withdrawEthDepositTo() - you are withdrawing more ether that you have in balance\",\n \"suggestion\": \"To fix this error, call `getTokenBalance()` with `ETH` as the token to check how many tokens you have and make sure `amount` is less than that\"\n },\n \"FW319\": {\n \"info\": \" TokenPaymaster.\\\\_getTokenValueOfEth() - call to token oracle failed\",\n \"suggestion\": \"To fix this error, check the token oracle and call `setTokenData()` to change the oracle if it is broken\"\n },\n \"FW320\": {\n \"info\": \" TokenPaymaster.\\\\_reimbursePaymaster() - failed to reimbursePaymaster with tokens via `permitTransfer()`\",\n \"suggestion\": \"To fix this **error**, make sure you have permitted the paymaster to spend your tokens\"\n },\n \"FW321\": {\n \"info\": \" TokenPaymaster.\\\\_reimbursePaymaster() - spender doesn't have enough tokens\",\n \"suggestion\": \"To fix this error, make sure to add more tokens to the token paymaster via `addTokenDepositTo()`\"\n },\n \"FW322\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - `paymasterAndData` length must be 60\",\n \"suggestion\": \"To fix this error, make sure to set `paymasterAndData` length to be 60\"\n },\n \"FW323\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - `verificationGasLimit` must be greater than `COST_OF_POST`\",\n \"suggestion\": \"To fix this error, make sure to set the userOp's `verificationGasLimit` to be greater than `COST_OF_POST`\"\n },\n \"FW324\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the sponsor must lock their ETH\",\n \"suggestion\": \"To fix this error, make sure the sponsor has locked their eth by calling `lockTokenDeposit()` from the sponsor address\"\n },\n \"FW325\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the account must lock their tokens\",\n \"suggestion\": \"To fix this error, make sure the user of the token paymaster has locked their tokens by calling `lockTokenDeposit()` from their address\"\n },\n \"FW326\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the sponsor eth balance must be greater than maxCost\",\n \"suggestion\": \"To fix this error, make sure the sponsor eth balance is greater than maxCost\"\n },\n \"FW327\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the sponsor must approve the spender\",\n \"suggestion\": \"To fix this error, make sure the sponsor has approved the spender by calling `setSpenderWhitelistMode()` or `setSpenderBlacklistMode()` and the sponsor's list mode is set to whitelist mode or blacklist mode using `setListMode()`\"\n },\n \"FW328\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the sponsor must have approved the token to the paymaster\",\n \"suggestion\": \"To fix this error, make sure the sponsor has approved the spender by calling `setTokenWhitelistMode()` or `setTokenBlacklistMode()` and the sponsor's list mode is set to whitelist mode or blacklist mode using `setTokenListMode()`\"\n },\n \"FW329\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the permitted token must be equal to the token you are trying to pay with if using permit\",\n \"suggestion\": \"To fix this error, make sure the permitted token is equal to the token you are trying to pay with if using permit\"\n },\n \"FW330\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the permitted transfer recipient must be the token paymaster\",\n \"suggestion\": \"To fix this error, make sure to permit the token paymaster to spend your tokens\"\n },\n \"FW331\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - the permitted transfer amount must be greater than or equal to the maxTokenCost\",\n \"suggestion\": \"To fix this error, make sure the permitted transfer amount is greater than or equal to the maxTokenCost\"\n },\n \"FW332\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - if permit was not used, make sure the tokenPaymaster was approved to spend tokens by the sponsor or enough tokens were deposited into the TokenPaymaster\",\n \"suggestion\": \"To fix this error, make sure the tokenPaymaster was approved(`approve()`) to spend tokens by the sponsor or enough tokens were deposited into the TokenPaymaster via `addTokenDepositTo()`\"\n },\n \"FW333\": {\n \"info\": \" TokenPaymaster.addEthDepositTo() - make sure msg.value is greater than or equal to amount\",\n \"suggestion\": \"To fix this error, make sure that the msg.value is greater than or equal to amount\"\n },\n \"FW334\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - sponsor cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the sponsor is not the zero address\"\n },\n \"FW335\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - target cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the target is not the zero address\"\n },\n \"FW336\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - token address cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the token address is not the zero address\"\n },\n \"FW337\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - spender address cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the spender address is not the zero address\"\n },\n \"FW338\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - the token oracle cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the token oracle is not the zero address\"\n },\n \"FW339\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - the tokenAddress cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the tokenAddress is not the zero address\"\n },\n \"FW340\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - the token decimals must be greater than 0\",\n \"suggestion\": \"To fix this error, make sure the token decimals is greater than 0\"\n },\n \"FW341\": {\n \"info\": \" TokenPaymaster.addTokenDepositTo() - the chainlink aggregator cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the chainlink aggregator is not the zero address\"\n },\n \"FW342\": {\n \"info\": \" TokenPaymaster.removeTokenData() - The token doesn't exist in tokens\",\n \"suggestion\": \"To fix this error, make sure the token address is not the zero address\"\n },\n \"FW343\": {\n \"info\": \" TokenPaymaster.removeTokenData() - The tokenListIndex doesn't match with the tokenAddress\",\n \"suggestion\": \"To fix this error, make sure the token at tokenList[tokenListIndex] is the same as the tokenAddress\"\n },\n \"FW344\": {\n \"info\": \" GaslessPaymaster.batchActions() - Cannot recursively call batchActions from within batchActions\",\n \"suggestion\": \"To fix this error, make sure you are not recursively calling batchActions from within batchActions\"\n },\n \"FW345\": {\n \"info\": \" TokenPaymaster.batchActions() - Cannot recursively call batchActions from within batchActions\",\n \"suggestion\": \"To fix this error, make sure you are not recursively calling batchActions from within batchActions\"\n },\n \"FW346\": {\n \"info\": \" TokenPaymaster.postOp() - Invalid Permit transfer amount\",\n \"suggestion\": \"To fix this error, make sure your permit transfer has transfered the correct amount of tokens\"\n },\n \"FW347\": {\n \"info\": \" TokenPaymaster.\\\\_reimbursePaymaster() - Invalid amount of tokens transferred\",\n \"suggestion\": \"The likely cause of this error is using a deflationary token that charges a tax when you transfer tokens. To fix this error, make sure you are transferring the correct amount of tokens and to account for the tax/deflation.\"\n },\n \"FW348\": {\n \"info\": \" UserAuthentication.init() - groupId count must be equal to groups length\",\n \"suggestion\": \"Make sure the number of groupIds equals the number of groups.\"\n },\n \"FW349\": {\n \"info\": \" TokenPaymaster.calculatePostOpGas() - Invalid Auth Type\",\n \"suggestion\": \"Make sure the authtype is correct\"\n },\n \"FW350\": {\n \"info\": \" TokenPaymaster.\\\\_validatePaymasterUserOp() - Does not have enough balance of token\",\n \"suggestion\": \"To fix this error, make sure your has enough tokens to permit transfer\"\n },\n \"FW351\": {\n \"info\": \" BasePaymaster.\\\\withdrawStakeFromEntryPoint() - Cannot withdraw to address zero\",\n \"suggestion\": \"To fix this error, make sure you are not withdrawing to address zero\"\n },\n \"FW401\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"### `FW402`: RoleBasedAccessControl.isValidAction(), isValidActionAndFee() - Invalid Target\"\n },\n \"FW402\": {\n \"info\": \" RoleBasedAccessControl.isValidAction(), isValidActionAndFee() - Invalid Target\",\n \"suggestion\": \"To fix this error, make sure the target that you are calling is in the merkle root of allowed targets verified by the rule. If this does not work make sure you are using the correct merkle root implementation.\"\n },\n \"FW403\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the selector that you are calling is in the merkle root of allowed selector verified by the rule. If this does not work make sure you are using the correct merkle root implementation.\"\n },\n \"FW404\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the ownerId is not 0 or an existing owner\"\n },\n \"FW405\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the ruleId is not 0\"\n },\n \"FW406\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the rule that you are using has a deadline that has passed.\"\n },\n \"FW408\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"### `FW410`: RoleBasedAccessControl: isValidAction(), isValidActionAndFee() - Rule not added to role\"\n },\n \"FW410\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the rule is added to the role\"\n },\n \"FW411\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the value for the execution call is less than the limit\"\n },\n \"FW412\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the fee value for the execution call is less than the limit\"\n },\n \"FW413\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the fee recipient is in the rule fee merkle root\"\n },\n \"FW414\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the fee token is in the rule fee merkle root\"\n },\n \"FW417\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the rule you are using exists\"\n },\n \"FW418\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the user is in the role\"\n },\n \"FW419\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the feeRecipientTokenMerkleRootHash is not zero\"\n },\n \"FW420\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the targetSelectorMerkleRootHash is not zero\"\n },\n \"FW421\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"### `FW422`: RoleBasedAccessControl: init() - Wallet has not been initialized\"\n },\n \"FW422\": {\n \"info\": \" RoleBasedAccessControl\",\n \"suggestion\": \"To fix this error, make sure the wallet has not initialized the validation contract\"\n },\n \"FW500\": {\n \"info\": \" FunWallet.initialize() - the entrypoint cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the entrypoint is not the zero address\"\n },\n \"FW501\": {\n \"info\": \" FunWallet.initialize() - the msg.sender cannot be the address of the Funwallet contract\",\n \"suggestion\": \"To fix this error, make sure the msg.sender is not the address of the Funwallet contract\"\n },\n \"FW502\": {\n \"info\": \" FunWallet.\\\\_requireFromFunWalletProxy() - the function must be called from the funwallet proxy\",\n \"suggestion\": \"To fix this error, make sure the msg.sender == funwallet\"\n },\n \"FW503\": {\n \"info\": \" FunWallet.updateEntryPoint() - the new entrypoint address cannot be the zero address\",\n \"suggestion\": \"To fix this error, make sure the new entrypoint address is not the zero address\"\n },\n \"FW504\": {\n \"info\": \" FunWallet.depositToEntryPoint() - not enough eth in the funwallet\",\n \"suggestion\": \"To fix this error, make sure the funwallet has more than the amount of eth you are trying to deposit\"\n },\n \"FW505\": {\n \"info\": \" FunWallet.\\\\_transferEthFromEntrypoint() - withdrawing eth from the entrypoint failed\",\n \"suggestion\": \"To fix this error, retry the operation and make sure you have greater than amount balance in the entrypoint\"\n },\n \"FW506\": {\n \"info\": \" FunWallet.\\\\_requireFromModule() - make sure a funwalletfactory deployed the module\",\n \"suggestion\": \"To fix this error, make sure the msg.sender is the module\"\n },\n \"FW507\": {\n \"info\": \" FunWallet.\\\\_requireFromEntryPoint() - the msg.sender must be the entrypoint\",\n \"suggestion\": \"To fix this error, make sure the msg.sender is the entrypoint\"\n },\n \"FW508\": {\n \"info\": \" WalletFee.\\\\_transferEth() - the eth transfer failed\",\n \"suggestion\": \"To fix this error, retry the operation and make sure you have greater than amount balance in the wallet\"\n },\n \"FW509\": {\n \"info\": \" WalletFee.\\\\_handleFee() - the developer eth transfer failed\",\n \"suggestion\": \"To fix this error, retry the operation and make sure you have greater than amount balance in the wallet\"\n },\n \"FW510\": {\n \"info\": \" WalletFee.\\\\_handleFee() - the funOracle eth transfer failed\",\n \"suggestion\": \"To fix this error, retry the operation and make sure you have greater than amount balance in the wallet\"\n },\n \"FW511\": {\n \"info\": \" WalletValidation.initValidations() - the WalletValidations contract has already been initialized\",\n \"suggestion\": \"Don't call initValidations() more than once\"\n },\n \"FW512\": {\n \"info\": \" WalletValidation.initValidations() - make sure there are more than zero validations\",\n \"suggestion\": \"To fix this error, make sure there are more than zero validations and the number of validation contract addresses are equal to the number of `initCallData` elements\"\n },\n \"FW513\": {\n \"info\": \" WalletValidation.initValidations() - make sure there are no duplicate validation contract addresses\",\n \"suggestion\": \"To fix this error, make sure there are no duplicate validation contract addresses in `validationData`\"\n },\n \"FW514\": {\n \"info\": \" WalletValidation.\\\\_validateUserOp() - make sure the signature length is greater than 0\",\n \"suggestion\": \"To fix this error, make sure the signature length is greater than 0\"\n },\n \"FW515\": {\n \"info\": \" WalletValidation.isValidSignature() - make sure the number of validations is greater than zero\",\n \"suggestion\": \"To fix this error, make sure the number of validations is greater than zero\"\n },\n \"FW516\": {\n \"info\": \" WalletValidation.\\\\_requireValidValidation() - the validation failed\",\n \"suggestion\": \"To fix this error, make sure the validation contract returns true\"\n },\n \"FW517\": {\n \"info\": \" WalletValidation.\\\\_requireValidValidationFormat() - the validation was incorrectly formatted\",\n \"suggestion\": \"To fix this error, make sure the validation contract address is not the zero address and the validation is valid and the address is not the zero address\"\n },\n \"FW518\": {\n \"info\": \" WalletValidation.\\\\_requireValidPrevValidation() - the previous validation must be linked to this validation\",\n \"suggestion\": \"To fix this error, make sure the previous validation is linked to this validation when adding or removing the validation\"\n },\n \"FW519\": {\n \"info\": \" WalletValidation.getValidations() - you must have more than zero validations to get validations\",\n \"suggestion\": \"To fix this error, make sure there are a nonzero amount of validations\"\n },\n \"FW520\": {\n \"info\": \" WalletValidation.addValidation() - The caller must be this wallet.\",\n \"suggestion\": \"To fix this error, make sure you are calling addValidation() from your funwallet.\"\n },\n \"FW521\": {\n \"info\": \" WalletValidation.removeValidation() - The caller must be this wallet.\",\n \"suggestion\": \"To fix this error, make sure you are calling removeValidation() from your funwallet.\"\n },\n \"FW522\": {\n \"info\": \" WalletValidation.updateValidation() - The caller must be this wallet.\",\n \"suggestion\": \"To fix this error, make sure you are calling updateValidation() from your funwallet.\"\n },\n \"FW523\": {\n \"info\": \" WalletModules.permitTransfer() - Invalid Permit Signature.\",\n \"suggestion\": \"To fix this error, make sure you have a valid permit signature.\"\n },\n \"FW524\": {\n \"info\": \" WalletValidation.getValidations() - No Validations in the wallet\",\n \"suggestion\": \"To fix this error, make sure the wallet has validation contracts\"\n },\n \"FW600\": {\n \"info\": \" DataLib\",\n \"suggestion\": \"To fix this error, make sure you are calling either execFromEntryPoint() or execFromEntryPointWithFee() from your funwallet.\"\n },\n \"FW601\": {\n \"info\": \" Ownable2StepNoRenounce\",\n \"suggestion\": \"To fix this error, don't call this function.\"\n }\n}\n", "export type ErrorData = {\n location: string\n error?: {\n txDetails?: ErrorTransactionDetails\n reasonData?: {\n title: string\n reasons: string[]\n }\n }\n}\n\nexport type ErrorTransactionDetails = {\n method: string\n params: any[]\n contractAddress?: string\n chainId?: number | string\n}\n\nexport enum ErrorBaseType {\n ClientError = 'ClientError',\n ServerError = 'ServerError',\n}\n\nexport enum ErrorType {\n InvalidParameter = 'InvalidParameter',\n InternalServerFailure = 'InternalServerFailure',\n ResourceNotFound = 'ResourceNotFound',\n InvalidAction = 'InvalidAction',\n ThrottlingError = 'ThrottlingError',\n AccessDeniedError = 'AccessDeniedError',\n UserOpFailureError = 'UserOpFailureError',\n}\n\nexport enum ErrorCode {\n MissingParameter = 'MissingParameter',\n InvalidParameter = 'InvalidParameter',\n InvalidThreshold = 'InvalidThreshold',\n InvalidChainIdentifier = 'InvalidChainIdentifier',\n InvalidNFTIdentifier = 'InvalidNFTIdentifier',\n InsufficientSignatures = 'InsufficientSignatures',\n InvalidParameterCombination = 'InvalidParameterCombination',\n CheckPointHintsNotFound = 'CheckPointHintsNotFound',\n GroupNotFound = 'GroupNotFound',\n TokenNotFound = 'TokenNotFound',\n AddressNotFound = 'AddressNotFound',\n UserAlreadyExists = 'UserAlreadyExists',\n UserNotFound = 'UserNotFound',\n ChainNotSupported = 'ChainNotSupported',\n ServerMissingData = 'ServerMissingData',\n ServerFailure = 'ServerFailure',\n ServerTimeout = 'ServerTimeout',\n UnknownServerError = 'UnknownServerError',\n ServerConnectionError = 'ServerConnectionError',\n UserOpFailureError = 'UserOpFailureError',\n Unauthorized = 'Unauthorized',\n RequestLimitExceeded = 'RequestLimitExceeded',\n WalletPrefundError = 'PrefundError',\n GasSponsorFundError = 'GasSponsorFundError',\n FunWalletErrorCode = 'FunWalletErrorCode',\n BridgeRouteNotFound = 'BridgeRouteNotFound',\n BridgeAllowanceDataNotFound = 'BridgeAllowanceDataNotFound',\n BridgeApproveTxDataNotFound = 'BridgeApproveTxDataNotFound',\n CheckoutInitDepositAddrNotFound = 'CheckoutInitDepositAddrNotFound',\n}\n", "import { BaseError } from './BaseError'\nimport FWErrors from './errors.json'\nimport { ErrorBaseType, ErrorCode, ErrorType } from './types'\nexport class ClientError extends BaseError {\n constructor(\n type: string,\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorBaseType.ClientError,\n type,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n false,\n )\n }\n}\n\nexport class InvalidParameterError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorType.InvalidParameter,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n}\n\nexport class ResourceNotFoundError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n if (msg.includes('Chain name not found')) {\n const { reqId } = JSON.parse(msg)\n msg = ': Chain name not found or not supported.'\n fixSuggestion = 'Change your EnvOptions to the correct chain identifier.'\n super(\n ErrorType.ResourceNotFound,\n ErrorCode.ChainNotSupported,\n msg,\n { reqId },\n fixSuggestion,\n docLink,\n )\n } else {\n super(\n ErrorType.ResourceNotFound,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n }\n}\n\nexport class InvalidActionError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorType.InvalidAction,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n}\n\nexport class ThrottlingError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorType.ThrottlingError,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n}\n\nexport class AccessDeniedError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorType.AccessDeniedError,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n}\n\nexport class UserOpFailureError extends ClientError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n const FWCode = findFWContractError(msg)\n if (FWCode) {\n const { reqId } = JSON.parse(msg)\n msg = FWErrors[FWCode].info\n fixSuggestion = FWErrors[FWCode].suggestion\n super(\n ErrorType.UserOpFailureError,\n ErrorCode.FunWalletErrorCode,\n msg,\n { reqId },\n fixSuggestion,\n docLink,\n )\n } else {\n super(\n ErrorType.UserOpFailureError,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n }\n}\n\nconst findFWContractError = (msg: string) => {\n let match = msg.match(/FW\\d{3}/)\n if (!match) {\n match = msg.match(/AA\\d./)\n }\n return match?.[0]\n}\n", "import { BaseError } from './BaseError'\nimport { ErrorBaseType, ErrorType } from './types'\n\nexport class ServerError extends BaseError {\n constructor(\n type: string,\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorBaseType.ServerError,\n type,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n true,\n )\n }\n}\n\nexport class InternalFailureError extends ServerError {\n constructor(\n code: string,\n msg: string,\n paramsUsed: any,\n fixSuggestion: string,\n docLink: string,\n ) {\n super(\n ErrorType.InternalServerFailure,\n code,\n msg,\n paramsUsed,\n fixSuggestion,\n docLink,\n )\n }\n}\n", "import {\n InvalidParameterError,\n ResourceNotFoundError,\n UserOpFailureError,\n} from '../errors'\n\nexport const errorAbortHandler = (err: any, context: any) => {\n if (\n err instanceof ResourceNotFoundError ||\n err instanceof InvalidParameterError ||\n err instanceof UserOpFailureError\n ) {\n context.abort()\n }\n}\n", "import { PartialAttemptOptions } from '@lifeomic/attempt'\n\nimport { errorAbortHandler } from '../utils/error'\n\nexport type BaseResponse = any // TODO:\n\nexport type RetryOptions = PartialAttemptOptions<BaseResponse>\n\nexport const DEFAULT_RETRY_OPTIONS = {\n delay: 100,\n initialDelay: 0,\n maxDelay: 3000,\n factor: 2,\n maxAttempts: 5,\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", "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'\nimport { toHex } from 'viem'\n\nimport { BaseRequest } from '../consts/request'\nimport {\n BaseResponse,\n DEFAULT_RETRY_OPTIONS,\n RetryOptions,\n} from '../consts/retry'\nimport {\n AccessDeniedError,\n ErrorCode,\n InternalFailureError,\n InvalidParameterError,\n ResourceNotFoundError,\n ThrottlingError,\n UserOpFailureError,\n} from '../errors'\nimport {\n DeleteRequest,\n GetRequest,\n PostRequest,\n PutRequest,\n} from './../consts/request'\n\nconst stringifyWithBigIntSanitization = (object: any) => {\n return JSON.stringify(\n object,\n (_, value) => (typeof value === 'bigint' ? toHex(value) : value), // return everything else unchanged\n )\n}\n\nexport const sendRequest = async ({\n uri,\n method,\n apiKey,\n body = {},\n retryOptions = {},\n signal,\n}: BaseRequest): Promise<BaseResponse> => {\n try {\n const headers = {\n 'Content-Type': 'application/json',\n ...(apiKey ? { 'X-Api-Key': apiKey } : {}),\n }\n\n const finalRetryOptions = {\n ...DEFAULT_RETRY_OPTIONS,\n ...(retryOptions || {}),\n } as RetryOptions\n\n return retry(async function () {\n const response = await fetch(uri, {\n method,\n headers,\n redirect: 'follow',\n signal,\n body:\n method !== 'GET' ? stringifyWithBigIntSanitization(body) : undefined,\n })\n const json = await response.json()\n if (response.ok) {\n return json\n } else if (response.status === 400) {\n throw new InvalidParameterError(\n ErrorCode.InvalidParameter,\n `bad request ${JSON.stringify(json)}`,\n { body },\n 'check the api call parameters. its mostly because some call parameters are wrong',\n 'https://docs.fun.xyz',\n )\n } else if (response.status === 403) {\n throw new AccessDeniedError(\n ErrorCode.Unauthorized,\n 'Invalid API key or insufficient access.',\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 } else if (response.status === 404) {\n throw new ResourceNotFoundError(\n ErrorCode.ServerMissingData,\n JSON.stringify(json),\n { body },\n 'check the api call parameters. its mostly because some call parameters are wrong',\n 'https://docs.fun.xyz',\n )\n } else if (response.status === 429) {\n throw new ThrottlingError(\n ErrorCode.RequestLimitExceeded,\n `too many requests ${JSON.stringify(json)}`,\n\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 } else if (response.status === 500) {\n if ((json as any).errorCode === ErrorCode.UserOpFailureError) {\n throw new UserOpFailureError(\n ErrorCode.UserOpFailureError,\n JSON.stringify(json),\n { body },\n 'fix user op failure. Most of the time this is due to invalid parameters',\n 'https://docs.fun.xyz',\n )\n } else {\n throw new InternalFailureError(\n ErrorCode.ServerFailure,\n `server failure ${JSON.stringify(json)}`,\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n }\n } else if (response.status === 504) {\n throw new InternalFailureError(\n ErrorCode.ServerTimeout,\n `server timeout failure ${JSON.stringify(json)}`,\n { body },\n 'retry later. if it still fails, please contact us.',\n 'https://docs.fun.xyz',\n )\n } else if (!response.ok) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n `unknown server failure ${JSON.stringify(json)}`,\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 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({\n uri,\n apiKey,\n retryOptions,\n signal,\n}: GetRequest): Promise<BaseResponse> {\n return await sendRequest({\n uri,\n apiKey,\n retryOptions,\n signal,\n method: 'GET',\n })\n}\n\nexport async function sendPostRequest({\n uri,\n body,\n apiKey,\n retryOptions,\n signal,\n}: PostRequest): Promise<BaseResponse> {\n return await sendRequest({\n uri,\n apiKey,\n body,\n retryOptions,\n signal,\n method: 'POST',\n })\n}\n\nexport async function sendDeleteRequest({\n uri,\n apiKey,\n retryOptions,\n signal,\n}: DeleteRequest): Promise<void> {\n await sendRequest({\n uri,\n method: 'DELETE',\n apiKey,\n retryOptions,\n signal,\n })\n}\n\nexport async function sendPutRequest({\n uri,\n body,\n apiKey,\n retryOptions,\n signal,\n}: PutRequest): Promise<BaseResponse> {\n return await sendRequest({\n uri,\n apiKey,\n body,\n retryOptions,\n signal,\n method: 'PUT',\n })\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport {\n GetAllWalletNFTsByChainIdRequest,\n GetAllWalletNFTsByChainIdResponse,\n GetAllWalletNFTsRequest,\n GetAllWalletNFTsResponse,\n GetAllWalletTokensByChainIdRequest,\n GetAllWalletTokensByChainIdResponse,\n GetAllWalletTokensRequest,\n GetAllWalletTokensResponse,\n GetAssetPriceInfoRequest,\n GetAssetPriceInfoResponse,\n GetWalletLidoWithdrawalsByChainId,\n GetWalletLidoWithdrawalsByChainIdResponse,\n} from './types'\n\n/**===========================================================\n * REFERENCE CORE FILE: /packages/core/src/apis/AssetApis.ts\n * TODO: Remove this comment once migration is complete\n *===========================================================*/\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 */\nexport async function getAssetPriceInfo({\n chainId,\n assetTokenAddress,\n apiKey,\n}: GetAssetPriceInfoRequest): Promise<GetAssetPriceInfoResponse> {\n const priceInfo = await sendGetRequest({\n uri: `${API_BASE_URL}/asset/erc20/price/${chainId}/${assetTokenAddress}`,\n apiKey,\n retryOptions: { maxAttempts: 2 },\n })\n return priceInfo\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 apiKey,\n signal,\n}: GetAllWalletTokensRequest): Promise<GetAllWalletTokensResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/erc20s/${walletAddress}?onlyVerifiedTokens=${onlyVerifiedTokens}`,\n apiKey,\n signal,\n retryOptions: { maxAttempts: 2 },\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 apiKey,\n}: GetAllWalletTokensByChainIdRequest): Promise<GetAllWalletTokensByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/erc20s/${walletAddress}/${chainId}?onlyVerifiedTokens=${onlyVerifiedTokens}`,\n apiKey,\n retryOptions: { maxAttempts: 2 },\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 apiKey,\n}: GetAllWalletNFTsRequest): Promise<GetAllWalletNFTsResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/nfts/${walletAddress}`,\n apiKey,\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 apiKey,\n}: GetAllWalletNFTsByChainIdRequest): Promise<GetAllWalletNFTsByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/nfts/${walletAddress}/${chainId}`,\n apiKey,\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 apiKey,\n}: GetWalletLidoWithdrawalsByChainId): Promise<GetWalletLidoWithdrawalsByChainIdResponse> {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/assets/lido-withdrawals/${walletAddress}/${chainId}`,\n apiKey,\n })\n}\n", "import Big from 'big.js'\nimport { Address } from 'viem'\n\nimport { API_BASE_URL } from '../../consts'\nimport { ErrorCode, ResourceNotFoundError } from '../../errors'\nimport {\n generateRandomCheckoutSalt,\n roundToNearestBottomTenth,\n sendGetRequest,\n sendPostRequest,\n} from '../../utils'\nimport {\n CheckoutApiInitParams,\n CheckoutApiQuoteParams,\n CheckoutApiQuoteResponse,\n CheckoutDeactivateParams,\n CheckoutHistoryItem,\n CheckoutInitParams,\n CheckoutInitResponse,\n CheckoutQuoteParams,\n CheckoutQuoteResponse,\n CheckoutState,\n CheckoutTransferSponsorshipApiParams,\n CheckoutTransferSponsorshipParams,\n CheckoutTransferSponsorshipResponse,\n} from './types'\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 expirationTimestampMs The amount of time (duration) from now before the checkout operation expires.\n * @param apiKey A valid fun api key.\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 expirationTimestampMs,\n sponsorInitialTransferGasLimit,\n recipientAddr,\n needsRefuel,\n userId,\n apiKey,\n}: CheckoutQuoteParams): Promise<CheckoutQuoteResponse> {\n try {\n const toMultipler = 10 ** toTokenDecimals\n const toAmountBaseUnitBI = BigInt(Math.floor(toTokenAmount * toMultipler))\n const queryParams = {\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() + expirationTimestampMs) / 1000),\n ).toString(),\n sponsorInitialTransferGasLimit,\n // @deprecated Not in use\n refuel: needsRefuel.toString(),\n } as CheckoutApiQuoteParams\n\n const searchParams = new URLSearchParams(queryParams)\n const quoteRes = (await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/quote?${searchParams}`,\n apiKey,\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 // 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 } as CheckoutQuoteResponse\n } catch (err: any) {\n throw new Error(\n `An error occured trying to generate a checkout quote: ${err.message}`,\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 apiKey,\n clientMetadata,\n}: CheckoutInitParams): Promise<Address> {\n const body = {\n ...(userOp ? { userOp } : {}),\n quoteId,\n sourceOfFund,\n salt: generateRandomCheckoutSalt(),\n clientMetadata,\n } as CheckoutApiInitParams\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/checkout`,\n body,\n apiKey,\n })\n if (!res?.depositAddr) {\n throw new ResourceNotFoundError(\n ErrorCode.CheckoutInitDepositAddrNotFound,\n 'Unable to initialize checkout',\n body,\n '',\n 'https://docs.fun.xyz',\n )\n }\n return res.depositAddr as CheckoutInitResponse\n}\n\nexport async function deactivateCheckout({\n depositAddress,\n apiKey,\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 apiKey,\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 apiKey,\n signal,\n}: {\n depositAddress: Address\n apiKey: string\n signal?: AbortSignal\n}): Promise<CheckoutHistoryItem | null> {\n try {\n return await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/${depositAddress}`,\n apiKey,\n signal,\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 apiKey,\n signal,\n}: {\n funWalletAddress: Address\n apiKey: string\n signal?: AbortSignal\n}): Promise<CheckoutHistoryItem[]> {\n const res = await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/fun-wallet/${funWalletAddress}`,\n apiKey,\n signal,\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 apiKey,\n signal,\n}: {\n recipientAddress: Address\n apiKey: string\n signal?: AbortSignal\n}): Promise<CheckoutHistoryItem[]> {\n const res = await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/recipient/${recipientAddress}`,\n apiKey,\n signal,\n })\n return res || []\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 apiKey,\n signal,\n}: {\n userId: string\n apiKey: string\n signal?: AbortSignal\n}): Promise<CheckoutHistoryItem[]> {\n const res = await sendGetRequest({\n uri: `${API_BASE_URL}/checkout/userId/${userId}`,\n apiKey,\n signal,\n })\n return res || []\n}\n\nexport async function getPaymasterDataForCheckoutSponsoredTransfer({\n depositAddress,\n transferUserOp,\n apiKey,\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 apiKey,\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", "/**===============*\n * CHECKOUT QUOTE *\n *================*/\nimport { Address, Hex } from 'viem'\n\n// TODO: Define the UserOperation type\ntype UserOperation = any\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 checkoutExpirationTimestampSeconds: string\n sponsorInitialTransferGasLimit: string\n refuel: string\n userId: string\n recipientAddr?: Address\n}\n\nexport type CheckoutQuoteParams = Omit<\n CheckoutApiQuoteParams,\n 'toAmountBaseUnit' | 'checkoutExpirationTimestampSeconds' | 'refuel'\n> & {\n fromTokenDecimals: number\n toTokenDecimals: number\n toTokenAmount: number\n expirationTimestampMs: number\n needsRefuel: boolean\n apiKey: string\n}\n\n// The response of the actual /checkout/quote api\nexport type CheckoutApiQuoteResponse = {\n quoteId: string\n estTotalFromAmountBaseUnit: string\n estSubtotalFromAmountBaseUnit: string\n estFeesFromAmountBaseUnit: string\n fromTokenAddress: Address\n estFeesUsd: number\n estSubtotalUsd: number\n estTotalUsd: number\n estCheckoutTimeMs: number\n}\n\n// The formatted response quote interface from the core sdk\nexport type CheckoutQuoteResponse = CheckoutApiQuoteResponse & {\n estTotalFromAmount: string\n estSubtotalFromAmount: string\n estFeesFromAmount: string\n}\n\n/**===============*\n * CHECKOUT INIT *\n *================*/\n\nexport type CheckoutApiInitParams = {\n userOp?: UserOperation\n quoteId: string\n sourceOfFund: string\n salt: Hex\n clientMetadata: object\n}\n\nexport type CheckoutInitParams = Omit<CheckoutApiInitParams, 'salt'> & {\n apiKey: string\n}\n\nexport type CheckoutInitResponse = Address\n\n/**=====================*\n * CHECKOUT DEACTIVATE *\n *======================*/\n\nexport type CheckoutDeactivateParams = {\n depositAddress: Address\n apiKey: string\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\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 clientMetadata: object\n}\n\n/**===============================*\n * CHECKOUT TRANSFER SPONSORSHIP *\n *================================*/\n\nexport type CheckoutTransferSponsorshipParams = {\n transferUserOp: UserOperation\n depositAddress: Address\n apiKey: string\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", "import { FUN_FAUCET_URL } from '../../consts'\nimport { sendGetRequest } from '../../utils'\nimport { GetAssetFromFaucetRequest } from './types'\n\nexport async function getAssetFromFaucet({\n token,\n chain,\n walletAddress,\n apiKey,\n}: GetAssetFromFaucetRequest) {\n return await sendGetRequest({\n uri: `${FUN_FAUCET_URL}/get-faucet?token=${token}&testnet=${chain}&addr=${walletAddress}`,\n apiKey,\n })\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport {\n GetCryptocurrencyHoldingsRequest,\n GetLinkTokenRequest,\n GetLinkTokenResponse,\n GetTransferIntegrationsRequest,\n GetTransferIntegrationsResponse,\n MeshExecuteTransferRequest,\n MeshExecuteTransferResponse,\n PreviewTransferRequest,\n} from './types'\n\n/**\n * @param authToken The authentication token to send the asset from.\n * @param type The type of the integration to send the asset from.\n * @return https://docs.meshconnect.com/reference/post_api-v1-holdings-get\n */\nexport async function meshGetCryptocurrencyHoldings({\n authToken,\n type,\n apiKey,\n}: GetCryptocurrencyHoldingsRequest): Promise<any> {\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/mesh/holdings/get`,\n body: { authToken, type },\n apiKey,\n })\n return res\n}\n\n/**\n * @return https://docs.meshconnect.com/reference/get_api-v1-transfers-managed-integrations\n */\nexport async function meshGetTransferIntegrations({\n apiKey,\n}: GetTransferIntegrationsRequest): Promise<GetTransferIntegrationsResponse> {\n const res = await sendGetRequest({\n uri: `${API_BASE_URL}/mesh/transfers/managed/integrations`,\n apiKey,\n })\n return res\n}\n\n/**\n * @param userId A unique Id representing the end user. Typically this will be a user Id from the\nclient application. Personally identifiable information, such as an email address or phone number,\nshould not be used. 50 characters length maximum.\n * @param integrationId A unique identifier representing a specific integration obtained from the list of available integrations.\n * @param restrictMultipleAccounts The final screen of Link allows users to \u201Ccontinue\u201D back to your app or \u201CLink another account.\u201D\nIf this param is present then this button will be hidden.\n * @param transferOptions Encapsulates transaction-related parameters, including destination addresses and the amount to transfer in fiat currency.\n * @return https://docs.meshconnect.com/reference/post_api-v1-linktoken\n */\nexport async function meshGetLinkToken({\n userId,\n integrationId,\n restrictMultipleAccounts,\n transferOptions,\n apiKey,\n}: GetLinkTokenRequest): Promise<GetLinkTokenResponse> {\n let body: any = { userId }\n if (integrationId) {\n body = { ...body, integrationId }\n }\n if (restrictMultipleAccounts) {\n body = { ...body, restrictMultipleAccounts }\n }\n if (transferOptions) {\n body = { ...body, transferOptions }\n }\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/mesh/linktoken`,\n body,\n apiKey,\n })\n return res\n}\n\n/**\n * @param fromAuthToken The authentication token to send the asset from.\n * @param fromType The type of the integration to send the asset from.\n * @param toAuthToken The authentication token of the target integration. Can be used alternatively to the address in the ToAddress field. If used, toType should also be provided.\n * @param toType The type of the target integration to send assets to. Used along with the toAuthToken alternatively to ToAddress.\n * @param networkId The network to send the asset over. This is generated by Mesh, it isn't a chainId or chain name.\n * @param symbol The symbol of the digital asset to send.\n * @param toAddress The target address to send the asset to.\n * @param amount The amount to send, in crypto.\n * @param amountInFiat The amount to send, in fiat currency. Can be used alternatively to Amount.\n * @param fiatCurrency Fiat currency that is to get corresponding converted fiat values of transfer and fee amounts. If not provided, defaults to USD.\n * @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-preview\n */\nexport async function meshPreviewTransfer({\n fromAuthToken,\n fromType,\n toAuthToken,\n toType,\n networkId,\n symbol,\n toAddress,\n amount,\n amountInFiat,\n fiatCurrency,\n apiKey,\n}: PreviewTransferRequest): Promise<any> {\n let body: any = { fromAuthToken, fromType }\n if (toAuthToken) {\n body = { ...body, toAuthToken }\n }\n if (toType) {\n body = { ...body, toType }\n }\n if (networkId) {\n body = { ...body, networkId }\n }\n if (symbol) {\n body = { ...body, symbol }\n }\n if (toAddress) {\n body = { ...body, toAddress }\n }\n if (amount) {\n body = { ...body, amount }\n }\n if (amountInFiat) {\n body = { ...body, amountInFiat }\n }\n if (fiatCurrency) {\n body = { ...body, fiatCurrency }\n }\n\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/mesh/transfers/managed/preview`,\n body,\n apiKey,\n retryOptions: { maxAttempts: 1 },\n })\n return res\n}\n/**\n *\n * @param fromAuthToken The authentication token to send the asset from.\n * @param fromType The type of the integration to send the asset from.\n * @param previewId The preview ID of the transfer to execute.\n * @param mfaCode Multi-factor auth code that should be provided if the status of the transfer was MfaRequired.\n * @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-execute\n */\nexport async function meshExecuteTransfer({\n fromAuthToken,\n fromType,\n previewId,\n mfaCode,\n apiKey,\n}: MeshExecuteTransferRequest): Promise<MeshExecuteTransferResponse> {\n let body: any = { fromAuthToken, fromType, previewId }\n if (mfaCode) {\n body = { ...body, mfaCode }\n }\n const res = await sendPostRequest({\n uri: `${API_BASE_URL}/mesh/transfers/managed/execute`,\n body,\n apiKey,\n })\n return res\n}\n", "export interface GetCryptocurrencyHoldingsRequest {\n authToken: string\n type: string\n apiKey: string\n}\n\nexport interface GetTransferIntegrationsRequest {\n apiKey: string\n}\n\nexport interface IntegrationNetworkInfo {\n chainId: string\n id: string\n logoUrl: string\n name: string\n nativeSymbol: string\n supportedTokens: string[]\n}\n\nexport interface TransferIntegration {\n networks: IntegrationNetworkInfo[]\n supportsIncomingTransfers: boolean\n supportsOutgoingTransfers: boolean\n type: string\n}\n\nexport interface GetTransferIntegrationsResponse {\n integrations: TransferIntegration[]\n}\n\nexport interface GetLinkTokenRequest {\n userId: string\n integrationId?: string | null\n restrictMultipleAccounts?: boolean\n transferOptions?: any | null\n apiKey: string\n}\n\nexport interface GetLinkTokenResponse {\n linkToken: string\n}\n\nexport interface PreviewTransferRequest {\n apiKey: string\n fromAuthToken: string\n fromType: string\n toAuthToken?: string | null\n toType?: string | null\n networkId?: string\n symbol?: string | null\n toAddress?: string | null\n amount?: string | null\n amountInFiat?: string | null\n fiatCurrency?: string | null\n}\n\nexport interface MeshExecuteTransferRequest {\n apiKey: string\n fromAuthToken: string\n fromType: string\n previewId: string\n mfaCode?: string | null\n}\n\n// Reference: https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-execute\nexport enum MeshExecuteTransferStatus {\n succeeded = 'succeeded',\n failed = 'failed',\n mfaRequired = 'mfaRequired',\n emailConfirmationRequired = 'emailConfirmationRequired',\n deviceConfirmationRequired = 'deviceConfirmationRequired',\n mfaFailed = 'mfaFailed',\n addressWhitelistRequired = 'addressWhitelistRequired',\n secondMfaRequired = 'secondMfaRequired',\n}\n\nexport enum MeshExecuteTransferMfaType {\n unspecified = 'unspecified',\n phone = 'phone',\n email = 'email',\n otp = 'otp',\n}\n\nexport interface MeshExecuteTransferContent {\n status: MeshExecuteTransferStatus\n mfaType: MeshExecuteTransferMfaType\n errorMessage: string | null\n executeTransferResult: object | null\n}\n\nexport interface MeshExecuteTransferResponse {\n status: MeshExecuteTransferStatus\n mfaType: MeshExecuteTransferMfaType\n errorMessage: string | null\n executeTransferResult: object | null\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { ErrorCode, InternalFailureError } from '../../errors'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport {\n GetMoonpayBuyQuoteForCreditCardRequest,\n GetMoonpayOffRampUrlRequest,\n GetMoonpayOnRampUrlRequest,\n GetMoonpayUrlSignatureRequest,\n MoonpayCurrency,\n} from './types'\n\nexport async function getMoonpayUrlSignature({\n url,\n isSandbox,\n apiKey,\n}: GetMoonpayUrlSignatureRequest): Promise<string> {\n const signature = await sendPostRequest({\n uri: `${API_BASE_URL}/on-ramp/moonpay-signature/`,\n body: { url, isSandbox },\n apiKey,\n })\n if (!signature || !signature?.url) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n 'No onramp url found.',\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 apiKey,\n}: GetMoonpayBuyQuoteForCreditCardRequest): Promise<any> {\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 const res = await sendGetRequest({\n uri: `${API_BASE_URL}/on-ramp/moonpay-buy-quote?${params}`,\n apiKey,\n retryOptions: { maxAttempts: 1 },\n })\n return res\n}\n\n/**=======================\n * POTENTIAL DEPRECATION\n *=======================*/\n\nexport async function getMoonpayOnRampUrl({\n apiKey,\n walletAddr,\n currencyCode,\n}: GetMoonpayOnRampUrlRequest): Promise<string> {\n const endpoint = `on-ramp/${walletAddr}?provider=moonpay`\n if (currencyCode) {\n endpoint.concat(`&currencyCode=${currencyCode}`)\n }\n const url: string = (\n await sendGetRequest({\n uri: `${API_BASE_URL}/${endpoint}`,\n apiKey,\n })\n )?.url\n if (!url) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n 'No onramp url found.',\n { walletAddr },\n 'This is an internal error, please contact support.',\n 'https://docs.fun.xyz',\n )\n }\n return url\n}\n\nexport async function getMoonpayOffRampUrl({\n walletAddr,\n apiKey,\n}: GetMoonpayOffRampUrlRequest): Promise<string> {\n const url: string = (\n await sendGetRequest({\n uri: `${API_BASE_URL}/off-ramp/${walletAddr}?provider=moonpay`,\n apiKey,\n })\n )?.url\n if (!url) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n 'No offramp url found.',\n { walletAddr },\n 'This is an internal error, please contact support.',\n 'https://docs.fun.xyz',\n )\n }\n return url\n}\n\nexport async function getMoonpayOnRampSupportedCurrencies({\n apiKey,\n}: {\n apiKey: string\n}): Promise<MoonpayCurrency[]> {\n const currencies: MoonpayCurrency[] = await sendGetRequest({\n uri: `${API_BASE_URL}/on-ramp/moonpay-currencies`,\n apiKey,\n })\n if (!currencies || !currencies.length) {\n throw new InternalFailureError(\n ErrorCode.UnknownServerError,\n 'No supported currencies found.',\n {},\n 'This is an internal error, please contact support.',\n 'https://docs.fun.xyz',\n )\n }\n return currencies\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendGetRequest, sendPostRequest } from '../../utils'\nimport {\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 apiKey,\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 apiKey,\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 apiKey,\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 apiKey,\n })\n return newBuySessionResp as CreateStripeBuySessionResponse\n}\n\nexport async function getStripeBuySession({\n sessionId,\n apiKey,\n}: {\n sessionId: string\n apiKey: 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 apiKey,\n })\n return buySessionResp as CreateStripeBuySessionResponse\n}\n", "import { API_BASE_URL } from '../../consts'\nimport { sendPostRequest } from '../../utils'\nimport { SendSupportMessageRequest } from './types'\n\nexport async function sendSupportMessage({\n title,\n description,\n userEmail,\n apiKey,\n}: SendSupportMessageRequest): Promise<boolean> {\n try {\n await sendPostRequest({\n uri: `${API_BASE_URL}/support/send-message`,\n body: { title, description, userEmail },\n apiKey,\n retryOptions: { maxAttempts: 1 },\n })\n return true\n } catch (err) {\n return false\n }\n}\n"],
5
+ "mappings": ";AAAO,IAAM,eACX,QACI,mCACA,QACA,mCACA,QACA;AAAA;AAAA,EAEA;AAAA;AAEC,IAAM,iBAAiB;;;ACV9B,IAAM,UAAU;AACT,IAAM,YAAN,cAAwB,MAAM;AAAA,EAGnC,YACS,UACA,MACA,MACP,KAEO,YACP,eACA,SACA,aAAa,OACb;AACA,UAAM,GAAG,GAAG;AAAA;AAAA,EAAO,aAAa;AAAA,QAAW,OAAO;AAAA,WAAc,OAAO,EAAE;AAVlE;AACA;AACA;AAGA;AAMP,QAAI,YAAY;AACd,WAAK,QAAQ;AAAA,IACf;AACA,SAAK,WAAW;AAChB,SAAK,aAAY,oBAAI,KAAK,GAAE,YAAY;AAAA,EAC1C;AAAA,EAEA,UAAU;AACR,SAAK,WACH;AAAA,EACJ;AACF;;;AC3BA;AAAA,EACE,MAAQ;AAAA,IACN,MAAQ;AAAA,IACR,YAAc;AAAA,EAChB;AAAA,EACA,OAAS;AAAA,IACP,MAAQ;AAAA,IACR,YAAc;AAAA,EAChB;AAAA,EACA,OAAS;AAAA,IACP,MAAQ;AAAA,IACR,YAAc;AAAA,EAChB;AAAA,EACA,OAAS;AAAA,IACP,MAAQ;AAAA,IACR,YAAc;AAAA,EAChB;AAAA,EACA,OAAS;AAAA,IACP,MAAQ;AAAA,IACR,YAAc;AAAA,EAChB;AAAA,EACA,OAAS;AAAA,IACP,MAAQ;AAAA,IACR,YAAc;AAAA,EAChB;AAAA,EACA,OAAS;AAAA,IACP,MAAQ;AAAA,IACR,YAAc;AAAA,EAChB;AAAA,EACA,OAAS;AAAA,IACP,MAAQ;AAAA,IACR,YAAc;AAAA,EAChB;AAAA,E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AAC,kBAAkB,GAAG;AAAA,IACxB;AAAA,IACA,GAAI,oBAAoB,EAAE,kBAAkB,IAAI,CAAC;AAAA,EACnD;AACA,QAAM,oBAAoB,MAAM,gBAAgB;AAAA,IAC9C,KAAK,GAAG,YAAY;AAAA,IACpB;AAAA,IACA,cAAc,EAAE,aAAa,EAAE;AAAA,IAC/B;AAAA,EACF,CAAC;AACD,SAAO;AACT;AAEA,eAAsB,oBAAoB;AAAA,EACxC;AAAA,EACA;AACF,GAG4C;AAC1C,QAAM,iBAAiB,MAAM,eAAe;AAAA,IAC1C,KAAK,GAAG,YAAY,oCAAoC,SAAS;AAAA,IACjE,cAAc,EAAE,aAAa,EAAE;AAAA,IAC/B;AAAA,EACF,CAAC;AACD,SAAO;AACT;;;AC9EA,eAAsB,mBAAmB;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAgD;AAC9C,MAAI;AACF,UAAM,gBAAgB;AAAA,MACpB,KAAK,GAAG,YAAY;AAAA,MACpB,MAAM,EAAE,OAAO,aAAa,UAAU;AAAA,MACtC;AAAA,MACA,cAAc,EAAE,aAAa,EAAE;AAAA,IACjC,CAAC;AACD,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,WAAO;AAAA,EACT;AACF;",
6
6
  "names": ["ErrorBaseType", "ErrorType", "ErrorCode", "toHex", "toHex", "CheckoutState", "MeshExecuteTransferStatus", "MeshExecuteTransferMfaType"]
7
7
  }
@@ -5,6 +5,7 @@ export interface BaseRequest {
5
5
  apiKey: string;
6
6
  retryOptions?: RetryOptions;
7
7
  body?: object;
8
+ signal?: AbortSignal;
8
9
  }
9
10
  export type GetRequest = Omit<BaseRequest, 'body' | 'method'>;
10
11
  export type PostRequest = Omit<BaseRequest, 'method'>;
@@ -15,8 +15,9 @@ export declare function getAssetPriceInfo({ chainId, assetTokenAddress, apiKey,
15
15
  * @param walletAddress
16
16
  * @param onlyVerifiedTokens If true, only return alchemy tokens that are verified(filters spam)
17
17
  * @param apiKey
18
+ * @param signal AbortSignal to cancel the request when no longer needed
18
19
  */
19
- export declare function getAllWalletTokens({ walletAddress, onlyVerifiedTokens, apiKey, }: GetAllWalletTokensRequest): Promise<GetAllWalletTokensResponse>;
20
+ export declare function getAllWalletTokens({ walletAddress, onlyVerifiedTokens, apiKey, signal, }: GetAllWalletTokensRequest): Promise<GetAllWalletTokensResponse>;
20
21
  /**
21
22
  * Get all tokens for a given wallet address on a specific chain
22
23
  * @param chainId https://chainlist.org/
@@ -13,6 +13,7 @@ export interface GetAllWalletTokensRequest {
13
13
  walletAddress: string;
14
14
  onlyVerifiedTokens: boolean;
15
15
  apiKey: string;
16
+ signal?: AbortSignal;
16
17
  }
17
18
  export interface AssetBalanceInfo {
18
19
  chainId: string;
@@ -27,40 +27,48 @@ export declare function deactivateCheckout({ depositAddress, apiKey, }: Checkout
27
27
  * Gets a checkout given a depositAddress
28
28
  * @param depositAddress A unique deposit address associated with a backend checkout item.
29
29
  * @param apiKey A valid fun api key.
30
+ * @param signal AbortSignal to cancel the request when no longer needed
30
31
  * @returns The checkout object if exists. Otherwise, null.
31
32
  */
32
- export declare function getCheckoutByDepositAddress({ depositAddress, apiKey, }: {
33
+ export declare function getCheckoutByDepositAddress({ depositAddress, apiKey, signal, }: {
33
34
  depositAddress: Address;
34
35
  apiKey: string;
36
+ signal?: AbortSignal;
35
37
  }): Promise<CheckoutHistoryItem | null>;
36
38
  /**
37
39
  * Gets all checkouts associated with a funWallet
38
40
  * @param funWalletAddress A funWallet address.
39
41
  * @param apiKey A valid fun api key.
42
+ * @param signal AbortSignal to cancel the request when no longer needed
40
43
  * @returns A list of checkout objects if exists. Otherwise, an empty array.
41
44
  */
42
- export declare function getCheckoutsByFunWalletAddress({ funWalletAddress, apiKey, }: {
45
+ export declare function getCheckoutsByFunWalletAddress({ funWalletAddress, apiKey, signal, }: {
43
46
  funWalletAddress: Address;
44
47
  apiKey: string;
48
+ signal?: AbortSignal;
45
49
  }): Promise<CheckoutHistoryItem[]>;
46
50
  /**
47
51
  * Gets all checkouts associated with a recipient address
48
52
  * @param recipientAddress A wallet address.
49
53
  * @param apiKey A valid fun api key.
54
+ * @param signal AbortSignal to cancel the request when no longer needed
50
55
  * @returns A list of checkout objects if exists. Otherwise, an empty array.
51
56
  */
52
- export declare function getCheckoutsByRecipientAddress({ recipientAddress, apiKey, }: {
57
+ export declare function getCheckoutsByRecipientAddress({ recipientAddress, apiKey, signal, }: {
53
58
  recipientAddress: Address;
54
59
  apiKey: string;
60
+ signal?: AbortSignal;
55
61
  }): Promise<CheckoutHistoryItem[]>;
56
62
  /**
57
63
  * Gets all checkouts associated with a funkit userId string
58
64
  * @param userId A userId string.
59
65
  * @param apiKey A valid fun api key.
66
+ * @param signal AbortSignal to cancel the request when no longer needed
60
67
  * @returns A list of checkout objects if exists. Otherwise, an empty array.
61
68
  */
62
- export declare function getCheckoutsByUserId({ userId, apiKey, }: {
69
+ export declare function getCheckoutsByUserId({ userId, apiKey, signal, }: {
63
70
  userId: string;
64
71
  apiKey: string;
72
+ signal?: AbortSignal;
65
73
  }): Promise<CheckoutHistoryItem[]>;
66
74
  export declare function getPaymasterDataForCheckoutSponsoredTransfer({ depositAddress, transferUserOp, apiKey, }: CheckoutTransferSponsorshipParams): Promise<CheckoutTransferSponsorshipResponse>;
@@ -5,4 +5,3 @@ export * from './mesh';
5
5
  export * from './moonpay';
6
6
  export * from './stripe';
7
7
  export * from './support';
8
- export * from './turnkey';
@@ -1,8 +1,8 @@
1
1
  import { BaseRequest } from '../consts/request';
2
2
  import { BaseResponse } from '../consts/retry';
3
3
  import { DeleteRequest, GetRequest, PostRequest, PutRequest } from './../consts/request';
4
- export declare const sendRequest: ({ uri, method, apiKey, body, retryOptions, }: BaseRequest) => Promise<BaseResponse>;
5
- export declare function sendGetRequest({ uri, apiKey, retryOptions, }: GetRequest): Promise<BaseResponse>;
6
- export declare function sendPostRequest({ uri, body, apiKey, retryOptions, }: PostRequest): Promise<BaseResponse>;
7
- export declare function sendDeleteRequest({ uri, apiKey, retryOptions, }: DeleteRequest): Promise<void>;
8
- export declare function sendPutRequest({ uri, body, apiKey, retryOptions, }: PutRequest): Promise<BaseResponse>;
4
+ export declare const sendRequest: ({ uri, method, apiKey, body, retryOptions, signal, }: BaseRequest) => Promise<BaseResponse>;
5
+ export declare function sendGetRequest({ uri, apiKey, retryOptions, signal, }: GetRequest): Promise<BaseResponse>;
6
+ export declare function sendPostRequest({ uri, body, apiKey, retryOptions, signal, }: PostRequest): Promise<BaseResponse>;
7
+ export declare function sendDeleteRequest({ uri, apiKey, retryOptions, signal, }: DeleteRequest): Promise<void>;
8
+ export declare function sendPutRequest({ uri, body, apiKey, retryOptions, signal, }: PutRequest): Promise<BaseResponse>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/api-base",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Base API for Funkit",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,3 +0,0 @@
1
- import { CreateTurnkeyPrivateKeyRequest, CreateTurnkeyPrivateKeyResponse, CreateTurnkeySubOrgRequest } from './types';
2
- export declare function createTurnkeySubOrg({ createSubOrgRequest, apiKey, }: CreateTurnkeySubOrgRequest): Promise<string>;
3
- export declare function createTurnkeyPrivateKey({ signedRequest, apiKey, }: CreateTurnkeyPrivateKeyRequest): Promise<CreateTurnkeyPrivateKeyResponse>;
@@ -1,2 +0,0 @@
1
- export * from './endpoints';
2
- export * from './types';
@@ -1,12 +0,0 @@
1
- export interface CreateTurnkeySubOrgRequest {
2
- apiKey: string;
3
- createSubOrgRequest: object;
4
- }
5
- export interface CreateTurnkeyPrivateKeyRequest {
6
- apiKey: string;
7
- signedRequest: object;
8
- }
9
- export interface CreateTurnkeyPrivateKeyResponse {
10
- id: string;
11
- address: string;
12
- }