Skip to content

Commit

Permalink
[APP-813] support celestia (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwonhyukjoon authored Oct 31, 2023
1 parent 1a5fab7 commit aa62374
Show file tree
Hide file tree
Showing 18 changed files with 217 additions and 17 deletions.
6 changes: 6 additions & 0 deletions Cosmostation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2713,6 +2713,8 @@
15722B252AEAC3E700A49D3E /* ChainMintStation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15722B232AEAC3E700A49D3E /* ChainMintStation.swift */; };
15722B272AEBB38100A49D3E /* ChainDydx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15722B262AEBB38100A49D3E /* ChainDydx.swift */; };
15722B282AEBB38100A49D3E /* ChainDydx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15722B262AEBB38100A49D3E /* ChainDydx.swift */; };
15722B2A2AF0CC8900A49D3E /* ChainCelestia.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15722B292AF0CC8900A49D3E /* ChainCelestia.swift */; };
15722B2B2AF0CC8900A49D3E /* ChainCelestia.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15722B292AF0CC8900A49D3E /* ChainCelestia.swift */; };
1575C2C629E6595D009BEE39 /* ChainStafi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1575C2C529E6595D009BEE39 /* ChainStafi.swift */; };
1575C2C729E6595D009BEE39 /* ChainStafi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1575C2C529E6595D009BEE39 /* ChainStafi.swift */; };
1575C2D029EFD95A009BEE39 /* WalletNobleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1575C2CE29EFD95A009BEE39 /* WalletNobleCell.swift */; };
Expand Down Expand Up @@ -5249,6 +5251,7 @@
156CDB8329E52B6A00D55BD2 /* WalletNeutronCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WalletNeutronCell.xib; sourceTree = "<group>"; };
15722B232AEAC3E700A49D3E /* ChainMintStation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChainMintStation.swift; sourceTree = "<group>"; };
15722B262AEBB38100A49D3E /* ChainDydx.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChainDydx.swift; sourceTree = "<group>"; };
15722B292AF0CC8900A49D3E /* ChainCelestia.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChainCelestia.swift; sourceTree = "<group>"; };
1575C2C529E6595D009BEE39 /* ChainStafi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChainStafi.swift; sourceTree = "<group>"; };
1575C2CE29EFD95A009BEE39 /* WalletNobleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletNobleCell.swift; sourceTree = "<group>"; };
1575C2CF29EFD95A009BEE39 /* WalletNobleCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WalletNobleCell.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -5935,6 +5938,7 @@
0451FC90282A3B1C00214FDA /* ChainBitcana.swift */,
0451FC9C282A3B5B00214FDA /* ChainBitsong.swift */,
15E4258629962E8E00FBA119 /* ChainCanto.swift */,
15722B292AF0CC8900A49D3E /* ChainCelestia.swift */,
0451FCBA282A3C2B00214FDA /* ChainCerberus.swift */,
0451FC5B282A39C100214FDA /* ChainCertik.swift */,
0451FCA8282A3B9100214FDA /* ChainChihuahua.swift */,
Expand Down Expand Up @@ -10763,6 +10767,7 @@
04F794DE2A458DF90093B79B /* stride_claim_claim.pb.swift in Sources */,
18FFB608281AF533004E65BB /* ManageChainCell.swift in Sources */,
18FFB609281AF533004E65BB /* VoteListViewController.swift in Sources */,
15722B2B2AF0CC8900A49D3E /* ChainCelestia.swift in Sources */,
18FFB60A281AF533004E65BB /* WalletBnbCell.swift in Sources */,
04F7960F2A458EFA0093B79B /* osmosis_gamm_v1beta1_tx.grpc.swift in Sources */,
04F795F72A458EFA0093B79B /* osmosis_gamm_pool-models_balancer_tx_tx.grpc.swift in Sources */,
Expand Down Expand Up @@ -12315,6 +12320,7 @@
047847CB2962C94800FD6A7E /* Cw20IcnsByAddressRes.swift in Sources */,
048161E62A41F2640006A906 /* irismod_record_tx.grpc.swift in Sources */,
04F797D92A4593050093B79B /* kava_savings_v1beta1_query.pb.swift in Sources */,
15722B2A2AF0CC8900A49D3E /* ChainCelestia.swift in Sources */,
048162792A41F32F0006A906 /* cryptoorg_nft_transfer_v1_packet.pb.swift in Sources */,
E1CF42F023598AFE00907F45 /* ManageChainCell.swift in Sources */,
E1945E4C222E81C200A1436F /* VoteListViewController.swift in Sources */,
Expand Down
2 changes: 2 additions & 0 deletions Cosmostation/Base/BaseConstant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ public enum ChainType: String {
case SEI_MAIN
case TERRA_MAIN
case DYDX_MAIN
case CELESTIA_MAIN

case COSMOS_TEST
case IRIS_TEST
Expand All @@ -368,6 +369,7 @@ public enum ChainType: String {
result.append(BITCANA_MAIN)
result.append(BITSONG_MAIN)
result.append(CANTO_MAIN)
result.append(CELESTIA_MAIN)
result.append(CHIHUAHUA_MAIN)
result.append(COMDEX_MAIN)
result.append(COREUM_MAIN)
Expand Down
5 changes: 5 additions & 0 deletions Cosmostation/Base/Chains/BaseChain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ class ChainFactory {
return .BITSONG_MAIN
case CHAIN_CANTO_S:
return .CANTO_MAIN
case CHAIN_CELESTIA_S:
return .CELESTIA_MAIN
case CHAIN_CERBERUS_S:
return .CERBERUS_MAIN
case CHAIN_CERTIK_S:
Expand Down Expand Up @@ -243,6 +245,8 @@ class ChainFactory {
return ChainBitsong(chainType)
case .CANTO_MAIN:
return ChainCanto(chainType)
case .CELESTIA_MAIN:
return ChainCelestia(chainType)
case .CERBERUS_MAIN:
return ChainCerberus(chainType)
case .CERTIK_MAIN:
Expand Down Expand Up @@ -454,6 +458,7 @@ let CHAIN_NEUTRON_S = "SUPPORT_CHAIN_NEUTRON"
let CHAIN_SEI_S = "SUPPORT_CHAIN_SEI"
let CHAIN_TERRA_S = "SUPPORT_CHAIN_TERRA"
let CHAIN_DYDX_S = "SUPPORT_CHAIN_DYDX"
let CHAIN_CELESTIA_S = "SUPPORT_CHAIN_CELESTIA"

let CHAIN_MINTSTATION_TEST_S = "SUPPORT_CHAIN_MINTSTATION_TEST"
let CHAIN_NEUTRON_TEST_S = "SUPPORT_CHAIN_NEUTRON_TEST"
Expand Down
74 changes: 74 additions & 0 deletions Cosmostation/Base/Chains/ChainCelestia.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//
// ChainCelestia.swift
// Cosmostation
//
// Created by 권혁준 on 10/31/23.
// Copyright © 2023 wannabit. All rights reserved.
//

import UIKit
import Foundation

class ChainCelestia: ChainConfig {
var isGrpc = true
var chainType = ChainType.CELESTIA_MAIN
var chainImg = UIImage(named: "chainCelestia")
var chainInfoImg = UIImage(named: "infoCelestia")
var chainInfoTitle = "CELESTIA"
var chainInfoMsg = NSLocalizedString("guide_msg_celestia", comment: "")
var chainColor = UIColor(named: "celestia")!
var chainColorBG = UIColor(named: "celestia_bg")!
var chainTitle = "(Celestia Mainnet)"
var chainTitle2 = "CELESTIA"
var chainDBName = CHAIN_CELESTIA_S
var chainAPIName = "celestia"
var chainKoreanName = "셀레스티아"
var chainIdPrefix = "celestia"

var stakeDenomImg = UIImage(named: "tokenCelestia")
var stakeDenom = "utia"
var stakeSymbol = "TIA"
var stakeSendImg = UIImage(named: "sendImg")!
var stakeSendBg = UIColor(named: "celestia")!
var divideDecimal: Int16 = 6
var displayDecimal: Int16 = 6

var addressPrefix = "celestia"
var validatorPrefix = "celestiavaloper"
var defaultPath = "m/44'/118'/0'/0/X"

var etherAddressSupport = false
var wasmSupport = false
var evmSupport = false
var wcSupoort = false
var authzSupoort = false
var moonPaySupoort = false
var kadoMoneySupoort = false
var grpcUrl = "grpc-celestia.cosmostation.io"
var grpcPort = 443
var rpcUrl = ""
var lcdUrl = ""
var explorerUrl = MintscanUrl + "celestia/"
var priceUrl = ""

required init(_ chainType: ChainType) {
self.chainType = chainType
}

func supportHdPaths() -> Array<String> {
return [defaultPath]
}

func getHdPath(_ type: Int, _ path: Int) -> String {
supportHdPaths()[type].replacingOccurrences(of: "X", with: String(path))
}

func getInfoLink1() -> String {
return "https://celestia.org/"
}

func getInfoLink2() -> String {
return "https://blog.celestia.org/"
}
}

12 changes: 12 additions & 0 deletions Cosmostation/Chain.xcassets/chainCelestia.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "chain.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
22 changes: 22 additions & 0 deletions Cosmostation/Chain.xcassets/infoCelestia.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "infoicon_light.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "infoicon_dark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions Cosmostation/Chain.xcassets/tokenCelestia.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "token.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
23 changes: 23 additions & 0 deletions Cosmostation/Color.xcassets/celestia.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.973",
"green" : "0.329",
"red" : "0.835"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"localizable" : true
}
}
41 changes: 41 additions & 0 deletions Cosmostation/Color.xcassets/celestia_bg.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "0.953",
"red" : "0.988"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.235",
"green" : "0.078",
"red" : "0.200"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"localizable" : true
}
}
12 changes: 6 additions & 6 deletions Cosmostation/Controller/GenTx/GenTx.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
Expand All @@ -19,7 +19,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="psJ-FU-Ucy">
<rect key="frame" x="0.0" y="44" width="414" height="50"/>
<rect key="frame" x="0.0" y="48" width="414" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="My Wallet" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="11r-5X-rUr">
<rect key="frame" x="40" y="14.5" width="334" height="21"/>
Expand All @@ -38,7 +38,7 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="77D-pi-oaJ">
<rect key="frame" x="0.0" y="94" width="414" height="60"/>
<rect key="frame" x="0.0" y="98" width="414" height="60"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="txStep4_1" translatesAutoresizingMaskIntoConstraints="NO" id="3xJ-ty-n1M">
<rect key="frame" x="155.5" y="8" width="103" height="18"/>
Expand All @@ -60,7 +60,7 @@
</constraints>
</view>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U89-Uh-Wth">
<rect key="frame" x="0.0" y="154" width="414" height="708"/>
<rect key="frame" x="0.0" y="158" width="414" height="704"/>
<connections>
<segue destination="CA2-JA-IdK" kind="embed" identifier="containerTxPage" id="TSE-ZX-GLd"/>
</connections>
Expand Down Expand Up @@ -98,7 +98,7 @@
<objects>
<viewController id="CA2-JA-IdK" customClass="StepGenTxViewController" customModule="Cosmostation" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="thp-Av-1b2">
<rect key="frame" x="0.0" y="0.0" width="414" height="708"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="704"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="In6-Rk-Hij"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
Expand Down
Loading

0 comments on commit aa62374

Please sign in to comment.