초과 Lamport 출금이란?
*rsWithdrawExcessLamports*는 Token Program 계정이 보유한 SOL 중 임대 면제
최솟값을 초과하는 금액을 대상 계정으로 이동시킵니다. 토큰 잔액과 mint 공급량은
변경되지 않으며 — 초과 lamport만 이동합니다.
이 기능은 이전에 고립된 SOL을 회수합니다: token account, mint, 또는 멀티시그(모두 Token Program이 소유)로 전송된 lamport는 기존에는 다른 방법으로 이동할 수 없었습니다.
소스 참조
계정
| 계정 | 설명 |
|---|---|
source | 쓰기 가능. 출금할 token account, mint, 또는 멀티시그. |
destination | 쓰기 가능. 초과 lamport를 수신합니다. |
authority | 소스 계정 유형에 따라 서명합니다 (아래 참조). |
서명 권한
필요한 서명자는 source 계정의 유형에 따라 다릅니다:
| 소스 계정 | 서명자 |
|---|---|
| token account | token account 소유자 (또는 해당 멀티시그 서명자). |
| mint authority가 있는 mint | mint authority. |
| mint authority가 없는 mint | mint account 자체가 서명해야 합니다 (아래 참고 참조). |
| 멀티시그 | 설정된 M-of-N 서명자. |
"민트 권한 없는 민트" 경우는 드문 경우입니다. 해당되는 경우, 민트 계정이 서명자가 됩니다: 프로그램 소유(오프 커브) 민트는 소유 프로그램의 CPI를 통해 서명하고, keypair(온 커브) 민트는 자체 키로 서명합니다.
네이티브(래핑된 SOL) token account는 지원되지 않으며 *rsNativeNotSupported*를
반환합니다. 출금 시 출처 계정의 잔액이 임대 면제 최솟값 아래로 떨어질 수
없습니다.
초과 lamport 출금 방법
이 예제는 구성된 @solana/kit
클라이언트를 사용합니다 — 클라이언트 설정은
토큰 전송을 참고하세요.
Withdraw excess lamports (Kit)
import { getWithdrawExcessLamportsInstruction } from "@solana-program/token";// source/destination: addresses of the account to drain and the lamport recipient.// authority: a TransactionSigner that signs per the source account type.const instruction = getWithdrawExcessLamportsInstruction({source,destination,authority});await client.sendTransaction([instruction]);
멀티시그 권한의 경우, *tsmultiSigners*와 함께 공동 서명자를 전달하세요.
Is this page helpful?