-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove combined asset model, closes #48
- Loading branch information
Showing
77 changed files
with
903 additions
and
1,074 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,18 @@ | ||
import { useBrc20AccountCryptoAssetsWithDetails } from '@app/query/bitcoin/ordinals/brc20/brc20-tokens.hooks'; | ||
import type { Brc20AccountCryptoAssetWithDetails } from '@app/query/models/crypto-asset.model'; | ||
import type { Brc20CryptoAssetInfo, CryptoAssetBalance, MarketData } from '@leather-wallet/models'; | ||
|
||
import { useBrc20Tokens } from '@app/query/bitcoin/ordinals/brc20/brc20-tokens.hooks'; | ||
|
||
interface Brc20TokensLoaderProps { | ||
children(tokens: Brc20AccountCryptoAssetWithDetails[]): React.ReactNode; | ||
children( | ||
tokens: { | ||
balance: CryptoAssetBalance; | ||
info: Brc20CryptoAssetInfo; | ||
holderAddress: string; | ||
marketData: MarketData; | ||
}[] | ||
): React.ReactNode; | ||
} | ||
export function Brc20TokensLoader({ children }: Brc20TokensLoaderProps) { | ||
const tokens = useBrc20AccountCryptoAssetsWithDetails(); | ||
const tokens = useBrc20Tokens(); | ||
return children(tokens); | ||
} |
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 type { BtcCryptoAssetBalance } from '@leather-wallet/models'; | ||
|
||
import { useBtcCryptoAssetBalanceNativeSegwit } from '@app/query/bitcoin/balance/btc-balance-native-segwit.hooks'; | ||
|
||
interface BtcBalanceLoaderProps { | ||
address: string; | ||
children(balance: BtcCryptoAssetBalance, isInitialLoading: boolean): React.ReactNode; | ||
} | ||
export function BtcBalanceLoader({ address, children }: BtcBalanceLoaderProps) { | ||
const { balance, isInitialLoading } = useBtcCryptoAssetBalanceNativeSegwit(address); | ||
return children(balance, isInitialLoading); | ||
} |
This file was deleted.
Oops, something went wrong.
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,11 +1,12 @@ | ||
import type { RuneToken } from '@app/query/bitcoin/bitcoin-client'; | ||
import type { CryptoAssetBalance, RuneCryptoAssetInfo } from '@leather-wallet/models'; | ||
|
||
import { useRuneTokens } from '@app/query/bitcoin/runes/runes.hooks'; | ||
|
||
interface RunesLoaderProps { | ||
addresses: string[]; | ||
children(runes: RuneToken[]): React.ReactNode; | ||
children(runes: { balance: CryptoAssetBalance; info: RuneCryptoAssetInfo }[]): React.ReactNode; | ||
} | ||
export function RunesLoader({ addresses, children }: RunesLoaderProps) { | ||
const runes = useRuneTokens(addresses); | ||
const { runes = [] } = useRuneTokens(addresses); | ||
return children(runes); | ||
} |
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,15 @@ | ||
import { | ||
type Sip10TokenAssetDetails, | ||
useFilteredSip10Tokens, | ||
} from '@app/query/stacks/sip10/sip10-tokens.hooks'; | ||
import type { Sip10CryptoAssetFilter } from '@app/query/stacks/sip10/sip10-tokens.utils'; | ||
|
||
interface Sip10TokensLoaderProps { | ||
address: string; | ||
filter: Sip10CryptoAssetFilter; | ||
children(isLoading: boolean, tokens: Sip10TokenAssetDetails[]): React.ReactNode; | ||
} | ||
export function Sip10TokensLoader({ address, filter, children }: Sip10TokensLoaderProps) { | ||
const { isInitialLoading, tokens = [] } = useFilteredSip10Tokens({ address, filter }); | ||
return children(isInitialLoading, tokens); | ||
} |
Oops, something went wrong.