Skip to main content

Stacks

getStacksSignedTransaction

This function is for:

  • STACKS (STX)
  • SIP010 - stacks token
  • STACKS_TESTNET (STXt)
  • SIP010_TESTNET

Parameters

ParameterTypeDescription
coinTypeCoinTypestacks coin type.
transactionStacksTransactionstacks transaction parameters.

class StacksTransaction

NameTypeDescription
hdKeyPathBip44KeyPathsign key path for stacks transaction
sigHashStringtransaction that has not been signed of stacks transaction
authTypeinttransaction authorization type of stacks transaction (refer toStacks Doc)
- standard authorization: 0x04
- sponsored authorization: 0x05
feeStringtransaction fee of stacks transaction
* Fee value is configured in stacks(STX) unit.
nonceStringtransaction nonce of stacks transaction
decimalsinttransaction decimals of stacks transaction
symbolStringtransaction symbol of stacks transaction
optionParamString(optional)hexadecimal value of the token method type
- '01' : asset transfer
- '02' : token stake
- '03' + amount(8bytes) : token revoke (amount value is configured in micro-STX unit)
- '04': dapp contract

Returns

String - signed transaction.

Requirements

  • DCENT Biometric Wallet version 2.14.1 or higher is required.
    • (for SIP010): 2.16.7 or higher is required.

Example

String keyPath = "m/44'/5757'/0'/0/0";
StacksTransaction stacksTransaction;

stacksTransaction = new StacksTransaction.Builder()
.keyPath(Bip44KeyPath.valueOf(keyPath))
.sigHash("0000000001040027b586cbbbd0902773c2faafb2c511b130c3610800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030200000000021608633eac058f2e6ab41613a0a537c7ea1a79cdd20f6d69616d69636f696e2d746f6b656e087472616e736665720000000401000000000000000000000000000f4240051627b586cbbbd0902773c2faafb2c511b130c361080516e3d94a92b80d0aabe8ef1b50de84449cd61ad6370a0200000006313130343239")
.fee("0.12")
.nonce("0000000000000029")
.decimals(6)
.authType(4)
.symbol("MIAMI")
.optionParam("01") // asset transfer
.build();

String response = mDcentmanager.getStacksSignedTransaction(CoinType.SRC20, stacksTransaction);