File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ class TVFData {
44
44
'solana_signTransaction' ,
45
45
'solana_signAllTransactions' ,
46
46
'wallet_sendCalls' ,
47
+ // Bitcoin
48
+ 'sendTransfer' ,
47
49
// Hedera
48
50
'hedera_signAndExecuteTransaction' ,
49
51
'hedera_executeTransaction' ,
Original file line number Diff line number Diff line change @@ -172,5 +172,24 @@ void main() {
172
172
);
173
173
expect (transactionId,
'[email protected] ' );
174
174
});
175
+
176
+ test ('should parse bitcoin\' s sendTransfer and extract txid' , () {
177
+ final jsonRPCResponse = {
178
+ 'jsonrpc' : '2.0' ,
179
+ 'id' : 1 ,
180
+ 'result' : {
181
+ 'txid' :
182
+ 'f007551f169722ce74104d6673bd46ce193c624b8550889526d1b93820d725f7'
183
+ },
184
+ };
185
+ final response = JsonRpcResponse .fromJson (jsonRPCResponse);
186
+ final result = (response.result as Map <String , dynamic >);
187
+ final txid = ReownCoreUtils .recursiveSearchForMapKey (
188
+ result,
189
+ 'txid' ,
190
+ );
191
+ expect (txid,
192
+ 'f007551f169722ce74104d6673bd46ce193c624b8550889526d1b93820d725f7' );
193
+ });
175
194
});
176
195
}
Original file line number Diff line number Diff line change @@ -2998,9 +2998,21 @@ class ReownSign implements IReownSign {
2998
2998
core.logger.e ('[$runtimeType ] _collectHashes: hedera, $e ' );
2999
2999
}
3000
3000
return null ;
3001
+ case 'bip122' :
3002
+ try {
3003
+ final result = (response.result as Map <String , dynamic >);
3004
+ final txId = ReownCoreUtils .recursiveSearchForMapKey (
3005
+ result,
3006
+ 'txid' ,
3007
+ );
3008
+ return < String > [txId];
3009
+ } catch (e) {
3010
+ core.logger.e ('[$runtimeType ] _collectHashes: bip122, $e ' );
3011
+ }
3012
+ return null ;
3001
3013
default :
3002
3014
// default to EVM
3003
- return List <String >. from ( [response.result]) ;
3015
+ return < String > [response.result];
3004
3016
}
3005
3017
}
3006
3018
}
You can’t perform that action at this time.
0 commit comments