How to use the bolt11.sign function in bolt11

To help you get started, we’ve selected a few bolt11 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LN-Zap / zap-desktop / stories / helpers.js View on Github external
},
      {
        tagName: 'expire_time',
        data: 30,
      },
      {
        tagName: 'description',
        data: memo,
      },
    ],
  }
  data[unit] = amount

  var encoded = lightningPayReq.encode(data)
  var privateKeyHex = 'e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734'
  var signed = lightningPayReq.sign(encoded, privateKeyHex)
  return signed.paymentRequest
}
github LN-Zap / zap-desktop / stories / containers / activity.stories.js View on Github external
{
          tagName: 'payment_hash',
          data: '0001020304050607080900010203040506070809000102030405060708090102',
        },
        {
          tagName: 'expire_time',
          data: 15,
        },
        {
          tagName: 'description',
          data: 'Some items',
        },
      ],
    })
    const privateKeyHex = 'e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734'
    const signed = lightningPayReq.sign(encoded, privateKeyHex)
    const invoice = {
      finalAmount: 15000,
      settled: boolean('Settled', false),
      creation_date: Math.round(new Date().getTime() / 1000),
      settle_date: Math.round(new Date().getTime() / 1000),
      payment_request: signed.paymentRequest,
      memo: signed.tags.find(t => t.tagName === 'description').data,
      tx_hash: '1ae44a23c141a2892c55eb3fe9de45195d88e89b36b5070e10df92d4130e4028',
    }
    return (
github LN-Zap / zap-desktop / stories / containers / request / request.component.stories.js View on Github external
{
        tagName: 'payment_hash',
        data: '0001020304050607080900010203040506070809000102030405060708090102',
      },
      {
        tagName: 'expire_time',
        data: 30,
      },
      {
        tagName: 'description',
        data: memo,
      },
    ],
  })
  const privateKeyHex = 'e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734'
  const signed = lightningPayReq.sign(encoded, privateKeyHex)
  return signed.paymentRequest
}

bolt11

A library for encoding and decoding lightning network payment requests as defined in [BOLT #11](https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md).

MIT
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Popular bolt11 functions