Skip to content

Commit ad6089f

Browse files
authored
feat: added an option to provide message for transfers from solana (#218)
* feat: added an option to provide message for transfers from solana * chore: bumped version * refactor: simplified max_gas_fee parsing
1 parent f911d6f commit ad6089f

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bridge-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bridge-cli"
3-
version = "0.3.22"
3+
version = "0.3.23"
44
edition = "2021"
55
repository = "https://github.com/Near-One/bridge-sdk-rs"
66

bridge-cli/src/omni_connector_command.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ pub enum OmniConnectorSubCommand {
220220
fee: u128,
221221
#[clap(short, long, help = "Native fee to charge for the transfer")]
222222
native_fee: u64,
223+
#[clap(short, long, help = "Additional message")]
224+
message: Option<String>,
223225
#[command(flatten)]
224226
config_cli: CliConfig,
225227
},
@@ -732,6 +734,7 @@ pub async fn match_subcommand(cmd: OmniConnectorSubCommand, network: Network) {
732734
recipient,
733735
fee,
734736
native_fee,
737+
message,
735738
config_cli,
736739
} => {
737740
omni_connector(network, config_cli)
@@ -741,7 +744,7 @@ pub async fn match_subcommand(cmd: OmniConnectorSubCommand, network: Network) {
741744
recipient,
742745
fee,
743746
native_fee,
744-
message: String::new(),
747+
message: message.unwrap_or_default(),
745748
})
746749
.await
747750
.unwrap();

bridge-sdk/connectors/omni-connector/src/omni_connector.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,7 @@ impl OmniConnector {
740740
"Estimated gas fee = {gas_fee}, but max gas fee = {max_gas_fee}"
741741
)));
742742
}
743-
Some(near_sdk::json_types::U128::from(<u64 as Into<u128>>::into(
744-
max_gas_fee,
745-
)))
743+
Some(near_sdk::json_types::U128::from(u128::from(max_gas_fee)))
746744
} else {
747745
None
748746
};

0 commit comments

Comments
 (0)