@funkit/core 0.9.0 → 0.10.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.
Files changed (205) hide show
  1. package/dist/fetch-polyfill.js.map +1 -1
  2. package/dist/index.d.ts +12 -12
  3. package/dist/src/abis/CheckoutPaymaster.json +1 -0
  4. package/dist/src/actions/AccessControl.d.ts +6 -6
  5. package/dist/src/actions/AccessControl.js +19 -15
  6. package/dist/src/actions/AccessControl.js.map +1 -1
  7. package/dist/src/actions/BatchActions.d.ts +2 -2
  8. package/dist/src/actions/BatchActions.js +2 -2
  9. package/dist/src/actions/BatchActions.js.map +1 -1
  10. package/dist/src/actions/Bridge.d.ts +4 -4
  11. package/dist/src/actions/Bridge.js +10 -6
  12. package/dist/src/actions/Bridge.js.map +1 -1
  13. package/dist/src/actions/FirstClassActions.d.ts +6 -6
  14. package/dist/src/actions/FirstClassActions.js +25 -23
  15. package/dist/src/actions/FirstClassActions.js.map +1 -1
  16. package/dist/src/actions/Group.d.ts +3 -3
  17. package/dist/src/actions/Group.js +6 -14
  18. package/dist/src/actions/Group.js.map +1 -1
  19. package/dist/src/actions/LimitOrder.d.ts +3 -3
  20. package/dist/src/actions/LimitOrder.js +16 -13
  21. package/dist/src/actions/LimitOrder.js.map +1 -1
  22. package/dist/src/actions/Stake.d.ts +3 -3
  23. package/dist/src/actions/Stake.js +31 -44
  24. package/dist/src/actions/Stake.js.map +1 -1
  25. package/dist/src/actions/Swap.d.ts +4 -4
  26. package/dist/src/actions/Swap.js +37 -35
  27. package/dist/src/actions/Swap.js.map +1 -1
  28. package/dist/src/actions/Token.d.ts +3 -3
  29. package/dist/src/actions/Token.js +33 -23
  30. package/dist/src/actions/Token.js.map +1 -1
  31. package/dist/src/actions/index.d.ts +7 -7
  32. package/dist/src/actions/types.d.ts +4 -4
  33. package/dist/src/actions/types.js +2 -2
  34. package/dist/src/actions/types.js.map +1 -1
  35. package/dist/src/apis/AccessControlApis.d.ts +1 -1
  36. package/dist/src/apis/AccessControlApis.js +7 -3
  37. package/dist/src/apis/AccessControlApis.js.map +1 -1
  38. package/dist/src/apis/AssetApis.d.ts +10 -0
  39. package/dist/src/apis/AssetApis.js +11 -1
  40. package/dist/src/apis/AssetApis.js.map +1 -1
  41. package/dist/src/apis/BridgeApis.d.ts +1 -1
  42. package/dist/src/apis/BridgeApis.js +13 -13
  43. package/dist/src/apis/BridgeApis.js.map +1 -1
  44. package/dist/src/apis/CheckoutApis.d.ts +43 -0
  45. package/dist/src/apis/CheckoutApis.js +116 -0
  46. package/dist/src/apis/CheckoutApis.js.map +1 -0
  47. package/dist/src/apis/ContractApis.js +1 -1
  48. package/dist/src/apis/ContractApis.js.map +1 -1
  49. package/dist/src/apis/FaucetApis.js.map +1 -1
  50. package/dist/src/apis/GroupApis.d.ts +2 -2
  51. package/dist/src/apis/GroupApis.js +3 -3
  52. package/dist/src/apis/GroupApis.js.map +1 -1
  53. package/dist/src/apis/InfoApis.d.ts +1 -1
  54. package/dist/src/apis/InfoApis.js +9 -7
  55. package/dist/src/apis/InfoApis.js.map +1 -1
  56. package/dist/src/apis/ListenerApis.d.ts +1 -1
  57. package/dist/src/apis/ListenerApis.js +6 -6
  58. package/dist/src/apis/ListenerApis.js.map +1 -1
  59. package/dist/src/apis/MeshApis.d.ts +87 -0
  60. package/dist/src/apis/MeshApis.js +213 -0
  61. package/dist/src/apis/MeshApis.js.map +1 -0
  62. package/dist/src/apis/NFTApis.js.map +1 -1
  63. package/dist/src/apis/OnOffRampApis.d.ts +2 -0
  64. package/dist/src/apis/OnOffRampApis.js +24 -5
  65. package/dist/src/apis/OnOffRampApis.js.map +1 -1
  66. package/dist/src/apis/OnOffRampUtils.js +2 -2
  67. package/dist/src/apis/OnOffRampUtils.js.map +1 -1
  68. package/dist/src/apis/OperationApis.d.ts +4 -4
  69. package/dist/src/apis/OperationApis.js +21 -12
  70. package/dist/src/apis/OperationApis.js.map +1 -1
  71. package/dist/src/apis/PaymasterApis.d.ts +1 -1
  72. package/dist/src/apis/PaymasterApis.js +2 -2
  73. package/dist/src/apis/PaymasterApis.js.map +1 -1
  74. package/dist/src/apis/SwapApis.d.ts +2 -2
  75. package/dist/src/apis/SwapApis.js +6 -6
  76. package/dist/src/apis/SwapApis.js.map +1 -1
  77. package/dist/src/apis/TurnkeyApis.d.ts +1 -1
  78. package/dist/src/apis/TurnkeyApis.js +3 -3
  79. package/dist/src/apis/TurnkeyApis.js.map +1 -1
  80. package/dist/src/apis/UserApis.d.ts +2 -2
  81. package/dist/src/apis/UserApis.js +10 -7
  82. package/dist/src/apis/UserApis.js.map +1 -1
  83. package/dist/src/apis/index.d.ts +13 -11
  84. package/dist/src/apis/index.js +3 -1
  85. package/dist/src/apis/index.js.map +1 -1
  86. package/dist/src/apis/types.d.ts +75 -3
  87. package/dist/src/apis/types.js +16 -0
  88. package/dist/src/apis/types.js.map +1 -1
  89. package/dist/src/auth/Auth.d.ts +6 -6
  90. package/dist/src/auth/Auth.js +43 -46
  91. package/dist/src/auth/Auth.js.map +1 -1
  92. package/dist/src/auth/SessionKeyAuth.d.ts +5 -5
  93. package/dist/src/auth/SessionKeyAuth.js +29 -24
  94. package/dist/src/auth/SessionKeyAuth.js.map +1 -1
  95. package/dist/src/auth/index.d.ts +2 -2
  96. package/dist/src/auth/types.d.ts +1 -1
  97. package/dist/src/common/constants.d.ts +110 -17
  98. package/dist/src/common/constants.js +158 -85
  99. package/dist/src/common/constants.js.map +1 -1
  100. package/dist/src/common/index.d.ts +2 -2
  101. package/dist/src/common/types.d.ts +2 -2
  102. package/dist/src/config/Config.d.ts +1 -1
  103. package/dist/src/config/Config.js +10 -4
  104. package/dist/src/config/Config.js.map +1 -1
  105. package/dist/src/config/index.d.ts +2 -2
  106. package/dist/src/config/types.d.ts +4 -2
  107. package/dist/src/data/Chain.d.ts +4 -4
  108. package/dist/src/data/Chain.js +38 -27
  109. package/dist/src/data/Chain.js.map +1 -1
  110. package/dist/src/data/NFT.d.ts +3 -3
  111. package/dist/src/data/NFT.js +11 -11
  112. package/dist/src/data/NFT.js.map +1 -1
  113. package/dist/src/data/Operation.d.ts +5 -5
  114. package/dist/src/data/Operation.js +12 -10
  115. package/dist/src/data/Operation.js.map +1 -1
  116. package/dist/src/data/SolidityData.d.ts +3 -3
  117. package/dist/src/data/SolidityData.js +37 -17
  118. package/dist/src/data/SolidityData.js.map +1 -1
  119. package/dist/src/data/Token.d.ts +4 -4
  120. package/dist/src/data/Token.js +9 -9
  121. package/dist/src/data/Token.js.map +1 -1
  122. package/dist/src/data/index.d.ts +6 -6
  123. package/dist/src/data/index.js +2 -2
  124. package/dist/src/data/index.js.map +1 -1
  125. package/dist/src/data/types.d.ts +2 -2
  126. package/dist/src/data/types.js +3 -3
  127. package/dist/src/data/types.js.map +1 -1
  128. package/dist/src/errors/BaseError.js +4 -3
  129. package/dist/src/errors/BaseError.js.map +1 -1
  130. package/dist/src/errors/ClientError.d.ts +1 -1
  131. package/dist/src/errors/ClientError.js +3 -3
  132. package/dist/src/errors/ClientError.js.map +1 -1
  133. package/dist/src/errors/ServerError.d.ts +1 -1
  134. package/dist/src/errors/ServerError.js.map +1 -1
  135. package/dist/src/errors/index.d.ts +4 -4
  136. package/dist/src/errors/types.d.ts +2 -1
  137. package/dist/src/errors/types.js +4 -3
  138. package/dist/src/errors/types.js.map +1 -1
  139. package/dist/src/sponsors/CheckoutSponsor.d.ts +23 -0
  140. package/dist/src/sponsors/CheckoutSponsor.js +65 -0
  141. package/dist/src/sponsors/CheckoutSponsor.js.map +1 -0
  142. package/dist/src/sponsors/GaslessSponsor.d.ts +4 -4
  143. package/dist/src/sponsors/GaslessSponsor.js +18 -15
  144. package/dist/src/sponsors/GaslessSponsor.js.map +1 -1
  145. package/dist/src/sponsors/Sponsor.d.ts +5 -5
  146. package/dist/src/sponsors/Sponsor.js +12 -11
  147. package/dist/src/sponsors/Sponsor.js.map +1 -1
  148. package/dist/src/sponsors/TokenSponsor.d.ts +7 -7
  149. package/dist/src/sponsors/TokenSponsor.js +75 -68
  150. package/dist/src/sponsors/TokenSponsor.js.map +1 -1
  151. package/dist/src/sponsors/index.d.ts +4 -3
  152. package/dist/src/sponsors/index.js +2 -1
  153. package/dist/src/sponsors/index.js.map +1 -1
  154. package/dist/src/sponsors/types.d.ts +2 -1
  155. package/dist/src/sponsors/types.js +2 -1
  156. package/dist/src/sponsors/types.js.map +1 -1
  157. package/dist/src/utils/ApiUtils.js +21 -19
  158. package/dist/src/utils/ApiUtils.js.map +1 -1
  159. package/dist/src/utils/AuthUtils.d.ts +1 -1
  160. package/dist/src/utils/AuthUtils.js +4 -4
  161. package/dist/src/utils/AuthUtils.js.map +1 -1
  162. package/dist/src/utils/ChainUtils.d.ts +5 -5
  163. package/dist/src/utils/ChainUtils.js +35 -20
  164. package/dist/src/utils/ChainUtils.js.map +1 -1
  165. package/dist/src/utils/CheckoutUtils.d.ts +6 -0
  166. package/dist/src/utils/CheckoutUtils.js +24 -0
  167. package/dist/src/utils/CheckoutUtils.js.map +1 -0
  168. package/dist/src/utils/GroupUtils.d.ts +3 -3
  169. package/dist/src/utils/GroupUtils.js +8 -8
  170. package/dist/src/utils/GroupUtils.js.map +1 -1
  171. package/dist/src/utils/MerkleUtils.d.ts +1 -1
  172. package/dist/src/utils/MerkleUtils.js +5 -5
  173. package/dist/src/utils/MerkleUtils.js.map +1 -1
  174. package/dist/src/utils/PaymasterUtils.d.ts +3 -3
  175. package/dist/src/utils/PaymasterUtils.js +6 -2
  176. package/dist/src/utils/PaymasterUtils.js.map +1 -1
  177. package/dist/src/utils/SwapUtils.d.ts +2 -2
  178. package/dist/src/utils/SwapUtils.js +42 -33
  179. package/dist/src/utils/SwapUtils.js.map +1 -1
  180. package/dist/src/utils/TypeUtils.js.map +1 -1
  181. package/dist/src/utils/UserOpUtils.d.ts +2 -2
  182. package/dist/src/utils/UserOpUtils.js +77 -65
  183. package/dist/src/utils/UserOpUtils.js.map +1 -1
  184. package/dist/src/utils/ViemUtils.d.ts +2 -2
  185. package/dist/src/utils/ViemUtils.js +10 -6
  186. package/dist/src/utils/ViemUtils.js.map +1 -1
  187. package/dist/src/utils/WalletUtils.d.ts +2 -2
  188. package/dist/src/utils/WalletUtils.js +6 -5
  189. package/dist/src/utils/WalletUtils.js.map +1 -1
  190. package/dist/src/utils/index.d.ts +8 -7
  191. package/dist/src/utils/index.js +1 -0
  192. package/dist/src/utils/index.js.map +1 -1
  193. package/dist/src/viem/ContractInterface.d.ts +4 -4
  194. package/dist/src/viem/ContractInterface.js +8 -8
  195. package/dist/src/viem/ContractInterface.js.map +1 -1
  196. package/dist/src/viem/Converter.d.ts +823 -1107
  197. package/dist/src/viem/Converter.js +11 -11
  198. package/dist/src/viem/Converter.js.map +1 -1
  199. package/dist/src/viem/index.d.ts +2 -2
  200. package/dist/src/wallet/FunWallet.d.ts +8 -8
  201. package/dist/src/wallet/FunWallet.js +133 -89
  202. package/dist/src/wallet/FunWallet.js.map +1 -1
  203. package/dist/src/wallet/index.d.ts +2 -2
  204. package/dist/src/wallet/types.d.ts +1 -1
  205. package/package.json +13 -5
