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
@@ -668,31 +680,60 @@ public func prepareTransactionToContract(data: [AnyObject],
668
680
669
681
### Send Transaction
670
682
671
-
#### Sending ETH
683
+
#### Sending Tokens
672
684
673
685
```swift
674
-
let web3Rinkeby = Web3.InfuraRinkebyWeb3()
675
-
web3Rinkeby.addKeystoreManager(bip32keystoreManager) // attach a keystore if you want to sign locally. Otherwise unsigned request will be sent to remote node
676
-
options.from= bip32ks?.addresses?.first!// specify from what address you want to send it
677
-
intermediateSend = web3Rinkeby.contract(Web3.Utils.coldWalletABI, at: coldWalletAddress, abiVersion: 2)!.method(options: options)!// an address with a private key attached in not different from any other address, just has very simple ABI
678
-
let sendResultBip32 = intermediateSend.send(password: "changeme")
let convenienceTokenTransfer = web3Rinkeby.eth.sendERC20tokensWithNaturalUnits(tokenAddress: EthereumAddress("0xa407dd0cbc9f9d20cdbd557686625e586c85b20a")!, from: (ks?.addresses?.first!)!, to: EthereumAddress("0x6394b37Cf80A7358b38068f0CA4760ad49983a1B")!, amount: "0.0001", options: convenienceTransferOptions) // there are also convenience functions to send ETH and ERC20 under the .eth structure
686
-
let gasEstimateResult = convenienceTokenTransfer!.estimateGas(options: nil)
0 commit comments