@@ -117,19 +117,32 @@ public async Task<string> SendTransaction(ThirdwebTransactionInput transaction)
117
117
Method = "eth_sendTransaction" ,
118
118
Params = new object [ ]
119
119
{
120
- new TransactionInput ( )
121
- {
122
- Nonce = transaction . Nonce ,
123
- From = await GetAddress ( ) ,
124
- To = transaction . To ,
125
- Gas = transaction . Gas ,
126
- GasPrice = transaction . GasPrice ,
127
- Value = transaction . Value ,
128
- Data = transaction . Data ,
129
- MaxFeePerGas = transaction . MaxFeePerGas ,
130
- MaxPriorityFeePerGas = transaction . MaxPriorityFeePerGas ,
131
- ChainId = new HexBigInteger ( WebGLMetaMask . Instance . GetActiveChainId ( ) ) ,
132
- }
120
+ transaction . GasPrice == null
121
+ ? new
122
+ {
123
+ nonce = transaction . Nonce . HexValue ,
124
+ from = await GetAddress ( ) ,
125
+ to = transaction . To ,
126
+ gas = transaction . Gas . HexValue ,
127
+ value = transaction . Value ? . HexValue ?? "0x0" ,
128
+ data = transaction . Data ,
129
+ maxFeePerGas = transaction . MaxFeePerGas . HexValue ,
130
+ maxPriorityFeePerGas = transaction . MaxPriorityFeePerGas ? . HexValue ?? "0x0" ,
131
+ chainId = WebGLMetaMask . Instance . GetActiveChainId ( ) . NumberToHex ( ) ,
132
+ type = "0x2"
133
+ }
134
+ : new
135
+ {
136
+ nonce = transaction . Nonce . HexValue ,
137
+ from = await GetAddress ( ) ,
138
+ to = transaction . To ,
139
+ gas = transaction . Gas . HexValue ,
140
+ value = transaction . Value ? . HexValue ?? "0x0" ,
141
+ data = transaction . Data ,
142
+ gasPrice = transaction . GasPrice . HexValue ,
143
+ chainId = WebGLMetaMask . Instance . GetActiveChainId ( ) . NumberToHex ( ) ,
144
+ type = "0x0"
145
+ }
133
146
}
134
147
} ;
135
148
return await WebGLMetaMask . Instance . RequestAsync < string > ( rpcRequest ) ;
0 commit comments