Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saqibadnan0011/cryptowallet
IOS app for monitoring the cryptocurrencies
https://github.com/saqibadnan0011/cryptowallet
bitcoin bitcoin-wallet cryptocurrency ios price swift
Last synced: about 1 month ago
JSON representation
IOS app for monitoring the cryptocurrencies
- Host: GitHub
- URL: https://github.com/saqibadnan0011/cryptowallet
- Owner: Saqibadnan0011
- Created: 2023-11-28T18:42:31.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-08-02T18:04:04.000Z (4 months ago)
- Last Synced: 2024-10-13T00:02:34.487Z (about 1 month ago)
- Topics: bitcoin, bitcoin-wallet, cryptocurrency, ios, price, swift
- Language: Swift
- Homepage:
- Size: 146 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
CryptoWallet: IOS Cryptocurrency App
![Swift 5.0](https://img.shields.io/badge/Swift-5.0-brightgreen.svg)
CryptoWallet, is a swift library and IOS app to watch prices and check your realtime account balance across multiple cryptocurrencies exchange.Show the different type of coins and their graph according to the current market prices and currencies.Working on more effectable functionalities.
Light and Dark mode Preferences
Requirements
- IOS 16.0
- XCode
Features
- Live prices according to the current market
- Show the percentage between Market Cap and DTC Dominance
- Holding your coin to explore the more ups and downs during the market graph
- Customize your holdings coins inside your account
Services
Fetching the coin data from API
```swift
import Combine
func getCoin() {
guard let url = URL(string: "https://api.coingecko.com/api/v3/coins/markets? vs_currency=usd&order=market_cap_desc&per_page=250&page=1&sparkline=true&price_change_percentage=24h") else { return }
coinSubscription = NetworkManager.download(url: url)
.decode(type: [CoinModel].self , decoder: JSONDecoder())
.sink(receiveCompletion: NetworkManager.handleCompletion, receiveValue: { [weak self] (returnedCoins) in
self?.allCoins = returnedCoins
self?.coinSubscription?.cancel()
})
}
```
Use CoreData for Setup the portfolio
```swift
import CoreData
init() {
container = NSPersistentContainer(name: containerName)
container.loadPersistentStores { (_, error) in
if let error = error {
print("Error loading CoreData! \(error)")
}
self.getPortfolio()
}
}
```
Initialize the Views to see coin with their details and prices
console
```
Initializing the view: Bitcoin
Recieve coin data: nil
Recieve coin data: Optional(CryptoWallet.CoinDetailModel(id: Optional("bitcoin"),
symbol: Optional("btc"), name: Optional("Bitcoin"), blockTimeInMinutes: Optional(10),
hashingAlgorithm: Optional("SHA-256"), description: Optional(CryptoWallet.Description(en: "Bitcoin is the first successful internet money based on peer-to-peer technology; whereby no central bank or authority is involved in the transaction and production of the Bitcoin currency. It was created by an anonymous individual/group under the name, Satoshi Nakamoto. The source code is available publicly as an open source project,
anybody can look at it and be part of the developmental process.\r\n\r\nBitcoin is changing the way we see money as we speak.
The idea was to produce a means of exchange, independent of any central authority, that could be transferred electronically in a secure,
verifiable and immutable way. It is a decentralized peer-to-peer internet currency making mobile payment easy,
very low transaction fees, protects your identity, and it works anywhere all the time with no central authority and banks.
\r\n\r\nBitcoin is designed to have only 21 million BTC ever created, thus making it a deflationary currency.
Bitcoin uses the SHA-256 hashing algorithm with an average transaction confirmation time of 10 minutes. Miners today are mining Bitcoin using ASIC chip dedicated to only mining Bitcoin, and the hash rate has shot up to peta hashes.
\r\n\r\nBeing the first successful online cryptography currency, Bitcoin has inspired other alternative currencies such as Litecoin, Peercoin,
Primecoin, and so on.
\r\n\r\nThe cryptocurrency then took off with the innovation of the turing-complete smart contract by
Ethereum which led to the development of other amazing projects such as
EOS, Tron, and even crypto-collectibles such as
CryptoKitties.")), links: Optional(CryptoWallet.Links(homepage: ["http://www.bitcoin.org", "", ""], subredditURL: Optional("https://www.reddit.com/r/Bitcoin/")))))
```
Extensions
UIApplication extension
```swift
import Foundation
import SwiftUI
extension UIApplication {
func endEditing() {
sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}
```
Date Extension to fetch and implement to current cryptocurrencies graphs
```swift
extension Date {
init(coinGeckoString: String) {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
let date = formatter.date(from: coinGeckoString) ?? Date()
self.init(timeInterval: 0, since: date)
}
```
API Integration
Use coinGecko API which is super conviniate and easy to use. And it's free
[cionGecko](https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=250&page=1&sparkline=true&price_change_percentage=24h)
Feeback
Give a πit will be appreciated.
Now you can