Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add memo to tx info modal #147

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions components/bank/components/historyBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ interface Transaction {
from_address: string;
to_address: string;
amount: Array<{ amount: string; denom: string }>;
memo?: string;
}

export interface TransactionGroup {
tx_hash: string;
block_number: number;
formatted_date: string;
data: Transaction;
memo?: string;
}

function formatLargeNumber(num: number): string {
Expand Down
5 changes: 5 additions & 0 deletions components/bank/modals/txInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ export default function TxInfoModal({ tx, modalId }: TxInfoModalProps) {
</div>
</div>
</div>
{tx?.data?.memo && (
<div className="mt-6">
<InfoItem label="MEMO" explorerUrl={explorerUrl} value={tx.data.memo} />
</div>
)}
</div>
<form method="dialog" className="modal-backdrop">
<button>close</button>
Expand Down
12 changes: 11 additions & 1 deletion hooks/useQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@
from_address: string;
to_address: string;
amount: { amount: string; denom: string }[];
memo?: string;

Check warning on line 717 in hooks/useQueries.ts

View check run for this annotation

Codecov / codecov/patch

hooks/useQueries.ts#L717

Added line #L717 was not covered by tests
};
}
| undefined => {
Expand All @@ -728,6 +729,7 @@
amount: amt.amount,
denom: amt.denom,
})),
memo: message.memo,

Check warning on line 732 in hooks/useQueries.ts

View check run for this annotation

Codecov / codecov/patch

hooks/useQueries.ts#L732

Added line #L732 was not covered by tests
},
};
case `/osmosis.tokenfactory.v1beta1.MsgMint`:
Expand All @@ -737,6 +739,7 @@
from_address: message.sender,
to_address: message.mintToAddress,
amount: [message.amount],
memo: message.memo,

Check warning on line 742 in hooks/useQueries.ts

View check run for this annotation

Codecov / codecov/patch

hooks/useQueries.ts#L742

Added line #L742 was not covered by tests
},
};
case `/osmosis.tokenfactory.v1beta1.MsgBurn`:
Expand All @@ -746,6 +749,7 @@
from_address: message.sender,
to_address: message.burnFromAddress,
amount: [message.amount],
memo: message.memo,

Check warning on line 752 in hooks/useQueries.ts

View check run for this annotation

Codecov / codecov/patch

hooks/useQueries.ts#L752

Added line #L752 was not covered by tests
},
};
case `/liftedinit.manifest.v1.MsgPayout`:
Expand All @@ -766,6 +770,7 @@
from_address: message.authority,
to_address: address,
amount: totalAmount,
memo: message.memo,

Check warning on line 773 in hooks/useQueries.ts

View check run for this annotation

Codecov / codecov/patch

hooks/useQueries.ts#L773

Added line #L773 was not covered by tests
},
};
case `/lifted.init.manifest.v1.MsgBurnHeldBalance`:
Expand All @@ -775,6 +780,7 @@
from_address: message.authority,
to_address: message.authority,
amount: message.burnCoins,
memo: message.memo,

Check warning on line 783 in hooks/useQueries.ts

View check run for this annotation

Codecov / codecov/patch

hooks/useQueries.ts#L783

Added line #L783 was not covered by tests
},
};
default:
Expand All @@ -799,7 +805,10 @@
tx_hash: tx.id,
block_number: parseInt(tx.data.txResponse.height),
formatted_date: tx.data.txResponse.timestamp,
...formattedMessage,
data: {
...formattedMessage.data,
memo: tx.data.tx.body.memo,
},

Check warning on line 811 in hooks/useQueries.ts

View check run for this annotation

Codecov / codecov/patch

hooks/useQueries.ts#L808-L811

Added lines #L808 - L811 were not covered by tests
});
}
}
Expand All @@ -811,6 +820,7 @@
tx_hash: tx.id,
block_number: parseInt(tx.data.txResponse.height),
formatted_date: tx.data.txResponse.timestamp,
memo: tx.data.tx.body.memo,

Check warning on line 823 in hooks/useQueries.ts

View check run for this annotation

Codecov / codecov/patch

hooks/useQueries.ts#L823

Added line #L823 was not covered by tests
...formattedMessage,
});
}
Expand Down
Loading