use std::convert::From;
#[allow(unused_imports)]
use cln_rpc::model::{responses,requests};
use cln_rpc::notifications;
use crate::pb;
use std::str::FromStr;
use bitcoin::hashes::sha256::Hash as Sha256;
use bitcoin::hashes::Hash;
use cln_rpc::primitives::PublicKey;
#[allow(unused_variables)]
impl From<responses::GetinfoAddress> for pb::GetinfoAddress {
fn from(c: responses::GetinfoAddress) -> Self {
Self {
address: c.address, port: c.port.into(), item_type: c.item_type as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::GetinfoBinding> for pb::GetinfoBinding {
fn from(c: responses::GetinfoBinding) -> Self {
Self {
address: c.address, port: c.port.map(|v| v.into()), socket: c.socket, subtype: c.subtype, item_type: c.item_type as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::GetinfoOur_features> for pb::GetinfoOurFeatures {
fn from(c: responses::GetinfoOur_features) -> Self {
Self {
channel: hex::decode(&c.channel).unwrap(), init: hex::decode(&c.init).unwrap(), invoice: hex::decode(&c.invoice).unwrap(), node: hex::decode(&c.node).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::GetinfoResponse> for pb::GetinfoResponse {
fn from(c: responses::GetinfoResponse) -> Self {
Self {
address: c.address.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), alias: c.alias, binding: c.binding.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), blockheight: c.blockheight, color: hex::decode(&c.color).unwrap(), fees_collected_msat: Some(c.fees_collected_msat.into()), id: c.id.serialize().to_vec(), lightning_dir: c.lightning_dir, network: c.network, num_active_channels: c.num_active_channels, num_inactive_channels: c.num_inactive_channels, num_peers: c.num_peers, num_pending_channels: c.num_pending_channels, our_features: c.our_features.map(|v| v.into()),
version: c.version, warning_bitcoind_sync: c.warning_bitcoind_sync, warning_lightningd_sync: c.warning_lightningd_sync, }
}
}
#[allow(unused_variables)]
impl From<responses::ListpeersPeersLog> for pb::ListpeersPeersLog {
fn from(c: responses::ListpeersPeersLog) -> Self {
Self {
data: c.data.map(|v| hex::decode(v).unwrap()), log: c.log, node_id: c.node_id.map(|v| v.serialize().to_vec()), num_skipped: c.num_skipped, source: c.source, time: c.time, item_type: c.item_type as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::ListpeersPeers> for pb::ListpeersPeers {
fn from(c: responses::ListpeersPeers) -> Self {
Self {
connected: c.connected, features: c.features.map(|v| hex::decode(v).unwrap()), id: c.id.serialize().to_vec(), log: c.log.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), netaddr: c.netaddr.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), num_channels: c.num_channels, remote_addr: c.remote_addr, }
}
}
#[allow(unused_variables)]
impl From<responses::ListpeersResponse> for pb::ListpeersResponse {
fn from(c: responses::ListpeersResponse) -> Self {
Self {
peers: c.peers.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListfundsChannels> for pb::ListfundsChannels {
fn from(c: responses::ListfundsChannels) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), channel_id: c.channel_id.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), connected: c.connected, funding_output: c.funding_output, funding_txid: hex::decode(&c.funding_txid).unwrap(), our_amount_msat: Some(c.our_amount_msat.into()), peer_id: c.peer_id.serialize().to_vec(), short_channel_id: c.short_channel_id.map(|v| v.to_string()), state: c.state as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::ListfundsOutputs> for pb::ListfundsOutputs {
fn from(c: responses::ListfundsOutputs) -> Self {
Self {
address: c.address, amount_msat: Some(c.amount_msat.into()), blockheight: c.blockheight, output: c.output, redeemscript: c.redeemscript.map(|v| hex::decode(v).unwrap()), reserved: c.reserved, reserved_to_block: c.reserved_to_block, scriptpubkey: hex::decode(&c.scriptpubkey).unwrap(), status: c.status as i32,
txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListfundsResponse> for pb::ListfundsResponse {
fn from(c: responses::ListfundsResponse) -> Self {
Self {
channels: c.channels.into_iter().map(|i| i.into()).collect(), outputs: c.outputs.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::SendpayResponse> for pb::SendpayResponse {
fn from(c: responses::SendpayResponse) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_sent_msat: Some(c.amount_sent_msat.into()), bolt11: c.bolt11, bolt12: c.bolt12, completed_at: c.completed_at, created_at: c.created_at, created_index: c.created_index, destination: c.destination.map(|v| v.serialize().to_vec()), groupid: c.groupid, id: c.id, label: c.label, message: c.message, partid: c.partid, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
updated_index: c.updated_index, }
}
}
#[allow(unused_variables)]
impl From<responses::ListchannelsChannels> for pb::ListchannelsChannels {
fn from(c: responses::ListchannelsChannels) -> Self {
Self {
active: c.active, amount_msat: Some(c.amount_msat.into()), base_fee_millisatoshi: c.base_fee_millisatoshi, channel_flags: c.channel_flags.into(), delay: c.delay, destination: c.destination.serialize().to_vec(), direction: c.direction, features: hex::decode(&c.features).unwrap(), fee_per_millionth: c.fee_per_millionth, htlc_maximum_msat: c.htlc_maximum_msat.map(|f| f.into()), htlc_minimum_msat: Some(c.htlc_minimum_msat.into()), last_update: c.last_update, message_flags: c.message_flags.into(), public: c.public, short_channel_id: c.short_channel_id.to_string(), source: c.source.serialize().to_vec(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListchannelsResponse> for pb::ListchannelsResponse {
fn from(c: responses::ListchannelsResponse) -> Self {
Self {
channels: c.channels.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::AddgossipResponse> for pb::AddgossipResponse {
fn from(c: responses::AddgossipResponse) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<responses::AddpsbtoutputResponse> for pb::AddpsbtoutputResponse {
fn from(c: responses::AddpsbtoutputResponse) -> Self {
Self {
estimated_added_weight: c.estimated_added_weight, outnum: c.outnum, psbt: c.psbt, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanonceAutocleanExpiredinvoices> for pb::AutocleanonceAutocleanExpiredinvoices {
fn from(c: responses::AutocleanonceAutocleanExpiredinvoices) -> Self {
Self {
cleaned: c.cleaned, uncleaned: c.uncleaned, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanonceAutocleanFailedforwards> for pb::AutocleanonceAutocleanFailedforwards {
fn from(c: responses::AutocleanonceAutocleanFailedforwards) -> Self {
Self {
cleaned: c.cleaned, uncleaned: c.uncleaned, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanonceAutocleanFailedpays> for pb::AutocleanonceAutocleanFailedpays {
fn from(c: responses::AutocleanonceAutocleanFailedpays) -> Self {
Self {
cleaned: c.cleaned, uncleaned: c.uncleaned, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanonceAutocleanPaidinvoices> for pb::AutocleanonceAutocleanPaidinvoices {
fn from(c: responses::AutocleanonceAutocleanPaidinvoices) -> Self {
Self {
cleaned: c.cleaned, uncleaned: c.uncleaned, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanonceAutocleanSucceededforwards> for pb::AutocleanonceAutocleanSucceededforwards {
fn from(c: responses::AutocleanonceAutocleanSucceededforwards) -> Self {
Self {
cleaned: c.cleaned, uncleaned: c.uncleaned, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanonceAutocleanSucceededpays> for pb::AutocleanonceAutocleanSucceededpays {
fn from(c: responses::AutocleanonceAutocleanSucceededpays) -> Self {
Self {
cleaned: c.cleaned, uncleaned: c.uncleaned, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanonceAutoclean> for pb::AutocleanonceAutoclean {
fn from(c: responses::AutocleanonceAutoclean) -> Self {
Self {
expiredinvoices: c.expiredinvoices.map(|v| v.into()),
failedforwards: c.failedforwards.map(|v| v.into()),
failedpays: c.failedpays.map(|v| v.into()),
paidinvoices: c.paidinvoices.map(|v| v.into()),
succeededforwards: c.succeededforwards.map(|v| v.into()),
succeededpays: c.succeededpays.map(|v| v.into()),
}
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanonceResponse> for pb::AutocleanonceResponse {
fn from(c: responses::AutocleanonceResponse) -> Self {
Self {
autoclean: Some(c.autoclean.into()),
}
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanstatusAutocleanExpiredinvoices> for pb::AutocleanstatusAutocleanExpiredinvoices {
fn from(c: responses::AutocleanstatusAutocleanExpiredinvoices) -> Self {
Self {
age: c.age, cleaned: c.cleaned, enabled: c.enabled, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanstatusAutocleanFailedforwards> for pb::AutocleanstatusAutocleanFailedforwards {
fn from(c: responses::AutocleanstatusAutocleanFailedforwards) -> Self {
Self {
age: c.age, cleaned: c.cleaned, enabled: c.enabled, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanstatusAutocleanFailedpays> for pb::AutocleanstatusAutocleanFailedpays {
fn from(c: responses::AutocleanstatusAutocleanFailedpays) -> Self {
Self {
age: c.age, cleaned: c.cleaned, enabled: c.enabled, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanstatusAutocleanPaidinvoices> for pb::AutocleanstatusAutocleanPaidinvoices {
fn from(c: responses::AutocleanstatusAutocleanPaidinvoices) -> Self {
Self {
age: c.age, cleaned: c.cleaned, enabled: c.enabled, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanstatusAutocleanSucceededforwards> for pb::AutocleanstatusAutocleanSucceededforwards {
fn from(c: responses::AutocleanstatusAutocleanSucceededforwards) -> Self {
Self {
age: c.age, cleaned: c.cleaned, enabled: c.enabled, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanstatusAutocleanSucceededpays> for pb::AutocleanstatusAutocleanSucceededpays {
fn from(c: responses::AutocleanstatusAutocleanSucceededpays) -> Self {
Self {
age: c.age, cleaned: c.cleaned, enabled: c.enabled, }
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanstatusAutoclean> for pb::AutocleanstatusAutoclean {
fn from(c: responses::AutocleanstatusAutoclean) -> Self {
Self {
expiredinvoices: c.expiredinvoices.map(|v| v.into()),
failedforwards: c.failedforwards.map(|v| v.into()),
failedpays: c.failedpays.map(|v| v.into()),
paidinvoices: c.paidinvoices.map(|v| v.into()),
succeededforwards: c.succeededforwards.map(|v| v.into()),
succeededpays: c.succeededpays.map(|v| v.into()),
}
}
}
#[allow(unused_variables)]
impl From<responses::AutocleanstatusResponse> for pb::AutocleanstatusResponse {
fn from(c: responses::AutocleanstatusResponse) -> Self {
Self {
autoclean: Some(c.autoclean.into()),
}
}
}
#[allow(unused_variables)]
impl From<responses::CheckmessageResponse> for pb::CheckmessageResponse {
fn from(c: responses::CheckmessageResponse) -> Self {
Self {
pubkey: c.pubkey.serialize().to_vec(), verified: c.verified, }
}
}
#[allow(unused_variables)]
impl From<responses::CloseResponse> for pb::CloseResponse {
fn from(c: responses::CloseResponse) -> Self {
Self {
tx: c.tx.map(|v| hex::decode(v).unwrap()), txid: c.txid.map(|v| hex::decode(v).unwrap()), item_type: c.item_type as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::ConnectAddress> for pb::ConnectAddress {
fn from(c: responses::ConnectAddress) -> Self {
Self {
address: c.address, port: c.port.map(|v| v.into()), socket: c.socket, item_type: c.item_type as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::ConnectResponse> for pb::ConnectResponse {
fn from(c: responses::ConnectResponse) -> Self {
Self {
address: Some(c.address.into()),
direction: c.direction as i32,
features: hex::decode(&c.features).unwrap(), id: c.id.serialize().to_vec(), }
}
}
#[allow(unused_variables)]
impl From<responses::CreateinvoicePaid_outpoint> for pb::CreateinvoicePaidOutpoint {
fn from(c: responses::CreateinvoicePaid_outpoint) -> Self {
Self {
outnum: c.outnum, txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::CreateinvoiceResponse> for pb::CreateinvoiceResponse {
fn from(c: responses::CreateinvoiceResponse) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_received_msat: c.amount_received_msat.map(|f| f.into()), bolt11: c.bolt11, bolt12: c.bolt12, created_index: c.created_index, description: c.description, expires_at: c.expires_at, invreq_payer_note: c.invreq_payer_note, label: c.label, local_offer_id: c.local_offer_id.map(|v| hex::decode(v).unwrap()), paid_at: c.paid_at, paid_outpoint: c.paid_outpoint.map(|v| v.into()),
pay_index: c.pay_index, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::DatastoreResponse> for pb::DatastoreResponse {
fn from(c: responses::DatastoreResponse) -> Self {
Self {
generation: c.generation, hex: c.hex.map(|v| hex::decode(v).unwrap()), key: c.key.into_iter().map(|i| i.into()).collect(), string: c.string, }
}
}
#[allow(unused_variables)]
impl From<responses::DatastoreusageDatastoreusage> for pb::DatastoreusageDatastoreusage {
fn from(c: responses::DatastoreusageDatastoreusage) -> Self {
Self {
key: c.key, total_bytes: c.total_bytes, }
}
}
#[allow(unused_variables)]
impl From<responses::DatastoreusageResponse> for pb::DatastoreusageResponse {
fn from(c: responses::DatastoreusageResponse) -> Self {
Self {
datastoreusage: Some(c.datastoreusage.into()),
}
}
}
#[allow(unused_variables)]
impl From<responses::CreateonionResponse> for pb::CreateonionResponse {
fn from(c: responses::CreateonionResponse) -> Self {
Self {
onion: hex::decode(&c.onion).unwrap(), shared_secrets: c.shared_secrets.into_iter().map(|i| i.to_vec()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::DeldatastoreResponse> for pb::DeldatastoreResponse {
fn from(c: responses::DeldatastoreResponse) -> Self {
Self {
generation: c.generation, hex: c.hex.map(|v| hex::decode(v).unwrap()), key: c.key.into_iter().map(|i| i.into()).collect(), string: c.string, }
}
}
#[allow(unused_variables)]
impl From<responses::DelinvoiceResponse> for pb::DelinvoiceResponse {
fn from(c: responses::DelinvoiceResponse) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_received_msat: c.amount_received_msat.map(|f| f.into()), bolt11: c.bolt11, bolt12: c.bolt12, created_index: c.created_index, description: c.description, expires_at: c.expires_at, invreq_payer_note: c.invreq_payer_note, label: c.label, local_offer_id: c.local_offer_id.map(|v| hex::decode(v).unwrap()), paid_at: c.paid_at, pay_index: c.pay_index, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
updated_index: c.updated_index, }
}
}
#[allow(unused_variables)]
impl From<responses::DevforgetchannelResponse> for pb::DevforgetchannelResponse {
fn from(c: responses::DevforgetchannelResponse) -> Self {
Self {
forced: c.forced, funding_txid: hex::decode(&c.funding_txid).unwrap(), funding_unspent: c.funding_unspent, }
}
}
#[allow(unused_variables)]
impl From<responses::EmergencyrecoverResponse> for pb::EmergencyrecoverResponse {
fn from(c: responses::EmergencyrecoverResponse) -> Self {
Self {
stubs: c.stubs.into_iter().map(|i| <Sha256 as AsRef<[u8]>>::as_ref(&i).to_vec()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::RecoverResponse> for pb::RecoverResponse {
fn from(c: responses::RecoverResponse) -> Self {
Self {
result: c.result.map(|v| v as i32),
}
}
}
#[allow(unused_variables)]
impl From<responses::RecoverchannelResponse> for pb::RecoverchannelResponse {
fn from(c: responses::RecoverchannelResponse) -> Self {
Self {
stubs: c.stubs.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::InvoiceResponse> for pb::InvoiceResponse {
fn from(c: responses::InvoiceResponse) -> Self {
Self {
bolt11: c.bolt11, created_index: c.created_index, expires_at: c.expires_at, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_secret: c.payment_secret.to_vec(), warning_capacity: c.warning_capacity, warning_deadends: c.warning_deadends, warning_mpp: c.warning_mpp, warning_offline: c.warning_offline, warning_private_unused: c.warning_private_unused, }
}
}
#[allow(unused_variables)]
impl From<responses::InvoicerequestResponse> for pb::InvoicerequestResponse {
fn from(c: responses::InvoicerequestResponse) -> Self {
Self {
active: c.active, bolt12: c.bolt12, invreq_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.invreq_id).to_vec(), label: c.label, single_use: c.single_use, used: c.used, }
}
}
#[allow(unused_variables)]
impl From<responses::DisableinvoicerequestResponse> for pb::DisableinvoicerequestResponse {
fn from(c: responses::DisableinvoicerequestResponse) -> Self {
Self {
active: c.active, bolt12: c.bolt12, invreq_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.invreq_id).to_vec(), label: c.label, single_use: c.single_use, used: c.used, }
}
}
#[allow(unused_variables)]
impl From<responses::ListinvoicerequestsInvoicerequests> for pb::ListinvoicerequestsInvoicerequests {
fn from(c: responses::ListinvoicerequestsInvoicerequests) -> Self {
Self {
active: c.active, bolt12: c.bolt12, invreq_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.invreq_id).to_vec(), label: c.label, single_use: c.single_use, used: c.used, }
}
}
#[allow(unused_variables)]
impl From<responses::ListinvoicerequestsResponse> for pb::ListinvoicerequestsResponse {
fn from(c: responses::ListinvoicerequestsResponse) -> Self {
Self {
invoicerequests: c.invoicerequests.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListdatastoreDatastore> for pb::ListdatastoreDatastore {
fn from(c: responses::ListdatastoreDatastore) -> Self {
Self {
generation: c.generation, hex: c.hex.map(|v| hex::decode(v).unwrap()), key: c.key.into_iter().map(|i| i.into()).collect(), string: c.string, }
}
}
#[allow(unused_variables)]
impl From<responses::ListdatastoreResponse> for pb::ListdatastoreResponse {
fn from(c: responses::ListdatastoreResponse) -> Self {
Self {
datastore: c.datastore.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListinvoicesInvoicesPaid_outpoint> for pb::ListinvoicesInvoicesPaidOutpoint {
fn from(c: responses::ListinvoicesInvoicesPaid_outpoint) -> Self {
Self {
outnum: c.outnum, txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListinvoicesInvoices> for pb::ListinvoicesInvoices {
fn from(c: responses::ListinvoicesInvoices) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_received_msat: c.amount_received_msat.map(|f| f.into()), bolt11: c.bolt11, bolt12: c.bolt12, created_index: c.created_index, description: c.description, expires_at: c.expires_at, invreq_payer_note: c.invreq_payer_note, label: c.label, local_offer_id: c.local_offer_id.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), paid_at: c.paid_at, paid_outpoint: c.paid_outpoint.map(|v| v.into()),
pay_index: c.pay_index, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
updated_index: c.updated_index, }
}
}
#[allow(unused_variables)]
impl From<responses::ListinvoicesResponse> for pb::ListinvoicesResponse {
fn from(c: responses::ListinvoicesResponse) -> Self {
Self {
invoices: c.invoices.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::SendonionResponse> for pb::SendonionResponse {
fn from(c: responses::SendonionResponse) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_sent_msat: Some(c.amount_sent_msat.into()), bolt11: c.bolt11, bolt12: c.bolt12, created_at: c.created_at, created_index: c.created_index, destination: c.destination.map(|v| v.serialize().to_vec()), id: c.id, label: c.label, message: c.message, partid: c.partid, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
updated_index: c.updated_index, }
}
}
#[allow(unused_variables)]
impl From<responses::ListsendpaysPayments> for pb::ListsendpaysPayments {
fn from(c: responses::ListsendpaysPayments) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_sent_msat: Some(c.amount_sent_msat.into()), bolt11: c.bolt11, bolt12: c.bolt12, completed_at: c.completed_at, created_at: c.created_at, created_index: c.created_index, description: c.description, destination: c.destination.map(|v| v.serialize().to_vec()), erroronion: c.erroronion.map(|v| hex::decode(v).unwrap()), groupid: c.groupid, id: c.id, label: c.label, partid: c.partid, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
updated_index: c.updated_index, }
}
}
#[allow(unused_variables)]
impl From<responses::ListsendpaysResponse> for pb::ListsendpaysResponse {
fn from(c: responses::ListsendpaysResponse) -> Self {
Self {
payments: c.payments.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListtransactionsTransactionsInputs> for pb::ListtransactionsTransactionsInputs {
fn from(c: responses::ListtransactionsTransactionsInputs) -> Self {
Self {
index: c.index, sequence: c.sequence, txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListtransactionsTransactionsOutputs> for pb::ListtransactionsTransactionsOutputs {
fn from(c: responses::ListtransactionsTransactionsOutputs) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), index: c.index, script_pub_key: hex::decode(&c.script_pub_key).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListtransactionsTransactions> for pb::ListtransactionsTransactions {
fn from(c: responses::ListtransactionsTransactions) -> Self {
Self {
blockheight: c.blockheight, hash: hex::decode(&c.hash).unwrap(), inputs: c.inputs.into_iter().map(|i| i.into()).collect(), locktime: c.locktime, outputs: c.outputs.into_iter().map(|i| i.into()).collect(), rawtx: hex::decode(&c.rawtx).unwrap(), txindex: c.txindex, version: c.version, }
}
}
#[allow(unused_variables)]
impl From<responses::ListtransactionsResponse> for pb::ListtransactionsResponse {
fn from(c: responses::ListtransactionsResponse) -> Self {
Self {
transactions: c.transactions.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::MakesecretResponse> for pb::MakesecretResponse {
fn from(c: responses::MakesecretResponse) -> Self {
Self {
secret: c.secret.to_vec(), }
}
}
#[allow(unused_variables)]
impl From<responses::PayResponse> for pb::PayResponse {
fn from(c: responses::PayResponse) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), amount_sent_msat: Some(c.amount_sent_msat.into()), created_at: c.created_at, destination: c.destination.map(|v| v.serialize().to_vec()), parts: c.parts, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.to_vec(), status: c.status as i32,
warning_partial_completion: c.warning_partial_completion, }
}
}
#[allow(unused_variables)]
impl From<responses::ListnodesNodesAddresses> for pb::ListnodesNodesAddresses {
fn from(c: responses::ListnodesNodesAddresses) -> Self {
Self {
address: c.address, port: c.port.into(), item_type: c.item_type as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::ListnodesNodesOption_will_fund> for pb::ListnodesNodesOptionWillFund {
fn from(c: responses::ListnodesNodesOption_will_fund) -> Self {
Self {
channel_fee_max_base_msat: Some(c.channel_fee_max_base_msat.into()), channel_fee_max_proportional_thousandths: c.channel_fee_max_proportional_thousandths, compact_lease: hex::decode(&c.compact_lease).unwrap(), funding_weight: c.funding_weight, lease_fee_base_msat: Some(c.lease_fee_base_msat.into()), lease_fee_basis: c.lease_fee_basis, }
}
}
#[allow(unused_variables)]
impl From<responses::ListnodesNodes> for pb::ListnodesNodes {
fn from(c: responses::ListnodesNodes) -> Self {
Self {
addresses: c.addresses.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), alias: c.alias, color: c.color.map(|v| hex::decode(v).unwrap()), features: c.features.map(|v| hex::decode(v).unwrap()), last_timestamp: c.last_timestamp, nodeid: c.nodeid.serialize().to_vec(), option_will_fund: c.option_will_fund.map(|v| v.into()),
}
}
}
#[allow(unused_variables)]
impl From<responses::ListnodesResponse> for pb::ListnodesResponse {
fn from(c: responses::ListnodesResponse) -> Self {
Self {
nodes: c.nodes.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::WaitanyinvoicePaid_outpoint> for pb::WaitanyinvoicePaidOutpoint {
fn from(c: responses::WaitanyinvoicePaid_outpoint) -> Self {
Self {
outnum: c.outnum, txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::WaitanyinvoiceResponse> for pb::WaitanyinvoiceResponse {
fn from(c: responses::WaitanyinvoiceResponse) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_received_msat: c.amount_received_msat.map(|f| f.into()), bolt11: c.bolt11, bolt12: c.bolt12, created_index: c.created_index, description: c.description, expires_at: c.expires_at, label: c.label, paid_at: c.paid_at, paid_outpoint: c.paid_outpoint.map(|v| v.into()),
pay_index: c.pay_index, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
updated_index: c.updated_index, }
}
}
#[allow(unused_variables)]
impl From<responses::WaitinvoicePaid_outpoint> for pb::WaitinvoicePaidOutpoint {
fn from(c: responses::WaitinvoicePaid_outpoint) -> Self {
Self {
outnum: c.outnum, txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::WaitinvoiceResponse> for pb::WaitinvoiceResponse {
fn from(c: responses::WaitinvoiceResponse) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_received_msat: c.amount_received_msat.map(|f| f.into()), bolt11: c.bolt11, bolt12: c.bolt12, created_index: c.created_index, description: c.description, expires_at: c.expires_at, label: c.label, paid_at: c.paid_at, paid_outpoint: c.paid_outpoint.map(|v| v.into()),
pay_index: c.pay_index, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
updated_index: c.updated_index, }
}
}
#[allow(unused_variables)]
impl From<responses::WaitsendpayResponse> for pb::WaitsendpayResponse {
fn from(c: responses::WaitsendpayResponse) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_sent_msat: Some(c.amount_sent_msat.into()), bolt11: c.bolt11, bolt12: c.bolt12, completed_at: c.completed_at, created_at: c.created_at, created_index: c.created_index, destination: c.destination.map(|v| v.serialize().to_vec()), groupid: c.groupid, id: c.id, label: c.label, partid: c.partid, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
updated_index: c.updated_index, }
}
}
#[allow(unused_variables)]
impl From<responses::NewaddrResponse> for pb::NewaddrResponse {
fn from(c: responses::NewaddrResponse) -> Self {
Self {
bech32: c.bech32, p2tr: c.p2tr, }
}
}
#[allow(unused_variables)]
impl From<responses::WithdrawResponse> for pb::WithdrawResponse {
fn from(c: responses::WithdrawResponse) -> Self {
Self {
psbt: c.psbt, tx: hex::decode(&c.tx).unwrap(), txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::KeysendResponse> for pb::KeysendResponse {
fn from(c: responses::KeysendResponse) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), amount_sent_msat: Some(c.amount_sent_msat.into()), created_at: c.created_at, destination: c.destination.map(|v| v.serialize().to_vec()), parts: c.parts, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.to_vec(), status: c.status as i32,
warning_partial_completion: c.warning_partial_completion, }
}
}
#[allow(unused_variables)]
impl From<responses::FundpsbtReservations> for pb::FundpsbtReservations {
fn from(c: responses::FundpsbtReservations) -> Self {
Self {
reserved: c.reserved, reserved_to_block: c.reserved_to_block, txid: hex::decode(&c.txid).unwrap(), vout: c.vout, was_reserved: c.was_reserved, }
}
}
#[allow(unused_variables)]
impl From<responses::FundpsbtResponse> for pb::FundpsbtResponse {
fn from(c: responses::FundpsbtResponse) -> Self {
Self {
change_outnum: c.change_outnum, estimated_final_weight: c.estimated_final_weight, excess_msat: Some(c.excess_msat.into()), feerate_per_kw: c.feerate_per_kw, psbt: c.psbt, reservations: c.reservations.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), }
}
}
#[allow(unused_variables)]
impl From<responses::SendpsbtResponse> for pb::SendpsbtResponse {
fn from(c: responses::SendpsbtResponse) -> Self {
Self {
tx: hex::decode(&c.tx).unwrap(), txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::SignpsbtResponse> for pb::SignpsbtResponse {
fn from(c: responses::SignpsbtResponse) -> Self {
Self {
signed_psbt: c.signed_psbt, }
}
}
#[allow(unused_variables)]
impl From<responses::UtxopsbtReservations> for pb::UtxopsbtReservations {
fn from(c: responses::UtxopsbtReservations) -> Self {
Self {
reserved: c.reserved, reserved_to_block: c.reserved_to_block, txid: hex::decode(&c.txid).unwrap(), vout: c.vout, was_reserved: c.was_reserved, }
}
}
#[allow(unused_variables)]
impl From<responses::UtxopsbtResponse> for pb::UtxopsbtResponse {
fn from(c: responses::UtxopsbtResponse) -> Self {
Self {
change_outnum: c.change_outnum, estimated_final_weight: c.estimated_final_weight, excess_msat: Some(c.excess_msat.into()), feerate_per_kw: c.feerate_per_kw, psbt: c.psbt, reservations: c.reservations.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), }
}
}
#[allow(unused_variables)]
impl From<responses::TxdiscardResponse> for pb::TxdiscardResponse {
fn from(c: responses::TxdiscardResponse) -> Self {
Self {
txid: hex::decode(&c.txid).unwrap(), unsigned_tx: hex::decode(&c.unsigned_tx).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::TxprepareResponse> for pb::TxprepareResponse {
fn from(c: responses::TxprepareResponse) -> Self {
Self {
psbt: c.psbt, txid: hex::decode(&c.txid).unwrap(), unsigned_tx: hex::decode(&c.unsigned_tx).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::TxsendResponse> for pb::TxsendResponse {
fn from(c: responses::TxsendResponse) -> Self {
Self {
psbt: c.psbt, tx: hex::decode(&c.tx).unwrap(), txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListpeerchannelsChannelsAlias> for pb::ListpeerchannelsChannelsAlias {
fn from(c: responses::ListpeerchannelsChannelsAlias) -> Self {
Self {
local: c.local.map(|v| v.to_string()), remote: c.remote.map(|v| v.to_string()), }
}
}
#[allow(unused_variables)]
impl From<responses::ListpeerchannelsChannelsFeerate> for pb::ListpeerchannelsChannelsFeerate {
fn from(c: responses::ListpeerchannelsChannelsFeerate) -> Self {
Self {
perkb: c.perkb, perkw: c.perkw, }
}
}
#[allow(unused_variables)]
impl From<responses::ListpeerchannelsChannelsFunding> for pb::ListpeerchannelsChannelsFunding {
fn from(c: responses::ListpeerchannelsChannelsFunding) -> Self {
Self {
fee_paid_msat: c.fee_paid_msat.map(|f| f.into()), fee_rcvd_msat: c.fee_rcvd_msat.map(|f| f.into()), local_funds_msat: Some(c.local_funds_msat.into()), pushed_msat: c.pushed_msat.map(|f| f.into()), remote_funds_msat: Some(c.remote_funds_msat.into()), }
}
}
#[allow(unused_variables)]
impl From<responses::ListpeerchannelsChannelsHtlcs> for pb::ListpeerchannelsChannelsHtlcs {
fn from(c: responses::ListpeerchannelsChannelsHtlcs) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), direction: c.direction as i32,
expiry: c.expiry, id: c.id, local_trimmed: c.local_trimmed, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), state: c.state as i32,
status: c.status, }
}
}
#[allow(unused_variables)]
impl From<responses::ListpeerchannelsChannelsInflight> for pb::ListpeerchannelsChannelsInflight {
fn from(c: responses::ListpeerchannelsChannelsInflight) -> Self {
Self {
feerate: c.feerate, funding_outnum: c.funding_outnum, funding_txid: hex::decode(&c.funding_txid).unwrap(), our_funding_msat: Some(c.our_funding_msat.into()), scratch_txid: c.scratch_txid.map(|v| hex::decode(v).unwrap()), splice_amount: c.splice_amount, total_funding_msat: Some(c.total_funding_msat.into()), }
}
}
#[allow(unused_variables)]
impl From<responses::ListpeerchannelsChannelsUpdatesLocal> for pb::ListpeerchannelsChannelsUpdatesLocal {
fn from(c: responses::ListpeerchannelsChannelsUpdatesLocal) -> Self {
Self {
cltv_expiry_delta: c.cltv_expiry_delta, fee_base_msat: Some(c.fee_base_msat.into()), fee_proportional_millionths: c.fee_proportional_millionths, htlc_maximum_msat: Some(c.htlc_maximum_msat.into()), htlc_minimum_msat: Some(c.htlc_minimum_msat.into()), }
}
}
#[allow(unused_variables)]
impl From<responses::ListpeerchannelsChannelsUpdatesRemote> for pb::ListpeerchannelsChannelsUpdatesRemote {
fn from(c: responses::ListpeerchannelsChannelsUpdatesRemote) -> Self {
Self {
cltv_expiry_delta: c.cltv_expiry_delta, fee_base_msat: Some(c.fee_base_msat.into()), fee_proportional_millionths: c.fee_proportional_millionths, htlc_maximum_msat: Some(c.htlc_maximum_msat.into()), htlc_minimum_msat: Some(c.htlc_minimum_msat.into()), }
}
}
#[allow(unused_variables)]
impl From<responses::ListpeerchannelsChannelsUpdates> for pb::ListpeerchannelsChannelsUpdates {
fn from(c: responses::ListpeerchannelsChannelsUpdates) -> Self {
Self {
local: Some(c.local.into()),
remote: c.remote.map(|v| v.into()),
}
}
}
#[allow(unused_variables)]
impl From<responses::ListpeerchannelsChannels> for pb::ListpeerchannelsChannels {
fn from(c: responses::ListpeerchannelsChannels) -> Self {
Self {
alias: c.alias.map(|v| v.into()),
channel_id: c.channel_id.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), close_to: c.close_to.map(|v| hex::decode(v).unwrap()), close_to_addr: c.close_to_addr, closer: c.closer.map(|v| v as i32),
direction: c.direction, dust_limit_msat: c.dust_limit_msat.map(|f| f.into()), fee_base_msat: c.fee_base_msat.map(|f| f.into()), fee_proportional_millionths: c.fee_proportional_millionths, feerate: c.feerate.map(|v| v.into()),
funding: c.funding.map(|v| v.into()),
funding_outnum: c.funding_outnum, funding_txid: c.funding_txid.map(|v| hex::decode(v).unwrap()), htlcs: c.htlcs.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), ignore_fee_limits: c.ignore_fee_limits, in_fulfilled_msat: c.in_fulfilled_msat.map(|f| f.into()), in_offered_msat: c.in_offered_msat.map(|f| f.into()), in_payments_fulfilled: c.in_payments_fulfilled, in_payments_offered: c.in_payments_offered, inflight: c.inflight.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), initial_feerate: c.initial_feerate, last_feerate: c.last_feerate, last_stable_connection: c.last_stable_connection, last_tx_fee_msat: c.last_tx_fee_msat.map(|f| f.into()), lost_state: c.lost_state, max_accepted_htlcs: c.max_accepted_htlcs, max_to_us_msat: c.max_to_us_msat.map(|f| f.into()), max_total_htlc_in_msat: c.max_total_htlc_in_msat.map(|f| f.into()), maximum_htlc_out_msat: c.maximum_htlc_out_msat.map(|f| f.into()), min_to_us_msat: c.min_to_us_msat.map(|f| f.into()), minimum_htlc_in_msat: c.minimum_htlc_in_msat.map(|f| f.into()), minimum_htlc_out_msat: c.minimum_htlc_out_msat.map(|f| f.into()), next_fee_step: c.next_fee_step, next_feerate: c.next_feerate, opener: c.opener as i32,
our_reserve_msat: c.our_reserve_msat.map(|f| f.into()), our_to_self_delay: c.our_to_self_delay, out_fulfilled_msat: c.out_fulfilled_msat.map(|f| f.into()), out_offered_msat: c.out_offered_msat.map(|f| f.into()), out_payments_fulfilled: c.out_payments_fulfilled, out_payments_offered: c.out_payments_offered, owner: c.owner, peer_connected: c.peer_connected, peer_id: c.peer_id.serialize().to_vec(), private: c.private, receivable_msat: c.receivable_msat.map(|f| f.into()), reestablished: c.reestablished, scratch_txid: c.scratch_txid.map(|v| hex::decode(v).unwrap()), short_channel_id: c.short_channel_id.map(|v| v.to_string()), spendable_msat: c.spendable_msat.map(|f| f.into()), state: c.state as i32,
status: c.status.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), their_reserve_msat: c.their_reserve_msat.map(|f| f.into()), their_to_self_delay: c.their_to_self_delay, to_us_msat: c.to_us_msat.map(|f| f.into()), total_msat: c.total_msat.map(|f| f.into()), updates: c.updates.map(|v| v.into()),
}
}
}
#[allow(unused_variables)]
impl From<responses::ListpeerchannelsResponse> for pb::ListpeerchannelsResponse {
fn from(c: responses::ListpeerchannelsResponse) -> Self {
Self {
channels: c.channels.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListclosedchannelsClosedchannelsAlias> for pb::ListclosedchannelsClosedchannelsAlias {
fn from(c: responses::ListclosedchannelsClosedchannelsAlias) -> Self {
Self {
local: c.local.map(|v| v.to_string()), remote: c.remote.map(|v| v.to_string()), }
}
}
#[allow(unused_variables)]
impl From<responses::ListclosedchannelsClosedchannels> for pb::ListclosedchannelsClosedchannels {
fn from(c: responses::ListclosedchannelsClosedchannels) -> Self {
Self {
alias: c.alias.map(|v| v.into()),
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), close_cause: c.close_cause as i32,
closer: c.closer.map(|v| v as i32),
final_to_us_msat: Some(c.final_to_us_msat.into()), funding_fee_paid_msat: c.funding_fee_paid_msat.map(|f| f.into()), funding_fee_rcvd_msat: c.funding_fee_rcvd_msat.map(|f| f.into()), funding_outnum: c.funding_outnum, funding_pushed_msat: c.funding_pushed_msat.map(|f| f.into()), funding_txid: hex::decode(&c.funding_txid).unwrap(), last_commitment_fee_msat: c.last_commitment_fee_msat.map(|f| f.into()), last_commitment_txid: c.last_commitment_txid.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), last_stable_connection: c.last_stable_connection, leased: c.leased, max_to_us_msat: Some(c.max_to_us_msat.into()), min_to_us_msat: Some(c.min_to_us_msat.into()), opener: c.opener as i32,
peer_id: c.peer_id.map(|v| v.serialize().to_vec()), private: c.private, short_channel_id: c.short_channel_id.map(|v| v.to_string()), total_htlcs_sent: c.total_htlcs_sent, total_local_commitments: c.total_local_commitments, total_msat: Some(c.total_msat.into()), total_remote_commitments: c.total_remote_commitments, }
}
}
#[allow(unused_variables)]
impl From<responses::ListclosedchannelsResponse> for pb::ListclosedchannelsResponse {
fn from(c: responses::ListclosedchannelsResponse) -> Self {
Self {
closedchannels: c.closedchannels.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::DecodepayExtra> for pb::DecodepayExtra {
fn from(c: responses::DecodepayExtra) -> Self {
Self {
data: c.data, tag: c.tag, }
}
}
#[allow(unused_variables)]
impl From<responses::DecodepayFallbacks> for pb::DecodepayFallbacks {
fn from(c: responses::DecodepayFallbacks) -> Self {
Self {
addr: c.addr, hex: hex::decode(&c.hex).unwrap(), item_type: c.item_type as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::DecodepayResponse> for pb::DecodepayResponse {
fn from(c: responses::DecodepayResponse) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), created_at: c.created_at, currency: c.currency, description: c.description, description_hash: c.description_hash.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), expiry: c.expiry, extra: c.extra.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), fallbacks: c.fallbacks.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), features: c.features.map(|v| hex::decode(v).unwrap()), min_final_cltv_expiry: c.min_final_cltv_expiry, payee: c.payee.serialize().to_vec(), payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_metadata: c.payment_metadata.map(|v| hex::decode(v).unwrap()), payment_secret: c.payment_secret.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), routes: c.routes.map(|drl| drl.into()), signature: c.signature, }
}
}
#[allow(unused_variables)]
impl From<responses::DecodeExtra> for pb::DecodeExtra {
fn from(c: responses::DecodeExtra) -> Self {
Self {
data: c.data, tag: c.tag, }
}
}
#[allow(unused_variables)]
impl From<responses::DecodeFallbacks> for pb::DecodeFallbacks {
fn from(c: responses::DecodeFallbacks) -> Self {
Self {
addr: c.addr, hex: hex::decode(&c.hex).unwrap(), item_type: c.item_type as i32,
warning_invoice_fallbacks_version_invalid: c.warning_invoice_fallbacks_version_invalid, }
}
}
#[allow(unused_variables)]
impl From<responses::DecodeInvoice_fallbacks> for pb::DecodeInvoiceFallbacks {
fn from(c: responses::DecodeInvoice_fallbacks) -> Self {
Self {
address: c.address, hex: hex::decode(&c.hex).unwrap(), version: c.version.into(), }
}
}
#[allow(unused_variables)]
impl From<responses::DecodeInvreq_pathsPath> for pb::DecodeInvreqPathsPath {
fn from(c: responses::DecodeInvreq_pathsPath) -> Self {
Self {
blinded_node_id: c.blinded_node_id.serialize().to_vec(), encrypted_recipient_data: hex::decode(&c.encrypted_recipient_data).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::DecodeInvreq_paths> for pb::DecodeInvreqPaths {
fn from(c: responses::DecodeInvreq_paths) -> Self {
Self {
blinding: c.blinding.serialize().to_vec(), first_node_id: c.first_node_id.map(|v| v.serialize().to_vec()), first_scid: c.first_scid.map(|v| v.to_string()), first_scid_dir: c.first_scid_dir, path: c.path.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::DecodeOffer_paths> for pb::DecodeOfferPaths {
fn from(c: responses::DecodeOffer_paths) -> Self {
Self {
blinding: c.blinding.serialize().to_vec(), first_node_id: c.first_node_id.map(|v| v.serialize().to_vec()), first_scid: c.first_scid.map(|v| v.to_string()), first_scid_dir: c.first_scid_dir, }
}
}
#[allow(unused_variables)]
impl From<responses::DecodeRestrictions> for pb::DecodeRestrictions {
fn from(c: responses::DecodeRestrictions) -> Self {
Self {
alternatives: c.alternatives.into_iter().map(|i| i.into()).collect(), summary: c.summary, }
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::DecodeResponse> for pb::DecodeResponse {
fn from(c: responses::DecodeResponse) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), created_at: c.created_at, currency: c.currency, currency_minor_unit: c.currency_minor_unit, decrypted: c.decrypted.map(|v| hex::decode(v).unwrap()), description: c.description, description_hash: c.description_hash.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), expiry: c.expiry, extra: c.extra.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), fallbacks: c.fallbacks.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), features: c.features.map(|v| hex::decode(v).unwrap()), hex: c.hex.map(|v| hex::decode(v).unwrap()), invoice_amount_msat: c.invoice_amount_msat.map(|f| f.into()), invoice_created_at: c.invoice_created_at, invoice_fallbacks: c.invoice_fallbacks.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), invoice_features: c.invoice_features.map(|v| hex::decode(v).unwrap()), invoice_node_id: c.invoice_node_id.map(|v| v.serialize().to_vec()), invoice_payment_hash: c.invoice_payment_hash.map(|v| hex::decode(v).unwrap()), invoice_recurrence_basetime: c.invoice_recurrence_basetime, invoice_relative_expiry: c.invoice_relative_expiry, invreq_amount_msat: c.invreq_amount_msat.map(|f| f.into()), invreq_chain: c.invreq_chain.map(|v| hex::decode(v).unwrap()), invreq_features: c.invreq_features.map(|v| hex::decode(v).unwrap()), invreq_metadata: c.invreq_metadata.map(|v| hex::decode(v).unwrap()), invreq_paths: c.invreq_paths.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), invreq_payer_id: c.invreq_payer_id.map(|v| hex::decode(v).unwrap()), invreq_payer_note: c.invreq_payer_note, invreq_quantity: c.invreq_quantity, invreq_recurrence_counter: c.invreq_recurrence_counter, invreq_recurrence_start: c.invreq_recurrence_start, min_final_cltv_expiry: c.min_final_cltv_expiry, offer_absolute_expiry: c.offer_absolute_expiry, offer_amount: c.offer_amount, offer_amount_msat: c.offer_amount_msat.map(|f| f.into()), offer_chains: c.offer_chains.map(|arr| arr.into_iter().map(|i| <Sha256 as AsRef<[u8]>>::as_ref(&i).to_vec()).collect()).unwrap_or(vec![]), offer_currency: c.offer_currency, offer_description: c.offer_description, offer_features: c.offer_features.map(|v| hex::decode(v).unwrap()), offer_id: c.offer_id.map(|v| hex::decode(v).unwrap()), offer_issuer: c.offer_issuer, offer_issuer_id: c.offer_issuer_id.map(|v| v.serialize().to_vec()), offer_metadata: c.offer_metadata.map(|v| hex::decode(v).unwrap()), #[allow(deprecated)]
offer_node_id: c.offer_node_id.map(|v| v.serialize().to_vec()), offer_paths: c.offer_paths.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), offer_quantity_max: c.offer_quantity_max, payee: c.payee.map(|v| v.serialize().to_vec()), payment_hash: c.payment_hash.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), payment_metadata: c.payment_metadata.map(|v| hex::decode(v).unwrap()), payment_secret: c.payment_secret.map(|v| v.to_vec()), restrictions: c.restrictions.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), routes: c.routes.map(|drl| drl.into()), signature: c.signature, string: c.string, item_type: c.item_type as i32,
unique_id: c.unique_id, valid: c.valid, version: c.version, warning_empty_blinded_path: c.warning_empty_blinded_path, warning_invalid_invoice_request_signature: c.warning_invalid_invoice_request_signature, warning_invalid_invoice_signature: c.warning_invalid_invoice_signature, warning_invalid_invreq_payer_note: c.warning_invalid_invreq_payer_note, warning_invalid_offer_currency: c.warning_invalid_offer_currency, warning_invalid_offer_description: c.warning_invalid_offer_description, warning_invalid_offer_issuer: c.warning_invalid_offer_issuer, warning_missing_invoice_amount: c.warning_missing_invoice_amount, warning_missing_invoice_blindedpay: c.warning_missing_invoice_blindedpay, warning_missing_invoice_created_at: c.warning_missing_invoice_created_at, warning_missing_invoice_node_id: c.warning_missing_invoice_node_id, warning_missing_invoice_paths: c.warning_missing_invoice_paths, warning_missing_invoice_payment_hash: c.warning_missing_invoice_payment_hash, warning_missing_invoice_recurrence_basetime: c.warning_missing_invoice_recurrence_basetime, warning_missing_invoice_request_signature: c.warning_missing_invoice_request_signature, warning_missing_invoice_signature: c.warning_missing_invoice_signature, warning_missing_invreq_metadata: c.warning_missing_invreq_metadata, warning_missing_invreq_payer_id: c.warning_missing_invreq_payer_id, warning_missing_offer_description: c.warning_missing_offer_description, warning_missing_offer_issuer_id: c.warning_missing_offer_issuer_id, #[allow(deprecated)]
warning_missing_offer_node_id: c.warning_missing_offer_node_id, warning_rune_invalid_utf8: c.warning_rune_invalid_utf8, warning_unknown_offer_currency: c.warning_unknown_offer_currency, }
}
}
#[allow(unused_variables)]
impl From<responses::DelpayPayments> for pb::DelpayPayments {
fn from(c: responses::DelpayPayments) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_sent_msat: Some(c.amount_sent_msat.into()), bolt11: c.bolt11, bolt12: c.bolt12, completed_at: c.completed_at, created_at: c.created_at, created_index: c.created_index, destination: c.destination.map(|v| v.serialize().to_vec()), erroronion: c.erroronion.map(|v| hex::decode(v).unwrap()), groupid: c.groupid, id: c.id, label: c.label, partid: c.partid, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
updated_index: c.updated_index, }
}
}
#[allow(unused_variables)]
impl From<responses::DelpayResponse> for pb::DelpayResponse {
fn from(c: responses::DelpayResponse) -> Self {
Self {
payments: c.payments.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::DelforwardResponse> for pb::DelforwardResponse {
fn from(c: responses::DelforwardResponse) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<responses::DisableofferResponse> for pb::DisableofferResponse {
fn from(c: responses::DisableofferResponse) -> Self {
Self {
active: c.active, bolt12: c.bolt12, label: c.label, offer_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.offer_id).to_vec(), single_use: c.single_use, used: c.used, }
}
}
#[allow(unused_variables)]
impl From<responses::DisconnectResponse> for pb::DisconnectResponse {
fn from(c: responses::DisconnectResponse) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<responses::FeeratesOnchain_fee_estimates> for pb::FeeratesOnchainFeeEstimates {
fn from(c: responses::FeeratesOnchain_fee_estimates) -> Self {
Self {
htlc_success_satoshis: c.htlc_success_satoshis, htlc_timeout_satoshis: c.htlc_timeout_satoshis, mutual_close_satoshis: c.mutual_close_satoshis, opening_channel_satoshis: c.opening_channel_satoshis, unilateral_close_nonanchor_satoshis: c.unilateral_close_nonanchor_satoshis, unilateral_close_satoshis: c.unilateral_close_satoshis, }
}
}
#[allow(unused_variables)]
impl From<responses::FeeratesPerkbEstimates> for pb::FeeratesPerkbEstimates {
fn from(c: responses::FeeratesPerkbEstimates) -> Self {
Self {
blockcount: c.blockcount, feerate: c.feerate, smoothed_feerate: c.smoothed_feerate, }
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::FeeratesPerkb> for pb::FeeratesPerkb {
fn from(c: responses::FeeratesPerkb) -> Self {
Self {
#[allow(deprecated)]
delayed_to_us: c.delayed_to_us, estimates: c.estimates.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), floor: c.floor, #[allow(deprecated)]
htlc_resolution: c.htlc_resolution, max_acceptable: c.max_acceptable, min_acceptable: c.min_acceptable, mutual_close: c.mutual_close, opening: c.opening, penalty: c.penalty, unilateral_anchor_close: c.unilateral_anchor_close, unilateral_close: c.unilateral_close, }
}
}
#[allow(unused_variables)]
impl From<responses::FeeratesPerkwEstimates> for pb::FeeratesPerkwEstimates {
fn from(c: responses::FeeratesPerkwEstimates) -> Self {
Self {
blockcount: c.blockcount, feerate: c.feerate, smoothed_feerate: c.smoothed_feerate, }
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::FeeratesPerkw> for pb::FeeratesPerkw {
fn from(c: responses::FeeratesPerkw) -> Self {
Self {
#[allow(deprecated)]
delayed_to_us: c.delayed_to_us, estimates: c.estimates.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), floor: c.floor, #[allow(deprecated)]
htlc_resolution: c.htlc_resolution, max_acceptable: c.max_acceptable, min_acceptable: c.min_acceptable, mutual_close: c.mutual_close, opening: c.opening, penalty: c.penalty, unilateral_anchor_close: c.unilateral_anchor_close, unilateral_close: c.unilateral_close, }
}
}
#[allow(unused_variables)]
impl From<responses::FeeratesResponse> for pb::FeeratesResponse {
fn from(c: responses::FeeratesResponse) -> Self {
Self {
onchain_fee_estimates: c.onchain_fee_estimates.map(|v| v.into()),
perkb: c.perkb.map(|v| v.into()),
perkw: c.perkw.map(|v| v.into()),
warning_missing_feerates: c.warning_missing_feerates, }
}
}
#[allow(unused_variables)]
impl From<responses::FetchinvoiceChanges> for pb::FetchinvoiceChanges {
fn from(c: responses::FetchinvoiceChanges) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), description: c.description, description_appended: c.description_appended, vendor: c.vendor, vendor_removed: c.vendor_removed, }
}
}
#[allow(unused_variables)]
impl From<responses::FetchinvoiceNext_period> for pb::FetchinvoiceNextPeriod {
fn from(c: responses::FetchinvoiceNext_period) -> Self {
Self {
counter: c.counter, endtime: c.endtime, paywindow_end: c.paywindow_end, paywindow_start: c.paywindow_start, starttime: c.starttime, }
}
}
#[allow(unused_variables)]
impl From<responses::FetchinvoiceResponse> for pb::FetchinvoiceResponse {
fn from(c: responses::FetchinvoiceResponse) -> Self {
Self {
changes: Some(c.changes.into()),
invoice: c.invoice, next_period: c.next_period.map(|v| v.into()),
}
}
}
#[allow(unused_variables)]
impl From<responses::Fundchannel_cancelResponse> for pb::FundchannelCancelResponse {
fn from(c: responses::Fundchannel_cancelResponse) -> Self {
Self {
cancelled: c.cancelled, }
}
}
#[allow(unused_variables)]
impl From<responses::Fundchannel_completeResponse> for pb::FundchannelCompleteResponse {
fn from(c: responses::Fundchannel_completeResponse) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), commitments_secured: c.commitments_secured, }
}
}
#[allow(unused_variables)]
impl From<responses::FundchannelChannel_type> for pb::FundchannelChannelType {
fn from(c: responses::FundchannelChannel_type) -> Self {
Self {
bits: c.bits.into_iter().map(|i| i.into()).collect(), names: c.names.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::FundchannelResponse> for pb::FundchannelResponse {
fn from(c: responses::FundchannelResponse) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), channel_type: c.channel_type.map(|v| v.into()),
close_to: c.close_to.map(|v| hex::decode(v).unwrap()), mindepth: c.mindepth, outnum: c.outnum, tx: hex::decode(&c.tx).unwrap(), txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::Fundchannel_startChannel_type> for pb::FundchannelStartChannelType {
fn from(c: responses::Fundchannel_startChannel_type) -> Self {
Self {
bits: c.bits.into_iter().map(|i| i.into()).collect(), names: c.names.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::Fundchannel_startResponse> for pb::FundchannelStartResponse {
fn from(c: responses::Fundchannel_startResponse) -> Self {
Self {
channel_type: c.channel_type.map(|v| v.into()),
close_to: c.close_to.map(|v| hex::decode(v).unwrap()), funding_address: c.funding_address, mindepth: c.mindepth, scriptpubkey: hex::decode(&c.scriptpubkey).unwrap(), warning_usage: c.warning_usage, }
}
}
#[allow(unused_variables)]
impl From<responses::GetlogLog> for pb::GetlogLog {
fn from(c: responses::GetlogLog) -> Self {
Self {
data: c.data.map(|v| hex::decode(v).unwrap()), log: c.log, node_id: c.node_id.map(|v| v.serialize().to_vec()), num_skipped: c.num_skipped, source: c.source, time: c.time, item_type: c.item_type as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::GetlogResponse> for pb::GetlogResponse {
fn from(c: responses::GetlogResponse) -> Self {
Self {
bytes_max: c.bytes_max, bytes_used: c.bytes_used, created_at: c.created_at, log: c.log.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::FunderupdateResponse> for pb::FunderupdateResponse {
fn from(c: responses::FunderupdateResponse) -> Self {
Self {
channel_fee_max_base_msat: c.channel_fee_max_base_msat.map(|f| f.into()), channel_fee_max_proportional_thousandths: c.channel_fee_max_proportional_thousandths, compact_lease: c.compact_lease.map(|v| hex::decode(v).unwrap()), fund_probability: c.fund_probability, funding_weight: c.funding_weight, fuzz_percent: c.fuzz_percent, lease_fee_base_msat: c.lease_fee_base_msat.map(|f| f.into()), lease_fee_basis: c.lease_fee_basis, leases_only: c.leases_only, max_their_funding_msat: Some(c.max_their_funding_msat.into()), min_their_funding_msat: Some(c.min_their_funding_msat.into()), per_channel_max_msat: Some(c.per_channel_max_msat.into()), per_channel_min_msat: Some(c.per_channel_min_msat.into()), policy: c.policy as i32,
policy_mod: c.policy_mod, reserve_tank_msat: Some(c.reserve_tank_msat.into()), summary: c.summary, }
}
}
#[allow(unused_variables)]
impl From<responses::GetrouteRoute> for pb::GetrouteRoute {
fn from(c: responses::GetrouteRoute) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), channel: c.channel.to_string(), delay: c.delay, direction: c.direction, id: c.id.serialize().to_vec(), style: c.style as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::GetrouteResponse> for pb::GetrouteResponse {
fn from(c: responses::GetrouteResponse) -> Self {
Self {
route: c.route.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListforwardsForwards> for pb::ListforwardsForwards {
fn from(c: responses::ListforwardsForwards) -> Self {
Self {
created_index: c.created_index, failcode: c.failcode, failreason: c.failreason, fee_msat: c.fee_msat.map(|f| f.into()), in_channel: c.in_channel.to_string(), in_htlc_id: c.in_htlc_id, in_msat: Some(c.in_msat.into()), out_channel: c.out_channel.map(|v| v.to_string()), out_htlc_id: c.out_htlc_id, out_msat: c.out_msat.map(|f| f.into()), received_time: c.received_time, resolved_time: c.resolved_time, status: c.status as i32,
style: c.style.map(|v| v as i32),
updated_index: c.updated_index, }
}
}
#[allow(unused_variables)]
impl From<responses::ListforwardsResponse> for pb::ListforwardsResponse {
fn from(c: responses::ListforwardsResponse) -> Self {
Self {
forwards: c.forwards.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListoffersOffers> for pb::ListoffersOffers {
fn from(c: responses::ListoffersOffers) -> Self {
Self {
active: c.active, bolt12: c.bolt12, label: c.label, offer_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.offer_id).to_vec(), single_use: c.single_use, used: c.used, }
}
}
#[allow(unused_variables)]
impl From<responses::ListoffersResponse> for pb::ListoffersResponse {
fn from(c: responses::ListoffersResponse) -> Self {
Self {
offers: c.offers.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListpaysPays> for pb::ListpaysPays {
fn from(c: responses::ListpaysPays) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_sent_msat: c.amount_sent_msat.map(|f| f.into()), bolt11: c.bolt11, bolt12: c.bolt12, completed_at: c.completed_at, created_at: c.created_at, description: c.description, destination: c.destination.map(|v| v.serialize().to_vec()), erroronion: c.erroronion.map(|v| hex::decode(v).unwrap()), label: c.label, number_of_parts: c.number_of_parts, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), preimage: c.preimage.map(|v| v.to_vec()), status: c.status as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::ListpaysResponse> for pb::ListpaysResponse {
fn from(c: responses::ListpaysResponse) -> Self {
Self {
pays: c.pays.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListhtlcsHtlcs> for pb::ListhtlcsHtlcs {
fn from(c: responses::ListhtlcsHtlcs) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), direction: c.direction as i32,
expiry: c.expiry, id: c.id, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), short_channel_id: c.short_channel_id.to_string(), state: c.state as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::ListhtlcsResponse> for pb::ListhtlcsResponse {
fn from(c: responses::ListhtlcsResponse) -> Self {
Self {
htlcs: c.htlcs.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::MultifundchannelChannel_idsChannel_type> for pb::MultifundchannelChannelIdsChannelType {
fn from(c: responses::MultifundchannelChannel_idsChannel_type) -> Self {
Self {
bits: c.bits.into_iter().map(|i| i.into()).collect(), names: c.names.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::MultifundchannelChannel_ids> for pb::MultifundchannelChannelIds {
fn from(c: responses::MultifundchannelChannel_ids) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), channel_type: c.channel_type.map(|v| v.into()),
close_to: c.close_to.map(|v| hex::decode(v).unwrap()), id: c.id.serialize().to_vec(), outnum: c.outnum, }
}
}
#[allow(unused_variables)]
impl From<responses::MultifundchannelFailedError> for pb::MultifundchannelFailedError {
fn from(c: responses::MultifundchannelFailedError) -> Self {
Self {
code: c.code, message: c.message, }
}
}
#[allow(unused_variables)]
impl From<responses::MultifundchannelFailed> for pb::MultifundchannelFailed {
fn from(c: responses::MultifundchannelFailed) -> Self {
Self {
error: Some(c.error.into()),
id: c.id.serialize().to_vec(), method: c.method as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::MultifundchannelResponse> for pb::MultifundchannelResponse {
fn from(c: responses::MultifundchannelResponse) -> Self {
Self {
channel_ids: c.channel_ids.into_iter().map(|i| i.into()).collect(), failed: c.failed.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), tx: hex::decode(&c.tx).unwrap(), txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::MultiwithdrawResponse> for pb::MultiwithdrawResponse {
fn from(c: responses::MultiwithdrawResponse) -> Self {
Self {
tx: hex::decode(&c.tx).unwrap(), txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::OfferResponse> for pb::OfferResponse {
fn from(c: responses::OfferResponse) -> Self {
Self {
active: c.active, bolt12: c.bolt12, created: c.created, label: c.label, offer_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.offer_id).to_vec(), single_use: c.single_use, used: c.used, }
}
}
#[allow(unused_variables)]
impl From<responses::Openchannel_abortResponse> for pb::OpenchannelAbortResponse {
fn from(c: responses::Openchannel_abortResponse) -> Self {
Self {
channel_canceled: c.channel_canceled, channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), reason: c.reason, }
}
}
#[allow(unused_variables)]
impl From<responses::Openchannel_bumpChannel_type> for pb::OpenchannelBumpChannelType {
fn from(c: responses::Openchannel_bumpChannel_type) -> Self {
Self {
bits: c.bits.into_iter().map(|i| i.into()).collect(), names: c.names.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::Openchannel_bumpResponse> for pb::OpenchannelBumpResponse {
fn from(c: responses::Openchannel_bumpResponse) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), channel_type: c.channel_type.map(|v| v.into()),
commitments_secured: c.commitments_secured, funding_serial: c.funding_serial, psbt: c.psbt, requires_confirmed_inputs: c.requires_confirmed_inputs, }
}
}
#[allow(unused_variables)]
impl From<responses::Openchannel_initChannel_type> for pb::OpenchannelInitChannelType {
fn from(c: responses::Openchannel_initChannel_type) -> Self {
Self {
bits: c.bits.into_iter().map(|i| i.into()).collect(), names: c.names.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::Openchannel_initResponse> for pb::OpenchannelInitResponse {
fn from(c: responses::Openchannel_initResponse) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), channel_type: c.channel_type.map(|v| v.into()),
commitments_secured: c.commitments_secured, funding_serial: c.funding_serial, psbt: c.psbt, requires_confirmed_inputs: c.requires_confirmed_inputs, }
}
}
#[allow(unused_variables)]
impl From<responses::Openchannel_signedResponse> for pb::OpenchannelSignedResponse {
fn from(c: responses::Openchannel_signedResponse) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), tx: hex::decode(&c.tx).unwrap(), txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::Openchannel_updateChannel_type> for pb::OpenchannelUpdateChannelType {
fn from(c: responses::Openchannel_updateChannel_type) -> Self {
Self {
bits: c.bits.into_iter().map(|i| i.into()).collect(), names: c.names.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::Openchannel_updateResponse> for pb::OpenchannelUpdateResponse {
fn from(c: responses::Openchannel_updateResponse) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), channel_type: c.channel_type.map(|v| v.into()),
close_to: c.close_to.map(|v| hex::decode(v).unwrap()), commitments_secured: c.commitments_secured, funding_outnum: c.funding_outnum, psbt: c.psbt, requires_confirmed_inputs: c.requires_confirmed_inputs, }
}
}
#[allow(unused_variables)]
impl From<responses::PingResponse> for pb::PingResponse {
fn from(c: responses::PingResponse) -> Self {
Self {
totlen: c.totlen.into(), }
}
}
#[allow(unused_variables)]
impl From<responses::PluginPlugins> for pb::PluginPlugins {
fn from(c: responses::PluginPlugins) -> Self {
Self {
active: c.active, dynamic: c.dynamic, name: c.name, }
}
}
#[allow(unused_variables)]
impl From<responses::PluginResponse> for pb::PluginResponse {
fn from(c: responses::PluginResponse) -> Self {
Self {
command: c.command as i32,
plugins: c.plugins.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), result: c.result, }
}
}
#[allow(unused_variables)]
impl From<responses::RenepaystatusPaystatus> for pb::RenepaystatusPaystatus {
fn from(c: responses::RenepaystatusPaystatus) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), amount_sent_msat: c.amount_sent_msat.map(|f| f.into()), bolt11: c.bolt11, created_at: c.created_at, destination: c.destination.map(|v| v.serialize().to_vec()), groupid: c.groupid, notes: c.notes.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), parts: c.parts, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::RenepaystatusResponse> for pb::RenepaystatusResponse {
fn from(c: responses::RenepaystatusResponse) -> Self {
Self {
paystatus: c.paystatus.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::RenepayResponse> for pb::RenepayResponse {
fn from(c: responses::RenepayResponse) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), amount_sent_msat: Some(c.amount_sent_msat.into()), created_at: c.created_at, destination: c.destination.map(|v| v.serialize().to_vec()), parts: c.parts, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.to_vec(), status: c.status as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::ReserveinputsReservations> for pb::ReserveinputsReservations {
fn from(c: responses::ReserveinputsReservations) -> Self {
Self {
reserved: c.reserved, reserved_to_block: c.reserved_to_block, txid: hex::decode(&c.txid).unwrap(), vout: c.vout, was_reserved: c.was_reserved, }
}
}
#[allow(unused_variables)]
impl From<responses::ReserveinputsResponse> for pb::ReserveinputsResponse {
fn from(c: responses::ReserveinputsResponse) -> Self {
Self {
reservations: c.reservations.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::SendcustommsgResponse> for pb::SendcustommsgResponse {
fn from(c: responses::SendcustommsgResponse) -> Self {
Self {
status: c.status, }
}
}
#[allow(unused_variables)]
impl From<responses::SendinvoiceResponse> for pb::SendinvoiceResponse {
fn from(c: responses::SendinvoiceResponse) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), amount_received_msat: c.amount_received_msat.map(|f| f.into()), bolt12: c.bolt12, created_index: c.created_index, description: c.description, expires_at: c.expires_at, label: c.label, paid_at: c.paid_at, pay_index: c.pay_index, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_preimage: c.payment_preimage.map(|v| v.to_vec()), status: c.status as i32,
updated_index: c.updated_index, }
}
}
#[allow(unused_variables)]
impl From<responses::SetchannelChannels> for pb::SetchannelChannels {
fn from(c: responses::SetchannelChannels) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), fee_base_msat: Some(c.fee_base_msat.into()), fee_proportional_millionths: c.fee_proportional_millionths, ignore_fee_limits: c.ignore_fee_limits, maximum_htlc_out_msat: Some(c.maximum_htlc_out_msat.into()), minimum_htlc_out_msat: Some(c.minimum_htlc_out_msat.into()), peer_id: c.peer_id.serialize().to_vec(), short_channel_id: c.short_channel_id.map(|v| v.to_string()), warning_htlcmax_too_high: c.warning_htlcmax_too_high, warning_htlcmin_too_low: c.warning_htlcmin_too_low, }
}
}
#[allow(unused_variables)]
impl From<responses::SetchannelResponse> for pb::SetchannelResponse {
fn from(c: responses::SetchannelResponse) -> Self {
Self {
channels: c.channels.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::SetconfigConfig> for pb::SetconfigConfig {
fn from(c: responses::SetconfigConfig) -> Self {
Self {
config: c.config, dynamic: c.dynamic, plugin: c.plugin, set: c.set, source: c.source, value_bool: c.value_bool, value_int: c.value_int, value_msat: c.value_msat.map(|f| f.into()), value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::SetconfigResponse> for pb::SetconfigResponse {
fn from(c: responses::SetconfigResponse) -> Self {
Self {
config: Some(c.config.into()),
}
}
}
#[allow(unused_variables)]
impl From<responses::SetpsbtversionResponse> for pb::SetpsbtversionResponse {
fn from(c: responses::SetpsbtversionResponse) -> Self {
Self {
psbt: c.psbt, }
}
}
#[allow(unused_variables)]
impl From<responses::SigninvoiceResponse> for pb::SigninvoiceResponse {
fn from(c: responses::SigninvoiceResponse) -> Self {
Self {
bolt11: c.bolt11, }
}
}
#[allow(unused_variables)]
impl From<responses::SignmessageResponse> for pb::SignmessageResponse {
fn from(c: responses::SignmessageResponse) -> Self {
Self {
recid: hex::decode(&c.recid).unwrap(), signature: hex::decode(&c.signature).unwrap(), zbase: c.zbase, }
}
}
#[allow(unused_variables)]
impl From<responses::Splice_initResponse> for pb::SpliceInitResponse {
fn from(c: responses::Splice_initResponse) -> Self {
Self {
psbt: c.psbt, }
}
}
#[allow(unused_variables)]
impl From<responses::Splice_signedResponse> for pb::SpliceSignedResponse {
fn from(c: responses::Splice_signedResponse) -> Self {
Self {
outnum: c.outnum, tx: hex::decode(&c.tx).unwrap(), txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::Splice_updateResponse> for pb::SpliceUpdateResponse {
fn from(c: responses::Splice_updateResponse) -> Self {
Self {
commitments_secured: c.commitments_secured, psbt: c.psbt, }
}
}
#[allow(unused_variables)]
impl From<responses::UnreserveinputsReservations> for pb::UnreserveinputsReservations {
fn from(c: responses::UnreserveinputsReservations) -> Self {
Self {
reserved: c.reserved, reserved_to_block: c.reserved_to_block, txid: hex::decode(&c.txid).unwrap(), vout: c.vout, was_reserved: c.was_reserved, }
}
}
#[allow(unused_variables)]
impl From<responses::UnreserveinputsResponse> for pb::UnreserveinputsResponse {
fn from(c: responses::UnreserveinputsResponse) -> Self {
Self {
reservations: c.reservations.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::UpgradewalletResponse> for pb::UpgradewalletResponse {
fn from(c: responses::UpgradewalletResponse) -> Self {
Self {
psbt: c.psbt, tx: c.tx.map(|v| hex::decode(v).unwrap()), txid: c.txid.map(|v| hex::decode(v).unwrap()), upgraded_outs: c.upgraded_outs, }
}
}
#[allow(unused_variables)]
impl From<responses::WaitblockheightResponse> for pb::WaitblockheightResponse {
fn from(c: responses::WaitblockheightResponse) -> Self {
Self {
blockheight: c.blockheight, }
}
}
#[allow(unused_variables)]
impl From<responses::WaitDetails> for pb::WaitDetails {
fn from(c: responses::WaitDetails) -> Self {
Self {
bolt11: c.bolt11, bolt12: c.bolt12, description: c.description, groupid: c.groupid, in_channel: c.in_channel.map(|v| v.to_string()), in_htlc_id: c.in_htlc_id, in_msat: c.in_msat.map(|f| f.into()), label: c.label, out_channel: c.out_channel.map(|v| v.to_string()), partid: c.partid, payment_hash: c.payment_hash.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), status: c.status.map(|v| v as i32),
}
}
}
#[allow(unused_variables)]
impl From<responses::WaitResponse> for pb::WaitResponse {
fn from(c: responses::WaitResponse) -> Self {
Self {
created: c.created, deleted: c.deleted, details: c.details.map(|v| v.into()),
subsystem: c.subsystem as i32,
updated: c.updated, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsAccepthtlctlvtypes> for pb::ListconfigsConfigsAccepthtlctlvtypes {
fn from(c: responses::ListconfigsConfigsAccepthtlctlvtypes) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsAddr> for pb::ListconfigsConfigsAddr {
fn from(c: responses::ListconfigsConfigsAddr) -> Self {
Self {
sources: c.sources.into_iter().map(|i| i.into()).collect(), values_str: c.values_str.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsAlias> for pb::ListconfigsConfigsAlias {
fn from(c: responses::ListconfigsConfigsAlias) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsAllowdeprecatedapis> for pb::ListconfigsConfigsAllowdeprecatedapis {
fn from(c: responses::ListconfigsConfigsAllowdeprecatedapis) -> Self {
Self {
source: c.source, value_bool: c.value_bool, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsAlwaysuseproxy> for pb::ListconfigsConfigsAlwaysuseproxy {
fn from(c: responses::ListconfigsConfigsAlwaysuseproxy) -> Self {
Self {
source: c.source, value_bool: c.value_bool, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsAnnounceaddr> for pb::ListconfigsConfigsAnnounceaddr {
fn from(c: responses::ListconfigsConfigsAnnounceaddr) -> Self {
Self {
sources: c.sources.into_iter().map(|i| i.into()).collect(), values_str: c.values_str.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsAnnounceaddrdiscovered> for pb::ListconfigsConfigsAnnounceaddrdiscovered {
fn from(c: responses::ListconfigsConfigsAnnounceaddrdiscovered) -> Self {
Self {
source: c.source, value_str: c.value_str as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsAnnounceaddrdiscoveredport> for pb::ListconfigsConfigsAnnounceaddrdiscoveredport {
fn from(c: responses::ListconfigsConfigsAnnounceaddrdiscoveredport) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsAnnounceaddrdns> for pb::ListconfigsConfigsAnnounceaddrdns {
fn from(c: responses::ListconfigsConfigsAnnounceaddrdns) -> Self {
Self {
source: c.source, value_bool: c.value_bool, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsAutolisten> for pb::ListconfigsConfigsAutolisten {
fn from(c: responses::ListconfigsConfigsAutolisten) -> Self {
Self {
source: c.source, value_bool: c.value_bool, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsBindaddr> for pb::ListconfigsConfigsBindaddr {
fn from(c: responses::ListconfigsConfigsBindaddr) -> Self {
Self {
sources: c.sources.into_iter().map(|i| i.into()).collect(), values_str: c.values_str.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsClearplugins> for pb::ListconfigsConfigsClearplugins {
fn from(c: responses::ListconfigsConfigsClearplugins) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsCltvdelta> for pb::ListconfigsConfigsCltvdelta {
fn from(c: responses::ListconfigsConfigsCltvdelta) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsCltvfinal> for pb::ListconfigsConfigsCltvfinal {
fn from(c: responses::ListconfigsConfigsCltvfinal) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsCommitfee> for pb::ListconfigsConfigsCommitfee {
fn from(c: responses::ListconfigsConfigsCommitfee) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsCommitfeerateoffset> for pb::ListconfigsConfigsCommitfeerateoffset {
fn from(c: responses::ListconfigsConfigsCommitfeerateoffset) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsCommittime> for pb::ListconfigsConfigsCommittime {
fn from(c: responses::ListconfigsConfigsCommittime) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsConf> for pb::ListconfigsConfigsConf {
fn from(c: responses::ListconfigsConfigsConf) -> Self {
Self {
source: c.source as i32,
value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsDaemon> for pb::ListconfigsConfigsDaemon {
fn from(c: responses::ListconfigsConfigsDaemon) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsDatabaseupgrade> for pb::ListconfigsConfigsDatabaseupgrade {
fn from(c: responses::ListconfigsConfigsDatabaseupgrade) -> Self {
Self {
source: c.source, value_bool: c.value_bool, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsDeveloper> for pb::ListconfigsConfigsDeveloper {
fn from(c: responses::ListconfigsConfigsDeveloper) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsDisabledns> for pb::ListconfigsConfigsDisabledns {
fn from(c: responses::ListconfigsConfigsDisabledns) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsDisablempp> for pb::ListconfigsConfigsDisablempp {
fn from(c: responses::ListconfigsConfigsDisablempp) -> Self {
Self {
plugin: c.plugin, set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsDisableplugin> for pb::ListconfigsConfigsDisableplugin {
fn from(c: responses::ListconfigsConfigsDisableplugin) -> Self {
Self {
sources: c.sources.into_iter().map(|i| i.into()).collect(), values_str: c.values_str.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsEncryptedhsm> for pb::ListconfigsConfigsEncryptedhsm {
fn from(c: responses::ListconfigsConfigsEncryptedhsm) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsExperimentalanchors> for pb::ListconfigsConfigsExperimentalanchors {
fn from(c: responses::ListconfigsConfigsExperimentalanchors) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsExperimentaldualfund> for pb::ListconfigsConfigsExperimentaldualfund {
fn from(c: responses::ListconfigsConfigsExperimentaldualfund) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsExperimentaloffers> for pb::ListconfigsConfigsExperimentaloffers {
fn from(c: responses::ListconfigsConfigsExperimentaloffers) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsExperimentalonionmessages> for pb::ListconfigsConfigsExperimentalonionmessages {
fn from(c: responses::ListconfigsConfigsExperimentalonionmessages) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsExperimentalpeerstorage> for pb::ListconfigsConfigsExperimentalpeerstorage {
fn from(c: responses::ListconfigsConfigsExperimentalpeerstorage) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsExperimentalshutdownwrongfunding> for pb::ListconfigsConfigsExperimentalshutdownwrongfunding {
fn from(c: responses::ListconfigsConfigsExperimentalshutdownwrongfunding) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsExperimentalsplicing> for pb::ListconfigsConfigsExperimentalsplicing {
fn from(c: responses::ListconfigsConfigsExperimentalsplicing) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsFeebase> for pb::ListconfigsConfigsFeebase {
fn from(c: responses::ListconfigsConfigsFeebase) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsFeepersatoshi> for pb::ListconfigsConfigsFeepersatoshi {
fn from(c: responses::ListconfigsConfigsFeepersatoshi) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsFetchinvoicenoconnect> for pb::ListconfigsConfigsFetchinvoicenoconnect {
fn from(c: responses::ListconfigsConfigsFetchinvoicenoconnect) -> Self {
Self {
plugin: c.plugin, set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsForcefeerates> for pb::ListconfigsConfigsForcefeerates {
fn from(c: responses::ListconfigsConfigsForcefeerates) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsFundingconfirms> for pb::ListconfigsConfigsFundingconfirms {
fn from(c: responses::ListconfigsConfigsFundingconfirms) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsHtlcmaximummsat> for pb::ListconfigsConfigsHtlcmaximummsat {
fn from(c: responses::ListconfigsConfigsHtlcmaximummsat) -> Self {
Self {
source: c.source, value_msat: Some(c.value_msat.into()), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsHtlcminimummsat> for pb::ListconfigsConfigsHtlcminimummsat {
fn from(c: responses::ListconfigsConfigsHtlcminimummsat) -> Self {
Self {
source: c.source, value_msat: Some(c.value_msat.into()), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsIgnorefeelimits> for pb::ListconfigsConfigsIgnorefeelimits {
fn from(c: responses::ListconfigsConfigsIgnorefeelimits) -> Self {
Self {
source: c.source, value_bool: c.value_bool, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsImportantplugin> for pb::ListconfigsConfigsImportantplugin {
fn from(c: responses::ListconfigsConfigsImportantplugin) -> Self {
Self {
sources: c.sources.into_iter().map(|i| i.into()).collect(), values_str: c.values_str.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsLargechannels> for pb::ListconfigsConfigsLargechannels {
fn from(c: responses::ListconfigsConfigsLargechannels) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsLightningdir> for pb::ListconfigsConfigsLightningdir {
fn from(c: responses::ListconfigsConfigsLightningdir) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsLogfile> for pb::ListconfigsConfigsLogfile {
fn from(c: responses::ListconfigsConfigsLogfile) -> Self {
Self {
sources: c.sources.into_iter().map(|i| i.into()).collect(), values_str: c.values_str.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsLoglevel> for pb::ListconfigsConfigsLoglevel {
fn from(c: responses::ListconfigsConfigsLoglevel) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsLogprefix> for pb::ListconfigsConfigsLogprefix {
fn from(c: responses::ListconfigsConfigsLogprefix) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsLogtimestamps> for pb::ListconfigsConfigsLogtimestamps {
fn from(c: responses::ListconfigsConfigsLogtimestamps) -> Self {
Self {
source: c.source, value_bool: c.value_bool, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsMainnet> for pb::ListconfigsConfigsMainnet {
fn from(c: responses::ListconfigsConfigsMainnet) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsMaxconcurrenthtlcs> for pb::ListconfigsConfigsMaxconcurrenthtlcs {
fn from(c: responses::ListconfigsConfigsMaxconcurrenthtlcs) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsMaxdusthtlcexposuremsat> for pb::ListconfigsConfigsMaxdusthtlcexposuremsat {
fn from(c: responses::ListconfigsConfigsMaxdusthtlcexposuremsat) -> Self {
Self {
source: c.source, value_msat: Some(c.value_msat.into()), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsMaxlocktimeblocks> for pb::ListconfigsConfigsMaxlocktimeblocks {
fn from(c: responses::ListconfigsConfigsMaxlocktimeblocks) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsMincapacitysat> for pb::ListconfigsConfigsMincapacitysat {
fn from(c: responses::ListconfigsConfigsMincapacitysat) -> Self {
Self {
dynamic: c.dynamic, source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsNetwork> for pb::ListconfigsConfigsNetwork {
fn from(c: responses::ListconfigsConfigsNetwork) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsOffline> for pb::ListconfigsConfigsOffline {
fn from(c: responses::ListconfigsConfigsOffline) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsPidfile> for pb::ListconfigsConfigsPidfile {
fn from(c: responses::ListconfigsConfigsPidfile) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsPlugin> for pb::ListconfigsConfigsPlugin {
fn from(c: responses::ListconfigsConfigsPlugin) -> Self {
Self {
sources: c.sources.into_iter().map(|i| i.into()).collect(), values_str: c.values_str.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsPlugindir> for pb::ListconfigsConfigsPlugindir {
fn from(c: responses::ListconfigsConfigsPlugindir) -> Self {
Self {
sources: c.sources.into_iter().map(|i| i.into()).collect(), values_str: c.values_str.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsProxy> for pb::ListconfigsConfigsProxy {
fn from(c: responses::ListconfigsConfigsProxy) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsRegtest> for pb::ListconfigsConfigsRegtest {
fn from(c: responses::ListconfigsConfigsRegtest) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsRequireconfirmedinputs> for pb::ListconfigsConfigsRequireconfirmedinputs {
fn from(c: responses::ListconfigsConfigsRequireconfirmedinputs) -> Self {
Self {
source: c.source, value_bool: c.value_bool, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsRescan> for pb::ListconfigsConfigsRescan {
fn from(c: responses::ListconfigsConfigsRescan) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsRgb> for pb::ListconfigsConfigsRgb {
fn from(c: responses::ListconfigsConfigsRgb) -> Self {
Self {
source: c.source, value_str: hex::decode(&c.value_str).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsRpcfile> for pb::ListconfigsConfigsRpcfile {
fn from(c: responses::ListconfigsConfigsRpcfile) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsRpcfilemode> for pb::ListconfigsConfigsRpcfilemode {
fn from(c: responses::ListconfigsConfigsRpcfilemode) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsSignet> for pb::ListconfigsConfigsSignet {
fn from(c: responses::ListconfigsConfigsSignet) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsSubdaemon> for pb::ListconfigsConfigsSubdaemon {
fn from(c: responses::ListconfigsConfigsSubdaemon) -> Self {
Self {
sources: c.sources.into_iter().map(|i| i.into()).collect(), values_str: c.values_str.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsTestnet> for pb::ListconfigsConfigsTestnet {
fn from(c: responses::ListconfigsConfigsTestnet) -> Self {
Self {
set: c.set, source: c.source, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsTorservicepassword> for pb::ListconfigsConfigsTorservicepassword {
fn from(c: responses::ListconfigsConfigsTorservicepassword) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsWallet> for pb::ListconfigsConfigsWallet {
fn from(c: responses::ListconfigsConfigsWallet) -> Self {
Self {
source: c.source, value_str: c.value_str, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsConfigsWatchtimeblocks> for pb::ListconfigsConfigsWatchtimeblocks {
fn from(c: responses::ListconfigsConfigsWatchtimeblocks) -> Self {
Self {
source: c.source, value_int: c.value_int, }
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::ListconfigsConfigs> for pb::ListconfigsConfigs {
fn from(c: responses::ListconfigsConfigs) -> Self {
Self {
accept_htlc_tlv_types: c.accept_htlc_tlv_types.map(|v| v.into()),
addr: c.addr.map(|v| v.into()),
alias: c.alias.map(|v| v.into()),
allow_deprecated_apis: c.allow_deprecated_apis.map(|v| v.into()),
always_use_proxy: c.always_use_proxy.map(|v| v.into()),
announce_addr: c.announce_addr.map(|v| v.into()),
announce_addr_discovered: c.announce_addr_discovered.map(|v| v.into()),
announce_addr_discovered_port: c.announce_addr_discovered_port.map(|v| v.into()),
announce_addr_dns: c.announce_addr_dns.map(|v| v.into()),
autolisten: c.autolisten.map(|v| v.into()),
bind_addr: c.bind_addr.map(|v| v.into()),
clear_plugins: c.clear_plugins.map(|v| v.into()),
cltv_delta: c.cltv_delta.map(|v| v.into()),
cltv_final: c.cltv_final.map(|v| v.into()),
commit_fee: c.commit_fee.map(|v| v.into()),
commit_feerate_offset: c.commit_feerate_offset.map(|v| v.into()),
commit_time: c.commit_time.map(|v| v.into()),
conf: c.conf.map(|v| v.into()),
daemon: c.daemon.map(|v| v.into()),
database_upgrade: c.database_upgrade.map(|v| v.into()),
developer: c.developer.map(|v| v.into()),
disable_dns: c.disable_dns.map(|v| v.into()),
disable_mpp: c.disable_mpp.map(|v| v.into()),
disable_plugin: c.disable_plugin.map(|v| v.into()),
encrypted_hsm: c.encrypted_hsm.map(|v| v.into()),
experimental_anchors: c.experimental_anchors.map(|v| v.into()),
experimental_dual_fund: c.experimental_dual_fund.map(|v| v.into()),
experimental_offers: c.experimental_offers.map(|v| v.into()),
experimental_onion_messages: c.experimental_onion_messages.map(|v| v.into()),
experimental_peer_storage: c.experimental_peer_storage.map(|v| v.into()),
experimental_shutdown_wrong_funding: c.experimental_shutdown_wrong_funding.map(|v| v.into()),
experimental_splicing: c.experimental_splicing.map(|v| v.into()),
fee_base: c.fee_base.map(|v| v.into()),
fee_per_satoshi: c.fee_per_satoshi.map(|v| v.into()),
fetchinvoice_noconnect: c.fetchinvoice_noconnect.map(|v| v.into()),
force_feerates: c.force_feerates.map(|v| v.into()),
funding_confirms: c.funding_confirms.map(|v| v.into()),
htlc_maximum_msat: c.htlc_maximum_msat.map(|v| v.into()),
htlc_minimum_msat: c.htlc_minimum_msat.map(|v| v.into()),
ignore_fee_limits: c.ignore_fee_limits.map(|v| v.into()),
important_plugin: c.important_plugin.map(|v| v.into()),
large_channels: c.large_channels.map(|v| v.into()),
lightning_dir: c.lightning_dir.map(|v| v.into()),
log_file: c.log_file.map(|v| v.into()),
log_level: c.log_level.map(|v| v.into()),
log_prefix: c.log_prefix.map(|v| v.into()),
log_timestamps: c.log_timestamps.map(|v| v.into()),
mainnet: c.mainnet.map(|v| v.into()),
max_concurrent_htlcs: c.max_concurrent_htlcs.map(|v| v.into()),
max_dust_htlc_exposure_msat: c.max_dust_htlc_exposure_msat.map(|v| v.into()),
max_locktime_blocks: c.max_locktime_blocks.map(|v| v.into()),
min_capacity_sat: c.min_capacity_sat.map(|v| v.into()),
network: c.network.map(|v| v.into()),
offline: c.offline.map(|v| v.into()),
pid_file: c.pid_file.map(|v| v.into()),
plugin: c.plugin.map(|v| v.into()),
plugin_dir: c.plugin_dir.map(|v| v.into()),
proxy: c.proxy.map(|v| v.into()),
regtest: c.regtest.map(|v| v.into()),
require_confirmed_inputs: c.require_confirmed_inputs.map(|v| v.into()),
rescan: c.rescan.map(|v| v.into()),
rgb: c.rgb.map(|v| v.into()),
rpc_file: c.rpc_file.map(|v| v.into()),
rpc_file_mode: c.rpc_file_mode.map(|v| v.into()),
signet: c.signet.map(|v| v.into()),
subdaemon: c.subdaemon.map(|v| v.into()),
testnet: c.testnet.map(|v| v.into()),
tor_service_password: c.tor_service_password.map(|v| v.into()),
wallet: c.wallet.map(|v| v.into()),
watchtime_blocks: c.watchtime_blocks.map(|v| v.into()),
}
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsImportantpluginsOptions> for pb::ListconfigsImportantpluginsOptions {
fn from(c: responses::ListconfigsImportantpluginsOptions) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsImportantplugins> for pb::ListconfigsImportantplugins {
fn from(c: responses::ListconfigsImportantplugins) -> Self {
Self {
name: c.name, options: c.options.map(|v| v.into()),
path: c.path, }
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsPluginsOptions> for pb::ListconfigsPluginsOptions {
fn from(c: responses::ListconfigsPluginsOptions) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<responses::ListconfigsPlugins> for pb::ListconfigsPlugins {
fn from(c: responses::ListconfigsPlugins) -> Self {
Self {
name: c.name, options: c.options.map(|v| v.into()),
path: c.path, }
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::ListconfigsResponse> for pb::ListconfigsResponse {
fn from(c: responses::ListconfigsResponse) -> Self {
Self {
#[allow(deprecated)]
accept_htlc_tlv_types: c.accept_htlc_tlv_types, #[allow(deprecated)]
addr: c.addr, #[allow(deprecated)]
alias: c.alias, #[allow(deprecated)]
allow_deprecated_apis: c.allow_deprecated_apis, #[allow(deprecated)]
always_use_proxy: c.always_use_proxy, #[allow(deprecated)]
announce_addr: c.announce_addr, #[allow(deprecated)]
announce_addr_discovered: c.announce_addr_discovered, #[allow(deprecated)]
announce_addr_discovered_port: c.announce_addr_discovered_port, #[allow(deprecated)]
announce_addr_dns: c.announce_addr_dns, #[allow(deprecated)]
autolisten: c.autolisten, #[allow(deprecated)]
bind_addr: c.bind_addr, #[allow(deprecated)]
bookkeeper_db: c.bookkeeper_db, #[allow(deprecated)]
bookkeeper_dir: c.bookkeeper_dir, #[allow(deprecated)]
cltv_delta: c.cltv_delta, #[allow(deprecated)]
cltv_final: c.cltv_final, #[allow(deprecated)]
commit_fee: c.commit_fee, commit_feerate_offset: c.commit_feerate_offset, #[allow(deprecated)]
commit_time: c.commit_time, #[allow(deprecated)]
conf: c.conf, configs: c.configs.map(|v| v.into()),
#[allow(deprecated)]
daemon: c.daemon, #[allow(deprecated)]
database_upgrade: c.database_upgrade, #[allow(deprecated)]
dev_allowdustreserve: c.dev_allowdustreserve, developer: c.developer, #[allow(deprecated)]
disable_dns: c.disable_dns, disable_plugin: c.disable_plugin.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), #[allow(deprecated)]
encrypted_hsm: c.encrypted_hsm, #[allow(deprecated)]
experimental_dual_fund: c.experimental_dual_fund, #[allow(deprecated)]
experimental_offers: c.experimental_offers, #[allow(deprecated)]
experimental_onion_messages: c.experimental_onion_messages, #[allow(deprecated)]
experimental_peer_storage: c.experimental_peer_storage, #[allow(deprecated)]
experimental_quiesce: c.experimental_quiesce, #[allow(deprecated)]
experimental_shutdown_wrong_funding: c.experimental_shutdown_wrong_funding, #[allow(deprecated)]
experimental_splicing: c.experimental_splicing, #[allow(deprecated)]
experimental_upgrade_protocol: c.experimental_upgrade_protocol, #[allow(deprecated)]
fee_base: c.fee_base, #[allow(deprecated)]
fee_per_satoshi: c.fee_per_satoshi, #[allow(deprecated)]
fetchinvoice_noconnect: c.fetchinvoice_noconnect, #[allow(deprecated)]
force_feerates: c.force_feerates, #[allow(deprecated)]
funding_confirms: c.funding_confirms, #[allow(deprecated)]
htlc_maximum_msat: c.htlc_maximum_msat.map(|f| f.into()), #[allow(deprecated)]
htlc_minimum_msat: c.htlc_minimum_msat.map(|f| f.into()), #[allow(deprecated)]
ignore_fee_limits: c.ignore_fee_limits, important_plugins: c.important_plugins.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), invoices_onchain_fallback: c.invoices_onchain_fallback, #[allow(deprecated)]
large_channels: c.large_channels, #[allow(deprecated)]
lightning_dir: c.lightning_dir, #[allow(deprecated)]
log_file: c.log_file, #[allow(deprecated)]
log_level: c.log_level, #[allow(deprecated)]
log_prefix: c.log_prefix, #[allow(deprecated)]
log_timestamps: c.log_timestamps, #[allow(deprecated)]
max_concurrent_htlcs: c.max_concurrent_htlcs, #[allow(deprecated)]
max_dust_htlc_exposure_msat: c.max_dust_htlc_exposure_msat.map(|f| f.into()), #[allow(deprecated)]
max_locktime_blocks: c.max_locktime_blocks, #[allow(deprecated)]
min_capacity_sat: c.min_capacity_sat, min_emergency_msat: c.min_emergency_msat.map(|f| f.into()), #[allow(deprecated)]
network: c.network, #[allow(deprecated)]
offline: c.offline, #[allow(deprecated)]
pid_file: c.pid_file, plugins: c.plugins.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), #[allow(deprecated)]
proxy: c.proxy, #[allow(deprecated)]
require_confirmed_inputs: c.require_confirmed_inputs, #[allow(deprecated)]
rescan: c.rescan, #[allow(deprecated)]
rgb: c.rgb.map(|v| hex::decode(v).unwrap()), #[allow(deprecated)]
rpc_file: c.rpc_file, #[allow(deprecated)]
rpc_file_mode: c.rpc_file_mode, #[allow(deprecated)]
subdaemon: c.subdaemon, #[allow(deprecated)]
tor_service_password: c.tor_service_password, #[allow(deprecated)]
wallet: c.wallet, #[allow(deprecated)]
watchtime_blocks: c.watchtime_blocks, }
}
}
#[allow(unused_variables)]
impl From<responses::StopResponse> for pb::StopResponse {
fn from(c: responses::StopResponse) -> Self {
Self {
result: c.result.map(|v| v as i32),
}
}
}
#[allow(unused_variables)]
impl From<responses::HelpHelp> for pb::HelpHelp {
fn from(c: responses::HelpHelp) -> Self {
Self {
command: c.command, }
}
}
#[allow(unused_variables)]
impl From<responses::HelpResponse> for pb::HelpResponse {
fn from(c: responses::HelpResponse) -> Self {
Self {
format_hint: c.format_hint.map(|v| v as i32),
help: c.help.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::PreapprovekeysendResponse> for pb::PreapprovekeysendResponse {
fn from(c: responses::PreapprovekeysendResponse) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<responses::PreapproveinvoiceResponse> for pb::PreapproveinvoiceResponse {
fn from(c: responses::PreapproveinvoiceResponse) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<responses::StaticbackupResponse> for pb::StaticbackupResponse {
fn from(c: responses::StaticbackupResponse) -> Self {
Self {
scb: c.scb.into_iter().map(|i| hex::decode(i).unwrap()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::BkprchannelsapyChannels_apy> for pb::BkprchannelsapyChannelsApy {
fn from(c: responses::BkprchannelsapyChannels_apy) -> Self {
Self {
account: c.account, apy_in: c.apy_in, apy_in_initial: c.apy_in_initial, apy_lease: c.apy_lease, apy_out: c.apy_out, apy_out_initial: c.apy_out_initial, apy_total: c.apy_total, apy_total_initial: c.apy_total_initial, channel_start_balance_msat: Some(c.channel_start_balance_msat.into()), fees_in_msat: c.fees_in_msat.map(|f| f.into()), fees_out_msat: Some(c.fees_out_msat.into()), lease_fee_earned_msat: Some(c.lease_fee_earned_msat.into()), lease_fee_paid_msat: Some(c.lease_fee_paid_msat.into()), our_start_balance_msat: Some(c.our_start_balance_msat.into()), pushed_in_msat: Some(c.pushed_in_msat.into()), pushed_out_msat: Some(c.pushed_out_msat.into()), routed_in_msat: Some(c.routed_in_msat.into()), routed_out_msat: Some(c.routed_out_msat.into()), utilization_in: c.utilization_in, utilization_in_initial: c.utilization_in_initial, utilization_out: c.utilization_out, utilization_out_initial: c.utilization_out_initial, }
}
}
#[allow(unused_variables)]
impl From<responses::BkprchannelsapyResponse> for pb::BkprchannelsapyResponse {
fn from(c: responses::BkprchannelsapyResponse) -> Self {
Self {
channels_apy: c.channels_apy.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::BkprdumpincomecsvResponse> for pb::BkprdumpincomecsvResponse {
fn from(c: responses::BkprdumpincomecsvResponse) -> Self {
Self {
csv_file: c.csv_file, csv_format: c.csv_format as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::BkprinspectTxsOutputs> for pb::BkprinspectTxsOutputs {
fn from(c: responses::BkprinspectTxsOutputs) -> Self {
Self {
account: c.account, credit_msat: c.credit_msat.map(|f| f.into()), currency: c.currency, debit_msat: c.debit_msat.map(|f| f.into()), originating_account: c.originating_account, outnum: c.outnum, output_tag: c.output_tag, output_value_msat: Some(c.output_value_msat.into()), payment_id: c.payment_id.map(|v| hex::decode(v).unwrap()), spend_tag: c.spend_tag, spending_txid: c.spending_txid.map(|v| hex::decode(v).unwrap()), }
}
}
#[allow(unused_variables)]
impl From<responses::BkprinspectTxs> for pb::BkprinspectTxs {
fn from(c: responses::BkprinspectTxs) -> Self {
Self {
blockheight: c.blockheight, fees_paid_msat: Some(c.fees_paid_msat.into()), outputs: c.outputs.into_iter().map(|i| i.into()).collect(), txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<responses::BkprinspectResponse> for pb::BkprinspectResponse {
fn from(c: responses::BkprinspectResponse) -> Self {
Self {
txs: c.txs.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::BkprlistaccounteventsEvents> for pb::BkprlistaccounteventsEvents {
fn from(c: responses::BkprlistaccounteventsEvents) -> Self {
Self {
account: c.account, blockheight: c.blockheight, credit_msat: Some(c.credit_msat.into()), currency: c.currency, debit_msat: Some(c.debit_msat.into()), description: c.description, fees_msat: c.fees_msat.map(|f| f.into()), is_rebalance: c.is_rebalance, origin: c.origin, outpoint: c.outpoint, part_id: c.part_id, payment_id: c.payment_id.map(|v| hex::decode(v).unwrap()), tag: c.tag, timestamp: c.timestamp, txid: c.txid.map(|v| hex::decode(v).unwrap()), item_type: c.item_type as i32,
}
}
}
#[allow(unused_variables)]
impl From<responses::BkprlistaccounteventsResponse> for pb::BkprlistaccounteventsResponse {
fn from(c: responses::BkprlistaccounteventsResponse) -> Self {
Self {
events: c.events.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::BkprlistbalancesAccountsBalances> for pb::BkprlistbalancesAccountsBalances {
fn from(c: responses::BkprlistbalancesAccountsBalances) -> Self {
Self {
balance_msat: Some(c.balance_msat.into()), coin_type: c.coin_type, }
}
}
#[allow(unused_variables)]
impl From<responses::BkprlistbalancesAccounts> for pb::BkprlistbalancesAccounts {
fn from(c: responses::BkprlistbalancesAccounts) -> Self {
Self {
account: c.account, account_closed: c.account_closed, account_resolved: c.account_resolved, balances: c.balances.into_iter().map(|i| i.into()).collect(), peer_id: c.peer_id.map(|v| v.serialize().to_vec()), resolved_at_block: c.resolved_at_block, we_opened: c.we_opened, }
}
}
#[allow(unused_variables)]
impl From<responses::BkprlistbalancesResponse> for pb::BkprlistbalancesResponse {
fn from(c: responses::BkprlistbalancesResponse) -> Self {
Self {
accounts: c.accounts.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::BkprlistincomeIncome_events> for pb::BkprlistincomeIncomeEvents {
fn from(c: responses::BkprlistincomeIncome_events) -> Self {
Self {
account: c.account, credit_msat: Some(c.credit_msat.into()), currency: c.currency, debit_msat: Some(c.debit_msat.into()), description: c.description, outpoint: c.outpoint, payment_id: c.payment_id.map(|v| hex::decode(v).unwrap()), tag: c.tag, timestamp: c.timestamp, txid: c.txid.map(|v| hex::decode(v).unwrap()), }
}
}
#[allow(unused_variables)]
impl From<responses::BkprlistincomeResponse> for pb::BkprlistincomeResponse {
fn from(c: responses::BkprlistincomeResponse) -> Self {
Self {
income_events: c.income_events.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::BlacklistruneBlacklist> for pb::BlacklistruneBlacklist {
fn from(c: responses::BlacklistruneBlacklist) -> Self {
Self {
end: c.end, start: c.start, }
}
}
#[allow(unused_variables)]
impl From<responses::BlacklistruneResponse> for pb::BlacklistruneResponse {
fn from(c: responses::BlacklistruneResponse) -> Self {
Self {
blacklist: c.blacklist.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<responses::CheckruneResponse> for pb::CheckruneResponse {
fn from(c: responses::CheckruneResponse) -> Self {
Self {
valid: c.valid, }
}
}
#[allow(unused_variables)]
impl From<responses::CreateruneResponse> for pb::CreateruneResponse {
fn from(c: responses::CreateruneResponse) -> Self {
Self {
rune: c.rune, unique_id: c.unique_id, warning_unrestricted_rune: c.warning_unrestricted_rune, }
}
}
#[allow(unused_variables)]
impl From<responses::ShowrunesRunesRestrictionsAlternatives> for pb::ShowrunesRunesRestrictionsAlternatives {
fn from(c: responses::ShowrunesRunesRestrictionsAlternatives) -> Self {
Self {
condition: c.condition, english: c.english, fieldname: c.fieldname, value: c.value, }
}
}
#[allow(unused_variables)]
impl From<responses::ShowrunesRunesRestrictions> for pb::ShowrunesRunesRestrictions {
fn from(c: responses::ShowrunesRunesRestrictions) -> Self {
Self {
alternatives: c.alternatives.into_iter().map(|i| i.into()).collect(), english: c.english, }
}
}
#[allow(unused_variables)]
impl From<responses::ShowrunesRunes> for pb::ShowrunesRunes {
fn from(c: responses::ShowrunesRunes) -> Self {
Self {
blacklisted: c.blacklisted, last_used: c.last_used, our_rune: c.our_rune, restrictions: c.restrictions.into_iter().map(|i| i.into()).collect(), restrictions_as_english: c.restrictions_as_english, rune: c.rune, stored: c.stored, unique_id: c.unique_id, }
}
}
#[allow(unused_variables)]
impl From<responses::ShowrunesResponse> for pb::ShowrunesResponse {
fn from(c: responses::ShowrunesResponse) -> Self {
Self {
runes: c.runes.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<notifications::BlockAddedNotification> for pb::BlockAddedNotification {
fn from(c: notifications::BlockAddedNotification) -> Self {
Self {
hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.hash).to_vec(), height: c.height, }
}
}
#[allow(unused_variables)]
impl From<notifications::ChannelOpenFailedNotification> for pb::ChannelOpenFailedNotification {
fn from(c: notifications::ChannelOpenFailedNotification) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), }
}
}
#[allow(unused_variables)]
impl From<notifications::ChannelOpenedNotification> for pb::ChannelOpenedNotification {
fn from(c: notifications::ChannelOpenedNotification) -> Self {
Self {
channel_ready: c.channel_ready, funding_msat: Some(c.funding_msat.into()), funding_txid: hex::decode(&c.funding_txid).unwrap(), id: c.id.serialize().to_vec(), }
}
}
#[allow(unused_variables)]
impl From<notifications::ConnectAddress> for pb::PeerConnectAddress {
fn from(c: notifications::ConnectAddress) -> Self {
Self {
address: c.address, port: c.port.map(|v| v.into()), socket: c.socket, item_type: c.item_type as i32,
}
}
}
#[allow(unused_variables)]
impl From<notifications::ConnectNotification> for pb::PeerConnectNotification {
fn from(c: notifications::ConnectNotification) -> Self {
Self {
address: Some(c.address.into()),
direction: c.direction as i32,
id: c.id.serialize().to_vec(), }
}
}
#[allow(unused_variables)]
impl From<notifications::CustomMsgNotification> for pb::CustomMsgNotification {
fn from(c: notifications::CustomMsgNotification) -> Self {
Self {
payload: hex::decode(&c.payload).unwrap(), peer_id: c.peer_id.serialize().to_vec(), }
}
}
#[allow(unused_variables)]
impl From<requests::GetinfoRequest> for pb::GetinfoRequest {
fn from(c: requests::GetinfoRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<requests::ListpeersRequest> for pb::ListpeersRequest {
fn from(c: requests::ListpeersRequest) -> Self {
Self {
id: c.id.map(|v| v.serialize().to_vec()), level: c.level.map(|v| v as i32),
}
}
}
#[allow(unused_variables)]
impl From<requests::ListfundsRequest> for pb::ListfundsRequest {
fn from(c: requests::ListfundsRequest) -> Self {
Self {
spent: c.spent, }
}
}
#[allow(unused_variables)]
impl From<requests::SendpayRoute> for pb::SendpayRoute {
fn from(c: requests::SendpayRoute) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), channel: c.channel.to_string(), delay: c.delay, id: c.id.serialize().to_vec(), }
}
}
#[allow(unused_variables)]
impl From<requests::SendpayRequest> for pb::SendpayRequest {
fn from(c: requests::SendpayRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), bolt11: c.bolt11, description: c.description, groupid: c.groupid, label: c.label, localinvreqid: c.localinvreqid.map(|v| hex::decode(v).unwrap()), partid: c.partid, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), payment_metadata: c.payment_metadata.map(|v| hex::decode(v).unwrap()), payment_secret: c.payment_secret.map(|v| v.to_vec()), route: c.route.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<requests::ListchannelsRequest> for pb::ListchannelsRequest {
fn from(c: requests::ListchannelsRequest) -> Self {
Self {
destination: c.destination.map(|v| v.serialize().to_vec()), short_channel_id: c.short_channel_id.map(|v| v.to_string()), source: c.source.map(|v| v.serialize().to_vec()), }
}
}
#[allow(unused_variables)]
impl From<requests::AddgossipRequest> for pb::AddgossipRequest {
fn from(c: requests::AddgossipRequest) -> Self {
Self {
message: hex::decode(&c.message).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<requests::AddpsbtoutputRequest> for pb::AddpsbtoutputRequest {
fn from(c: requests::AddpsbtoutputRequest) -> Self {
Self {
destination: c.destination, initialpsbt: c.initialpsbt, locktime: c.locktime, satoshi: Some(c.satoshi.into()), }
}
}
#[allow(unused_variables)]
impl From<requests::AutocleanonceRequest> for pb::AutocleanonceRequest {
fn from(c: requests::AutocleanonceRequest) -> Self {
Self {
age: c.age, subsystem: c.subsystem as i32,
}
}
}
#[allow(unused_variables)]
impl From<requests::AutocleanstatusRequest> for pb::AutocleanstatusRequest {
fn from(c: requests::AutocleanstatusRequest) -> Self {
Self {
subsystem: c.subsystem.map(|v| v as i32),
}
}
}
#[allow(unused_variables)]
impl From<requests::CheckmessageRequest> for pb::CheckmessageRequest {
fn from(c: requests::CheckmessageRequest) -> Self {
Self {
message: c.message, pubkey: c.pubkey.map(|v| v.serialize().to_vec()), zbase: c.zbase, }
}
}
#[allow(unused_variables)]
impl From<requests::CloseRequest> for pb::CloseRequest {
fn from(c: requests::CloseRequest) -> Self {
Self {
destination: c.destination, fee_negotiation_step: c.fee_negotiation_step, feerange: c.feerange.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), force_lease_closed: c.force_lease_closed, id: c.id, unilateraltimeout: c.unilateraltimeout, wrong_funding: c.wrong_funding.map(|o|o.into()), }
}
}
#[allow(unused_variables)]
impl From<requests::ConnectRequest> for pb::ConnectRequest {
fn from(c: requests::ConnectRequest) -> Self {
Self {
host: c.host, id: c.id, port: c.port.map(|v| v.into()), }
}
}
#[allow(unused_variables)]
impl From<requests::CreateinvoiceRequest> for pb::CreateinvoiceRequest {
fn from(c: requests::CreateinvoiceRequest) -> Self {
Self {
invstring: c.invstring, label: c.label, preimage: hex::decode(&c.preimage).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<requests::DatastoreRequest> for pb::DatastoreRequest {
fn from(c: requests::DatastoreRequest) -> Self {
Self {
generation: c.generation, hex: c.hex.map(|v| hex::decode(v).unwrap()), key: c.key.into_iter().map(|i| i.into()).collect(), mode: c.mode.map(|v| v as i32),
string: c.string, }
}
}
#[allow(unused_variables)]
impl From<requests::DatastoreusageRequest> for pb::DatastoreusageRequest {
fn from(c: requests::DatastoreusageRequest) -> Self {
Self {
key: c.key.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), }
}
}
#[allow(unused_variables)]
impl From<requests::CreateonionHops> for pb::CreateonionHops {
fn from(c: requests::CreateonionHops) -> Self {
Self {
payload: hex::decode(&c.payload).unwrap(), pubkey: c.pubkey.serialize().to_vec(), }
}
}
#[allow(unused_variables)]
impl From<requests::CreateonionRequest> for pb::CreateonionRequest {
fn from(c: requests::CreateonionRequest) -> Self {
Self {
assocdata: hex::decode(&c.assocdata).unwrap(), hops: c.hops.into_iter().map(|i| i.into()).collect(), onion_size: c.onion_size.map(|v| v.into()), session_key: c.session_key.map(|v| v.to_vec()), }
}
}
#[allow(unused_variables)]
impl From<requests::DeldatastoreRequest> for pb::DeldatastoreRequest {
fn from(c: requests::DeldatastoreRequest) -> Self {
Self {
generation: c.generation, key: c.key.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<requests::DelinvoiceRequest> for pb::DelinvoiceRequest {
fn from(c: requests::DelinvoiceRequest) -> Self {
Self {
desconly: c.desconly, label: c.label, status: c.status as i32,
}
}
}
#[allow(unused_variables)]
impl From<requests::DevforgetchannelRequest> for pb::DevforgetchannelRequest {
fn from(c: requests::DevforgetchannelRequest) -> Self {
Self {
channel_id: c.channel_id.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), force: c.force, id: c.id.serialize().to_vec(), short_channel_id: c.short_channel_id.map(|v| v.to_string()), }
}
}
#[allow(unused_variables)]
impl From<requests::EmergencyrecoverRequest> for pb::EmergencyrecoverRequest {
fn from(c: requests::EmergencyrecoverRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<requests::RecoverRequest> for pb::RecoverRequest {
fn from(c: requests::RecoverRequest) -> Self {
Self {
hsmsecret: c.hsmsecret, }
}
}
#[allow(unused_variables)]
impl From<requests::RecoverchannelRequest> for pb::RecoverchannelRequest {
fn from(c: requests::RecoverchannelRequest) -> Self {
Self {
scb: c.scb.into_iter().map(|i| hex::decode(i).unwrap()).collect(), }
}
}
#[allow(unused_variables)]
impl From<requests::InvoiceRequest> for pb::InvoiceRequest {
fn from(c: requests::InvoiceRequest) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), cltv: c.cltv, deschashonly: c.deschashonly, description: c.description, expiry: c.expiry, exposeprivatechannels: c.exposeprivatechannels.map(|arr| arr.into_iter().map(|i| i.to_string()).collect()).unwrap_or(vec![]), fallbacks: c.fallbacks.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), label: c.label, preimage: c.preimage.map(|v| hex::decode(v).unwrap()), }
}
}
#[allow(unused_variables)]
impl From<requests::InvoicerequestRequest> for pb::InvoicerequestRequest {
fn from(c: requests::InvoicerequestRequest) -> Self {
Self {
absolute_expiry: c.absolute_expiry, amount: Some(c.amount.into()), description: c.description, issuer: c.issuer, label: c.label, single_use: c.single_use, }
}
}
#[allow(unused_variables)]
impl From<requests::DisableinvoicerequestRequest> for pb::DisableinvoicerequestRequest {
fn from(c: requests::DisableinvoicerequestRequest) -> Self {
Self {
invreq_id: c.invreq_id, }
}
}
#[allow(unused_variables)]
impl From<requests::ListinvoicerequestsRequest> for pb::ListinvoicerequestsRequest {
fn from(c: requests::ListinvoicerequestsRequest) -> Self {
Self {
active_only: c.active_only, invreq_id: c.invreq_id, }
}
}
#[allow(unused_variables)]
impl From<requests::ListdatastoreRequest> for pb::ListdatastoreRequest {
fn from(c: requests::ListdatastoreRequest) -> Self {
Self {
key: c.key.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), }
}
}
#[allow(unused_variables)]
impl From<requests::ListinvoicesRequest> for pb::ListinvoicesRequest {
fn from(c: requests::ListinvoicesRequest) -> Self {
Self {
index: c.index.map(|v| v as i32),
invstring: c.invstring, label: c.label, limit: c.limit, offer_id: c.offer_id, payment_hash: c.payment_hash.map(|v| hex::decode(v).unwrap()), start: c.start, }
}
}
#[allow(unused_variables)]
impl From<requests::SendonionFirst_hop> for pb::SendonionFirstHop {
fn from(c: requests::SendonionFirst_hop) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), delay: c.delay.into(), id: c.id.serialize().to_vec(), }
}
}
#[allow(unused_variables)]
impl From<requests::SendonionRequest> for pb::SendonionRequest {
fn from(c: requests::SendonionRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), bolt11: c.bolt11, description: c.description, destination: c.destination.map(|v| v.serialize().to_vec()), first_hop: Some(c.first_hop.into()),
groupid: c.groupid, label: c.label, localinvreqid: c.localinvreqid.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), onion: hex::decode(&c.onion).unwrap(), partid: c.partid.map(|v| v.into()), payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), shared_secrets: c.shared_secrets.map(|arr| arr.into_iter().map(|i| i.to_vec()).collect()).unwrap_or(vec![]), }
}
}
#[allow(unused_variables)]
impl From<requests::ListsendpaysRequest> for pb::ListsendpaysRequest {
fn from(c: requests::ListsendpaysRequest) -> Self {
Self {
bolt11: c.bolt11, index: c.index.map(|v| v as i32),
limit: c.limit, payment_hash: c.payment_hash.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), start: c.start, status: c.status.map(|v| v as i32),
}
}
}
#[allow(unused_variables)]
impl From<requests::ListtransactionsRequest> for pb::ListtransactionsRequest {
fn from(c: requests::ListtransactionsRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<requests::MakesecretRequest> for pb::MakesecretRequest {
fn from(c: requests::MakesecretRequest) -> Self {
Self {
hex: c.hex.map(|v| hex::decode(v).unwrap()), string: c.string, }
}
}
#[allow(unused_variables)]
impl From<requests::PayRequest> for pb::PayRequest {
fn from(c: requests::PayRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), bolt11: c.bolt11, description: c.description, exclude: c.exclude.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), exemptfee: c.exemptfee.map(|f| f.into()), label: c.label, localinvreqid: c.localinvreqid.map(|v| hex::decode(v).unwrap()), maxdelay: c.maxdelay.map(|v| v.into()), maxfee: c.maxfee.map(|f| f.into()), maxfeepercent: c.maxfeepercent, partial_msat: c.partial_msat.map(|f| f.into()), retry_for: c.retry_for.map(|v| v.into()), riskfactor: c.riskfactor, }
}
}
#[allow(unused_variables)]
impl From<requests::ListnodesRequest> for pb::ListnodesRequest {
fn from(c: requests::ListnodesRequest) -> Self {
Self {
id: c.id.map(|v| v.serialize().to_vec()), }
}
}
#[allow(unused_variables)]
impl From<requests::WaitanyinvoiceRequest> for pb::WaitanyinvoiceRequest {
fn from(c: requests::WaitanyinvoiceRequest) -> Self {
Self {
lastpay_index: c.lastpay_index, timeout: c.timeout, }
}
}
#[allow(unused_variables)]
impl From<requests::WaitinvoiceRequest> for pb::WaitinvoiceRequest {
fn from(c: requests::WaitinvoiceRequest) -> Self {
Self {
label: c.label, }
}
}
#[allow(unused_variables)]
impl From<requests::WaitsendpayRequest> for pb::WaitsendpayRequest {
fn from(c: requests::WaitsendpayRequest) -> Self {
Self {
groupid: c.groupid, partid: c.partid, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), timeout: c.timeout, }
}
}
#[allow(unused_variables)]
impl From<requests::NewaddrRequest> for pb::NewaddrRequest {
fn from(c: requests::NewaddrRequest) -> Self {
Self {
addresstype: c.addresstype.map(|v| v as i32),
}
}
}
#[allow(unused_variables)]
impl From<requests::WithdrawRequest> for pb::WithdrawRequest {
fn from(c: requests::WithdrawRequest) -> Self {
Self {
destination: c.destination, feerate: c.feerate.map(|o|o.into()), minconf: c.minconf.map(|v| v.into()), satoshi: Some(c.satoshi.into()), utxos: c.utxos.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), }
}
}
#[allow(unused_variables)]
impl From<requests::KeysendRequest> for pb::KeysendRequest {
fn from(c: requests::KeysendRequest) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), destination: c.destination.serialize().to_vec(), exemptfee: c.exemptfee.map(|f| f.into()), extratlvs: c.extratlvs.map(|s| s.into()), label: c.label, maxdelay: c.maxdelay, maxfeepercent: c.maxfeepercent, retry_for: c.retry_for, routehints: c.routehints.map(|rl| rl.into()), }
}
}
#[allow(unused_variables)]
impl From<requests::FundpsbtRequest> for pb::FundpsbtRequest {
fn from(c: requests::FundpsbtRequest) -> Self {
Self {
excess_as_change: c.excess_as_change, feerate: Some(c.feerate.into()), locktime: c.locktime, min_witness_weight: c.min_witness_weight, minconf: c.minconf, nonwrapped: c.nonwrapped, opening_anchor_channel: c.opening_anchor_channel, reserve: c.reserve, satoshi: Some(c.satoshi.into()), startweight: c.startweight, }
}
}
#[allow(unused_variables)]
impl From<requests::SendpsbtRequest> for pb::SendpsbtRequest {
fn from(c: requests::SendpsbtRequest) -> Self {
Self {
psbt: c.psbt, reserve: c.reserve, }
}
}
#[allow(unused_variables)]
impl From<requests::SignpsbtRequest> for pb::SignpsbtRequest {
fn from(c: requests::SignpsbtRequest) -> Self {
Self {
psbt: c.psbt, signonly: c.signonly.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), }
}
}
#[allow(unused_variables)]
impl From<requests::UtxopsbtRequest> for pb::UtxopsbtRequest {
fn from(c: requests::UtxopsbtRequest) -> Self {
Self {
excess_as_change: c.excess_as_change, feerate: Some(c.feerate.into()), locktime: c.locktime, min_witness_weight: c.min_witness_weight, opening_anchor_channel: c.opening_anchor_channel, reserve: c.reserve, reservedok: c.reservedok, satoshi: Some(c.satoshi.into()), startweight: c.startweight, utxos: c.utxos.into_iter().map(|i| i.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<requests::TxdiscardRequest> for pb::TxdiscardRequest {
fn from(c: requests::TxdiscardRequest) -> Self {
Self {
txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<requests::TxprepareRequest> for pb::TxprepareRequest {
fn from(c: requests::TxprepareRequest) -> Self {
Self {
feerate: c.feerate.map(|o|o.into()), minconf: c.minconf, outputs: c.outputs.into_iter().map(|i| i.into()).collect(), utxos: c.utxos.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), }
}
}
#[allow(unused_variables)]
impl From<requests::TxsendRequest> for pb::TxsendRequest {
fn from(c: requests::TxsendRequest) -> Self {
Self {
txid: hex::decode(&c.txid).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<requests::ListpeerchannelsRequest> for pb::ListpeerchannelsRequest {
fn from(c: requests::ListpeerchannelsRequest) -> Self {
Self {
id: c.id.map(|v| v.serialize().to_vec()), }
}
}
#[allow(unused_variables)]
impl From<requests::ListclosedchannelsRequest> for pb::ListclosedchannelsRequest {
fn from(c: requests::ListclosedchannelsRequest) -> Self {
Self {
id: c.id.map(|v| v.serialize().to_vec()), }
}
}
#[allow(unused_variables)]
impl From<requests::DecodepayRequest> for pb::DecodepayRequest {
fn from(c: requests::DecodepayRequest) -> Self {
Self {
bolt11: c.bolt11, description: c.description, }
}
}
#[allow(unused_variables)]
impl From<requests::DecodeRequest> for pb::DecodeRequest {
fn from(c: requests::DecodeRequest) -> Self {
Self {
string: c.string, }
}
}
#[allow(unused_variables)]
impl From<requests::DelpayRequest> for pb::DelpayRequest {
fn from(c: requests::DelpayRequest) -> Self {
Self {
groupid: c.groupid, partid: c.partid, payment_hash: <Sha256 as AsRef<[u8]>>::as_ref(&c.payment_hash).to_vec(), status: c.status as i32,
}
}
}
#[allow(unused_variables)]
impl From<requests::DelforwardRequest> for pb::DelforwardRequest {
fn from(c: requests::DelforwardRequest) -> Self {
Self {
in_channel: c.in_channel.to_string(), in_htlc_id: c.in_htlc_id, status: c.status as i32,
}
}
}
#[allow(unused_variables)]
impl From<requests::DisableofferRequest> for pb::DisableofferRequest {
fn from(c: requests::DisableofferRequest) -> Self {
Self {
offer_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.offer_id).to_vec(), }
}
}
#[allow(unused_variables)]
impl From<requests::DisconnectRequest> for pb::DisconnectRequest {
fn from(c: requests::DisconnectRequest) -> Self {
Self {
force: c.force, id: c.id.serialize().to_vec(), }
}
}
#[allow(unused_variables)]
impl From<requests::FeeratesRequest> for pb::FeeratesRequest {
fn from(c: requests::FeeratesRequest) -> Self {
Self {
style: c.style as i32,
}
}
}
#[allow(unused_variables)]
impl From<requests::FetchinvoiceRequest> for pb::FetchinvoiceRequest {
fn from(c: requests::FetchinvoiceRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), offer: c.offer, payer_note: c.payer_note, quantity: c.quantity, recurrence_counter: c.recurrence_counter, recurrence_label: c.recurrence_label, recurrence_start: c.recurrence_start, timeout: c.timeout, }
}
}
#[allow(unused_variables)]
impl From<requests::Fundchannel_cancelRequest> for pb::FundchannelCancelRequest {
fn from(c: requests::Fundchannel_cancelRequest) -> Self {
Self {
id: c.id.serialize().to_vec(), }
}
}
#[allow(unused_variables)]
impl From<requests::Fundchannel_completeRequest> for pb::FundchannelCompleteRequest {
fn from(c: requests::Fundchannel_completeRequest) -> Self {
Self {
id: c.id.serialize().to_vec(), psbt: c.psbt, }
}
}
#[allow(unused_variables)]
impl From<requests::FundchannelRequest> for pb::FundchannelRequest {
fn from(c: requests::FundchannelRequest) -> Self {
Self {
amount: Some(c.amount.into()), announce: c.announce, channel_type: c.channel_type.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), close_to: c.close_to, compact_lease: c.compact_lease, feerate: c.feerate.map(|o|o.into()), id: c.id.serialize().to_vec(), minconf: c.minconf, mindepth: c.mindepth, push_msat: c.push_msat.map(|f| f.into()), request_amt: c.request_amt.map(|f| f.into()), reserve: c.reserve.map(|f| f.into()), utxos: c.utxos.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), }
}
}
#[allow(unused_variables)]
impl From<requests::Fundchannel_startRequest> for pb::FundchannelStartRequest {
fn from(c: requests::Fundchannel_startRequest) -> Self {
Self {
amount: Some(c.amount.into()), announce: c.announce, channel_type: c.channel_type.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), close_to: c.close_to, feerate: c.feerate.map(|o|o.into()), id: c.id.serialize().to_vec(), mindepth: c.mindepth, push_msat: c.push_msat.map(|f| f.into()), reserve: c.reserve.map(|f| f.into()), }
}
}
#[allow(unused_variables)]
impl From<requests::GetlogRequest> for pb::GetlogRequest {
fn from(c: requests::GetlogRequest) -> Self {
Self {
level: c.level.map(|v| v as i32),
}
}
}
#[allow(unused_variables)]
impl From<requests::FunderupdateRequest> for pb::FunderupdateRequest {
fn from(c: requests::FunderupdateRequest) -> Self {
Self {
channel_fee_max_base_msat: c.channel_fee_max_base_msat.map(|f| f.into()), channel_fee_max_proportional_thousandths: c.channel_fee_max_proportional_thousandths, compact_lease: c.compact_lease.map(|v| hex::decode(v).unwrap()), fund_probability: c.fund_probability, funding_weight: c.funding_weight, fuzz_percent: c.fuzz_percent, lease_fee_base_msat: c.lease_fee_base_msat.map(|f| f.into()), lease_fee_basis: c.lease_fee_basis, leases_only: c.leases_only, max_their_funding_msat: c.max_their_funding_msat.map(|f| f.into()), min_their_funding_msat: c.min_their_funding_msat.map(|f| f.into()), per_channel_max_msat: c.per_channel_max_msat.map(|f| f.into()), per_channel_min_msat: c.per_channel_min_msat.map(|f| f.into()), policy: c.policy.map(|v| v as i32),
policy_mod: c.policy_mod.map(|f| f.into()), reserve_tank_msat: c.reserve_tank_msat.map(|f| f.into()), }
}
}
#[allow(unused_variables)]
impl From<requests::GetrouteRequest> for pb::GetrouteRequest {
fn from(c: requests::GetrouteRequest) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), cltv: c.cltv, exclude: c.exclude.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), fromid: c.fromid.map(|v| v.serialize().to_vec()), fuzzpercent: c.fuzzpercent, id: c.id.serialize().to_vec(), maxhops: c.maxhops, riskfactor: c.riskfactor, }
}
}
#[allow(unused_variables)]
impl From<requests::ListforwardsRequest> for pb::ListforwardsRequest {
fn from(c: requests::ListforwardsRequest) -> Self {
Self {
in_channel: c.in_channel.map(|v| v.to_string()), index: c.index.map(|v| v as i32),
limit: c.limit, out_channel: c.out_channel.map(|v| v.to_string()), start: c.start, status: c.status.map(|v| v as i32),
}
}
}
#[allow(unused_variables)]
impl From<requests::ListoffersRequest> for pb::ListoffersRequest {
fn from(c: requests::ListoffersRequest) -> Self {
Self {
active_only: c.active_only, offer_id: c.offer_id.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), }
}
}
#[allow(unused_variables)]
impl From<requests::ListpaysRequest> for pb::ListpaysRequest {
fn from(c: requests::ListpaysRequest) -> Self {
Self {
bolt11: c.bolt11, payment_hash: c.payment_hash.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec()), status: c.status.map(|v| v as i32),
}
}
}
#[allow(unused_variables)]
impl From<requests::ListhtlcsRequest> for pb::ListhtlcsRequest {
fn from(c: requests::ListhtlcsRequest) -> Self {
Self {
id: c.id, }
}
}
#[allow(unused_variables)]
impl From<requests::MultifundchannelDestinations> for pb::MultifundchannelDestinations {
fn from(c: requests::MultifundchannelDestinations) -> Self {
Self {
amount: Some(c.amount.into()), announce: c.announce, close_to: c.close_to, compact_lease: c.compact_lease, id: c.id, mindepth: c.mindepth, push_msat: c.push_msat.map(|f| f.into()), request_amt: c.request_amt.map(|f| f.into()), reserve: c.reserve.map(|f| f.into()), }
}
}
#[allow(unused_variables)]
impl From<requests::MultifundchannelRequest> for pb::MultifundchannelRequest {
fn from(c: requests::MultifundchannelRequest) -> Self {
Self {
commitment_feerate: c.commitment_feerate.map(|o|o.into()), destinations: c.destinations.into_iter().map(|i| i.into()).collect(), feerate: c.feerate.map(|o|o.into()), minchannels: c.minchannels, minconf: c.minconf, utxos: c.utxos.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), }
}
}
#[allow(unused_variables)]
impl From<requests::MultiwithdrawRequest> for pb::MultiwithdrawRequest {
fn from(c: requests::MultiwithdrawRequest) -> Self {
Self {
feerate: c.feerate.map(|o|o.into()), minconf: c.minconf, outputs: c.outputs.into_iter().map(|i| i.into()).collect(), utxos: c.utxos.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), }
}
}
#[allow(unused_variables)]
impl From<requests::OfferRequest> for pb::OfferRequest {
fn from(c: requests::OfferRequest) -> Self {
Self {
absolute_expiry: c.absolute_expiry, amount: c.amount, description: c.description, issuer: c.issuer, label: c.label, quantity_max: c.quantity_max, recurrence: c.recurrence, recurrence_base: c.recurrence_base, recurrence_limit: c.recurrence_limit, recurrence_paywindow: c.recurrence_paywindow, recurrence_start_any_period: c.recurrence_start_any_period, single_use: c.single_use, }
}
}
#[allow(unused_variables)]
impl From<requests::Openchannel_abortRequest> for pb::OpenchannelAbortRequest {
fn from(c: requests::Openchannel_abortRequest) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), }
}
}
#[allow(unused_variables)]
impl From<requests::Openchannel_bumpRequest> for pb::OpenchannelBumpRequest {
fn from(c: requests::Openchannel_bumpRequest) -> Self {
Self {
amount: Some(c.amount.into()), channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), funding_feerate: c.funding_feerate.map(|o|o.into()), initialpsbt: c.initialpsbt, }
}
}
#[allow(unused_variables)]
impl From<requests::Openchannel_initRequest> for pb::OpenchannelInitRequest {
fn from(c: requests::Openchannel_initRequest) -> Self {
Self {
amount: Some(c.amount.into()), announce: c.announce, channel_type: c.channel_type.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), close_to: c.close_to, commitment_feerate: c.commitment_feerate.map(|o|o.into()), compact_lease: c.compact_lease.map(|v| hex::decode(v).unwrap()), funding_feerate: c.funding_feerate.map(|o|o.into()), id: c.id.serialize().to_vec(), initialpsbt: c.initialpsbt, request_amt: c.request_amt.map(|f| f.into()), }
}
}
#[allow(unused_variables)]
impl From<requests::Openchannel_signedRequest> for pb::OpenchannelSignedRequest {
fn from(c: requests::Openchannel_signedRequest) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), signed_psbt: c.signed_psbt, }
}
}
#[allow(unused_variables)]
impl From<requests::Openchannel_updateRequest> for pb::OpenchannelUpdateRequest {
fn from(c: requests::Openchannel_updateRequest) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), psbt: c.psbt, }
}
}
#[allow(unused_variables)]
impl From<requests::PingRequest> for pb::PingRequest {
fn from(c: requests::PingRequest) -> Self {
Self {
id: c.id.serialize().to_vec(), len: c.len.map(|v| v.into()), pongbytes: c.pongbytes.map(|v| v.into()), }
}
}
#[allow(unused_variables)]
impl From<requests::PluginRequest> for pb::PluginRequest {
fn from(c: requests::PluginRequest) -> Self {
Self {
directory: c.directory, options: c.options.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), plugin: c.plugin, subcommand: c.subcommand as i32,
}
}
}
#[allow(unused_variables)]
impl From<requests::RenepaystatusRequest> for pb::RenepaystatusRequest {
fn from(c: requests::RenepaystatusRequest) -> Self {
Self {
invstring: c.invstring, }
}
}
#[allow(unused_variables)]
impl From<requests::RenepayRequest> for pb::RenepayRequest {
fn from(c: requests::RenepayRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), description: c.description, dev_use_shadow: c.dev_use_shadow, exclude: c.exclude.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), invstring: c.invstring, label: c.label, maxdelay: c.maxdelay, maxfee: c.maxfee.map(|f| f.into()), retry_for: c.retry_for, }
}
}
#[allow(unused_variables)]
impl From<requests::ReserveinputsRequest> for pb::ReserveinputsRequest {
fn from(c: requests::ReserveinputsRequest) -> Self {
Self {
exclusive: c.exclusive, psbt: c.psbt, reserve: c.reserve, }
}
}
#[allow(unused_variables)]
impl From<requests::SendcustommsgRequest> for pb::SendcustommsgRequest {
fn from(c: requests::SendcustommsgRequest) -> Self {
Self {
msg: hex::decode(&c.msg).unwrap(), node_id: c.node_id.serialize().to_vec(), }
}
}
#[allow(unused_variables)]
impl From<requests::SendinvoiceRequest> for pb::SendinvoiceRequest {
fn from(c: requests::SendinvoiceRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|f| f.into()), invreq: c.invreq, label: c.label, quantity: c.quantity, timeout: c.timeout, }
}
}
#[allow(unused_variables)]
impl From<requests::SetchannelRequest> for pb::SetchannelRequest {
fn from(c: requests::SetchannelRequest) -> Self {
Self {
enforcedelay: c.enforcedelay, feebase: c.feebase.map(|f| f.into()), feeppm: c.feeppm, htlcmax: c.htlcmax.map(|f| f.into()), htlcmin: c.htlcmin.map(|f| f.into()), id: c.id, ignorefeelimits: c.ignorefeelimits, }
}
}
#[allow(unused_variables)]
impl From<requests::SetconfigRequest> for pb::SetconfigRequest {
fn from(c: requests::SetconfigRequest) -> Self {
Self {
config: c.config, val: c.val, }
}
}
#[allow(unused_variables)]
impl From<requests::SetpsbtversionRequest> for pb::SetpsbtversionRequest {
fn from(c: requests::SetpsbtversionRequest) -> Self {
Self {
psbt: c.psbt, version: c.version, }
}
}
#[allow(unused_variables)]
impl From<requests::SigninvoiceRequest> for pb::SigninvoiceRequest {
fn from(c: requests::SigninvoiceRequest) -> Self {
Self {
invstring: c.invstring, }
}
}
#[allow(unused_variables)]
impl From<requests::SignmessageRequest> for pb::SignmessageRequest {
fn from(c: requests::SignmessageRequest) -> Self {
Self {
message: c.message, }
}
}
#[allow(unused_variables)]
impl From<requests::Splice_initRequest> for pb::SpliceInitRequest {
fn from(c: requests::Splice_initRequest) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), feerate_per_kw: c.feerate_per_kw, force_feerate: c.force_feerate, initialpsbt: c.initialpsbt, relative_amount: c.relative_amount, }
}
}
#[allow(unused_variables)]
impl From<requests::Splice_signedRequest> for pb::SpliceSignedRequest {
fn from(c: requests::Splice_signedRequest) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), psbt: c.psbt, sign_first: c.sign_first, }
}
}
#[allow(unused_variables)]
impl From<requests::Splice_updateRequest> for pb::SpliceUpdateRequest {
fn from(c: requests::Splice_updateRequest) -> Self {
Self {
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), psbt: c.psbt, }
}
}
#[allow(unused_variables)]
impl From<requests::UnreserveinputsRequest> for pb::UnreserveinputsRequest {
fn from(c: requests::UnreserveinputsRequest) -> Self {
Self {
psbt: c.psbt, reserve: c.reserve, }
}
}
#[allow(unused_variables)]
impl From<requests::UpgradewalletRequest> for pb::UpgradewalletRequest {
fn from(c: requests::UpgradewalletRequest) -> Self {
Self {
feerate: c.feerate.map(|o|o.into()), reservedok: c.reservedok, }
}
}
#[allow(unused_variables)]
impl From<requests::WaitblockheightRequest> for pb::WaitblockheightRequest {
fn from(c: requests::WaitblockheightRequest) -> Self {
Self {
blockheight: c.blockheight, timeout: c.timeout, }
}
}
#[allow(unused_variables)]
impl From<requests::WaitRequest> for pb::WaitRequest {
fn from(c: requests::WaitRequest) -> Self {
Self {
indexname: c.indexname as i32,
nextvalue: c.nextvalue, subsystem: c.subsystem as i32,
}
}
}
#[allow(unused_variables)]
impl From<requests::ListconfigsRequest> for pb::ListconfigsRequest {
fn from(c: requests::ListconfigsRequest) -> Self {
Self {
config: c.config, }
}
}
#[allow(unused_variables)]
impl From<requests::StopRequest> for pb::StopRequest {
fn from(c: requests::StopRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<requests::HelpRequest> for pb::HelpRequest {
fn from(c: requests::HelpRequest) -> Self {
Self {
command: c.command, }
}
}
#[allow(unused_variables)]
impl From<requests::PreapprovekeysendRequest> for pb::PreapprovekeysendRequest {
fn from(c: requests::PreapprovekeysendRequest) -> Self {
Self {
amount_msat: Some(c.amount_msat.into()), destination: c.destination.serialize().to_vec(), payment_hash: hex::decode(&c.payment_hash).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<requests::PreapproveinvoiceRequest> for pb::PreapproveinvoiceRequest {
fn from(c: requests::PreapproveinvoiceRequest) -> Self {
Self {
bolt11: c.bolt11, }
}
}
#[allow(unused_variables)]
impl From<requests::StaticbackupRequest> for pb::StaticbackupRequest {
fn from(c: requests::StaticbackupRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<requests::BkprchannelsapyRequest> for pb::BkprchannelsapyRequest {
fn from(c: requests::BkprchannelsapyRequest) -> Self {
Self {
end_time: c.end_time, start_time: c.start_time, }
}
}
#[allow(unused_variables)]
impl From<requests::BkprdumpincomecsvRequest> for pb::BkprdumpincomecsvRequest {
fn from(c: requests::BkprdumpincomecsvRequest) -> Self {
Self {
consolidate_fees: c.consolidate_fees, csv_file: c.csv_file, csv_format: c.csv_format, end_time: c.end_time, start_time: c.start_time, }
}
}
#[allow(unused_variables)]
impl From<requests::BkprinspectRequest> for pb::BkprinspectRequest {
fn from(c: requests::BkprinspectRequest) -> Self {
Self {
account: c.account, }
}
}
#[allow(unused_variables)]
impl From<requests::BkprlistaccounteventsRequest> for pb::BkprlistaccounteventsRequest {
fn from(c: requests::BkprlistaccounteventsRequest) -> Self {
Self {
account: c.account, payment_id: c.payment_id, }
}
}
#[allow(unused_variables)]
impl From<requests::BkprlistbalancesRequest> for pb::BkprlistbalancesRequest {
fn from(c: requests::BkprlistbalancesRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<requests::BkprlistincomeRequest> for pb::BkprlistincomeRequest {
fn from(c: requests::BkprlistincomeRequest) -> Self {
Self {
consolidate_fees: c.consolidate_fees, end_time: c.end_time, start_time: c.start_time, }
}
}
#[allow(unused_variables)]
impl From<requests::BlacklistruneRequest> for pb::BlacklistruneRequest {
fn from(c: requests::BlacklistruneRequest) -> Self {
Self {
end: c.end, start: c.start, }
}
}
#[allow(unused_variables)]
impl From<requests::CheckruneRequest> for pb::CheckruneRequest {
fn from(c: requests::CheckruneRequest) -> Self {
Self {
method: c.method, nodeid: c.nodeid, params: c.params.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), rune: c.rune, }
}
}
#[allow(unused_variables)]
impl From<requests::CreateruneRequest> for pb::CreateruneRequest {
fn from(c: requests::CreateruneRequest) -> Self {
Self {
restrictions: c.restrictions.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), rune: c.rune, }
}
}
#[allow(unused_variables)]
impl From<requests::ShowrunesRequest> for pb::ShowrunesRequest {
fn from(c: requests::ShowrunesRequest) -> Self {
Self {
rune: c.rune, }
}
}
#[allow(unused_variables)]
impl From<notifications::requests::StreamBlockAddedRequest> for pb::StreamBlockAddedRequest {
fn from(c: notifications::requests::StreamBlockAddedRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<notifications::requests::StreamChannelOpenFailedRequest> for pb::StreamChannelOpenFailedRequest {
fn from(c: notifications::requests::StreamChannelOpenFailedRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<notifications::requests::StreamChannelOpenedRequest> for pb::StreamChannelOpenedRequest {
fn from(c: notifications::requests::StreamChannelOpenedRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<notifications::requests::StreamConnectRequest> for pb::StreamConnectRequest {
fn from(c: notifications::requests::StreamConnectRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<notifications::requests::StreamCustomMsgRequest> for pb::StreamCustomMsgRequest {
fn from(c: notifications::requests::StreamCustomMsgRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<pb::GetinfoRequest> for requests::GetinfoRequest {
fn from(c: pb::GetinfoRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<pb::ListpeersRequest> for requests::ListpeersRequest {
fn from(c: pb::ListpeersRequest) -> Self {
Self {
id: c.id.map(|v| PublicKey::from_slice(&v).unwrap()), level: c.level.map(|v| v.try_into().unwrap()),
}
}
}
#[allow(unused_variables)]
impl From<pb::ListfundsRequest> for requests::ListfundsRequest {
fn from(c: pb::ListfundsRequest) -> Self {
Self {
spent: c.spent, }
}
}
#[allow(unused_variables)]
impl From<pb::SendpayRoute> for requests::SendpayRoute {
fn from(c: pb::SendpayRoute) -> Self {
Self {
amount_msat: c.amount_msat.unwrap().into(), channel: cln_rpc::primitives::ShortChannelId::from_str(&c.channel).unwrap(), delay: c.delay, id: PublicKey::from_slice(&c.id).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<pb::SendpayRequest> for requests::SendpayRequest {
fn from(c: pb::SendpayRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|a| a.into()), bolt11: c.bolt11, description: c.description, groupid: c.groupid, label: c.label, localinvreqid: c.localinvreqid.map(|v| hex::encode(v)), partid: c.partid, payment_hash: Sha256::from_slice(&c.payment_hash).unwrap(), payment_metadata: c.payment_metadata.map(|v| hex::encode(v)), payment_secret: c.payment_secret.map(|v| v.try_into().unwrap()), route: c.route.into_iter().map(|s| s.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<pb::ListchannelsRequest> for requests::ListchannelsRequest {
fn from(c: pb::ListchannelsRequest) -> Self {
Self {
destination: c.destination.map(|v| PublicKey::from_slice(&v).unwrap()), short_channel_id: c.short_channel_id.map(|v| cln_rpc::primitives::ShortChannelId::from_str(&v).unwrap()), source: c.source.map(|v| PublicKey::from_slice(&v).unwrap()), }
}
}
#[allow(unused_variables)]
impl From<pb::AddgossipRequest> for requests::AddgossipRequest {
fn from(c: pb::AddgossipRequest) -> Self {
Self {
message: hex::encode(&c.message), }
}
}
#[allow(unused_variables)]
impl From<pb::AddpsbtoutputRequest> for requests::AddpsbtoutputRequest {
fn from(c: pb::AddpsbtoutputRequest) -> Self {
Self {
destination: c.destination, initialpsbt: c.initialpsbt, locktime: c.locktime, satoshi: c.satoshi.unwrap().into(), }
}
}
#[allow(unused_variables)]
impl From<pb::AutocleanonceRequest> for requests::AutocleanonceRequest {
fn from(c: pb::AutocleanonceRequest) -> Self {
Self {
age: c.age, subsystem: c.subsystem.try_into().unwrap(),
}
}
}
#[allow(unused_variables)]
impl From<pb::AutocleanstatusRequest> for requests::AutocleanstatusRequest {
fn from(c: pb::AutocleanstatusRequest) -> Self {
Self {
subsystem: c.subsystem.map(|v| v.try_into().unwrap()),
}
}
}
#[allow(unused_variables)]
impl From<pb::CheckmessageRequest> for requests::CheckmessageRequest {
fn from(c: pb::CheckmessageRequest) -> Self {
Self {
message: c.message, pubkey: c.pubkey.map(|v| PublicKey::from_slice(&v).unwrap()), zbase: c.zbase, }
}
}
#[allow(unused_variables)]
impl From<pb::CloseRequest> for requests::CloseRequest {
fn from(c: pb::CloseRequest) -> Self {
Self {
destination: c.destination, fee_negotiation_step: c.fee_negotiation_step, feerange: Some(c.feerange.into_iter().map(|s| s.into()).collect()), force_lease_closed: c.force_lease_closed, id: c.id, unilateraltimeout: c.unilateraltimeout, wrong_funding: c.wrong_funding.map(|a| a.into()), }
}
}
#[allow(unused_variables)]
impl From<pb::ConnectRequest> for requests::ConnectRequest {
fn from(c: pb::ConnectRequest) -> Self {
Self {
host: c.host, id: c.id, port: c.port.map(|v| v as u16), }
}
}
#[allow(unused_variables)]
impl From<pb::CreateinvoiceRequest> for requests::CreateinvoiceRequest {
fn from(c: pb::CreateinvoiceRequest) -> Self {
Self {
invstring: c.invstring, label: c.label, preimage: hex::encode(&c.preimage), }
}
}
#[allow(unused_variables)]
impl From<pb::DatastoreRequest> for requests::DatastoreRequest {
fn from(c: pb::DatastoreRequest) -> Self {
Self {
generation: c.generation, hex: c.hex.map(|v| hex::encode(v)), key: c.key.into_iter().map(|s| s.into()).collect(), mode: c.mode.map(|v| v.try_into().unwrap()),
string: c.string, }
}
}
#[allow(unused_variables)]
impl From<pb::DatastoreusageRequest> for requests::DatastoreusageRequest {
fn from(c: pb::DatastoreusageRequest) -> Self {
Self {
key: Some(c.key.into_iter().map(|s| s.into()).collect()), }
}
}
#[allow(unused_variables)]
impl From<pb::CreateonionHops> for requests::CreateonionHops {
fn from(c: pb::CreateonionHops) -> Self {
Self {
payload: hex::encode(&c.payload), pubkey: PublicKey::from_slice(&c.pubkey).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<pb::CreateonionRequest> for requests::CreateonionRequest {
fn from(c: pb::CreateonionRequest) -> Self {
Self {
assocdata: hex::encode(&c.assocdata), hops: c.hops.into_iter().map(|s| s.into()).collect(), onion_size: c.onion_size.map(|v| v as u16), session_key: c.session_key.map(|v| v.try_into().unwrap()), }
}
}
#[allow(unused_variables)]
impl From<pb::DeldatastoreRequest> for requests::DeldatastoreRequest {
fn from(c: pb::DeldatastoreRequest) -> Self {
Self {
generation: c.generation, key: c.key.into_iter().map(|s| s.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<pb::DelinvoiceRequest> for requests::DelinvoiceRequest {
fn from(c: pb::DelinvoiceRequest) -> Self {
Self {
desconly: c.desconly, label: c.label, status: c.status.try_into().unwrap(),
}
}
}
#[allow(unused_variables)]
impl From<pb::DevforgetchannelRequest> for requests::DevforgetchannelRequest {
fn from(c: pb::DevforgetchannelRequest) -> Self {
Self {
channel_id: c.channel_id.map(|v| Sha256::from_slice(&v).unwrap()), force: c.force, id: PublicKey::from_slice(&c.id).unwrap(), short_channel_id: c.short_channel_id.map(|v| cln_rpc::primitives::ShortChannelId::from_str(&v).unwrap()), }
}
}
#[allow(unused_variables)]
impl From<pb::EmergencyrecoverRequest> for requests::EmergencyrecoverRequest {
fn from(c: pb::EmergencyrecoverRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<pb::RecoverRequest> for requests::RecoverRequest {
fn from(c: pb::RecoverRequest) -> Self {
Self {
hsmsecret: c.hsmsecret, }
}
}
#[allow(unused_variables)]
impl From<pb::RecoverchannelRequest> for requests::RecoverchannelRequest {
fn from(c: pb::RecoverchannelRequest) -> Self {
Self {
scb: c.scb.into_iter().map(|s| hex::encode(s)).collect(), }
}
}
#[allow(unused_variables)]
impl From<pb::InvoiceRequest> for requests::InvoiceRequest {
fn from(c: pb::InvoiceRequest) -> Self {
Self {
amount_msat: c.amount_msat.unwrap().into(), cltv: c.cltv, deschashonly: c.deschashonly, description: c.description, expiry: c.expiry, exposeprivatechannels: Some(c.exposeprivatechannels.into_iter().map(|s| cln_rpc::primitives::ShortChannelId::from_str(&s).unwrap()).collect()), fallbacks: Some(c.fallbacks.into_iter().map(|s| s.into()).collect()), label: c.label, preimage: c.preimage.map(|v| hex::encode(v)), }
}
}
#[allow(unused_variables)]
impl From<pb::InvoicerequestRequest> for requests::InvoicerequestRequest {
fn from(c: pb::InvoicerequestRequest) -> Self {
Self {
absolute_expiry: c.absolute_expiry, amount: c.amount.unwrap().into(), description: c.description, issuer: c.issuer, label: c.label, single_use: c.single_use, }
}
}
#[allow(unused_variables)]
impl From<pb::DisableinvoicerequestRequest> for requests::DisableinvoicerequestRequest {
fn from(c: pb::DisableinvoicerequestRequest) -> Self {
Self {
invreq_id: c.invreq_id, }
}
}
#[allow(unused_variables)]
impl From<pb::ListinvoicerequestsRequest> for requests::ListinvoicerequestsRequest {
fn from(c: pb::ListinvoicerequestsRequest) -> Self {
Self {
active_only: c.active_only, invreq_id: c.invreq_id, }
}
}
#[allow(unused_variables)]
impl From<pb::ListdatastoreRequest> for requests::ListdatastoreRequest {
fn from(c: pb::ListdatastoreRequest) -> Self {
Self {
key: Some(c.key.into_iter().map(|s| s.into()).collect()), }
}
}
#[allow(unused_variables)]
impl From<pb::ListinvoicesRequest> for requests::ListinvoicesRequest {
fn from(c: pb::ListinvoicesRequest) -> Self {
Self {
index: c.index.map(|v| v.try_into().unwrap()),
invstring: c.invstring, label: c.label, limit: c.limit, offer_id: c.offer_id, payment_hash: c.payment_hash.map(|v| hex::encode(v)), start: c.start, }
}
}
#[allow(unused_variables)]
impl From<pb::SendonionFirstHop> for requests::SendonionFirst_hop {
fn from(c: pb::SendonionFirstHop) -> Self {
Self {
amount_msat: c.amount_msat.unwrap().into(), delay: c.delay as u16, id: PublicKey::from_slice(&c.id).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<pb::SendonionRequest> for requests::SendonionRequest {
fn from(c: pb::SendonionRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|a| a.into()), bolt11: c.bolt11, description: c.description, destination: c.destination.map(|v| PublicKey::from_slice(&v).unwrap()), first_hop: c.first_hop.unwrap().into(),
groupid: c.groupid, label: c.label, localinvreqid: c.localinvreqid.map(|v| Sha256::from_slice(&v).unwrap()), onion: hex::encode(&c.onion), partid: c.partid.map(|v| v as u16), payment_hash: Sha256::from_slice(&c.payment_hash).unwrap(), shared_secrets: Some(c.shared_secrets.into_iter().map(|s| s.try_into().unwrap()).collect()), }
}
}
#[allow(unused_variables)]
impl From<pb::ListsendpaysRequest> for requests::ListsendpaysRequest {
fn from(c: pb::ListsendpaysRequest) -> Self {
Self {
bolt11: c.bolt11, index: c.index.map(|v| v.try_into().unwrap()),
limit: c.limit, payment_hash: c.payment_hash.map(|v| Sha256::from_slice(&v).unwrap()), start: c.start, status: c.status.map(|v| v.try_into().unwrap()),
}
}
}
#[allow(unused_variables)]
impl From<pb::ListtransactionsRequest> for requests::ListtransactionsRequest {
fn from(c: pb::ListtransactionsRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<pb::MakesecretRequest> for requests::MakesecretRequest {
fn from(c: pb::MakesecretRequest) -> Self {
Self {
hex: c.hex.map(|v| hex::encode(v)), string: c.string, }
}
}
#[allow(unused_variables)]
impl From<pb::PayRequest> for requests::PayRequest {
fn from(c: pb::PayRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|a| a.into()), bolt11: c.bolt11, description: c.description, exclude: Some(c.exclude.into_iter().map(|s| s.into()).collect()), exemptfee: c.exemptfee.map(|a| a.into()), label: c.label, localinvreqid: c.localinvreqid.map(|v| hex::encode(v)), maxdelay: c.maxdelay.map(|v| v as u16), maxfee: c.maxfee.map(|a| a.into()), maxfeepercent: c.maxfeepercent, partial_msat: c.partial_msat.map(|a| a.into()), retry_for: c.retry_for.map(|v| v as u16), riskfactor: c.riskfactor, }
}
}
#[allow(unused_variables)]
impl From<pb::ListnodesRequest> for requests::ListnodesRequest {
fn from(c: pb::ListnodesRequest) -> Self {
Self {
id: c.id.map(|v| PublicKey::from_slice(&v).unwrap()), }
}
}
#[allow(unused_variables)]
impl From<pb::WaitanyinvoiceRequest> for requests::WaitanyinvoiceRequest {
fn from(c: pb::WaitanyinvoiceRequest) -> Self {
Self {
lastpay_index: c.lastpay_index, timeout: c.timeout, }
}
}
#[allow(unused_variables)]
impl From<pb::WaitinvoiceRequest> for requests::WaitinvoiceRequest {
fn from(c: pb::WaitinvoiceRequest) -> Self {
Self {
label: c.label, }
}
}
#[allow(unused_variables)]
impl From<pb::WaitsendpayRequest> for requests::WaitsendpayRequest {
fn from(c: pb::WaitsendpayRequest) -> Self {
Self {
groupid: c.groupid, partid: c.partid, payment_hash: Sha256::from_slice(&c.payment_hash).unwrap(), timeout: c.timeout, }
}
}
#[allow(unused_variables)]
impl From<pb::NewaddrRequest> for requests::NewaddrRequest {
fn from(c: pb::NewaddrRequest) -> Self {
Self {
addresstype: c.addresstype.map(|v| v.try_into().unwrap()),
}
}
}
#[allow(unused_variables)]
impl From<pb::WithdrawRequest> for requests::WithdrawRequest {
fn from(c: pb::WithdrawRequest) -> Self {
Self {
destination: c.destination, feerate: c.feerate.map(|a| a.into()), minconf: c.minconf.map(|v| v as u16), satoshi: c.satoshi.unwrap().into(), utxos: Some(c.utxos.into_iter().map(|s| s.into()).collect()), }
}
}
#[allow(unused_variables)]
impl From<pb::KeysendRequest> for requests::KeysendRequest {
fn from(c: pb::KeysendRequest) -> Self {
Self {
amount_msat: c.amount_msat.unwrap().into(), destination: PublicKey::from_slice(&c.destination).unwrap(), exemptfee: c.exemptfee.map(|a| a.into()), extratlvs: c.extratlvs.map(|s| s.into()), label: c.label, maxdelay: c.maxdelay, maxfeepercent: c.maxfeepercent, retry_for: c.retry_for, routehints: c.routehints.map(|rl| rl.into()), }
}
}
#[allow(unused_variables)]
impl From<pb::FundpsbtRequest> for requests::FundpsbtRequest {
fn from(c: pb::FundpsbtRequest) -> Self {
Self {
excess_as_change: c.excess_as_change, feerate: c.feerate.unwrap().into(), locktime: c.locktime, min_witness_weight: c.min_witness_weight, minconf: c.minconf, nonwrapped: c.nonwrapped, opening_anchor_channel: c.opening_anchor_channel, reserve: c.reserve, satoshi: c.satoshi.unwrap().into(), startweight: c.startweight, }
}
}
#[allow(unused_variables)]
impl From<pb::SendpsbtRequest> for requests::SendpsbtRequest {
fn from(c: pb::SendpsbtRequest) -> Self {
Self {
psbt: c.psbt, reserve: c.reserve, }
}
}
#[allow(unused_variables)]
impl From<pb::SignpsbtRequest> for requests::SignpsbtRequest {
fn from(c: pb::SignpsbtRequest) -> Self {
Self {
psbt: c.psbt, signonly: Some(c.signonly.into_iter().map(|s| s).collect()), }
}
}
#[allow(unused_variables)]
impl From<pb::UtxopsbtRequest> for requests::UtxopsbtRequest {
fn from(c: pb::UtxopsbtRequest) -> Self {
Self {
excess_as_change: c.excess_as_change, feerate: c.feerate.unwrap().into(), locktime: c.locktime, min_witness_weight: c.min_witness_weight, opening_anchor_channel: c.opening_anchor_channel, reserve: c.reserve, reservedok: c.reservedok, satoshi: c.satoshi.unwrap().into(), startweight: c.startweight, utxos: c.utxos.into_iter().map(|s| s.into()).collect(), }
}
}
#[allow(unused_variables)]
impl From<pb::TxdiscardRequest> for requests::TxdiscardRequest {
fn from(c: pb::TxdiscardRequest) -> Self {
Self {
txid: hex::encode(&c.txid), }
}
}
#[allow(unused_variables)]
impl From<pb::TxprepareRequest> for requests::TxprepareRequest {
fn from(c: pb::TxprepareRequest) -> Self {
Self {
feerate: c.feerate.map(|a| a.into()), minconf: c.minconf, outputs: c.outputs.into_iter().map(|s| s.into()).collect(), utxos: Some(c.utxos.into_iter().map(|s| s.into()).collect()), }
}
}
#[allow(unused_variables)]
impl From<pb::TxsendRequest> for requests::TxsendRequest {
fn from(c: pb::TxsendRequest) -> Self {
Self {
txid: hex::encode(&c.txid), }
}
}
#[allow(unused_variables)]
impl From<pb::ListpeerchannelsRequest> for requests::ListpeerchannelsRequest {
fn from(c: pb::ListpeerchannelsRequest) -> Self {
Self {
id: c.id.map(|v| PublicKey::from_slice(&v).unwrap()), }
}
}
#[allow(unused_variables)]
impl From<pb::ListclosedchannelsRequest> for requests::ListclosedchannelsRequest {
fn from(c: pb::ListclosedchannelsRequest) -> Self {
Self {
id: c.id.map(|v| PublicKey::from_slice(&v).unwrap()), }
}
}
#[allow(unused_variables)]
impl From<pb::DecodepayRequest> for requests::DecodepayRequest {
fn from(c: pb::DecodepayRequest) -> Self {
Self {
bolt11: c.bolt11, description: c.description, }
}
}
#[allow(unused_variables)]
impl From<pb::DecodeRequest> for requests::DecodeRequest {
fn from(c: pb::DecodeRequest) -> Self {
Self {
string: c.string, }
}
}
#[allow(unused_variables)]
impl From<pb::DelpayRequest> for requests::DelpayRequest {
fn from(c: pb::DelpayRequest) -> Self {
Self {
groupid: c.groupid, partid: c.partid, payment_hash: Sha256::from_slice(&c.payment_hash).unwrap(), status: c.status.try_into().unwrap(),
}
}
}
#[allow(unused_variables)]
impl From<pb::DelforwardRequest> for requests::DelforwardRequest {
fn from(c: pb::DelforwardRequest) -> Self {
Self {
in_channel: cln_rpc::primitives::ShortChannelId::from_str(&c.in_channel).unwrap(), in_htlc_id: c.in_htlc_id, status: c.status.try_into().unwrap(),
}
}
}
#[allow(unused_variables)]
impl From<pb::DisableofferRequest> for requests::DisableofferRequest {
fn from(c: pb::DisableofferRequest) -> Self {
Self {
offer_id: Sha256::from_slice(&c.offer_id).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<pb::DisconnectRequest> for requests::DisconnectRequest {
fn from(c: pb::DisconnectRequest) -> Self {
Self {
force: c.force, id: PublicKey::from_slice(&c.id).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<pb::FeeratesRequest> for requests::FeeratesRequest {
fn from(c: pb::FeeratesRequest) -> Self {
Self {
style: c.style.try_into().unwrap(),
}
}
}
#[allow(unused_variables)]
impl From<pb::FetchinvoiceRequest> for requests::FetchinvoiceRequest {
fn from(c: pb::FetchinvoiceRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|a| a.into()), offer: c.offer, payer_note: c.payer_note, quantity: c.quantity, recurrence_counter: c.recurrence_counter, recurrence_label: c.recurrence_label, recurrence_start: c.recurrence_start, timeout: c.timeout, }
}
}
#[allow(unused_variables)]
impl From<pb::FundchannelCancelRequest> for requests::Fundchannel_cancelRequest {
fn from(c: pb::FundchannelCancelRequest) -> Self {
Self {
id: PublicKey::from_slice(&c.id).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<pb::FundchannelCompleteRequest> for requests::Fundchannel_completeRequest {
fn from(c: pb::FundchannelCompleteRequest) -> Self {
Self {
id: PublicKey::from_slice(&c.id).unwrap(), psbt: c.psbt, }
}
}
#[allow(unused_variables)]
impl From<pb::FundchannelRequest> for requests::FundchannelRequest {
fn from(c: pb::FundchannelRequest) -> Self {
Self {
amount: c.amount.unwrap().into(), announce: c.announce, channel_type: Some(c.channel_type.into_iter().map(|s| s).collect()), close_to: c.close_to, compact_lease: c.compact_lease, feerate: c.feerate.map(|a| a.into()), id: PublicKey::from_slice(&c.id).unwrap(), minconf: c.minconf, mindepth: c.mindepth, push_msat: c.push_msat.map(|a| a.into()), request_amt: c.request_amt.map(|a| a.into()), reserve: c.reserve.map(|a| a.into()), utxos: Some(c.utxos.into_iter().map(|s| s.into()).collect()), }
}
}
#[allow(unused_variables)]
impl From<pb::FundchannelStartRequest> for requests::Fundchannel_startRequest {
fn from(c: pb::FundchannelStartRequest) -> Self {
Self {
amount: c.amount.unwrap().into(), announce: c.announce, channel_type: Some(c.channel_type.into_iter().map(|s| s).collect()), close_to: c.close_to, feerate: c.feerate.map(|a| a.into()), id: PublicKey::from_slice(&c.id).unwrap(), mindepth: c.mindepth, push_msat: c.push_msat.map(|a| a.into()), reserve: c.reserve.map(|a| a.into()), }
}
}
#[allow(unused_variables)]
impl From<pb::GetlogRequest> for requests::GetlogRequest {
fn from(c: pb::GetlogRequest) -> Self {
Self {
level: c.level.map(|v| v.try_into().unwrap()),
}
}
}
#[allow(unused_variables)]
impl From<pb::FunderupdateRequest> for requests::FunderupdateRequest {
fn from(c: pb::FunderupdateRequest) -> Self {
Self {
channel_fee_max_base_msat: c.channel_fee_max_base_msat.map(|a| a.into()), channel_fee_max_proportional_thousandths: c.channel_fee_max_proportional_thousandths, compact_lease: c.compact_lease.map(|v| hex::encode(v)), fund_probability: c.fund_probability, funding_weight: c.funding_weight, fuzz_percent: c.fuzz_percent, lease_fee_base_msat: c.lease_fee_base_msat.map(|a| a.into()), lease_fee_basis: c.lease_fee_basis, leases_only: c.leases_only, max_their_funding_msat: c.max_their_funding_msat.map(|a| a.into()), min_their_funding_msat: c.min_their_funding_msat.map(|a| a.into()), per_channel_max_msat: c.per_channel_max_msat.map(|a| a.into()), per_channel_min_msat: c.per_channel_min_msat.map(|a| a.into()), policy: c.policy.map(|v| v.try_into().unwrap()),
policy_mod: c.policy_mod.map(|a| a.into()), reserve_tank_msat: c.reserve_tank_msat.map(|a| a.into()), }
}
}
#[allow(unused_variables)]
impl From<pb::GetrouteRequest> for requests::GetrouteRequest {
fn from(c: pb::GetrouteRequest) -> Self {
Self {
amount_msat: c.amount_msat.unwrap().into(), cltv: c.cltv, exclude: Some(c.exclude.into_iter().map(|s| s.into()).collect()), fromid: c.fromid.map(|v| PublicKey::from_slice(&v).unwrap()), fuzzpercent: c.fuzzpercent, id: PublicKey::from_slice(&c.id).unwrap(), maxhops: c.maxhops, riskfactor: c.riskfactor, }
}
}
#[allow(unused_variables)]
impl From<pb::ListforwardsRequest> for requests::ListforwardsRequest {
fn from(c: pb::ListforwardsRequest) -> Self {
Self {
in_channel: c.in_channel.map(|v| cln_rpc::primitives::ShortChannelId::from_str(&v).unwrap()), index: c.index.map(|v| v.try_into().unwrap()),
limit: c.limit, out_channel: c.out_channel.map(|v| cln_rpc::primitives::ShortChannelId::from_str(&v).unwrap()), start: c.start, status: c.status.map(|v| v.try_into().unwrap()),
}
}
}
#[allow(unused_variables)]
impl From<pb::ListoffersRequest> for requests::ListoffersRequest {
fn from(c: pb::ListoffersRequest) -> Self {
Self {
active_only: c.active_only, offer_id: c.offer_id.map(|v| Sha256::from_slice(&v).unwrap()), }
}
}
#[allow(unused_variables)]
impl From<pb::ListpaysRequest> for requests::ListpaysRequest {
fn from(c: pb::ListpaysRequest) -> Self {
Self {
bolt11: c.bolt11, payment_hash: c.payment_hash.map(|v| Sha256::from_slice(&v).unwrap()), status: c.status.map(|v| v.try_into().unwrap()),
}
}
}
#[allow(unused_variables)]
impl From<pb::ListhtlcsRequest> for requests::ListhtlcsRequest {
fn from(c: pb::ListhtlcsRequest) -> Self {
Self {
id: c.id, }
}
}
#[allow(unused_variables)]
impl From<pb::MultifundchannelDestinations> for requests::MultifundchannelDestinations {
fn from(c: pb::MultifundchannelDestinations) -> Self {
Self {
amount: c.amount.unwrap().into(), announce: c.announce, close_to: c.close_to, compact_lease: c.compact_lease, id: c.id, mindepth: c.mindepth, push_msat: c.push_msat.map(|a| a.into()), request_amt: c.request_amt.map(|a| a.into()), reserve: c.reserve.map(|a| a.into()), }
}
}
#[allow(unused_variables)]
impl From<pb::MultifundchannelRequest> for requests::MultifundchannelRequest {
fn from(c: pb::MultifundchannelRequest) -> Self {
Self {
commitment_feerate: c.commitment_feerate.map(|a| a.into()), destinations: c.destinations.into_iter().map(|s| s.into()).collect(), feerate: c.feerate.map(|a| a.into()), minchannels: c.minchannels, minconf: c.minconf, utxos: Some(c.utxos.into_iter().map(|s| s.into()).collect()), }
}
}
#[allow(unused_variables)]
impl From<pb::MultiwithdrawRequest> for requests::MultiwithdrawRequest {
fn from(c: pb::MultiwithdrawRequest) -> Self {
Self {
feerate: c.feerate.map(|a| a.into()), minconf: c.minconf, outputs: c.outputs.into_iter().map(|s| s.into()).collect(), utxos: Some(c.utxos.into_iter().map(|s| s.into()).collect()), }
}
}
#[allow(unused_variables)]
impl From<pb::OfferRequest> for requests::OfferRequest {
fn from(c: pb::OfferRequest) -> Self {
Self {
absolute_expiry: c.absolute_expiry, amount: c.amount, description: c.description, issuer: c.issuer, label: c.label, quantity_max: c.quantity_max, recurrence: c.recurrence, recurrence_base: c.recurrence_base, recurrence_limit: c.recurrence_limit, recurrence_paywindow: c.recurrence_paywindow, recurrence_start_any_period: c.recurrence_start_any_period, single_use: c.single_use, }
}
}
#[allow(unused_variables)]
impl From<pb::OpenchannelAbortRequest> for requests::Openchannel_abortRequest {
fn from(c: pb::OpenchannelAbortRequest) -> Self {
Self {
channel_id: Sha256::from_slice(&c.channel_id).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<pb::OpenchannelBumpRequest> for requests::Openchannel_bumpRequest {
fn from(c: pb::OpenchannelBumpRequest) -> Self {
Self {
amount: c.amount.unwrap().into(), channel_id: Sha256::from_slice(&c.channel_id).unwrap(), funding_feerate: c.funding_feerate.map(|a| a.into()), initialpsbt: c.initialpsbt, }
}
}
#[allow(unused_variables)]
impl From<pb::OpenchannelInitRequest> for requests::Openchannel_initRequest {
fn from(c: pb::OpenchannelInitRequest) -> Self {
Self {
amount: c.amount.unwrap().into(), announce: c.announce, channel_type: Some(c.channel_type.into_iter().map(|s| s).collect()), close_to: c.close_to, commitment_feerate: c.commitment_feerate.map(|a| a.into()), compact_lease: c.compact_lease.map(|v| hex::encode(v)), funding_feerate: c.funding_feerate.map(|a| a.into()), id: PublicKey::from_slice(&c.id).unwrap(), initialpsbt: c.initialpsbt, request_amt: c.request_amt.map(|a| a.into()), }
}
}
#[allow(unused_variables)]
impl From<pb::OpenchannelSignedRequest> for requests::Openchannel_signedRequest {
fn from(c: pb::OpenchannelSignedRequest) -> Self {
Self {
channel_id: Sha256::from_slice(&c.channel_id).unwrap(), signed_psbt: c.signed_psbt, }
}
}
#[allow(unused_variables)]
impl From<pb::OpenchannelUpdateRequest> for requests::Openchannel_updateRequest {
fn from(c: pb::OpenchannelUpdateRequest) -> Self {
Self {
channel_id: Sha256::from_slice(&c.channel_id).unwrap(), psbt: c.psbt, }
}
}
#[allow(unused_variables)]
impl From<pb::PingRequest> for requests::PingRequest {
fn from(c: pb::PingRequest) -> Self {
Self {
id: PublicKey::from_slice(&c.id).unwrap(), len: c.len.map(|v| v as u16), pongbytes: c.pongbytes.map(|v| v as u16), }
}
}
#[allow(unused_variables)]
impl From<pb::PluginRequest> for requests::PluginRequest {
fn from(c: pb::PluginRequest) -> Self {
Self {
directory: c.directory, options: Some(c.options.into_iter().map(|s| s.into()).collect()), plugin: c.plugin, subcommand: c.subcommand.try_into().unwrap(),
}
}
}
#[allow(unused_variables)]
impl From<pb::RenepaystatusRequest> for requests::RenepaystatusRequest {
fn from(c: pb::RenepaystatusRequest) -> Self {
Self {
invstring: c.invstring, }
}
}
#[allow(unused_variables)]
impl From<pb::RenepayRequest> for requests::RenepayRequest {
fn from(c: pb::RenepayRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|a| a.into()), description: c.description, dev_use_shadow: c.dev_use_shadow, exclude: Some(c.exclude.into_iter().map(|s| s.into()).collect()), invstring: c.invstring, label: c.label, maxdelay: c.maxdelay, maxfee: c.maxfee.map(|a| a.into()), retry_for: c.retry_for, }
}
}
#[allow(unused_variables)]
impl From<pb::ReserveinputsRequest> for requests::ReserveinputsRequest {
fn from(c: pb::ReserveinputsRequest) -> Self {
Self {
exclusive: c.exclusive, psbt: c.psbt, reserve: c.reserve, }
}
}
#[allow(unused_variables)]
impl From<pb::SendcustommsgRequest> for requests::SendcustommsgRequest {
fn from(c: pb::SendcustommsgRequest) -> Self {
Self {
msg: hex::encode(&c.msg), node_id: PublicKey::from_slice(&c.node_id).unwrap(), }
}
}
#[allow(unused_variables)]
impl From<pb::SendinvoiceRequest> for requests::SendinvoiceRequest {
fn from(c: pb::SendinvoiceRequest) -> Self {
Self {
amount_msat: c.amount_msat.map(|a| a.into()), invreq: c.invreq, label: c.label, quantity: c.quantity, timeout: c.timeout, }
}
}
#[allow(unused_variables)]
impl From<pb::SetchannelRequest> for requests::SetchannelRequest {
fn from(c: pb::SetchannelRequest) -> Self {
Self {
enforcedelay: c.enforcedelay, feebase: c.feebase.map(|a| a.into()), feeppm: c.feeppm, htlcmax: c.htlcmax.map(|a| a.into()), htlcmin: c.htlcmin.map(|a| a.into()), id: c.id, ignorefeelimits: c.ignorefeelimits, }
}
}
#[allow(unused_variables)]
impl From<pb::SetconfigRequest> for requests::SetconfigRequest {
fn from(c: pb::SetconfigRequest) -> Self {
Self {
config: c.config, val: c.val, }
}
}
#[allow(unused_variables)]
impl From<pb::SetpsbtversionRequest> for requests::SetpsbtversionRequest {
fn from(c: pb::SetpsbtversionRequest) -> Self {
Self {
psbt: c.psbt, version: c.version, }
}
}
#[allow(unused_variables)]
impl From<pb::SigninvoiceRequest> for requests::SigninvoiceRequest {
fn from(c: pb::SigninvoiceRequest) -> Self {
Self {
invstring: c.invstring, }
}
}
#[allow(unused_variables)]
impl From<pb::SignmessageRequest> for requests::SignmessageRequest {
fn from(c: pb::SignmessageRequest) -> Self {
Self {
message: c.message, }
}
}
#[allow(unused_variables)]
impl From<pb::SpliceInitRequest> for requests::Splice_initRequest {
fn from(c: pb::SpliceInitRequest) -> Self {
Self {
channel_id: Sha256::from_slice(&c.channel_id).unwrap(), feerate_per_kw: c.feerate_per_kw, force_feerate: c.force_feerate, initialpsbt: c.initialpsbt, relative_amount: c.relative_amount, }
}
}
#[allow(unused_variables)]
impl From<pb::SpliceSignedRequest> for requests::Splice_signedRequest {
fn from(c: pb::SpliceSignedRequest) -> Self {
Self {
channel_id: Sha256::from_slice(&c.channel_id).unwrap(), psbt: c.psbt, sign_first: c.sign_first, }
}
}
#[allow(unused_variables)]
impl From<pb::SpliceUpdateRequest> for requests::Splice_updateRequest {
fn from(c: pb::SpliceUpdateRequest) -> Self {
Self {
channel_id: Sha256::from_slice(&c.channel_id).unwrap(), psbt: c.psbt, }
}
}
#[allow(unused_variables)]
impl From<pb::UnreserveinputsRequest> for requests::UnreserveinputsRequest {
fn from(c: pb::UnreserveinputsRequest) -> Self {
Self {
psbt: c.psbt, reserve: c.reserve, }
}
}
#[allow(unused_variables)]
impl From<pb::UpgradewalletRequest> for requests::UpgradewalletRequest {
fn from(c: pb::UpgradewalletRequest) -> Self {
Self {
feerate: c.feerate.map(|a| a.into()), reservedok: c.reservedok, }
}
}
#[allow(unused_variables)]
impl From<pb::WaitblockheightRequest> for requests::WaitblockheightRequest {
fn from(c: pb::WaitblockheightRequest) -> Self {
Self {
blockheight: c.blockheight, timeout: c.timeout, }
}
}
#[allow(unused_variables)]
impl From<pb::WaitRequest> for requests::WaitRequest {
fn from(c: pb::WaitRequest) -> Self {
Self {
indexname: c.indexname.try_into().unwrap(),
nextvalue: c.nextvalue, subsystem: c.subsystem.try_into().unwrap(),
}
}
}
#[allow(unused_variables)]
impl From<pb::ListconfigsRequest> for requests::ListconfigsRequest {
fn from(c: pb::ListconfigsRequest) -> Self {
Self {
config: c.config, }
}
}
#[allow(unused_variables)]
impl From<pb::StopRequest> for requests::StopRequest {
fn from(c: pb::StopRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<pb::HelpRequest> for requests::HelpRequest {
fn from(c: pb::HelpRequest) -> Self {
Self {
command: c.command, }
}
}
#[allow(unused_variables)]
impl From<pb::PreapprovekeysendRequest> for requests::PreapprovekeysendRequest {
fn from(c: pb::PreapprovekeysendRequest) -> Self {
Self {
amount_msat: c.amount_msat.unwrap().into(), destination: PublicKey::from_slice(&c.destination).unwrap(), payment_hash: hex::encode(&c.payment_hash), }
}
}
#[allow(unused_variables)]
impl From<pb::PreapproveinvoiceRequest> for requests::PreapproveinvoiceRequest {
fn from(c: pb::PreapproveinvoiceRequest) -> Self {
Self {
bolt11: c.bolt11, }
}
}
#[allow(unused_variables)]
impl From<pb::StaticbackupRequest> for requests::StaticbackupRequest {
fn from(c: pb::StaticbackupRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<pb::BkprchannelsapyRequest> for requests::BkprchannelsapyRequest {
fn from(c: pb::BkprchannelsapyRequest) -> Self {
Self {
end_time: c.end_time, start_time: c.start_time, }
}
}
#[allow(unused_variables)]
impl From<pb::BkprdumpincomecsvRequest> for requests::BkprdumpincomecsvRequest {
fn from(c: pb::BkprdumpincomecsvRequest) -> Self {
Self {
consolidate_fees: c.consolidate_fees, csv_file: c.csv_file, csv_format: c.csv_format, end_time: c.end_time, start_time: c.start_time, }
}
}
#[allow(unused_variables)]
impl From<pb::BkprinspectRequest> for requests::BkprinspectRequest {
fn from(c: pb::BkprinspectRequest) -> Self {
Self {
account: c.account, }
}
}
#[allow(unused_variables)]
impl From<pb::BkprlistaccounteventsRequest> for requests::BkprlistaccounteventsRequest {
fn from(c: pb::BkprlistaccounteventsRequest) -> Self {
Self {
account: c.account, payment_id: c.payment_id, }
}
}
#[allow(unused_variables)]
impl From<pb::BkprlistbalancesRequest> for requests::BkprlistbalancesRequest {
fn from(c: pb::BkprlistbalancesRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<pb::BkprlistincomeRequest> for requests::BkprlistincomeRequest {
fn from(c: pb::BkprlistincomeRequest) -> Self {
Self {
consolidate_fees: c.consolidate_fees, end_time: c.end_time, start_time: c.start_time, }
}
}
#[allow(unused_variables)]
impl From<pb::BlacklistruneRequest> for requests::BlacklistruneRequest {
fn from(c: pb::BlacklistruneRequest) -> Self {
Self {
end: c.end, start: c.start, }
}
}
#[allow(unused_variables)]
impl From<pb::CheckruneRequest> for requests::CheckruneRequest {
fn from(c: pb::CheckruneRequest) -> Self {
Self {
method: c.method, nodeid: c.nodeid, params: Some(c.params.into_iter().map(|s| s.into()).collect()), rune: c.rune, }
}
}
#[allow(unused_variables)]
impl From<pb::CreateruneRequest> for requests::CreateruneRequest {
fn from(c: pb::CreateruneRequest) -> Self {
Self {
restrictions: Some(c.restrictions.into_iter().map(|s| s.into()).collect()), rune: c.rune, }
}
}
#[allow(unused_variables)]
impl From<pb::ShowrunesRequest> for requests::ShowrunesRequest {
fn from(c: pb::ShowrunesRequest) -> Self {
Self {
rune: c.rune, }
}
}
#[allow(unused_variables)]
impl From<pb::StreamBlockAddedRequest> for notifications::requests::StreamBlockAddedRequest {
fn from(c: pb::StreamBlockAddedRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<pb::StreamChannelOpenFailedRequest> for notifications::requests::StreamChannelOpenFailedRequest {
fn from(c: pb::StreamChannelOpenFailedRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<pb::StreamChannelOpenedRequest> for notifications::requests::StreamChannelOpenedRequest {
fn from(c: pb::StreamChannelOpenedRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<pb::StreamConnectRequest> for notifications::requests::StreamConnectRequest {
fn from(c: pb::StreamConnectRequest) -> Self {
Self {
}
}
}
#[allow(unused_variables)]
impl From<pb::StreamCustomMsgRequest> for notifications::requests::StreamCustomMsgRequest {
fn from(c: pb::StreamCustomMsgRequest) -> Self {
Self {
}
}
}