@omnisat/lasereyes 0.0.10 → 0.0.11

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 CHANGED
@@ -690,8 +690,24 @@ var LaserEyesProvider = ({
690
690
  if (!txId)
691
691
  throw new Error("Transaction failed");
692
692
  return txId;
693
- } else {
694
- throw new Error("The connected wallet doesn't support this method..");
693
+ } else if (provider === XVERSE) {
694
+ const response = yield (0, import_sats_connect.request)("sendTransfer", {
695
+ recipients: [
696
+ {
697
+ address: to,
698
+ amount: Number(amount)
699
+ }
700
+ ]
701
+ });
702
+ if (response.status === "success") {
703
+ return response.result.txid;
704
+ } else {
705
+ if (response.error.code === import_sats_connect.RpcErrorCode.USER_REJECTION) {
706
+ throw new Error("User rejected the request");
707
+ } else {
708
+ throw new Error("Error sending BTC: " + response.error.message);
709
+ }
710
+ }
695
711
  }
696
712
  } catch (error) {
697
713
  throw error;
package/dist/index.mjs CHANGED
@@ -627,8 +627,24 @@ var LaserEyesProvider = ({
627
627
  if (!txId)
628
628
  throw new Error("Transaction failed");
629
629
  return txId;
630
- } else {
631
- throw new Error("The connected wallet doesn't support this method..");
630
+ } else if (provider === XVERSE) {
631
+ const response = yield request("sendTransfer", {
632
+ recipients: [
633
+ {
634
+ address: to,
635
+ amount: Number(amount)
636
+ }
637
+ ]
638
+ });
639
+ if (response.status === "success") {
640
+ return response.result.txid;
641
+ } else {
642
+ if (response.error.code === RpcErrorCode.USER_REJECTION) {
643
+ throw new Error("User rejected the request");
644
+ } else {
645
+ throw new Error("Error sending BTC: " + response.error.message);
646
+ }
647
+ }
632
648
  }
633
649
  } catch (error) {
634
650
  throw error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnisat/lasereyes",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "sideEffects": false,
5
5
  "private": false,
6
6
  "license": "MIT",