> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/openhive-network/wax/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started with WAX in under 5 minutes

This quickstart guide will help you create your first Hive blockchain transaction using WAX. Choose your preferred language to get started.

<Tabs>
  <Tab title="TypeScript">
    ## Installation

    Install WAX using your preferred package manager:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @hiveio/wax
      ```

      ```bash yarn theme={null}
      yarn add @hiveio/wax
      ```

      ```bash pnpm theme={null}
      pnpm add @hiveio/wax
      ```
    </CodeGroup>

    ## Create your first transaction

    <Steps>
      <Step title="Import and initialize WAX">
        ```typescript theme={null}
        import { createWaxFoundation, createHiveChain } from '@hiveio/wax';

        // For offline operations (transaction building)
        const wax = await createWaxFoundation();

        // For online operations (broadcasting, API calls)
        const chain = await createHiveChain();
        ```
      </Step>

      <Step title="Build a transaction">
        Create a transaction and add operations. This example creates a vote operation:

        ```typescript theme={null}
        // Create a transaction
        const tx = await wax.createTransaction();

        // Add a vote operation
        tx.pushOperation({
          vote: {
            voter: "alice",
            author: "bob",
            permlink: "example-post",
            weight: 10000  // 100% vote (10000 = 100%)
          }
        });
        ```

        <Note>
          The `weight` field accepts values from -10000 (100% downvote) to 10000 (100% upvote).
        </Note>
      </Step>

      <Step title="Sign the transaction">
        Sign the transaction with your wallet or signing provider:

        ```typescript theme={null}
        // Sign with Beekeeper (recommended for development)
        import { createBeekeeperSession } from '@hiveio/signers-beekeeper';

        const session = await createBeekeeperSession();
        const wallet = await session.createWallet("my-wallet");
        const publicKey = await wallet.importKey("5JYourPrivateKeyHere...");

        await tx.sign(wallet, publicKey);
        ```

        <Warning>
          Never hard-code private keys in production. Use environment variables or secure key management.
        </Warning>
      </Step>

      <Step title="Broadcast to the network">
        Send your signed transaction to the Hive blockchain:

        ```typescript theme={null}
        // Broadcast the transaction
        const result = await chain.broadcast(tx.transaction);

        console.log('Transaction broadcasted!');
        console.log('Transaction ID:', result.id);
        console.log('Block number:', result.block_num);
        ```
      </Step>
    </Steps>

    ## Next steps

    <CardGroup cols={2}>
      <Card title="TypeScript SDK Guide" icon="code" href="/typescript/overview">
        Learn more about the TypeScript SDK
      </Card>

      <Card title="Transaction Building" icon="hammer" href="/guides/building-transactions">
        Deep dive into transaction building
      </Card>

      <Card title="Signing Options" icon="key" href="/guides/signing-transactions">
        Explore different signing providers
      </Card>

      <Card title="API Reference" icon="book" href="/api/typescript/wax-factory">
        Browse the complete API reference
      </Card>
    </CardGroup>
  </Tab>

  <Tab title="Python">
    ## Installation

    Install WAX using pip:

    ```bash theme={null}
    pip install hiveio-wax
    ```

    <Note>
      WAX requires Python 3.12 or higher.
    </Note>

    ## Create your first transaction

    <Steps>
      <Step title="Import and initialize WAX">
        ```python theme={null}
        from wax import create_wax_foundation, create_hive_chain

        # For offline operations (transaction building)
        wax = create_wax_foundation()

        # For online operations (broadcasting, API calls)
        chain = create_hive_chain()
        ```
      </Step>

      <Step title="Build a transaction">
        Create a transaction and add operations. This example creates a vote operation:

        ```python theme={null}
        from wax.proto.operations import vote_operation

        # Create a transaction
        tx = wax.create_transaction()

        # Add a vote operation
        tx.push_operation(
            vote_operation(
                voter="alice",
                author="bob",
                permlink="example-post",
                weight=10000  # 100% vote
            )
        )
        ```

        <Note>
          The `weight` field accepts values from -10000 (100% downvote) to 10000 (100% upvote).
        </Note>
      </Step>

      <Step title="Sign the transaction">
        Sign the transaction with Beekeeper wallet:

        ```python theme={null}
        from beekeepy import create_wallet

        # Create a Beekeeper wallet session
        async with create_wallet() as wallet:
            # Import your key
            public_key = await wallet.import_key("5JYourPrivateKeyHere...")
            
            # Sign the transaction
            await tx.sign(wallet, public_key)
        ```

        <Warning>
          Never hard-code private keys in production. Use environment variables or secure key management.
        </Warning>
      </Step>

      <Step title="Broadcast to the network">
        Send your signed transaction to the Hive blockchain:

        ```python theme={null}
        # Broadcast the transaction
        result = await chain.broadcast(tx.transaction)

        print(f"Transaction broadcasted!")
        print(f"Transaction ID: {result.id}")
        print(f"Block number: {result.block_num}")
        ```
      </Step>
    </Steps>

    ## Next steps

    <CardGroup cols={2}>
      <Card title="Python SDK Guide" icon="python" href="/python/overview">
        Learn more about the Python SDK
      </Card>

      <Card title="Transaction Building" icon="hammer" href="/guides/building-transactions">
        Deep dive into transaction building
      </Card>

      <Card title="Signing Options" icon="key" href="/guides/signing-transactions">
        Explore different signing providers
      </Card>

      <Card title="API Reference" icon="book" href="/api/python/wax-factory">
        Browse the complete API reference
      </Card>
    </CardGroup>
  </Tab>
</Tabs>

## Common operations

Here are some other common operations you might want to try:

<AccordionGroup>
  <Accordion title="Transfer tokens">
    Transfer HIVE, HBD, or HIVE POWER between accounts:

    <Tabs>
      <Tab title="TypeScript">
        ```typescript theme={null}
        tx.pushOperation({
          transfer: {
            from_account: "alice",
            to_account: "bob",
            amount: wax.hiveCoins(10),  // 10 HIVE
            memo: "Thanks for your help!"
          }
        });
        ```
      </Tab>

      <Tab title="Python">
        ```python theme={null}
        from wax.proto.operations import transfer_operation

        tx.push_operation(
            transfer_operation(
                from_account="alice",
                to_account="bob",
                amount=wax.hive(10),  # 10 HIVE
                memo="Thanks for your help!"
            )
        )
        ```
      </Tab>
    </Tabs>
  </Accordion>

  <Accordion title="Create a blog post">
    Publish content to the Hive blockchain:

    <Tabs>
      <Tab title="TypeScript">
        ```typescript theme={null}
        tx.pushOperation({
          comment: {
            parent_author: "",
            parent_permlink: "blockchain",
            author: "alice",
            permlink: "my-first-post",
            title: "My First Post on Hive",
            body: "This is the content of my post...",
            json_metadata: JSON.stringify({
              tags: ["blockchain", "hive"],
              app: "my-app/1.0.0"
            })
          }
        });
        ```
      </Tab>

      <Tab title="Python">
        ```python theme={null}
        from wax.proto.operations import comment_operation
        import json

        tx.push_operation(
            comment_operation(
                parent_author="",
                parent_permlink="blockchain",
                author="alice",
                permlink="my-first-post",
                title="My First Post on Hive",
                body="This is the content of my post...",
                json_metadata=json.dumps({
                    "tags": ["blockchain", "hive"],
                    "app": "my-app/1.0.0"
                })
            )
        )
        ```
      </Tab>
    </Tabs>
  </Accordion>

  <Accordion title="Follow another user">
    Use custom\_json to follow another account:

    <Tabs>
      <Tab title="TypeScript">
        ```typescript theme={null}
        tx.pushOperation({
          custom_json: {
            required_auths: [],
            required_posting_auths: ["alice"],
            id: "follow",
            json: JSON.stringify([
              "follow",
              {
                follower: "alice",
                following: "bob",
                what: ["blog"]
              }
            ])
          }
        });
        ```
      </Tab>

      <Tab title="Python">
        ```python theme={null}
        from wax.proto.operations import custom_json_operation
        import json

        tx.push_operation(
            custom_json_operation(
                required_auths=[],
                required_posting_auths=["alice"],
                id="follow",
                json=json.dumps([
                    "follow",
                    {
                        "follower": "alice",
                        "following": "bob",
                        "what": ["blog"]
                    }
                ])
            )
        )
        ```
      </Tab>
    </Tabs>
  </Accordion>
</AccordionGroup>

## Get help

<CardGroup cols={2}>
  <Card title="Core Concepts" icon="lightbulb" href="/concepts/architecture">
    Understand how WAX works under the hood
  </Card>

  <Card title="Examples" icon="code" href="/typescript/examples">
    Browse complete working examples
  </Card>
</CardGroup>
