forked from web3swift-team/web3swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
151 changed files
with
870 additions
and
650 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// RIPEMD160_SO.swift | ||
// web3swift | ||
// | ||
// Created by Alexander Vlasov on 10.01.2018. | ||
// | ||
|
||
import Foundation | ||
import struct BigInt.BigUInt | ||
|
||
extension BigUInt { | ||
init?(_ naturalUnits: String, _ ethereumUnits: Utilities.Units) { | ||
guard let value = Utilities.parseToBigUInt(naturalUnits, units: ethereumUnits) else {return nil} | ||
self = value | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Yaroslav Yashin on 11.07.2022. | ||
// | ||
|
||
import Foundation | ||
import BigInt | ||
|
||
public enum BlockNumber { | ||
case pending | ||
/// Latest block of a chain | ||
case latest | ||
/// Earliest block of a chain | ||
case earliest | ||
/// Exact block number | ||
case exact(BigUInt) | ||
|
||
/// Block number as a hex string | ||
public var stringValue: String { | ||
switch self { | ||
case .pending: | ||
return "pending" | ||
case .latest: | ||
return "latest" | ||
case .earliest: | ||
return "earliest" | ||
case .exact(let number): | ||
return String(number, radix: 16).addHexPrefix() | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.