@settlr/sdk 0.6.3 → 0.6.5
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.js +11 -5
- package/dist/index.mjs +11 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -616,6 +616,13 @@ function SettlrProvider({
|
|
|
616
616
|
}, [config]);
|
|
617
617
|
(0, import_react.useEffect)(() => {
|
|
618
618
|
let cancelled = false;
|
|
619
|
+
if (config.merchant.walletAddress) {
|
|
620
|
+
console.log(
|
|
621
|
+
"[Settlr] Wallet address provided in config, skipping API validation"
|
|
622
|
+
);
|
|
623
|
+
setReady(true);
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
619
626
|
settlr.validateApiKey().then(() => {
|
|
620
627
|
if (!cancelled) {
|
|
621
628
|
setReady(true);
|
|
@@ -633,7 +640,7 @@ function SettlrProvider({
|
|
|
633
640
|
return () => {
|
|
634
641
|
cancelled = true;
|
|
635
642
|
};
|
|
636
|
-
}, [settlr, config.apiKey]);
|
|
643
|
+
}, [settlr, config.apiKey, config.merchant.walletAddress]);
|
|
637
644
|
const value = (0, import_react.useMemo)(
|
|
638
645
|
() => ({
|
|
639
646
|
settlr,
|
|
@@ -739,11 +746,10 @@ function BuyButton({
|
|
|
739
746
|
const handleClick = (0, import_react2.useCallback)(async () => {
|
|
740
747
|
if (disabled || loading) return;
|
|
741
748
|
if (!ready) {
|
|
742
|
-
const
|
|
743
|
-
|
|
744
|
-
);
|
|
749
|
+
const errorMsg = sdkError?.message || "Settlr SDK not ready. Please check your API key configuration.";
|
|
750
|
+
console.error("[Settlr BuyButton]", errorMsg);
|
|
751
|
+
const notReadyError = new Error(errorMsg);
|
|
745
752
|
onError?.(notReadyError);
|
|
746
|
-
return;
|
|
747
753
|
}
|
|
748
754
|
setLoading(true);
|
|
749
755
|
setStatus("processing");
|
package/dist/index.mjs
CHANGED
|
@@ -558,6 +558,13 @@ function SettlrProvider({
|
|
|
558
558
|
}, [config]);
|
|
559
559
|
useEffect(() => {
|
|
560
560
|
let cancelled = false;
|
|
561
|
+
if (config.merchant.walletAddress) {
|
|
562
|
+
console.log(
|
|
563
|
+
"[Settlr] Wallet address provided in config, skipping API validation"
|
|
564
|
+
);
|
|
565
|
+
setReady(true);
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
561
568
|
settlr.validateApiKey().then(() => {
|
|
562
569
|
if (!cancelled) {
|
|
563
570
|
setReady(true);
|
|
@@ -575,7 +582,7 @@ function SettlrProvider({
|
|
|
575
582
|
return () => {
|
|
576
583
|
cancelled = true;
|
|
577
584
|
};
|
|
578
|
-
}, [settlr, config.apiKey]);
|
|
585
|
+
}, [settlr, config.apiKey, config.merchant.walletAddress]);
|
|
579
586
|
const value = useMemo(
|
|
580
587
|
() => ({
|
|
581
588
|
settlr,
|
|
@@ -685,11 +692,10 @@ function BuyButton({
|
|
|
685
692
|
const handleClick = useCallback(async () => {
|
|
686
693
|
if (disabled || loading) return;
|
|
687
694
|
if (!ready) {
|
|
688
|
-
const
|
|
689
|
-
|
|
690
|
-
);
|
|
695
|
+
const errorMsg = sdkError?.message || "Settlr SDK not ready. Please check your API key configuration.";
|
|
696
|
+
console.error("[Settlr BuyButton]", errorMsg);
|
|
697
|
+
const notReadyError = new Error(errorMsg);
|
|
691
698
|
onError?.(notReadyError);
|
|
692
|
-
return;
|
|
693
699
|
}
|
|
694
700
|
setLoading(true);
|
|
695
701
|
setStatus("processing");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@settlr/sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Settlr SDK - Accept Solana USDC payments with privacy. Email checkout, gasless transactions, FHE-encrypted receipts. Private on-chain, compliant off-chain.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|