You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I sign transaction and try to send, in result got error:
Validate signature error: 9830a120e0369096c8172ec19b398af8990ea531b820df57846929cca2cb6c844d59737ad2e2ba5fa1758acdafa37b414187ef32359b14bd0b0f99d1c7fc7a1900 is signed by TLzoQNmdkmfeJK96W4S8xXmYLQYK27xGUj but it is not contained of permission
To Reproduce
Example of my code:
func createRangoTronTransaction(amount: Decimal,
receiverAddress: String,
lastTronBlock: CheckTronLatestBlockResponse,
assetCode: String,
orderId: Int?,
decimalValue: Int) -> (tronModel: TronTransactionRequestModel?, signatureSize: Int)? {
let inputAmount = Int64(NSDecimalNumber(decimal: amount * pow(10, decimalValue)).intValue)
let timestamp = Date().currentTimeMillis()
let wallet = walletService?.getWallet()
guard let unwrapWallet = wallet else { return nil }
let privateKey = unwrapWallet.getKeyForCoin(coin: .tron).data
Also I tried to sign transaction directly with txId, result was same:
let input = TronSigningInput.with {
$0.txID = "cd014f91d7a4e1408d5338b39d908b61d21dd630f65c70c43daee41a8ac30a44"
$0.transaction = transaction
}
I am sure then used valid and correct private key
Please help, where is problem in my code?
The text was updated successfully, but these errors were encountered:
This error occurs when you try to sign a transaction using an account that gets permission from another account. For this type of transaction, you need to set a permission ID in the transaction parameters. However, I'm not sure if Trust Wallet supports setting permission IDs. I also need this type of transaction functionality.
Describe the bug
Hello! I got answer with tron transaction from dex-service Rango:
{
"ok": true,
"error": null,
"errorCode": null,
"traceId": null,
"transaction": {
"type": "TRON",
"blockChain": "TRON",
"isApprovalTx": false,
"raw_data": {
"contract": [
{
"parameter": {
"value": {
"data": "b24ebddb00000000000000000000000000000000000000000000000000000000005358eb000000000000000000000000000000000000000000000000000001916f9e0a17000000000000000000000000000000000000000000000000000000000253d2f0",
"owner_address": "4125f6835920fde416dc9b6b9ab76dea06e7dbc7b0",
"contract_address": "41a2726afbecbd8e936000ed684cef5e2f5cf43008",
"call_value": 39047920
},
"type_url": "type.googleapis.com/protocol.TriggerSmartContract"
},
"type": "TriggerSmartContract"
}
],
"ref_block_bytes": "3aac",
"ref_block_hash": "5c747ef87c3f9f35",
"expiration": 1724154573000,
"fee_limit": 1500000000,
"timestamp": 1724154514026
},
"raw_data_hex": "0a023aac22085c747ef87c3f9f3540c8e1fbfc96325ad401081f12cf010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e74726163741299010a154125f6835920fde416dc9b6b9ab76dea06e7dbc7b0121541a2726afbecbd8e936000ed684cef5e2f5cf4300818f0a5cf122264b24ebddb00000000000000000000000000000000000000000000000000000000005358eb000000000000000000000000000000000000000000000000000001916f9e0a17000000000000000000000000000000000000000000000000000000000253d2f070ea94f8fc9632900180dea0cb05",
"externalTxId": null,
"payload": {
"owner_address": "4125f6835920fde416dc9b6b9ab76dea06e7dbc7b0",
"call_value": 39047920,
"contract_address": "41a2726afbecbd8e936000ed684cef5e2f5cf43008",
"fee_limit": 1500000000,
"function_selector": "trxToTokenSwapInput(uint256,uint256,uint256)",
"parameter": "00000000000000000000000000000000000000000000000000000000005358eb000000000000000000000000000000000000000000000000000001916f9e0a17000000000000000000000000000000000000000000000000000000000253d2f0",
"chainType": 0
},
"txID": "cd014f91d7a4e1408d5338b39d908b61d21dd630f65c70c43daee41a8ac30a44",
"visible": false
}
}
When I sign transaction and try to send, in result got error:
Validate signature error: 9830a120e0369096c8172ec19b398af8990ea531b820df57846929cca2cb6c844d59737ad2e2ba5fa1758acdafa37b414187ef32359b14bd0b0f99d1c7fc7a1900 is signed by TLzoQNmdkmfeJK96W4S8xXmYLQYK27xGUj but it is not contained of permission
To Reproduce
Example of my code:
func createRangoTronTransaction(amount: Decimal,
receiverAddress: String,
lastTronBlock: CheckTronLatestBlockResponse,
assetCode: String,
orderId: Int?,
decimalValue: Int) -> (tronModel: TronTransactionRequestModel?, signatureSize: Int)? {
let inputAmount = Int64(NSDecimalNumber(decimal: amount * pow(10, decimalValue)).intValue)
let timestamp = Date().currentTimeMillis()
let wallet = walletService?.getWallet()
guard let unwrapWallet = wallet else { return nil }
let privateKey = unwrapWallet.getKeyForCoin(coin: .tron).data
Also I tried to sign transaction directly with txId, result was same:
let input = TronSigningInput.with {
$0.txID = "cd014f91d7a4e1408d5338b39d908b61d21dd630f65c70c43daee41a8ac30a44"
$0.transaction = transaction
}
I am sure then used valid and correct private key
Please help, where is problem in my code?
The text was updated successfully, but these errors were encountered: