# transactions | Stacks.js 1.4.1 Library Reference
Documentation for Stacks.js 1.4.1 Library Reference

# @stacks/transactions

Construct, decode transactions and work with Clarity smart contracts on the Stacks blockchain.

## Installation

    npm install @stacks/transactions

## Overview

This library supports the creation of the following Stacks transaction types:

1. STX token transfer
2. Smart contract deploy
3. Smart contract function call

## Key Generation

    import { createStacksPrivateKey, makeRandomPrivKey, getPublicKey } from '@stacks/transactions';

    // Random key
    const privateKey = makeRandomPrivKey();
    // Get public key from private
    const publicKey = getPublicKey(privateKey);

    // Private key from hex string
    const key = 'b244296d5907de9864c0b0d51f98a13c52890be0404e83f273144cd5b9960eed01';
    const privateKey = createStacksPrivateKey(key);

## STX Token Transfer Transaction

    import {
      makeSTXTokenTransfer,
      makeStandardSTXPostCondition,
      broadcastTransaction,
    } from '@stacks/transactions';
    import { StacksTestnet, StacksMainnet } from '@stacks/network';
    const BigNum = require('bn.js');

    // for mainnet, use `StacksMainnet()`
    const network = new StacksTestnet();

    const txOptions = {
      recipient: 'SP3FGQ8Z7JY9BWYZ5WM53E0M9NK7WHJF0691NZ159',
      amount: new BigNum(12345),
      senderKey: 'b244296d5907de9864c0b0d51f98a13c52890be0404e83f273144cd5b9960eed01',
      network,
      memo: 'test memo',
      nonce: new BigNum(0), // set a nonce manually if you don't want builder to fetch from a Stacks node
      fee: new BigNum(200), // set a tx fee if you don't want the builder to estimate
      anchorMode: AnchorMode.Any
    };

    const transaction = await makeSTXTokenTransfer(txOptions);

    // to see the raw serialized tx
    const serializedTx = transaction.serialize().toString('hex');

    // broadcasting transaction to the specified network
    broadcastTransaction(transaction, network);

## Smart Contract Deploy Transaction

    import { makeContractDeploy, broadcastTransaction, AnchorMode } from '@stacks/transactions';
    import { StacksTestnet, StacksMainnet } from '@stacks/network';
    const BigNum = require('bn.js');

    // for mainnet, use `StacksMainnet()`
    const network = new StacksTestnet();

    const txOptions = {
      contractName: 'contract_name',
      codeBody: fs.readFileSync('/path/to/contract.clar').toString(),
      senderKey: 'b244296d5907de9864c0b0d51f98a13c52890be0404e83f273144cd5b9960eed01',
      network,
    };

    const transaction = await makeContractDeploy(txOptions);

    broadcastTransaction(transaction, network);

## Smart Contract Function Call

    import { makeContractCall, BufferCV, broadcastTransaction, AnchorMode } from '@stacks/transactions';
    import { StacksTestnet, StacksMainnet } from '@stacks/network';
    const BigNum = require('bn.js');

    // for mainnet, use `StacksMainnet()`
    const network = new StacksTestnet();

    // Add an optional post condition
    // See below for details on constructing post conditions
    const postConditionAddress = 'SP2ZD731ANQZT6J4K3F5N8A40ZXWXC1XFXHVVQFKE';
    const postConditionCode = FungibleConditionCode.GreaterEqual;
    const postConditionAmount = new BigNum(1000000);
    const postConditions = [
      makeStandardSTXPostCondition(postConditionAddress, postConditionCode, postConditionAmount),
    ];

    const txOptions = {
      contractAddress: 'SPBMRFRPPGCDE3F384WCJPK8PQJGZ8K9QKK7F59X',
      contractName: 'contract_name',
      functionName: 'contract_function',
      functionArgs: [bufferCVFromString('foo')],
      senderKey: 'b244296d5907de9864c0b0d51f98a13c52890be0404e83f273144cd5b9960eed01',
      validateWithAbi: true,
      network,
      postConditions,
      anchorMode: AnchorMode.Any,
    };

    const transaction = await makeContractCall(txOptions);

    broadcastTransaction(transaction, network);

In this example we construct a `contract-call` transaction with a post condition. We have set the `validateWithAbi` option to `true`, so the `makeContractCall` builder will attempt to fetch this contracts ABI from the specified Stacks network, and validate that the provided functionArgs match what is described in the ABI. This should help you avoid constructing invalid contract-call transactions. If you would prefer to provide your own ABI instead of fetching it from the network, the `validateWithABI` option also accepts ClarityABI objects, which can be constructed from ABI files like so:

    import { readFileSync } from 'fs';

    const abi: ClarityAbi = JSON.parse(readFileSync('abi.json').toString());

## Sponsoring Transactions

To generate a sponsored transaction, first create and sign the transaction as the origin. The `sponsored` property in the options object must be set to true.

    import { makeContractCall, BufferCV, AnchorMode } from '@stacks/transactions';
    const BigNum = require('bn.js');

    const txOptions = {
      contractAddress: 'SPBMRFRPPGCDE3F384WCJPK8PQJGZ8K9QKK7F59X',
      contractName: 'contract_name',
      functionName: 'contract_function',
      functionArgs: [bufferCVFromString('foo')],
      senderKey: 'b244296d5907de9864c0b0d51f98a13c52890be0404e83f273144cd5b9960eed01',
      validateWithAbi: true,
      sponsored: true,
      anchorMode: AnchorMode.Any,
    };

    const transaction = await makeContractCall(txOptions);
    const serializedTx = transaction.serialize().toString('hex');

The serialized transaction can now be passed to the sponsoring party which will sign the sponsor portion of the transaction and set the fee.

    import {
      sponsorTransaction,
      BufferReader,
      deserializeTransaction,
      broadcastTransaction,
    } from '@stacks/transactions';
    import { StacksTestnet, StacksMainnet } from '@stacks/network';
    const BigNum = require('bn.js');

    const bufferReader = new BufferReader(Buffer.from(serializedTx));
    const deserializedTx = deserializeTransaction(bufferReader);
    const sponsorKey = '770287b9471081c8acd37d57190c7a70f0da2633311cc120853537362d32e67c01';
    const fee = new BigNum(1000);

    const sponsorOptions = {
      transaction: deserializedTx,
      sponsorPrivateKey: sponsorKey,
      fee,
    };

    const sponsoredTx = await sponsorTransaction(sponsorOptions);

    // for mainnet, use `StacksMainnet()`
    const network = new StacksTestnet();
    broadcastTransaction(sponsoredTx, network);

## Supporting multi-signature transactions

To generate a multi-sig transaction, first create an unsigned transaction. The `numSignatures` and `publicKeys` properties in the options object must be set:

    import {
      makeUnsignedSTXTokenTransfer,
      createStacksPrivateKey,
      pubKeyfromPrivKey,
      publicKeyToString,
      TransactionSigner,
      standardPrincipalCV,
      BufferReader,
      AnchorMode,
    } from '@stacks/transactions';
    const BigNum = require('bn.js');

    const recipient = standardPrincipalCV('SP3FGQ8...');
    const amount = new BigNum(2500000);
    const fee = new BigNum(0);
    const nonce = new BigNum(0);
    const memo = 'test memo';

    // private keys of the participants in the transaction
    const privKeyStrings = ['6d430bb9...', '2a584d89...', 'd5200dee...'];

    // create private key objects from string array
    const privKeys = privKeyStrings.map(createStacksPrivateKey);

    // corresponding public keys
    const pubKeys = privKeyStrings.map(pubKeyfromPrivKey);

    // create public key string array from objects
    const pubKeyStrings = pubKeys.map(publicKeyToString);

    const transaction = await makeUnsignedSTXTokenTransfer({
      recipient,
      amount,
      fee,
      nonce,
      memo,
      numSignatures: 2, // number of signature required
      publicKeys: pubKeyStrings, // public key string array with >= numSignatures elements
      anchorMode: AnchorMode.Any,
    });

    const serializedTx = transaction.serialize();

This transaction payload can be passed along to other participants to sign. In addition to meeting the numSignatures requirement, the public keys of the parties who did not sign the transaction must be appended to the signature.

    // deserialize and sign transaction
    const bufferReader = new BufferReader(serializedTx);
    const deserializedTx = deserializeTransaction(bufferReader);

    const signer = new TransactionSigner(deserializedTx);

    // first signature
    signer.signOrigin(privKeys[0]);

    // second signature
    signer.signOrigin(privKeys[1]);

    // after meeting the numSignatures requirement, the public
    // keys of the participants who did not sign must be appended
    signer.appendOrigin(pubKeys[2]);

    // the serialized multi-sig tx
    const serializedSignedTx = deserializedTx.serialize();

## Calling Read-only Contract Functions

Read-only contract functions can be called without generating or broadcasting a transaction. Instead it works via a direct API call to a Stacks node.

    const contractAddress = 'ST3KC0MTNW34S1ZXD36JYKFD3JJMWA01M55DSJ4JE';
    const contractName = 'kv-store';
    const functionName = 'get-value';
    const buffer = bufferCVFromString('foo');
    const network = new StacksTestnet();
    const senderAddress = 'ST2F4BK4GZH6YFBNHYDDGN4T1RKBA7DA1BJZPJEJJ';

    const options = {
      contractAddress,
      contractName,
      functionName,
      functionArgs: [buffer],
      network,
      senderAddress,
    };

    const result = await callReadOnlyFunction(options);

## Constructing Clarity Values

Building transactions that call functions in deployed clarity contracts requires you to construct valid Clarity Values to pass to the function as arguments. The Clarity type system contains the following types:

- `(tuple (key-name-0 key-type-0) (key-name-1 key-type-1) ...)`
  - a typed tuple with named fields.
- `(list max-len entry-type)`
  - a list of maximum length max-len, with entries of type entry-type
- `(response ok-type err-type)`
  - object used by public functions to commit their changes or abort. May be returned or used by other functions as well, however, only public functions have the commit/abort behavior.
- `(optional some-type)`
  - an option type for objects that can either be (some value) or none
- `(buff max-len)`
  - byte buffer or maximum length max-len.
- `principal`
  - object representing a principal (whether a contract principal or standard principal).
- `bool`
  - boolean value ('true or 'false)
- `int`
  - signed 128-bit integer
- `uint`
  - unsigned 128-bit integer

