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

### Hierarchy

- StacksTransaction

## Index

### Constructors

- constructor

### Properties

- anchorMode
- auth
- chainId
- payload
- postConditionMode
- postConditions
- version

### Methods

- appendPubkey
- createTxWithSignature
- serialize
- setFee
- setNonce
- setSponsor
- setSponsorNonce
- signAndAppend
- signBegin
- signNextOrigin
- signNextSponsor
- txid
- verifyBegin
- verifyOrigin

## Constructors

### constructor

- new StacksTransaction(version: TransactionVersion, auth: Authorization, payload: Payload, postConditions?: LengthPrefixedList, postConditionMode?: PostConditionMode, anchorMode?: AnchorMode, chainId?: ChainID ): StacksTransaction

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

  #### Parameters

  - ##### version: TransactionVersion

  - ##### auth: Authorization

  - ##### payload: Payload

  - ##### Optional postConditions: LengthPrefixedList

  - ##### Optional postConditionMode: PostConditionMode

  - ##### Optional anchorMode: AnchorMode

  - ##### Optional chainId: ChainID

  #### Returns StacksTransaction

## Properties

### anchorMode

anchorMode: AnchorMode

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

### auth

auth: Authorization

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

### chainId

chainId: ChainID

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

### payload

payload: Payload

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

### postConditionMode

postConditionMode: PostConditionMode

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

### postConditions

postConditions: LengthPrefixedList

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

### version

version: TransactionVersion

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

## Methods

### appendPubkey

- appendPubkey(publicKey: StacksPublicKey ): void

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

  #### Parameters

  - ##### publicKey: StacksPublicKey

  #### Returns void

### createTxWithSignature

- createTxWithSignature(signature: string | Buffer): StacksTransaction

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

  #### Parameters

  - ##### signature: string | Buffer

  #### Returns StacksTransaction

### serialize

- serialize(): Buffer

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

  #### Returns Buffer

### setFee

- setFee(amount: BN): void

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

  Set the total fee to be paid for this transaction

  #### Parameters

  - ##### amount: BN

  #### Returns void

### setNonce

- setNonce(nonce: BN): void

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

  Set the transaction nonce

  #### Parameters

  - ##### nonce: BN

    the nonce value

  #### Returns void

### setSponsor

- setSponsor(sponsorSpendingCondition: SpendingCondition ): void

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

  #### Parameters

  - ##### sponsorSpendingCondition: SpendingCondition

  #### Returns void

### setSponsorNonce

- setSponsorNonce(nonce: BN): void

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

  Set the transaction sponsor nonce

  #### Parameters

  - ##### nonce: BN

    the sponsor nonce value

  #### Returns void

### signAndAppend

- signAndAppend(condition: SpendingCondition, curSigHash: string, authType: AuthType, privateKey: StacksPrivateKey ): string

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

  #### Parameters

  - ##### condition: SpendingCondition

  - ##### curSigHash: string

  - ##### authType: AuthType

  - ##### privateKey: StacksPrivateKey

  #### Returns string

### signBegin

- signBegin(): string

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

  #### Returns string

### signNextOrigin

- signNextOrigin(sigHash: string, privateKey: StacksPrivateKey ): string

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

  #### Parameters

  - ##### sigHash: string

  - ##### privateKey: StacksPrivateKey

  #### Returns string

### signNextSponsor

- signNextSponsor(sigHash: string, privateKey: StacksPrivateKey ): string

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

  #### Parameters

  - ##### sigHash: string

  - ##### privateKey: StacksPrivateKey

  #### Returns string

### txid

- txid(): string

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

  #### Returns string

### verifyBegin

- verifyBegin(): string

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

  #### Returns string

### verifyOrigin

- verifyOrigin(): string

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

  #### Returns string

Generated using TypeDoc