kaspanet / rusty-kaspa

Kaspa full-node reference implementation and related libraries in the Rust programming language
ISC License
442 stars 144 forks source link

`UtxoEntry` from RPC and wasm class has different field name #332

Open Cryptok777 opened 10 months ago

Cryptok777 commented 10 months ago

Describe the bug From the RPC call getUtxosByAddresses it's returning {utxoEntry: {...}}, but in WASM class UtxoEntry has the field entry instead of utxoEntry, code - would be good to keep it consistent and so that the interface can be reused

To Reproduce

// Calling RPC
const resp = await this.rpc.getUtxosByAddresses({ addresses: [address] })
resp.utxoEntry // This is valid and returned by RPC

// In kaspa_wasm.d.ts, the UtxoEntry class is 

export class UtxoEntry {
/**
** Return copy of self without private attributes.
*/
  toJSON(): Object;
/**
* Return stringified version of self.
*/
  toString(): string;
  free(): void;
/**
*/
  address?: Address;
/**
*/
  entry: TxUtxoEntry;
/**
*/
  outpoint: TransactionOutpoint;
}
`

Expected behavior Would be ideal to keep these consistent so we can reuse the interface