Skip to main content

Near

getNearSignedTransaction

This function is for:

  • .NEAR - near (NEAR)
  • .NEAR_TOKEN - near token
  • .NEAR_TESTNET - near testnet (NEARt)

Parameters

  • coinType: near networks coin type
  • nearTransaction: (NearTransaction)near transaction parameter

class NearTransaction

NameTypeDescription
sigHashStringtransaction that has not been signed of near transaction
keyStringsign key path for near transaction
feeStringtransaction fee of near transaction
* fee value is configured in near(NEAR) unit.
nonceString(optional)transaction nonce of near transaction
decimalsStringtransaction decimals of near transaction
symbolStringtransaction symbol of near transaction
optionParamString(optional) hexadecimal value of the token method type is used only in near token.
- '02' : Function call(ft_transfer)
- '04' : Stake (The method will be supported later.)
- '08' : Delegate (The method will be supported later)

Returns

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

Requirements

  • DCENT Biometric Wallet version 2.24.0 or higher is required.
    • (for near-token): 2.27.1 or higher is required.

Example

let nearTransaction : NearTransaction = NearTransaction(sigHash: "4000000033666164666339326631633631643261303138626166333738383566376633363331313439616331356163303438613263303137316566316661356139633366003fadfc92f1c61d2a018baf37885f7f3631149ac15ac048a2c0171ef1fa5a9c3f41b15753844300004000000033666164666339326631633631643261303138626166333738383566376633363331313439616331356163303438613263303137316566316661356139633366d5e91d9515257370e4763c0da089ca544c1292bd188ad3fee466e17024e941f40100000003000000a1edccce1bc2d3000000000000", key: "m/44'/397'/0'", fee: "0.000860039223625", decimals: 24, symbol: "NEAR", optionParam: "")

DcentMgr.getNearSignedTransaction(coinType: .NEAR, nearTransaction: nearTransaction) { (result, txData) in
print("Near Transaction closure")
if result == false {
print("FAIL !!!")
}else{
print(txData)
}
}