@@ -6,54 +6,54 @@ const errors_1 = require("../errors");
6
6
  const ApiUtils_1 = require("../utils/ApiUtils");
7
7
  async function getSocketBridgeQuote(recipient, walletAddress, fromChain, toChain, fromToken, toToken, amount, sort) {
8
8
  const params = new URLSearchParams({
9
- recipient: recipient,
9
+ recipient,
10
10
  fromChainId: fromChain,
11
11
  fromTokenAddress: fromToken,
12
12
  toChainId: toChain,
13
13
  toTokenAddress: toToken,
14
14
  fromAmount: amount.toString(),
15
15
  userAddress: walletAddress,
16
- uniqueRoutesPerBridge: "true",
16
+ uniqueRoutesPerBridge: 'true',
17
17
  sort,
18
- singleTxOnly: "true"
18
+ singleTxOnly: 'true',
19
19
  }).toString();
20
20
  const quote = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `bridge/quote/?${params}`);
21
21
  if (!quote.success || quote.result.routes.length === 0) {
22
- throw new errors_1.ResourceNotFoundError(errors_1.ErrorCode.BridgeRouteNotFound, "Unable to find a route for these assets between these chains", { walletAddress, fromChain, toChain, fromToken, toToken, amount, sort }, "Try another route with a different asset pair", "https://docs.fun.xyz");
22
+ throw new errors_1.ResourceNotFoundError(errors_1.ErrorCode.BridgeRouteNotFound, 'Unable to find a route for these assets between these chains', { walletAddress, fromChain, toChain, fromToken, toToken, amount, sort }, 'Try another route with a different asset pair', 'https://docs.fun.xyz');
23
23
  }
