0.2.60 • Published 7 months ago

sphinx-bridge-kevkevinpal v0.2.60

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

sphinx-bridge

library for applications embedded within Sphinx apps

Load into your app

npm install --save sphinx-bridge

import * as sphinx from 'sphinx-bridge'

or

<script src="https://unpkg.com/sphinx-bridge@0.2.4/sphinx/sphinx.min.js"></script>

API

All functions return a Promise, that resolves when the action has been completed in the Sphinx App

  • sphinx.enable(): Enable the sphinx library. This function will postMessage to the Sphinx app, requesting authorization, a budget to spend, and the user's pubkey (hex encoded)
  • sphinx.keysend(pubkey, amount): Initiate a keysend (pubkey is hex encoded)
  • sphinx.sendPayment(paymentRequest): Pay a Lightning invoice
  • sphinx.makeInvoice(amount, memo): Create a Lightning invoice
  • sphinx.signMessage(message): Request that the Sphinx app signs a message with Lightning private key
  • sphinx.verifyMessage(signature, message): Verify a signed message
  • sphinx.topup(): Show the authorization modal again, so the user can top up their budget for the app
  • sphinx.authorize(challenge, noBudget): Request the Sphinx app to sign a challenge with their Lightning private key. "noBudget" boolean set to true will prevent the app from showing the budget input.
  • sphinx.updated(): Utility function to let Sphinx app know that something has happened out of band (like a payment has been received), so satoshi balance should be refreshed in app.
0.2.60

7 months ago

0.2.59

7 months ago

0.2.58

1 year ago

0.2.57

1 year ago

0.2.56

1 year ago

0.2.55

1 year ago

0.2.52

1 year ago

0.2.54

1 year ago

0.2.49

2 years ago

0.2.48

2 years ago

0.2.47

2 years ago

0.2.46

2 years ago

0.2.45

2 years ago

0.2.43

2 years ago

0.2.42

2 years ago

0.2.51

2 years ago

0.2.41

2 years ago

0.2.40

2 years ago

0.2.39

2 years ago

0.2.38

2 years ago

0.2.37

2 years ago

0.2.36

2 years ago

0.2.35

2 years ago

0.2.34

2 years ago

0.2.33

2 years ago

0.2.32

2 years ago

0.2.31

2 years ago

0.2.30

2 years ago

0.2.29

2 years ago

0.2.28

2 years ago

0.2.27

2 years ago

0.2.26

2 years ago

0.2.25

2 years ago

0.2.24

2 years ago

0.2.23

2 years ago

0.2.22

2 years ago

0.2.21

2 years ago

0.2.20

2 years ago

0.2.19

2 years ago

0.2.18

2 years ago

0.2.17

2 years ago

0.2.16

2 years ago

0.2.15

2 years ago

0.2.14

2 years ago

0.2.13

2 years ago

0.2.12

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.9

2 years ago