Open HinsonSIDAN opened 1 month ago
Suggest to improve the selection taking reference to existing resources:
One possible reason / edge case is that when we rely on auto min-utxo calculation, the output value is not considered at selection. E.g.
sendRefScriptOnchain = async (scriptIndex: ScriptIndex) => {
const { utxos, walletAddress } = await this.getWalletInfoForTx();
const { scriptAddress } = this.getOwnerNativeScript();
const txHex = await this.mesh
.txOut(scriptAddress, []) // minutxo ada for this output is not considered
.txOutReferenceScript(getScriptCbor(this.paramUtxo, scriptIndex))
.changeAddress(walletAddress)
.selectUtxosFrom(utxos, 'experimental')
.complete();
return txHex;
};
Maybe we needa implement / integrate min utxo calculation at TS level to solve the issue
Current experimental utxo selection - https://github.com/MeshJS/mesh/blob/main/packages/mesh-common/src/utxo-selection/experimental.ts
Describe the bug
Wallet got utxos containing necessary value & token, but failed to select
To Reproduce
With above utxos, select: