# Launchpad

This document aims to allow external developers to integrate with Mito's Launchpad from within their dApps. We will only show the message examples, how will you integrate them within your dApp is your own choice. Documentation on broadcasting the transactions containing these messages can be found [here](https://docs.ts.injective.network/transactions/msgbroadcaster#msgbroadcaster--wallet-strategy).

### Query

#### Fetch Launchpad Details

```typescript
import { IndexerGrpcMitoApi } from '@injectivelabs/sdk-ts'

const MITO_API_ENDPOINT = 'https://k8s.mainnet.mito.grpc-web.injective.network' /** for mainnet */
const mitoApi = new IndexerGrpcMitoApi(MITO_API_ENDPOINT)

const address = 'inj1..'
const LAUNCHPAD_CONTRACT_ADDRESS = 'inj1..'

const { ido: launchpad } = await mitoApi.fetchIDO({
    contractAddress: LAUNCHPAD_CONTRACT_ADDRESS,
    accountAddress: address
})

console.log(launchpad)
```

### Transactions

#### Subscribe to Launchpad

```typescript
import { 
  MsgExecuteContractCompat,
  spotQuantityToChainQuantityToFixed 
} from '@injectivelabs/sdk-ts'

const sender = `inj1...`
const amount = 0.01 /** subscribing 0.01 INJ */
const quoteTokenDenom = 'inj' /** if the launchpad is quoted in INJ */
const quoteTokenDecimals = 18
const contractAddress = `inj1..` /** launchpad contract address */

const message = MsgExecuteContractCompat.fromJSON({
  sender,
  funds: [
    {
      denom: quoteTokenDenom,
      amount: spotQuantityToChainQuantityToFixed({
        value: amount,
        baseDecimals: quoteTokenDecimals
      })
    }
  ],
  contractAddress,
  exec: {
    action: 'Subscribe',
    msg: {}
  }
})

/** (Prepare) Broadcast the transaction */
```

#### Claim Launchpad Subscription

```typescript
import { 
  MsgExecuteContractCompat
} from '@injectivelabs/sdk-ts'

const sender = `inj1...`
const contractAddress = `inj1..` /** launchpad contract address */

const message = MsgExecuteContractCompat.fromJSON({
  sender,
  contractAddress,
  exec: {
    action: 'Claim',
    msg: {}
  }
})

/** (Prepare) Broadcast the 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.mito.fi/integration/launchpad.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.
