import { APIResource } from "../core/resource.mjs"; import * as IntentsAPI from "./intents.mjs"; import * as KeyQuorumsAPI from "./key-quorums.mjs"; import * as PoliciesAPI from "./policies.mjs"; import * as SharedAPI from "./shared.mjs"; import * as WalletsAPI from "./wallets/wallets.mjs"; export declare class Intents extends APIResource { } /** * Common fields for intent action execution results. */ export interface BaseActionResult { /** * Unix timestamp when the action was executed */ executed_at: number; /** * HTTP status code from the action execution */ status_code: number; /** * Display name of the key quorum that authorized execution */ authorized_by_display_name?: string; /** * ID of the key quorum that authorized execution */ authorized_by_id?: string; } /** * Common fields shared by all intent response types. */ export interface BaseIntentResponse { /** * Detailed authorization information including key quorum members, thresholds, and * signature status */ authorization_details: Array; /** * Unix timestamp when the intent was created */ created_at: number; /** * Display name of the user who created the intent */ created_by_display_name: string; /** * Whether this intent has a custom expiry time set by the client. If false, the * intent expires after a default duration. */ custom_expiry: boolean; /** * Unix timestamp when the intent expires */ expires_at: number; /** * Unique ID for the intent */ intent_id: string; /** * ID of the resource being modified (wallet_id, policy_id, etc) */ resource_id: string; /** * Current status of an intent. */ status: IntentStatus; /** * ID of the user who created the intent. If undefined, the intent was created * using the app secret */ created_by_id?: string; /** * Human-readable reason for dismissal, present when status is 'dismissed' */ dismissal_reason?: string; /** * Unix timestamp when the intent was dismissed, present when status is 'dismissed' */ dismissed_at?: number; /** * Unix timestamp when the intent was rejected, present when status is 'rejected' */ rejected_at?: number; } /** * Authorization quorum for an intent */ export interface IntentAuthorization { /** * Members in this authorization quorum */ members: Array; /** * Number of signatures required to satisfy this quorum */ threshold: number; /** * Display name of the key quorum */ display_name?: string; } /** * A leaf member (user or key) of a nested key quorum in an intent authorization. */ export type IntentAuthorizationKeyQuorumMember = IntentAuthorizationKeyQuorumMember.UserMember | IntentAuthorizationKeyQuorumMember.KeyMember; export declare namespace IntentAuthorizationKeyQuorumMember { interface UserMember { /** * Unix timestamp when this member signed, or null if not yet signed. */ signed_at: number | null; type: 'user'; /** * User ID of the key quorum member */ user_id: string; } interface KeyMember { /** * Public key of the key quorum member */ public_key: string; /** * Unix timestamp when this member signed, or null if not yet signed. */ signed_at: number | null; type: 'key'; } } /** * A member of an intent authorization quorum. Can be a user, key, or nested key * quorum. */ export type IntentAuthorizationMember = IntentAuthorizationMember.UserMember | IntentAuthorizationMember.KeyMember | IntentAuthorizationMember.KeyQuorumMember; export declare namespace IntentAuthorizationMember { interface UserMember { /** * Unix timestamp when this member signed, or null if not yet signed. */ signed_at: number | null; type: 'user'; /** * User ID of the key quorum member */ user_id: string; } interface KeyMember { /** * Public key of the key quorum member */ public_key: string; /** * Unix timestamp when this member signed, or null if not yet signed. */ signed_at: number | null; type: 'key'; } interface KeyQuorumMember { /** * ID of the child key quorum member */ key_quorum_id: string; /** * Members of this child quorum */ members: Array; /** * Number of signatures required from this child quorum */ threshold: number; /** * Whether this child key quorum has met its signature threshold */ threshold_met: boolean; type: 'key_quorum'; /** * Display name for the child key quorum (if any) */ display_name?: string; } } /** * Request body for authorizing an intent. */ export interface IntentAuthorizeInput { /** * Signature authorizing the intent. */ signature: string; /** * Unix timestamp (in milliseconds) when the signature was created. Used to verify * the signature was created when the signing key was valid. */ timestamp: number; } /** * Headers required to create an intent. */ export interface IntentCreationHeaders { /** * ID of your Privy app. */ 'privy-app-id': string; /** * Request expiry. Value is a Unix timestamp in milliseconds representing the * deadline by which the request must be processed. */ 'privy-request-expiry'?: string; } /** * Response for an intent object */ export type IntentResponse = RpcIntentResponse | TransferIntentResponse | WalletIntentResponse | PolicyIntentResponse | RuleIntentResponse | KeyQuorumIntentResponse; /** * Current status of an intent. */ export type IntentStatus = 'pending' | 'processing' | 'executed' | 'failed' | 'expired' | 'rejected' | 'dismissed'; /** * Type of intent. */ export type IntentType = 'KEY_QUORUM' | 'POLICY' | 'RULE' | 'RPC' | 'TRANSFER' | 'WALLET'; /** * Response for a key quorum intent */ export interface KeyQuorumIntentResponse extends BaseIntentResponse { intent_type: 'KEY_QUORUM'; /** * The original key quorum update request that would be sent to the key quorum * endpoint */ request_details: KeyQuorumIntentResponse.RequestDetails; /** * Result of key quorum update execution (only present if status is 'executed' or * 'failed') */ action_result?: BaseActionResult; /** * A key quorum for authorizing wallet operations. */ current_resource_data?: KeyQuorumsAPI.KeyQuorum; } export declare namespace KeyQuorumIntentResponse { /** * The original key quorum update request that would be sent to the key quorum * endpoint */ interface RequestDetails { /** * Request input for updating an existing key quorum. At least one field must be * provided. */ body: KeyQuorumsAPI.KeyQuorumUpdateRequestBody; method: 'PATCH'; url: string; } } /** * Request details for a policy intent. */ export interface PolicyIntentRequestDetails { body: PolicyIntentRequestDetails.Body; method: 'PATCH'; url: string; } export declare namespace PolicyIntentRequestDetails { interface Body { /** * Name to assign to policy. */ name?: string; /** * The owner of the resource, specified as a Privy user ID, a P-256 public key, or * null to remove the current owner. */ owner?: SharedAPI.OwnerInput | null; /** * The key quorum ID to set as the owner of the resource. If you provide this, do * not specify an owner. */ owner_id?: SharedAPI.OwnerIDInput | null; rules?: Array; } } /** * Response for a policy intent */ export interface PolicyIntentResponse extends BaseIntentResponse { intent_type: 'POLICY'; /** * The original policy update request that would be sent to the policy endpoint */ request_details: PolicyIntentResponse.RequestDetails; /** * Result of policy update execution (only present if status is 'executed' or * 'failed') */ action_result?: BaseActionResult; /** * A policy for controlling wallet operations. */ current_resource_data?: PoliciesAPI.Policy; } export declare namespace PolicyIntentResponse { /** * The original policy update request that would be sent to the policy endpoint */ interface RequestDetails { body: RequestDetails.Body; method: 'PATCH'; url: string; } namespace RequestDetails { interface Body { /** * Name to assign to policy. */ name?: string; /** * The owner of the resource, specified as a Privy user ID, a P-256 public key, or * null to remove the current owner. */ owner?: SharedAPI.OwnerInput | null; /** * The key quorum ID to set as the owner of the resource. If you provide this, do * not specify an owner. */ owner_id?: SharedAPI.OwnerIDInput | null; rules?: Array; } } } /** * Request details for an RPC intent. */ export interface RpcIntentRequestDetails { /** * Request body for wallet RPC operations, discriminated by method. */ body: WalletsAPI.WalletRpcRequestBody; method: 'POST'; url: string; } /** * Response for an RPC intent */ export interface RpcIntentResponse extends BaseIntentResponse { intent_type: 'RPC'; /** * The original RPC request that would be sent to the wallet endpoint */ request_details: RpcIntentResponse.RequestDetails; /** * Result of RPC execution (only present if status is 'executed' or 'failed') */ action_result?: BaseActionResult; /** * A wallet managed by Privy's wallet infrastructure. */ current_resource_data?: WalletsAPI.Wallet; } export declare namespace RpcIntentResponse { /** * The original RPC request that would be sent to the wallet endpoint */ interface RequestDetails { /** * Request body for wallet RPC operations, discriminated by method. */ body: WalletsAPI.WalletRpcRequestBody; method: 'POST'; url: string; } } /** * Response for a delete rule intent */ export interface RuleDeleteIntentResponse extends BaseIntentResponse { intent_type: 'RULE'; /** * Request details for deleting a rule via intent. */ request_details: RuleIntentDeleteRequestDetails; /** * Result of rule execution (only present if status is 'executed' or 'failed') */ action_result?: BaseActionResult; /** * A rule that defines the conditions and action to take if the conditions are * true. */ current_resource_data?: PoliciesAPI.PolicyRuleResponse; /** * A policy for controlling wallet operations. */ policy?: PoliciesAPI.Policy; } /** * Request details for creating a rule via intent. */ export interface RuleIntentCreateRequestDetails { /** * The rules that apply to each method the policy covers. */ body: PoliciesAPI.PolicyRuleRequestBody; method: 'POST'; url: string; } /** * Request details for deleting a rule via intent. */ export interface RuleIntentDeleteRequestDetails { method: 'DELETE'; url: string; body?: RuleIntentDeleteRequestDetails.Body; } export declare namespace RuleIntentDeleteRequestDetails { interface Body { } } /** * The original rule request. Method is POST (create), PATCH (update), or DELETE * (delete) */ export type RuleIntentRequestDetails = RuleIntentCreateRequestDetails | RuleIntentUpdateRequestDetails | RuleIntentDeleteRequestDetails; /** * Response for a rule intent */ export interface RuleIntentResponse extends BaseIntentResponse { intent_type: 'RULE'; /** * The original rule request. Method is POST (create), PATCH (update), or DELETE * (delete) */ request_details: RuleIntentRequestDetails; /** * Result of rule execution (only present if status is 'executed' or 'failed') */ action_result?: BaseActionResult; /** * A rule that defines the conditions and action to take if the conditions are * true. */ current_resource_data?: PoliciesAPI.PolicyRuleResponse; /** * A policy for controlling wallet operations. */ policy?: PoliciesAPI.Policy; } /** * Request details for updating a rule via intent. */ export interface RuleIntentUpdateRequestDetails { /** * The rules that apply to each method the policy covers. */ body: PoliciesAPI.PolicyRuleRequestBody; method: 'PATCH'; url: string; } /** * Response for a create or update rule intent */ export interface RuleMutateIntentResponse extends BaseIntentResponse { intent_type: 'RULE'; /** * The original rule request. Method is POST (create), PATCH (update), or DELETE * (delete) */ request_details: RuleIntentRequestDetails; /** * Result of rule execution (only present if status is 'executed' or 'failed') */ action_result?: BaseActionResult; /** * A rule that defines the conditions and action to take if the conditions are * true. */ current_resource_data?: PoliciesAPI.PolicyRuleResponse; /** * A policy for controlling wallet operations. */ policy?: PoliciesAPI.Policy; } /** * Request details for a transfer intent. */ export interface TransferIntentRequestDetails { /** * Request body for initiating a sponsored token transfer from an embedded wallet. */ body: WalletsAPI.TransferRequestBody; method: 'POST'; url: string; } /** * Response for a transfer intent */ export interface TransferIntentResponse extends BaseIntentResponse { intent_type: 'TRANSFER'; /** * The original transfer request that would be sent to the wallet transfer endpoint */ request_details: TransferIntentResponse.RequestDetails; /** * Result of transfer execution (only present if intent status is 'executed' or * 'failed') */ action_result?: BaseActionResult; /** * A wallet managed by Privy's wallet infrastructure. */ current_resource_data?: WalletsAPI.Wallet; } export declare namespace TransferIntentResponse { /** * The original transfer request that would be sent to the wallet transfer endpoint */ interface RequestDetails { /** * Request body for initiating a sponsored token transfer from an embedded wallet. */ body: WalletsAPI.TransferRequestBody; method: 'POST'; url: string; } } /** * Response for a wallet intent */ export interface WalletIntentResponse extends BaseIntentResponse { intent_type: 'WALLET'; /** * The original wallet update request that would be sent to the wallet endpoint */ request_details: WalletIntentResponse.RequestDetails; /** * Result of wallet update execution (only present if status is 'executed' or * 'failed') */ action_result?: BaseActionResult; /** * A wallet managed by Privy's wallet infrastructure. */ current_resource_data?: WalletsAPI.Wallet; } export declare namespace WalletIntentResponse { /** * The original wallet update request that would be sent to the wallet endpoint */ interface RequestDetails { body: RequestDetails.Body; method: 'PATCH'; url: string; } namespace RequestDetails { interface Body { /** * Additional signers for the wallet. */ additional_signers?: WalletsAPI.AdditionalSignerInput; authorization_key_ids?: Array; authorization_threshold?: number; display_name?: string | null; /** * The owner of the resource, specified as a Privy user ID, a P-256 public key, or * null to remove the current owner. */ owner?: SharedAPI.OwnerInput | null; /** * The key quorum ID to set as the owner of the resource. If you provide this, do * not specify an owner. */ owner_id?: SharedAPI.OwnerIDInput | null; /** * An optional list of up to one policy ID to enforce on the wallet. */ policy_ids?: WalletsAPI.PolicyInput; } } } export declare namespace Intents { export { type BaseActionResult as BaseActionResult, type BaseIntentResponse as BaseIntentResponse, type IntentAuthorization as IntentAuthorization, type IntentAuthorizationKeyQuorumMember as IntentAuthorizationKeyQuorumMember, type IntentAuthorizationMember as IntentAuthorizationMember, type IntentAuthorizeInput as IntentAuthorizeInput, type IntentCreationHeaders as IntentCreationHeaders, type IntentResponse as IntentResponse, type IntentStatus as IntentStatus, type IntentType as IntentType, type KeyQuorumIntentResponse as KeyQuorumIntentResponse, type PolicyIntentRequestDetails as PolicyIntentRequestDetails, type PolicyIntentResponse as PolicyIntentResponse, type RpcIntentRequestDetails as RpcIntentRequestDetails, type RpcIntentResponse as RpcIntentResponse, type RuleDeleteIntentResponse as RuleDeleteIntentResponse, type RuleIntentCreateRequestDetails as RuleIntentCreateRequestDetails, type RuleIntentDeleteRequestDetails as RuleIntentDeleteRequestDetails, type RuleIntentRequestDetails as RuleIntentRequestDetails, type RuleIntentResponse as RuleIntentResponse, type RuleIntentUpdateRequestDetails as RuleIntentUpdateRequestDetails, type RuleMutateIntentResponse as RuleMutateIntentResponse, type TransferIntentRequestDetails as TransferIntentRequestDetails, type TransferIntentResponse as TransferIntentResponse, type WalletIntentResponse as WalletIntentResponse, }; } //# sourceMappingURL=intents.d.mts.map