-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1720 from TalaoDAO/walletconnectV2
Walletconnect v2 implementation (except tezos)
- Loading branch information
Showing
33 changed files
with
1,035 additions
and
641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
enum CredentialsStatus { | ||
init, | ||
idle, | ||
populate, | ||
loading, | ||
insert, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
enum WCV2SignType { | ||
message, | ||
personalMessage, | ||
typedMessageV2, | ||
typedMessageV3, | ||
typedMessageV4, | ||
} | ||
|
||
class EthereumSignMessage { | ||
const EthereumSignMessage({ | ||
required this.data, | ||
required this.address, | ||
required this.type, | ||
}); | ||
|
||
final String data; | ||
final String address; | ||
final WCV2SignType type; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:json_annotation/json_annotation.dart'; | ||
|
||
part 'ethereum_transaction.g.dart'; | ||
|
||
@JsonSerializable(includeIfNull: false) | ||
class EthereumTransaction { | ||
EthereumTransaction({ | ||
required this.from, | ||
required this.to, | ||
required this.value, | ||
this.nonce, | ||
this.gasPrice, | ||
this.maxFeePerGas, | ||
this.maxPriorityFeePerGas, | ||
this.gas, | ||
this.gasLimit, | ||
this.data, | ||
}); | ||
|
||
factory EthereumTransaction.fromJson(Map<String, dynamic> json) => | ||
_$EthereumTransactionFromJson(json); | ||
final String from; | ||
final String to; | ||
final String value; | ||
final String? nonce; | ||
final String? gasPrice; | ||
final String? maxFeePerGas; | ||
final String? maxPriorityFeePerGas; | ||
final String? gas; | ||
final String? gasLimit; | ||
final String? data; | ||
|
||
Map<String, dynamic> toJson() => _$EthereumTransactionToJson(this); | ||
|
||
@override | ||
String toString() { | ||
return 'WCEthereumTransaction(from: $from, to: $to, nonce: $nonce, gasPrice: $gasPrice, maxFeePerGas: $maxFeePerGas, maxPriorityFeePerGas: $maxPriorityFeePerGas, gas: $gas, gasLimit: $gasLimit, value: $value, data: $data)'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export 'ethereum_sign_message.dart'; | ||
export 'ethereum_transaction.dart'; | ||
export 'saved_dapp_data.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import 'package:altme/app/app.dart'; | ||
import 'package:beacon_flutter/beacon_flutter.dart'; | ||
import 'package:equatable/equatable.dart'; | ||
import 'package:json_annotation/json_annotation.dart'; | ||
import 'package:wallet_connect/wallet_connect.dart'; | ||
import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart'; | ||
|
||
part 'saved_dapp_data.g.dart'; | ||
|
||
@JsonSerializable() | ||
class SavedDappData extends Equatable { | ||
const SavedDappData({ | ||
this.peer, | ||
required this.walletAddress, | ||
required this.blockchainType, | ||
this.wcSessionStore, | ||
this.walletAddress, | ||
this.sessionData, | ||
}); | ||
|
||
factory SavedDappData.fromJson(Map<String, dynamic> json) => | ||
_$SavedDappDataFromJson(json); | ||
|
||
final P2PPeer? peer; | ||
final String walletAddress; | ||
final BlockchainType blockchainType; | ||
final WCSessionStore? wcSessionStore; | ||
final String? walletAddress; | ||
final SessionData? sessionData; | ||
|
||
Map<String, dynamic> toJson() => _$SavedDappDataToJson(this); | ||
|
||
@override | ||
List<Object?> get props => | ||
[peer, walletAddress, blockchainType, wcSessionStore]; | ||
List<Object?> get props => [ | ||
peer, | ||
walletAddress, | ||
sessionData, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.