Skip to content

Commit

Permalink
Merge branch 'develop' into jc/scan-screen
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Son89 authored May 21, 2024
2 parents 1020f07 + b3361b7 commit c61e480
Show file tree
Hide file tree
Showing 23 changed files with 108 additions and 131 deletions.
57 changes: 20 additions & 37 deletions resources/config/fleets.json

Large diffs are not rendered by default.

Binary file removed resources/images/services/Latamex@2x.png
Binary file not shown.
Binary file removed resources/images/services/Latamex@3x.png
Binary file not shown.
Binary file removed resources/images/services/Moonpay@2x.png
Binary file not shown.
Binary file removed resources/images/services/Moonpay@3x.png
Binary file not shown.
Binary file removed resources/images/services/Ramp@2x.png
Binary file not shown.
Binary file removed resources/images/services/Ramp@3x.png
Binary file not shown.
3 changes: 1 addition & 2 deletions src/legacy/status_im/fleet/core_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
(testing "it returns the default fleets"
(is (=
#{:eth.prod
:eth.staging
:eth.test}
:eth.staging}
(into #{}
(keys (node/fleets {})))))))
(testing "passing a custom fleet"
Expand Down
9 changes: 0 additions & 9 deletions src/status_im/common/resources.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,6 @@
:user-picture-male4 (js/require "../resources/images/mock2/user_picture_male4.png")
:user-picture-male5 (js/require "../resources/images/mock2/user_picture_male5.png")})

(def services
{:latamex (js/require "../resources/images/services/Latamex.png")
:moonpay (js/require "../resources/images/services/Moonpay.png")
:ramp (js/require "../resources/images/services/Ramp.png")})

(defn get-service-image
[k]
(get services k))

(defn get-mock-image
[k]
(get mock-images k))
Expand Down
3 changes: 2 additions & 1 deletion src/status_im/common/signals/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
(let [^js data (.parse js/JSON event-str)
^js event-js (.-event data)
type (.-type data)]
(log/debug "Signal received" event-str)
(log/debug "Signal received" {:type type})
(log/trace "Signal received" {:payload event-str})
(case type
"node.login" {:fx [[:dispatch
[:profile.login/login-node-signal
Expand Down
8 changes: 4 additions & 4 deletions src/status_im/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@
["enrtree://AL65EKLJAUXKKPG43HVTML5EFFWEZ7L4LOKTLZCLJASG4DSESQZEC@prod.status.nodes.status.im"]
:status.test
["enrtree://AIO6LUM3IVWCU2KCPBBI6FEH2W42IGK3ASCZHZGG5TIXUR56OGQUO@test.status.nodes.status.im"]
:wakuv2.prod
["enrtree://ANEDLO25QVUGJOUTQFRYKWX6P4Z4GKVESBMHML7DZ6YK4LGS5FC5O@prod.wakuv2.nodes.status.im"]
:wakuv2.test
["enrtree://AO47IDOLBKH72HIZZOXQP6NMRESAN7CHYWIBNXDXWRJRZWLODKII6@test.wakuv2.nodes.status.im"]})
:waku.sandbox
["enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im"]
:waku.test
["enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im"]})

(def default-kdf-iterations 3200)

Expand Down
25 changes: 17 additions & 8 deletions src/status_im/contexts/communities/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@

(rf/reg-event-fx :chat.ui/community-failed-to-fetch community-failed-to-fetch)

(defn- failed-to-fetch-community
[community-id err]
(rf/dispatch [:chat.ui/community-failed-to-fetch community-id])
(log/error {:message
"Failed to request community info from mailserver"
:error err}))

(defn fetch-community
[{:keys [db]} [{:keys [community-id update-last-opened-at?]}]]
(when (and community-id (not (get-in db [:communities/fetching-communities community-id])))
Expand All @@ -250,14 +257,16 @@
:TryDatabase true
:WaitForResponse true}]
:on-success (fn [community]
(when update-last-opened-at?
(rf/dispatch [:communities/update-last-opened-at community-id]))
(rf/dispatch [:chat.ui/community-fetched community-id community]))
:on-error (fn [err]
(rf/dispatch [:chat.ui/community-failed-to-fetch community-id])
(log/error {:message
"Failed to request community info from mailserver"
:error err}))}]}))
(if community
(do (when update-last-opened-at?
(rf/dispatch [:communities/update-last-opened-at
community-id]))
(rf/dispatch [:chat.ui/community-fetched community-id
community]))
(failed-to-fetch-community
community-id
"community wasn't found at the store node")))
:on-error (partial failed-to-fetch-community community-id)}]}))

