Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TalDerei committed Jul 17, 2024
1 parent 9a8b69a commit ec51e8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/minifront/src/components/shared/gas-fee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const GasFee = ({
assetFeeMetadata?: Metadata;
setFeeTier: (feeTier: FeeTier_Tier) => void;
}) => {
// Use stakingAssetMetadata if assetFeeMetadata is undefined
// If the metadata for the fee asset is undefined, fallback to using the bundled staking asset metadata.
const feeMetadata = assetFeeMetadata ?? stakingAssetMetadata;

const feeValueView = new ValueView({
Expand Down
2 changes: 2 additions & 0 deletions apps/minifront/src/state/send/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export const createSendSlice = (): SliceCreator<SendSlice> => (set, get) => {
const txPlan = await plan(assembleRequest(get().send));
const fee = txPlan.transactionParameters?.fee;

// Fetch the asset metadata for the fee if assetId is defined; otherwise, set it to undefined.
// The undefined case occurs when the fee uses the native staking token.
const feeAssetMetadata = fee?.assetId ? await getAssetTokenMetadata(fee.assetId) : undefined;

if (!fee?.amount) {
Expand Down

0 comments on commit ec51e8b

Please sign in to comment.