Skip to content

Commit

Permalink
display correct denomination token on redemption intro
Browse files Browse the repository at this point in the history
  • Loading branch information
kenkunz committed Sep 27, 2024
1 parent 1e99060 commit 6b03393
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/routes/wizard/redeem/introduction/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<script lang="ts">
import { wizard } from 'wizard/store';
export let data;
const { denominationToken } = data;
wizard.toggleComplete('introduction');
</script>

<div class="deposit-introduction">
<p>
Ready to redeem shares of <strong>{$wizard.data.strategyName}</strong>? Upon redemption, you'll receive USDC.e and
any tokens the strategy is currently invested in. Connect your wallet, review your share balance, enter your desired
redemption amount, and complete your transaction. Let's get started!
Ready to redeem shares of <strong>{$wizard.data.strategyName}</strong>? Upon redemption, you'll receive
<strong>{denominationToken.label}</strong> and any tokens the strategy is currently invested in. Connect your wallet,
review your share balance, enter your desired redemption amount, and complete your transaction. Let's get started!
</p>
</div>
16 changes: 16 additions & 0 deletions src/routes/wizard/redeem/introduction/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { EnzymeSmartContracts } from 'trade-executor/strategy/summary';
import { type ConfiguredChainId, config } from '$lib/wallet';
import { get } from 'svelte/store';
import { wizard } from 'wizard/store';
import { getAccount } from '@wagmi/core';
import { getDenominationToken } from '$lib/eth-defi/helpers';

export async function load() {
const { address } = getAccount(config) as { address: Address };
const { chainId, contracts } = get(wizard).data! as { chainId: ConfiguredChainId; contracts: EnzymeSmartContracts };
const comptroller = contracts.comptroller!;

return {
denominationToken: await getDenominationToken(config, { address, comptroller, chainId })
};
}

0 comments on commit 6b03393

Please sign in to comment.