{"action":"created","issue":{"url":"https://api.github.com/repos/Boilertalk/Web3.swift/issues/63","repository_url":"https://api.github.com/repos/Boilertalk/Web3.swift","labels_url":"https://api.github.com/repos/Boilertalk/Web3.swift/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/Boilertalk/Web3.swift/issues/63/comments","events_url":"https://api.github.com/repos/Boilertalk/Web3.swift/issues/63/events","html_url":"https://github.com/Boilertalk/Web3.swift/issues/63","id":350976695,"node_id":"MDU6SXNzdWUzNTA5NzY2OTU=","number":63,"title":"Error: Ambiguous reference to member 'firstly(execute:)'","user":{"login":"mscilab","id":32267730,"node_id":"MDQ6VXNlcjMyMjY3NzMw","avatar_url":"https://avatars3.githubusercontent.com/u/32267730?v=4","gravatar_id":"","url":"https://api.github.com/users/mscilab","html_url":"https://github.com/mscilab","followers_url":"https://api.github.com/users/mscilab/followers","following_url":"https://api.github.com/users/mscilab/following{/other_user}","gists_url":"https://api.github.com/users/mscilab/gists{/gist_id}","starred_url":"https://api.github.com/users/mscilab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscilab/subscriptions","organizations_url":"https://api.github.com/users/mscilab/orgs","repos_url":"https://api.github.com/users/mscilab/repos","events_url":"https://api.github.com/users/mscilab/events{/privacy}","received_events_url":"https://api.github.com/users/mscilab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-15T21:38:31Z","updated_at":"2018-08-16T21:38:48Z","closed_at":null,"author_association":"NONE","body":"Hi, I am trying to test the \"Send raw transaction\" example [Link](https://github.com/Boilertalk/Web3.swift/tree/335ec4a31990b0ba43bea4e717a22c3f2498affd#send-raw-transaction) Unfortunately I always get an error: \"Ambiguous reference to member 'firstly(execute:)'\". \r\n\r\n~~~swift\r\n    class func transaction(privateKey: String, to: String) {\r\n        let web3 = Web3(rpcURL: \"http://XXXX:XXXX\")\r\n        let privateKeyTwo = try! EthereumPrivateKey(hexPrivateKey: privateKey)\r\n        firstly {\r\n            web3.eth.getTransactionCount(address: getPrivateKey(privateKey: privateKey), block: .latest)\r\n            } .then { nonce in\r\n                let tx = createTx(nonce: nonce, to: to)\r\n                return try tx.sign(with: privateKeyTwo, chainId: 1).promise\r\n            } .then { tx in\r\n                web3.eth.sendRawTransaction(transaction: tx)\r\n            } .done { hash in\r\n                print(hash)\r\n            } .catch {error in\r\n                print(\"error: \\(error)\")\r\n            }\r\n    }\r\n~~~"},"comment":{"url":"https://api.github.com/repos/Boilertalk/Web3.swift/issues/comments/413692860","html_url":"https://github.com/Boilertalk/Web3.swift/issues/63#issuecomment-413692860","issue_url":"https://api.github.com/repos/Boilertalk/Web3.swift/issues/63","id":413692860,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzY5Mjg2MA==","user":{"login":"Ybrin","id":11356621,"node_id":"MDQ6VXNlcjExMzU2NjIx","avatar_url":"https://avatars1.githubusercontent.com/u/11356621?v=4","gravatar_id":"","url":"https://api.github.com/users/Ybrin","html_url":"https://github.com/Ybrin","followers_url":"https://api.github.com/users/Ybrin/followers","following_url":"https://api.github.com/users/Ybrin/following{/other_user}","gists_url":"https://api.github.com/users/Ybrin/gists{/gist_id}","starred_url":"https://api.github.com/users/Ybrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ybrin/subscriptions","organizations_url":"https://api.github.com/users/Ybrin/orgs","repos_url":"https://api.github.com/users/Ybrin/repos","events_url":"https://api.github.com/users/Ybrin/events{/privacy}","received_events_url":"https://api.github.com/users/Ybrin/received_events","type":"User","site_admin":false},"created_at":"2018-08-16T21:38:48Z","updated_at":"2018-08-16T21:38:48Z","author_association":"MEMBER","body":"The following should work:\r\n\r\n```Swift\r\nfunc test() {\r\n    let web3 = Web3(rpcURL: \"http://XXXX:XXXX\")\r\n    let privateKey = try! EthereumPrivateKey(hexPrivateKey: \"0xa26da69ed1df3ba4bb2a231d506b711eace012f1bd2571dfbfff9650b03375af\")\r\n    firstly {\r\n        web3.eth.getTransactionCount(address: privateKey.address, block: .latest)\r\n    }.then { nonce -> Promise<EthereumSignedTransaction> in\r\n        let tx = try EthereumTransaction(\r\n            nonce: nonce,\r\n            gasPrice: EthereumQuantity(quantity: 21.gwei),\r\n            gas: 21000,\r\n            to: EthereumAddress(hex: \"0xC0866A1a0ed41e1aa75c932cA3c55fad847fd90D\", eip55: true),\r\n            value: EthereumQuantity(quantity: 1.eth)\r\n        )\r\n        return try tx.sign(with: privateKey, chainId: 1).promise\r\n    }.then { tx in\r\n        web3.eth.sendRawTransaction(transaction: tx)\r\n    }.done { hash in\r\n        print(hash)\r\n    }.catch { error in\r\n        print(error)\r\n    }\r\n}\r\n```\r\n\r\nThe problem was the incorrect `gasLimit` argument label which was changed to `gas` in the last version. I have to fix that in the README...\r\n\r\nIf you have obscure compiler errors like that, it's always worth a try to explicitly write the return types of the promise closures. I don't know why but if you do this you get better error messages..."}}
{"actor":{"display_login":"Ybrin"}}