#include <bitcoin/tx.h>
#include <ccan/crypto/shachain/shachain.h>
#include <common/amount.h>
#include <common/channel_id.h>
#include <common/channel_type.h>
#include <common/derive_basepoints.h>
#include <common/htlc_wire.h>
#include <common/node_id.h>
#include <common/wireaddr.h>
#include <common/utils.h>

tlvtype,scb_tlvs,shachain,1,
tlvdata,scb_tlvs,shachain,their_shachain,shachain,
tlvtype,scb_tlvs,basepoints,3,
tlvdata,scb_tlvs,basepoints,their_basepoint,basepoints,
tlvtype,scb_tlvs,opener,5,
tlvdata,scb_tlvs,opener,opener,enum side,
tlvtype,scb_tlvs,remote_to_self_delay,7,
tlvdata,scb_tlvs,remote_to_self_delay,remote_to_self_delay,u16,

# legacy_scb_chan stores min. info required to sweep the peer's force close.
subtype,legacy_scb_chan
subtypedata,legacy_scb_chan,id,u64,
subtypedata,legacy_scb_chan,cid,channel_id,
subtypedata,legacy_scb_chan,node_id,node_id,
subtypedata,legacy_scb_chan,unused,u8,
subtypedata,legacy_scb_chan,addr,wireaddr,
subtypedata,legacy_scb_chan,funding,bitcoin_outpoint,
subtypedata,legacy_scb_chan,funding_sats,amount_sat,
subtypedata,legacy_scb_chan,type,channel_type,

msgtype,static_chan_backup,6135,
msgdata,static_chan_backup,version,u64,
msgdata,static_chan_backup,timestamp,u32,
msgdata,static_chan_backup,num,u16,
msgdata,static_chan_backup,channels,legacy_scb_chan,num

subtype,modern_scb_chan
subtypedata,modern_scb_chan,id,u64,
subtypedata,modern_scb_chan,cid,channel_id,
subtypedata,modern_scb_chan,node_id,node_id,
subtypedata,modern_scb_chan,addr,wireaddr,
subtypedata,modern_scb_chan,funding,bitcoin_outpoint,
subtypedata,modern_scb_chan,funding_sats,amount_sat,
subtypedata,modern_scb_chan,type,channel_type,
subtypedata,modern_scb_chan,len_tlv,u32,
subtypedata,modern_scb_chan,tlvs,scb_tlvs,len_tlv

msgtype,static_chan_backup_with_tlvs,6137,
msgdata,static_chan_backup_with_tlvs,version,u64,
msgdata,static_chan_backup_with_tlvs,timestamp,u32,
msgdata,static_chan_backup_with_tlvs,num,u16,
msgdata,static_chan_backup_with_tlvs,channels,modern_scb_chan,num
