Giter VIP home page Giter VIP logo

Comments (5)

openoms avatar openoms commented on August 11, 2024 2

Until the preimage is returned for intraledger also can offer a partial improvement to return it for ln settlements at least: #2953

from lightning-browser-extension.

openoms avatar openoms commented on August 11, 2024 1

The preImage could be returned for intraledger payments as well as the invoice is generated on the node (not knowing that it will be paid intraledger or over LN) and the paymentSecret is known. Will open an issue for discussion with the Galoy team.

eg.:

curl --request POST \
    --header 'content-type: application/json' \
    --header 'X-API-KEY: galoy_staging_xxxxxxxxxxxx' \
    --url 'https://api.staging.galoy.io/graphql' \
    --data '{"query":"mutation LnInvoiceCreate($input: LnInvoiceCreateInput!) {\n  lnInvoiceCreate(input: $input) {\n    invoice {\n      paymentHash\n      paymentRequest\n      createdAt\n      satoshis\n      paymentStatus\n      paymentSecret\n    }\n  }\n}","variables":{"input":{"amount":21,"walletId":"xxxxxxxxxx"}}}'
{
  "data": {
    "lnInvoiceCreate": {
      "invoice": {
        "paymentHash": "b1cf0faaf9fd7b15de77cf032d9ca7559612c8356c6b21a7c45402d65e9c4869",
        "paymentRequest": "lntbs210n1pjc9w42pp5k88sl2hel4a3thnheupjm8982ktp9jp4d34jrf7y2spdvh5ufp5sdqqcqzpuxqyz5vqsp5tr8c5ngy7s9ryvu9v3hx5tg26wfrx8kg42uhuqlleaavsc6qpp7s9qyyssq2tjznjeckf8j8mcpgezcyprat4yys3ac9fqf0g2uutkavt3qj5grqtha38lkxyvlncfwhfh88ssa895ur6a6a8h8390s6qm9tn34kdsqlwkhkj",
        "createdAt": 1703066283,
        "satoshis": 21,
        "paymentStatus": "PENDING",
        "paymentSecret": "58cf8a4d04f40a323385646e6a2d0ad392331ec8aab97e03ffcf7ac86340087d"
      }
    }
  }
}

from lightning-browser-extension.

openoms avatar openoms commented on August 11, 2024

Looking into this, can extend the graphql call. The API can return the preimage when paying through LN, but doesn't do for intraledger:

mutation LnInvoicePaymentSend($input: LnInvoicePaymentInput!) {
  lnInvoicePaymentSend(input: $input) {
    errors {
      message
    }
    status
    transaction {
      settlementVia {
        ... on SettlementViaLn {
          preImage
        }
        ... on SettlementViaIntraLedger {
          counterPartyUsername
          counterPartyWalletId
        }
      }
    }
  }
}

would it be useful to return the username or just a note about intraledger settlement?

Testing paying a new account without username set is not returning anything so it must be a note about intraledger payment:

{
  "data": {
    "lnInvoicePaymentSend": {
      "errors": [],
      "status": "SUCCESS",
      "transaction": {
        "settlementVia": {
          "counterPartyUsername": null,
          "counterPartyWalletId": null
        }
      }
    }
  }
}

Example response on signet LN:

{
  "data": {
    "lnInvoicePaymentSend": {
      "errors": [],
      "status": "SUCCESS",
      "transaction": {
        "settlementVia": {
          "preImage": "b88173fa2326356c4f0f3399cc0c7e2eb6c1c8b75369c45b708c77fdb4799e15"
        }
      }
    }
  }
}

from lightning-browser-extension.

reneaaron avatar reneaaron commented on August 11, 2024

If the Galoy connector doesn't reliably return preimages for WebLN it will break quite some apps that follow the current WebLN spec and possibly would force them to handle those special cases (for intraledger payments) which is clearly not how WebLN is intended to work.

Why is it that you can't provide a preimage for intraledger payments? Do they never hit the node but just the DB?

from lightning-browser-extension.

bumi avatar bumi commented on August 11, 2024

that would be great! \o/

from lightning-browser-extension.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.