Crate xrpl_wasm_stdlib

Crate xrpl_wasm_stdlib 

Source
Expand description

§xrpl-wasm-stdlib Library

The XRPL Standard Library provides safe, type-safe access to XRPL host functions for WebAssembly smart contract development. This no_std library offers zero-cost abstractions over raw host function calls and handles memory management, error handling, and type conversions.

§Quick Start

There is an interface available at https://ripple.github.io/xrpl-wasm-stdlib/ui/ for local or Devnet testing.

§Examples Overview

  • hello_world - Basic escrow with logging
  • oracle - Price-based release using oracle data
  • kyc - Credential-based verification
  • notary - Multi-signature authorization
  • nft_owner - NFT ownership verification
  • ledger_sqn - Sequence-based release

§Documentation

SectionDescription
Complete Developer GuideComprehensive guide with working internal links
Rust API DocsGenerated API documentation (cargo doc)

The complete developer guide includes:

  • Getting Started - Installation, first contract, core concepts
  • API Reference - Complete API documentation and usage patterns
  • Examples - Smart escrow examples and tutorials
  • Development Guide - Building, testing, and CI setup

§Key Features

  • Type-safe access to transaction and ledger data
  • Memory-safe operations with no heap allocations
  • Deterministic execution across all nodes/validators
  • Zero-cost abstractions over host functions
  • Comprehensive error handling with custom Result types

§Safety and Constraints

Smart escrows run in a constrained WebAssembly environment:

  • Read-only ledger access (except escrow data updates)
  • Deterministic execution required
  • Resource limits enforced
  • No network/file system access

§Contributing

See CONTRIBUTING.md for detailed guidelines on:

  • Development setup and workflow
  • Code standards and style guidelines
  • Pull request process
  • Testing requirements
  • Release procedures

We welcome contributions of all kinds!

Modules§

core
Core modules for XRPL transaction and ledger access.
guide
Complete Developer Guide
host
Host bindings and utilities exposed to WASM smart contracts.
sfield
types

Macros§

assert
Asserts that a condition is true.
assert_eq
Asserts that two expressions are equal.
assert_ne
Asserts that two expressions are not equal.
r_address

Functions§

decode_hex_20
Decode a 40-hex-character string into a 20-byte array.
decode_hex_32
Decode a 64-hex-character string into a 32-byte array.