Skip to content

Commit

Permalink
chore: use correct types
Browse files Browse the repository at this point in the history
  • Loading branch information
pbkompasz committed Aug 19, 2024
1 parent c56f70f commit d842bb7
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions static/scripts/rewards/render-transaction/insert-table-data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ERC20Permit, ERC721Permit } from "@ubiquibot/permit-generation/types";
import { ERC20PermitReward, ERC721PermitReward } from "@ubiquibot/permit-generation/types";
import { BigNumber, ethers } from "ethers";
import { app } from "../app-state";
import { ButtonController } from "../button-controller";
Expand All @@ -9,7 +9,7 @@ function shortenAddress(address: string): string {
}

export function insertErc20PermitTableData(
reward: ERC20Permit,
reward: ERC20PermitReward,
table: Element,
treasury: { balance: BigNumber; allowance: BigNumber; decimals: number; symbol: string }
): Element {
Expand All @@ -19,14 +19,7 @@ export function insertErc20PermitTableData(
[
{
name: "From",
value: `<a target="_blank" rel="noopener noreferrer" href="${app.getCurrentExplorerUrl(reward)}/address/${reward.owner}">
<span class="full">
<div>${reward.owner}</div>
</span>
<span class="short">
<div>${shortenAddress(reward.owner)}</div>
</span>
</a>`,
value: `<a target="_blank" rel="noopener noreferrer" href="${app.getCurrentExplorerUrl(reward)}/address/${reward.owner}">${reward.owner}</a>`,
},
{
name: "Expiry",
Expand All @@ -49,7 +42,7 @@ export function insertErc20PermitTableData(
return table.querySelector(".reward-amount") as Element;
}

export function insertErc721PermitTableData(reward: ERC721Permit, table: Element): Element {
export function insertErc721PermitTableData(reward: ERC721PermitReward, table: Element): Element {
const requestedAmountElement = table.querySelector(".reward-amount") as Element;
renderToFields(reward.beneficiary, app.getCurrentExplorerUrl(reward), table);
renderTokenFields(reward.tokenAddress, app.getCurrentExplorerUrl(reward), table);
Expand Down

0 comments on commit d842bb7

Please sign in to comment.