@beep-it/sdk-core 0.1.5 → 0.1.7
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/README.md +12 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -9
- package/dist/index.mjs +52 -9
- package/dist/modules/payments.d.ts +8 -5
- package/dist/modules/payments.d.ts.map +1 -1
- package/dist/modules/widget.d.ts +9 -4
- package/dist/modules/widget.d.ts.map +1 -1
- package/dist/types/cash-payment.d.ts +13 -0
- package/dist/types/cash-payment.d.ts.map +1 -0
- package/dist/types/payment.d.ts +23 -0
- package/dist/types/payment.d.ts.map +1 -1
- package/dist/types/public.d.ts +95 -1
- package/dist/types/public.d.ts.map +1 -1
- package/package.json +11 -13
package/README.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
# The BEEP SDK: Turn Your Cool Sh\*t into
|
|
1
|
+
# The BEEP PAY SDK: Turn Your Cool Sh\*t into Revenue - now on SUI 💸
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Accept credit cards, USDC and receive revenue in USDC on SUI wallets
|
|
4
|
+
|
|
5
|
+
Alright, let's be real. You made something awesome. A game, an app, a digital masterpiece. And now you wanna get paid for it. As you should! But dealing with payments is a whole vibe killer.
|
|
6
|
+
|
|
7
|
+
That’s where **Beep** comes in.
|
|
8
|
+
|
|
9
|
+
Beep makes it stupid simple to accept **USDC payments** on the **SUI network**, fully **self-custodial**, **AEO-ready**, and **AI-native**.
|
|
10
|
+
No banks. No bridges. No nonsense.
|
|
11
|
+
|
|
12
|
+
---
|
|
4
13
|
|
|
5
14
|
## Table of Contents
|
|
6
15
|
|
|
@@ -374,7 +383,7 @@ const beep = new BeepClient({ apiKey: process.env.BEEP_API_KEY! });
|
|
|
374
383
|
const result = await beep.createPayout({
|
|
375
384
|
amount: '1000000', // 1.00 USDC (6 decimals)
|
|
376
385
|
destinationWalletAddress: 'DESTINATION_ADDRESS',
|
|
377
|
-
chain: '
|
|
386
|
+
chain: 'SUI',
|
|
378
387
|
token: 'USDC',
|
|
379
388
|
});
|
|
380
389
|
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAgB;IAE9B,oEAAoE;IACpE,SAAgB,QAAQ,EAAE,cAAc,CAAC;IAEzC,oEAAoE;IACpE,SAAgB,QAAQ,EAAE,cAAc,CAAC;IAEzC;;;;;OAKG;IACH,SAAgB,QAAQ,EAAE,cAAc,CAAC;IACzC,wCAAwC;IACxC,SAAgB,IAAI,EAAE,UAAU,CAAC;IAEjC;;;;;OAKG;gBACS,OAAO,EAAE,iBAAiB;IAoBtC;;;;;;;;;;;;;;;;OAgBG;IAGH;;;;;;;;;;;OAWG;IACU,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;CAW5C;AAOD,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGpG,YAAY,EACV,0BAA0B,EAC1B,+BAA+B,EAC/B,oBAAoB,EACpB,OAAO,EACP,aAAa,E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|
*
|
|
441
441
|
* const paymentSession = await beep.payments.issuePayment({
|
|
442
|
-
* apiKey: 'your_secret_api_key',
|
|
443
442
|
* assetChunks: [
|
|
444
443
|
* { assetId: 'video-streaming-uuid', quantity: 1 },
|
|
445
444
|
* { assetId: 'api-calls-uuid', quantity: 100 }
|
|
@@ -477,7 +476,6 @@ var PaymentsModule = class {
|
|
|
477
476
|
* ```typescript
|
|
478
477
|
* // Start billing for the streaming session
|
|
479
478
|
* const result = await beep.payments.startStreaming({
|
|
480
|
-
* apiKey: 'your_secret_api_key',
|
|
481
479
|
* invoiceId: 'invoice_uuid_from_issuePayment'
|
|
482
480
|
* });
|
|
483
481
|
*
|
|
@@ -507,7 +505,6 @@ var PaymentsModule = class {
|
|
|
507
505
|
* ```typescript
|
|
508
506
|
* // Temporarily pause billing (can be resumed later)
|
|
509
507
|
* const result = await beep.payments.pauseStreaming({
|
|
510
|
-
* apiKey: 'your_secret_api_key',
|
|
511
508
|
* invoiceId: 'active_streaming_invoice_uuid'
|
|
512
509
|
* });
|
|
513
510
|
*
|
|
@@ -539,7 +536,6 @@ var PaymentsModule = class {
|
|
|
539
536
|
* ```typescript
|
|
540
537
|
* // Permanently stop and finalize the streaming session
|
|
541
538
|
* const result = await beep.payments.stopStreaming({
|
|
542
|
-
* apiKey: 'your_secret_api_key',
|
|
543
539
|
* invoiceId: 'active_streaming_invoice_uuid'
|
|
544
540
|
* });
|
|
545
541
|
*
|
|
@@ -552,6 +548,16 @@ var PaymentsModule = class {
|
|
|
552
548
|
const response = await this.client.post("/v1/invoices/stop", payload);
|
|
553
549
|
return response.data;
|
|
554
550
|
}
|
|
551
|
+
/**
|
|
552
|
+
* Checks payment status for a given reference key.
|
|
553
|
+
* Calls the server `/v1/invoices/check-payment-status` endpoint with an API key.
|
|
554
|
+
*
|
|
555
|
+
* @param params.referenceKey - The payment reference key to check
|
|
556
|
+
*/
|
|
557
|
+
async checkPaymentStatus(params) {
|
|
558
|
+
const { data } = await this.client.post("/v1/invoices/check-payment-status", params);
|
|
559
|
+
return data;
|
|
560
|
+
}
|
|
555
561
|
};
|
|
556
562
|
|
|
557
563
|
// src/modules/products.ts
|
|
@@ -691,16 +697,14 @@ var ProductsModule = class {
|
|
|
691
697
|
|
|
692
698
|
// src/modules/widget.ts
|
|
693
699
|
var WidgetModule = class {
|
|
694
|
-
constructor(client
|
|
700
|
+
constructor(client) {
|
|
695
701
|
this.client = client;
|
|
696
|
-
this.publishableKey = publishableKey;
|
|
697
702
|
}
|
|
698
703
|
/**
|
|
699
704
|
* Creates a payment session (public, CORS-open) for Checkout Widget
|
|
700
705
|
*/
|
|
701
706
|
async createPaymentSession(input) {
|
|
702
707
|
const body = {
|
|
703
|
-
publishableKey: this.publishableKey,
|
|
704
708
|
assets: input.assets,
|
|
705
709
|
paymentLabel: input.paymentLabel,
|
|
706
710
|
generateQrCode: input.generateQrCode ?? true
|
|
@@ -711,6 +715,36 @@ var WidgetModule = class {
|
|
|
711
715
|
);
|
|
712
716
|
return res.data;
|
|
713
717
|
}
|
|
718
|
+
async generateOTP(input) {
|
|
719
|
+
const res = await this.client.post("/v1/widget/generate-otp", {
|
|
720
|
+
...input
|
|
721
|
+
});
|
|
722
|
+
return res.data;
|
|
723
|
+
}
|
|
724
|
+
async verifyOTP(input) {
|
|
725
|
+
const res = await this.client.post("/v1/widget/verify-otp", {
|
|
726
|
+
...input
|
|
727
|
+
});
|
|
728
|
+
return res.data;
|
|
729
|
+
}
|
|
730
|
+
async generatePaymentQuote(input) {
|
|
731
|
+
const res = await this.client.post(
|
|
732
|
+
"/v1/widget/generate-payment-quote",
|
|
733
|
+
{
|
|
734
|
+
...input
|
|
735
|
+
}
|
|
736
|
+
);
|
|
737
|
+
return res.data;
|
|
738
|
+
}
|
|
739
|
+
async createCashPaymentOrder(input) {
|
|
740
|
+
const res = await this.client.post(
|
|
741
|
+
"/v1/widget/create-cash-payment-order",
|
|
742
|
+
{
|
|
743
|
+
...input
|
|
744
|
+
}
|
|
745
|
+
);
|
|
746
|
+
return res.data;
|
|
747
|
+
}
|
|
714
748
|
/**
|
|
715
749
|
* Retrieves payment status for a reference key
|
|
716
750
|
*/
|
|
@@ -753,6 +787,14 @@ var WidgetModule = class {
|
|
|
753
787
|
await new Promise((r) => setTimeout(r, currentIntervalMs));
|
|
754
788
|
}
|
|
755
789
|
}
|
|
790
|
+
async getDynamicEnv() {
|
|
791
|
+
const res = await this.client.get("/v1/widget/environment");
|
|
792
|
+
return res.data;
|
|
793
|
+
}
|
|
794
|
+
async getProducts() {
|
|
795
|
+
const res = await this.client.get("/v1/widget/products");
|
|
796
|
+
return res.data;
|
|
797
|
+
}
|
|
756
798
|
};
|
|
757
799
|
|
|
758
800
|
// src/modules/user.ts
|
|
@@ -848,10 +890,11 @@ var BeepPublicClient = class {
|
|
|
848
890
|
baseURL: options.serverUrl || "https://api.justbeep.it",
|
|
849
891
|
headers: {
|
|
850
892
|
"Content-Type": "application/json",
|
|
851
|
-
"X-Beep-Client": "beep-sdk"
|
|
893
|
+
"X-Beep-Client": "beep-sdk",
|
|
894
|
+
Authorization: `Bearer ${options.publishableKey}`
|
|
852
895
|
}
|
|
853
896
|
});
|
|
854
|
-
this.widget = new WidgetModule(this.client
|
|
897
|
+
this.widget = new WidgetModule(this.client);
|
|
855
898
|
}
|
|
856
899
|
};
|
|
857
900
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -402,7 +402,6 @@ var PaymentsModule = class {
|
|
|
402
402
|
* const beep = new BeepClient({ apiKey: 'your_secret_api_key' });
|
|
403
403
|
*
|
|
404
404
|
* const paymentSession = await beep.payments.issuePayment({
|
|
405
|
-
* apiKey: 'your_secret_api_key',
|
|
406
405
|
* assetChunks: [
|
|
407
406
|
* { assetId: 'video-streaming-uuid', quantity: 1 },
|
|
408
407
|
* { assetId: 'api-calls-uuid', quantity: 100 }
|
|
@@ -440,7 +439,6 @@ var PaymentsModule = class {
|
|
|
440
439
|
* ```typescript
|
|
441
440
|
* // Start billing for the streaming session
|
|
442
441
|
* const result = await beep.payments.startStreaming({
|
|
443
|
-
* apiKey: 'your_secret_api_key',
|
|
444
442
|
* invoiceId: 'invoice_uuid_from_issuePayment'
|
|
445
443
|
* });
|
|
446
444
|
*
|
|
@@ -470,7 +468,6 @@ var PaymentsModule = class {
|
|
|
470
468
|
* ```typescript
|
|
471
469
|
* // Temporarily pause billing (can be resumed later)
|
|
472
470
|
* const result = await beep.payments.pauseStreaming({
|
|
473
|
-
* apiKey: 'your_secret_api_key',
|
|
474
471
|
* invoiceId: 'active_streaming_invoice_uuid'
|
|
475
472
|
* });
|
|
476
473
|
*
|
|
@@ -502,7 +499,6 @@ var PaymentsModule = class {
|
|
|
502
499
|
* ```typescript
|
|
503
500
|
* // Permanently stop and finalize the streaming session
|
|
504
501
|
* const result = await beep.payments.stopStreaming({
|
|
505
|
-
* apiKey: 'your_secret_api_key',
|
|
506
502
|
* invoiceId: 'active_streaming_invoice_uuid'
|
|
507
503
|
* });
|
|
508
504
|
*
|
|
@@ -515,6 +511,16 @@ var PaymentsModule = class {
|
|
|
515
511
|
const response = await this.client.post("/v1/invoices/stop", payload);
|
|
516
512
|
return response.data;
|
|
517
513
|
}
|
|
514
|
+
/**
|
|
515
|
+
* Checks payment status for a given reference key.
|
|
516
|
+
* Calls the server `/v1/invoices/check-payment-status` endpoint with an API key.
|
|
517
|
+
*
|
|
518
|
+
* @param params.referenceKey - The payment reference key to check
|
|
519
|
+
*/
|
|
520
|
+
async checkPaymentStatus(params) {
|
|
521
|
+
const { data } = await this.client.post("/v1/invoices/check-payment-status", params);
|
|
522
|
+
return data;
|
|
523
|
+
}
|
|
518
524
|
};
|
|
519
525
|
|
|
520
526
|
// src/modules/products.ts
|
|
@@ -654,16 +660,14 @@ var ProductsModule = class {
|
|
|
654
660
|
|
|
655
661
|
// src/modules/widget.ts
|
|
656
662
|
var WidgetModule = class {
|
|
657
|
-
constructor(client
|
|
663
|
+
constructor(client) {
|
|
658
664
|
this.client = client;
|
|
659
|
-
this.publishableKey = publishableKey;
|
|
660
665
|
}
|
|
661
666
|
/**
|
|
662
667
|
* Creates a payment session (public, CORS-open) for Checkout Widget
|
|
663
668
|
*/
|
|
664
669
|
async createPaymentSession(input) {
|
|
665
670
|
const body = {
|
|
666
|
-
publishableKey: this.publishableKey,
|
|
667
671
|
assets: input.assets,
|
|
668
672
|
paymentLabel: input.paymentLabel,
|
|
669
673
|
generateQrCode: input.generateQrCode ?? true
|
|
@@ -674,6 +678,36 @@ var WidgetModule = class {
|
|
|
674
678
|
);
|
|
675
679
|
return res.data;
|
|
676
680
|
}
|
|
681
|
+
async generateOTP(input) {
|
|
682
|
+
const res = await this.client.post("/v1/widget/generate-otp", {
|
|
683
|
+
...input
|
|
684
|
+
});
|
|
685
|
+
return res.data;
|
|
686
|
+
}
|
|
687
|
+
async verifyOTP(input) {
|
|
688
|
+
const res = await this.client.post("/v1/widget/verify-otp", {
|
|
689
|
+
...input
|
|
690
|
+
});
|
|
691
|
+
return res.data;
|
|
692
|
+
}
|
|
693
|
+
async generatePaymentQuote(input) {
|
|
694
|
+
const res = await this.client.post(
|
|
695
|
+
"/v1/widget/generate-payment-quote",
|
|
696
|
+
{
|
|
697
|
+
...input
|
|
698
|
+
}
|
|
699
|
+
);
|
|
700
|
+
return res.data;
|
|
701
|
+
}
|
|
702
|
+
async createCashPaymentOrder(input) {
|
|
703
|
+
const res = await this.client.post(
|
|
704
|
+
"/v1/widget/create-cash-payment-order",
|
|
705
|
+
{
|
|
706
|
+
...input
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
return res.data;
|
|
710
|
+
}
|
|
677
711
|
/**
|
|
678
712
|
* Retrieves payment status for a reference key
|
|
679
713
|
*/
|
|
@@ -716,6 +750,14 @@ var WidgetModule = class {
|
|
|
716
750
|
await new Promise((r) => setTimeout(r, currentIntervalMs));
|
|
717
751
|
}
|
|
718
752
|
}
|
|
753
|
+
async getDynamicEnv() {
|
|
754
|
+
const res = await this.client.get("/v1/widget/environment");
|
|
755
|
+
return res.data;
|
|
756
|
+
}
|
|
757
|
+
async getProducts() {
|
|
758
|
+
const res = await this.client.get("/v1/widget/products");
|
|
759
|
+
return res.data;
|
|
760
|
+
}
|
|
719
761
|
};
|
|
720
762
|
|
|
721
763
|
// src/modules/user.ts
|
|
@@ -811,10 +853,11 @@ var BeepPublicClient = class {
|
|
|
811
853
|
baseURL: options.serverUrl || "https://api.justbeep.it",
|
|
812
854
|
headers: {
|
|
813
855
|
"Content-Type": "application/json",
|
|
814
|
-
"X-Beep-Client": "beep-sdk"
|
|
856
|
+
"X-Beep-Client": "beep-sdk",
|
|
857
|
+
Authorization: `Bearer ${options.publishableKey}`
|
|
815
858
|
}
|
|
816
859
|
});
|
|
817
|
-
this.widget = new WidgetModule(this.client
|
|
860
|
+
this.widget = new WidgetModule(this.client);
|
|
818
861
|
}
|
|
819
862
|
};
|
|
820
863
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { BeepPurchaseAsset, IssuePaymentPayload, IssuePaymentResponse, PauseStreamingPayload, PauseStreamingResponse, PaymentRequestData, RequestAndPurchaseAssetRequestParams, SignSolanaTransactionData, SignSolanaTransactionParams, StartStreamingPayload, StartStreamingResponse, StopStreamingPayload, StopStreamingResponse } from '../types';
|
|
2
|
+
import { BeepPurchaseAsset, CheckPaymentStatusPayload, CheckPaymentStatusResponse, IssuePaymentPayload, IssuePaymentResponse, PauseStreamingPayload, PauseStreamingResponse, PaymentRequestData, RequestAndPurchaseAssetRequestParams, SignSolanaTransactionData, SignSolanaTransactionParams, StartStreamingPayload, StartStreamingResponse, StopStreamingPayload, StopStreamingResponse } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Module for handling payment operations including asset purchases and Solana transactions
|
|
5
5
|
* Provides methods for creating payment requests and signing blockchain transactions
|
|
@@ -140,7 +140,6 @@ export declare class PaymentsModule {
|
|
|
140
140
|
* const beep = new BeepClient({ apiKey: 'your_secret_api_key' });
|
|
141
141
|
*
|
|
142
142
|
* const paymentSession = await beep.payments.issuePayment({
|
|
143
|
-
* apiKey: 'your_secret_api_key',
|
|
144
143
|
* assetChunks: [
|
|
145
144
|
* { assetId: 'video-streaming-uuid', quantity: 1 },
|
|
146
145
|
* { assetId: 'api-calls-uuid', quantity: 100 }
|
|
@@ -172,7 +171,6 @@ export declare class PaymentsModule {
|
|
|
172
171
|
* ```typescript
|
|
173
172
|
* // Start billing for the streaming session
|
|
174
173
|
* const result = await beep.payments.startStreaming({
|
|
175
|
-
* apiKey: 'your_secret_api_key',
|
|
176
174
|
* invoiceId: 'invoice_uuid_from_issuePayment'
|
|
177
175
|
* });
|
|
178
176
|
*
|
|
@@ -199,7 +197,6 @@ export declare class PaymentsModule {
|
|
|
199
197
|
* ```typescript
|
|
200
198
|
* // Temporarily pause billing (can be resumed later)
|
|
201
199
|
* const result = await beep.payments.pauseStreaming({
|
|
202
|
-
* apiKey: 'your_secret_api_key',
|
|
203
200
|
* invoiceId: 'active_streaming_invoice_uuid'
|
|
204
201
|
* });
|
|
205
202
|
*
|
|
@@ -228,7 +225,6 @@ export declare class PaymentsModule {
|
|
|
228
225
|
* ```typescript
|
|
229
226
|
* // Permanently stop and finalize the streaming session
|
|
230
227
|
* const result = await beep.payments.stopStreaming({
|
|
231
|
-
* apiKey: 'your_secret_api_key',
|
|
232
228
|
* invoiceId: 'active_streaming_invoice_uuid'
|
|
233
229
|
* });
|
|
234
230
|
*
|
|
@@ -238,5 +234,12 @@ export declare class PaymentsModule {
|
|
|
238
234
|
* ```
|
|
239
235
|
*/
|
|
240
236
|
stopStreaming(payload: StopStreamingPayload): Promise<StopStreamingResponse>;
|
|
237
|
+
/**
|
|
238
|
+
* Checks payment status for a given reference key.
|
|
239
|
+
* Calls the server `/v1/invoices/check-payment-status` endpoint with an API key.
|
|
240
|
+
*
|
|
241
|
+
* @param params.referenceKey - The payment reference key to check
|
|
242
|
+
*/
|
|
243
|
+
checkPaymentStatus(params: CheckPaymentStatusPayload): Promise<CheckPaymentStatusResponse>;
|
|
241
244
|
}
|
|
242
245
|
//# sourceMappingURL=payments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../src/modules/payments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,oCAAoC,EAEpC,yBAAyB,EACzB,2BAA2B,EAE3B,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAGlB;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAgB;gBAElB,MAAM,EAAE,aAAa;IAIjC;;;;;;;;;;;;;;;;OAgBG;IACU,YAAY,CAAC,MAAM,EAAE;QAChC,MAAM,EAAE,MAAM,CAAC;QACf,wBAAwB,EAAE,MAAM,CAAC;QACjC,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;QAChC,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAKF;;;OAGG;IACU,wBAAwB,CAAC,OAAO,EAAE;QAC7C,MAAM,EAAE,iBAAiB,EAAE,CAAC;QAC5B,gBAAgB,EAAE,MAAM,CAAC;QACzB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,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IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQ/E;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAKrF;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAKrF;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAKlF;;;;;OAKG;IAEG,kBAAkB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAIjG"}
|
package/dist/modules/widget.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { PublicPaymentSessionRequest, PublicPaymentSessionResponse, PublicPaymentStatusResponse } from '../types/public';
|
|
2
|
+
import { GenerateOTPRequest, GenerateOTPResponse, DynamicEnvResponse, CreateCashPaymentOrderRequest, CreateCashPaymentOrderResponse, PublicPaymentSessionRequest, PublicPaymentSessionResponse, PublicPaymentStatusResponse, VerifyOTPRequest, VerifyOTPResponse, GeneratePaymentQuoteRequest, GeneratePaymentQuoteResponse, GetProductsResponse } from '../types/public';
|
|
3
3
|
export declare class WidgetModule {
|
|
4
4
|
private client;
|
|
5
|
-
|
|
6
|
-
constructor(client: AxiosInstance, publishableKey: string);
|
|
5
|
+
constructor(client: AxiosInstance);
|
|
7
6
|
/**
|
|
8
7
|
* Creates a payment session (public, CORS-open) for Checkout Widget
|
|
9
8
|
*/
|
|
10
|
-
createPaymentSession(input:
|
|
9
|
+
createPaymentSession(input: PublicPaymentSessionRequest): Promise<PublicPaymentSessionResponse>;
|
|
10
|
+
generateOTP(input: GenerateOTPRequest): Promise<GenerateOTPResponse>;
|
|
11
|
+
verifyOTP(input: VerifyOTPRequest): Promise<VerifyOTPResponse>;
|
|
12
|
+
generatePaymentQuote(input: GeneratePaymentQuoteRequest): Promise<GeneratePaymentQuoteResponse>;
|
|
13
|
+
createCashPaymentOrder(input: CreateCashPaymentOrderRequest): Promise<CreateCashPaymentOrderResponse>;
|
|
11
14
|
/**
|
|
12
15
|
* Retrieves payment status for a reference key
|
|
13
16
|
*/
|
|
@@ -27,5 +30,7 @@ export declare class WidgetModule {
|
|
|
27
30
|
paid: boolean;
|
|
28
31
|
last?: PublicPaymentStatusResponse;
|
|
29
32
|
}>;
|
|
33
|
+
getDynamicEnv(): Promise<DynamicEnvResponse>;
|
|
34
|
+
getProducts(): Promise<GetProductsResponse>;
|
|
30
35
|
}
|
|
31
36
|
//# sourceMappingURL=widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../src/modules/widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,iBAAiB,CAAC;AAEzB,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAgB;
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../src/modules/widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,gBAAgB,EAChB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAgB;gBAElB,MAAM,EAAE,aAAa;IAIjC;;OAEG;IACG,oBAAoB,CACxB,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,4BAA4B,CAAC;IAalC,WAAW,CAAC,KAAK,EAAE,kBAAkB;IAOrC,SAAS,CAAC,KAAK,EAAE,gBAAgB;IAOjC,oBAAoB,CAAC,KAAK,EAAE,2BAA2B;IAUvD,sBAAsB,CAAC,KAAK,EAAE,6BAA6B;IAUjE;;OAEG;IACG,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAOlF;;;OAGG;IACG,WAAW,CAAC,OAAO,EAAE;QACzB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,2BAA2B,KAAK,IAAI,CAAC;QACzD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;KACpC,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,2BAA2B,CAAA;KAAE,CAAC;IAmC5D,aAAa;IAKb,WAAW;CAIlB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alchemy Pay payment method codes
|
|
3
|
+
* The payment methods below support USD.
|
|
4
|
+
* Reference: https://alchemypay.notion.site/Payment-Methods-Coverages-Other-Details-Table-fb3b4f5c68c04b9b8619c48aad31277d
|
|
5
|
+
*/
|
|
6
|
+
export declare enum PayWayCode {
|
|
7
|
+
VISA_MASTER_CARD = "10001",// Visa, MasterCard
|
|
8
|
+
APPLE_PAY = "501",
|
|
9
|
+
GOOGLE_PAY = "701",
|
|
10
|
+
NETELLER = "52004",
|
|
11
|
+
SKRILL = "52005"
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=cash-payment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cash-payment.d.ts","sourceRoot":"","sources":["../../src/types/cash-payment.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,UAAU;IACpB,gBAAgB,UAAU,CAAE,mBAAmB;IAC/C,SAAS,QAAQ;IACjB,UAAU,QAAQ;IAClB,QAAQ,UAAU;IAClB,MAAM,UAAU;CACjB"}
|
package/dist/types/payment.d.ts
CHANGED
|
@@ -292,4 +292,27 @@ export interface StopStreamingResponse {
|
|
|
292
292
|
*/
|
|
293
293
|
referenceKeys: string[];
|
|
294
294
|
}
|
|
295
|
+
export declare enum PayoutStatus {
|
|
296
|
+
PENDING = "PENDING",
|
|
297
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
298
|
+
COMPLETED = "COMPLETED",
|
|
299
|
+
FAILED = "FAILED",
|
|
300
|
+
CANCELED = "CANCELED"
|
|
301
|
+
}
|
|
302
|
+
export interface CheckPaymentStatusPayload {
|
|
303
|
+
/** The payment reference key to check */
|
|
304
|
+
referenceKey: string;
|
|
305
|
+
}
|
|
306
|
+
export interface CheckPaymentStatusResponse {
|
|
307
|
+
/** The current status of the payment (PENDING, IN_PROGRESS, COMPLETED, FAILED, CANCELED) */
|
|
308
|
+
status: PayoutStatus | 'NOT_FOUND';
|
|
309
|
+
/** The payout amount (if applicable) */
|
|
310
|
+
amount?: string;
|
|
311
|
+
/** The blockchain chain (if applicable) */
|
|
312
|
+
chain?: string;
|
|
313
|
+
/** The token type (if applicable) */
|
|
314
|
+
token?: string;
|
|
315
|
+
/** The destination wallet address (if applicable) */
|
|
316
|
+
destinationWalletAddress?: string;
|
|
317
|
+
}
|
|
295
318
|
//# sourceMappingURL=payment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../src/types/payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAA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AAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC"}
|
package/dist/types/public.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BeepPurchaseAsset } from './payment';
|
|
2
2
|
import { SupportedToken } from './token';
|
|
3
3
|
import { InvoiceStatus } from './invoice';
|
|
4
|
+
import { PayWayCode } from './cash-payment';
|
|
4
5
|
/**
|
|
5
6
|
* On-the-fly item sent from the browser. The server will create a corresponding product record
|
|
6
7
|
* during the payment-session so it is persisted for audit/reuse. Safe to send from clients.
|
|
@@ -14,11 +15,56 @@ export interface EphemeralItem {
|
|
|
14
15
|
}
|
|
15
16
|
export type PublicAssetInput = BeepPurchaseAsset | EphemeralItem;
|
|
16
17
|
export interface PublicPaymentSessionRequest {
|
|
17
|
-
publishableKey: string;
|
|
18
18
|
assets: PublicAssetInput[];
|
|
19
19
|
paymentLabel?: string;
|
|
20
20
|
generateQrCode?: boolean;
|
|
21
21
|
}
|
|
22
|
+
export interface GeneratePaymentQuoteRequest {
|
|
23
|
+
amount: string;
|
|
24
|
+
walletAddress: string;
|
|
25
|
+
payWayCode?: PayWayCode;
|
|
26
|
+
}
|
|
27
|
+
interface PaymentLimit {
|
|
28
|
+
/** Country code (e.g., 'US') */
|
|
29
|
+
country: string;
|
|
30
|
+
/** Payment method code */
|
|
31
|
+
payWayCode: PayWayCode;
|
|
32
|
+
/** Minimum purchase amount in fiat currency */
|
|
33
|
+
minPurchaseAmount: string;
|
|
34
|
+
/** Maximum purchase amount in fiat currency */
|
|
35
|
+
maxPurchaseAmount: string;
|
|
36
|
+
}
|
|
37
|
+
export interface GeneratePaymentQuoteResponse {
|
|
38
|
+
fiatAmount: string;
|
|
39
|
+
networkFee: string;
|
|
40
|
+
rampFee: string;
|
|
41
|
+
supportedPaymentMethods: PaymentLimit[];
|
|
42
|
+
}
|
|
43
|
+
export interface CreateCashPaymentOrderRequest {
|
|
44
|
+
reference: string;
|
|
45
|
+
walletAddress: string;
|
|
46
|
+
amount: string;
|
|
47
|
+
payWayCode: PayWayCode;
|
|
48
|
+
email: string;
|
|
49
|
+
}
|
|
50
|
+
export interface CreateCashPaymentOrderResponse {
|
|
51
|
+
payUrl: string;
|
|
52
|
+
}
|
|
53
|
+
export interface VerifyOTPRequest {
|
|
54
|
+
email: string;
|
|
55
|
+
otp: string;
|
|
56
|
+
}
|
|
57
|
+
export interface VerifyOTPResponse {
|
|
58
|
+
success: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface GenerateOTPRequest {
|
|
61
|
+
email: string;
|
|
62
|
+
tosAccepted: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface GenerateOTPResponse {
|
|
65
|
+
verificationCode?: string;
|
|
66
|
+
newCodeGenerated: boolean;
|
|
67
|
+
}
|
|
22
68
|
export interface PublicPaymentSessionResponse {
|
|
23
69
|
referenceKey: string;
|
|
24
70
|
paymentUrl: string;
|
|
@@ -26,9 +72,57 @@ export interface PublicPaymentSessionResponse {
|
|
|
26
72
|
amount: string;
|
|
27
73
|
expiresAt: string | Date;
|
|
28
74
|
status: InvoiceStatus | string;
|
|
75
|
+
isCashPaymentEligible: boolean;
|
|
76
|
+
destinationAddress: string;
|
|
29
77
|
}
|
|
30
78
|
export interface PublicPaymentStatusResponse {
|
|
31
79
|
paid: boolean;
|
|
32
80
|
status?: InvoiceStatus | string;
|
|
33
81
|
}
|
|
82
|
+
export interface DynamicEnvResponse {
|
|
83
|
+
environmentId: string;
|
|
84
|
+
}
|
|
85
|
+
export interface ProductWithPrices {
|
|
86
|
+
/** External UUID for API references */
|
|
87
|
+
uuid: string;
|
|
88
|
+
/** UUID of the merchant who owns this product */
|
|
89
|
+
merchantId: string;
|
|
90
|
+
/** Display name for the product */
|
|
91
|
+
name: string;
|
|
92
|
+
/** Optional detailed description of the product */
|
|
93
|
+
description: string | null;
|
|
94
|
+
/** Whether product is available for purchase */
|
|
95
|
+
active: boolean;
|
|
96
|
+
/** Array of image URLs for product display */
|
|
97
|
+
images: string[];
|
|
98
|
+
/** Flexible key-value data for additional product information */
|
|
99
|
+
metadata: Record<string, any>;
|
|
100
|
+
/** Associated price information (most recent active price) */
|
|
101
|
+
prices: Array<{
|
|
102
|
+
/** External UUID for API references */
|
|
103
|
+
uuid: string;
|
|
104
|
+
/** The currency token (USDT, USDC, etc.) */
|
|
105
|
+
token: string;
|
|
106
|
+
/** Blockchain network (SOLANA, BASE, SUI) */
|
|
107
|
+
chain: string;
|
|
108
|
+
/** Base amount in smallest units. */
|
|
109
|
+
amount: string;
|
|
110
|
+
/** Type/description of billing unit */
|
|
111
|
+
unitType: string;
|
|
112
|
+
/** Unit amount for incremental billing */
|
|
113
|
+
unitAmount: string;
|
|
114
|
+
/** Size of each billing unit */
|
|
115
|
+
unitSize: number;
|
|
116
|
+
/** Whether this price is available for new purchases */
|
|
117
|
+
active: boolean;
|
|
118
|
+
}>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Response structure for the public products endpoint.
|
|
122
|
+
*/
|
|
123
|
+
export interface GetProductsResponse {
|
|
124
|
+
/** Array of products with their associated prices */
|
|
125
|
+
products: Array<ProductWithPrices>;
|
|
126
|
+
}
|
|
127
|
+
export {};
|
|
34
128
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/types/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/types/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AA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jE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,8DAA8D;IAC9D,MAAM,EAAE,KAAK,CAAC;QACZ,uCAAuC;QACvC,IAAI,EAAE,MAAM,CAAC;QACb,4CAA4C;QAC5C,KAAK,EAAE,MAAM,CAAC;QACd,6CAA6C;QAC7C,KAAK,EAAE,MAAM,CAAC;QACd,qCAAqC;QACrC,MAAM,EAAE,MAAM,CAAC;QACf,uCAAuC;QACvC,QAAQ,EAAE,MAAM,CAAC;QACjB,0CAA0C;QAC1C,UAAU,EAAE,MAAM,CAAC;QACnB,gCAAgC;QAChC,QAAQ,EAAE,MAAM,CAAC;QACjB,wDAAwD;QACxD,MAAM,EAAE,OAAO,CAAC;KACjB,CAAC,CAAC;CACJ;AACD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;CACpC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beep-it/sdk-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Official TypeScript SDK for the BEEP Payment and Invoice Server",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -11,17 +11,6 @@
|
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=20"
|
|
13
13
|
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsc --project tsconfig.build.json --emitDeclarationOnly && tsup src/index.ts --format cjs,esm --no-dts",
|
|
16
|
-
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
17
|
-
"lint": "eslint . --ext .ts",
|
|
18
|
-
"test": "jest",
|
|
19
|
-
"test:watch": "jest --watch",
|
|
20
|
-
"test:coverage": "jest --coverage",
|
|
21
|
-
"prepare": "husky",
|
|
22
|
-
"prepublishOnly": "npm run lint && npm test && npm run build",
|
|
23
|
-
"pack": "npm pack --pack-destination ../cli/templates"
|
|
24
|
-
},
|
|
25
14
|
"lint-staged": {
|
|
26
15
|
"*.{js,ts}": [
|
|
27
16
|
"eslint --fix"
|
|
@@ -65,5 +54,14 @@
|
|
|
65
54
|
},
|
|
66
55
|
"dependencies": {
|
|
67
56
|
"axios": "^1.7.2"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsc --project tsconfig.build.json --emitDeclarationOnly && tsup src/index.ts --format cjs,esm --no-dts",
|
|
60
|
+
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
61
|
+
"lint": "eslint . --ext .ts",
|
|
62
|
+
"test": "jest",
|
|
63
|
+
"test:watch": "jest --watch",
|
|
64
|
+
"test:coverage": "jest --coverage",
|
|
65
|
+
"pack": "npm pack --pack-destination ../cli/templates"
|
|
68
66
|
}
|
|
69
|
-
}
|
|
67
|
+
}
|