-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add api top asset, getWalletAssetsPositions (#34)
* add more rust funcs * refactor code * add fn `change_wallet_name` * Update code * Update config * Add api top asset * Add api top assets * Update code * Add wallet position * Add wallet position * Update logic * Update code * Update edit nickname * Refactor --------- Co-authored-by: tony <[email protected]>
- Loading branch information
1 parent
2b04d9d
commit 671b097
Showing
82 changed files
with
1,862 additions
and
426 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import SwiftUI | ||
import Combine | ||
import MinWalletAPI | ||
|
||
|
||
extension AppSetting { | ||
func getAdaPrice() { | ||
Task { | ||
repeat { | ||
let data = try? await MinWalletService.shared.fetch(query: AdaPriceQuery(currency: .case(.usd))) | ||
currencyInADA = data?.adaPrice.value ?? 0 | ||
try? await Task.sleep(for: .seconds(5 * 60)) | ||
} while (!Task.isCancelled) | ||
} | ||
} | ||
} |
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,6 @@ | ||
query AdaPriceQuery($currency: SupportedCurrency!) { | ||
adaPrice(currency: $currency) { | ||
value | ||
currency | ||
} | ||
} |
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,7 @@ | ||
query PortfolioOverviewQuery($address: String!) { | ||
portfolioOverview(address: $address) { | ||
netAdaValue | ||
pnl24H | ||
adaValue | ||
} | ||
} |
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,5 +1,19 @@ | ||
query TopAssetQuery { | ||
topAssets { | ||
query TopAssetQuery($input: TopAssetsInput) { | ||
topAssets(input: $input) { | ||
searchAfter | ||
topAssets { | ||
price | ||
asset { | ||
currencySymbol | ||
metadata { | ||
isVerified | ||
decimals | ||
ticker | ||
name | ||
} | ||
tokenName | ||
} | ||
priceChange24h | ||
} | ||
} | ||
} |
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,38 @@ | ||
query WalletAssetsQuery($address: String!) { | ||
getWalletAssetsPositions(address: $address) { | ||
lpTokens { | ||
pnl24H | ||
amountLPAsset { | ||
asset { | ||
currencySymbol | ||
tokenName | ||
metadata { | ||
isVerified | ||
name | ||
ticker | ||
decimals | ||
} | ||
} | ||
amount | ||
} | ||
lpAdaValue | ||
} | ||
assets { | ||
amountAsset { | ||
asset { | ||
currencySymbol | ||
metadata { | ||
isVerified | ||
name | ||
ticker | ||
decimals | ||
} | ||
tokenName | ||
} | ||
amount | ||
} | ||
pnl24H | ||
valueInAda | ||
} | ||
} | ||
} |
Oops, something went wrong.