Members
(constant) approveLoan
P2P 대출을 승인합니다.
(constant) createLoan
새로운 P2P 대출을 생성하고 계약서를 저장합니다.
(constant) createPool
새로운 대출 풀을 생성합니다.
(constant) createWallet
사용자의 지갑을 생성합니다. (서버 경유 -> 체인코드 호출)
(constant) denyLoan
P2P 대출을 거절합니다.
(constant) downloadAndSaveContract
계약서 해시를 서버에 저장하고, 사용자에게 파일을 다운로드해주는 필수 절차 함수입니다.
(constant) fetchAcceptedFriendsWithWallets
현재 사용자와 친구 관계이며 지갑이 있는 모든 친구 목록을 조회합니다.
(constant) getLoanMeta
대출 ID로 이자율과 기간을 조회합니다.
(constant) getMyLoanTransactions
사용자의 모든 대출 관련 거래(송금, 수신) 기록을 조회합니다.
(constant) getNameById
사용자 ID로 이름을 조회합니다.
(constant) getUserWalletAddress
Supabase에서 로그인 유저의 wallet_id를 조회합니다.
(constant) getWalletBalance
특정 지갑 주소의 잔액을 조회합니다.
(constant) joinPool
대출 풀에 참여(자금 예치)합니다.
(constant) queryAllLoans
체인코드에 기록된 모든 P2P 대출 목록을 조회합니다.
(constant) queryAllPools
모든 대출 풀 목록을 조회합니다.
(constant) queryLoan
특정 P2P 대출 정보를 조회합니다.
(constant) queryMyLoans
특정 지갑 주소와 관련된 모든 P2P 대출 목록을 조회합니다.
(constant) queryPool
특정 대출 풀 정보를 조회합니다.
(constant) repayLoan
P2P 대출금을 상환합니다.
(constant) saveContract
계약서 이미지의 해시를 서버에 저장합니다.
(constant) verifyContract
계약서 이미지의 유효성을 검증합니다.
Methods
getCurrentUser() → {Promise.<object>}
현재 로그인된 유저의 Supabase auth 정보를 가져옵니다.
Returns:
Supabase 사용자 객체
- Type
- Promise.<object>
getFriendList() → {Promise.<Array.<object>>}
현재 사용자의 친구 목록을 조회합니다.
Returns:
친구 목록
- Type
- Promise.<Array.<object>>
getReceivedRequests() → {Promise.<Array.<object>>}
받은 친구 요청 목록을 조회합니다.
Returns:
받은 친구 요청 목록
- Type
- Promise.<Array.<object>>
getUserProfile(userId) → {Promise.<object>}
특정 사용자의 상세 프로필 정보를 Supabase에서 직접 가져옵니다.
Parameters:
Name | Type | Description |
---|---|---|
userId |
string | 조회할 사용자의 UUID |
Returns:
사용자의 프로필 객체
- Type
- Promise.<object>
handleFriendRequest(requestId, acceptopt) → {Promise.<object>}
친구 요청을 수락 또는 거절합니다.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
requestId |
string | 처리할 친구 요청의 ID (friends 테이블의 PK) |
||
accept |
boolean |
<optional> |
true | 수락 여부 (기본값: true) |
Returns:
서버 응답 객체
- Type
- Promise.<object>
sendFriendRequest(userId, friendEmail) → {Promise.<object>}
다른 사용자에게 친구 추가를 요청합니다.
Parameters:
Name | Type | Description |
---|---|---|
userId |
string | 요청을 보내는 사용자의 UUID |
friendEmail |
string | 친구 요청을 받을 사용자의 이메일 |
Returns:
서버 응답 객체
- Type
- Promise.<object>