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

v3.2.0 #118

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9faa680
chore: build number
N3TC4T Nov 14, 2024
b67a12d
feat: Replace AccountResolver with ResolverService
N3TC4T Nov 26, 2024
9c28eaa
feat: improve token/issuer details resolving/caching
N3TC4T Nov 26, 2024
e0713c9
chore: clean up
N3TC4T Nov 26, 2024
c0c60d0
fix: only update the active account details on cold boot
N3TC4T Nov 26, 2024
8759bf0
fix: wrong regular key payment values color
N3TC4T Nov 26, 2024
1db595c
feat: reduce blocked participant visibility on event list
N3TC4T Nov 26, 2024
9dbec97
fix: ExplainBalanceOverlay readonly warning
N3TC4T Nov 26, 2024
29f8f9f
fix: XAppBrowser more debug details for devs
N3TC4T Nov 26, 2024
77e3829
fix: token details update sync
N3TC4T Nov 26, 2024
e5567e9
feat: developer settings and clean ui
N3TC4T Nov 27, 2024
2743f21
fix: clean up orphan currencies
N3TC4T Nov 27, 2024
7dc79a5
fix: Monetization element
N3TC4T Nov 27, 2024
4449239
chore: v3.2.0
N3TC4T Nov 27, 2024
4e3d53c
chore: e2e
N3TC4T Nov 27, 2024
55425e7
fix: pay button loading indicator color
N3TC4T Nov 27, 2024
4c17a62
fix: simple ui
N3TC4T Nov 27, 2024
a05d37e
chore: bump build number
N3TC4T Nov 27, 2024
c98ee3b
Revert "chore: e2e"
N3TC4T Nov 27, 2024
35b931f
fix: small bugs
N3TC4T Nov 27, 2024
270a54a
fix: PurchaseProduct on Iphone SE
N3TC4T Nov 27, 2024
34da0fe
chore: bump build number
N3TC4T Nov 27, 2024
0f1ce73
fix: account service account change event
N3TC4T Nov 27, 2024
a70a6c6
chore: bump build number
N3TC4T Nov 27, 2024
6ab8988
fix: small ui issues
N3TC4T Nov 28, 2024
3b7acc9
fix: only validate the transaction if it needs to be submitted by app
N3TC4T Nov 28, 2024
370a2fd
chore: bump build number
N3TC4T Nov 28, 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
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ apply plugin: "com.google.firebase.crashlytics"

import com.android.build.OutputFile

def canonicalVersionName = "3.1.0"
def canonicalVersionCode = 29
def canonicalVersionName = "3.2.0"
def canonicalVersionCode = 34

