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

# Integration Guide

> Build a deployment-aware InkyPump integration without duplicate launches or wrong-hook routing.

The fastest safe path is the [Launchpad Quickstart](/integrations/launchpad-quickstart). This page explains the system choices around it.

## Recommended architecture

```text theme={null}
Partner backend
  - fetches Capabilities and InkyPump read data
  - caches public deployment data briefly
  - serves allowlisted data to the partner frontend

Partner frontend
  - shows the exact launch intent
  - uses the creator's connected wallet
  - simulates and submits the contract call
  - saves the transaction hash before waiting

Chain receipt
  - proves launch ID, creator, token, target, and hook

InkyPump indexer
  - publishes discovery and metrics after confirmation
```

This avoids cross-origin API trouble and keeps creator ownership with the user.

## Choose the creation path

| Product | Discovery | Write |
| - | - | - |
| Native Ink | `/api/capabilities?chainId=57073` | `createLaunch(params)` with optional native value |
| Native Robinhood | `/api/capabilities?chainId=4663` | `createLaunch(params)` with optional native value |
| Ink xStocks | `/api/xstocks/quote-assets?chainId=57073` | `createLaunchWithQuotePrebuy(params, amount)` after wrapper approval |

xStocks do not run on the native creation hook. Each wrapper has a separate hook.

## Creation state machine

Use explicit states in your UI:

```text theme={null}
draft
  -> simulating
  -> awaiting-signature
  -> submitted (transaction hash saved)
  -> confirmed (receipt and LaunchCreated verified)
  -> indexing
  -> discoverable

Any pre-submit error -> draft
Receipt revert -> failed
Wait timeout -> submitted, not failed
```

Never return a submitted transaction to `draft` merely because an RPC wait timed out.

## Verify `LaunchCreated`

The receipt decoder must use:

```solidity theme={null}
event LaunchCreated(
    uint256 indexed launchId,
    address indexed creator,
    address token,
    uint96 targetRaise
);
```

Require the event address to equal the planned hook. Check the creator and target. Persist:

```ts theme={null}
const launchRecord = {
  chainId,
  hookAddress,
  launchId,
  tokenAddress,
  transactionHash,
}
```

## Route an existing token

```bash theme={null}
curl "https://inkypump.com/api/token?chainId=57073&address=0x..."
```

Use the returned `hook_address` and `launch_id`. An active deployment is only for a new launch; it must not overwrite an existing token's execution context.

Before bond, read `getLaunchState` and use the hook previews. After bond, resolve the exact pool by ABI family: call `getLaunchPoolKey` on corrected/current hooks, or use complete indexed pool fields for `ink-legacy`. Validate the key and computed pool ID. Never construct the pool from WETH or another guessed quote token.

## Approvals

| Action | Approval target |
| - | - |
| Native curve buy | None |
| Native or xStocks curve sell | Launch's own hook spends the launch token |
| xStocks launch prebuy | Per-asset hook spends the wrapper |
| xStocks curve buy | Per-asset hook spends the wrapper |
| Post-bond routed ERC-20 trade | Exact router/gateway from that transaction plan |

Show spender, token, and amount before requesting approval.

## Referrals

An on-chain `Referral` event and a permanent fee-earning referral binding are not the same thing. The fee-earning system uses a wallet challenge, signature, and chain-specific accept route.

Do not add `createLaunchWithReferral` as a universal selector. The older Ink hook rejects it. Use plain creation unless you have selected and simulated a deployment that supports it.

## Captcha window

Direct creation needs no captcha. A pre-bond trade during `antiSnipeDuration` needs a valid InkyPump signer authorization. That signer API is protected by Turnstile and first-party origin policy.

For a partner's first release, set `antiSnipeDuration` to zero or coordinate an approved captcha flow with InkyPump.

## Read API boundary

* Always pass `chainId`.
* Call the API from your backend.
* Treat `404` after a confirmed receipt as indexing delay.
* Preserve exact strings and null values.
* Handle `429` with backoff.
* Ignore new response fields you do not use.

See [Read and Index](/integrations/read-and-index) and [API Policies](/api-reference/policies).

## Production release

Before enabling users, complete the [Production Checklist](/integrations/production-checklist). At minimum, test native creation with and without prebuy, receipt recovery after an RPC timeout, wrong-chain rejection, and existing-token routing on both active and deprecated hooks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.