Skip to content

Commit

Permalink
add jiffyscan as 4337 explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwahid authored and Sednaoui committed Jul 3, 2023
1 parent 70063d3 commit c1abfa9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/config/network.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Networks {
logo: SvgPicture.asset("assets/images/optimism.svg"),
extendedLogo: SvgPicture.asset("assets/images/optimism-wordmark-red.svg"),
chainId: BigInt.from(10),
explorerUrl: "https://optimistic.etherscan.io",
explorers: {"etherscan":"https://optimistic.etherscan.io/{data}", "jiffyscan":"https://www.jiffyscan.xyz/{data}?network=optimism"},
//
coinGeckoAssetPlatform: "optimistic-ethereum",
nativeCurrency: 'ETH',
Expand Down Expand Up @@ -79,7 +79,7 @@ class Networks {
visible: false,
color: const Color.fromARGB(255, 34, 115, 113),
chainId: BigInt.from(420),
explorerUrl: "https://goerli-optimism.etherscan.io",
explorers: {"etherscan":"https://goerli-optimism.etherscan.io/{data}", "jiffyscan":"https://www.jiffyscan.xyz/{data}?network=optimism-goerli"},
//
coinGeckoAssetPlatform: "optimistic-ethereum",
nativeCurrency: 'ETH',
Expand Down Expand Up @@ -121,7 +121,7 @@ class Networks {
visible: false,
color: const Color.fromARGB(255, 70, 127, 188),
chainId: BigInt.from(5),
explorerUrl: "https://goerli.etherscan.io",
explorers: {"etherscan":"https://goerli.etherscan.io/{data}", "jiffyscan":"https://www.jiffyscan.xyz/{data}?network=optimism"},
//
coinGeckoAssetPlatform: "ethereum",
nativeCurrency: 'ETH',
Expand Down Expand Up @@ -220,7 +220,7 @@ class Network{
Widget? logo;
Widget? extendedLogo;
BigInt chainId;
String explorerUrl;
Map<String, String> explorers;
String coinGeckoAssetPlatform;
String nativeCurrency;
EthereumAddress nativeCurrencyAddress;
Expand Down Expand Up @@ -248,7 +248,7 @@ class Network{
this.logo,
this.extendedLogo,
required this.chainId,
required this.explorerUrl,
required this.explorers,
required this.coinGeckoAssetPlatform,
required this.nativeCurrency,
required this.nativeCurrencyAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,13 @@ class _TransactionActivityDetailsCardState extends State<TransactionActivityDeta
textDirection: TextDirection.rtl,
child: ElevatedButton.icon(
onPressed: () async {
Utils.launchUri("${Networks.selected().explorerUrl}/tx/${widget.transaction.txHash}", mode: LaunchMode.externalApplication);
String url = "";
if (widget.transaction.hash != null && widget.transaction.hash!.isNotEmpty && Networks.selected().explorers.containsKey("jiffyscan")){
url = Networks.selected().explorers["jiffyscan"]!.replaceAll("{data}", "userOpHash/${widget.transaction.hash}");
}else{
url = Networks.selected().explorers["etherscan"]!.replaceAll("{data}", "tx/${widget.transaction.txHash}");
}
Utils.launchUri(url, mode: LaunchMode.externalApplication);
},
style: ButtonStyle(
minimumSize: MaterialStateProperty.all(Size(Get.width * 0.9, 40)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class WCApproveComponent extends StatelessWidget {
Text("Address: ", style: TextStyle(fontFamily: AppThemes.fonts.gilroyBold, fontSize: 13)),
InkWell(
onTap: () async {
String url = "${Networks.selected().explorerUrl}/address/${(transactionDetails.parameterValues[0] as EthereumAddress).hex}";
String url = Networks.selected().explorers["etherscan"]!.replaceAll("{data}", "address/${(transactionDetails.parameterValues[0] as EthereumAddress).hex}");
Utils.launchUri(url, mode: LaunchMode.externalApplication);
},
borderRadius: BorderRadius.circular(25),
Expand Down

0 comments on commit c1abfa9

Please sign in to comment.