Skip to content

Commit

Permalink
fix: wrapper fee payer type
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszjasiuk committed Jan 27, 2025
1 parent d9cc843 commit 929c570
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/extension/src/Approvals/Commitment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { TransactionCard } from "./TransactionCard";

type CommitmentProps = {
commitment: CommitmentDetailProps;
wrapperFeePayer?: string;
wrapperFeePayer: string;
};

const IconMap: Record<TxType, React.ReactNode> = {
Expand Down Expand Up @@ -61,7 +61,7 @@ const formatTransferAddress = (address: string): string =>

const renderContent = (
tx: CommitmentDetailProps,
wrapperFeePayer?: string
wrapperFeePayer: string
): ReactNode => {
switch (tx.txType) {
case TxType.Bond:
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/src/tx/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ export class Tx {

return {
...wrapperTx,
// Wrapper fee payer is always defined at this point
wrapperFeePayer: wrapperTx.wrapperFeePayer!,
commitments: commitments.map(
({ txType, hash, txCodeId, data, memo, maspTxIn, maspTxOut }) => ({
txType: txType as TxType,
Expand Down
2 changes: 2 additions & 0 deletions packages/types/src/tx/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ export type CommitmentDetailProps = SupportedTxProps & {

export type TxDetails = WrapperTxProps & {
commitments: CommitmentDetailProps[];
// We override wrapperFeePayer to be a string because it should always be defined at this point
wrapperFeePayer: string;
};

0 comments on commit 929c570

Please sign in to comment.