Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove source denom #3665

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/server/src/queries/complex/assets/price/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export async function getAssetPrice({
assetLists: AssetList[];
asset: { coinDenom?: string } & (
| { coinMinimalDenom: string }
| { sourceDenom: string }
| { chainId: number | string; address: string }
| { coinGeckoId: string }
);
Expand All @@ -40,7 +39,6 @@ export async function getAssetPrice({
}): Promise<Dec> {
const coinMinimalDenom =
"coinMinimalDenom" in asset ? asset.coinMinimalDenom : undefined;
const sourceDenom = "sourceDenom" in asset ? asset.sourceDenom : undefined;
const { chainId, address } =
"chainId" in asset && "address" in asset
? asset
Expand All @@ -53,7 +51,6 @@ export async function getAssetPrice({
.find(
(asset) =>
(coinMinimalDenom && asset.coinMinimalDenom === coinMinimalDenom) ||
(sourceDenom && asset.sourceDenom === sourceDenom) ||
(chainId &&
address &&
asset.counterparty.some(
Expand All @@ -74,7 +71,7 @@ export async function getAssetPrice({
if (!foundAsset)
throw new Error(
`Asset ${
asset.coinDenom ?? coinMinimalDenom ?? sourceDenom
asset.coinDenom ?? coinMinimalDenom
} not found in asset list registry.`
);

Expand Down
5 changes: 0 additions & 5 deletions packages/web/server/api/routers/bridge-transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ export const bridgeTransferRouter = createTRPCRouter({
...ctx,
asset: {
coinMinimalDenom: input.toAsset.address,
sourceDenom: input.toAsset.address,
chainId: input.toChain.chainId,
address: input.toAsset.address,
coinGeckoId: input.toAsset.coinGeckoId,
Expand All @@ -158,7 +157,6 @@ export const bridgeTransferRouter = createTRPCRouter({
...ctx,
asset: {
coinMinimalDenom: input.fromAsset.address,
sourceDenom: input.fromAsset.address,
chainId: input.fromChain.chainId,
address: input.fromAsset.address,
coinGeckoId: input.fromAsset.coinGeckoId,
Expand All @@ -169,7 +167,6 @@ export const bridgeTransferRouter = createTRPCRouter({
...ctx,
asset: {
coinMinimalDenom: feeCoin.address,
sourceDenom: feeCoin.address,
chainId: quote.transferFee.chainId,
address: quote.transferFee.address,
coinGeckoId: quote.transferFee.coinGeckoId,
Expand All @@ -183,7 +180,6 @@ export const bridgeTransferRouter = createTRPCRouter({
{
bridge: input.bridge,
coinMinimalDenom: feeCoin.address,
sourceDenom: feeCoin.address,
chainId: quote.transferFee.chainId,
address: quote.transferFee.address,
coinGeckoId: quote.transferFee.coinGeckoId,
Expand All @@ -197,7 +193,6 @@ export const bridgeTransferRouter = createTRPCRouter({
...ctx,
asset: {
coinMinimalDenom: quote.estimatedGasFee.address,
sourceDenom: quote.estimatedGasFee.address,
chainId: quote.fromChain.chainId,
address: quote.estimatedGasFee.address,
coinGeckoId: quote.estimatedGasFee.coinGeckoId,
Expand Down