24
24
  const route = quote.result.routes[0];
25
25
  return route;
26
26
  }
27
27
  exports.getSocketBridgeQuote = getSocketBridgeQuote;
28
28
  async function getSocketBridgeTransaction(route) {
29
- return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "bridge/build-tx/", { route });
29
+ return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'bridge/build-tx/', { route });
30
30
  }
31
31
  exports.getSocketBridgeTransaction = getSocketBridgeTransaction;
32
32
  async function getSocketBridgeAllowance(chainId, sender, allowanceTarget, token) {
33
33
  const params = new URLSearchParams({
34
- chainId: chainId,
34
+ chainId,
35
35
  owner: sender,
36
- allowanceTarget: allowanceTarget,
37
- tokenAddress: token
36
+ allowanceTarget,
37
+ tokenAddress: token,
38
38
  }).toString();
39
39
  const json = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `bridge/approval/check-allowance/?${params}`);
40
40
  if (!json.result.value) {
41
- throw new errors_1.ResourceNotFoundError(errors_1.ErrorCode.BridgeAllowanceDataNotFound, "Unable to get allowance data", { chainId, sender, allowanceTarget, token }, "Make sure the chainId, sender, allowanceTarget, and token are correct", "https://docs.fun.xyz");
41
+ throw new errors_1.ResourceNotFoundError(errors_1.ErrorCode.BridgeAllowanceDataNotFound, 'Unable to get allowance data', { chainId, sender, allowanceTarget, token }, 'Make sure the chainId, sender, allowanceTarget, and token are correct', 'https://docs.fun.xyz');
42
42
  }
43
43
  return json;
44
44
  }
45
45
  exports.getSocketBridgeAllowance = getSocketBridgeAllowance;
46
46
  async function getSocketBridgeApproveTransaction(chainId, sender, allowanceTarget, token, amount) {
47
47
  const params = new URLSearchParams({
48
- chainId: chainId,
48
+ chainId,
49
49
  owner: sender,
50
- allowanceTarget: allowanceTarget,
50
+ allowanceTarget,
51
51
  tokenAddress: token,
52
- amount: amount.toString()
52
+ amount: amount.toString(),
53
53
  }).toString();
54
54
  const json = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `bridge/approval/build-tx/?${params}`);
55
55
  if (!json.result) {
56
- throw new errors_1.ResourceNotFoundError(errors_1.ErrorCode.BridgeApproveTxDataNotFound, "Unable to build the approve transaction data", { chainId, sender, allowanceTarget, token, amount }, "Make sure the token and allowance are valid values", "https://docs.fun.xyz");
56
+ throw new errors_1.ResourceNotFoundError(errors_1.ErrorCode.BridgeApproveTxDataNotFound, 'Unable to build the approve transaction data', { chainId, sender, allowanceTarget, token, amount }, 'Make sure the token and allowance are valid values', 'https://docs.fun.xyz');
57
57
  }
58
58
  return json;
