export { CreatorFeeManagerWithRoyaltiesAbi, ExecutionManagerAbi, HypercertExchangeAbi, HypercertMinterAbi, OrderValidatorV2AAbi, StrategyHypercertFractionOfferAbi, StrategyManagerAbi, TransferManagerAbi } from '@hypercerts-org/contracts'; import { PublicClient, Hash, Address, WalletClient, Hex, ByteArray, BaseError } from 'viem'; import { AxiosRequestConfig, AxiosResponse } from 'axios'; import { StandardMerkleTree } from '@openzeppelin/merkle-tree'; import { HypercertMetadata as HypercertMetadata$2, HypercertClaimdata as HypercertClaimdata$3, AllowlistEntry as AllowlistEntry$1 } from 'src/types'; import { z } from 'zod'; type ClaimStoredEvent = { claimId: bigint; uri: string; totalUnits: bigint; }; type ParserReturnType = { success: boolean; data?: ClaimStoredEvent; errors?: Record; }; declare const getClaimStoredDataFromTxHash: (client: PublicClient, hash: Hash) => Promise; /* eslint-disable */ /** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ /** * Properties of an impact claim */ interface HypercertClaimdata$2 { /** * Scopes of impact */ impact_scope: { name?: string; value?: string[]; excludes?: string[]; display_value?: string; [k: string]: unknown; }; /** * Scopes of work */ work_scope: { name?: string; value?: string[]; excludes?: string[]; display_value?: string; [k: string]: unknown; }; /** * Work time period. The value is UNIX time in seconds from epoch. */ work_timeframe: { name?: string; value?: number[]; display_value?: string; [k: string]: unknown; }; /** * Impact time period. The value is UNIX time in seconds from epoch. */ impact_timeframe: { name?: string; value?: number[]; display_value?: string; [k: string]: unknown; }; /** * Contributors */ contributors: { name?: string; value?: string[]; display_value?: string; [k: string]: unknown; }; /** * Rights */ rights?: { name?: string; value?: string[]; excludes?: string[]; display_value?: string; [k: string]: unknown; }; [k: string]: unknown; } declare const TransferRestrictions: { readonly AllowAll: 0; readonly DisallowAll: 1; readonly FromCreatorOnly: 2; }; type TransferRestrictions = (typeof TransferRestrictions)[keyof typeof TransferRestrictions]; type AllowlistEntry = { address: string; units: bigint; }; /* eslint-disable */ /** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ /** * Claim data for hypercert. ERC1155 Metadata compliant */ interface HypercertMetadata$1 { /** * Identifies the asset to which this token represents */ name: string; /** * Describes the asset to which this token represents */ description: string; /** * An url pointing to the external website of the project */ external_url?: string; /** * A URI pointing to a resource with mime type image/* representing the asset to which this token represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive. */ image: string; /** * The version of Hypercert schema used to describe this hypercert */ version?: string; /** * Describes the asset to which this token represents */ ref?: string; /** * A CID pointer to the merke tree proof json on ipfs */ allowList?: string; properties?: ( | { trait_type: string; value: string; } | { trait_type: string; type: string; src: string; name: string; } )[]; hypercert?: HypercertClaimdata$1; } /** * Properties of an impact claim */ interface HypercertClaimdata$1 { /** * Scopes of impact */ impact_scope: { name?: string; value?: string[]; excludes?: string[]; display_value?: string; [k: string]: unknown; }; /** * Scopes of work */ work_scope: { name?: string; value?: string[]; excludes?: string[]; display_value?: string; [k: string]: unknown; }; /** * Work time period. The value is UNIX time in seconds from epoch. */ work_timeframe: { name?: string; value?: number[]; display_value?: string; [k: string]: unknown; }; /** * Impact time period. The value is UNIX time in seconds from epoch. */ impact_timeframe: { name?: string; value?: number[]; display_value?: string; [k: string]: unknown; }; /** * Contributors */ contributors: { name?: string; value?: string[]; display_value?: string; [k: string]: unknown; }; /** * Rights */ rights?: { name?: string; value?: string[]; excludes?: string[]; display_value?: string; [k: string]: unknown; }; [k: string]: unknown; } type TestChainIds = 11155111 | 84532 | 421614 | 314159; type ProductionChainIds = 10 | 42220 | 8453 | 42161 | 314; type SupportedChainIds = TestChainIds | ProductionChainIds; type SupportedOverrides = ContractOverrides & FeatureOverrides & AxiosRequestConfig; type ContractOverrides = { value?: bigint; gasPrice?: bigint; gasLimit?: bigint; }; type FeatureOverrides = { safeAddress?: Address; }; type Contracts = "HypercertMinterUUPS" | "TransferManager" | "ProtocolFeeRecipient" | "HypercertExchange" | "RoyaltyFeeRegistry" | "OrderValidator" | "CreatorFeeManager" | "StrategyHypercertFractionOffer"; type Deployment = { chainId: SupportedChainIds; addresses: Partial>; isTestnet: boolean; easSchemas?: { [key: string]: { [key: string]: string | boolean; }; }; }; type HypercertClientConfig = { environment: Environment; deployments: { [k: string]: Deployment; }; readOnly: boolean; graphUrl: string; publicClient?: PublicClient; walletClient?: WalletClient; }; type Environment = "production" | "test"; type HypercertClientProps = { config?: Partial; }; interface HypercertClientInterface extends HypercertClientMethods, HypercertClientState { } interface HypercertClientState { readOnly: boolean; } interface TransactionParams { overrides?: SupportedOverrides; } interface MintParams extends TransactionParams { metaData: HypercertMetadata$1; totalUnits: bigint; transferRestriction: TransferRestrictions; allowList?: AllowlistEntry[] | string; } interface TransferParams extends TransactionParams { fractionId: bigint; to: `0x${string}`; } interface BatchTransferParams extends TransactionParams { fractionIds: bigint[]; to: `0x${string}`; } interface SplitFractionParams extends TransactionParams { fractionId: bigint; fractions: bigint[]; } interface MergeFractionsParams extends TransactionParams { fractionIds: bigint[]; } interface BurnFractionParams extends TransactionParams { fractionId: bigint; } interface ClaimFractionFromAllowlistParams extends TransactionParams { hypercertTokenId: bigint; units: bigint; proof: (Hex | ByteArray)[]; root?: Hex | ByteArray; } interface BatchClaimFractionsFromAllowlistsParams extends TransactionParams { hypercertTokenIds: bigint[]; units: bigint[]; proofs: (Hex | ByteArray)[][]; roots?: (Hex | ByteArray)[]; } interface HypercertClientMethods { getDeployments: ({ chainId, environment }: { chainId?: SupportedChainIds; environment?: Environment; }) => { [k: string]: Deployment; }; mintClaim: (metaData: HypercertMetadata$1, totalUnits: bigint, transferRestriction: TransferRestrictions, allowList?: AllowlistEntry[]) => Promise<`0x${string}` | undefined>; mintHypercert: (params: MintParams) => Promise<`0x${string}` | undefined>; getTransferRestrictions: (fractionId: bigint) => Promise; transferFraction: (params: TransferParams) => Promise<`0x${string}` | undefined>; batchTransferFractions: (params: BatchTransferParams) => Promise<`0x${string}` | undefined>; createAllowlist: (allowList: AllowlistEntry[], metaData: HypercertMetadata$1, totalUnits: bigint, transferRestriction: TransferRestrictions) => Promise<`0x${string}` | undefined>; splitFractionUnits: (fractionId: bigint, fractions: bigint[]) => Promise<`0x${string}` | undefined>; splitFraction: (params: SplitFractionParams) => Promise<`0x${string}` | undefined>; mergeFractionUnits: (fractionIds: bigint[]) => Promise<`0x${string}` | undefined>; mergeFractions: (params: MergeFractionsParams) => Promise<`0x${string}` | undefined>; burnClaimFraction: (fractionId: bigint) => Promise<`0x${string}` | undefined>; burnFraction: (params: BurnFractionParams) => Promise<`0x${string}` | undefined>; mintClaimFractionFromAllowlist: (claimId: bigint, units: bigint, proof: (Hex | ByteArray)[]) => Promise<`0x${string}` | undefined>; claimFractionFromAllowlist: (params: ClaimFractionFromAllowlistParams) => Promise<`0x${string}` | undefined>; batchMintClaimFractionsFromAllowlists: (claimIds: bigint[], units: bigint[], proofs: (Hex | ByteArray)[][]) => Promise<`0x${string}` | undefined>; batchClaimFractionsFromAllowlists: (params: BatchClaimFractionsFromAllowlistsParams) => Promise<`0x${string}` | undefined>; isClaimOrFractionOnConnectedChain: (claimOrFractionId: string) => boolean; isHypercertsOrFractionOnConnectedChain: (claimOrFractionId: string) => boolean; } interface CustomError { payload?: { [key: string]: unknown; }; } declare class ClientError extends Error implements CustomError { payload?: { [key: string]: unknown; }; constructor(message: string, payload?: { [key: string]: unknown; }); } declare class ContractError extends Error implements CustomError { payload?: { [key: string]: unknown; }; constructor(errorName?: string, payload?: { data: BaseError | Hex; [key: string]: unknown; }); } declare class FetchError extends Error implements CustomError { payload?: { [key: string]: unknown; }; constructor(message: string, payload?: { [key: string]: unknown; }); } declare class InvalidOrMissingError extends Error implements CustomError { payload?: { [key: string]: unknown; }; constructor(message: string, payload?: { [key: string]: unknown; }); } declare class MintingError extends Error implements CustomError { payload?: { [key: string]: unknown; }; constructor(message: string, payload?: { [key: string]: unknown; }); } declare class StorageError extends Error implements CustomError { payload?: { [key: string]: unknown; }; constructor(message: string, payload?: { [key: string]: unknown; }); } declare class UnknownSchemaError extends Error implements CustomError { payload?: { schemaName: string; }; constructor(message: string, payload?: { schemaName: string; }); } declare class MalformedDataError extends Error implements CustomError { payload?: { [key: string]: unknown; }; constructor(message: string, payload?: { [key: string]: unknown; }); } declare class UnsupportedChainError extends Error implements CustomError { payload?: { chainID: string | number | undefined; }; constructor(message: string, payload?: { chainID: string | number | undefined; }); } declare class ConfigurationError extends Error implements CustomError { payload?: { [key: string]: unknown; }; constructor(message: string, payload?: { [key: string]: unknown; }); } declare class SafeTransactionError extends Error implements CustomError { payload?: { [key: string]: unknown; }; constructor(message: string, payload?: { [key: string]: unknown; }); } type HypercertsSdkError = ConfigurationError | FetchError | InvalidOrMissingError | MalformedDataError | MintingError | StorageError | UnsupportedChainError | UnknownSchemaError; interface StoreAllowListRequest { allowList: string; totalUnits?: string; } type StorageResponseData = { cid: string; }; interface StorageResponse { data?: StorageResponseData; errors?: RecordStringUnknown; message?: string; success: boolean; } interface HypercertMetadata { allowList?: string; description: string; external_url?: string; hypercert?: HypercertClaimdata; image: string; name: string; properties?: HypercertMetadataPropertiesItem[]; ref?: string; version?: string; } interface StoreMetadataWithAllowlistRequest { allowList: string; metadata: HypercertMetadata; totalUnits?: string; } interface StoreMetadataRequest { metadata: HypercertMetadata; } type HypercertMetadataPropertiesItemAnyOfTwo = { name: string; src: string; trait_type: string; type: string; }; type HypercertMetadataPropertiesItemAnyOf = { trait_type: string; value: string; }; type HypercertMetadataPropertiesItem = HypercertMetadataPropertiesItemAnyOf | HypercertMetadataPropertiesItemAnyOfTwo; type HypercertClaimdataWorkTimeframe = { display_value?: string; name?: string; value?: number[]; [key: string]: unknown; }; type HypercertClaimdataWorkScope = { display_value?: string; excludes?: string[]; name?: string; value?: string[]; [key: string]: unknown; }; type HypercertClaimdataRights = { display_value?: string; excludes?: string[]; name?: string; value?: string[]; [key: string]: unknown; }; type HypercertClaimdataImpactTimeframe = { display_value?: string; name?: string; value?: number[]; [key: string]: unknown; }; type HypercertClaimdataImpactScope = { display_value?: string; excludes?: string[]; name?: string; value?: string[]; [key: string]: unknown; }; type HypercertClaimdataContributors = { display_value?: string; name?: string; value?: string[]; [key: string]: unknown; }; interface HypercertClaimdata { contributors: HypercertClaimdataContributors; impact_scope: HypercertClaimdataImpactScope; impact_timeframe: HypercertClaimdataImpactTimeframe; rights?: HypercertClaimdataRights; work_scope: HypercertClaimdataWorkScope; work_timeframe: HypercertClaimdataWorkTimeframe; [key: string]: unknown; } interface RecordStringUnknown { [key: string]: unknown; } interface HypercertStorage { storeMetadata: (request: StoreMetadataRequest, config?: AxiosRequestConfig) => Promise>; storeAllowlist: (request: StoreAllowListRequest, config?: AxiosRequestConfig) => Promise>; storeMetadataWithAllowlist: (request: StoreMetadataWithAllowlistRequest, config?: AxiosRequestConfig) => Promise>; } declare class HypercertClient implements HypercertClientInterface { readonly _config: HypercertClientConfig; private readonly _publicClient?; private readonly _walletClient?; private readonly _storage; readOnly: boolean; constructor(config: Partial); isHypercertsOrFractionOnConnectedChain: (claimOrFractionId: string) => boolean; isClaimOrFractionOnConnectedChain: (claimOrFractionId: string) => boolean; get config(): Partial; get storage(): HypercertStorage; getDeployments: ({ chainId, environment }: { chainId?: SupportedChainIds; environment?: Environment; }) => { [k: string]: Deployment; }; mintClaim: (metaData: HypercertMetadata$1, totalUnits: bigint, transferRestriction: TransferRestrictions, allowList?: AllowlistEntry[], overrides?: SupportedOverrides) => Promise<`0x${string}`>; mintHypercert: ({ metaData, totalUnits, transferRestriction, allowList, overrides }: MintParams) => Promise<`0x${string}`>; getTransferRestrictions: (fractionId: bigint) => Promise; transferFraction: ({ fractionId, to, overrides }: TransferParams) => Promise<`0x${string}`>; batchTransferFractions: ({ fractionIds, to, overrides }: BatchTransferParams) => Promise<`0x${string}`>; createAllowlist: (allowList: AllowlistEntry[], metaData: HypercertMetadata$1, totalUnits: bigint, transferRestriction: TransferRestrictions, overrides?: SupportedOverrides) => Promise<`0x${string}`>; splitFraction: ({ fractionId, fractions, overrides, }: SplitFractionParams) => Promise<`0x${string}` | undefined>; splitFractionUnits: (fractionId: bigint, fractions: bigint[], overrides?: SupportedOverrides) => Promise<`0x${string}` | undefined>; mergeFractions: ({ fractionIds, overrides }: MergeFractionsParams) => Promise<`0x${string}`>; mergeFractionUnits: (fractionIds: bigint[], overrides?: SupportedOverrides) => Promise<`0x${string}`>; burnFraction: ({ fractionId, overrides }: BurnFractionParams) => Promise<`0x${string}`>; burnClaimFraction: (claimId: bigint, overrides?: SupportedOverrides) => Promise<`0x${string}`>; claimFractionFromAllowlist: ({ hypercertTokenId, units, proof, root, overrides, }: ClaimFractionFromAllowlistParams) => Promise<`0x${string}`>; mintClaimFractionFromAllowlist: (claimId: bigint, units: bigint, proof: (Hex | ByteArray)[], root?: Hex | ByteArray, overrides?: SupportedOverrides) => Promise<`0x${string}`>; batchClaimFractionsFromAllowlists: ({ hypercertTokenIds, units, proofs, roots, overrides, }: BatchClaimFractionsFromAllowlistsParams) => Promise<`0x${string}`>; batchMintClaimFractionsFromAllowlists: (claimIds: bigint[], units: bigint[], proofs: (Hex | ByteArray)[][], roots?: (Hex | ByteArray)[], overrides?: SupportedOverrides) => Promise<`0x${string}`>; getClaimStoredDataFromTxHash: (hash: `0x${string}`) => Promise; private _getContract; private getConnected; private simulateRequest; private submitRequest; } declare const DEFAULT_ENVIRONMENT: Environment; declare const ENDPOINTS: { [key: string]: string; }; declare const DEPLOYMENTS: { [key in SupportedChainIds]: Deployment; }; declare const constants_DEFAULT_ENVIRONMENT: typeof DEFAULT_ENVIRONMENT; declare const constants_DEPLOYMENTS: typeof DEPLOYMENTS; declare const constants_ENDPOINTS: typeof ENDPOINTS; declare namespace constants { export { constants_DEFAULT_ENVIRONMENT as DEFAULT_ENVIRONMENT, constants_DEPLOYMENTS as DEPLOYMENTS, constants_ENDPOINTS as ENDPOINTS, }; } interface IValidator { validate(data: unknown, params?: P): ValidationResult$1; } interface ValidationResult$1 { isValid: boolean; data?: T; errors: ValidationError[]; } interface ValidationError { code: string; message: string; field?: string; details?: unknown; } interface MerkleProofData { root: string; signerAddress: string; units: bigint; proof: string[]; } interface AllowlistValidationParams { expectedUnits: bigint; } type PropertyValues = HypercertMetadata$2["properties"]; type PropertyValue = NonNullable[number]; declare const AttestationSchema: z.ZodEffects, z.objectInputType<{ chain_id: z.ZodBigInt; contract_address: z.ZodString; token_id: z.ZodBigInt; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ chain_id: z.ZodBigInt; contract_address: z.ZodString; token_id: z.ZodBigInt; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ chain_id: z.ZodBigInt; contract_address: z.ZodString; token_id: z.ZodBigInt; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ chain_id: z.ZodBigInt; contract_address: z.ZodString; token_id: z.ZodBigInt; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ chain_id: z.ZodBigInt; contract_address: z.ZodString; token_id: z.ZodBigInt; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ chain_id: z.ZodBigInt; contract_address: z.ZodString; token_id: z.ZodBigInt; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ chain_id: z.ZodBigInt; contract_address: z.ZodString; token_id: z.ZodBigInt; }, z.ZodTypeAny, "passthrough">>; type AttestationData = z.infer; declare class ValidatorFactory { static createMetadataValidator(): IValidator; static createClaimDataValidator(): IValidator; static createAllowlistValidator(): IValidator; static createMerkleProofValidator(): IValidator; static createPropertyValidator(): IValidator; static createAttestationValidator(): IValidator; } type ValidationResult = { data: AllowlistEntry[] | HypercertClaimdata$2 | HypercertMetadata$1 | unknown; valid: boolean; errors: Record; }; declare const validateMetaData: (data: unknown) => ValidationResult; declare const validateClaimData: (data: unknown) => ValidationResult; declare const validateAllowlist: (data: AllowlistEntry[], units: bigint) => ValidationResult; declare const verifyMerkleProof: (root: string, signerAddress: string, units: bigint, proof: string[]) => void; declare const verifyMerkleProofs: (roots: string[], signerAddress: string, units: bigint[], proofs: string[][]) => void; declare const parseAllowListEntriesToMerkleTree: (allowList: AllowlistEntry[]) => StandardMerkleTree<[string, bigint]>; declare const getProofsFromAllowlist: (cidOrIpfsUri: string, account: `0x${string}`) => Promise<{ proof: string[]; root: string; } | undefined>; declare const getFromIPFS: (cidOrIpfsUri: string, timeout?: number) => Promise; type FormatResult = { data: HypercertMetadata$1 | null; valid: boolean; errors: Record | null; }; declare const formatHypercertData: ({ name, description, external_url, image, version, properties, impactScope, excludedImpactScope, workScope, excludedWorkScope, workTimeframeStart, workTimeframeEnd, impactTimeframeStart, impactTimeframeEnd, contributors, rights, excludedRights, }: { name: string; description: string; external_url?: string; image: string; version: string; properties?: ({ trait_type: string; value: string; } | { trait_type: string; type: string; src: string; name: string; })[]; impactScope: string[]; excludedImpactScope: string[]; workScope: string[]; excludedWorkScope: string[]; workTimeframeStart: number; workTimeframeEnd: number; impactTimeframeStart: number; impactTimeframeEnd: number; contributors: string[]; rights: string[]; excludedRights: string[]; }) => FormatResult; declare const logger: { error: (error: Error, label?: string) => void; warn: (message: string, label?: string, ...data: unknown[]) => void; info: (message: string, label?: string, ...data: unknown[]) => void; debug: (message: string, label?: string, ...data: unknown[]) => void; }; declare const handleSdkError: (err: HypercertsSdkError) => void; declare const handleContractError: (data: Hex) => ContractError; declare const parseClaimOrFractionId: (claimId: string) => { chainId: number; contractAddress: string; id: bigint; }; declare const isHypercertToken: (tokenId?: bigint) => boolean; declare const getHypercertTokenId: (tokenId: bigint) => bigint; declare global { interface BigInt { toJSON: () => string; } } export { constants as CONSTANTS, ClientError, ConfigurationError, ContractError, FetchError, HypercertClient, InvalidOrMissingError, MalformedDataError, MintingError, SafeTransactionError, StorageError, TransferRestrictions, UnknownSchemaError, UnsupportedChainError, ValidatorFactory, formatHypercertData, getClaimStoredDataFromTxHash, getFromIPFS, getHypercertTokenId, getProofsFromAllowlist, handleContractError, handleSdkError, isHypercertToken, logger, parseAllowListEntriesToMerkleTree, parseClaimOrFractionId, validateAllowlist, validateClaimData, validateMetaData, verifyMerkleProof, verifyMerkleProofs }; export type { AllowlistEntry, BatchClaimFractionsFromAllowlistsParams, BatchTransferParams, BurnFractionParams, ClaimFractionFromAllowlistParams, ContractOverrides, Contracts, CustomError, Deployment, Environment, FeatureOverrides, HypercertClaimdata$2 as HypercertClaimdata, HypercertClientConfig, HypercertClientInterface, HypercertClientMethods, HypercertClientProps, HypercertClientState, HypercertMetadata$1 as HypercertMetadata, HypercertsSdkError, MergeFractionsParams, MintParams, ProductionChainIds, SplitFractionParams, SupportedChainIds, SupportedOverrides, TestChainIds, TransactionParams, TransferParams };