Skip to content

Commit

Permalink
Merge pull request #15 from getsafle/feature-broadcast-transaction
Browse files Browse the repository at this point in the history
Feature broadcast transaction
  • Loading branch information
sshubhamagg authored Jul 25, 2024
2 parents f962b0a + d9a0408 commit 265d085
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
- Added initial test
- Added functionality to sign message
- Added get balance method to fetch SOL balance of an account
- Added functionality to sign SOL and fungible tokens transfer transaction
- Added functionality to sign SOL and fungible tokens transfer transaction
- Added functionality to broadcast a signed transaction
16 changes: 16 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,22 @@ class KeyringController {
}
}

async sendTransaction(rawTransaction) {

try {
const { network } = this.store.getState()
const stringBuff = Buffer.from(rawTransaction, 'hex')

const connection = new solanaWeb3.Connection(network, "confirmed")
const transactionDetails = await connection.sendRawTransaction(stringBuff)
return { transactionDetails: transactionDetails }

} catch (err) {
console.log(err);
throw err
}
}

persistAllAddress(_address) {
const { address } = this.store.getState();
let newAdd = address;
Expand Down

0 comments on commit 265d085

Please sign in to comment.