Skip to content
Permalink
Browse files

✏️ Fix typo and copyrights

  • Loading branch information...
usatie committed Sep 19, 2018
1 parent b9ffa4a commit f908578ef9cee49074188d29904e42acc8d900ae
@@ -72,12 +72,12 @@ final public class Wallet {
utxoSelector: UtxoSelector = StandardUtxoSelector.default,
transactionBuilder: TransactionBuilder = StandardTransactionBuilder.default,
transactionSigner: TransactionSigner = StandardTransactionSigner.default) {
guard let privkey = try? PrivateKey(wif: wif) else {
guard let privateKey = try? PrivateKey(wif: wif) else {
return nil
}
self.privateKey = privkey
self.publicKey = privkey.publicKey()
self.network = privkey.network
self.privateKey = privateKey
self.publicKey = privateKey.publicKey()
self.network = privateKey.network

self.walletDataStore = walletDataStore
self.addressProvider = addressProvider
@@ -100,12 +100,12 @@ final public class Wallet {
guard let wif = walletDataStore.getString(forKey: .wif) else {
return nil
}
guard let privkey = try? PrivateKey(wif: wif) else {
guard let privateKey = try? PrivateKey(wif: wif) else {
return nil
}
self.privateKey = privkey
self.publicKey = privkey.publicKey()
self.network = privkey.network
self.privateKey = privateKey
self.publicKey = privateKey.publicKey()
self.network = privateKey.network

self.walletDataStore = walletDataStore
self.addressProvider = addressProvider
@@ -1,9 +1,25 @@
//
// AppDelegate.swift
// WalletExample
//
// Created by Shun Usami on 2018/09/18.
// Copyright © 2018 Yenom Inc. All rights reserved.
// Copyright © 2018 BitcoinKit developers
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
import UIKit
@@ -30,29 +30,29 @@
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="E4n-eI-MFH">
<rect key="frame" x="45" y="439" width="31" height="30"/>
<rect key="frame" x="37" y="439" width="47" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="更新"/>
<state key="normal" title="Reload"/>
<connections>
<action selector="didTapReloadBalanceButton:" destination="BYZ-38-t0r" eventType="touchUpInside" id="fWr-sF-rrF"/>
</connections>
</button>
<textField opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="送金先アドレス" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="GDL-Gu-z9V">
<textField opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Send to Bitcoin Cash Address" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="GDL-Gu-z9V">
<rect key="frame" x="37" y="509" width="300" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cyA-b6-4iT">
<rect key="frame" x="172" y="566" width="31" height="30"/>
<rect key="frame" x="152" y="566" width="71" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="送金"/>
<state key="normal" title="Send Coin"/>
<connections>
<action selector="didTapSendButton:" destination="BYZ-38-t0r" eventType="touchUpInside" id="ceW-nr-nnh"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="残高:0 satoshi" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bkx-0b-bjo">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Balance : 0 satoshi" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bkx-0b-bjo">
<rect key="frame" x="97" y="444" width="240" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
@@ -1,9 +1,25 @@
//
// ViewController.swift
// WalletExample
//
// Created by Shun Usami on 2018/09/18.
// Copyright © 2018 Yenom Inc. All rights reserved.
// Copyright © 2018 BitcoinKit developers
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
import UIKit
@@ -25,8 +41,8 @@ class ViewController: UIViewController {

func createWalletIfNeeded() {
if wallet == nil {
let privkey = PrivateKey(network: .testnet)
wallet = Wallet(privateKey: privkey)
let privateKey = PrivateKey(network: .testnet)
wallet = Wallet(privateKey: privateKey)
wallet?.save()
}
}
@@ -35,7 +51,7 @@ class ViewController: UIViewController {
qrCodeImageView.image = wallet?.address.qrImage()
addressLabel.text = wallet?.address.cashaddr
if let balance = wallet?.balance() {
balanceLabel.text = "残高:\(balance) satoshi"
balanceLabel.text = "Balance : \(balance) satoshi"
}
}

0 comments on commit f908578

Please sign in to comment.
You can’t perform that action at this time.