@getalby/bitcoin-connect-react
Advanced tools
Comparing version 3.0.0-beta.3 to 3.0.0-beta.4
@@ -1,2 +0,2 @@ | ||
import n from"react";import{onConnected as e,onConnecting as t,onDisconnected as o,onModalOpened as c,onModalClosed as r}from"@getalby/bitcoin-connect";export{closeModal,disconnect,init,isConnected,launchModal,onConnected,onConnecting,onDisconnected,onModalClosed,onModalOpened,requestProvider}from"@getalby/bitcoin-connect";function i(i){n.useEffect(()=>{if(i.onConnected){const n=e(i.onConnected);return()=>{n()}}return()=>{}},[]),n.useEffect(()=>{if(i.onConnecting){const n=t(i.onConnecting);return()=>{n()}}return()=>{}},[]),n.useEffect(()=>{if(i.onDisconnected){const n=o(i.onDisconnected);return()=>{n()}}return()=>{}},[]),n.useEffect(()=>{if(i.onModalOpened){const n=c(i.onModalOpened);return()=>{n()}}return()=>{}},[]),n.useEffect(()=>{if(i.onModalClosed){const n=r(i.onModalClosed);return()=>{n()}}return()=>{}},[])}const a=e=>(i(e),/*#__PURE__*/n.createElement("bc-button",null)),s=e=>(i(e),/*#__PURE__*/n.createElement("bc-connect-flow",null));function d(){return d=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},d.apply(this,arguments)}const l=e=>{i(e);const[t,o]=n.useState();return n.useEffect(()=>{const{onPaid:n,checkPayment:t}=e,c=e=>{null==n||n(e.detail)};window.addEventListener("bc:onpaid",c);const r=setInterval(async()=>{const n=await(null==t?void 0:t());n&&(clearInterval(r),o(!0),window.dispatchEvent(new CustomEvent("bc:onpaid",{detail:n})))},1e3);return()=>{window.removeEventListener("bc:onpaid",c),clearInterval(r)}},[]),/*#__PURE__*/n.createElement("bc-send-payment-flow",d({invoice:e.invoice},t?{paid:t}:{}))};export{a as Button,s as Connect,l as SendPayment}; | ||
import n from"react";import{onConnected as e,onConnecting as t,onDisconnected as o,onModalOpened as c,onModalClosed as r}from"@getalby/bitcoin-connect";export{closeModal,disconnect,init,isConnected,launchModal,onConnected,onConnecting,onDisconnected,onModalClosed,onModalOpened,requestProvider}from"@getalby/bitcoin-connect";function i(i){n.useEffect(()=>{if(i.onConnected){const n=e(i.onConnected);return()=>{n()}}return()=>{}},[]),n.useEffect(()=>{if(i.onConnecting){const n=t(i.onConnecting);return()=>{n()}}return()=>{}},[]),n.useEffect(()=>{if(i.onDisconnected){const n=o(i.onDisconnected);return()=>{n()}}return()=>{}},[]),n.useEffect(()=>{if(i.onModalOpened){const n=c(i.onModalOpened);return()=>{n()}}return()=>{}},[]),n.useEffect(()=>{if(i.onModalClosed){const n=r(i.onModalClosed);return()=>{n()}}return()=>{}},[])}const a=e=>(i(e),/*#__PURE__*/n.createElement("bc-button",null)),s=e=>(i(e),/*#__PURE__*/n.createElement("bc-connect-flow",null));function d(){return d=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},d.apply(this,arguments)}const l=e=>{i(e);const[t,o]=n.useState(),{onPaid:c,checkPayment:r}=e;return n.useEffect(()=>{const n=n=>{null==c||c(n.detail)};window.addEventListener("bc:onpaid",n);const e=setInterval(async()=>{const n=await(null==r?void 0:r());n&&(clearInterval(e),o(!0),window.dispatchEvent(new CustomEvent("bc:onpaid",{detail:n})))},1e3);return()=>{window.removeEventListener("bc:onpaid",n),clearInterval(e)}},[c,r]),/*#__PURE__*/n.createElement("bc-send-payment-flow",d({invoice:e.invoice},t?{paid:t}:{}))};export{a as Button,s as Connect,l as SendPayment}; | ||
//# sourceMappingURL=index.modern.js.map |
@@ -1,2 +0,2 @@ | ||
import n from"react";import{onConnected as e,onConnecting as t,onDisconnected as o,onModalOpened as c,onModalClosed as r}from"@getalby/bitcoin-connect";export{closeModal,disconnect,init,isConnected,launchModal,onConnected,onConnecting,onDisconnected,onModalClosed,onModalOpened,requestProvider}from"@getalby/bitcoin-connect";function i(i){n.useEffect(function(){if(i.onConnected){var n=e(i.onConnected);return function(){n()}}return function(){}},[]),n.useEffect(function(){if(i.onConnecting){var n=t(i.onConnecting);return function(){n()}}return function(){}},[]),n.useEffect(function(){if(i.onDisconnected){var n=o(i.onDisconnected);return function(){n()}}return function(){}},[]),n.useEffect(function(){if(i.onModalOpened){var n=c(i.onModalOpened);return function(){n()}}return function(){}},[]),n.useEffect(function(){if(i.onModalClosed){var n=r(i.onModalClosed);return function(){n()}}return function(){}},[])}var u=function(e){return i(e),/*#__PURE__*/n.createElement("bc-button",null)},a=function(e){return i(e),/*#__PURE__*/n.createElement("bc-connect-flow",null)};function f(){return f=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},f.apply(this,arguments)}var l=function(e){i(e);var t=n.useState(),o=t[0],c=t[1];return n.useEffect(function(){var n=e.onPaid,t=e.checkPayment,o=function(e){null==n||n(e.detail)};window.addEventListener("bc:onpaid",o);var r=setInterval(function(){return Promise.resolve(null==t?void 0:t()).then(function(n){n&&(clearInterval(r),c(!0),window.dispatchEvent(new CustomEvent("bc:onpaid",{detail:n})))})},1e3);return function(){window.removeEventListener("bc:onpaid",o),clearInterval(r)}},[]),/*#__PURE__*/n.createElement("bc-send-payment-flow",f({invoice:e.invoice},o?{paid:o}:{}))};export{u as Button,a as Connect,l as SendPayment}; | ||
import n from"react";import{onConnected as e,onConnecting as t,onDisconnected as o,onModalOpened as c,onModalClosed as r}from"@getalby/bitcoin-connect";export{closeModal,disconnect,init,isConnected,launchModal,onConnected,onConnecting,onDisconnected,onModalClosed,onModalOpened,requestProvider}from"@getalby/bitcoin-connect";function i(i){n.useEffect(function(){if(i.onConnected){var n=e(i.onConnected);return function(){n()}}return function(){}},[]),n.useEffect(function(){if(i.onConnecting){var n=t(i.onConnecting);return function(){n()}}return function(){}},[]),n.useEffect(function(){if(i.onDisconnected){var n=o(i.onDisconnected);return function(){n()}}return function(){}},[]),n.useEffect(function(){if(i.onModalOpened){var n=c(i.onModalOpened);return function(){n()}}return function(){}},[]),n.useEffect(function(){if(i.onModalClosed){var n=r(i.onModalClosed);return function(){n()}}return function(){}},[])}var u=function(e){return i(e),/*#__PURE__*/n.createElement("bc-button",null)},a=function(e){return i(e),/*#__PURE__*/n.createElement("bc-connect-flow",null)};function f(){return f=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},f.apply(this,arguments)}var l=function(e){i(e);var t=n.useState(),o=t[0],c=t[1],r=e.onPaid,u=e.checkPayment;return n.useEffect(function(){var n=function(n){null==r||r(n.detail)};window.addEventListener("bc:onpaid",n);var e=setInterval(function(){return Promise.resolve(null==u?void 0:u()).then(function(n){n&&(clearInterval(e),c(!0),window.dispatchEvent(new CustomEvent("bc:onpaid",{detail:n})))})},1e3);return function(){window.removeEventListener("bc:onpaid",n),clearInterval(e)}},[r,u]),/*#__PURE__*/n.createElement("bc-send-payment-flow",f({invoice:e.invoice},o?{paid:o}:{}))};export{u as Button,a as Connect,l as SendPayment}; | ||
//# sourceMappingURL=index.module.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("@getalby/bitcoin-connect")):"function"==typeof define&&define.amd?define(["exports","react","@getalby/bitcoin-connect"],n):n((e||self).bitcoinConnectReact={},e.React,e.bitcoinConnect)}(this,function(e,n,t){function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=/*#__PURE__*/o(n);function c(e){r.default.useEffect(function(){if(e.onConnected){var n=t.onConnected(e.onConnected);return function(){n()}}return function(){}},[]),r.default.useEffect(function(){if(e.onConnecting){var n=t.onConnecting(e.onConnecting);return function(){n()}}return function(){}},[]),r.default.useEffect(function(){if(e.onDisconnected){var n=t.onDisconnected(e.onDisconnected);return function(){n()}}return function(){}},[]),r.default.useEffect(function(){if(e.onModalOpened){var n=t.onModalOpened(e.onModalOpened);return function(){n()}}return function(){}},[]),r.default.useEffect(function(){if(e.onModalClosed){var n=t.onModalClosed(e.onModalClosed);return function(){n()}}return function(){}},[])}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},i.apply(this,arguments)}Object.defineProperty(e,"closeModal",{enumerable:!0,get:function(){return t.closeModal}}),Object.defineProperty(e,"disconnect",{enumerable:!0,get:function(){return t.disconnect}}),Object.defineProperty(e,"init",{enumerable:!0,get:function(){return t.init}}),Object.defineProperty(e,"isConnected",{enumerable:!0,get:function(){return t.isConnected}}),Object.defineProperty(e,"launchModal",{enumerable:!0,get:function(){return t.launchModal}}),Object.defineProperty(e,"onConnected",{enumerable:!0,get:function(){return t.onConnected}}),Object.defineProperty(e,"onConnecting",{enumerable:!0,get:function(){return t.onConnecting}}),Object.defineProperty(e,"onDisconnected",{enumerable:!0,get:function(){return t.onDisconnected}}),Object.defineProperty(e,"onModalClosed",{enumerable:!0,get:function(){return t.onModalClosed}}),Object.defineProperty(e,"onModalOpened",{enumerable:!0,get:function(){return t.onModalOpened}}),Object.defineProperty(e,"requestProvider",{enumerable:!0,get:function(){return t.requestProvider}}),e.Button=function(e){return c(e),/*#__PURE__*/r.default.createElement("bc-button",null)},e.Connect=function(e){return c(e),/*#__PURE__*/r.default.createElement("bc-connect-flow",null)},e.SendPayment=function(e){c(e);var n=r.default.useState(),t=n[0],o=n[1];return r.default.useEffect(function(){var n=e.onPaid,t=e.checkPayment,r=function(e){null==n||n(e.detail)};window.addEventListener("bc:onpaid",r);var c=setInterval(function(){return Promise.resolve(null==t?void 0:t()).then(function(e){e&&(clearInterval(c),o(!0),window.dispatchEvent(new CustomEvent("bc:onpaid",{detail:e})))})},1e3);return function(){window.removeEventListener("bc:onpaid",r),clearInterval(c)}},[]),/*#__PURE__*/r.default.createElement("bc-send-payment-flow",i({invoice:e.invoice},t?{paid:t}:{}))}}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("@getalby/bitcoin-connect")):"function"==typeof define&&define.amd?define(["exports","react","@getalby/bitcoin-connect"],n):n((e||self).bitcoinConnectReact={},e.React,e.bitcoinConnect)}(this,function(e,n,t){function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=/*#__PURE__*/o(n);function c(e){r.default.useEffect(function(){if(e.onConnected){var n=t.onConnected(e.onConnected);return function(){n()}}return function(){}},[]),r.default.useEffect(function(){if(e.onConnecting){var n=t.onConnecting(e.onConnecting);return function(){n()}}return function(){}},[]),r.default.useEffect(function(){if(e.onDisconnected){var n=t.onDisconnected(e.onDisconnected);return function(){n()}}return function(){}},[]),r.default.useEffect(function(){if(e.onModalOpened){var n=t.onModalOpened(e.onModalOpened);return function(){n()}}return function(){}},[]),r.default.useEffect(function(){if(e.onModalClosed){var n=t.onModalClosed(e.onModalClosed);return function(){n()}}return function(){}},[])}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},i.apply(this,arguments)}Object.defineProperty(e,"closeModal",{enumerable:!0,get:function(){return t.closeModal}}),Object.defineProperty(e,"disconnect",{enumerable:!0,get:function(){return t.disconnect}}),Object.defineProperty(e,"init",{enumerable:!0,get:function(){return t.init}}),Object.defineProperty(e,"isConnected",{enumerable:!0,get:function(){return t.isConnected}}),Object.defineProperty(e,"launchModal",{enumerable:!0,get:function(){return t.launchModal}}),Object.defineProperty(e,"onConnected",{enumerable:!0,get:function(){return t.onConnected}}),Object.defineProperty(e,"onConnecting",{enumerable:!0,get:function(){return t.onConnecting}}),Object.defineProperty(e,"onDisconnected",{enumerable:!0,get:function(){return t.onDisconnected}}),Object.defineProperty(e,"onModalClosed",{enumerable:!0,get:function(){return t.onModalClosed}}),Object.defineProperty(e,"onModalOpened",{enumerable:!0,get:function(){return t.onModalOpened}}),Object.defineProperty(e,"requestProvider",{enumerable:!0,get:function(){return t.requestProvider}}),e.Button=function(e){return c(e),/*#__PURE__*/r.default.createElement("bc-button",null)},e.Connect=function(e){return c(e),/*#__PURE__*/r.default.createElement("bc-connect-flow",null)},e.SendPayment=function(e){c(e);var n=r.default.useState(),t=n[0],o=n[1],u=e.onPaid,f=e.checkPayment;return r.default.useEffect(function(){var e=function(e){null==u||u(e.detail)};window.addEventListener("bc:onpaid",e);var n=setInterval(function(){return Promise.resolve(null==f?void 0:f()).then(function(e){e&&(clearInterval(n),o(!0),window.dispatchEvent(new CustomEvent("bc:onpaid",{detail:e})))})},1e3);return function(){window.removeEventListener("bc:onpaid",e),clearInterval(n)}},[u,f]),/*#__PURE__*/r.default.createElement("bc-send-payment-flow",i({invoice:e.invoice},t?{paid:t}:{}))}}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@getalby/bitcoin-connect-react", | ||
"version": "3.0.0-beta.3", | ||
"version": "3.0.0-beta.4", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "source": "src/index.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37299
96