통합 API

CHAINFetch Deposit State

Last updated January 31, 2026

Genesis JavaScript SDK를 사용하여 블록체인에서 직접 사용자 예치 상태를 조회합니다. 예치 금액, 클레임 상태, 사용자가 예치했는지 여부를 확인할 수 있습니다.

온체인 조회에는 UmiGenesis SDK가 필요합니다.

메서드

메서드런치 유형동작
fetchLaunchPoolDepositV2Launch Pool찾을 수 없으면 예외 발생
safeFetchLaunchPoolDepositV2Launch Poolnull 반환
fetchPresaleDepositV2Presale찾을 수 없으면 예외 발생
safeFetchPresaleDepositV2Presalenull 반환

Launch Pool 예치

import {
fetchLaunchPoolDepositV2,
safeFetchLaunchPoolDepositV2,
} from '@metaplex-foundation/genesis';
// Throws if not found — use when you expect the deposit to exist
const deposit = await fetchLaunchPoolDepositV2(umi, depositPda);
console.log('Amount:', deposit.amountQuoteToken);
console.log('Claimed:', deposit.claimed);
// Returns null if not found — use for optional lookups
const maybeDeposit = await safeFetchLaunchPoolDepositV2(umi, depositPda);
if (maybeDeposit) {
console.log('Amount:', maybeDeposit.amountQuoteToken);
}

Presale 예치

import {
fetchPresaleDepositV2,
safeFetchPresaleDepositV2,
} from '@metaplex-foundation/genesis';
// Throws if not found — use when you expect the deposit to exist
const deposit = await fetchPresaleDepositV2(umi, depositPda);
console.log('Amount deposited:', deposit.amountQuoteToken);
console.log('Amount claimed:', deposit.amountClaimed);
console.log('Fully claimed:', deposit.claimed);
// Returns null if not found — use for optional lookups
const maybeDeposit = await safeFetchPresaleDepositV2(umi, depositPda);
if (maybeDeposit) {
console.log('Amount deposited:', maybeDeposit.amountQuoteToken);
}

사용자가 예치했는지 확인

safeFetch 변형을 사용하면 오류를 발생시키지 않고 사용자의 예치 여부를 확인할 수 있습니다:

import {
safeFetchLaunchPoolDepositV2,
safeFetchPresaleDepositV2,
findLaunchPoolDepositV2Pda,
findPresaleDepositV2Pda,
} from '@metaplex-foundation/genesis';
// Launch Pool
const [lpDepositPda] = findLaunchPoolDepositV2Pda(umi, {
bucket: launchPoolBucket,
recipient: userPublicKey,
});
const lpDeposit = await safeFetchLaunchPoolDepositV2(umi, lpDepositPda);
const hasLpDeposit = lpDeposit !== null;
// Presale
const [psDepositPda] = findPresaleDepositV2Pda(umi, {
bucket: presaleBucket,
recipient: userPublicKey,
});
const psDeposit = await safeFetchPresaleDepositV2(umi, psDepositPda);
const hasPsDeposit = psDeposit !== null;