Browse Source

RAM bundle basic setup

tags/pre-yarn2nix-push
Roman Volosovskyi 2 months ago
parent
commit
c7c7b50281
No account linked to committer's email address
100 changed files with 1031 additions and 507 deletions
  1. 2
    0
      android/app/build.gradle
  2. 0
    1
      clj-rn.conf.edn
  3. 52
    37
      components/src/status_im/ui/components/react.cljs
  4. 1
    1
      ios/StatusIm.xcodeproj/project.pbxproj
  5. 35
    0
      packager/config.js
  6. 415
    0
      packager/modulePaths.js
  7. 25
    24
      react-native/src/desktop/status_im/react_native/js_dependencies.cljs
  8. 29
    25
      react-native/src/mobile/status_im/react_native/js_dependencies.cljs
  9. 1
    1
      scripts/start-react-native.sh
  10. 7
    7
      src/status_im/android/core.cljs
  11. 2
    2
      src/status_im/browser/core.cljs
  12. 1
    1
      src/status_im/chat/commands/impl/transactions.cljs
  13. 1
    1
      src/status_im/chat/models/input.cljs
  14. 10
    1
      src/status_im/chat/models/message.cljs
  15. 8
    2
      src/status_im/constants.cljs
  16. 1
    1
      src/status_im/contact/core.cljs
  17. 1
    1
      src/status_im/contact/db.cljs
  18. 3
    2
      src/status_im/data_store/messages.cljs
  19. 4
    3
      src/status_im/data_store/realm/core.cljs
  20. 1
    1
      src/status_im/data_store/realm/schemas/account/migrations.cljs
  21. 3
    3
      src/status_im/desktop/core.cljs
  22. 3
    3
      src/status_im/dev_server/core.cljs
  23. 11
    11
      src/status_im/ethereum/abi_spec.cljs
  24. 3
    3
      src/status_im/ethereum/core.cljs
  25. 3
    3
      src/status_im/ethereum/eip55.cljs
  26. 24
    6
      src/status_im/ethereum/macros.clj
  27. 7
    5
      src/status_im/ethereum/tokens.cljs
  28. 1
    1
      src/status_im/events.cljs
  29. 5
    5
      src/status_im/extensions/capacities/components.cljs
  30. 6
    4
      src/status_im/extensions/capacities/map.cljs
  31. 2
    2
      src/status_im/group_chats/core.cljs
  32. 27
    27
      src/status_im/hardwallet/card.cljs
  33. 7
    7
      src/status_im/ios/core.cljs
  34. 13
    11
      src/status_im/js_dependencies.cljs
  35. 1
    1
      src/status_im/mailserver/core.cljs
  36. 67
    67
      src/status_im/native_module/impl/module.cljs
  37. 9
    9
      src/status_im/network/net_info.cljs
  38. 1
    1
      src/status_im/notifications/background.cljs
  39. 15
    12
      src/status_im/notifications/core.cljs
  40. 1
    1
      src/status_im/privacy_policy/core.cljs
  41. 25
    17
      src/status_im/react_native/resources.cljs
  42. 1
    1
      src/status_im/transport/message/protocol.cljs
  43. 3
    3
      src/status_im/transport/partitioned_topic.cljs
  44. 4
    4
      src/status_im/transport/utils.cljs
  45. 3
    3
      src/status_im/tribute_to_talk/db.cljs
  46. 8
    8
      src/status_im/ui/components/animation.cljs
  47. 5
    5
      src/status_im/ui/components/bottom_bar/core.cljs
  48. 3
    3
      src/status_im/ui/components/bottom_sheet/view.cljs
  49. 5
    5
      src/status_im/ui/components/camera.cljs
  50. 16
    16
      src/status_im/ui/components/connectivity/view.cljs
  51. 3
    3
      src/status_im/ui/components/dialog.cljs
  52. 2
    2
      src/status_im/ui/components/icons/vector_icons.cljs
  53. 4
    4
      src/status_im/ui/components/list/views.cljs
  54. 2
    2
      src/status_im/ui/components/list_selection.cljs
  55. 2
    2
      src/status_im/ui/components/permissions.cljs
  56. 5
    5
      src/status_im/ui/components/qr_code_viewer/views.cljs
  57. 1
    1
      src/status_im/ui/components/svgimage.cljs
  58. 2
    2
      src/status_im/ui/components/tooltip/views.cljs
  59. 7
    5
      src/status_im/ui/components/webview_bridge.cljs
  60. 1
    1
      src/status_im/ui/screens/about_app/views.cljs
  61. 1
    1
      src/status_im/ui/screens/accounts/create/views.cljs
  62. 1
    1
      src/status_im/ui/screens/accounts/login/views.cljs
  63. 1
    1
      src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs
  64. 3
    3
      src/status_im/ui/screens/browser/open_dapp/views.cljs
  65. 2
    2
      src/status_im/ui/screens/browser/permissions/views.cljs
  66. 4
    4
      src/status_im/ui/screens/browser/site_blocked/views.cljs
  67. 1
    1
      src/status_im/ui/screens/chat/bottom_info.cljs
  68. 4
    4
      src/status_im/ui/screens/chat/input/animations/expandable.cljs
  69. 3
    3
      src/status_im/ui/screens/chat/input/input.cljs
  70. 2
    2
      src/status_im/ui/screens/chat/input/suggestions.cljs
  71. 1
    1
      src/status_im/ui/screens/chat/message/datemark.cljs
  72. 1
    1
      src/status_im/ui/screens/chat/message/message.cljs
  73. 13
    13
      src/status_im/ui/screens/chat/stickers/views.cljs
  74. 1
    1
      src/status_im/ui/screens/chat/utils.cljs
  75. 5
    5
      src/status_im/ui/screens/chat/views.cljs
  76. 3
    3
      src/status_im/ui/screens/contacts_list/views.cljs
  77. 2
    2
      src/status_im/ui/screens/desktop/main/add_new/views.cljs
  78. 13
    13
      src/status_im/ui/screens/desktop/main/chat/views.cljs
  79. 1
    1
      src/status_im/ui/screens/desktop/main/tabs/home/views.cljs
  80. 2
    2
      src/status_im/ui/screens/desktop/main/tabs/profile/views.cljs
  81. 2
    2
      src/status_im/ui/screens/extensions/add/views.cljs
  82. 2
    2
      src/status_im/ui/screens/group/views.cljs
  83. 1
    1
      src/status_im/ui/screens/hardwallet/authentication_method/views.cljs
  84. 3
    3
      src/status_im/ui/screens/hardwallet/components.cljs
  85. 3
    3
      src/status_im/ui/screens/hardwallet/connect/views.cljs
  86. 1
    1
      src/status_im/ui/screens/hardwallet/pin/views.cljs
  87. 3
    3
      src/status_im/ui/screens/hardwallet/settings/views.cljs
  88. 15
    15
      src/status_im/ui/screens/hardwallet/setup/views.cljs
  89. 2
    2
      src/status_im/ui/screens/help_center/views.cljs
  90. 2
    2
      src/status_im/ui/screens/home/animations/responder.cljs
  91. 1
    1
      src/status_im/ui/screens/home/filter/views.cljs
  92. 1
    1
      src/status_im/ui/screens/home/views.cljs
  93. 1
    1
      src/status_im/ui/screens/network_settings/edit_network/views.cljs
  94. 1
    1
      src/status_im/ui/screens/offline_messaging_settings/edit_mailserver/views.cljs
  95. 4
    4
      src/status_im/ui/screens/pairing/views.cljs
  96. 1
    1
      src/status_im/ui/screens/profile/contact/views.cljs
  97. 1
    1
      src/status_im/ui/screens/profile/group_chat/views.cljs
  98. 4
    4
      src/status_im/ui/screens/profile/seed/views.cljs
  99. 9
    10
      src/status_im/ui/screens/profile/tribute_to_talk/views.cljs
  100. 0
    0
      src/status_im/ui/screens/profile/user/views.cljs

+ 2
- 0
android/app/build.gradle View File

@@ -80,6 +80,8 @@ project.ext.react = [
nodeExecutableAndArgs: ["node", "--max-old-space-size=16384"],
entryFile: "index.android.js",
bundleInPr: true,
bundleCommand: "ram-bundle",
bundleConfig: "packager/config.js"
]

apply from: "../../node_modules/react-native/react.gradle"

+ 0
- 1
clj-rn.conf.edn View File

@@ -46,7 +46,6 @@
"hi-base32"
"react-native-mail"
"react-native-shake"]

