nim-dagger/dagger/contracts/offers.nim

16 lines
308 B
Nim

import pkg/contractabi
import pkg/nimcrypto
export contractabi
type
StorageOffer* = tuple
host: Address
requestId: array[32, byte]
price: UInt256
expiry: UInt256
func id*(offer: StorageOffer): array[32, byte] =
let encoding = AbiEncoder.encode(offer)
keccak256.digest(encoding).data