npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@autonomys/auto-xdm

v1.6.16

Published

![Autonomys Banner](https://github.com/autonomys/auto-sdk/blob/main/.github/images/autonomys-banner.webp)

Readme

Autonomys Auto XDM SDK

Autonomys Banner

Latest Github release Build status of the main branch on Linux/OSX npm version

Overview

The Autonomys Auto XDM SDK (@autonomys/auto-xdm) provides functionalities for cross-domain transfer of native tokens.

Features

  • Cross-Domain Transfer: Transfer tokens between consensus and domain accounts.
  • EVM Precompile Support: Transfer from EVM domains to consensus using the Transporter Precompile.
  • TypeScript Support: Fully typed for enhanced developer experience.

Installation

Install the package via npm or yarn:

# Using npm
npm install @autonomys/auto-xdm

# Using yarn
yarn add @autonomys/auto-xdm

Getting Started

Prerequisites

  • Node.js (version 14 or higher)
  • TypeScript (optional, but recommended for development)
  • Familiarity with async/await and promise handling in JavaScript/TypeScript.
  • @autonomys/auto-utils package installed (as it provides utility functions and API activation).

Usage Examples

Below are examples demonstrating how to use the functions provided by @autonomys/auto-xdm.

1. Transfer from Consensus to Domain using an EVM address

import { activateWallet } from '@autonomys/auto-utils'
import { transporterTransfer } from '@autonomys/auto-xdm'

const api = await activateWallet({ networkId: 'taurus', uri: '//alice' })
const tx = transporterTransfer(
  api,
  { domainId: 0 }, // Receiver domain (0 is Auto EVM on Taurus Testnet)
  { accountId20: '0x1234567890abcdef1234567890abcdef12345678' }, // Receiver domain account (EVM address)
  '1000000000000000000',
)

2. Transfer from Consensus to Domain using a Substrate address

import { activateWallet } from '@autonomys/auto-utils'
import { transporterTransfer } from '@autonomys/auto-xdm'

const api = await activateWallet({ networkId: 'taurus', uri: '//alice' })
const tx = transporterTransfer(
  api,
  { domainId: 0 }, // Receiver domain (0 is Auto EVM on Taurus Testnet)
  { accountId32: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY' }, // Receiver domain account (Substrate address)
  '1000000000000000000',
)

3. Transfer from Domain to Consensus (Substrate RPC)

import { activateWallet } from '@autonomys/auto-utils'
import { transporterTransfer } from '@autonomys/auto-xdm'

const api = await activateWallet({ networkId: 'taurus', domainId: 0, uri: '//alice' })
const tx = transporterTransfer(
  api,
  'consensus', // Destination is consensus chain
  { accountId32: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY' }, // Receiver consensus account (Substrate address)
  '1000000000000000000',
)

4. Transfer from EVM Domain to Consensus (Precompile)

The Transporter Precompile allows EVM users to transfer funds to the consensus chain without using Substrate RPCs. This is useful for:

  • EVM-native wallets (MetaMask, WalletConnect, etc.)
  • Smart contracts that need to bridge funds
  • Applications that only interact with EVM JSON-RPC

Network Compatibility: The transporter precompile is currently available on Chronos testnet and local dev nodes. Mainnet support is coming soon. Use isPrecompileDeployed() to check availability at runtime.

Note: To use precompile functions, install ethers as a peer dependency:

npm install ethers
# or
yarn add ethers
import { JsonRpcProvider, Wallet } from 'ethers'
import {
  transferToConsensus,
  getMinimumTransferAmount,
  TRANSPORTER_PRECOMPILE_ADDRESS,
} from '@autonomys/auto-xdm'

// Setup provider and wallet (Chronos testnet)
const provider = new JsonRpcProvider('https://auto-evm.chronos.autonomys.xyz/ws')
const wallet = new Wallet(privateKey, provider)

// Check minimum transfer amount
const minAmount = await getMinimumTransferAmount(provider)
console.log(`Minimum transfer: ${minAmount / 10n ** 18n} AI3`)

// Transfer 10 AI3 to a consensus account
const result = await transferToConsensus(
  wallet,
  'sufsKsx4kZ26i7bJXc1TFguysVzjkzsDtE2VDiCEBY2WjyGAj', // Recipient SS58 address
  10n * 10n ** 18n, // 10 AI3 in wei
)

console.log(`Transfer tx: ${result.transactionHash}`)
console.log(`Block: ${result.blockNumber}`)

5. Low-level Precompile Access

For more control, you can create the transaction data manually:

import { Contract } from 'ethers'
import {
  createTransferToConsensusTxData,
  encodeAccountId32ToBytes32,
  getTransporterPrecompileAbi,
  TRANSPORTER_PRECOMPILE_ADDRESS,
} from '@autonomys/auto-xdm'

// Option A: Create raw transaction data
const txData = createTransferToConsensusTxData(
  'sufsKsx4kZ26i7bJXc1TFguysVzjkzsDtE2VDiCEBY2WjyGAj',
  10n * 10n ** 18n,
)

// Use for gas estimation
const gasEstimate = await provider.estimateGas({ ...txData, from: wallet.address })

// Option B: Use ethers Contract directly
const contract = new Contract(TRANSPORTER_PRECOMPILE_ADDRESS, getTransporterPrecompileAbi(), wallet)

const accountId32 = encodeAccountId32ToBytes32('sufsKsx4kZ26i7bJXc1TFguysVzjkzsDtE2VDiCEBY2WjyGAj')
const tx = await contract.transfer_to_consensus_v1(accountId32, 10n * 10n ** 18n)
await tx.wait()