import type * as Address from 'ox/Address'; import type * as Errors from 'ox/Errors'; import type * as Hex from 'ox/Hex'; import { type Calls, type Client, type Narrow, type Transport } from 'viem'; import type { Chain } from '../core/Chains.js'; import type * as Capabilities from '../core/internal/relay/schema/capabilities.js'; import type * as Quotes from '../core/internal/relay/schema/quotes.js'; import type { OneOf, PartialBy, RequiredBy } from '../core/internal/types.js'; import type { relay } from '../core/Mode.js'; import * as Account from './Account.js'; import * as RelayActions from './internal/relayActions.js'; import type { GetAccountParameter, GetChainParameter } from './internal/utils.js'; import * as Key from './Key.js'; export { addFaucetFunds, getAssets, getAuthorization, getCallsHistory, getCallsStatus, getCapabilities, health, verifySignature, } from './internal/relayActions.js'; /** * Creates a new Porto Account using an ephemeral EOA. * * @example * TODO * * @param client - Client. * @param parameters - Parameters. * @returns Result. */ export declare function createAccount(client: Client, parameters: createAccount.Parameters): Promise; export declare namespace createAccount { type Parameters = Omit, 'account'>; type ReturnType = RequiredBy; } /** * Gets the keys for an account. * * @example * TODO * * @param client - Client. * @param parameters - Parameters. * @returns Account keys. */ export declare function getKeys(client: Client, parameters: getKeys.Parameters): Promise; export declare namespace getKeys { type Parameters = GetAccountParameter & Pick; type ReturnType = readonly Key.Key[]; type ErrorType = RelayActions.getKeys.ErrorType; } /** * 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 = RelayActions.getOnrampContactInfo.Parameters; type ReturnType = RelayActions.getOnrampContactInfo.ReturnType; type ErrorType = RelayActions.getOnrampContactInfo.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 = RelayActions.onrampStatus.Parameters; type ReturnType = RelayActions.onrampStatus.ReturnType; type ErrorType = RelayActions.onrampStatus.ErrorType | Errors.GlobalErrorType; } /** * Prepares the digest to sign over and fills the request to send a call bundle. * * @example * TODO * * @param client - Client. * @param parameters - Prepare call bundle parameters. * @returns Prepared properties. */ export declare function prepareCalls(client: Client, parameters: prepareCalls.Parameters): Promise; export declare namespace prepareCalls { type Parameters = GetChainParameter & GetAccountParameter & { /** Additional keys to authorize on the account. */ authorizeKeys?: readonly Key.Key[] | undefined; /** Calls to prepare. */ calls?: Calls> | undefined; /** Key that will be used to sign the calls. */ key?: Pick | undefined; /** * Indicates if the bundle is "pre-calls", and should be executed before * the main bundle. * * Accepts: * - `true`: Indicates this is pre-calls. * - An array: Set of prepared pre-calls. */ preCalls?: true | readonly { context: prepareCalls.ReturnType['context']; signature: Hex.Hex; }[] | undefined; /** Required funds to execute the calls. */ requiredFunds?: Capabilities.requiredFunds.Request | undefined; /** Additional keys to revoke from the account. */ revokeKeys?: readonly Key.Key[] | undefined; /** Merchant RPC URL. */ merchantUrl?: string | undefined; } & Omit; type ReturnType = { capabilities: RelayActions.prepareCalls.ReturnType['capabilities'] & { quote: Quotes.Signed; }; context: RelayActions.prepareCalls.ReturnType['context']; digest: RelayActions.prepareCalls.ReturnType['digest']; key: Parameters['key']; typedData: RelayActions.prepareCalls.ReturnType['typedData']; }; type ErrorType = RelayActions.prepareCalls.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 = GetChainParameter & { /** Address of the account to upgrade. */ address: Address.Address; /** Keys to authorize. */ authorizeKeys: readonly Key.Key[]; /** Contract address to delegate to. */ delegation?: Address.Address | undefined; /** Fee token. */ feeToken?: Address.Address | undefined; }; type ReturnType = Omit & { context: RelayActions.prepareUpgradeAccount.ReturnType['context'] & { account: Account.Account; }; }; type ErrorType = RelayActions.prepareUpgradeAccount.ErrorType | Errors.GlobalErrorType; } /** * Resends phone verification code 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 = RelayActions.resendVerifyPhone.Parameters; type ReturnType = RelayActions.resendVerifyPhone.ReturnType; type ErrorType = RelayActions.resendVerifyPhone.ErrorType | Errors.GlobalErrorType; } /** * Broadcasts a call bundle to the Relay. * * @example * TODO * * @param client - Client. * @param parameters - Parameters. * @returns Bundle identifier. */ export declare function sendCalls(client: Client, parameters: sendCalls.Parameters): Promise; export declare namespace sendCalls { type Parameters = Omit & GetAccountParameter & GetChainParameter & { /** Calls to execute. */ calls?: Calls> | undefined; /** Key to sign the bundle with. */ key?: Key.Key | undefined; /** Calls to execute before the main bundle. */ preCalls?: readonly OneOf<{ context: prepareCalls.ReturnType['context']; signature: Hex.Hex; } | (Pick, 'authorizeKeys' | 'calls' | 'revokeKeys'> & { key: Key.Key; })>[] | undefined; /** Merchant RPC URL. */ merchantUrl?: string | undefined; webAuthn?: relay.Parameters['webAuthn']; }; type ReturnType = RelayActions.sendPreparedCalls.ReturnType; type ErrorType = RelayActions.sendPreparedCalls.ErrorType | Errors.GlobalErrorType; } export declare function signCalls(request: prepareCalls.ReturnType, options: signCalls.Options): Promise<`0x${string}`>; export declare namespace signCalls { type Options = OneOf<{ account: Account.Account; } | { key: Key.Key; }>; } export declare function sendPreparedCalls(client: Client, parameters: sendPreparedCalls.Parameters): Promise; export declare namespace sendPreparedCalls { type Parameters = { /** Capabilities. */ capabilities?: RelayActions.sendPreparedCalls.Parameters['capabilities'] | undefined; /** Context. */ context: prepareCalls.ReturnType['context']; /** Key. */ key?: Pick | undefined; /** Signature. */ signature: Hex.Hex; }; type ReturnType = RelayActions.sendPreparedCalls.ReturnType; type ErrorType = RelayActions.sendPreparedCalls.ErrorType; } /** * 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 = RelayActions.setEmail.Parameters; type ReturnType = RelayActions.setEmail.ReturnType; type ErrorType = RelayActions.setEmail.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 = RelayActions.setPhone.Parameters; type ReturnType = RelayActions.setPhone.ReturnType; type ErrorType = RelayActions.setPhone.ErrorType | Errors.GlobalErrorType; } /** * Broadcasts an account upgrade. * * @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 = OneOf>; type PreparedParameters = { context: prepareUpgradeAccount.ReturnType['context']; signatures: RelayActions.upgradeAccount.Parameters['signatures']; }; type UnpreparedParameters = PartialBy, 'address'>, 'authorizeKeys'> & { account: Account.Account<'privateKey'>; }; type ReturnType = RequiredBy; type ErrorType = RelayActions.upgradeAccount.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 = RelayActions.verifyEmail.Parameters; type ReturnType = RelayActions.verifyEmail.ReturnType; type ErrorType = RelayActions.verifyEmail.ErrorType | Errors.GlobalErrorType; } /** * Verifies phone 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 = RelayActions.verifyPhone.Parameters; type ReturnType = RelayActions.verifyPhone.ReturnType; type ErrorType = RelayActions.verifyPhone.ErrorType | Errors.GlobalErrorType; } export type Decorator = { /** * Creates a new Porto Account using an ephemeral EOA. * * @example * TODO * * @param client - Client. * @param parameters - Parameters. * @returns Result. */ createAccount: (parameters: createAccount.Parameters) => Promise; /** * Gets the status of a call bundle. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ getCallsStatus: (parameters: RelayActions.getCallsStatus.Parameters) => Promise; /** * Gets the call history for an account. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ getCallsHistory: (parameters: RelayActions.getCallsHistory.Parameters) => Promise; /** * Gets the capabilities for a given chain ID. * * @example * TODO * * @param client - The client to use. * @param options - Options. * @returns Result. */ getCapabilities: () => Promise>; /** * Gets the keys for a given account. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ getKeys: (parameters: getKeys.Parameters) => Promise; /** * Gets the health of the RPC. * * @example * TODO * * @param client - The client to use. * @returns Result. */ health: () => Promise; /** * Prepares a call bundle. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ prepareCalls: (parameters: prepareCalls.Parameters) => Promise; /** * Prepares an account upgrade. * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ prepareUpgradeAccount: (parameters: prepareUpgradeAccount.Parameters) => Promise; /** * Broadcasts a call bundle. * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ sendCalls: (parameters: sendCalls.Parameters) => Promise; /** * Broadcasts a signed call bundle. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ sendPreparedCalls: (parameters: sendPreparedCalls.Parameters) => Promise; /** * Broadcasts an account upgrade. * * @example * TODO * * @param client - Client to use. * @param parameters - Parameters. * @returns Result. */ upgradeAccount: (parameters: upgradeAccount.Parameters) => Promise; /** * Verifies a signature. * * @example * TODO * * @param client - The client to use. * @param parameters - Parameters. * @returns Result. */ verifySignature: (parameters: RelayActions.verifySignature.Parameters) => Promise; }; export declare function decorator(client: Client): Decorator; //# sourceMappingURL=RelayActions.d.ts.map