# 사용자의 계정 접근하기

사용자에게서 서명을 요청하거나 사용자가 트랜잭션을 승인하도록하려면 eth\_requestAccounts RPC 방법을 사용하여 사용자의 계정에 액세스해야 합니다.&#x20;

```javascript
const accounts = await window.biport.request({ method: 'eth_requestAccounts' })
  .catch((err) => {
    if (err.code === 4001) {
      // EIP-1193 userRejectedRequest error
      // If this happens, the user rejected the connection request.
      console.log('Please connect to Biport.');
    } else {
      console.error(err);
    }
  });

console.log('Connected Account:', accounts[0]);
```

### 사용자 계정 다루기

eth\_accounts RPC 메소드를 사용하여 사용자 계정을 다룰 수 있습니다. provider에서 accountsChanged 이벤트를 수신하여 사용자 계정이 변경될 때 알림을 받을 수 있습니다.

```javascript
let currentAccount = null;
window.biport.request({ method: 'eth_accounts' })
  .then(handleAccountsChanged)
  .catch((err) => {
    // Some unexpected error.
    // For backwards compatibility reasons, if no accounts are available,
    // eth_accounts returns an empty array.
    console.error(err);
  });

// Note that this event is emitted on page load.
// If the array of accounts is non-empty, you're already
// connected.
window.biport.on('accountsChanged', handleAccountsChanged);

// eth_accounts always returns an array.
function handleAccountsChanged(accounts) {
  if (accounts.length === 0) {
    // Biport is locked or the user has not connected any accounts.
    console.log('Please connect to Biport.');
  } else if (accounts[0] !== currentAccount) {
    // Reload your interface with accounts[0].
    currentAccount = accounts[0];
    // Update the account displayed (see the HTML for the connect button)
    showAccount.innerHTML = currentAccount;
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bifi.finance/biport-guide-kr/api-documentation/undefined/undefined-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
