2021-05-26 15:24:01 +09:30
|
|
|
{
|
2021-11-04 15:15:51 +01:00
|
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"valid"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"bolt12 offer",
|
|
|
|
"bolt12 invoice",
|
|
|
|
"bolt12 invoice_request",
|
2022-07-16 22:48:27 +09:30
|
|
|
"bolt11 invoice",
|
2023-10-26 13:45:50 +10:30
|
|
|
"rune",
|
|
|
|
"emergency recover"
|
2021-11-04 15:15:51 +01:00
|
|
|
],
|
|
|
|
"description": "what kind of object it decoded to"
|
2021-05-26 15:24:01 +09:30
|
|
|
},
|
2021-11-04 15:15:51 +01:00
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"description": "if this is false, you *MUST* not use the result except for diagnostics!"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"allOf": [
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"bolt12 offer"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
true
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": [
|
|
|
|
"offer_id",
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_node_id",
|
|
|
|
"offer_description"
|
2021-11-04 15:15:51 +01:00
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"type": {},
|
|
|
|
"valid": {},
|
|
|
|
"offer_id": {
|
|
|
|
"type": "hex",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the id we use to identify this offer",
|
2021-11-04 15:15:51 +01:00
|
|
|
"maxLength": 64,
|
|
|
|
"minLength": 64
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_chains": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "array",
|
|
|
|
"description": "which blockchains this offer is for (missing implies bitcoin mainnet only)",
|
|
|
|
"items": {
|
2023-01-30 16:54:17 +10:30
|
|
|
"type": "hash",
|
|
|
|
"description": "the genesis blockhash"
|
2021-11-04 15:15:51 +01:00
|
|
|
}
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_metadata": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "any metadata the creater of the offer includes"
|
|
|
|
},
|
|
|
|
"offer_currency": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
|
|
|
"description": "ISO 4217 code of the currency (missing implies Bitcoin)",
|
|
|
|
"maxLength": 3,
|
|
|
|
"minLength": 3
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_unknown_offer_currency": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "The currency code is unknown (so no `currency_minor_unit`)"
|
|
|
|
},
|
|
|
|
"currency_minor_unit": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "u32",
|
|
|
|
"description": "the number of decimal places to apply to amount (if currency known)"
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_amount": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "u64",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_amount_msat": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "msat",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the amount in bitcoin (if specified, and no `offer_currency`)"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_description": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
|
|
|
"description": "the description of the purpose of the offer"
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_issuer": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the description of the creator of the offer"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_features": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "hex",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the feature bits of the offer"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_absolute_expiry": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "u64",
|
|
|
|
"description": "UNIX timestamp of when this offer expires"
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_quantity_max": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "the maximum quantity (or, if 0, means any quantity)"
|
|
|
|
},
|
|
|
|
"offer_paths": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "array",
|
|
|
|
"description": "Paths to the destination",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
2022-10-17 11:07:05 +10:30
|
|
|
"first_node_id",
|
2021-11-04 15:15:51 +01:00
|
|
|
"blinding",
|
|
|
|
"path"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
2022-10-17 11:07:05 +10:30
|
|
|
"first_node_id": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "the (presumably well-known) public key of the start of the path"
|
|
|
|
},
|
2021-11-04 15:15:51 +01:00
|
|
|
"blinding": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "blinding factor for this path"
|
|
|
|
},
|
|
|
|
"path": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "an individual path",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
2022-10-17 11:07:05 +10:30
|
|
|
"blinded_node_id",
|
2021-11-30 13:36:04 +10:30
|
|
|
"encrypted_recipient_data"
|
2021-11-04 15:15:51 +01:00
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
2022-10-17 11:07:05 +10:30
|
|
|
"blinded_node_id": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "pubkey",
|
|
|
|
"description": "node_id of the hop"
|
|
|
|
},
|
2021-11-30 13:36:04 +10:30
|
|
|
"encrypted_recipient_data": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "hex",
|
|
|
|
"description": "encrypted TLV entry for this hop"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_node_id": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "public key of the offering node"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_recurrence": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "object",
|
|
|
|
"description": "how often to this offer should be used",
|
|
|
|
"required": [
|
|
|
|
"period",
|
|
|
|
"time_unit"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"time_unit": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "the BOLT12 time unit"
|
|
|
|
},
|
|
|
|
"time_unit_name": {
|
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the name of `time_unit` (if valid)"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
|
|
|
"period": {
|
|
|
|
"type": "u32",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "how many `time_unit` per payment period"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
|
|
|
"basetime": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "period starts at this UNIX timestamp"
|
|
|
|
},
|
|
|
|
"start_any_period": {
|
2023-11-24 18:21:42 +01:00
|
|
|
"type": "boolean",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "you can start at any period (only if `basetime` present)"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
|
|
|
"limit": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "maximum period number for recurrence"
|
|
|
|
},
|
|
|
|
"paywindow": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "when within a period will payment be accepted (default is prior and during the period)",
|
|
|
|
"required": [
|
|
|
|
"seconds_before",
|
|
|
|
"seconds_after"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"seconds_before": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "seconds prior to period start"
|
|
|
|
},
|
|
|
|
"seconds_after": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "seconds after to period start"
|
|
|
|
},
|
|
|
|
"proportional_amount": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
true
|
|
|
|
],
|
|
|
|
"description": "amount should be scaled if payed after period start"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-11-09 13:02:01 +10:30
|
|
|
},
|
|
|
|
"unknown_offer_tlvs": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "Any extra fields we didn't know how to parse",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"length",
|
|
|
|
"value"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "The type"
|
|
|
|
},
|
|
|
|
"length": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "The length"
|
|
|
|
},
|
|
|
|
"value": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "The value"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-04 15:15:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"bolt12 offer"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
false
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": [],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"type": {},
|
|
|
|
"valid": {},
|
|
|
|
"offer_id": {},
|
|
|
|
"node_id": {},
|
|
|
|
"signature": {},
|
|
|
|
"chains": {},
|
|
|
|
"currency": {},
|
|
|
|
"minor_unit": {},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_unknown_offer_currency": {},
|
2021-11-04 15:15:51 +01:00
|
|
|
"amount": {},
|
|
|
|
"amount_msat": {},
|
|
|
|
"send_invoice": {},
|
|
|
|
"description": {},
|
|
|
|
"vendor": {},
|
|
|
|
"features": {},
|
|
|
|
"absolute_expiry": {},
|
|
|
|
"paths": {},
|
|
|
|
"quantity_max": {},
|
2022-11-09 13:02:01 +10:30
|
|
|
"unknown_offer_tlvs": {},
|
2021-11-04 15:15:51 +01:00
|
|
|
"recurrence": {},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_missing_offer_node_id": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`offer_node_id` is not present"
|
|
|
|
},
|
|
|
|
"warning_invalid_offer_description": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`offer_description` is not valid UTF8"
|
|
|
|
},
|
|
|
|
"warning_missing_offer_description": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`offer_description` is not present"
|
|
|
|
},
|
|
|
|
"warning_invalid_offer_currency": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`offer_currency_code` is not valid UTF8"
|
|
|
|
},
|
|
|
|
"warning_invalid_offer_issuer": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`offer_issuer` is not valid UTF8"
|
2021-11-04 15:15:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
2022-11-09 13:02:00 +10:30
|
|
|
"bolt12 invoice_request"
|
2021-11-04 15:15:51 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
true
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": [
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_node_id",
|
|
|
|
"offer_description",
|
|
|
|
"invreq_metadata",
|
|
|
|
"invreq_payer_id",
|
|
|
|
"signature"
|
2021-11-04 15:15:51 +01:00
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"type": {},
|
|
|
|
"valid": {},
|
|
|
|
"offer_id": {
|
|
|
|
"type": "hex",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the id we use to identify this offer",
|
2021-11-04 15:15:51 +01:00
|
|
|
"maxLength": 64,
|
|
|
|
"minLength": 64
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_chains": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "which blockchains this offer is for (missing implies bitcoin mainnet only)",
|
|
|
|
"items": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the genesis blockhash",
|
|
|
|
"maxLength": 64,
|
|
|
|
"minLength": 64
|
|
|
|
}
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_metadata": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "hex",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "any metadata the creator of the offer includes"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_currency": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "ISO 4217 code of the currency (missing implies Bitcoin)",
|
|
|
|
"maxLength": 3,
|
|
|
|
"minLength": 3
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_unknown_offer_currency": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "The currency code is unknown (so no `currency_minor_unit`)"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"currency_minor_unit": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "the number of decimal places to apply to amount (if currency known)"
|
|
|
|
},
|
|
|
|
"offer_amount": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_amount_msat": {
|
|
|
|
"type": "msat",
|
|
|
|
"description": "the amount in bitcoin (if specified, and no `offer_currency`)"
|
|
|
|
},
|
|
|
|
"offer_description": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
|
|
|
"description": "the description of the purpose of the offer"
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_issuer": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the description of the creator of the offer"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_features": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "hex",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the feature bits of the offer"
|
|
|
|
},
|
|
|
|
"offer_absolute_expiry": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "UNIX timestamp of when this offer expires"
|
|
|
|
},
|
|
|
|
"offer_quantity_max": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "the maximum quantity (or, if 0, means any quantity)"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_paths": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "array",
|
|
|
|
"description": "Paths to the destination",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
2022-10-17 11:07:05 +10:30
|
|
|
"first_node_id",
|
2021-11-04 15:15:51 +01:00
|
|
|
"blinding",
|
|
|
|
"path"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
2022-10-17 11:07:05 +10:30
|
|
|
"first_node_id": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "the (presumably well-known) public key of the start of the path"
|
|
|
|
},
|
2021-11-04 15:15:51 +01:00
|
|
|
"blinding": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "blinding factor for this path"
|
|
|
|
},
|
|
|
|
"path": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "an individual path",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
2022-10-17 11:07:05 +10:30
|
|
|
"blinded_node_id",
|
2021-11-30 13:36:04 +10:30
|
|
|
"encrypted_recipient_data"
|
2021-11-04 15:15:51 +01:00
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
2022-10-17 11:07:05 +10:30
|
|
|
"blinded_node_id": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "pubkey",
|
|
|
|
"description": "node_id of the hop"
|
|
|
|
},
|
2021-11-30 13:36:04 +10:30
|
|
|
"encrypted_recipient_data": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "hex",
|
|
|
|
"description": "encrypted TLV entry for this hop"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_node_id": {
|
2022-10-17 11:07:05 +10:30
|
|
|
"type": "pubkey",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "public key of the offering node"
|
|
|
|
},
|
|
|
|
"offer_recurrence": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "how often to this offer should be used",
|
|
|
|
"required": [
|
|
|
|
"period",
|
|
|
|
"time_unit"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"time_unit": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "the BOLT12 time unit"
|
|
|
|
},
|
|
|
|
"time_unit_name": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the name of `time_unit` (if valid)"
|
|
|
|
},
|
|
|
|
"period": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "how many `time_unit` per payment period"
|
|
|
|
},
|
|
|
|
"basetime": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "period starts at this UNIX timestamp"
|
|
|
|
},
|
|
|
|
"start_any_period": {
|
2023-11-24 18:21:42 +01:00
|
|
|
"type": "boolean",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "you can start at any period (only if `basetime` present)"
|
|
|
|
},
|
|
|
|
"limit": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "maximum period number for recurrence"
|
|
|
|
},
|
|
|
|
"paywindow": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "when within a period will payment be accepted (default is prior and during the period)",
|
|
|
|
"required": [
|
|
|
|
"seconds_before",
|
|
|
|
"seconds_after"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"seconds_before": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "seconds prior to period start"
|
|
|
|
},
|
|
|
|
"seconds_after": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "seconds after to period start"
|
|
|
|
},
|
|
|
|
"proportional_amount": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
true
|
|
|
|
],
|
|
|
|
"description": "amount should be scaled if payed after period start"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"invreq_metadata": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "hex",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the payer-provided blob to derive invreq_payer_id"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"invreq_payer_id": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the payer-provided key"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"invreq_chain": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "hex",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "which blockchain this offer is for (missing implies bitcoin mainnet only)",
|
2021-11-04 15:15:51 +01:00
|
|
|
"maxLength": 64,
|
|
|
|
"minLength": 64
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"invreq_amount_msat": {
|
|
|
|
"type": "msat",
|
|
|
|
"description": "the amount the invoice should be for"
|
|
|
|
},
|
|
|
|
"invreq_features": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the feature bits of the invoice_request"
|
|
|
|
},
|
|
|
|
"invreq_quantity": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "the number of items to invoice for"
|
|
|
|
},
|
|
|
|
"invreq_payer_note": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "a note attached by the payer"
|
|
|
|
},
|
|
|
|
"invreq_recurrence_counter": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "u32",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "which number request this is for the same invoice"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"invreq_recurrence_start": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "when we're requesting to start an invoice at a non-zero period"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"signature": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "bip340sig",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "BIP-340 signature of the `invreq_payer_id` on this invoice_request"
|
2022-11-09 13:02:01 +10:30
|
|
|
},
|
|
|
|
"unknown_invoice_request_tlvs": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "Any extra fields we didn't know how to parse",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"length",
|
|
|
|
"value"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "The type"
|
|
|
|
},
|
|
|
|
"length": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "The length"
|
|
|
|
},
|
|
|
|
"value": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "The value"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-04 15:15:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
2022-11-09 13:02:00 +10:30
|
|
|
"bolt12 invoice_request"
|
2021-11-04 15:15:51 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
false
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": [],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"type": {},
|
|
|
|
"valid": {},
|
|
|
|
"offer_id": {},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_chains": {},
|
|
|
|
"offer_metadata": {},
|
|
|
|
"offer_currency": {},
|
|
|
|
"warning_unknown_offer_currency": {},
|
|
|
|
"currency_minor_unit": {},
|
|
|
|
"offer_amount": {},
|
|
|
|
"offer_amount_msat": {},
|
|
|
|
"offer_description": {},
|
|
|
|
"offer_issuer": {},
|
|
|
|
"offer_features": {},
|
|
|
|
"offer_absolute_expiry": {},
|
|
|
|
"offer_quantity_max": {},
|
|
|
|
"offer_paths": {},
|
|
|
|
"offer_node_id": {},
|
|
|
|
"offer_recurrence": {},
|
2022-11-09 13:02:00 +10:30
|
|
|
"invreq_metadata": {},
|
2022-11-09 13:02:00 +10:30
|
|
|
"invreq_payer_id": {},
|
|
|
|
"invreq_chain": {},
|
|
|
|
"invreq_amount_msat": {},
|
|
|
|
"invreq_features": {},
|
|
|
|
"invreq_quantity": {},
|
|
|
|
"invreq_payer_note": {},
|
|
|
|
"invreq_recurrence_counter": {},
|
|
|
|
"invreq_recurrence_start": {},
|
|
|
|
"warning_invalid_offer_description": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`offer_description` is not valid UTF8"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_missing_offer_description": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`offer_description` is not present"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_invalid_offer_currency": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`offer_currency_code` is not valid UTF8"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_invalid_offer_issuer": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`offer_issuer` is not valid UTF8"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_missing_invreq_metadata": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`invreq_metadata` is not present"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_missing_invreq_payer_id": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`invreq_payer_id` is not present"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_invalid_invreq_payer_note": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`invreq_payer_note` is not valid UTF8"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_missing_invoice_request_signature": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`signature` is not present"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_invalid_invoice_request_signature": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "Incorrect `signature`"
|
2021-11-04 15:15:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
2022-11-09 13:02:00 +10:30
|
|
|
"bolt12 invoice"
|
2021-11-04 15:15:51 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
true
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": [
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_node_id",
|
|
|
|
"offer_description",
|
|
|
|
"invreq_metadata",
|
|
|
|
"invreq_payer_id",
|
|
|
|
"invoice_paths",
|
|
|
|
"invoice_created_at",
|
|
|
|
"invoice_payment_hash",
|
|
|
|
"invoice_amount_msat",
|
|
|
|
"signature"
|
2021-11-04 15:15:51 +01:00
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"type": {},
|
|
|
|
"valid": {},
|
|
|
|
"offer_id": {
|
|
|
|
"type": "hex",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the id we use to identify this offer",
|
2021-11-04 15:15:51 +01:00
|
|
|
"maxLength": 64,
|
|
|
|
"minLength": 64
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_chains": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "which blockchains this offer is for (missing implies bitcoin mainnet only)",
|
|
|
|
"items": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the genesis blockhash",
|
|
|
|
"maxLength": 64,
|
|
|
|
"minLength": 64
|
|
|
|
}
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_metadata": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "hex",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "any metadata the creator of the offer includes"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_currency": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "ISO 4217 code of the currency (missing implies Bitcoin)",
|
|
|
|
"maxLength": 3,
|
|
|
|
"minLength": 3
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_unknown_offer_currency": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "The currency code is unknown (so no `currency_minor_unit`)"
|
|
|
|
},
|
|
|
|
"currency_minor_unit": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "u32",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the number of decimal places to apply to amount (if currency known)"
|
|
|
|
},
|
|
|
|
"offer_amount": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any"
|
|
|
|
},
|
|
|
|
"offer_amount_msat": {
|
|
|
|
"type": "msat",
|
|
|
|
"description": "the amount in bitcoin (if specified, and no `offer_currency`)"
|
|
|
|
},
|
|
|
|
"offer_description": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the description of the purpose of the offer"
|
|
|
|
},
|
|
|
|
"offer_issuer": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the description of the creator of the offer"
|
|
|
|
},
|
|
|
|
"offer_features": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the feature bits of the offer"
|
|
|
|
},
|
|
|
|
"offer_absolute_expiry": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "UNIX timestamp of when this offer expires"
|
|
|
|
},
|
|
|
|
"offer_quantity_max": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "the maximum quantity (or, if 0, means any quantity)"
|
|
|
|
},
|
|
|
|
"offer_paths": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "Paths to the destination",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"first_node_id",
|
|
|
|
"blinding",
|
|
|
|
"path"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"first_node_id": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "the (presumably well-known) public key of the start of the path"
|
|
|
|
},
|
|
|
|
"blinding": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "blinding factor for this path"
|
|
|
|
},
|
|
|
|
"path": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "an individual path",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"blinded_node_id",
|
|
|
|
"encrypted_recipient_data"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"blinded_node_id": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "node_id of the hop"
|
|
|
|
},
|
|
|
|
"encrypted_recipient_data": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "encrypted TLV entry for this hop"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_node_id": {
|
2022-10-17 11:07:05 +10:30
|
|
|
"type": "pubkey",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "public key of the offering node"
|
|
|
|
},
|
|
|
|
"offer_recurrence": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "how often to this offer should be used",
|
|
|
|
"required": [
|
|
|
|
"period",
|
|
|
|
"time_unit"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"time_unit": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "the BOLT12 time unit"
|
|
|
|
},
|
|
|
|
"time_unit_name": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the name of `time_unit` (if valid)"
|
|
|
|
},
|
|
|
|
"period": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "how many `time_unit` per payment period"
|
|
|
|
},
|
|
|
|
"basetime": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "period starts at this UNIX timestamp"
|
|
|
|
},
|
|
|
|
"start_any_period": {
|
2023-11-24 18:21:42 +01:00
|
|
|
"type": "boolean",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "you can start at any period (only if `basetime` present)"
|
|
|
|
},
|
|
|
|
"limit": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "maximum period number for recurrence"
|
|
|
|
},
|
|
|
|
"paywindow": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "when within a period will payment be accepted (default is prior and during the period)",
|
|
|
|
"required": [
|
|
|
|
"seconds_before",
|
|
|
|
"seconds_after"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"seconds_before": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "seconds prior to period start"
|
|
|
|
},
|
|
|
|
"seconds_after": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "seconds after to period start"
|
|
|
|
},
|
|
|
|
"proportional_amount": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
true
|
|
|
|
],
|
|
|
|
"description": "amount should be scaled if payed after period start"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"invreq_metadata": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "hex",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the payer-provided blob to derive invreq_payer_id"
|
|
|
|
},
|
|
|
|
"invreq_payer_id": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the payer-provided key"
|
|
|
|
},
|
|
|
|
"invreq_chain": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "which blockchain this offer is for (missing implies bitcoin mainnet only)",
|
|
|
|
"maxLength": 64,
|
|
|
|
"minLength": 64
|
|
|
|
},
|
|
|
|
"invreq_amount_msat": {
|
|
|
|
"type": "msat",
|
|
|
|
"description": "the amount the invoice should be for"
|
|
|
|
},
|
|
|
|
"invreq_features": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the feature bits of the invoice_request"
|
|
|
|
},
|
|
|
|
"invreq_quantity": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "the number of items to invoice for"
|
|
|
|
},
|
|
|
|
"invreq_payer_note": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "a note attached by the payer"
|
|
|
|
},
|
|
|
|
"invreq_recurrence_counter": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "which number request this is for the same invoice"
|
|
|
|
},
|
|
|
|
"invreq_recurrence_start": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "when we're requesting to start an invoice at a non-zero period"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"invoice_paths": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "Paths to pay the destination",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"first_node_id",
|
|
|
|
"blinding",
|
2023-01-12 14:28:03 +10:30
|
|
|
"payinfo",
|
2022-11-09 13:02:00 +10:30
|
|
|
"path"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"first_node_id": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "the (presumably well-known) public key of the start of the path"
|
|
|
|
},
|
|
|
|
"blinding": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "blinding factor for this path"
|
|
|
|
},
|
2023-01-12 14:28:03 +10:30
|
|
|
"payinfo": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"fee_base_msat",
|
|
|
|
"fee_proportional_millionths",
|
|
|
|
"cltv_expiry_delta",
|
|
|
|
"features"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"fee_base_msat": {
|
|
|
|
"type": "msat",
|
|
|
|
"description": "basefee for path"
|
|
|
|
},
|
|
|
|
"fee_proportional_millionths": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "proportional fee for path"
|
|
|
|
},
|
|
|
|
"cltv_expiry_delta": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "CLTV delta for path"
|
|
|
|
},
|
|
|
|
"features": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "features allowed for path"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"path": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "an individual path",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"blinded_node_id",
|
|
|
|
"encrypted_recipient_data"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"blinded_node_id": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "node_id of the hop"
|
|
|
|
},
|
|
|
|
"encrypted_recipient_data": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "encrypted TLV entry for this hop"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"invoice_created_at": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "the UNIX timestamp of invoice creation"
|
|
|
|
},
|
|
|
|
"invoice_relative_expiry": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "the number of seconds after *invoice_created_at* when this expires"
|
|
|
|
},
|
|
|
|
"invoice_payment_hash": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the hash of the *payment_preimage*",
|
|
|
|
"maxLength": 64,
|
|
|
|
"minLength": 64
|
|
|
|
},
|
|
|
|
"invoice_amount_msat": {
|
|
|
|
"type": "msat",
|
|
|
|
"description": "the amount required to fulfill invoice"
|
|
|
|
},
|
|
|
|
"invoice_fallbacks": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "onchain addresses",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"version",
|
|
|
|
"hex"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"version": {
|
|
|
|
"type": "u8",
|
|
|
|
"description": "Segwit address version"
|
|
|
|
},
|
|
|
|
"hex": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "Raw encoded segwit address"
|
|
|
|
},
|
|
|
|
"address": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "bech32 segwit address"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"invoice_features": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the feature bits of the invoice"
|
|
|
|
},
|
|
|
|
"invoice_node_id": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "the id to pay (usually the same as offer_node_id)"
|
|
|
|
},
|
|
|
|
"invoice_recurrence_basetime": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "the UNIX timestamp to base the invoice periods on"
|
|
|
|
},
|
|
|
|
"signature": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "bip340sig",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "BIP-340 signature of the `offer_node_id` on this invoice"
|
2022-11-09 13:02:01 +10:30
|
|
|
},
|
|
|
|
"unknown_invoice_tlvs": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "Any extra fields we didn't know how to parse",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"length",
|
|
|
|
"value"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "The type"
|
|
|
|
},
|
|
|
|
"length": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "The length"
|
|
|
|
},
|
|
|
|
"value": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "The value"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-04 15:15:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
2022-11-09 13:02:00 +10:30
|
|
|
"bolt12 invoice"
|
2021-11-04 15:15:51 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
false
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": [],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"type": {},
|
|
|
|
"valid": {},
|
|
|
|
"offer_id": {},
|
2022-11-09 13:02:00 +10:30
|
|
|
"offer_chains": {},
|
|
|
|
"offer_metadata": {},
|
|
|
|
"offer_currency": {},
|
|
|
|
"warning_unknown_offer_currency": {},
|
|
|
|
"currency_minor_unit": {},
|
|
|
|
"offer_amount": {},
|
|
|
|
"offer_amount_msat": {},
|
|
|
|
"offer_description": {},
|
|
|
|
"offer_issuer": {},
|
|
|
|
"offer_features": {},
|
|
|
|
"offer_absolute_expiry": {},
|
|
|
|
"offer_quantity_max": {},
|
|
|
|
"offer_paths": {},
|
|
|
|
"offer_node_id": {},
|
|
|
|
"offer_recurrence": {},
|
2022-11-09 13:02:00 +10:30
|
|
|
"invreq_metadata": {},
|
2022-11-09 13:02:00 +10:30
|
|
|
"invreq_payer_id": {},
|
|
|
|
"invreq_chain": {},
|
|
|
|
"invreq_amount_msat": {},
|
|
|
|
"invreq_features": {},
|
|
|
|
"invreq_quantity": {},
|
|
|
|
"invreq_payer_note": {},
|
|
|
|
"invreq_node_id": {},
|
|
|
|
"invreq_recurrence_counter": {},
|
|
|
|
"invreq_recurrence_start": {},
|
|
|
|
"warning_invalid_offer_description": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`offer_description` is not valid UTF8"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_missing_offer_description": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`offer_description` is not present"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_invalid_offer_currency": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`offer_currency_code` is not valid UTF8"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
2022-11-09 13:02:00 +10:30
|
|
|
"warning_invalid_offer_issuer": {
|
2021-11-04 15:15:51 +01:00
|
|
|
"type": "string",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "`offer_issuer` is not valid UTF8"
|
|
|
|
},
|
|
|
|
"warning_missing_invreq_metadata": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`invreq_metadata` is not present"
|
|
|
|
},
|
|
|
|
"warning_invalid_invreq_payer_note": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`invreq_payer_note` is not valid UTF8"
|
|
|
|
},
|
|
|
|
"warning_missing_invoice_paths": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`invoice_paths` is not present"
|
|
|
|
},
|
|
|
|
"warning_missing_invoice_blindedpay": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`invoice_blindedpay` is not present"
|
|
|
|
},
|
|
|
|
"warning_missing_invoice_created_at": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`invoice_created_at` is not present"
|
|
|
|
},
|
|
|
|
"warning_missing_invoice_payment_hash": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`invoice_payment_hash` is not present"
|
|
|
|
},
|
|
|
|
"warning_missing_invoice_amount": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`invoice_amount` is not present"
|
|
|
|
},
|
|
|
|
"warning_missing_invoice_recurrence_basetime": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`invoice_recurrence_basetime` is not present"
|
|
|
|
},
|
|
|
|
"warning_missing_invoice_node_id": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`invoice_node_id` is not present"
|
|
|
|
},
|
|
|
|
"warning_missing_invoice_signature": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`signature` is not present"
|
|
|
|
},
|
|
|
|
"warning_invalid_invoice_signature": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "Incorrect `signature`"
|
|
|
|
},
|
|
|
|
"fallbacks": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"version",
|
|
|
|
"hex"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"version": {},
|
|
|
|
"hex": {},
|
|
|
|
"address": {},
|
|
|
|
"warning_invoice_fallbacks_version_invalid": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "`version` is > 16"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-04 15:15:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"bolt11 invoice"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
true
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": [
|
|
|
|
"currency",
|
|
|
|
"created_at",
|
|
|
|
"expiry",
|
|
|
|
"payee",
|
|
|
|
"min_final_cltv_expiry",
|
|
|
|
"payment_hash",
|
|
|
|
"signature"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
2022-03-31 19:40:50 +10:30
|
|
|
"type": {},
|
|
|
|
"valid": {},
|
2021-11-04 15:15:51 +01:00
|
|
|
"currency": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the BIP173 name for the currency"
|
|
|
|
},
|
|
|
|
"created_at": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": "the UNIX-style timestamp of the invoice"
|
|
|
|
},
|
|
|
|
"expiry": {
|
|
|
|
"type": "u64",
|
2022-11-09 13:02:00 +10:30
|
|
|
"description": "the number of seconds this is valid after `created_at`"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
|
|
|
"payee": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "the public key of the recipient"
|
|
|
|
},
|
|
|
|
"amount_msat": {
|
|
|
|
"type": "msat",
|
|
|
|
"description": "Amount the invoice asked for"
|
|
|
|
},
|
|
|
|
"payment_hash": {
|
2023-01-30 16:54:17 +10:30
|
|
|
"type": "hash",
|
|
|
|
"description": "the hash of the *payment_preimage*"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
|
|
|
"signature": {
|
|
|
|
"type": "signature",
|
|
|
|
"description": "signature of the *payee* on this invoice"
|
|
|
|
},
|
|
|
|
"description": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the description of the purpose of the purchase"
|
|
|
|
},
|
|
|
|
"description_hash": {
|
2023-01-30 16:54:17 +10:30
|
|
|
"type": "hash",
|
|
|
|
"description": "the hash of the description, in place of *description*"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
|
|
|
"min_final_cltv_expiry": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "the minimum CLTV delay for the final node"
|
|
|
|
},
|
|
|
|
"payment_secret": {
|
2023-01-30 16:54:17 +10:30
|
|
|
"type": "secret",
|
|
|
|
"description": "the secret to hand to the payee node"
|
2021-11-04 15:15:51 +01:00
|
|
|
},
|
|
|
|
"features": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the features bitmap for this invoice"
|
|
|
|
},
|
2022-03-31 19:40:50 +10:30
|
|
|
"payment_metadata": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the payment_metadata to put in the payment"
|
|
|
|
},
|
2021-11-04 15:15:51 +01:00
|
|
|
"fallbacks": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "onchain addresses",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"hex"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the address type (if known)",
|
|
|
|
"enum": [
|
|
|
|
"P2PKH",
|
|
|
|
"P2SH",
|
|
|
|
"P2WPKH",
|
2023-10-26 14:02:08 +10:30
|
|
|
"P2WSH",
|
|
|
|
"P2TR"
|
2021-11-04 15:15:51 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"addr": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the address in appropriate format for *type*"
|
|
|
|
},
|
|
|
|
"hex": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "Raw encoded address"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"routes": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "Route hints to the *payee*",
|
|
|
|
"items": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "hops in the route",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"pubkey",
|
|
|
|
"short_channel_id",
|
|
|
|
"fee_base_msat",
|
|
|
|
"fee_proportional_millionths",
|
|
|
|
"cltv_expiry_delta"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"pubkey": {
|
|
|
|
"type": "pubkey",
|
|
|
|
"description": "the public key of the node"
|
|
|
|
},
|
|
|
|
"short_channel_id": {
|
|
|
|
"type": "short_channel_id",
|
|
|
|
"description": "a channel to the next peer"
|
|
|
|
},
|
|
|
|
"fee_base_msat": {
|
doc: fix decode schema for bolt11 routehints.
I decode a routehint in the next patch, and it barfed:
```
> assert only_one(l1.rpc.decode(inv['bolt11'])['routes'])['short_channel_id'] == alias23
tests/test_opening.py:1515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
contrib/pyln-client/pyln/client/lightning.py:321: in wrapper
return self.call(name, payload=args)
contrib/pyln-testing/pyln/testing/utils.py:691: in call
schemas[1].validate(res)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Validator(schema={'$schema': 'http://json-...ft-07/schema#', 'allOf': [{'if': {'properties': {'type': {'enum': [...], ...iption': 'if this is f... diagnostics!', 'type': 'boolean'}}, 'required': ['type', 'valid'], ...}, format_checker=None)
args = ({'amount_msat': 10msat, 'created_at': 1659923931, 'currency': 'bcrt', 'description': 'desc', ...},), kwargs = {}
error = <ValidationError: "1msat is not of type 'u32'">
def validate(self, *args, **kwargs):
for error in self.iter_errors(*args, **kwargs):
> raise error
E jsonschema.exceptions.ValidationError: 1msat is not of type 'u32'
E
E Failed validating 'type' in schema['allOf'][6]['then']['properties']['routes']['items']['items']['properties']['fee_base_msat']:
E {'description': 'the base fee for payments', 'type': 'u32'}
E
E On instance['routes'][0][0]['fee_base_msat']:
E 1msat
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-08-08 11:31:19 +09:30
|
|
|
"type": "msat",
|
2021-11-04 15:15:51 +01:00
|
|
|
"description": "the base fee for payments"
|
|
|
|
},
|
|
|
|
"fee_proportional_millionths": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "the parts-per-million fee for payments"
|
|
|
|
},
|
|
|
|
"cltv_expiry_delta": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": "the CLTV delta across this hop"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"extra": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "Any extra fields we didn't know how to parse",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"tag",
|
|
|
|
"data"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"tag": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "The bech32 letter which identifies this field",
|
|
|
|
"maxLength": 1,
|
|
|
|
"minLength": 1
|
|
|
|
},
|
|
|
|
"data": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "The bech32 data for this field"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-07-16 22:48:27 +09:30
|
|
|
},
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"rune"
|
|
|
|
]
|
2022-07-25 10:53:30 +09:30
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
true
|
|
|
|
]
|
2022-07-16 22:48:27 +09:30
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": [
|
|
|
|
"string",
|
2022-07-25 10:53:30 +09:30
|
|
|
"restrictions",
|
|
|
|
"valid"
|
2022-07-16 22:48:27 +09:30
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"unique_id": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "unique id (always a numeric id on runes we create)"
|
|
|
|
},
|
|
|
|
"version": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "rune version, not currently set on runes we create"
|
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
true
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"type": {},
|
|
|
|
"string": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the string encoding of the rune"
|
|
|
|
},
|
|
|
|
"restrictions": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "restrictions built into the rune: all must pass",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"alternatives",
|
|
|
|
"summary"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"alternatives": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "each way restriction can be met: any can pass",
|
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the alternative of form fieldname condition fieldname"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"summary": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "human-readable summary of this restriction"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-07-25 10:53:30 +09:30
|
|
|
},
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"rune"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
false
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": [
|
|
|
|
"valid"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
false
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"type": {},
|
|
|
|
"warning_rune_invalid_utf8": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the rune contains invalid UTF-8 strings"
|
|
|
|
},
|
|
|
|
"hex": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "the raw rune in hex"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-10-26 13:45:50 +10:30
|
|
|
},
|
|
|
|
{
|
|
|
|
"if": {
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"emergency recover"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean",
|
|
|
|
"enum": [
|
|
|
|
true
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": [
|
|
|
|
"decrypted"
|
|
|
|
],
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"type": {},
|
|
|
|
"valid": {},
|
|
|
|
"decrypted": {
|
|
|
|
"type": "hex",
|
|
|
|
"description": "The decrypted value of the provided bech32 of emergency.recover",
|
|
|
|
"added": "v23.11"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-04 15:15:51 +01:00
|
|
|
}
|
|
|
|
]
|
2021-05-26 15:24:01 +09:30
|
|
|
}
|