Skip to content
    hazBasehazBaseDocs
    HTTP API / WALLET CLIENT

    prepareOwnerOperation

    Inspect HTTP routes, arguments and responses used by @hazbase/kit/wallet. Additional authentication and passkey APIs are covered in the auth SDK reference and integration guide.

    https://api.hazbase.com@hazbase/kit 0.9.0JSON

    User-session, signature and permission requirements differ by API. Check the specifications below and the connection requirements of your API environment. Check API access requirements

    POST /api/wallet/operation/prepare

    Request

    @hazbase/kit/wallet
    prepareOwnerOperation(input: PrepareOwnerOperationInput): Promise<PrepareOwnerOperationResult>
    This SDK method does not automatically add a Bearer header. Check any environment-level access requirements separately.
    FieldTypeRequiredLocation
    chainIdnumberYesJSON body
    accountstringYesJSON body
    policyKeystringYesJSON body
    callsOwnerOperationCall[]YesJSON body
    grantTokenstringYesJSON body
    metadataRecord<string, unknown>NoJSON body
    endpointstringNoSDK endpoint override

    POST requests include Content-Type: application/json and x-request-id. The request ID supports tracking; it is not a blanket idempotency guarantee.

    Response

    typescript
    export type PrepareOwnerOperationResult = {
      chainId: number;
      account: string;
      operation: {
        policyKey: string;
        displayName: string;
        calls: Array<OwnerOperationCall & { selector: string }>;
      };
      policy: {
        authorization: string;
        sessionEligible: boolean;
        sponsored: boolean;
        maxCalls: number;
        maxNativeValueWei: string;
      };
      metadata?: Record<string, unknown>;
      status?: string;
    };

    Find nested types in the SDK reference. The client handles both a top-level response and a response wrapped in data.

    PrepareOwnerOperationResult

    Handling failures

    Non-2xx responses become HazbaseWalletApiError. Record status, code and message, distinguishing API errors from network failures. Keep credentials out of logs.

    Errors & troubleshooting
    View source