Skip to content

Commit

Permalink
Added signAndSendTransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
mmjee committed Nov 3, 2023
1 parent ccbbb25 commit fcf2f80
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class ArcanaSolanaAPI {
message: string | Uint8Array | Buffer
display: string
}
if (Buffer.isBuffer(p.message) || p.message instanceof Uint8Array) {
if (p.message instanceof Uint8Array) {
p.message = this.bs58Module.encode(p.message)
}
}
Expand Down Expand Up @@ -90,4 +90,16 @@ export class ArcanaSolanaAPI {
})
return r as Promise<Web3Module.VersionedTransaction>
}

signAndSendTransaction(
tx: Web3Module.VersionedTransaction | Web3Module.Transaction
): Promise<{ signature: string; publicKey: string }> {
const r = this.request({
method: 'signAndSendTransaction',
params: {
message: this.bs58Module.encode(tx.serialize()),
},
})
return r as Promise<{ signature: string; publicKey: string }>
}
}

0 comments on commit fcf2f80

Please sign in to comment.