Skip to content

smplx_sdk: add wrapper over Transaction for fetch_transaction#64

Draft
ikripaka wants to merge 1 commit intodevfrom
feat/fetch_transaction
Draft

smplx_sdk: add wrapper over Transaction for fetch_transaction#64
ikripaka wants to merge 1 commit intodevfrom
feat/fetch_transaction

Conversation

@ikripaka
Copy link
Copy Markdown
Collaborator

@ikripaka ikripaka commented Apr 28, 2026

  • This PR suggests a bug fix and I've added the necessary tests.
  • This PR introduces a new feature and I've discussed the update in an Issue or with the team.
  • This PR is just a minor change like a typo fix.

  • Add simplex::transaction::Transaction type to wrap behaviour over Transaction. In this way, we need to invoke get_unblinded_out or get_explicit_out to obtain a UTXO object from elements::Transaction
  • Changes code in the following way.
    Before:
let lending_utxo = provider.fetch_scripthash_utxos(&lending.get_script_pubkey())?[0].clone();

    let lending_creation_tx = provider.fetch_transaction(&lending_creation_txid)?;

    let first_parameters_nft_utxo = UTXO {
        outpoint: OutPoint::new(lending_creation_txid, 1),
        txout: lending_creation_tx.output[1].clone(),
        secrets: None,
    };
    let second_parameters_nft_utxo = UTXO {
        outpoint: OutPoint::new(lending_creation_txid, 2),
        txout: lending_creation_tx.output[2].clone(),
        secrets: None,
    };

After:

let txid = finalize_and_broadcast(&context, &ft)?;
    provider.wait(&txid)?;

    let lending_utxo = provider.fetch_scripthash_utxos(&lending.get_script_pubkey())?[0].clone();

    let lending_creation_tx = provider.fetch_transaction(&lending_creation_txid)?;

    let first_parameters_nft_utxo = lending_creation_tx.get_explicit_out(1)?;
    let second_parameters_nft_utxo = lending_creation_tx.get_explicit_out(2)?;

- add simplex::transaction::Transaction type to wrap behaviour over Transaction. In this way, we need to invoke get_unblinded_out or get_explicit_out to obtain a UTXO object from elements::Transaction
@ikripaka ikripaka force-pushed the feat/fetch_transaction branch from a5ef3fe to 9a76dee Compare April 28, 2026 14:10
@ikripaka ikripaka self-assigned this Apr 28, 2026
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.

1 participant