;; Desktop modules
:desktop-modules ["realm"
"react-native-languages"

+ 52
- 37
components/src/status_im/ui/components/react.cljs View File

@@ -1,7 +1,6 @@
(ns status-im.ui.components.react
(:require-macros [status-im.utils.views :as views])
(:require [clojure.string :as string]
[goog.object :as object]
(:require [goog.object :as object]
[reagent.core :as reagent]
[status-im.ui.components.styles :as styles]
[status-im.utils.utils :as utils]
@@ -17,31 +16,42 @@
(or (object/get js-dependencies/react-native name) {})
#js {}))

(defn lazy-get-react-property [name]
(let [react-property (atom nil)]
(fn []
(if @react-property
@react-property
(reset! react-property (get-react-property name))))))

(defn adapt-class [class]
(when class
(reagent/adapt-react-class class)))

(defn get-class [name]
(adapt-class (get-react-property name)))
(let [react-class (atom nil)]
(fn []
(if @react-class
@react-class
(reset! react-class
(adapt-class (get-react-property name)))))))

(def native-modules (.-NativeModules js-dependencies/react-native))
(def device-event-emitter (.-DeviceEventEmitter js-dependencies/react-native))
(def dismiss-keyboard! js-dependencies/dismiss-keyboard)
(def back-handler (get-react-property "BackHandler"))
(defn dismiss-keyboard! [] ((js-dependencies/dismiss-keyboard)))

(def splash-screen (.-SplashScreen native-modules))

;; React Components

(def app-registry (get-react-property "AppRegistry"))
(def app-state (get-react-property "AppState"))
(def net-info (get-react-property "NetInfo"))
(def view (get-class "View"))
(def app-state (lazy-get-react-property "AppState"))
(def net-info (lazy-get-react-property "NetInfo"))
(def view ((get-class "View")))
(def safe-area-view (get-class "SafeAreaView"))
(def progress-bar (get-class "ProgressBarAndroid"))

(def status-bar-class (when-not platform/desktop? (get-react-property "StatusBar")))
(def status-bar (get-class (if platform/desktop? "View" "StatusBar")))

(def scroll-view (get-class "ScrollView"))
(def web-view (get-class "WebView"))
@@ -49,11 +59,12 @@

(def refresh-control (get-class "RefreshControl"))

(def text-class (get-class "Text"))
(def text-class ((get-class "Text")))
(def text-input-class (get-class "TextInput"))
(def image-class (get-class "Image"))
(def picker-class (get-class "Picker"))
(def picker-item-class (adapt-class (.-Item (get-react-property "Picker"))))
(def picker-obj (lazy-get-react-property "Picker"))
(defn picker-class [] (adapt-class (picker-obj)))
(defn picker-item-class [] (adapt-class (.-Item (picker-obj))))

(defn valid-source? [source]
(or (not (map? source))
@@ -63,30 +74,34 @@

(defn image [{:keys [source] :as props}]
(when (valid-source? source)
[image-class props]))
(let [source (if (fn? source) (source) source)]
[(image-class) (assoc props :source source)])))

(def switch-class (get-class "Switch"))

(def switch (get-class "Switch"))
(def check-box (get-class "CheckBox"))
(defn switch [props]
[(switch-class) props])

(def touchable-highlight-class (get-class "TouchableHighlight"))
(def touchable-without-feedback-class (get-class "TouchableWithoutFeedback"))
(def touchable-opacity (get-class "TouchableOpacity"))
(def activity-indicator (get-class "ActivityIndicator"))
(def activity-indicator-class (get-class "ActivityIndicator"))

(defn activity-indicator [props]
[(activity-indicator-class) props])

(def modal (get-class "Modal"))

(def pan-responder (.-PanResponder js-dependencies/react-native))
(def animated (.-Animated js-dependencies/react-native))
(def animated-view (reagent/adapt-react-class (.-View animated)))
(def animated-text (reagent/adapt-react-class (.-Text animated)))
(def pan-responder (lazy-get-react-property "PanResponder"))
(def animated (lazy-get-react-property "Animated"))
(defn animated-view []
(reagent/adapt-react-class (.-View (animated))))

(def dimensions (.-Dimensions js-dependencies/react-native))
(def keyboard (.-Keyboard js-dependencies/react-native))
(def linking (.-Linking js-dependencies/react-native))
(def dimensions (lazy-get-react-property "Dimensions"))
(def keyboard (lazy-get-react-property "Keyboard"))
(def linking (lazy-get-react-property "Linking"))
(def desktop-notification (.-DesktopNotification (.-NativeModules js-dependencies/react-native)))

(def slider (get-class "Slider"))

(def max-font-size-multiplier 1.25)

(defn prepare-text-props [props]
@@ -122,7 +137,7 @@

(defn text-input
[options text]
[text-input-class
[(text-input-class)
(merge
{:underline-color-android :transparent
:max-font-size-multiplier max-font-size-multiplier
@@ -145,30 +160,30 @@
:style style}]))

(defn touchable-highlight [props content]
[touchable-highlight-class
[(touchable-highlight-class)
(merge {:underlay-color :transparent} props)
content])

(defn touchable-without-feedback [props content]
[touchable-without-feedback-class
[(touchable-without-feedback-class)
props
content])

(defn get-dimensions [name]
(js->clj (.get dimensions name) :keywordize-keys true))
(js->clj (.get (dimensions) name) :keywordize-keys true))

(defn list-item [component]
(reagent/as-element component))

(defn value->picker-item [{:keys [value label]}]
[picker-item-class {:value (or value "") :label (or label value "")}])
[(picker-item-class) {:value (or value "") :label (or label value "")}])

(defn picker [{:keys [style on-change selected enabled data]}]
(into
[picker-class (merge (when style {:style style})
(when enabled {:enabled enabled})
(when on-change {:on-value-change on-change})
(when selected {:selected-value selected}))]
[(picker-class) (merge (when style {:style style})
(when enabled {:enabled enabled})
(when on-change {:on-value-change on-change})
(when selected {:selected-value selected}))]
(map value->picker-item data)))

;; Image picker
@@ -184,7 +199,7 @@
([images-fn]
(show-image-picker images-fn nil))
([images-fn media-type]
(let [image-picker (.-default image-picker-class)]
(let [image-picker (.-default (image-picker-class))]
(-> image-picker
(.openPicker (clj->js {:multiple false :mediaType (or media-type "any")}))
(.then images-fn)
@@ -210,7 +225,7 @@

(defn keyboard-avoiding-view [props & children]
(let [view-element (if platform/ios?
[keyboard-avoiding-view-class (merge {:behavior :padding} props)]
[(keyboard-avoiding-view-class) (merge {:behavior :padding} props)]
[view props])]
(vec (concat view-element children))))

@@ -309,7 +324,7 @@
:height 100
:z-index -1000}])
children (conj children bottom-background)]
(apply vector safe-area-view props children))))
(apply vector (safe-area-view) props children))))

(defmethod create-main-screen-view :default [_]
view)

+ 1
- 1
ios/StatusIm.xcodeproj/project.pbxproj View File

@@ -1837,7 +1837,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -o errexit\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --max-old-space-size=16384 \"\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
shellScript = "set -o errexit\nexport BUNDLE_COMMAND=\"ram-bundle\"\nexport BUNDLE_CONFIG=\"packager/config.js\"\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --max-old-space-size=16384 \"\n\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
};
2EAC54E16AB243C3EBBFE1BA /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;

+ 35
- 0
packager/config.js View File

@@ -0,0 +1,35 @@
const modulePaths = require('./modulePaths');
const resolve = require('path').resolve;
const fs = require('fs');
const { getDefaultConfig } = require("metro-config");

// Update the following line if the root folder of your app is somewhere else.
const ROOT_FOLDER = resolve(__dirname, '..');

module.exports = (async () => {
const {
resolver: { sourceExts, assetExts }
} = await getDefaultConfig();
return {
transformer: {
babelTransformerPath: require.resolve("react-native-svg-transformer"),
getTransformOptions: async () => {
const moduleMap = {};
modulePaths.forEach(path => {
if (fs.existsSync(path)) {
moduleMap[resolve(path)] = true;
}
});
return {
preloadedModules: moduleMap,
transform: { inlineRequires: { blacklist: moduleMap } },
}
},
},
projectRoot:ROOT_FOLDER,
resolver: {
assetExts: assetExts.filter(ext => ext !== "svg"),
sourceExts: [...sourceExts, "svg"]
}
};
})();

+ 415
- 0
packager/modulePaths.js View File