This library contains Typescript types and classes that map to the Clarity types, in order to make it easy to construct well-typed Clarity values in Javascript. These types all extend the abstract class `ClarityValue`.

    // construct boolean clarity values
    const t = trueCV();
    const f = falseCV();

    // construct optional clarity values
    const nothing = noneCV();
    const something = someCV(t);

    // construct a buffer clarity value from an existing Buffer
    const buffer = Buffer.from('foo');
    const bufCV = bufferCV(buffer);

    // construct signed and unsigned integer clarity values
    const i = intCV(-10);
    const u = uintCV(10);

    // construct principal clarity values
    const address = 'SP2JXKMSH007NPYAQHKJPQMAQYAD90NQGTVJVQ02B';
    const contractName = 'contract-name';
    const spCV = standardPrincipalCV(address);
    const cpCV = contractPrincipalCV(address, contractName);

    // construct response clarity values
    const errCV = responseErrorCV(trueCV());
    const okCV = responseOkCV(falseCV());

    // construct tuple clarity values
    const tupCV = tupleCV({
      a: intCV(1),
      b: trueCV(),
      c: falseCV(),
    });

    // construct list clarity values
    const l = listCV([trueCV(), falseCV()]);

If you develop in Typescript, the type checker can help prevent you from creating wrongly-typed Clarity values. For example, the following code won't compile since in Clarity lists are homogeneous, meaning they can only contain values of a single type. It is important to include the type variable `BooleanCV` in this example, otherwise the typescript type checker won't know which type the list is of and won't enforce homogeneity.

    const l = listCV<BooleanCV>([trueCV(), intCV(1)]);

## Post Conditions

Three types of post conditions can be added to transactions:

1. STX post condition
2. Fungible token post condition
3. Non-Fungible token post condition

For details see: https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#transaction-post-conditions

### STX post condition

    // With a standard principal
    const postConditionAddress = 'SP2ZD731ANQZT6J4K3F5N8A40ZXWXC1XFXHVVQFKE';
    const postConditionCode = FungibleConditionCode.GreaterEqual;
    const postConditionAmount = new BigNum(12345);

    const standardSTXPostCondition = makeStandardSTXPostCondition(
      postConditionAddress,
      postConditionCode,
      postConditionAmount
    );

    // With a contract principal
    const contractAddress = 'SPBMRFRPPGCDE3F384WCJPK8PQJGZ8K9QKK7F59X';
    const contractName = 'test-contract';

    const contractSTXPostCondition = makeContractSTXPostCondition(
      contractAddress,
      contractName,
      postConditionCode,
      postConditionAmount
    );

### Fungible token post condition

    // With a standard principal
    const postConditionAddress = 'SP2ZD731ANQZT6J4K3F5N8A40ZXWXC1XFXHVVQFKE';
    const postConditionCode = FungibleConditionCode.GreaterEqual;
    const postConditionAmount = new BigNum(12345);
    const assetAddress = 'SP62M8MEFH32WGSB7XSF9WJZD7TQB48VQB5ANWSJ';
    const assetContractName = 'test-asset-contract';
    const fungibleAssetInfo = createAssetInfo(assetAddress, assetContractName);

    const standardFungiblePostCondition = makeStandardFungiblePostCondition(
      postConditionAddress,
      postConditionCode,
      postConditionAmount,
      fungibleAssetInfo
    );

    // With a contract principal
    const contractAddress = 'SPBMRFRPPGCDE3F384WCJPK8PQJGZ8K9QKK7F59X';
    const contractName = 'test-contract';
    const assetAddress = 'SP62M8MEFH32WGSB7XSF9WJZD7TQB48VQB5ANWSJ';
    const assetContractName = 'test-asset-contract';
    const fungibleAssetInfo = createAssetInfo(assetAddress, assetContractName);

    const contractFungiblePostCondition = makeContractFungiblePostCondition(
      contractAddress,
      contractName,
      postConditionCode,
      postConditionAmount,
      fungibleAssetInfo
    );

### Non-fungible token post condition

    // With a standard principal
    const postConditionAddress = 'SP2ZD731ANQZT6J4K3F5N8A40ZXWXC1XFXHVVQFKE';
    const postConditionCode = NonFungibleConditionCode.Owns;
    const assetAddress = 'SP62M8MEFH32WGSB7XSF9WJZD7TQB48VQB5ANWSJ';
    const assetContractName = 'test-asset-contract';
    const assetName = 'test-asset';
    const tokenAssetName = 'test-token-asset';
    const nonFungibleAssetInfo = createAssetInfo(assetAddress, assetContractName, assetName);

    const standardNonFungiblePostCondition = makeStandardNonFungiblePostCondition(
      postConditionAddress,
      postConditionCode,
      nonFungibleAssetInfo,
      tokenAssetName
    );

    // With a contract principal
    const contractAddress = 'SPBMRFRPPGCDE3F384WCJPK8PQJGZ8K9QKK7F59X';
    const contractName = 'test-contract';

    const contractNonFungiblePostCondition = makeContractNonFungiblePostCondition(
      contractAddress,
      contractName,
      postConditionCode,
      nonFungibleAssetInfo,
      tokenAssetName
    );

## Helper functions

### Conversion of Clarity Values to JSON

Clarity Values represent values of Clarity contracts. If a JSON format is required the helper function `cvToJSON` can be used.

    cvToJSON(hexToCV(tx.tx_result.hex))

## Index

### References

- randomBytes

### Enumerations

- AddressHashMode
- AddressVersion
- AnchorMode
- AssetType
- AuthType
- ChainID
- ClarityAbiTypeId
- ClarityType
- FungibleConditionCode
- NonFungibleConditionCode
- PayloadType
- PostConditionMode
- PostConditionPrincipalID
- PostConditionType
- PubKeyEncoding
- StacksMessageType
- TransactionVersion
- TxRejectedReason

### Classes

- Authorization
- BufferArray
- BufferReader
- SponsoredAuthorization
- StacksTransaction
- StandardAuthorization
- TransactionSigner
- sha512_256

### Interfaces

- Address
- AssetInfo
- BufferCV
- ClarityAbi
- ClarityAbiFunction
- ClarityAbiMap
- ClarityAbiTypeFungibleToken
- ClarityAbiTypeNonFungibleToken
- ClarityAbiVariable
- CoinbasePayload
- ContractCallOptions
- ContractCallPayload
- ContractDeployOptions
- ContractPrincipal
- ContractPrincipalCV
- FalseCV
- IntCV
- LengthPrefixedList
- LengthPrefixedString
- ListCV
- MemoString
- MessageSignature
- MultiSigOptions
- MultiSigSpendingCondition
- NoneCV
- PoisonPayload
- ReadOnlyFunctionErrorResponse
- ReadOnlyFunctionOptions
- ReadOnlyFunctionSuccessResponse
- ResponseErrorCV
- ResponseOkCV
- SignedContractCallOptions
- SignedMultiSigContractCallOptions
- SignedMultiSigTokenTransferOptions
- SignedTokenTransferOptions
- SingleSigSpendingCondition
- SmartContractPayload
- SomeCV
- SponsorOptions
- StacksPrivateKey
- StacksPublicKey
- StandardPrincipal
- StandardPrincipalCV
- StringAsciiCV
- StringUtf8CV
- TokenTransferOptions
- TokenTransferPayload
- TransactionAuthField
- TrueCV
- TupleCV
- UIntCV
- UnsignedContractCallOptions
- UnsignedMultiSigContractCallOptions
- UnsignedMultiSigTokenTransferOptions
- UnsignedTokenTransferOptions

### Type aliases

- BooleanCV
- ClarityAbiType
- ClarityAbiTypeBool
- ClarityAbiTypeBuffer
- ClarityAbiTypeInt128
- ClarityAbiTypeList
- ClarityAbiTypeNone
- ClarityAbiTypeOptional
- ClarityAbiTypePrimitive
- ClarityAbiTypePrincipal
- ClarityAbiTypeResponse
- ClarityAbiTypeStringAscii
- ClarityAbiTypeStringUtf8
- ClarityAbiTypeTraitReference
- ClarityAbiTypeTuple
- ClarityAbiTypeUInt128
- ClarityAbiTypeUnion
- ClarityValue
- MultiSigHashMode
- OptionalCV
- PostCondition
- PostConditionPrincipal
- PrincipalCV
- ReadOnlyFunctionResponse
- ResponseCV
- SingleSigHashMode
- SpendingCondition
- StacksMessage
- TransactionAuthFieldContents
- TxBroadcastResult
- TxBroadcastResultOk
- TxBroadcastResultRejected

### Variables

- CLARITY_INT_SIZE
- COINBASE_BUFFER_LENGTH_BYTES
- COMPRESSED_PUBKEY_LENGTH_BYTES
- DEFAULT_CHAIN_ID
- DEFAULT_CORE_NODE_API_URL
- DEFAULT_TRANSACTION_VERSION
- MAX_STRING_LENGTH_BYTES
- MEMO_MAX_LENGTH_BYTES
- RECOVERABLE_ECDSA_SIG_LENGTH_BYTES
- UNCOMPRESSED_PUBKEY_LENGTH_BYTES

### Functions

- abiFunctionToString
- addressFromHashMode
- addressFromPublicKeys
- addressFromVersionHash
- addressHashModeToVersion
- addressToString
- broadcastRawTransaction
- broadcastTransaction
- bufferCV
- bufferCVFromString
- callReadOnlyFunction
- cloneDeep
- codeBodyString
- compressPublicKey
- contractPrincipalCV
- contractPrincipalCVFromAddress
- contractPrincipalCVFromStandard
- createAddress
- createAssetInfo
- createContractPrincipal
- createEmptyAddress
- createFungiblePostCondition
- createLPList
- createLPString
- createMemoString
- createMessageSignature
- createMultiSigSpendingCondition
- createNonFungiblePostCondition
- createSTXPostCondition
- createSingleSigSpendingCondition
- createStacksPrivateKey
- createStacksPublicKey
- createStandardPrincipal
- createTransactionAuthField
- cvToHex
- cvToJSON
- cvToString
- cvToValue
- deserializeAddress
- deserializeAssetInfo
- deserializeCV
- deserializeLPList
- deserializeLPString
- deserializeMemoString
- deserializeMessageSignature
- deserializeMultiSigSpendingCondition
- deserializePostCondition
- deserializePrincipal
- deserializePublicKey
- deserializeSingleSigSpendingCondition
- deserializeSpendingCondition
- deserializeStacksMessage
- deserializeTransaction
- deserializeTransactionAuthField
- emptyMessageSignature
- encodeClarityValue
- estimateContractDeploy
- estimateContractFunctionCall
- estimateTransfer
- exceedsMaxLengthBytes
- falseCV
- getAbi
- getAddressFromPrivateKey
- getAddressFromPublicKey
- getCVTypeString
- getNonce
- getPublicKey
- getSignatureRecoveryParam
- getTypeString
- getTypeUnion
- hash160
- hashP2PKH
- hashP2SH
- hexStringToInt
- hexToCV
- intCV
- intToHexString
- isClarityAbiBuffer
- isClarityAbiList
- isClarityAbiOptional
- isClarityAbiPrimitive
- isClarityAbiResponse
- isClarityAbiStringAscii
- isClarityAbiStringUtf8
- isClarityAbiTuple
- isClarityName
- isCompressed
- isSingleSig
- leftPadHex
- leftPadHexToLength
- listCV
- makeContractCall
- makeContractDeploy
- makeContractFungiblePostCondition
- makeContractNonFungiblePostCondition
- makeContractSTXPostCondition
- makeRandomPrivKey
- makeSTXTokenTransfer
- makeSigHashPreSign
- makeStandardFungiblePostCondition
- makeStandardNonFungiblePostCondition
- makeStandardSTXPostCondition
- makeUnsignedContractCall
- makeUnsignedSTXTokenTransfer
- nextSignature
- nextVerification
- noneCV
- omit
- parseAssetInfoString
- parsePrincipalString
- parseReadOnlyResponse
- parseRecoverableSignature
- parseToCV
- privateKeyToString
- pubKeyfromPrivKey
- publicKeyFromBuffer
- publicKeyFromSignature
- publicKeyToAddress
- publicKeyToString
- responseErrorCV
- responseOkCV
- rightPadHexToLength
- serializeAddress
- serializeAssetInfo
- serializeCV
- serializeLPList
- serializeLPString
- serializeMemoString
- serializeMessageSignature
- serializeMultiSigSpendingCondition
- serializePostCondition
- serializePrincipal
- serializePublicKey
- serializeSingleSigSpendingCondition
- serializeSpendingCondition
- serializeStacksMessage
- serializeTransactionAuthField
- signWithKey
- someCV
- sponsorTransaction
- standardPrincipalCV
- standardPrincipalCVFromAddress
- stringAsciiCV
- stringUtf8CV
- trueCV
- tupleCV
- txidFromData
- uintCV
- validateContractCall
- validateStacksAddress

## References

### randomBytes

Re-exports randomBytes

## Type aliases

### BooleanCV

BooleanCV: TrueCV | FalseCV

- Defined in packages/transactions/src/clarity/types/booleanCV.ts:3

### ClarityAbiType

ClarityAbiType: ClarityAbiTypePrimitive | ClarityAbiTypeBuffer | ClarityAbiTypeResponse | ClarityAbiTypeOptional | ClarityAbiTypeTuple | ClarityAbiTypeList | ClarityAbiTypeStringAscii | ClarityAbiTypeStringUtf8 | ClarityAbiTypeTraitReference

- Defined in packages/transactions/src/contract-abi.ts:46

### ClarityAbiTypeBool

ClarityAbiTypeBool: "bool"

- Defined in packages/transactions/src/contract-abi.ts:33

### ClarityAbiTypeBuffer

ClarityAbiTypeBuffer: { buffer: { length: number } }

- Defined in packages/transactions/src/contract-abi.ts:23

#### Type declaration

- ##### buffer: { length: number }

  - ##### length: number

### ClarityAbiTypeInt128

ClarityAbiTypeInt128: "int128"

- Defined in packages/transactions/src/contract-abi.ts:32

### ClarityAbiTypeList

ClarityAbiTypeList: { list: { length: number; type: ClarityAbiType } }

- Defined in packages/transactions/src/contract-abi.ts:29

#### Type declaration

- ##### list: { length: number; type: ClarityAbiType }

  - ##### length: number

  - ##### type: ClarityAbiType

### ClarityAbiTypeNone

ClarityAbiTypeNone: "none"

- Defined in packages/transactions/src/contract-abi.ts:36

### ClarityAbiTypeOptional

ClarityAbiTypeOptional: { optional: ClarityAbiType }

- Defined in packages/transactions/src/contract-abi.ts:27

#### Type declaration

- ##### optional: ClarityAbiType

### ClarityAbiTypePrimitive

ClarityAbiTypePrimitive: ClarityAbiTypeUInt128 | ClarityAbiTypeInt128 | ClarityAbiTypeBool | ClarityAbiTypePrincipal | ClarityAbiTypeTraitReference | ClarityAbiTypeNone

- Defined in packages/transactions/src/contract-abi.ts:38

### ClarityAbiTypePrincipal

ClarityAbiTypePrincipal: "principal"

- Defined in packages/transactions/src/contract-abi.ts:34

### ClarityAbiTypeResponse

ClarityAbiTypeResponse: { response: { error: ClarityAbiType ; ok: ClarityAbiType } }

- Defined in packages/transactions/src/contract-abi.ts:26

#### Type declaration

- ##### response: { error: ClarityAbiType ; ok: ClarityAbiType }

  - ##### error: ClarityAbiType

  - ##### ok: ClarityAbiType

### ClarityAbiTypeStringAscii

ClarityAbiTypeStringAscii: { string-ascii: { length: number } }

- Defined in packages/transactions/src/contract-abi.ts:24

#### Type declaration

- ##### string-ascii: { length: number }

  - ##### length: number

### ClarityAbiTypeStringUtf8

ClarityAbiTypeStringUtf8: { string-utf8: { length: number } }

- Defined in packages/transactions/src/contract-abi.ts:25

#### Type declaration

- ##### string-utf8: { length: number }

  - ##### length: number

### ClarityAbiTypeTraitReference

ClarityAbiTypeTraitReference: "trait_reference"

- Defined in packages/transactions/src/contract-abi.ts:35

### ClarityAbiTypeTuple

ClarityAbiTypeTuple: { tuple: { name: string; type: ClarityAbiType }[] }

- Defined in packages/transactions/src/contract-abi.ts:28

#### Type declaration

- ##### tuple: { name: string; type: ClarityAbiType }[]

### ClarityAbiTypeUInt128

ClarityAbiTypeUInt128: "uint128"

- Defined in packages/transactions/src/contract-abi.ts:31

### ClarityAbiTypeUnion

ClarityAbiTypeUnion: { id: ClarityAbiTypeUInt128 ; type: ClarityAbiTypeUInt128 } | { id: ClarityAbiTypeInt128 ; type: ClarityAbiTypeInt128 } | { id: ClarityAbiTypeBool ; type: ClarityAbiTypeBool } | { id: ClarityAbiTypePrincipal ; type: ClarityAbiTypePrincipal } | { id: ClarityAbiTypeTraitReference ; type: ClarityAbiTypeTraitReference } | { id: ClarityAbiTypeNone ; type: ClarityAbiTypeNone } | { id: ClarityAbiTypeBuffer ; type: ClarityAbiTypeBuffer } | { id: ClarityAbiTypeResponse ; type: ClarityAbiTypeResponse } | { id: ClarityAbiTypeOptional ; type: ClarityAbiTypeOptional } | { id: ClarityAbiTypeTuple ; type: ClarityAbiTypeTuple } | { id: ClarityAbiTypeList ; type: ClarityAbiTypeList } | { id: ClarityAbiTypeStringAscii ; type: ClarityAbiTypeStringAscii } | { id: ClarityAbiTypeStringUtf8 ; type: ClarityAbiTypeStringUtf8 }

- Defined in packages/transactions/src/contract-abi.ts:90

### ClarityValue

ClarityValue: BooleanCV | BufferCV | IntCV | UIntCV | StandardPrincipalCV | ContractPrincipalCV | ResponseErrorCV | ResponseOkCV | NoneCV | SomeCV | ListCV | TupleCV | StringAsciiCV | StringUtf8CV

- Defined in packages/transactions/src/clarity/clarityValue.ts:44

### MultiSigHashMode

MultiSigHashMode: SerializeP2SH | SerializeP2WSH

- Defined in packages/transactions/src/constants.ts:98

### OptionalCV

OptionalCV<T>: NoneCV | SomeCV <T>

- Defined in packages/transactions/src/clarity/types/optionalCV.ts:3

#### Type parameters

- #### T: ClarityValue = ClarityValue

### PostCondition

PostCondition: STXPostCondition | FungiblePostCondition | NonFungiblePostCondition

- Defined in packages/transactions/src/postcondition.ts:27

### PostConditionPrincipal

PostConditionPrincipal: StandardPrincipal | ContractPrincipal

- Defined in packages/transactions/src/types.ts:241

### PrincipalCV

PrincipalCV: StandardPrincipalCV | ContractPrincipalCV

- Defined in packages/transactions/src/clarity/types/principalCV.ts:11

### ReadOnlyFunctionResponse

ReadOnlyFunctionResponse: ReadOnlyFunctionSuccessResponse | ReadOnlyFunctionErrorResponse

- Defined in packages/transactions/src/utils.ts:185

### ResponseCV

ResponseCV: ResponseErrorCV | ResponseOkCV

- Defined in packages/transactions/src/clarity/types/responseCV.ts:3

### SingleSigHashMode

SingleSigHashMode: SerializeP2PKH | SerializeP2WPKH

- Defined in packages/transactions/src/constants.ts:97

### SpendingCondition

SpendingCondition: SingleSigSpendingCondition | MultiSigSpendingCondition

- Defined in packages/transactions/src/authorization.ts:186

### StacksMessage

StacksMessage: Address | PostConditionPrincipal | LengthPrefixedString | LengthPrefixedList | Payload | MemoString | AssetInfo | PostCondition | StacksPublicKey | TransactionAuthField | MessageSignature

- Defined in packages/transactions/src/types.ts:38

### TransactionAuthFieldContents

TransactionAuthFieldContents: StacksPublicKey | MessageSignature

- Defined in packages/transactions/src/authorization.ts:92

### TxBroadcastResult

TxBroadcastResult: TxBroadcastResultOk | TxBroadcastResultRejected

- Defined in packages/transactions/src/builders.ts:149

### TxBroadcastResultOk

TxBroadcastResultOk: string

- Defined in packages/transactions/src/builders.ts:142

### TxBroadcastResultRejected

TxBroadcastResultRejected: { error: string; reason: TxRejectedReason ; reason_data: any; txid: string }

