blockchainethereumblockchain-walleterc20erc721walletxdaidappdecentralizederc1155erc875iosswifttokens
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
562 B
25 lines
562 B
7 years ago
|
// Copyright SIX DAY LLC. All rights reserved.
|
||
|
|
||
|
import BigInt
|
||
|
import Geth
|
||
|
|
||
|
extension BigInt {
|
||
|
init(_ value: GethBigInt) {
|
||
|
print(value.getBytes().hex)
|
||
|
let magnitude = BigUInt(value.getBytes())
|
||
|
let sign: Sign
|
||
|
if value.string().hasPrefix("-") {
|
||
|
sign = .minus
|
||
|
} else {
|
||
|
sign = .plus
|
||
|
}
|
||
|
self.init(sign: sign, magnitude: magnitude)
|
||
|
}
|
||
|
|
||
|
var gethBigInt: GethBigInt {
|
||
|
let value = GethNewBigInt(0)!
|
||
|
value.setString(description, base: 10)
|
||
|
return value
|
||
|
}
|
||
|
}
|