solana_kit_options 0.3.1 copy "solana_kit_options: ^0.3.1" to clipboard
solana_kit_options: ^0.3.1 copied to clipboard

Rust-like Option type codec for the Solana Kit Dart SDK.

example/main.dart

// Examples intentionally print CLI output for demonstration purposes.
// ignore_for_file: avoid_print
import 'package:solana_kit_options/solana_kit_options.dart';

void main() {
  final maybeFeePayer = some('FEE_PAYER_ADDRESS');
  final noMemo = none<String>();

  final feePayerText = switch (maybeFeePayer) {
    Some<String>(:final value) => 'fee payer: $value',
    None<String>() => 'no fee payer set',
  };

  final memoText = switch (noMemo) {
    Some<String>(:final value) => 'memo: $value',
    None<String>() => 'memo not provided',
  };

  print(feePayerText);
  print(memoText);
}
0
likes
160
points
230
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Rust-like Option type codec for the Solana Kit Dart SDK.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

meta, solana_kit_codecs_core, solana_kit_codecs_numbers, solana_kit_errors

More

Packages that depend on solana_kit_options