- Defined in packages/transactions/src/builders.ts:143

#### Type declaration

- ##### error: string

- ##### reason: TxRejectedReason

- ##### reason_data: any

- ##### txid: string

## Variables

### Const CLARITY_INT_SIZE

CLARITY_INT_SIZE: 128 = 128

- Defined in packages/transactions/src/constants.ts:11

### Const COINBASE_BUFFER_LENGTH_BYTES

COINBASE_BUFFER_LENGTH_BYTES: 32 = 32

- Defined in packages/transactions/src/constants.ts:12

### Const COMPRESSED_PUBKEY_LENGTH_BYTES

COMPRESSED_PUBKEY_LENGTH_BYTES: 32 = 32

- Defined in packages/transactions/src/constants.ts:14

### Const DEFAULT_CHAIN_ID

DEFAULT_CHAIN_ID: Mainnet = ...

- Defined in packages/transactions/src/constants.ts:9

### Const DEFAULT_CORE_NODE_API_URL

DEFAULT_CORE_NODE_API_URL: "https://stacks-node-api.mainnet.stacks.co" = 'https://stacks-node-api.mainnet.stacks.co'

- Defined in packages/transactions/src/constants.ts:17

### Const DEFAULT_TRANSACTION_VERSION

DEFAULT_TRANSACTION_VERSION: Mainnet = ...

- Defined in packages/transactions/src/constants.ts:66

### Const MAX_STRING_LENGTH_BYTES

MAX_STRING_LENGTH_BYTES: 128 = 128

- Defined in packages/transactions/src/constants.ts:10

### Const MEMO_MAX_LENGTH_BYTES

MEMO_MAX_LENGTH_BYTES: 34 = 34

- Defined in packages/transactions/src/constants.ts:16

### Const RECOVERABLE_ECDSA_SIG_LENGTH_BYTES

RECOVERABLE_ECDSA_SIG_LENGTH_BYTES: 65 = 65

- Defined in packages/transactions/src/constants.ts:13

### Const UNCOMPRESSED_PUBKEY_LENGTH_BYTES

UNCOMPRESSED_PUBKEY_LENGTH_BYTES: 64 = 64

- Defined in packages/transactions/src/constants.ts:15

## Functions

### abiFunctionToString

- abiFunctionToString(func: ClarityAbiFunction ): string

- - Defined in packages/transactions/src/contract-abi.ts:233

  #### Parameters

  - ##### func: ClarityAbiFunction

  #### Returns string

### addressFromHashMode

- addressFromHashMode(hashMode: AddressHashMode, txVersion: TransactionVersion, data: string): Address

- - Defined in packages/transactions/src/types.ts:177

  #### Parameters

  - ##### hashMode: AddressHashMode

  - ##### txVersion: TransactionVersion

  - ##### data: string

  #### Returns Address

### addressFromPublicKeys

- addressFromPublicKeys(version: AddressVersion, hashMode: AddressHashMode, numSigs: number, publicKeys: StacksPublicKey []): Address

- - Defined in packages/transactions/src/types.ts:186

  #### Parameters

  - ##### version: AddressVersion

  - ##### hashMode: AddressHashMode

  - ##### numSigs: number

  - ##### publicKeys: StacksPublicKey []

  #### Returns Address

### addressFromVersionHash

- addressFromVersionHash(version: AddressVersion, hash: string): Address

- - Defined in packages/transactions/src/types.ts:135

  #### Parameters

  - ##### version: AddressVersion

  - ##### hash: string

  #### Returns Address

### addressHashModeToVersion

- addressHashModeToVersion(hashMode: AddressHashMode, txVersion: TransactionVersion ): AddressVersion

- - Defined in packages/transactions/src/types.ts:143

  Translates the tx auth hash mode to the corresponding address version.

  see

    https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#transaction-authorization

  #### Parameters

  - ##### hashMode: AddressHashMode

  - ##### txVersion: TransactionVersion

  #### Returns AddressVersion

### addressToString

- addressToString(address: Address ): string

- - Defined in packages/transactions/src/types.ts:222

  #### Parameters

  - ##### address: Address

  #### Returns string

### broadcastRawTransaction

- broadcastRawTransaction(rawTx: Buffer, url: string, attachment?: Buffer): Promise< TxBroadcastResult >

- - Defined in packages/transactions/src/builders.ts:178

  Broadcast the signed transaction to a core node

  #### Parameters

  - ##### rawTx: Buffer

    the raw serialized transaction buffer to broadcast

  - ##### url: string

    the broadcast endpoint URL

  - ##### Optional attachment: Buffer

  #### Returns Promise< TxBroadcastResult >

  that resolves to a response if the operation succeeds

### broadcastTransaction

- broadcastTransaction(transaction: StacksTransaction, network: StacksNetwork, attachment?: Buffer): Promise< TxBroadcastResult >

- - Defined in packages/transactions/src/builders.ts:159

  Broadcast the signed transaction to a core node

  #### Parameters

  - ##### transaction: StacksTransaction

    the token transfer transaction to broadcast

  - ##### network: StacksNetwork

    the Stacks network to broadcast transaction to

  - ##### Optional attachment: Buffer

  #### Returns Promise< TxBroadcastResult >

  that resolves to a response if the operation succeeds

### Const bufferCV

- bufferCV(buffer: Buffer): BufferCV

- - Defined in packages/transactions/src/clarity/types/bufferCV.ts:9

  #### Parameters

  - ##### buffer: Buffer

  #### Returns BufferCV

### Const bufferCVFromString

- bufferCVFromString(str: string): BufferCV

- - Defined in packages/transactions/src/clarity/types/bufferCV.ts:17

  #### Parameters

  - ##### str: string

  #### Returns BufferCV

### callReadOnlyFunction

- callReadOnlyFunction(readOnlyFunctionOptions: ReadOnlyFunctionOptions ): Promise< ClarityValue >

- - Defined in packages/transactions/src/builders.ts:1025

  Calls a read only function from a contract interface

  #### Parameters

  - ##### readOnlyFunctionOptions: ReadOnlyFunctionOptions

    the options object

    Returns an object with a status bool (okay) and a result string that is a serialized clarity value in hex format.

  #### Returns Promise< ClarityValue >

### cloneDeep

- cloneDeep<T>(obj: T): T

- - Defined in packages/transactions/src/utils.ts:54

  #### Type parameters

  - #### T

  #### Parameters

  - ##### obj: T

  #### Returns T

### codeBodyString

- codeBodyString(content: string): LengthPrefixedString

- - Defined in packages/transactions/src/types.ts:375

  #### Parameters

  - ##### content: string

  #### Returns LengthPrefixedString

### compressPublicKey

- compressPublicKey(publicKey: string | Buffer): StacksPublicKey

- - Defined in packages/transactions/src/keys.ts:114

  #### Parameters

  - ##### publicKey: string | Buffer

  #### Returns StacksPublicKey

### contractPrincipalCV

- contractPrincipalCV(addressString: string, contractName: string): ContractPrincipalCV

- - Defined in packages/transactions/src/clarity/types/principalCV.ts:53

  #### Parameters

  - ##### addressString: string

  - ##### contractName: string

  #### Returns ContractPrincipalCV

### contractPrincipalCVFromAddress

- contractPrincipalCVFromAddress(address: Address, contractName: LengthPrefixedString ): ContractPrincipalCV

- - Defined in packages/transactions/src/clarity/types/principalCV.ts:59

  #### Parameters

  - ##### address: Address

  - ##### contractName: LengthPrefixedString

  #### Returns ContractPrincipalCV

### contractPrincipalCVFromStandard

- contractPrincipalCVFromStandard(sp: StandardPrincipalCV, contractName: string): ContractPrincipalCV

- - Defined in packages/transactions/src/clarity/types/principalCV.ts:69

  #### Parameters

  - ##### sp: StandardPrincipalCV

  - ##### contractName: string

  #### Returns ContractPrincipalCV

### createAddress

- createAddress(c32AddressString: string): Address

- - Defined in packages/transactions/src/types.ts:118

  #### Parameters

  - ##### c32AddressString: string

  #### Returns Address

### createAssetInfo

- createAssetInfo(addressString: string, contractName: string, assetName: string): AssetInfo

- - Defined in packages/transactions/src/types.ts:425

  #### Parameters

  - ##### addressString: string

  - ##### contractName: string

  - ##### assetName: string

  #### Returns AssetInfo

### createContractPrincipal

- createContractPrincipal(addressString: string, contractName: string): ContractPrincipal

- - Defined in packages/transactions/src/types.ts:282

  #### Parameters

  - ##### addressString: string

  - ##### contractName: string

  #### Returns ContractPrincipal

### createEmptyAddress

- createEmptyAddress(): Address

- - Defined in packages/transactions/src/types.ts:127

  #### Returns Address

### createFungiblePostCondition

- createFungiblePostCondition(principal: string | PostConditionPrincipal, conditionCode: FungibleConditionCode, amount: BigNum, assetInfo: string | AssetInfo ): FungiblePostCondition

- - Defined in packages/transactions/src/postcondition.ts:64

  #### Parameters

  - ##### principal: string | PostConditionPrincipal

  - ##### conditionCode: FungibleConditionCode

  - ##### amount: BigNum

  - ##### assetInfo: string | AssetInfo

  #### Returns FungiblePostCondition

### createLPList

- createLPList<T>(values: T[], lengthPrefixBytes?: number): LengthPrefixedList

- - Defined in packages/transactions/src/types.ts:461

  #### Type parameters

  - #### T: StacksMessage

  #### Parameters

  - ##### values: T[]

  - ##### Optional lengthPrefixBytes: number

  #### Returns LengthPrefixedList

### createLPString

- createLPString(content: string): LengthPrefixedString
- createLPString(content: string, lengthPrefixBytes: number): LengthPrefixedString
- createLPString(content: string, lengthPrefixBytes: number, maxLengthBytes: number): LengthPrefixedString

- - Defined in packages/transactions/src/types.ts:330

  #### Parameters

  - ##### content: string

  #### Returns LengthPrefixedString

- - Defined in packages/transactions/src/types.ts:331

  #### Parameters

  - ##### content: string

  - ##### lengthPrefixBytes: number

  #### Returns LengthPrefixedString

- - Defined in packages/transactions/src/types.ts:332

  #### Parameters

  - ##### content: string

  - ##### lengthPrefixBytes: number

  - ##### maxLengthBytes: number

  #### Returns LengthPrefixedString

