-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APP] support custom chain dapp (#332)
- Loading branch information
1 parent
e47debe
commit c1f6d0f
Showing
7 changed files
with
81 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// SupportConfig.swift | ||
// Cosmostation | ||
// | ||
// Created by 권혁준 on 2023/07/04. | ||
// Copyright © 2023 wannabit. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct SupportConfig { | ||
var supportChainNames: Array<String>? | ||
var supportChainIds: Array<String>? | ||
var customChains = Array<CustomChain>() | ||
|
||
init(_ dictionary: NSDictionary?) { | ||
if let rawSupportChainNames = dictionary?["supportChainNames"] as? Array<String> { | ||
self.supportChainNames = rawSupportChainNames | ||
} | ||
if let rawSupportChainIds = dictionary?["supportChainIds"] as? Array<String> { | ||
self.supportChainIds = rawSupportChainIds | ||
} | ||
if let rawCustomChains = dictionary?["customChains"] as? Array<NSDictionary> { | ||
rawCustomChains.forEach { rawCustomChain in | ||
self.customChains.append(CustomChain.init(rawCustomChain)) | ||
} | ||
} | ||
} | ||
} | ||
|
||
public struct CustomChain { | ||
var chainId: String? | ||
var denom: String? | ||
var prefix: String? | ||
|
||
init(_ dictionary: NSDictionary?) { | ||
self.chainId = dictionary?["chainId"] as? String | ||
self.denom = dictionary?["denom"] as? String | ||
self.prefix = dictionary?["prefix"] as? String | ||
} | ||
} |