Skip to main content

Raycast Extension

The GHOST Raycast extension (ghost-raycast) provides quick access to protocol operations directly from the Raycast launcher on macOS. It features a multi view interface with forms, lists, and detail views for all protocol operations.

Technology Stack

ComponentTechnology
FrameworkRaycast API
UIReact 19
Blockchainethers.js v6 on Sepolia
Encryptioneciesjs v0.4

Features

FeatureDescription
Wallet ManagementCreate or import a Sepolia wallet. Private key stored in Raycast preferences.
Balance DashboardView private vault balances and on chain token balances side by side.
Lend Intent5 step guided form: token, amount, rate, deposit confirmation, intent submission.
Borrow IntentForm with collateral calculation based on credit tier and live ETH price.
Loan PortfolioUnified view of all active, repaid, and defaulted loans.
Private TransfersSend tokens to another shielded address within the vault.
Shielded AddressGenerate and display the user's shielded vault address.
WithdrawalsWithdraw from vault shielded balance to on chain ERC20 balance.
Transaction HistoryView all historical transfers with reason codes and timestamps.
Credit ProfileDisplay credit tier, multiplier, loans repaid, and loans defaulted.

Views

The extension is organized into 12 view components:

WalletView

Create a new wallet or import an existing one by entering a private key. The wallet is stored securely in Raycast's local storage.

BalancesView

Displays two sections:

  • Private balances: gUSD and gETH held in the shielded vault
  • On chain balances: ERC20 token balances on Sepolia

Balances auto refresh on view open.

LendFormView

A 5 step guided lending flow:

StepInput
1Select token (gUSD)
2Enter lending amount
3Enter desired interest rate (encrypted with CRE public key)
4Confirm vault deposit and private transfer to pool
5Submit lend intent with EIP 712 signature

BorrowFormView

Collateral is calculated automatically:

  1. Enter borrow amount
  2. Extension fetches credit tier and ETH price
  3. Required collateral displayed (amount * multiplier / ethPrice)
  4. Enter maximum acceptable rate
  5. Submit with EIP 712 signature

LendPositionsView and BorrowPositionsView

List views showing all active intents, pending proposals, and matched loans. Each item has actions for:

  • Cancelling intents
  • Accepting or rejecting proposals
  • Viewing loan details

MyLoansView

Unified loan dashboard with sections for active, repaid, and defaulted loans. Each loan shows:

  • Principal and effective rate
  • Collateral amount and current health factor
  • Matched tick breakdown
  • Repayment and claim actions

TransferView

Form for executing private transfers within the vault. Enter recipient shielded address, token, and amount. Signed with EIP 712.

WithdrawView

Withdraw from vault shielded balance to on chain. Requires a withdrawal ticket signed by the user.

ProfileView

Displays the user's credit score:

  • Current tier (Bronze, Silver, Gold, Platinum)
  • Collateral multiplier for the tier
  • Total loans repaid
  • Total loans defaulted

Hooks

Custom React hooks for data fetching:

HookPurpose
useWalletWallet state management and persistence
useBalancesFetch private and on chain balances
useLenderStatusFetch lender positions and active intents
useBorrowerStatusFetch borrower positions, proposals, and loans
useCreditScoreFetch credit tier and calculate multiplier

Library Modules

ModulePurpose
constants.tsServer URLs, contract addresses, EIP 712 type definitions
ghost-api.tsGHOST server API client (all endpoints)
external-api.tsVault API client (deposits, transfers, withdrawals, balances)
chain.tsOn chain interactions (ERC20 balances, approvals)
encryption.tsRate encryption using eciesjs
wallet.tsLocal wallet creation, import, and storage

Running the Extension

Development

cd ghost-raycast
npm install
ray develop

This opens the extension in Raycast's development mode with hot reload.

Building

ray build

Publishing

npx @raycast/api@latest publish

Configuration

The extension uses hardcoded configuration in constants.ts:

ConstantValue
GHOST_SERVER_URLGHOST API base URL
RPC_URLSepolia RPC endpoint
VAULT_ADDRESSCompliant Private Transfer vault address
TOKEN_ADDRESSgUSD token address
GETH_ADDRESSgETH token address
CRE_PUBLIC_KEYCRE public key for rate encryption

For local development, update these constants to point to your local server.