### createMemoString

- createMemoString(content: string): MemoString

- - Defined in packages/transactions/src/types.ts:384

  #### Parameters

  - ##### content: string

  #### Returns MemoString

### createMessageSignature

- createMessageSignature(signature: string): MessageSignature

- - Defined in packages/transactions/src/authorization.ts:54

  #### Parameters

  - ##### signature: string

  #### Returns MessageSignature

### createMultiSigSpendingCondition

- createMultiSigSpendingCondition(hashMode: MultiSigHashMode, numSigs: number, pubKeys: string[], nonce: BigNum, fee: BigNum): MultiSigSpendingCondition

- - Defined in packages/transactions/src/authorization.ts:210

  #### Parameters

  - ##### hashMode: MultiSigHashMode

  - ##### numSigs: number

  - ##### pubKeys: string[]

  - ##### nonce: BigNum

  - ##### fee: BigNum

  #### Returns MultiSigSpendingCondition

### createNonFungiblePostCondition

- createNonFungiblePostCondition(principal: string | PostConditionPrincipal, conditionCode: NonFungibleConditionCode, assetInfo: string | AssetInfo, assetName: ClarityValue ): NonFungiblePostCondition

- - Defined in packages/transactions/src/postcondition.ts:98

  #### Parameters

  - ##### principal: string | PostConditionPrincipal

  - ##### conditionCode: NonFungibleConditionCode

  - ##### assetInfo: string | AssetInfo

  - ##### assetName: ClarityValue

  #### Returns NonFungiblePostCondition

### createSTXPostCondition

- createSTXPostCondition(principal: string | PostConditionPrincipal, conditionCode: FungibleConditionCode, amount: BigNum): STXPostCondition

- - Defined in packages/transactions/src/postcondition.ts:37

  #### Parameters

  - ##### principal: string | PostConditionPrincipal

  - ##### conditionCode: FungibleConditionCode

  - ##### amount: BigNum

  #### Returns STXPostCondition

### createSingleSigSpendingCondition

- createSingleSigSpendingCondition(hashMode: SingleSigHashMode, pubKey: string, nonce: BigNum, fee: BigNum): SingleSigSpendingCondition

- - Defined in packages/transactions/src/authorization.ts:188

  #### Parameters

  - ##### hashMode: SingleSigHashMode

  - ##### pubKey: string

  - ##### nonce: BigNum

  - ##### fee: BigNum

  #### Returns SingleSigSpendingCondition

### createStacksPrivateKey

- createStacksPrivateKey(key: string | Buffer): StacksPrivateKey

- - Defined in packages/transactions/src/keys.ts:135

  #### Parameters

  - ##### key: string | Buffer

  #### Returns StacksPrivateKey

### createStacksPublicKey

- createStacksPublicKey(key: string): StacksPublicKey

- - Defined in packages/transactions/src/keys.ts:57

  #### Parameters

  - ##### key: string

  #### Returns StacksPublicKey

### createStandardPrincipal

- createStandardPrincipal(addressString: string): StandardPrincipal

- - Defined in packages/transactions/src/types.ts:273

  #### Parameters

  - ##### addressString: string

  #### Returns StandardPrincipal

### createTransactionAuthField

- createTransactionAuthField(pubKeyEncoding: PubKeyEncoding, contents: TransactionAuthFieldContents ): TransactionAuthField

- - Defined in packages/transactions/src/authorization.ts:100

  #### Parameters

  - ##### pubKeyEncoding: PubKeyEncoding

  - ##### contents: TransactionAuthFieldContents

  #### Returns TransactionAuthField

### cvToHex

- cvToHex(cv: ClarityValue ): string

- - Defined in packages/transactions/src/utils.ts:156

  Converts a clarity value to a hex encoded string with `0x` prefix

  #### Parameters

  - ##### cv: ClarityValue

    the clarity value to convert

  #### Returns string

### cvToJSON

- cvToJSON(val: ClarityValue ): any

- - Defined in packages/transactions/src/clarity/clarityValue.ts:140

  #### Parameters

  - ##### val: ClarityValue

  #### Returns any

### cvToString

- cvToString(val: ClarityValue, encoding?: "tryAscii" | "hex"): string

- - Defined in packages/transactions/src/clarity/clarityValue.ts:60

  #### Parameters

  - ##### val: ClarityValue

  - ##### encoding: "tryAscii" | "hex" = 'hex'

  #### Returns string

### cvToValue

- cvToValue(val: ClarityValue ): any

- - Defined in packages/transactions/src/clarity/clarityValue.ts:102

  #### Parameters

  - ##### val: ClarityValue

  #### Returns any

### deserializeAddress

- deserializeAddress(bufferReader: BufferReader ): Address

- - Defined in packages/transactions/src/types.ts:234

  #### Parameters

  - ##### bufferReader: BufferReader

  #### Returns Address

### deserializeAssetInfo

- deserializeAssetInfo(bufferReader: BufferReader ): AssetInfo

- - Defined in packages/transactions/src/types.ts:446

  #### Parameters

  - ##### bufferReader: BufferReader

  #### Returns AssetInfo

### deserializeCV

- deserializeCV<T>(serializedClarityValue: BufferReader | Buffer | string): T

- - Defined in packages/transactions/src/clarity/deserialize.ts:24

  #### Type parameters

  - #### T: ClarityValue = ClarityValue

  #### Parameters

  - ##### serializedClarityValue: BufferReader | Buffer | string

  #### Returns T

### deserializeLPList

- deserializeLPList(bufferReader: BufferReader, type: StacksMessageType, lengthPrefixBytes?: number): LengthPrefixedList

- - Defined in packages/transactions/src/types.ts:482

  #### Parameters

  - ##### bufferReader: BufferReader

  - ##### type: StacksMessageType

  - ##### Optional lengthPrefixBytes: number

  #### Returns LengthPrefixedList

### deserializeLPString

- deserializeLPString(bufferReader: BufferReader, prefixBytes?: number, maxLength?: number): LengthPrefixedString

- - Defined in packages/transactions/src/types.ts:364

  #### Parameters

  - ##### bufferReader: BufferReader

  - ##### Optional prefixBytes: number

  - ##### Optional maxLength: number

  #### Returns LengthPrefixedString

### deserializeMemoString

- deserializeMemoString(bufferReader: BufferReader ): MemoString

- - Defined in packages/transactions/src/types.ts:402

  #### Parameters

  - ##### bufferReader: BufferReader

  #### Returns MemoString

### deserializeMessageSignature

- deserializeMessageSignature(bufferReader: BufferReader ): MessageSignature

- - Defined in packages/transactions/src/authorization.ts:79

  #### Parameters

  - ##### bufferReader: BufferReader

  #### Returns MessageSignature

### deserializeMultiSigSpendingCondition

- deserializeMultiSigSpendingCondition(hashMode: MultiSigHashMode, bufferReader: BufferReader ): MultiSigSpendingCondition

- - Defined in packages/transactions/src/authorization.ts:299

  #### Parameters

  - ##### hashMode: MultiSigHashMode

  - ##### bufferReader: BufferReader

  #### Returns MultiSigSpendingCondition

### deserializePostCondition

- deserializePostCondition(bufferReader: BufferReader ): PostCondition

- - Defined in packages/transactions/src/postcondition.ts:149

  #### Parameters

  - ##### bufferReader: BufferReader

  #### Returns PostCondition

### deserializePrincipal

- deserializePrincipal(bufferReader: BufferReader ): PostConditionPrincipal

- - Defined in packages/transactions/src/types.ts:306

  #### Parameters

  - ##### bufferReader: BufferReader

  #### Returns PostConditionPrincipal

### deserializePublicKey

- deserializePublicKey(bufferReader: BufferReader ): StacksPublicKey

- - Defined in packages/transactions/src/keys.ts:121

  #### Parameters

  - ##### bufferReader: BufferReader

  #### Returns StacksPublicKey

### deserializeSingleSigSpendingCondition

- deserializeSingleSigSpendingCondition(hashMode: SingleSigHashMode, bufferReader: BufferReader ): SingleSigSpendingCondition

- - Defined in packages/transactions/src/authorization.ts:277

  #### Parameters

  - ##### hashMode: SingleSigHashMode

  - ##### bufferReader: BufferReader

  #### Returns SingleSigSpendingCondition

### deserializeSpendingCondition

- deserializeSpendingCondition(bufferReader: BufferReader ): SpendingCondition

- - Defined in packages/transactions/src/authorization.ts:330

  #### Parameters

  - ##### bufferReader: BufferReader

  #### Returns SpendingCondition

### deserializeStacksMessage

- deserializeStacksMessage(bufferReader: BufferReader, type: StacksMessageType, listType?: StacksMessageType ): StacksMessage

- - Defined in packages/transactions/src/types.ts:78

  #### Parameters

  - ##### bufferReader: BufferReader

  - ##### type: StacksMessageType

  - ##### Optional listType: StacksMessageType

  #### Returns StacksMessage

### deserializeTransaction

- deserializeTransaction(data: BufferReader | Buffer | string): StacksTransaction

- - Defined in packages/transactions/src/transaction.ts:252

  #### Parameters

  - ##### data: BufferReader | Buffer | string

    Buffer or hex string

  #### Returns StacksTransaction

### deserializeTransactionAuthField

- deserializeTransactionAuthField(bufferReader: BufferReader ): TransactionAuthField

- - Defined in packages/transactions/src/authorization.ts:137

  #### Parameters

  - ##### bufferReader: BufferReader

  #### Returns TransactionAuthField

### emptyMessageSignature

- emptyMessageSignature(): MessageSignature

- - Defined in packages/transactions/src/authorization.ts:66

  #### Returns MessageSignature

### encodeClarityValue

- encodeClarityValue(type: ClarityAbiType, val: string): ClarityValue
- encodeClarityValue(type: ClarityAbiTypeUnion, val: string): ClarityValue

- - Defined in packages/transactions/src/contract-abi.ts:141

  #### Parameters

  - ##### type: ClarityAbiType

  - ##### val: string

  #### Returns ClarityValue

- - Defined in packages/transactions/src/contract-abi.ts:142

  #### Parameters

  - ##### type: ClarityAbiTypeUnion

  - ##### val: string

  #### Returns ClarityValue

### estimateContractDeploy

- estimateContractDeploy(transaction: StacksTransaction, network?: StacksNetwork ): Promise<BigNum>

