Skip to content

Commit

Permalink
remove source denom (#3665)
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn authored Aug 5, 2024
1 parent 027dd1e commit e47181b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
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

0 comments on commit e47181b

Please sign in to comment.