@@ -0,0 +1,415 @@
module.exports = [
"node_modules/react-native/Libraries/Core/InitializeCore.js",
"index.android.js",
"index.ios.js",
"node_modules/react-native-config/index.js",
"node_modules/react-native/Libraries/react-native/react-native-implementation.js",
"node_modules/react-native/Libraries/BatchedBridge/NativeModules.js",
"node_modules/invariant/browser.js",
"node_modules/react-native/Libraries/BatchedBridge/BatchedBridge.js",
"node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js",
"node_modules/react-native/Libraries/Utilities/stringifySafe.js",
"node_modules/react-native/Libraries/Utilities/defineLazyObjectProperty.js",
"node_modules/react-native/Libraries/EventEmitter/RCTDeviceEventEmitter.js",
"node_modules/react-native/Libraries/vendor/emitter/EventSubscriptionVendor.js",
"node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js",
"node_modules/react-native/Libraries/vendor/emitter/EmitterSubscription.js",
"node_modules/react-native/Libraries/vendor/emitter/EventSubscription.js",
"node_modules/react-native/Libraries/ReactNative/UIManager.js",
"node_modules/react-native/Libraries/Utilities/Platform.android.js",
"node_modules/react-native/Libraries/ReactNative/UIManagerProperties.js",
"node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js",
"node_modules/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js",
"node_modules/react-native/Libraries/react-native/React.js",
"node_modules/react/index.js",
"node_modules/object-assign/index.js",
"node_modules/react/cjs/react.production.min.js",
"node_modules/react/node_modules/prop-types/checkPropTypes.js",
"node_modules/react/node_modules/prop-types/lib/ReactPropTypesSecret.js",
"node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js",
"node_modules/react-native/Libraries/Renderer/shims/createReactNativeComponentClass.js",
"node_modules/react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js",
"node_modules/react-native/Libraries/ReactNative/getNativeComponentAttributes.js",
"node_modules/react-native/node_modules/fbjs/lib/warning.js",
"node_modules/@babel/runtime/helpers/objectSpread.js",
"node_modules/@babel/runtime/helpers/defineProperty.js",
"node_modules/react-native/Libraries/Components/View/ReactNativeStyleAttributes.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedLayoutPropTypes.js",
"node_modules/react-native/node_modules/prop-types/index.js",
"node_modules/react-native/node_modules/prop-types/factoryWithTypeCheckers.js",
"node_modules/react-native/node_modules/prop-types/lib/ReactPropTypesSecret.js",
"node_modules/react-native/node_modules/prop-types/checkPropTypes.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js",
"node_modules/react-native/Libraries/Color/normalizeColor.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js",
"node_modules/react-native/Libraries/Utilities/deprecatedPropType.js",
"node_modules/react-native/Libraries/Text/TextStylePropTypes.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js",
"node_modules/react-native/Libraries/StyleSheet/processTransform.js",
"node_modules/react-native/Libraries/Utilities/differ/sizesDiffer.js",
"node_modules/react-native/Libraries/StyleSheet/processColor.js",
"node_modules/react-native/Libraries/Image/AssetRegistry.js",
"node_modules/react-native/Libraries/Utilities/PixelRatio.js",
"node_modules/react-native/Libraries/Utilities/Dimensions.js",
"node_modules/react-native/Libraries/Utilities/DeviceInfo.js",
"node_modules/react-native/Libraries/Components/View/View.js",
"node_modules/react-native/Libraries/Components/View/ViewNativeComponent.js",
"node_modules/react-native/Libraries/Text/TextAncestor.js",
"node_modules/react-native/Libraries/StyleSheet/StyleSheet.js",
"node_modules/react-native/Libraries/StyleSheet/flattenStyle.js",
"node_modules/react-native/Libraries/StyleSheet/StyleSheetValidation.js",
"node_modules/react-native/Libraries/vendor/core/merge.js",
"node_modules/react-native/Libraries/vendor/core/mergeInto.js",
"node_modules/react-native/Libraries/vendor/core/mergeHelpers.js",
"node_modules/react-native/Libraries/Components/View/ReactNativeViewAttributes.js",
"node_modules/react-native/Libraries/Components/Touchable/Touchable.js",
"node_modules/react-native/node_modules/fbjs/lib/keyMirror.js",
"node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js",
"node_modules/react-native/Libraries/Renderer/shims/ReactNative.js",
"node_modules/react-native/Libraries/Core/setUpGlobals.js",
"node_modules/react-native/Libraries/Core/polyfillES6Collections.js",
"node_modules/react-native/Libraries/vendor/core/_shouldPolyfillES6Collection.js",
"node_modules/react-native/Libraries/Utilities/PolyfillFunctions.js",
"node_modules/react-native/Libraries/Core/setUpSystrace.js",
"node_modules/react-native/Libraries/Core/setUpErrorHandling.js",
"node_modules/react-native/Libraries/Core/ExceptionsManager.js",
"node_modules/stacktrace-parser/index.js",
"node_modules/stacktrace-parser/lib/stacktrace-parser.js",
"node_modules/react-native/Libraries/Network/fetch.js",
"node_modules/react-native/Libraries/vendor/core/whatwg-fetch.js",
"node_modules/react-native/Libraries/Core/checkNativeVersion.js",
"node_modules/react-native/Libraries/Core/ReactNativeVersionCheck.js",
"node_modules/react-native/Libraries/Core/ReactNativeVersion.js",
"node_modules/react-native/Libraries/Core/polyfillPromise.js",
"node_modules/react-native/Libraries/Promise.js",
"node_modules/promise/setimmediate/done.js",
"node_modules/promise/setimmediate/core.js",
"node_modules/promise/setimmediate/es6-extensions.js",
"node_modules/promise/setimmediate/rejection-tracking.js",
"node_modules/react-native/Libraries/Core/setUpRegeneratorRuntime.js",
"node_modules/regenerator-runtime/runtime.js",
"node_modules/react-native/Libraries/Core/setUpTimers.js",
"node_modules/react-native/Libraries/Core/Timers/JSTimers.js",
"node_modules/react-native/node_modules/fbjs/lib/ExecutionEnvironment.js",
"node_modules/react-native/Libraries/Core/setUpXHR.js",
"node_modules/react-native/Libraries/Blob/BlobManager.js",
"node_modules/react-native/Libraries/Blob/Blob.js",
"node_modules/react-native/Libraries/Blob/BlobRegistry.js",
"node_modules/event-target-shim/lib/event-target.js",
"node_modules/event-target-shim/lib/commons.js",
"node_modules/event-target-shim/lib/custom-event-target.js",
"node_modules/event-target-shim/lib/event-wrapper.js",
"node_modules/react-native/Libraries/Network/FormData.js",
"node_modules/base64-js/index.js",
"node_modules/react-native/Libraries/WebSocket/WebSocket.js",
"node_modules/react-native/Libraries/WebSocket/WebSocketEvent.js",
"node_modules/react-native/Libraries/Blob/File.js",
"node_modules/react-native/Libraries/Core/setUpAlert.js",
"node_modules/react-native/Libraries/Core/setUpGeolocation.js",
"node_modules/react-native/Libraries/Utilities/logError.js",
"node_modules/react-native/Libraries/Core/setUpBatchedBridge.js",
"node_modules/react-native/Libraries/Utilities/RCTLog.js",
"node_modules/react-native/Libraries/Utilities/infoLog.js",
"node_modules/react-native/Libraries/Core/setUpSegmentFetcher.js",
"node_modules/react-native/Libraries/AppState/AppState.js",
"node_modules/react-native/Libraries/JSInspector/JSInspector.js",
"node_modules/react-native/Libraries/JSInspector/NetworkAgent.js",
"node_modules/react-native/Libraries/JSInspector/InspectorAgent.js",
"node_modules/react-native/Libraries/EventEmitter/RCTEventEmitter.js",
"node_modules/react-native/Libraries/Utilities/differ/deepDiffer.js",
"node_modules/react-native/Libraries/Components/TextInput/TextInputState.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType.js",
"node_modules/react-native/Libraries/Animated/src/Animated.js",
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedValue.js",
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedInterpolation.js",
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedWithChildren.js",
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedNode.js",
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedValueXY.js",
"node_modules/react-native/Libraries/Animated/src/AnimatedImplementation.js",
"node_modules/react-native/Libraries/Animated/src/Easing.js",
"node_modules/react-native/Libraries/Animated/src/AnimatedEvent.js",
"node_modules/react-native/Libraries/Animated/src/createAnimatedComponent.js",
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedProps.js",
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedStyle.js",
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedTransform.js",
"node_modules/react-native/Libraries/Components/Keyboard/Keyboard.js",
"node_modules/react-native/Libraries/Utilities/dismissKeyboard.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js",
"node_modules/react-native/Libraries/Components/View/PlatformViewPropTypes.android.js",
"node_modules/react-native/Libraries/Animated/src/components/AnimatedText.js",
"node_modules/react-native/Libraries/Text/Text.js",
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js",
"node_modules/react-native/Libraries/Animated/src/components/AnimatedView.js",
"node_modules/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js",
"node_modules/react-native/Libraries/Components/StatusBar/StatusBar.js",
"node_modules/react-native/Libraries/Utilities/warnOnce.js",
"node_modules/react-native/Libraries/ReactNative/AppContainer.js",
"node_modules/react-native/Libraries/ReactNative/I18nManager.js",
"node_modules/react-native/Libraries/Interaction/PanResponder.js",
"node_modules/react-native/Libraries/ReactNative/AppRegistry.js",
"node_modules/react-native/Libraries/ReactNative/renderApplication.js",
"node_modules/react-native/Libraries/Utilities/BackHandler.android.js",
"node_modules/react-native/Libraries/BugReporting/BugReporting.js",
"node_modules/react-native/Libraries/Utilities/SceneTracker.js",
"node_modules/react-native/Libraries/Linking/Linking.js",
"node_modules/react-native/Libraries/Network/NetInfo.js",
"node_modules/react-native/Libraries/Share/Share.js",
"node_modules/react-native-fs/FS.common.js",
"node_modules/react-native-keychain/index.js",
"node_modules/fbjs/lib/warning.js",
"node_modules/fbjs/lib/emptyFunction.js",
"node_modules/fbjs/lib/invariant.js",
"node_modules/fbjs/lib/emptyObject.js",
"node_modules/realm/lib/index.js",
"node_modules/realm/lib/user-methods.js",
"node_modules/realm/lib/errors.js",
"node_modules/realm/lib/permission-api.js",
"node_modules/realm/lib/extensions.js",
"node_modules/realm/lib/collection-methods.js",
"node_modules/create-react-class/index.js",
"node_modules/create-react-class/factory.js",
"node_modules/prop-types/index.js",
"node_modules/prop-types/factoryWithTypeCheckers.js",
"node_modules/prop-types/lib/ReactPropTypesSecret.js",
"node_modules/prop-types/checkPropTypes.js",
"node_modules/react-native-securerandom/index.js",
"node_modules/i18n-js/app/assets/javascripts/i18n.js",
"node_modules/react-native-languages/index.js",
"node_modules/react-native-camera/src/index.js",
"node_modules/react-native-camera/src/Camera.js",
"node_modules/react-native-camera/node_modules/prop-types/index.js",
"node_modules/react-native-camera/node_modules/prop-types/factoryWithTypeCheckers.js",
"node_modules/react-native-camera/node_modules/prop-types/lib/ReactPropTypesSecret.js",
"node_modules/react-native-camera/node_modules/prop-types/checkPropTypes.js",
"node_modules/react-native-camera/src/RNCamera.js",
"node_modules/react-native-camera/src/FaceDetector.js",
"node_modules/react-native-svg/index.js",
"node_modules/react-native-svg/elements/Rect.js",
"node_modules/react-native-svg/lib/extract/extractProps.js",
"node_modules/react-native-svg/lib/extract/extractFill.js",
"node_modules/react-native-svg/lib/extract/extractBrush.js",
"node_modules/react-native-svg/lib/extract/extractColor.js",
"node_modules/react-native-svg/lib/extract/extractOpacity.js",
"node_modules/react-native-svg/lib/extract/extractStroke.js",
"node_modules/react-native-svg/lib/extract/extractLengthList.js",
"node_modules/react-native-svg/lib/extract/extractClipPath.js",
"node_modules/react-native-svg/lib/extract/extractResponder.js",
"node_modules/react-native-svg/lib/extract/extractTransform.js",
"node_modules/react-native-svg/lib/Matrix2D.js",
"node_modules/react-native-svg/lib/extract/transform.js",
"node_modules/react-native-svg/elements/Shape.js",
"node_modules/react-native-svg/lib/SvgTouchableMixin.js",
"node_modules/react-native-svg/elements/Circle.js",
"node_modules/react-native-svg/elements/Ellipse.js",
"node_modules/react-native-svg/elements/Polygon.js",
"node_modules/react-native-svg/elements/Path.js",
"node_modules/react-native-svg/lib/extract/extractPolyPoints.js",
"node_modules/react-native-svg/elements/Polyline.js",
"node_modules/react-native-svg/elements/Line.js",
"node_modules/react-native-svg/elements/Svg.js",
"node_modules/react-native-svg/lib/extract/extractViewBox.js",
"node_modules/react-native-svg/elements/G.js",
"node_modules/react-native-svg/lib/extract/extractText.js",
"node_modules/react-native-svg/elements/Text.js",
"node_modules/react-native-svg/elements/TSpan.js",
"node_modules/react-native-svg/elements/TextPath.js",
"node_modules/react-native-svg/elements/Use.js",
"node_modules/react-native-svg/elements/Image.js",
"node_modules/react-native-svg/elements/Symbol.js",
"node_modules/react-native-svg/elements/Defs.js",
"node_modules/react-native-svg/elements/LinearGradient.js",
"node_modules/react-native-svg/lib/extract/extractGradient.js",
"node_modules/react-native-svg/lib/units.js",
"node_modules/react-native-svg/elements/RadialGradient.js",
"node_modules/react-native-svg/elements/Stop.js",
"node_modules/react-native-svg/elements/ClipPath.js",
"node_modules/react-native-svg/elements/Pattern.js",
"node_modules/react-native-svg/elements/Mask.js",
"node_modules/react-native-firebase/dist/index.js",
"node_modules/react-native-firebase/dist/modules/core/firebase.js",
"node_modules/react-native-firebase/dist/utils/apps.js",
"node_modules/react-native-firebase/dist/modules/core/app.js",
"node_modules/react-native-firebase/dist/utils/internals.js",
"node_modules/react-native-firebase/dist/modules/admob/index.js",
"node_modules/react-native-firebase/dist/utils/ModuleBase.js",
"node_modules/react-native-firebase/dist/utils/native.js",
"node_modules/react-native-firebase/dist/utils/events.js",
"node_modules/react-native-firebase/dist/utils/emitter/EventEmitter.js",
"node_modules/react-native-firebase/dist/utils/emitter/EventSubscriptionVendor.js",
"node_modules/react-native-firebase/dist/utils/emitter/EmitterSubscription.js",
"node_modules/react-native-firebase/dist/utils/emitter/EventSubscription.js",
"node_modules/react-native-firebase/dist/utils/log.js",
"node_modules/react-native-firebase/dist/modules/admob/Interstitial.js",
"node_modules/react-native-firebase/dist/modules/admob/AdRequest.js",
"node_modules/react-native-firebase/dist/utils/index.js",
"node_modules/react-native-firebase/dist/modules/admob/RewardedVideo.js",
"node_modules/react-native-firebase/dist/modules/admob/VideoOptions.js",
"node_modules/react-native-firebase/dist/modules/admob/Banner.js",
"node_modules/react-native-firebase/dist/modules/admob/AdMobComponent.js",
"node_modules/react-native-firebase/node_modules/prop-types/index.js",
"node_modules/react-native-firebase/node_modules/prop-types/factoryWithTypeCheckers.js",
"node_modules/react-native-firebase/node_modules/prop-types/lib/ReactPropTypesSecret.js",
"node_modules/react-native-firebase/node_modules/prop-types/checkPropTypes.js",
"node_modules/react-native-firebase/dist/modules/admob/EventTypes.js",
"node_modules/react-native-firebase/dist/modules/admob/NativeExpress.js",
"node_modules/react-native-firebase/dist/modules/auth/index.js",
"node_modules/react-native-firebase/dist/modules/auth/User.js",
"node_modules/react-native-firebase/dist/modules/auth/phone/ConfirmationResult.js",
"node_modules/react-native-firebase/dist/modules/auth/phone/PhoneAuthListener.js",
"node_modules/react-native-firebase/dist/modules/auth/providers/EmailAuthProvider.js",
"node_modules/react-native-firebase/dist/modules/auth/providers/PhoneAuthProvider.js",
"node_modules/react-native-firebase/dist/modules/auth/providers/GoogleAuthProvider.js",
"node_modules/react-native-firebase/dist/modules/auth/providers/GithubAuthProvider.js",
"node_modules/react-native-firebase/dist/modules/auth/providers/OAuthProvider.js",
"node_modules/react-native-firebase/dist/modules/auth/providers/TwitterAuthProvider.js",
"node_modules/react-native-firebase/dist/modules/auth/providers/FacebookAuthProvider.js",
"node_modules/react-native-firebase/dist/modules/analytics/index.js",
"node_modules/react-native-firebase/dist/modules/config/index.js",
"node_modules/react-native-firebase/dist/modules/crashlytics/index.js",
"node_modules/react-native-firebase/dist/modules/database/index.js",
"node_modules/react-native-firebase/dist/modules/database/Reference.js",
"node_modules/react-native-firebase/dist/modules/database/Query.js",
"node_modules/react-native-firebase/dist/modules/database/DataSnapshot.js",
"node_modules/react-native-firebase/dist/modules/database/OnDisconnect.js",
"node_modules/react-native-firebase/dist/utils/ReferenceBase.js",
"node_modules/react-native-firebase/dist/utils/SyncTree.js",
"node_modules/react-native-firebase/dist/modules/database/transaction.js",
"node_modules/react-native-firebase/dist/modules/firestore/index.js",
"node_modules/react-native-firebase/dist/modules/firestore/CollectionReference.js",
"node_modules/react-native-firebase/dist/modules/firestore/DocumentReference.js",
"node_modules/react-native-firebase/dist/modules/firestore/DocumentSnapshot.js",
"node_modules/react-native-firebase/dist/modules/firestore/FieldPath.js",
"node_modules/react-native-firebase/dist/modules/firestore/Path.js",
"node_modules/react-native-firebase/dist/modules/firestore/Blob.js",
"node_modules/react-native-firebase/dist/utils/Base64.js",
"node_modules/react-native-firebase/dist/modules/firestore/GeoPoint.js",
"node_modules/react-native-firebase/dist/modules/firestore/FieldValue.js",
"node_modules/react-native-firebase/dist/modules/firestore/Query.js",
"node_modules/react-native-firebase/dist/modules/firestore/QuerySnapshot.js",
"node_modules/react-native-firebase/dist/modules/firestore/DocumentChange.js",
"node_modules/react-native-firebase/dist/modules/firestore/WriteBatch.js",
"node_modules/react-native-firebase/dist/modules/firestore/TransactionHandler.js",
"node_modules/react-native-firebase/dist/modules/firestore/Transaction.js",
"node_modules/react-native-firebase/dist/modules/functions/index.js",
"node_modules/react-native-firebase/dist/modules/functions/HttpsError.js",
"node_modules/react-native-firebase/dist/modules/iid/index.js",
"node_modules/react-native-firebase/dist/modules/invites/index.js",
"node_modules/react-native-firebase/dist/modules/invites/Invitation.js",
"node_modules/react-native-firebase/dist/modules/invites/AndroidInvitation.js",
"node_modules/react-native-firebase/dist/modules/links/index.js",
"node_modules/react-native-firebase/dist/modules/links/DynamicLink.js",
"node_modules/react-native-firebase/dist/modules/links/AnalyticsParameters.js",
"node_modules/react-native-firebase/dist/modules/links/AndroidParameters.js",
"node_modules/react-native-firebase/dist/modules/links/IOSParameters.js",
"node_modules/react-native-firebase/dist/modules/links/ITunesParameters.js",
"node_modules/react-native-firebase/dist/modules/links/NavigationParameters.js",
"node_modules/react-native-firebase/dist/modules/links/SocialParameters.js",
"node_modules/react-native-firebase/dist/modules/messaging/index.js",
"node_modules/react-native-firebase/dist/modules/messaging/RemoteMessage.js",
"node_modules/react-native-firebase/dist/modules/notifications/index.js",
"node_modules/react-native-firebase/dist/modules/notifications/AndroidAction.js",
"node_modules/react-native-firebase/dist/modules/notifications/AndroidRemoteInput.js",
"node_modules/react-native-firebase/dist/modules/notifications/types.js",
"node_modules/react-native-firebase/dist/modules/notifications/AndroidChannel.js",
"node_modules/react-native-firebase/dist/modules/notifications/AndroidChannelGroup.js",
"node_modules/react-native-firebase/dist/modules/notifications/AndroidNotifications.js",
"node_modules/react-native-firebase/dist/modules/notifications/IOSNotifications.js",
"node_modules/react-native-firebase/dist/modules/notifications/Notification.js",
"node_modules/react-native-firebase/dist/modules/notifications/AndroidNotification.js",
"node_modules/react-native-firebase/dist/modules/notifications/IOSNotification.js",
"node_modules/react-native-firebase/dist/modules/perf/index.js",
"node_modules/react-native-firebase/dist/modules/perf/Trace.js",
"node_modules/react-native-firebase/dist/modules/perf/HttpMetric.js",
"node_modules/react-native-firebase/dist/modules/storage/index.js",
"node_modules/react-native-firebase/dist/modules/storage/reference.js",
"node_modules/react-native-firebase/dist/modules/storage/task.js",
"node_modules/react-native-firebase/dist/modules/utils/index.js",
"node_modules/react-native-firebase/dist/version.js",
"node_modules/react-navigation/src/react-navigation.js",
"node_modules/react-navigation/src/createNavigationContainer.js",
"node_modules/react-navigation/src/NavigationActions.js",
"node_modules/react-navigation/src/getNavigation.js",
"node_modules/react-navigation/src/routers/getNavigationActionCreators.js",
"node_modules/react-navigation/src/utils/invariant.js",
"node_modules/react-navigation/src/getChildNavigation.js",
"node_modules/react-navigation/src/getChildEventSubscriber.js",
"node_modules/react-navigation/src/getChildRouter.js",
"node_modules/react-navigation/src/utils/docsUrl.js",
"node_modules/react-navigation/src/routers/pathUtils.js",
"node_modules/path-to-regexp/index.js",
"node_modules/path-to-regexp/node_modules/isarray/index.js",
"node_modules/react-lifecycles-compat/react-lifecycles-compat.cjs.js",
"node_modules/react-navigation/src/StateUtils.js",
"node_modules/react-navigation/src/navigators/createNavigator.js",
"node_modules/react-navigation/src/navigators/createKeyboardAwareNavigator.js",
"node_modules/react-navigation/src/views/NavigationContext.js",
"node_modules/create-react-context/lib/index.js",
"node_modules/create-react-context/lib/implementation.js",
"node_modules/gud/index.js",
"node_modules/react-navigation-stack/dist/index.js",
"node_modules/react-navigation-stack/dist/navigators/createContainedStackNavigator.js",
"node_modules/react-navigation-stack/dist/navigators/createStackNavigator.js",
"node_modules/react-navigation-stack/dist/views/StackView/StackView.js",
"node_modules/react-navigation-stack/dist/views/StackView/StackViewLayout.js",
"node_modules/react-navigation-stack/dist/utils/clamp.js",
"node_modules/react-navigation-stack/dist/views/StackView/StackViewCard.js",
"node_modules/react-navigation-stack/dist/views/StackView/createPointerEventsContainer.js",
"node_modules/react-navigation-stack/dist/utils/invariant.js",
"node_modules/react-native-screens/src/screens.native.js",
"node_modules/react-navigation-stack/dist/views/Header/Header.js",
"node_modules/react-navigation-stack/dist/views/Header/HeaderTitle.js",
"node_modules/react-navigation-stack/dist/views/Header/HeaderBackButton.js",
"node_modules/react-navigation-stack/dist/views/TouchableItem.js",
"node_modules/react-navigation-stack/dist/views/assets/back-icon.png",
"node_modules/react-navigation-stack/dist/views/Header/ModularHeaderBackButton.js",
"node_modules/react-navigation-stack/dist/views/Header/HeaderStyleInterpolator.js",
"node_modules/react-navigation-stack/dist/utils/getSceneIndicesForInterpolationInputRange.js",
"node_modules/react-navigation-stack/dist/views/StackView/StackViewTransitionConfigs.js",
"node_modules/react-navigation-stack/dist/views/StackView/StackViewStyleInterpolator.js",
"node_modules/react-navigation-stack/dist/utils/ReactNativeFeatures.js",
"node_modules/react-navigation-stack/dist/views/Transitioner.js",
"node_modules/react-navigation-stack/dist/views/ScenesReducer.js",
"node_modules/react-navigation-stack/dist/utils/shallowEqual.js",
"node_modules/react-navigation/src/navigators/createContainedSwitchNavigator.js",
"node_modules/react-navigation/src/navigators/createSwitchNavigator.js",
"node_modules/react-navigation/src/routers/SwitchRouter.js",
"node_modules/react-navigation/src/routers/getScreenForRouteName.js",
"node_modules/react-is/index.js",
"node_modules/react-is/cjs/react-is.production.min.js",
"node_modules/react-navigation/src/routers/createConfigGetter.js",
"node_modules/react-navigation/src/routers/validateScreenOptions.js",
"node_modules/react-navigation/src/routers/StackActions.js",
"node_modules/react-navigation/src/routers/validateRouteConfigMap.js",
"node_modules/react-navigation/src/views/SwitchView/SwitchView.js",
"node_modules/react-navigation/src/views/SceneView.js",
"node_modules/react-navigation-drawer/dist/index.js",
"node_modules/react-navigation-drawer/dist/navigators/createDrawerNavigator.js",
"node_modules/react-navigation-drawer/dist/routers/DrawerRouter.js",
"node_modules/react-navigation-drawer/dist/routers/DrawerActions.js",
"node_modules/react-navigation-drawer/dist/views/DrawerView.js",
"node_modules/react-native-drawer-layout-polyfill/dist/index.android.js",
"node_modules/react-navigation-drawer/dist/views/DrawerSidebar.js",
"node_modules/react-navigation-drawer/dist/utils/invariant.js",
"node_modules/react-navigation-drawer/dist/views/DrawerNavigatorItems.js",
"node_modules/react-navigation-drawer/dist/views/TouchableItem.js",
"node_modules/react-navigation-tabs/src/index.js",
"node_modules/react-navigation-tabs/src/navigators/createBottomTabNavigator.js",
"node_modules/react-navigation-tabs/src/utils/createTabNavigator.js",
"node_modules/react-navigation-tabs/src/views/BottomTabBar.js",
"node_modules/react-navigation-tabs/src/views/CrossFadeIcon.js",
"node_modules/react-navigation-tabs/src/utils/withDimensions.js",
"node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js",
"node_modules/react-navigation-tabs/src/views/ResourceSavingScene.js",
"node_modules/react-navigation/src/routers/StackRouter.js",
"node_modules/react-navigation/src/routers/KeyGenerator.js",
"node_modules/react-navigation/src/routers/TabRouter.js",
"node_modules/react-navigation/src/utils/withDefaultValue.js",
"node_modules/react-navigation/src/views/NavigationEvents.js",
"node_modules/react-navigation/src/views/withNavigation.js",
"node_modules/react-navigation/src/views/withOrientation.js",
"resources/images/ui/dapp-store.png"];

