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
web3Rinkeby.addKeystoreManager(bip32keystoreManager) // attach a keystore if you want to sign locally. Otherwise unsigned request will be sent to remote node
193
222
options.from= bip32ks?.addresses?.first!// specify from what address you want to send it
@@ -198,7 +227,7 @@ let sendResultBip32 = intermediateSend.send(password: "changeme")
198
227
### ERC20 Iteraction:
199
228
200
229
#### Getting ERC20 token balance
201
-
```
230
+
```swift
202
231
let contractAddress =EthereumAddress("0x45245bc59219eeaaf6cd3f382e078a461ff9de7b")!// BKX token on Ethereum mainnet
203
232
let contract = web3.contract(Web3.Utils.erc20ABI, at: contractAddress, abiVersion: 2)!// utilize precompiled ERC20 ABI for your concenience
204
233
guardlet bkxBalanceResult = contract.method("balanceOf", parameters: [coldWalletAddress] as [AnyObject], options: options)?.call(options: nil) else {return} // encode parameters for transaction
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
0 commit comments