---
eip: 5792
label: EIP-5792
title: Wallet Call API
status: Final
type: Standards Track
category: Interface
created: 2022-10-17
requires: 1193
official: https://eips.ethereum.org/EIPS/eip-5792
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-5792.md
canonical: https://eips.huatuo.xyz/ko/eip-5792/
lang: ko
tldr: wallet_sendCalls와 관련 RPC 메서드를 추가해, dApp이 지갑에 호출 묶음(선택적으로 원자적)을 보내 달라고 요청하고 페이마스터 같은 지갑 기능을 쓸 수 있게 한다.
tags: [wallet, json-rpc, batching, account-abstraction, interface]
---

# EIP-5792: Wallet Call API

> Adds JSON-RPC methods for sending multiple calls from the user's wallet, and checking their status

**TL;DR:** wallet_sendCalls와 관련 RPC 메서드를 추가해, dApp이 지갑에 호출 묶음(선택적으로 원자적)을 보내 달라고 요청하고 페이마스터 같은 지갑 기능을 쓸 수 있게 한다.

## 어떤 문제를 해결하나요?

dApp은 주로 `eth_sendTransaction`과 `eth_getTransactionReceipt`로 지갑과 소통합니다. 이 메서드들은 정확히 하나의 트랜잭션만 보내며 스마트 계정에 대해서는 아무것도 모릅니다. 단순한 "approve 후 swap"도 팝업 두 번과 트랜잭션 두 번이 필요하고, 지갑이 페이마스터(가스 대납)를 지원하더라도 앱이 이를 사용해 달라고 요청할 수 없습니다.

EIP-5792는 새로운 `wallet_` API를 정의합니다. 앱이 호출 목록을 넘기면 지갑이 실행 방식(스마트 계정은 하나의 묶음 트랜잭션, 일반 EOA는 여러 트랜잭션)을 결정하고, 앱은 지갑이 지원하는 추가 기능을 알아낼 수 있습니다.

## 어떻게 동작하나요?

네 가지 JSON-RPC 메서드가 있습니다.

- **`wallet_sendCalls`**: `version`, `chainId`, 선택적 `from`, `atomicRequired`, `{to, data, value}` 호출 목록, 선택적 `capabilities`를 받아 묶음 `id`를 반환합니다. 호출은 지정된 체인에서, 지정된 주소로부터, 순서대로 실행되어야 합니다.
- **`wallet_getCallsStatus(id)`**: 숫자 `status`(100 대기 중, 200 확인됨, 400 오프체인 실패, 500 완전 되돌림, 600 부분 되돌림), 묶음이 `atomic`하게 실행되었는지 여부, 그리고 여러분의 호출에서 나온 로그만 담은 영수증을 반환합니다.
- **`wallet_showCallsStatus(id)`**: 지갑에 묶음을 사용자에게 보여 달라고 요청합니다.
- **`wallet_getCapabilities(address, chainIds?)`**: 체인별로 지원되는 capability를 반환합니다(키는 16진수 체인 ID이며 `"0x0"`은 모든 체인을 의미).

**원자성**은 내장 capability이며 상태는 `supported`, `ready`(사용자 승인 후 업그레이드 가능, 예: [EIP-7702](/eip-7702/)를 통한 EOA), `unsupported` 중 하나입니다. `atomicRequired: true`이면 지갑은 모든 호출을 원자적이고 연속적으로 실행하거나 거부해야 합니다.

**Capability**는 확장 가능합니다. 지갑이 모르는 capability는 앱이 `optional: true`로 표시하지 않는 한 거부됩니다(오류 5700). [ERC-4337](/eip-4337/) 계정용 페이마스터 서비스가 대표적인 예입니다. 새 capability는 별도의 ERC에서 정의됩니다.

## 샘플 코드

한 번의 요청으로 approve와 swap을 실행하고, 묶음 처리를 쓸 수 없으면 폴백하기:

```ts
const [from] = await window.ethereum.request({ method: "eth_requestAccounts" });
const chainId = "0x1";

const caps = await window.ethereum.request({
  method: "wallet_getCapabilities",
  params: [from, [chainId]],
});
const atomic = caps?.[chainId]?.atomic?.status; // "supported" | "ready" | "unsupported"

const { id } = await window.ethereum.request({
  method: "wallet_sendCalls",
  params: [{
    version: "2.0.0",
    chainId,
    from,
    atomicRequired: atomic === "supported" || atomic === "ready",
    calls: [
      { to: TOKEN, data: approveCalldata },
      { to: ROUTER, data: swapCalldata },
    ],
  }],
});

const status = await window.ethereum.request({
  method: "wallet_getCallsStatus",
  params: [id],
});
if (status.status === 200) console.log(status.receipts);
```

## 알아둘 점

- **상태: Final.** 지갑이 이 메서드들을 구현하지 않은 경우 앱은 여전히 `eth_sendTransaction`으로 폴백해야 합니다.
- `atomicRequired`가 없으면 EOA 지갑은 호출을 별도 트랜잭션으로 보낼 수 있으므로, 앞선 호출이 실패한 뒤에도 뒤의 호출이 실행될 수 있습니다. `atomic`과 영수증별 상태를 확인하세요.
- 지갑은 제출 후 최소 24시간 동안 묶음 상태를 조회할 수 있게 유지해야 합니다.
- 묶음 ID는 발신자별, 앱별로 고유해야 합니다. 재사용하면 거부됩니다(오류 5720).
- `wallet_getCapabilities`는 핑거프린팅을 제한하기 위해 이미 앱에 연결된 주소에 대해서만 응답해야 합니다. 지갑은 capability를 대역 외로(예: [EIP-6963](/eip-6963/) 탐색과 함께) 노출할 수도 있습니다.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-5792
