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

Missing fields (sfEmitNonce, sfEmitCallback) in EmitDetails. #20

Open
tequdev opened this issue Jan 31, 2025 · 1 comment
Open

Missing fields (sfEmitNonce, sfEmitCallback) in EmitDetails. #20

tequdev opened this issue Jan 31, 2025 · 1 comment

Comments

@tequdev
Copy link

tequdev commented Jan 31, 2025

sfEmitNonce -> string(uint256)
sfEmitCallback -> optional string (Account)

https://github.com/Xahau/xahaud/blob/d17f7151ab35e4c7b7fbb18371a427f62b416d74/src/ripple/protocol/impl/InnerObjectFormats.cpp#L26-L33

export interface EmitDetails {
EmitBurden: number
EmitGeneration: number
EmitHookHash: string
EmitParentTxnID: string
}

@RJ-Flash
Copy link

RJ-Flash commented Feb 2, 2025

It looks like you’re running into a mismatch between the Xahau protocol’s sfEmitNonce and sfEmitCallback fields and the way xahau.js handles EmitDetails in xrpl/src/models/common/index.ts. Specifically:

Key Differences

  1. Xahau Protocol Definition (C++ - InnerObjectFormats.cpp)

    • sfEmitNoncestring(uint256)
    • sfEmitCallbackoptional string (Account)
  2. Current Xahau.js Definition (EmitDetails in index.ts)

    • EmitBurden: number
    • EmitGeneration: number
    • EmitHookHash: string
    • EmitParentTxnID: string

Potential Issues

  • Missing sfEmitNonce in EmitDetails → Should be added as EmitNonce: string (to store a uint256 as a string).
  • Missing sfEmitCallback in EmitDetails → Should be added as EmitCallback?: string (optional).
  • Possible Type Mismatch → uint256 (C++) should be properly represented as a hex string (string) in TypeScript.

Fix
Modify EmitDetails in xahau.js/packages/xrpl/src/models/common/index.ts:

Before
typescript
export interface EmitDetails {
EmitBurden: number
EmitGeneration: number
EmitHookHash: string
EmitParentTxnID: string
}

After (Updated to Match Xahau Protocol)
typescript
export interface EmitDetails {
EmitBurden: number;
EmitGeneration: number;
EmitHookHash: string;
EmitParentTxnID: string;
EmitNonce: string; // Added to match sfEmitNonce (uint256 as string)
EmitCallback?: string; // Optional, matches sfEmitCallback (Account)
}

Next Steps

  1. Update index.ts and rebuild the xahau.js package:
    bash
    cd xahau.js
    npm install
    npm run build

  2. Ensure that your code properly assigns values to EmitNonce and EmitCallback.

  3. Test transactions using the updated EmitDetails.

This should resolve any issues with missing or incorrect fields related to sfEmitNonce and sfEmitCallback.

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

No branches or pull requests

2 participants