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
|
@override
|
||||||
Future<String> confirmSend({required Map<String, dynamic> txData}) async {
|
Future<String> confirmSend({required Map<String, dynamic> txData}) async {
|
||||||
web3.Web3Client client = getEthClient();
|
web3.Web3Client client = getEthClient();
|
||||||
final int chainId = await client.getNetworkId();
|
final chainId = await client.getChainId();
|
||||||
final amount = txData['recipientAmt'];
|
final amount = txData['recipientAmt'] as int;
|
||||||
final decimalAmount = Format.satoshisToAmount(amount as int, coin: coin);
|
final decimalAmount = Format.satoshisToAmount(amount, coin: coin);
|
||||||
final bigIntAmount = amountToBigInt(
|
final bigIntAmount = amountToBigInt(
|
||||||
decimalAmount.toDouble(),
|
decimalAmount.toDouble(),
|
||||||
Constants.decimalPlacesForCoin(coin),
|
Constants.decimalPlacesForCoin(coin),
|
||||||
|
@ -187,8 +187,8 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
web3.EtherUnit.wei, txData['feeInWei']),
|
web3.EtherUnit.wei, txData['feeInWei']),
|
||||||
maxGas: _gasLimit,
|
maxGas: _gasLimit,
|
||||||
value: web3.EtherAmount.inWei(bigIntAmount));
|
value: web3.EtherAmount.inWei(bigIntAmount));
|
||||||
final transaction =
|
final transaction = await client.sendTransaction(_credentials, tx,
|
||||||
await client.sendTransaction(_credentials, tx, chainId: chainId);
|
chainId: chainId.toInt());
|
||||||
|
|
||||||
return transaction;
|
return transaction;
|
||||||
}
|
}
|
||||||
|
@ -773,8 +773,8 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
Future<bool> testNetworkConnection() async {
|
Future<bool> testNetworkConnection() async {
|
||||||
web3.Web3Client client = getEthClient();
|
web3.Web3Client client = getEthClient();
|
||||||
try {
|
try {
|
||||||
final result = await client.isListeningForNetwork();
|
await client.getBlockNumber();
|
||||||
return result;
|
return true;
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue