rgb-cln/doc/schemas/sendpay.schema.json

166 lines
4.1 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": true,
"required": [
"id",
"created_index",
"payment_hash",
"status",
"created_at",
"amount_sent_msat"
],
"properties": {
"created_index": {
"added": "v23.11",
"type": "u64",
"description": "1-based index indicating order this payment was created in"
},
"updated_index": {
"added": "v23.11",
"type": "u64",
"description": "1-based index indicating order this payment was changed (only present if it has changed since creation)"
},
"id": {
"type": "u64",
"description": "old synonym for created_index"
},
"groupid": {
"type": "u64",
"description": "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash"
},
"payment_hash": {
"type": "hash",
"description": "the hash of the *payment_preimage* which will prove payment"
},
"status": {
"type": "string",
"enum": [
"pending",
"complete"
],
"description": "status of the payment (could be complete if already sent previously)"
},
"amount_msat": {
"type": "msat",
"description": "The amount delivered to destination (if known)"
},
"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"
},
"amount_sent_msat": {
"type": "msat",
"description": "The amount sent"
},
"label": {
"type": "string",
"description": "the *label*, if given to sendpay"
},
"partid": {
"type": "u64",
"description": "the *partid*, if given to sendpay"
},
"bolt11": {
"type": "string",
"description": "the bolt11 string (if supplied)"
},
"bolt12": {
"type": "string",
"description": "the bolt12 string (if supplied: **experimental-offers** only)."
}
},
"allOf": [
{
"if": {
"properties": {
"status": {
"type": "string",
"enum": [
"complete"
]
}
}
},
"then": {
"additionalProperties": false,
"required": [
"payment_preimage"
],
"properties": {
"id": {},
"created_index": {},
"updated_index": {},
"groupid": {},
"payment_hash": {},
"status": {},
"msatoshi": {},
"amount_msat": {},
"destination": {},
"created_at": {},
"completed_at": {},
"msatoshi_sent": {},
"amount_sent_msat": {},
"label": {},
"partid": {},
"bolt11": {},
"bolt12": {},
"payment_preimage": {
"type": "secret",
"description": "the proof of payment: SHA256 of this **payment_hash**"
}
}
}
},
{
"if": {
"properties": {
"status": {
"type": "string",
"enum": [
"pending"
]
}
}
},
"then": {
"additionalProperties": false,
"required": [
"message"
],
"properties": {
"id": {},
"created_index": {},
"updated_index": {},
"groupid": {},
"payment_hash": {},
"status": {},
"msatoshi": {},
"amount_msat": {},
"destination": {},
"created_at": {},
"completed_at": {},
"msatoshi_sent": {},
"amount_sent_msat": {},
"label": {},
"partid": {},
"bolt11": {},
"bolt12": {},
"message": {
"type": "string",
"description": "Monitor status with listpays or waitsendpay"
}
}
}
}
]
}