Skip to content

Commit c4bdafa

Browse files
Problem: wc 2.0 fix not applied to c++ api (fix #467) (#468)
reformat update log
1 parent 0572f72 commit c4bdafa

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
## [v0.0.24-alpha] - 2023-12-4
55
- fix walletconnect 2.0 send_tx
6+
- add from_address for walletconnect 2.0 sendtx
67

78
## [v0.0.23-alpha] - 2023-8-7
89
- add mac universal binary (arm64 + x86_64)

extra-cpp-bindings/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ mod ffi {
129129
/// wallet connect cronos(eth) eip155-tx signing info
130130
#[derive(Debug, Default)]
131131
pub struct WalletConnectTxEip155 {
132+
pub from: String, // hexstring, "0x..."
132133
pub to: String, // hexstring, "0x..."
133134
pub value: String, // decimal string, in wei units
134135
pub data: Vec<u8>, // data, as bytes

extra-cpp-bindings/src/walletconnect2.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ impl Walletconnect2Client {
300300

301301
let mut tx = Eip1559TransactionRequest::new();
302302

303+
if !userinfo.from.is_empty() {
304+
// from address is necessary for wc.20 , metamask
305+
tx = tx.from(Address::from_str(&userinfo.from)?);
306+
}
307+
303308
if !userinfo.to.is_empty() {
304309
tx = tx.to(NameOrAddress::Address(Address::from_str(&userinfo.to)?));
305310
}

0 commit comments

Comments
 (0)