/** * Actions for Porto Relay. * * @see https://porto.sh/relay */ import * as AbiError from 'ox/AbiError'; import type * as Address from 'ox/Address'; import * as Errors from 'ox/Errors'; import * as Hex from 'ox/Hex'; import { BaseError, type Calls, type Chain, type Client, type Narrow, type Transport, type ValueOf } from 'viem'; import * as z from 'zod/mini'; import * as RpcSchema from '../../core/internal/relay/rpcSchema.js'; import * as u from '../../core/internal/schema/utils.js'; import type { IsUndefined, OneOf } from '../../core/internal/types.js'; import type { sendCalls } from '../RelayActions.js'; import type { GetChainParameter } from './utils.js'; /** * Gets the authorization for a given address. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ export declare function getAuthorization(client: Client, parameters: getAuthorization.Parameters): Promise; export declare namespace getAuthorization { type Parameters = RpcSchema.wallet_getAuthorization.Parameters; type ReturnType = RpcSchema.wallet_getAuthorization.Response; } /** * Gets the capabilities for a given chain ID. * * @example * TODO * * @param client - The client to use. * @param options - Options. * @returns Result. */ export declare function getCapabilities(client: Client, options?: getCapabilities.Options): Promise>; export declare namespace getCapabilities { type Options = { /** * Whether to return the raw, non-decoded response. * @default false */ raw?: raw | boolean | undefined; } & OneOf<{ /** * Chain IDs to get the capabilities for. * `"all"` will return the capabilities for all supported chains. */ chainIds?: chainIds | 'all' | readonly number[] | undefined; } | { /** * Chain ID to get the capabilities for. */ chainId?: number | undefined; }>; type ReturnType : RpcSchema.wallet_getCapabilities.Response> = IsUndefined extends true ? ValueOf : value; type ErrorType = parseSchemaError.ErrorType | Errors.GlobalErrorType; } /** * Get assets owned by user in given chain IDs. */ export declare function getAssets(client: Client, parameters: getAssets.Parameters): Promise; export declare namespace getAssets { type Parameters = RpcSchema.wallet_getAssets.Parameters; type ReturnType = RpcSchema.wallet_getAssets.Response; } /** * Requests faucet funds to be sent to an address on the Relay. */ export declare function addFaucetFunds(client: Client, parameters: addFaucetFunds.Parameters): Promise; export declare namespace addFaucetFunds { type Parameters = Omit & GetChainParameter; } /** * Gets the status of a call bundle. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ export declare function getCallsStatus(client: Client, parameters: getCallsStatus.Parameters): Promise; export declare namespace getCallsStatus { type Parameters = { id: Hex.Hex; }; type ReturnType = RpcSchema.wallet_getCallsStatus.Response; type ErrorType = parseSchemaError.ErrorType | Errors.GlobalErrorType; } /** * Gets the call history for an account. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ export declare function getCallsHistory(client: Client, parameters: getCallsHistory.Parameters): Promise; export declare namespace getCallsHistory { type Parameters = RpcSchema.wallet_getCallsHistory.Parameters; type ReturnType = RpcSchema.wallet_getCallsHistory.Response; type ErrorType = parseSchemaError.ErrorType | Errors.GlobalErrorType; } /** * Gets the keys for a given account. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ export declare function getKeys(client: Client, parameters: getKeys.Parameters): Promise; export declare namespace getKeys { type Parameters = RpcSchema.wallet_getKeys.Parameters; type ReturnType = RpcSchema.wallet_getKeys.Response; type ErrorType = parseSchemaError.ErrorType | Errors.GlobalErrorType; } /** * Gets the health of the RPC. * * @example * TODO * * @param client - The client to use. * @returns Result. */ export declare function health(client: Client): Promise; export declare namespace health { type ReturnType = RpcSchema.health.Response; type ErrorType = Errors.GlobalErrorType; } /** * Prepares a call bundle. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ export declare function prepareCalls(client: Client, parameters: prepareCalls.Parameters): Promise; export declare namespace prepareCalls { type Parameters = { address?: Address.Address | undefined; calls: Calls>; capabilities?: RpcSchema.wallet_prepareCalls.Capabilities | undefined; key: RpcSchema.wallet_prepareCalls.Parameters['key']; } & GetChainParameter; type ReturnType = RpcSchema.wallet_prepareCalls.Response & { _raw: z.input; }; type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType; } /** * Prepares an account upgrade. * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ export declare function prepareUpgradeAccount(client: Client, parameters: prepareUpgradeAccount.Parameters): Promise; export declare namespace prepareUpgradeAccount { type Parameters = RpcSchema.wallet_prepareUpgradeAccount.Parameters['capabilities'] & Omit & GetChainParameter; type ReturnType = RpcSchema.wallet_prepareUpgradeAccount.Response; type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType; } /** * Broadcasts a signed call bundle. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ export declare function sendPreparedCalls(client: Client, parameters: sendPreparedCalls.Parameters): Promise; export declare namespace sendPreparedCalls { type Parameters = RpcSchema.wallet_sendPreparedCalls.Parameters; type ReturnType = RpcSchema.wallet_sendPreparedCalls.Response; type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType; } /** * NOTE: SHOULD ONLY BE USED ON SERVER. * * Gets onramp contact info for address. * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ export declare function getOnrampContactInfo(client: Client, parameters: getOnrampContactInfo.Parameters): Promise; export declare namespace getOnrampContactInfo { type Parameters = RpcSchema.account_getOnrampContactInfo.Parameters; type ReturnType = RpcSchema.account_getOnrampContactInfo.Response; type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType; } /** * Gets onramp status for address * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ export declare function onrampStatus(client: Client, parameters: onrampStatus.Parameters): Promise; export declare namespace onrampStatus { type Parameters = RpcSchema.account_onrampStatus.Parameters; type ReturnType = RpcSchema.account_onrampStatus.Response; type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType; } /** * Resends phone verification for address * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ export declare function resendVerifyPhone(client: Client, parameters: resendVerifyPhone.Parameters): Promise; export declare namespace resendVerifyPhone { type Parameters = RpcSchema.account_resendVerifyPhone.Parameters; type ReturnType = RpcSchema.account_resendVerifyPhone.Response; type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType; } /** * Sets email for address * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ export declare function setEmail(client: Client, parameters: setEmail.Parameters): Promise; export declare namespace setEmail { type Parameters = RpcSchema.account_setEmail.Parameters; type ReturnType = RpcSchema.account_setEmail.Response; type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType; } /** * Sets phone for address * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ export declare function setPhone(client: Client, parameters: setPhone.Parameters): Promise; export declare namespace setPhone { type Parameters = RpcSchema.account_setPhone.Parameters; type ReturnType = RpcSchema.account_setPhone.Response; type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType; } /** * Submits an account upgrade to the Relay. * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ export declare function upgradeAccount(client: Client, parameters: upgradeAccount.Parameters): Promise; export declare namespace upgradeAccount { type Parameters = RpcSchema.wallet_upgradeAccount.Parameters; type ReturnType = RpcSchema.wallet_upgradeAccount.Response; type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType; } /** * Verifies email for address * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ export declare function verifyEmail(client: Client, parameters: verifyEmail.Parameters): Promise; export declare namespace verifyEmail { type Parameters = RpcSchema.account_verifyEmail.Parameters; type ReturnType = RpcSchema.account_verifyEmail.Response; type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType; } /** * Verifies email for address * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ export declare function verifyPhone(client: Client, parameters: verifyPhone.Parameters): Promise; export declare namespace verifyPhone { type Parameters = RpcSchema.account_verifyPhone.Parameters; type ReturnType = RpcSchema.account_verifyPhone.Response; type ErrorType = parseSchemaError.ErrorType | parseExecutionError.ErrorType | Errors.GlobalErrorType; } /** * Verifies a prepare calls response. * * @param client - Client to use. * @param parameters - Parameters. * @returns Whether or not the response is valid. */ export declare function verifyPrepareCallsResponse(client: Client, parameters: verifyPrepareCallsResponse.Parameters): Promise; export declare namespace verifyPrepareCallsResponse { type Parameters = { response: z.input; signature: Hex.Hex; }; } /** * Verifies a signature. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ export declare function verifySignature(client: Client, parameters: verifySignature.Parameters): Promise; export declare namespace verifySignature { type Parameters = Omit & { address: Address.Address; } & GetChainParameter; type ReturnType = RpcSchema.wallet_verifySignature.Response; type ErrorType = parseSchemaError.ErrorType | Errors.GlobalErrorType; } export declare function parseExecutionError(e: unknown, { calls }?: { calls?: sendCalls.Parameters['calls'] | undefined; }): void; export declare function sortKeys(value: value): value; export declare namespace parseExecutionError { type ErrorType = ExecutionError | Errors.GlobalErrorType; } /** Thrown when schema validation fails. */ export declare function parseSchemaError(e: unknown): void; export declare namespace parseSchemaError { type ErrorType = u.ValidationError | Errors.GlobalErrorType; } /** Thrown when the execution fails. */ export declare class ExecutionError extends Errors.BaseError { readonly name = "Rpc.ExecutionError"; abiError?: AbiError.AbiError | undefined; constructor(cause: BaseError & { abiError?: AbiError.AbiError | undefined; }); } //# sourceMappingURL=relayActions.d.ts.map