phantom / docs

32 stars 17 forks source link

Partilly Signed Transaction and signAndSendTransaction #30

Closed beargrilo closed 2 years ago

beargrilo commented 2 years ago

Hi, since Phantom Labs discord doesn't give support anymore and I don'have have any reply from Phantom Support, I'll expose my issue here:

I'm creating a Transaction and then partially signed it, serialize it and send it to the frontend.

transaction.partialSign(bankKeypair)
const serializedTransaction = transaction.serialize({
    requireAllSignatures: false
})
serializedTransaction.toString('base64')

When I get the Transaction in the frontend, I recover it with:

const recoveredTransaction = Transaction.from(Buffer.from(serializedTransaction, 'base64'))

If I use the deprecated function from phantom wallet signTransaction

const signedTransaction = await window.solana.signTransaction(recoveredTransaction)
const result = await connection.sendRawTransaction(signedTransaction.serialize());

Everything works just fine!

If I use the correct method from phantom wallet signAndSendTransaction

const result = await window.solana.signAndSendTransaction(recoveredTransaction)

It fails with {code: -32003, message: 'Transaction creation failed.'}

Why does it fail with signAndSendTransaction and not with signTransaction and sendRawTransaction ?

Thank you,

bfriel commented 2 years ago

Hi @beargrilo,

I'm sorry we were not able to get in touch with you earlier.

Our signAndSendTransaction method has never supported partially-signed transactions. That said, we recognize the value this has and are currently adding support for partially-signed transactions on both extension and mobile. We estimate that this should be available within the next month.

beargrilo commented 2 years ago

Thank you very much