2021-05-26 07:55:01 +02:00
|
|
|
{
|
2021-11-04 15:15:51 +01:00
|
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"label",
|
|
|
|
"payment_hash",
|
|
|
|
"status",
|
|
|
|
"expires_at"
|
|
|
|
],
|
|
|
|
"additionalProperties": true,
|
|
|
|
"properties": {
|
|
|
|
"label": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "Unique label given at creation time"
|
2021-05-26 07:55:01 +02:00
|
|
|
},
|
2021-11-04 15:15:51 +01:00
|
|
|
"bolt11": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "BOLT11 string"
|
|
|
|
},
|
|
|
|
"bolt12": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "BOLT12 string"
|
|
|
|
},
|
|
|
|
"msatoshi": {
|
|
|
|
"deprecated": "true"
|
|
|
|
},
|
|
|
|
"amount_msat": {
|
|
|
|
"type": "msat",
|
|
|
|
"description": "the amount required to pay this invoice"
|
|
|
|
},
|
|
|
|
"description": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "description used in the invoice"
|
|
|
|
},
|
|
|
|
"payment_hash": {
|
2022-04-01 06:13:34 +02:00
|
|
|
"type": "hash",
|
2021-11-04 15:15:51 +01:00
|
|
|
"description": "the hash of the *payment_preimage* which will prove payment",
|
|
|
|
"maxLength": 64,
|
|
|
|
"minLength": 64
|
|
|
|
},
|
|
|
|
"status": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "State of invoice",
|
|
|
|
"enum": [
|
|
|
|
"paid",
|
|
|
|
"expired",
|
|
|
|
"unpaid"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"expires_at": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "UNIX timestamp when invoice expires (or expired)"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"allOf": [
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"required": [
|
|
|
|
"bolt12"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": [],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"label": {},
|
|
|
|
"bolt12": {},
|
|
|
|
"status": {},
|
|
|
|
"expires_at": {},
|
|
|
|
"msatoshi": {},
|
|
|
|
"amount_msat": {},
|
|
|
|
"description": {},
|
|
|
|
"payment_hash": {},
|
|
|
|
"pay_index": {},
|
|
|
|
"amount_received_msat": {},
|
|
|
|
"paid_at": {},
|
|
|
|
"payment_preimage": {},
|
|
|
|
"local_offer_id": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "offer for which this invoice was created"
|
|
|
|
},
|
|
|
|
"payer_note": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the optional *payer_note* from invoice_request which created this invoice"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"else": {
|
|
|
|
"required": [
|
|
|
|
"bolt11"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"label": {},
|
|
|
|
"bolt11": {},
|
|
|
|
"status": {},
|
|
|
|
"expires_at": {},
|
|
|
|
"msatoshi": {},
|
|
|
|
"amount_msat": {},
|
|
|
|
"description": {},
|
|
|
|
"payment_hash": {},
|
|
|
|
"pay_index": {},
|
|
|
|
"amount_received_msat": {},
|
2022-03-24 00:24:38 +01:00
|
|
|
"msatoshi_received": {},
|
2021-11-04 15:15:51 +01:00
|
|
|
"paid_at": {},
|
|
|
|
"payment_preimage": {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"properties": {
|
|
|
|
"status": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"paid"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"additionalProperties": false,
|
|
|
|
"required": [
|
|
|
|
"pay_index",
|
|
|
|
"amount_received_msat",
|
|
|
|
"paid_at",
|
|
|
|
"payment_preimage"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"label": {},
|
|
|
|
"bolt11": {},
|
|
|
|
"bolt12": {},
|
|
|
|
"status": {},
|
|
|
|
"expires_at": {},
|
|
|
|
"msatoshi": {},
|
|
|
|
"amount_msat": {},
|
|
|
|
"description": {},
|
|
|
|
"payment_hash": {},
|
|
|
|
"payer_note": {},
|
|
|
|
"local_offer_id": {},
|
|
|
|
"pay_index": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "unique index for this invoice payment"
|
|
|
|
},
|
|
|
|
"amount_received_msat": {
|
|
|
|
"type": "msat",
|
|
|
|
"description": "how much was actually received"
|
|
|
|
},
|
2022-03-24 00:24:38 +01:00
|
|
|
"msatoshi_received": {
|
|
|
|
"deprecated": "true"
|
|
|
|
},
|
2021-11-04 15:15:51 +01:00
|
|
|
"paid_at": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "UNIX timestamp of when payment was received"
|
|
|
|
},
|
|
|
|
"payment_preimage": {
|
2022-04-01 06:13:34 +02:00
|
|
|
"type": "secret",
|
2021-11-04 15:15:51 +01:00
|
|
|
"description": "SHA256 of this is the *payment_hash* offered in the invoice",
|
|
|
|
"maxLength": 64,
|
|
|
|
"minLength": 64
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"else": {
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"label": {},
|
|
|
|
"bolt11": {},
|
|
|
|
"bolt12": {},
|
|
|
|
"status": {},
|
|
|
|
"msatoshi": {},
|
|
|
|
"amount_msat": {},
|
|
|
|
"description": {},
|
|
|
|
"payment_hash": {},
|
|
|
|
"expires_at": {},
|
|
|
|
"pay_index": {},
|
|
|
|
"payer_note": {},
|
|
|
|
"local_offer_id": {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2021-05-26 07:55:01 +02:00
|
|
|
}
|