Skip to content

Commit

Permalink
1.3.2 : Crowns and fixes (#100)
Browse files Browse the repository at this point in the history
* .

* .

* .

Co-authored-by: Varun Kohli <kohli.varun5@gmail.com>
  • Loading branch information
kohlivarun5 and Varun Kohli authored Aug 1, 2021
1 parent 2fcb55d commit bf9bd0c
Show file tree
Hide file tree
Showing 17 changed files with 141 additions and 15 deletions.
4 changes: 2 additions & 2 deletions NFTY.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.3.1;
MARKETING_VERSION = 1.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.nftygo.NFTY;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1045,7 +1045,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.3.1;
MARKETING_VERSION = 1.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.nftygo.NFTY;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<key>DownloadCollection.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>1</integer>
</dict>
<key>DownloadCryptoPunks.xcscheme_^#shared#^_</key>
<dict>
Expand Down Expand Up @@ -64,7 +64,7 @@
<key>NFTY.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>2</integer>
</dict>
<key>ParseTokenDistances.xcscheme_^#shared#^_</key>
<dict>
Expand Down
21 changes: 21 additions & 0 deletions NFTY/Assets.xcassets/SAMPLE_CROWN1.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "SAMPLE_CROWN1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions NFTY/Assets.xcassets/SAMPLE_CROWN2.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "SAMPLE_CROWN2.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions NFTY/Assets.xcassets/SAMPLE_CROWN3.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "SAMPLE_CROWN3.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions NFTY/Assets.xcassets/SAMPLE_CROWN4.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "SAMPLE_CROWN4.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion NFTY/Model/CollectionContracts/BAYC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BAYC_Contract : ContractInterface {

private var pricesCache : [UInt : ObservablePromise<NFTPriceStatus>] = [:]

let name = "BoredApeYachtClub"
let name = "BAYC"

let contractAddressHex = "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"

Expand Down
6 changes: 3 additions & 3 deletions NFTY/Model/Erc721Contract.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class Erc721Contract {
let res = try! web3.eth.abi.decodeLog(event:self.Transfer,from:log)
let from = res["from"] as! EthereumAddress

var type : TradeEventType = .bought
var type : TradeEventType? = nil

if (from == EthereumAddress(hexString: "0x0000000000000000000000000000000000000000")) {
reachedMint = true
Expand All @@ -172,9 +172,9 @@ class Erc721Contract {
.map(on:DispatchQueue.global(qos:.userInitiated)) { (txData:TxFetcher.TxInfo?) in
switch(txData) {
case .none:
return TradeEvent(type:.transfer,value:BigUInt(0),blockNumber:log.blockNumber!)
return TradeEvent(type:type ?? .transfer,value:BigUInt(0),blockNumber:log.blockNumber!)
case .some(let tx):
return TradeEvent(type:type,value:tx.value,blockNumber:tx.blockNumber)
return TradeEvent(type:type ?? .bought,value:tx.value,blockNumber:tx.blockNumber)
}
}.done { response($0) }
.catch { print($0) }
Expand Down
7 changes: 7 additions & 0 deletions NFTY/Model/NFT.swift
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,13 @@ let SAMPLE_CRHDL : [String] = [
"SampleHodler4"
]

let SAMPLE_CROWNS : [String] = [
"SAMPLE_CROWN1",
"SAMPLE_CROWN2",
"SAMPLE_CROWN3",
"SAMPLE_CROWN4"
]

let CryptoPunks_nearestTokens : [[UInt]] = load("CryptoPunks_nearestTokens.json")
let CryptoPunks_rarityRanks : [UInt] = load("CryptoPunks_rarityRanks.json")

Expand Down
4 changes: 2 additions & 2 deletions NFTY/Model/OpenSeaApi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct OpenSeaApi {
}

struct Asset: Codable {
let sell_orders : [SellOrder]
let sell_orders : [SellOrder]?
}

struct AssetOrders: Codable {
Expand All @@ -42,7 +42,7 @@ struct OpenSeaApi {
let assets = try jsonDecoder.decode(AssetOrders.self, from: data!)
// print(assets)

switch(assets.assets[safe:0]?.sell_orders[safe:0]) {
switch(assets.assets[safe:0]?.sell_orders?[safe:0]) {
case .none:
seal.fulfill(BidAsk(bid:nil,ask:nil))
case .some(let order):
Expand Down
27 changes: 26 additions & 1 deletion NFTY/ViewModel/CoreCollections.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ let CRHDL_Contract = IpfsCollectionContract(
name: "CryptoHodlers",
address: "0xe12a2A0Fb3fB5089A498386A734DF7060c1693b8")

let CROWNS_Contract = IpfsCollectionContract(
name: "Crowns",
address: "0x42e8CB3b99658EeB70Af7eD97a3f21d8349b433E")


let CompositeCollection = CompositeRecentTradesObject([
CompositeRecentTradesObject.CollectionInitializer(
info:CollectionInfo(
Expand Down Expand Up @@ -87,7 +92,7 @@ let CompositeCollection = CompositeRecentTradesObject([
url2:SAMPLE_BAYC[1],
url3:SAMPLE_BAYC[2],
url4:SAMPLE_BAYC[3],
name:"BoredApeYachtClub",
name:"BAYC",
webLink: URL(string:"https://boredapeyachtclub.com/#/")!,
themeColor:Color.black,
themeLabelColor:Color.white,
Expand Down Expand Up @@ -140,6 +145,26 @@ let CompositeCollection = CompositeRecentTradesObject([
rarityRanking : RarityRankingImpl(CRHDL_rarityRanks)
),
contract:CRHDL_Contract),
CompositeRecentTradesObject.CollectionInitializer(
info:CollectionInfo(
address:CROWNS_Contract.contractAddressHex,
url1:SAMPLE_CROWNS[0],
url2:SAMPLE_CROWNS[1],
url3:SAMPLE_CROWNS[2],
url4:SAMPLE_CROWNS[3],
name:CROWNS_Contract.name,
webLink: URL(string:"https://fameladysquad.com")!,
themeColor:Color.black,
themeLabelColor:Color.white,
subThemeColor:Color.label,
collectionColor:Color.black,
disableRecentTrades:false,
blur:0,
samplePadding:15,
similarTokens: nil,
rarityRanking: nil
),
contract:CROWNS_Contract),
CompositeRecentTradesObject.CollectionInitializer(
info:CollectionInfo(
address:cryptoKittiesContract.contractAddressHex,
Expand Down
3 changes: 1 addition & 2 deletions NFTY/Views/RoundedImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,9 @@ struct RoundedImage: View {
.padding(.leading,5)
.padding(.trailing,3)
.padding([.top,.bottom],5)
.background(RoundedCorners(color: .secondarySystemBackground, tl: 5, tr: 5, bl: 5, br: 5))
.background(RoundedCorners(color: .secondarySystemBackground, tl: 10, tr: 10, bl: 10, br: 10))
.padding(.bottom,5)
.padding(.trailing,10)
.shadow(radius: 0)
}
.font(.subheadline)
.padding([.top,.bottom],10)
Expand Down
15 changes: 13 additions & 2 deletions NFTY/Views/TradeEventsList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ struct TradeEventsList: View {

VStack {

switch(event.value) {
case 0:
switch(event.value,event.type) {
case (0,.bought):
HStack {
Text("Transfer")
.frame(width:120,alignment: .trailing)
Expand All @@ -114,6 +114,17 @@ struct TradeEventsList: View {
}
.foregroundColor(.secondaryLabel)
.font(.footnote)
case (0,_):
HStack {
Text("")
.frame(width:120,alignment: .trailing)
Spacer()
TradeEventIconView(type:event.type)
Spacer()
BlockTimeLabel(blockNumber: event.blockNumber.quantity)
.frame(width:120,alignment: .trailing)
}
.foregroundColor(event.type == .bought || event.type == .minted ? .label : .secondary)
default:
HStack {
UsdText(wei:event.value,fontWeight: event.type == .bought ? .semibold : nil)
Expand Down

0 comments on commit bf9bd0c

Please sign in to comment.