feat: add sendRawTransaction()
This commit is contained in:
parent
aee383eaec
commit
ac4bfaad32
|
@ -69,6 +69,9 @@ declare module '@solana/web3.js' {
|
|||
transaction: Transaction,
|
||||
...signers: Array<Account>
|
||||
): Promise<TransactionSignature>;
|
||||
sendRawTransaction(
|
||||
wireTransaction: Buffer,
|
||||
): Promise<TransactionSignature>;
|
||||
onAccountChange(
|
||||
publickey: PublicKey,
|
||||
callback: AccountChangeCallback,
|
||||
|
|
|
@ -421,6 +421,16 @@ export class Connection {
|
|||
}
|
||||
|
||||
const wireTransaction = transaction.serialize();
|
||||
return await this.sendRawTransaction(wireTransaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a transaction that has already been signed and serialized into the
|
||||
* wire format
|
||||
*/
|
||||
async sendRawTransaction(
|
||||
wireTransaction: Buffer,
|
||||
): Promise<TransactionSignature> {
|
||||
const unsafeRes = await this._rpcRequest('sendTransaction', [
|
||||
[...wireTransaction],
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue