@funkit/api-base 1.8.3 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @funkit/api-base
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b18e3e2: feat: add meld quote/widgets
8
+
9
+ ### Patch Changes
10
+
11
+ - 6ea6b26: feat: frog fun-relay fee
12
+ - 48ab9be: feat: only fetch first five checkouts & direct executions for faster notification
13
+ - a273823: feat(api-base): add meld quote/widget endpoints
14
+ - Updated dependencies [b18e3e2]
15
+ - @funkit/utils@1.1.0
16
+
17
+ ## 1.8.4
18
+
19
+ ### Patch Changes
20
+
21
+ - 8292deb: feat: fetching organization / client id
22
+ - cbea7ca: feat: update direct execution interface
23
+
3
24
  ## 1.8.3
4
25
 
5
26
  ### Patch Changes
package/dist/index.js CHANGED
@@ -683,10 +683,14 @@ async function getCheckoutsByRecipientAddress({
683
683
  }
684
684
  async function getCheckoutsByUserId({
685
685
  userId,
686
+ limit,
686
687
  ...options
687
688
  }) {
689
+ const query = limit ? new URLSearchParams({
690
+ limit: limit.toString()
691
+ }) : "";
688
692
  const res = await sendGetRequest({
689
- uri: `${API_BASE_URL}/checkout/userId/${userId}`,
693
+ uri: `${API_BASE_URL}/checkout/userId/${userId}?${query}`,
690
694
  ...options
691
695
  });
692
696
  return res || [];
@@ -769,10 +773,14 @@ async function getDirectExecutionsByUserId({
769
773
  userId,
770
774
  apiKey,
771
775
  logger,
776
+ limit,
772
777
  signal
773
778
  }) {
779
+ const query = limit ? new URLSearchParams({
780
+ limit: limit.toString()
781
+ }) : "";
774
782
  return sendGetRequest({
775
- uri: `${API_BASE_URL}/direct-execution/userId/${userId}`,
783
+ uri: `${API_BASE_URL}/direct-execution/userId/${userId}?${query}`,
776
784
  apiKey,
777
785
  logger,
778
786
  signal
@@ -1192,6 +1200,118 @@ async function getUserWalletIdentities({
1192
1200
  })).ids ?? [];
1193
1201
  }
1194
1202
 
1203
+ // src/services/meld/endpoints.ts
1204
+ async function getMeldSupportedFiat({
1205
+ ...options
1206
+ }) {
1207
+ return sendGetRequest({
1208
+ uri: `${MESH_API_BASE_URL}/api/meld/fiat`,
1209
+ ...options,
1210
+ retryOptions: { maxAttempts: 2 }
1211
+ });
1212
+ }
1213
+ async function getMeldQuotes({
1214
+ params,
1215
+ ...options
1216
+ }) {
1217
+ return sendPostRequest({
1218
+ uri: `${MESH_API_BASE_URL}/api/meld/quote`,
1219
+ body: params,
1220
+ retryOptions: { maxAttempts: 2 },
1221
+ ...options
1222
+ });
1223
+ }
1224
+ async function startMeldSession({
1225
+ params,
1226
+ ...options
1227
+ }) {
1228
+ return sendPostRequest({
1229
+ uri: `${MESH_API_BASE_URL}/api/meld/session`,
1230
+ body: {
1231
+ sessionData: params,
1232
+ sessionType: "BUY"
1233
+ },
1234
+ retryOptions: { maxAttempts: 2 },
1235
+ ...options
1236
+ });
1237
+ }
1238
+ async function getMeldDefaultFiat({
1239
+ params,
1240
+ ...options
1241
+ }) {
1242
+ const countries = params.countries?.join(",") ?? "";
1243
+ const categories = params.categories?.join(",") ?? "";
1244
+ const urlParams = new URLSearchParams({
1245
+ ...countries ? { countries } : {},
1246
+ ...categories ? { categories } : {}
1247
+ });
1248
+ return sendGetRequest({
1249
+ uri: `${MESH_API_BASE_URL}/api/meld/defaultFiat?${urlParams}`,
1250
+ ...options,
1251
+ retryOptions: { maxAttempts: 2 }
1252
+ });
1253
+ }
1254
+ async function getMeldFiatLimits({
1255
+ params,
1256
+ ...options
1257
+ }) {
1258
+ const countries = params.countries.join(",");
1259
+ const cryptoCurrencies = params.cryptoCurrencies.join(",");
1260
+ const fiatCurrencies = params.fiatCurrencies.join(",");
1261
+ const categories = params.categories?.join(",") ?? "";
1262
+ const urlParams = new URLSearchParams({
1263
+ countries,
1264
+ cryptoCurrencies,
1265
+ fiatCurrencies,
1266
+ ...categories ? { categories } : {}
1267
+ });
1268
+ return sendGetRequest({
1269
+ uri: `${MESH_API_BASE_URL}/api/meld/fiatLimit?${urlParams}`,
1270
+ ...options,
1271
+ retryOptions: { maxAttempts: 2 }
1272
+ });
1273
+ }
1274
+
1275
+ // src/services/meld/types.ts
1276
+ var MeldServiceProvider = /* @__PURE__ */ ((MeldServiceProvider2) => {
1277
+ MeldServiceProvider2["ALCHEMYPAY"] = "ALCHEMYPAY";
1278
+ MeldServiceProvider2["BANXA"] = "BANXA";
1279
+ MeldServiceProvider2["BILIRA"] = "BILIRA";
1280
+ MeldServiceProvider2["BINANCECONNECT"] = "BINANCECONNECT";
1281
+ MeldServiceProvider2["BLOCKCHAINDOTCOM"] = "BLOCKCHAINDOTCOM";
1282
+ MeldServiceProvider2["BTCDIRECT"] = "BTCDIRECT";
1283
+ MeldServiceProvider2["COINBASEPAY"] = "COINBASEPAY";
1284
+ MeldServiceProvider2["FONBNK"] = "FONBNK";
1285
+ MeldServiceProvider2["GUARDARIAN"] = "GUARDARIAN";
1286
+ MeldServiceProvider2["KOYWE"] = "KOYWE";
1287
+ MeldServiceProvider2["MESH"] = "MESH";
1288
+ MeldServiceProvider2["MESO"] = "MESO";
1289
+ MeldServiceProvider2["ONMETA"] = "ONMETA";
1290
+ MeldServiceProvider2["ONRAMPMONEY"] = "ONRAMPMONEY";
1291
+ MeldServiceProvider2["PAYBIS"] = "PAYBIS";
1292
+ MeldServiceProvider2["PAYPAL"] = "PAYPAL";
1293
+ MeldServiceProvider2["RAMP"] = "RAMP";
1294
+ MeldServiceProvider2["ROBINHOOD"] = "ROBINHOOD";
1295
+ MeldServiceProvider2["SARDINE"] = "SARDINE";
1296
+ MeldServiceProvider2["SHIFT4"] = "SHIFT4";
1297
+ MeldServiceProvider2["SIMPLEX"] = "SIMPLEX";
1298
+ MeldServiceProvider2["SKRILLCRYPTO"] = "SKRILLCRYPTO";
1299
+ MeldServiceProvider2["STRIPE"] = "STRIPE";
1300
+ MeldServiceProvider2["TOPPER"] = "TOPPER";
1301
+ MeldServiceProvider2["TRANSAK"] = "TRANSAK";
1302
+ MeldServiceProvider2["TRANSFI"] = "TRANSFI";
1303
+ MeldServiceProvider2["UNLIMIT"] = "UNLIMIT";
1304
+ MeldServiceProvider2["YELLOWCARD"] = "YELLOWCARD";
1305
+ return MeldServiceProvider2;
1306
+ })(MeldServiceProvider || {});
1307
+ var MELD_PROVIDER_CATEGORIES = [
1308
+ "BANK_LINKING",
1309
+ "CRYPTO_ONRAMP",
1310
+ "CRYPTO_OFFRAMP",
1311
+ "CRYPTO_TRANSFER",
1312
+ "FIAT_PAYMENTS"
1313
+ ];
1314
+
1195
1315
  // src/services/mesh/endpoints.ts
1196
1316
  async function meshGetCryptocurrencyHoldings({
1197
1317
  authToken,
@@ -1454,6 +1574,16 @@ async function getMoonpayBuyQuoteForCreditCard({
1454
1574
  });
1455
1575
  }
1456
1576
 
1577
+ // src/services/organization/endpoints.ts
1578
+ async function getOrganizationIdByApiKey({
1579
+ apiKey
1580
+ }) {
1581
+ return await sendGetRequest({
1582
+ uri: `${API_BASE_URL}/organization`,
1583
+ apiKey
1584
+ });
1585
+ }
1586
+
1457
1587
  // src/services/stripe/endpoints.ts
1458
1588
  async function getStripeBuyQuote({
1459
1589
  sourceCurrency,
@@ -1568,7 +1698,9 @@ export {
1568
1698
  FUN_FAUCET_URL,
1569
1699
  IN_PROGRESS_CHECKOUT_STATES,
1570
1700
  KATANA_API_KEY,
1701
+ MELD_PROVIDER_CATEGORIES,
1571
1702
  MESH_API_BASE_URL,
1703
+ MeldServiceProvider,
1572
1704
  MeshConfigureTransferStatus,
1573
1705
  MeshExecuteTransferMfaType,
1574
1706
  MeshExecuteTransferStatus,
@@ -1621,12 +1753,17 @@ export {
1621
1753
  getFrogAccount,
1622
1754
  getFullReceipt,
1623
1755
  getGroups,
1756
+ getMeldDefaultFiat,
1757
+ getMeldFiatLimits,
1758
+ getMeldQuotes,
1759
+ getMeldSupportedFiat,
1624
1760
  getMoonpayBuyQuoteForCreditCard,
1625
1761
  getMoonpayUrlSignature,
1626
1762
  getNftAddress,
1627
1763
  getNftName,
1628
1764
  getOps,
1629
1765
  getOpsOfWallet,
1766
+ getOrganizationIdByApiKey,
1630
1767
  getPaymasterDataForCheckoutSponsoredTransfer,
1631
1768
  getRiskAssessmentForAddress,
1632
1769
  getStripeBuyQuote,
@@ -1660,6 +1797,7 @@ export {
1660
1797
  sendPutRequest,
1661
1798
  sendRequest,
1662
1799
  sendSupportMessage,
1663
- signOp
1800
+ signOp,
1801
+ startMeldSession
1664
1802
  };
1665
1803
  //# sourceMappingURL=index.js.map