- - Defined in packages/transactions/src/builders.ts:464

  Estimate the total transaction fee in microstacks for a contract deploy

  #### Parameters

  - ##### transaction: StacksTransaction

    the token transfer transaction to estimate fees for

  - ##### Optional network: StacksNetwork

    the Stacks network to estimate transaction for

  #### Returns Promise<BigNum>

  a promise that resolves to number of microstacks per byte

### estimateContractFunctionCall

- estimateContractFunctionCall(transaction: StacksTransaction, network?: StacksNetwork ): Promise<BigNum>

- - Defined in packages/transactions/src/builders.ts:650

  Estimate the total transaction fee in microstacks for a contract function call

  #### Parameters

  - ##### transaction: StacksTransaction

    the token transfer transaction to estimate fees for

  - ##### Optional network: StacksNetwork

    the Stacks network to estimate transaction for

  #### Returns Promise<BigNum>

  a promise that resolves to number of microstacks per byte

### estimateTransfer

- estimateTransfer(transaction: StacksTransaction, network?: StacksNetwork ): Promise<BigNum>

- - Defined in packages/transactions/src/builders.ts:100

  Estimate the total transaction fee in microstacks for a token transfer

  #### Parameters

  - ##### transaction: StacksTransaction

    the token transfer transaction to estimate fees for

  - ##### Optional network: StacksNetwork

    the Stacks network to estimate transaction for

  #### Returns Promise<BigNum>

  a promise that resolves to number of microstacks per byte

### Const exceedsMaxLengthBytes

- exceedsMaxLengthBytes(string: string, maxLengthBytes: number): boolean

- - Defined in packages/transactions/src/utils.ts:51

  #### Parameters

  - ##### string: string

  - ##### maxLengthBytes: number

  #### Returns boolean

### Const falseCV

- falseCV(): BooleanCV

- - Defined in packages/transactions/src/clarity/types/booleanCV.ts:14

  #### Returns BooleanCV

### getAbi

- getAbi(address: string, contractName: string, network: StacksNetwork ): Promise< ClarityAbi >

- - Defined in packages/transactions/src/builders.ts:220

  Fetch a contract's ABI

  #### Parameters

  - ##### address: string

    the contracts address

  - ##### contractName: string

    the contracts name

  - ##### network: StacksNetwork

    the Stacks network to broadcast transaction to

  #### Returns Promise< ClarityAbi >

  that resolves to a ClarityAbi if the operation succeeds

### getAddressFromPrivateKey

- getAddressFromPrivateKey(privateKey: string | Buffer, transactionVersion?: TransactionVersion ): string

- - Defined in packages/transactions/src/keys.ts:35

  Creates a P2PKH address string from the given private key and tx version.

  #### Parameters

  - ##### privateKey: string | Buffer

  - ##### transactionVersion: TransactionVersion = ...

  #### Returns string

### getAddressFromPublicKey

- getAddressFromPublicKey(publicKey: string | Buffer, transactionVersion?: TransactionVersion ): string

- - Defined in packages/transactions/src/keys.ts:45

  Creates a P2PKH address string from the given public key and tx version.

  #### Parameters

  - ##### publicKey: string | Buffer

  - ##### transactionVersion: TransactionVersion = ...

  #### Returns string

### getCVTypeString

- getCVTypeString(val: ClarityValue ): string

- - Defined in packages/transactions/src/clarity/clarityValue.ts:151

  #### Parameters

  - ##### val: ClarityValue

  #### Returns string

### getNonce

- getNonce(address: string, network?: StacksNetwork ): Promise<BigNum>

- - Defined in packages/transactions/src/builders.ts:72

  Lookup the nonce for an address from a core node

  #### Parameters

  - ##### address: string

    the c32check address to look up

  - ##### Optional network: StacksNetwork

    the Stacks network to look up address on

  #### Returns Promise<BigNum>

  a promise that resolves to an integer

### getPublicKey

- getPublicKey(privateKey: StacksPrivateKey ): StacksPublicKey

- - Defined in packages/transactions/src/keys.ts:203

  #### Parameters

  - ##### privateKey: StacksPrivateKey

  #### Returns StacksPublicKey

### getSignatureRecoveryParam

- getSignatureRecoveryParam(signature: string): number

- - Defined in packages/transactions/src/keys.ts:179

  #### Parameters

  - ##### signature: string

  #### Returns number

### getTypeString

- getTypeString(val: ClarityAbiType ): string

- - Defined in packages/transactions/src/contract-abi.ts:194

  #### Parameters

  - ##### val: ClarityAbiType

  #### Returns string

### getTypeUnion

- getTypeUnion(val: ClarityAbiType ): ClarityAbiTypeUnion

- - Defined in packages/transactions/src/contract-abi.ts:105

  #### Parameters

  - ##### val: ClarityAbiType

  #### Returns ClarityAbiTypeUnion

### Const hash160

- hash160(input: Buffer): Buffer

- - Defined in packages/transactions/src/utils.ts:100

  #### Parameters

  - ##### input: Buffer

  #### Returns Buffer

### Const hashP2PKH

- hashP2PKH(input: Buffer): string

- - Defined in packages/transactions/src/utils.ts:107

  #### Parameters

  - ##### input: Buffer

  #### Returns string

### Const hashP2SH

- hashP2SH(numSigs: number, pubKeys: Buffer[]): string

- - Defined in packages/transactions/src/utils.ts:113

  #### Parameters

  - ##### numSigs: number

  - ##### pubKeys: Buffer[]

  #### Returns string

### Const hexStringToInt

- hexStringToInt(hexString: string): number

- - Defined in packages/transactions/src/utils.ts:49

  #### Parameters

  - ##### hexString: string

  #### Returns number

### hexToCV

- hexToCV(hex: string): ClarityValue

- - Defined in packages/transactions/src/utils.ts:165

  Converts a hex encoded string to a clarity value

  #### Parameters

  - ##### hex: string

    the hex encoded string with or without `0x` prefix

  #### Returns ClarityValue

### Const intCV

- intCV(value: string | number | Buffer): IntCV

- - Defined in packages/transactions/src/clarity/types/intCV.ts:12

  #### Parameters

  - ##### value: string | number | Buffer

  #### Returns IntCV

### Const intToHexString

- intToHexString(integer: number, lengthBytes?: number): string

- - Defined in packages/transactions/src/utils.ts:46

  #### Parameters

  - ##### integer: number

  - ##### lengthBytes: number = 8

  #### Returns string

### Const isClarityAbiBuffer

- isClarityAbiBuffer(val: ClarityAbiType ): val is ClarityAbiTypeBuffer

- - Defined in packages/transactions/src/contract-abi.ts:75

  #### Parameters

  - ##### val: ClarityAbiType

  #### Returns val is ClarityAbiTypeBuffer

### Const isClarityAbiList

- isClarityAbiList(val: ClarityAbiType ): val is ClarityAbiTypeList

- - Defined in packages/transactions/src/contract-abi.ts:87

  #### Parameters

  - ##### val: ClarityAbiType

  #### Returns val is ClarityAbiTypeList

### Const isClarityAbiOptional

- isClarityAbiOptional(val: ClarityAbiType ): val is ClarityAbiTypeOptional

- - Defined in packages/transactions/src/contract-abi.ts:83

  #### Parameters

  - ##### val: ClarityAbiType

  #### Returns val is ClarityAbiTypeOptional

### Const isClarityAbiPrimitive

- isClarityAbiPrimitive(val: ClarityAbiType ): val is ClarityAbiTypePrimitive

- - Defined in packages/transactions/src/contract-abi.ts:73

  #### Parameters

  - ##### val: ClarityAbiType

  #### Returns val is ClarityAbiTypePrimitive

### Const isClarityAbiResponse

- isClarityAbiResponse(val: ClarityAbiType ): val is ClarityAbiTypeResponse

- - Defined in packages/transactions/src/contract-abi.ts:81

  #### Parameters

  - ##### val: ClarityAbiType

  #### Returns val is ClarityAbiTypeResponse

### Const isClarityAbiStringAscii

- isClarityAbiStringAscii(val: ClarityAbiType ): val is ClarityAbiTypeStringAscii

- - Defined in packages/transactions/src/contract-abi.ts:77

  #### Parameters

  - ##### val: ClarityAbiType

  #### Returns val is ClarityAbiTypeStringAscii

### Const isClarityAbiStringUtf8

- isClarityAbiStringUtf8(val: ClarityAbiType ): val is ClarityAbiTypeStringUtf8

- - Defined in packages/transactions/src/contract-abi.ts:79

  #### Parameters

  - ##### val: ClarityAbiType

  #### Returns val is ClarityAbiTypeStringUtf8

### Const isClarityAbiTuple

- isClarityAbiTuple(val: ClarityAbiType ): val is ClarityAbiTypeTuple

- - Defined in packages/transactions/src/contract-abi.ts:85

  #### Parameters

  - ##### val: ClarityAbiType

  #### Returns val is ClarityAbiTypeTuple

### isClarityName

- isClarityName(name: string): boolean

- - Defined in packages/transactions/src/utils.ts:137

  #### Parameters

  - ##### name: string

  #### Returns boolean

### isCompressed

- isCompressed(key: StacksPublicKey ): boolean

- - Defined in packages/transactions/src/keys.ts:92

  #### Parameters

  - ##### key: StacksPublicKey

  #### Returns boolean

### isSingleSig

- isSingleSig(condition: SpendingCondition ): condition is SingleSigSpendingCondition

- - Defined in packages/transactions/src/authorization.ts:232

  #### Parameters

  - ##### condition: SpendingCondition

  #### Returns condition is SingleSigSpendingCondition

### Const leftPadHex

- leftPadHex(hexString: string): string

- - Defined in packages/transactions/src/utils.ts:37

  #### Parameters

  - ##### hexString: string

  #### Returns string

### Const leftPadHexToLength

- leftPadHexToLength(hexString: string, length: number): string

- - Defined in packages/transactions/src/utils.ts:40

  #### Parameters

  - ##### hexString: string

  - ##### length: number

  #### Returns string

### listCV

- listCV<T>(values: T[]): ListCV <T>

- - Defined in packages/transactions/src/clarity/types/listCV.ts:8

  #### Type parameters

  - #### T: ClarityValue = ClarityValue

  #### Parameters

  - ##### values: T[]

  #### Returns ListCV <T>

### makeContractCall

- makeContractCall(txOptions: SignedContractCallOptions | SignedMultiSigContractCallOptions ): Promise< StacksTransaction >