+ 25
- 24
react-native/src/desktop/status_im/react_native/js_dependencies.cljs View File

@@ -1,37 +1,38 @@
(ns status-im.react-native.js-dependencies)
(ns status-im.react-native.js-dependencies
(:require-macros [status-im.utils.js-require :as js-require]))

(def config (js/require "react-native-config"))
(def fs (js/require "react-native-fs"))
(def http-bridge (js/require "react-native-http-bridge"))
(def keychain (js/require "react-native-keychain"))
(def qr-code (js/require "react-native-qrcode"))
(def config (js-require/js-require "react-native-config"))
(def fs (js-require/js-require "react-native-fs"))
(def http-bridge (js-require/js-require "react-native-http-bridge"))
(def keychain (js-require/js-require "react-native-keychain"))
(def qr-code (js-require/js-require "react-native-qrcode"))
(def react-native (js/require "react-native"))
(def realm (js/require "realm"))
(def webview-bridge (js/require "react-native-webview-bridge"))
(def webview #js {:WebView #js {}})
(def secure-random (.-generateSecureRandom (js/require "react-native-securerandom")))
(def EventEmmiter (js/require "react-native/Libraries/vendor/emitter/EventEmitter"))
(def fetch (.-default (js/require "react-native-fetch-polyfill")))
(def securerandom (js-require/js-require "react-native-securerandom"))
(defn secure-random [] (.-generateSecureRandom (securerandom)))
(def fetch-polyfill (js-require/js-require "react-native-fetch-polyfill"))
(defn fetch [] (.-default (fetch-polyfill)))
(def i18n (js/require "i18n-js"))
(def react-native-languages (.-default (js/require "react-native-languages")))
(def desktop-linking (.-DesktopLinking (.-NativeModules react-native)))
(def desktop-menu (js/require "react-native-desktop-menu"))
(def desktop-config (js/require "react-native-desktop-config"))
(def desktop-shortcuts (js/require "react-native-desktop-shortcuts"))
(def react-native-firebase #js {})
(def camera #js {:default #js {:constants {:Aspect "Portrait"}}})
(def status-keycard #js {:default #js {}})
(def dialogs #js {})
(def dismiss-keyboard #js {})
(def image-crop-picker #js {})
(def image-resizer #js {})
(def nfc #js {})
(def react-native-firebase (fn [] #js {}))
(def camera (fn [] #js {:default #js {:constants {:Aspect "Portrait"}}}))
(def status-keycard (fn [] #js {:default #js {}}))
(def dialogs (fn [] #js {}))
(def dismiss-keyboard (fn [] #js {}))
(def image-crop-picker (fn [] #js {}))
(def image-resizer (fn [] #js {}))
(def svg #js {})
(def snoopy #js {})
(def snoopy-filter #js {})
(def snoopy-bars #js {})
(def snoopy-buffer #js {})
(def background-timer #js {:setTimeout (fn [cb ms] (js/setTimeout cb ms))})
(def snoopy (fn [] #js {}))
(def snoopy-filter (fn [] #js {}))
(def snoopy-bars (fn [] #js {}))
(def snoopy-buffer (fn [] #js {}))
(def background-timer (fn [] #js {:setTimeout (fn [cb ms] (js/setTimeout cb ms))}))
(def react-navigation (js/require "react-navigation"))
(def react-native-shake #js {})
(def react-native-mail #js {:mail (fn [])})
(def react-native-shake (fn [] #js {}))
(def react-native-mail (fn [] #js {:mail (fn [])}))

+ 29
- 25
react-native/src/mobile/status_im/react_native/js_dependencies.cljs View File

@@ -1,35 +1,39 @@
(ns status-im.react-native.js-dependencies)
(ns status-im.react-native.js-dependencies
(:require-macros [status-im.utils.js-require :as js-require]))

(def config (js/require "react-native-config"))
(def fs (js/require "react-native-fs"))
(def http-bridge (js/require "react-native-http-bridge"))
(def keychain (js/require "react-native-keychain"))
(def qr-code (js/require "react-native-qrcode"))
(def config (js-require/js-require "react-native-config"))
(def fs (js-require/js-require "react-native-fs"))
(def http-bridge (js-require/js-require "react-native-http-bridge"))
(def keychain (js-require/js-require "react-native-keychain"))
(def qr-code (js-require/js-require "react-native-qrcode"))
(def react-native (js/require "react-native"))
(def status-keycard (js/require "react-native-status-keycard"))
(def status-keycard (js-require/js-require "react-native-status-keycard"))
(def realm (js/require "realm"))
(def webview-bridge (js/require "react-native-webview-bridge"))
(def webview (js/require "react-native-webview"))
(def secure-random (.-generateSecureRandom (js/require "react-native-securerandom")))
(def EventEmmiter (js/require "react-native/Libraries/vendor/emitter/EventEmitter"))
(def fetch (.-default (js/require "react-native-fetch-polyfill")))
(def webview-bridge (js-require/js-require "react-native-webview-bridge"))
(def webview (js-require/js-require "react-native-webview"))
(def securerandom (js-require/js-require "react-native-securerandom"))
(defn secure-random [] (.-generateSecureRandom (securerandom)))
(def fetch-polyfill (js-require/js-require "react-native-fetch-polyfill"))
(defn fetch [] (.-default (fetch-polyfill)))
(def i18n (js/require "i18n-js"))
(def react-native-languages (.-default (js/require "react-native-languages")))
(def camera (js/require "react-native-camera"))
(def dialogs (js/require "react-native-dialogs"))
(def dismiss-keyboard (js/require "dismissKeyboard"))
(def image-crop-picker (js/require "react-native-image-crop-picker"))
(def image-resizer (js/require "react-native-image-resizer"))
(def camera (js-require/js-require "react-native-camera"))
(def dialogs (js-require/js-require "react-native-dialogs"))
(def dismiss-keyboard (js-require/js-require "dismissKeyboard"))
(def image-crop-picker (js-require/js-require "react-native-image-crop-picker"))
(def image-resizer (js-require/js-require "react-native-image-resizer"))
(def svg (js/require "react-native-svg"))
(def react-native-firebase (js/require "react-native-firebase"))
(def snoopy (js/require "rn-snoopy"))
(def snoopy-filter (js/require "rn-snoopy/stream/filter"))
(def snoopy-bars (js/require "rn-snoopy/stream/bars"))
(def snoopy-buffer (js/require "rn-snoopy/stream/buffer"))
(def background-timer (.-default (js/require "react-native-background-timer")))
(def react-native-firebase (js-require/js-require "react-native-firebase"))
(def snoopy (js-require/js-require "rn-snoopy"))
(def snoopy-filter (js-require/js-require "rn-snoopy/stream/filter"))
(def snoopy-bars (js-require/js-require "rn-snoopy/stream/bars"))
(def snoopy-buffer (js-require/js-require "rn-snoopy/stream/buffer"))
(def background-timer-class (js-require/js-require "react-native-background-timer"))
(defn background-timer [] (.-default (background-timer-class)))
(def react-navigation (js/require "react-navigation"))
(def react-native-shake (js/require "react-native-shake"))
(def react-native-mail (.-default (js/require "react-native-mail")))
(def react-native-shake (js-require/js-require "react-native-shake"))
(def mail-class (js-require/js-require "react-native-mail"))
(defn react-native-mail [] (.-default (mail-class)))
(def desktop-linking #js {:addEventListener (fn [])})
(def desktop-menu #js {:addEventListener (fn [])})
(def desktop-config #js {:addEventListener (fn [])})

+ 1
- 1
scripts/start-react-native.sh View File

@@ -15,4 +15,4 @@ if [ ! -z "$METRO_PID" ]; then
[[ $term == 'y' ]] && kill $METRO_PID
fi

react-native start
react-native start --config packager/config.js

+ 7
- 7
src/status_im/android/core.cljs View File

@@ -29,7 +29,7 @@
(reagent/create-class
{:component-will-mount
(fn []
(.addListener react/keyboard
(.addListener (react/keyboard)
"keyboardDidShow"
(fn [e]
(let [h (.. e -endCoordinates -height)]
@@ -37,16 +37,16 @@
(when-not (= h @keyboard-height)
(dispatch [:set :keyboard-height h])
(dispatch [:set :keyboard-max-height h])))))
(.addListener react/keyboard
(.addListener (react/keyboard)
"keyboardDidHide"
(fn [_]
(dispatch [:show-tab-bar])
(when-not (zero? @keyboard-height)
(dispatch [:set :keyboard-height 0]))))
(.hide react/splash-screen)
(.addEventListener react/app-state "change" app-state-change-handler)
(.addEventListener (react/app-state) "change" app-state-change-handler)
(.addEventListener rn-dependencies/react-native-languages "change" on-languages-change)
(.addEventListener rn-dependencies/react-native-shake
(.addEventListener (rn-dependencies/react-native-shake)
"ShakeEvent"
on-shake))
:component-did-mount
@@ -54,10 +54,10 @@
(dispatch [:set-initial-props (reagent/props this)]))
:component-will-unmount
(fn []
(.stop react/http-bridge)
(.removeEventListener react/app-state "change" app-state-change-handler)
(.stop (react/http-bridge))
(.removeEventListener (react/app-state) "change" app-state-change-handler)
(.removeEventListener rn-dependencies/react-native-languages "change" on-languages-change)
(.removeEventListener rn-dependencies/react-native-shake
(.removeEventListener (rn-dependencies/react-native-shake)
"ShakeEvent"
on-shake))
:display-name "root"

+ 2
- 2
src/status_im/browser/core.cljs View File

@@ -63,7 +63,7 @@

(defn check-if-phishing-url [{:keys [history history-index] :as browser}]
(let [history-host (http/url-host (try (nth history history-index) (catch js/Error _)))]
(cond-> browser history-host (assoc :unsafe? (js-dependencies/phishing-detect history-host)))))
(cond-> browser history-host (assoc :unsafe? ((js-dependencies/phishing-detect) history-host)))))

(defn- content->hash [hex]
(when (and hex (not= hex "0x"))
@@ -155,7 +155,7 @@

(defmethod storage-gateway :ipfs
[{:keys [hash]}]
(let [base32hash (-> (.encode js-dependencies/hi-base32 (alphabase.base58/decode hash))
(let [base32hash (-> (.encode (js-dependencies/hi-base32) (alphabase.base58/decode hash))
(string/replace #"=" "")
(string/lower-case))]
(str base32hash ".infura.status.im")))

+ 1
- 1
src/status_im/chat/commands/impl/transactions.cljs View File

@@ -401,7 +401,7 @@
{:on-press on-press-handler
:style transactions-styles/command-request-image-touchable
:accessibility-label (request-button-label (:name command))}
[react/animated-view {:style (transactions-styles/command-request-image-view command scale-anim-val)}
[(react/animated-view) {:style (transactions-styles/command-request-image-view command scale-anim-val)}
(when command-icon
[react/icon command-icon transactions-styles/command-request-image])]]))})))


+ 1
- 1
src/status_im/chat/models/input.cljs View File

@@ -21,7 +21,7 @@
(string/replace text
#":([a-z_\-+0-9]*):"
(fn [[original emoji-id]]
(if-let [emoji-map (object/get (object/get dependencies/emojis "lib") emoji-id)]
(if-let [emoji-map (object/get (object/get (dependencies/emojis) "lib") emoji-id)]
(object/get emoji-map "char")
original)))))


+ 10
- 1
src/status_im/chat/models/message.cljs View File

@@ -365,8 +365,17 @@

(def ^:private transport-keys [:content :content-type :message-type :clock-value :timestamp])

(defn remove-icon
"Coin's icon's resource is represented as a function,
can't be properly de/serialised and has to be removed."
[message]
(cond-> message
(get-in message [:content :params :coin :icon :source])
(update-in [:content :params :coin] dissoc :icon)))

(fx/defn upsert-and-send [{:keys [now] :as cofx} {:keys [chat-id from] :as message}]
(let [send-record (protocol/map->Message (select-keys message transport-keys))
(let [message (remove-icon message)
send-record (protocol/map->Message (select-keys message transport-keys))
old-message-id (transport.utils/old-message-id send-record)
wrapped-record (if (= (:message-type send-record) :group-user-message)
(wrap-group-message cofx chat-id send-record)

+ 8
- 2
src/status_im/constants.cljs View File

@@ -222,8 +222,14 @@

(def ^:const status-create-address "status_createaddress")

(def ^:const event-transfer-hash
(ethereum/sha3 "Transfer(address,address,uint256)"))
(def event-transfer-hash
(let [hash (atom nil)]
(fn []
(if @hash
@hash
(reset!
hash
(ethereum/sha3 "Transfer(address,address,uint256)"))))))

(def regx-emoji #"^((?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F|[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])+$")
(def regx-rtl-characters #"[^\u0591-\u06EF\u06FA-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]*?[\u0591-\u06EF\u06FA-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]")

+ 1
- 1
src/status_im/contact/core.cljs View File

@@ -66,7 +66,7 @@
(upsert-contact contact)
(mailserver/upsert-mailserver-topic
{:chat-ids [public-key]
:topic transport.topic/discovery-topic-hash
:topic (transport.topic/discovery-topic-hash)
:fetch? false})
(send-contact-request contact)
(mailserver/process-next-messages-request)))))

+ 1
- 1
src/status_im/contact/db.cljs View File

@@ -66,7 +66,7 @@
128 public-key
nil)]
(when normalized-key
(subs (.sha3 js-dependencies/Web3.prototype normalized-key #js {:encoding "hex"}) 26))))
(subs (.sha3 (js-dependencies/web3-prototype) normalized-key #js {:encoding "hex"}) 26))))

(defn public-key->new-contact [public-key]
{:name (gfycat/generate-gfy public-key)

+ 3
- 2
src/status_im/data_store/messages.cljs View File

@@ -5,7 +5,8 @@
[status-im.constants :as constants]
[status-im.data-store.realm.core :as core]
[status-im.utils.core :as utils]
[status-im.js-dependencies :as dependencies]))
[status-im.js-dependencies :as dependencies]
[taoensso.timbre :as log]))

(defn- transform-message [{:keys [content] :as message}]
(when-let [parsed-content (utils/safe-read-message-content content)]
@@ -78,7 +79,7 @@
(assoc cofx :get-stored-messages get-by-chat-id)))

(defn- sha3 [s]
(.sha3 dependencies/Web3.prototype s))
(.sha3 (dependencies/web3-prototype) s))

(re-frame/reg-cofx
:data-store/get-referenced-messages

+ 4
- 3
src/status_im/data_store/realm/core.cljs View File

@@ -154,7 +154,7 @@
(open-realm (last schemas) file-name encryption-key))

(defn keccak512-array [key]
(.array (.-keccak512 js-dependencies/js-sha3) key))
(.array (.-keccak512 (js-dependencies/js-sha3)) key))

(defn merge-Uint8Arrays [arr1 arr2]
(let [arr1-length (.-length arr1)
@@ -165,8 +165,9 @@
arr))

(defn db-encryption-key [password encryption-key]
(let [password-array (.encode
(new (.-TextEncoder js-dependencies/text-encoding))
(let [TextEncoder (.-TextEncoder (js-dependencies/text-encoding))
password-array (.encode
(new TextEncoder)
password)]
(keccak512-array (merge-Uint8Arrays encryption-key password-array))))


+ 1
- 1
src/status_im/data_store/realm/schemas/account/migrations.cljs View File

@@ -191,7 +191,7 @@
"status-im.transport.message.protocol"))

(defn sha3 [s]
(.sha3 dependencies/Web3.prototype s))
(.sha3 (dependencies/web3-prototype) s))

(defn old-message-id
"Calculates the same `message-id` as was used in `0.9.31`"

+ 3
- 3
src/status_im/desktop/core.cljs View File

@@ -24,14 +24,14 @@
(reagent/create-class
{:component-will-mount
(fn []
(.addEventListener react/app-state "change" app-state-change-handler))
(.addEventListener (react/app-state) "change" app-state-change-handler))
:component-did-mount
(fn [this]
(re-frame/dispatch [:set-initial-props (reagent/props this)]))
:component-will-unmount
(fn []
(.stop react/http-bridge)
(.removeEventListener react/app-state "change" app-state-change-handler))
(.stop (react/http-bridge))
(.removeEventListener (react/app-state) "change" app-state-change-handler))
:display-name "root"
:reagent-render views/main})
(reagent/create-class

+ 3
- 3
src/status_im/dev_server/core.cljs View File

@@ -11,14 +11,14 @@
"Status Android"))

(defn respond! [request-id status-code data]
(.respond react/http-bridge
(.respond (react/http-bridge)
request-id
status-code
"application/json"
(types/clj->json data)))

(defn start! []
(.start react/http-bridge
(.start (react/http-bridge)
port
server-name
(fn [req]
@@ -33,4 +33,4 @@
(log/debug "Error: " e))))))

(defn stop! []
(.stop react/http-bridge))
(.stop (react/http-bridge)))

+ 11
- 11
src/status_im/ethereum/abi_spec.cljs View File

@@ -4,54 +4,54 @@
[status-im.js-dependencies :as dependencies]))
;; Utility functions for encoding

(def utils dependencies/web3-utils)
(defn utils [] (dependencies/web3-utils))

(defn right-pad [x]
(let [len (count x)
to-pad (- 64 (mod len 64))]
(if (= 64 to-pad)
x
(.rightPad utils x (+ len to-pad)))))
(.rightPad (utils) x (+ len to-pad)))))

(defn left-pad [x]
(let [len (count x)
to-pad (- 64 (mod len 64))]
(if (= 64 to-pad)
x
(.leftPad utils x (+ len to-pad)))))
(.leftPad (utils) x (+ len to-pad)))))

(defn to-two-complement [x]
(when x
(subs (.toTwosComplement utils x) 2)))
(subs (.toTwosComplement (utils) x) 2)))

(defn from-utf8 [x]
(when x
(subs (.fromUtf8 utils x) 2)))
(subs (.fromUtf8 (utils) x) 2)))

(defn hex-to-boolean [x]
(= x "0x0"))

(defn bytes-to-hex [x]
(when x
(subs (.bytesToHex utils x) 2)))
(subs (.bytesToHex (utils) x) 2)))

(defn number-to-hex [x]
(when x
(subs (.numberToHex utils x) 2)))
(subs (.numberToHex (utils) x) 2)))

(defn hex-to-utf8 [x]
(.hexToUtf8 utils (str "0x" x)))
(.hexToUtf8 (utils) (str "0x" x)))

(defn hex-to-number [x]
(when x
(let [hex-x (str "0x" x)]
(try
(.hexToNumber utils hex-x)
(.hexToNumber (utils) hex-x)
(catch :default err
(.hexToNumberString utils hex-x))))))
(.hexToNumberString (utils) hex-x))))))

(defn sha3 [s]
(.sha3 utils (str s)))
(.sha3 (utils) (str s)))

(defn is-hex? [value]
(when value

+ 3
- 3
src/status_im/ethereum/core.cljs View File

@@ -49,7 +49,7 @@

(defn address? [s]
(when s
(.isAddress dependencies/Web3.prototype s)))
(.isAddress (dependencies/web3-prototype) s)))

(defn network->chain-id [network]
(get-in network [:config :NetworkId]))
@@ -70,9 +70,9 @@

(defn sha3
([s]
(.sha3 dependencies/Web3.prototype (str s)))
(.sha3 (dependencies/web3-prototype) (str s)))
([s opts]
(.sha3 dependencies/Web3.prototype (str s) (clj->js opts))))
(.sha3 (dependencies/web3-prototype) (str s) (clj->js opts))))

(def default-transaction-gas (money/bignumber 21000))


+ 3
- 3
src/status_im/ethereum/eip55.cljs View File

@@ -7,15 +7,15 @@
(:require [clojure.string :as string]
[status-im.js-dependencies :as dependencies]))

(def utils dependencies/web3-utils)
(defn utils [] (dependencies/web3-utils))

(defn address->checksum
"Converts an arbitrary case address to one with correct checksum case."
[address]
(when address
(.toChecksumAddress utils address)))
(.toChecksumAddress (utils) address)))

(defn valid-address-checksum?
"Checks address checksum validity."
[address]
(.checkAddressChecksum utils address))
(.checkAddressChecksum (utils) address))

+ 24
- 6
src/status_im/ethereum/macros.clj View File

@@ -4,10 +4,19 @@

(defn token-icon-path
[network symbol]
(let [s (str "./resources/images/tokens/" (name network) "/" (name symbol) ".png")]
(let [s (str "./resources/images/tokens/" (name network) "/" (name symbol) ".png")
image (gensym)]
(if (.exists (io/file s))
`(js/require ~s)
`(js/require "./resources/images/tokens/default-token.png"))))
`(let [~image (atom nil)]
(fn []
(or @~image
(reset! ~image (js/require ~s)))))
`(let [~image (atom nil)]
(fn []
(or
@~image
(reset! ~image
(js/require "./resources/images/tokens/default-token.png"))))))))

(defn- token->icon [network {:keys [icon symbol]}]
;; Tokens can define their own icons.
@@ -21,10 +30,19 @@
(mapv #(assoc-in % [:icon :source] (token->icon network %)) tokens))

(defn network->icon [network]
(let [s (str "./resources/images/tokens/" (name network) "/0-native.png")]
(let [s (str "./resources/images/tokens/" (name network) "/0-native.png")
image (gensym)]
(if (.exists (io/file s))
`(js/require ~s)
`(js/require "./resources/images/tokens/default-native.png"))))
`(let [~image (atom nil)]
(fn []
(or @~image
(reset! ~image (js/require ~s)))))
`(let [~image (atom nil)]
(fn []
(or
@~image
(reset! ~image
(js/require "./resources/images/tokens/default-native.png"))))))))

(defmacro resolve-native-currency-icons
"In react-native arguments to require must be static strings.

+ 7
- 5
src/status_im/ethereum/tokens.cljs View File

@@ -7,10 +7,12 @@
{:border-color color :border-width 1 :border-radius 32})

(def default-native-currency
{:name "Native"
:symbol :ETH
:decimals 18
:icon {:source (js/require "./resources/images/tokens/default-native.png")}})
(memoize
(fn []
{:name "Native"
:symbol :ETH
:decimals 18
:icon {:source (js/require "./resources/images/tokens/default-native.png")}})))

(def all-native-currencies
(ethereum.macros/resolve-native-currency-icons
@@ -40,7 +42,7 @@
(set (map #(-> % val :symbol) all-native-currencies)))

(defn native-currency [chain]
(-> (get all-native-currencies chain default-native-currency)))
(-> (get all-native-currencies chain (default-native-currency))))

(defn ethereum? [symbol]
(native-currency-symbols symbol))

+ 1
- 1
src/status_im/events.cljs View File

@@ -184,7 +184,7 @@
(def CUD-url "https://chaos-unicorn-day.org")

(defn open-chaos-unicorn-day-link []
(.openURL react/linking CUD-url))
(.openURL (react/linking) CUD-url))

(handlers/register-handler-fx
:accounts.ui/chaos-mode-switched

+ 5
- 5
src/status_im/extensions/capacities/components.cljs View File

@@ -47,8 +47,8 @@
[tooltip/tooltip error (styles/error error)])])

(defn touchable-opacity [{:keys [style on-press]} & children]
(into [react/touchable-opacity (merge (when on-press {:on-press #(on-press {})})
(when style {:style style}))] children))
(into [(react/touchable-opacity) (merge (when on-press {:on-press #(on-press {})})
(when style {:style style}))] children))

(defn image [{:keys [source uri style]}]
[react/image (merge {:style (merge {:width 100 :height 100} style)} {:source (if source source {:uri uri})})])
@@ -57,7 +57,7 @@
[react/text (merge {:style {:color colors/white
:text-decoration-line :underline}
:on-press (case open-in
:device #(.openURL react/linking uri)
:device #(.openURL (react/linking) uri)
:status #(re-frame/dispatch [:browser.ui/open-in-status-option-selected uri])
#(re-frame/dispatch [:browser.ui/message-link-pressed uri]))}
(when style {:style style}))
@@ -119,7 +119,7 @@
(apply abstract-view react/view o children))

(defn scroll-view [o & children]
(apply abstract-view react/scroll-view o children))
(apply abstract-view (react/scroll-view) o children))

(defn keyboard-avoiding-view [o & children]
(apply abstract-view react/keyboard-avoiding-view o children))
@@ -158,4 +158,4 @@
:fly? :boolean
:interactive? :boolean
:on-change :event}}
'map-link {:data map-link :properties {:text :string :lng :any :lat :any}}})
'map-link {:data map-link :properties {:text :string :lng :any :lat :any}}})

+ 6
- 4
src/status_im/extensions/capacities/map.cljs View File

@@ -14,7 +14,9 @@
(def mapview-html (slurp "resources/mapview/mapview.html"))

(def webview-class
(reagent/adapt-react-class (.-WebView js-dependencies/webview)))
(memoize
(fn []
(reagent/adapt-react-class (.-WebView js-dependencies/webview)))))

(defn map-component
"creates a webview reagent component which cause webview to be updated only when style changes.
@@ -32,7 +34,7 @@
false)))
:reagent-render
(fn [opts]
[webview-class opts])}))
[(webview-class) opts])}))

(defn- on-map-message [map-event on-change]
(let [data (-> map-event
@@ -69,7 +71,7 @@
:on-should-start-load-with-request #(let [url (.-url %)]
(if (string/starts-with? url "file")
true
(do (.openURL react/linking url) false)))
(do (.openURL (react/linking) url) false)))

:ref #(reset! webview %)
:on-message #(when on-change (on-map-message % on-change))
@@ -78,4 +80,4 @@
(if (map? marker)
(str "update(" (types/clj->json (assoc marker :fly fly? :interactive interactive?)) ");")
(str "init(" (types/clj->json {:interactive interactive?}) ");")))}
webview]))
webview]))

+ 2
- 2
src/status_im/group_chats/core.cljs View File

@@ -220,7 +220,7 @@
:db (assoc db :group/selected-contacts #{})}
(mailserver/upsert-mailserver-topic
{:chat-ids [chat-id]
:topic transport.topic/discovery-topic-hash
:topic (transport.topic/discovery-topic-hash)
:fetch? false})
(mailserver/process-next-messages-request))))

@@ -257,7 +257,7 @@
:events [event]}}
(mailserver/upsert-mailserver-topic
{:chat-ids [chat-id]
:topic transport.topic/discovery-topic-hash
:topic (transport.topic/discovery-topic-hash)
:fetch false})
(mailserver/process-next-messages-request)))))


