Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
quetool committed Dec 11, 2023
1 parent 241fe01 commit 05707dd
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Steps to reproduce the behavior:
**Expected behavior**
A clear and concise description of what you expected to happen.

**Reproducible code**
If applicable, add a minimum reproducible code snippet.

**Screenshots**
If applicable, add screenshots to help explain your problem.

Expand Down
66 changes: 66 additions & 0 deletions example/wallet/lib/dependencies/chains/evm_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,70 @@ class EVMService {
version: TypedDataVersion.V4,
);
}

// Future<void> interactWithContract(String topic, dynamic parameters) async {
// final contractAddr =
// EthereumAddress.fromHex('0xf451659CF5688e31a31fC3316efbcC2339A490Fb');
// final receiver =
// EthereumAddress.fromHex('0x6c87E1a114C3379BEc929f6356c5263d62542C13');

// final File abiFile = File(join(dirname(Platform.script.path), 'abi.json'));
// final List<ChainKey> keys = GetIt.I<IKeyService>().getKeysForChain(
// chainSupported.chain(),
// );

// final credentials = EthPrivateKey.fromHex('0x${keys[0].privateKey}');
// final ownAddress = credentials.address;

// // read the contract abi and tell web3dart where it's deployed (contractAddr)
// final abiCode = await abiFile.readAsString();
// final contract = DeployedContract(
// ContractAbi.fromJson(abiCode, 'MetaCoin'),
// contractAddr,
// );

// // extracting some functions and events that we'll need later
// final transferEvent = contract.event('Transfer');
// final balanceFunction = contract.function('getBalance');
// final sendFunction = contract.function('sendCoin');

// // listen for the Transfer event when it's emitted by the contract above
// final subscription = ethClient
// .events(FilterOptions.events(contract: contract, event: transferEvent))
// .take(1)
// .listen((event) {
// final decoded = transferEvent.decodeResults(
// event.topics ?? [],
// event.data ?? '',
// );

// final from = decoded[0] as EthereumAddress;
// final to = decoded[1] as EthereumAddress;
// final value = decoded[2] as BigInt;

// print('$from sent $value MetaCoins to $to');
// });

// // check our balance in MetaCoins by calling the appropriate function
// final balance = await ethClient.call(
// contract: contract,
// function: balanceFunction,
// params: [ownAddress],
// );
// print('We have ${balance.first} MetaCoins');

// // send all our MetaCoins to the other address by calling the sendCoin
// // function
// await ethClient.sendTransaction(
// credentials,
// Transaction.callContract(
// contract: contract,
// function: sendFunction,
// parameters: [receiver, balance.first],
// ),
// );

// await subscription.asFuture();
// await subscription.cancel();
// }
}
4 changes: 3 additions & 1 deletion lib/apis/utils/constants.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:walletconnect_flutter_v2/src/version.dart';

class WalletConnectConstants {
static const SDK_VERSION = '2.1.11';
static const SDK_VERSION = packageVersion;

static const CORE_PROTOCOL = 'wc';
static const CORE_VERSION = 2;
Expand Down
2 changes: 2 additions & 0 deletions lib/walletconnect_flutter_v2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ export 'apis/web3wallet/web3wallet.dart';
// Web3App
export 'apis/web3app/i_web3app.dart';
export 'apis/web3app/web3app.dart';

export 'src/version.dart';

0 comments on commit 05707dd

Please sign in to comment.