@funkit/core 0.9.0 → 0.10.1

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 +124 -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 +105 -17
  98. package/dist/src/common/constants.js +160 -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 +7 -0
  166. package/dist/src/utils/CheckoutUtils.js +28 -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 +15 -9
  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
@@ -0,0 +1,213 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.meshExecuteOrder = exports.meshPreviewOrder = exports.meshExecuteTransfer = exports.meshPreviewTransfer = exports.meshGetLinkToken = exports.meshGetTransferIntegrations = exports.meshGetCryptocurrencyHoldings = exports.meshGetHoldings = void 0;
4
+ const constants_1 = require("../common/constants");
5
+ const ApiUtils_1 = require("../utils/ApiUtils");
6
+ /**
7
+ * @param authToken The authentication token to send the asset from.
8
+ * @param type The type of the integration to send the asset from.
9
+ * @return https://docs.meshconnect.com/reference/post_api-v1-balance-get
10
+ */
11
+ async function meshGetHoldings(authToken, type, apiKey) {
12
+ const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/balance/get', { authToken, type }, apiKey);
13
+ return res;
14
+ }
15
+ exports.meshGetHoldings = meshGetHoldings;
16
+ /**
17
+ * @param authToken The authentication token to send the asset from.
18
+ * @param type The type of the integration to send the asset from.
19
+ * @return https://docs.meshconnect.com/reference/post_api-v1-holdings-get
20
+ */
21
+ async function meshGetCryptocurrencyHoldings(authToken, type, apiKey) {
22
+ const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/holdings/get', { authToken, type }, apiKey);
23
+ return res;
24
+ }
25
+ exports.meshGetCryptocurrencyHoldings = meshGetCryptocurrencyHoldings;
26
+ /**
27
+ * @return https://docs.meshconnect.com/reference/get_api-v1-transfers-managed-integrations
28
+ */
29
+ async function meshGetTransferIntegrations(apiKey) {
30
+ const res = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, 'mesh/transfers/managed/integrations', apiKey);
31
+ return res;
32
+ }
33
+ exports.meshGetTransferIntegrations = meshGetTransferIntegrations;
34
+ /**
35
+ * @param userId A unique Id representing the end user. Typically this will be a user Id from the
36
+ client application. Personally identifiable information, such as an email address or phone number,
37
+ should not be used. 50 characters length maximum.
38
+ * @param integrationId A unique identifier representing a specific integration obtained from the list of available integrations.
39
+ * @param restrictMultipleAccounts The final screen of Link allows users to “continue” back to your app or “Link another account.”
40
+ If this param is present then this button will be hidden.
41
+ * @param transferOptions Encapsulates transaction-related parameters, including destination addresses and the amount to transfer in fiat currency.
42
+ * @return https://docs.meshconnect.com/reference/post_api-v1-linktoken
43
+ */
44
+ async function meshGetLinkToken(userId, integrationId, restrictMultipleAccounts, transferOptions, apiKey) {
45
+ let body = { userId };
46
+ if (integrationId) {
47
+ body = { ...body, integrationId };
48
+ }
49
+ if (restrictMultipleAccounts) {
50
+ body = { ...body, restrictMultipleAccounts };
51
+ }
52
+ if (transferOptions) {
53
+ body = { ...body, transferOptions };
54
+ }
55
+ const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/linktoken', body, apiKey);
56
+ return res;
57
+ }
58
+ exports.meshGetLinkToken = meshGetLinkToken;
59
+ /**
60
+ * @param fromAuthToken The authentication token to send the asset from.
61
+ * @param fromType The type of the integration to send the asset from.
62
+ * @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.
63
+ * @param toType The type of the target integration to send assets to. Used along with the toAuthToken alternatively to ToAddress.
64
+ * @param networkId The network to send the asset over. This is generated by Mesh, it isn't a chainId or chain name.
65
+ * @param symbol The symbol of the digital asset to send.
66
+ * @param toAddress The target address to send the asset to.
67
+ * @param amount The amount to send, in crypto.
68
+ * @param amountInFiat The amount to send, in fiat currency. Can be used alternatively to Amount.
69
+ * @param fiatCurrency Fiat currency that is to get corresponding converted fiat values of transfer and fee amounts. If not provided, defaults to USD.
70
+ * @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-preview
71
+ */
72
+ async function meshPreviewTransfer(fromAuthToken, fromType, toAuthToken, toType, networkId, symbol, toAddress, amount, amountInFiat, fiatCurrency, apiKey) {
73
+ let body = { fromAuthToken, fromType };
74
+ if (toAuthToken) {
75
+ body = { ...body, toAuthToken };
76
+ }
77
+ if (toType) {
78
+ body = { ...body, toType };
79
+ }
80
+ if (networkId) {
81
+ body = { ...body, networkId };
82
+ }
83
+ if (symbol) {
84
+ body = { ...body, symbol };
85
+ }
86
+ if (toAddress) {
87
+ body = { ...body, toAddress };
88
+ }
89
+ if (amount) {
90
+ body = { ...body, amount };
91
+ }
92
+ if (amountInFiat) {
93
+ body = { ...body, amountInFiat };
94
+ }
95
+ if (fiatCurrency) {
96
+ body = { ...body, fiatCurrency };
97
+ }
98
+ const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/transfers/managed/preview', body, apiKey);
99
+ console.log('Preview transfer res', res);
100
+ return res;
101
+ }
102
+ exports.meshPreviewTransfer = meshPreviewTransfer;
103
+ /**
104
+ *
105
+ * @param fromAuthToken The authentication token to send the asset from.
106
+ * @param fromType The type of the integration to send the asset from.
107
+ * @param previewId The preview ID of the transfer to execute.
108
+ * @param mfaCode Multi-factor auth code that should be provided if the status of the transfer was MfaRequired.
109
+ * @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-execute
110
+ */
111
+ async function meshExecuteTransfer(fromAuthToken, fromType, previewId, mfaCode, apiKey) {
112
+ let body = { fromAuthToken, fromType, previewId };
113
+ if (mfaCode) {
114
+ body = { ...body, mfaCode };
115
+ }
116
+ const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/transfers/managed/execute', body, apiKey);
117
+ console.log(res);
118
+ return res;
119
+ }
120
+ exports.meshExecuteTransfer = meshExecuteTransfer;
121
+ /**
122
+ * @param side {buy, sell}
123
+ * @param authToken The authentication token to use for the preview.
124
+ * @param type The type of the integration to use for the preview.
125
+ * @param symbol Symbol to trade. For example, AAPL or ETH
126
+ * @param paymentSymbol Symbol to use for payment, defaults to USD.
127
+ * @param amount Amount of purchase.
128
+ * @param price Price of the unit, used for Limit and StopLoss orders.
129
+ * @param isCryptocurrency Some Stock and Crypto symbols can intersect, so the type of the asset needs to be specified explicitly.
130
+ * @param paymentIsCryptoCurrency Indicates whether the PaymentSymbol is fiat or cryptocurrency
131
+ * @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.
132
+ * @param extendedHours Specifies if the extended trading hours should be used.
133
+ * @param orderType {market, limit, stopLoss}
134
+ * @param timeInForce {goodTillCancel, immediateOrCancel, fillOrKill, goodForDay, postOnly, unknown}
135
+ * @param mfaCode MFA Code to create an order (requested by Kraken if MFA is enabled in user settings)
136
+ * @returns https://docs.meshconnect.com/reference/post_api-v1-transactions-preview-side
137
+ */
138
+ async function meshPreviewOrder(side, authToken, type, symbol, paymentSymbol, amount, isCryptocurrency, paymentIsCryptoCurrency, orderType, timeInForce, price, amountIsInPaymentSymbol, extendedHours, mfaCode, apiKey) {
139
+ let body = {
140
+ side,
141
+ authToken,
142
+ type,
143
+ symbol,
144
+ paymentSymbol,
145
+ amount,
146
+ isCryptocurrency,
147
+ paymentIsCryptoCurrency,
148
+ orderType,
149
+ timeInForce,
150
+ };
151
+ if (price) {
152
+ body = { ...body, price };
153
+ }
154
+ if (amountIsInPaymentSymbol) {
155
+ body = { ...body, amountIsInPaymentSymbol };
156
+ }
157
+ if (extendedHours) {
158
+ body = { ...body, extendedHours };
159
+ }
160
+ if (mfaCode) {
161
+ body = { ...body, mfaCode };
162
+ }
163
+ const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/transactions/preview', body, apiKey);
164
+ return res;
165
+ }
166
+ exports.meshPreviewOrder = meshPreviewOrder;
167
+ /**
168
+ * @param side {buy, sell}
169
+ * @param authToken The authentication token to use for the preview.
170
+ * @param type The type of the integration to use for the preview.
171
+ * @param symbol Symbol to trade. For example, AAPL or ETH
172
+ * @param paymentSymbol Symbol to use for payment, defaults to USD.
173
+ * @param amount Amount of purchase.
174
+ * @param price Price of the unit, used for Limit and StopLoss orders.
175
+ * @param isCryptocurrency Some Stock and Crypto symbols can intersect, so the type of the asset needs to be specified explicitly.
176
+ * @param paymentIsCryptoCurrency Indicates whether the PaymentSymbol is fiat or cryptocurrency
177
+ * @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.
178
+ * @param extendedHours Specifies if the extended trading hours should be used.
179
+ * @param orderType {market, limit, stopLoss}
180
+ * @param timeInForce {goodTillCancel, immediateOrCancel, fillOrKill, goodForDay, postOnly, unknown}
181
+ * @param mfaCode MFA Code to create an order (requested by Kraken if MFA is enabled in user settings)
182
+ * @returns https://docs.meshconnect.com/reference/post_api-v1-transactions-side
183
+ */
184
+ async function meshExecuteOrder(side, authToken, type, symbol, paymentSymbol, amount, isCryptocurrency, paymentIsCryptoCurrency, orderType, timeInForce, price, amountIsInPaymentSymbol, extendedHours, mfaCode, apiKey) {
185
+ let body = {
186
+ side,
187
+ authToken,
188
+ type,
189
+ symbol,
190
+ paymentSymbol,
191
+ amount,
192
+ isCryptocurrency,
193
+ paymentIsCryptoCurrency,
194
+ orderType,
195
+ timeInForce,
196
+ };
197
+ if (price) {
198
+ body = { ...body, price };
199
+ }
200
+ if (amountIsInPaymentSymbol) {
201
+ body = { ...body, amountIsInPaymentSymbol };
202
+ }
203
+ if (extendedHours) {
204
+ body = { ...body, extendedHours };
205
+ }
206
+ if (mfaCode) {
207
+ body = { ...body, mfaCode };
208
+ }
209
+ const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/transactions', body, apiKey);
210
+ return res;
211
+ }
212
+ exports.meshExecuteOrder = meshExecuteOrder;
213
+ //# sourceMappingURL=MeshApis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MeshApis.js","sourceRoot":"","sources":["../../../src/apis/MeshApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,gDAAmE;AAGnE;;;;GAIG;AACI,KAAK,UAAU,eAAe,CACnC,SAAiB,EACjB,IAAY,EACZ,MAAe;IAEf,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAe,EAC/B,mBAAO,EACP,kBAAkB,EAClB,EAAE,SAAS,EAAE,IAAI,EAAE,EACnB,MAAM,CACP,CAAA;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAZD,0CAYC;AAED;;;;GAIG;AACI,KAAK,UAAU,6BAA6B,CACjD,SAAiB,EACjB,IAAY,EACZ,MAAe;IAEf,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAe,EAC/B,mBAAO,EACP,mBAAmB,EACnB,EAAE,SAAS,EAAE,IAAI,EAAE,EACnB,MAAM,CACP,CAAA;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAZD,sEAYC;AAED;;G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IAAA,yBAAc,EAAC,mBAAO,EAAE,kBAAkB,IAAI,EAAE,CAAC,CAAA;AAClE,CAAC;AAFD,sCAEC"}
1
+ {"version":3,"file":"NFTApis.js","sourceRoot":"","sources":["../../../src/apis/NFTApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,gDAAkD;AAElD;;;;;;;;;GASG;AACI,KAAK,UAAU,UAAU,CAC9B,OAAe,EACf,UAAkB;IAElB,OAAO,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,aAAa,OAAO,IAAI,UAAU,EAAE,CAAC,CAAA;AAC5E,CAAC;AALD,gCAKC;AAED;;;;;;;;;GASG;AACI,KAAK,UAAU,aAAa,CAAC,IAAY;IAC9C,OAAO,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,kBAAkB,IAAI,EAAE,CAAC,CAAA;AAChE,CAAC;AAFD,sCAEC"}
@@ -1,4 +1,6 @@
1
+ export declare function getMoonPayCheckout(tokenAddress: string, chainId: number, walletAddress: string, amount: string): Promise<string>;
1
2
  export declare function getOnRampUrl(walletAddr: string, currencyCode?: string): Promise<string>;
3
+ export declare function getMoonpayUrlSignature(url: string, apiKey?: string): Promise<string>;
2
4
  export declare function getOffRampUrl(walletAddr: string): Promise<string>;
3
5
  export interface Currency {
4
6
  id: string;
@@ -1,9 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOnRampSupportedCurrencies = exports.getOffRampUrl = exports.getOnRampUrl = void 0;
3
+ exports.getOnRampSupportedCurrencies = exports.getOffRampUrl = exports.getMoonpayUrlSignature = exports.getOnRampUrl = exports.getMoonPayCheckout = void 0;
4
4
  const constants_1 = require("../common/constants");
5
5
  const errors_1 = require("../errors");
6
6
  const ApiUtils_1 = require("../utils/ApiUtils");
7
+ async function getMoonPayCheckout(tokenAddress, chainId, walletAddress, amount) {
8
+ const params = new URLSearchParams({
9
+ tokenAddress,
10
+ chainId: chainId.toString(),
11
+ walletAddress,
12
+ quoteCurrencyAmount: amount,
13
+ }).toString();
14
+ const json = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `on-ramp/moonpay-checkout/?${params}`);
15
+ return json.url;
16
+ }
17
+ exports.getMoonPayCheckout = getMoonPayCheckout;
7
18
  async function getOnRampUrl(walletAddr, currencyCode) {
8
19
  const endpoint = `on-ramp/${walletAddr}?provider=moonpay`;
9
20
  if (currencyCode) {
@@ -11,23 +22,31 @@ async function getOnRampUrl(walletAddr, currencyCode) {
11
22
  }
12
23
  const url = (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, endpoint))?.url;
13
24
  if (!url) {
14
- throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, "No onramp url found.", { walletAddr }, "This is an internal error, please contact support.", "https://docs.fun.xyz");
25
+ throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'No onramp url found.', { walletAddr }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
15
26
  }
16
27
  return url;
17
28
  }
18
29
  exports.getOnRampUrl = getOnRampUrl;
30
+ async function getMoonpayUrlSignature(url, apiKey) {
31
+ const signature = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, `on-ramp/moonpay-signature/`, { url }, apiKey);
32
+ if (!signature) {
33
+ throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'No onramp url found.', { url }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
34
+ }
35
+ return signature.url;
36
+ }
37
+ exports.getMoonpayUrlSignature = getMoonpayUrlSignature;
19
38
  async function getOffRampUrl(walletAddr) {
20
39
  const url = (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `off-ramp/${walletAddr}?provider=moonpay`))?.url;
21
40
  if (!url) {
22
- throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, "No offramp url found.", { walletAddr }, "This is an internal error, please contact support.", "https://docs.fun.xyz");
41
+ throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'No offramp url found.', { walletAddr }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
23
42
  }
24
43
  return url;
25
44
  }
26
45
  exports.getOffRampUrl = getOffRampUrl;
27
46
  async function getOnRampSupportedCurrencies() {
28
- const currencies = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, "on-ramp/currencies");
47
+ const currencies = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, 'on-ramp/currencies');
29
48
  if (!currencies || !currencies.length) {
30
- throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, "No supported currencies found.", {}, "This is an internal error, please contact support.", "https://docs.fun.xyz");
49
+ throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'No supported currencies found.', {}, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
31
50
  }
