Skip to main content

MoneyAccountApiDataService Actions

8 actions registered.

NameDeprecated
fetchHistory
fetchInterest
fetchPositions
fetchRateHistory
fetchVaultRate
fetchVaults
fetchVaultShareValuations
fetchVbaTransfers

MoneyAccountApiDataService:fetchHistory​

Package: @metamask/money-account-api-data-service

Fetches cursor-paginated cash-flow history for a given address. Uses fetchInfiniteQuery for proper TanStack Query pagination semantics.

When paginating, consumers must re-pass the same filter options (vaultAddress, chainId, limit) alongside cursor on every page request. This ensures the query key matches the original infinite query and that the HTTP request includes the correct filters.

Parameters:

NameDescription
addressThe user's Ethereum address.
optionsOptional filtering and pagination options.

Returns: The history response containing cash-flow entries for the requested page.

Handler signature:

(address: string, options?: HistoryOptions) => Promise<HistoryResponse>

MoneyAccountApiDataService:fetchInterest​

Package: @metamask/money-account-api-data-service

Fetches the interest earned for a given address and vault over a specified time window.

Parameters:

NameDescription
addressThe user's Ethereum address.
optionsOptions specifying vault, window, and optional chain ID.

Returns: The interest response.

Handler signature:

(address: string, options: InterestOptions) => Promise<InterestResponse>

MoneyAccountApiDataService:fetchPositions​

Package: @metamask/money-account-api-data-service

Fetches the current vault positions for a given user address.

Parameters:

NameDescription
addressThe user's Ethereum address.
optionsOptional fetch options.
options.freshWhen true, cancels in-flight reads, fetches with a zero stale time, invalidates the result for subsequent reads, and asks the Money API to skip its Nest response cache with Cache-Control: no-cache.

Returns: The position response containing vault positions and an optional balance summary (null when the API balance path is unavailable).

Handler signature:

(address: string, { fresh }?: FetchPositionsOptions) => Promise<PositionResponse>

MoneyAccountApiDataService:fetchRateHistory​

Package: @metamask/money-account-api-data-service

Fetches the exchange-rate time series for a given vault.

Parameters:

NameDescription
vaultAddressThe vault's Ethereum address.
optionsOptional range and chain ID filters.

Returns: The rate history response.

Handler signature:

(vaultAddress: string, options?: RateHistoryOptions) => Promise<RateHistoryResponse>

MoneyAccountApiDataService:fetchVaultRate​

Package: @metamask/money-account-api-data-service

Fetches the current Accountant exchange rate for a vault.

The server returns 404 when the vault is not in the deployment registry or has no indexed rate yet.

Parameters:

NameDescription
vaultAddressThe vault's Ethereum address.
optionsOptional chain ID filter. Omitted requests use the API default.

Returns: The current vault rate response.

Handler signature:

(vaultAddress: string, options?: VaultRateOptions) => Promise<VaultRateResponse>

MoneyAccountApiDataService:fetchVaults​

Package: @metamask/money-account-api-data-service

Fetches the environment's vault catalog, including each vault's current APY.

Returns: The vault catalog response.

Handler signature:

() => Promise<VaultsResponse>

MoneyAccountApiDataService:fetchVaultShareValuations​

Package: @metamask/money-account-api-data-service

Batch-values vault share movements in past transactions. Each result reports the shares moved and what they were worth in the vault's underlying asset at that block. Unknown transactions come back with found: false instead of failing the batch.

Parameters:

NameDescription
addressThe user's Ethereum address.
optionsTransaction hashes to value and an optional chain ID.
options.txHashesTransaction hashes. At most 50 distinct hashes after lowercasing and de-duplication.
options.chainIdChain ID of the transactions. Omitted requests use the API default (Monad, 143).

Returns: One result per requested hash, in request order.

Handler signature:

(address: string, { txHashes, chainId }: VaultShareValuationsOptions) => Promise<VaultShareValuationsResponse>

MoneyAccountApiDataService:fetchVbaTransfers​

Package: @metamask/money-account-api-data-service

Fetches current VBA transfers for the wallet authenticated via SIWE.

Parameters:

NameDescription
optionsFetch options, including the wallet address to authenticate.

Returns: Current transfers belonging to the authenticated wallet.

Handler signature:

(options: FetchVbaTransfersOptions) => Promise<VbaTransfersResponse>