Bagpipes Documentation

website·Indexed 32 days ago

https://docs.bagpipes.io

Documentation for Bagpipes and XCMSend, a tool for managing cross-chain asset transfers and workflows. It provides support for XCM asset transfers across Polkadot, Kusama, Moonbeam, Moonriver, HydraDx, and Interlay, including teleporting assets and interacting with ink smart contracts. The platform includes Threadbag for persistent execution, a set of nodes for chain queries and transactions, and deployment guides for Docker and Debian Linux.

Tokens
16.4K
Snippets
107
Records
182
Agent score
58%

What's inside Bagpipes

  1. Overview of Bagpipes SDK core features

    The Bagpipes SDK provides two primary modules for building decentralized applications (DApps) on Polkadot and other compatible chains:

    • Wallet: Handles wallet extension integration and transaction signing.
    • Chains: Manages interactions with blockchain networks.
  2. Use Action Nodes for cross-chain operations

    Action Nodes are used between two chains to execute blockchain transactions (also known as extrinsics) that are signed by a user and submitted on-chain. There are two primary types of actions available: xTransfer and Swap.
  3. Use Smoldot Light Client in Bagpipes

    Bagpipes integrates the Smoldot light client and the new Polkadot API (PAPI). This integration allows the browser to run a light client locally, removing the dependency on centralized RPC providers. All queries previously made via the ChainQuery node are now enabled to use Smoldot.
  4. Use the Http Node to make HTTP(s) requests

    The Http Node allows you to perform HTTP(s) requests to any internet endpoint. The response data or event data returned from the request can be captured and used as input for subsequent steps in your workflow.
  5. Understand Bagpipes workflow components

    Bagpipes uses a visual workflow system composed of the following elements:

    • Nodes: Objects dragged onto the canvas that perform specific operations.
    • Edges: The connections between nodes that define the flow of the workflow.
    • Scenario: A complete workflow consisting of nodes and edges. Each scenario is identified by a unique scenario_id and is saved in the Lab.
    • Executions: A single run-through of a scenario. This can be a full run or a single node execution. Executions are stored in the Lab for review.
  6. Retrieve scenario information

    Use the /api/scenario/info endpoint to get basic information about a specific scenario using its ID.
    curl -X POST -H "Content-Type: application/json" -d '{"id": "Uvervffcw"}' http://localhost:8080/api/scenario/info
  7. Access wallet state and methods via WalletContext

    Use WalletContext with React's useContext hook to access the current wallet state and control connection methods.

    Available properties and methods:

    • wallet: Information about the connected wallet.
    • accounts: Array of connected accounts.
    • connectWallet(): Method to initiate wallet connection.
    • disconnectWallet(): Method to disconnect the current wallet.
    • evmWallet: Information about connected EVM wallets.
    • walletType: The type of the connected wallet.
    import { useContext } from 'react';
    import { WalletContext } from '@bagpipes/wallet';
    
    function AccountInfo() {
      const { wallet, accounts, disconnectWallet } = useContext(WalletContext);
    
      if (!wallet) {
        return <p>No wallet connected</p>;
      }
    
      return (
        <div>
          <h2>Connected Wallet: {wallet.title}</h2>
          <h3>Accounts:</h3>
          {accounts.map((account) => (
            <p key={account.address}>{account.address}</p>
          ))}
          <button onClick={disconnectWallet}>Disconnect</button>
        </div>
      );
    }
  8. Integrate third-party services with the XCMSend JSON HTTP API

    XCMSend provides a separate JSON HTTP API designed for building third-party integrations. The source code and implementation details for the API are available in the official GitHub repository.
    # API Source Repository
    https://github.com/XcmSend/api
  9. Retrieve scenario information via Discord bot

    To display information about a scenario created in the Bagpipes public interface (alpha.bagpipes.io), you can either paste the copied link from the /lab view directly into the #bot channel or use the /scenario_info slash command.
    /scenario_info <copied_link_here>
  10. Automate multi-step blockchain workflows with Bagpipes

    Bagpipes (formerly xcmsend.com) provides a no-code visual canvas interface for designing and automating complex blockchain workflows. It allows users to wrap multiple cross-chain actions—which would typically require multiple platforms and manual signing—into a single action on one platform. Users can sign all transactions simultaneously and monitor the execution in real-time.
  11. Integrate Polkadot and EVM wallets using Bagpipes Wallet Kit

    The Bagpipes Wallet Kit allows developers to integrate Polkadot and EVM wallet extensions into DApps. Currently supported wallets include Talisman, Polkadot Extension, and SubWallet. Future updates are planned to include Nova QR and Wallet Connect to expand support across the crypto wallet ecosystem.