- - Defined in packages/transactions/src/builders.ts:809

  Generates a Clarity smart contract function call transaction

  #### Parameters

  - ##### txOptions: SignedContractCallOptions | SignedMultiSigContractCallOptions

    an options object for the contract function call

    Returns a signed Stacks smart contract function call transaction.

  #### Returns Promise< StacksTransaction >

### makeContractDeploy

- makeContractDeploy(txOptions: ContractDeployOptions ): Promise< StacksTransaction >

- - Defined in packages/transactions/src/builders.ts:517

  Generates a Clarity smart contract deploy transaction

  #### Parameters

  - ##### txOptions: ContractDeployOptions

    an options object for the contract deploy

    Returns a signed Stacks smart contract deploy transaction.

  #### Returns Promise< StacksTransaction >

### makeContractFungiblePostCondition

- makeContractFungiblePostCondition(address: string, contractName: string, conditionCode: FungibleConditionCode, amount: BigNum, assetInfo: string | AssetInfo ): FungiblePostCondition

- - Defined in packages/transactions/src/builders.ts:925

  Generates a fungible token post condition with a contract principal

  Returns a fungible token post condition object

  #### Parameters

  - ##### address: string

    the c32check address

  - ##### contractName: string

    the name of the contract

  - ##### conditionCode: FungibleConditionCode

    the condition code

  - ##### amount: BigNum

    the amount of fungible tokens

  - ##### assetInfo: string | AssetInfo

    asset info describing the fungible token

  #### Returns FungiblePostCondition

### makeContractNonFungiblePostCondition

- makeContractNonFungiblePostCondition(address: string, contractName: string, conditionCode: NonFungibleConditionCode, assetInfo: string | AssetInfo, assetName: ClarityValue ): NonFungiblePostCondition

- - Defined in packages/transactions/src/builders.ts:979

  Generates a non-fungible token post condition with a contract principal

  Returns a non-fungible token post condition object

  #### Parameters

  - ##### address: string

    the c32check address

  - ##### contractName: string

    the name of the contract

  - ##### conditionCode: NonFungibleConditionCode

    the condition code

  - ##### assetInfo: string | AssetInfo

    asset info describing the non-fungible token

  - ##### assetName: ClarityValue

    asset name describing the non-fungible token

  #### Returns NonFungiblePostCondition

### makeContractSTXPostCondition

- makeContractSTXPostCondition(address: string, contractName: string, conditionCode: FungibleConditionCode, amount: BigNum): STXPostCondition

- - Defined in packages/transactions/src/builders.ts:873

  Generates a STX post condition with a contract principal

  Returns a STX post condition object

  #### Parameters

  - ##### address: string

    the c32check address of the contract

  - ##### contractName: string

    the name of the contract

  - ##### conditionCode: FungibleConditionCode

    the condition code

  - ##### amount: BigNum

    the amount of STX tokens

  #### Returns STXPostCondition

### makeRandomPrivKey

- makeRandomPrivKey(entropy?: Buffer): StacksPrivateKey

- - Defined in packages/transactions/src/keys.ts:156

  #### Parameters

  - ##### Optional entropy: Buffer

  #### Returns StacksPrivateKey

### makeSTXTokenTransfer

- makeSTXTokenTransfer(txOptions: SignedTokenTransferOptions | SignedMultiSigTokenTransferOptions ): Promise< StacksTransaction >

- - Defined in packages/transactions/src/builders.ts:396

  Generates a signed Stacks token transfer transaction

  Returns a signed Stacks token transfer transaction.

  #### Parameters

  - ##### txOptions: SignedTokenTransferOptions | SignedMultiSigTokenTransferOptions

    an options object for the token transfer

  #### Returns Promise< StacksTransaction >

### makeSigHashPreSign

- makeSigHashPreSign(curSigHash: string, authType: AuthType, fee: BigNum, nonce: BigNum): string

- - Defined in packages/transactions/src/authorization.ts:342

  #### Parameters

  - ##### curSigHash: string

  - ##### authType: AuthType

  - ##### fee: BigNum

  - ##### nonce: BigNum

  #### Returns string

### makeStandardFungiblePostCondition

- makeStandardFungiblePostCondition(address: string, conditionCode: FungibleConditionCode, amount: BigNum, assetInfo: string | AssetInfo ): FungiblePostCondition

- - Defined in packages/transactions/src/builders.ts:898

  Generates a fungible token post condition with a standard principal

  Returns a fungible token post condition object

  #### Parameters

  - ##### address: string

    the c32check address

  - ##### conditionCode: FungibleConditionCode

    the condition code

  - ##### amount: BigNum

    the amount of fungible tokens

  - ##### assetInfo: string | AssetInfo

    asset info describing the fungible token

  #### Returns FungiblePostCondition

### makeStandardNonFungiblePostCondition

- makeStandardNonFungiblePostCondition(address: string, conditionCode: NonFungibleConditionCode, assetInfo: string | AssetInfo, assetName: ClarityValue ): NonFungiblePostCondition

- - Defined in packages/transactions/src/builders.ts:952

  Generates a non-fungible token post condition with a standard principal

  Returns a non-fungible token post condition object

  #### Parameters

  - ##### address: string

    the c32check address

  - ##### conditionCode: NonFungibleConditionCode

    the condition code

  - ##### assetInfo: string | AssetInfo

    asset info describing the non-fungible token

  - ##### assetName: ClarityValue

    asset name describing the non-fungible token

  #### Returns NonFungiblePostCondition

### makeStandardSTXPostCondition

- makeStandardSTXPostCondition(address: string, conditionCode: FungibleConditionCode, amount: BigNum): STXPostCondition

- - Defined in packages/transactions/src/builders.ts:853

  Generates a STX post condition with a standard principal

  Returns a STX post condition object

  #### Parameters

  - ##### address: string

    the c32check address

  - ##### conditionCode: FungibleConditionCode

    the condition code

  - ##### amount: BigNum

    the amount of STX tokens

  #### Returns STXPostCondition

### makeUnsignedContractCall

- makeUnsignedContractCall(txOptions: UnsignedContractCallOptions | UnsignedMultiSigContractCallOptions ): Promise< StacksTransaction >

- - Defined in packages/transactions/src/builders.ts:701

  Generates an unsigned Clarity smart contract function call transaction

  #### Parameters

  - ##### txOptions: UnsignedContractCallOptions | UnsignedMultiSigContractCallOptions

    an options object for the contract call

  #### Returns Promise< StacksTransaction >

### makeUnsignedSTXTokenTransfer

- makeUnsignedSTXTokenTransfer(txOptions: UnsignedTokenTransferOptions | UnsignedMultiSigTokenTransferOptions ): Promise< StacksTransaction >

- - Defined in packages/transactions/src/builders.ts:307

  Generates an unsigned Stacks token transfer transaction

  Returns a Stacks token transfer transaction.

  #### Parameters

  - ##### txOptions: UnsignedTokenTransferOptions | UnsignedMultiSigTokenTransferOptions

    an options object for the token transfer

  #### Returns Promise< StacksTransaction >

### nextSignature

- nextSignature(curSigHash: string, authType: AuthType, fee: BigNum, nonce: BigNum, privateKey: StacksPrivateKey ): { nextSig: MessageSignature ; nextSigHash: string }

- - Defined in packages/transactions/src/authorization.ts:394

  #### Parameters

  - ##### curSigHash: string

  - ##### authType: AuthType

  - ##### fee: BigNum

  - ##### nonce: BigNum

  - ##### privateKey: StacksPrivateKey

  #### Returns { nextSig: MessageSignature ; nextSigHash: string }

  - ##### nextSig: MessageSignature

  - ##### nextSigHash: string

### nextVerification

- nextVerification(initialSigHash: string, authType: AuthType, fee: BigNum, nonce: BigNum, pubKeyEncoding: PubKeyEncoding, signature: MessageSignature ): { nextSigHash: string; pubKey: StacksPublicKey }

- - Defined in packages/transactions/src/authorization.ts:416

  #### Parameters

  - ##### initialSigHash: string

  - ##### authType: AuthType

  - ##### fee: BigNum

  - ##### nonce: BigNum

  - ##### pubKeyEncoding: PubKeyEncoding

  - ##### signature: MessageSignature

  #### Returns { nextSigHash: string; pubKey: StacksPublicKey }

  - ##### nextSigHash: string

  - ##### pubKey: StacksPublicKey

### noneCV

- noneCV(): NoneCV

- - Defined in packages/transactions/src/clarity/types/optionalCV.ts:14

  #### Returns NoneCV

### omit

- omit<T, K>(obj: T, prop: K): Omit<T, K>

- - Defined in packages/transactions/src/utils.ts:58

  #### Type parameters

  - #### T

  - #### K: string | number | symbol

  #### Parameters

  - ##### obj: T

  - ##### prop: K

  #### Returns Omit<T, K>

### parseAssetInfoString

- parseAssetInfoString(id: string): AssetInfo

- - Defined in packages/transactions/src/types.ts:419

  Parse a fully qualified string that identifies the token type.

  example

    "SP13N5TE1FBBGRZD1FCM49QDGN32WAXM2E5F8WT2G.example-contract::example-token"

  #### Parameters

  - ##### id: string

    String in the format `{address}.{contractName}::{assetName}`

  #### Returns AssetInfo

### parsePrincipalString

- parsePrincipalString(principalString: string): StandardPrincipal | ContractPrincipal

- - Defined in packages/transactions/src/types.ts:262

  Parses a principal string for either a standard principal or contract principal.

  example

    "SP13N5TE1FBBGRZD1FCM49QDGN32WAXM2E5F8WT2G.example-contract"

  example

    "SP13N5TE1FBBGRZD1FCM49QDGN32WAXM2E5F8WT2G"

  #### Parameters

  - ##### principalString: string

    String in the format `{address}.{contractName}`

  #### Returns StandardPrincipal | ContractPrincipal

### Const parseReadOnlyResponse

- parseReadOnlyResponse(response: ReadOnlyFunctionResponse ): ClarityValue

- - Defined in packages/transactions/src/utils.ts:193

  Converts the response of a read-only function call into its Clarity Value

  #### Parameters

  - ##### response: ReadOnlyFunctionResponse

  #### Returns ClarityValue

### parseRecoverableSignature

- parseRecoverableSignature(signature: string): { r: string; recoveryParam: number; s: string }

- - Defined in packages/transactions/src/keys.ts:188

  #### Parameters

  - ##### signature: string

  #### Returns { r: string; recoveryParam: number; s: string }

  - ##### r: string

  - ##### recoveryParam: number

  - ##### s: string

