# Dogecoin

Sure, here's a basic guide on how to interact with the Dogecoin blockchain using the Moon SDK in Markdown format.

### Initialization

Firstly, you need to import the necessary modules and initialize the MoonSDK:

```javascript
import { MoonSDK } from '@moonup/moon-api';

const moonSDK = new MoonSDK({
  apiKey: 'your-api-key',
});
```

Replace `'your-api-key'` with your actual API key.

### List Dogecoin Accounts

To list Dogecoin accounts:

```javascript
async function listDogeCoinAccounts() {
  try {
    const response = await moonSDK.getDogecoinSDK().listDogeCoinAccounts();
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

listDogeCoinAccounts();
```

### Create a Dogecoin Account

To create a new Dogecoin account:

```javascript
async function createDogeCoinAccount() {
  try {
    const response = await moonSDK.getDogecoinSDK().createDogeCoinAccount({
      network: 'testnet', // or 'mainnet'
    });
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

createDogeCoinAccount();
```

The `createDogeCoinAccount` function will return an object containing the address and private key of the newly created account.

### Sign a Dogecoin Transaction

To sign a Dogecoin transaction:

```javascript
async function signDogeCoinTransaction(accountName, toAddress, amount) {
  try {
    const response = await moonSDK.getDogecoinSDK().signDogeCoinTransaction(accountName, {
      network: 'testnet', // or 'mainnet'
      to: toAddress,
      value: amount,
    });
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

signDogeCoinTransaction('your-account-name', 'recipient-address', 1);
```

Replace `'your-account-name'`, `'recipient-address'`, and `1` with the appropriate values. The `signDogeCoinTransaction` function will return an object containing the signed transaction (`signedTx`) and the transaction hash (`transaction_hash`).

### Extra Notes

* Always remember to handle errors properly in your production code.
* This guide assumes that you're running in a Node.js environment. If you're running in a browser, you'll need to use a library like `dogecoinjs-lib` to sign transactions, as the browser doesn't have access to the file system to store private keys.
* This guide uses the testnet network for demonstration purposes. When you're ready to use the mainnet, make sure to change the `network` parameter to `'mainnet'`.
* Dogecoin uses a different unit of account than Bitcoin. One Dogecoin is equal to 100,000,000 Dogecoin coins, so you'll need to specify the amount in Dogecoin coins when sending a transaction.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usemoon.ai/interacting-with-the-blockchain/dogecoin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
