import { APIResource } from "../../../core/resource.js"; import * as TransferInAPI from "../../transfer-in.js"; import * as AgentsAPI from "../agents.js"; import * as InternalAccountsAPI from "../../sandbox/internal-accounts.js"; import { InternalAccountsDefaultPagination } from "../../sandbox/internal-accounts.js"; import * as ActionsAPI from "./actions.js"; import { ActionListParams, Actions } from "./actions.js"; import * as ExternalAccountsAPI from "./external-accounts.js"; import { ExternalAccountAddParams, ExternalAccountListParams, ExternalAccounts } from "./external-accounts.js"; import * as QuotesAPI from "./quotes.js"; import { QuoteCreateParams, QuoteExecuteParams, Quotes } from "./quotes.js"; import * as TransactionsAPI from "./transactions.js"; import { TransactionListParams, Transactions } from "./transactions.js"; import { APIPromise } from "../../../core/api-promise.js"; import { type DefaultPaginationParams, PagePromise } from "../../../core/pagination.js"; import { RequestOptions } from "../../../internal/request-options.js"; /** * Endpoints called by the agent itself using its own credentials (obtained via device code redemption). Scoped to the agent's associated customer — all requests automatically operate on behalf of that customer and are subject to the agent's policy. When an action requires approval, the resulting transaction enters a pending state and must be approved by the platform via `POST /transactions/{transactionId}/approve`. */ export declare class Me extends APIResource { transactions: TransactionsAPI.Transactions; quotes: QuotesAPI.Quotes; externalAccounts: ExternalAccountsAPI.ExternalAccounts; actions: ActionsAPI.Actions; /** * Retrieve the authenticated agent's own profile, policy, and current usage. This * endpoint is called by the agent software itself using its own credentials * (obtained via device code redemption) rather than platform credentials. * * @example * ```ts * const agent = await client.agents.me.retrieve(); * ``` */ retrieve(options?: RequestOptions): APIPromise; /** * Transfer funds from an external account to an internal account for the * authenticated agent's customer. Accounts must belong to the agent's customer. * Requires the CREATE_TRANSFERS permission in the agent's policy. If the agent's * policy requires approval for this amount, the transaction will be created in a * pending state and must be approved by the platform via * `POST /agents/{agentId}/actions/{actionId}/approve`. This endpoint should only * be used for external account sources with pull functionality (e.g. ACH Pull). * Otherwise, use the payment instructions on the internal account to deposit * funds. * * @example * ```ts * const agentAction = await client.agents.me.createTransferIn( * { * destination: { * accountId: * 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123', * }, * source: { * accountId: * 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965', * }, * amount: 12550, * }, * ); * ``` */ createTransferIn(params: MeCreateTransferInParams, options?: RequestOptions): APIPromise; /** * Transfer funds from an internal account to an external account for the * authenticated agent's customer. Accounts must belong to the agent's customer. * Requires the CREATE_TRANSFERS permission in the agent's policy. If the agent's * policy requires approval for this amount, the transaction will be created in a * pending state and must be approved by the platform via * `POST /agents/{agentId}/actions/{actionId}/approve`. * * @example * ```ts * const agentAction = * await client.agents.me.createTransferOut({ * destination: { * accountId: * 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965', * }, * source: { * accountId: * 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123', * }, * amount: 12550, * }); * ``` */ createTransferOut(params: MeCreateTransferOutParams, options?: RequestOptions): APIPromise; /** * Retrieve the internal accounts belonging to the customer this agent operates on * behalf of. Use this to discover available source accounts for transfers and * quotes, and to verify which accounts are accessible under the agent's * `accountRestrictions` policy. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const internalAccount of client.agents.me.listInternalAccounts()) { * // ... * } * ``` */ listInternalAccounts(query?: MeListInternalAccountsParams | null | undefined, options?: RequestOptions): PagePromise; } export interface MeCreateTransferInParams { /** * Body param: Destination internal account details */ destination: TransferInAPI.InternalAccountReference; /** * Body param: Source external account details */ source: TransferInAPI.ExternalAccountReference; /** * Body param: Amount in the smallest unit of the currency (e.g., cents for * USD/EUR, satoshis for BTC) */ amount?: number; /** * Header param: A unique identifier for the request. If the same key is sent * multiple times, the server will return the same response as the first request. */ 'Idempotency-Key'?: string; } export interface MeCreateTransferOutParams { /** * Body param: Destination external account details */ destination: TransferInAPI.ExternalAccountReference; /** * Body param: Source internal account details */ source: TransferInAPI.InternalAccountReference; /** * Body param: Amount in the smallest unit of the currency (e.g., cents for * USD/EUR, satoshis for BTC) */ amount?: number; /** * Header param: A unique identifier for the request. If the same key is sent * multiple times, the server will return the same response as the first request. */ 'Idempotency-Key'?: string; } export interface MeListInternalAccountsParams extends DefaultPaginationParams { /** * Filter by currency code */ currency?: string; /** * Maximum number of results to return (default 20, max 100) */ limit?: number; /** * Filter by internal account type. Use `EMBEDDED_WALLET` to find the * self-custodial wallet provisioned for the customer, or `INTERNAL_FIAT` / * `INTERNAL_CRYPTO` for platform-managed holding accounts. */ type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; } export declare namespace Me { export { type MeCreateTransferInParams as MeCreateTransferInParams, type MeCreateTransferOutParams as MeCreateTransferOutParams, type MeListInternalAccountsParams as MeListInternalAccountsParams, }; export { Transactions as Transactions, type TransactionListParams as TransactionListParams }; export { Quotes as Quotes, type QuoteCreateParams as QuoteCreateParams, type QuoteExecuteParams as QuoteExecuteParams, }; export { ExternalAccounts as ExternalAccounts, type ExternalAccountListParams as ExternalAccountListParams, type ExternalAccountAddParams as ExternalAccountAddParams, }; export { Actions as Actions, type ActionListParams as ActionListParams }; } export { type InternalAccountsDefaultPagination }; //# sourceMappingURL=me.d.ts.map