Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

@burnt-labs/xion-types

What is xion-types?

The xion-types repository is a type definition package that acts as a bridge between different programming languages and the Xion blockchain. Think of it as a "translator" that helps developers work with Xion blockchain data in their preferred programming language.

The Core Problem It Solves

Blockchains like Xion use a data format called Protocol Buffers (Protobuf) to define their data structures. However, most developers don't write code directly in Protobuf - they use languages like TypeScript, Swift, or Kotlin.

Without xion-types, developers would have to:

  • Manually write type definitions for every blockchain data structure
  • Risk making errors when handling blockchain data
  • Spend time figuring out what fields exist and what types they should be

What It Provides

The repository generates type-safe definitions for multiple programming languages:

  • TypeScript/JavaScript - For web apps and Node.js projects
  • Swift - For iOS/macOS apps
  • Kotlin - For Android apps

These type definitions ensure that when developers work with Xion blockchain data (like transactions, account information, or smart contract calls), they get:

  • Autocomplete in their code editor
  • Error checking if they try to use wrong data types
  • Documentation of what fields are available

Benefits

  1. Reduced Development Time - No need to manually write type definitions
  2. Fewer Bugs - Type safety catches errors at compile time
  3. Better Developer Experience - Autocomplete and IntelliSense support
  4. Consistency - Same types across different languages and projects
  5. Maintainability - Types automatically update when the blockchain protocol changes

Table of Contents


Installation

Install the @burnt-labs/xion-types package via npm or yarn:

# Using npm
npm install @burnt-labs/xion-types

# Using yarn
yarn add @burnt-labs/xion-types

Usage

Once installed, you can import the type definitions in your TypeScript project. The types are generated from the Protobuf files used in the Xion project.

import { MyProtobufType } from '@burnt-labs/xion-types/types/filename';

const myData: MyProtobufType = {
  field1: 'value',
  field2: 42
};

Note: Replace filename with the appropriate file name where the type is defined.


Example

Here is a full example of how you might use the @burnt-labs/xion-types package in a TypeScript project:

import { MyProtobufType } from '@burnt-labs/xion-types/types/filename';

function processData(data: MyProtobufType): void {
  console.log(`Field 1: ${data.field1}`);
  console.log(`Field 2: ${data.field2}`);
}

const sampleData: MyProtobufType = {
  field1: 'Hello, Xion!',
  field2: 100
};

processData(sampleData);

This simple example illustrates how you can work with the types generated from Xion's Protobuf definitions.


Development

If you want to modify or regenerate the TypeScript definitions from Protobuf files, follow these steps:

  1. Initialize and Update Submodules

    # Initialize and update all submodules
    make submodules
    
    # Alternatively, you can run these commands manually:
    git submodule init
    git submodule update --init
    
  2. Build Docker Image

    # Build the Swift protobuf builder image
    make build-swiftbuilder-image
    
    # Alternatively, you can run these commands manually:
    cd docker && docker build . --tag swiftbuilder
    
    # You can verify the image was built successfully with:
    docker images | grep swiftbuilder
    
  3. Install Dependencies

    npm install
    
  4. Generate TypeScript Definitions

    npx protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \
      --ts_out=./generated \
      --proto_path=./proto \
      $(find ./proto -name '*.proto')
    
  5. Compile TypeScript Files

    tsc --noEmit
    

These steps will generate the TypeScript definitions from the Protobuf files located in the proto directory.


License

This project is licensed under the MIT License. See the LICENSE file for details.


For more information, check out Xion's GitHub repository.

Metadata

Release files for xion-types 0.0.0.dev1765984010

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xion-types 0.0.0.dev1765984010
File Size Uploaded Provenance Actions
xion_types-0.0.0.dev1765984010.tar.gz 188.9 kB Without provenance Details for xion_types-0.0.0.dev1765984010.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xion-types 0.0.0.dev1765984010
File Interpreter ABI Platform Actions
xion_types-0.0.0.dev1765984010-py3-none-any.whl Python 3 none any Details for xion_types-0.0.0.dev1765984010-py3-none-any.whl

Total release size: 622.6 kB

Release files / xion_types-0.0.0.dev1765984010.tar.gz

Download URL xion_types-0.0.0.dev1765984010.tar.gz
Size 188.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2d7b0f0517225ae2cba6668da8c037b9d3147eba80639aafe999e0073088c7d6
BLAKE2b-256 checksum
How to use checksums
7a1750fe797b4955cdf3643acf9ddcda3ed63e7ab27cb8d0688bd5660e081626
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / xion_types-0.0.0.dev1765984010-py3-none-any.whl

Download URL xion_types-0.0.0.dev1765984010-py3-none-any.whl
Size 433.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3707cc4a7ec82be9b78502533542ff16f746ff4bdee232d8e5b4bf255332e2bd
BLAKE2b-256 checksum
How to use checksums
6c5fe160711b6ac30e17fbb39027634452ff56b946c2438e0a3a84370f2ee195
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for xion-types 0.0.0.dev1765984010

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page