import type * as Address from 'ox/Address'; import * as Hex from 'ox/Hex'; import type * as z from 'zod/mini'; import type * as Account from '../../viem/Account.js'; import type * as Key from '../../viem/Key.js'; import type { RelayClient } from '../../viem/RelayClient.js'; import type * as Chains from '../Chains.js'; import type * as RpcSchema from '../RpcSchema.js'; import * as Call from './call.js'; import type * as PermissionsRequest from './permissionsRequest.js'; import type * as Porto from './porto.js'; import type * as Capabilities from './schema/capabilities.js'; import type * as RpcRequest from './schema/request.js'; import type * as Token from './schema/token.js'; import type { Assign, PartialBy } from './types.js'; export type ActionsInternal = Pick, 'config' | 'store'> & { /** Viem Client. */ client: RelayClient; /** RPC Request. */ request: RpcRequest.Request; }; type PrepareCallsContext = { calls?: readonly Call.Call[] | undefined; nonce?: bigint | undefined; [key: string]: unknown; }; export type Mode = { actions: { addFunds: (parameters: { /** Address to add funds to (optional for guest checkout). */ address?: Address.Address | undefined; /** Internal properties. */ internal: ActionsInternal; /** Token to add funds to. */ token?: Address.Address | undefined; /** Amount to add. */ value?: string | undefined; }) => Promise<{ id: Hex.Hex; }>; createAccount: (parameters: { /** Admins to grant. */ admins?: readonly Pick[] | undefined; /** Whether to link `label` to account address as email. */ email?: boolean | undefined; /** Pre-generated EOA to use for account creation. If not provided, a random one will be generated. */ eoa?: Account.Account<'privateKey'> | undefined; /** Internal properties. */ internal: ActionsInternal; /** Label to associate with the WebAuthn credential. */ label?: string | undefined; /** Permissions to grant. */ permissions?: PermissionsRequest.PermissionsRequest | undefined; /** Adds support for offchain authentication using ERC-4361. */ signInWithEthereum?: Capabilities.signInWithEthereum.Request | undefined; }) => Promise<{ /** Account. */ account: Account.Account & { signInWithEthereum?: { message: string; signature: Hex.Hex; } | undefined; }; }>; disconnect?: ((parameters: { /** Internal properties. */ internal: ActionsInternal; }) => Promise) | undefined; getAccountVersion: (parameters: { /** Address of the account to get the version of. */ address: Address.Address; /** Internal properties. */ internal: ActionsInternal; }) => Promise<{ /** Latest version. */ latest: string; /** Current version. */ current: string; }>; getAssets: (parameters: RpcRequest.wallet_getAssets.Parameters & { /** Internal properties. */ internal: ActionsInternal; }) => Promise; getCallsStatus: (parameters: { /** ID of the calls to get the status of. */ id: Hex.Hex; /** Internal properties. */ internal: ActionsInternal; }) => Promise>; getCallsHistory: (parameters: RpcSchema.wallet_getCallsHistory.Parameters & { /** Internal properties. */ internal: ActionsInternal; }) => Promise; getCapabilities: (parameters: { /** Chain IDs to get the capabilities for. */ chainIds?: readonly Hex.Hex[] | undefined; /** Internal properties. */ internal: ActionsInternal; }) => Promise>; getKeys: (parameters: { /** Account to get the keys for. */ account: Account.Account; /** Chain IDs to get the keys for. */ chainIds?: readonly number[] | undefined; /** Internal properties. */ internal: ActionsInternal; }) => Promise; grantAdmin: (parameters: { /** Account to grant admin for. */ account: Account.Account; /** Internal properties. */ internal: ActionsInternal; /** Fee token to use for execution. If not provided, the native token (e.g. ETH) will be used. */ feeToken?: Token.Symbol | Address.Address | undefined; /** Key to authorize as an admin. */ key: Key.from.Value; }) => Promise<{ /** Key the admin is granted to. */ key: Key.Key; }>; grantPermissions: (parameters: { /** Account to grant permissions for. */ account: Account.Account; /** Internal properties. */ internal: ActionsInternal; /** Permissions to grant. */ permissions?: PermissionsRequest.PermissionsRequest | undefined; }) => Promise<{ /** Key the permissions are granted to. */ key: Key.Key; }>; loadAccounts: (parameters: { /** Address of the account to load. */ address?: Hex.Hex | undefined; /** Key to use to load an existing account. */ key?: { /** Credential ID. May be `undefined` when the key is not a WebAuthn credential. */ credentialId?: string | undefined; /** Public key. */ publicKey: Hex.Hex; } | undefined; /** Internal properties. */ internal: ActionsInternal; /** Permissions to grant. */ permissions?: PermissionsRequest.PermissionsRequest | undefined; /** Adds support for offchain authentication using ERC-4361. */ signInWithEthereum?: Capabilities.signInWithEthereum.Request | undefined; }) => Promise<{ /** Accounts. */ accounts: readonly (Account.Account & { signInWithEthereum?: { message: string; signature: Hex.Hex; } | undefined; })[]; }>; prepareCalls: (parameters: { /** Account to execute the calls with. */ account: Account.Account; /** Calls to execute. */ calls: readonly Call.Call[]; /** Key that will be used to sign over the digest. */ key?: Pick | undefined; /** Fee token to use for execution. If not provided, the native token (e.g. ETH) will be used. */ feeToken?: Token.Symbol | Address.Address | undefined; /** Internal properties. */ internal: ActionsInternal; /** Merchant RPC URL. */ merchantUrl?: string | undefined; /** Required funds to execute the calls. */ requiredFunds?: RpcSchema.wallet_prepareCalls.Capabilities['requiredFunds'] | undefined; }) => Promise<{ /** Account to execute the calls with. */ account: Account.Account; /** Chain ID. */ chainId?: number | undefined; /** Capabilities. */ capabilities?: RpcSchema.wallet_prepareCalls.Response['capabilities'] | undefined; /** Context for `sendPreparedCalls` */ context: PrepareCallsContext; /** Digest to sign. */ digest: Hex.Hex; /** Key that will sign over the digest. */ key: Pick; /** EIP-712 typed data. */ typedData: RpcSchema.wallet_prepareCalls.Response['typedData']; }>; prepareUpgradeAccount: (parameters: { /** Address of the account to import. */ address: Address.Address; /** Whether to link `label` to account address as email. */ email?: boolean | undefined; /** Label to associate with the account. */ label?: string | undefined; /** Internal properties. */ internal: ActionsInternal; /** Permissions to grant. */ permissions?: PermissionsRequest.PermissionsRequest | undefined; }) => Promise<{ /** Digests to sign. */ digests: { auth: Hex.Hex; exec: Hex.Hex; }; /** Filled context for the `createAccount` implementation. */ context: unknown; }>; revokeAdmin: (parameters: { /** Account to revoke the permissions for. */ account: Account.Account; /** Fee token to use for execution. If not provided, the native token (e.g. ETH) will be used. */ feeToken?: Token.Symbol | Address.Address | undefined; /** ID of the admin to revoke. */ id: Hex.Hex; /** Internal properties. */ internal: ActionsInternal; }) => Promise; revokePermissions: (parameters: { /** Account to revoke the permissions for. */ account: Account.Account; /** Fee token to use for execution. If not provided, the native token (e.g. ETH) will be used. */ feeToken?: Token.Symbol | Address.Address | undefined; /** ID of the permissions to revoke. */ id: Hex.Hex; /** Internal properties. */ internal: ActionsInternal; }) => Promise; sendCalls: (parameters: { /** Account to execute the calls with (optional for guest checkout). */ account?: Account.Account | undefined; /** Whether the returned bundle identifier is the transaction hash. */ asTxHash?: boolean | undefined; /** Calls to execute. */ calls: readonly Call.Call[]; /** Chain ID to execute the calls on. */ chainId?: number | undefined; /** Fee token to use for execution. If not provided, the native token (e.g. ETH) will be used. */ feeToken?: Token.Symbol | Address.Address | undefined; /** Internal properties. */ internal: ActionsInternal; /** Required funds to execute the calls. */ requiredFunds?: RpcSchema.wallet_prepareCalls.Capabilities['requiredFunds'] | undefined; /** Permissions ID to use to execute the calls. */ permissionsId?: Hex.Hex | null | undefined; /** Merchant RPC URL. */ merchantUrl?: string | undefined; }) => Promise<{ id: Hex.Hex; }>; sendPreparedCalls: (parameters: { /** Account. */ account: Account.Account; /** Context. */ context: PrepareCallsContext; /** Key. */ key: Pick; /** Signature for execution. */ signature: Hex.Hex; /** Internal properties. */ internal: ActionsInternal; }) => Promise; signPersonalMessage: (parameters: { /** Account to sign the message with. */ account: Account.Account; /** Data to sign. */ data: Hex.Hex; /** Internal properties. */ internal: ActionsInternal; }) => Promise; signTypedData: (parameters: { /** Account to sign the message with. */ account: Account.Account; /** Data to sign. */ data: string; /** Internal properties. */ internal: ActionsInternal; }) => Promise; switchChain?: ((parameters: { /** Chain ID to switch to. */ chainId: number; /** Internal properties. */ internal: ActionsInternal; }) => Promise) | undefined; upgradeAccount: (parameters: { /** Account to upgrade. */ account: Account.Account; /** Preparation context (from `prepareUpgradeAccount`). */ context: unknown; /** Internal properties. */ internal: ActionsInternal; /** Preparation signatures (from `prepareUpgradeAccount`). */ signatures: { auth: Hex.Hex; exec: Hex.Hex; }; }) => Promise<{ /** Account. */ account: Account.Account; }>; verifyEmail: (parameters: { /** Account to sign the email + token with. */ account: Account.Account; /** Chain ID to verify against. */ chainId: number; /** Email to link to wallet address. */ email: string; /** Generated token value. */ token: string; /** Wallet address to link to email. */ walletAddress: Address.Address; /** Internal properties. */ internal: ActionsInternal; }) => Promise; }; config?: unknown | undefined; name: string; setup: (parameters: { /** Internal properties. */ internal: Porto.Internal; }) => () => void; }; /** * Instantiates a mode. * * @param mode - Mode. * @returns Mode. */ export declare function from(mode: mode | from.Parameters): Assign; export declare namespace from { type Parameters = PartialBy; } /** * Returns the calls needed to authorize the given keys (and permissions). * * @param keys - Keys to authorize. * @returns Calls to authorize the given keys. */ export declare function getAuthorizeCalls(keys: readonly Key.Key[]): readonly Call.Call[]; /** * * @param parameters * @returns */ export declare function getAuthorizedExecuteKey(parameters: { account: Account.Account; calls: readonly Call.Call[]; permissionsId?: Hex.Hex | null | undefined; }): Promise; export {}; //# sourceMappingURL=mode.d.ts.map