+ 27
- 27
src/status_im/hardwallet/card.cljs View File

@@ -2,11 +2,11 @@
(:require [re-frame.core :as re-frame]
[status-im.react-native.js-dependencies :as js-dependencies]
[status-im.utils.config :as config]
[status-im.utils.platform :as platform]
[taoensso.timbre :as log]))
[status-im.utils.platform :as platform]))

(defonce keycard (.-default js-dependencies/status-keycard))
(defonce event-emitter (.-DeviceEventEmitter js-dependencies/react-native))
(defn keycard [] (.-default (js-dependencies/status-keycard)))
(defn event-emitter []
(.-DeviceEventEmitter js-dependencies/react-native))

(defn- error-object->map [object]
{:code (.-code object)
@@ -15,24 +15,24 @@
(defn check-nfc-support []
(when (and config/hardwallet-enabled?
platform/android?)
(.. keycard
(.. (keycard)
nfcIsSupported
(then #(re-frame/dispatch [:hardwallet.callback/check-nfc-support-success %])))))

(defn check-nfc-enabled []
(when (and config/hardwallet-enabled?
platform/android?)
(.. keycard
(.. (keycard)
nfcIsEnabled
(then #(re-frame/dispatch [:hardwallet.callback/check-nfc-enabled-success %])))))

(defn open-nfc-settings []
(when platform/android?
(.openNfcSettings keycard)))
(.openNfcSettings (keycard))))

(defn remove-event-listeners []
(doseq [event ["keyCardOnConnected" "keyCardOnDisconnected"]]
(.removeAllListeners event-emitter event)))
(.removeAllListeners (event-emitter) event)))

(defn register-card-events []
(when (and config/hardwallet-enabled?)
@@ -41,38 +41,38 @@

(re-frame/dispatch [:hardwallet.callback/on-register-card-events
{:on-card-connected
(.addListener event-emitter
(.addListener (event-emitter)
"keyCardOnConnected"
#(re-frame/dispatch [:hardwallet.callback/on-card-connected %]))

:on-card-disconnected
(.addListener event-emitter
(.addListener (event-emitter)
"keyCardOnDisconnected"
#(re-frame/dispatch [:hardwallet.callback/on-card-disconnected %]))}])))

(defn get-application-info [{:keys [pairing on-success]}]
(.. keycard
(.. (keycard)
(getApplicationInfo (str pairing))
(then #(re-frame/dispatch [:hardwallet.callback/on-get-application-info-success % on-success]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-get-application-info-error (error-object->map %)]))))

(defn install-applet []
(when config/hardwallet-enabled?
(.. keycard
(.. (keycard)
installApplet
(then #(re-frame/dispatch [:hardwallet.callback/on-install-applet-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-install-applet-error (error-object->map %)])))))

(defn init-card [pin]
(when config/hardwallet-enabled?
(.. keycard
(.. (keycard)
(init pin)
(then #(re-frame/dispatch [:hardwallet.callback/on-init-card-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-init-card-error (error-object->map %)])))))

(defn install-applet-and-init-card [pin]
(when config/hardwallet-enabled?
(.. keycard
(.. (keycard)
(installAppletAndInitCard pin)
(then #(re-frame/dispatch [:hardwallet.callback/on-install-applet-and-init-card-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-install-applet-and-init-card-error (error-object->map %)])))))
@@ -80,7 +80,7 @@
(defn pair
[{:keys [password]}]
(when password
(.. keycard
(.. (keycard)
(pair password)
(then #(re-frame/dispatch [:hardwallet.callback/on-pairing-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-pairing-error (error-object->map %)])))))
@@ -88,7 +88,7 @@
(defn generate-mnemonic
[{:keys [pairing words]}]
(when pairing
(.. keycard
(.. (keycard)
(generateMnemonic pairing words)
(then #(re-frame/dispatch [:hardwallet.callback/on-generate-mnemonic-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-generate-mnemonic-error (error-object->map %)])))))
@@ -96,7 +96,7 @@
(defn generate-and-load-key
[{:keys [mnemonic pairing pin]}]
(when pairing
(.. keycard
(.. (keycard)
(generateAndLoadKey mnemonic pairing pin)
(then #(re-frame/dispatch [:hardwallet.callback/on-generate-and-load-key-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-generate-and-load-key-error (error-object->map %)])))))
@@ -104,7 +104,7 @@
(defn unblock-pin
[{:keys [puk new-pin pairing]}]
(when (and pairing new-pin puk)
(.. keycard
(.. (keycard)
(unblockPin pairing puk new-pin)
(then #(re-frame/dispatch [:hardwallet.callback/on-unblock-pin-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-unblock-pin-error (error-object->map %)])))))
@@ -112,7 +112,7 @@
(defn verify-pin
[{:keys [pin pairing]}]
(when (and pairing (not-empty pin))
(.. keycard
(.. (keycard)
(verifyPin pairing pin)
(then #(re-frame/dispatch [:hardwallet.callback/on-verify-pin-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-verify-pin-error (error-object->map %)])))))
@@ -120,7 +120,7 @@
(defn change-pin
[{:keys [current-pin new-pin pairing]}]
(when (and pairing current-pin new-pin)
(.. keycard
(.. (keycard)
(changePin pairing current-pin new-pin)
(then #(re-frame/dispatch [:hardwallet.callback/on-change-pin-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-change-pin-error (error-object->map %)])))))
@@ -128,28 +128,28 @@
(defn unpair
[{:keys [pin pairing]}]
(when (and pairing pin)
(.. keycard
(.. (keycard)
(unpair pairing pin)
(then #(re-frame/dispatch [:hardwallet.callback/on-unpair-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-unpair-error (error-object->map %)])))))

(defn delete
[]
(.. keycard
(.. (keycard)
(delete)
(then #(re-frame/dispatch [:hardwallet.callback/on-delete-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-delete-error (error-object->map %)]))))

(defn remove-key
[{:keys [pin pairing]}]
(.. keycard
(.. (keycard)
(removeKey pairing pin)
(then #(re-frame/dispatch [:hardwallet.callback/on-remove-key-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-remove-key-error (error-object->map %)]))))

(defn remove-key-with-unpair
[{:keys [pin pairing]}]
(.. keycard
(.. (keycard)
(removeKeyWithUnpair pairing pin)
(then #(re-frame/dispatch [:hardwallet.callback/on-remove-key-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-remove-key-error (error-object->map %)]))))
@@ -157,7 +157,7 @@
(defn unpair-and-delete
[{:keys [pin pairing]}]
(when (and pairing pin)
(.. keycard
(.. (keycard)
(unpairAndDelete pairing pin)
(then #(re-frame/dispatch [:hardwallet.callback/on-delete-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-delete-error (error-object->map %)])))))
@@ -165,7 +165,7 @@
(defn get-keys
[{:keys [pairing pin on-success]}]
(when (and pairing (not-empty pin))
(.. keycard
(.. (keycard)
(getKeys pairing pin)
(then #(re-frame/dispatch [(or on-success :hardwallet.callback/on-get-keys-success) %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-get-keys-error (error-object->map %)])))))
@@ -173,7 +173,7 @@
(defn sign
[{:keys [pairing pin hash]}]
(when (and pairing pin hash)
(.. keycard
(.. (keycard)
(sign pairing pin hash)
(then #(re-frame/dispatch [:hardwallet.callback/on-sign-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-sign-error (error-object->map %)])))))

+ 7
- 7
src/status_im/ios/core.cljs View File

@@ -27,21 +27,21 @@
(reagent/create-class
{:component-will-mount
(fn []
(.addListener react/keyboard
(.addListener (react/keyboard)
"keyboardWillShow"
(fn [e]
(let [h (.. e -endCoordinates -height)]
(when-not (= h @keyboard-height)
(dispatch [:set :keyboard-height h])
(dispatch [:set :keyboard-max-height h])))))
(.addListener react/keyboard
(.addListener (react/keyboard)
"keyboardWillHide"
#(when-not (= 0 @keyboard-height)
(dispatch [:set :keyboard-height 0])))
(.hide react/splash-screen)
(.addEventListener react/app-state "change" app-state-change-handler)
(.addEventListener (react/app-state) "change" app-state-change-handler)
(.addEventListener rn-dependencies/react-native-languages "change" on-languages-change)
(.addEventListener rn-dependencies/react-native-shake
(.addEventListener (rn-dependencies/react-native-shake)
"ShakeEvent"
on-shake))
:component-did-mount
@@ -49,10 +49,10 @@
(dispatch [:set-initial-props (reagent/props this)]))
:component-will-unmount
(fn []
(.stop react/http-bridge)
(.removeEventListener react/app-state "change" app-state-change-handler)
(.stop (react/http-bridge))
(.removeEventListener (react/app-state) "change" app-state-change-handler)
(.removeEventListener rn-dependencies/react-native-languages "change" on-languages-change)
(.removeEventListener rn-dependencies/react-native-shake
(.removeEventListener (rn-dependencies/react-native-shake)
"ShakeEvent"
on-shake))
:display-name "root"

+ 13
- 11
src/status_im/js_dependencies.cljs View File

@@ -1,12 +1,14 @@
(ns status-im.js-dependencies)
(ns status-im.js-dependencies
(:require-macros [status-im.utils.js-require :as js-require]))

(def Chance (js/require "chance"))
(def emojis (js/require "emojilib"))
(def phishing-detect (js/require "eth-phishing-detect"))
(def homoglyph-finder (js/require "homoglyph-finder"))
(def identicon-js (js/require "identicon.js"))
(def Web3 (js/require "web3"))
(def text-encoding (js/require "text-encoding"))
(def js-sha3 (js/require "js-sha3"))
(def web3-utils (js/require "web3-utils"))
(def hi-base32 (js/require "hi-base32"))
(def Chance (js-require/js-require "chance"))
(def emojis (js-require/js-require "emojilib"))
(def phishing-detect (js-require/js-require "eth-phishing-detect"))
(def homoglyph-finder (js-require/js-require "homoglyph-finder"))
(def identicon-js (js-require/js-require "identicon.js"))
(def Web3 (js-require/js-require "web3"))
(defn web3-prototype [] (.-prototype (Web3)))
(def text-encoding (js-require/js-require "text-encoding"))
(def js-sha3 (js-require/js-require "js-sha3"))
(def web3-utils (js-require/js-require "web3-utils"))
(def hi-base32 (js-require/js-require "hi-base32"))

+ 1
- 1
src/status_im/mailserver/core.cljs View File

@@ -517,7 +517,7 @@
[{:keys [db] :as cofx} chat-id]
(let [{:keys [public?] :as chat} (get-in db [:chats chat-id])
topic (if (and chat (not public?))
transport.topic/discovery-topic-hash
(transport.topic/discovery-topic-hash)
(get-in db [:transport/chats chat-id :topic]))
{:keys [chat-ids] :as mailserver-topic} (update (get-in db [:mailserver/topics topic])
:chat-ids

+ 67
- 67
src/status_im/native_module/impl/module.cljs View File

@@ -5,7 +5,7 @@
[clojure.string :as string]
[status-im.utils.platform :as platform]))

(def status
(defn status []
(when (exists? (.-NativeModules rn-dependencies/react-native))
(.-Status (.-NativeModules rn-dependencies/react-native))))

@@ -20,20 +20,20 @@

(defn stop-node []
(reset! node-started false)
(when status
(.stopNode status)))
(when (status)
(.stopNode (status))))

(defn node-ready []
(reset! node-started true))

(defn start-node [config]
(when status
(.startNode status config)))
(when (status)
(.startNode (status) config)))

(defonce account-creation? (atom false))

(defn create-account [password on-result]
(when status
(when (status)
(let [callback (fn [data]
(reset! account-creation? false)
(on-result data))]
@@ -41,132 +41,132 @@
(fn [creation?]
(if-not creation?
(do
(.createAccount status password callback)
(.createAccount (status) password callback)
true)
false))))))

(defn send-data-notification [{:keys [data-payload tokens] :as m} on-result]
(when status
(.sendDataNotification status data-payload tokens on-result)))
(when (status)
(.sendDataNotification (status) data-payload tokens on-result)))

(defn send-logs [dbJson js-logs callback]
(when status
(.sendLogs status dbJson js-logs callback)))
(when (status)
(.sendLogs (status) dbJson js-logs callback)))

(defn add-peer [enode on-result]
(when (and @node-started status)
(.addPeer status enode on-result)))
(when (and @node-started (status))
(.addPeer (status) enode on-result)))

(defn recover-account [passphrase password on-result]
(when (and @node-started status)
(.recoverAccount status passphrase password on-result)))
(when (and @node-started (status))
(.recoverAccount (status) passphrase password on-result)))

(defn login [address password on-result]
(when (and @node-started status)
(.login status address password on-result)))
(when (and @node-started (status))
(.login (status) address password on-result)))

(defn verify [address password on-result]
(when (and @node-started status)
(.verify status address password on-result)))
(when (and @node-started (status))
(.verify (status) address password on-result)))

(defn login-with-keycard [whisper-private-key encryption-public-key on-result]
(when (and @node-started status)
(.loginWithKeycard status whisper-private-key encryption-public-key on-result)))
(when (and @node-started (status))
(.loginWithKeycard (status) whisper-private-key encryption-public-key on-result)))

(defn set-soft-input-mode [mode]
(when status
(.setSoftInputMode status mode)))
(when (status)
(.setSoftInputMode (status) mode)))

(defn clear-web-data []
(when status
(.clearCookies status)
(.clearStorageAPIs status)))
(when (status)
(.clearCookies (status))
(.clearStorageAPIs (status))))

(defn call-rpc [payload callback]
(when (and @node-started status)
(.callRPC status payload callback)))
(when (and @node-started (status))
(.callRPC (status) payload callback)))

(defn call-private-rpc [payload callback]
(when (and @node-started status)
(.callPrivateRPC status payload callback)))
(when (and @node-started (status))
(.callPrivateRPC (status) payload callback)))

(defn sign-message [rpcParams callback]
(when (and @node-started status)
(.signMessage status rpcParams callback)))
(when (and @node-started (status))
(.signMessage (status) rpcParams callback)))

(defn hash-transaction [rpcParams callback]
(when (and @node-started status)
(.hashTransaction status rpcParams callback)))
(when (and @node-started (status))
(.hashTransaction (status) rpcParams callback)))

(defn hash-message [message callback]
(when (and @node-started status)
(.hashMessage status message callback)))
(when (and @node-started (status))
(.hashMessage (status) message callback)))

(defn hash-typed-data [data callback]
(when (and @node-started status)
(.hashTypedData status data callback)))
(when (and @node-started (status))
(.hashTypedData (status) data callback)))

(defn sign-typed-data [data password callback]
(when (and @node-started status)
(.signTypedData status data password callback)))
(when (and @node-started (status))
(.signTypedData (status) data password callback)))

(defn send-transaction [rpcParams password callback]
(when (and @node-started status)
(.sendTransaction status rpcParams password callback)))
(when (and @node-started (status))
(.sendTransaction (status) rpcParams password callback)))

(defn send-transaction-with-signature [rpcParams sig callback]
(when (and @node-started status)
(.sendTransactionWithSignature status rpcParams sig callback)))
(when (and @node-started (status))
(.sendTransactionWithSignature (status) rpcParams sig callback)))

(defn close-application []
(.closeApplication status))
(.closeApplication (status)))

(defn connection-change [{:keys [type expensive?]}]
(.connectionChange status type expensive?))
(.connectionChange (status) type expensive?))

(defn app-state-change [state]
(.appStateChange status state))
(.appStateChange (status) state))

(defn get-device-UUID [callback]
(.getDeviceUUID
status
(status)
(fn [UUID]
(callback (string/upper-case UUID)))))

(defn set-blank-preview-flag [flag]
(.setBlankPreviewFlag status flag))
(.setBlankPreviewFlag (status) flag))

(defn extract-group-membership-signatures [signature-pairs callback]
(when status
(.extractGroupMembershipSignatures status signature-pairs callback)))
(when (status)
(.extractGroupMembershipSignatures (status) signature-pairs callback)))

(defn sign-group-membership [content callback]
(when status
(.signGroupMembership status content callback)))
(when (status)
(.signGroupMembership (status) content callback)))

(defn enable-installation [installation-id callback]
(when status
(.enableInstallation status installation-id callback)))
(when (status)
(.enableInstallation (status) installation-id callback)))

(defn disable-installation [installation-id callback]
(when status
(.disableInstallation status installation-id callback)))
(when (status)
(.disableInstallation (status) installation-id callback)))

(defn is24Hour []
(when status
(.-is24Hour status)))
(when (status)
(.-is24Hour (status))))

(defn update-mailservers [enodes on-result]
(when status
(.updateMailservers status enodes on-result)))
(when (status)
(.updateMailservers (status) enodes on-result)))

(defn chaos-mode-update [on on-result]
(when status
(.chaosModeUpdate status on on-result)))
(when (status)
(.chaosModeUpdate (status) on on-result)))

(defn get-nodes-from-contract [rpc-endpoint contract-address on-result]
(when status
(.getNodesFromContract status rpc-endpoint contract-address on-result)))
(when (status)
(.getNodesFromContract (status) rpc-endpoint contract-address on-result)))

(defn rooted-device? [callback]
(cond
@@ -181,8 +181,8 @@

;; we check root on android
platform/android?
(if status
(.isDeviceRooted status callback)
(if (status)
(.isDeviceRooted (status) callback)
;; if module isn't initialized we return true to avoid degrading security
(callback true))


+ 9
- 9
src/status_im/network/net_info.cljs View File

@@ -4,8 +4,8 @@
[status-im.utils.platform :as platform]))

(defn is-connected? [callback]
(when react-components/net-info
(.then (.fetch (.-isConnected react-components/net-info))
(when (react-components/net-info)
(.then (.fetch (.-isConnected (react-components/net-info)))
(fn [is-connected?]
(log/debug "Is connected?" is-connected?)
(callback is-connected?)))))
@@ -16,21 +16,21 @@
on-success #(callback {:type (:type info) :expensive? %})]
(if platform/ios?
(on-success false)
(.. react-components/net-info
(.. (react-components/net-info)
isConnectionExpensive
(then on-success)
(catch (fn [error] (log/warn "isConnectionExpensive: " error))))))))

(defn net-info [callback]
(when react-components/net-info
(.then (.getConnectionInfo react-components/net-info)
(when (react-components/net-info)
(.then (.getConnectionInfo (react-components/net-info))
(wrap-net-info callback))))

(defn add-connection-listener [listener]
(when react-components/net-info
(.addEventListener (.-isConnected react-components/net-info) "connectionChange" listener)))
(when (react-components/net-info)
(.addEventListener (.-isConnected (react-components/net-info)) "connectionChange" listener)))

(defn add-net-info-listener [listener]
(when react-components/net-info
(.addEventListener react-components/net-info "connectionChange"
(when (react-components/net-info)
(.addEventListener (react-components/net-info) "connectionChange"