From ff09959188c180ab8348ea3a370882eb8317663f Mon Sep 17 00:00:00 2001 From: EA Date: Thu, 26 Sep 2024 18:43:50 +0600 Subject: [PATCH] Add Base blockchain support --- .github/workflows/deploy_appstore.yml | 1 + .github/workflows/deploy_dev.yml | 1 + .../project.pbxproj | 8 +++---- .../base_eip20_32.imageset/Contents.json | 22 ++++++++++++++++++ .../Images/base_eip20_32.imageset/base@2x.png | Bin 0 -> 2085 bytes .../Images/base_eip20_32.imageset/base@3x.png | Bin 0 -> 3053 bytes .../Images/base_trx_32.imageset/Contents.json | 22 ++++++++++++++++++ .../Images/base_trx_32.imageset/base@2x.png | Bin 0 -> 689 bytes .../Images/base_trx_32.imageset/base@3x.png | Bin 0 -> 1032 bytes .../Development.template.xcconfig | 1 + .../Production.template.xcconfig | 1 + .../Core/Address/UdnAddressParserItem.swift | 3 ++- .../Core/Factories/AdapterFactory.swift | 4 ++-- .../Core/Factories/AddressParserFactory.swift | 2 +- .../Core/Managers/EvmBlockchainManager.swift | 2 ++ .../Core/Managers/EvmSyncSourceManager.swift | 19 +++++++++++++++ .../Core/Providers/AppConfig.swift | 5 ++++ .../Extensions/BlockchainType.swift | 11 ++++++--- .../UnstoppableWallet/Extensions/Token.swift | 1 + .../UnstoppableWallet/Info.plist | 2 ++ .../Models/AccountType.swift | 2 ++ .../MarketAdvancedSearchViewModel.swift | 1 + .../Providers/OneInchMultiSwapProvider.swift | 2 +- .../PancakeV3MultiSwapProvider.swift | 2 +- .../UniswapV2MultiSwapProvider.swift | 1 + .../UniswapV3MultiSwapProvider.swift | 2 +- .../Modules/Swap/SwapModule.swift | 7 +++--- fastlane/Fastfile | 4 ++++ 28 files changed, 109 insertions(+), 17 deletions(-) create mode 100644 UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_eip20_32.imageset/Contents.json create mode 100644 UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_eip20_32.imageset/base@2x.png create mode 100644 UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_eip20_32.imageset/base@3x.png create mode 100644 UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_trx_32.imageset/Contents.json create mode 100644 UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_trx_32.imageset/base@2x.png create mode 100644 UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_trx_32.imageset/base@3x.png diff --git a/.github/workflows/deploy_appstore.yml b/.github/workflows/deploy_appstore.yml index 5dc87c309c..4e9749bfef 100644 --- a/.github/workflows/deploy_appstore.yml +++ b/.github/workflows/deploy_appstore.yml @@ -55,6 +55,7 @@ jobs: XCCONFIG_PROD_ETHERSCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_ETHERSCAN_API_KEY }} XCCONFIG_PROD_ARBISCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_ARBISCAN_API_KEY }} XCCONFIG_PROD_OPTIMISM_ETHERSCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_OPTIMISM_ETHERSCAN_API_KEY }} + XCCONFIG_PROD_BASESCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_BASESCAN_API_KEY }} XCCONFIG_PROD_BSCSCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_BSCSCAN_API_KEY }} XCCONFIG_PROD_POLYGONSCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_POLYGONSCAN_API_KEY }} XCCONFIG_PROD_SNOWTRACE_API_KEY: ${{ secrets.XCCONFIG_PROD_SNOWTRACE_API_KEY }} diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index 25d892c1a1..3e4a5d5f6e 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -56,6 +56,7 @@ jobs: XCCONFIG_DEV_ETHERSCAN_API_KEY: ${{ secrets.XCCONFIG_DEV_ETHERSCAN_API_KEY }} XCCONFIG_DEV_ARBISCAN_API_KEY: ${{ secrets.XCCONFIG_DEV_ARBISCAN_API_KEY }} XCCONFIG_DEV_OPTIMISM_ETHERSCAN_API_KEY: ${{ secrets.XCCONFIG_DEV_OPTIMISM_ETHERSCAN_API_KEY }} + XCCONFIG_DEV_BASESCAN_API_KEY: ${{ secrets.XCCONFIG_DEV_BASESCAN_API_KEY }} XCCONFIG_DEV_BSCSCAN_API_KEY: ${{ secrets.XCCONFIG_DEV_BSCSCAN_API_KEY }} XCCONFIG_DEV_POLYGONSCAN_API_KEY: ${{ secrets.XCCONFIG_DEV_POLYGONSCAN_API_KEY }} XCCONFIG_DEV_SNOWTRACE_API_KEY: ${{ secrets.XCCONFIG_DEV_SNOWTRACE_API_KEY }} diff --git a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj index 891b1e6b1a..25ad380a1f 100644 --- a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj +++ b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj @@ -12883,7 +12883,7 @@ repositoryURL = "https://github.com/horizontalsystems/EvmKit.Swift"; requirement = { kind = exactVersion; - version = 2.0.20; + version = 2.0.21; }; }; D3604E4828F02A8B0066C366 /* XCRemoteSwiftPackageReference "Eip20Kit" */ = { @@ -12907,7 +12907,7 @@ repositoryURL = "https://github.com/horizontalsystems/UniswapKit.Swift"; requirement = { kind = exactVersion; - version = 3.0.1; + version = 3.0.2; }; }; D3604E5128F02B150066C366 /* XCRemoteSwiftPackageReference "OneInchKit" */ = { @@ -12915,7 +12915,7 @@ repositoryURL = "https://github.com/horizontalsystems/OneInchKit.Swift"; requirement = { kind = exactVersion; - version = 3.0.3; + version = 3.0.4; }; }; D3604E6428F02D9A0066C366 /* XCRemoteSwiftPackageReference "BitcoinKit" */ = { @@ -12947,7 +12947,7 @@ repositoryURL = "https://github.com/horizontalsystems/MarketKit.Swift"; requirement = { kind = exactVersion; - version = 3.0.12; + version = 3.0.13; }; }; D3604E7D28F03C1D0066C366 /* XCRemoteSwiftPackageReference "Chart" */ = { diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_eip20_32.imageset/Contents.json b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_eip20_32.imageset/Contents.json new file mode 100644 index 0000000000..b7d065de93 --- /dev/null +++ b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_eip20_32.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "base@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "base@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_eip20_32.imageset/base@2x.png b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_eip20_32.imageset/base@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..55de8fa089bed03e8fc911baab08ca598a0719e1 GIT binary patch literal 2085 zcmV+=2-^3FP)ruDSLp>Gip+YL)sZAsWdc(8<(?)IzjZJ!JB4`Wt zV8D|-Xhe^s3EN9qytp*+q)Ca0{E?m4?>Dov%(A=e%)FWHD!*j2v-4)(%=f+Teg8*L z$cUa%cV&kTja5%5b7^OQCun+Pu#3cQiu=~0-|56#8gUs z%7?9#OQ=^Ql~B`C%CW?+wbK+Z0%Jg=RW(-Et@a2qdP#{!3I{A5#zitJrh}3UZ3dKx z@N5XRNJ5N?lo-)vgcbvu+gE#tQiCNUJQt=!B*u4-l27a@(527z&E(UU!HGLN+=-)AC1>ubbGyP1{`Q#zQ$tK zMH)ELBI(3O6%>6>(*C!F`2n84RFq&ZAn}hulMgm%Zb6X_SQp452kv&<%-;rGz4eM_<_z)+W?}r%MBU+H*A-=e&dN8`3+g{xMW>Ed zkROcwu|YrG+Mwsl{v^VUBy7uo17}tS*ex9-AAopY|F$M0=6;dj?Qs6`8a;XHb6ZFn zp8u_`uh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YD$*(Qho+KTbsNKKa1 z*sx1tTl!6e=M z@93*DTw8^5g%Ijup&mhVoQfdY_F`0#?4;Ka0w!-_ch~mUxB$D!vn)n|)euVox6RV7 z^3?O=^@qVtdQE_5bwfPhx-bG!5=y-WiqRM;CiYHvsthG=)(>(bv9Bymr1eaF^Ao#0 zz0soc(iA&O&yc9;4B5{l~nIWvV%5SqTKZVpC z1&nZ;`pA+DbfTddOOQBdkcyxyWosH2o0Oce P00000NkvXXu0mjfqeAE0 literal 0 HcmV?d00001 diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_eip20_32.imageset/base@3x.png b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_eip20_32.imageset/base@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..cbeccc9ae2cc9d839c144a44a713b5302553dfbd GIT binary patch literal 3053 zcmVM}#ks!LnVtnZ;h;wm(sIetdvbmG_4|l2Ma!D?^JF_d9KY*gR z9PTdPn|W{M&6^>kgpwZP{oSt>h8ZsoTb40^LtH!Pn`8ve1P#aacoWeXNre> zHVkW(v($3odH1rpB;QLMj1qzrc<=g{MXAG#^HCh42ocI#7D`$+h~FnGmCb$JV^RW$ zRRIusPv82KsNugBFGoo)S;nmSxRnu$0y4kLkMbhFK>CGVizQBc{_)MeCDM#G1-NSa z8H(7vM2IO`#Z2zTYjdOtEeaSMF9@L*FIG9uCHNFwb6`@1{nRoMP zZdjK^jUS_30B3y8u#6cM&N^}hyme}8lCc+8c96LVijvk4nF8QsyL$5I*_@@_j6qj6 z*L!B78rVgm0BLd<{}1h4Ti+}uk27kZy%$H;~g|{B2^Z4P@X*HG=JwM-TSO4|5wbpuWt6XB#V|5 zpj!B01n^~)^YI58=cER%Li6~>aOPb_x1>rqgMD1ij}Y? zx~K<(c2NU$LovuwDSXs?UBWM2uR~r_5mHu=S&+hk6kv~V)1&|$X2<`!9V(Tc?&^~= zYe+){WX7LQk)rSd9BmxJcfhrycJ^f~I*SfVqhfWhuG;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O4lCqY^8$)0pNAoO=1cQGv__%+nxu1yKz>irs*CLYM$eK{YH$qc?iK>7UhnfDU{2g z_TT+mmwbk>obmwXXZ}xJWrvJbffjW19ix2Aopgori?iM3&->lez0Zpk>5)s9x@2uf zS-h9|`F6;okpk->YXAFw3h-^qU;SHdKx$G5P=l%-`x@JC>3}~e3D5}vIKXM1oZc)u zbNCE&S)DHB=?}Lme2;hKyWc%|%lzT;mQ*a>lQAbDeB2WTVwE^ zS4@d;MP%6&JCS-}hCrXEkl4Q~vq-PnA`j6cM5m-#n_qPrih%Y{8MaO&TZZFCHoG*{8{=U^_PpSF#B_dMG#T%g_78idI~Tr7;e_dP8sKyCudtczU3PP|%Rw1mj; zj`%@mH@l!Un07BGON!94f#;4>1Y%wyl-z3HzNt%*Ms|QAOr+)H^F4D>{bF__v?{;> z+vKMho3s)#-HB{vDovhbNi(r1z`@?JeN^1Vq|U9A0fa6dw{+I_8uyV5wv}Oxaz?+1 zdM{JC4vt|BMDc!Mqi-orp}R?p0=!^T)9&uVFt*jS#7l$G0GFGJ@U-0J%e%n{`stjl vVe18hm?_NLs<7uKmf;o(-OEW4xR)ORw~35~@(gzi00000NkvXXu0mjfWaz|B literal 0 HcmV?d00001 diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_trx_32.imageset/Contents.json b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_trx_32.imageset/Contents.json new file mode 100644 index 0000000000..b7d065de93 --- /dev/null +++ b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_trx_32.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "base@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "base@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_trx_32.imageset/base@2x.png b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_trx_32.imageset/base@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..dc19723db5d4998391e7d67e8121d2e6020ccb8f GIT binary patch literal 689 zcmV;i0#5yjP)h(schNF;Kt44?xLF`-LFc1OmaM`S~1HKns1*@mx!!Jq`I(4>cCbFvjS zXG=D50ki=RmTW<`$97q$4g~(Lc-s>{W)9k*L5;`??2ZDpsDTFZg6CiLQ}8_>p--@q zeBbnw5~ySHHQfdQE7@z~85$705yGnY6rhg-**J9bbQ9uCljoh=3UtC_dv{|L6BGb~ zb1ebA@D_U-@&$1UD3<;)L8%a;0DU{K({KuiRUlG;q1CTp6{MtsgU?Z_04u9sBUXVl z02$chUgG3U0g^vg)-Bj1^%X;j0y3~m=5vq)KqMuljC>A~03=`+@8Vs00D`u~>YxIg z;Xm=+BlKC|;)nr&E9chdKxwoGyTzpRIY<=XeV|ZG>2r_-U;}pf^f^cZumihz$1VxL z8tk(6IYPU zw5^WPAxAyr&z)eyU&;VA=kp*@KcaSEa4LpBJ@T%va8LZT>#CG|a zI0m-A^ok1vH#%>zIV-Gc%-JU1b-O&jtE*e)lRqv8XS~Pwa@P+@gF_?|i9{liNK?K6 XZjW#~jkd#R00000NkvXXu0mjf8`2x+ literal 0 HcmV?d00001 diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_trx_32.imageset/base@3x.png b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Images/base_trx_32.imageset/base@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..495e21d5baaf6b631971a4195db79da1dd553590 GIT binary patch literal 1032 zcmV+j1o!)iP)?=zy{C>3KKvlXqlj80@?}gHh@lWVFK9T^*z}E8t$a}&*c*5 z`$<-Wgmj5tUhLS30}v4r5fKp)5z$o4Fkm9Gr<=o24z#p?8`t^wM$2<34_Y2=JDbgx z7_h+wKr7wp=2XiGd}Z$;PaBY1ElUkZ1NxVp=~^zdEM)r@TFyZ)6@R7WN&2@6zwIzJ zJFfVym6j_^g&yo_IOw5SX_=!|;?Md!8NP4gdtbfir5B_JWWAX?yze>=Riov&j~>$p zY?)U6nQj&sPvsk@ZiNB@4L*4BDU?BzX6H0bNt)X(LpMyWvB8pss#E&li zz_b);53&OgE|bHJ?Cjsq$%5Prn9ex* zde$4t%7Ww!;MxBoD+_Wm;2dNu3(k=!Cje)l)(H|N1wj1NoddPzk~q1angKlf-%Faj zNe#dp)RlA@iVi?XH3#ZCOc|t0$$&%9I&Ys_{ckA&n1eRyB>)GYO`_{2B>=rWv@}AW z5Gi^n!e*yIn>0Eku@73$CXQsgo)Bs4PsUA5FWpcohymC!24Ke+fU=?|Wj-QOXz6(` zuwH{mDH)LU7)Iry>n0@t51>u{AW}*I9zmNlh{OyiE4pq{#)2I9ILcZ&4isIV(HRh) zjc-6*OC(6W5BLr0N~)980Q>@VCDlpJqlvsBdu7Yu93w%_P{a+Wb&Etf8DM9B^aMnO zvSz`OGax(-oE-UzWYqy*(8$vub5W11;pp(gQ*H}xbKe;*@sggk1(pR<>k$=s0wQ}t zCbR`#F+D|&x!6(#nhEx*>KxN>qbFXG#XCv{z%D_yPJ~0<8WeaxxW⁡tY4O4x>9} zbr{!@HVtZ7xYdLMu?dSYjGo%q*3qoi?+l24Nn$0#vyz$@?|w`CLf%7ZpzT_3 z`!c=hRXu2@<)`c>Bc@yNUE(vsE=~8ceGBnDGgkaM; String? { switch (token.blockchainType, token.type) { - case (.ethereum, .eip20), (.optimism, .eip20), (.arbitrumOne, .eip20), (.gnosis, .eip20), (.fantom, .eip20): return "ERC20" + case (.ethereum, .eip20), (.optimism, .eip20), (.arbitrumOne, .eip20), (.gnosis, .eip20), (.fantom, .eip20), (.base, .eip20): return "ERC20" case (.binanceSmartChain, .native), (.binanceSmartChain, .eip20): return "BEP20" case (.polygon, .native), (.polygon, .eip20): return "MATIC" case (.avalanche, .native), (.avalanche, .eip20): return "AVAX" diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Factories/AdapterFactory.swift b/UnstoppableWallet/UnstoppableWallet/Core/Factories/AdapterFactory.swift index e062c382b5..55d8318506 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Factories/AdapterFactory.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Factories/AdapterFactory.swift @@ -138,10 +138,10 @@ extension AdapterFactory { return BinanceAdapter(binanceKit: binanceKit, feeToken: feeToken, wallet: wallet) } - case (.native, .ethereum), (.native, .binanceSmartChain), (.native, .polygon), (.native, .avalanche), (.native, .optimism), (.native, .arbitrumOne), (.native, .gnosis), (.native, .fantom): + case (.native, .ethereum), (.native, .binanceSmartChain), (.native, .polygon), (.native, .avalanche), (.native, .optimism), (.native, .arbitrumOne), (.native, .gnosis), (.native, .fantom), (.native, .base): return evmAdapter(wallet: wallet) - case let (.eip20(address), .ethereum), let (.eip20(address), .binanceSmartChain), let (.eip20(address), .polygon), let (.eip20(address), .avalanche), let (.eip20(address), .optimism), let (.eip20(address), .arbitrumOne), let (.eip20(address), .gnosis), let (.eip20(address), .fantom): + case let (.eip20(address), .ethereum), let (.eip20(address), .binanceSmartChain), let (.eip20(address), .polygon), let (.eip20(address), .avalanche), let (.eip20(address), .optimism), let (.eip20(address), .arbitrumOne), let (.eip20(address), .gnosis), let (.eip20(address), .fantom), let (.eip20(address), .base): return eip20Adapter(address: address, wallet: wallet, coinManager: coinManager) case (.native, .tron): diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Factories/AddressParserFactory.swift b/UnstoppableWallet/UnstoppableWallet/Core/Factories/AddressParserFactory.swift index 245a3e4bd0..b794f6b8e0 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Factories/AddressParserFactory.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Factories/AddressParserFactory.swift @@ -75,7 +75,7 @@ enum AddressParserFactory { } return handlers - case .ethereum, .gnosis, .fantom, .polygon, .arbitrumOne, .avalanche, .optimism, .binanceSmartChain: + case .ethereum, .gnosis, .fantom, .polygon, .arbitrumOne, .avalanche, .optimism, .binanceSmartChain, .base: let evmAddressParserItem = EvmAddressParser(blockchainType: blockchainType) var handlers = [IAddressParserItem]() diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Managers/EvmBlockchainManager.swift b/UnstoppableWallet/UnstoppableWallet/Core/Managers/EvmBlockchainManager.swift index 29ccb65376..6c6facd5a5 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Managers/EvmBlockchainManager.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Managers/EvmBlockchainManager.swift @@ -12,6 +12,7 @@ class EvmBlockchainManager { .arbitrumOne, .gnosis, .fantom, + .base, ] private let syncSourceManager: EvmSyncSourceManager @@ -99,6 +100,7 @@ extension EvmBlockchainManager { case .arbitrumOne: return .arbitrumOne case .gnosis: return .gnosis case .fantom: return .fantom + case .base: return .base default: fatalError("Unsupported blockchain type") } } diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Managers/EvmSyncSourceManager.swift b/UnstoppableWallet/UnstoppableWallet/Core/Managers/EvmSyncSourceManager.swift index 151439cd28..8eee80015f 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Managers/EvmSyncSourceManager.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Managers/EvmSyncSourceManager.swift @@ -28,6 +28,7 @@ class EvmSyncSourceManager { case .arbitrumOne: return .arbiscan(apiKey: AppConfig.arbiscanKey) case .gnosis: return .gnosis(apiKey: AppConfig.gnosisscanKey) case .fantom: return .fantom(apiKey: AppConfig.ftmscanKey) + case .base: return .basescan(apiKey: AppConfig.basescanKey) default: fatalError("Non-supported EVM blockchain") } } @@ -184,6 +185,24 @@ extension EvmSyncSourceManager { transactionSource: defaultTransactionSource(blockchainType: blockchainType) ), ] + case .base: + return [ + EvmSyncSource( + name: "Base", + rpcSource: .baseRpcHttp(), + transactionSource: defaultTransactionSource(blockchainType: blockchainType) + ), + EvmSyncSource( + name: "LlamaNodes", + rpcSource: .http(urls: [URL(string: "https://base.llamarpc.com")!], auth: nil), + transactionSource: defaultTransactionSource(blockchainType: blockchainType) + ), + EvmSyncSource( + name: "Omnia", + rpcSource: .http(urls: [URL(string: "https://endpoints.omniatech.io/v1/base/mainnet/public")!], auth: nil), + transactionSource: defaultTransactionSource(blockchainType: blockchainType) + ), + ] default: return [] } diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Providers/AppConfig.swift b/UnstoppableWallet/UnstoppableWallet/Core/Providers/AppConfig.swift index 9f3bfea206..d720942cfd 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Providers/AppConfig.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Providers/AppConfig.swift @@ -32,6 +32,7 @@ enum AppConfig { .polygon: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1", .avalanche: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1", .optimism: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1", + .base: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1", .arbitrumOne: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1", .gnosis: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1", .fantom: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1", @@ -84,6 +85,10 @@ enum AppConfig { (Bundle.main.object(forInfoDictionaryKey: "OptimismEtherscanApiKey") as? String) ?? "" } + static var basescanKey: String { + (Bundle.main.object(forInfoDictionaryKey: "BasescanApiKey") as? String) ?? "" + } + static var bscscanKey: String { (Bundle.main.object(forInfoDictionaryKey: "BscscanApiKey") as? String) ?? "" } diff --git a/UnstoppableWallet/UnstoppableWallet/Extensions/BlockchainType.swift b/UnstoppableWallet/UnstoppableWallet/Extensions/BlockchainType.swift index e5f6f364c8..60147761a5 100644 --- a/UnstoppableWallet/UnstoppableWallet/Extensions/BlockchainType.swift +++ b/UnstoppableWallet/UnstoppableWallet/Extensions/BlockchainType.swift @@ -19,6 +19,7 @@ extension BlockchainType { .arbitrumOne, .gnosis, .fantom, + .base, .binanceSmartChain, .binanceChain, .tron, @@ -53,6 +54,7 @@ extension BlockchainType { .tron, .ton, .polygon, + .base, .avalanche, .zcash, .bitcoinCash, @@ -71,14 +73,14 @@ extension BlockchainType { var resendable: Bool { switch self { - case .optimism, .arbitrumOne: return false + case .optimism, .arbitrumOne, .base: return false default: return true } } var rollupFeeContractAddress: EvmKit.Address? { switch self { - case .optimism: return try? EvmKit.Address(hex: "0x420000000000000000000000000000000000000F") + case .optimism, .base: return try? EvmKit.Address(hex: "0x420000000000000000000000000000000000000F") default: return nil } } @@ -114,7 +116,7 @@ extension BlockchainType { } case .evmPrivateKey, .evmAddress: switch self { - case .ethereum, .binanceSmartChain, .polygon, .avalanche, .optimism, .arbitrumOne, .gnosis, .fantom: return true + case .ethereum, .binanceSmartChain, .polygon, .avalanche, .optimism, .arbitrumOne, .gnosis, .fantom, .base: return true default: return false } case .tronAddress: @@ -143,6 +145,7 @@ extension BlockchainType { case .gnosis: return "xDAI, ERC20 tokens" case .fantom: return "FTM, ERC20 tokens" case .optimism: return "L2 chain" + case .base: return "L2 chain" case .arbitrumOne: return "L2 chain" case .zcash: return "ZEC" case .dash: return "DASH" @@ -163,6 +166,7 @@ extension BlockchainType { case .polygon: return UIColor(hex: 0x8247E5) case .avalanche: return UIColor(hex: 0xD74F49) case .optimism: return UIColor(hex: 0xEB3431) + case .base: return UIColor(hex: 0x2759F6) case .arbitrumOne: return UIColor(hex: 0x96BEDC) default: return nil } @@ -175,6 +179,7 @@ extension BlockchainType { case .polygon: return Color(hex: 0x8247E5) case .avalanche: return Color(hex: 0xD74F49) case .optimism: return Color(hex: 0xEB3431) + case .base: return Color(hex: 0x2759F6) case .arbitrumOne: return Color(hex: 0x96BEDC) default: return nil } diff --git a/UnstoppableWallet/UnstoppableWallet/Extensions/Token.swift b/UnstoppableWallet/UnstoppableWallet/Extensions/Token.swift index 6ba2f8f1fc..14490a1914 100644 --- a/UnstoppableWallet/UnstoppableWallet/Extensions/Token.swift +++ b/UnstoppableWallet/UnstoppableWallet/Extensions/Token.swift @@ -45,6 +45,7 @@ extension Token { case .arbitrumOne: return true case .gnosis: return true case .fantom: return true + case .base: return true default: return false } } diff --git a/UnstoppableWallet/UnstoppableWallet/Info.plist b/UnstoppableWallet/UnstoppableWallet/Info.plist index 7cae265932..ca94240753 100644 --- a/UnstoppableWallet/UnstoppableWallet/Info.plist +++ b/UnstoppableWallet/UnstoppableWallet/Info.plist @@ -4,6 +4,8 @@ ArbiscanApiKey ${arbiscan_api_key} + BasescanApiKey + ${basescan_api_key} BscscanApiKey ${bscscan_api_key} CFBundleDevelopmentRegion diff --git a/UnstoppableWallet/UnstoppableWallet/Models/AccountType.swift b/UnstoppableWallet/UnstoppableWallet/Models/AccountType.swift index 4ef4a220c8..d8bff21190 100644 --- a/UnstoppableWallet/UnstoppableWallet/Models/AccountType.swift +++ b/UnstoppableWallet/UnstoppableWallet/Models/AccountType.swift @@ -82,6 +82,7 @@ enum AccountType { case (.fantom, .native), (.fantom, .eip20): return true case (.arbitrumOne, .native), (.arbitrumOne, .eip20): return true case (.optimism, .native), (.optimism, .eip20): return true + case (.base, .native), (.base, .eip20): return true case (.tron, .native), (.tron, .eip20): return true case (.ton, .native), (.ton, .jetton): return true default: return false @@ -113,6 +114,7 @@ enum AccountType { case (.fantom, .native), (.fantom, .eip20): return true case (.arbitrumOne, .native), (.arbitrumOne, .eip20): return true case (.optimism, .native), (.optimism, .eip20): return true + case (.base, .native), (.base, .eip20): return true default: return false } case .tronAddress: diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Market/AdvancedSearch/MarketAdvancedSearchViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Market/AdvancedSearch/MarketAdvancedSearchViewModel.swift index 826810565a..a116c863c7 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Market/AdvancedSearch/MarketAdvancedSearchViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Market/AdvancedSearch/MarketAdvancedSearchViewModel.swift @@ -18,6 +18,7 @@ class MarketAdvancedSearchViewModel: ObservableObject { .unsupported(uid: "moonriver"), .unsupported(uid: "okex-chain"), .optimism, + .base, .polygon, .unsupported(uid: "solana"), .unsupported(uid: "sora"), diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/OneInchMultiSwapProvider.swift b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/OneInchMultiSwapProvider.swift index 487b5596bd..0301c80d08 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/OneInchMultiSwapProvider.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/OneInchMultiSwapProvider.swift @@ -37,7 +37,7 @@ class OneInchMultiSwapProvider: BaseEvmMultiSwapProvider { } switch tokenIn.blockchainType { - case .ethereum, .binanceSmartChain, .polygon, .avalanche, .optimism, .arbitrumOne, .gnosis, .fantom: return true + case .ethereum, .binanceSmartChain, .polygon, .avalanche, .optimism, .arbitrumOne, .gnosis, .fantom, .base: return true default: return false } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/PancakeV3MultiSwapProvider.swift b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/PancakeV3MultiSwapProvider.swift index 7528e4abf1..63e8c6e56a 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/PancakeV3MultiSwapProvider.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/PancakeV3MultiSwapProvider.swift @@ -19,7 +19,7 @@ class PancakeV3MultiSwapProvider: BaseUniswapV3MultiSwapProvider { } switch tokenIn.blockchainType { - case .ethereum, .binanceSmartChain: return true + case .ethereum, .binanceSmartChain, .base: return true default: return false } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/UniswapV2MultiSwapProvider.swift b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/UniswapV2MultiSwapProvider.swift index bf908a8552..a1a23e7516 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/UniswapV2MultiSwapProvider.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/UniswapV2MultiSwapProvider.swift @@ -16,6 +16,7 @@ class UniswapV2MultiSwapProvider: BaseUniswapV2MultiSwapProvider { override func supports(tokenIn: MarketKit.Token, tokenOut: MarketKit.Token) -> Bool { switch (tokenIn.blockchainType, tokenOut.blockchainType) { case (.ethereum, .ethereum): return true + case (.base, .base): return true default: return false } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/UniswapV3MultiSwapProvider.swift b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/UniswapV3MultiSwapProvider.swift index c703cf7d14..9715b9c55e 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/UniswapV3MultiSwapProvider.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/Providers/UniswapV3MultiSwapProvider.swift @@ -19,7 +19,7 @@ class UniswapV3MultiSwapProvider: BaseUniswapV3MultiSwapProvider { } switch tokenIn.blockchainType { - case .ethereum, .binanceSmartChain, .polygon, .arbitrumOne: return true + case .ethereum, .binanceSmartChain, .polygon, .arbitrumOne, .base: return true default: return false } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Swap/SwapModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Swap/SwapModule.swift index e7ed3906a0..6c0885c3a6 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Swap/SwapModule.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Swap/SwapModule.swift @@ -155,6 +155,7 @@ extension BlockchainType { case .arbitrumOne: return [.oneInch, .uniswapV3] case .gnosis: return [.oneInch] case .fantom: return [.oneInch] + case .base: return [.oneInch, .uniswap, .uniswapV3] default: return [] } } @@ -182,9 +183,9 @@ extension SwapModule.Dex { var allowedBlockchainTypes: [BlockchainType] { switch self { - case .uniswap: return [.ethereum] - case .uniswapV3: return [.ethereum, .binanceSmartChain, .arbitrumOne, .polygon] - case .oneInch: return [.ethereum, .binanceSmartChain, .polygon, .avalanche, .optimism, .arbitrumOne, .gnosis, .fantom] + case .uniswap: return [.ethereum, .base] + case .uniswapV3: return [.ethereum, .binanceSmartChain, .arbitrumOne, .polygon, .base] + case .oneInch: return [.ethereum, .binanceSmartChain, .polygon, .avalanche, .optimism, .arbitrumOne, .gnosis, .fantom, .base] case .pancake: return [.binanceSmartChain] case .pancakeV3: return [.ethereum, .binanceSmartChain] case .quickSwap: return [.polygon] diff --git a/fastlane/Fastfile b/fastlane/Fastfile index abf8c1a596..ea12386b25 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -12,6 +12,7 @@ APP_CENTER_API_TOKEN = ENV["APP_CENTER_API_TOKEN"] XCCONFIG_DEV_ETHERSCAN_API_KEY = ENV["XCCONFIG_DEV_ETHERSCAN_API_KEY"] XCCONFIG_DEV_ARBISCAN_API_KEY = ENV["XCCONFIG_DEV_ARBISCAN_API_KEY"] XCCONFIG_DEV_OPTIMISM_ETHERSCAN_API_KEY = ENV["XCCONFIG_DEV_OPTIMISM_ETHERSCAN_API_KEY"] +XCCONFIG_DEV_BASESCAN_API_KEY = ENV["XCCONFIG_DEV_BASESCAN_API_KEY"] XCCONFIG_DEV_BSCSCAN_API_KEY = ENV["XCCONFIG_DEV_BSCSCAN_API_KEY"] XCCONFIG_DEV_POLYGONSCAN_API_KEY = ENV["XCCONFIG_DEV_POLYGONSCAN_API_KEY"] XCCONFIG_DEV_SNOWTRACE_API_KEY = ENV["XCCONFIG_DEV_SNOWTRACE_API_KEY"] @@ -32,6 +33,7 @@ XCCONFIG_DEV_REFERRAL_APP_SERVER_URL = ENV["XCCONFIG_DEV_REFERRAL_APP_SERVER_URL XCCONFIG_PROD_ETHERSCAN_API_KEY = ENV["XCCONFIG_PROD_ETHERSCAN_API_KEY"] XCCONFIG_PROD_ARBISCAN_API_KEY = ENV["XCCONFIG_PROD_ARBISCAN_API_KEY"] XCCONFIG_PROD_OPTIMISM_ETHERSCAN_API_KEY = ENV["XCCONFIG_PROD_OPTIMISM_ETHERSCAN_API_KEY"] +XCCONFIG_PROD_BASESCAN_API_KEY = ENV["XCCONFIG_PROD_BASESCAN_API_KEY"] XCCONFIG_PROD_BSCSCAN_API_KEY = ENV["XCCONFIG_PROD_BSCSCAN_API_KEY"] XCCONFIG_PROD_POLYGONSCAN_API_KEY = ENV["XCCONFIG_PROD_POLYGONSCAN_API_KEY"] XCCONFIG_PROD_SNOWTRACE_API_KEY = ENV["XCCONFIG_PROD_SNOWTRACE_API_KEY"] @@ -113,6 +115,7 @@ end def apply_dev_xcconfig update_dev_xcconfig('etherscan_api_key', XCCONFIG_DEV_ETHERSCAN_API_KEY) update_dev_xcconfig('optimism_etherscan_api_key', XCCONFIG_DEV_OPTIMISM_ETHERSCAN_API_KEY) + update_dev_xcconfig('basescan_api_key', XCCONFIG_DEV_BASESCAN_API_KEY) update_dev_xcconfig('arbiscan_api_key', XCCONFIG_DEV_ARBISCAN_API_KEY) update_dev_xcconfig('bscscan_api_key', XCCONFIG_DEV_BSCSCAN_API_KEY) update_dev_xcconfig('polygonscan_api_key', XCCONFIG_DEV_POLYGONSCAN_API_KEY) @@ -138,6 +141,7 @@ def apply_prod_xcconfig(swap_enabled, donate_enabled) update_prod_xcconfig('etherscan_api_key', XCCONFIG_PROD_ETHERSCAN_API_KEY) update_prod_xcconfig('arbiscan_api_key', XCCONFIG_PROD_ARBISCAN_API_KEY) update_prod_xcconfig('optimism_etherscan_api_key', XCCONFIG_PROD_OPTIMISM_ETHERSCAN_API_KEY) + update_prod_xcconfig('basescan_api_key', XCCONFIG_PROD_BASESCAN_API_KEY) update_prod_xcconfig('bscscan_api_key', XCCONFIG_PROD_BSCSCAN_API_KEY) update_prod_xcconfig('polygonscan_api_key', XCCONFIG_PROD_POLYGONSCAN_API_KEY) update_prod_xcconfig('snowtrace_api_key', XCCONFIG_PROD_SNOWTRACE_API_KEY)