getAlby / bitcoin-connect

Connecting lightning wallets to your webapp has never been easier. Enable WebLN in all browsers with a single button
https://bitcoin-connect.com
MIT License
79 stars 26 forks source link

Feat: add payment methods #214

Closed rolznz closed 2 months ago

rolznz commented 2 months ago

New PR based off of https://github.com/getAlby/bitcoin-connect/pull/213

Fixes https://github.com/getAlby/bitcoin-connect/issues/212

Try it by installing @getalby/bitcoin-connect@3.3.0-beta.1 or @getalby/bitcoin-connect-react@3.3.0-beta.3

socket-security[bot] commented 2 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/code-frame@7.22.5 None +3 99.7 kB nicolo-ribaudo
npm/@babel/generator@7.22.9 None +1 518 kB nicolo-ribaudo
npm/@babel/helper-compilation-targets@7.22.9 Transitive: environment, filesystem, unsafe +10 1.73 MB nicolo-ribaudo
npm/@babel/helper-create-class-features-plugin@7.22.9 Transitive: environment, filesystem, unsafe +14 1.94 MB nicolo-ribaudo
npm/@babel/parser@7.22.7 None 0 3.72 MB nicolo-ribaudo
npm/@babel/plugin-transform-optional-chaining@7.22.6 Transitive: environment, filesystem, unsafe +9 1.71 MB nicolo-ribaudo
npm/@babel/plugin-transform-regenerator@7.22.5 Transitive: environment, filesystem, unsafe +8 1.77 MB nicolo-ribaudo
npm/@babel/runtime@7.22.6 None +1 310 kB nicolo-ribaudo
npm/@babel/traverse@7.22.8 None +5 712 kB nicolo-ribaudo
npm/@babel/types@7.22.5 environment +2 2.47 MB nicolo-ribaudo
npm/@getalby/lightning-tools@5.0.3 network 0 134 kB reneaaron
npm/@jridgewell/trace-mapping@0.3.18 None +2 259 kB jridgewell
npm/@lit/reactive-element@2.0.2 None 0 833 kB lit-robot
npm/@open-wc/testing@3.2.2 Transitive: environment, eval, filesystem, network, unsafe +98 11.5 MB modern-web
npm/@twind/core@1.1.3 None +1 4.77 MB sastan
npm/@twind/preset-tailwind@1.1.4 None 0 2.08 MB sastan
npm/@twind/with-web-components@1.1.3 None 0 150 kB sastan
npm/@types/chai@4.3.5 None 0 77.2 kB types
npm/@types/istanbul-lib-coverage@2.0.4 None 0 5.76 kB types
npm/@types/koa@2.13.6 None +16 3.98 MB types
npm/@typescript-eslint/eslint-plugin@5.62.0 Transitive: environment, filesystem +16 6.17 MB jameshenry
npm/@typescript-eslint/parser@5.62.0 Transitive: environment, filesystem +4 1.4 MB jameshenry
npm/@web/dev-server-esbuild@0.4.4 filesystem Transitive: environment, eval, network, shell, unsafe +67 218 MB modern-web
npm/@web/parse5-utils@2.1.0 None +2 379 kB modern-web
npm/@web/test-runner-core@0.10.29 filesystem, network Transitive: environment, eval, unsafe +83 6.76 MB modern-web
npm/@web/test-runner-playwright@0.9.0 Transitive: environment, eval, filesystem, network, shell, unsafe +4 7.31 MB modern-web
npm/@web/test-runner@0.15.3 Transitive: environment, eval, filesystem, network, shell, unsafe +100 17.4 MB modern-web
npm/@webbtc/webln-types@2.1.0 None 0 11.4 kB rolznz
npm/@webcomponents/webcomponentsjs@2.8.0 None 0 3.56 MB bicknellr
npm/browserslist@4.21.9 environment, filesystem +2 332 kB ai
npm/buffer@5.7.1 None +2 98.9 kB feross
npm/caniuse-lite@1.0.30001517 None 0 2.06 MB caniuse-lite
npm/concurrently@8.2.2 environment, filesystem Transitive: shell +6 11.4 MB gustavohenke
npm/end-of-stream@1.4.4 None 0 6.23 kB mafintosh
npm/esbuild@0.18.20 environment, filesystem, network, shell +22 207 MB evanw
npm/eslint-visitor-keys@3.4.1 None 0 32.3 kB eslintbot
npm/eslint@8.56.0 environment, filesystem Transitive: eval, shell, unsafe +52 8.91 MB eslintbot
npm/extend-shallow@3.0.2 None +2 21.4 kB phated
npm/fast-glob@3.3.0 filesystem +1 154 kB mrmlnc
npm/get-value@2.0.6 None 0 3.71 kB jonschlinkert
npm/is-descriptor@1.0.2 None +2 27.2 kB jonschlinkert
npm/is-extendable@0.1.1 None 0 5.09 kB jonschlinkert
npm/is-plain-object@2.0.4 None 0 7.5 kB jonschlinkert
npm/isobject@3.0.1 None 0 6.93 kB doowb
npm/kind-of@6.0.3 None 0 22.8 kB doowb
npm/lit-analyzer@1.2.1 filesystem Transitive: environment, network +68 3.08 MB runebm
npm/lit-html@3.1.0 None 0 1.66 MB lit-robot
npm/lit@3.1.1 None 0 105 kB lit-robot
npm/prettier@2.8.8 environment, filesystem, unsafe 0 11.2 MB prettier-bot
npm/readable-stream@3.6.2 environment +1 138 kB matteo.collina
npm/regex-not@1.0.2 None +2 32.2 kB jonschlinkert
npm/resolve@1.22.2 environment, filesystem +4 206 kB ljharb
npm/set-value@2.0.1 None 0 10.3 kB doowb
npm/split-string@3.1.0 None 0 13.8 kB jonschlinkert

