-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds transfer status indicator to deposit withdraw (#1023)
* Add ALTER, SHD & SIENNA (Secret SNIP-20 tokens) * Update SIENNA's image * Update ALTER's image * Add Button group token * added SHD, BUTT, & ALTER svgs * added staking derivatives * added ics20 contract to ibc-assets * updated to channel-476 * updated ics20 contract * removed accidental changes * fix comment * stkd-SCRT * cleanup * Update ibc-assets.ts * Adds transfer status indicator to deposit withdraw * Revert some unneeded changes to package.json files * Removes type that was put directly in observable query * Fix content overflow on zh-tw (#1024) * Fix #1011 Non-localized stablecoin type (#1025) * add sample fix for ko + es * use collateral type as key into localization * fix key for install keplr notice * Remove unneeded type definition * uses implied return undefined and spelling * Remove unused store import * Remove default baseUrl, Add in channel status logic * Remove unused import and use deconstructed values directly * Remove log * Update button text for blocked and congested * Switch to CoinGecko IDs--no pool spot prices (#1026) * Fix content overflow on zh-tw (#1028) * Fix content overflow on zh-tw * Fix content overflow on languages with Unicode/full width chars * Add missing entry * correct stargaze cgid, uncomment prices * add ibc-go to chihuahua * add secret network features and change api * minor fix * add secret network tokens * Use `computedFn` * Don't get prices when no input in swap tool * Enable pool calculation * update korean.json (#1037) * Uncomment image * removed duplicated secret network tokens * Update Chihuahua Chain Suggest Fees * Replace FUND token logo with Circular logo Was a square before. * Change crbruc to unstable, unverified (#1040) * Fix pool reward query error response * Changed Marble to unverified (#1045) Unverified because Marble no longer receives incentives. * Fix zh-tw format (#1043) * Fix Docker GitHub Actions (#1044) * Fix commands in README.md * Remove arm64 support * Pin node version to 18.12.1 * Remove duplicate Dockerfile and docker-compose.yml * Make NETA, BOOT unverified * Changed IXO to unverified (#1049) * Changed Marble to unverified Unverified because Marble no longer receives incentives. * Changed IXO to unverified Unverified because IXO no longer receives incentives. * Adds transfer status indicator to deposit withdraw * Revert some unneeded changes to package.json files * Removes type that was put directly in observable query * Remove unneeded type definition * uses implied return undefined and spelling * Remove unused store import * Remove default baseUrl, Add in channel status logic * Remove unused import and use deconstructed values directly * Remove log * Update button text for blocked and congested Co-authored-by: Assaf Morami <assaf.morami@gmail.com> Co-authored-by: DrPresident <jacksonswenson@securesecrets.org> Co-authored-by: PikachuEXE <pikachuexe@gmail.com> Co-authored-by: Sehyun Chung ✌︎ <sehyun@berkeley.edu> Co-authored-by: JeremyParish69 <95667791+JeremyParish69@users.noreply.github.com> Co-authored-by: Jeremy Parish <jeremyparish69@gmail.com> Co-authored-by: jonator <jonathanator0@gmail.com> Co-authored-by: KIM, WOOJUNG <gnujoow@users.noreply.github.com> Co-authored-by: Crypto Assassin <103904125+CryptoAssassin1@users.noreply.github.com> Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com>
- Loading branch information
1 parent
7bc4d88
commit 0e78486
Showing
23 changed files
with
249 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./status-by-id"; | ||
export * from "./types"; |
123 changes: 123 additions & 0 deletions
123
packages/stores/src/queries-external/ibc/status-by-id.ts
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,123 @@ | ||
import { computed, makeObservable } from "mobx"; | ||
import { HasMapStore } from "@keplr-wallet/stores"; | ||
import { ObservableQueryExternalBase } from "../base"; | ||
import { KVStore } from "@keplr-wallet/common"; | ||
import { computedFn } from "mobx-utils"; | ||
import { IbcStatus } from "./types"; | ||
|
||
/** Queries for ibc chain data*/ | ||
class ObservableQueryIbcChainStatus extends ObservableQueryExternalBase< | ||
[ | ||
{ | ||
source: string; | ||
destination: string; | ||
channel_id: string; | ||
token_symbol: string; | ||
token_name: string; | ||
last_tx: string; | ||
size_queue: number; | ||
duration_minutes: number; | ||
} | ||
] | ||
> { | ||
constructor( | ||
kvStore: KVStore, | ||
baseURL: string, | ||
sourceChainId: string, | ||
destinationChainId: string | ||
) { | ||
super( | ||
kvStore, | ||
baseURL, | ||
`/ibc/v1/source/${sourceChainId}/destination${destinationChainId}?minutes_trigger=-1` | ||
); | ||
|
||
makeObservable(this); | ||
} | ||
|
||
readonly getIbcStatus = computedFn( | ||
(channelId: string): IbcStatus | undefined => { | ||
const channelData = this.response?.data.find( | ||
(channel) => channel.channel_id === channelId | ||
); | ||
if (channelData) { | ||
if (channelData.size_queue > 0) { | ||
if (channelData.duration_minutes > 20) return "blocked"; | ||
else if (channelData.duration_minutes > 5) return "congested"; | ||
} | ||
return "normal"; | ||
} | ||
} | ||
); | ||
} | ||
|
||
// Ibc status (sourceChainId -> counterPartyChainId) | ||
class ObservableQueryWithdrawIbcChainsStatus extends HasMapStore<ObservableQueryIbcChainStatus> { | ||
constructor(kvStore: KVStore, sourceChainId: string, baseUrl: string) { | ||
super( | ||
(counterPartyChainId) => | ||
new ObservableQueryIbcChainStatus( | ||
kvStore, | ||
baseUrl, | ||
sourceChainId, | ||
counterPartyChainId | ||
) | ||
); | ||
} | ||
|
||
get(counterPartyChainId: string): ObservableQueryIbcChainStatus { | ||
return super.get(counterPartyChainId); | ||
} | ||
} | ||
|
||
// Ibc status (counterPartyChainId -> sourceChainId) | ||
class ObservableQueryDepositIbcChainsStatus extends HasMapStore<ObservableQueryIbcChainStatus> { | ||
constructor(kvStore: KVStore, sourceChainId: string, baseUrl: string) { | ||
super( | ||
(counterPartyChainId) => | ||
new ObservableQueryIbcChainStatus( | ||
kvStore, | ||
baseUrl, | ||
counterPartyChainId, | ||
sourceChainId | ||
) | ||
); | ||
} | ||
|
||
get(counterPartyChainId: string): ObservableQueryIbcChainStatus { | ||
return super.get(counterPartyChainId); | ||
} | ||
} | ||
|
||
export class ObservableQueryIbcChainsStatus { | ||
withdrawQueryMapping: ObservableQueryWithdrawIbcChainsStatus; | ||
depositQueryMapping: ObservableQueryDepositIbcChainsStatus; | ||
constructor(kvStore: KVStore, sourceChainId: string, baseUrl: string) { | ||
this.withdrawQueryMapping = new ObservableQueryWithdrawIbcChainsStatus( | ||
kvStore, | ||
sourceChainId, | ||
baseUrl | ||
); | ||
this.depositQueryMapping = new ObservableQueryDepositIbcChainsStatus( | ||
kvStore, | ||
sourceChainId, | ||
baseUrl | ||
); | ||
} | ||
|
||
@computed | ||
getIbcStatus( | ||
direction: "withdraw" | "deposit", | ||
channelId: string, | ||
counterPartyChainId: string | ||
): IbcStatus | undefined { | ||
if (direction === "withdraw") | ||
return this.withdrawQueryMapping | ||
.get(counterPartyChainId) | ||
.getIbcStatus(channelId); | ||
else | ||
return this.depositQueryMapping | ||
.get(counterPartyChainId) | ||
.getIbcStatus(channelId); | ||
} | ||
} |
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 @@ | ||
export type IbcStatus = "normal" | "congested" | "blocked"; |
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,2 @@ | ||
export * from "./status-by-id"; | ||
export * from "./types"; |
35 changes: 35 additions & 0 deletions
35
packages/stores/types/queries-external/ibc/status-by-id.d.ts
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,35 @@ | ||
import { HasMapStore } from "@keplr-wallet/stores"; | ||
import { ObservableQueryExternalBase } from "../base"; | ||
import { KVStore } from "@keplr-wallet/common"; | ||
import { IbcStatus } from "./types"; | ||
/** Queries for ibc chain data*/ | ||
declare class ObservableQueryIbcChainStatus extends ObservableQueryExternalBase<[ | ||
{ | ||
source: string; | ||
destination: string; | ||
channel_id: string; | ||
token_symbol: string; | ||
token_name: string; | ||
last_tx: string; | ||
size_queue: number; | ||
duration_minutes: number; | ||
} | ||
]> { | ||
constructor(kvStore: KVStore, baseURL: string, sourceChainId: string, destinationChainId: string); | ||
readonly getIbcStatus: (channelId: string) => IbcStatus | undefined; | ||
} | ||
declare class ObservableQueryWithdrawIbcChainsStatus extends HasMapStore<ObservableQueryIbcChainStatus> { | ||
constructor(kvStore: KVStore, sourceChainId: string, baseUrl: string); | ||
get(counterPartyChainId: string): ObservableQueryIbcChainStatus; | ||
} | ||
declare class ObservableQueryDepositIbcChainsStatus extends HasMapStore<ObservableQueryIbcChainStatus> { | ||
constructor(kvStore: KVStore, sourceChainId: string, baseUrl: string); | ||
get(counterPartyChainId: string): ObservableQueryIbcChainStatus; | ||
} | ||
export declare class ObservableQueryIbcChainsStatus { | ||
withdrawQueryMapping: ObservableQueryWithdrawIbcChainsStatus; | ||
depositQueryMapping: ObservableQueryDepositIbcChainsStatus; | ||
constructor(kvStore: KVStore, sourceChainId: string, baseUrl: string); | ||
getIbcStatus(direction: "withdraw" | "deposit", channelId: string, counterPartyChainId: string): IbcStatus | undefined; | ||
} | ||
export {}; |
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 @@ | ||
export declare type IbcStatus = "normal" | "congested" | "blocked"; |
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,6 @@ | ||
export * from "./pool-fees"; | ||
export * from "./pool-rewards"; | ||
export * from "./ibc"; | ||
export * from "./store"; | ||
export declare const IMPERATOR_HISTORICAL_DATA_BASEURL = "https://api-osmosis.imperator.co"; | ||
export declare const IMPERATOR_TX_REWARD_BASEURL = "https://api-osmosis-chain.imperator.co"; |
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,12 @@ | ||
import { HasMapStore } from "@keplr-wallet/stores"; | ||
import { ObservableQueryExternalBase } from "../base"; | ||
import { KVStore } from "@keplr-wallet/common"; | ||
/** Queries */ | ||
export declare class ObservableQueryIbcChainStatus extends ObservableQueryExternalBase<string> { | ||
constructor(kvStore: KVStore, baseURL: string, chainId: string, counterPartyChainId: string); | ||
get getIBCStatus(): string | undefined; | ||
} | ||
export declare class ObservableQueryIbcChainsStatus extends HasMapStore<ObservableQueryIbcChainStatus> { | ||
constructor(kvStore: KVStore, chainId: string, baseUrl?: string); | ||
get(counterPartyChainId: string): ObservableQueryIbcChainStatus; | ||
} |
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 { HasMapStore } from "@keplr-wallet/stores"; | ||
import { ObservableQueryExternalBase } from "../base"; | ||
import { KVStore } from "@keplr-wallet/common"; | ||
/** Queries */ | ||
export declare class ObservableQueryIbcChainStatus extends ObservableQueryExternalBase<string> { | ||
constructor(kvStore: KVStore, baseURL: string, chainId: string, counterPartyChainId: string); | ||
get getIBCStatus(): string | undefined; | ||
} | ||
export declare class ObservableQueryIbcChainsStatus extends HasMapStore<ObservableQueryIbcChainStatus> { | ||
constructor(kvStore: KVStore, chainId: string, baseUrl?: string); | ||
get(counterPartyChainId: string): ObservableQueryIbcChainStatus; | ||
} |
Empty file.
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
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.
0e78486
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
osmosis-frontend – ./
osmosis-frontend-osmo-labs.vercel.app
app.osmosis.zone
osmosis-frontend.vercel.app
osmosis-frontend-git-master-osmo-labs.vercel.app
0e78486
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
osmosis-frontend-v13-chain – ./
v13.osmosis.zone
osmosis-frontend-chain-releases.vercel.app
osmosis-frontend-v13-chain-osmo-labs.vercel.app
osmosis-frontend-v13-chain-git-master-osmo-labs.vercel.app
0e78486
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
osmosis-frontier – ./
osmosis-frontier-new.vercel.app
front.osmosis.zone
osmosis-frontier-osmo-labs.vercel.app
frontier.osmosis.zone
osmosis-frontier-git-master-osmo-labs.vercel.app