core-lightning/doc/schemas/listpays.schema.json
2022-09-14 13:14:10 +02:00

145 lines
4.1 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"required": [
"pays"
],
"properties": {
"pays": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true,
"required": [
"payment_hash",
"status",
"created_at"
],
"properties": {
"payment_hash": {
"type": "hex",
"description": "the hash of the *payment_preimage* which will prove payment",
"maxLength": 64,
"minLength": 64
},
"status": {
"type": "string",
"enum": [
"pending",
"failed",
"complete"
],
"description": "status of the payment"
},
"destination": {
"type": "pubkey",
"description": "the final destination of the payment if known"
},
"created_at": {
"type": "u64",
"description": "the UNIX timestamp showing when this payment was initiated"
},
"completed_at": {
"type": "u64",
"description": "the UNIX timestamp showing when this payment was completed"
},
"label": {
"type": "string",
"description": "the label, if given to sendpay"
},
"bolt11": {
"type": "string",
"description": "the bolt11 string (if pay supplied one)"
},
"description": {
"type": "string",
"description": "the description matching the bolt11 description hash (if pay supplied one)"
},
"bolt12": {
"type": "string",
"description": "the bolt12 string (if supplied for pay: **experimental-offers** only)."
}
},
"allOf": [
{
"if": {
"properties": {
"status": {
"type": "string",
"enum": [
"complete"
]
}
}
},
"then": {
"additionalProperties": false,
"required": [
"amount_sent_msat",
"preimage"
],
"properties": {
"payment_hash": {},
"status": {},
"destination": {},
"created_at": {},
"completed_at": {},
"label": {},
"bolt11": {},
"description": {},
"bolt12": {},
"amount_msat": {},
"amount_sent_msat": {},
"preimage": {
"type": "hex",
"description": "proof of payment",
"maxLength": 64,
"minLength": 64
},
"number_of_parts": {
"type": "u64",
"description": "the number of parts for a successful payment (only if more than one)."
}
}
}
},
{
"if": {
"properties": {
"status": {
"type": "string",
"enum": [
"failed"
]
}
}
},
"then": {
"additionalProperties": false,
"required": [
"amount_sent_msat"
],
"properties": {
"payment_hash": {},
"status": {},
"destination": {},
"created_at": {},
"label": {},
"bolt11": {},
"description": {},
"bolt12": {},
"amount_sent_msat": {},
"erroronion": {
"type": "hex",
"description": "the error onion returned on failure, if any."
}
}
}
}
]
}
}
}
}