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 ResponseOkCV = { readonly type: "ok" readonly value: ClarityValue }; type ResponseErrorCV = { readonly type: "err" readonly value: ClarityValue }; type StandardPrincipalCV = { readonly type: "address" readonly value: string }; type ContractPrincipalCV = { readonly type: "contract" readonly value: string }; 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; declare const AuthType: { readonly Standard: 0x04 readonly Sponsored: 0x05 }; type AuthType = (typeof AuthType)[keyof typeof AuthType]; declare const PayloadType: { readonly TokenTransfer: 0x00 readonly SmartContract: 0x01 readonly ContractCall: 0x02 readonly PoisonMicroblock: 0x03 readonly Coinbase: 0x04 readonly CoinbaseToAltRecipient: 0x05 readonly VersionedSmartContract: 0x06 readonly TenureChange: 0x07 readonly NakamotoCoinbase: 0x08 }; type PayloadType = (typeof PayloadType)[keyof typeof PayloadType]; declare const ClarityVersion: { readonly Clarity1: 1 readonly Clarity2: 2 readonly Clarity3: 3 readonly Clarity4: 4 readonly Clarity5: 5 readonly Clarity6: 6 }; type ClarityVersion = (typeof ClarityVersion)[keyof typeof ClarityVersion]; declare const AnchorMode: { readonly OnChainOnly: 0x01 readonly OffChainOnly: 0x02 readonly Any: 0x03 }; type AnchorMode = (typeof AnchorMode)[keyof typeof AnchorMode]; declare const PostConditionModeWire: { readonly Allow: 0x01 readonly Deny: 0x02 readonly Originator: 0x03 }; type PostConditionModeWire = (typeof PostConditionModeWire)[keyof typeof PostConditionModeWire]; declare const AddressHashMode: { readonly P2PKH: 0x00 readonly P2SH: 0x01 readonly P2WPKH: 0x02 readonly P2WSH: 0x03 readonly P2SH_NonSequential: 0x05 readonly P2WSH_P2SH_NonSequential: 0x07 }; type AddressHashMode = (typeof AddressHashMode)[keyof typeof AddressHashMode]; declare const PubKeyEncoding: { readonly Compressed: 0x00 readonly Uncompressed: 0x01 }; type PubKeyEncoding = (typeof PubKeyEncoding)[keyof typeof PubKeyEncoding]; declare const FungibleConditionCode: { readonly Equal: 0x01 readonly Greater: 0x02 readonly GreaterEqual: 0x03 readonly Less: 0x04 readonly LessEqual: 0x05 }; declare const NonFungibleConditionCode: { readonly Sends: 0x10 readonly DoesNotSend: 0x11 readonly MaybeSent: 0x12 }; declare const PoxConditionCode: { readonly WillNotPerform: 0x30 readonly MayPerform: 0x31 readonly WillPerform: 0x32 }; type PoxConditionCode = (typeof PoxConditionCode)[keyof typeof PoxConditionCode]; declare const PostConditionPrincipalId: { readonly Origin: 0x01 readonly Standard: 0x02 readonly Contract: 0x03 }; declare const AssetType: { readonly STX: 0x00 readonly Fungible: 0x01 readonly NonFungible: 0x02 readonly Staking: 0x03 readonly Pox: 0x04 }; declare const AuthFieldType: { readonly PublicKeyCompressed: 0x00 readonly PublicKeyUncompressed: 0x01 readonly SignatureCompressed: 0x02 readonly SignatureUncompressed: 0x03 }; declare const RECOVERABLE_ECDSA_SIG_LENGTH_BYTES = 65; declare const MEMO_MAX_LENGTH_BYTES = 34; declare const MAX_STRING_LENGTH_BYTES = 128; declare const COINBASE_BYTES_LENGTH = 32; declare const VRF_PROOF_BYTES_LENGTH = 80; declare const MICROBLOCK_HEADER_BYTES_LENGTH = 132; declare const TenureChangeCause: { readonly BlockFound: 0x00 readonly Extended: 0x01 readonly ExtendedRuntime: 0x02 readonly ExtendedReadCount: 0x03 readonly ExtendedReadLength: 0x04 readonly ExtendedWriteCount: 0x05 readonly ExtendedWriteLength: 0x06 }; type TenureChangeCause = (typeof TenureChangeCause)[keyof typeof TenureChangeCause]; type TokenTransferPayload = { payloadType: typeof PayloadType.TokenTransfer recipient: ClarityValue amount: bigint memo: string }; type ContractCallPayload = { payloadType: typeof PayloadType.ContractCall contractAddress: string contractName: string functionName: string functionArgs: ClarityValue[] }; type SmartContractPayload = { payloadType: typeof PayloadType.SmartContract | typeof PayloadType.VersionedSmartContract clarityVersion?: ClarityVersion contractName: string codeBody: string }; type CoinbasePayload = { payloadType: typeof PayloadType.Coinbase coinbaseBuffer: string }; type CoinbaseToAltRecipientPayload = { payloadType: typeof PayloadType.CoinbaseToAltRecipient coinbaseBuffer: string recipient: ClarityValue }; type PoisonMicroblockPayload = { payloadType: typeof PayloadType.PoisonMicroblock header1: string header2: string }; type TenureChangePayload = { payloadType: typeof PayloadType.TenureChange tenureConsensusHash: string prevTenureConsensusHash: string burnViewConsensusHash: string previousTenureEnd: string previousTenureBlocks: number cause: TenureChangeCause pubkeyHash: string }; type NakamotoCoinbasePayload = { payloadType: typeof PayloadType.NakamotoCoinbase coinbaseBuffer: string recipient: ClarityValue | null vrfProof: string }; type TransactionPayload = TokenTransferPayload | ContractCallPayload | SmartContractPayload | CoinbasePayload | CoinbaseToAltRecipientPayload | PoisonMicroblockPayload | TenureChangePayload | NakamotoCoinbasePayload; type SingleSigSpendingCondition = { hashMode: typeof AddressHashMode.P2PKH | typeof AddressHashMode.P2WPKH signer: string nonce: bigint fee: bigint keyEncoding: PubKeyEncoding signature: string }; type TransactionAuthField = { pubKeyEncoding: PubKeyEncoding type: "publicKey" | "signature" data: string }; type MultiSigHashMode = typeof AddressHashMode.P2SH | typeof AddressHashMode.P2WSH | typeof AddressHashMode.P2SH_NonSequential | typeof AddressHashMode.P2WSH_P2SH_NonSequential; type MultiSigSpendingCondition = { hashMode: MultiSigHashMode signer: string nonce: bigint fee: bigint fields: TransactionAuthField[] signaturesRequired: number }; type SpendingCondition = SingleSigSpendingCondition | MultiSigSpendingCondition; type StandardAuthorization = { authType: typeof AuthType.Standard spendingCondition: SpendingCondition }; type SponsoredAuthorization = { authType: typeof AuthType.Sponsored spendingCondition: SpendingCondition sponsorSpendingCondition: SpendingCondition }; type Authorization = StandardAuthorization | SponsoredAuthorization; type StacksTransaction = { version: number chainId: number auth: Authorization anchorMode: AnchorMode postConditionMode: PostConditionModeWire postConditions: PostConditionWire[] payload: TransactionPayload /** Multi-sig signer metadata — not part of the wire format, preserved * through serialize/deserialize round-trip for auto-detection. */ _multisig?: { publicKeys: string[] } }; type PostConditionWire = StxPostConditionWire | FtPostConditionWire | NftPostConditionWire | StakingPostConditionWire | PoxPostConditionWire; type StxPostConditionWire = { type: "stx" principal: PostConditionPrincipalWire conditionCode: number amount: bigint }; type FtPostConditionWire = { type: "ft" principal: PostConditionPrincipalWire asset: AssetInfoWire conditionCode: number amount: bigint }; type NftPostConditionWire = { type: "nft" principal: PostConditionPrincipalWire asset: AssetInfoWire conditionCode: number assetId: ClarityValue }; type StakingPostConditionWire = { type: "staking" principal: PostConditionPrincipalWire conditionCode: number amount: bigint }; type PoxPostConditionWire = { type: "pox" principal: PostConditionPrincipalWire conditionCode: PoxConditionCode }; type PostConditionPrincipalWire = { type: "origin" } | { type: "standard" address: string } | { type: "contract" address: string contractName: string }; type AssetInfoWire = { address: string contractName: string assetName: string }; declare function createSingleSigSpendingCondition(publicKey: string, nonce: bigint, fee: bigint): SingleSigSpendingCondition; declare function createStandardAuth(spendingCondition: SpendingCondition): StandardAuthorization; declare function createSponsoredAuth(spendingCondition: SpendingCondition, sponsorSpendingCondition?: SpendingCondition): SponsoredAuthorization; /** Compute pre-sign sighash = sha512/256(prevSigHash + authType + fee + nonce) */ declare function sigHashPreSign(curSigHash: string, authType: number, fee: bigint, nonce: bigint): string; /** Compute post-sign sighash = sha512/256(preSigHash + pubKeyEncoding + signature) */ declare function sigHashPostSign(curSigHash: string, pubKeyEncoding: number, signature: string): string; declare function nextSignature(curSigHash: string, authType: number, fee: bigint, nonce: bigint, privateKey: string): { nextSig: string nextSigHash: string }; /** 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 }; /** Account with a user-provided signing function (sync or async). */ type CustomAccount = { type: "custom" address: string publicKey: string sign(hash: Uint8Array): Promise | Uint8Array }; /** Compute the initial sighash for a transaction */ declare function signBegin(tx: StacksTransaction): string; /** Sign a single-sig transaction with a private key, returning the signed transaction */ declare function signTransaction(tx: StacksTransaction, privateKey: string): StacksTransaction; /** Sign a single-sig transaction using an account (LocalAccount or CustomAccount) */ declare function signTransactionWithAccount(tx: StacksTransaction, account: LocalAccount | CustomAccount): Promise; /** Get the txid of a transaction */ declare function getTransactionId(tx: StacksTransaction): string; /** Reconstruct the sighash after origin signing (needed for sponsor signing) */ declare function getOriginSigHash(tx: StacksTransaction): string; /** Sign a sponsored transaction as the sponsor with a private key */ declare function signSponsor(tx: StacksTransaction, privateKey: string): StacksTransaction; /** Sign a sponsored transaction as the sponsor using an account */ declare function signSponsorWithAccount(tx: StacksTransaction, account: LocalAccount | CustomAccount): Promise; /** Full chain descriptor used by clients and transports for network-aware operations. */ type StacksChain = { /** Chain ID (e.g. 0x00000001 for mainnet) */ id: number /** Human-readable name */ name: string /** Network type */ network: "mainnet" | "testnet" /** Transaction version byte for serialization */ transactionVersion: number /** Peer network ID for P2P broadcasting */ peerNetworkId: number /** Address version bytes */ addressVersion: { singleSig: number multiSig: number } /** Magic bytes for network identification */ magicBytes: string /** Boot address (system contracts deployer) */ bootAddress: string /** Native currency info */ nativeCurrency: { name: string symbol: string decimals: number } /** Default RPC URLs */ rpcUrls: { default: { http: string[] ws?: string[] } } /** Block explorer URLs */ blockExplorers?: { default: { name: string url: string } } }; type FungibleComparator = "eq" | "gt" | "gte" | "lt" | "lte"; type NonFungibleComparator = "sent" | "not-sent" | "maybe-sent"; type StxPostCondition = { type: "stx-postcondition" address: string condition: FungibleComparator amount: string | bigint | number }; type FtPostCondition = { type: "ft-postcondition" address: string condition: FungibleComparator asset: string amount: string | bigint | number }; type NftPostCondition = { type: "nft-postcondition" address: string condition: NonFungibleComparator asset: string assetId: ClarityValue }; type StakingPostCondition = { type: "staking-postcondition" address: string condition: FungibleComparator amount: string | bigint | number }; type PoxComparator = "will-not-perform" | "may-perform" | "will-perform"; type PoxPostCondition = { type: "pox-postcondition" address: string condition: PoxComparator }; type PostCondition = StxPostCondition | FtPostCondition | NftPostCondition | StakingPostCondition | PoxPostCondition; /** Serialized PC hex is accepted anywhere a `PostCondition` object is. */ type PostConditionInput = PostCondition | string; type PostConditionMode = "allow" | "deny" | "originator"; type IntegerType = number | string | bigint | Uint8Array; type MultiSigOptions = { publicKeys?: string[] signaturesRequired?: number hashMode?: MultiSigHashMode }; type BuildTokenTransferOptions = MultiSigOptions & { recipient: string amount: IntegerType memo?: string fee: IntegerType nonce: IntegerType publicKey?: string chain?: StacksChain postConditionMode?: PostConditionMode postConditions?: PostConditionInput[] sponsored?: boolean }; type BuildContractCallOptions = MultiSigOptions & { contractAddress: string contractName: string functionName: string functionArgs: ClarityValue[] fee: IntegerType nonce: IntegerType publicKey?: string chain?: StacksChain postConditionMode?: PostConditionMode postConditions?: PostConditionInput[] sponsored?: boolean }; type BuildContractDeployOptions = MultiSigOptions & { contractName: string codeBody: string clarityVersion?: ClarityVersion fee: IntegerType nonce: IntegerType publicKey?: string chain?: StacksChain postConditionMode?: PostConditionMode postConditions?: PostConditionInput[] sponsored?: boolean }; declare function buildTokenTransfer(options: BuildTokenTransferOptions): StacksTransaction; declare function buildContractCall(options: BuildContractCallOptions): StacksTransaction; declare function buildContractDeploy(options: BuildContractDeployOptions): StacksTransaction; declare function serializePostConditionWire(pc: PostConditionWire): Uint8Array; declare function serializeTransaction(tx: StacksTransaction): Uint8Array; declare function serializeTransactionHex(tx: StacksTransaction): string; declare function deserializePostConditionWire(input: string | Uint8Array): PostConditionWire; declare function deserializeTransaction(input: string | Uint8Array, meta?: { _multisig?: { publicKeys: string[] } }): StacksTransaction; /** Check if hash mode is non-sequential (SIP-027) */ declare function isNonSequential(hashMode: number): boolean; /** Derive a multi-sig address from public keys */ declare function makeMultiSigAddress(publicKeys: string[], signaturesRequired: number, chain?: StacksChain): string; /** Create an empty multi-sig spending condition */ declare function createMultiSigSpendingCondition(publicKeys: string[], signaturesRequired: number, nonce: bigint, fee: bigint, hashMode?: MultiSigHashMode): MultiSigSpendingCondition; /** Replay sighash through existing auth fields of a multi-sig tx */ declare function replayMultiSigSigHash(tx: StacksTransaction): string; /** Sign one position of a multi-sig transaction with a private key */ declare function signMultiSig(tx: StacksTransaction, privateKey: string, publicKeys: string[]): StacksTransaction; /** Sign one position of a multi-sig transaction with an account */ declare function signMultiSigWithAccount(tx: StacksTransaction, account: LocalAccount | CustomAccount, publicKeys: string[]): Promise; /** Fill remaining slots with pubkey fields after all signatures are collected */ declare function finalizeMultiSig(tx: StacksTransaction, publicKeys: string[]): StacksTransaction; /** Combine independently-signed non-sequential multi-sig transactions */ declare function combineMultiSigSignatures(baseTx: StacksTransaction, signedTxs: StacksTransaction[]): StacksTransaction; export { signTransactionWithAccount, signTransaction, signSponsorWithAccount, signSponsor, signMultiSigWithAccount, signMultiSig, signBegin, sigHashPreSign, sigHashPostSign, serializeTransactionHex, serializeTransaction, serializePostConditionWire, replayMultiSigSigHash, nextSignature, makeMultiSigAddress, isNonSequential, getTransactionId, getOriginSigHash, finalizeMultiSig, deserializeTransaction, deserializePostConditionWire, createStandardAuth, createSponsoredAuth, createSingleSigSpendingCondition, createMultiSigSpendingCondition, combineMultiSigSignatures, buildTokenTransfer, buildContractDeploy, buildContractCall, VRF_PROOF_BYTES_LENGTH, TransactionPayload, TransactionAuthField, TokenTransferPayload, TenureChangePayload, TenureChangeCause as TenureChangeCauseType, TenureChangeCause, StxPostConditionWire, StandardAuthorization, StakingPostConditionWire, StacksTransaction, SponsoredAuthorization, SpendingCondition, SmartContractPayload, SingleSigSpendingCondition, RECOVERABLE_ECDSA_SIG_LENGTH_BYTES, PubKeyEncoding, PoxPostConditionWire, PoxConditionCode, PostConditionWire, PostConditionPrincipalId, PostConditionModeWire, PoisonMicroblockPayload, PayloadType, NonFungibleConditionCode, NftPostConditionWire, NakamotoCoinbasePayload, MultiSigSpendingCondition, MultiSigHashMode, MICROBLOCK_HEADER_BYTES_LENGTH, MEMO_MAX_LENGTH_BYTES, MAX_STRING_LENGTH_BYTES, FungibleConditionCode, FtPostConditionWire, ContractCallPayload, CoinbaseToAltRecipientPayload, CoinbasePayload, ClarityVersion, COINBASE_BYTES_LENGTH, BuildTokenTransferOptions, BuildContractDeployOptions, BuildContractCallOptions, Authorization, AuthType, AuthFieldType, AssetType, AnchorMode, AddressHashMode };