Skip to content

Commit

Permalink
fix: v5 solana walletconnetprovider response encoding (#2946)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoruka authored Sep 26, 2024
1 parent 79ac86c commit d488048
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class WalletConnectProvider extends ProviderEventEmitter implements Provi
return transaction
}

const decodedTransaction = base58.decode(result.transaction)
const decodedTransaction = Buffer.from(result.transaction, 'base64')

if (isVersionedTransaction(transaction)) {
return VersionedTransaction.deserialize(decodedTransaction) as T
Expand Down Expand Up @@ -199,7 +199,7 @@ export class WalletConnectProvider extends ProviderEventEmitter implements Provi
throw new Error('Invalid transactions response')
}

const decodedTransaction = base58.decode(serializedTransaction)
const decodedTransaction = Buffer.from(serializedTransaction, 'base64')

if (isVersionedTransaction(transaction)) {
return VersionedTransaction.deserialize(decodedTransaction)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function mockUniversalProvider() {
case 'solana_signTransaction':
return Promise.resolve({
transaction:
'4zZMC2ddAFY1YHcA2uFCqbuTHmD1xvB5QLzgNnT3dMb4aQT98md8jVm1YRGUsKJkYkLPYarnkobvESUpjqEUnDmoG76e9cgNJzLuFXBW1i6njs2Sy1Lnr9TZmLnhif5CYjh1agVJEvjfYpTq1QbTnLS3rBt4yKVjQ6FcV3x22Vm3XBPqodTXz17o1YcHMcvYQbHZfVUyikQ3Nmv6ktZzWe36D6ceKCVBV88VvYkkFhwWUWkA5ErPvsHWQU64VvbtENaJXFUUnuqTFSX4q3ccHuHdmtnhWQ7Mv8Xkb'
'AbtgOVOy/IOH3BOPyZ8/hu1pi0NQqO1mV13HnoWEvRDCpGKO6/8yTfuJmDgQet+S1iFeIos+2EQLJNee0l561AEBAAEDEYu60W1iZPqZxekvWxHW9/B92on2Sa8LAUEGjV1el9d1oyGFaAZ/9w4srgx9KoqiHtPM6Vur7h4D6XVoSgrEhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyVZNp39crMNo5bEpnmL7eM8r98bZA5VoGNHFLu7CvL4BAgIAAQwCAAAAQEIPAAAAAAA='
} satisfies WalletConnectProvider.RequestMethods['solana_signTransaction']['returns'])
case 'solana_signAndSendTransaction':
return Promise.resolve({
Expand All @@ -33,8 +33,8 @@ export function mockUniversalProvider() {
case 'solana_signAllTransactions':
return Promise.resolve({
transactions: [
'4zZMC2ddAFY1YHcA2uFCqbuTHmD1xvB5QLzgNnT3dMb4aQT98md8jVm1YRGUsKJkYkLPYarnkobvESUpjqEUnDmoG76e9cgNJzLuFXBW1i6njs2Sy1Lnr9TZmLnhif5CYjh1agVJEvjfYpTq1QbTnLS3rBt4yKVjQ6FcV3x22Vm3XBPqodTXz17o1YcHMcvYQbHZfVUyikQ3Nmv6ktZzWe36D6ceKCVBV88VvYkkFhwWUWkA5ErPvsHWQU64VvbtENaJXFUUnuqTFSX4q3ccHuHdmtnhWQ7Mv8Xkb',
'4zZMC2ddAFY1YHcA2uFCqbuTHmD1xvB5QLzgNnT3dMb4aQT98md8jVm1YRGUsKJkYkLPYarnkobvESUpjqEUnDmoG76e9cgNJzLuFXBW1i6njs2Sy1Lnr9TZmLnhif5CYjh1agVJEvjfYpTq1QbTnLS3rBt4yKVjQ6FcV3x22Vm3XBPqodTXz17o1YcHMcvYQbHZfVUyikQ3Nmv6ktZzWe36D6ceKCVBV88VvYkkFhwWUWkA5ErPvsHWQU64VvbtENaJXFUUnuqTFSX4q3ccHuHdmtnhWQ7Mv8Xkb'
'AbtgOVOy/IOH3BOPyZ8/hu1pi0NQqO1mV13HnoWEvRDCpGKO6/8yTfuJmDgQet+S1iFeIos+2EQLJNee0l561AEBAAEDEYu60W1iZPqZxekvWxHW9/B92on2Sa8LAUEGjV1el9d1oyGFaAZ/9w4srgx9KoqiHtPM6Vur7h4D6XVoSgrEhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyVZNp39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