Socket
Book a DemoInstallSign in
Socket

@xpla/contracts

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xpla/contracts

XPLA precompiled contract interfaces and types

latest
Source
npmnpm
Version
1.8.1
Version published
Maintainers
4
Created
Source

@xplajs/contracts

XPLA precompiled contract interfaces and types for Solidity projects.

Installation

For Foundry/Forge Projects

forge install xpladev/xplajs

After installation, create or add to your project's remappings.txt file:

@xpla/contracts/=lib/xplajs/contracts/

Note: You need to create this file in your Forge project root directory, not in this package.

For Hardhat/Truffle Projects

npm install @xpla/contracts
# or
yarn add @xpla/contracts

Usage

Import in Solidity

import "@xpla/contracts/interfaces/IAuth.sol";
import "@xpla/contracts/common/Types.sol";

Example

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// Import precompiled contract interfaces
import "@xpla/contracts/interfaces/IAuth.sol";
import "@xpla/contracts/interfaces/IBank.sol";

contract MyContract {
    // Use the imported interfaces
    IAuth public auth;
    IBank public bank;
    
    constructor() {
        // Initialize with precompiled contract addresses using constants from interfaces
        auth = IAuth(IAuth.AUTH_PRECOMPILE_ADDRESS);
        bank = IBank(IBank.BANK_PRECOMPILE_ADDRESS);
    }
    
    function getAccountInfo(address user) external view returns (string memory) {
        return auth.account(user);
    }
    
    function getBalance(address user) external view returns (uint256) {
        return bank.balanceOf(user);
    }
}

Available Contracts

Core Interfaces

  • IAuth - Authentication and account management
  • IBank - Banking and token operations
  • IWasm - CosmWasm contract support
  • StakingI - Staking operations
  • DistributionI - Distribution and rewards
  • IGov - Governance operations
  • ISlashing - Slashing operations

Utilities

  • Bech32I - Bech32 address encoding/decoding

Type Definitions

The package includes common type definitions used across contracts:

  • common/Types.sol - Shared types used across contracts
  • util/Types.sol - Utility-specific types

License

MIT

Keywords

xpla

FAQs

Package last updated on 12 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts