Skip to content

Commit

Permalink
Update 1Inch module with apiKey
Browse files Browse the repository at this point in the history
  • Loading branch information
ant013 committed Oct 23, 2023
1 parent 3d138f6 commit 8062947
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy_appstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ jobs:
XCCONFIG_PROD_OPEN_SEA_API_KEY: ${{ secrets.XCCONFIG_PROD_OPEN_SEA_API_KEY }}
XCCONFIG_PROD_TRONGRID_API_KEY: ${{ secrets.XCCONFIG_PROD_TRONGRID_API_KEY }}
XCCONFIG_PROD_UNSTOPPABLE_DOMAINS_API_KEY: ${{ secrets.XCCONFIG_PROD_UNSTOPPABLE_DOMAINS_API_KEY }}
XCCONFIG_PROD_ONE_INCH_API_KEY: ${{ secrets.XCCONFIG_PROD_ONE_INCH_API_KEY }}
1 change: 1 addition & 0 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ jobs:
XCCONFIG_DEV_OPEN_SEA_API_KEY: ${{ secrets.XCCONFIG_DEV_OPEN_SEA_API_KEY }}
XCCONFIG_DEV_TRONGRID_API_KEY: ${{ secrets.XCCONFIG_DEV_TRONGRID_API_KEY }}
XCCONFIG_DEV_UNSTOPPABLE_DOMAINS_API_KEY: ${{ secrets.XCCONFIG_DEV_UNSTOPPABLE_DOMAINS_API_KEY }}
XCCONFIG_DEV_ONE_INCH_API_KEY: ${{ secrets.XCCONFIG_DEV_ONE_INCH_API_KEY }}
Original file line number Diff line number Diff line change
Expand Up @@ -11254,7 +11254,7 @@
repositoryURL = "https://github.com/horizontalsystems/OneInchKit.Swift";
requirement = {
kind = exactVersion;
version = 2.0.1;
version = 2.1.1;
};
};
D3604E6428F02D9A0066C366 /* XCRemoteSwiftPackageReference "BitcoinKit.Swift" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ shared_cloud_container_id = iCloud.io.horizontalsystems.bank-wallet.shared.dev
private_cloud_container_id = iCloud.io.horizontalsystems.bank-wallet.dev
open_sea_api_key =
unstoppable_domains_api_key =
one_inch_api_key =

default_words =
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ wallet_connect_v2_project_key =
shared_cloud_container_id = iCloud.io.horizontalsystems.bank-wallet.shared
private_cloud_container_id = iCloud.io.horizontalsystems.bank-wallet
open_sea_api_key =
unstoppable_domains_api_key =
unstoppable_domains_api_key =
one_inch_api_key =
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ struct AppConfig {
(Bundle.main.object(forInfoDictionaryKey: "UnstoppableDomainsApiKey") as? String).flatMap { $0.isEmpty ? nil : $0 }
}

static var oneInchApiKey: String? {
(Bundle.main.object(forInfoDictionaryKey: "oneInchApiKey") as? String).flatMap { $0.isEmpty ? nil : $0 }
}

static var defaultWords: String {
Bundle.main.object(forInfoDictionaryKey: "DefaultWords") as? String ?? ""
}
Expand Down
2 changes: 2 additions & 0 deletions UnstoppableWallet/UnstoppableWallet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,7 @@
<string>${open_sea_api_key}</string>
<key>UnstoppableDomainsApiKey</key>
<string>${unstoppable_domains_api_key}</string>
<key>oneInchApiKey</key>
<string>${one_inch_api_key}</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class OneInchModule {
return nil
}

guard let swapKit = try? OneInchKit.Kit.instance(evmKit: evmKit) else {
guard let apiKey = AppConfig.oneInchApiKey,
let swapKit = try? OneInchKit.Kit.instance(evmKit: evmKit, apiKey: apiKey) else {
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ struct SwapConfirmationModule {
}

let evmKit = evmKitWrapper.evmKit
guard let swapKit = try? OneInchKit.Kit.instance(evmKit: evmKit) else {
guard let apiKey = AppConfig.oneInchApiKey,
let swapKit = try? OneInchKit.Kit.instance(evmKit: evmKit, apiKey: apiKey) else {
return nil
}

Expand Down
4 changes: 4 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY = ENV["XCCONFIG_DEV_WALLET_CONNECT_V2
XCCONFIG_DEV_OPEN_SEA_API_KEY = ENV["XCCONFIG_DEV_OPEN_SEA_API_KEY"]
XCCONFIG_DEV_TRONGRID_API_KEY = ENV["XCCONFIG_DEV_TRONGRID_API_KEY"]
XCCONFIG_DEV_UNSTOPPABLE_DOMAINS_API_KEY = ENV["XCCONFIG_DEV_UNSTOPPABLE_DOMAINS_API_KEY"]
XCCONFIG_DEV_ONE_INCH_API_KEY = ENV["XCCONFIG_DEV_ONE_INCH_API_KEY"]

XCCONFIG_PROD_INFURA_PROJECT_ID = ENV["XCCONFIG_PROD_INFURA_PROJECT_ID"]
XCCONFIG_PROD_INFURA_PROJECT_SECRET = ENV["XCCONFIG_PROD_INFURA_PROJECT_SECRET"]
Expand All @@ -48,6 +49,7 @@ XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY = ENV["XCCONFIG_PROD_WALLET_CONNECT_
XCCONFIG_PROD_OPEN_SEA_API_KEY = ENV["XCCONFIG_PROD_OPEN_SEA_API_KEY"]
XCCONFIG_PROD_TRONGRID_API_KEY = ENV["XCCONFIG_PROD_TRONGRID_API_KEY"]
XCCONFIG_PROD_UNSTOPPABLE_DOMAINS_API_KEY = ENV["XCCONFIG_PROD_UNSTOPPABLE_DOMAINS_API_KEY"]
XCCONFIG_PROD_ONE_INCH_API_KEY = ENV["XCCONFIG_PROD_ONE_INCH_API_KEY"]

def delete_temp_keychain(name)
delete_keychain(
Expand Down Expand Up @@ -123,6 +125,7 @@ def apply_dev_xcconfig
update_dev_xcconfig('open_sea_api_key', XCCONFIG_DEV_OPEN_SEA_API_KEY)
update_dev_xcconfig('trongrid_api_key', XCCONFIG_DEV_TRONGRID_API_KEY)
update_dev_xcconfig('unstoppable_domains_api_key', XCCONFIG_DEV_UNSTOPPABLE_DOMAINS_API_KEY)
update_dev_xcconfig('one_inch_api_key', XCCONFIG_DEV_ONE_INCH_API_KEY)
end

def apply_prod_xcconfig
Expand All @@ -143,6 +146,7 @@ def apply_prod_xcconfig
update_prod_xcconfig('open_sea_api_key', XCCONFIG_PROD_OPEN_SEA_API_KEY)
update_prod_xcconfig('trongrid_api_key', XCCONFIG_PROD_TRONGRID_API_KEY)
update_prod_xcconfig('unstoppable_domains_api_key', XCCONFIG_PROD_UNSTOPPABLE_DOMAINS_API_KEY)
update_prod_xcconfig('one_inch_api_key', XCCONFIG_PROD_ONE_INCH_API_KEY)
end

def force_update_devices(type, username)
Expand Down

0 comments on commit 8062947

Please sign in to comment.