
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
A powerful, flexible SDK for seamlessly working with blockchain state through a unified message-centric architecture.
Blaze SDK provides a robust solution for managing blockchain state with an intelligent multi-layer caching system. It's designed around a message-centric query/mutate architecture that handles both reading and writing through a unified interface, allowing developers to:
npm install blaze-sdk
# or
yarn add blaze-sdk
# or
pnpm add blaze-sdk
import { Blaze } from 'blaze-sdk';
// Create a simple client with blockchain access
const client = new Blaze({
apiKey: 'your-api-key',
network: 'mainnet'
});
// Read a token balance
const balance = await client.call(
'SP2ZNGJ85ENDY6QRHQ5P2D4FXKGZWCKTB2T0Z55KS.charisma-contract',
'get-balance',
['SP2ZNGJ85ENDY6QRHQ5P2D4FXKGZWCKTB2T0Z55KS']
);
console.log(`Balance: ${balance}`);
// Create a client with write capabilities
const client = new Blaze({
privateKey: 'your-private-key',
apiKey: 'your-api-key'
});
// Execute a token transfer
const result = await client.execute(
'SP2ZNGJ85ENDY6QRHQ5P2D4FXKGZWCKTB2T0Z55KS.token-contract',
'transfer',
[
'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE', // recipient
1000, // amount
'Payment for services' // memo
]
);
console.log(`Transaction ID: ${result.txId}`);
The SDK follows a clear query/mutate pattern with a layered architecture:
┌──────────────┐ ┌──────────────┐ ┌───────────────┐
│ Blaze Client │──│ Processor │──│ Service Chain │
└──────────────┘ └──────────────┘ └───────────────┘
│
│
┌──────────────┐
│ Memory Cache │
└──────────────┘
The SDK organizes all operations into two types:
This pattern provides clear intent separation and optimizes each operation type independently.
Connect to an L2 service for faster responses with blockchain fallback:
// Using a URL endpoint for L2
const client = new Blaze({
apiKey: 'your-api-key',
privateKey: 'your-private-key', // optional
l2: {
url: 'https://l2.example.com/api',
options: {
headers: {
'Authorization': 'Bearer token123'
}
}
}
});
Create your own service implementation:
import { createService, Blaze } from 'blaze-sdk';
// Create a custom service
const myService = createService({
name: 'my-custom-service',
queryFn: async (intent) => {
// Custom query logic
console.log(`Querying ${intent.contract}.${intent.function}`);
return myCustomDataSource.get(intent.contract, intent.function, intent.args);
},
mutateFn: async (intent) => {
// Custom mutation logic
console.log(`Mutating ${intent.contract}.${intent.function}`);
const result = await myCustomDataSource.set(
intent.contract,
intent.function,
intent.args
);
return { txId: result.transactionId };
},
debug: true
});
// Use the custom service
const client = new Blaze({
services: [myService],
privateKey: 'your-private-key' // optional
});
For common use cases, convenience functions are provided:
import { createReadOnlyClient, createL2Client, createClientWithService } from 'blaze-sdk';
// Read-only client
const readOnly = createReadOnlyClient({
apiKey: 'your-api-key',
network: 'mainnet'
});
// L2 client with blockchain fallback
const l2Client = createL2Client({
l2Url: 'https://l2.example.com/api',
apiKey: 'your-api-key',
privateKey: 'your-private-key' // optional
});
// Client with a custom service
const customClient = createClientWithService({
service: myService,
apiKey: 'your-api-key',
fallbackToBlockchain: true
});
Control caching behavior for optimal performance:
// Configure caching
const client = new Blaze({
apiKey: 'your-api-key',
cacheTTL: 60 * 1000, // 1 minute cache
maxCacheEntries: 500 // limit cache size
});
// Manually invalidate cache entries
client.invalidate(
'SP2ZNGJ85ENDY6QRHQ5P2D4FXKGZWCKTB2T0Z55KS.token-contract',
'get-balance',
['SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE']
);
// Clear entire cache
client.clearCache();
// Get cache statistics
const stats = client.getCacheStats();
console.log(`Cache size: ${stats.size} entries`);
For advanced use cases, create intents directly:
// Create a query intent
const queryIntent = client.createQueryIntent(
'SP2ZNGJ85ENDY6QRHQ5P2D4FXKGZWCKTB2T0Z55KS.token-contract',
'get-balance',
['SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE']
);
// Execute the query intent
const queryResult = await client.query(queryIntent);
// Create a mutate intent
const mutateIntent = await client.createMutateIntent(
'SP2ZNGJ85ENDY6QRHQ5P2D4FXKGZWCKTB2T0Z55KS.token-contract',
'transfer',
['SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE', 1000, 'memo'],
{
postConditions: [
// Add post conditions here
]
}
);
// Execute the mutate intent
const mutateResult = await client.mutate(mutateIntent);
The SDK dramatically improves app performance:
For more detailed information, refer to the following documentation:
Contributions are welcome! See CONTRIBUTING.md for details.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
the fast stacks client
The npm package blaze-sdk receives a total of 6 weekly downloads. As such, blaze-sdk popularity was classified as not popular.
We found that blaze-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.