32
51
  return currencies;
33
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OnOffRampApis.js","sourceRoot":"","sources":["../../../src/apis/OnOffRampApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,sCAA2D;AAC3D,gDAAkD;AAE3C,KAAK,UAAU,YAAY,CAAC,UAAkB,EAAE,YAAqB;IACxE,MAAM,QAAQ,GAAG,WAAW,UAAU,mBAAmB,CAAA;IACzD,IAAI,YAAY,EAAE;QACd,QAAQ,CAAC,MAAM,CAAC,iBAAiB,YAAY,EAAE,CAAC,CAAA;KACnD;IACD,MAAM,GAAG,GAAW,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAA;IAClE,IAAI,CAAC,GAAG,EAAE;QACN,MAAM,IAAI,6BAAoB,CAC1B,kBAAS,CAAC,kBAAkB,EAC5B,sBAAsB,EACtB,EAAE,UAAU,EAAE,EACd,oDAAoD,EACpD,sBAAsB,CACzB,CAAA;KACJ;IACD,OAAO,GAAG,CAAA;AACd,CAAC;AAhBD,oCAgBC;AAEM,KAAK,UAAU,aAAa,CAAC,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U,EAAE,EACd,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAdD,sCAcC;AA2BM,KAAK,UAAU,4BAA4B;IAChD,MAAM,UAAU,GAAe,MAAM,IAAA,yBAAc,EACjD,mBAAO,EACP,oBAAoB,CACrB,CAAA;IACD,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,gCAAgC,EAChC,EAAE,EACF,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC;AAfD,oEAeC"}
@@ -7,7 +7,7 @@ const ApiUtils_1 = require("../utils/ApiUtils");
7
7
  async function getOnRampUrl(walletAddr) {
8
8
  const url = (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `on-ramp/${walletAddr}?provider=moonpay`))?.url;
