diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index ba5af7a4ce..c914631447 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -84,9 +84,9 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index f1fa3b08ef..70b6edcebd 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -122,12 +122,12 @@ dependencies {
// Firebase
implementation platform('com.google.firebase:firebase-bom:26.0.0')
- implementation 'com.google.firebase:firebase-crashlytics'
- implementation 'com.google.firebase:firebase-config-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
+ implementation 'com.google.firebase:firebase-crashlytics-ktx'
- // AppsFlyer
+ // Analytics
implementation 'com.appsflyer:af-android-sdk:6.5.1'
+ implementation 'com.amplitude:android-sdk:2.36.1'
// WalletConnect
implementation 'com.github.salomonbrys.kotson:kotson:2.5.0'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 4422e037f9..874783a15d 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -15,6 +15,7 @@
+
diff --git a/app/src/main/assets/tangem-app-config b/app/src/main/assets/tangem-app-config
index c8f577f2ab..cf6ea50867 160000
--- a/app/src/main/assets/tangem-app-config
+++ b/app/src/main/assets/tangem-app-config
@@ -1 +1 @@
-Subproject commit c8f577f2ab48e0d6c49f79b6cff21eabe67cd63e
+Subproject commit cf6ea50867477f97655da9da47ff94987e8f3354
diff --git a/app/src/main/assets/tos.html b/app/src/main/assets/tos.html
deleted file mode 100644
index 67c6eba9b4..0000000000
--- a/app/src/main/assets/tos.html
+++ /dev/null
@@ -1,1832 +0,0 @@
-
-
-
-
- file_1666042066293
-
-
-
-
- SaltPay Oly Card Terms of Service
-
-
-We are delighted
- that you (“you”,
- “your”, or the “Cardholder”) have chosen to use the SaltPay Oly Card (the “Card”).
- The terms
- and conditions set out here (“Terms”) govern your use of your Card as operated by
- SaltPay.
-
- When you use the
- Card, you also agree to
- the SaltPay
- General Terms
- which are incorporated
- into these Terms by
- reference, including any amendments made to those from time to time. If you do not
- understand any provisions of
- these Terms, please contact us before using the Card. For information about how we treat
- your personal data,
- please see our Privacy
- Policy.
-
-
-
- Definitions
-
- Affiliate: means any entity controlling, controlled by or under common control with that party, where “control” means the ownership of more than 50% of (i) the voting securities or (ii) an interest in the assets, profits, or earnings of an entity.
-
-
- Blockchain Asset: means a digital data stored in and protected by the blockchain network, including but not limited to ownership right and value of cryptocurrency, tokenized assets, non-fungible asset.
-
-
- Cardholder: a person who holds a SaltPay Oly Card.
-
- Private
- Key: a secret cryptographic key which provides full control over a Blockchain Asset.
-
-
- Public
- Key: means a cryptographic key, which provides access to information about a Blockchain Asset, including but not limited to Blockchain Address.
-
-
- SaltPay: Salt Pay IIB hf.
-
- SaltPay
- Oly Card / Card: physical card which stores Private Key and Public Key.
-
- Services: enabling the use of the SaltPay Oly Card at physical point of sale terminals that are enabled for the acceptance of Visa Debit cards.
-
-
- Tangem: means Tangem AG, a company incorporated in Switzerland with company number 1315048, whose address is at Baarerstrasse 10, 6300 Zug.
-
-
- Tangem
- Mobile Application: Third party mobile application, providing interoperability between SaltPay Oly Card and blockchain, and working on NFC-capable smartphones and tablets using Google Android and Apple iOS operating systems.
-
-
- Tangem
- Service: means the service provided by Tangem, which provides and administers the Tangem Mobile Application, which enables Cardholders to generate and store Public Keys and Private Keys in a hardware crypto wallet.
-
- Utorg
- Service: means providing services of exchanging a virtual currency against a fiat currency.
-
-
-
- Important Legal
- Stuff
-
- We think
- it’s important that we highlight and clearly explain how SaltPay safeguards its
- interests, while offering
- its services to its Cardholders (you!) which includes limitation of liability and
- disclaimers. The sections
- set out below reflect those safeguards and how they might impact you. It’s therefore
- important that you read
- them carefully. If you’re unsure about any of them, please get in touch.
-
-
- These
- Terms of Service (the “Terms”) govern the use of SaltPay Oly Cards to
- authorised employees of
- SaltPay and its Affiliates.
-
- The Cards may be used for storage of Private Key and Public Key to the Cardholder’s
- Blockchain Assets
- and authentication of Card Transactions with the purpose of transfer of Blockchain
- Assets for goods and
- services purchasing through the Visa payments infrastructure.
-
- The Cardholder
- agrees that these Terms are binding.
- The
- Cardholder shall be
- the only person having physical access to the Card.
-
- The Cardholder acknowledges and agrees that SaltPay does not provide backup or
- recovery of Private Key
- and Public Key stored by the Card. The Cardholder creates the backup of the SaltPay
- Card at the point at
- which they activate the Card through the Tangem Mobile Application by linking their
- Card with Tangem
- Wallet.
-
-
- The conditions of
- use of the Tangem Wallet and Mobile Application are defined in the terms of service
- for the Tangem
- Wallet and Mobile Application, which will also be available upon downloading the
- application.
-
-
-
-
- SaltPay’s
- obligations
-
-
- SaltPay agrees to
- provide the Cardholder with the Service in accordance with these Terms and within
- the agreed scope.
-
-
- Under the condition
- that the Cardholder exercises their obligations set out under Clause 4 of these
- Terms, SaltPay shall use
- its best endeavours to ensure that the Card will function properly and without
- restriction until the
- date on which the Card expires.
-
- SaltPay shall ensure
- that the Card prevents duplication of the Private Key, and that the Cardholder has
- exclusive control
- over the Blockchain Asset unless the contrary is imposed by specific blockchain
- network rules e.g., two
- or more private keys can be used to control the same Blockchain Asset.
-
- SaltPay
- agrees that it will not keep any records of Cardholder information, save for the
- Cardholder’s full name,
- including but not limited to the amount of Blockchain Asset stored on the Card, the
- Private Key or
- personalised history of Card usage.
-
- For the
- avoidance of doubt, SaltPay does not guarantee that the operation of Card and/or
- Tangem Mobile
- Application will be secure, accurate, complete, uninterrupted, without error or free
- of viruses, worms,
- other harmful components or other program limitations. SaltPay may, at its sole
- discretion and without
- obligation to do so, correct, modify, amend, enhance, improve and make any other
- changes to Card.
-
-
-
- The
- Cardholder’s
- obligations
-
-
- By
- accepting these Terms, you represent and warrant that (a) you have the authority to
- execute and perform
- the obligations contained here; (b) you (and your employees, directors, contractors
- and agents) will
- comply with all law applicable to your business and the use of the Card; and (c) you
- will not use the
- Card, directly or indirectly, for any fraudulent or illegal undertaking.
-
- Upon receiving the Card, the Cardholder, if they choose to use the Tangem Service,
- should download the
- Tangem Mobile Application in order to determine the amount of Blockchain Asset
- stored on the Card.
-
-
- When the Cardholder
- pays for goods or services using their SaltPay Oly Card through contactless
- confirmation using NFC, they
- confirm that there is a sufficient balance in the Tangem Wallet and thereby agree
- that amount is
- deducted from the account.
-
- The Cardholder shall at all times keep the Card and the means of access (backup card
- and pin codes) to
- the Card separate from each other.
-
- The Cardholder shall at all times be aware of where the Card is and regularly ensure
- that it is still in
- their possession. The Cardholder shall avoid even temporary possession of the Card
- by any other
-
- person. If the Card is lost, stolen or destroyed, control over the corresponding
- Blockchain Asset
- may be permanently lost.
-
- The Cardholder shall treat the Card with care and protect the Card from mechanical
- damage, high
- temperatures, strong electromagnetic fields, and other harmful factors.
-
- In the event that the
- Card is stolen or
- lost, and/or if a Cardholder becomes aware of an unauthorised or incorrectly
- initiated transaction,
- the Cardholder shall contact Tangem as soon as possible by sending an email
- to support@tangem.com
- or by using the chat function on the Official Mobile Application.
-
-
-
- In the event that the
- Cardholder wishes
- to deactivate their account, they shall contact Tangem by sending an email
- to support@tangem.com
- or by using the chat function on the Official Mobile Application.
-
-
-
- The Card can be used only with the official Tangem Mobile Application downloaded
- from Google Play and
- App Store.
-
- The Tangem Mobile Application shall be the exclusive source of information
- concerning the Blockchain
- Address of the Blockchain Asset and corresponding Public Key stored on the Card.
-
-
- The Cardholder shall only use Near-Field Devices (“NFC Devices”) that are
- capable of running the
- Tangem Mobile Application.
-
- The Card shall be used only for physically tapping and holding near the Cardholder’s
- NFC Device when the
- Tangem Mobile Application requests it. For the avoidance of doubt, the Card cannot
- be used to pay using
- any method which involves gateways.
-
-
-
- The
- Cardholder’s liabilities
-
-
- The Cardholder is liable for all liabilities arising from the use and misuse of the
- Card. In any case,
- the Cardholder is liable for all transactions authorised using a means of
- access.
-
- Any loss or damage resulting from the forwarding of the Card and/or means of access
- shall be borne by
- the Cardholder.
-
- Loss or damage incurred by the Cardholder in connection with the possession or use
- of the Card shall be
- borne solely by the Cardholder. SaltPay assumes no liability if the Card cannot be
- used due to a
- technical defect or because it has been cancelled or blocked.
-
-
- Cardholder is only
- permitted to use the Products for his personal, non-commercial use. Cardholder is
- not permitted to
- resell the Card.
-
-
-
-
- Limitation of
- liability
-
-
- The Card is provided as-is, and except as expressly stated in these Terms, SaltPay
- provides no express
- or implied warranties or conditions, and SaltPay disclaims and excludes any implied
- terms,
- representations, warranties, and conditions with respect to the Card, including
- warranties of
- merchantability, fitness for a particular purpose, title, satisfactory quality and
- non-infringement, as
- well as any other implied warranties, such as warranties regarding data loss,
- availability, accuracy,
- functionality and lack of viruses. These disclaimers will apply except to the extent
- applicable law does
- not permit them. Any warranties, guarantees, or conditions that cannot be disclaimed
- as a matter of law,
- but which may be limited in duration, last for one year from the date on which you
- receive the Card.
-
-
- SaltPay shall not be liable and does not warrant or make any representations
- regarding the services
- provided by third parties in relation to the Tangem Service, including but not
- limited to the Tangem
- Mobile Application and the Utorg Service. The relationship between the Cardholder
- and any third party in
- relation to the Tangem Service shall be governed by separate agreements provided
- below.
-
- In
- no event shall SaltPay and/or any of its Affiliates be liable for any damages
- whatsoever, including
- direct, indirect, extraordinary, incidental or consequential damages of any kind
- resulting from or
- arising out of the use of Card and/or the Tangem Mobile Application or inability to
- use Card and/or the
- Tangem Mobile Application, failure of Card and/or the Tangem Mobile Application to
- perform as
- represented or expected, loss of goodwill or profits.
-
- SaltPay shall not be held liable for any failure to be able to use the Card and/or
- the Tangem Mobile
- Application for any reason whatsoever, nor will SaltPay be held liable for the loss
- of the Blockchain
- Asset resulting from a malfunction or inoperability of the blockchain network
- hosting Blockchain Asset,
- as well as the inaccessibility of its public servers and services.
-
- SaltPay shall not be held liable for the loss of profits, income, value or any
- indirect, extraordinary,
- consequential, exemplary or punitive damages.
-
- SaltPay shall not be
- held liable for loss or breakdown of the Card and/or the Tangem Mobile
- Application.
-
- SaltPay shall not be held liable for any loss of Blockchain Asset in the event of
- loss or total
- breakdown of the Card and/or the Tangem Mobile Application.
-
- The Cardholder hereby acknowledges and agrees that these limitations of liability
- are agreed allocations
- of risk constituting in part the consideration for using the Card and/or the Tangem
- Mobile Application
- and such limitations will apply notwithstanding the failure of essential purpose of
- any limited remedy,
- and even if SaltPay and/or any SaltPay Affiliates have been advised of the
- possibility of such
- liabilities and/or damages.
-
-
-
- Term
- and
- Termination
-
-
- These Terms become effective upon the date (i) you accept these Terms online (or in
- another manner
- expressly approved by us) or (ii) you first access or use Tangem and shall terminate
- on the date on
- which the Card expires.
-
-
- We may terminate
- our arrangement with you under these Terms for any reason or no reason, at any time,
- by giving 2 months’
- prior notice to this effect. We may also suspend your access to Tangem if you: (i)
- have breached these
- Terms or any other agreement you have with SaltPay, including SaltPay’s policies or
- instructions; or
- (ii) provided any false, incomplete, inaccurate, or misleading information or
- otherwise engaged in
- fraudulent or illegal conduct c) have misused the Service.
-
-
- Where your
- arrangement with us under these Terms terminates for any reason, you will, where
- applicable, remain
- liable for any fees, charges and other payment obligations you owe us.
-
-
-
-
- General
-
-
- Except as expressly provided herein, these Terms are a complete statement of the
- agreement between you
- and us regarding your use of Tangem. In the event of a conflict between these Terms
- and the SaltPay
- General Terms or any other SaltPay agreement or policy, these Terms shall
- prevail.
-
-
- These Terms do not
- limit any rights that SaltPay may have under trade secret, copyright, patent, or
- other laws. No waiver
- of any term of these Terms shall be deemed a further or continuing waiver of such
- term or any other
- term.
-
- In
- the event any court shall declare any section or sections of this Agreement invalid
- or void, such
- declaration shall not invalidate the entire Agreement and all other paragraphs of
- the Agreement shall
- remain in full force and effect.
-
- For
- the avoidance of doubt,
- provisions around general terms not covered in these Terms of Service, including
- but not limited to
- restrictions and unauthorised or illegal use, intellectual property, data,
- taxes, indemnification,
- warranties, severability, force majeure, and disputes, shall be governed by
- the SaltPay General
- Terms.
-
-
-
-TANGEM
- WALLET AND TANGEM MOBILE APPLICATION
-Terms of Service
-
-PLEASE READ
- THESE TERMS OF SERVICE
- CAREFULLY. BY CLICKING TO ACCEPT, OR BY ACCESSING OR USING OUR SERVICES, YOU AGREE THAT YOU HAVE
- READ, UNDERSTOOD,
- AND ACCEPT ALL OF THE TERMS AND CONDITIONS CONTAINED HEREIN. BY PURCHASE OF THE SALTPAY OLY CARD
- WITH THE TANGEM
- WALLET OR BY USING THE SALTPAY OLY CARD OR BY USING TANGEM WALLET OR BY USING TANGEM MOBILE
- APPLICATION, YOU
- DEMONSTRATE YOUR AGREEMENT TO THESE TERMS AND CONDITIONS CONTAINED HEREIN.
-
-
-
- DEFINITIONS
-
-
-
-
-
- “Cardholder” |
-
- means a person who owns Tangem Wallet and SaltPay Oly Card. |
-
-
-
- “Blockchain Asset” |
-
- means a digital data stored in and protected by the blockchain network,
- including but not limited to
- ownership right and value of cryptocurrency, tokenized assets, non-fungible
- asset. |
-
-
-
- “Blockchain Address” |
-
- means a unique identifier that serves as a virtual location of the Blockchain
- Asset in the
- blockchain. |
-
-
-
- “Card Transaction” |
-
- means transfer of Blockchain Asset from the Blockchain Address associated with
- the Public Key stored
- on the SaltPay Oly Card for goods and services purchased through traditional
- payments rail. |
-
-
-
- “Official Mobile Application” |
-
- means an application developed and distributed by Tangem, providing
- interoperability between SaltPay
- Oly Card or Tangem Wallet and blockchain, and working on NFC-capable smartphones
- and tablets using
- Google Android and Apple iOS operation systems. |
-
-
-
- “Private Key” |
-
- a secret cryptographic key which provides full control over a Blockchain
- Asset. |
-
-
-
- “Tangem” |
-
- means Tangem AG, Baarerstrasse 10, 6300 Zug. |
-
-
-
- “Public Key” |
-
- means a cryptographic key, which provides access to information about a
- Blockchain Asset, including
- but not limited to Blockchain Address |
-
-
-
- “Services” |
-
- means the purchase and/or use of the Tangem Wallet and the services or any other
- features,
- technologies or functionalities linked to the Card provided or operated by
- Tangem AG via the website
- or Official Mobile Applications. |
-
-
-
- “Tangem Wallet/Tangem Card / Card” |
-
- means physical card which stores Private Key and Public Key and is used as a
- backup card for SaltPay
- Oly Card. |
-
-
-
- GENERAL
- PROVISIONS
-
-
-
- These Terms of Service (the “Terms”) govern the use of Tangem Wallet and/or
- Official Mobile
- Application provided by Tangem AG (referred to as "Tangem",
- "we" or
- "us" in this document) and the related services or any other
- features, technologies or
- functionalities linked to the Tangem Wallet. Tangem is a company
-
- incorporated under the laws of Switzerland, with a registered address at
- Baarerstrasse 10, 6300 Zug,
- Switzerland.
-
-
- Tangem Wallet
- represents a backup to the SaltPay Oly Card, which may be used only for storage of
- Private Key and
- Public Key to Cardholder’s Blockchain Assets. Tangem Wallet, unlike SaltPay Oly
- Card, can’t be used for
- goods and services purchasing through traditional payments rail. The use of SaltPay
- Oly Card is governed
- by a separate Terms of Service, provided above.
-
-
- Official Mobile
- Application is intended for usage only with SaltPay Oly and Tangem Wallet, providing
- interoperability
- between the cards and blockchain via NFC interface. Official Mobile Application DOES
- NOT:
-
-
- Generate, store, transmit, or have access to private (secret) cryptographic
- keys to blockchain
- wallets holding Blockchain assets.
-
- Generate,
- store, transmit, or have access to secret keys, passwords, passphrases,
- recovery phrases that
- can be used to restore or to copy private (secret) keys to blockchain
- wallets holding Blockchain
- assets.
- Provide
- exchange, trading, investment services on behalf of Tangem.
-
-
-
-
-
-
- RIGHTS AND
- OBLIGATIONS
-
-
-
- Cardholder agrees that
- these Terms are binding.
-
-
- Cardholder shall be the
- only person having physical access to the Tangem Wallet.
-
-
- Cardholder acknowledges and agrees that Tangem does not provide backup or recovery
- of Private Key and
- Public Key stored by the Tangem Wallet.
-
-
- Tangem does not
- keep records of Cardholder’s personal data, the amount of Blockchain Asset stored on
- the Card, the
- Private Key, or personalized history of Card usage.
-
-
-
-
- COSTS
-
-
-
- Costs, fees and commission (the “Costs”) may be charged in connection with the use
- of SaltPay Oly Card.
- These Costs are disclosed in the Official Mobile Application to the Cardholder.
-
-
- Amendments to Costs
- due to changing expenses or market conditions may be made at any time via
- adjustments to the fee
- schedules. Such amendments shall be communicated to the Cardholder in an appropriate
- manner. Upon
- notification and in the event of the objection, the Cardholder may cancel the
- SaltPay Oly Card with
- immediate effect.
-
-
-
- CARDHOLDER’S DUTIES OF CARE
-
- In particular, the
- Cardholder shall exercise the
- following duties of care:
-
-
-
- Upon receiving the SaltPay Oly Card and the Tangem Wallet, the Cardholder should
- download the Official
- Mobile Application from Google Play or Apple app store and create the backup of the
- SaltPay Oly Card by
- linking SaltPay Oly card with Tangem backup wallet following the instructions in the
- Official Mobile
- Application.
-
- Cardholder
- shall keep the SaltPay Oly Card and Tangem Wallet with care and separate from each
- other.
-
-
- Cardholder must always know where the Tangem Wallet is and regularly ensure that it
- is still in his/her
- possession. He/she shall avoid even temporary possession of the Tangem Wallet by any
- other person.
-
-
- Cardholder shall
- treat the Tangem Wallet in the same manner as physical money (cash) and keep it
- safe. If the SaltPay Oly
- Card and Tangem Wallet are lost, stolen or destroyed at the same time, control over
- the corresponding
- Blockchain Asset may be permanently lost.
-
-
- Official Mobile
- Application shall be the only source of information about the Blockchain Address of
- the Blockchain Asset
- and corresponding Public Key stored on the SaltPay Oly Card/Tangem Wallet.
-
-
- Cardholder shall
- only use Near-Field Devices (the “NFC”) devices that are capable of running Official
- Mobile
- Applications. He/she shall avoid leaving the Tangem Wallet in the proximity of the
- NFC devices of other
- persons.
-
-
- Tangem Wallet shall
- be used only for physically tapping and holding near Cardholder’s NFC device when
- Official Mobile
- Application requests it.
-
-
- Cardholder shall
- keep the Tangem Wallet with care and protect the Tangem Wallet from mechanical
- damage, high
- temperatures, strong electromagnetic fields, and other harmful factors.
-
-
-
-
- RIGHTS AND
- RESPONSIBILITIES OF CARDHOLDER
-
-
-
- The Cardholder is liable for all liabilities arising from the use of the Tangem
- Wallet and/or Tangem
- Official Mobile Application. As a matter of principle, the Cardholder is liable for
- any risks resulting
- from the misuse of the Tangem Wallet and/or Official Mobile Application. In any
- case, the Cardholder is
- liable for all transactions authorized using a means of access.
-
-
- Any loss or damage
- resulting from the forwarding of the Tangem Wallet and/or means of access shall be
- borne by the
- Cardholder.
-
-
- Loss or damage
- incurred by the Cardholder in connection with the possession or use of the Tangem
- Wallet and/or Official
- Mobile Application shall be borne solely by the Cardholder. Tangem assumes no
- liability if the Tangem
- Wallet and/or Official Mobile Application cannot be used due to a technical defect
- or because it has
- been canceled, blocked or the spending limit has been adjusted.
-
-
- Cardholder is only
- permitted to use the Tangem Wallet and Official Mobile Application for his personal,
- non-commercial use.
- Cardholder is not allowed to resell the Tangem Wallet.
-
- Cardholder is solely responsible to determinate what, if any, taxes apply to Card
- Transactions. Tangem
- or contributors to the Official Mobile Application are NOT responsible for
- determining the taxes that
- apply to Card Transactions.
-
-
- Before Cardholder
- engages in transactions
- using an electronic system, Cardholder should carefully review the rules and
- regulations of the
- third-party provider Utorg OÜ (https://utorg.pro/terms/),
- who provides exchange services for SaltPay Oly Card. Online trading has inherent
- risk due to system
- response and access times that may vary due to market conditions, system
- performance, and other factors.
- Cardholder should understand, fully accept and take on these and additional risks
- before executing any
- Card Transactions.
-
-
- There is
- considerable exposure to risk in the Blockchain Asset exchange transaction. Any
- transaction involving
- the Blockchain Asset involves risks including, but not limited to, the potential for
- changing economic
- conditions that may substantially affect the price or liquidity of the Blockchain
- Asset. Investments in
- the Blockchain Asset exchange speculation may also be susceptible to sharp rises and
- falls as the
- relevant market values fluctuate. It is for this reason that when speculating in
- such markets it is
- advisable to use only risk capital.
-
-
-
-
- RESPONSIBILITIES AND
- LIABILITIES OF TANGEM
-
-
-
- Tangem does not warrant or make any representations regarding the use, the inability
- to use or operate,
- or the results of the use or operation of the Tangem Wallet and/or Tangem Official
- Mobile
- Application.
-
- Tangem does not
- provide any backup or recovery of Private Key and Public Key stored on the Tangem
- Wallet.
-
-
- Tangem does not keep any records of Cardholder information, the amount of Blockchain
- Asset stored on the
- Tangem Wallet or SaltPay Oly Card, the Private Key, or personalized history of cards
- usage.
-
-
- Tangem shall not be
- held liable for any failure to be able to use the Tangem Wallet and/or Official
- Mobile Application, for
- any reason whatsoever, nor will Tangem be held liable for the loss of the Blockchain
- Asset resulting
- from a malfunction or inoperability of the blockchain network hosting Blockchain
- Asset, as well as the
- inaccessibility of its public servers and services.
-
-
- The Tangem does not
- guarantee that the operation of Tangem Wallet and/or Official Mobile Application
- will be secure,
- accurate, complete, uninterrupted, without error or free of viruses, worms, other
- harmful components or
- other program limitations. Tangem may, at its sole discretion and without obligation
- to do so, correct,
- modify, amend, enhance, improve and make any other changes to Tangem Wallet and/or
- Official Mobile
- Application.
-
-
- Tangem shall not be
- held liable for the loss of profits, income, value or any indirect, extraordinary,
- consequential,
- exemplary or punitive damages.
-
- Tangem shall
- not be held liable for loss or breakdown of the Tangem Wallet.
-
-
- Tangem shall not be held liable for any loss of Blockchain Asset in the event of
- loss or total breakdown
- of the Tangem Wallet or SaltPay Oly Card.
-
-
-
- GUARANTEES
-
-
-
- Under the condition that the Cardholder exercises the duties of care as stated in
- Clause 5, Tangem
- guarantees that the Tangem Wallet will function properly and without restriction for
- a period of 2 (two)
- years.
-
-
- Tangem guarantees
- that the Tangem Wallet prevents duplication of the Private Key and that the
- Cardholder has exclusive
- control over the Blockchain Asset unless the contrary is imposed by specific
- blockchain network
- rules,
-
- e.g. two or more
- private keys can be used to control the same Blockchain Asset.
-
-
-
-
- LIMITATION OF LIABILITY
-
-
-
- The Tangem Wallet, including without limitation any content, data and information
- related thereto, is
- provided on an “as is” basis and “as available” basis, without any warranties of any
- kind, express or
- implied warranties of use, merchantability or suitability for a certain purpose or
- use, including
- without limitation, the quality of products and services provided by users,
- third-party services, and/or
- exchanges (except for the guarantees set forth in Clause 8).
-
-
- Official Mobile
- Application is provided on an “as is” basis and “as available” basis without any
- warranties of any
- kind regarding Official Mobile Application and/or any content, data, materials
- and/or services
- provided on Official Mobile Application.
-
-
- Tangem and its
- affiliates, including any of their officers, directors, shareholders, employees,
- sub-contractors,
- agents, parent companies, subsidiaries and other affiliates (collectively, the
- “Tangem Affiliates”),
- jointly and severally, disclaim and make no representations or warranties as to the
- usability, accuracy,
- quality, availability, reliability, suitability, completeness, truthfulness,
- usefulness or effectiveness
- of any content, data, results or other information obtained or generated by Tangem
- and/or any user
- related to you or any other user of the Tangem Wallet, and Official Mobile
- Applications.
-
-
- In no event shall
- Tangem and/or any of the Tangem Affiliates be liable for any damages whatsoever,
- including direct,
- indirect, extraordinary, incidental or consequential damages of any kind, but not
- limited to, resulting
- from or arising out of the use of Tangem Wallet and/or Official Mobile Applications
- or inability to use
- Tangem Wallet and/or Official Mobile Applications, failure of Tangem Wallet and/or
- Official Mobile
- Applications to perform as represented or expected, loss of goodwill or profits, or
- loss of data arising
- out of or in any way connected with the use of Tangem Wallet and/or Official Mobile
- Applications. In no
- event shall Tangem and/or any of the Tangem Affiliates be liable for the performance
- or failure of the
- Tangem Wallet and/ or Official Mobile Applications to perform under these Terms of
- Use and any other act
- or omission by Tangem by any cause whatsoever including without limitation damages
- arising from the
- conduct of any users, third party services and/or exchanges. In no way Tangem or
- contributors to
- Official Mobile Application are responsible for the actions, decisions, or other
- behavior taken or not
- taken by Cardholder in reliance upon Tangem Official Mobile Application.
-
-
- You hereby
- acknowledge and agree that these limitations of liability are agreed allocations of
- risk constituting in
- part the consideration for using the Tangem Wallet and Official Mobile Applications
- and such limitations
- will apply notwithstanding the failure of essential purpose of any limited remedy,
- and even if Tangem
- and/or any Tangem Affiliates has been advised of the possibility of such liabilities
- and/or damages.
-
-
- Tangem will not be
- responsible for any losses, damages or claims arising from events falling within the
- scope of the
- following five categories:
-
-
- Mistakes made by Cardholder, e.g., forgotten passwords, payments sent to
- wrong addresses, and
- accidental deletion of blockchain wallets on Tangem Wallet or SaltPay Oly
- cards.
-
- Problems of
- Official Mobile Application and/or any blockchain- or cryptocurrency-
- related software or
- service, e.g., corrupted files, incorrectly constructed transactions, unsafe
- cryptographic
- libraries, malware.
-
- Technical
- failures in the hardware of Cardholder, including cards, of any blockchain-
- or
- cryptocurrency-related software or service, e.g., data loss due to a faulty
- or damaged storage
- device.
-
- Security
- problems experienced by Cardholder,
- e.g., unauthorized
- access to Cardholders' wallets and/or accounts.
-
- Actions or
- inactions of third parties and/or events experienced by third parties, e.g.,
- bankruptcy of
- service providers, information security attacks on service providers, and
- fraud conducted by
- third parties.
-
-
-
-
-
-
- SEVERABILITY
-
-
-
- In
- the event any court shall declare any section or sections of this Agreement invalid
- or void, such
- declaration shall not invalidate the entire Agreement and all other paragraphs of
- the Agreement shall
- remain in full force and effect.
-
-
-
-
- ARBITRATION AND
- GOVERNING LAW
-
-
-
- These Terms of Service are governed exclusively by the laws of Switzerland, without
- regard to its
- conflict of law rules. You consent to the exclusive jurisdiction of the court of
- Zug, Switzerland for
- any dispute arising under this Agreement.
-
-
-
-
- Utorg OÜ Terms of Use
-
-These Terms of
- Use constitute an
- electronic agreement between you (hereinafter the "User") and Utorg OÜ (hereinafter
- the “Utorg.pro”,
- “we”, “us”, “our”), a company incorporated in Estonia with Company No.
- 14786273, located at
- Roosikrantsi tn 2-1068, Kesklinna linnaosa,Tallinn, Harju maakond, 10119, that applies to the
- User's use of this
- website, any and all services, products and content provided by Utorg.pro.
-
-As used herein,
- "Utorg.pro" refers to the company Utorg OÜ, including but not limited to, its
- owners, directors,
- investors, officers, employees, agents or other related parties, unless otherwise provided
- herein.
-
-These Terms of
- Use contain
- important provisions, which the User must consider carefully when choosing whether to use the
- services, products and
- content of Utorg.pro. Please read these Terms of Use carefully before agreeing to them.
-
-The User is
- solely responsible for
- understanding and complying with any and all laws, rules and regulations of his/her specific
- jurisdiction that may
- be applicable to the User in connection with the use of any and all services, products and
- content of Utorg.pro.
-
-These Terms of Use
- incorporate our Privacy Policy
- as well as any other policies published on the Site by reference, so by accepting these Terms of Use, the User agrees with and accepts all the policies published on the Site.
-
-
-IF THE USER
- DOES NOT ACCEPT THESE
- TERMS OF USE, THE USER SHALL NOT USE ANY OF UTORG.PRO’S SERVICES, PRODUCTS AND CONTENT.
-
-
-
- Terms and
- Definitions
-
-
- “Account”
- shall mean a record created and maintained by the Software that accumulates and stores
- all information about
- the Cardholder, including without limitation Transactional history, Cryptocurrency
- balance, and the
- Cardholder personal information.
-
- “SaltPay
- Oly Card” shall mean a plastic card linked to the Account. “Cardholder” shall
- mean an individual
- or entity holding a SaltPay Oly Card.
-
- "Confidential
- Information" shall mean any data or information, oral or written, treated as
- confidential that
- relates to either party’s (or, if either party is bound to protect the confidentiality
- of any third party’s
- information, such third party’s) past, present, or future research, development or
- business activities,
- including any unannounced products and services, any information relating to Services,
- developments,
- relevant documentation (in whatever form or media provided), inventions, processes,
- plans, financial
- information, end-user data, revenue, transaction volume, forecasts, projections, and the
- financial terms of
- this Agreement. Notwithstanding the foregoing, Confidential Information shall not be
- deemed to include
- information if: (i) it was already known to the receiving party prior to the Effective
- Date of this
- Agreement, as established by documentary evidence; (ii) it is in or has entered the
- public domain through no
- breach of this Agreement or other wrongful act of the receiving party; (iii) it has been
- rightfully received
- by the receiving party from a third party and without breach of any obligation of
- confidentiality of such
- third party to the owner of the Confidential Information; (iv) it has been approved for
- release by written
- authorization of the owner of the Confidential Information; or, (v) it has been
- independently developed by a
- party without access to or use of the Confidential Information of the other party.”
-
- “Cryptocurrency”
- shall mean any medium of exchange using cryptography to secure transactions and to
- control the creation of
- new units, as bitcoins (http://bitcoin.org), or any other that meet those requirements.
-
-
- “Force-Majeure
- Event” shall mean any act or event beyond a Party’s reasonable control, including
- without limitation
- non-delivery or defective delivery of third party services necessary to provide the
- Services (including but
- not limited to those of our partners, vendors and suppliers), strikes, lock-outs or
- other industrial action
- by third parties, civil commotion, riot, invasion, terrorist attack or threat of
- terrorist attack, war
- (whether declared or not) or threat or
-
- preparation for war, fire, explosion, storm, flood, earthquake, subsidence, epidemic or
- other natural
- disaster, failure of public or private telecommunications networks, worldwide Web
- unavailability or
- malfunction, governmental prohibition or other limitation of Cryptocurrencies, or
- seizing of infrastructure
- and operations of Cryptocurrencies.
-
- “Over-the-counter
- (OTC) deal” shall mean a direct, off-exchange, Transaction between Utorg and
- Cardholder. “Price”
- shall mean a "price per coin" for which users are willing to purchase or sell
- Cryptocurrency using
- the Services. “Relevant Exchange Rate” shall mean the weighted spot price average
- at the time of the
- transaction.
- “Services”
- shall mean
- providing services of exchanging a virtual currency against a fiat currency.
- “Site” means Utorg.pro’s website
- at https://Utorg.pro.
- “Specified
- Bank Account”
- means the bank account belonging to Salt Pay IIB hf., the details of which shall be
- provided to Utorg.pro.
-
- “Software”
- shall mean a
- software owned by Utorg and enabling Transactions’ processing.
-
- “Transaction”
- shall mean any of the following: (i) a purchase of the Cryptocurrency by the Cardholder;
- (ii) a sale of the
- Cryptocurrency by the Cardholder; (iii) a transfer of Cryptocurrency to a Cardholder.
-
-
-
- Scope of the
- Services
-
-
-
- Utorg undertakes to
- provide the Cardholder with Services, including but not limited to OTC deal. For the
- avoidance of doubt,
- Utorg shall use the Relevant Exchange Rate when executing the OTC deal.
-
-
- The Services will
- be provided in such a manner that Utorg will be acting on its own behalf strictly
- under the Cardholder’s
- instructions regarding any Transaction as well as other matters which the Cardholder
- consider to be
- necessary hereunder and are accepted by Utorg.
-
-
- Utorg will treat
- the each individual Cardholder as its sole client to which it owes obligations and
- will bear no
- responsibility to third parties for whom the Cardholder may be acting as an agent,
- intermediary or
- fiduciary, whether or not the existence or identity of such person(s) has been
- disclosed to, or is known
- by Utorg.
-
-
- Utorg does not
- provide banking, or payment Services and does not hold or store the Cardholder’s
- fiat or crypto
- currencies.
-
-
-
-
- Warranties
-
- The
- Cardholder hereby warrants
- and represents to Utorg as follows:
-
-
- It
- represents and warrants that all than all outgoing Transactions, cryptocurrency
- and/or fiat currency,
- are made only to the Specified Bank Account, and Utorg shall not be liable for the
- consequences of any
- other incoming Transactions.
-
-
- It also represents
- and warrants than all incoming Transactions, cryptocurrency and/or fiat currency,
- are made only from its
- own wallet and/or bank account, and Utorg shall not be liable for the consequences
- of any other incoming
- Transactions.
-
-
- It shall use the
- Services in strict conformity with the Terms of Use and for no other purpose and in
- no other manner. All
- other warranties and representations regarding the use of the Services set forth
- below shall be in
- addition to and not in limitation of this general overriding warranty and
- representation.
-
-
- The Cardholder represents
- and warrants to accept
- and comply with all policies posted on Utorg.pro website: https://utorg.pro, Terms of Use (https://utorg.pro/terms/), Privacy Policy
- (https://utorg.pro/privacy-policy), KYC/AML Policy
- (https://utorg.pro/kyc-aml-policy).
-
-
-
- Rights
- and Obligations
-
-
- The Cardholder
- has right to:
-
-
- ask
- Utorg for any type of assistance and support;
-
-
- request a confirmation letter stating all information on Cardholder’s
- Transactions; and
-
-
- be promptly notified of any relevant changes, including but not limited to Commissions, bank details, cryptocurrency wallets, etc.
-
-
-
-
-
- Utorg has the right
- to stop providing the Services and terminate the Agreement immediately in case of
- any breach of the
- Agreement or/and the Terms of Use;
-
- Utorg
- undertakes to provide the Cardholder with full assistant and support regarding the
- Service
- provision.
-
-
-
- KYC
- Verification
-
-
-
- Identification and
- verification procedures (also known as “Know Your Customer” or “KYC”)
- are required for all
- Transactions, which shall be undertaken by Utorg. If the User refuses to provide
- required documents and
- information under KYC, including additional information that can be requested after
- the business
- relationships were established, Utorg.pro reserves the right to immediately
- terminate the Services
- provision to the User.
-
-
- The User hereby
- authorises Utorg.pro to, directly or indirectly (through third parties), make any
- inquiries as
- considered necessary to check the relevance and accuracy of the information provided
- for verification
- purposes. Personal Data transferred will be limited to strictly the necessary and
- with security measures
- in use to protect the data.
-
-
-
-
- Regulatory
- Compliance
-
-
-
- For the purposes of
- anti-money laundering prevention and combatting terrorist activities, Utorg performs
- a thorough due
- diligence on each of its customers. Cardholder will have to provide all documents
- and information
- requested by Utorg for KYC purposesin order to be able to use the Services. Utorg
- will keep records of
- the Cardholder’s information and documents safe and confidential in accordance with
- its Privacy Policy
- and the applicable legal and regulatory requirements.
-
-
- Utorg reserves the
- right to request any additional information about the Cardholder and/or the
- Cardholder’s Transaction,
- and the Cardholder agrees to provide such documents and information in due time.
- Utorg has a right to
- decline to deliver the Services anytime in case the documents or information
- provided by the Cardholder
- are unsatisfactory or insufficient, or in case such actions are necessary to comply
- with the applicable
- laws and regulations, as Utorg may decide in its sole discretion.
-
-
- The Cardholder will
- be able to perform Transactions within certain amounts according to the limits
- established by Utorg and
- the applicable law. Cardholder will be able to provide some additional information
- as instructed by
- Utorg to increase or eliminate these limits.
-
-
-
-
- Intellectual
- Property
-
-
-
- All content at
- Utorg's website is the property of Utorg and is protected by copyright, patent,
- trademark and any
- other applicable laws, unless otherwise specified hereby.
-
-
- The trademarks,
- brands, trade names, service marks and logos of Utorg and others used on the Site
- (hereinafter, the
- "Trademarks") are the property of Utorg and its respective owners.
- The software,
- applications, text, images, graphics, data, prices, trades, charts, graphs, video
- and audio materials
- used on this Site belong to Utorg. The Trademarks and other content on the Platform
- and at Utorg's
- website should not be copied, reproduced, modified, republished, uploaded, posted,
- transmitted, scraped,
- collected or distributed in any form or by any means, whether manual or automated.
- The use of any
- content from the Platform and at Utorg's website on any other site or a
- networked computer
- environment for any other purpose
-
- is
- strictly prohibited; any such unauthorized use may violate copyright, patent,
- trademark and any
- other applicable laws and could result in criminal or civil
- penalties/liabilities.
-
-
-
-
- Confidentiality
-
-
-
- Any information of
- a Party (hereinafter, the “Disclosing Party”) which is not public and which
- was obtained by the
- other Party (hereinafter, the “Receiving Party”) in the course of performance
- of this Agreement,
- whether proprietary to such other Party or any third party, whether expressly marked
- as confidential or
- not and regardless of the form and manner, in which it was obtained, shall be deemed
- “Confidential
- Information”.
-
- With respect to
- any and all Confidential Information of the Disclosing Party the Receiving Party
- agrees to:
-
-
-
- hold it in
- confidence and treat it with the same degree of care and diligence, as it
- employs with respect
- to its own confidential information, but in no case less than a reasonable
- degree of care and
- diligence;
-
- use
- it solely for the purpose of performance of this Agreement;
-
-
- communicate
- it only to the employers and agents of the Receiving Party who have a need
- to know such
- Confidential Information for the purpose of performance by the Receiving
- Party of this Agreement
- and who are subject to confidentiality obligations with respect to such
- information; and
-
-
- upon
- request of the Disclosing Party or following termination of this Agreement
- promptly return to
- the Disclosing Party any and all material embodiments of its Confidential
- Information and
- destroy those material embodiments of Confidential Information return of
- which is not
- practicable and certify such destruction to the Disclosing Party in
- writing.
-
-
-
-
- The Parties hereby
- agree and acknowledge that restrictions on use of Confidential Information set forth
- in Clauses 9.1 and
- 9.2 above shall not apply to information, which (subject to the burden of proof
- being on the Receiving
- Party):
-
-
-
- was known
- to the Receiving Party prior to it being obtained from the Disclosing Party
- in connection with
- this Agreement;
-
-
- has been
- developed or otherwise obtained by the Receiving Party without the use of
- the Confidential
- Information;
-
- has
- become public through no fault of the Receiving Party.
-
-
-
-
- The Parties hereby
- agree that limitations on use and disclosure of Confidential Information as per the
- Agreement shall not
- apply to any disclosure made in accordance with a valid law, court order, or other
- statutory act or
- decision of a judicial or governmental authority that has relevant jurisdiction over
- the Receiving Party
- (the ”Act”), provided that:
-
-
- The
- Receiving Party has provided the Disclosing Party with notice of the Act as
- soon as
- practicable;
-
-
- the
- Receiving Party has provided all reasonable assistance to the Disclosing
- Party (at the
- Disclosing Party’s expense) in contesting the Act as the Disclosing Party
- had requested;
-
-
- the
- Receiving Party has disclosed only the portion of Confidential Information
- which it was obliged
- to disclose as per the Act (subject to any alterations due to the Disclosing
- Party contesting
- the Act).
-
-
-
-
-
-
- Taxation
-
- Utorg
- makes no representations concerning the tax implications of the Transactions or the
- possession or use the
- Cryptocurrency. The Cardholder bears the sole responsibility to determine if the
- Cryptocurrency or the
- potential appreciation or depreciation in the value of the Cryptocurrency over time has
- tax implications for
- the Cardholder in the
-
- Cardholder's
- home jurisdiction. By using the Services, and to the extent permitted by law, the
- Cardholder agrees not to
- hold Utorg liable for any tax liability associated with or arising from the Cardholder's
- use of the
- Services.
-
-
- Governing Law
-
- This
- Agreement shall be governed by the laws of Republic of Estonia. All disputes and
- controversies arising out
- of or in connection with this Agreement shall be submitted to the relevant Estonian
- Court in Tallinn, as the
- Court of first instance.
-
-
- Dispute Resolution
-
-
-
- The Parties
- undertake to make every possible effort to resolve disputes that may arise in the
- performance of this
- Agreement by means of negotiations.
-
-
- Any dispute,
- controversy or claim arising out of or relating to this contract, or the breach
- termination or
- invalidity thereof, that cannot be solved in the process of negotiations shall be
- settled in the
- appropriate court according to the Governing Law.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/java/com/tangem/tap/MainActivity.kt b/app/src/main/java/com/tangem/tap/MainActivity.kt
index b75cb31efc..a94cf067f5 100644
--- a/app/src/main/java/com/tangem/tap/MainActivity.kt
+++ b/app/src/main/java/com/tangem/tap/MainActivity.kt
@@ -18,7 +18,6 @@ import com.tangem.tap.common.DialogManager
import com.tangem.tap.common.IntentHandler
import com.tangem.tap.common.OnActivityResultCallback
import com.tangem.tap.common.SnackbarHandler
-import com.tangem.tap.common.extensions.copyToClipboard
import com.tangem.tap.common.redux.NotificationsHandler
import com.tangem.tap.common.redux.global.AndroidResources
import com.tangem.tap.common.redux.global.GlobalAction
@@ -61,7 +60,6 @@ class MainActivity : AppCompatActivity(), SnackbarHandler, ActivityResultCallbac
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
- internalActivity = this
setContentView(R.layout.activity_main)
systemActions()
store.dispatch(NavigationAction.ActivityCreated(WeakReference(this)))
@@ -176,10 +174,4 @@ class MainActivity : AppCompatActivity(), SnackbarHandler, ActivityResultCallbac
override fun removeOnActivityResultCallback(callback: OnActivityResultCallback) {
onActivityResultCallbacks.remove(callback)
}
-}
-
-lateinit var internalActivity: AppCompatActivity
-//TODO: delete
-fun copyToClipboard(text: String) {
- internalActivity.copyToClipboard(text)
}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/TapApplication.kt b/app/src/main/java/com/tangem/tap/TapApplication.kt
index 8fa11bf17a..c0d6e566b4 100644
--- a/app/src/main/java/com/tangem/tap/TapApplication.kt
+++ b/app/src/main/java/com/tangem/tap/TapApplication.kt
@@ -5,16 +5,16 @@ import android.content.Context
import android.content.pm.PackageManager
import coil.ImageLoader
import coil.ImageLoaderFactory
-import com.appsflyer.AppsFlyerLib
import com.tangem.Log
import com.tangem.LogFormat
import com.tangem.blockchain.network.BlockchainSdkRetrofitBuilder
+import com.tangem.common.json.MoshiJsonConverter
import com.tangem.domain.DomainLayer
import com.tangem.domain.common.LogConfig
import com.tangem.network.common.MoshiConverter
import com.tangem.tap.common.AndroidAssetReader
import com.tangem.tap.common.AssetReader
-import com.tangem.tap.common.analytics.GlobalAnalyticsHandler
+import com.tangem.tap.common.analytics.GlobalAnalyticsEventHandlerBuilder
import com.tangem.tap.common.feedback.AdditionalFeedbackInfo
import com.tangem.tap.common.feedback.FeedbackManager
import com.tangem.tap.common.images.createCoilImageLoader
@@ -97,15 +97,19 @@ class TapApplication : Application(), ImageLoaderFactory {
private fun initWithConfigDependency(config: Config) {
shopService = TangemShopService(this, config.shopify!!)
- initAppsFlyer(this, config)
+ initAnalytics(this, config)
initFeedbackManager(this, preferencesStorage, config)
}
- private fun initAppsFlyer(context: Context, config: Config) {
- AppsFlyerLib.getInstance().init(config.appsFlyerDevKey, null, context)
- AppsFlyerLib.getInstance().start(context)
- val analyticsHandler = GlobalAnalyticsHandler.createDefaultAnalyticHandlers(context)
- store.dispatch(GlobalAction.SetAnanlyticHandlers(analyticsHandler))
+ private fun initAnalytics(application: Application, config: Config) {
+ val globalAnalyticsHandler = GlobalAnalyticsEventHandlerBuilder(
+ application = application,
+ config = config,
+ isDebug = BuildConfig.DEBUG,
+ logConfig = LogConfig.analyticsHandlers,
+ jsonConverter = MoshiJsonConverter.INSTANCE,
+ ).default()
+ store.dispatch(GlobalAction.SetGlobalAnalyticsHandler(globalAnalyticsHandler))
}
private fun initFeedbackManager(context: Context, preferencesStorage: PreferencesStorage, config: Config) {
diff --git a/app/src/main/java/com/tangem/tap/common/DialogManager.kt b/app/src/main/java/com/tangem/tap/common/DialogManager.kt
index d3fe7eacd2..5ae8d9ce04 100644
--- a/app/src/main/java/com/tangem/tap/common/DialogManager.kt
+++ b/app/src/main/java/com/tangem/tap/common/DialogManager.kt
@@ -20,6 +20,7 @@ import com.tangem.tap.features.onboarding.products.wallet.redux.BackupDialog
import com.tangem.tap.features.onboarding.products.wallet.saltPay.dialog.NoFundsForActivationDialog
import com.tangem.tap.features.onboarding.products.wallet.saltPay.dialog.RegistrationErrorDialog
import com.tangem.tap.features.onboarding.products.wallet.saltPay.dialog.SaltPayDialog
+import com.tangem.tap.features.onboarding.products.wallet.saltPay.dialog.TryToInterruptRegistrationDialog
import com.tangem.tap.features.onboarding.products.wallet.ui.dialogs.AddMoreBackupCardsDialog
import com.tangem.tap.features.onboarding.products.wallet.ui.dialogs.BackupInProgressDialog
import com.tangem.tap.features.onboarding.products.wallet.ui.dialogs.ConfirmDiscardingBackupDialog
@@ -54,7 +55,6 @@ class DialogManager : StoreSubscriber {
store.unsubscribe(this)
}
-
override fun newState(state: GlobalState) {
if (state.dialog == null) {
dialog?.dismiss()
@@ -67,6 +67,8 @@ class DialogManager : StoreSubscriber {
dialog = when (state.dialog) {
is AppDialog.SimpleOkDialog -> SimpleOkDialog.create(state.dialog, context)
is AppDialog.SimpleOkDialogRes -> SimpleOkDialog.create(state.dialog, context)
+ is AppDialog.SimpleOkErrorDialog -> SimpleOkDialog.create(state.dialog, context)
+ is AppDialog.SimpleOkWarningDialog -> SimpleOkDialog.create(state.dialog, context)
is AppDialog.ScanFailsDialog -> ScanFailsDialog.create(context)
is AppDialog.AddressInfoDialog -> AddressInfoBottomSheetDialog(state.dialog, context)
is AppDialog.TestActionsDialog -> TestActionsBottomSheetDialog(state.dialog, context)
@@ -76,16 +78,16 @@ class DialogManager : StoreSubscriber {
SimpleAlertDialog.create(
titleRes = R.string.wallet_connect,
messageRes = R.string.wallet_connect_scanner_error_no_ethereum_wallet,
- context = context
+ context = context,
)
is WalletConnectDialog.AddNetwork ->
SimpleAlertDialog.create(
titleRes = R.string.wallet_connect,
message = context.getString(
R.string.wallet_connect_network_not_found_format,
- state.dialog.network
+ state.dialog.network,
),
- context = context
+ context = context,
)
is WalletConnectDialog.OpeningSessionRejected -> {
SimpleAlertDialog.create(
@@ -123,26 +125,23 @@ class DialogManager : StoreSubscriber {
SimpleAlertDialog.create(
titleRes = R.string.wallet_connect,
messageRes = R.string.wallet_connect_scanner_error_unsupported_network,
- context = context
+ context = context,
)
is BackupDialog.AddMoreBackupCards -> AddMoreBackupCardsDialog.create(context)
is BackupDialog.BackupInProgress -> BackupInProgressDialog.create(context)
is BackupDialog.UnfinishedBackupFound -> UnfinishedBackupFoundDialog.create(context)
is BackupDialog.ConfirmDiscardingBackup -> ConfirmDiscardingBackupDialog.create(context)
- is SaltPayDialog.NoFundsForActivation -> NoFundsForActivationDialog.create(context)
- is SaltPayDialog.RegistrationError -> RegistrationErrorDialog.create(context, state.dialog)
- is WalletDialog.CurrencySelectionDialog ->
- CurrencySelectionDialog.create(state.dialog, context)
- is WalletDialog.ChooseTradeActionDialog ->
- ChooseTradeActionBottomSheetDialog(context)
- is WalletDialog.SelectAmountToSendDialog ->
- AmountToSendBottomSheetDialog(context, state.dialog)
- is WalletDialog.SignedHashesMultiWalletDialog ->
- SignedHashesWarningDialog.create(context)
+ is SaltPayDialog.Activation.NoGas -> NoFundsForActivationDialog.create(context)
+ is SaltPayDialog.Activation.TryToInterrupt -> TryToInterruptRegistrationDialog.create(context, state.dialog)
+ is SaltPayDialog.Activation.OnError -> RegistrationErrorDialog.create(context, state.dialog)
+ is WalletDialog.CurrencySelectionDialog -> CurrencySelectionDialog.create(state.dialog, context)
+ is WalletDialog.ChooseTradeActionDialog -> ChooseTradeActionBottomSheetDialog(context)
+ is WalletDialog.SelectAmountToSendDialog -> AmountToSendBottomSheetDialog(context, state.dialog)
+ is WalletDialog.SignedHashesMultiWalletDialog -> SignedHashesWarningDialog.create(context)
is WalletDialog.TokensAreLinkedDialog -> SimpleAlertDialog.create(
title = context.getString(state.dialog.titleRes, state.dialog.currencySymbol),
message = context.getString(
- state.dialog.messageRes, state.dialog.currencySymbol, state.dialog.currencyTitle
+ state.dialog.messageRes, state.dialog.currencySymbol, state.dialog.currencyTitle,
),
context = context,
)
@@ -151,7 +150,7 @@ class DialogManager : StoreSubscriber {
messageRes = state.dialog.messageRes,
context = context,
primaryButtonRes = state.dialog.primaryButtonRes,
- primaryButtonAction = state.dialog.onOk
+ primaryButtonAction = state.dialog.onOk,
)
is WalletDialog.RussianCardholdersWarningDialog ->
RussianCardholdersWarningBottomSheetDialog(context)
diff --git a/app/src/main/java/com/tangem/tap/common/TestActions.kt b/app/src/main/java/com/tangem/tap/common/TestActions.kt
index d5939dae64..5eb1021886 100644
--- a/app/src/main/java/com/tangem/tap/common/TestActions.kt
+++ b/app/src/main/java/com/tangem/tap/common/TestActions.kt
@@ -27,8 +27,8 @@ object TestActions {
* @param isTestView - true must be used if you want to show or hide your view depends on BuildConfig
*/
fun initFor(view: View, actions: List, isTestView: Boolean = false) {
- if (isTestView) view.show(BuildConfig.TEST_ACTION_ENABLED)
if (!BuildConfig.TEST_ACTION_ENABLED) return
+ if (isTestView) view.show(BuildConfig.TEST_ACTION_ENABLED)
view.setOnClickListener {
store.dispatchDialogShow(AppDialog.TestActionsDialog(actions))
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsEvent.kt b/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsEventAnOld.kt
similarity index 92%
rename from app/src/main/java/com/tangem/tap/common/analytics/AnalyticsEvent.kt
rename to app/src/main/java/com/tangem/tap/common/analytics/AnalyticsEventAnOld.kt
index 90ff7d7f3b..41cc0d9b96 100644
--- a/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsEvent.kt
+++ b/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsEventAnOld.kt
@@ -1,6 +1,6 @@
package com.tangem.tap.common.analytics
-enum class AnalyticsEvent(val event: String) {
+enum class AnalyticsEventAnOld(val event: String) {
CARD_IS_SCANNED("card_is_scanned"),
TRANSACTION_IS_SENT("transaction_is_sent"),
READY_TO_SCAN("ready_to_scan"),
@@ -19,7 +19,7 @@ enum class AnalyticsEvent(val event: String) {
GET_CARD("get_card"),
}
-enum class AnalyticsParam(val param: String) {
+enum class AnalyticsParamAnOld(val param: String) {
BLOCKCHAIN("blockchain"),
CARD_ID("cardId"),
BATCH_ID("batch_id"),
@@ -37,13 +37,13 @@ enum class AnalyticsParam(val param: String) {
SOURCE("source"),
}
-enum class GetCardSourceParams(val param: String) {
+enum class GetCardSourceParamsAnOld(val param: String) {
WELCOME("welcome"),
ONBOARDING_BUY_MORE("wallet_onboaring_buy_more_cards"),
ONBOARDING("wallet_onboarding")
}
-object Analytics {
+object AnalyticsAnOld {
enum class ActionToLog(val key: String) {
Scan("tap_scan_task"),
SendTransaction("send_transaction"),
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsEventsLogger.kt b/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsEventsLogger.kt
new file mode 100644
index 0000000000..0865d2aa81
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsEventsLogger.kt
@@ -0,0 +1,26 @@
+package com.tangem.tap.common.analytics
+
+import com.tangem.common.json.MoshiJsonConverter
+import com.tangem.tap.common.analytics.api.ErrorEventLogger
+import com.tangem.tap.common.analytics.api.EventLogger
+import timber.log.Timber
+
+class AnalyticsEventsLogger(
+ private val name: String,
+ private val jsonConverter: MoshiJsonConverter,
+) : EventLogger, ErrorEventLogger {
+
+ override fun logEvent(event: String, params: Map) {
+ Timber.d(jsonConverter.prettyPrint(PrintEventModel(name, event, params)))
+ }
+
+ override fun logErrorEvent(error: Throwable, params: Map) {
+ Timber.e(error, jsonConverter.prettyPrint(PrintEventModel(name, "error", params)))
+ }
+}
+
+private data class PrintEventModel(
+ val client: String,
+ val event: String,
+ val params: Map,
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsHandler.kt b/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsHandler.kt
deleted file mode 100644
index 424f06d9ce..0000000000
--- a/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsHandler.kt
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.tangem.tap.common.analytics
-
-import com.shopify.buy3.Storefront
-import com.tangem.common.card.Card
-import com.tangem.common.core.TangemSdkError
-import com.tangem.tap.common.extensions.filterNotNull
-
-
-abstract class AnalyticsHandler {
- abstract fun triggerEvent(
- event: AnalyticsEvent,
- card: Card? = null,
- blockchain: String? = null,
- params: Map = emptyMap()
- )
-
- abstract fun triggerEvent(
- event: String,
- params: Map
- )
-
- abstract fun logCardSdkError(
- error: TangemSdkError,
- actionToLog: Analytics.ActionToLog,
- parameters: Map? = null,
- card: Card? = null
- )
-
- abstract fun logError(
- error: Throwable,
- params: Map = emptyMap()
- )
-
- protected fun prepareParams(card: Card?, blockchain: String? = null): Map {
- return mapOf(
- AnalyticsParam.FIRMWARE.param to card?.firmwareVersion?.stringValue,
- AnalyticsParam.BATCH_ID.param to card?.batchId,
- AnalyticsParam.BLOCKCHAIN.param to blockchain,
- ).filterNotNull()
- }
-
- fun logWcEvent(event: Analytics.WcAnalyticsEvent) {
- when (event) {
- is Analytics.WcAnalyticsEvent.Action -> {
- triggerEvent(
- event = AnalyticsEvent.WC_SUCCESS_RESPONSE,
- params = mapOf(
- AnalyticsParam.WALLET_CONNECT_ACTION.param to event.action.name
- )
- )
- }
- is Analytics.WcAnalyticsEvent.Error -> {
- val params = mapOf(
- AnalyticsParam.WALLET_CONNECT_ACTION.param to event.action?.name,
- AnalyticsParam.ERROR_DESCRIPTION.param to event.error.message
- )
- .filterNotNull()
- logError(event.error, params)
- }
- is Analytics.WcAnalyticsEvent.InvalidRequest ->
- triggerEvent(
- event = AnalyticsEvent.WC_INVALID_REQUEST,
- params = mapOf(
- AnalyticsParam.WALLET_CONNECT_REQUEST.param to event.json
- ).filterNotNull()
- )
- is Analytics.WcAnalyticsEvent.Session -> {
- val analyticsEvent = when (event.event) {
- Analytics.WcSessionEvent.Disconnect -> AnalyticsEvent.WC_SESSION_DISCONNECTED
- Analytics.WcSessionEvent.Connect -> AnalyticsEvent.WC_NEW_SESSION
- }
- triggerEvent(
- event = analyticsEvent,
- params = mapOf(
- AnalyticsParam.WALLET_CONNECT_DAPP_URL.param to event.url
- ).filterNotNull()
- )
- }
- }
- }
-
- fun logShopifyOrder(order: Storefront.Order) {
- triggerEvent(getOrderEvent(), getOrderParams(order))
- }
-
- protected abstract fun getOrderEvent(): String
-
- protected abstract fun getOrderParams(order: Storefront.Order): Map
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsInterfaces.kt b/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsInterfaces.kt
new file mode 100644
index 0000000000..6fd6fc7dc8
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/AnalyticsInterfaces.kt
@@ -0,0 +1,3 @@
+package com.tangem.tap.common.analytics
+
+
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/AppsFlyerAnalyticsHandler.kt b/app/src/main/java/com/tangem/tap/common/analytics/AppsFlyerAnalyticsHandler.kt
deleted file mode 100644
index 16fa1644ab..0000000000
--- a/app/src/main/java/com/tangem/tap/common/analytics/AppsFlyerAnalyticsHandler.kt
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.tangem.tap.common.analytics
-
-import android.content.Context
-import com.appsflyer.AFInAppEventParameterName
-import com.appsflyer.AFInAppEventType
-import com.appsflyer.AppsFlyerLib
-import com.shopify.buy3.Storefront
-import com.tangem.common.card.Card
-import com.tangem.common.core.TangemSdkError
-
-class AppsFlyerAnalyticsHandler(val context: Context): AnalyticsHandler() {
-
- override fun triggerEvent(
- event: AnalyticsEvent,
- card: Card?,
- blockchain: String?,
- params: Map
- ) {
- AppsFlyerLib.getInstance().logEvent(context, event.event, prepareParams(card, blockchain))
- }
-
- override fun logCardSdkError(
- error: TangemSdkError,
- actionToLog: Analytics.ActionToLog,
- parameters: Map?,
- card: Card?
- ) {
- //TODO
- }
-
- override fun logError(error: Throwable, params: Map) {
- //TODO
- }
-
- override fun getOrderEvent(): String = AFInAppEventType.PURCHASE
-
- override fun getOrderParams(order: Storefront.Order): Map {
-
- val sku = order.lineItems.edges.firstOrNull()?.node?.variant?.sku ?: "unknown"
-
- val discountCode =
- (order.discountApplications.edges.firstOrNull()?.node as? Storefront.DiscountCodeApplication)?.code
-
- val discountParams = if (discountCode != null ){
- mapOf(AFInAppEventParameterName.COUPON_CODE to discountCode)
- } else {
- mapOf()
- }
-
- return mapOf(
- AFInAppEventParameterName.CONTENT_ID to sku,
- AFInAppEventParameterName.REVENUE to order.totalPriceV2.amount,
- AFInAppEventParameterName.CURRENCY to order.currencyCode.name
- ) + discountParams
- }
-
- override fun triggerEvent(event: String, params: Map) {
- AppsFlyerLib.getInstance().logEvent(context, event, params)
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/FirebaseAnalyticsHandler.kt b/app/src/main/java/com/tangem/tap/common/analytics/FirebaseAnalyticsHandler.kt
deleted file mode 100644
index 4e0371206a..0000000000
--- a/app/src/main/java/com/tangem/tap/common/analytics/FirebaseAnalyticsHandler.kt
+++ /dev/null
@@ -1,88 +0,0 @@
-package com.tangem.tap.common.analytics
-
-import android.os.Bundle
-import androidx.core.os.bundleOf
-import com.google.firebase.analytics.FirebaseAnalytics
-import com.google.firebase.analytics.ktx.analytics
-import com.google.firebase.crashlytics.FirebaseCrashlytics
-import com.google.firebase.ktx.Firebase
-import com.shopify.buy3.Storefront
-import com.tangem.common.card.Card
-import com.tangem.common.core.TangemSdkError
-
-object FirebaseAnalyticsHandler : AnalyticsHandler() {
- override fun triggerEvent(
- event: AnalyticsEvent,
- card: Card?,
- blockchain: String?,
- params: Map
- ) {
- val fullParams = prepareParams(card, blockchain) + params
- Firebase.analytics.logEvent(event.event, fullParams.toBundle())
- }
-
- fun logException(name: String, throwable: Throwable) {
- Firebase.analytics.logEvent(name, bundleOf(
- "message" to (throwable.message ?: "none"),
- "cause_message" to (throwable.cause?.message ?: "none"),
- "stack_trace" to throwable.stackTraceToString()
- ))
- }
-
- private fun Map.toBundle(): Bundle {
- return bundleOf(*this.toList().toTypedArray())
- }
-
- override fun logCardSdkError(
- error: TangemSdkError,
- actionToLog: Analytics.ActionToLog,
- parameters: Map?,
- card: Card?,
- ) {
- if (error is TangemSdkError.UserCancelled) return
-
- val params = parameters?.toMutableMap() ?: mutableMapOf()
- if (card != null) params + prepareParams(card)
- params[AnalyticsParam.ACTION] = actionToLog.key
- params[AnalyticsParam.ERROR_CODE] = error.code.toString()
- params[AnalyticsParam.ERROR_DESCRIPTION] = error.javaClass.simpleName
- params[AnalyticsParam.ERROR_KEY] = "TangemSdkError"
-
- params.forEach {
- FirebaseCrashlytics.getInstance().setCustomKey(it.key.param, it.value)
- }
- val cardError = TangemSdk.map(error)
- FirebaseCrashlytics.getInstance().recordException(cardError)
- }
-
- override fun logError(error: Throwable, params: Map) {
- params.forEach { (key, value) -> FirebaseCrashlytics.getInstance().setCustomKey(key, value) }
- FirebaseCrashlytics.getInstance().recordException(error)
- }
-
- override fun getOrderEvent(): String = FirebaseAnalytics.Event.PURCHASE
-
- override fun getOrderParams(order: Storefront.Order): Map {
-
- val sku = order.lineItems.edges.firstOrNull()?.node?.variant?.sku ?: "unknown"
-
- val discountCode =
- (order.discountApplications.edges.firstOrNull()?.node as? Storefront.DiscountCodeApplication)?.code
-
- val discountParams = if (discountCode != null ){
- mapOf(FirebaseAnalytics.Param.DISCOUNT to discountCode)
- } else {
- mapOf()
- }
-
- return mapOf(
- FirebaseAnalytics.Param.ITEM_ID to sku,
- FirebaseAnalytics.Param.VALUE to order.totalPriceV2.amount,
- FirebaseAnalytics.Param.CURRENCY to order.currencyCode.name
- ) + discountParams
- }
-
- override fun triggerEvent(event: String, params: Map) {
- Firebase.analytics.logEvent(event, params.toBundle())
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/GlobalAnalyticsEventHandlerBuilder.kt b/app/src/main/java/com/tangem/tap/common/analytics/GlobalAnalyticsEventHandlerBuilder.kt
new file mode 100644
index 0000000000..8e2b439e08
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/GlobalAnalyticsEventHandlerBuilder.kt
@@ -0,0 +1,79 @@
+package com.tangem.tap.common.analytics
+
+import android.app.Application
+import com.tangem.common.json.MoshiJsonConverter
+import com.tangem.domain.common.AnalyticsHandlersLogConfig
+import com.tangem.tap.common.analytics.api.AnalyticsEventHandler
+import com.tangem.tap.common.analytics.handlers.amplitude.AmplitudeAnalyticsHandler
+import com.tangem.tap.common.analytics.handlers.amplitude.AmplitudeClient
+import com.tangem.tap.common.analytics.handlers.amplitude.AmplitudeLogClient
+import com.tangem.tap.common.analytics.handlers.appsFlyer.AppsFlyerAnalyticsHandler
+import com.tangem.tap.common.analytics.handlers.appsFlyer.AppsFlyerClient
+import com.tangem.tap.common.analytics.handlers.appsFlyer.AppsFlyerLogClient
+import com.tangem.tap.common.analytics.handlers.firebase.FirebaseAnalyticsHandler
+import com.tangem.tap.common.analytics.handlers.firebase.FirebaseClient
+import com.tangem.tap.common.analytics.handlers.firebase.FirebaseLogClient
+import com.tangem.tap.domain.configurable.config.Config
+
+/**
+[REDACTED_AUTHOR]
+ */
+class GlobalAnalyticsEventHandlerBuilder(
+ val application: Application,
+ val config: Config,
+ val isDebug: Boolean,
+ val logConfig: AnalyticsHandlersLogConfig,
+ val jsonConverter: MoshiJsonConverter,
+) {
+
+ private val analyticHandlers = mutableListOf()
+
+ fun build(): GlobalAnalyticsEventHandler {
+ return GlobalAnalyticsHandler(analyticHandlers.toList())
+ }
+
+ fun default(): GlobalAnalyticsEventHandler {
+ addFirebaseAnalytics()
+ addAppsFlyer()
+ addAmplitude()
+
+ return GlobalAnalyticsHandler(analyticHandlers.toList())
+ }
+
+ fun addFirebaseAnalytics(): GlobalAnalyticsEventHandlerBuilder {
+ if (isDebug) {
+ if (logConfig.firebase) FirebaseLogClient(createLogger("FirebaseAnalyticsHandler")) else null
+ } else {
+ FirebaseClient()
+ }?.let {
+ analyticHandlers.add(FirebaseAnalyticsHandler(it))
+ }
+ return this
+ }
+
+ fun addAppsFlyer(): GlobalAnalyticsEventHandlerBuilder {
+ if (isDebug) {
+ if (logConfig.appsFlyer) AppsFlyerLogClient(createLogger("AppsFlyerAnalyticsHandler")) else null
+ } else {
+ AppsFlyerClient(application, config.appsFlyerDevKey)
+ }?.let {
+ analyticHandlers.add(AppsFlyerAnalyticsHandler(it))
+ }
+ return this
+ }
+
+ fun addAmplitude(): GlobalAnalyticsEventHandlerBuilder {
+ if (isDebug) {
+ if (logConfig.firebase) AmplitudeLogClient(createLogger("AmplitudeAnalyticsHandler")) else null
+ } else {
+ AmplitudeClient(application, config.amplitudeApiKey)
+ }?.let {
+ analyticHandlers.add(AmplitudeAnalyticsHandler(it))
+ }
+ return this
+ }
+
+ private fun createLogger(name: String): AnalyticsEventsLogger {
+ return AnalyticsEventsLogger(name, jsonConverter)
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/GlobalAnalyticsHandler.kt b/app/src/main/java/com/tangem/tap/common/analytics/GlobalAnalyticsHandler.kt
index 197f396621..d1bef7d01b 100644
--- a/app/src/main/java/com/tangem/tap/common/analytics/GlobalAnalyticsHandler.kt
+++ b/app/src/main/java/com/tangem/tap/common/analytics/GlobalAnalyticsHandler.kt
@@ -1,53 +1,160 @@
package com.tangem.tap.common.analytics
-import android.content.Context
import com.shopify.buy3.Storefront
+import com.tangem.blockchain.common.BlockchainError
import com.tangem.common.card.Card
import com.tangem.common.core.TangemSdkError
+import com.tangem.tap.common.analytics.api.AnalyticsEventHandler
+import com.tangem.tap.common.analytics.api.BlockchainSdkErrorEventHandler
+import com.tangem.tap.common.analytics.api.CardSdkErrorEventHandler
+import com.tangem.tap.common.analytics.api.ErrorEventHandler
+import com.tangem.tap.common.analytics.api.ErrorEventLogger
+import com.tangem.tap.common.analytics.api.SdkErrorEventHandler
+import com.tangem.tap.common.analytics.api.ShopifyOrderEventHandler
+import com.tangem.tap.common.analytics.events.AnalyticsEvent
+import com.tangem.tap.common.extensions.filterNotNull
-class GlobalAnalyticsHandler(val analyticsHandlers: List) :
- AnalyticsHandler() {
- override fun triggerEvent(
+interface GlobalAnalyticsEventHandler : AnalyticsEventHandler,
+ ErrorEventHandler,
+ SdkErrorEventHandler,
+ ShopifyOrderEventHandler {
+
+ fun attachToAllEvents(key: String, value: String)
+
+ companion object {
+ fun stub(): GlobalAnalyticsEventHandler {
+ return object : GlobalAnalyticsEventHandler {
+ override fun attachToAllEvents(key: String, value: String) {}
+ override fun handleEvent(event: String, params: Map) {}
+ override fun handleErrorEvent(error: Throwable, params: Map) {}
+ override fun handleCardSdkErrorEvent(
+ error: TangemSdkError,
+ action: AnalyticsAnOld.ActionToLog,
+ params: Map,
+ card: Card?,
+ ) {
+ }
+
+ override fun handleBlockchainSdkErrorEvent(
+ error: BlockchainError,
+ action: AnalyticsAnOld.ActionToLog,
+ params: Map,
+ card: Card?,
+ ) {
+ }
+
+ override fun handleShopifyOrderEvent(order: Storefront.Order) {}
+ }
+ }
+ }
+}
+
+class GlobalAnalyticsHandler(
+ private val analyticsHandlers: List,
+) : GlobalAnalyticsEventHandler {
+
+ private val attachToAllEventsParams: MutableMap = mutableMapOf()
+
+ override fun attachToAllEvents(key: String, value: String) {
+ attachToAllEventsParams[key] = value
+ }
+
+ override fun handleEvent(event: String, params: Map) {
+ analyticsHandlers.forEach { it.handleEvent(event, params) }
+ }
+
+ override fun handleAnalyticsEvent(
event: AnalyticsEvent,
card: Card?,
blockchain: String?,
- params: Map
) {
- analyticsHandlers.forEach { it.triggerEvent(event, card, blockchain, params) }
+ analyticsHandlers.forEach { it.handleAnalyticsEvent(event, card, blockchain) }
}
- override fun triggerEvent(event: String, params: Map) {
- analyticsHandlers.forEach { it.triggerEvent(event, params) }
+ override fun handleAnalyticsEvent(
+ event: AnalyticsEventAnOld,
+ params: Map,
+ card: Card?,
+ blockchain: String?,
+ ) {
+ analyticsHandlers.forEach { it.handleAnalyticsEvent(event, params, card, blockchain) }
}
- override fun logCardSdkError(
+ override fun handleErrorEvent(error: Throwable, params: Map) {
+ analyticsHandlers.filterIsInstance().forEach {
+ it.logErrorEvent(error, params)
+ }
+ }
+
+ override fun handleCardSdkErrorEvent(
error: TangemSdkError,
- actionToLog: Analytics.ActionToLog,
- parameters: Map?,
- card: Card?
+ action: AnalyticsAnOld.ActionToLog,
+ params: Map,
+ card: Card?,
) {
- analyticsHandlers.forEach { it.logCardSdkError(error, actionToLog, parameters, card) }
+ analyticsHandlers.filterIsInstance().forEach {
+ it.handleCardSdkErrorEvent(error, action, params, card)
+ }
}
- override fun logError(error: Throwable, params: Map) {
- analyticsHandlers.forEach { it.logError(error, params) }
+ override fun handleBlockchainSdkErrorEvent(
+ error: BlockchainError,
+ action: AnalyticsAnOld.ActionToLog,
+ params: Map,
+ card: Card?,
+ ) {
+ analyticsHandlers.filterIsInstance().forEach {
+ it.handleBlockchainSdkErrorEvent(error, action, params, card)
+ }
}
- override fun getOrderEvent(): String {
- return ""
+ override fun handleShopifyOrderEvent(order: Storefront.Order) {
+ analyticsHandlers.filterIsInstance().forEach {
+ it.handleShopifyOrderEvent(order)
+ }
}
- override fun getOrderParams(order: Storefront.Order): Map {
- return emptyMap()
+ override fun prepareParams(card: Card?, blockchain: String?, params: Map): Map {
+ return super.prepareParams(card, blockchain, params).toMutableMap().apply {
+ putAll(attachToAllEventsParams)
+ }
}
+}
- companion object {
- fun createDefaultAnalyticHandlers(context: Context): GlobalAnalyticsHandler {
- return GlobalAnalyticsHandler(
- listOf(
- FirebaseAnalyticsHandler,
- AppsFlyerAnalyticsHandler(context)
- )
+fun GlobalAnalyticsEventHandler.logWcEvent(event: AnalyticsAnOld.WcAnalyticsEvent) {
+ when (event) {
+ is AnalyticsAnOld.WcAnalyticsEvent.Action -> {
+ handleAnalyticsEvent(
+ event = AnalyticsEventAnOld.WC_SUCCESS_RESPONSE,
+ params = mapOf(
+ AnalyticsParamAnOld.WALLET_CONNECT_ACTION.param to event.action.name,
+ ),
+ )
+ }
+ is AnalyticsAnOld.WcAnalyticsEvent.Error -> {
+ val params = mapOf(
+ AnalyticsParamAnOld.WALLET_CONNECT_ACTION.param to event.action?.name,
+ AnalyticsParamAnOld.ERROR_DESCRIPTION.param to event.error.message,
+ ).filterNotNull()
+ handleErrorEvent(event.error, params)
+ }
+ is AnalyticsAnOld.WcAnalyticsEvent.InvalidRequest ->
+ handleAnalyticsEvent(
+ event = AnalyticsEventAnOld.WC_INVALID_REQUEST,
+ params = mapOf(
+ AnalyticsParamAnOld.WALLET_CONNECT_REQUEST.param to event.json,
+ ).filterNotNull(),
+ )
+ is AnalyticsAnOld.WcAnalyticsEvent.Session -> {
+ val analyticsEvent = when (event.event) {
+ AnalyticsAnOld.WcSessionEvent.Disconnect -> AnalyticsEventAnOld.WC_SESSION_DISCONNECTED
+ AnalyticsAnOld.WcSessionEvent.Connect -> AnalyticsEventAnOld.WC_NEW_SESSION
+ }
+ handleAnalyticsEvent(
+ event = analyticsEvent,
+ params = mapOf(
+ AnalyticsParamAnOld.WALLET_CONNECT_DAPP_URL.param to event.url,
+ ).filterNotNull(),
)
}
}
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/api/ClientApi.kt b/app/src/main/java/com/tangem/tap/common/analytics/api/ClientApi.kt
new file mode 100644
index 0000000000..3b5b0720f2
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/api/ClientApi.kt
@@ -0,0 +1,18 @@
+package com.tangem.tap.common.analytics.api
+
+/**
+[REDACTED_AUTHOR]
+ */
+interface EventLogger {
+ fun logEvent(
+ event: String,
+ params: Map = emptyMap(),
+ )
+}
+
+interface ErrorEventLogger {
+ fun logErrorEvent(
+ error: Throwable,
+ params: Map = emptyMap(),
+ )
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/api/EventHandlerApi.kt b/app/src/main/java/com/tangem/tap/common/analytics/api/EventHandlerApi.kt
new file mode 100644
index 0000000000..08e1609e3c
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/api/EventHandlerApi.kt
@@ -0,0 +1,88 @@
+package com.tangem.tap.common.analytics.api
+
+import com.shopify.buy3.Storefront
+import com.tangem.blockchain.common.BlockchainError
+import com.tangem.common.card.Card
+import com.tangem.common.core.TangemSdkError
+import com.tangem.tap.common.analytics.AnalyticsAnOld
+import com.tangem.tap.common.analytics.AnalyticsEventAnOld
+import com.tangem.tap.common.analytics.AnalyticsParamAnOld
+import com.tangem.tap.common.analytics.events.AnalyticsEvent
+import com.tangem.tap.common.analytics.events.AnalyticsParam
+import com.tangem.tap.common.extensions.filterNotNull
+
+/**
+[REDACTED_AUTHOR]
+ */
+interface AnalyticsEventHandler {
+ fun handleEvent(
+ event: String,
+ params: Map = emptyMap(),
+ )
+
+ fun handleAnalyticsEvent(
+ event: AnalyticsEvent,
+ card: Card? = null,
+ blockchain: String? = null,
+ ) {
+ handleEvent(
+ event = prepareEventString(event.category, event.event),
+ params = prepareParams(card, blockchain, event.params),
+ )
+ }
+
+ @Deprecated("Migrate to AnalyticsEvent")
+ fun handleAnalyticsEvent(
+ event: AnalyticsEventAnOld,
+ params: Map = emptyMap(),
+ card: Card? = null,
+ blockchain: String? = null,
+ ) {
+ handleEvent(event.event, prepareParams(card, blockchain, params))
+ }
+
+ fun prepareParams(
+ card: Card? = null,
+ blockchain: String? = null,
+ params: Map = emptyMap(),
+ ): Map = mapOf(
+ AnalyticsParam.Firmware to card?.firmwareVersion?.stringValue,
+ AnalyticsParam.BatchId to card?.batchId,
+ AnalyticsParam.Blockchain to blockchain,
+ ).filterNotNull() + params
+
+ fun prepareEventString(category: String, event: String): String {
+ return "[$category] $event"
+ }
+}
+
+interface ErrorEventHandler {
+ fun handleErrorEvent(
+ error: Throwable,
+ params: Map = emptyMap(),
+ )
+}
+
+interface SdkErrorEventHandler : CardSdkErrorEventHandler, BlockchainSdkErrorEventHandler
+
+interface CardSdkErrorEventHandler {
+ fun handleCardSdkErrorEvent(
+ error: TangemSdkError,
+ action: AnalyticsAnOld.ActionToLog,
+ params: Map = emptyMap(),
+ card: Card? = null,
+ )
+}
+
+interface BlockchainSdkErrorEventHandler {
+ fun handleBlockchainSdkErrorEvent(
+ error: BlockchainError,
+ action: AnalyticsAnOld.ActionToLog,
+ params: Map = mapOf(),
+ card: Card? = null,
+ )
+}
+
+interface ShopifyOrderEventHandler {
+ fun handleShopifyOrderEvent(order: Storefront.Order)
+}
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/converters/SdkErrorConverters.kt b/app/src/main/java/com/tangem/tap/common/analytics/converters/SdkErrorConverters.kt
new file mode 100644
index 0000000000..5229df8174
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/converters/SdkErrorConverters.kt
@@ -0,0 +1,88 @@
+package com.tangem.tap.common.analytics.converters
+
+import com.tangem.blockchain.common.BlockchainError
+import com.tangem.blockchain.common.BlockchainSdkError
+import com.tangem.common.Converter
+import com.tangem.common.core.TangemSdkError
+import com.tangem.tap.common.analytics.AnalyticsAnOld
+import com.tangem.tap.common.analytics.AnalyticsParamAnOld
+import com.tangem.tap.common.analytics.TangemSdk
+import com.tangem.tap.features.demo.DemoTransactionSender
+
+/**
+[REDACTED_AUTHOR]
+ */
+internal data class ErrorEvent(
+ val throwable: Throwable,
+ val params: Map,
+)
+
+internal class CardSdkErrorConverter : Converter {
+
+ override fun convert(value: Model): ErrorEvent? {
+ if (value.error is TangemSdkError.UserCancelled) return null
+
+ val mutableParams = value.params.convertToParamValue().toMutableMap().apply {
+ putAll(value.cardParams)
+ }
+ mutableParams[AnalyticsParamAnOld.ACTION.param] = value.action.key
+ mutableParams[AnalyticsParamAnOld.ERROR_CODE.param] = value.error.code.toString()
+ mutableParams[AnalyticsParamAnOld.ERROR_DESCRIPTION.param] = value.error.javaClass.simpleName
+ mutableParams[AnalyticsParamAnOld.ERROR_KEY.param] = "TangemSdkError"
+
+ return ErrorEvent(TangemSdk.map(value.error), mutableParams)
+ }
+
+ internal data class Model(
+ val error: TangemSdkError,
+ val action: AnalyticsAnOld.ActionToLog,
+ val params: Map,
+ val cardParams: Map,
+ )
+}
+
+internal class BlockchainSdkErrorConverter(
+ private val cardSdkErrorConverter: CardSdkErrorConverter,
+) : Converter {
+
+ override fun convert(value: Model): ErrorEvent? {
+ val error = (value.error as? BlockchainSdkError) ?: return null
+
+ if (error is BlockchainSdkError.WrappedTangemError) {
+ val tangemSdkError = (error.tangemError as? TangemSdkError) ?: return null
+
+ val cardSdkModel = CardSdkErrorConverter.Model(
+ error = tangemSdkError,
+ action = value.action,
+ params = value.params,
+ cardParams = value.cardParams,
+ )
+ return cardSdkErrorConverter.convert(cardSdkModel)
+ }
+
+ if (error.customMessage.contains(DemoTransactionSender.ID)) return null
+
+ val mutableParams = value.params.convertToParamValue().toMutableMap()
+ mutableParams[AnalyticsParamAnOld.ACTION.param] = value.action.key
+ mutableParams[AnalyticsParamAnOld.ERROR_CODE.param] = error.code.toString()
+ mutableParams[AnalyticsParamAnOld.ERROR_DESCRIPTION.param] = "${error.javaClass.simpleName}: ${error.customMessage}"
+ mutableParams[AnalyticsParamAnOld.ERROR_KEY.param] = "BlockchainSdkError"
+
+ return ErrorEvent(value.error, mutableParams)
+ }
+
+ data class Model(
+ val error: BlockchainError,
+ val action: AnalyticsAnOld.ActionToLog,
+ val params: Map,
+ val cardParams: Map,
+ )
+}
+
+internal fun Map.convertToParamValue(): Map {
+ return mutableMapOf().also { newMap ->
+ this.forEach {
+ newMap[it.key.param] = it.value
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/AnalyticsEvent.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/AnalyticsEvent.kt
new file mode 100644
index 0000000000..0451fdd68c
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/AnalyticsEvent.kt
@@ -0,0 +1,10 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class AnalyticsEvent(
+ val category: String,
+ val event: String,
+ val params: Map = mapOf(),
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/AnalyticsParam.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/AnalyticsParam.kt
new file mode 100644
index 0000000000..8c69239429
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/AnalyticsParam.kt
@@ -0,0 +1,58 @@
+package com.tangem.tap.common.analytics.events
+
+sealed class AnalyticsParam {
+
+ sealed class CurrencyType(val value: String) {
+ class Currency(currency: com.tangem.tap.features.wallet.models.Currency) : CurrencyType(currency.currencySymbol)
+ class Blockchain(blockchain: com.tangem.blockchain.common.Blockchain) : CurrencyType(blockchain.currency)
+ class Token(token: com.tangem.blockchain.common.Token) : CurrencyType(token.symbol)
+ }
+
+ // Multicurrency or CurrencyType
+ sealed class CardCurrency(val value: String) {
+ object MultiCurrency : CardCurrency("Multicurrency")
+ class SingleCurrency(type: CurrencyType) : CardCurrency(type.value)
+ }
+
+ sealed class CardState(val value: String) {
+ object Empty : CardState("Empty")
+ object Full : CardState("Full")
+ }
+
+ sealed class RateApp(val value: String) {
+ object Liked : RateApp("Liked")
+ object Disliked : RateApp("Disliked")
+ object Closed : RateApp("Close")
+ }
+
+ sealed class OnOffState(val value: String) {
+ object On : OnOffState("On")
+ object Off : OnOffState("Off")
+ }
+
+ sealed class UserCode(val value: String) {
+ object AccessCode : UserCode("Access Code")
+ object Passcode : UserCode("Passcode")
+ }
+
+ sealed class SecurityMode(val value: String) {
+ object AccessCode : SecurityMode("Access Code")
+ object Passcode : SecurityMode("Passcode")
+ object LongTap : SecurityMode("Long Tap")
+ }
+
+ sealed class SocialNetwork(val value: String) {
+ object Facebook : SocialNetwork("Facebook")
+ object Instagram : SocialNetwork("Instagram")
+ object Youtube : SocialNetwork("Youtube")
+ object Twitter : SocialNetwork("Twitter")
+ object LinkedIn : SocialNetwork("LinkedIn")
+ object GitHub : SocialNetwork("GitHub")
+ }
+
+ companion object Key {
+ const val Blockchain = "blockchain"
+ const val BatchId = "batch_id"
+ const val Firmware = "firmware"
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/Basic.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/Basic.kt
new file mode 100644
index 0000000000..bb37145672
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/Basic.kt
@@ -0,0 +1,28 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class Basic(
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent("Basic", event, params) {
+
+ sealed class SignedIn(
+ state: AnalyticsParam.CardState,
+ currency: AnalyticsParam.CardCurrency,
+ batch: String,
+ ) : Basic(
+ event = "Signed in",
+ params = mapOf(
+ "State" to state.value,
+ "Currency" to currency.value,
+ "Batch" to batch,
+ ),
+ )
+
+ class ToppedUp(currency: AnalyticsParam.CardCurrency) : Basic(
+ event = "Topped up",
+ params = mapOf("Currency" to currency.value),
+ )
+}
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/Chat.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/Chat.kt
new file mode 100644
index 0000000000..a26109ae2a
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/Chat.kt
@@ -0,0 +1,12 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class Chat(
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent("Chat", event, params) {
+
+ class ScreenOpened : Chat("Chat Screen Opened")
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/DetailsScreen.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/DetailsScreen.kt
new file mode 100644
index 0000000000..1ec8d81533
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/DetailsScreen.kt
@@ -0,0 +1,12 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class DetailsScreen(
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent("Details Screen", event, params) {
+
+ class ScreenOpened : DetailsScreen("Details Screen Opened")
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/IntroductionProcess.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/IntroductionProcess.kt
new file mode 100644
index 0000000000..4b3eb7f431
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/IntroductionProcess.kt
@@ -0,0 +1,17 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class IntroductionProcess(
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent("Introduction Process", event, params) {
+
+ class ScreenOpened : IntroductionProcess("Introduction Process Screen Opened")
+ class ButtonTokensList : IntroductionProcess("Button - Tokens List")
+ class ButtonBuyCards : IntroductionProcess("Button - Buy Cards")
+ class ButtonScanCard : IntroductionProcess("Button - Scan Card")
+ class CardWasScanned : IntroductionProcess("Card Was Scanned")
+ class ButtonRequestSupport : IntroductionProcess("Button - Request Support")
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/MainScreen.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/MainScreen.kt
new file mode 100644
index 0000000000..c6825718b7
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/MainScreen.kt
@@ -0,0 +1,29 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class MainScreen(
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent("Main Screen", event, params) {
+
+ class ScreenOpened : MainScreen("Screen opened")
+
+ class ButtonScanCard : MainScreen("Button - Scan Card")
+ class CardWasScanned : MainScreen("Card Was Scanned")
+ class ButtonMyWallets : MainScreen("Button - My Wallets")
+
+ class MainCurrencyChanged(currencyType: AnalyticsParam.CurrencyType) : MainScreen(
+ event = "Main Currency Changed",
+ params = mapOf("Currency Type" to currencyType.value),
+ )
+
+ sealed class NoticeRateAppButton(result: AnalyticsParam.RateApp) : MainScreen(
+ event = "Notice - Rate The App Button Tapped",
+ params = mapOf("Result" to result.value),
+ )
+
+ class NoticeBackupYourWalletTapped : MainScreen("Notice - Backup Your Wallet Tapped")
+ class NoticeScanYourCardTapped : MainScreen("Notice - Scan Your Card Tapped")
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/ManageTokens.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/ManageTokens.kt
new file mode 100644
index 0000000000..e5e3fdb96a
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/ManageTokens.kt
@@ -0,0 +1,33 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class ManageTokens(
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent("Manage Tokens", event, params) {
+
+ class ScreenOpened : ManageTokens("Manage Tokens Screen Opened")
+ class TokenSearched : ManageTokens("Token Searched")
+ class TokenSwitcherChanged : ManageTokens("Token Switcher Changed")
+ class ButtonSaveChanges : ManageTokens("Button - Save Changes")
+ class ButtonCustomToken : ManageTokens("Button - Custom Token")
+
+ sealed class CustomToken(
+ event: String,
+ params: Map = mapOf(),
+ ) : ManageTokens(event, params) {
+
+ class ScreenOpened : ManageTokens("Custom Token Screen Opened")
+
+ class TokenWasAdded(symbol: String, network: String, address: String) : ManageTokens(
+ event = "Custom Token Was Added",
+ params = mapOf(
+ "Symbol" to symbol,
+ "Network" to network,
+ "Address" to address,
+ ),
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/Onboarding.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/Onboarding.kt
new file mode 100644
index 0000000000..b65408b7d5
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/Onboarding.kt
@@ -0,0 +1,76 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class Onboarding(
+ category: String,
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent(category, event, params) {
+
+ class Started : Onboarding("Onboarding", "Onboarding Started")
+ class Finished : Onboarding("Onboarding", "Onboarding Finished")
+
+ sealed class CreateWallet(
+ event: String,
+ params: Map = mapOf(),
+ ) : Onboarding("Onboarding / Create Wallet", event, params) {
+
+ class ScreenOpened : CreateWallet("Create Wallet Screen Opened")
+ class ButtonCreateWallet : CreateWallet("Button - Create Wallet")
+ class WalletCreatedSuccessfully : CreateWallet("Wallet Created Successfully")
+ }
+
+ sealed class Backup(
+ event: String,
+ params: Map = mapOf(),
+ ) : Onboarding("Onboarding / Backup", event, params) {
+
+ class ScreenOpened : Backup("Backup Screen Opened")
+ class Started : Backup("Backup Started")
+ class Skipped : Backup("Backup Skipped")
+ class SettingAccessCodeStarted : Backup("Setting Access Code Started")
+ class AccessCodeEntered : Backup("Access Code Entered")
+ class AccessCodeReEntered : Backup("Access Code Re-entered")
+
+ class Finished(cardsCount: String) : Backup(
+ event = "Backup Finished",
+ params = mapOf("Cards count" to cardsCount),
+ )
+ }
+
+ sealed class Topup(
+ event: String,
+ params: Map = mapOf(),
+ ) : Onboarding("Onboarding / Top Up", event, params) {
+
+ class ScreenOpened : Topup("Activation Screen Opened")
+
+ class ButtonBuyCrypto(currency: AnalyticsParam.CurrencyType) : Topup(
+ event = "Button - Buy Crypto",
+ params = mapOf("Currency" to currency.value),
+ )
+
+ class ButtonShowWalletAddress : Topup("Button - Show the Wallet Address")
+ }
+
+ sealed class Twins(
+ event: String,
+ params: Map = mapOf(),
+ ) : Onboarding("Onboarding / Twins", event, params) {
+
+ class ScreenOpened : Twins("Twinning Screen Opened")
+ class SetupStarted : Twins("Twin Setup Started")
+ class SetupFinished : Twins("Twin Setup Finished")
+ }
+
+ class PinCodeSet: Onboarding("Onboarding", "PIN code set")
+ class ButtonConnect: Onboarding("Onboarding", "Button - Connect")
+ class KYCStarted: Onboarding("Onboarding", "KYC started")
+ class KYCInProgress: Onboarding("Onboarding", "KYC in progress")
+ class KYCRejected: Onboarding("Onboarding", "KYC rejected")
+ class ClaimScreenOpened: Onboarding("Onboarding", "Claim screen opened")
+ class ButtonClaim: Onboarding("Onboarding", "Button - Claim")
+ class ClaimWasSuccessfully: Onboarding("Onboarding", "Claim was successfully")
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/Portfolio.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/Portfolio.kt
new file mode 100644
index 0000000000..6747c2172d
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/Portfolio.kt
@@ -0,0 +1,15 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+
+sealed class Portfolio(
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent("Portfolio", event, params) {
+
+ class Refreshed : Portfolio("Refreshed")
+ class ButtonManageTokens : Portfolio("Button - Manage Tokens")
+ class TokenTapped : Portfolio("Token is Tapped")
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/Settings.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/Settings.kt
new file mode 100644
index 0000000000..56893d2f31
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/Settings.kt
@@ -0,0 +1,64 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class Settings(
+ category: String = "Settings",
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent(category, event, params) {
+
+ class ScreenOpened : Settings(event = "Settings Screen Opened")
+ class ButtonChat : Settings(event = "Button - Chat")
+ class ButtonSendFeedback : Settings(event = "Button - Send Feedback")
+ class ButtonStartWalletConnectSession : Settings(event = "Button - Start Wallet Connect Session")
+ class ButtonStopWalletConnectSession : Settings(event = "Button - Stop Wallet Connect Session")
+ class ButtonCardSettings : Settings(event = "Button - Card Settings")
+ class ButtonAppSettings : Settings(event = "Button - App Settings")
+ class ButtonCreateBackup : Settings(event = "Button - Create Backup")
+
+ sealed class ButtonSocialNetwork(network: AnalyticsParam.SocialNetwork) : Settings(
+ event = "Button - Social Network",
+ params = mapOf("Network" to network.value),
+ )
+
+ sealed class CardSettings(
+ event: String,
+ params: Map = mapOf(),
+ ) : Settings("Settings / Card Settings", event, params) {
+
+ class ButtonFactoryReset : CardSettings("Button - Factory Reset")
+ class FactoryResetFinished : CardSettings("Factory Reset Finished")
+ class UserCodeChanged : CardSettings("User Code Changed")
+ class ButtonChangeSecurityMode : CardSettings("Button - Change Security Mode")
+
+ sealed class ButtonChangeUserCode(type: AnalyticsParam.UserCode) : CardSettings(
+ event = "Button - Change User Code",
+ params = mapOf("Type" to type.value),
+ )
+
+ sealed class SecurityModeChanged(mode: AnalyticsParam.SecurityMode) : CardSettings(
+ event = "Security Mode Changed",
+ params = mapOf("Mode" to mode.value),
+ )
+ }
+
+ sealed class AppSettings(
+ event: String,
+ params: Map = mapOf(),
+ ) : Settings("Settings / App Settings", event, params) {
+
+ sealed class FaceIDSwitcherChanged(state: AnalyticsParam.OnOffState) : CardSettings(
+ event = "Face ID Switcher Changed",
+ params = mapOf("State" to state.value),
+ )
+
+ sealed class SaveAccessCodeSwitcherChanged(state: AnalyticsParam.OnOffState) : CardSettings(
+ event = "Save Access Code Switcher Changed",
+ params = mapOf("State" to state.value),
+ )
+
+ class ButtonEnableBiometricAuthentication : AppSettings("Button - Enable Biometric Authentication")
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/Shop.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/Shop.kt
new file mode 100644
index 0000000000..c09bf89ab3
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/Shop.kt
@@ -0,0 +1,22 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class Shop(
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent("Shop", event, params) {
+
+ class ScreenOpened : IntroductionProcess("Shop Screen Opened")
+
+ class Purchased(productSku: String) : Shop(
+ event = "Purchased",
+ params = mapOf("SKU" to productSku),
+ )
+
+ class Redirected(partnerName: String) : Shop(
+ event = "Redirected",
+ params = mapOf("Partner" to partnerName),
+ )
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/Token.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/Token.kt
new file mode 100644
index 0000000000..afe5da529a
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/Token.kt
@@ -0,0 +1,62 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class Token(
+ category: String,
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent(category, event, params) {
+
+ class Refreshed : Token("Token", "Refreshed")
+ class ButtonRemoveToken : Token("Token", "Button - Remove Token")
+ class ButtonExplore : Token("Token", "Button - Explore")
+ class ButtonBuy(token: String) : Token("Token", "Button - Buy", mapOf("Token" to token))
+ class ButtonSell(token: String) : Token("Token", "Button - Sell", mapOf("Token" to token))
+ class ButtonExchange(token: String) : Token("Token", "Button - Exchange", mapOf("Token" to token))
+ class ButtonSend(token: String) : Token("Token", "Button - Send", mapOf("Token" to token))
+
+ sealed class Recieve(
+ event: String,
+ params: Map = mapOf(),
+ ) : Token("Token / Recieve", event, params) {
+
+ class ScreenOpened : Recieve("Recieve Screen Opened")
+ class ButtonCopyAddress : Recieve("Button - Copy Address")
+ class ButtonShareAddress : Recieve("Button - Share Address")
+ }
+
+ sealed class Send(
+ event: String,
+ params: Map = mapOf(),
+ ) : Token("Token / Send", event, params) {
+
+ class ScreenOpened : Send("Send Screen Opened")
+ class ButtonPaste : Send("Button - Paste")
+ class ButtonQRCode : Send("Button - QR Code")
+ class ButtonSwapCurrency : Send("Button - Swap Currency")
+
+ class TransactionSent(token: AnalyticsParam.CurrencyType) : Send(
+ event = "Transaction Sent",
+ params = mapOf("Token" to token.value),
+ )
+ }
+
+ sealed class Topup(
+ event: String,
+ params: Map = mapOf(),
+ ) : Token("Token / Topup", event, params) {
+
+ class ScreenOpened : Topup("Top Up Screen Opened")
+ class P2PScreenOpened : Topup("P2P Screen Opened")
+ }
+
+ sealed class Withdraw(
+ event: String,
+ params: Map = mapOf(),
+ ) : Token("Token / Withdraw", event, params) {
+
+ class ScreenOpened : Withdraw("Withdraw Screen Opened")
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/WalletConnect.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/WalletConnect.kt
new file mode 100644
index 0000000000..624145c63d
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/events/WalletConnect.kt
@@ -0,0 +1,14 @@
+package com.tangem.tap.common.analytics.events
+
+/**
+[REDACTED_AUTHOR]
+ */
+sealed class WalletConnect(
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent("Wallet Connect", event, params) {
+
+ class NewSessionEstablished : WalletConnect("New Session Established")
+ class SessionDisconnected : WalletConnect("Session Disconnected")
+ class RequestSigned : WalletConnect("Request Signed")
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/handlers/amplitude/AmplitudeAnalyticsHandler.kt b/app/src/main/java/com/tangem/tap/common/analytics/handlers/amplitude/AmplitudeAnalyticsHandler.kt
new file mode 100644
index 0000000000..27132a1f61
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/handlers/amplitude/AmplitudeAnalyticsHandler.kt
@@ -0,0 +1,12 @@
+package com.tangem.tap.common.analytics.handlers.amplitude
+
+import com.tangem.tap.common.analytics.api.AnalyticsEventHandler
+
+class AmplitudeAnalyticsHandler(
+ private val client: AmplitudeAnalyticsClient,
+) : AnalyticsEventHandler {
+
+ override fun handleEvent(event: String, params: Map) {
+ client.logEvent(event, params)
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/common/analytics/handlers/amplitude/AmplitudeClient.kt b/app/src/main/java/com/tangem/tap/common/analytics/handlers/amplitude/AmplitudeClient.kt
new file mode 100644
index 0000000000..d90ed084b5
--- /dev/null
+++ b/app/src/main/java/com/tangem/tap/common/analytics/handlers/amplitude/AmplitudeClient.kt
@@ -0,0 +1,36 @@
+package com.tangem.tap.common.analytics.handlers.amplitude
+
+import android.app.Application
+import com.amplitude.api.Amplitude
+import com.amplitude.api.AmplitudeClient
+import com.tangem.common.Converter
+import com.tangem.tap.common.analytics.api.EventLogger
+import org.json.JSONObject
+
+/**
+[REDACTED_AUTHOR]
+ */
+interface AmplitudeAnalyticsClient : EventLogger
+
+internal class AmplitudeClient(
+ application: Application,
+ key: String,
+) : AmplitudeAnalyticsClient {
+
+ private val client: AmplitudeClient = Amplitude.getInstance()
+
+ init {
+ client.initialize(application, key)
+ client.enableForegroundTracking(application)
+ }
+
+ override fun logEvent(event: String, params: Map) {
+ client.logEvent(event, ParamsToJSONObjectConverter().convert(params))
+ }
+}
+
+private class ParamsToJSONObjectConverter : Converter