Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 8212

How do you change the signer of an transaction or replicate a transaction with you as signer?

$
0
0

I want to prep a versionedTransaction to sell some tokens before I receive them. Such that the instant they hit my wallet the transaction triggers - rather than deal with the delay of compiling the instructions after I receive the token.

Raydium SDK is very troublesome but I know how many tokens I will receive exactly so I want to execute it straight away.

I find that I cannot create a transaction using Raydium's SDK or v2 SDK without having the tokens in my account. But what I can do is specify a different wallet I don't own, from the holders list who has sufficient tokens to let me successfully create such a transaction (since Raydium simulates this before giving instructions out).

What I'd like to do, effectively is take this Versionedtransaction take the instructions, swap my own wallet/signer in place of the one I used, and fire that off when ready. Elminating precious wait time.

The problem I have is nowhere seems to tell you how to do this.

I can't just sign the VersionedTransaction in hopes that it will let me take over the signature, as I get the error "Cannot sign with non signer key", which is fair... since this key didnt create the transaction. But I want the instructions to make my own.

Any ideas or tips on this? Or a way to circumvent the simulation to just get the swap transaction instructions even if my wallet hasn't got the token yet?


Viewing all articles
Browse latest Browse all 8212

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>