9
9
  if (!url) {
10
- throw new errors_1.InternalFailureError(errors_1.ErrorCode.ServerFailure, `fail to get on ramp url for ${walletAddr}`, { walletAddr }, "retry later. if it still fails, please contact us.", "https://docs.fun.xyz");
10
+ throw new errors_1.InternalFailureError(errors_1.ErrorCode.ServerFailure, `fail to get on ramp url for ${walletAddr}`, { walletAddr }, 'retry later. if it still fails, please contact us.', 'https://docs.fun.xyz');
11
11
  }
12
12
  return url;
13
13
  }
@@ -15,7 +15,7 @@ exports.getOnRampUrl = getOnRampUrl;
15
15
  async function getOffRampUrl(walletAddr) {
16
16
  const url = (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `off-ramp/${walletAddr}?provider=moonpay`))?.url;
17
17
  if (!url) {
18
- throw new errors_1.InternalFailureError(errors_1.ErrorCode.ServerFailure, `fail to get off ramp url for ${walletAddr}`, { walletAddr }, "retry later. if it still fails, please contact us.", "https://docs.fun.xyz");
18
+ throw new errors_1.InternalFailureError(errors_1.ErrorCode.ServerFailure, `fail to get off ramp url for ${walletAddr}`, { walletAddr }, 'retry later. if it still fails, please contact us.', 'https://docs.fun.xyz');
19
19
  }
20
20
  return url;
21
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OnOffRampUtils.js","sourceRoot":"","sources":["../../../src/apis/OnOffRampUtils.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,sCAA2D;AAC3D,gDAAkD;AAE3C,KAAK,UAAU,YAAY,CAAC,UAAkB;IACjD,MAAM,GAAG,GAAG,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,WAAW,UAAU,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAA;IAC1F,IAAI,CAAC,GAAG,EAAE;QACN,MAAM,IAAI,6BAAoB,CAC1B,kBAAS,CAAC,aAAa,EACvB,+BAA+B,UAAU,EAAE,EAC3C,EAAE,UAAU,EAAE,EACd,oDAAoD,EACpD,sBAAsB,CACzB,CAAA;KACJ;IACD,OAAO,GAAG,CAAA;AACd,CAAC;AAZD,oCAYC;AAEM,KAAK,UAAU,aAAa,CAAC,UAAkB;IAClD,MAAM,GAAG,GAAG,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,YAAY,UAAU,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAA;IAC3F,IAAI,CAAC,GAAG,EAAE;QACN,MAAM,IAAI,6BAAoB,CAC1B,kBAAS,CAAC,aAAa,EACvB,gCAAgC,UAAU,EAAE,EAC5C,EAAE,UAAU,EAAE,EACd,oDAAoD,EACpD,sBAAsB,CACzB,CAAA;KACJ;IACD,OAAO,GAAG,CAAA;AACd,CAAC;AAZD,sCAYC"}
1
+ {"version":3,"file":"OnOffRampUtils.js","sourceRoot":"","sources":["../../../src/apis/OnOffRampUtils.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,sCAA2D;AAC3D,gDAAkD;AAE3C,KAAK,UAAU,YAAY,CAAC,UAAkB;IACnD,MAAM,GAAG,GAAG,CACV,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,WAAW,UAAU,mBAAmB,CAAC,CACxE,EAAE,GAAG,CAAA;IACN,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,aAAa,EACvB,+BAA+B,UAAU,EAAE,EAC3C,EAAE,UAAU,EAAE,EACd,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAdD,oCAcC;AAEM,KAAK,UAAU,aAAa,CAAC,UAAkB;IACpD,MAAM,GAAG,GAAG,CACV,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,YAAY,UAAU,mBAAmB,CAAC,CACzE,EAAE,GAAG,CAAA;IACN,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,aAAa,EACvB,gCAAgC,UAAU,EAAE,EAC5C,EAAE,UAAU,EAAE,EACd,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAdD,sCAcC"}
@@ -1,7 +1,7 @@
1
- import { Address, Hex } from "viem";
2
- import { EstimateOpInput, EstimatedGas, ExecuteOpInput, ScheduleOpInput, UserOperationGasPrice } from "./types";
3
- import { ExecutionReceipt } from "../common/types";
4
- import { Operation, OperationStatus } from "../data";
1
+ import { Address, Hex } from 'viem';
2
+ import { ExecutionReceipt } from '../common/types';
3
+ import { Operation, OperationStatus } from '../data';
4
+ import { EstimatedGas, EstimateOpInput, ExecuteOpInput, ScheduleOpInput, UserOperationGasPrice } from './types';
5
5
  export declare function createOp(op: Operation): Promise<string>;
6
6
  export declare function getOpsOfGroup(groupId: Hex, chainId: string, status: OperationStatus): Promise<Operation[]>;
7
7
  export declare function getOpsOfWallet(walletAddr: Address, chainId: string, status?: OperationStatus): Promise<Operation[]>;
@@ -5,7 +5,7 @@ const constants_1 = require("../common/constants");
5
5
  const data_1 = require("../data");
6
6
  const ApiUtils_1 = require("../utils/ApiUtils");
7
7
  async function createOp(op) {
8
- return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "operation", { ...op })).opId;
8
+ return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation', { ...op })).opId;
9
9
  }
10
10
  exports.createOp = createOp;
11
11
  async function getOpsOfGroup(groupId, chainId, status) {
@@ -23,7 +23,10 @@ async function getOpsOfWallet(walletAddr, chainId, status) {
23
23
  }
24
24
  exports.getOpsOfWallet = getOpsOfWallet;
25
25
  async function getOps(opIds, chainId) {
26
- return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "operation/get-operations", { opIds, chainId })).operations;
26
+ return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/get-operations', {
27
+ opIds,
28
+ chainId,
29
+ })).operations;
27
30
  }
28
31
  exports.getOps = getOps;
29
32
  async function deleteOp(opId, chainId) {
@@ -31,19 +34,25 @@ async function deleteOp(opId, chainId) {
31
34
  }
32
35
  exports.deleteOp = deleteOp;
33
36
  async function signOp(opId, chainId, signature, signedBy, threshold) {
34
- await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "operation/sign", { opId, chainId, signature, signedBy, threshold });
37
+ await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/sign', {
38
+ opId,
39
+ chainId,
40
+ signature,
41
+ signedBy,
42
+ threshold,
43
+ });
35
44
  }
36
45
  exports.signOp = signOp;
37
46
  async function executeOp(executeOpInput) {
38
- return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "operation/execute", executeOpInput);
47
+ return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/execute', executeOpInput);
39
48
  }
