SatsAllDay 9c774d596b
Support JIT invoicing on donations to rewards pool (#515)
* Support JIT invoicing on donations to rewards pool

Now you can just-in-time fund your account to donate to SN's reward pool.

You can also donate without an account via the @anon account, also using
JIT invoices.

* Ensure donate amount is numeric

* Explicit error checking for hash being required for invoice validation

* let donation exceptions bubble for jit funding

---------

Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-09-24 14:38:37 -05:00

31 lines
491 B
JavaScript

import { gql } from 'graphql-tag'
export default gql`
extend type Query {
rewards(when: [String!]): [Rewards!]
meRewards(when: [String!]!): [MeRewards]
}
extend type Mutation {
donateToRewards(sats: Int!, hash: String, hmac: String): Int!
}
type Rewards {
total: Int!
time: Date!
sources: [NameValue!]!
}
type Reward {
type: String
rank: Int
sats: Int!
item: Item
}
type MeRewards {
total: Int!
rewards: [Reward!]
}
`