@ton-pay/api 0.2.0-beta.1 → 0.2.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/dist/index.mjs CHANGED
@@ -6625,8 +6625,8 @@ var require_crypto_js = __commonJS({
6625
6625
  });
6626
6626
 
6627
6627
  // src/common/const.ts
6628
- var BASE_URL = "https://tonpay.tech";
6629
- var TESTNET_BASE_URL = "https://testnet.tonpay.tech";
6628
+ var BASE_URL = "https://pay.ton.org";
6629
+ var TESTNET_BASE_URL = "https://testnet.pay.ton.org";
6630
6630
 
6631
6631
  // src/common/get-base-url.ts
6632
6632
  var getBaseUrl = (chain) => {
@@ -6734,6 +6734,27 @@ var checkMoonpayLimits = async (params, options) => {
6734
6734
  return response.json();
6735
6735
  };
6736
6736
 
6737
+ // src/check-moonpay-availability/check-moonpay-availability.ts
6738
+ var checkMoonpayAvailability = async (params, options) => {
6739
+ const baseUrl = getBaseUrl(options?.chain);
6740
+ const headers = {
6741
+ "Content-Type": "application/json",
6742
+ ...options?.apiKey ? { "x-api-key": options.apiKey } : {}
6743
+ };
6744
+ const response = await fetch(`${baseUrl}/api/external/moonpay/check`, {
6745
+ method: "POST",
6746
+ body: JSON.stringify(params),
6747
+ headers
6748
+ });
6749
+ if (!response.ok) {
6750
+ const errorText = await response.text();
6751
+ throw new Error(`Failed to check MoonPay availability: ${errorText}`, {
6752
+ cause: response.statusText
6753
+ });
6754
+ }
6755
+ return response.json();
6756
+ };
6757
+
6737
6758
  // src/get-ton-pay-transfer/get-ton-pay-transfer-by-body-hash.ts
6738
6759
  var getTonPayTransferByBodyHash = async (bodyHash, options) => {
6739
6760
  const baseUrl = getBaseUrl(options?.chain);
@@ -6783,6 +6804,7 @@ function verifySignature(payload, signature, apiSecret) {
6783
6804
  export {
6784
6805
  TON,
6785
6806
  USDT,
6807
+ checkMoonpayAvailability,
6786
6808
  checkMoonpayGeo,
6787
6809
  checkMoonpayLimits,
6788
6810
  createMoonpayTransfer,