(schema/=> fetch-community
[:=>
Expand Down
43 changes: 0 additions & 43 deletions src/status_im/contexts/wallet/common/temp.cljs

This file was deleted.

17 changes: 17 additions & 0 deletions src/status_im/contexts/wallet/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -521,3 +521,20 @@
activities (cske/transform-keys transforms/->kebab-case-keyword activities)
sorted-activities (sort :timestamp activities)]
{:db (assoc-in db [:wallet :activities] sorted-activities)})))

(rf/reg-event-fx
:wallet/get-crypto-on-ramps-success
(fn [{:keys [db]} [data]]
{:db (assoc-in db
[:wallet :crypto-on-ramps]
(cske/transform-keys transforms/->kebab-case-keyword data))}))

(rf/reg-event-fx
:wallet/get-crypto-on-ramps
(fn [_]
{:fx [[:json-rpc/call
[{:method "wallet_getCryptoOnRamps"
:on-success [:wallet/get-crypto-on-ramps-success]
:on-error #(log/info "failed to fetch crypto on ramps"
{:error %
:event :wallet/get-crypto-on-ramps})}]]]}))
9 changes: 3 additions & 6 deletions src/status_im/contexts/wallet/send/input_amount/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
[status-im.contexts.wallet.send.routes.view :as routes]
[status-im.contexts.wallet.send.utils :as send-utils]
[status-im.contexts.wallet.sheets.unpreferred-networks-alert.view :as unpreferred-networks-alert]
[utils.address :as address]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.money :as money]
Expand All @@ -35,7 +34,7 @@
(str currency-symbol amount))

(defn- estimated-fees
[{:keys [loading-routes? fees amount receiver]}]
[{:keys [loading-routes? fees amount]}]
[rn/view {:style style/estimated-fees-container}
[rn/view {:style style/estimated-fees-content-container}
[quo/button
Expand All @@ -59,7 +58,7 @@
:label :none
:status (if loading-routes? :loading :default)
:size :small
:title (i18n/label :t/user-gets {:name receiver})
:title (i18n/label :t/recipient-gets)
:subtitle amount}]])

(defn- every-network-value-is-zero?
Expand Down Expand Up @@ -162,7 +161,6 @@
loading-routes? (rf/sub
[:wallet/wallet-send-loading-suggested-routes?])
route (rf/sub [:wallet/wallet-send-route])
to-address (rf/sub [:wallet/wallet-send-to-address])
on-confirm (or default-on-confirm handle-on-confirm)
crypto-decimals (or token-decimals default-crypto-decimals)
current-crypto-limit (or default-limit-crypto
Expand Down Expand Up @@ -332,8 +330,7 @@
[estimated-fees
{:loading-routes? loading-routes?
:fees fee-formatted
:amount amount-text
:receiver (address/get-shortened-key to-address)}])
:amount amount-text}])
(when (or no-routes-found? limit-insufficient?)
[rn/view {:style style/no-routes-found-container}
[quo/info-message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
:subtitle subtitle}])

