Compare commits
45
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
579e0790ab | ||
|
|
79bded1023 | ||
|
|
ff3f171646 | ||
|
|
3ae85cacd5 | ||
|
|
36f9436e12 | ||
|
|
8c42e717c1 | ||
|
|
cf0cd283a6 | ||
|
|
316c6038d7 | ||
|
|
f5034a4dfa | ||
|
|
cf58a84838 | ||
|
|
dcd2655860 | ||
|
|
9e0b8e76cf | ||
|
|
40a26f4e10 | ||
|
|
094cf61915 | ||
|
|
c238b6bca5 | ||
|
|
908b5f723c | ||
|
|
085ae22be1 | ||
|
|
0368895edf | ||
|
|
905699b686 | ||
|
|
b198084b78 | ||
|
|
2e7c377343 | ||
|
|
9f36bd44b2 | ||
|
|
4e9b1001df | ||
|
|
e602f0493d | ||
|
|
85991d2272 | ||
|
|
f3ed1e370a | ||
|
|
bdbc48764e | ||
|
|
c74a5a5215 | ||
|
|
c4cac2cef7 | ||
|
|
966f6de31a | ||
|
|
93ed3eb7ff | ||
|
|
bc12c90d2e | ||
|
|
00ec94b73c | ||
|
|
5458c7b2db | ||
|
|
92fae99cf7 | ||
|
|
9cd1e08aaa | ||
|
|
6cf3a6a98e | ||
|
|
c866082cde | ||
|
|
22ca98b0f8 | ||
|
|
b5f7a62b14 | ||
|
|
abe6e97728 | ||
|
|
6940adf1cb | ||
|
|
e55cb6b47b | ||
|
|
ccd034e7a6 | ||
|
|
f2da0cbbdb |
+1
-1
@@ -17,4 +17,4 @@ RPC_NETWORKS_ONLY=0
|
||||
PARTITIONED_TOPIC=0
|
||||
CONTRACT_NODES=1
|
||||
ENABLE_ROOT_ALERT=1
|
||||
ENABLE_REFERRAL_INVITE=1
|
||||
ENABLE_REFERRAL_INVITE=0
|
||||
|
||||
+3
-3
@@ -28,8 +28,8 @@ desktop/ @vkjr
|
||||
modules/react-native-desktop*/ @vkjr
|
||||
modules/react-native-desktop*/ @vkjr
|
||||
|
||||
/doc @oskarth @yenda @jeluard
|
||||
/doc @oskarth @yenda @jeluard
|
||||
|
||||
/deployment @vkjr
|
||||
/deployment @vkjr
|
||||
|
||||
/test/appium/ @antdanchenko @churik
|
||||
/test/appium/ @churik
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
@@ -101,12 +101,14 @@ pipeline {
|
||||
} else { /* if no universal is available pick first */
|
||||
env.PKG_URL = urls.first()
|
||||
}
|
||||
if (utils.isNightlyBuild()) {
|
||||
env.DIAWI_URL = android.uploadToDiawi()
|
||||
}
|
||||
jenkins.setBuildDesc(APK: env.PKG_URL)
|
||||
/* e2e builds get tested in SauceLabs */
|
||||
if (utils.isE2EBuild()) {
|
||||
env.SAUCE_URL = android.uploadToSauceLabs()
|
||||
}
|
||||
if (utils.isNightlyBuild()) {
|
||||
env.DIAWI_URL = android.uploadToDiawi()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos-xcode-11.5' }
|
||||
@@ -99,8 +99,9 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
env.PKG_URL = s3.uploadArtifact(api)
|
||||
jenkins.setBuildDesc(IPA: env.PKG_URL)
|
||||
/* e2e builds get tested in SauceLabs */
|
||||
if (btype == 'e2e') {
|
||||
if (utils.isE2EBuild()) {
|
||||
env.SAUCE_URL = ios.uploadToSauceLabs()
|
||||
} else {
|
||||
env.DIAWI_URL = ios.uploadToDiawi()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label params.AGENT_LABEL }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos' }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
# Description
|
||||
|
||||
This document describes how to update Status APK builds for the [F-Droid](https://f-droid.org/) Android application catalogue.
|
||||
|
||||
# Intro
|
||||
|
||||
In simplest terms F-Droid requires a YAML file that defines the steps necessary to create a universal unsigned APK build. This is achieved by submitting a new app versions into the `metadata/im.status.ethereum.yml` file in the [fdroiddata](https://gitlab.com/fdroid/fdroiddata) repository.
|
||||
|
||||
The app builds defined this way run on servers that generate the unsigned APKs using the [fdroidserver](https://gitlab.com/fdroid/fdroidserver) software. The [server setup](https://f-droid.org/en/docs/Build_Server_Setup/) is quite involved but is not necessary unless you want to run your own instance. Normally the applications defines in `fdroiddata` are built by servers maintained by [the F-Droid volunteers](https://f-droid.org/en/contribute/).
|
||||
|
||||
First release of Status app was merged in [fdroid/fdroiddata#7179](https://gitlab.com/fdroid/fdroiddata/-/merge_requests/7179).
|
||||
|
||||
# Adding New Versions
|
||||
|
||||
You can find our configuration file at [`metadata/im.status.ethereum.yml`](https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/im.status.ethereum.yml)
|
||||
|
||||
The file defines all the necessary metadata like `SourceCode`, `Website`, or `License`, but the most important key is `Builds`, which looks like this:
|
||||
```yml
|
||||
Builds:
|
||||
- versionName: 1.4.1
|
||||
versionCode: 2020070112
|
||||
commit: cfb825a11b61d312af8cb5d36686af540c31f481
|
||||
sudo:
|
||||
- mkdir -m 0755 /nix
|
||||
- chown vagrant /nix
|
||||
init: ./nix/scripts/setup.sh
|
||||
output: ./result/app-release-unsigned.apk
|
||||
scanignore:
|
||||
- android/build.gradle
|
||||
scandelete:
|
||||
- ios
|
||||
build: make release-android BUILD_TYPE=release BUILD_NUMBER=2020070112 ANDROID_APK_SIGNED=false
|
||||
```
|
||||
It contains a list of objects defining each release of the application. In order to add a new release simply copy a previous release object and adjust the following values:
|
||||
|
||||
* `versionName` - String version like `1.4.1`
|
||||
* `versionCode` - Android `versionCode`. We use a timestamp generated by [a script](../scripts/version/gen_build_no.sh)
|
||||
* `commit` - Specific commit SHA1 from which the given release was built
|
||||
* `BUILD_NUMBER` in `build` step - Same value as `versionCode`
|
||||
|
||||
The `versionCode` should be the same as the one in build that was uplodade to Play Store. It can be found in the build logs or by using:
|
||||
```
|
||||
> apkanalyzer manifest version-code StatusIm-v1.4.1.apk
|
||||
2020070112
|
||||
```
|
||||
|
||||
At the bottom of the file you should also update the following keys:
|
||||
|
||||
* `CurrentVersion` - Same as the new `versionName` added
|
||||
* `CurrentVersionCode` - Same as the `versionCode` added
|
||||
|
||||
Then submit a merge request to the [fdroid/fdroiddata](https://gitlab.com/fdroid/fdroiddata) repository.
|
||||
|
||||
# Checking Builds
|
||||
|
||||
The simplest way to test if the app builds via F-Droid is to use the Docker image:
|
||||
https://gitlab.com/fdroid/docker-executable-fdroidserver
|
||||
|
||||
Which is available under `registry.gitlab.com/fdroid/docker-executable-fdroidserver:latest`.
|
||||
|
||||
Because we use Nix to build the mobile app we need to slightly modify the image with this `Dockerfile`:
|
||||
```Dockerfile
|
||||
FROM registry.gitlab.com/fdroid/docker-executable-fdroidserver:latest
|
||||
ARG BUILDER_UID=1000
|
||||
ENV BUILDER_USER=vagrant
|
||||
RUN useradd -u $BUILDER_UID $BUILDER_USER
|
||||
RUN mkdir -m 0755 /nix /home/$BUILDER_USER \
|
||||
&& chown -R $BUILDER_USER /nix /home/$BUILDER_USER
|
||||
```
|
||||
Build it using:
|
||||
```
|
||||
docker build --build-arg=BUILDER_UID=$UID -t statusteam/docker-executable-fdroidserver:latest .
|
||||
```
|
||||
Then clone the [fdroiddata](https://gitlab.com/fdroid/fdroiddata) and [fdroidserver](https://gitlab.com/fdroid/fdroidserver) repos and use it to test the build of a specific Status Android app version: `1.4.1`
|
||||
```
|
||||
docker run --rm \
|
||||
-u $UID:$GID \
|
||||
-v $(pwd)/nix:/nix \
|
||||
-v $(pwd)/fdroiddata:/repo \
|
||||
-v $(pwd)/fdroidserver:/fdroidserver \
|
||||
statusteam/docker-executable-fdroidserver:latest \
|
||||
build im.status.ethereum:1.4.1
|
||||
```
|
||||
We have to create a user and specify the UID because Nix cannot run as `root` and that is the default user for the F-Droid Docker image. By adding our own user and setting the UID we also make it possible to mount folders like `fdroiddata` and `fdroidserver`.
|
||||
|
||||
You can specify a `--vebose` flag for `build` command for additional information.
|
||||
|
||||
You should also run `lint im.status.ethereum` to verify the YAML format is correct.
|
||||
|
||||
# Details
|
||||
|
||||
The original research was done in [#8512](https://github.com/status-im/status-react/issues/8512).
|
||||
|
||||
Normally F-Droid server wants to run Gradle itself, but we do not specify the `gradle` key in order to run `make release-android` ourselves in `build` step.
|
||||
@@ -1,12 +1,12 @@
|
||||
Status é uma ferramenta de comunicação segura e privada. Converse com os seus amigos, armazene ativos e explore o futuro da web sem que os seus dados sejam explorados.
|
||||
Status es una herramienta de comunicación segura y privada. Chatea con amigos, almacena activos y explora el futuro de la web sin ser explotado por tu información personal.
|
||||
|
||||
Com a Status, apenas você controlas as suas informações.
|
||||
Solo tú controlas tu información, con Status.
|
||||
|
||||
CONVERSA
|
||||
A Status remove terceiros centralizados das suas mensagens. Não é apenas o seu conteúdo que está protegido, mas também os seus metadados - para uma privacidade máxima.
|
||||
CHAT
|
||||
Status quita de en medio terceros centralizados a tus mensajes. No sólo tu contenido es protegido, sino también tu metadata: por máxima privacidad.
|
||||
|
||||
TRANSACIONA
|
||||
Armazene ativos digitais na sua carteira Status. Envie e solicite tokens aos seus amigos, ou transacione com aplicações descentralizadas.
|
||||
TRANSFIERE
|
||||
Almacena activos digitales en tu monedero Status (ERC20 and ERC721). Envía y recibe monedas de tus amigos, o transfiere activos con aplicaciónes descentralizadas.
|
||||
|
||||
EXPLORA
|
||||
Acesse à aplicações baseadas na Ethereum na web3. Joge jogos, troce ativos digitais e muito mais.
|
||||
Accede a aplicaciones basadas en Ethereum de la Web3. Juega, intercambia bienes digitales y más.
|
||||
@@ -1 +1 @@
|
||||
Converse e faça transações de uma forma segura
|
||||
Chatea y transfiere de forma segura
|
||||
@@ -1 +1 @@
|
||||
Status - Comunição Privada
|
||||
Status - Comunicación Privada
|
||||
+7
-7
@@ -334,7 +334,7 @@ PODS:
|
||||
- React
|
||||
- RNFS (2.16.6):
|
||||
- React
|
||||
- RNGestureHandler (1.6.1):
|
||||
- RNGestureHandler (1.8.0):
|
||||
- React
|
||||
- RNImageCropPicker (0.31.1):
|
||||
- React-Core
|
||||
@@ -353,9 +353,9 @@ PODS:
|
||||
- React
|
||||
- RNReactNativeHapticFeedback (1.9.0):
|
||||
- React
|
||||
- RNReanimated (1.8.0):
|
||||
- RNReanimated (1.13.0):
|
||||
- React
|
||||
- RNScreens (2.5.0):
|
||||
- RNScreens (2.10.1):
|
||||
- React
|
||||
- RNSVG (9.13.6):
|
||||
- React
|
||||
@@ -601,7 +601,7 @@ SPEC CHECKSUMS:
|
||||
Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7
|
||||
FlipperKit: afd4259ef9eadeeb2d30250b37d95cb3b6b97a69
|
||||
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
|
||||
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
|
||||
glog: d6cca0516fb0ca3697a5b2e199ea83dfc7133411
|
||||
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
|
||||
Permission-Camera: afad27bf90337684d4a86f3825112d648c8c4d3b
|
||||
Permission-Microphone: 0ffabc3fe1c75cfb260525ee3f529383c9f4368c
|
||||
@@ -643,14 +643,14 @@ SPEC CHECKSUMS:
|
||||
RNCPushNotificationIOS: c145c6253ea016e5efeff604f2720736b4a596f7
|
||||
RNDeviceInfo: b6e650fbd234732c759544218657d549b4339038
|
||||
RNFS: 2bd9eb49dc82fa9676382f0585b992c424cd59df
|
||||
RNGestureHandler: 8f09cd560f8d533eb36da5a6c5a843af9f056b38
|
||||
RNGestureHandler: 7a5833d0f788dbd107fbb913e09aa0c1ff333c39
|
||||
RNImageCropPicker: 38865ab4af1b0b2146ad66061196bc0184946855
|
||||
RNKeychain: 216f37338fcb9e5c3a2530f1e3295f737a690cb1
|
||||
RNLanguages: 962e562af0d34ab1958d89bcfdb64fafc37c513e
|
||||
RNPermissions: ad71dd4f767ec254f2cd57592fbee02afee75467
|
||||
RNReactNativeHapticFeedback: 2566b468cc8d0e7bb2f84b23adc0f4614594d071
|
||||
RNReanimated: 955cf4068714003d2f1a6e2bae3fb1118f359aff
|
||||
RNScreens: ac02d0e4529f08ced69f5580d416f968a6ec3a1d
|
||||
RNReanimated: 89f5e0a04d1dd52fbf27e7e7030d8f80a646a3fc
|
||||
RNScreens: b748efec66e095134c7166ca333b628cd7e6f3e2
|
||||
RNSVG: 8ba35cbeb385a52fd960fd28db9d7d18b4c2974f
|
||||
SQLCipher: f9fcf29b2e59ced7defc2a2bdd0ebe79b40d4990
|
||||
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
|
||||
|
||||
+45
@@ -9,6 +9,7 @@ import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import androidx.core.content.FileProvider;
|
||||
@@ -16,9 +17,15 @@ import androidx.core.content.FileProvider;
|
||||
import android.util.Log;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.CookieSyncManager;
|
||||
import android.webkit.WebStorage;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.EditText;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import com.facebook.react.bridge.Arguments;
|
||||
import com.facebook.react.bridge.Callback;
|
||||
@@ -30,6 +37,9 @@ import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.bridge.WritableMap;
|
||||
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
||||
import com.facebook.react.uimanager.UIManagerModule;
|
||||
import com.facebook.react.uimanager.UIBlock;
|
||||
import com.facebook.react.uimanager.NativeViewHierarchyManager;
|
||||
|
||||
import statusgo.SignalHandler;
|
||||
import statusgo.Statusgo;
|
||||
@@ -1042,6 +1052,22 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void toggleWebviewDebug(final boolean val) {
|
||||
Log.d(TAG, "toggleWebviewDebug");
|
||||
final Activity activity = getCurrentActivity();
|
||||
if (activity == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
WebView.setWebContentsDebuggingEnabled(val);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void clearStorageAPIs() {
|
||||
Log.d(TAG, "clearStorageAPIs");
|
||||
@@ -1386,5 +1412,24 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void resetKeyboardInputCursor(final int reactTagToReset, final int selection) {
|
||||
UIManagerModule uiManager = getReactApplicationContext().getNativeModule(UIManagerModule.class);
|
||||
uiManager.addUIBlock(new UIBlock() {
|
||||
@Override
|
||||
public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
|
||||
InputMethodManager imm = (InputMethodManager) getReactApplicationContext().getBaseContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (imm != null) {
|
||||
View viewToReset = nativeViewHierarchyManager.resolveView(reactTagToReset);
|
||||
imm.restartInput(viewToReset);
|
||||
try {
|
||||
EditText textView = (EditText) viewToReset;
|
||||
textView.setSelection(selection);
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+61
-51
@@ -3668,16 +3668,16 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "commons-codec/commons-codec/1.14/commons-codec-1.14",
|
||||
"path": "commons-codec/commons-codec/1.15/commons-codec-1.15",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "3e98fb226cb1c6a9caa5fdb2a522ba42f4ea16d2",
|
||||
"sha256": "19mp203aw77s79mv7gqcqdg0i8mww4dcih66pvw6z5s9z31611cn"
|
||||
"sha1": "c08f2dcdbba1a9466f3f9fa05e669fd61c3a47b7",
|
||||
"sha256": "0n5b40x4wsmygna7fivix3cy9rs2yv5ikx30g141adsslfcf2vn8"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "3cb1181b2141a7e752f5bdc998b7ef1849f726cf",
|
||||
"sha256": "1s9kmlbms3hbmvp3rd4ff45h61ly05rjikv4xlfkirdb7zwy8a51"
|
||||
"sha1": "49d94806b6e3dc933dacbd8acb0fdbab8ebd1e5d",
|
||||
"sha256": "0qzd8v96j4x7jjcfpvvdh9ar1xhwxpxi2rh51nzhj0br7bbgdsdk"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5676,16 +5676,16 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/squareup/okhttp3/okhttp/4.8.1/okhttp-4.8.1",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.9.0/okhttp-4.9.0",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "06674a5ab0fe82b134a2fe02a18ccf9c51e9a0b2",
|
||||
"sha256": "08dyq3vxk27na7d5g3p100vi5ihplf6ylrsyibg7lzfc4sxdawmc"
|
||||
"sha1": "8806abdf57ce7ec2d72b5a89eb79ec8907af7eb0",
|
||||
"sha256": "125x8lm1iz2hf9dsxhd25dgpw4x70s2bravwj609wl44wzfr52ag"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "dd36d61fbfa0a33c805e3d92f64e0832234c56c6",
|
||||
"sha256": "1scg21n0a41rhv2n4crx62kmfl5yavj45hgl97acw3c7kccgaggi"
|
||||
"sha1": "08e17601d3bdc8cf57902c154de021931d2c27c1",
|
||||
"sha256": "0z0zaw06f2ihgs1rik50b4y3sjkgk6nwqqv20ksbj0mhxh2bphnv"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5724,16 +5724,16 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/squareup/okio/okio/2.7.0/okio-2.7.0",
|
||||
"path": "com/squareup/okio/okio/2.8.0/okio-2.8.0",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "c171afa3f9084ec998ad1ff7b24e7b857b5bdf24",
|
||||
"sha256": "1p1fnhr6rbry0r1y97mwr5fmb6ld5bf7gd7234yafjj3fhjvh1hw"
|
||||
"sha1": "db3559887f215bc3cdbb4ad37d246d04fbbdff8e",
|
||||
"sha256": "10clihpazwlsml3jhn2pqi8w37cs5a07d1gyr1x46zsczml40896"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "1181a029fa94760ccf46f264bc06ca2e60262f8f",
|
||||
"sha256": "1fc65k52z6zxrbahs0fzigpyb0290870fwxslgc5c0hdvsx05ck3"
|
||||
"sha1": "49b64e09d81c0cc84b267edd0c2fd7df5a64c78c",
|
||||
"sha256": "1j5v14ps6s5c9i2ran6zcm2gmqicvzjlcgrrlpccsbwqfdpb15j4"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -6699,6 +6699,16 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/apache/apache/23/apache-23",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "pom",
|
||||
"pom": {
|
||||
"sha1": "0404949e96725e63a10a6d8f9d9b521948d170d5",
|
||||
"sha256": "07298c2jfkdb6gaxidig2pnl0ckdjfi9qqy5z9vnbwr30r76445w"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
@@ -6856,12 +6866,12 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/apache/commons/commons-parent/50/commons-parent-50",
|
||||
"path": "org/apache/commons/commons-parent/52/commons-parent-52",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "pom",
|
||||
"pom": {
|
||||
"sha1": "b47c55b7ee647e1c78546791e7f4fe59b842c320",
|
||||
"sha256": "01kz260pqzil5h2rv1rjvrpf4aq7r3pxalzmcxc4n1s7yyrjsykv"
|
||||
"sha1": "004ee86dedc66d0010ccdc29e5a4ce014c057854",
|
||||
"sha256": "0bjhnkdhdsdcc12daiqhbwxwvjxlkqplmbns8bzw7r4q9vryinvm"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7358,16 +7368,16 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/checkerframework/checker-qual/3.6.0/checker-qual-3.6.0",
|
||||
"path": "org/checkerframework/checker-qual/3.6.1/checker-qual-3.6.1",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "cc9a54c245d87d07533a5534ec607d88a66ea82a",
|
||||
"sha256": "16hhzdvv7jlwzvfjaf5f2l4b7n0lbwnwgkbfhx3i6r7zgpw320yl"
|
||||
"sha1": "5a9e629db8b2dc58bf7199c4c5a9c2aa3226540f",
|
||||
"sha256": "0x2fg03ccsrzhh2x5jknqm9g4cszcyqm9wasm69pwzvai1a23pbs"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "b39405a5894b39073ad0e70671edd39b673e259a",
|
||||
"sha256": "0c751lskwkdkkl9ch6scfcxim2sn0knl6mmwzskfq2dpdb4djkrv"
|
||||
"sha1": "52ca62b41f68584c4d2de39d6176758e9383d0b6",
|
||||
"sha256": "0a7q2lhqbrgf5ll16zqima1q6rpn6x2m5fnli21ahlc1b4n4dl3w"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7764,12 +7774,12 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jacoco/org.jacoco.build/0.8.5/org.jacoco.build-0.8.5",
|
||||
"path": "org/jacoco/org.jacoco.build/0.8.6/org.jacoco.build-0.8.6",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "pom",
|
||||
"pom": {
|
||||
"sha1": "ad6a35af94c242182132ceba52f07620ca80832a",
|
||||
"sha256": "1jn13ax45dyp6j5ly95p4z8qd6990884v8279zmxnzb44z940vmd"
|
||||
"sha1": "3fb028eaf46f792cfd65b2d65be7e5d175623378",
|
||||
"sha256": "1yahzgqvhsghcvss2nm9pjm53qypv07fr8ndni2irkdqskzpf56r"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7788,16 +7798,16 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jacoco/org.jacoco.core/0.8.5/org.jacoco.core-0.8.5",
|
||||
"path": "org/jacoco/org.jacoco.core/0.8.6/org.jacoco.core-0.8.6",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "dc976cf0d68a488c893d9b7957d63e61d597c85a",
|
||||
"sha256": "1vvlncgffkg9yv1djlnmv6vsi6pmzwx393bv9xdxyc87csz9pxrd"
|
||||
"sha1": "6f4a9abb3333a92f028bf444b596a7b7648db111",
|
||||
"sha256": "1pk3rwz5fm9ns70rf4r2nyly56xg5kq10hqqamzsyrvh57ggxfx3"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "1ac96769aa83e5492d1a1a694774f6baec4eb704",
|
||||
"sha256": "1p8d3x473wi3ccpd1kigfps4sfxqn9l9a279kqsh777qa38ihn4l"
|
||||
"sha1": "8c20544d06b8a54de1a585e4fcd0b101c0b433d9",
|
||||
"sha256": "1zxn67mkafvk9x5vjdryyzn25yvmk7vgnfp3f2mpdyh1piiwnjwn"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -8250,30 +8260,30 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib-common/1.3.70/kotlin-stdlib-common-1.3.70",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib-common/1.4.0/kotlin-stdlib-common-1.4.0",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "bd1d0642aedfd3780a730235af7499706225ccb3",
|
||||
"sha256": "1qr8i917sznbmrdsvk8q4ggjic8k7qsij4337zyrfs3mmby2n5kn"
|
||||
"sha1": "03055a223c66d74a15ae3f53870e910e769483ff",
|
||||
"sha256": "02mx38iv2y3afvmv7bgmqrzsfgz5bm484ryf264gaj1jb929mrcq"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "3fa8dd6c896d635e78201e5e811545f3846dec04",
|
||||
"sha256": "0l1sylyady51n9c882l67w72a2sp7c9ip5998jr2z3w9qk7pf8vf"
|
||||
"sha1": "1c752cce0ead8d504ccc88a4fed6471fd83ab0dd",
|
||||
"sha256": "1lgpr4rrvmnm4j4v10jhykgy8b281drkmi7nf7lfajsdsw2f00c6"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib-common/1.3.72/kotlin-stdlib-common-1.3.72",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib-common/1.4.10/kotlin-stdlib-common-1.4.10",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "c4e521d2c0af9e771afbfc11fff4b2f5111b2678",
|
||||
"sha256": "1p79gfryfclii2cjda1rc8a0swcy3f8wibyw614q0d09bggiwy14"
|
||||
"sha1": "a7a2da276e4c795619d6dd862cf8db356906ca3c",
|
||||
"sha256": "002xa53xg74zhfsgh6p17xzs6k2lbzj91zx694mp9pnllxr0wj33"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "6ca8bee3d88957eaaaef077c41c908c9940492d8",
|
||||
"sha256": "0fi0f98xmb05b8hhc093nzsjky0f4g73kk5i50b0qj1yhr91azay"
|
||||
"sha1": "6229be3465805c99db1142ad75e6c6ddeac0b04c",
|
||||
"sha256": "1zkl29qhssa8m3k92z7nl2fjyf71b1byv12xb4ipb3566vag50a6"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -8474,30 +8484,30 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.70/kotlin-stdlib-1.3.70",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.4.0/kotlin-stdlib-1.4.0",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "018c32fc0020da57fc1ea22f6d276d672ea91ab1",
|
||||
"sha256": "0j2hs6zpcrnllx3pzp0nqfz7snsqb75135mb4h4jx33kqlahnhgz"
|
||||
"sha1": "4758d9ec733fd494e6e67fe493d6ac60cd30659d",
|
||||
"sha256": "0jkdpk6qkhf8jwqp6jrwwqnr39p8z56kmnyg6dg03f92qjppvdix"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "e5d97e25bb5b30dcfc022ec1c8f3959a875257fb",
|
||||
"sha256": "0crjz4wykw5qrb5mxg5nsl06crlfnawvwsld53g1qa1alc73q11j"
|
||||
"sha1": "63e75298e93d4ae0b299bb869cf0c627196f8843",
|
||||
"sha256": "1cbyxn0wwjcawl6klm2dgcxxhl3xgj4f5w8nk8bqy1g9wvk16sk1"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.4.10/kotlin-stdlib-1.4.10",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "aecbe532bd46a37d2217a63cc0fed4eca0bd71cc",
|
||||
"sha256": "10cl234gh961grj2rmvq89cb9azzscg3w5lac92kracyjr55f3ag"
|
||||
"sha1": "1ae8d0e617a4e272ce07664ad928c57b171e31f9",
|
||||
"sha256": "0qi77kk5dssssijv0j4fav5zgh5rbxvjrm943spj79dx9fxwzfd4"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"sha256": "0sxisi1q565c8nwvd4pacjjwbhjdkknjyaw0wqdnvkdskqsafmiq"
|
||||
"sha1": "ea29e063d2bbe695be13e9d044dcfb0c7add398e",
|
||||
"sha256": "1aldbd3x859ldvyhlh05bllhnd48l4hwz6l3q4qvjhn0habv1v01"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
+12
-11
@@ -260,7 +260,7 @@ https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.4/commons-cod
|
||||
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.6/commons-codec-1.6.pom
|
||||
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.9/commons-codec-1.9.pom
|
||||
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.10/commons-codec-1.10.pom
|
||||
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.14/commons-codec-1.14.pom
|
||||
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.15/commons-codec-1.15.pom
|
||||
https://repo.maven.apache.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.pom
|
||||
https://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
|
||||
https://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.pom
|
||||
@@ -410,11 +410,11 @@ https://repo.maven.apache.org/maven2/com/squareup/javapoet/1.8.0/javapoet-1.8.0.
|
||||
https://repo.maven.apache.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp-urlconnection/3.12.1/okhttp-urlconnection-3.12.1.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp/3.12.1/okhttp-3.12.1.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp/4.8.1/okhttp-4.8.1.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp/4.9.0/okhttp-4.9.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okhttp3/parent/3.12.1/parent-3.12.1.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okio/okio-parent/1.15.0/okio-parent-1.15.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okio/okio/1.15.0/okio-1.15.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okio/okio/2.7.0/okio-2.7.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okio/okio/2.8.0/okio-2.8.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/sun/activation/all/1.2.0/all-1.2.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/sun/activation/all/2.0.0-RC3/all-2.0.0-RC3.pom
|
||||
https://repo.maven.apache.org/maven2/com/sun/activation/jakarta.activation/2.0.0-RC3/jakarta.activation-2.0.0-RC3.pom
|
||||
@@ -494,6 +494,7 @@ https://repo.maven.apache.org/maven2/org/apache/apache/15/apache-15.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/apache/16/apache-16.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/apache/18/apache-18.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/apache/21/apache-21.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/apache/23/apache-23.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.12/commons-compress-1.12.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.3.2/commons-lang3-3.3.2.pom
|
||||
@@ -508,7 +509,7 @@ https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/34/common
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/35/commons-parent-35.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/39/commons-parent-39.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/48/commons-parent-48.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/50/commons-parent-50.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/52/commons-parent-52.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.2.6/httpclient-4.2.6.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.pom
|
||||
@@ -549,7 +550,7 @@ https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.56/bcprov
|
||||
https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.60/bcprov-jdk15on-1.60.pom
|
||||
https://repo.maven.apache.org/maven2/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.pom
|
||||
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/2.5.2/checker-qual-2.5.2.pom
|
||||
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.6.0/checker-qual-3.6.0.pom
|
||||
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.6.1/checker-qual-3.6.1.pom
|
||||
https://repo.maven.apache.org/maven2/org/codehaus/codehaus-parent/4/codehaus-parent-4.pom
|
||||
https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.pom
|
||||
https://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.pom
|
||||
@@ -582,9 +583,9 @@ https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/2.2/hamcrest-cor
|
||||
https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom
|
||||
https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest/2.2/hamcrest-2.2.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.build/0.7.4.201502262128/org.jacoco.build-0.7.4.201502262128.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.build/0.8.5/org.jacoco.build-0.8.5.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.build/0.8.6/org.jacoco.build-0.8.6.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.core/0.7.4.201502262128/org.jacoco.core-0.7.4.201502262128.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.core/0.8.5/org.jacoco.core-0.8.5.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.core/0.8.6/org.jacoco.core-0.8.6.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.report/0.7.4.201502262128/org.jacoco.report-0.7.4.201502262128.pom
|
||||
https://repo.maven.apache.org/maven2/org/jdom/jdom2/2.0.6/jdom2-2.0.6.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/annotations/13.0/annotations-13.0.pom
|
||||
@@ -617,8 +618,8 @@ https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.20/kotlin-stdlib-common-1.3.20.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.31/kotlin-stdlib-common-1.3.31.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.70/kotlin-stdlib-common-1.3.70.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.72/kotlin-stdlib-common-1.3.72.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.0/kotlin-stdlib-common-1.4.0.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.10/kotlin-stdlib-common-1.4.10.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.2.71/kotlin-stdlib-jdk7-1.2.71.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.20/kotlin-stdlib-jdk7-1.3.20.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.50/kotlin-stdlib-jdk7-1.3.50.pom
|
||||
@@ -633,8 +634,8 @@ https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.0/ko
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.20/kotlin-stdlib-1.3.20.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.70/kotlin-stdlib-1.3.70.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.4.0/kotlin-stdlib-1.4.0.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.4.10/kotlin-stdlib-1.4.10.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-util-io/1.3.50/kotlin-util-io-1.3.50.pom
|
||||
https://repo.maven.apache.org/maven2/org/junit/jupiter/junit-jupiter-api/5.5.2/junit-jupiter-api-5.5.2.pom
|
||||
https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-commons/1.5.2/junit-platform-commons-1.5.2.pom
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Helper for verifying an environment variable is set
|
||||
name: ''
|
||||
if [[ -z ''$${name} ]]; then
|
||||
echo 'Not env var set: ${name}' >&2
|
||||
exit 1
|
||||
echo 'WARNING! Env var not set: ${name}' >&2
|
||||
fi
|
||||
''
|
||||
+1
-1
@@ -4,5 +4,5 @@
|
||||
getConfig = import ./getConfig.nix { inherit lib config; };
|
||||
mkFilter = import ./mkFilter.nix { inherit lib; };
|
||||
mergeSh = import ./mergeSh.nix { inherit lib; };
|
||||
assertEnvVarSet = import ./assertEnvVarSet.nix;
|
||||
checkEnvVarSet = import ./checkEnvVarSet.nix;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
|
||||
{ stdenv, lib, deps, pkgs }:
|
||||
|
||||
# Path to the file containing secret environment variables
|
||||
{ secretsFile ? "" }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "status-react-build-jsbundle-android";
|
||||
src =
|
||||
@@ -36,8 +39,19 @@ stdenv.mkDerivation {
|
||||
};
|
||||
};
|
||||
buildInputs = with pkgs; [ clojure nodejs bash git openjdk];
|
||||
phases = [
|
||||
"unpackPhase" "secretsPhase" "patchPhase"
|
||||
"configurePhase" "buildPhase" "installPhase"
|
||||
];
|
||||
|
||||
# For optional INFURA_TOKEN variable
|
||||
secretsPhase = if (secretsFile != "") then ''
|
||||
source "${secretsFile}"
|
||||
${lib.checkEnvVarSet "INFURA_TOKEN"}
|
||||
'' else ''
|
||||
echo "No secrets provided!"
|
||||
'';
|
||||
|
||||
phases = [ "unpackPhase" "patchPhase" "configurePhase" "buildPhase" "installPhase" ];
|
||||
# Patching shadow-cljs.edn so it uses the local maven repo of dependencies provided by Nix
|
||||
patchPhase =
|
||||
let anchor = ''{:source-paths ["src" "test/cljs"]'';
|
||||
|
||||
@@ -17,7 +17,10 @@ assert (lib.stringLength watchmanSockPath) > 0 -> stdenv.isDarwin;
|
||||
let
|
||||
inherit (lib)
|
||||
toLower optionalString stringLength assertMsg
|
||||
getConfig makeLibraryPath assertEnvVarSet elem;
|
||||
getConfig makeLibraryPath checkEnvVarSet elem;
|
||||
|
||||
# Pass secretsFile for INFURA_TOKEN to jsbundle build
|
||||
builtJsBundle = jsbundle { inherit secretsFile; };
|
||||
|
||||
buildType = getConfig "build-type" "release";
|
||||
buildNumber = getConfig "build-number" 9999;
|
||||
@@ -84,8 +87,8 @@ in stdenv.mkDerivation rec {
|
||||
STATUS_GO_ANDROID_LIBDIR = "${status-go}";
|
||||
|
||||
phases = [
|
||||
"unpackPhase" "secretsPhase" "secretsCheckPhase"
|
||||
"keystorePhase" "buildPhase" "checkPhase" "installPhase"
|
||||
"unpackPhase" "secretsPhase" "keystorePhase"
|
||||
"buildPhase" "checkPhase" "installPhase"
|
||||
];
|
||||
|
||||
unpackPhase = ''
|
||||
@@ -98,7 +101,7 @@ in stdenv.mkDerivation rec {
|
||||
cp -bf ./${envFileName} ./.env
|
||||
|
||||
# Copy index.js and app/ input files
|
||||
cp -ra --no-preserve=ownership ${jsbundle}/* ./
|
||||
cp -ra --no-preserve=ownership ${builtJsBundle}/* ./
|
||||
|
||||
# Copy android/ directory
|
||||
mkdir -p ./android/build
|
||||
@@ -116,6 +119,9 @@ in stdenv.mkDerivation rec {
|
||||
# if secretsFile is not set we use generate keystore
|
||||
secretsPhase = if (secretsFile != "") then ''
|
||||
source "${secretsFile}"
|
||||
${checkEnvVarSet "KEYSTORE_ALIAS"}
|
||||
${checkEnvVarSet "KEYSTORE_PASSWORD"}
|
||||
${checkEnvVarSet "KEYSTORE_KEY_PASSWORD"}
|
||||
'' else keystore.shellHook;
|
||||
|
||||
# if keystorePath is set copy it into build directory
|
||||
@@ -125,11 +131,6 @@ in stdenv.mkDerivation rec {
|
||||
export KEYSTORE_PATH="$PWD/status-im.keystore"
|
||||
cp -a --no-preserve=ownership "${keystorePath}" "$KEYSTORE_PATH"
|
||||
'';
|
||||
secretsCheckPhase = ''
|
||||
${assertEnvVarSet "KEYSTORE_ALIAS"}
|
||||
${assertEnvVarSet "KEYSTORE_PASSWORD"}
|
||||
${assertEnvVarSet "KEYSTORE_KEY_PASSWORD"}
|
||||
'';
|
||||
buildPhase = let
|
||||
adhocEnvVars = optionalString stdenv.isLinux
|
||||
"LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${makeLibraryPath [ pkgs.zlib ]}";
|
||||
|
||||
+8
-8
@@ -19,9 +19,9 @@
|
||||
"@react-native-community/netinfo": "^4.4.0",
|
||||
"@react-native-community/push-notification-ios": "^1.4.1",
|
||||
"@react-native-community/slider": "^3.0.0",
|
||||
"@react-navigation/bottom-tabs": "^5.7.0",
|
||||
"@react-navigation/native": "^5.7.0",
|
||||
"@react-navigation/stack": "^5.7.0",
|
||||
"@react-navigation/bottom-tabs": "^5.8.0",
|
||||
"@react-navigation/native": "^5.7.3",
|
||||
"@react-navigation/stack": "^5.9.0",
|
||||
"bignumber.js": "git+https://github.com/status-im/bignumber.js.git#v4.0.2-status",
|
||||
"buffer": "^5.4.2",
|
||||
"chance": "^1.1.0",
|
||||
@@ -43,7 +43,7 @@
|
||||
"react-native-dialogs": "^1.0.4",
|
||||
"react-native-fetch-polyfill": "^1.1.2",
|
||||
"react-native-fs": "^2.14.1",
|
||||
"react-native-gesture-handler": "^1.6.0",
|
||||
"react-native-gesture-handler": "^1.8.0",
|
||||
"react-native-haptic-feedback": "^1.9.0",
|
||||
"react-native-image-crop-picker": "^0.31.1",
|
||||
"react-native-image-resizer": "^1.2.3",
|
||||
@@ -53,16 +53,16 @@
|
||||
"react-native-mail": "git+https://github.com/status-im/react-native-mail.git#v4.0.0-status",
|
||||
"react-native-navigation-bar-color": "^2.0.1",
|
||||
"react-native-permissions": "^2.1.5",
|
||||
"react-native-reanimated": "^1.7.0",
|
||||
"react-native-reanimated": "^1.13.0",
|
||||
"react-native-redash": "^14.2.2",
|
||||
"react-native-safe-area-context": "^2.0.0",
|
||||
"react-native-screens": "^2.3.0",
|
||||
"react-native-screens": "^2.10.1",
|
||||
"react-native-shake": "^3.3.1",
|
||||
"react-native-splash-screen": "^3.2.0",
|
||||
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#v2.5.23",
|
||||
"react-native-svg": "^9.8.4",
|
||||
"react-native-touch-id": "^4.4.1",
|
||||
"react-native-webview": "git+https://github.com/status-im/react-native-webview.git#v10.2.3_7",
|
||||
"react-native-webview": "git+https://github.com/status-im/react-native-webview.git#v10.9.2",
|
||||
"tdigest": "^0.1.1",
|
||||
"web3-utils": "^1.2.1"
|
||||
},
|
||||
@@ -78,6 +78,6 @@
|
||||
"nyc": "^14.1.1",
|
||||
"process": "0.11.10",
|
||||
"rn-snoopy": "git+https://github.com/status-im/rn-snoopy.git#v2.0.2-status",
|
||||
"shadow-cljs": "2.9.2"
|
||||
"shadow-cljs": "^2.10.14"
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
@@ -160,6 +160,11 @@
|
||||
return sendAPIrequest('qr-code', {regex: regex});
|
||||
};
|
||||
|
||||
EthereumProvider.prototype.on = function (type, handler)
|
||||
{
|
||||
console.log("Not supported by Status")
|
||||
}
|
||||
|
||||
EthereumProvider.prototype.request = function (requestArguments)
|
||||
{
|
||||
if (!requestArguments) {
|
||||
|
||||
+20
-13
@@ -7,20 +7,19 @@ GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
||||
source "${GIT_ROOT}/scripts/colors.sh"
|
||||
|
||||
function must_get_env() {
|
||||
declare -n VAR_NAME="$1"
|
||||
if [[ -n "${VAR_NAME}" ]]; then
|
||||
echo "${VAR_NAME}"
|
||||
declare -n VAR_VALUE="$1"
|
||||
if [[ -n "${VAR_VALUE}" ]]; then
|
||||
echo "${VAR_VALUE}"
|
||||
return
|
||||
fi
|
||||
echo -e "${RED}No required env variable:${RST} ${BLD}${!VAR_NAME}${RST}" 1>&2
|
||||
echo -e "${RED}No required env variable:${RST} ${BLD}${!VAR_VALUE}${RST}" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
function append_env_export() {
|
||||
ENV_VAR_NAME=${1}
|
||||
if [[ -n "${!ENV_VAR_NAME}" ]]; then
|
||||
echo "export ${ENV_VAR_NAME}=\"${!ENV_VAR_NAME}\";" >> "${SECRETS_FILE_PATH}"
|
||||
fi
|
||||
VAR_NAME=${1}
|
||||
VAR_VALUE=$(must_get_env "${VAR_NAME}")
|
||||
echo "export ${VAR_NAME}=\"${VAR_VALUE}\";" >> "${SECRETS_FILE_PATH}"
|
||||
}
|
||||
|
||||
config=''
|
||||
@@ -38,15 +37,23 @@ config+="status-im.android.abi-split=\"$(must_get_env ANDROID_ABI_SPLIT)\";"
|
||||
config+="status-im.android.abi-include=\"$(must_get_env ANDROID_ABI_INCLUDE)\";"
|
||||
nixOpts=()
|
||||
|
||||
# If no secrets were passed there's no need to pass the 'secretsFile'
|
||||
# We create if now so the trap knows its location
|
||||
export SECRETS_FILE_PATH=$(mktemp)
|
||||
chmod 644 ${SECRETS_FILE_PATH}
|
||||
# If secrets file was created we want to remove it.
|
||||
trap "rm -vf ${SECRETS_FILE_PATH}" EXIT ERR INT QUIT
|
||||
# Secrets like this can't be passed via args or they end up in derivation.
|
||||
if [[ -n "${KEYSTORE_ALIAS}${KEYSTORE_ALIAS}${KEYSTORE_ALIAS}" ]]; then
|
||||
# Secrets like this can't be passed via args or they end up in derivation
|
||||
SECRETS_FILE_PATH=$(mktemp)
|
||||
trap "rm -f ${SECRETS_FILE_PATH}" EXIT ERR INT QUIT
|
||||
chmod 644 ${SECRETS_FILE_PATH}
|
||||
# WARNING: All three have to be set!
|
||||
append_env_export 'KEYSTORE_PASSWORD'
|
||||
append_env_export 'KEYSTORE_ALIAS'
|
||||
append_env_export 'KEYSTORE_KEY_PASSWORD'
|
||||
fi
|
||||
if [[ -n "${INFURA_TOKEN}" ]]; then
|
||||
append_env_export 'INFURA_TOKEN'
|
||||
fi
|
||||
# If no secrets were passed there's no need to pass the 'secretsFile'.
|
||||
if [[ -s "${SECRETS_FILE_PATH}" ]]; then
|
||||
nixOpts+=("--argstr" "secretsFile" "${SECRETS_FILE_PATH}")
|
||||
fi
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ if [[ ! -x "$(command -v nix-prefetch-url)" ]] && [[ -z "${IN_NIX_SHELL}" ]]; th
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -eof pipefail
|
||||
set -ef
|
||||
|
||||
GIT_ROOT="$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)"
|
||||
VERSION_FILE="${GIT_ROOT}/status-go-version.json"
|
||||
@@ -20,6 +20,7 @@ HELP_MESSAGE=$(cat <<-END
|
||||
This is a tool for upgrading status-go to a given version in:
|
||||
${VERSION_FILE}
|
||||
Which is then used by Nix derivations to build status-go for the app.
|
||||
If the given name matches both a branch and a tag the tag is used.
|
||||
|
||||
Usage:
|
||||
${SCRIPT_FILE} {version}
|
||||
@@ -55,7 +56,18 @@ if [[ "${STATUS_GO_VERSION}" = PR-* ]]; then
|
||||
fi
|
||||
|
||||
# ls-remote finds only tags, branches, and pull requests, but can't find commits
|
||||
STATUS_GO_COMMIT_SHA1=$(git ls-remote ${REPO_URL} ${STATUS_GO_VERSION} | cut -f1)
|
||||
STATUS_GO_MATCHING_REFS=$(git ls-remote ${REPO_URL} ${STATUS_GO_VERSION})
|
||||
|
||||
# It's possible that there's both a branch and a tag matching the given version
|
||||
STATUS_GO_TAG_SHA1=$(echo "${STATUS_GO_MATCHING_REFS}" | grep 'refs/tags' | cut -f1)
|
||||
STATUS_GO_BRANCH_SHA1=$(echo "${STATUS_GO_MATCHING_REFS}" | grep 'refs/heads' | cut -f1)
|
||||
|
||||
# Prefer tag over branch if both are found
|
||||
if [[ -n "${STATUS_GO_TAG_SHA1}" ]]; then
|
||||
STATUS_GO_COMMIT_SHA1="${STATUS_GO_TAG_SHA1}"
|
||||
else
|
||||
STATUS_GO_COMMIT_SHA1="${STATUS_GO_BRANCH_SHA1}"
|
||||
fi
|
||||
|
||||
if [[ -z "${STATUS_GO_COMMIT_SHA1}" ]]; then
|
||||
echo "ERROR: Failed to find a SHA1 for rev '${STATUS_GO_VERSION}'."
|
||||
|
||||
+9
-5
@@ -38,19 +38,23 @@
|
||||
{:target :react-native
|
||||
:output-dir "app"
|
||||
:init-fn status-im.core/init
|
||||
:closure-defines {"status-im.utils.config/INFURA_TOKEN" #shadow/env "INFURA_TOKEN"}
|
||||
:dev {:devtools {:after-load status-im.reloader/reload
|
||||
:build-notify status-im.reloader/build-notify
|
||||
:preloads [re-frisk-remote.preload]}
|
||||
:compiler-options {:closure-defines
|
||||
:closure-defines {status-im.utils.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"}
|
||||
:compiler-options {:output-feature-set :es5
|
||||
:closure-defines
|
||||
{re-frame.trace/trace-enabled? true}
|
||||
:source-map false}
|
||||
:source-map false
|
||||
:infer-externs true}
|
||||
;; if you want to use a real device, set your local ip
|
||||
;; in the SHADOW_HOST env variable to make sure that
|
||||
;; it will use the right interface
|
||||
:local-ip #shadow/env "SHADOW_HOST"}
|
||||
:chunks {:fleets status-im.default-fleet/default-fleets
|
||||
:chats status-im.chat.default-chats/default-chats}
|
||||
:release {:compiler-options {:output-feature-set :es6
|
||||
:release {:closure-defines {status-im.utils.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"}
|
||||
:compiler-options {:output-feature-set :es6
|
||||
;;disable for android build as there
|
||||
;;is an intermittent warning with deftype
|
||||
:warnings-as-errors false
|
||||
@@ -67,8 +71,8 @@
|
||||
{:output-to "target/test/test.js"
|
||||
:output-dir "target/test"
|
||||
:optimizations :simple
|
||||
:closure-defines {status-im.utils.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"}
|
||||
:target :node-test
|
||||
:closure-defines {status-im.utils.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"}
|
||||
:compiler-options {;; needed because we override require and it
|
||||
;; messes with source-map which reports callstack
|
||||
;; exceeded exceptions instead of real issues
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
(def platform (.-Platform ^js rn))
|
||||
|
||||
(def find-node-handle (.-findNodeHandle ^js rn))
|
||||
|
||||
(def view (reagent/adapt-react-class (.-View ^js rn)))
|
||||
(def image (reagent/adapt-react-class (.-Image rn)))
|
||||
(def text (reagent/adapt-react-class (.-Text ^js rn)))
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
(ns shadow.cljs.devtools.client.react-native
|
||||
(:require [cljs.reader :as reader]
|
||||
[clojure.string :as str]
|
||||
[goog.net.XhrIo :as xhr]
|
||||
[shadow.cljs.devtools.client.env :as env]
|
||||
[status-im.reloader :as reloader]))
|
||||
|
||||
(defonce repl-ns-ref (atom nil))
|
||||
|
||||
(defonce socket-ref (volatile! nil))
|
||||
|
||||
(defn ws-msg [msg]
|
||||
(if-let [s @socket-ref]
|
||||
(.send s (pr-str msg))
|
||||
(js/console.warn "WEBSOCKET NOT CONNECTED" (pr-str msg))))
|
||||
|
||||
(defn devtools-msg
|
||||
([x]
|
||||
(js/console.log x))
|
||||
([x y]
|
||||
(js/console.log x y)))
|
||||
|
||||
(defn script-eval [code]
|
||||
(js/goog.global.eval code))
|
||||
|
||||
(defn do-js-load [sources]
|
||||
(doseq [{:keys [resource-name js] :as src} sources]
|
||||
(devtools-msg "load JS" resource-name)
|
||||
(env/before-load-src src)
|
||||
(script-eval (str js "\n//# sourceURL=" resource-name))))
|
||||
|
||||
(defn do-js-reload [msg sources complete-fn]
|
||||
(env/do-js-reload
|
||||
(assoc msg
|
||||
:log-missing-fn
|
||||
(fn [fn-sym]
|
||||
(devtools-msg (str "can't find fn " fn-sym)))
|
||||
:log-call-async
|
||||
(fn [fn-sym]
|
||||
(devtools-msg (str "call async " fn-sym)))
|
||||
:log-call
|
||||
(fn [fn-sym]
|
||||
(devtools-msg (str "call " fn-sym))))
|
||||
#(do-js-load sources)
|
||||
complete-fn))
|
||||
|
||||
(defn load-sources [sources callback]
|
||||
(if (empty? sources)
|
||||
(callback [])
|
||||
(xhr/send
|
||||
(env/files-url)
|
||||
(fn [_]
|
||||
(this-as ^goog req
|
||||
(let [content
|
||||
(-> req
|
||||
(.getResponseText)
|
||||
(reader/read-string))]
|
||||
(callback content))))
|
||||
|
||||
"POST"
|
||||
(pr-str {:client :browser
|
||||
:sources (into [] (map :resource-id) sources)})
|
||||
#js {"content-type" "application/edn; charset=utf-8"})))
|
||||
|
||||
(defn noop [& _])
|
||||
|
||||
(defn handle-build-complete [{:keys [info reload-info] :as msg}]
|
||||
(let [{:keys [sources]}
|
||||
info
|
||||
|
||||
warnings
|
||||
(->> (for [{:keys [resource-name warnings] :as src} sources
|
||||
:when (not (:from-jar src))
|
||||
warning warnings]
|
||||
(assoc warning :resource-name resource-name))
|
||||
(distinct)
|
||||
(into []))]
|
||||
(when (seq warnings)
|
||||
(reloader/build-failed))
|
||||
(when (and env/autoload
|
||||
(or (empty? warnings) env/ignore-warnings))
|
||||
(reloader/build-competed)
|
||||
(let [sources-to-get (env/filter-reload-sources info reload-info)]
|
||||
|
||||
(when (seq sources-to-get)
|
||||
(load-sources sources-to-get #(do-js-reload msg % noop)))))))
|
||||
|
||||
(defn repl-error [e]
|
||||
(js/console.error "repl/invoke error" (.-message e) e)
|
||||
(env/repl-error e))
|
||||
|
||||
(defn repl-invoke [{:keys [id js]}]
|
||||
(let [result (env/repl-call #(js/eval js) repl-error)]
|
||||
(-> result
|
||||
(assoc :id id)
|
||||
(ws-msg))))
|
||||
|
||||
(defn repl-require [{:keys [id sources reload-namespaces]} done]
|
||||
(let [sources-to-load
|
||||
(->> sources
|
||||
(remove (fn [{:keys [provides] :as src}]
|
||||
(and (env/src-is-loaded? src)
|
||||
(not (some reload-namespaces provides)))))
|
||||
(into []))]
|
||||
|
||||
(load-sources
|
||||
sources-to-load
|
||||
(fn [sources]
|
||||
(do-js-load sources)
|
||||
(ws-msg {:type :repl/require-complete :id id})
|
||||
(done)))))
|
||||
|
||||
(defn repl-init [{:keys [repl-state id]} done]
|
||||
(reset! repl-ns-ref (get-in repl-state [:current :ns]))
|
||||
(load-sources
|
||||
;; maybe need to load some missing files to init REPL
|
||||
(->> (:repl-sources repl-state)
|
||||
(remove env/src-is-loaded?)
|
||||
(into []))
|
||||
(fn [sources]
|
||||
(do-js-load sources)
|
||||
(ws-msg {:type :repl/init-complete :id id})
|
||||
(devtools-msg "REPL init successful")
|
||||
(done))))
|
||||
|
||||
(defn repl-set-ns [{:keys [id ns]}]
|
||||
(reset! repl-ns-ref ns)
|
||||
(ws-msg {:type :repl/set-ns-complete :id id :ns ns}))
|
||||
|
||||
;; FIXME: core.async-ify this
|
||||
(defn handle-message [{:keys [type] :as msg} done]
|
||||
;; (js/console.log "ws-msg" (pr-str msg))
|
||||
(case type
|
||||
:repl/invoke
|
||||
(repl-invoke msg)
|
||||
|
||||
:repl/require
|
||||
(repl-require msg done)
|
||||
|
||||
:repl/set-ns
|
||||
(repl-set-ns msg)
|
||||
|
||||
:repl/init
|
||||
(repl-init msg done)
|
||||
|
||||
:repl/ping
|
||||
(ws-msg {:type :repl/pong :time-server (:time-server msg) :time-runtime (js/Date.now)})
|
||||
|
||||
:build-complete
|
||||
(handle-build-complete msg)
|
||||
|
||||
:build-failure
|
||||
(reloader/build-failed)
|
||||
|
||||
:build-init
|
||||
nil
|
||||
|
||||
:build-start
|
||||
(reloader/build-start)
|
||||
|
||||
:pong
|
||||
nil
|
||||
|
||||
:client/stale
|
||||
(devtools-msg "Stale Client! You are not using the latest compilation output!")
|
||||
|
||||
:client/no-worker
|
||||
(devtools-msg (str "watch for build \"" env/build-id "\" not running"))
|
||||
|
||||
;; default
|
||||
:ignored)
|
||||
|
||||
(when-not (contains? env/async-ops type)
|
||||
(done)))
|
||||
|
||||
(defn ws-connect []
|
||||
(let [ws-url
|
||||
(env/ws-url :react-native)
|
||||
|
||||
socket
|
||||
(js/WebSocket. ws-url)]
|
||||
|
||||
(vreset! socket-ref socket)
|
||||
(set! (.-onmessage socket)
|
||||
(fn [e]
|
||||
(env/process-ws-msg (. e -data) handle-message)))
|
||||
|
||||
(set! (.-onopen socket)
|
||||
(fn [_]
|
||||
;; :module-format :js already patches provide
|
||||
(when (= "goog" env/module-format)
|
||||
;; patch away the already declared exception
|
||||
(set! (.-provide js/goog) js/goog.constructNamespace_))
|
||||
|
||||
(env/set-print-fns! ws-msg)
|
||||
|
||||
(devtools-msg "WebSocket connected!")))
|
||||
|
||||
(set! (.-onclose socket)
|
||||
(fn [_]
|
||||
;; not a big fan of reconnecting automatically since a disconnect
|
||||
;; may signal a change of config, safer to just reload the page
|
||||
(devtools-msg "WebSocket disconnected!")
|
||||
(vreset! socket-ref nil)
|
||||
(env/reset-print-fns!)))
|
||||
|
||||
(set! (.-onerror socket)
|
||||
(fn [e]
|
||||
(js/console.error (str "WebSocket connect failed:" (.-message e) "\n"
|
||||
"It was trying to connect to: " (subs ws-url 0 (str/index-of ws-url "/" 6)) "\n"))))))
|
||||
|
||||
(when ^boolean env/enabled
|
||||
;; disconnect an already connected socket, happens if this file is reloaded
|
||||
;; pretty much only for me while working on this file
|
||||
(when-let [s @socket-ref]
|
||||
(devtools-msg "connection reset!")
|
||||
(set! (.-onclose s) (fn [_]))
|
||||
(.close s)
|
||||
(vreset! socket-ref nil))
|
||||
|
||||
(ws-connect))
|
||||
@@ -1,4 +0,0 @@
|
||||
(ns status-im.android.platform)
|
||||
|
||||
(def platform-specific
|
||||
{:status-bar-default-height 25})
|
||||
@@ -170,7 +170,7 @@
|
||||
:group-chat true
|
||||
:contacts #{}
|
||||
:public? true
|
||||
:might-have-join-time-messages? true
|
||||
:might-have-join-time-messages? (get-in cofx [:db :multiaccount :use-mailservers?])
|
||||
:unviewed-messages-count 0
|
||||
:loaded-unviewed-messages-ids #{}}
|
||||
nil))
|
||||
|
||||
@@ -30,25 +30,35 @@
|
||||
{:db (assoc-in db [:chat/inputs current-chat-id :input-text] (text->emoji new-input))})
|
||||
|
||||
(fx/defn select-mention
|
||||
[{:keys [db] :as cofx} {:keys [alias name searched-text match] :as user}]
|
||||
[{:keys [db] :as cofx} text-input-ref {:keys [alias name searched-text match] :as user}]
|
||||
(let [chat-id (:current-chat-id db)
|
||||
new-text (mentions/new-input-text-with-mention cofx user)
|
||||
at-sign-idx (get-in db [:chats chat-id :mentions :at-sign-idx])]
|
||||
at-sign-idx (get-in db [:chats chat-id :mentions :at-sign-idx])
|
||||
cursor (+ at-sign-idx (count name) 2)]
|
||||
(fx/merge
|
||||
cofx
|
||||
{:db (-> db
|
||||
(assoc-in [:chats/cursor chat-id] (+ at-sign-idx (count name) 2))
|
||||
(assoc-in [:chats/cursor chat-id] cursor)
|
||||
(assoc-in [:chats/mention-suggestions chat-id] nil))}
|
||||
(set-chat-input-text new-text)
|
||||
;; NOTE(rasom): Some keyboards do not react on selection property passed to
|
||||
;; text input (specifically Samsung keyboard with predictive text set on).
|
||||
;; In this case, if the user continues typing after the programmatic change,
|
||||
;; the new text is added to the last known cursor position before
|
||||
;; programmatic change. By calling `reset-text-input-cursor` we force the
|
||||
;; keyboard's cursor position to be changed before the next input.
|
||||
(mentions/reset-text-input-cursor text-input-ref cursor)
|
||||
;; NOTE(roman): on-text-input event is not dispatched when we change input
|
||||
;; programmatically, so we have to call `on-text-input` manually
|
||||
(mentions/on-text-input
|
||||
(let [match-len (count match)
|
||||
searched-text-len (count searched-text)]
|
||||
{:new-text (subs match searched-text-len)
|
||||
:previous-text ""
|
||||
:start (+ at-sign-idx searched-text-len 1)
|
||||
:end (+ at-sign-idx match-len 1)}))
|
||||
(let [match-len (count match)
|
||||
searched-text-len (count searched-text)
|
||||
start (inc at-sign-idx)
|
||||
end (+ start match-len)]
|
||||
{:new-text match
|
||||
:previous-text searched-text
|
||||
:start start
|
||||
:end end}))
|
||||
(mentions/recheck-at-idxs {alias user}))))
|
||||
|
||||
(defn- start-cooldown [{:keys [db]} cooldowns]
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
[status-im.chat.models.reactions :as reactions]
|
||||
[status-im.chat.models.message-list :as message-list]
|
||||
[taoensso.timbre :as log]
|
||||
[status-im.chat.models.message-seen :as message-seen]))
|
||||
[status-im.chat.models.message-seen :as message-seen]
|
||||
[status-im.chat.models.mentions :as mentions]))
|
||||
|
||||
(defn cursor->clock-value
|
||||
[^js cursor]
|
||||
@@ -95,11 +96,13 @@
|
||||
(let [nickname (get-in db [:contacts/contacts from :nickname])]
|
||||
(cond-> acc
|
||||
(and alias (not= alias ""))
|
||||
(update :users assoc from {:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:public-key from
|
||||
:nickname nickname})
|
||||
(update :users assoc from
|
||||
(mentions/add-searchable-phrases
|
||||
{:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:public-key from
|
||||
:nickname nickname}))
|
||||
(or (nil? last-clock-value)
|
||||
(> last-clock-value clock-value))
|
||||
(assoc :last-clock-value clock-value)
|
||||
|
||||
@@ -1,13 +1,174 @@
|
||||
(ns status-im.chat.models.mentions
|
||||
(:require [clojure.string :as string]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.utils.fx :as fx]
|
||||
[status-im.contact.db :as contact.db]
|
||||
[status-im.utils.platform :as platform]
|
||||
[taoensso.timbre :as log]
|
||||
[status-im.utils.utils :as utils]))
|
||||
[status-im.utils.utils :as utils]
|
||||
[status-im.native-module.core :as status]
|
||||
[quo.react-native :as rn]
|
||||
[quo.react :as react]))
|
||||
|
||||
(def at-sign "@")
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn re-pos [re s]
|
||||
(loop [res [] s s last-idx 0]
|
||||
(if-let [m (.exec re s)]
|
||||
(let [new-idx (.-index m)
|
||||
idx (+ last-idx new-idx)
|
||||
c (get m 0)]
|
||||
(recur (conj res [idx c]) (subs s (inc new-idx)) (inc idx)))
|
||||
res)))
|
||||
|
||||
(defn check-style-tag [text idxs idx]
|
||||
(let [[pos c] (get idxs idx)
|
||||
[pos2 c2] (get idxs (inc idx))
|
||||
[pos3 c3] (get idxs (+ 2 idx))
|
||||
prev-c (get text (dec pos))
|
||||
len (cond
|
||||
(and (= c c2 c3)
|
||||
(= pos (dec pos2) (- pos3 2)))
|
||||
3
|
||||
(and (= c c2)
|
||||
(= pos (dec pos2)))
|
||||
2
|
||||
:else 1)
|
||||
next-idx (inc (first (get idxs (+ idx (dec len)))))
|
||||
next-c (get text next-idx)
|
||||
can-be-end? (if (= 1 len)
|
||||
(and prev-c
|
||||
(not (string/blank? prev-c))
|
||||
(or (nil? next-c)
|
||||
(string/blank? next-c)))
|
||||
(and prev-c
|
||||
(not (string/blank? prev-c))))
|
||||
can-be-start? (and next-c
|
||||
(not (string/blank? next-c)))]
|
||||
[len can-be-start? can-be-end?]))
|
||||
|
||||
(defn clear-pending-at-signs
|
||||
[data from]
|
||||
(let [{:keys [pending]} (get data at-sign)
|
||||
new-idxs (filter (partial > from) pending)]
|
||||
(-> data
|
||||
(update at-sign dissoc :pending)
|
||||
(update-in [at-sign :checked]
|
||||
(fn [checked]
|
||||
;; NOTE(rasom): there might be stack overflow without doall
|
||||
(doall
|
||||
((fnil concat []) checked new-idxs)))))))
|
||||
|
||||
(defn apply-style-tag [data idx pos c len start? end?]
|
||||
(let [was-started? (get data c)
|
||||
tripple-tilde? (and (= "~" c) (= 3 len))]
|
||||
(cond
|
||||
(and was-started? end?)
|
||||
(let [old-len (:len was-started?)
|
||||
tag-len (cond
|
||||
(and tripple-tilde?
|
||||
(= 3 old-len))
|
||||
2
|
||||
|
||||
(>= old-len len)
|
||||
len
|
||||
|
||||
:else
|
||||
old-len)
|
||||
old-idx (:idx was-started?)]
|
||||
{:data (-> data
|
||||
(dissoc c)
|
||||
(clear-pending-at-signs old-idx))
|
||||
:next-idx (+ idx tag-len)})
|
||||
|
||||
start?
|
||||
{:data (-> data
|
||||
(assoc c {:len len
|
||||
:idx pos})
|
||||
(clear-pending-at-signs pos))
|
||||
:next-idx (+ idx len)}
|
||||
|
||||
:else
|
||||
{:data data
|
||||
:next-idx (+ idx len)})))
|
||||
|
||||
(defn code-tag-len [idxs idx]
|
||||
(let [[pos c] (get idxs idx)
|
||||
[pos2 c2] (get idxs (inc idx))
|
||||
[pos3 c3] (get idxs (+ 2 idx))]
|
||||
(cond
|
||||
(and (= c c2 c3)
|
||||
(= pos (dec pos2) (- pos3 2)))
|
||||
3
|
||||
(and (= c c2)
|
||||
(= pos (dec pos2)))
|
||||
2
|
||||
:else 1)))
|
||||
|
||||
(defn get-at-signs
|
||||
([text]
|
||||
(let [idxs (re-pos #"[@~\\*_\n>`]{1}" text)]
|
||||
(loop [data nil
|
||||
idx 0]
|
||||
(let [quote-started? (get data ">")
|
||||
[pos c] (get idxs idx)
|
||||
styling-tag? (get #{"*" "_" "~"} c)
|
||||
code-tag? (= "`" c)
|
||||
quote? (= ">" c)
|
||||
at-sign? (= at-sign c)
|
||||
newline? (= "\n" c)]
|
||||
(if (nil? c)
|
||||
(let [{:keys [checked pending]} (get data at-sign)]
|
||||
(concat checked pending))
|
||||
(cond
|
||||
newline?
|
||||
(let [prev-newline (first (get data :newline))]
|
||||
(recur
|
||||
(cond-> (update data :newline (fnil conj '()) pos)
|
||||
(and quote-started?
|
||||
prev-newline
|
||||
(string/blank? (subs text prev-newline (dec pos))))
|
||||
(dissoc ">"))
|
||||
(inc idx)))
|
||||
|
||||
quote-started?
|
||||
(recur data (inc idx))
|
||||
|
||||
quote?
|
||||
(let [prev-newlines (take 2 (get data :newline))]
|
||||
(if (or (zero? pos)
|
||||
(and (= 1 (count prev-newlines))
|
||||
(string/blank? (subs text 0 (dec pos))))
|
||||
(and (= 2 (count prev-newlines))
|
||||
(string/blank? (subs text (first prev-newlines) (dec pos)))))
|
||||
(recur (-> data
|
||||
(dissoc :newline "*" "_" "~" "`")
|
||||
(assoc ">" {:idx pos})) (inc idx))
|
||||
(recur data (inc idx))))
|
||||
|
||||
at-sign?
|
||||
(recur (update-in data [at-sign :pending] (fnil conj []) pos)
|
||||
(inc idx))
|
||||
|
||||
code-tag?
|
||||
(let [len (code-tag-len idxs idx)
|
||||
{:keys [data next-idx]}
|
||||
(apply-style-tag data idx pos c len true true)]
|
||||
(recur data next-idx))
|
||||
|
||||
styling-tag?
|
||||
(let [[len can-be-start? can-be-end?]
|
||||
(check-style-tag text idxs idx)
|
||||
{:keys [data next-idx]}
|
||||
(apply-style-tag data idx pos c len can-be-start? can-be-end?)]
|
||||
(recur data next-idx))
|
||||
|
||||
:else (recur data (inc idx)))))))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn get-mentionable-users
|
||||
[{{:keys [current-chat-id]
|
||||
:contacts/keys [contacts] :as db} :db}]
|
||||
@@ -72,25 +233,33 @@
|
||||
|
||||
(defn get-suggestions [users searched-text]
|
||||
(reduce
|
||||
(fn [acc [k {:keys [alias name nickname] :as user}]]
|
||||
(fn [acc [k {:keys [alias name nickname searchable-phrases] :as user}]]
|
||||
(if-let [match
|
||||
(cond
|
||||
(and nickname
|
||||
(string/starts-with?
|
||||
(string/lower-case nickname)
|
||||
searched-text))
|
||||
(or alias name)
|
||||
(if (seq searchable-phrases)
|
||||
(when (some
|
||||
(fn [s]
|
||||
(string/starts-with?
|
||||
(string/lower-case s)
|
||||
searched-text))
|
||||
searchable-phrases)
|
||||
(or name alias))
|
||||
(cond
|
||||
(and nickname
|
||||
(string/starts-with?
|
||||
(string/lower-case nickname)
|
||||
searched-text))
|
||||
(or name alias)
|
||||
|
||||
(and alias
|
||||
(string/starts-with?
|
||||
(string/lower-case alias)
|
||||
searched-text))
|
||||
alias
|
||||
(and alias
|
||||
(string/starts-with?
|
||||
(string/lower-case alias)
|
||||
searched-text))
|
||||
alias
|
||||
|
||||
(string/starts-with?
|
||||
(string/lower-case name)
|
||||
searched-text)
|
||||
name)]
|
||||
(string/starts-with?
|
||||
(string/lower-case name)
|
||||
searched-text)
|
||||
name))]
|
||||
(assoc acc k (assoc user
|
||||
:match match
|
||||
:searched-text searched-text))
|
||||
@@ -132,11 +301,13 @@
|
||||
|
||||
(defn replace-mentions
|
||||
([text users-fn]
|
||||
(replace-mentions text users-fn 0))
|
||||
([text users-fn idx]
|
||||
(if (string/blank? text)
|
||||
(let [idxs (get-at-signs text)]
|
||||
(replace-mentions text users-fn idxs 0)))
|
||||
([text users-fn idxs diff]
|
||||
(if (or (string/blank? text)
|
||||
(empty? idxs))
|
||||
text
|
||||
(let [mention-key-idx (string/index-of text at-sign idx)]
|
||||
(let [mention-key-idx (- (first idxs) diff)]
|
||||
(if-not mention-key-idx
|
||||
text
|
||||
(let [users (users-fn)]
|
||||
@@ -145,14 +316,14 @@
|
||||
(let [{:keys [public-key match]}
|
||||
(match-mention text users mention-key-idx)]
|
||||
(if-not match
|
||||
(recur text (fn [] users) (inc mention-key-idx))
|
||||
(recur text (fn [] users) (rest idxs) diff)
|
||||
(let [new-text (string/join
|
||||
[(subs text 0 (inc mention-key-idx))
|
||||
public-key
|
||||
(subs text (+ (inc mention-key-idx)
|
||||
(count match)))])
|
||||
mention-end (+ (inc mention-key-idx) (count public-key))]
|
||||
(recur new-text (fn [] users) mention-end)))))))))))
|
||||
(count match)))])]
|
||||
(recur new-text (fn [] users) (rest idxs)
|
||||
(+ diff (- (count text) (count new-text))))))))))))))
|
||||
|
||||
(defn check-mentions [cofx text]
|
||||
(replace-mentions text #(get-mentionable-users cofx)))
|
||||
@@ -450,3 +621,27 @@
|
||||
(calculate-suggestions mentionable-users))
|
||||
(clear-suggestions cofx)))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
::reset-text-input-cursor
|
||||
(fn [[ref cursor]]
|
||||
(when ref
|
||||
(status/reset-keyboard-input
|
||||
(rn/find-node-handle (react/current-ref ref))
|
||||
cursor))))
|
||||
|
||||
(fx/defn reset-text-input-cursor
|
||||
[_ ref cursor]
|
||||
{::reset-text-input-cursor [ref cursor]})
|
||||
|
||||
(defn add-searchable-phrases
|
||||
[{:keys [alias name nickname] :as user}]
|
||||
(reduce
|
||||
(fn [user s]
|
||||
(if (nil? s)
|
||||
user
|
||||
(let [new-words (concat
|
||||
[s]
|
||||
(rest (string/split s " ")))]
|
||||
(update user :searchable-phrases (fnil concat []) new-words))))
|
||||
user
|
||||
[alias name nickname]))
|
||||
|
||||
@@ -105,4 +105,150 @@
|
||||
exprected-result (string/join
|
||||
" "
|
||||
(repeat 1000 "@0xpk1 @0xpk2"))]
|
||||
(test/is (= exprected-result result))))))
|
||||
(test/is (= exprected-result result))))
|
||||
(test/testing "markdown"
|
||||
(test/testing "single * case 1"
|
||||
(let [text "*@user2*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "single * case 2"
|
||||
(let [text "*@user2 *"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "*@0xpk2 *") (pr-str text))))
|
||||
|
||||
(test/testing "single * case 3"
|
||||
(let [text "a*@user2*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "single * case 4"
|
||||
(let [text "*@user2 foo*foo"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "*@0xpk2 foo*foo") (pr-str text))))
|
||||
|
||||
(test/testing "single * case 5"
|
||||
(let [text "a *@user2*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "single * case 6"
|
||||
(let [text "*@user2 foo*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "single * case 7"
|
||||
(let [text "@user2 *@user2 foo* @user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "@0xpk2 *@user2 foo* @0xpk2") (pr-str text))))
|
||||
|
||||
(test/testing "single * case 8"
|
||||
(let [text "*@user2 foo**@user2 foo*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "single * case 9"
|
||||
(let [text "*@user2 foo***@user2 foo* @user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "*@user2 foo***@user2 foo* @0xpk2") (pr-str text))))
|
||||
|
||||
(test/testing "double * case 1"
|
||||
(let [text "**@user2**"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "double * case 2"
|
||||
(let [text "**@user2 **"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "**@0xpk2 **") (pr-str text))))
|
||||
|
||||
(test/testing "double * case 3"
|
||||
(let [text "a**@user2**"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "double * case 4"
|
||||
(let [text "**@user2 foo**foo"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "**@user2 foo**foo") (pr-str text))))
|
||||
|
||||
(test/testing "double * case 5"
|
||||
(let [text "a **@user2**"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "double * case 6"
|
||||
(let [text "**@user2 foo**"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "double * case 7"
|
||||
(let [text "@user2 **@user2 foo** @user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "@0xpk2 **@user2 foo** @0xpk2") (pr-str text))))
|
||||
|
||||
(test/testing "double * case 8"
|
||||
(let [text "**@user2 foo****@user2 foo**"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "double * case 9"
|
||||
(let [text "**@user2 foo*****@user2 foo** @user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "**@user2 foo*****@user2 foo** @0xpk2") (pr-str text))))
|
||||
|
||||
(test/testing "tripple * case 1"
|
||||
(let [text "***@user2 foo***@user2 foo*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "***@user2 foo***@0xpk2 foo*") (pr-str text))))
|
||||
|
||||
(test/testing "tripple ~ case 1"
|
||||
(let [text "~~~@user2 foo~~~@user2 foo~"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "quote case 1"
|
||||
(let [text ">@user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "quote case 2"
|
||||
(let [text "\n>@user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "quote case 3"
|
||||
(let [text "\n> @user2 \n \n @user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "\n> @user2 \n \n @0xpk2") (pr-str text))))
|
||||
|
||||
(test/testing "quote case 4"
|
||||
(let [text ">@user2\n\n>@user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "quote case 5"
|
||||
(let [text "***hey\n\n>@user2\n\n@user2 foo***"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "***hey\n\n>@user2\n\n@0xpk2 foo***")
|
||||
(pr-str text))))
|
||||
|
||||
(test/testing "code case 1"
|
||||
(let [text "` @user2 `"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "code case 2"
|
||||
(let [text "` @user2 `"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "code case 3"
|
||||
(let [text "``` @user2 ```"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "code case 4"
|
||||
(let [text "` ` @user2 ``"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "` ` @0xpk2 ``") (pr-str text)))))))
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
[status-im.transport.message.protocol :as protocol]
|
||||
[status-im.ui.screens.chat.state :as view.state]
|
||||
[status-im.utils.fx :as fx]
|
||||
[taoensso.timbre :as log]))
|
||||
[taoensso.timbre :as log]
|
||||
[status-im.chat.models.mentions :as mentions]))
|
||||
|
||||
(defn- prepare-message
|
||||
[message current-chat?]
|
||||
@@ -67,11 +68,12 @@
|
||||
(let [nickname (get-in db [:contacts/contacts from :nickname])]
|
||||
{:db (update-in db [:chats chat-id :users] assoc
|
||||
from
|
||||
{:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:public-key from
|
||||
:nickname nickname})})))
|
||||
(mentions/add-searchable-phrases
|
||||
{:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:public-key from
|
||||
:nickname nickname}))})))
|
||||
|
||||
(fx/defn add-received-message
|
||||
[{:keys [db] :as cofx}
|
||||
|
||||
@@ -45,11 +45,12 @@
|
||||
"00000000000000000000000000000000000000000000000000090x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
:cursor-clock-value 9,
|
||||
:users
|
||||
{"from" {:alias "alias",
|
||||
:name "name",
|
||||
:identicon "identicon",
|
||||
:public-key "from"
|
||||
:nickname nil}}}}}}
|
||||
{"from" {:alias "alias",
|
||||
:name "name",
|
||||
:identicon "identicon",
|
||||
:public-key "from"
|
||||
:nickname nil
|
||||
:searchable-phrases ["alias" "name"]}}}}}}
|
||||
(message/add-received-message
|
||||
cofx
|
||||
message)))))
|
||||
@@ -68,11 +69,12 @@
|
||||
"00000000000000000000000000000000000000000000000000090x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
:cursor-clock-value 9,
|
||||
:users
|
||||
{"from" {:alias "alias",
|
||||
:name "name",
|
||||
:identicon "identicon",
|
||||
:public-key "from"
|
||||
:nickname nil}}}}}}
|
||||
{"from" {:alias "alias",
|
||||
:name "name",
|
||||
:identicon "identicon",
|
||||
:public-key "from"
|
||||
:nickname nil
|
||||
:searchable-phrases ["alias" "name"]}}}}}}
|
||||
(message/add-received-message
|
||||
cofx
|
||||
message)))))
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
(def invitation-state-requested 1)
|
||||
(def invitation-state-rejected 2)
|
||||
(def invitation-state-approved 3)
|
||||
(def invitation-state-granted 4)
|
||||
(def invitation-state-removed 5)
|
||||
|
||||
(def message-type-one-to-one 1)
|
||||
(def message-type-public-group 2)
|
||||
@@ -50,7 +52,7 @@
|
||||
(def command-state-transaction-sent 7)
|
||||
|
||||
(def min-password-length 6)
|
||||
(def max-group-chat-participants 10)
|
||||
(def max-group-chat-participants 20)
|
||||
(def default-number-of-messages 20)
|
||||
|
||||
(def mailserver-password "status-offline-inbox")
|
||||
|
||||
@@ -485,6 +485,10 @@
|
||||
:nft? true
|
||||
:name "SupeRare"
|
||||
:address "0x41a322b28d0ff354040e2cbc676f0320d8c8850d"}
|
||||
{:symbol :SUPRR
|
||||
:nft? true
|
||||
:name "SuperRare"
|
||||
:address "0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0"}
|
||||
{:symbol :KDO
|
||||
:nft? true
|
||||
:name "KudosToken"
|
||||
@@ -641,7 +645,7 @@
|
||||
:decimals 9
|
||||
:symbol :XRL
|
||||
:name "RIALTO"}
|
||||
{:address "0xC011A72400E58ecD99Ee497CF89E3775d4bd732F"
|
||||
{:address "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F"
|
||||
:decimals 18
|
||||
:symbol :SNX
|
||||
:name "Synthetix Network Token"}
|
||||
@@ -705,7 +709,7 @@
|
||||
:symbol :DTA
|
||||
:name "Data Token"
|
||||
:decimals 18}
|
||||
{:address "0x57ab1e02fee23774580c119740129eac7081e9d3"
|
||||
{:address "0x57Ab1ec28D129707052df4dF418D58a2D46d5f51"
|
||||
:symbol :sUSD
|
||||
:name "Synth sUSD"
|
||||
:decimals 18}
|
||||
@@ -736,7 +740,11 @@
|
||||
{:address "0x8ab7404063ec4dbcfd4598215992dc3f8ec853d7"
|
||||
:symbol :AKRO
|
||||
:name "Akropolis"
|
||||
:decimals 18}])
|
||||
:decimals 18}
|
||||
{:address "0x9ba00d6856a4edf4665bca2c2309936572473b7e"
|
||||
:symbol :aUSDC
|
||||
:name "Aave Interest bearing USDC"
|
||||
:decimals 6}])
|
||||
:testnet
|
||||
(resolve-icons :testnet
|
||||
[{:name "Status Test Token"
|
||||
|
||||
@@ -228,7 +228,8 @@
|
||||
(conj acc address)
|
||||
acc))
|
||||
#{}
|
||||
transfers))))
|
||||
transfers))
|
||||
nil))
|
||||
|
||||
(< (count transfers) limit)
|
||||
(conj (tx-history-end-reached checksum)))]
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
[taoensso.timbre :as log]
|
||||
status-im.waku.core
|
||||
status-im.wallet.choose-recipient.core
|
||||
status-im.wallet.collectibles.core
|
||||
status-im.wallet.accounts.core
|
||||
status-im.popover.core
|
||||
[status-im.keycard.core :as keycard]
|
||||
@@ -68,7 +67,8 @@
|
||||
status-im.ui.screens.profile.events
|
||||
status-im.chat.models.images
|
||||
status-im.ui.screens.privacy-and-security-settings.events
|
||||
[status-im.data-store.invitations :as data-store.invitations]))
|
||||
[status-im.data-store.invitations :as data-store.invitations]
|
||||
[status-im.ui.screens.wallet.events :as wallet.events]))
|
||||
|
||||
;; init module
|
||||
(handlers/register-handler-fx
|
||||
@@ -237,6 +237,11 @@
|
||||
(fn [cofx [_ _]]
|
||||
(mailserver/retry-next-messages-request cofx)))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:mailserver.ui/use-history-switch-pressed
|
||||
(fn [cofx [_ use-mailservers?]]
|
||||
(mailserver/update-use-mailservers cofx use-mailservers?)))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:mailserver/check-connection-timeout
|
||||
(fn [cofx _]
|
||||
@@ -507,8 +512,8 @@
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:chat.ui/select-mention
|
||||
(fn [cofx [_ mention]]
|
||||
(chat.input/select-mention cofx mention)))
|
||||
(fn [cofx [_ text-input-ref mention]]
|
||||
(chat.input/select-mention cofx text-input-ref mention)))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:chat.ui/set-chat-input-text
|
||||
@@ -1257,4 +1262,5 @@
|
||||
;; messages
|
||||
:chat (chat.loading/load-messages %)
|
||||
:multiaccounts (keycard/multiaccounts-screen-did-load %)
|
||||
(:wallet-stack :wallet) (wallet.events/wallet-will-focus %)
|
||||
nil))))
|
||||
|
||||
@@ -168,3 +168,11 @@
|
||||
(assoc acc id inv))
|
||||
%
|
||||
invitations))})
|
||||
|
||||
(defn member-removed? [{:keys [membership-update-events]} pk]
|
||||
(->> membership-update-events
|
||||
(filter #(contains? (set (:members %)) pk))
|
||||
(sort-by :clockValue >)
|
||||
first
|
||||
:type
|
||||
(= constants/invitation-state-removed)))
|
||||
|
||||
@@ -58,10 +58,10 @@
|
||||
::open-multiaccounts #(re-frame/dispatch [::initialize-multiaccounts % {:logout? false}])
|
||||
:ui/listen-to-window-dimensions-change nil
|
||||
::network/listen-to-network-info nil
|
||||
:keycard/register-card-events nil
|
||||
:keycard/check-nfc-support nil
|
||||
:keycard/check-nfc-enabled nil
|
||||
:keycard/retrieve-pairings nil}
|
||||
:keycard/register-card-events nil
|
||||
:keycard/check-nfc-support nil
|
||||
:keycard/check-nfc-enabled nil
|
||||
:keycard/retrieve-pairings nil}
|
||||
(initialize-app-db)))
|
||||
|
||||
(re-frame/reg-fx
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
(ns status-im.ios.platform
|
||||
(:require ["react-native" :refer (Dimensions)]))
|
||||
|
||||
;; iPhone X dimensions
|
||||
(def x-height 812)
|
||||
(def xs-height 896)
|
||||
|
||||
(defn iphone-x-dimensions? []
|
||||
(let [{:keys [height]} (-> Dimensions
|
||||
(.get "window")
|
||||
(js->clj :keywordize-keys true))]
|
||||
(or (= height x-height) (= height xs-height))))
|
||||
|
||||
(def platform-specific
|
||||
{:status-bar-default-height (if (iphone-x-dimensions?) 0 20)})
|
||||
@@ -148,7 +148,8 @@
|
||||
whisper-private-key
|
||||
encryption-public-key
|
||||
instance-uid
|
||||
key-uid]} multiaccount
|
||||
key-uid
|
||||
recovered]} multiaccount
|
||||
{:keys [pairing paired-on]} secrets
|
||||
{:keys [name photo-path]}
|
||||
(if (nil? name)
|
||||
@@ -167,7 +168,8 @@
|
||||
(assoc-in [:keycard :setup-step] nil)
|
||||
(dissoc :intro-wizard))}
|
||||
(multiaccounts.create/on-multiaccount-created
|
||||
{:derived {constants/path-wallet-root-keyword
|
||||
{:recovered (or recovered (get-in db [:intro-wizard :recovering?]))
|
||||
:derived {constants/path-wallet-root-keyword
|
||||
{:public-key wallet-root-public-key
|
||||
:address (eip55/address->checksum wallet-root-address)}
|
||||
constants/path-whisper-keyword
|
||||
@@ -268,6 +270,7 @@
|
||||
{:db (update-in db [:keycard :multiaccount]
|
||||
(fn [multiacc]
|
||||
(assoc multiacc
|
||||
:recovered true
|
||||
:name whisper-name
|
||||
:photo-path photo-path)))}
|
||||
(create-keycard-multiaccount)))
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
payload (.stringify js/JSON (clj->js args))]
|
||||
(status/call-private-rpc payload
|
||||
(handlers/response-handler
|
||||
#(log/debug "mailserver: remove-peer success" %)
|
||||
#(log/info "mailserver: remove-peer success" %)
|
||||
#(log/error "mailserver: remove-peer error" %)))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
@@ -214,27 +214,45 @@
|
||||
current-request
|
||||
[:from :to :force-to? :topics :chat-id])))
|
||||
|
||||
(fx/defn disconnect-from-mailserver
|
||||
[{:keys [db] :as cofx}]
|
||||
(let [{:keys [address]} (fetch-current db)
|
||||
{:keys [peers-summary]} db
|
||||
gap-request? (executing-gap-request? db)]
|
||||
{:db (cond-> (dissoc db :mailserver/current-request)
|
||||
gap-request?
|
||||
(-> (assoc :mailserver/fetching-gaps-in-progress {})
|
||||
(dissoc :mailserver/planned-gap-requests)))
|
||||
|
||||
:mailserver/remove-peer address}))
|
||||
|
||||
(defn fetch-use-mailservers? [{:keys [db]}]
|
||||
(get-in db [:multiaccount :use-mailservers?]))
|
||||
|
||||
(fx/defn connect-to-mailserver
|
||||
"Add mailserver as a peer using `::add-peer` cofx and generate sym-key when
|
||||
it doesn't exists
|
||||
Peer summary will change and we will receive a signal from status go when
|
||||
this is successful
|
||||
A connection-check is made after `connection timeout` is reached and
|
||||
mailserver-state is changed to error if it is not connected by then"
|
||||
mailserver-state is changed to error if it is not connected by then
|
||||
No attempt is made if mailserver usage is disabled"
|
||||
{:events [:mailserver.ui/reconnect-mailserver-pressed]}
|
||||
[{:keys [db] :as cofx}]
|
||||
(let [{:keys [address]} (fetch-current db)
|
||||
(let [{:keys [address]} (fetch-current db)
|
||||
{:keys [peers-summary]} db
|
||||
added? (registered-peer? peers-summary address)
|
||||
gap-request? (executing-gap-request? db)]
|
||||
(fx/merge cofx
|
||||
{:db (cond-> (dissoc db :mailserver/current-request)
|
||||
gap-request?
|
||||
(-> (assoc :mailserver/fetching-gaps-in-progress {})
|
||||
(dissoc :mailserver/planned-gap-requests)))}
|
||||
(if added?
|
||||
(mark-trusted-peer)
|
||||
(add-peer)))))
|
||||
use-mailservers? (fetch-use-mailservers? cofx)
|
||||
added? (registered-peer? peers-summary address)
|
||||
gap-request? (executing-gap-request? db)]
|
||||
(when use-mailservers?
|
||||
(fx/merge cofx
|
||||
{:db (cond-> (dissoc db :mailserver/current-request)
|
||||
gap-request?
|
||||
(-> (assoc :mailserver/fetching-gaps-in-progress {})
|
||||
(dissoc :mailserver/planned-gap-requests)))}
|
||||
(if added?
|
||||
(mark-trusted-peer)
|
||||
(add-peer))))))
|
||||
|
||||
(defn pool-size [fleet-size]
|
||||
(.ceil js/Math (/ fleet-size 4)))
|
||||
@@ -299,7 +317,7 @@
|
||||
(mark-trusted-peer cofx)
|
||||
mailserver-removed?
|
||||
(connect-to-mailserver cofx)))
|
||||
;; if there is no current mailserver defined,
|
||||
;; if there is no current mailserver defined
|
||||
;; we set it first
|
||||
(set-current-mailserver cofx))))
|
||||
|
||||
@@ -446,6 +464,7 @@
|
||||
(when (and
|
||||
(:filters/initialized db)
|
||||
(mobile-network-utils/syncing-allowed? cofx)
|
||||
(fetch-use-mailservers? cofx)
|
||||
(not (:mailserver/current-request db)))
|
||||
(when-let [mailserver (get-mailserver-when-ready cofx)]
|
||||
(let [request-to (or (:mailserver/request-to db)
|
||||
@@ -489,11 +508,24 @@
|
||||
dissoc :generating-sym-key?))}
|
||||
(process-next-messages-request))))
|
||||
|
||||
(fx/defn update-use-mailservers
|
||||
[cofx use-mailservers?]
|
||||
(fx/merge cofx
|
||||
(multiaccounts.update/multiaccount-update :use-mailservers? use-mailservers? {})
|
||||
(if use-mailservers?
|
||||
(connect-to-mailserver)
|
||||
(disconnect-from-mailserver))))
|
||||
|
||||
(fx/defn change-mailserver
|
||||
"mark mailserver status as `:error` if custom mailserver is used
|
||||
otherwise try to reconnect to another mailserver"
|
||||
[{:keys [db] :as cofx}]
|
||||
(when-not (zero? (:peers-count db))
|
||||
(when (and (fetch-use-mailservers? cofx)
|
||||
;; For some reason the tests are checking
|
||||
;; for non-zero, so nil value is ok, not
|
||||
;; sure is intentional, but will leave it as it is
|
||||
;; instead of using pos?
|
||||
(not (zero? (:peers-count db))))
|
||||
(if-let [preferred-mailserver (preferred-mailserver-id db)]
|
||||
(let [current-fleet (node/current-fleet-key db)]
|
||||
{:db
|
||||
@@ -525,7 +557,8 @@
|
||||
;; check if logged into multiaccount
|
||||
(when (contains? db :multiaccount)
|
||||
(let [last-connection-attempt (:mailserver/last-connection-attempt db)]
|
||||
(when (<= (- now last-connection-attempt))
|
||||
(when (and (fetch-use-mailservers? cofx)
|
||||
(<= (- now last-connection-attempt)))
|
||||
(fx/merge cofx
|
||||
(when (not= :connected (:mailserver/state db))
|
||||
(change-mailserver)))))))
|
||||
@@ -1124,11 +1157,14 @@
|
||||
(let [{:keys [address]} (fetch-current db)
|
||||
pinned-mailservers (get-in db [:multiaccount :pinned-mailservers])
|
||||
;; Check if previous mailserver was pinned
|
||||
pinned? (get pinned-mailservers current-fleet)]
|
||||
pinned? (get pinned-mailservers current-fleet)
|
||||
use-mailservers? (fetch-use-mailservers? cofx)]
|
||||
(fx/merge cofx
|
||||
{:db (assoc db :mailserver/current-id mailserver-id)
|
||||
:mailserver/remove-peer address}
|
||||
(connect-to-mailserver)
|
||||
|
||||
(when use-mailservers? (connect-to-mailserver))
|
||||
|
||||
(when pinned?
|
||||
(multiaccounts.update/multiaccount-update
|
||||
:pinned-mailservers (assoc pinned-mailservers
|
||||
|
||||
@@ -35,12 +35,14 @@
|
||||
(deftest change-mailserver
|
||||
(testing "we are offline"
|
||||
(testing "it does not change mailserver"
|
||||
(is (not (mailserver/change-mailserver {:db {:peers-count 0}})))))
|
||||
(is (not (mailserver/change-mailserver {:db {:multiaccount {:use-mailservers? true}
|
||||
:peers-count 0}})))))
|
||||
(testing "we are online"
|
||||
(testing "there's a preferred mailserver"
|
||||
(testing "it shows the popup"
|
||||
(is (:ui/show-confirmation (mailserver/change-mailserver
|
||||
{:db {:multiaccount {:fleet :staging
|
||||
:use-mailservers? true
|
||||
:pinned-mailservers {:staging "id"}}
|
||||
:peers-count 1}})))))
|
||||
(testing "there's not a preferred mailserver"
|
||||
@@ -49,12 +51,14 @@
|
||||
(get-in
|
||||
(mailserver/change-mailserver
|
||||
{:db {:mailserver/mailservers {:staging {:a "b"}}
|
||||
:multiaccount {:fleet :staging}
|
||||
:multiaccount {:use-mailservers? true
|
||||
:fleet :staging}
|
||||
:peers-count 1}})
|
||||
[::json-rpc/call 0 :method]))))
|
||||
(testing "it does not show the popup"
|
||||
(is (not (:ui/show-confirmation (mailserver/change-mailserver
|
||||
{:db {:peers-count 1}}))))))))
|
||||
{:db {:multiaccount {:use-mailservers? true}
|
||||
:peers-count 1}}))))))))
|
||||
|
||||
(deftest test-registered-peer?
|
||||
(testing "Peer is registered"
|
||||
@@ -334,7 +338,8 @@
|
||||
:peers-summary (if registered-peer?
|
||||
[{:id "mailserver-id" :enode "enode://mailserver-id@ip"}]
|
||||
[])
|
||||
:multiaccount {:fleet :eth.staging}
|
||||
:multiaccount {:fleet :eth.staging
|
||||
:use-mailservers? true}
|
||||
:mailserver/current-id "mailserver-a"
|
||||
:mailserver/mailservers {:eth.staging {"mailserver-a" {:sym-key-id sym-key
|
||||
:address "enode://mailserver-id@ip"}}}}})
|
||||
@@ -354,7 +359,8 @@
|
||||
(testing "it changes mailserver"
|
||||
(is (= "mailservers_ping"
|
||||
(-> (mailserver/resend-request
|
||||
{:db {:mailserver/current-request
|
||||
{:db {:multiaccount {:use-mailservers? true}
|
||||
:mailserver/current-request
|
||||
{:attempts constants/maximum-number-of-attempts}}}
|
||||
{})
|
||||
::json-rpc/call
|
||||
@@ -611,7 +617,8 @@
|
||||
:password "mailserver-password"}}}
|
||||
:multiaccount
|
||||
{:fleet :eth.staging
|
||||
:pinned-mailservers {:eth.staging "mailserverid"}}}]
|
||||
:pinned-mailservers {:eth.staging "mailserverid"}
|
||||
:use-mailservers? true}}]
|
||||
(testing "it adds the peer"
|
||||
(is (= "mailserver-address"
|
||||
(:mailserver/add-peer (mailserver/connect-to-mailserver {:db db})))))
|
||||
@@ -625,7 +632,12 @@
|
||||
"somesymkeyid")]
|
||||
(testing "it does not generate a sym key if already present"
|
||||
(is (not (-> (mailserver/connect-to-mailserver {:db mailserver-with-sym-key-db})
|
||||
:shh/generate-sym-key-from-password)))))))
|
||||
:shh/generate-sym-key-from-password)))))
|
||||
|
||||
(testing "it returns noops when use-mailservers? is false"
|
||||
(let [no-mailservers-cofx {:db (assoc-in db [:multiaccount :use-mailservers?] false)}]
|
||||
(is (= (mailserver/connect-to-mailserver no-mailservers-cofx)
|
||||
nil))))))
|
||||
|
||||
(deftest check-existing-gaps
|
||||
(testing "no gaps"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
[status-im.utils.theme :as utils.theme]
|
||||
[status-im.theme.core :as theme]
|
||||
[status-im.utils.utils :as utils]
|
||||
[quo.platform :as platform]
|
||||
[clojure.string :as string]))
|
||||
|
||||
(defn contact-names
|
||||
@@ -65,6 +66,12 @@
|
||||
(fn [on]
|
||||
(native-module/chaos-mode-update on (constantly nil))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
::webview-debug-changed
|
||||
(fn [value]
|
||||
(when platform/android?
|
||||
(native-module/toggle-webview-debug value))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
::blank-preview-flag-changed
|
||||
(fn [flag]
|
||||
@@ -86,6 +93,15 @@
|
||||
:dev-mode? dev-mode?
|
||||
{}))
|
||||
|
||||
(fx/defn switch-webview-debug
|
||||
{:events [:multiaccounts.ui/switch-webview-debug]}
|
||||
[{:keys [db] :as cofx} value]
|
||||
(fx/merge cofx
|
||||
{::webview-debug-changed value}
|
||||
(multiaccounts.update/multiaccount-update
|
||||
:webview-debug (boolean value)
|
||||
{})))
|
||||
|
||||
(fx/defn switch-chaos-mode
|
||||
[{:keys [db] :as cofx} chaos-mode?]
|
||||
(when (:multiaccount db)
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
(fx/defn on-multiaccount-created
|
||||
[{:keys [signing-phrase random-guid-generator db] :as cofx}
|
||||
{:keys [address chat-key keycard-instance-uid key-uid
|
||||
keycard-pairing keycard-paired-on mnemonic public-key]
|
||||
keycard-pairing keycard-paired-on mnemonic recovered]
|
||||
:as multiaccount}
|
||||
password
|
||||
{:keys [save-mnemonic? login?] :or {login? true save-mnemonic? false}}]
|
||||
@@ -252,7 +252,10 @@
|
||||
:latest-derived-path 0
|
||||
:signing-phrase signing-phrase
|
||||
:send-push-notifications? true
|
||||
:installation-id (random-guid-generator)}
|
||||
:installation-id (random-guid-generator)
|
||||
;; default mailserver (history node) setting
|
||||
:use-mailservers? true
|
||||
:recovered (or recovered (get-in db [:intro-wizard :recovering?]))}
|
||||
constants/default-multiaccount)
|
||||
;; The address from which we derive any chat
|
||||
;; account/encryption keys
|
||||
|
||||
@@ -55,14 +55,14 @@
|
||||
|
||||
(fx/defn initialize-wallet
|
||||
{:events [::initialize-wallet]}
|
||||
[{:keys [db] :as cofx} accounts custom-tokens favourites]
|
||||
[{:keys [db] :as cofx} accounts custom-tokens favourites new-account?]
|
||||
(fx/merge
|
||||
cofx
|
||||
{:db (assoc db :multiaccount/accounts
|
||||
(rpc->accounts accounts))}
|
||||
(wallet/initialize-tokens custom-tokens)
|
||||
(wallet/initialize-favourites favourites)
|
||||
(wallet/update-balances nil)
|
||||
(wallet/update-balances nil new-account?)
|
||||
(prices/update-prices)))
|
||||
|
||||
(fx/defn login
|
||||
@@ -250,9 +250,7 @@
|
||||
[{:keys [db] :as cofx}]
|
||||
(let [{:keys [multiaccount multiaccounts :multiaccount/accounts]} db
|
||||
{:keys [creating?]} (:multiaccounts/login db)
|
||||
recovering? (get-in db [:intro-wizard :recovering?])
|
||||
first-account? (and creating?
|
||||
(not recovering?)
|
||||
(empty? multiaccounts))]
|
||||
(fx/merge cofx
|
||||
{:db (-> db
|
||||
@@ -266,6 +264,7 @@
|
||||
;;so here we set it at 1 already so that it passes the check once it has
|
||||
;;been initialized
|
||||
:filters/initialized 1))
|
||||
:dispatch-later [{:ms 2000 :dispatch [::initialize-wallet accounts nil nil (:recovered multiaccount)]}]
|
||||
:filters/load-filters [[]]}
|
||||
(finish-keycard-setup)
|
||||
(when first-account?
|
||||
@@ -275,8 +274,7 @@
|
||||
:mailserver-topics {}
|
||||
:default-mailserver true})
|
||||
(multiaccounts/switch-preview-privacy-mode-flag)
|
||||
(logging/set-log-level (:log-level multiaccount))
|
||||
(initialize-wallet accounts nil nil))))
|
||||
(logging/set-log-level (:log-level multiaccount)))))
|
||||
|
||||
(defn- keycard-setup? [cofx]
|
||||
(boolean (get-in cofx [:db :keycard :flow])))
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[status-im.native-module.core :as status]
|
||||
[status-im.transport.core :as transport]
|
||||
[status-im.utils.fx :as fx]
|
||||
[status-im.multiaccounts.core :as multiaccounts]
|
||||
[status-im.utils.keychain.core :as keychain]
|
||||
[status-im.notifications.core :as notifications]))
|
||||
|
||||
@@ -13,9 +14,10 @@
|
||||
[{:keys [db] :as cofx} {:keys [auth-method logout?]}]
|
||||
(let [key-uid (get-in db [:multiaccount :key-uid])]
|
||||
(fx/merge cofx
|
||||
{::logout nil
|
||||
:keychain/clear-user-password key-uid
|
||||
::init/open-multiaccounts #(re-frame/dispatch [::init/initialize-multiaccounts % {:logout? logout?}])}
|
||||
{::logout nil
|
||||
::multiaccounts/webview-debug-changed false
|
||||
:keychain/clear-user-password key-uid
|
||||
::init/open-multiaccounts #(re-frame/dispatch [::init/initialize-multiaccounts % {:logout? logout?}])}
|
||||
(notifications/logout-disable)
|
||||
(keychain/save-auth-method key-uid auth-method)
|
||||
(transport/stop-whisper)
|
||||
|
||||
@@ -308,6 +308,10 @@
|
||||
(log/debug "[native-module] chaos-mode-update")
|
||||
(.chaosModeUpdate ^js (status) on on-result))
|
||||
|
||||
(defn toggle-webview-debug [on]
|
||||
(log/debug "[native-module] toggle-webview-debug" on)
|
||||
(.toggleWebviewDebug ^js (status) on))
|
||||
|
||||
(defn get-nodes-from-contract
|
||||
[rpc-endpoint contract-address on-result]
|
||||
(log/debug "[native-module] get-nodes-from-contract")
|
||||
@@ -380,3 +384,8 @@
|
||||
(defn deactivate-keep-awake []
|
||||
(log/debug "[native-module] deactivateKeepAwake")
|
||||
(.deactivateKeepAwake ^js (status)))
|
||||
|
||||
(defn reset-keyboard-input [input selection]
|
||||
(log/debug "[native-module] resetKeyboardInput")
|
||||
(when platform/android?
|
||||
(.resetKeyboardInputCursor ^js (status) input selection)))
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{:db (assoc db :network-status (if is-connected? :online :offline))}
|
||||
(when is-connected?
|
||||
(if-not (= (count (get-in db [:wallet :accounts])) (count (get db :multiaccount/accounts)))
|
||||
(wallet/update-balances nil)))))
|
||||
(wallet/update-balances nil nil)))))
|
||||
|
||||
(fx/defn change-network-type
|
||||
[{:keys [db] :as cofx} old-network-type network-type expensive?]
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
(reset! warning? false)
|
||||
(reset! visible true))
|
||||
|
||||
(defn build-failed []
|
||||
(defn build-failed [warnings]
|
||||
(reset! warning? true)
|
||||
(reset! label "building failed")
|
||||
(reset! label (str "building failed"
|
||||
(when (seq warnings)
|
||||
(str "\n" (count warnings) " warnings"))))
|
||||
(reset! visible true))
|
||||
|
||||
(defn build-start []
|
||||
@@ -33,6 +35,15 @@
|
||||
(reset! label "building")
|
||||
(reset! visible true))
|
||||
|
||||
(defn build-notify [{:keys [type info]}]
|
||||
(cond (= :build-start type)
|
||||
(build-start)
|
||||
(or (= :build-failure type)
|
||||
(and (= :build-complete type) (seq (:warnings info))))
|
||||
(build-failed (:warnings info))
|
||||
(= :build-complete type)
|
||||
(build-competed)))
|
||||
|
||||
(defn reload-view [_]
|
||||
(fn [cnt]
|
||||
(when @timeout (js/clearTimeout @timeout))
|
||||
|
||||
+23
-12
@@ -15,6 +15,7 @@
|
||||
[status-im.ethereum.transactions.core :as transactions]
|
||||
[status-im.fleet.core :as fleet]
|
||||
[status-im.group-chats.db :as group-chats.db]
|
||||
[status-im.group-chats.core :as group-chat]
|
||||
[status-im.i18n :as i18n]
|
||||
[status-im.multiaccounts.core :as multiaccounts]
|
||||
[status-im.multiaccounts.db :as multiaccounts.db]
|
||||
@@ -42,7 +43,8 @@
|
||||
status-im.ui.screens.keycard.subs
|
||||
status-im.ui.screens.keycard.settings.subs
|
||||
status-im.ui.screens.keycard.pin.subs
|
||||
status-im.ui.screens.keycard.setup.subs))
|
||||
status-im.ui.screens.keycard.setup.subs
|
||||
[status-im.chat.models.mentions :as mentions]))
|
||||
|
||||
;; TOP LEVEL ===========================================================================================================
|
||||
|
||||
@@ -866,6 +868,13 @@
|
||||
(fn [[invitations]]
|
||||
(filter #(= constants/invitation-state-requested (:state %)) invitations)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:group-chat/removed-from-current-chat?
|
||||
:<- [:chats/current-raw-chat]
|
||||
:<- [:multiaccount/public-key]
|
||||
(fn [[current-chat pk]]
|
||||
(group-chat/member-removed? current-chat pk)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:chats/transaction-status
|
||||
;;TODO address here for transactions
|
||||
@@ -890,11 +899,12 @@
|
||||
(not (contact.db/blocked? contact)))
|
||||
(let [name (utils/safe-replace name ".stateofus.eth" "")]
|
||||
(assoc acc public-key
|
||||
{:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:nickname nickname
|
||||
:public-key key}))
|
||||
(mentions/add-searchable-phrases
|
||||
{:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:nickname nickname
|
||||
:public-key key})))
|
||||
acc))
|
||||
{}
|
||||
contacts)))
|
||||
@@ -909,10 +919,11 @@
|
||||
(apply dissoc
|
||||
(-> users
|
||||
(merge contacts)
|
||||
(assoc public-key {:alias name
|
||||
:name (or preferred-name name)
|
||||
:identicon photo-path
|
||||
:public-key public-key}))
|
||||
(assoc public-key (mentions/add-searchable-phrases
|
||||
{:alias name
|
||||
:name (or preferred-name name)
|
||||
:identicon photo-path
|
||||
:public-key public-key})))
|
||||
blocked)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
@@ -1274,9 +1285,9 @@
|
||||
|
||||
(defn get-asset-amount [balances sym]
|
||||
(reduce #(if-let [^js bl (get %2 sym)]
|
||||
(.plus ^js %1 bl)
|
||||
(.plus ^js (or ^js %1 ^js (money/bignumber 0)) bl)
|
||||
%1)
|
||||
^js (money/bignumber 0)
|
||||
nil
|
||||
balances))
|
||||
|
||||
(re-frame/reg-sub
|
||||
|
||||
@@ -255,13 +255,14 @@
|
||||
[rn/view {:style {:flex-direction :row
|
||||
:justify-content :center}}
|
||||
[rn/view {:style (styles/home-tokens-icons (count tokens))}
|
||||
(for [[{name :name
|
||||
{source :source} :icon} _ i] tokens]
|
||||
^{:key name}
|
||||
[rn/view {:style (styles/home-token-icon-style i)}
|
||||
[rn/image {:source (if (fn? source) (source) source)
|
||||
:style {:width 20
|
||||
:height 20}}]])]
|
||||
(doall
|
||||
(for [[{name :name
|
||||
{source :source} :icon} _ i] tokens]
|
||||
^{:key name}
|
||||
[rn/view {:style (styles/home-token-icon-style i)}
|
||||
[rn/image {:source (if (fn? source) (source) source)
|
||||
:style {:width 20
|
||||
:height 20}}]]))]
|
||||
[quo/text {:align :center}
|
||||
(i18n/label :t/invite-reward)]])]])))
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
(defn- normal-mode-settings-data [{:keys [network-name
|
||||
current-log-level
|
||||
waku-bloom-filter-mode
|
||||
current-fleet]}]
|
||||
current-fleet
|
||||
webview-debug]}]
|
||||
[{:size :small
|
||||
:title (i18n/label :t/network)
|
||||
:accessibility-label :network-button
|
||||
@@ -63,6 +64,15 @@
|
||||
#(re-frame/dispatch [:navigate-to :notifications-advanced-settings])
|
||||
:chevron true})
|
||||
{:size :small
|
||||
:title "Webview debug"
|
||||
:accessibility-label :webview-debug-switch
|
||||
:container-margin-bottom 8
|
||||
:on-press
|
||||
#(re-frame/dispatch
|
||||
[:multiaccounts.ui/switch-webview-debug (not webview-debug)])
|
||||
:accessory :switch
|
||||
:active webview-debug}
|
||||
{:size :small
|
||||
:title (i18n/label :t/waku-bloom-filter-mode)
|
||||
:accessibility-label :waku-bloom-filter-mode-settings-switch
|
||||
:container-margin-bottom 8
|
||||
@@ -71,7 +81,7 @@
|
||||
[:multiaccounts.ui/waku-bloom-filter-mode-switched (not waku-bloom-filter-mode)])
|
||||
:accessory :switch
|
||||
:active waku-bloom-filter-mode}
|
||||
#_{:size :small
|
||||
#_{:size :small
|
||||
:title :t/dev-mode
|
||||
:accessibility-label :dev-mode-settings-switch
|
||||
:container-margin-bottom 8
|
||||
@@ -119,7 +129,7 @@
|
||||
[quo/list-item props]))
|
||||
|
||||
(views/defview advanced-settings []
|
||||
(views/letsubs [{:keys [chaos-mode?]} [:multiaccount]
|
||||
(views/letsubs [{:keys [chaos-mode? webview-debug]} [:multiaccount]
|
||||
network-name [:network-name]
|
||||
waku-bloom-filter-mode [:waku/bloom-filter-mode]
|
||||
current-log-level [:log-level/current-log-level]
|
||||
@@ -133,6 +143,7 @@
|
||||
:current-fleet current-fleet
|
||||
:dev-mode? false
|
||||
:waku-bloom-filter-mode waku-bloom-filter-mode
|
||||
:webview-debug webview-debug
|
||||
:chaos-mode? chaos-mode?})
|
||||
:key-fn (fn [_ i] (str i))
|
||||
:render-fn render-item}]]))
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
input-with-mentions)]]))
|
||||
|
||||
(defn mention-item
|
||||
[[_ {:keys [identicon alias name nickname] :as user}]]
|
||||
[text-input-ref [_ {:keys [identicon alias name nickname] :as user}]]
|
||||
(let [ens-name? (not= alias name)]
|
||||
[list-item/list-item
|
||||
(cond-> {:icon
|
||||
@@ -233,14 +233,14 @@
|
||||
:title-text-weight :medium
|
||||
:on-press
|
||||
(fn []
|
||||
(re-frame/dispatch [:chat.ui/select-mention user]))}
|
||||
(re-frame/dispatch [:chat.ui/select-mention text-input-ref user]))}
|
||||
|
||||
ens-name?
|
||||
(assoc :subtitle alias))]))
|
||||
|
||||
(def chat-input-height (reagent/atom nil))
|
||||
|
||||
(defn autocomplete-mentions []
|
||||
(defn autocomplete-mentions [text-input-ref]
|
||||
(let [suggestions @(re-frame/subscribe [:chat/mention-suggestions])]
|
||||
(when (and (seq suggestions) @chat-input-height)
|
||||
(let [height (+ 16 (* 52 (min 4.5 (count suggestions))))]
|
||||
@@ -254,7 +254,7 @@
|
||||
:header [rn/view {:style {:height 8}}]
|
||||
:data suggestions
|
||||
:key-fn first
|
||||
:render-fn #(mention-item %)}]]]))))
|
||||
:render-fn #(mention-item text-input-ref %)}]]]))))
|
||||
|
||||
(defn chat-input
|
||||
[{:keys [set-active-panel active-panel on-send-press reply
|
||||
|
||||
@@ -19,12 +19,11 @@
|
||||
(i18n/label :t/join-group-chat)])
|
||||
|
||||
(defn decline-chat [chat-id]
|
||||
[react/touchable-highlight
|
||||
{:on-press
|
||||
#(debounce/dispatch-and-chill [:group-chats.ui/leave-chat-confirmed chat-id] 2000)
|
||||
:accessibility-label :decline-chat-button}
|
||||
[react/text {:style style/decline-chat}
|
||||
(i18n/label :t/group-chat-decline-invitation)]])
|
||||
[quo/button
|
||||
{:type :secondary
|
||||
:accessibility-label :decline-chat-button
|
||||
:on-press #(debounce/dispatch-and-chill [:group-chats.ui/leave-chat-confirmed chat-id] 2000)}
|
||||
(i18n/label :t/group-chat-decline-invitation)])
|
||||
|
||||
(defn request-membership [{:keys [state introduction-message] :as invitation}]
|
||||
(let [{:keys [message retry?]} @(re-frame/subscribe [:chats/current-chat-membership])]
|
||||
@@ -64,10 +63,11 @@
|
||||
(defview group-chat-footer
|
||||
[chat-id invitation-admin]
|
||||
(letsubs [{:keys [joined?]} [:group-chat/inviter-info chat-id]
|
||||
removed? [:group-chat/removed-from-current-chat?]
|
||||
invitations [:group-chat/invitations-by-chat-id chat-id]]
|
||||
(if invitation-admin
|
||||
[request-membership (first invitations)]
|
||||
(when-not joined?
|
||||
(when (and (not joined?) (not removed?))
|
||||
[react/view {:style style/group-chat-join-footer}
|
||||
[react/view {:style style/group-chat-join-container}
|
||||
[join-chat-button chat-id]
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
from
|
||||
contact-name
|
||||
current-public-key
|
||||
(partial style/quoted-message-author outgoing)]]
|
||||
(partial style/quoted-message-author outgoing)
|
||||
outgoing]]
|
||||
(if (and image
|
||||
;; Disabling images for public-chats
|
||||
(not public?))
|
||||
|
||||
@@ -104,13 +104,10 @@
|
||||
|
||||
(def group-chat-join-container
|
||||
{:flex 1
|
||||
:padding-bottom 40
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
|
||||
(def decline-chat
|
||||
{:color colors/blue
|
||||
:margin-bottom 40})
|
||||
|
||||
(def are-you-friends-bubble
|
||||
{:border-radius 8
|
||||
:border-width 1
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
:font-weight "400"}}
|
||||
first-name]))))
|
||||
|
||||
(defn format-reply-author [from username current-public-key style]
|
||||
(defn format-reply-author [from username current-public-key style outgoing]
|
||||
(let [contact-name (str reply-symbol username)]
|
||||
(or (and (= from current-public-key)
|
||||
[react/text {:style (style true)}
|
||||
@@ -43,7 +43,9 @@
|
||||
:line-height 18
|
||||
:font-weight "500"})}
|
||||
(or (stateofus/username trimmed-name) trimmed-name)])
|
||||
[react/text {:style (merge {:color colors/gray
|
||||
[react/text {:style (merge {:color (if outgoing
|
||||
colors/white-transparent-70-persist
|
||||
colors/gray)
|
||||
:font-size 12
|
||||
:line-height 18
|
||||
:font-weight "400"})}
|
||||
|
||||
@@ -301,7 +301,7 @@
|
||||
;; :always doesn't work and keyboard is hidden on pressing suggestion.
|
||||
;; Scrolling of suggestions doesn't work neither in this case.
|
||||
(when platform/android?
|
||||
[components/autocomplete-mentions])
|
||||
[components/autocomplete-mentions text-input-ref])
|
||||
(when show-input?
|
||||
[accessory/view {:y position-y
|
||||
:pan-state pan-state
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
[react/view styles/multiaccounts-container
|
||||
[list/flat-list {:data (vals multiaccounts)
|
||||
:contentContainerStyle styles/multiaccounts-list-container
|
||||
:key-fn :address
|
||||
:key-fn (comp str :address)
|
||||
:render-fn multiaccount-view}]]
|
||||
[toolbar/toolbar
|
||||
{:show-border? true
|
||||
|
||||
@@ -5,15 +5,10 @@
|
||||
(def wrapper
|
||||
{:flex 1})
|
||||
|
||||
(def mailserver-item-inner
|
||||
{:padding-horizontal 16})
|
||||
|
||||
(styles/defn mailserver-item [pinned?]
|
||||
(styles/defn mailserver-item []
|
||||
{:flex-direction :row
|
||||
:align-items :center
|
||||
:opacity (if pinned?
|
||||
1
|
||||
0.4)
|
||||
:justify-content :space-between
|
||||
:padding-horizontal 16
|
||||
:ios {:height 64}
|
||||
:android {:height 56}})
|
||||
@@ -31,21 +26,24 @@
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
|
||||
(defn mailserver-icon [connected?]
|
||||
(hash-map :color
|
||||
(if connected? colors/white-persist colors/gray)))
|
||||
(def switch-container
|
||||
{:height 52})
|
||||
|
||||
(def mailserver-pinned
|
||||
{:padding-horizontal 16
|
||||
:flex-direction :row
|
||||
:align-items :center
|
||||
:padding-vertical 5})
|
||||
(def automatic-selection-container
|
||||
{:border-top-width 1
|
||||
:border-top-color colors/gray-lighter
|
||||
:margin-top 16})
|
||||
|
||||
(def mailserver-pinned-checkbox-container
|
||||
{:width 40
|
||||
:height 40
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
(def explanation-text
|
||||
{:color colors/gray})
|
||||
|
||||
(def mailserver-pinned-text-container
|
||||
{:padding-horizontal 15})
|
||||
(def use-history-explanation-text-container
|
||||
{:margin-right 16
|
||||
:margin-left 16
|
||||
:margin-top 8
|
||||
:margin-bottom 16})
|
||||
|
||||
(def history-nodes-label
|
||||
{:color colors/gray
|
||||
:padding-horizontal 16
|
||||
:margin-top 48})
|
||||
|
||||
@@ -2,60 +2,78 @@
|
||||
(:require-macros [status-im.utils.views :as views])
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[status-im.i18n :as i18n]
|
||||
[status-im.ui.components.checkbox.view :as checkbox.views]
|
||||
[status-im.ui.components.icons.vector-icons :as vector-icons]
|
||||
[status-im.ui.components.list.views :as list]
|
||||
[status-im.ui.components.react :as react]
|
||||
[status-im.ui.components.radio :as radio]
|
||||
[status-im.ui.components.colors :as colors]
|
||||
[status-im.ui.screens.offline-messaging-settings.styles :as styles]
|
||||
[status-im.ui.screens.profile.components.views :as profile.components]
|
||||
[status-im.ui.components.topbar :as topbar]))
|
||||
|
||||
(defn- mailserver-icon [connected?]
|
||||
[react/view (styles/mailserver-icon-container connected?)
|
||||
[vector-icons/icon :main-icons/mailserver
|
||||
(styles/mailserver-icon connected?)]])
|
||||
|
||||
(defn pinned-state [pinned?]
|
||||
[react/touchable-highlight {:on-press (if pinned?
|
||||
#(re-frame/dispatch [:mailserver.ui/unpin-pressed])
|
||||
#(re-frame/dispatch [:mailserver.ui/pin-pressed]))}
|
||||
[react/view {:style styles/mailserver-pinned}
|
||||
[checkbox.views/checkbox
|
||||
{:checked? (not pinned?)
|
||||
:style styles/mailserver-pinned-checkbox-container
|
||||
:on-value-change (if pinned?
|
||||
#(re-frame/dispatch [:mailserver.ui/unpin-pressed])
|
||||
#(re-frame/dispatch [:mailserver.ui/pin-pressed]))}]
|
||||
[react/view {:style styles/mailserver-pinned-text-container}
|
||||
[react/text (i18n/label :t/mailserver-automatic)]]]])
|
||||
[react/view {:style styles/automatic-selection-container}
|
||||
[react/view {:style styles/switch-container}
|
||||
[profile.components/settings-switch-item
|
||||
{:label-kw :t/mailserver-automatic
|
||||
:value (not pinned?)
|
||||
:action-fn #(if pinned?
|
||||
(re-frame/dispatch [:mailserver.ui/unpin-pressed])
|
||||
(re-frame/dispatch [:mailserver.ui/pin-pressed]))}]]
|
||||
[react/view {:style {:padding-horizontal 16}}
|
||||
[react/text {:style styles/explanation-text}
|
||||
(i18n/label :t/mailserver-automatic-switch-explanation)]]])
|
||||
|
||||
(defn render-row [current-mailserver-id pinned?]
|
||||
(fn [{:keys [name id user-defined]}]
|
||||
(let [connected? (= id current-mailserver-id)]
|
||||
[react/touchable-highlight
|
||||
{:on-press (when pinned? #(if user-defined
|
||||
(re-frame/dispatch [:mailserver.ui/user-defined-mailserver-selected id])
|
||||
(re-frame/dispatch [:mailserver.ui/default-mailserver-selected id])))
|
||||
:accessibility-label :mailserver-item}
|
||||
[react/view (styles/mailserver-item pinned?)
|
||||
[mailserver-icon connected?]
|
||||
[react/view styles/mailserver-item-inner
|
||||
[react/text {:style styles/mailserver-item-name-text}
|
||||
name]]]])))
|
||||
(let [connected? (= id current-mailserver-id)
|
||||
visible? (or pinned? ; show everything when auto selection is turned off
|
||||
(and (not pinned?) ; auto selection turned on
|
||||
(= current-mailserver-id id) ; show only the selected server
|
||||
))]
|
||||
(when visible?
|
||||
[react/touchable-highlight
|
||||
{:on-press (when pinned? #(if user-defined
|
||||
(re-frame/dispatch [:mailserver.ui/user-defined-mailserver-selected id])
|
||||
(re-frame/dispatch [:mailserver.ui/default-mailserver-selected id])))
|
||||
:accessibility-label :mailserver-item}
|
||||
[react/view (styles/mailserver-item)
|
||||
[react/text {:style styles/mailserver-item-name-text}
|
||||
name]
|
||||
|
||||
(if pinned?
|
||||
[radio/radio connected?]
|
||||
[vector-icons/icon :check {:color colors/blue}])]]))))
|
||||
|
||||
(views/defview offline-messaging-settings []
|
||||
(views/letsubs [current-mailserver-id [:mailserver/current-id]
|
||||
preferred-mailserver-id [:mailserver/preferred-id]
|
||||
mailservers [:mailserver/fleet-mailservers]]
|
||||
[react/view {:flex 1}
|
||||
(views/letsubs [current-mailserver-id [:mailserver/current-id]
|
||||
preferred-mailserver-id [:mailserver/preferred-id]
|
||||
mailservers [:mailserver/fleet-mailservers]
|
||||
{:keys [use-mailservers?]} [:multiaccount]]
|
||||
[react/view {:style styles/wrapper}
|
||||
[topbar/topbar
|
||||
{:title (i18n/label :t/offline-messaging-settings)
|
||||
{:title (i18n/label :t/offline-messaging-settings)
|
||||
:right-accessories
|
||||
[{:icon :main-icons/add
|
||||
[{:icon :main-icons/add-circle
|
||||
:on-press #(re-frame/dispatch [:mailserver.ui/add-pressed])}]}]
|
||||
[react/view styles/wrapper
|
||||
[pinned-state preferred-mailserver-id]
|
||||
[list/flat-list {:data (vals mailservers)
|
||||
:default-separator? false
|
||||
:key-fn :name
|
||||
:render-fn (render-row current-mailserver-id
|
||||
preferred-mailserver-id)}]]]))
|
||||
|
||||
[react/view {:style styles/switch-container}
|
||||
[profile.components/settings-switch-item
|
||||
{:label-kw :t/offline-messaging-use-history-nodes
|
||||
:value use-mailservers?
|
||||
:action-fn #(re-frame/dispatch [:mailserver.ui/use-history-switch-pressed (not use-mailservers?)])}]]
|
||||
[react/view {:style styles/use-history-explanation-text-container}
|
||||
[react/text {:style styles/explanation-text}
|
||||
(i18n/label :t/offline-messaging-use-history-explanation)]]
|
||||
|
||||
(when use-mailservers?
|
||||
[:<>
|
||||
[pinned-state preferred-mailserver-id]
|
||||
|
||||
[react/text {:style styles/history-nodes-label}
|
||||
(i18n/label :t/history-nodes)]
|
||||
[list/flat-list {:data (vals mailservers)
|
||||
:default-separator? false
|
||||
:key-fn :name
|
||||
:render-fn (render-row current-mailserver-id
|
||||
preferred-mailserver-id)}]])]))
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
(re-frame/dispatch
|
||||
[::delete-profile/delete-profile @password])
|
||||
(reset! password nil))
|
||||
:theme :negative
|
||||
:theme :negative
|
||||
:accessibility-label :delete-profile-confirm
|
||||
:disabled ((complement valid-password?) @password)}
|
||||
(i18n/label :t/delete-profile)]]])]]))))
|
||||
|
||||
@@ -195,16 +195,16 @@
|
||||
:subtitle second-name})}
|
||||
|
||||
[react/view {:padding-top 12}
|
||||
(for [{:keys [label subtext accessibility-label icon action disabled?]} (actions contact)]
|
||||
(for [{:keys [label subtext accessibility-label icon action disabled?]} (actions contact)
|
||||
:when label]
|
||||
^{:key label}
|
||||
(when label
|
||||
[quo/list-item {:theme :accent
|
||||
:title label
|
||||
:subtitle subtext
|
||||
:icon icon
|
||||
:accessibility-label accessibility-label
|
||||
:disabled disabled?
|
||||
:on-press action}]))]
|
||||
[quo/list-item {:theme :accent
|
||||
:title label
|
||||
:subtitle subtext
|
||||
:icon icon
|
||||
:accessibility-label accessibility-label
|
||||
:disabled disabled?
|
||||
:on-press action}])]
|
||||
[react/view styles/contact-profile-details-container
|
||||
[profile-details contact]
|
||||
[chat-settings contact]]
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
[status-im.ui.screens.routing.intro-login-stack :as intro-login-stack]
|
||||
[status-im.ui.screens.routing.chat-stack :as chat-stack]
|
||||
[status-im.ui.screens.routing.wallet-stack :as wallet-stack]
|
||||
[status-im.ui.screens.wallet.events :as wallet.events]
|
||||
[status-im.ui.screens.group.views :as group-chat]
|
||||
[status-im.ui.screens.group.events :as group.events]
|
||||
[status-im.ui.screens.routing.profile-stack :as profile-stack]
|
||||
@@ -43,7 +42,6 @@
|
||||
:insets {:top false}
|
||||
:component browser-stack/browser-stack}
|
||||
{:name :wallet-stack
|
||||
:on-focus [::wallet.events/wallet-stack]
|
||||
:insets {:top false}
|
||||
:component wallet-stack/wallet-stack}
|
||||
{:name :profile-stack
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
(ns status-im.ui.screens.routing.wallet-stack
|
||||
(:require [status-im.ui.screens.currency-settings.views :as currency-settings]
|
||||
[status-im.ui.screens.wallet.collectibles.views :as collectibles]
|
||||
[status-im.ui.screens.wallet.settings.views :as wallet-settings]
|
||||
[status-im.ui.screens.wallet.transactions.views :as wallet-transactions]
|
||||
[status-im.ui.screens.wallet.custom-tokens.views :as custom-tokens]
|
||||
@@ -29,8 +28,6 @@
|
||||
:component add-account/pin}
|
||||
{:name :account-settings
|
||||
:component account-settings/account-settings}
|
||||
{:name :collectibles-list
|
||||
:component collectibles/collectibles-list}
|
||||
{:name :wallet-transaction-details
|
||||
:component wallet-transactions/transaction-details}
|
||||
{:name :wallet-settings-assets
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
[status-im.ui.components.topbar :as topbar]))
|
||||
|
||||
(views/defview sync-settings []
|
||||
(views/letsubs [{:keys [syncing-on-mobile-network?]} [:multiaccount]
|
||||
(views/letsubs [{:keys [syncing-on-mobile-network?
|
||||
use-mailservers?]} [:multiaccount]
|
||||
mailserver-id [:mailserver/current-id]]
|
||||
[react/view {:style {:flex 1 :background-color colors/white}}
|
||||
[topbar/topbar {:title (i18n/label :t/sync-settings)}]
|
||||
@@ -28,7 +29,7 @@
|
||||
:title (i18n/label :t/offline-messaging)
|
||||
:on-press #(re-frame/dispatch [:navigate-to :offline-messaging-settings])
|
||||
:accessory :text
|
||||
:accessory-text mailserver-id
|
||||
:accessory-text (when use-mailservers? mailserver-id)
|
||||
:chevron true}]
|
||||
;; TODO(Ferossgp): Devider componemt
|
||||
[react/view {:height 1
|
||||
|
||||
@@ -15,11 +15,6 @@
|
||||
[status-im.ui.screens.multiaccounts.recover.views :as recover.views]
|
||||
[status-im.ui.screens.wallet.send.views :as wallet]
|
||||
[status-im.ui.components.status-bar.view :as statusbar]
|
||||
status-im.ui.screens.wallet.collectibles.etheremon.views
|
||||
status-im.ui.screens.wallet.collectibles.cryptostrikers.views
|
||||
status-im.ui.screens.wallet.collectibles.cryptokitties.views
|
||||
status-im.ui.screens.wallet.collectibles.superrare.views
|
||||
status-im.ui.screens.wallet.collectibles.kudos.views
|
||||
[status-im.ui.components.colors :as colors]
|
||||
[status-im.keycard.test-menu :as keycard.test-menu]
|
||||
[quo.core :as quo]
|
||||
|
||||
@@ -80,26 +80,38 @@
|
||||
colors/white-persist
|
||||
#(re-frame/dispatch [:show-popover {:view :share-account :address address}])]]]))
|
||||
|
||||
(defn render-collectible [address]
|
||||
(fn [{:keys [name icon amount] :as collectible}]
|
||||
(let [items-number (money/to-fixed amount)
|
||||
details? (pos? items-number)]
|
||||
[quo/list-item
|
||||
{:title (wallet.utils/display-symbol collectible)
|
||||
:subtitle name
|
||||
:icon [list/item-image icon]
|
||||
:on-press (when details?
|
||||
#(re-frame/dispatch
|
||||
[:show-collectibles-list collectible address]))
|
||||
:chevron :true
|
||||
:accessory :text
|
||||
:accessory-text items-number}])))
|
||||
(defn render-collectible [{:keys [name icon amount] :as collectible}]
|
||||
(let [items-number (money/to-fixed amount)]
|
||||
[quo/list-item
|
||||
{:title (wallet.utils/display-symbol collectible)
|
||||
:subtitle name
|
||||
:icon [list/item-image icon]
|
||||
:accessory :text
|
||||
:accessory-text items-number}]))
|
||||
|
||||
(views/defview transactions [address]
|
||||
(views/letsubs [{:keys [transaction-history-sections]}
|
||||
[:wallet.transactions.history/screen address]]
|
||||
[history/history-list transaction-history-sections address]))
|
||||
|
||||
(defn collectibles-link []
|
||||
[react/touchable-highlight
|
||||
{:on-press #(re-frame/dispatch [:browser.ui/open-url "https://opensea.io/account/"])}
|
||||
[react/view
|
||||
{:style {:flex 1
|
||||
:padding-horizontal 14
|
||||
:flex-direction :row
|
||||
:align-items :center
|
||||
:background-color colors/blue-light
|
||||
:height 52}}
|
||||
[icons/tiny-icon
|
||||
:tiny-icons/tiny-external
|
||||
{:color colors/blue
|
||||
:container-style {:margin-right 5}}]
|
||||
[react/text
|
||||
{:style {:color colors/blue}}
|
||||
(i18n/label :t/check-on-opensea)]]])
|
||||
|
||||
(views/defview assets-and-collections [address]
|
||||
(views/letsubs [{:keys [tokens nfts]} [:wallet/visible-assets-with-values address]
|
||||
currency [:wallet/currency]]
|
||||
@@ -116,14 +128,16 @@
|
||||
:key-fn :name
|
||||
:render-fn (accounts/render-asset (:code currency))}]
|
||||
(= tab :nft)
|
||||
(if (seq nfts)
|
||||
[list/flat-list {:data nfts
|
||||
:default-separator? false
|
||||
:key-fn :name
|
||||
:render-fn (render-collectible address)}]
|
||||
[react/view {:align-items :center :margin-top 32}
|
||||
[react/text {:style {:color colors/gray}}
|
||||
(i18n/label :t/no-collectibles)]])
|
||||
[react/view
|
||||
[collectibles-link]
|
||||
(if (seq nfts)
|
||||
[list/flat-list {:data nfts
|
||||
:default-separator? false
|
||||
:key-fn :name
|
||||
:render-fn render-collectible}]
|
||||
[react/view {:align-items :center :margin-top 32}
|
||||
[react/text {:style {:color colors/gray}}
|
||||
(i18n/label :t/no-collectibles)]])]
|
||||
(= tab :history)
|
||||
[transactions address])])))
|
||||
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
:accessibility-label :wallet-manage-assets
|
||||
:on-press #(hide-sheet-and-dispatch
|
||||
[:navigate-to :wallet-settings-assets])}]
|
||||
[quo/list-item
|
||||
{:theme :accent
|
||||
:title (i18n/label :t/scan-tokens)
|
||||
:icon :main-icons/refresh
|
||||
:accessibility-label :wallet-scan-token
|
||||
:on-press #(hide-sheet-and-dispatch
|
||||
[:wallet/update-balances nil true])}]
|
||||
[quo/list-item
|
||||
{:theme :accent
|
||||
:title (i18n/label :t/set-currency)
|
||||
|
||||
@@ -74,12 +74,14 @@
|
||||
[quo/list-item
|
||||
(merge {:title [quo/text {:weight :medium}
|
||||
[quo/text {:weight :inherit}
|
||||
(str (wallet.utils/format-amount amount decimals)
|
||||
(str (if amount
|
||||
(wallet.utils/format-amount amount decimals)
|
||||
"...")
|
||||
" ")]
|
||||
[quo/text {:color :secondary
|
||||
:weight :inherit}
|
||||
(wallet.utils/display-symbol token)]]
|
||||
:subtitle (str (if value value "0.00") " " currency)
|
||||
:subtitle (str (if value value "...") " " currency)
|
||||
:accessibility-label (str (:symbol token) "-asset-value")
|
||||
:icon (if icon
|
||||
[list/item-image icon]
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
(ns status-im.ui.screens.wallet.collectibles.cryptokitties.views
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[status-im.i18n :as i18n]
|
||||
[status-im.ui.components.react :as react]
|
||||
[status-im.ui.screens.wallet.collectibles.styles :as styles]
|
||||
[status-im.ui.screens.wallet.collectibles.views :as collectibles]
|
||||
[status-im.ui.components.svgimage :as svgimage]
|
||||
[quo.core :as quo]))
|
||||
|
||||
(defmethod collectibles/render-collectible :CK [_ {:keys [id name bio image_url]}]
|
||||
[react/view {:style styles/details}
|
||||
[react/view {:style styles/details-text}
|
||||
[svgimage/svgimage {:style styles/details-image
|
||||
:source {:uri image_url}}]
|
||||
[react/view {:flex 1}
|
||||
[react/text {:style styles/details-name}
|
||||
(or name (i18n/label :t/cryptokitty-name {:id id}))]
|
||||
[react/text {:number-of-lines 3
|
||||
:ellipsize-mode :tail}
|
||||
bio]]]
|
||||
[quo/list-item
|
||||
{:theme :accent
|
||||
:title (i18n/label :t/view-cryptokitties)
|
||||
:icon :main-icons/address
|
||||
:accessibility-label :open-collectible-button
|
||||
:on-press #(re-frame/dispatch [:open-collectible-in-browser
|
||||
(str "https://www.cryptokitties.co/kitty/" id)])}]])
|
||||
@@ -1,26 +0,0 @@
|
||||
(ns status-im.ui.screens.wallet.collectibles.cryptostrikers.views
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[status-im.ui.components.react :as react]
|
||||
[status-im.ui.screens.wallet.collectibles.styles :as styles]
|
||||
[status-im.ui.components.svgimage :as svgimage]
|
||||
[status-im.ui.screens.wallet.collectibles.views :as collectibles]
|
||||
[status-im.i18n :as i18n]
|
||||
[quo.core :as quo]))
|
||||
|
||||
(defmethod collectibles/render-collectible :STRK [_ {:keys [external_url description name image]}]
|
||||
[react/view {:style styles/details}
|
||||
[react/view {:style styles/details-text}
|
||||
[svgimage/svgimage {:style styles/details-image
|
||||
:source {:uri image
|
||||
:k 1.4}}]
|
||||
[react/view {:flex 1 :justify-content :center}
|
||||
[react/text {:style styles/details-name}
|
||||
name]
|
||||
[react/text
|
||||
description]]]
|
||||
[quo/list-item
|
||||
{:theme :accent
|
||||
:title (i18n/label :t/view-cryptostrikers)
|
||||
:icon :main-icons/address
|
||||
:accessibility-label :open-collectible-button
|
||||
:on-press #(re-frame/dispatch [:open-collectible-in-browser external_url])}]])
|
||||
@@ -1,26 +0,0 @@
|
||||
(ns status-im.ui.screens.wallet.collectibles.etheremon.views
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[status-im.ui.components.react :as react]
|
||||
[status-im.ui.screens.wallet.collectibles.styles :as styles]
|
||||
[status-im.ui.components.svgimage :as svgimage]
|
||||
[status-im.ui.screens.wallet.collectibles.views :as collectibles]
|
||||
[status-im.i18n :as i18n]
|
||||
[quo.core :as quo]))
|
||||
|
||||
(defmethod collectibles/render-collectible :EMONA [_ {:keys [user_defined_name image class_id]}]
|
||||
[react/view {:style styles/details}
|
||||
[react/view {:style styles/details-text}
|
||||
[react/view {:flex 1}
|
||||
[svgimage/svgimage {:style styles/details-image
|
||||
:source {:uri image
|
||||
:k 2}}]]
|
||||
[react/view {:flex 1 :justify-content :center}
|
||||
[react/text {:style styles/details-name}
|
||||
user_defined_name]]]
|
||||
[quo/list-item
|
||||
{:theme :accent
|
||||
:title (i18n/label :t/view-etheremon)
|
||||
:icon :main-icons/address
|
||||
:accessibility-label :open-collectible-button
|
||||
:on-press #(re-frame/dispatch [:open-collectible-in-browser
|
||||
(str "https://www.etheremon.com/#/mons/" class_id)])}]])
|
||||
@@ -1,26 +0,0 @@
|
||||
(ns status-im.ui.screens.wallet.collectibles.kudos.views
|
||||
(:require [status-im.ui.screens.wallet.collectibles.views :as collectibles]
|
||||
[status-im.ui.components.react :as react]
|
||||
[status-im.ui.screens.wallet.collectibles.styles :as styles]
|
||||
[status-im.ui.components.svgimage :as svgimage]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.i18n :as i18n]
|
||||
[quo.core :as quo]))
|
||||
|
||||
(defmethod collectibles/render-collectible :KDO [_ {:keys [external_url description name image]}]
|
||||
[react/view {:style styles/details}
|
||||
[react/view {:style styles/details-text}
|
||||
[svgimage/svgimage {:style styles/details-image
|
||||
:source {:uri image
|
||||
:k 1.4}}]
|
||||
[react/view {:flex 1 :justify-content :center}
|
||||
[react/text {:style styles/details-name}
|
||||
name]
|
||||
[react/text
|
||||
description]]]
|
||||
[quo/list-item
|
||||
{:theme :accent
|
||||
:title (i18n/label :t/view-gitcoin)
|
||||
:icon :main-icons/address
|
||||
:accessibility-label :open-collectible-button
|
||||
:on-press #(re-frame/dispatch [:open-collectible-in-browser external_url])}]])
|
||||
@@ -1,27 +0,0 @@
|
||||
(ns status-im.ui.screens.wallet.collectibles.styles)
|
||||
|
||||
(def default-collectible
|
||||
{:padding-left 10
|
||||
:padding-vertical 20})
|
||||
|
||||
(def loading-indicator
|
||||
{:flex 1
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
|
||||
(def details
|
||||
{:padding-vertical 10})
|
||||
|
||||
(def details-text
|
||||
{:flex 1
|
||||
:flex-direction :row
|
||||
:align-items :center
|
||||
:padding-horizontal 16})
|
||||
|
||||
(def details-name
|
||||
{:text-align-vertical :center
|
||||
:margin-bottom 10})
|
||||
|
||||
(def details-image
|
||||
{:flex 1
|
||||
:margin 10})
|
||||
@@ -1,26 +0,0 @@
|
||||
(ns status-im.ui.screens.wallet.collectibles.superrare.views
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[status-im.i18n :as i18n]
|
||||
[status-im.ui.components.react :as react]
|
||||
[status-im.ui.screens.wallet.collectibles.styles :as styles]
|
||||
[status-im.ui.screens.wallet.collectibles.views :as collectibles]
|
||||
[quo.core :as quo]))
|
||||
|
||||
(defmethod collectibles/render-collectible :SUPR [_ {tokenId :tokenId {:keys [description name imageUri]} :metadata}]
|
||||
[react/view {:style styles/details}
|
||||
[react/view {:style styles/details-text}
|
||||
[react/image {:style (merge {:resize-mode :contain :width 100 :height 100} styles/details-image)
|
||||
:source {:uri imageUri
|
||||
:k 1.4}}]
|
||||
[react/view {:flex 1 :justify-content :center}
|
||||
[react/text {:style styles/details-name}
|
||||
name]
|
||||
[react/text
|
||||
description]]]
|
||||
[quo/list-item
|
||||
{:theme :accent
|
||||
:title (i18n/label :t/view-superrare)
|
||||
:icon :main-icons/address
|
||||
:accessibility-label :open-collectible-button
|
||||
:on-press #(re-frame/dispatch [:open-collectible-in-browser
|
||||
(str "https://superrare.co/artwork/" name "-" tokenId)])}]])
|
||||
@@ -1,34 +0,0 @@
|
||||
(ns status-im.ui.screens.wallet.collectibles.views
|
||||
(:require-macros [status-im.utils.views :refer [defview letsubs]])
|
||||
(:require [status-im.i18n :as i18n]
|
||||
[status-im.ui.components.colors :as colors]
|
||||
[status-im.ui.components.list.views :as list]
|
||||
[status-im.ui.components.react :as react]
|
||||
[status-im.ui.components.styles :as component.styles]
|
||||
[status-im.ui.screens.wallet.collectibles.styles :as styles]
|
||||
[status-im.ui.components.topbar :as topbar]))
|
||||
|
||||
(defmulti render-collectible (fn [symbol _] symbol))
|
||||
|
||||
(defmethod render-collectible :default [symbol {:keys [id name]}]
|
||||
[react/view {:style styles/default-collectible}
|
||||
[react/text (str (clojure.core/name symbol) " #" (or id name))]])
|
||||
|
||||
(defview collectibles-list []
|
||||
(letsubs [{:keys [name symbol]} [:get-screen-params]
|
||||
collectibles [:screen-collectibles]]
|
||||
[react/view {:style component.styles/flex}
|
||||
[topbar/topbar {:title name}]
|
||||
(cond
|
||||
(nil? collectibles)
|
||||
[react/view {:style styles/loading-indicator}
|
||||
[react/activity-indicator {:animating true :size :large :color colors/blue}]]
|
||||
(seq collectibles)
|
||||
[list/flat-list {:data collectibles
|
||||
:key-fn (comp str :id)
|
||||
:render-fn #(render-collectible symbol %)}]
|
||||
:else
|
||||
;; Should never happen. Less confusing to debug new NFT support.
|
||||
[react/view {:style styles/loading-indicator}
|
||||
[react/text (i18n/label :t/error)]])]))
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
(ns status-im.ui.screens.wallet.events
|
||||
(:require [status-im.ui.screens.wallet.signing-phrase.views :as signing-phrase]
|
||||
[status-im.utils.handlers :as handlers]))
|
||||
[status-im.utils.handlers :as handlers]
|
||||
[status-im.utils.fx :as fx]))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
::wallet-stack
|
||||
(fn [{:keys [db]}]
|
||||
(let [wallet-set-up-passed? (get-in db [:multiaccount :wallet-set-up-passed?])
|
||||
sign-phrase-showed? (get db :wallet/sign-phrase-showed?)]
|
||||
{:dispatch [:wallet.ui/pull-to-refresh] ;TODO temporary simple fix for v1
|
||||
:db (if (or wallet-set-up-passed? sign-phrase-showed?)
|
||||
db
|
||||
(assoc db :popover/popover {:view [signing-phrase/signing-phrase]}
|
||||
:wallet/sign-phrase-showed? true))})))
|
||||
(fx/defn wallet-will-focus
|
||||
{:events [::wallet-stack]}
|
||||
[{:keys [db]}]
|
||||
(let [wallet-set-up-passed? (get-in db [:multiaccount :wallet-set-up-passed?])
|
||||
sign-phrase-showed? (get db :wallet/sign-phrase-showed?)]
|
||||
{:dispatch [:wallet.ui/pull-to-refresh] ;TODO temporary simple fix for v1
|
||||
:db (if (or wallet-set-up-passed? sign-phrase-showed?)
|
||||
db
|
||||
(assoc db :popover/popover {:view [signing-phrase/signing-phrase]}
|
||||
:wallet/sign-phrase-showed? true))}))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
::wallet-add-custom-token
|
||||
|
||||
@@ -89,7 +89,6 @@
|
||||
:subtitle second-name
|
||||
:on-press #(do
|
||||
(some-> ^js @scroll-view-ref (.scrollTo #js {:x 0 :animated true}))
|
||||
(re-frame/dispatch [:wallet.recipient/focus-input])
|
||||
(re-frame/dispatch [:wallet.recipient/address-changed name]))
|
||||
:icon [chat-icon/contact-icon-contacts-tab
|
||||
(multiaccounts/displayed-photo contact)]}]))
|
||||
@@ -119,9 +118,7 @@
|
||||
[quo/list-item
|
||||
{:title [quo/text {:monospace true}
|
||||
(utils/get-shortened-checksum-address address)]
|
||||
:on-press #(do
|
||||
(re-frame/dispatch [:wallet.recipient/focus-input])
|
||||
(re-frame/dispatch [:wallet.recipient/address-changed address]))
|
||||
:on-press #(re-frame/dispatch [:wallet.recipient/address-changed address])
|
||||
:size :small
|
||||
:accessory [react/text {:style {:flex-shrink 1
|
||||
:color colors/gray}}
|
||||
@@ -227,15 +224,17 @@
|
||||
:align-items :center :height 40 :margin-vertical 8}
|
||||
[quo/text (i18n/label :t/address-or-ens-name)]]
|
||||
[quo/text-input
|
||||
{:multiline true
|
||||
:default-value resolved-address
|
||||
:height 70
|
||||
:editable false}]]
|
||||
{:multiline true
|
||||
:default-value resolved-address
|
||||
:height 70
|
||||
:editable false
|
||||
:accessibility-label :fav-address}]]
|
||||
[react/view {:height 16}]
|
||||
[quo/list-header (i18n/label :t/name-optional)]
|
||||
[react/view {:padding-horizontal 16}
|
||||
[quo/text-input {:show-cancel false
|
||||
:on-change-text #(reset! fav-name %)}]]]
|
||||
[quo/text-input {:show-cancel false
|
||||
:accessibility-label :fav-name
|
||||
:on-change-text #(reset! fav-name %)}]]]
|
||||
[toolbar/toolbar
|
||||
{:show-border? true
|
||||
:center
|
||||
@@ -246,9 +245,8 @@
|
||||
(i18n/label :t/add)]}]]]))
|
||||
|
||||
(views/defview recipient []
|
||||
(views/letsubs [{:keys [address resolved-address searching] :as recip} [:wallet/recipient]
|
||||
search-filter [:search/recipient-filter]
|
||||
input-focused? (reagent/atom false)]
|
||||
(views/letsubs [{:keys [address resolved-address searching]} [:wallet/recipient]
|
||||
search-filter [:search/recipient-filter]]
|
||||
(let [disabled? (or searching (not resolved-address))]
|
||||
[kb-presentation/keyboard-avoiding-view {:style {:flex 1}}
|
||||
[react/view {:flex 1}
|
||||
@@ -268,10 +266,6 @@
|
||||
(i18n/label :t/paste)]]
|
||||
[quo/text-input
|
||||
{:multiline true
|
||||
:get-ref #(when (and recip %)
|
||||
(re-frame/dispatch [:set-in [:wallet/recipient :inp-ref] %]))
|
||||
:on-focus #(reset! input-focused? true)
|
||||
:on-blur #(reset! input-focused? false)
|
||||
:default-value address
|
||||
:height 70
|
||||
:placeholder (i18n/label :t/recipient-code-placeholder)
|
||||
@@ -295,21 +289,20 @@
|
||||
:color :inherit}
|
||||
(utils/get-shortened-address resolved-address)]]))]
|
||||
[accordion search-filter]]]
|
||||
(when @input-focused?
|
||||
[toolbar/toolbar
|
||||
{:show-border? true
|
||||
:left
|
||||
[quo/button
|
||||
{:accessibility-label :participant-add-to-favs
|
||||
:type :secondary
|
||||
:disabled disabled?
|
||||
:on-press #(re-frame/dispatch [:navigate-to :new-favourite])}
|
||||
(i18n/label :t/add-to-favourites)]
|
||||
:right
|
||||
[quo/button
|
||||
{:accessibility-label :participant-done
|
||||
:type :secondary
|
||||
:after :main-icons/next
|
||||
:disabled disabled?
|
||||
:on-press #(re-frame/dispatch [:wallet.send/set-recipient resolved-address])}
|
||||
(i18n/label :t/done)]}])]])))
|
||||
[toolbar/toolbar
|
||||
{:show-border? true
|
||||
:left
|
||||
[quo/button
|
||||
{:accessibility-label :participant-add-to-favs
|
||||
:type :secondary
|
||||
:disabled disabled?
|
||||
:on-press #(re-frame/dispatch [:navigate-to :new-favourite])}
|
||||
(i18n/label :t/add-to-favourites)]
|
||||
:right
|
||||
[quo/button
|
||||
{:accessibility-label :participant-done
|
||||
:type :secondary
|
||||
:after :main-icons/next
|
||||
:disabled disabled?
|
||||
:on-press #(re-frame/dispatch [:wallet.send/set-recipient resolved-address])}
|
||||
(i18n/label :t/done)]}]]])))
|
||||
@@ -17,7 +17,7 @@
|
||||
;; NOTE(oskarth): Feature flag deprecation lifecycles. We want to make sure
|
||||
;; flags stay up to date and are removed once behavior introduced is stable.
|
||||
|
||||
(goog-define INFURA_TOKEN "40ec14d9d9384d52b7fbcfecdde4e2c0")
|
||||
(goog-define INFURA_TOKEN "d3633f237cbd4649a639067d1807584c")
|
||||
|
||||
(def bootnodes-settings-enabled? (enabled? (get-config :BOOTNODES_SETTINGS_ENABLED "1")))
|
||||
(def rpc-networks-only? (enabled? (get-config :RPC_NETWORKS_ONLY "1")))
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
(ns status-im.utils.platform
|
||||
(:require [status-im.ios.platform :as ios]
|
||||
["react-native" :as react-native]))
|
||||
(:require ["react-native" :as react-native :refer (Dimensions)]))
|
||||
|
||||
(def platform
|
||||
(.-Platform react-native))
|
||||
@@ -13,9 +12,19 @@
|
||||
(when platform
|
||||
(.-Version ^js platform)))
|
||||
|
||||
;; iPhone X dimensions
|
||||
(def x-height 812)
|
||||
(def xs-height 896)
|
||||
|
||||
(defn iphone-x-dimensions? []
|
||||
(let [{:keys [height]} (-> Dimensions
|
||||
(.get "window")
|
||||
(js->clj :keywordize-keys true))]
|
||||
(or (= height x-height) (= height xs-height))))
|
||||
|
||||
(def android? (= os "android"))
|
||||
(def ios? (= os "ios"))
|
||||
(def iphone-x? (and ios? (ios/iphone-x-dimensions?)))
|
||||
(def iphone-x? (and ios? (iphone-x-dimensions?)))
|
||||
|
||||
(defn no-backup-directory []
|
||||
(cond
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
(fx/merge cofx
|
||||
{:db (update-in db [:add-account :account] merge account)}
|
||||
(save-new-account)
|
||||
(wallet/update-balances nil)
|
||||
(wallet/update-balances nil true)
|
||||
(prices/update-prices)
|
||||
(navigation/navigate-back)))))
|
||||
|
||||
|
||||
@@ -81,9 +81,7 @@
|
||||
(if address
|
||||
(if (:wallet/recipient db)
|
||||
{:db (update db :wallet/recipient assoc :resolved-address address
|
||||
:address address)
|
||||
;;android
|
||||
:dispatch-later [{:ms 1000 :dispatch [:wallet.recipient/focus-input]}]}
|
||||
:address address)}
|
||||
(if (:wallet/prepare-transaction db)
|
||||
{:db (update db :wallet/prepare-transaction assoc
|
||||
:to address :to-name (find-address-name db address))}
|
||||
|
||||
@@ -1,197 +0,0 @@
|
||||
(ns status-im.wallet.collectibles.core
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[status-im.browser.core :as browser]
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.ethereum.erc721 :as erc721]
|
||||
[status-im.ethereum.tokens :as tokens]
|
||||
[status-im.utils.handlers :as handlers]
|
||||
[status-im.utils.money :as money]
|
||||
[status-im.utils.http :as http]
|
||||
[clojure.string :as string]
|
||||
[status-im.utils.types :as types]))
|
||||
|
||||
;;TODO: REPLACE ALL HANDLERS BY FX/DEFN
|
||||
|
||||
(defmulti load-collectible-fx (fn [_ symbol _] symbol))
|
||||
|
||||
(defmethod load-collectible-fx :default [_ _ _] nil)
|
||||
|
||||
(defmulti load-collectibles-fx (fn [_ symbol _ _ _] symbol))
|
||||
|
||||
(defmethod load-collectibles-fx :default [all-tokens symbol items-number address]
|
||||
{:load-collectibles-fx [all-tokens symbol items-number address]})
|
||||
|
||||
(defn load-token [i items-number contract address symbol]
|
||||
(when (< i items-number)
|
||||
(erc721/token-of-owner-by-index contract address i
|
||||
(fn [response]
|
||||
(load-token (inc i) items-number contract address symbol)
|
||||
(re-frame/dispatch [:load-collectible symbol response])))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
:load-collectibles-fx
|
||||
(fn [[all-tokens symbol items-number address]]
|
||||
(let [contract (:address (tokens/symbol->token all-tokens symbol))]
|
||||
(load-token 0 items-number contract address symbol))))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:show-collectibles-list
|
||||
(fn [{:keys [db]} [_ {:keys [symbol amount] :as collectible} address]]
|
||||
(let [all-tokens (:wallet/all-tokens db)
|
||||
items-number (money/to-number amount)
|
||||
loaded-items-number (count (get-in db [:collectibles symbol]))]
|
||||
(merge (when (not= items-number loaded-items-number)
|
||||
(load-collectibles-fx all-tokens symbol items-number address))
|
||||
{:dispatch [:navigate-to :collectibles-list collectible]}))))
|
||||
|
||||
;; Crypto Kitties
|
||||
(def ck :CK)
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:load-kitties
|
||||
(fn [{db :db} [_ ids]]
|
||||
{:db (update-in db [:collectibles] merge {ck (sorted-map-by >)})
|
||||
:http-get-n (mapv (fn [id]
|
||||
{:url (str "https://api.cryptokitties.co/kitties/" id)
|
||||
:on-success (fn [o]
|
||||
(re-frame/dispatch [:load-collectible-success ck {id (http/parse-payload o)}]))
|
||||
:on-error (fn [o]
|
||||
(re-frame/dispatch [:load-collectible-failure ck {id (http/parse-payload o)}]))})
|
||||
ids)}))
|
||||
|
||||
(defmethod load-collectibles-fx ck [_ _ items-number address _]
|
||||
{:http-get-n (mapv (fn [offset]
|
||||
{:url (str "https://api.cryptokitties.co/kitties?limit=20&offset="
|
||||
offset
|
||||
"&owner_wallet_address="
|
||||
address
|
||||
"&parents=false")
|
||||
:on-success (fn [o]
|
||||
(re-frame/dispatch [:load-kitties (map :id (:kitties (http/parse-payload o)))]))
|
||||
:on-error (fn [o]
|
||||
(re-frame/dispatch [:load-collectibles-failure (http/parse-payload o)]))
|
||||
:timeout-ms 10000})
|
||||
(range 0 items-number 20))}) ;; Cryptokitties API limited to 20 items per request
|
||||
|
||||
;; Crypto Strikers
|
||||
(def strikers :STRK)
|
||||
|
||||
(defmethod load-collectible-fx strikers [_ _ id]
|
||||
{:http-get {:url (str "https://us-central1-cryptostrikers-prod.cloudfunctions.net/cards/" id)
|
||||
:on-success (fn [o]
|
||||
(re-frame/dispatch [:load-collectible-success strikers {id (http/parse-payload o)}]))
|
||||
:on-error (fn [o]
|
||||
(re-frame/dispatch [:load-collectible-failure strikers {id (http/parse-payload o)}]))}})
|
||||
|
||||
;;Etheremona
|
||||
(def emona :EMONA)
|
||||
|
||||
(defmethod load-collectible-fx emona [_ _ id]
|
||||
{:http-get {:url (str "https://www.etheremon.com/api/monster/get_data?monster_ids=" id)
|
||||
:on-success (fn [o]
|
||||
(re-frame/dispatch [:load-collectible-success emona (:data (http/parse-payload o))]))
|
||||
:on-error (fn [o]
|
||||
(re-frame/dispatch [:load-collectible-failure emona {id (http/parse-payload o)}]))}})
|
||||
|
||||
;;Kudos
|
||||
(def kudos :KDO)
|
||||
|
||||
(defmethod load-collectible-fx kudos [{db :db} symbol id]
|
||||
{:erc721-token-uri [(:wallet/all-tokens db) symbol id]})
|
||||
|
||||
(re-frame/reg-fx
|
||||
:erc721-token-uri
|
||||
(fn [[all-tokens symbol tokenId]]
|
||||
(let [contract (:address (tokens/symbol->token all-tokens symbol))]
|
||||
(erc721/token-uri contract
|
||||
tokenId
|
||||
#(re-frame/dispatch [:token-uri-success
|
||||
tokenId
|
||||
(when %
|
||||
(subs % (.indexOf ^js % "http")))]))))) ;; extra chars in rinkeby
|
||||
|
||||
;;Superrare
|
||||
(def superrare :SUPR)
|
||||
|
||||
(defmethod load-collectible-fx superrare [_ _ ids]
|
||||
{:http-get-n (mapv (fn [id]
|
||||
{:url id
|
||||
:on-success (fn [o]
|
||||
(re-frame/dispatch [:load-collectible-success superrare {id (http/parse-payload o)}]))
|
||||
:on-error (fn [o]
|
||||
(re-frame/dispatch [:load-collectible-failure superrare {id (http/parse-payload o)}]))})
|
||||
ids)})
|
||||
|
||||
(def graphql-url "https://api.pixura.io/graphql")
|
||||
|
||||
(defn graphql-query [address]
|
||||
(str "{
|
||||
collectiblesByOwner: allErc721Tokens(condition: {owner: \"" address "\"}) {
|
||||
collectibles: nodes {
|
||||
tokenId,
|
||||
metadata: erc721MetadatumByTokenId {
|
||||
metadataUri,
|
||||
description,
|
||||
name,
|
||||
imageUri
|
||||
}}}}"))
|
||||
|
||||
(defmethod load-collectibles-fx superrare [_ _ _ address _]
|
||||
{:http-post {:url graphql-url
|
||||
:data (types/clj->json {:query (graphql-query (ethereum/naked-address address))})
|
||||
:opts {:headers {"Content-Type" "application/json"}}
|
||||
:on-success (fn [{:keys [response-body]}]
|
||||
(re-frame/dispatch [:store-collectibles superrare
|
||||
(get-in (http/parse-payload response-body)
|
||||
[:data :collectiblesByOwner :collectibles])]))
|
||||
:on-error (fn [{:keys [response-body]}]
|
||||
(re-frame/dispatch [:load-collectibles-failure (http/parse-payload response-body)]))
|
||||
:timeout-ms 10000}})
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:token-uri-success
|
||||
(fn [_ [_ tokenId token-uri]]
|
||||
{:http-get {:url
|
||||
token-uri
|
||||
:on-success
|
||||
(fn [o]
|
||||
(re-frame/dispatch [:load-collectible-success kudos
|
||||
{tokenId (update (http/parse-payload o)
|
||||
:image
|
||||
string/replace
|
||||
#"http:"
|
||||
"https:")}])) ;; http in mainnet
|
||||
:on-error
|
||||
(fn [o]
|
||||
(re-frame/dispatch [:load-collectible-failure kudos {tokenId (http/parse-payload o)}]))}}))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:load-collectible
|
||||
(fn [cofx [_ symbol token-id]]
|
||||
(load-collectible-fx cofx symbol token-id)))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:store-collectibles
|
||||
(fn [{db :db} [_ symbol collectibles]]
|
||||
{:db (update-in db [:collectibles symbol] merge
|
||||
(reduce #(assoc %1 (:tokenId %2) %2) {} collectibles))}))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:load-collectible-success
|
||||
(fn [{db :db} [_ symbol collectibles]]
|
||||
{:db (update-in db [:collectibles symbol] merge collectibles)}))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:load-collectibles-failure
|
||||
(fn [{db :db} [_ reason]]
|
||||
{:db (update-in db [:collectibles symbol :errors] merge reason)}))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:load-collectible-failure
|
||||
(fn [{db :db} [_]]
|
||||
{:db db}))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:open-collectible-in-browser
|
||||
(fn [cofx [_ url]]
|
||||
(browser/open-url cofx url)))
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
(defn- validate-token-symbol!
|
||||
[{:keys [address symbol]}]
|
||||
(when-not (= symbol :DCN) ;; ignore this symbol because it has weird symbol
|
||||
(when-not (or (= symbol :DCN) (= symbol :SUPRR)) ;; ignore this symbol because it has weird symbol
|
||||
(json-rpc/eth-call
|
||||
{:contract address
|
||||
:method "symbol()"
|
||||
@@ -203,7 +203,8 @@
|
||||
(let [all-default-tokens (get tokens/all-default-tokens
|
||||
(ethereum/chain-keyword db))
|
||||
default-tokens (utils.core/index-by :address all-default-tokens)
|
||||
all-tokens (merge default-tokens (rpc->token custom-tokens))]
|
||||
;;we want to override custom-tokens by default
|
||||
all-tokens (merge (rpc->token custom-tokens) default-tokens)]
|
||||
(merge
|
||||
{:db (assoc db :wallet/all-tokens all-tokens)}
|
||||
(when config/erc20-contract-warnings-enabled?
|
||||
@@ -217,15 +218,14 @@
|
||||
favourites))})
|
||||
|
||||
(fx/defn update-balances
|
||||
{:events [:wallet/update-balances]}
|
||||
[{{:keys [network-status :wallet/all-tokens
|
||||
multiaccount :multiaccount/accounts] :as db} :db
|
||||
:as cofx} addresses]
|
||||
:as cofx} addresses init?]
|
||||
(let [addresses (or addresses (map (comp string/lower-case :address) accounts))
|
||||
{:keys [:wallet/visible-tokens]} multiaccount
|
||||
chain (ethereum/chain-keyword db)
|
||||
assets (get visible-tokens chain)
|
||||
init? (or (empty? assets)
|
||||
(= assets (constants/default-visible-tokens chain)))
|
||||
tokens (->> (vals all-tokens)
|
||||
(remove #(or (:hidden? %)
|
||||
;;if not init remove not visible tokens
|
||||
@@ -266,12 +266,14 @@
|
||||
[{{:keys [multiaccount] :as db} :db :as cofx} symbol checked?]
|
||||
(let [chain (ethereum/chain-keyword db)
|
||||
visible-tokens (get multiaccount :wallet/visible-tokens)]
|
||||
(multiaccounts.update/multiaccount-update
|
||||
cofx
|
||||
:wallet/visible-tokens (update visible-tokens
|
||||
chain
|
||||
#(set-checked % symbol checked?))
|
||||
{})))
|
||||
(fx/merge cofx
|
||||
(multiaccounts.update/multiaccount-update
|
||||
:wallet/visible-tokens (update visible-tokens
|
||||
chain
|
||||
#(set-checked % symbol checked?))
|
||||
{})
|
||||
#(when checked?
|
||||
(update-balances % nil nil)))))
|
||||
|
||||
(fx/defn toggle-visible-token
|
||||
[cofx symbol checked?]
|
||||
@@ -314,9 +316,7 @@
|
||||
|
||||
(fx/defn add-custom-token
|
||||
[cofx {:keys [symbol]}]
|
||||
(fx/merge cofx
|
||||
(update-toggle-in-settings symbol true)
|
||||
(update-balances nil)))
|
||||
(update-toggle-in-settings cofx symbol true))
|
||||
|
||||
(fx/defn remove-custom-token
|
||||
[cofx {:keys [symbol]}]
|
||||
|
||||
@@ -23,35 +23,14 @@
|
||||
|
||||
(re-frame/reg-fx
|
||||
:wallet.recipient/address-paste
|
||||
(fn [inp-ref]
|
||||
(fn []
|
||||
(react/get-from-clipboard
|
||||
#(do
|
||||
(when inp-ref (.focus inp-ref))
|
||||
(re-frame/dispatch [:wallet.recipient/address-changed (string/trim %)])))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
:wallet.recipient/address-paste
|
||||
(fn [inp-ref]
|
||||
(react/get-from-clipboard
|
||||
#(do
|
||||
(when inp-ref (.focus inp-ref))
|
||||
(re-frame/dispatch [:wallet.recipient/address-changed (string/trim %)])))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
::focus-input
|
||||
(fn [inp-ref]
|
||||
(when inp-ref
|
||||
(.focus inp-ref))))
|
||||
|
||||
(fx/defn focus-input
|
||||
{:events [:wallet.recipient/focus-input]}
|
||||
[{:keys [db]}]
|
||||
{::focus-input (get-in db [:wallet/recipient :inp-ref])})
|
||||
#(re-frame/dispatch [:wallet.recipient/address-changed (string/trim %)]))))
|
||||
|
||||
(fx/defn address-paste-pressed
|
||||
{:events [:wallet.recipient/address-paste-pressed]}
|
||||
[{:keys [db]}]
|
||||
{:wallet.recipient/address-paste (get-in db [:wallet/recipient :inp-ref])})
|
||||
[_]
|
||||
{:wallet.recipient/address-paste nil})
|
||||
|
||||
(fx/defn set-recipient
|
||||
{:events [::recipient-address-resolved]}
|
||||
@@ -77,7 +56,8 @@
|
||||
:number-of-retries 3}))
|
||||
{:ui/show-error (i18n/label :t/wallet-invalid-address-checksum {:data recipient})
|
||||
:db (assoc-in db [:wallet/recipient :searching] false)}))
|
||||
(and (not (string/blank? recipient)) (ens/valid-eth-name-prefix? recipient))
|
||||
(and (not (string/blank? recipient)) (not (string/starts-with? recipient "0x"))
|
||||
(ens/valid-eth-name-prefix? recipient))
|
||||
(let [ens-name (if (= (.indexOf ^js recipient ".") -1)
|
||||
(stateofus/subdomain recipient)
|
||||
recipient)]
|
||||
@@ -112,8 +92,6 @@
|
||||
:name (or name "")}]
|
||||
(fx/merge cofx
|
||||
{:db (assoc-in db [:wallet/favourites address] new-favourite)
|
||||
;;android
|
||||
:dispatch-later [{:ms 1000 :dispatch [:wallet.recipient/focus-input]}]
|
||||
::json-rpc/call [{:method "wallet_addFavourite"
|
||||
:params [new-favourite]
|
||||
:on-success #()}]}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "v0.62.3",
|
||||
"commit-sha1": "397ee840c650b7fd4a414b38e200274d2d1b716c",
|
||||
"src-sha256": "1x6cs06qqbncvlbkw2ch3alkrhf24m966c7jkvvz6rb9fhbxgrgj"
|
||||
"version": "v0.62.11",
|
||||
"commit-sha1": "4ecca1169d2e0a07b4e0cf5a7a3f4044216c678f",
|
||||
"src-sha256": "189igps203m2yf3gcqjrghqnncf7vgl3p3bjcrk5dp2ym00jfr9f"
|
||||
}
|
||||
|
||||
@@ -32,13 +32,19 @@ class NetworkApi(object):
|
||||
return requests.request('GET', url=method, headers=self.headers).json()['result']
|
||||
except TypeError as e:
|
||||
self.log("Check response from etherscan API. Returned values do not match expected. %s" % e)
|
||||
except JSONDecodeError as e:
|
||||
self.log(str(e))
|
||||
pass
|
||||
|
||||
def get_token_transactions(self, address: str) -> List[dict]:
|
||||
method = self.network_url + 'module=account&action=tokentx&address=0x%s&sort=desc&apikey=%s' % (address, self.api_key)
|
||||
try:
|
||||
return requests.request('GET', url=method, headers=self.headers).json()['result']
|
||||
except TypeError as e:
|
||||
self.log("Check response from etherscan API. Returned values do not match expected. %s" % e)
|
||||
self.log("Check response from etherscan API. Returned values do not match expected. %s" % str(e))
|
||||
except JSONDecodeError as e:
|
||||
self.log(str(e))
|
||||
pass
|
||||
|
||||
def is_transaction_successful(self, transaction_hash: str) -> int:
|
||||
method = self.network_url + 'module=transaction&action=getstatus&txhash=%s' % transaction_hash
|
||||
@@ -48,10 +54,13 @@ class NetworkApi(object):
|
||||
method = self.network_url + 'module=account&action=balance&address=0x%s&tag=latest&apikey=%s' % (address , self.api_key)
|
||||
for i in range(5):
|
||||
try:
|
||||
return int(requests.request('GET', method, headers=self.headers).json()["result"])
|
||||
except ValueError:
|
||||
self.log('Trying to get balance for %s, attempt %s' % (address, i + 1))
|
||||
balance = requests.request('GET', method, headers=self.headers).json()["result"]
|
||||
self.log('Balance is %s Gwei' % balance)
|
||||
return int(balance)
|
||||
except JSONDecodeError as e:
|
||||
self.log(str(e))
|
||||
time.sleep(5)
|
||||
pass
|
||||
|
||||
def get_latest_block_number(self) -> int:
|
||||
method = self.network_url + 'module=proxy&action=eth_blockNumber'
|
||||
@@ -129,10 +138,20 @@ class NetworkApi(object):
|
||||
errors.append('Recipients balance is not updated on etherscan')
|
||||
|
||||
def faucet(self, address):
|
||||
return requests.request('GET', '%s/0x%s' % (self.faucet_url, address)).json()
|
||||
try:
|
||||
self.log("Trying to get funds from %s" % self.faucet_url)
|
||||
return requests.request('GET', '%s/0x%s' % (self.faucet_url, address)).json()
|
||||
except JSONDecodeError as e:
|
||||
self.log(str(e))
|
||||
pass
|
||||
|
||||
def faucet_backup(self, address):
|
||||
return requests.request('GET', '%s/0x%s' % (self.faucet_backup_url, address)).json()
|
||||
try:
|
||||
self.log("Trying to get funds from %s" % self.faucet_backup_url)
|
||||
return requests.request('GET', '%s/0x%s' % (self.faucet_backup_url, address)).json()
|
||||
except JSONDecodeError as e:
|
||||
self.log(str(e))
|
||||
pass
|
||||
|
||||
def get_donate(self, address, external_faucet=True, wait_time=300):
|
||||
initial_balance = self.get_balance(address)
|
||||
|
||||
@@ -60,6 +60,7 @@ connection_is_secure_text = "Connection is secure. Make sure you really trust th
|
||||
"before signing transactions or entering personal data."
|
||||
recorded_error = "You have to give permission to send audio messages"
|
||||
|
||||
test_dapp_web_url = "status-im.github.io/dapp"
|
||||
test_dapp_url = 'simpledapp.eth'
|
||||
test_dapp_name = 'simpledapp.eth'
|
||||
|
||||
|
||||
@@ -450,6 +450,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
||||
|
||||
@marks.critical
|
||||
@marks.testrail_id(5419)
|
||||
@marks.flaky
|
||||
def test_logcat_backup_recovery_phrase(self):
|
||||
sign_in_view = SignInView(self.driver)
|
||||
sign_in_view.create_user()
|
||||
@@ -806,15 +807,16 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
|
||||
profile_1.mail_server_address_input.clear()
|
||||
profile_1.mail_server_address_input.set_value(mailserver_address)
|
||||
profile_1.save_button.click()
|
||||
profile_1.mail_server_by_name(server_name).click()
|
||||
profile_1.mail_server_connect_button.click()
|
||||
profile_1.confirm_button.click()
|
||||
if profile_1.element_by_text_part("Error connecting").is_element_displayed(40):
|
||||
profile_1.retry_to_connect_to_mailserver()
|
||||
profile_1.get_back_to_home_view()
|
||||
profile_1.home_button.click()
|
||||
|
||||
# TODO: disabled due to 10065
|
||||
# profile_1.mail_server_by_name(server_name).click()
|
||||
# profile_1.mail_server_connect_button.click()
|
||||
# profile_1.confirm_button.click()
|
||||
# if profile_1.element_by_text_part("Error connecting").is_element_displayed(40):
|
||||
# profile_1.retry_to_connect_to_mailserver()
|
||||
# profile_1.get_back_to_home_view()
|
||||
# profile_1.home_button.click()
|
||||
|
||||
|
||||
# profile_1.just_fyi('start chat with user2 and check that all messages are delivered')
|
||||
# chat_1 = home_1.add_contact(public_key)
|
||||
# message = 'test message'
|
||||
|
||||
@@ -208,6 +208,7 @@ class TestWalletManagement(SingleDeviceTestCase):
|
||||
profile = home_view.profile_button.click()
|
||||
wallet_view = profile.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
wallet_view.scan_tokens()
|
||||
wallet_view.accounts_status_account.click()
|
||||
wallet_view.collectibles_button.click()
|
||||
if not wallet_view.element_by_text('KDO').is_element_displayed():
|
||||
@@ -215,8 +216,10 @@ class TestWalletManagement(SingleDeviceTestCase):
|
||||
if not wallet_view.element_by_text('1').is_element_displayed():
|
||||
self.driver.fail('User collectibles amount does not match')
|
||||
|
||||
# TODO: redo to open with Opensea
|
||||
@marks.testrail_id(5346)
|
||||
@marks.high
|
||||
@marks.skip
|
||||
def test_collectible_from_wallet_opens_in_browser_view(self):
|
||||
passphrase = wallet_users['F']['passphrase']
|
||||
signin_view = SignInView(self.driver)
|
||||
|
||||
@@ -21,7 +21,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
||||
home_1, home_2 = device_1_sign_in.get_home_view(), device_2_sign_in.get_home_view()
|
||||
profile_2 = home_2.profile_button.click()
|
||||
device_2_username = profile_2.default_username_text.text
|
||||
profile_2.switch_network('Mainnet with upstream RPC')
|
||||
profile_2.switch_network()
|
||||
|
||||
chat_2 = home_2.add_contact(sender['public_key'])
|
||||
chat_2.send_message("Hey there!")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user