An advanced Ethereum/EVM mobile wallet
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.
alpha-wallet-ios/Trust/Extensions/BigInt.swift

25 lines
562 B

// 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
}
}