59
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BridgeApis.js","sourceRoot":"","sources":["../../../src/apis/BridgeApis.ts"],"names":[],"mappings":";;;AACA,mDAA6C;AAC7C,sCAA4D;AAC5D,gDAAmE;AAE5D,KAAK,UAAU,oBAAoB,CACtC,SAAiB,EACjB,aAAqB,EACrB,SAAiB,EACjB,OAAe,EACf,SAAiB,EACjB,OAAe,EACf,MAAc,EACd,IAAY;IAEZ,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QAC/B,SAAS,EAAE,SAAS;QACpB,WAAW,EAAE,SAAS;QACtB,gBAAgB,EAAE,SAAS;QAC3B,SAAS,EAAE,OAAO;QAClB,cAAc,EAAE,OAAO;QACvB,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE;QAC7B,WAAW,EAAE,aAAa;QAC1B,qBAAqB,EAAE,MAAM;QAC7B,IAAI;QACJ,YAAY,EAAE,MAAM;KACvB,CAAC,CAAC,QAAQ,EAAE,CAAA;IACb,MAAM,KAAK,GAAG,MAAM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A2B,EACrC,8BAA8B,EAC9B,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,EAC3C,uEAAuE,EACvE,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AA1BD,4DA0BC;AAEM,KAAK,UAAU,iCAAiC,CACrD,OAAe,EACf,MAAe,EACf,eAAuB,EACvB,KAAa,EACb,MAAc;IAEd,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QACjC,OAAO;QACP,KAAK,EAAE,MAAM;QACb,eAAe;QACf,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;KAC1B,CAAC,CAAC,QAAQ,EAAE,CAAA;IACb,MAAM,IAAI,GAAG,MAAM,IAAA,yBAAc,EAC/B,mBAAO,EACP,6BAA6B,MAAM,EAAE,CACtC,CAAA;IACD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACjB,MAAM,IAAI,8BAAqB,CAC7B,kBAAS,CAAC,2BAA2B,EACrC,8CAA8C,EAC9C,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,EACnD,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AA5BD,8EA4BC"}
@@ -0,0 +1,43 @@
1
+ import { Address } from 'viem';
2
+ import { CheckoutCoreInitParams, CheckoutCoreQuoteParams, CheckoutCoreQuoteResponse, CheckoutHistoryItem } from './types';
3
+ /**
4
+ * Gets a checkout quote (estimation).
5
+ * @param fromChainId The ID of the chain where funds will be provided from.
6
+ * @param fromTokenAddress The asset to fund the checkout. This must be either a chain native token or an ERC-20, on the fromChainId.
7
+ * @param toChainId The ID of the chain where the checkout operation is to be performed.
8
+ * @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.
9
+ * @param toTokenAmount The amount of wanted asset for the checkout operation in base units.
10
+ * @param expirationTimestampMs The amount of time (duration) from now before the checkout operation expires.
11
+ * @param apiKey A valid fun api key.
12
+ * @return {Promise<CheckoutCoreQuoteResponse>} The formatted quote object
13
+ */
14
+ export declare function getCheckoutQuote({ fromChainId, fromTokenAddress, toChainId, toTokenAddress, toTokenAmount, expirationTimestampMs, apiKey, }: CheckoutCoreQuoteParams): Promise<CheckoutCoreQuoteResponse>;
15
+ /**
16
+ * Initializes a checkout
17
+ * @param userOp The checkout UserOp, signed.
18
+ * @param quoteId The quoteId specific to the checkout.
19
+ * @param apiKey A valid fun api key.
20
+ * @return {Address} The generated deposit address
21
+ */
22
+ export declare function initializeCheckout({ userOp, quoteId, apiKey, clientMetadata, }: CheckoutCoreInitParams): Promise<Address>;
23
+ /**
24
+ * Gets a checkout given a depositAddress
25
+ * @param depositAddress A unique deposit address associated with a backend checkout item.
26
+ * @param apiKey A valid fun api key.
27
+ * // TODO: Return interface
28
+ * @returns The checkout object if exists. Otherwise, null.
29
+ */
30
+ export declare function getCheckoutByDepositAddress({ depositAddress, apiKey, }: {
31
+ depositAddress: Address;
32
+ apiKey: string;
33
+ }): Promise<any>;
34
+ /**
35
+ * Gets all checkouts associated with a funWallet
36
+ * @param funWalletAddress A funWallet address.
37
+ * @param apiKey A valid fun api key.
38
+ * @returns A list of checkout objects if exists. Otherwise, an empty array.
39
+ */
40
+ export declare function getCheckoutsByFunWalletAddress({ funWalletAddress, apiKey, }: {
41
+ funWalletAddress: Address;
42
+ apiKey: string;
43
+ }): Promise<CheckoutHistoryItem[]>;
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getCheckoutsByFunWalletAddress = exports.getCheckoutByDepositAddress = exports.initializeCheckout = exports.getCheckoutQuote = void 0;
7
+ const big_js_1 = __importDefault(require("big.js"));
8
+ const constants_1 = require("../common/constants");
9
+ const errors_1 = require("../errors");
10
+ const ApiUtils_1 = require("../utils/ApiUtils");
11
+ const CheckoutUtils_1 = require("../utils/CheckoutUtils");
12
+ /**
13
+ * Gets a checkout quote (estimation).
14
+ * @param fromChainId The ID of the chain where funds will be provided from.
15
+ * @param fromTokenAddress The asset to fund the checkout. This must be either a chain native token or an ERC-20, on the fromChainId.
16
+ * @param toChainId The ID of the chain where the checkout operation is to be performed.
17
+ * @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.
18
+ * @param toTokenAmount The amount of wanted asset for the checkout operation in base units.
19
+ * @param expirationTimestampMs The amount of time (duration) from now before the checkout operation expires.
20
+ * @param apiKey A valid fun api key.
21
+ * @return {Promise<CheckoutCoreQuoteResponse>} The formatted quote object
22
+ */
23
+ async function getCheckoutQuote({ fromChainId, fromTokenAddress, toChainId, toTokenAddress, toTokenAmount, expirationTimestampMs, apiKey, }) {
24
+ const toDecimals = await (0, CheckoutUtils_1.getDecimals)({
25
+ chainId: toChainId,
26
+ tokenAddress: toTokenAddress,
27
+ });
28
+ const toMultipler = 10 ** toDecimals;
29
+ const queryParams = {
30
+ fromChainId,
31
+ fromTokenAddress,
32
+ toChainId,
33
+ toTokenAddress,
34
+ toAmountBaseUnit: (toTokenAmount * toMultipler).toString(),
35
+ checkoutExpirationTimestampSeconds: Math.round((Date.now() + expirationTimestampMs) / 1000).toString(),
36
+ };
37
+ const searchParams = new URLSearchParams(queryParams);
38
+ const url = `checkout/quote?${searchParams}`;
39
+ const quoteRes = (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, url, apiKey));
40
+ const fromDecimals = await (0, CheckoutUtils_1.getDecimals)({
41
+ chainId: fromChainId,
42
+ tokenAddress: fromTokenAddress,
43
+ });
44
+ const fromMultipler = 10 ** fromDecimals;
45
+ // Format the response for frontend usage
46
+ return {
47
+ quoteId: quoteRes.quoteId,
48
+ fromTokenAddress: quoteRes.fromTokenAddress,
49
+ estFeesUsd: quoteRes.estFeesUsd,
50
+ estTotalUsd: quoteRes.estTotalUsd,
51
+ estCheckoutTimeMs: quoteRes.estCheckoutTimeMs,
52
+ estTotalFromAmountBaseUnit: quoteRes.estTotalFromAmountBaseUnit,
53
+ estFeesFromAmountBaseUnit: quoteRes.estFeesFromAmountBaseUnit,
54
+ // Added fields
55
+ estFeesFromAmount: new big_js_1.default(quoteRes.estFeesFromAmountBaseUnit)
56
+ .div(fromMultipler)
57
+ .toString(),
58
+ estTotalFromAmount: new big_js_1.default(quoteRes.estTotalFromAmountBaseUnit)
59
+ .div(fromMultipler)
60
+ .toString(),
61
+ };
62
+ }
63
+ exports.getCheckoutQuote = getCheckoutQuote;
64
+ /**
65
+ * Initializes a checkout
66
+ * @param userOp The checkout UserOp, signed.
67
+ * @param quoteId The quoteId specific to the checkout.
68
+ * @param apiKey A valid fun api key.
69
+ * @return {Address} The generated deposit address
70
+ */
71
+ async function initializeCheckout({ userOp, quoteId, apiKey, clientMetadata, }) {
72
+ const body = {
73
+ userOp,
74
+ quoteId,
75
+ salt: (0, CheckoutUtils_1.generateRandomCheckoutSalt)(),
76
+ clientMetadata,
77
+ };
78
+ const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'checkout', body, apiKey);
79
+ if (!res?.depositAddr) {
80
+ throw new errors_1.ResourceNotFoundError(errors_1.ErrorCode.CheckoutInitDepositAddrNotFound, 'Unable to initialize checkout', body, '', 'https://docs.fun.xyz');
81
+ }
82
+ return res.depositAddr;
83
+ }
84
+ exports.initializeCheckout = initializeCheckout;
85
+ /**
86
+ * Gets a checkout given a depositAddress
87
+ * @param depositAddress A unique deposit address associated with a backend checkout item.
88
+ * @param apiKey A valid fun api key.
89
+ * // TODO: Return interface
90
+ * @returns The checkout object if exists. Otherwise, null.
91
+ */
92
+ async function getCheckoutByDepositAddress({ depositAddress, apiKey, }) {
93
+ try {
94
+ return await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `checkout/${depositAddress}`, apiKey);
95
+ }
96
+ catch (err) {
97
+ if (err instanceof errors_1.ResourceNotFoundError) {
98
+ return null;
99
+ }
100
+ throw err;
101
+ }
102
+ }
103
+ exports.getCheckoutByDepositAddress = getCheckoutByDepositAddress;
104
+ /**
105
+ * Gets all checkouts associated with a funWallet
106
+ * @param funWalletAddress A funWallet address.
107
+ * @param apiKey A valid fun api key.
108
+ * @returns A list of checkout objects if exists. Otherwise, an empty array.
109
+ */
110
+ async function getCheckoutsByFunWalletAddress({ funWalletAddress, apiKey, }) {
111
+ const url = `checkout/fun-wallet/${funWalletAddress}`;
112
+ const res = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, url, apiKey);
113
+ return res || [];
114
+ }
115
+ exports.getCheckoutsByFunWalletAddress = getCheckoutsByFunWalletAddress;
116
+ //# sourceMappingURL=CheckoutApis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckoutApis.js","sourceRoot":"","sources":["../../../src/apis/CheckoutApis.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAwB;AAGxB,mDAA6C;AAC7C,sCAA4D;AAC5D,gDAAmE;AACnE,0DAAgF;AAYhF;;;;;;;;;;GAUG;AACI,KAAK,UAAU,gBAAgB,CAAC,EACrC,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,MAAM,GACkB;IACxB,MAAM,UAAU,GAAG,MAAM,IAAA,2BAAW,EAAC;QACnC,OAAO,EAAE,SAAS;QAClB,YAAY,EAAE,cAAc;KAC7B,CAAC,CAAA;IACF,MAAM,WAAW,GAAG,EAAE,IAAI,UAAU,CAAA;IAEpC,MAAM,WAAW,GAAG;QAClB,WAAW;QACX,gBAAgB;QAChB,SAAS;QACT,cAAc;QACd,gBAAgB,EAAE,CAAC,aAAa,GAAG,WAAW,CAAC,CAAC,QAAQ,EAAE;QAC1D,kCAAkC,EAAE,IAAI,CAAC,KAAK,CAC5C,CAAC,IAAI,CAAC,GAAG,EAA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QAClC,cAAc;KACU,CAAA;IAC1B,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;IACpE,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,CAAC;QACtB,MAAM,IAAI,8BAAqB,CAC7B,kBAAS,CAAC,+BAA+B,EACzC,+BAA+B,EAC/B,IAAI,EACJ,EAAE,EACF,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAC,WAAuC,CAAA;AACpD,CAAC;AAvBD,gDAuBC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,2BAA2B,CAAC,EAChD,cAAc,EACd,MAAM,GAIP;IACC,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,YAAY,cAAc,EAAE,EAAE,MAAM,CAAC,CAAA;IAC5E,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,8BAAqB,EAAE,CAAC;YACzC,OAAO,IAAI,CAAA;QACb,CAAC;QACD,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC;AAfD,kEAeC;AAED;;;;;GAKG;AACI,KAAK,UAAU,8BAA8B,CAAC,EACnD,gBAAgB,EAChB,MAAM,GAIP;IACC,MAAM,GAAG,GAAG,uBAAuB,gBAAgB,EAAE,CAAA;IACrD,MAAM,GAAG,GAAG,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;IACtD,OAAO,GAAG,IAAI,EAAE,CAAA;AAClB,CAAC;AAVD,wEAUC"}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getContractAbi = void 0;
4
4
  const constants_1 = require("../common/constants");
