Crate ckb_ssri_sdk

Crate ckb_ssri_sdk 

Source
Expand description

§CKB SSRI SDK

A comprehensive framework for implementing SSRI-compliant smart contracts on the Nervos CKB blockchain.

§Overview

The SSRI (Standard Smart Contract Runtime Interface) SDK provides a standardized way to develop smart contracts that are compliant with the SSRI protocol. This enables better interoperability and a more consistent development experience across the CKB ecosystem.

§Features

  • Public Traits: Pre-defined interfaces that receive first-class support within the ecosystem
  • Utility Functions: Helper functions for SSRI-VM syscalls and data handling
  • Procedural Macros: Simplify contract development with automatic SSRI method generation
  • No Standard Library: Designed for the constrained smart contract environment

§Usage

Add this to your Cargo.toml:

[dependencies]
ckb_ssri_sdk = "0.1.0"

§Example

use ckb_ssri_sdk::prelude::*;
use ckb_ssri_sdk::public_module_traits::udt::UDT;
 
// Implement a basic UDT (User-Defined Token)
#[derive(Default)]
struct MyToken;
 
impl UDT for MyToken {
    type Error = ();
    // ... implement required methods
}

Re-exports§

pub use macros::*;

Modules§

macros
Re-exports of procedural macros from ckb_ssri_sdk_proc_macro
prelude
public_module_traits
utils

Enums§

SSRIError
Represents possible errors that can occur during SSRI method execution