Update json-rpc client

This commit is contained in:
AsamK 2022-05-21 12:10:51 +02:00
parent 5a63b5419f
commit cf07512d24
5 changed files with 61 additions and 4 deletions

8
client/Cargo.lock generated
View file

@ -639,9 +639,9 @@ dependencies = [
[[package]]
name = "regex"
version = "1.5.5"
version = "1.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1"
dependencies = [
"aho-corasick",
"memchr",
@ -650,9 +650,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
version = "0.6.25"
version = "0.6.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64"
[[package]]
name = "rustc_version"

View file

@ -164,6 +164,15 @@ pub enum CliCommands {
sticker: Option<String>,
},
SendContacts,
SendPaymentNotification {
recipient: String,
#[clap(long)]
receipt: String,
#[clap(long)]
note: String,
},
SendReaction {
recipient: Vec<String>,
@ -319,6 +328,9 @@ pub enum CliCommands {
#[clap(long = "about-emoji")]
about_emoji: Option<String>,
#[clap(long = "mobile-coin-address")]
mobile_coin_address: Option<String>,
#[clap(long)]
avatar: Option<String>,

View file

@ -135,6 +135,15 @@ pub trait Rpc {
#[rpc(name = "sendContacts", params = "named")]
fn send_contacts(&self, account: Option<String>) -> Result<Value>;
#[rpc(name = "sendPaymentNotification", params = "named")]
fn send_payment_notification(
&self,
account: Option<String>,
recipient: String,
receipt: String,
note: String,
) -> Result<Value>;
#[rpc(name = "sendReaction", params = "named")]
fn send_reaction(
&self,
@ -263,6 +272,7 @@ pub trait Rpc {
#[allow(non_snake_case)] familyName: Option<String>,
about: Option<String>,
#[allow(non_snake_case)] aboutEmoji: Option<String>,
#[allow(non_snake_case)] mobileCoinAddress: Option<String>,
avatar: Option<String>,
#[allow(non_snake_case)] removeAvatar: bool,
) -> Result<Value>;

View file

@ -147,6 +147,15 @@ async fn main() -> Result<(), anyhow::Error> {
.await
}
cli::CliCommands::SendContacts => client.send_contacts(cli.account).await,
cli::CliCommands::SendPaymentNotification {
recipient,
receipt,
note,
} => {
client
.send_payment_notification(cli.account, recipient, receipt, note)
.await
}
cli::CliCommands::SendReaction {
recipient,
group_id,
@ -309,6 +318,7 @@ async fn main() -> Result<(), anyhow::Error> {
family_name,
about,
about_emoji,
mobile_coin_address,
avatar,
remove_avatar,
} => {
@ -319,6 +329,7 @@ async fn main() -> Result<(), anyhow::Error> {
family_name,
about,
about_emoji,
mobile_coin_address,
avatar,
remove_avatar,
)