40
49
  exports.executeOp = executeOp;
41
50
  async function estimateOp(estimateOpInput) {
42
- return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "operation/estimate", estimateOpInput);
51
+ return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/estimate', estimateOpInput);
43
52
  }
44
53
  exports.estimateOp = estimateOp;
45
54
  async function scheduleOp(scheduleOpInput) {
46
- await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "operation/schedule", scheduleOpInput);
55
+ await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/schedule', scheduleOpInput);
47
56
  }
48
57
  exports.scheduleOp = scheduleOp;
49
58
  const getFullReceipt = async (opId, chainId, userOpHash) => {
@@ -52,7 +61,7 @@ const getFullReceipt = async (opId, chainId, userOpHash) => {
52
61
  for (let i = 0; i < retries; i++) {
53
62
  try {
54
63
  result = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `operation/${opId}/chain/${chainId}/receipt?userOpHash=${userOpHash}`);
55
- if (result.status === "included") {
64
+ if (result.status === 'included') {
56
65
  break;
57
66
  }
58
67
  }
@@ -63,14 +72,14 @@ const getFullReceipt = async (opId, chainId, userOpHash) => {
63
72
  }
64
73
  if (!result.receipt) {
65
74
  result.receipt = {
66
- txId: "Failed to find.",
67
- gasUsed: "Failed to find.",
68
- opFeeUSD: "Failed to find.",
69
- opFee: "Failed to find."
75
+ txId: 'Failed to find.',
76
+ gasUsed: 'Failed to find.',
77
+ opFeeUSD: 'Failed to find.',
78
+ opFee: 'Failed to find.',
70
79
  };
71
80
  }
72
81
  return {
73
- ...result.receipt
82
+ ...result.receipt,
74
83
  };
75
84
  };
76
85
  exports.getFullReceipt = getFullReceipt;
@@ -1 +1 @@
1
- {"version":3,"file":"OperationApis.js","sourceRoot":"","sources":["../../../src/apis/OperationApis.ts"],"names":[],"mappings":";;;AAEA,mDAA6C;AAE7C,kCAAoD;AACpD,gDAAsF;AAE/E,KAAK,UAAU,QAAQ,CAAC,EAAa;IACxC,OAAO,CAAC,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,I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,OAAO,EACP,UAAU,EACiB,EAAE;IAC7B,MAAM,OAAO,GAAG,EAAE,CAAA;IAClB,IAAI,MAAW,CAAA;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,IAAA,yBAAc,EAC3B,mBAAO,EACP,aAAa,IAAI,UAAU,OAAO,uBAAuB,UAAU,EAAE,CACtE,CAAA;YACD,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBACjC,MAAK;YACP,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,WAAW;QACb,CAAC;QAED,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;IAC3D,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,GAAG;YACf,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,iBAAiB;YAC1B,QAAQ,EAAE,iBAAiB;YAC3B,KAAK,EAAE,iBAAiB;SACzB,CAAA;IACH,CAAC;IACD,OAAO;QACL,GAAG,MAAM,CAAC,OAAO;KAClB,CAAA;AACH,CAAC,CAAA;AAjCY,QAAA,cAAc,kBAiC1B;AAEM,MAAM,WAAW,GAAG,KAAK,EAC9B,OAAe,EACiB,EAAE;IAClC,OAAO,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,mBAAmB,OAAO,YAAY,CAAC,CAAA;AAC9E,CAAC,CAAA;AAJY,QAAA,WAAW,eAIvB"}
@@ -1,4 +1,4 @@
1
- import { PaymasterType } from "../sponsors/types";
1
+ import { PaymasterType } from '../sponsors/types';
2
2
  export interface PaymasterTransaction {
3
3
  action: string;
4
4
  amount: number;
@@ -5,13 +5,13 @@ const constants_1 = require("../common/constants");
5
5
  const ApiUtils_1 = require("../utils/ApiUtils");
6
6
  async function addTransaction(chainId, timestamp, txid, transaction, paymasterType, sponsorAddress) {
7
7
  try {
8
- return await (0, ApiUtils_1.sendPostRequest)(constants_1.DASHBOARD_API_URL, "paymasters/add-transaction", {
8
+ return await (0, ApiUtils_1.sendPostRequest)(constants_1.DASHBOARD_API_URL, 'paymasters/add-transaction', {
9
9
  chain: chainId,
10
10
  sponsorAddress,
11
11
  type: paymasterType,
12
12
  timestamp,
13
13
  transaction,
14
- txid
14
+ txid,
15
15
  });
16
16
  }
17
17
  catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"PaymasterApis.js","sourceRoot":"","sources":["../../../src/apis/PaymasterApis.ts"],"names":[],"mappings":";;;AAAA,mDAAuD;AAEvD,gDAAmD;AAU5C,KAAK,UAAU,cAAc,CAChC,OAAe,EACf,SAAiB,EACjB,IAAI,EACJ,WAAiC,EACjC,aAA4B,EAC5B,cAAsB;IAEtB,IAAI;QACA,OAAO,MAAM,IAAA,0BAAe,EAAC,6BAAiB,EAAE,4BAA4B,EAAE;YAC1E,KAAK,EAAE,OAAO;YACd,cAAc;YACd,IAAI,EAAE,aAAa;YACnB,SAAS;YACT,WAAW;YACX,IAAI;SACP,CAAC,CAAA;KACL;IAAC,OAAO,CAAC,EAAE;QACR,WAAW;KACd;AACL,CAAC;AApBD,wCAoBC"}
1
+ {"version":3,"file":"PaymasterApis.js","sourceRoot":"","sources":["../../../src/apis/PaymasterApis.ts"],"names":[],"mappings":";;;AAAA,mDAAuD;AAEvD,gDAAmD;AAU5C,KAAK,UAAU,cAAc,CAClC,OAAe,EACf,SAAiB,EACjB,IAAI,EACJ,WAAiC,EACjC,aAA4B,EAC5B,cAAsB;IAEtB,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,0BAAe,EAC1B,6BAAiB,EACjB,4BAA4B,EAC5B;YACE,KAAK,EAAE,OAAO;YACd,cAAc;YACd,IAAI,EAAE,aAAa;YACnB,SAAS;YACT,WAAW;YACX,IAAI;SACL,CACF,CAAA;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,WAAW;IACb,CAAC;AACH,CAAC;AAxBD,wCAwBC"}
@@ -1,4 +1,4 @@
1
- import { TransactionParams } from "../common";
1
+ import { TransactionParams } from '../common';
2
2
  export declare function get1InchSwapTx(chainId: string, src: string, dst: string, amount: string, from: string, slippage: string, disableEstimate: string, allowPartialFill: string): Promise<TransactionParams>;
3
- export declare function get1InchAllowance(chainId: string, tokenAddress: string, walletAddress: string): Promise<Number>;
3
+ export declare function get1InchAllowance(chainId: string, tokenAddress: string, walletAddress: string): Promise<number>;
4
4
  export declare function get1InchApproveTx(chainId: string, tokenAddress: string, amount: string): Promise<TransactionParams>;
@@ -11,35 +11,35 @@ async function get1InchSwapTx(chainId, src, dst, amount, from, slippage, disable
11
11
  from,
12
12
  slippage,
13
13
  disableEstimate,
14
- allowPartialFill
14
+ allowPartialFill,
15
15
  }).toString();
16
16
  const res = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `swap/${chainId}/swap/?${params}`);
17
17
  return {
18
18
  to: res.tx.to,
19
19
  value: Number(res.tx.value),
20
- data: res.tx.data
20
+ data: res.tx.data,
21
21
  };
22
22
  }
23
23
  exports.get1InchSwapTx = get1InchSwapTx;
24
24
  async function get1InchAllowance(chainId, tokenAddress, walletAddress) {
25
25
  const params = new URLSearchParams({
26
26
  tokenAddress,
27
- walletAddress
27
+ walletAddress,
28
28
  }).toString();
29
29
  const res = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `swap/${chainId}/approve/allowance/?${params}`);
30
- return Number(res["allowance"]);
30
+ return Number(res['allowance']);
31
31
  }
32
32
  exports.get1InchAllowance = get1InchAllowance;
33
33
  async function get1InchApproveTx(chainId, tokenAddress, amount) {
34
34
  const params = new URLSearchParams({
35
35
  tokenAddress,
36
- amount
36
+ amount,
37
37
  }).toString();
38
38
  const res = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `swap/${chainId}/approve/transaction/?${params}`);
39
39
  return {
40
40
  to: res.to,
41
41
  value: Number(res.value),
42
- data: res.data
42
+ data: res.data,
43
43
  };
44
44
  }
