Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

## [v0.0.24-alpha] - 2023-12-4
- fix walletconnect 2.0 send_tx
- add from_address for walletconnect 2.0 sendtx

## [v0.0.23-alpha] - 2023-8-7
- add mac universal binary (arm64 + x86_64)
Expand Down
1 change: 1 addition & 0 deletions extra-cpp-bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ mod ffi {
/// wallet connect cronos(eth) eip155-tx signing info
#[derive(Debug, Default)]
pub struct WalletConnectTxEip155 {
pub from: String, // hexstring, "0x..."
pub to: String, // hexstring, "0x..."
pub value: String, // decimal string, in wei units
pub data: Vec<u8>, // data, as bytes
Expand Down
5 changes: 5 additions & 0 deletions extra-cpp-bindings/src/walletconnect2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ impl Walletconnect2Client {

let mut tx = Eip1559TransactionRequest::new();

if !userinfo.from.is_empty() {
// from address is necessary for wc.20 , metamask
tx = tx.from(Address::from_str(&userinfo.from)?);
}

if !userinfo.to.is_empty() {
tx = tx.to(NameOrAddress::Address(Address::from_str(&userinfo.to)?));
}
Expand Down