5
5
  const ApiUtils_1 = require("../utils/ApiUtils");
6
- async function getContractAbi(contractName, mode = "abi") {
6
+ async function getContractAbi(contractName, mode = 'abi') {
7
7
  const { name, abi, addresses } = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `contract/${contractName}?mode=${mode}`);
8
8
  return { name, abi, addresses };
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContractApis.js","sourceRoot":"","sources":["../../../src/apis/ContractApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,gDAAkD;AAE3C,KAAK,UAAU,cAAc,CAAC,YAAoB,EAAE,IAAI,GAAG,KAAK;IACnE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,YAAY,YAAY,SAAS,IAAI,EAAE,CAAC,CAAA;IACvG,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,CAAA;AACnC,CAAC;AAHD,wCAGC"}
1
+ {"version":3,"file":"ContractApis.js","sourceRoot":"","sources":["../../../src/apis/ContractApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,gDAAkD;AAE3C,KAAK,UAAU,cAAc,CAClC,YAAoB,EACpB,IAAI,GAAG,KAAK;IAEZ,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,IAAA,yBAAc,EACnD,mBAAO,EACP,YAAY,YAAY,SAAS,IAAI,EAAE,CACxC,CAAA;IACD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,CAAA;AACjC,CAAC;AATD,wCASC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FaucetApis.js","sourceRoot":"","sources":["../../../src/apis/FaucetApis.ts"],"names":[],"mappings":";;;AAAA,sCAA0C;AAC1C,oCAAyC;AAElC,MAAM,SAAS,GAAG,KAAK,WAAW,KAAa,EAAE,KAAa,EAAE,aAAqB;IACxF,OAAO,MAAM,IAAA,sBAAc,EAAC,uBAAc,EAAE,oBAAoB,KAAK,YAAY,KAAK,SAAS,aAAa,EAAE,CAAC,CAAA;AACnH,CAAC,CAAA;AAFY,QAAA,SAAS,aAErB"}
1
+ {"version":3,"file":"FaucetApis.js","sourceRoot":"","sources":["../../../src/apis/FaucetApis.ts"],"names":[],"mappings":";;;AAAA,sCAA0C;AAC1C,oCAAyC;AAElC,MAAM,SAAS,GAAG,KAAK,WAC5B,KAAa,EACb,KAAa,EACb,aAAqB;IAErB,OAAO,MAAM,IAAA,sBAAc,EACzB,uBAAc,EACd,oBAAoB,KAAK,YAAY,KAAK,SAAS,aAAa,EAAE,CACnE,CAAA;AACH,CAAC,CAAA;AATY,QAAA,SAAS,aASrB"}
@@ -1,4 +1,4 @@
1
- import { Address, Hex } from "viem";
2
- import { GroupMetadata } from "./types";
1
+ import { Address, Hex } from 'viem';
2
+ import { GroupMetadata } from './types';
3
3
  export declare function getGroups(groupIds: Hex[], chainId: string): Promise<GroupMetadata[]>;
4
4
  export declare function getGroupsByWallet(walletAddr: Address, chainId: string): Promise<GroupMetadata[]>;
@@ -4,16 +4,16 @@ exports.getGroupsByWallet = exports.getGroups = void 0;
4
4
  const constants_1 = require("../common/constants");
5
5
  const ApiUtils_1 = require("../utils/ApiUtils");
6
6
  async function getGroups(groupIds, chainId) {
7
- return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "group/get-groups", {
7
+ return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'group/get-groups', {
8
8
  groupIds,
9
- chainId
9
+ chainId,
10
10
  })).groups;
11
11
  }
12
12
  exports.getGroups = getGroups;
13
13
  async function getGroupsByWallet(walletAddr, chainId) {
14
14
  return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, `group/wallet/${walletAddr}/chain/${chainId}`, {
15
15
  walletAddr,
16
- chainId
16
+ chainId,
17
17
  })).groups;
