solana_kit_rpc_subscriptions_api 0.9.3
solana_kit_rpc_subscriptions_api: ^0.9.3 copied to clipboard
Subscription method definitions for the Solana Kit Dart SDK.
solana_kit_rpc_subscriptions_api #
Subscription method type definitions and parameter builders for all Solana RPC subscription methods in the Solana Kit Dart SDK.
This package defines the request and response shapes for slotSubscribe, accountSubscribe, signatureSubscribe, logsSubscribe, programSubscribe, and the rest. solana_kit_rpc_subscriptions composes these into the streaming client you call directly.
Installation #
Install the package directly:
dependencies:
"solana_kit_rpc_subscriptions_api": ^0.9.3
If your app uses several Solana Kit packages together, you can also depend on the umbrella package instead:
dart pub add solana_kit
Inside this monorepo, Dart workspace resolution uses the local package automatically.
Documentation #
- Package page: https://pub.dev/packages/solana_kit_rpc_subscriptions_api
- API reference: https://pub.dev/documentation/solana_kit_rpc_subscriptions_api/latest/
- Workspace docs: https://openbudgetfun.github.io/solana_kit/
- Package catalog entry: https://openbudgetfun.github.io/solana_kit/reference/package-catalog#solana_kit_rpc_subscriptions_api
- Source code: https://github.com/openbudgetfun/solana_kit/tree/main/packages/solana_kit_rpc_subscriptions_api
For architecture notes, getting-started guides, and cross-package examples, start with the workspace docs site and then drill down into the package README and API reference.
Usage #
Building subscription parameters #
Each subscription method has a params builder. slotNotificationsParams takes no arguments; account, signature, logs, and program subscriptions take a target plus an optional config.
import 'package:solana_kit_addresses/solana_kit_addresses.dart';
import 'package:solana_kit_rpc_subscriptions_api/solana_kit_rpc_subscriptions_api.dart';
import 'package:solana_kit_rpc_types/solana_kit_rpc_types.dart';
void main() {
final slotParams = slotNotificationsParams();
print(slotParams); // []
const target = Address('11111111111111111111111111111111');
final accountParams = accountNotificationsParams(
target,
const AccountNotificationsConfig(commitment: Commitment.confirmed),
);
print(accountParams);
}
Key APIs #
- Params builders:
slotNotificationsParams,accountNotificationsParams,signatureNotificationsParams,logsNotificationsParams,programNotificationsParams, and the rest. - Config classes:
AccountNotificationsConfig,SignatureNotificationsConfig,LogsNotificationsConfig,ProgramNotificationsConfig. - Notification types for each subscription.
Example #
Use example/main.dart as a runnable starting point for solana_kit_rpc_subscriptions_api.
- Import path:
package:solana_kit_rpc_subscriptions_api/solana_kit_rpc_subscriptions_api.dart - This section is centrally maintained with
mdtto keep package guidance aligned. - After updating shared docs templates, run
docs:updatefrom the repo root.
Maintenance #
- Validate docs in CI and locally with
docs:check. - Keep examples focused on one workflow and reference package README sections for deeper API details.