Skip to content

Commit 2b4b91f

Browse files
niftyneirustyrussell
authored andcommitted
bkpr: add new RPC bkpr-editdescriptionbyoutpoint
Given an {outpoint}, sets the description on the matching outpoint (if exists). Note that if no outpoint exists in bookkeeper, will return an empty list Changleog-Added: PLUGINS: bookkeeper has a new RPC `bkrp-editdescriptionbyoutpoint` which will set/update a description for an outpoint creation event.
1 parent a61b7ef commit 2b4b91f

File tree

6 files changed

+685
-0
lines changed

6 files changed

+685
-0
lines changed

contrib/msggen/msggen/schema.json

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2605,6 +2605,275 @@
26052605
}
26062606
]
26072607
},
2608+
"lightning-bkpr-editdescriptionbyoutpoint.json": {
2609+
"$schema": "../rpc-schema-draft.json",
2610+
"type": "object",
2611+
"additionalProperties": false,
2612+
"rpc": "bkpr-editdescriptionbyoutpoint",
2613+
"title": "Command to change the description for events with {outpoint} after they're made",
2614+
"description": [
2615+
"The **bkpr-editdescriptionbyoutpoint** RPC command updates all chain and channel events that match the {outpoint} with the provided {description}"
2616+
],
2617+
"request": {
2618+
"required": [
2619+
"outpoint",
2620+
"description"
2621+
],
2622+
"properties": {
2623+
"outpoint": {
2624+
"type": "string",
2625+
"description": [
2626+
"The outpoint to update the description for."
2627+
]
2628+
},
2629+
"description": {
2630+
"type": "string",
2631+
"description": [
2632+
"The description to update to"
2633+
]
2634+
}
2635+
}
2636+
},
2637+
"response": {
2638+
"required": [
2639+
"updated"
2640+
],
2641+
"properties": {
2642+
"updated": {
2643+
"type": "array",
2644+
"items": {
2645+
"type": "object",
2646+
"additionalProperties": true,
2647+
"required": [
2648+
"account",
2649+
"type",
2650+
"tag",
2651+
"credit_msat",
2652+
"debit_msat",
2653+
"currency",
2654+
"timestamp",
2655+
"description"
2656+
],
2657+
"properties": {
2658+
"account": {
2659+
"type": "string",
2660+
"description": [
2661+
"The account name. If the account is a channel, the channel_id."
2662+
]
2663+
},
2664+
"type": {
2665+
"type": "string",
2666+
"enum": [
2667+
"chain",
2668+
"channel"
2669+
],
2670+
"description": [
2671+
"Coin movement type."
2672+
]
2673+
},
2674+
"tag": {
2675+
"type": "string",
2676+
"description": [
2677+
"Description of movement."
2678+
]
2679+
},
2680+
"credit_msat": {
2681+
"type": "msat",
2682+
"description": [
2683+
"Amount credited."
2684+
]
2685+
},
2686+
"debit_msat": {
2687+
"type": "msat",
2688+
"description": [
2689+
"Amount debited."
2690+
]
2691+
},
2692+
"currency": {
2693+
"type": "string",
2694+
"description": [
2695+
"Human-readable bech32 part for this coin type."
2696+
]
2697+
},
2698+
"timestamp": {
2699+
"type": "u32",
2700+
"description": [
2701+
"Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp."
2702+
]
2703+
},
2704+
"description": {
2705+
"type": "string",
2706+
"description": [
2707+
"The description of this event"
2708+
]
2709+
}
2710+
},
2711+
"allOf": [
2712+
{
2713+
"if": {
2714+
"properties": {
2715+
"type": {
2716+
"type": "string",
2717+
"enum": [
2718+
"chain"
2719+
]
2720+
}
2721+
}
2722+
},
2723+
"then": {
2724+
"properties": {
2725+
"account": {},
2726+
"type": {},
2727+
"tag": {},
2728+
"credit_msat": {},
2729+
"debit_msat": {},
2730+
"currency": {},
2731+
"timestamp": {},
2732+
"description": {
2733+
"type": "string",
2734+
"description": [
2735+
"A description of this outpoint."
2736+
]
2737+
},
2738+
"outpoint": {
2739+
"type": "string",
2740+
"description": [
2741+
"The txid:outnum for this event."
2742+
]
2743+
},
2744+
"blockheight": {
2745+
"type": "u32",
2746+
"description": [
2747+
"For chain events, blockheight this occured at."
2748+
]
2749+
},
2750+
"origin": {
2751+
"type": "string",
2752+
"description": [
2753+
"The account this movement originated from."
2754+
]
2755+
},
2756+
"payment_id": {
2757+
"type": "hex",
2758+
"description": [
2759+
"Lightning payment identifier. For an htlc, this will be the preimage."
2760+
]
2761+
},
2762+
"txid": {
2763+
"type": "txid",
2764+
"description": [
2765+
"The txid of the transaction that created this event."
2766+
]
2767+
}
2768+
},
2769+
"required": [
2770+
"outpoint",
2771+
"blockheight"
2772+
],
2773+
"additionalProperties": false
2774+
}
2775+
},
2776+
{
2777+
"if": {
2778+
"properties": {
2779+
"type": {
2780+
"type": "string",
2781+
"enum": [
2782+
"onchain_fee"
2783+
]
2784+
}
2785+
}
2786+
},
2787+
"then": {
2788+
"properties": {
2789+
"account": {},
2790+
"type": {},
2791+
"tag": {},
2792+
"credit_msat": {},
2793+
"debit_msat": {},
2794+
"currency": {},
2795+
"timestamp": {},
2796+
"description": {},
2797+
"txid": {
2798+
"type": "txid",
2799+
"description": [
2800+
"The txid of the transaction that created this event."
2801+
]
2802+
}
2803+
},
2804+
"required": [
2805+
"txid"
2806+
],
2807+
"additionalProperties": false
2808+
}
2809+
},
2810+
{
2811+
"if": {
2812+
"properties": {
2813+
"type": {
2814+
"type": "string",
2815+
"enum": [
2816+
"channel"
2817+
]
2818+
}
2819+
}
2820+
},
2821+
"then": {
2822+
"properties": {
2823+
"account": {},
2824+
"type": {},
2825+
"tag": {},
2826+
"credit_msat": {},
2827+
"debit_msat": {},
2828+
"currency": {},
2829+
"timestamp": {},
2830+
"description": {},
2831+
"fees_msat": {
2832+
"type": "msat",
2833+
"description": [
2834+
"Amount paid in fees."
2835+
]
2836+
},
2837+
"is_rebalance": {
2838+
"type": "boolean",
2839+
"description": [
2840+
"Is this payment part of a rebalance."
2841+
]
2842+
},
2843+
"payment_id": {
2844+
"type": "hex",
2845+
"description": [
2846+
"Lightning payment identifier. For an htlc, this will be the preimage."
2847+
]
2848+
},
2849+
"part_id": {
2850+
"type": "u32",
2851+
"description": [
2852+
"Counter for multi-part payments."
2853+
]
2854+
}
2855+
},
2856+
"additionalProperties": false
2857+
}
2858+
}
2859+
]
2860+
}
2861+
}
2862+
}
2863+
},
2864+
"author": [
2865+
"Lisa Neigut <<[email protected]>> is mainly responsible."
2866+
],
2867+
"see_also": [
2868+
"lightning-bkpr-editdescriptionbypaymentid(7)",
2869+
"lightning-bkpr-listaccountevents(7)",
2870+
"lightning-bkpr-listincome(7)"
2871+
],
2872+
"resources": [
2873+
"Main web site: <https://github.com/ElementsProject/lightning>"
2874+
],
2875+
"examples": []
2876+
},
26082877
"lightning-bkpr-editdescriptionbypaymentid.json": {
26092878
"$schema": "../rpc-schema-draft.json",
26102879
"type": "object",
@@ -2859,6 +3128,7 @@
28593128
"Lisa Neigut <<[email protected]>> is mainly responsible."
28603129
],
28613130
"see_also": [
3131+
"lightning-bkpr-editdescriptionbyoutpoint(7)",
28623132
"lightning-bkpr-listaccountevents(7)",
28633133
"lightning-bkpr-listincome(7)"
28643134
],

0 commit comments

Comments
 (0)