18
18
  }
19
19
  exports.getGroupsByWallet = getGroupsByWallet;
@@ -1 +1 @@
1
- {"version":3,"file":"GroupApis.js","sourceRoot":"","sources":["../../../src/apis/GroupApis.ts"],"names":[],"mappings":";;;AAEA,mDAA6C;AAC7C,gDAAmD;AAE5C,KAAK,UAAU,SAAS,CAAC,QAAe,EAAE,OAAe;IAC5D,OAAO,CACH,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,kBAAkB,EAAE;QAC/C,QAAQ;QACR,OAAO;KACV,CAAC,CACL,CAAC,MAAM,CAAA;AACZ,CAAC;AAPD,8BAOC;AAEM,KAAK,UAAU,iBAAiB,CAAC,UAAmB,EAAE,OAAe;IACxE,OAAO,CACH,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,gBAAgB,UAAU,UAAU,OAAO,EAAE,EAAE;QAC1E,UAAU;QACV,OAAO;KACV,CAAC,CACL,CAAC,MAAM,CAAA;AACZ,CAAC;AAPD,8CAOC"}
1
+ {"version":3,"file":"GroupApis.js","sourceRoot":"","sources":["../../../src/apis/GroupApis.ts"],"names":[],"mappings":";;;AAEA,mDAA6C;AAC7C,gDAAmD;AAG5C,KAAK,UAAU,SAAS,CAC7B,QAAe,EACf,OAAe;IAEf,OAAO,CACL,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,kBAAkB,EAAE;QACjD,QAAQ;QACR,OAAO;KACR,CAAC,CACH,CAAC,MAAM,CAAA;AACV,CAAC;AAVD,8BAUC;AAEM,KAAK,UAAU,iBAAiB,CACrC,UAAmB,EACnB,OAAe;IAEf,OAAO,CACL,MAAM,IAAA,0BAAe,EACnB,mBAAO,EACP,gBAAgB,UAAU,UAAU,OAAO,EAAE,EAC7C;QACE,UAAU;QACV,OAAO;KACR,CACF,CACF,CAAC,MAAM,CAAA;AACV,CAAC;AAdD,8CAcC"}
@@ -1,4 +1,4 @@
1
- import { Address } from "viem";
1
+ import { Address } from 'viem';
2
2
  export declare function getTokenInfo(symbol: string, chainId: string): Promise<Address>;
3
3
  export declare function getChainFromId(chainId: string): Promise<any>;
4
4
  export declare function getChainFromName(name: string): Promise<any>;
