
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@forbole/kastle-sdk
Advanced tools
A JavaScript library for integrating Kaspa cryptocurrency wallet functionality into web applications.
A JavaScript library for integrating Kaspa cryptocurrency wallet functionality into web applications.
npm install @forbole/kastle-sdk
import {
connect,
getWalletAddress,
getBalance,
sendKaspa
} from '@forbole/kastle-sdk';
// Connect to the wallet
const isConnected = await connect();
if (isConnected) {
// Get the wallet address
const address = await getWalletAddress();
console.log(`Connected to address: ${address}`);
// Get the wallet balance
const balance = await getBalance();
console.log(`Balance: ${balance} sompi`);
// Send KAS to another address
const txId = await sendKaspa('kaspa:recipient_address', 1000000);
console.log(`Transaction sent with ID: ${txId}`);
}
isWalletInstalled()
Checks if a compatible Kaspa wallet provider is installed.
boolean
connect(networkId?)
Connects to the wallet on the specified network.
networkId
(optional): The network to connect to (default: 'mainnet')Promise<boolean>
- True if connection was successfuldisconnect(origin?)
Disconnects the wallet.
origin
(optional): Origin parameterPromise<void>
getNetwork()
Returns the active Kaspa network.
Promise<NetworkId>
('mainnet' or 'testnet')switchNetwork(networkId)
Switches to a different Kaspa network.
networkId
: The network to switch toPromise<boolean>
- True if successfulgetWalletAddress()
Returns the currently connected wallet address.
Promise<string>
getPublicKey()
Retrieves the public key associated with the wallet.
Promise<string>
getBalance()
Fetches the current balance of the wallet in sompi.
Promise<number>
getUtxoAddress(p2shAddress?)
Retrieves unspent UTXOs for the wallet.
p2shAddress
(optional): Optional p2sh addressPromise<any[]>
sendKaspa(toAddress, amountSompi, options?)
Sends Kaspa (KAS) to another address.
toAddress
: Recipient addressamountSompi
: Amount to send in sompioptions
(optional): Additional options like priorityFee
Promise<string>
- Transaction IDsetEventListeners(eventListeners)
Registers event listeners for account/network/balance changes.
eventListeners
: Event listener functionremoveEventListeners()
Removes all event listeners.
void
The following features are currently under development and not yet fully implemented:
signPskt(txJsonString, submit?, protocol?, protocolAction?, priorityFee?)
Signs a PSKT transaction for KRC20/KRC721 transfers.
doCommitReveal(actionScript, options?)
Commits and reveals a transaction, used for minting/listing KRC assets.
doRevealOnly(options)
Performs only the reveal phase of a commit-reveal operation.
signMessage(msg, type?)
Signs a message using the wallet's private key and returns the signature.
compoundUtxo()
Compounds wallet UTXOs.
MIT
FAQs
A JavaScript library for integrating Kaspa cryptocurrency wallet functionality into web applications.
We found that @forbole/kastle-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.