
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@notifi-network/fusion-sdk
Advanced tools
SDK utils for Notifi Fusion parser development. This includes types and helpers for accessing ephemeral/persistent storage, RPCs for different chains, and other utilities.
Fusion SDK provides TypeScript/JavaScript wrappers and types for interacting with Notifi Fusion blockchain services, including EVM, Sui, Solana, storage management, and subscriptions.
npm install fusion-sdk
import {
EvmRpc,
SuiRpc,
SolanaRpc,
PersistentStorage,
EphemeralStorage,
Subscriptions,
BlockchainType,
HttpMethod,
Region,
getParserBlobInput
} from "fusion-sdk";
const evm = new EvmRpc("your-context-id");
const sui = new SuiRpc("your-context-id");
const solana = new SolanaRpc("your-context-id");
const persistentStorage = new PersistentStorage("your-context-id");
const ephemeralStorage = new EphemeralStorage("your-context-id");
const subscriptions = new Subscriptions("your-context-id");
EVM-specific blockchain operations.
Methods:
runEthCall(request): Executes an Ethereum call operation.getAccountBalance(request): Retrieves the account balance for an Ethereum address.const evm = new EvmRpc("your-context-id");
const balance = await evm.getAccountBalance({ address: "0x..." });
Sui blockchain operations.
Methods:
getSuiAccountBalance(request): Retrieves the account balance for a Sui address.runSuiTransaction(request): Executes a Sui transaction.getSuiObject(request): Retrieves a Sui object.const sui = new SuiRpc("your-context-id");
const balance = await sui.getSuiAccountBalance({ address: "0x..." });
Solana blockchain operations.
Methods:
getSolanaBalance(request): Retrieves the balance for a Solana address.getSolanaAccountInfo(request): Retrieves account information for a Solana address.getSolanaSlot(request): Retrieves the current Solana slot.const solana = new SolanaRpc("your-context-id");
const balance = await solana.getSolanaBalance({ address: "..." });
CRUD operations for persistent storage.
Methods:
put(request): Stores a string value in persistent storage.get(request): Retrieves a value from persistent storage.delete(request): Deletes a value from persistent storage.const persistentStorage = new PersistentStorage("your-context-id");
await persistentStorage.put({ key: "foo", value: "bar" });
const value = await persistentStorage.get({ key: "foo" });
Optimistic Concurrency Example: Fetch a value, increment its version, update, and retry on exception (optimistic locking with 100ms jitter):
function sleep(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function updateWithOptimisticLock(key: string, newValue: string, maxRetries = 3) {
let attempt = 0;
while (attempt < maxRetries) {
try {
// Fetch current value and version
const current = await persistentStorage.get({ key });
const currentVersion = current.version ?? 0;
// Attempt to update with incremented version
await persistentStorage.put({ key, value: newValue, version: currentVersion + 1 });
return true;
} catch (err) {
attempt++;
if (attempt >= maxRetries) throw err;
// Add 100ms jitter before retrying
await sleep(100 + Math.floor(Math.random() * 100));
}
}
return false;
}
// Usage
await updateWithOptimisticLock("foo", "newBar");
This pattern helps ensure updates are atomic and consistent, retrying if another process updates the value concurrently.
Operations for ephemeral storage.
Methods:
put(request): Stores a string value in ephemeral storage.get(request): Retrieves a value from ephemeral storage.delete(request): Deletes a value from ephemeral storage.peek(request): Peeks at the next value in a queue in ephemeral storage.enqueue(request): Enqueues a value into a queue in ephemeral storage.dequeue(request): Dequeues a value from a queue in ephemeral storage.getModuleExecutionParams(request): Retrieves module execution parameters.getOnChainBlock(request): Retrieves an on-chain block.const ephemeralStorage = new EphemeralStorage("your-context-id");
await ephemeralStorage.put({ key: "temp", value: "baz" });
const value = await ephemeralStorage.get({ key: "temp" });
Manage and retrieve subscription data.
Methods:
getSubscriptions(request): Retrieves subscription data.const subscriptions = new Subscriptions("your-context-id");
const subs = await subscriptions.getSubscriptions({ eventTypeId: "event-type-id" });
All wrappers require a contextId string for gRPC requests. This is provided as an argument in the parse function in the Fusion system.
BlockchainType: Enum for supported blockchains (EVM, Solana, Sui, etc.)getParserBlobInput(contextId: string, urlForBlob: string): Fetches and parses block data from storage. The response can be typed as:
EvmBlockAndLogs for EVM chainsSolanaBlockAndLogs for SolanaSuiCheckpointTransactions for Sui
This allows you to safely cast and work with chain-specific block data structures in your application. Not applicable to OffChain parsers.EVM_RPC_ADDRESS: EVM gRPC endpoint (default: localhost:50054)SUI_RPC_ADDRESS: Sui gRPC endpoint (default: localhost:50057)SOLANA_RPC_ADDRESS: Solana gRPC endpoint (default: localhost:50055)PERSISTENT_STORAGE_ADDRESS: Persistent storage gRPC endpoint (default: localhost:50053)EPHEMERAL_STORAGE_ADDRESS: Ephemeral storage gRPC endpoint (default: localhost:50052)SUBSCRIPTION_MANAGER_ADDRESS: Subscriptions gRPC endpoint (default: localhost:50056)GRPC_INSECURE: Set to "true" for insecure local connectionsTo publish to npm:
npm publish
Ensure your documentation and API are up to date before publishing.
See LICENSE.
FAQs
SDK utils for Notifi Fusion parser development. This includes types and helpers for accessing ephemeral/persistent storage, RPCs for different chains, and other utilities.
The npm package @notifi-network/fusion-sdk receives a total of 40 weekly downloads. As such, @notifi-network/fusion-sdk popularity was classified as not popular.
We found that @notifi-network/fusion-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.