@@ -8,19 +8,21 @@ async function getTokenInfo(symbol, chainId) {
8
8
  symbol = symbol.toLowerCase();
9
9
  const body = {
10
10
  symbol,
11
- chain: chainId
11
+ chain: chainId,
12
12
  };
13
- if (symbol === "weth" && chainId !== "137" && Object.keys(constants_1.BASE_WRAP_TOKEN_ADDR).includes(chainId)) {
13
+ if (symbol === 'weth' &&
14
+ chainId !== '137' &&
15
+ Object.keys(constants_1.BASE_WRAP_TOKEN_ADDR).includes(chainId)) {
14
16
  return constants_1.BASE_WRAP_TOKEN_ADDR[chainId][symbol];
15
17
  }
16
- else if (symbol === "wmatic" && chainId === "137") {
18
+ else if (symbol === 'wmatic' && chainId === '137') {
17
19
  return constants_1.BASE_WRAP_TOKEN_ADDR[chainId][symbol];
18
20
  }
19
21
  const tokenInfo = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `asset/erc20/${body.chain}/${body.symbol}`);
20
22
  if (tokenInfo.address) {
21
23
  return tokenInfo.address;
22
24
  }
23
- throw new errors_1.ResourceNotFoundError(errors_1.ErrorCode.TokenNotFound, "token symbol does not exist on provided chain", { symbol, chainId }, "Provide correct symbol and chainId.", "https://docs.fun.xyz");
25
+ throw new errors_1.ResourceNotFoundError(errors_1.ErrorCode.TokenNotFound, 'token symbol does not exist on provided chain', { symbol, chainId }, 'Provide correct symbol and chainId.', 'https://docs.fun.xyz');
24
26
  }
25
27
  exports.getTokenInfo = getTokenInfo;
26
28
  async function getChainFromId(chainId) {
@@ -44,15 +46,15 @@ exports.getChainFromName = getChainFromName;
44
46
  async function getModuleInfo(moduleName, chainId) {
45
47
  const body = {
46
48
  module: moduleName,
47
- chain: chainId
49
+ chain: chainId,
48
50
  };
49
- return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "get-module-info", body).then((r) => {
51
+ return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'get-module-info', body).then((r) => {
50
52
  return r.data;
51
53
  });
52
54
  }
53
55
  exports.getModuleInfo = getModuleInfo;
54
56
  async function getPaymasterAddress(chainId) {
55
- const { moduleAddresses: { paymaster: { paymasterAddress } } } = await getChainFromId(chainId);
57
+ const { moduleAddresses: { paymaster: { paymasterAddress }, }, } = await getChainFromId(chainId);
56
58
  return paymasterAddress;
57
59
  }
58
60
  exports.getPaymasterAddress = getPaymasterAddress;
@@ -1 +1 @@
1
- {"version":3,"file":"InfoApis.js","sourceRoot":"","sources":["../../../src/apis/InfoApis.ts"],"names":[],"mappings":";;;AACA,mDAAmE;AACnE,sCAA4D;AAC5D,gDAAmE;AAE5D,KAAK,UAAU,YAAY,CAAC,MAAc,EAAE,OAAe;IAC9D,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAA;IAC7B,MAAM,IAAI,GAAG;QACT,MAAM;QACN,KAAK,EAAE,OAAO;KACjB,CAAA;IACD,IAAI,MAAM,KAAK,MAAM,IAAI,OAAO,KAAK,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,gCAAoB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QAC/F,OAAQ,gCAA4B,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;KACxD;SAAM,IAAI,MAAM,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,EAAE;QACjD,OAAQ,gCAA4B,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;KACxD;IAED,MAAM,SAAS,GAAG,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,eAAe,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAE3F,IAAI,SAAS,CAAC,OAAO,EAAE;QACnB,OAAO,SAAS,CAAC,OAAO,CAAA;KAC3B;IACD,MAAM,IAAI,8BAAqB,CAC3B,kBAAS,CAAC,aAAa,EACvB,+CAA+C,EAC/C,EAAE,MAAM,EAAE,OAAO,EAAE,EACnB,qCAAqC,EACrC,sBAAsB,CACzB,CAAA;AACL,CAAC;AAxBD,oCAwBC;AAEM,KAAK,UAAU,cAAc,CAAC,OAAe;IAChD,OAAO,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,cAAc,OAAO,E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;IACV,CAAC,CAAC,CAAA;AACJ,CAAC;AAPD,wCAOC;AAEM,KAAK,UAAU,gBAAgB,CAAC,IAAY;IACjD,OAAO,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,mBAAmB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QACzE,IAAI,CAAC,CAAC,EAAE,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;QACpC,CAAC;QACD,OAAO,CAAC,CAAA;IACV,CAAC,CAAC,CAAA;AACJ,CAAC;AAPD,4CAOC;AAEM,KAAK,UAAU,aAAa,CACjC,UAAkB,EAClB,OAAe;IAEf,MAAM,IAAI,GAAG;QACX,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,OAAO;KACf,CAAA;IAED,OAAO,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QACxE,OAAO,CAAC,CAAC,IAAI,CAAA;IACf,CAAC,CAAC,CAAA;AACJ,CAAC;AAZD,sCAYC;AAEM,KAAK,UAAU,mBAAmB,CAAC,OAAe;IACvD,MAAM,EACJ,eAAe,EAAE,EACf,SAAS,EAAE,EAAE,gBAAgB,EAAE,GAChC,GACF,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAA;IAEjC,OAAO,gBAAgB,CAAA;AACzB,CAAC;AARD,kDAQC"}
@@ -1,3 +1,3 @@
1
- import { Address } from "viem";
1
+ import { Address } from 'viem';
2
2
  export declare function createListener(walletAddresses: Address[], chains: string[], webhookUrl: string): Promise<void>;
3
3
  export declare function deleteListener(walletAddress: Address, chain: string): Promise<void>;
@@ -8,13 +8,13 @@ async function createListener(walletAddresses, chains, webhookUrl) {
8
8
  const body = {
9
9
  walletAddresses,
10
10
  chains,
11
- webhookUrl
11
+ webhookUrl,
12
12
  };
13
- const result = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "listeners/", body).then((r) => {
13
+ const result = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'listeners/', body).then((r) => {
14
14
  return r;
15
15
  });
16
16
  if (!result) {
17
- throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, "Listener call failed.", { walletAddresses, chains, webhookUrl }, "This is an internal error, please contact support.", "https://docs.fun.xyz");
17
+ throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'Listener call failed.', { walletAddresses, chains, webhookUrl }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
18
18
  }
19
19
  return result;
20
20
  }
@@ -22,13 +22,13 @@ exports.createListener = createListener;
22
22
  async function deleteListener(walletAddress, chain) {
23
23
  const body = {
24
24
  walletAddress,
25
- chain
25
+ chain,
26
26
  };
27
- const result = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "listeners/delete", body).then((r) => {
27
+ const result = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'listeners/delete', body).then((r) => {
28
28
  return r;
29
29
  });
30
30
  if (!result) {
31
- throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, "Listener call failed.", { walletAddress, chain }, "This is an internal error, please contact support.", "https://docs.fun.xyz");
31
+ throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'Listener call failed.', { walletAddress, chain }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
32
32
  }
33
33
  return result;
34
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ListenerApis.js","sourceRoot":"","sources":["../../../src/apis/ListenerApis.ts"],"names":[],"mappings":";;;AACA,mDAA6C;AAC7C,sCAA2D;AAC3D,gDAAmD;AAE5C,KAAK,UAAU,cAAc,CAAC,eAA0B,EAAE,MAAgB,EAAE,UAAkB;IACjG,MAAM,IAAI,GAAG;QACT,eAAe;QACf,MAAM;QACN,UAAU;KACb,CAAA;IACD,MAAM,MAA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C,mBAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC,IAAI,CACpE,CAAC,CAAC,EAAE,EAAE;QACJ,OAAO,CAAC,CAAA;IACV,CAAC,CACF,CAAA;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,uBAAuB,EACvB,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,EACvC,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAzBD,wCAyBC;AAEM,KAAK,UAAU,cAAc,CAClC,aAAsB,EACtB,KAAa;IAEb,MAAM,IAAI,GAAG;QACX,aAAa;QACb,KAAK;KACN,CAAA;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC,IAAI,CAC1E,CAAC,CAAC,EAAE,EAAE;QACJ,OAAO,CAAC,CAAA;IACV,CAAC,CACF,CAAA;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,uBAAuB,EACvB,EAAE,aAAa,EAAE,KAAK,EAAE,EACxB,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAvBD,wCAuBC"}
@@ -0,0 +1,87 @@
1
+ import { MeshOrderSide } from './types';
2
+ /**
3
+ * @param authToken The authentication token to send the asset from.
4
+ * @param type The type of the integration to send the asset from.
5
+ * @return https://docs.meshconnect.com/reference/post_api-v1-balance-get
6
+ */
7
+ export declare function meshGetHoldings(authToken: string, type: string, apiKey?: string): Promise<any>;
8
+ /**
9
+ * @param authToken The authentication token to send the asset from.
10
+ * @param type The type of the integration to send the asset from.
11
+ * @return https://docs.meshconnect.com/reference/post_api-v1-holdings-get
12
+ */
13
+ export declare function meshGetCryptocurrencyHoldings(authToken: string, type: string, apiKey?: string): Promise<any>;
14
+ /**
15
+ * @return https://docs.meshconnect.com/reference/get_api-v1-transfers-managed-integrations
16
+ */
17
+ export declare function meshGetTransferIntegrations(apiKey?: string): Promise<any>;
18
+ /**
19
+ * @param userId A unique Id representing the end user. Typically this will be a user Id from the
20
+ client application. Personally identifiable information, such as an email address or phone number,
21
+ should not be used. 50 characters length maximum.
22
+ * @param integrationId A unique identifier representing a specific integration obtained from the list of available integrations.
23
+ * @param restrictMultipleAccounts The final screen of Link allows users to “continue” back to your app or “Link another account.”
24
+ If this param is present then this button will be hidden.
25
+ * @param transferOptions Encapsulates transaction-related parameters, including destination addresses and the amount to transfer in fiat currency.
26
+ * @return https://docs.meshconnect.com/reference/post_api-v1-linktoken
27
+ */
28
+ export declare function meshGetLinkToken(userId: string, integrationId?: string | null, restrictMultipleAccounts?: boolean, transferOptions?: any | null, apiKey?: string): Promise<any>;
29
+ /**
30
+ * @param fromAuthToken The authentication token to send the asset from.
31
+ * @param fromType The type of the integration to send the asset from.
32
+ * @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.
33
+ * @param toType The type of the target integration to send assets to. Used along with the toAuthToken alternatively to ToAddress.
34
+ * @param networkId The network to send the asset over. This is generated by Mesh, it isn't a chainId or chain name.
35
+ * @param symbol The symbol of the digital asset to send.
36
+ * @param toAddress The target address to send the asset to.
37
+ * @param amount The amount to send, in crypto.
38
+ * @param amountInFiat The amount to send, in fiat currency. Can be used alternatively to Amount.
39
+ * @param fiatCurrency Fiat currency that is to get corresponding converted fiat values of transfer and fee amounts. If not provided, defaults to USD.
40
+ * @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-preview
41
+ */
42
+ export declare function meshPreviewTransfer(fromAuthToken: string, fromType: string, toAuthToken?: string | null, toType?: string | null, networkId?: string, symbol?: string | null, toAddress?: string | null, amount?: string | null, amountInFiat?: string | null, fiatCurrency?: string | null, apiKey?: string): Promise<any>;
43
+ /**
44
+ *
45
+ * @param fromAuthToken The authentication token to send the asset from.
46
+ * @param fromType The type of the integration to send the asset from.
47
+ * @param previewId The preview ID of the transfer to execute.
48
+ * @param mfaCode Multi-factor auth code that should be provided if the status of the transfer was MfaRequired.
49
+ * @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-execute
50
+ */
51
+ export declare function meshExecuteTransfer(fromAuthToken: string, fromType: string, previewId: string, mfaCode?: string | null, apiKey?: string): Promise<any>;
52
+ /**
53
+ * @param side {buy, sell}
54
+ * @param authToken The authentication token to use for the preview.
55
+ * @param type The type of the integration to use for the preview.
56
+ * @param symbol Symbol to trade. For example, AAPL or ETH
57
+ * @param paymentSymbol Symbol to use for payment, defaults to USD.
58
+ * @param amount Amount of purchase.
59
+ * @param price Price of the unit, used for Limit and StopLoss orders.
60
+ * @param isCryptocurrency Some Stock and Crypto symbols can intersect, so the type of the asset needs to be specified explicitly.
61
+ * @param paymentIsCryptoCurrency Indicates whether the PaymentSymbol is fiat or cryptocurrency
62
+ * @param amountIsInPaymentSymbol This value indicates if the order should be executed in payment/quote currency amount (e.g. purchase ETH for $10). This can be performed only if the current institution supports such orders (SupportsPlacingSellOrdersInPaymentSymbolAmount and SupportsPlacingBuyOrdersInPaymentSymbolAmount fields in get supported order features for institution) and AmountInPaymentSymbol value is passed.
63
+ * @param extendedHours Specifies if the extended trading hours should be used.
64
+ * @param orderType {market, limit, stopLoss}
65
+ * @param timeInForce {goodTillCancel, immediateOrCancel, fillOrKill, goodForDay, postOnly, unknown}
66
+ * @param mfaCode MFA Code to create an order (requested by Kraken if MFA is enabled in user settings)
67
+ * @returns https://docs.meshconnect.com/reference/post_api-v1-transactions-preview-side
68
+ */
69
+ export declare function meshPreviewOrder(side: MeshOrderSide, authToken: string, type: string, symbol: string, paymentSymbol: string, amount: string, isCryptocurrency: string, paymentIsCryptoCurrency: string, orderType: string, timeInForce: string, price?: string, amountIsInPaymentSymbol?: string | null, extendedHours?: boolean, mfaCode?: string | null, apiKey?: string): Promise<any>;
70
+ /**
71
+ * @param side {buy, sell}
72
+ * @param authToken The authentication token to use for the preview.
73
+ * @param type The type of the integration to use for the preview.
74
+ * @param symbol Symbol to trade. For example, AAPL or ETH
75
+ * @param paymentSymbol Symbol to use for payment, defaults to USD.
76
+ * @param amount Amount of purchase.
77
+ * @param price Price of the unit, used for Limit and StopLoss orders.
78
+ * @param isCryptocurrency Some Stock and Crypto symbols can intersect, so the type of the asset needs to be specified explicitly.
79
+ * @param paymentIsCryptoCurrency Indicates whether the PaymentSymbol is fiat or cryptocurrency
80
+ * @param amountIsInPaymentSymbol This value indicates if the order should be executed in payment/quote currency amount (e.g. purchase ETH for $10). This can be performed only if the current institution supports such orders (SupportsPlacingSellOrdersInPaymentSymbolAmount and SupportsPlacingBuyOrdersInPaymentSymbolAmount fields in get supported order features for institution) and AmountInPaymentSymbol value is passed.
81
+ * @param extendedHours Specifies if the extended trading hours should be used.
82
+ * @param orderType {market, limit, stopLoss}
83
+ * @param timeInForce {goodTillCancel, immediateOrCancel, fillOrKill, goodForDay, postOnly, unknown}
84
+ * @param mfaCode MFA Code to create an order (requested by Kraken if MFA is enabled in user settings)
85
+ * @returns https://docs.meshconnect.com/reference/post_api-v1-transactions-side
86
+ */
87
+ export declare function meshExecuteOrder(side: MeshOrderSide, authToken: string, type: string, symbol: string, paymentSymbol: string, amount: string, isCryptocurrency: string, paymentIsCryptoCurrency: string, orderType: string, timeInForce: string, price?: string, amountIsInPaymentSymbol?: string | null, extendedHours?: boolean, mfaCode?: string | null, apiKey?: string): Promise<any>;