Skip to content

Conversation

JkrishnaD
Copy link
Contributor

Problem

Implement the sendTransaction call as a hook

Summary of Changes

as mentioned in #167 to create a sendTransaction hook i have done

  • i have added the useSendTransaction in hooks/send-transaction.ts
  • added typeset file for send-transaction.ts - ensures type safety and correct response shapes for all supported encodings
  • export the hook from main index.ts
  • updated the react package README.md
  • followed existing naming convention and changeset rules for consistency

Copy link

changeset-bot bot commented Aug 31, 2025

🦋 Changeset detected

Latest commit: e22e4c1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@gillsdk/react Minor
@gillsdk/examples-basics Minor
@gillsdk/examples-tokens Minor
@gillsdk/tests-e2e Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@JkrishnaD
Copy link
Contributor Author

@nickfrosty check this out once (my bad multiple commits in order to fix the changeset file)

@macalinao
Copy link
Contributor

What's the benefit of using a mutation over something like useCallback, or adding this to createSolanaClient?

@JkrishnaD
Copy link
Contributor Author

@macalinao here we used useMutation because it is a state changing rpc-call as we are sending the transaction on-chain which changes the state. so i have used it there

Copy link
Collaborator

@GuiBibeau GuiBibeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Nice work on this hook 🎉

Just noticed a small naming issue: the parameter signature in line 19 should probably be wireTransaction or transaction instead.

Currently it's a bit confusing because:

  • We're passing IN a transaction (base64 encoded)
  • We're getting OUT a signature (the transaction ID)

Using signature for the input makes it seem like we're passing in a signature, when we're actually passing in the whole transaction. What do you think about renaming it?

@JkrishnaD
Copy link
Contributor Author

@GuiBibeau thanks for the review i'll make sure all the changes which are reviewed will be added by tomorrow

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.

3 participants