mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 01:37:54 +00:00
replace 'net_*' calls with 'eth_*' alternatives
This commit is contained in:
parent
24e66f3d5f
commit
305b252573
1 changed files with 7 additions and 7 deletions
|
@ -173,9 +173,9 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
@override
|
||||
Future<String> confirmSend({required Map<String, dynamic> txData}) async {
|
||||
web3.Web3Client client = getEthClient();
|
||||
final int chainId = await client.getNetworkId();
|
||||
final amount = txData['recipientAmt'];
|
||||
final decimalAmount = Format.satoshisToAmount(amount as int, coin: coin);
|
||||
final chainId = await client.getChainId();
|
||||
final amount = txData['recipientAmt'] as int;
|
||||
final decimalAmount = Format.satoshisToAmount(amount, coin: coin);
|
||||
final bigIntAmount = amountToBigInt(
|
||||
decimalAmount.toDouble(),
|
||||
Constants.decimalPlacesForCoin(coin),
|
||||
|
@ -187,8 +187,8 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
web3.EtherUnit.wei, txData['feeInWei']),
|
||||
maxGas: _gasLimit,
|
||||
value: web3.EtherAmount.inWei(bigIntAmount));
|
||||
final transaction =
|
||||
await client.sendTransaction(_credentials, tx, chainId: chainId);
|
||||
final transaction = await client.sendTransaction(_credentials, tx,
|
||||
chainId: chainId.toInt());
|
||||
|
||||
return transaction;
|
||||
}
|
||||
|
@ -773,8 +773,8 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
Future<bool> testNetworkConnection() async {
|
||||
web3.Web3Client client = getEthClient();
|
||||
try {
|
||||
final result = await client.isListeningForNetwork();
|
||||
return result;
|
||||
await client.getBlockNumber();
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue