Mito
  • Introduction
    • ๐Ÿ‘‹Welcome
    • ๐ŸŒProtocol Overview
    • ๐Ÿ—๏ธValue Propositions
  • Products
    • ๐Ÿš€Launchpad
      • ๐Ÿ”‘Key Features
      • โ“How Does It Work?
      • ๐ŸŽŸ๏ธLaunchpad Eligibility
      • ๐Ÿ“ˆLaunchpad Subscription Model
      • โŒ›Launchpad Subscription Conclusion
        • ๐Ÿ‘จโ€๐Ÿ’ปNon-Whitelisted Users
    • ๐ŸŽ๏ธAutomated Vaults
      • โš–๏ธCPMM Automated Vaults
      • โšกRewards
    • ๐Ÿช„Permissionless Vaults
  • HOW TO
    • ๐Ÿš€Launchpad Creation Guide
    • ๐Ÿช„Vault Creation Guide
  • Integration
    • ๐ŸคนLaunchpad
    • ๐Ÿ๏ธAutomated Vaults
    • ๐ŸฅฉRewards
    • ๐Ÿช„Permissionless Vaults
    • ๐Ÿฆ“Holders/Stakers
Powered by GitBook
On this page
  • Query
  • Transactions
  1. Integration

Launchpad

PreviousVault Creation GuideNextAutomated Vaults

Last updated 1 year ago

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 .

Query

Fetch Launchpad Details

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

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

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 */
๐Ÿคน
here