🚮 Removed packages: npm/@babel/code-frame@7.22.10, npm/@babel/helper-compilation-targets@7.22.10, npm/@babel/helper-create-class-features-plugin@7.22.11, npm/@babel/parser@7.22.11, npm/@babel/plugin-transform-optional-chaining@7.22.12, npm/@babel/plugin-transform-regenerator@7.22.10, npm/@babel/runtime@7.22.11, npm/@babel/types@7.22.11, npm/@eslint-community/regexpp@4.6.2, npm/@getalby/bitcoin-connect-react@3.2.2, npm/@getalby/lightning-tools@5.0.0, npm/@jridgewell/trace-mapping@0.3.19, npm/@types/koa@2.13.8, npm/@types/node@20.10.4, npm/@types/react-dom@18.2.17, npm/@types/react-dom@18.2.7, npm/@types/react@18.2.18, npm/@types/react@18.2.21, npm/@types/react@18.2.43, npm/@typescript-eslint/eslint-plugin@6.2.1, npm/@typescript-eslint/parser@6.2.1, npm/@vitejs/plugin-react-swc@3.3.2, npm/@webbtc/webln-types@1.0.13, npm/array-includes@3.1.7, npm/array.prototype.flat@1.3.2, npm/array.prototype.flatmap@1.3.2, npm/autoprefixer@10.4.16, npm/browserslist@4.21.10, npm/call-bind@1.0.5, npm/caniuse-lite@1.0.30001523, npm/eslint-plugin-react-hooks@4.6.0, npm/eslint-plugin-react-refresh@0.4.3, npm/eslint-visitor-keys@3.4.2, npm/eslint@8.46.0, npm/react-dom@18.2.0, npm/react-hot-toast@2.4.1, npm/react@18.2.0, npm/resolve@1.22.4, npm/terser@5.19.2, npm/tslib@2.6.2, npm/type-check@0.4.0, npm/which-typed-array@1.1.11, npm/yaml@1.10.2

View full report↗︎

socket-security[bot] commented 2 months ago

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Install scripts npm/playwright@1.36.0
  • Install script: install
  • Source: node install.js

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/playwright@1.36.0
rolznz commented 2 months ago

I realized it doesn't really make sense to pass it as a property? it might be better as a global bitcoin connect option... I don't know if there will be any app which requires this to be different in different situations.

rolznz commented 2 months ago

@positiveblue do my changes look ok to you? if so I'll merge it

positiveblue commented 2 months ago

@rolznz we tested it using the 3.3.0-beta.3 pkg and it went well, feel free to merge :rocket:

Thank you!