-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1864 from stakwork/feat/integrate_v2_payments
PR: v2 bounty payouts
- Loading branch information
Showing
21 changed files
with
2,935 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package db | ||
|
||
const ( | ||
InvoicePaid = "paid" | ||
InvoiceExpired = "expired" | ||
InvoicePending = "pending" | ||
) | ||
|
||
const ( | ||
PaymentComplete = "COMPLETE" | ||
PaymentFailed = "FAILED" | ||
PaymentPending = "PENDING" | ||
) | ||
|
||
type V2InvoiceResponse struct { | ||
Status string `json:"status"` | ||
Timestamp string `json:"timestamp"` | ||
AmtMsat string `json:"amt_msat"` | ||
} | ||
|
||
type V2InvoiceBody struct { | ||
PaymentHash string `json:"payment_hash"` | ||
Bolt11 string `json:"bolt11"` | ||
} | ||
|
||
type V2SendOnionRes struct { | ||
Status string `json:"status"` // "COMPLETE", "PENDING", or "FAILED" | ||
Tag string `json:"tag"` | ||
Preimage string `json:"preimage"` | ||
PaymentHash string `json:"payment_hash"` | ||
} | ||
|
||
type V2PayInvoiceBody struct { | ||
Bolt11 string `json:"bolt11"` | ||
} | ||
|
||
type V2CreateInvoiceBody struct { | ||
AmtMsat uint `json:"amt_msat"` | ||
} | ||
|
||
type V2CreateInvoiceResponse struct { | ||
Bolt11 string `json:"bolt11"` | ||
PaymentHash string `json:"payment_hash"` | ||
} | ||
|
||
type V2PayInvoiceResponse struct { | ||
Tag string `json:"tag"` | ||
Msat string `json:"msat"` | ||
Timestamp string `json:"timestamp"` | ||
PaymentHash string `json:"payment_hash"` | ||
} | ||
|
||
type V2TagRes struct { | ||
Tag string `json:"tag"` | ||
Ts uint64 `json:"ts"` | ||
Status string `json:"status"` // "COMPLETE", "PENDING", or "FAILED" | ||
Error string `json:"error"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.