(defn- transaction-details
[{:keys [estimated-time-min max-fees token-display-name amount to-address to-network route
[{:keys [estimated-time-min max-fees token-display-name amount to-network route
transaction-type
theme]}]
(let [currency-symbol (rf/sub [:profile/currency-symbol])
Expand Down Expand Up @@ -201,7 +201,7 @@
{:title (if (= transaction-type :tx/bridge)
(i18n/label :t/bridged-to
{:network (:abbreviated-name to-network)})
(i18n/label :t/user-gets {:name (utils/get-shortened-address to-address)}))
(i18n/label :t/recipient-gets))
:subtitle (str amount " " token-display-name)}]]
:else
[quo/text {:style {:align-self :center}}
Expand Down Expand Up @@ -297,7 +297,6 @@
:max-fees max-fees
:token-display-name token-display-name
:amount amount
:to-address to-address
:to-network bridge-to-network
:theme theme
:route route
Expand Down
35 changes: 27 additions & 8 deletions src/status_im/contexts/wallet/sheets/buy_token/view.cljs
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
(ns status-im.contexts.wallet.sheets.buy-token.view
(:require [quo.core :as quo]
[react-native.core :as rn]
[status-im.contexts.wallet.common.temp :as temp]
[status-im.contexts.wallet.sheets.buy-token.style :as style]
[utils.i18n :as i18n]))
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

(defn- crypto-on-ramp-item
[{:keys [name description fees logo-url site-url]}]
[quo/settings-item
{:title name
:description :text
:description-props {:text description}
:tag :context
:tag-props {:icon :i/fees
:context fees}
:action :arrow
:action-props {:alignment :flex-start
:icon :i/external}
:image :icon-avatar
:image-props {:icon logo-url}
:on-press #(rn/open-url site-url)}])

(defn view
[]
[:<>
[quo/drawer-top {:title (i18n/label :t/buy-tokens)}]
[rn/flat-list
{:data temp/buy-tokens-list
:style style/list-container
:render-fn quo/settings-item}]])
(rn/use-mount (fn []
(rf/dispatch [:wallet/get-crypto-on-ramps])))
(let [crypto-on-ramps (rf/sub [:wallet/crypto-on-ramps])]
[:<>
[quo/drawer-top {:title (i18n/label :t/buy-assets)}]
[rn/flat-list
{:data crypto-on-ramps
:style style/list-container
:render-fn crypto-on-ramp-item}]]))
2 changes: 1 addition & 1 deletion src/status_im/contexts/wallet/signals.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
(let [event-type (oops/oget event-js "type")
blockNumber (oops/oget event-js "blockNumber")
accounts (oops/oget event-js "accounts")]
(log/debug "[wallet-subs] New wallet event"
(log/debug "[wallet] Wallet signal received"
{:type event-type
:block-number blockNumber
:accounts accounts})
Expand Down
1 change: 1 addition & 0 deletions src/status_im/subs/root.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
status-im.subs.settings
status-im.subs.shell
status-im.subs.wallet.activities
status-im.subs.wallet.buy
status-im.subs.wallet.collectibles
status-im.subs.wallet.networks
status-im.subs.wallet.saved-addresses
Expand Down
7 changes: 7 additions & 0 deletions src/status_im/subs/wallet/buy.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(ns status-im.subs.wallet.buy
(:require [re-frame.core :as rf]))

(rf/reg-sub
:wallet/crypto-on-ramps
:<- [:wallet]
:-> :crypto-on-ramps)
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.179.19",
"commit-sha1": "3103c298015483cb4d1ee90c8f432fcefe21927d",
"src-sha256": "0ks0ks1fxfn1vdnl5j1pygvyv8gbiixihxrc1ac39yi5q61hwccb"
"version": "v0.179.20",
"commit-sha1": "92ef58d4202d151d44015c37d6c1ea45d8a8d8b3",
"src-sha256": "05vqn5zy7fd4abq4d0r5191w2f3dzv9j5s6gmvqsis2r1y4njj7p"
}
2 changes: 1 addition & 1 deletion test/appium/tests/old_ui/medium/test_browser_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def test_profile_change_fleet(self):

self.home.just_fyi('Set another fleet and check that changes are applied')
profile.fleet_setting_button.click()
changed_fleet = 'wakuv2.prod'
changed_fleet = 'waku.sandbox'
profile.element_by_text(changed_fleet).click_until_presence_of_element(profile.confirm_button)
profile.confirm_button.click()
self.sign_in.sign_in()
Expand Down
7 changes: 2 additions & 5 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2466,10 +2466,7 @@
"select-another-account": "Select another account",
"oops-this-qr-does-not-contain-an-address": "Oops! This QR does not contain an address",
"scan-an-account-qr-code": "Scan an account QR code",
"buy-tokens": "Buy Tokens",
"ramp-description": "Global crypto to fiat flow.",
"moonpay-description": "The new standard for fiat to crypto, supports Apple Pay.",
"latamex-description": "Easily buy crypto in Argentina, Mexico and Brazil.",
"buy-assets": "Buy assets",
"account-info": "Account info",
"network-preferences": "Network preferences",
"network-preferences-desc-1": "Select which networks this address is happy to receive funds on",
Expand Down Expand Up @@ -2516,7 +2513,7 @@
"this-address-has-no-activity": "This address has no activity",
"details": "Details",
"est-time": "Est. time",
"user-gets": "{{name}} gets",
"recipient-gets": "Recipient gets",
"slide-to-send": "Slide to send",
"generate-new-keypair": "Generate new key pair",
"import-using-phrase": "Import using recovery phrase",
Expand Down

0 comments on commit c61e480

Please sign in to comment.