Skip to main content

Conflux

getConfluxSignedTransaction

This function is for:

  • .CONFLUX - conflux (CFX)

Parameters

  • coinType: conflux network coin type
  • confluxTransaction: (ConfluxTransaction)conflux transaction parameter

class ConfluxTransaction

NameTypeDescription
nonceStringaccount nonce for Conflux transaction
gasPriceStringgas price for Conflux transaction
gasStringgas limit value of Conflux transaction
toStringaddress to send
amountStringamount of CFX to send of Conflux transaction
storageLimitStringstorageLimit for Conflux transaction
epochHeightStringepochHeight for Conflux transaction
chainIdStringchain id for Conflux transaction
dataString(optional)transaction input data for Conflux transaction
addressPathStringsign key path for Conflux transaction

Returns

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

Requirements

  • DCENT Biometric Wallet version 2.18.3 or higher is required.

Example

let confluxTransaction : ConfluxTransaction = ConfluxTransaction(nonce: "0", gasPrice: "1", gas: "53000", to: "cfx:aath39ukgygwae5jnhuj1z02vkkc68wsu62j5spdng", amount: "499993640000000000000", storageLimit: "0", epochHeight: "57744640", chainId: "1029", addressPath: "m/44'/60'/0'/0/0")

DcentMgr.getConfluxSignedTransaction(coinType: .CONFLUX, confluxTransaction: confluxTransaction) { (result, txData) in
print("Conflux Transaction closure")
if result == false {
print("FAIL !!!")
}else{
print(txData)
}
}

getCRC20TokenSignedTransaction

This function is for:

  • .CFX_CRC20 - conflux token

Parameters

  • coinType: conflux token coin type
  • tokenTransaction: (CRC20TokenTransaction)conflux token transaction parameter

class CRC20TokenTransaction

NameTypeDescription
nonceStringaccount nonce for Conflux transaction
gasPriceStringgas price for Conflux transaction
gasStringgas limit value of Conflux transaction
toStringaddress to send
amountStringamount of CFX to send of Conflux transaction
storageLimitStringstorageLimit for Conflux transaction
epochHeightStringepochHeight for Conflux transaction
chainIdStringchain id for Conflux transaction
dataString(optional)transaction input data for Conflux transaction
addressPathStringsign key path for Conflux transaction
tokenNameStringtoken name of Crc20 transaction
contractAddressStringcontractAddress of Crc20 transaction
toAddressStringtoAddress of Crc20 transaction
decimalsStringdecimals of Crc20 transaction
valueStringamount of ether to be sent of Crc20. ( Drip unit value )
tokenSymbolStringsymbol of Crc20 transaction

Returns

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

Requirements

  • DCENT Biometric Wallet version 2.18.3 or higher is required.

Example

let crc20Transaction : CRC20TokenTransaction = CRC20TokenTransaction(nonce: "0", gasPrice: "1", gas: "53000", to: "cfx:acdeewzdr3cv7hvc12kdwp7gzysjaexz9jw7s1uaft", amount: "0", storageLimit: "0", epochHeight: "58463079", chainId: "1029", addressPath: "m/44'/60'/0'/0/0", tokenName: "IoTestCoin", contractAddress: "cfx:acdeewzdr3cv7hvc12kdwp7gzysjaexz9jw7s1uaft", toAddress: "cfx:aath39ukgygwae5jnhuj1z02vkkc68wsu62j5spdng", decimals: "18", value: "5000000000000000000", tokenSymbol:"ITC")

DcentMgr.getCRC20TokenSignedTransaction(coinType: .CFX_CRC20, tokenTransaction: crc20Transaction) { (result, txData) in
print("Conflux token CRC20 Transaction closure")
if result == false {
print("FAIL !!!")
}else{
print(txData)
}
}