1

Using go-ethereum iOS framework I'm trying to create a new transaction. Using GethNewTransaction i get an error (Use of unresolved identifier GethNewTransaction).

An example is found here: https://github.com/ethereum/go-ethereum/wiki/Mobile:-Account-management

// Create a new account to sign transactions with
var error: NSError?
let signer = try! ks?.newAccount("Signer password")

let to    = GethNewAddressFromHex("0x0000000000000000000000000000000000000000", &error)
let tx    = GethNewTransaction(1, to, GethNewBigInt(0), 
GethNewBigInt(0), GethNewBigInt(0), nil) // Random empty transaction
let chain = GethNewBigInt(1) // Chain identifier of the main net

My code:

// Create a new account to sign transactions with
var error: NSError?
var signer: GEGethAccount?; try! ks?.newAccount("Signer password", ret0_: &signer)

var to: GEGethAddress?; GEGethNewAddressFromHex("0x0000000000000000000000000000000000000000", &to, &error)
let tx = GethNewTransaction(1, to, GEGethNewBigInt(0), GEGethNewBigInt(0), GEGethNewBigInt(0), nil) // Random empty transaction
let chain = GEGethNewBigInt(1) // Chain identifier of the main net

This line is wrong:

let tx = GethNewTransaction(1, to, GEGethNewBigInt(0), GEGethNewBigInt(0), GEGethNewBigInt(0), nil) // Random empty transaction

How do i write this line to create a new transaction?

0

Did you import Geth? My call to GethNewTransaction looks like this:

let tx = GethNewTransaction(wallet.transactionCount, to, GethNewBigInt(amount), self.gasLimit, self.gasPrice, nil)

With gasLimit as an Int64 and gasPrice as a GethBigInt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.