Skip to content

Commit

Permalink
Merge pull request #115 from XRPL-Labs/develop
Browse files Browse the repository at this point in the history
v3.0.1
  • Loading branch information
N3TC4T authored Oct 3, 2024
2 parents c9a5455 + b3c0bbd commit cfe7faf
Show file tree
Hide file tree
Showing 100 changed files with 620 additions and 566 deletions.
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.0.0"
def canonicalVersionCode = 18
def canonicalVersionName = "3.0.1"
def canonicalVersionCode = 19

// NOTE: DO NOT change postFixSize value, this is for handling legacy method for handling the versioning in android
def postFixSize = 30_000
Expand Down
4 changes: 4 additions & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
#------------- realm ------------------
-keep class io.realm.react.**

#------------- tangem ------------------
-keep class com.tangem.**


#------------- Hermes ------------------
-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }
Expand Down
34 changes: 17 additions & 17 deletions android/app/src/main/java/libs/common/HTTPClientFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,23 @@


public class HTTPClientFactory implements OkHttpClientFactory {
// TODO: remove "xumm-cdn.imgix.net" after migration period
private static final List<String> trustedHosts = Arrays.asList("xumm-cdn.imgix.net", "cdn.xumm.pro", "xumm.app", "image-proxy.xrpl-labs.com");
private static final String defaultHost = "xumm.app";
// TODO: remove "xumm-cdn.imgix.net", "cdn.xumm.pro". "xumm.app" after migration period
private static final List<String> trustedHosts = Arrays.asList("xumm-cdn.imgix.net", "cdn.xumm.pro", "xumm.app", "cdn.xaman.app", "xaman.app", "image-proxy.xrpl-labs.com");
private static final String defaultHost = "xaman.app";

@Override
public OkHttpClient createNewNetworkModuleClient() {

HostSelectionInterceptor interceptor = new HostSelectionInterceptor();

OkHttpClient.Builder client = new OkHttpClient.Builder()
.connectTimeout(0, TimeUnit.MILLISECONDS)
.readTimeout(0, TimeUnit.MILLISECONDS)
.writeTimeout(0, TimeUnit.MILLISECONDS)
.cookieJar(new ReactCookieJarContainer())
.addInterceptor(interceptor);
return client.build();
}

private static final class HostSelectionInterceptor implements Interceptor {
@Override
Expand All @@ -37,18 +51,4 @@ public okhttp3.Response intercept(Chain chain) throws IOException {
return chain.proceed(request);
}
}

@Override
public OkHttpClient createNewNetworkModuleClient() {

HostSelectionInterceptor interceptor = new HostSelectionInterceptor();

OkHttpClient.Builder client = new OkHttpClient.Builder()
.connectTimeout(0, TimeUnit.MILLISECONDS)
.readTimeout(0, TimeUnit.MILLISECONDS)
.writeTimeout(0, TimeUnit.MILLISECONDS)
.cookieJar(new ReactCookieJarContainer())
.addInterceptor(interceptor);
return client.build();
}
}
12 changes: 6 additions & 6 deletions ios/Xaman.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@
"${PODS_ROOT}/Firebase/CoreOnly/Sources",
"\"$(PODS_ROOT)/boost\"",
"\"$(PODS_ROOT)/Headers/Private/React-Core\"",
"$CONFIGURATION_TEMP_DIR/Xaman.build/DerivedSources",
$CONFIGURATION_TEMP_DIR/Xaman.build/DerivedSources,
);
INFOPLIST_FILE = XamanTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
Expand Down Expand Up @@ -1182,7 +1182,7 @@
"${PODS_ROOT}/Firebase/CoreOnly/Sources",
"\"$(PODS_ROOT)/boost\"",
"\"$(PODS_ROOT)/Headers/Private/React-Core\"",
"$CONFIGURATION_TEMP_DIR/Xaman.build/DerivedSources",
$CONFIGURATION_TEMP_DIR/Xaman.build/DerivedSources,
);
INFOPLIST_FILE = XamanTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
Expand Down Expand Up @@ -1210,7 +1210,7 @@
CODE_SIGN_ENTITLEMENTS = Xaman/Xaman.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 14;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = LK5BBJNJZ6;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
Expand All @@ -1221,7 +1221,7 @@
INFOPLIST_FILE = Xaman/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.0.0;
MARKETING_VERSION = 3.0.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -1246,13 +1246,13 @@
CODE_SIGN_ENTITLEMENTS = Xaman/Xaman.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 14;
CURRENT_PROJECT_VERSION = 1;
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.0.0;
MARKETING_VERSION = 3.0.1;
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>14</string>
<string>1</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>14</string>
<string>1</string>
</dict>
</plist>
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.0.0",
"version": "3.0.1",
"license": "SEE LICENSE IN <LICENSE>",
"scripts": {
"start": "node node_modules/react-native/cli.js start",
Expand Down
1 change: 0 additions & 1 deletion src/__mocks__/react-native-localize.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable spellcheck/spell-checker */
const getLocales = () => [
// you can choose / add the locales you want
{ countryCode: 'US', languageTag: 'en-US', languageCode: 'en', isRTL: false },
Expand Down
45 changes: 0 additions & 45 deletions src/common/constants/api.ts

This file was deleted.

11 changes: 3 additions & 8 deletions src/common/constants/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@
*/

export default {
// App Details and URL's
appName: 'Xaman',
supportEmail: 'support@xumm.dev',
termOfUseURL: 'https://xumm.app/app/webviews/tos-privacy/',
creditsURL: 'https://xumm.app/app/webviews/credits/',
changeLogURL: 'https://xumm.app/app/webviews/update/en/?update=',
explorerProxy: 'https://xumm.app/explorer',
hooksExplainerURL: 'https://xumm.app/app/webviews/hooks/',
supportEmail: 'support@xaman.app',

// persist storage config
// NOTE: this should never be changed
storage: {
keyName: 'xumm-realm-key',
path: 'xumm.realm',
},

// list of static xapp identifiers
// list of static xApp identifiers
xappIdentifiers: {
support: 'xumm.support',
nftInfo: 'xumm.nft-info',
Expand Down
58 changes: 58 additions & 0 deletions src/common/constants/endpoints.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* eslint-disable */
/**
* Endpoints
*/

export const HOSTNAME = 'xaman.app';
export const ApiUrl = `https://${HOSTNAME}/api`;

export enum Endpoints {
Ping = '/v1/app/ping',
AddUser = '/v1/app/add-user',
ActivateDevice = '/v1/app/activate-device',
AddDevice = '/v1/app/add-device',
UpdateDevice = '/v1/app/update-device',
RefreshToken = '/v1/app/refresh-token',
Payload = '/v1/app/payload/{uuid}',
PendingPayloads = '/v1/app/pending-payloads',
CuratedIOUs = '/v1/app/curated-ious',
AddressInfo = '/v1/app/account-info',
Lookup = '/v1/app/handle-lookup',
AccountAdvisory = '/v1/app/account-advisory',
LiquidityBoundaries = '/v1/app/liquidity-boundaries/{issuer}/{currency}',
Translation = '/v1/app/translation/{uuid}',
XAppsStore = '/v1/app/xapp/store/v1/{category}',
XAppsShortList = '/v1/app/xapp/shortlist',
XAppLaunch = '/v1/app/xapp/launch/{xAppId}',
XAppInfo = '/v1/app/xapp/info/{xAppId}',
Currencies = '/v1/app/currencies/{locale}',
Rates = '/v1/app/rates/{currency}',
AuditTrail = '/v1/app/audit-trail/{destination}',
AddAccount = '/v1/app/add-account',
AddTransaction = '/v1/app/add-tx',
ThirdPartyApps = '/v1/app/third-party-permissions',
ThirdPartyApp = '/v1/app/third-party-permissions/{appId}',
NftDetails = '/v1/app/nft-details',
NftOffered = '/v1/app/nft-offered/{account}',
NetworkRails = '/v1/app/rails',
VerifyPurchase = '/v1/app/verify-purchase',
}

export enum WebLinks {
// Webview
TermOfUseURL = `https://${HOSTNAME}/app/webviews/tos-privacy`,
CreditsURL = `https://${HOSTNAME}/app/webviews/credits`,
ChangeLogURL = `https://${HOSTNAME}/app/webviews/update`,
HooksExplainerURL = `https://${HOSTNAME}/app/webviews/hooks`,

// Providers
ExplorerProxy = `https://${HOSTNAME}/explorer`,
AvatarURL = `https://${HOSTNAME}/avatar`,

// Blog and Help center
FAQSecurityHardwareURL = `https://${HOSTNAME}/redir/faq/security-hardware`,
FAQAccountSigningPasswordURL = `https://${HOSTNAME}/redir/faq/account-signing-password`,

// Other
AppleStoreLink = `https://apps.apple.com/us/app/id1492302343`,
}
3 changes: 1 addition & 2 deletions src/common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

import AppConfig from './config';
import AppScreens from './screens';
import ApiConfig from './api';
import NetworkConfig from './network';

import Amendments from './amendments';
import ErrorMessages from './errors';

export { AppConfig, AppScreens, ApiConfig, NetworkConfig, Amendments, ErrorMessages };
export { AppConfig, AppScreens, NetworkConfig, Amendments, ErrorMessages };
22 changes: 10 additions & 12 deletions src/common/libs/payload/__tests__/object.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ describe('Payload', () => {
expect(craftedPayload.getTransaction().JsonForSigning).toEqual(transaction);
expect(craftedPayload.getSigners()).toEqual(['rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY']);

const payloadPatchSpy = jest.spyOn(ApiService.payload, 'patch');
const payloadPatchSpy = jest.spyOn(ApiService, 'fetch');
// @ts-ignore
craftedPayload.patch({ signed_blob: '', tx_id: '', multisigned: '' });
expect(payloadPatchSpy).toBeCalledTimes(0);
payloadPatchSpy.mockClear();
payloadPatchSpy.mockRestore();

const payloadRejectSpy = jest.spyOn(ApiService.payload, 'patch');
const payloadRejectSpy = jest.spyOn(ApiService, 'fetch');
craftedPayload.reject('USER');
expect(payloadRejectSpy).toBeCalledTimes(0);
payloadRejectSpy.mockClear();
Expand All @@ -44,7 +44,7 @@ describe('Payload', () => {
const { AccountSet: AccountSetPayload } = PayloadTemplate;

const payloadFetchSpy = jest
.spyOn(ApiService.payload, 'get')
.spyOn(ApiService, 'fetch')
.mockImplementation(() => Promise.resolve(AccountSetPayload));

const fetchedPayload = await Payload.from(AccountSetPayload.meta.uuid);
Expand All @@ -63,7 +63,7 @@ describe('Payload', () => {
invalidTypesPayload.payload.request_json.TransactionType = 'SomethingElse';

let payloadFetchSpy = jest
.spyOn(ApiService.payload, 'get')
.spyOn(ApiService, 'fetch')
.mockImplementation(() => Promise.resolve(Object.assign(invalidTypesPayload)));

try {
Expand All @@ -74,9 +74,7 @@ describe('Payload', () => {

payloadFetchSpy.mockClear();

payloadFetchSpy = jest
.spyOn(ApiService.payload, 'get')
.mockImplementation(() => Promise.resolve(AccountSetPayload));
payloadFetchSpy = jest.spyOn(ApiService, 'fetch').mockImplementation(() => Promise.resolve(AccountSetPayload));

const invalidSignInPayload = JSON.parse(JSON.stringify(AccountSetPayload));
invalidSignInPayload.payload.tx_type = 'SignIn';
Expand All @@ -95,7 +93,7 @@ describe('Payload', () => {
const { InvalidPayload } = PayloadTemplate;

const payloadFetchSpy = jest
.spyOn(ApiService.payload, 'get')
.spyOn(ApiService, 'fetch')
.mockImplementation(() => Promise.resolve(InvalidPayload));

try {
Expand Down Expand Up @@ -152,7 +150,7 @@ describe('Payload', () => {
it('Should throw error if payload is resolved or expired', async () => {
const { AccountSet: AccountSetPayload } = PayloadTemplate;

const payloadFetchSpy = jest.spyOn(ApiService.payload, 'get').mockImplementation(() =>
const payloadFetchSpy = jest.spyOn(ApiService, 'fetch').mockImplementation(() =>
Promise.resolve({
...AccountSetPayload,
...{
Expand All @@ -173,7 +171,7 @@ describe('Payload', () => {

payloadFetchSpy.mockClear();

const payloadFetchSpy2 = jest.spyOn(ApiService.payload, 'get').mockImplementation(() =>
const payloadFetchSpy2 = jest.spyOn(ApiService, 'fetch').mockImplementation(() =>
Promise.resolve({
...AccountSetPayload,
...{
Expand All @@ -199,7 +197,7 @@ describe('Payload', () => {
const { AccountSet: AccountSetPayload } = PayloadTemplate;

const payloadFetchSpy = jest
.spyOn(ApiService.payload, 'get')
.spyOn(ApiService, 'fetch')
.mockImplementation(() => Promise.reject(new ApiError('message', 403, 'refrence')));

try {
Expand Down
Loading

0 comments on commit cfe7faf

Please sign in to comment.