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 property of Transaction Interface #589

Open
mykhailohordin opened this issue Dec 24, 2024 · 2 comments
Open

Missing property of Transaction Interface #589

mykhailohordin opened this issue Dec 24, 2024 · 2 comments

Comments

@mykhailohordin
Copy link

TronWeb: 6.0.0

properties ret, signature are missing in Transaction interface

Transaction Interface:

export interface Transaction<T = ContractParamter> {
    visible: boolean;
    txID: string;
    raw_data: {
        contract: TransactionContract<T>[];
        ref_block_bytes: string;
        ref_block_hash: string;
        expiration: number;
        timestamp: number;
        data?: unknown;
        fee_limit?: unknown;
    };
    raw_data_hex: string;
}
Request:
tronWeb.trx.getTransaction('broadcast tx hash').then((tx) => {console.log(tx)});

getTransaction implementation:
 async getTransaction(transactionID: string): Promise<Transaction> {
        const transaction = await this.tronWeb.fullNode.request<Transaction>(
            'wallet/gettransactionbyid',
            {
                value: transactionID,
            },
            'post'
        );
        if (!Object.keys(transaction).length) {
            throw new Error('Transaction not found');
        }
        return transaction;
    }

Response:
{
  ret: [ { contractRet: 'SUCCESS' } ],
  signature: [ ---
  ],
  txID: '---',
  raw_data: {
    contract: [ [Object] ],
    ref_block_bytes: '---',
    ref_block_hash: '---',
    expiration: ---,
    fee_limit: ---,
    timestamp: ---
  },
  raw_data_hex: '---'
}



@DmytroShalaiev
Copy link

+1

@Satan-web3
Copy link
Contributor

Thanks for your feedback. We'll fix it in the next version.

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

5 participants
@DmytroShalaiev @mykhailohordin @Satan-web3 and others