# Stacks

## **getStacksSignedTransaction**

**This function for :**

* `.STACKS` - stacks (STX)
* `.SIP010` - stacks token
* `.STACKS_TESTNET` - stacks testnet (STXt)
* `.SIP010_TESTNET` - stacks testnet token

### **Parameters**

* coinType: stacks networks coin type
* stacksTransaction: ([StacksTransation](#class-stackstransaction))stacks transaction parameter

#### class StacksTransaction

<table><thead><tr><th width="162.33333333333331">Name</th><th width="129">Type</th><th>Description</th></tr></thead><tbody><tr><td>key</td><td><code>String</code></td><td>sign key path for stacks transaction</td></tr><tr><td>signHash</td><td><code>String</code></td><td>transaction that has not been signed of stacks transaction</td></tr><tr><td>authType</td><td><code>UInt32</code></td><td>transaction authorization type of stacks transaction (refer to<a href="https://docs.stacks.co/docs/stacks-academy/technical-specs#transactions">Stacks Doc</a>)<br>- standard authorization: 0x04<br>- sponsored authorization: 0x05</td></tr><tr><td>fee</td><td><code>String</code></td><td>transaction fee of stacks transaction<br>* fee value is configured in stacks(STX) unit</td></tr><tr><td>nonce</td><td><code>String</code></td><td>transaction nonce of stacks transaction</td></tr><tr><td>symbol</td><td><code>String</code></td><td>transaction symbol of stacks transaction</td></tr><tr><td>decimals</td><td><code>UInt32</code></td><td>transaction decimals of stacks transaction</td></tr><tr><td>optionParam</td><td><code>String</code></td><td>(optional)hexadecimal value of the token method type<br>- '01' : assert transfer<br>- '02' : token stake<br>- '03' + amount(8bytes) : token revoke (amount value is configured in micro-STX unit)<br>- '04' : dapp contract</td></tr></tbody></table>

### **Returns**

* result: (Bool) `true` if successful, `false` if error occurred
* txData: signed transaction

### **Requirements**

* D'CENT Biometric Wallet version 2.14.1 or higher is required.
  * (for SIP010): 2.16.7 or higher is required.

**Example**

```swift
let stacksTransaction : StacksTransaction = StacksTransaction(key: "m/44'/5757'/0'/0/0", sigHash: "00000000010400b8d4c2dbab9a59837ca0892080d9395199b3fa9d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000302000000000005166c717c6701374d0db48dac262d1a85f906ae2d1e000000001ad2748031303638343134333900000000000000000000000000000000000000000000000000", authType: 4, fee: "0.12", nonce: "000000000000006c", symbol: "STX", decimals: 6, optionParam: "")
  
DcentMgr.getStacksSignedTransaction(coinType: .STACKS, stacksTransaction: stacksTransaction) { (result, txData) in
    print("Stacks Transaction closure")
    if result == false {
        print("FAIL !!!")
    }else{
        print(txData)
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev-docs.dcentwallet.com/dcent-biometric-wallet-for-mobile/dcent-biometric-sdk-ios/stacks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
