
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@solflare-wallet/solcast-sdk
Advanced tools
Solcast is notification service built for Solana.
One of the main functions of Solcast is to observe Solana blockchain. Each new block and transactions in it are parsed in search of transactions linked with Public Keys Solcast is tracking.
When transaction with tracked Public Key is found events are generated for that Public Key and sent to Consumers that are interested in events from said Public Key.
Type of events are:
npm i @solflare-wallet/solcast-sdk
Simple usage:
const {Solcast} = require('@solflare-wallet/solcast-sdk')
const {PublicKey} = require('@solana/web3.js')
async function main() {
const solcast = new Solcast(process.env.SOLCAST_API_KEY)
console.log(await solcast.webhooks.all())
try {
const webhook = await solcast.webhooks.create("http://localhost/webhook/events", [
new PublicKey("ABcD...0NPL"),
]);
console.log(await solcast.webhooks.get(webhook.id))
console.log(await solcast.webhooks.update(webhook.id, [
new PublicKey("LniM...C2BB"),
], []))
console.log(await solcast.webhooks.all())
console.log(await solcast.webhooks.remove(webhook.id))
console.log(await solcast.webhooks.all())
} catch (error) {
console.log(error.message)
}
}
main()
Solcast Consumer accounts with Webhook API enabled can create and manage webhooks.
Each webhook has set of Public Keys that will be tracked and events about them sent to webhook's URL.
Solcast sends events in buckets of data in intervals of 5-10 seconds, if no events are available in a bucket, it will not be sent to the Webhook.
Each bucket is sent over POST HTTP request, and includes hash
field which is there to prevent both replay attacks and unverified payloads. We encourage Consumers to check always validity of hash
field.
const secret = 'cdda0...589e0e6'
const hashString = secret + '.' + JSON.stringify(bucket.data)
const hash = crypto
.createHash('sha256')
.update(hashString)
.digest('hex')
{
"id": "ec2916a8ede53a061a46dab32a4bf58958eb54cb",
"version": "1.0.0",
"data": [
{
"signature": "inboundSolSignature",
"tokenAddress": null,
"nft": null,
"token": null,
"decimals": 9,
"publicKey": "AC7YHa5qAm1EwLPG6Qn2reRPCzYEyUPZchQkAyRMYysf",
"balance": "1",
"change": "330000000",
"type": "sol"
},
{
"signature": "outboundSLRSSignature",
"tokenAddress": "SLRSSpSLUTP7okbCUBYStWCo1vUgyt775faPqz8HUMr",
"decimals": 6,
"nft": null,
"token": {
"mint": "SLRSSpSLUTP7okbCUBYStWCo1vUgyt775faPqz8HUMr",
"symbol": "SLRS",
"name": "Solrise Finance",
"logoURI": "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/SLRSSpSLUTP7okbCUBYStWCo1vUgyt775faPqz8HUMr/logo.png"
},
"publicKey": "AC7YHa5qAm1EwLPG6Qn2reRPCzYEyUPZchQkAyRMYysf",
"balance": "2000000",
"change": "-999000",
"type": "spl"
}
],
"hash": "4f75feb60edbad9f93b33e847b6974b8687b480c6192816c96c6722cfd91ae1f"
}
Example webhook secret: cdda02f9a8dee5826db3578fb00d7e56c72b4e4e6347d26989657a9e0b68a66c4890dd4bfd865f44b710edd118f2a3fe3915bd49c97e52acc4f02d017589e0e6
FAQs
Solcast is notification service built for Solana.
The npm package @solflare-wallet/solcast-sdk receives a total of 1 weekly downloads. As such, @solflare-wallet/solcast-sdk popularity was classified as not popular.
We found that @solflare-wallet/solcast-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.