45
45
  exports.get1InchApproveTx = get1InchApproveTx;
@@ -1 +1 @@
1
- {"version":3,"file":"SwapApis.js","sourceRoot":"","sources":["../../../src/apis/SwapApis.ts"],"names":[],"mappings":";;;AACA,mDAA6C;AAC7C,gDAAkD;AAE3C,KAAK,UAAU,cAAc,CAChC,OAAe,EACf,GAAW,EACX,GAAW,EACX,MAAc,EACd,IAAY,EACZ,QAAgB,EAChB,eAAuB,EACvB,gBAAwB;IAExB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QAC/B,GAAG;QACH,GAAG;QACH,MAAM;QACN,IAAI;QACJ,QAAQ;QACR,eAAe;QACf,gBAAgB;KACnB,CAAC,CAAC,QAAQ,EAAE,CAAA;IACb,MAAM,GAAG,GAAG,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,QAAQ,OAAO,UAAU,MAAM,EAAE,CAAC,CAAA;IAC5E,OAAO;QACH,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE;QACb,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC;QAC3B,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI;KACpB,CAAA;AACL,CAAC;AAzBD,wCAyBC;AAEM,KAAK,UAAU,iBAAiB,CAAC,OAAe,EAAE,YAAoB,EAAE,aAAqB;IAChG,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QAC/B,YAAY;QACZ,aAAa;KAChB,CAAC,CAAC,QAAQ,EAAE,CAAA;IACb,MAAM,GAAG,GAAG,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,QAAQ,OAAO,uBAAuB,MAAM,EAAE,CAAC,CAAA;IACzF,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAA;AACnC,CAAC;AAPD,8CAOC;AAEM,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M,GAAG,IAAI,eAAe,CAAC;QACjC,YAAY;QACZ,aAAa;KACd,CAAC,CAAC,QAAQ,EAAE,CAAA;IACb,MAAM,GAAG,GAAG,MAAM,IAAA,yBAAc,EAC9B,mBAAO,EACP,QAAQ,OAAO,uBAAuB,MAAM,EAAE,CAC/C,CAAA;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAA;AACjC,CAAC;AAdD,8CAcC;AAEM,KAAK,UAAU,iBAAiB,CACrC,OAAe,EACf,YAAoB,EACpB,MAAc;IAEd,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QACjC,YAAY;QACZ,MAAM;KACP,CAAC,CAAC,QAAQ,EAAE,CAAA;IACb,MAAM,GAAG,GAAG,MAAM,IAAA,yBAAc,EAC9B,mBAAO,EACP,QAAQ,OAAO,yBAAyB,MAAM,EAAE,CACjD,CAAA;IACD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;QACxB,IAAI,EAAE,GAAG,CAAC,IAAI;KACf,CAAA;AACH,CAAC;AAlBD,8CAkBC"}
@@ -1,3 +1,3 @@
1
- import { TPrivateKeyState } from "./types";
1
+ import { TPrivateKeyState } from './types';
2
2
  export declare function createTurnkeySubOrg(createSubOrgRequest: object): Promise<string>;
3
3
  export declare function createTurnkeyPrivateKey(signedRequest: object): Promise<TPrivateKeyState>;
@@ -4,15 +4,15 @@ exports.createTurnkeyPrivateKey = exports.createTurnkeySubOrg = void 0;
4
4
  const constants_1 = require("../common/constants");
5
5
  const ApiUtils_1 = require("../utils/ApiUtils");
6
6
  async function createTurnkeySubOrg(createSubOrgRequest) {
7
- const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "turnkey/sub-org", createSubOrgRequest);
7
+ const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'turnkey/sub-org', createSubOrgRequest);
8
8
  return res;
9
9
  }
10
10
  exports.createTurnkeySubOrg = createTurnkeySubOrg;
11
11
  async function createTurnkeyPrivateKey(signedRequest) {
12
- const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, "turnkey/private-key", signedRequest);
12
+ const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'turnkey/private-key', signedRequest);
13
13
  return {
14
14
  id: res.id,
15
- address: res.address
15
+ address: res.address,
16
16
  };
17
17
  }
18
18
  exports.createTurnkeyPrivateKey = createTurnkeyPrivateKey;
@@ -1 +1 @@
1
- {"version":3,"file":"TurnkeyApis.js","sourceRoot":"","sources":["../../../src/apis/TurnkeyApis.ts"],"names":[],"mappings":";;;AACA,mDAA6C;AAC7C,gDAAmD;AAE5C,KAAK,UAAU,mBAAmB,CAAC,mBAA2B;IACjE,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,iBAAiB,EAAE,mBAAmB,CAAC,CAAA;IAClF,OAAO,GAAG,CAAA;AACd,CAAC;AAHD,kDAGC;AAEM,KAAK,UAAU,uBAAuB,CAAC,aAAqB;IAC/D,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,qBAAqB,EAAE,aAAa,CAAC,CAAA;IAChF,OAAO;QACH,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,OAAO,EAAE,GAAG,CAAC,OAAO;KACvB,CAAA;AACL,CAAC;AAND,0DAMC"}
1
+ {"version":3,"file":"TurnkeyApis.js","sourceRoot":"","sources":["../../../src/apis/TurnkeyApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,gDAAmD;AAG5C,KAAK,UAAU,mBAAmB,CACvC,mBAA2B;IAE3B,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAe,EAC/B,mBAAO,EACP,iBAAiB,EACjB,mBAAmB,CACpB,CAAA;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AATD,kDASC;AAEM,KAAK,UAAU,uBAAuB,CAC3C,aAAqB;IAErB,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAe,EAC/B,mBAAO,EACP,qBAAqB,EACrB,aAAa,CACd,CAAA;IACD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB,CAAA;AACH,CAAC;AAZD,0DAYC"}
@@ -1,5 +1,5 @@
1
- import { Address, Hex } from "viem";
2
- import { Wallet } from "./types";
1
+ import { Address, Hex } from 'viem';
2
+ import { Wallet } from './types';
3
3
  export declare function createUser(authId: string, addr: string, method: string, userUniqueId: string): Promise<void>;
4
4
  export declare function getUserUniqueId(authId: string): Promise<string>;
5
5
  export declare function getUserAddr(authId: string): Promise<string>;