-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #408 from nova-wallet/develop
v3.8
- Loading branch information
Showing
151 changed files
with
7,378 additions
and
400 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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 |
---|---|---|
|
@@ -8,8 +8,5 @@ | |
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"preserves-vector-representation" : true | ||
} | ||
} |
Binary file modified
BIN
+47 Bytes
(100%)
novawallet/Assets.xcassets/iconBondMore.imageset/iconBondMore.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/iconControllerAccount.imageset/Contents.json
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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "iconControllerAccount.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+5.45 KB
novawallet/Assets.xcassets/iconControllerAccount.imageset/iconControllerAccount.pdf
Binary file not shown.
Binary file modified
BIN
+112 Bytes
(100%)
novawallet/Assets.xcassets/iconPendingRewards.imageset/iconPendingRewards.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
...cassets/iconWallet.imageset/Contents.json → ...ts/iconRewardsDest.imageset/Contents.json
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "iconWallet.pdf", | ||
"filename" : "iconRewardsDest.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
|
Binary file added
BIN
+2.93 KB
novawallet/Assets.xcassets/iconRewardsDest.imageset/iconRewardsDest.pdf
Binary file not shown.
Binary file modified
BIN
+47 Bytes
(100%)
novawallet/Assets.xcassets/iconUnbond.imageset/iconUnbond.pdf
Binary file not shown.
Binary file modified
BIN
+47 Bytes
(100%)
novawallet/Assets.xcassets/iconValidators.imageset/iconValidators.pdf
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
...assets/iconAccount.imageset/Contents.json → ...ets/iconYieldBoost.imageset/Contents.json
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "iconAccount.pdf", | ||
"filename" : "iconYieldBoost.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
|
Binary file added
BIN
+1.87 KB
novawallet/Assets.xcassets/iconYieldBoost.imageset/iconYieldBoost.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/imageYieldBoostPowered.imageset/Contents.json
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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "imageYieldBoostPowered.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+16.8 KB
novawallet/Assets.xcassets/imageYieldBoostPowered.imageset/imageYieldBoostPowered.pdf
Binary file not shown.
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
67 changes: 67 additions & 0 deletions
67
novawallet/Common/DataProvider/Triggers/AccountAssetBalanceTrigger.swift
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,67 @@ | ||
import Foundation | ||
import RobinHood | ||
|
||
protocol AccountAssetBalanceChangeStoreProtocol { | ||
var chainAssetId: ChainAssetId { get } | ||
var accountId: AccountId { get } | ||
|
||
func consumeLastBlockHash() -> Data? | ||
} | ||
|
||
final class AccountAssetBalanceTrigger: AccountAssetBalanceChangeStoreProtocol { | ||
weak var delegate: DataProviderTriggerDelegate? | ||
|
||
private(set) var wrappedTrigger: DataProviderTriggerProtocol? | ||
let eventCenter: EventCenterProtocol | ||
let chainAssetId: ChainAssetId | ||
let accountId: AccountId | ||
|
||
private(set) var lastSeenBlockHash: Data? | ||
|
||
init( | ||
chainAssetId: ChainAssetId, | ||
eventCenter: EventCenterProtocol, | ||
wrappedTrigger: DataProviderTriggerProtocol?, | ||
accountId: AccountId | ||
) { | ||
self.chainAssetId = chainAssetId | ||
self.accountId = accountId | ||
self.eventCenter = eventCenter | ||
self.wrappedTrigger = wrappedTrigger | ||
|
||
self.wrappedTrigger?.delegate = self | ||
self.eventCenter.add(observer: self) | ||
} | ||
|
||
func consumeLastBlockHash() -> Data? { | ||
let hash = lastSeenBlockHash | ||
lastSeenBlockHash = nil | ||
return hash | ||
} | ||
} | ||
|
||
extension AccountAssetBalanceTrigger: DataProviderTriggerDelegate { | ||
func didTrigger() { | ||
delegate?.didTrigger() | ||
} | ||
} | ||
|
||
extension AccountAssetBalanceTrigger: DataProviderTriggerProtocol { | ||
func receive(event: DataProviderEvent) { | ||
wrappedTrigger?.receive(event: event) | ||
} | ||
} | ||
|
||
extension AccountAssetBalanceTrigger: EventVisitorProtocol { | ||
func processAssetBalanceChanged(event: AssetBalanceChanged) { | ||
guard | ||
accountId == event.accountId, | ||
chainAssetId == event.chainAssetId else { | ||
return | ||
} | ||
|
||
lastSeenBlockHash = event.block | ||
|
||
delegate?.didTrigger() | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
novawallet/Common/EventCenter/Events/AssetBalanceChanged.swift
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,12 @@ | ||
import Foundation | ||
|
||
struct AssetBalanceChanged: EventProtocol { | ||
let chainAssetId: ChainAssetId | ||
let accountId: AccountId | ||
let changes: Data? | ||
let block: Data? | ||
|
||
func accept(visitor: EventVisitorProtocol) { | ||
visitor.processAssetBalanceChanged(event: self) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
novawallet/Common/Extension/Foundation/Decimal+Conversion.swift
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 |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import Foundation | ||
import BigInt | ||
|
||
extension Decimal { | ||
static func fromSubstratePercent(value: UInt8) -> Decimal? { | ||
let decimalValue = NSDecimalNumber(value: value) | ||
return decimalValue.multiplying(byPowerOf10: -2).decimalValue | ||
} | ||
|
||
init?(_ bigUInt: BigUInt) { | ||
self.init(string: String(bigUInt)) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import Foundation | ||
import SubstrateSdk | ||
|
||
struct BlockWeights: Codable { | ||
struct BlockWeights: Decodable { | ||
@StringCodable var maxBlock: UInt64 | ||
} |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ import Foundation | |
|
||
struct StatemineAssetExtras: Codable { | ||
let assetId: String | ||
let palletName: String? | ||
} |
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
Oops, something went wrong.