// NOTE: DO NOT change postFixSize value, this is for handling legacy method for handling the versioning in android
def postFixSize = 30_000
Expand Down
8 changes: 4 additions & 4 deletions ios/Xaman.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@
CODE_SIGN_ENTITLEMENTS = Xaman/Xaman.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = LK5BBJNJZ6;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
Expand All @@ -1193,7 +1193,7 @@
INFOPLIST_FILE = Xaman/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.2.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -1218,13 +1218,13 @@
CODE_SIGN_ENTITLEMENTS = Xaman/Xaman.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = LK5BBJNJZ6;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = Xaman/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.2.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 1 addition & 1 deletion ios/Xaman/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>9</string>
<string>5</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>https</string>
Expand Down
2 changes: 1 addition & 1 deletion ios/XamanTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>9</string>
<string>5</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xaman",
"version": "3.1.0",
"version": "3.2.0",
"license": "SEE LICENSE IN <LICENSE>",
"scripts": {
"start": "node node_modules/react-native/cli.js start",
Expand Down
1 change: 1 addition & 0 deletions src/common/constants/screens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const screens = {
Edit: 'app.Settings.ThirdPartyApps.Edit',
},
SessionLog: 'app.Settings.SessionLog',
DeveloperSettings: 'app.Settings.DeveloperSettings',
General: 'app.Settings.General',
Advanced: 'app.Settings.Advanced',
Security: 'app.Settings.Security',
Expand Down
109 changes: 109 additions & 0 deletions src/common/helpers/advisory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/**
Advisory helper
*/

import BigNumber from 'bignumber.js';

import LedgerService from '@services/LedgerService';

import { AccountRoot } from '@common/libs/ledger/types/ledger';
import { AccountInfoAccountFlags } from '@common/libs/ledger/types/methods/accountInfo';

/* Constants ==================================================================== */
const BLACK_HOLE_KEYS = ['rrrrrrrrrrrrrrrrrrrrrhoLvTp', 'rrrrrrrrrrrrrrrrrrrrBZbvji'];
const EXCHANGE_BALANCE_THRESHOLD = 1000000000000;
const MIN_TRANSACTION_TAG = 9999;
const HIGH_SENDER_COUNT = 10;
const HIGH_PERCENTAGE_TAGGED_TX = 50;

/* Helper Functions ==================================================================== */
/**
* The Advisory object provides methods to fetch account advisory information, account details,
* and perform various checks on accounts based on their data and flags.
*/
const Advisory = {
/**
* Determines whether a possible exchange can take place based on the account balance.
*
* The function evaluates if the account balance is defined and greater than a specified threshold.
*
* @param {AccountRoot} accountData - The account data containing balance information.
* @returns {boolean} - Returns true if the account balance exceeds the exchange threshold; otherwise, false.
*/
checkPossibleExchange: (accountData?: AccountRoot): boolean => {
return !!accountData?.Balance && new BigNumber(accountData.Balance).isGreaterThan(EXCHANGE_BALANCE_THRESHOLD);
},

/**
* Checks if a given account is a "black hole" account.
*
* A black hole account is determined by checking if:
* 1. The account has a RegularKey set.
* 2. The master key is disabled.
* 3. The RegularKey is one of the predefined black hole keys.
*
* @param {AccountRoot} accountData - The account data object containing details of the account.
* @param {AccountInfoAccountFlags} accountFlags - The flags indicating account settings.
* @returns {boolean} - True if the account is a black hole account, otherwise false.
*/
checkBlackHoleAccount: (accountData?: AccountRoot, accountFlags?: AccountInfoAccountFlags): boolean => {
return (
!!accountData?.RegularKey &&
!!accountFlags?.disableMasterKey &&
BLACK_HOLE_KEYS.includes(accountData.RegularKey)
);
},

/**
* Determines if incoming XRP is disallowed for an account based on its flags.
*
* @param {AccountInfoAccountFlags} accountFlags - The flags associated with the account.
* @returns {boolean} - Returns `true` if the account disallows incoming XRP, otherwise `false`.
*/
checkDisallowIncomingXRP: (accountFlags?: AccountInfoAccountFlags): boolean => {
return accountFlags?.disallowIncomingXRP ?? false;
},

/**
* Checks if a destination tag is required for transactions to a specific account.
*
* This function evaluates multiple conditions to determine if a destination tag
* should be enforced for incoming transactions to the specified account address.
* It first checks if the destination tag requirement is already specified in the
* provided advisory or account flags. If not, it retrieves recent transactions
* for the account and analyzes the percentage of incoming transactions that
* already use a destination tag, as well as the number of unique senders.
*
* @param {string} address - The account address to check for destination tag requirement.
* @param {XamanBackend.AccountAdvisoryResponse} advisory - Advisory response with force destination tag info.
* @param {AccountInfoAccountFlags} accountFlags - Account flags indicating if destination tag is required.
* @returns {Promise<boolean>} - Returns true if a destination tag is required, false otherwise.
*/
checkRequireDestinationTag: async (
address: string,
advisory: XamanBackend.AccountAdvisoryResponse,
accountFlags?: AccountInfoAccountFlags,
): Promise<boolean> => {
// already indicates on advisory or account info ?
if (advisory.force_dtag || accountFlags?.requireDestinationTag) {
return true;
}

const transactionsResp = await LedgerService.getTransactions(address, undefined, 200);

if (!('error' in transactionsResp) && transactionsResp.transactions?.length > 0) {
const incomingTXS = transactionsResp.transactions.filter((tx) => tx.tx.Destination === address);
const incomingTxCountWithTag = incomingTXS.filter(
(tx) => Number(tx.tx.DestinationTag) > MIN_TRANSACTION_TAG,
).length;
const uniqueSenders = new Set(transactionsResp.transactions.map((tx) => tx.tx.Account || '')).size;
const percentageTag = (incomingTxCountWithTag / incomingTXS.length) * 100;

return uniqueSenders >= HIGH_SENDER_COUNT && percentageTag > HIGH_PERCENTAGE_TAGGED_TX;
}

return false;
},
};

export default Advisory;
Loading
Loading