type ClarityType = "int" | "uint" | "buffer" | "true" | "false" | "address" | "contract" | "ok" | "err" | "none" | "some" | "list" | "tuple" | "ascii" | "utf8"; /** Wire type IDs matching the Stacks binary format (SIP-005) */ declare const ClarityWireType: { readonly int: 0x00 readonly uint: 0x01 readonly buffer: 0x02 readonly true: 0x03 readonly false: 0x04 readonly address: 0x05 readonly contract: 0x06 readonly ok: 0x07 readonly err: 0x08 readonly none: 0x09 readonly some: 0x0a readonly list: 0x0b readonly tuple: 0x0c readonly ascii: 0x0d readonly utf8: 0x0e }; declare function clarityTypeFromByte(byte: number): ClarityType; type IntCV = { readonly type: "int" readonly value: bigint }; type UIntCV = { readonly type: "uint" readonly value: bigint }; type BooleanCV = TrueCV | FalseCV; type TrueCV = { readonly type: "true" }; type FalseCV = { readonly type: "false" }; type BufferCV = { readonly type: "buffer" readonly value: string }; type NoneCV = { readonly type: "none" }; type SomeCV = { readonly type: "some" readonly value: ClarityValue }; type OptionalCV = NoneCV | SomeCV; type ResponseOkCV = { readonly type: "ok" readonly value: ClarityValue }; type ResponseErrorCV = { readonly type: "err" readonly value: ClarityValue }; type ResponseCV = ResponseOkCV | ResponseErrorCV; type StandardPrincipalCV = { readonly type: "address" readonly value: string }; type ContractPrincipalCV = { readonly type: "contract" readonly value: string }; type PrincipalCV = StandardPrincipalCV | ContractPrincipalCV; type ListCV = { type: "list" value: ClarityValue[] }; type TupleData = { [key: string]: ClarityValue }; type TupleCV = { type: "tuple" value: TupleData }; type StringAsciiCV = { readonly type: "ascii" readonly value: string }; type StringUtf8CV = { readonly type: "utf8" readonly value: string }; type ClarityValue = IntCV | UIntCV | BooleanCV | BufferCV | NoneCV | SomeCV | ResponseOkCV | ResponseErrorCV | StandardPrincipalCV | ContractPrincipalCV | ListCV | TupleCV | StringAsciiCV | StringUtf8CV; type IntegerType = number | string | bigint | Uint8Array; declare function intCV(value: IntegerType): IntCV; declare function uintCV(value: IntegerType): UIntCV; declare const trueCV: () => TrueCV; declare const falseCV: () => FalseCV; declare const boolCV: (v: boolean) => BooleanCV; declare function bufferCV(buffer: Uint8Array): BufferCV; declare function standardPrincipalCV(address: string): StandardPrincipalCV; declare function contractPrincipalCV(address: string, contractName: string): ContractPrincipalCV; declare function noneCV(): NoneCV; declare function someCV(value: ClarityValue): SomeCV; declare function responseOkCV(value: ClarityValue): ResponseOkCV; declare function responseErrorCV(value: ClarityValue): ResponseErrorCV; declare function listCV(values: ClarityValue[]): ListCV; declare function tupleCV(data: TupleData): TupleCV; declare function stringAsciiCV(value: string): StringAsciiCV; declare function stringUtf8CV(value: string): StringUtf8CV; declare const Cl: { readonly int: (value: IntegerType) => IntCV readonly uint: (value: IntegerType) => UIntCV readonly bool: (v: boolean) => BooleanCV principal(address: string): StandardPrincipalCV | ContractPrincipalCV address(address: string): StandardPrincipalCV | ContractPrincipalCV readonly contractPrincipal: (address: string, contractName: string) => ContractPrincipalCV readonly standardPrincipal: (address: string) => StandardPrincipalCV readonly buffer: (buffer: Uint8Array) => BufferCV readonly bufferFromHex: (hex: string) => BufferCV readonly bufferFromAscii: (ascii: string) => BufferCV readonly bufferFromUtf8: (utf8: string) => BufferCV readonly none: () => NoneCV readonly some: (value: ClarityValue) => SomeCV readonly ok: (value: ClarityValue) => ResponseOkCV readonly error: (value: ClarityValue) => ResponseErrorCV readonly list: (values: ClarityValue[]) => ListCV readonly tuple: (data: TupleData) => TupleCV readonly stringAscii: (value: string) => StringAsciiCV readonly stringUtf8: (value: string) => StringUtf8CV serialize(value: ClarityValue): string readonly deserialize: (bytes: Uint8Array) => ClarityValue }; declare function serializeCVBytes(value: ClarityValue): Uint8Array; declare function serializeCV(value: ClarityValue): string; declare function deserializeCVBytes(input: Uint8Array | string): T; declare function deserializeCV(input: Uint8Array | string): T; /** Account derived from a local private key (mnemonic or raw key). */ type LocalAccount = { type: "local" address: string /** Compressed public key (hex) */ publicKey: string /** Raw ECDSA sign over a hash */ sign(hash: Uint8Array): Uint8Array /** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */ signMessage(message: string | Uint8Array): string }; /** asciiToBytes("SIP018") */ declare const SIP018_PREFIX: Uint8Array; /** sha256(serialize(cv)) — inner hash used by SIP-018. */ declare function hashStructuredData(structuredData: ClarityValue): Uint8Array; /** * SIP-018 encoding: `"SIP018" || sha256(serialize(domain)) || sha256(serialize(message))`. * The signature is over `sha256` of this buffer. */ declare function encodeStructuredData(opts: { message: ClarityValue domain: ClarityValue }): Uint8Array; /** SIP-018 message hash: sha256(encodeStructuredData(...)). */ declare function structuredDataHash(opts: { message: ClarityValue domain: ClarityValue }): Uint8Array; /** * Sign a SIP-018 structured message. Returns a 65-byte recoverable signature * in RSV order (recovery byte last) — the layout contracts expect. */ declare function signStructuredData(account: LocalAccount, opts: { message: ClarityValue domain: ClarityValue }): Promise; declare function prettyPrint(val: ClarityValue, encoding?: "tryAscii" | "hex"): string | undefined; declare function cvToJSON(val: ClarityValue): any; declare function cvToValue(val: ClarityValue): any; /** Narrow to bigint; throws unless `val` is an int or uint. */ declare function cvToBigInt(val: ClarityValue): bigint; /** Narrow to string; throws unless `val` is an ascii or utf8 string. */ declare function cvToString(val: ClarityValue): string; /** Narrow to hex string (no 0x prefix); throws unless `val` is a buffer. */ declare function cvToBuffer(val: ClarityValue): string; /** Narrow to boolean; throws unless `val` is a bool. */ declare function cvToBoolean(val: ClarityValue): boolean; /** Narrow to principal string; throws unless `val` is a standard or contract principal. */ declare function cvToPrincipal(val: ClarityValue): string; /** Clarity contract-name grammar: leading letter, then letters/digits/`-`/`_`. * Underscore is legal (SIP-002) and deployed contracts use it — matches the * pattern the Index API already accepts for contract ids. */ declare const CONTRACT_NAME_REGEX: RegExp; type AbiUInt128 = "uint128"; type AbiInt128 = "int128"; type AbiBool = "bool"; type AbiPrincipal = "principal"; type AbiTraitReference = "trait_reference"; type AbiNone = "none"; type AbiStringAscii = { "string-ascii": { length: L } }; type AbiStringUtf8 = { "string-utf8": { length: L } }; type AbiBuffer = { buff: { length: L } }; type AbiPrimitiveType = AbiUInt128 | AbiInt128 | AbiBool | AbiPrincipal | AbiTraitReference | AbiNone | AbiStringAscii | AbiStringUtf8 | AbiBuffer; interface AbiListType { list: { type: AbiType length: number }; } interface AbiTupleType { tuple: ReadonlyArray<{ name: string type: AbiType }>; } interface AbiOptionalType { optional: AbiType; } interface AbiResponseType { response: { ok: AbiType error: AbiType }; } /** Discriminated union of all Clarity value types (primitives, buffers, lists, tuples, optionals, responses). */ type AbiType = AbiPrimitiveType | AbiListType | AbiTupleType | AbiOptionalType | AbiResponseType; type AbiList< T extends AbiType = AbiType, L extends number = number > = { list: { type: T length: L } }; type AbiTuple> = { tuple: T }; type AbiOptional = { optional: T }; type AbiResponse< O extends AbiType = AbiType, E extends AbiType = AbiType > = { response: { ok: O error: E } }; type CamelCaseInner = S extends `${infer P1}-${infer P2}${infer P3}` ? `${P1}${Capitalize>}` : S; type ToCamelCase = CamelCaseInner extends `${number}${string}` ? `_${CamelCaseInner}` : CamelCaseInner; declare function toCamelCase(str: string): string; type TupleToObject> = { [K in T[number]["name"] as ToCamelCase] : AbiToTS["type"]> }; type AbiToTS = T extends "none" ? never : T extends "uint128" ? bigint : T extends "int128" ? bigint : T extends "bool" ? boolean : T extends "principal" ? string : T extends "trait_reference" ? string : T extends { "string-ascii": any } ? string : T extends { "string-utf8": any } ? string : T extends { buff: any } ? Uint8Array : T extends { list: { type: infer U extends AbiType } } ? Array> : T extends { optional: infer U extends AbiType } ? AbiToTS | null : T extends { response: { ok: infer O extends AbiType error: infer E extends AbiType } } ? { ok: AbiToTS } | { err: AbiToTS } : T extends { tuple: infer Fields extends ReadonlyArray<{ name: string type: AbiType }> } ? TupleToObject : never; type ResponseOk = { ok: T }; type ResponseErr = { err: E }; type Response< T, E > = ResponseOk | ResponseErr; type FunctionAccess = "public" | "read-only" | "private"; interface FunctionArg { name: string; type: AbiType; } /** A single Clarity function definition with name, access level, arguments, and return type. */ interface AbiFunction { name: string; access: FunctionAccess; args: ReadonlyArray; outputs: AbiType; } type VariableAccess = "constant" | "variable"; interface AbiVariable { name: string; type: AbiType; access: VariableAccess; } interface AbiMap { name: string; key: AbiType; value: AbiType; } interface AbiFungibleToken { name: string; } interface AbiNonFungibleToken { name: string; type: AbiType; } type TraitFunctionAccess = Exclude; interface AbiTraitFunction { name: string; access: TraitFunctionAccess; args: ReadonlyArray; outputs: AbiType; } interface AbiTraitDefinition { name: string; functions: ReadonlyArray; } /** Full Clarity contract ABI including functions, maps, variables, and token definitions. */ interface AbiContract { functions: ReadonlyArray; maps?: ReadonlyArray; variables?: ReadonlyArray; fungible_tokens?: ReadonlyArray; non_fungible_tokens?: ReadonlyArray; implemented_traits?: ReadonlyArray; defined_traits?: ReadonlyArray; } declare const abiTypes: unique symbol; /** * Phantom type bundle a codegen tool can fuse onto an as-const ABI literal. * * Function/map keys are camelCase (matching the runtime client's method names) * and `args` is the named-args object each method accepts. `ret` is the raw * output type before any response unwrapping. */ type ContractTypes = { functions: Record maps?: Record }; /** * An as-const ABI literal branded with named codegen types. The brand is a * phantom optional property: it never exists at runtime, so any `TypedAbi` * value is still a plain ABI object and works everywhere an `AbiContract` * does. Typed consumers (e.g. `getContract`) resolve the brand to surface * named type aliases in hovers and errors instead of expanded inline types. */ type TypedAbi< A extends AbiContract, T extends ContractTypes > = A & { readonly [abiTypes]?: T }; /** * Resolve the brand off an ABI type. `never` for un-branded ABIs, which lets * consumers fall back to structural inference. */ type AbiTypesOf = C extends { readonly [abiTypes]?: infer T } ? NonNullable extends ContractTypes ? NonNullable : never : never; type ExtractFunctionNames< C extends AbiContract, Access extends FunctionAccess = FunctionAccess > = Extract["name"]; type ExtractFunction< C extends AbiContract, N extends ExtractFunctionNames > = Extract; type ExtractFunctionArgs< C extends AbiContract, N extends ExtractFunctionNames > = ExtractFunction extends { args: infer Args extends ReadonlyArray<{ name: string type: any }> } ? { [K in Args[number]["name"] as ToCamelCase] : AbiToTS["type"]> } : never; type ExtractFunctionOutput< C extends AbiContract, N extends ExtractFunctionNames > = ExtractFunction extends { outputs: infer O extends AbiType } ? AbiToTS : never; type ExtractPublicFunctions = ExtractFunctionNames; type ExtractReadOnlyFunctions = ExtractFunctionNames; type ExtractPrivateFunctions = ExtractFunctionNames; type ExtractMapNames = C["maps"] extends ReadonlyArray<{ name: infer N extends string }> ? N : never; type ExtractMap< C extends AbiContract, N extends ExtractMapNames > = C["maps"] extends ReadonlyArray ? Extract : never; type ExtractMapKey< C extends AbiContract, N extends ExtractMapNames > = ExtractMap extends { key: infer K extends AbiType } ? AbiToTS : never; type ExtractMapValue< C extends AbiContract, N extends ExtractMapNames > = ExtractMap extends { value: infer V extends AbiType } ? AbiToTS : never; type ExtractVariableNames< C extends AbiContract, Access extends VariableAccess = VariableAccess > = C["variables"] extends ReadonlyArray ? V extends { name: infer N extends string access: Access } ? N : never : never; type ExtractVariable< C extends AbiContract, N extends ExtractVariableNames > = C["variables"] extends ReadonlyArray ? Extract : never; type ExtractVariableType< C extends AbiContract, N extends ExtractVariableNames > = ExtractVariable extends { type: infer T extends AbiType } ? AbiToTS : never; type ExtractConstants = ExtractVariableNames; type ExtractDataVars = ExtractVariableNames; type ExtractFungibleTokenNames = C["fungible_tokens"] extends ReadonlyArray<{ name: infer N extends string }> ? N : never; type ExtractNonFungibleTokenNames = C["non_fungible_tokens"] extends ReadonlyArray<{ name: infer N extends string }> ? N : never; type ExtractNFTAssetType< C extends AbiContract, N extends ExtractNonFungibleTokenNames > = C["non_fungible_tokens"] extends ReadonlyArray ? Extract extends { type: infer A extends AbiType } ? AbiToTS : never : never; type ExtractDefinedTraitNames = C["defined_traits"] extends ReadonlyArray<{ name: infer N extends string }> ? N : never; type ExtractImplementedTraits = C["implemented_traits"] extends ReadonlyArray ? T : never; declare function isUint128(value: unknown): value is bigint; declare function isInt128(value: unknown): value is bigint; declare function isBool(value: unknown): value is boolean; declare function isPrincipal(value: unknown): value is string; declare function isStandardPrincipal(value: unknown): value is string; declare function isContractPrincipal(value: unknown): value is string; declare function isTraitReference(value: unknown): value is string; declare function isString(value: unknown): value is string; declare function isUint8Array(value: unknown): value is Uint8Array; declare function isArray(value: unknown, itemGuard: (item: unknown) => item is T): value is T[]; declare function isOptional(value: unknown, guard: (val: unknown) => val is T): value is T | null; declare function isOkResponse(response: { ok: T } | { err: any }): response is ResponseOk; declare function isErrResponse(response: { ok: any } | { err: E }): response is ResponseErr; declare function isResponse< T, E >(value: unknown, okGuard: (val: unknown) => val is T, errGuard: (val: unknown) => val is E): value is ResponseOk | ResponseErr; declare function isAbiList(type: AbiType): type is AbiListType; declare function isAbiTuple(type: AbiType): type is AbiTupleType; declare function isAbiOptional(type: AbiType): type is AbiOptionalType; declare function isAbiResponse(type: AbiType): type is AbiResponseType; declare function isAbiBuffer(type: AbiType): type is AbiBuffer; declare function isAbiStringAscii(type: AbiType): type is AbiStringAscii; declare function isAbiStringUtf8(type: AbiType): type is AbiStringUtf8; declare function isAbiTraitReference(type: AbiType): type is AbiTraitReference; declare class ClarityConversionError extends Error { readonly type: AbiType; readonly value: unknown; constructor(message: string, type: AbiType, value: unknown); } declare function jsToClarity(type: AbiType, value: unknown): unknown; declare function prepareArgs(func: F, args: Record): unknown[]; declare function validateArgs(func: F, args: Record): void; declare function validateArgsArray(func: F, args: unknown[]): void; declare const SIP010_ABI: { readonly functions: readonly [{ readonly name: "transfer" readonly access: "public" readonly args: readonly [{ readonly name: "amount" readonly type: "uint128" }, { readonly name: "sender" readonly type: "principal" }, { readonly name: "recipient" readonly type: "principal" }, { readonly name: "memo" readonly type: { readonly optional: { readonly buff: { readonly length: 34 } } } }] readonly outputs: { readonly response: { readonly ok: "bool" readonly error: "uint128" } } }, { readonly name: "get-balance" readonly access: "read-only" readonly args: readonly [{ readonly name: "account" readonly type: "principal" }] readonly outputs: { readonly response: { readonly ok: "uint128" readonly error: "uint128" } } }, { readonly name: "get-total-supply" readonly access: "read-only" readonly args: readonly [] readonly outputs: { readonly response: { readonly ok: "uint128" readonly error: "uint128" } } }, { readonly name: "get-name" readonly access: "read-only" readonly args: readonly [] readonly outputs: { readonly response: { readonly ok: { readonly "string-ascii": { readonly length: 32 } } readonly error: "uint128" } } }, { readonly name: "get-symbol" readonly access: "read-only" readonly args: readonly [] readonly outputs: { readonly response: { readonly ok: { readonly "string-ascii": { readonly length: 10 } } readonly error: "uint128" } } }, { readonly name: "get-decimals" readonly access: "read-only" readonly args: readonly [] readonly outputs: { readonly response: { readonly ok: "uint128" readonly error: "uint128" } } }, { readonly name: "get-token-uri" readonly access: "read-only" readonly args: readonly [] readonly outputs: { readonly response: { readonly ok: { readonly optional: { readonly "string-utf8": { readonly length: 256 } } } readonly error: "uint128" } } }] readonly fungible_tokens: readonly [{ readonly name: "token" }] }; declare const SIP009_ABI: { readonly functions: readonly [{ readonly name: "transfer" readonly access: "public" readonly args: readonly [{ readonly name: "id" readonly type: "uint128" }, { readonly name: "sender" readonly type: "principal" }, { readonly name: "recipient" readonly type: "principal" }] readonly outputs: { readonly response: { readonly ok: "bool" readonly error: "uint128" } } }, { readonly name: "get-owner" readonly access: "read-only" readonly args: readonly [{ readonly name: "id" readonly type: "uint128" }] readonly outputs: { readonly response: { readonly ok: { readonly optional: "principal" } readonly error: "uint128" } } }, { readonly name: "get-last-token-id" readonly access: "read-only" readonly args: readonly [] readonly outputs: { readonly response: { readonly ok: "uint128" readonly error: "uint128" } } }, { readonly name: "get-token-uri" readonly access: "read-only" readonly args: readonly [{ readonly name: "id" readonly type: "uint128" }] readonly outputs: { readonly response: { readonly ok: { readonly optional: { readonly "string-utf8": { readonly length: 256 } } } readonly error: "uint128" } } }] readonly non_fungible_tokens: readonly [{ readonly name: "nft" readonly type: "uint128" }] }; declare const SIP013_ABI: { readonly functions: readonly [{ readonly name: "transfer" readonly access: "public" readonly args: readonly [{ readonly name: "token-id" readonly type: "uint128" }, { readonly name: "amount" readonly type: "uint128" }, { readonly name: "sender" readonly type: "principal" }, { readonly name: "recipient" readonly type: "principal" }] readonly outputs: { readonly response: { readonly ok: "bool" readonly error: "uint128" } } }, { readonly name: "transfer-memo" readonly access: "public" readonly args: readonly [{ readonly name: "token-id" readonly type: "uint128" }, { readonly name: "amount" readonly type: "uint128" }, { readonly name: "sender" readonly type: "principal" }, { readonly name: "recipient" readonly type: "principal" }, { readonly name: "memo" readonly type: { readonly buff: { readonly length: 34 } } }] readonly outputs: { readonly response: { readonly ok: "bool" readonly error: "uint128" } } }, { readonly name: "transfer-many" readonly access: "public" readonly args: readonly [{ readonly name: "transfers" readonly type: { readonly list: { readonly type: { readonly tuple: readonly [{ readonly name: "token-id" readonly type: "uint128" }, { readonly name: "amount" readonly type: "uint128" }, { readonly name: "sender" readonly type: "principal" }, { readonly name: "recipient" readonly type: "principal" }] } readonly length: 200 } } }] readonly outputs: { readonly response: { readonly ok: "bool" readonly error: "uint128" } } }, { readonly name: "transfer-many-memo" readonly access: "public" readonly args: readonly [{ readonly name: "transfers" readonly type: { readonly list: { readonly type: { readonly tuple: readonly [{ readonly name: "token-id" readonly type: "uint128" }, { readonly name: "amount" readonly type: "uint128" }, { readonly name: "sender" readonly type: "principal" }, { readonly name: "recipient" readonly type: "principal" }, { readonly name: "memo" readonly type: { readonly buff: { readonly length: 34 } } }] } readonly length: 200 } } }] readonly outputs: { readonly response: { readonly ok: "bool" readonly error: "uint128" } } }, { readonly name: "get-balance" readonly access: "read-only" readonly args: readonly [{ readonly name: "token-id" readonly type: "uint128" }, { readonly name: "account" readonly type: "principal" }] readonly outputs: { readonly response: { readonly ok: "uint128" readonly error: "uint128" } } }, { readonly name: "get-overall-balance" readonly access: "read-only" readonly args: readonly [{ readonly name: "account" readonly type: "principal" }] readonly outputs: { readonly response: { readonly ok: "uint128" readonly error: "uint128" } } }, { readonly name: "get-total-supply" readonly access: "read-only" readonly args: readonly [{ readonly name: "token-id" readonly type: "uint128" }] readonly outputs: { readonly response: { readonly ok: "uint128" readonly error: "uint128" } } }, { readonly name: "get-overall-supply" readonly access: "read-only" readonly args: readonly [] readonly outputs: { readonly response: { readonly ok: "uint128" readonly error: "uint128" } } }, { readonly name: "get-decimals" readonly access: "read-only" readonly args: readonly [{ readonly name: "token-id" readonly type: "uint128" }] readonly outputs: { readonly response: { readonly ok: "uint128" readonly error: "uint128" } } }, { readonly name: "get-token-uri" readonly access: "read-only" readonly args: readonly [{ readonly name: "token-id" readonly type: "uint128" }] readonly outputs: { readonly response: { readonly ok: { readonly optional: { readonly "string-utf8": { readonly length: 256 } } } readonly error: "uint128" } } }] readonly fungible_tokens: readonly [] readonly non_fungible_tokens: readonly [] }; declare const sip010Abi: AbiContract; declare const sip009Abi: AbiContract; declare const sip013Abi: AbiContract; /** * Static conformance classification — "does this contract's ABI look like a * SIP-009/010/013 token?". Powers trait-based discovery for the (many) contracts * that conform to a standard without declaring its trait. Lean match: every * REQUIRED standard function must be present with the same access + arg arity * (optional functions like get-token-uri are ignored). Loose on exact arg/return * types to catch real-world variants; consumers wanting certainty use the * `declared` traits parsed from source instead. */ /** The canonical SIP trait standards this package can classify/scaffold against. * Single source of truth — the `SipStandard` type, CLI `--trait` validation, and * the MCP traits resource all derive from this so the vocabulary can't drift. */ declare const TRAIT_STANDARDS: readonly ["sip-009", "sip-010", "sip-013"]; type SipStandard = (typeof TRAIT_STANDARDS)[number]; /** Return the SIP standards a contract's ABI statically conforms to. */ declare function classifyContract(abi: AbiContract): SipStandard[]; /** * Parse the standards a contract *declares* via `(impl-trait …)` in its Clarity * source. Matched heuristically on the trait-reference name (robust across * mainnet/testnet principals + community variants) rather than an exact principal * allowlist. The ABI/RPC doesn't carry trait info, so source is the only declared * signal. `declared` is the high-confidence signal; `classifyContract` is the * catch-all for conforming-but-undeclared contracts. */ declare function parseDeclaredStandards(claritySource: string): SipStandard[]; /** * Normalize function access type from various formats to internal format */ declare function normalizeAccess(access: string): "public" | "read-only" | "private"; /** * Normalize a Clarity type from API format to internal format * Handles buffer vs buff, and recursively normalizes nested types */ declare function normalizeType(type: unknown): AbiType; /** * Normalize an entire ABI from various sources to consistent internal format * * This handles ABIs from: * - Hiro API responses * - Clarinet SDK * - Upstream @secondlayer/stacks types */ declare function normalizeAbi(abi: unknown): AbiContract; /** * Duck-type check: is `value` already a built ClarityValue? Tag-only CVs * (`true`/`false`/`none`) have no payload; every other tag carries `value`. */ declare function isClarityValue(value: unknown): value is ClarityValue; /** * Convert a JS value to a ClarityValue using ABI type information. * * Pre-built ClarityValues pass through unchanged (escape hatch for callers * that already hold a CV). Buffer args additionally accept hex strings and * tagged `{ type, value }` objects — matching the generated-client input * contract. */ declare function jsToClarityValue(abiType: AbiType, value: unknown): ClarityValue; /** * Convert a ClarityValue back to a typed JS value using ABI type information. */ declare function clarityValueToJS(abiType: T, cv: ClarityValue): AbiToTS; /** Non-generic version for internal use — avoids deep type instantiation. */ declare function clarityValueToJSUntyped(abiType: AbiType, cv: ClarityValue): unknown; export { validateArgsArray, validateArgs, uintCV, tupleCV, trueCV, toCamelCase, structuredDataHash, stringUtf8CV, stringAsciiCV, standardPrincipalCV, someCV, sip013Abi, sip010Abi, sip009Abi, signStructuredData, serializeCVBytes, serializeCV, responseOkCV, responseErrorCV, prettyPrint, prepareArgs, parseDeclaredStandards, normalizeType, normalizeAccess, normalizeAbi, noneCV, listCV, jsToClarityValue, jsToClarity, isUint8Array, isUint128, isTraitReference, isString, isStandardPrincipal, isResponse, isPrincipal, isOptional, isOkResponse, isInt128, isErrResponse, isContractPrincipal, isClarityValue, isBool, isArray, isAbiTuple, isAbiTraitReference, isAbiStringUtf8, isAbiStringAscii, isAbiResponse, isAbiOptional, isAbiList, isAbiBuffer, intCV, hashStructuredData, falseCV, encodeStructuredData, deserializeCVBytes, deserializeCV, cvToValue, cvToString, cvToPrincipal, cvToJSON, cvToBuffer, cvToBoolean, cvToBigInt, contractPrincipalCV, classifyContract, clarityValueToJSUntyped, clarityValueToJS, clarityTypeFromByte, bufferCV, boolCV, VariableAccess, UIntCV, TypedAbi, TupleData, TupleCV, TrueCV, TraitFunctionAccess, ToCamelCase, TRAIT_STANDARDS, StringUtf8CV, StringAsciiCV, StandardPrincipalCV, SomeCV, SipStandard, SIP018_PREFIX, SIP013_ABI, SIP010_ABI, SIP009_ABI, ResponseOkCV, ResponseOk, ResponseErrorCV, ResponseErr, ResponseCV, Response, PrincipalCV, OptionalCV, NoneCV, ListCV, IntCV, FunctionArg, FunctionAccess, FalseCV, ExtractVariableType, ExtractVariableNames, ExtractVariable, ExtractReadOnlyFunctions, ExtractPublicFunctions, ExtractPrivateFunctions, ExtractNonFungibleTokenNames, ExtractNFTAssetType, ExtractMapValue, ExtractMapNames, ExtractMapKey, ExtractMap, ExtractImplementedTraits, ExtractFungibleTokenNames, ExtractFunctionOutput, ExtractFunctionNames, ExtractFunctionArgs, ExtractFunction, ExtractDefinedTraitNames, ExtractDataVars, ExtractConstants, ContractTypes, ContractPrincipalCV, ClarityWireType, ClarityValue, ClarityType, ClarityConversionError, Cl, CONTRACT_NAME_REGEX, BufferCV, BooleanCV, AbiVariable, AbiUInt128, AbiTypesOf, AbiType, AbiTupleType, AbiTuple, AbiTraitReference, AbiTraitFunction, AbiTraitDefinition, AbiToTS, AbiStringUtf8, AbiStringAscii, AbiResponseType, AbiResponse, AbiPrincipal, AbiPrimitiveType, AbiOptionalType, AbiOptional, AbiNone, AbiNonFungibleToken, AbiMap, AbiListType, AbiList, AbiInt128, AbiFungibleToken, AbiFunction, AbiContract, AbiBuffer, AbiBool };