Skip to content

p2p-org/p2p-wallet-ios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Key App

Key App wallet on Solana blockchain

Features

  • Create new wallet
  • Restore existing wallet using seed phrases
  • Decentralized identification (name service)
  • Send SOL, SPL tokens and renBTC via name or address
  • Receive SOL, SPL tokens and renBTC
  • Swap SOL and SPL tokens (powered by Orca)
  • Buy tokens (moonpay)

Requirements

  • iOS 13.0+
  • Xcode 12
  • SwiftFormat

Installation

  • Clone project and move to folder
git clone [email protected]:p2p-org/p2p-wallet-ios.git && cd p2p-wallet-ios
  • Set git hooks (Optional)
git config core.hooksPath .githooks
chmod -R +x .githooks
  • Add Config.xcconfig to p2p-wallet-ios/p2p-wallet contains following content
// MARK: - Transak
TRANSAK_STAGING_API_KEY = fake_api_key
TRANSAK_PRODUCTION_API_KEY = fake_api_key
TRANSAK_HOST_URL = p2p.org

// Mark: - Moonpay
MOONPAY_STAGING_API_KEY = fake_api_key
MOONPAY_PRODUCTION_API_KEY = fake_api_key

// MARK: - Amplitude
AMPLITUDE_API_KEY = fake_api_key

// MARK: - FeeRelayer
FEE_RELAYER_STAGING_ENDPOINT = test-solana-fee-relayer.wallet.p2p.org
FEE_RELAYER_ENDPOINT = fee-relayer.solana.p2p.org
TEST_ACCOUNT_SEED_PHRASE = account-test-seed-phrase-separated-by-hyphens

// MARK: - NameService
NAME_SERVICE_ENDPOINT = name_service.org
  • Run install.sh
chmod u+x Scripts/install.sh && Scripts/install.sh
  • Select target p2p_wallet (if Detect Unused Code is selected by default after xcodegen)

Localization

  • Download LocalizationHelper app
  • Copy LocalizationHelper to Applications
  • After xcodegen, the LocalizationHelper stopped working, so here is the solution:
  1. Click "Open..."
  2. Choose Tuist project instead of Default project

image

  1. Choose project root folder (p2p-wallet-ios)
  2. Resouces folder must be p2p-wallet-ios/p2p_wallet

image

  1. Click open project.

image

CI/CD

  • Swiftgen for automatically generating strings, assets.
  • Swiftlint, SwiftFormat for linting, automatically formating code
  • Periphery for detecting dead code (use Detect Unused Code target and run)
  • CircleCI or GithubAction: implementing...

Fastlane config (optional)

Add .env file contains following content (ask teamate):

DEVELOPER_APP_IDENTIFIER=""
APP_STORE_CONNECT_TEAM_ID=""
DEVELOPER_PORTAL_TEAM_ID=""
DEVELOPER_APP_ID=""
PROVISIONING_PROFILE_SPECIFIER_ADHOC=""
PROVISIONING_PROFILE_SPECIFIER_APPSTORE=""
APPLE_ISSUER_ID=""
PROVISIONING_REPO=""

FIREBASE_APP_ID=""
FIREBASE_CLI_TOKEN=""

BROWSERSTACK_USERNAME=""
BROWSERSTACK_ACCESS_KEY=""

FASTLANE_APPLE_ID=""
TEMP_KEYCHAIN_USER=""
TEMP_KEYCHAIN_PASSWORD=""
APPLE_KEY_ID=""
APPLE_KEY_CONTENT=""
GIT_AUTHORIZATION=""
MATCH_PASSWORD=""
IS_CI=false

XCCONFIG_URL=""

Code style

  • Space indent: 4
  • NSAttributedString Example:
label.attributedText = 
   NSMutableAttributedString()
      .text(
          "0.00203928 SOL",
          size: 15,
          color: .textBlack
      )
      .text(
          " (~$0.93)",
          size: 15,
          color: .textSecondary
      )

Result image

UI Templates

  • Copy template MVVM-C.xctemplate that is located under Templates folder to ~/Library/Developer/Xcode/Templates/
mkdir -p ~/Library/Developer/Xcode/Templates/MVVM-C.xctemplate
cp -R Templates/MVVM-C.xctemplate ~/Library/Developer/Xcode/Templates

Dependency Injection

  • Resolver

Contribute

We would love you for the contribution to Key App, check the LICENSE file for more info.

Feature Flags

Add feature flag steps

  • Add feature flag to Firebase Remote Config with style: settingsFeature
  • Add feature flag with the same title to public extension Feature struct
public extension Feature {
    static let settingsFeature = Feature(rawValue: "settingsFeature")
}
  • Add feature flag to DebugMenuViewModel
extension DebugMenuViewModel {
    enum Menu: Int, CaseIterable {
        case newSettings

        var title: String {
            switch self {
            case .newSettings:
                return "New Settings"
            }
        }

        var feature: Feature {
            switch self {
            case .newSettings:
                return .settingsFeature
            }
        }
    }
}

Feature flag using example

if available(.settingsFeature) {
    showNewSettingsScreen(
        input: input,
        state: status.creditState
    )
} else {
    showOldSettingsScreen(
        input: input,
        status: status
    )
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages