Skip to content

Conversation

@raul-oliveira
Copy link
Contributor

@raul-oliveira raul-oliveira commented Oct 28, 2025

Depends on #858

Motivation

Add the fee, and fee completion api to the transaction template. It will enable developers to create custom transactions without having to add new methods or args to the wallet facade

Acceptance Criteria

  • Add tests for tx template
  • Add the addFee instruction, and executor

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation-tx-template branch from fda016a to dcee210 Compare October 31, 2025 01:26
@raul-oliveira raul-oliveira changed the title feat: fee token feat: fee token in tx template Oct 31, 2025
@raul-oliveira raul-oliveira self-assigned this Oct 31, 2025
@raul-oliveira raul-oliveira moved this from Todo to In Progress (WIP) in Hathor Network Oct 31, 2025
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation branch 6 times, most recently from 727fbcb to ab8cdcf Compare November 6, 2025 21:07
@raul-oliveira raul-oliveira moved this from In Progress (WIP) to Todo in Hathor Network Nov 10, 2025
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation branch from ab8cdcf to a9d458a Compare November 11, 2025 17:07
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation-tx-template branch from b0c3c18 to ca29709 Compare November 12, 2025 05:15
@raul-oliveira raul-oliveira moved this from Todo to In Progress (WIP) in Hathor Network Nov 12, 2025
@raul-oliveira raul-oliveira requested a review from r4mmer November 12, 2025 05:15
@raul-oliveira raul-oliveira marked this pull request as ready for review November 13, 2025 16:25
@raul-oliveira raul-oliveira moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Nov 13, 2025
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation branch from 578d9ba to c23972a Compare November 27, 2025 14:29
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation branch 2 times, most recently from 55ff9ca to dfddf95 Compare December 3, 2025 23:27
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation-tx-template branch from ca29709 to 60733a2 Compare December 4, 2025 20:30
@github-project-automation github-project-automation bot moved this from In Progress (Done) to Waiting to be deployed in Hathor Network Dec 4, 2025
@raul-oliveira raul-oliveira reopened this Dec 4, 2025
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation-tx-template branch 2 times, most recently from 825e5cb to 23e3b23 Compare December 5, 2025 16:38
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation-tx-template branch from 01a56f5 to 29238ac Compare January 8, 2026 22:27
r4mmer
r4mmer previously approved these changes Jan 9, 2026
pedroferreira1
pedroferreira1 previously approved these changes Jan 9, 2026
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation-tx-template branch 2 times, most recently from 73dffe2 to fb8aefc Compare January 9, 2026 14:10
@raul-oliveira raul-oliveira dismissed stale reviews from pedroferreira1 and r4mmer via 4a37863 January 9, 2026 16:06
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation-tx-template branch 2 times, most recently from 4a37863 to 1db9f33 Compare January 9, 2026 16:54
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation-tx-template branch from 1db9f33 to 0cc6faf Compare January 9, 2026 18:14
tuliomir
tuliomir previously approved these changes Jan 15, 2026
Comment on lines +417 to +421
tokenInfo: {
name: 'Hathor',
symbol: 'HTR',
version: TokenVersion.NATIVE,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore: Use the constants instead of hardcoding this data.

Suggested change
tokenInfo: {
name: 'Hathor',
symbol: 'HTR',
version: TokenVersion.NATIVE,
},
tokenInfo: constants.DEFAULT_NATIVE_TOKEN_CONFIG,

private static buildFeeHeader(ctx: TxTemplateContext): FeeHeader {
const entries: IFeeEntry[] = Array.from(ctx.fees.entries()).map(([tokenUid, amount]) => ({
tokenIndex: tokensUtils.getTokenIndex(
ctx.tokens.map(t => ({ uid: t })),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: There is a warning that this header section wasn't tested. Isn't this a critical part of the resulting transaction, or can we skip this testing to a later stage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. We are using the fee header in the integration tests. I'll see why it's nove flagging as covered :)

pedroferreira1
pedroferreira1 previously approved these changes Jan 15, 2026
@raul-oliveira raul-oliveira dismissed stale reviews from pedroferreira1 and tuliomir via 9c9a28d January 16, 2026 16:54
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-creation-tx-template branch from 9c9a28d to 4683ca0 Compare January 16, 2026 16:55
@tuliomir tuliomir moved this from In Review (WIP) to In Review (Done) in Hathor Network Jan 16, 2026
@raul-oliveira raul-oliveira merged commit 6ccff20 into master Jan 16, 2026
5 checks passed
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting to be deployed

Development

Successfully merging this pull request may close these issues.

5 participants