Skip to main content

@elizaos/core v1.0.6 / IWalletService

Class: abstract IWalletService

Abstract interface for a Wallet Service. Plugins that provide wallet functionality (e.g., for Solana, EVM) should implement this service. It provides a standardized way for other plugins to query the state of a wallet.

Extends​

Properties​

runtime​

protected runtime: IAgentRuntime

Runtime instance

Inherited from​

Service.runtime

Defined in​

packages/core/src/types/service.ts:105


config?​

optional config: Metadata

Service configuration

Inherited from​

Service.config

Defined in​

packages/core/src/types/service.ts:122


serviceType​

readonly static serviceType: "wallet" = ServiceType.WALLET

Service type

Overrides​

Service.serviceType

Defined in​

packages/core/src/types/wallet.ts:27


capabilityDescription​

readonly capabilityDescription: "Provides standardized access to wallet balances and portfolios." = 'Provides standardized access to wallet balances and portfolios.'

Service name

Overrides​

Service.capabilityDescription

Defined in​

packages/core/src/types/wallet.ts:29

Methods​

start()​

static start(_runtime): Promise<Service>

Start service connection

Parameters​

• _runtime: IAgentRuntime

Returns​

Promise<Service>

Inherited from​

Service.start

Defined in​

packages/core/src/types/service.ts:125


stop()​

static stop(_runtime): Promise<unknown>

Stop service connection

Parameters​

• _runtime: IAgentRuntime

Returns​

Promise<unknown>

Inherited from​

Service.stop

Defined in​

packages/core/src/types/service.ts:130


getPortfolio()​

abstract getPortfolio(owner?): Promise<WalletPortfolio>

Retrieves the entire portfolio of assets held by the wallet.

Parameters​

• owner?: string

Optional: The specific wallet address/owner to query if the service manages multiple.

Returns​

Promise<WalletPortfolio>

A promise that resolves to the wallet's portfolio.

Defined in​

packages/core/src/types/wallet.ts:37


getBalance()​

abstract getBalance(assetAddress, owner?): Promise<number>

Retrieves the balance of a specific asset in the wallet.

Parameters​

• assetAddress: string

The mint address or native identifier of the asset.

• owner?: string

Optional: The specific wallet address/owner to query.

Returns​

Promise<number>

A promise that resolves to the user-friendly (decimal-adjusted) balance of the asset held.

Defined in​

packages/core/src/types/wallet.ts:45


transferSol()​

abstract transferSol(from, to, lamports): Promise<string>

Transfers SOL from a specified keypair to a given public key. This is a low-level function primarily for Solana-based wallet services.

Parameters​

• from: any

The Keypair of the sender.

• to: any

The PublicKey of the recipient.

• lamports: number

The amount in lamports to transfer.

Returns​

Promise<string>

A promise that resolves with the transaction signature.

Defined in​

packages/core/src/types/wallet.ts:55