### parseToCV

- parseToCV(input: string, type: ClarityAbiType ): ClarityValue

- - Defined in packages/transactions/src/contract-abi.ts:417

  Convert string input to Clarity value based on contract ABI data. Only handles Clarity primitives and buffers. Responses, optionals, tuples and lists are not supported.

  #### Parameters

  - ##### input: string

    string to be parsed into Clarity value

  - ##### type: ClarityAbiType

    the contract function argument object

  #### Returns ClarityValue

  returns a Clarity value

### privateKeyToString

- privateKeyToString(privateKey: StacksPrivateKey ): string

- - Defined in packages/transactions/src/keys.ts:207

  #### Parameters

  - ##### privateKey: StacksPrivateKey

  #### Returns string

### pubKeyfromPrivKey

- pubKeyfromPrivKey(privateKey: string | Buffer): StacksPublicKey

- - Defined in packages/transactions/src/keys.ts:106

  #### Parameters

  - ##### privateKey: string | Buffer

  #### Returns StacksPublicKey

### publicKeyFromBuffer

- publicKeyFromBuffer(data: Buffer): StacksPublicKey

- - Defined in packages/transactions/src/keys.ts:88

  #### Parameters

  - ##### data: Buffer

  #### Returns StacksPublicKey

### publicKeyFromSignature

- publicKeyFromSignature(message: string, messageSignature: MessageSignature, pubKeyEncoding?: PubKeyEncoding ): any

- - Defined in packages/transactions/src/keys.ts:64

  #### Parameters

  - ##### message: string

  - ##### messageSignature: MessageSignature

  - ##### pubKeyEncoding: PubKeyEncoding = ...

  #### Returns any

### publicKeyToAddress

- publicKeyToAddress(version: AddressVersion, publicKey: StacksPublicKey ): string

- - Defined in packages/transactions/src/keys.ts:211

  #### Parameters

  - ##### version: AddressVersion

  - ##### publicKey: StacksPublicKey

  #### Returns string

### publicKeyToString

- publicKeyToString(key: StacksPublicKey ): string

- - Defined in packages/transactions/src/keys.ts:96

  #### Parameters

  - ##### key: StacksPublicKey

  #### Returns string

### responseErrorCV

- responseErrorCV<T>(value: T): ResponseErrorCV <T>

- - Defined in packages/transactions/src/clarity/types/responseCV.ts:15

  #### Type parameters

  - #### T: ClarityValue = ClarityValue

  #### Parameters

  - ##### value: T

  #### Returns ResponseErrorCV <T>

### responseOkCV

- responseOkCV<T>(value: T): ResponseOkCV <T>

- - Defined in packages/transactions/src/clarity/types/responseCV.ts:19

  #### Type parameters

  - #### T: ClarityValue = ClarityValue

  #### Parameters

  - ##### value: T

  #### Returns ResponseOkCV <T>

### Const rightPadHexToLength

- rightPadHexToLength(hexString: string, length: number): string

- - Defined in packages/transactions/src/utils.ts:43

  #### Parameters

  - ##### hexString: string

  - ##### length: number

  #### Returns string

### serializeAddress

- serializeAddress(address: Address ): Buffer

- - Defined in packages/transactions/src/types.ts:226

  #### Parameters

  - ##### address: Address

  #### Returns Buffer

### serializeAssetInfo

- serializeAssetInfo(info: AssetInfo ): Buffer

- - Defined in packages/transactions/src/types.ts:438

  #### Parameters

  - ##### info: AssetInfo

  #### Returns Buffer

### serializeCV

- serializeCV(value: ClarityValue ): Buffer

- - Defined in packages/transactions/src/clarity/serialize.ts:124

  #### Parameters

  - ##### value: ClarityValue

  #### Returns Buffer

### serializeLPList

- serializeLPList(lpList: LengthPrefixedList ): Buffer

- - Defined in packages/transactions/src/types.ts:472

  #### Parameters

  - ##### lpList: LengthPrefixedList

  #### Returns Buffer

### serializeLPString

- serializeLPString(lps: LengthPrefixedString ): Buffer

- - Defined in packages/transactions/src/types.ts:355

  #### Parameters

  - ##### lps: LengthPrefixedString

  #### Returns Buffer

### serializeMemoString

- serializeMemoString(memoString: MemoString ): Buffer

- - Defined in packages/transactions/src/types.ts:391

  #### Parameters

  - ##### memoString: MemoString

  #### Returns Buffer

### serializeMessageSignature

- serializeMessageSignature(messageSignature: MessageSignature ): Buffer

- - Defined in packages/transactions/src/authorization.ts:73

  #### Parameters

  - ##### messageSignature: MessageSignature

  #### Returns Buffer

### serializeMultiSigSpendingCondition

- serializeMultiSigSpendingCondition(condition: MultiSigSpendingCondition ): Buffer

- - Defined in packages/transactions/src/authorization.ts:261

  #### Parameters

  - ##### condition: MultiSigSpendingCondition

  #### Returns Buffer

### serializePostCondition

- serializePostCondition(postCondition: PostCondition ): Buffer

- - Defined in packages/transactions/src/postcondition.ts:121

  #### Parameters

  - ##### postCondition: PostCondition

  #### Returns Buffer

### serializePrincipal

- serializePrincipal(principal: PostConditionPrincipal ): Buffer

- - Defined in packages/transactions/src/types.ts:296

  #### Parameters

  - ##### principal: PostConditionPrincipal

  #### Returns Buffer

### serializePublicKey

- serializePublicKey(key: StacksPublicKey ): Buffer

- - Defined in packages/transactions/src/keys.ts:100

  #### Parameters

  - ##### key: StacksPublicKey

  #### Returns Buffer

### serializeSingleSigSpendingCondition

- serializeSingleSigSpendingCondition(condition: SingleSigSpendingCondition ): Buffer

- - Defined in packages/transactions/src/authorization.ts:250

  #### Parameters

  - ##### condition: SingleSigSpendingCondition

  #### Returns Buffer

### serializeSpendingCondition

- serializeSpendingCondition(condition: SpendingCondition ): Buffer

- - Defined in packages/transactions/src/authorization.ts:322

  #### Parameters

  - ##### condition: SpendingCondition

  #### Returns Buffer

### serializeStacksMessage

- serializeStacksMessage(message: StacksMessage ): Buffer

- - Defined in packages/transactions/src/types.ts:51

  #### Parameters

  - ##### message: StacksMessage

  #### Returns Buffer

### serializeTransactionAuthField

- serializeTransactionAuthField(field: TransactionAuthField ): Buffer

- - Defined in packages/transactions/src/authorization.ts:111

  #### Parameters

  - ##### field: TransactionAuthField

  #### Returns Buffer

### signWithKey

- signWithKey(privateKey: StacksPrivateKey, input: string): MessageSignature

- - Defined in packages/transactions/src/keys.ts:164

  #### Parameters

  - ##### privateKey: StacksPrivateKey

  - ##### input: string

  #### Returns MessageSignature

### someCV

- someCV<T>(value: T): OptionalCV <T>

- - Defined in packages/transactions/src/clarity/types/optionalCV.ts:18

  #### Type parameters

  - #### T: ClarityValue = ClarityValue

  #### Parameters

  - ##### value: T

  #### Returns OptionalCV <T>

### sponsorTransaction

- sponsorTransaction(sponsorOptions: SponsorOptions ): Promise< StacksTransaction >

- - Defined in packages/transactions/src/builders.ts:1094

  Constructs and signs a sponsored transaction as the sponsor

  #### Parameters

  - ##### sponsorOptions: SponsorOptions

    the sponsor options object

    Returns a signed sponsored transaction.

  #### Returns Promise< StacksTransaction >

### standardPrincipalCV

- standardPrincipalCV(addressString: string): StandardPrincipalCV

- - Defined in packages/transactions/src/clarity/types/principalCV.ts:44

  #### Parameters

  - ##### addressString: string

  #### Returns StandardPrincipalCV

### standardPrincipalCVFromAddress

- standardPrincipalCVFromAddress(address: Address ): StandardPrincipalCV

- - Defined in packages/transactions/src/clarity/types/principalCV.ts:49

  #### Parameters

  - ##### address: Address

  #### Returns StandardPrincipalCV

### Const stringAsciiCV

- stringAsciiCV(data: string): StringAsciiCV

- - Defined in packages/transactions/src/clarity/types/stringCV.ts:13

  #### Parameters

  - ##### data: string

  #### Returns StringAsciiCV

### Const stringUtf8CV

- stringUtf8CV(data: string): StringUtf8CV

- - Defined in packages/transactions/src/clarity/types/stringCV.ts:17

  #### Parameters

  - ##### data: string

  #### Returns StringUtf8CV

### Const trueCV

- trueCV(): BooleanCV

- - Defined in packages/transactions/src/clarity/types/booleanCV.ts:13

  #### Returns BooleanCV

### tupleCV

- tupleCV<T>(data: TupleData<T>): TupleCV <TupleData<T>>

- - Defined in packages/transactions/src/clarity/types/tupleCV.ts:11

  #### Type parameters

  - #### T: ClarityValue = ClarityValue

  #### Parameters

  - ##### data: TupleData<T>

  #### Returns TupleCV <TupleData<T>>

### Const txidFromData

- txidFromData(data: Buffer): string

- - Defined in packages/transactions/src/utils.ts:98

  #### Parameters

  - ##### data: Buffer

  #### Returns string

### Const uintCV

- uintCV(value: string | number | Buffer): UIntCV

- - Defined in packages/transactions/src/clarity/types/intCV.ts:28

  #### Parameters

  - ##### value: string | number | Buffer

  #### Returns UIntCV

### validateContractCall

- validateContractCall(payload: ContractCallPayload, abi: ClarityAbi ): boolean

- - Defined in packages/transactions/src/contract-abi.ts:370

  Validates a contract-call payload with a contract ABI

  #### Parameters

  - ##### payload: ContractCallPayload

    a contract-call payload

  - ##### abi: ClarityAbi

    a contract ABI

  #### Returns boolean

  true if the payloads functionArgs type check against those in the ABI

### Const validateStacksAddress

- validateStacksAddress(stacksAddress: string): boolean

- - Defined in packages/transactions/src/utils.ts:201

  #### Parameters

  - ##### stacksAddress: string

  #### Returns boolean

Generated using TypeDoc