Skip to content

feat(tron): add data type for sign message#215

Merged
soralit merged 1 commit intomasterfrom
feat/add-data-type-for-tron
Mar 17, 2026
Merged

feat(tron): add data type for sign message#215
soralit merged 1 commit intomasterfrom
feat/add-data-type-for-tron

Conversation

@Qkin-Keystone
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the Tron UR registry sign-request payload to include a dataType field so callers can distinguish between signing a transaction vs. signing a personal message.

Changes:

  • Adds a DataType enum and a dataType field to TronSignRequest serialization/deserialization.
  • Updates the public exports to expose DataType from the package entrypoint.
  • Updates Jest tests to include dataType and to match the new UR encoding output.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/ur-registry-tron/src/index.ts Re-exports DataType alongside TronSignRequest.
packages/ur-registry-tron/src/TronSignRequest.ts Introduces DataType and serializes/deserializes it in the CBOR map; updates constructor and factory signature.
packages/ur-registry-tron/test/TronSignRequest.test.ts Adjusts tests to set dataType and updates expected UR strings.
Comments suppressed due to low confidence (1)

packages/ur-registry-tron/src/TronSignRequest.ts:133

  • constructTronRequest now requires a new positional dataType argument, which is a breaking change for downstream callers. If backward compatibility is desired, consider making dataType optional with a default (e.g., DataType.transaction) and/or providing an overload that preserves the previous parameter order.
  public static constructTronRequest(
    signData: Buffer,
    dataType: DataType,
    derivationHDPath: string,
    xfp: string,
    uuidString?: string,
    address?: Buffer,
    origin?: string

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 16 to 20
signData,
dataType,
derivationPath,
address,
origin,
Comment on lines 98 to +101
return new TronSignRequest({
requestId,
signData: map[Keys.signData],
dataType: map[Keys.dataType],
Comment on lines +23 to +26
export enum DataType {
transaction = 1,
personalMessage = 2,
}
@soralit soralit merged commit cda9c6e into master Mar 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants