import { EmbeddingSubType, type Op } from '@geoprotocol/grc-20'; import type { SafeSmartAccountImplementation } from 'permissionless/accounts'; import type { SmartAccountClient } from 'permissionless/clients'; import type { Address, Chain, HttpTransport } from 'viem'; import type { SmartAccountImplementation } from 'viem/account-abstraction'; import type { Id } from './id.js'; export type Network = 'TESTNET'; export type BuiltInGeoNetworkId = 'TESTNET'; export type GeoNetworkId = BuiltInGeoNetworkId | (string & {}); export type GeoContractAddresses = { SPACE_REGISTRY_ADDRESS?: `0x${string}`; DAO_SPACE_FACTORY_ADDRESS?: `0x${string}`; DAO_FACTORY_ADDRESS?: `0x${string}`; SPACE_PLUGIN_REPO_ADDRESS?: `0x${string}`; PERSONAL_SPACE_ADMIN_PLUGIN_REPO_ADDRESS?: `0x${string}`; GOVERNANCE_PLUGIN_REPO_ADDRESS?: `0x${string}`; ENS_REGISTRY_ADDRESS?: `0x${string}`; PLUGIN_SETUP_PROCESSOR_ADDRESS?: `0x${string}`; }; export type GeoChainConfig = { id: number; name: string; rpcUrl?: string; }; export type GeoNetworkConfig = { id: GeoNetworkId; name: string; apiOrigin: string; chain?: GeoChainConfig; contracts?: GeoContractAddresses; }; export type Networkish = BuiltInGeoNetworkId | GeoNetworkConfig; export { EmbeddingSubType }; export type { Op }; /** @deprecated Use `Op` instead */ export type GrcOp = Op; export type DecimalMantissa = { type: 'i64'; value: bigint; } | { type: 'big'; bytes: Uint8Array; }; export type ValueDataType = 'BOOLEAN' | 'INTEGER' | 'FLOAT' | 'DECIMAL' | 'TEXT' | 'BYTES' | 'DATE' | 'TIME' | 'DATETIME' | 'SCHEDULE' | 'POINT' | 'EMBEDDING'; export type DataType = ValueDataType | 'RELATION'; /** * Typed value types for GRC-20 v2 binary format. * * Date/time formats: * - `date`: ISO 8601 date format (YYYY-MM-DD), e.g., "2024-01-15" * - `time`: ISO 8601 time format with timezone (HH:MM:SSZ or HH:MM:SS+HH:MM), e.g., "14:30:00Z" * - `datetime`: ISO 8601 combined date and time with timezone, e.g., "2024-01-15T14:30:00Z" * - `schedule`: iCalendar RRULE format for recurring events, e.g., "FREQ=WEEKLY;BYDAY=MO,WE,FR" */ export type TypedValue = { type: 'boolean'; value: boolean; } | { type: 'integer'; value: bigint | number; unit?: Id | string; } | { type: 'float'; value: number; unit?: Id | string; } | { type: 'decimal'; exponent: number; mantissa: DecimalMantissa; unit?: Id | string; } | { type: 'text'; value: string; language?: Id | string; } | { type: 'bytes'; value: Uint8Array; } | { type: 'point'; lon: number; lat: number; alt?: number; } /** ISO 8601 date format (YYYY-MM-DD), e.g., "2024-01-15" */ | { type: 'date'; value: string; } /** ISO 8601 time format with timezone (HH:MM:SSZ or HH:MM:SS+HH:MM), e.g., "14:30:00Z" */ | { type: 'time'; value: string; } /** ISO 8601 combined date and time, e.g., "2024-01-15T14:30:00Z" */ | { type: 'datetime'; value: string; } /** iCalendar RRULE format for recurring events, e.g., "FREQ=WEEKLY;BYDAY=MO,WE,FR" */ | { type: 'schedule'; value: string; } | { type: 'embedding'; subType: EmbeddingSubType; dims: number; data: Uint8Array; }; export type ValueParams = { value: TypedValue; }; export type DefaultProperties = { id?: Id | string; name?: string; description?: string; cover?: Id | string; }; export type PropertyValueParam = { property: Id | string; } & TypedValue; export type PropertiesParam = Array; export type EntityRelationParams = Omit; export type RelationsParam = Record>; export type EntityParams = DefaultProperties & { values?: PropertiesParam; relations?: RelationsParam; types?: Array; }; /** * Language specification for unsetting property values. * - `'all'`: Unset all language slots for the property * - `Id | string | Uint8Array`: A specific language entity ID (use `languages.english()` or `languageId('de')` from grc-20) * * @example * ```ts * import { languages, languageId } from '@geoprotocol/grc-20'; * * // Unset all languages * unset: [{ property: propertyId, language: 'all' }] * * // Unset specific language using grc-20 helpers * unset: [{ property: propertyId, language: languages.english() }] * unset: [{ property: propertyId, language: languageId('de') }] * ``` */ export type UnsetLanguageParam = 'all' | Id | string | Uint8Array; /** * Parameter for unsetting a property value on an entity. */ export type UnsetPropertyParam = { property: Id | string; /** Defaults to 'all' if omitted. Use `languages.english()` or `languageId('de')` from grc-20 for specific languages. */ language?: UnsetLanguageParam; }; export type UpdateEntityParams = Omit & { id: Id | string; values?: PropertiesParam; unset?: UnsetPropertyParam[]; }; type RelationEntityParams = { [K in keyof EntityParams as `entity${Capitalize}`]?: EntityParams[K]; }; export type RelationParams = { id?: Id | string; fromEntity: Id | string; toEntity: Id | string; toSpace?: Id | string; fromSpace?: Id | string; fromVersion?: Id | string; toVersion?: Id | string; position?: string | undefined; type: Id | string; } & RelationEntityParams; export type UpdateRelationParams = { id: Id | string; position?: string | undefined; fromSpace?: Id | string; fromVersion?: Id | string; toVersion?: Id | string; toSpace?: Id | string; }; export type CreateResult = { id: Id; ops: Op[]; }; export type CreateImageResult = CreateResult & { cid: string; dimensions?: { width: number; height: number; }; }; export type UnsetRelationParams = { id: Id | string; fromSpace?: boolean; fromVersion?: boolean; toSpace?: boolean; toVersion?: boolean; position?: boolean; }; export type UnsetEntityValuesParams = { id: Id | string; properties: Array; }; export type DeleteRelationParams = { id: Id | string; }; export type DeleteEntityParams = { id: Id | string; spaceId: Id | string; network?: Network; }; export type CreateTypeParams = DefaultProperties & { properties?: Array; }; export type CreatePropertyParams = DefaultProperties & ({ dataType: ValueDataType; } | { dataType: 'RELATION'; properties?: Array; relationValueTypes?: Array; }); export type CreateCommentParams = { id?: Id | string; content: string; replyTo: { entityId: Id | string; spaceId: Id | string; }; resolved?: boolean; network?: Network; }; export type UpdateCommentParams = { id: Id | string; content?: string; resolved?: boolean; }; export type StarRating = 0 | 0.2 | 0.4 | 0.6 | 0.8 | 1; export type CreateProposalReviewParams = { id?: Id | string; proposal: { id: Id | string; name: string; }; pass: boolean; content?: string; } | { id?: Id | string; proposal: { id: Id | string; name: string; }; pass: boolean; content?: string; completeness: StarRating; accuracy: StarRating; skill: StarRating; effort: StarRating; }; export type UpdateProposalReviewParams = { proposalReviewId: Id | string; pass: boolean; content?: string; } | { proposalReviewId: Id | string; pass: boolean; content?: string; completeness: StarRating; accuracy: StarRating; skill: StarRating; effort: StarRating; }; export type CreateImageParams = { blob: Blob; name?: string; description?: string; id?: Id | string; network?: Network | undefined; } | { url: string; name?: string; description?: string; id?: Id | string; network?: Network | undefined; }; type SafeSmartAccount = SafeSmartAccountImplementation<'0.7'> & { address: Address; getNonce: NonNullable; isDeployed: () => Promise; type: 'smart'; }; export type GeoSmartAccount = SmartAccountClient, Chain, object & SafeSmartAccount & { address: Address; getNonce: NonNullable; isDeployed: () => Promise; type: 'smart'; }, undefined, undefined>; export type GraphUri = `graph://${string}`; export declare enum VoteOption { None = 0, Abstain = 1, Yes = 2, No = 3 } //# sourceMappingURL=types.d.ts.map