2022-03-23 12:57:48 +00:00
|
|
|
import pkg/chronos
|
2022-03-28 15:24:28 +00:00
|
|
|
import pkg/upraises
|
2022-03-23 12:57:48 +00:00
|
|
|
import ./contracts/requests
|
2022-03-24 13:22:45 +00:00
|
|
|
import ./contracts/offers
|
2022-03-23 12:57:48 +00:00
|
|
|
|
|
|
|
export chronos
|
|
|
|
export requests
|
2022-03-24 13:22:45 +00:00
|
|
|
export offers
|
2022-03-23 12:57:48 +00:00
|
|
|
|
|
|
|
type
|
|
|
|
Market* = ref object of RootObj
|
2022-03-28 10:28:22 +00:00
|
|
|
Subscription* = ref object of RootObj
|
2022-04-11 18:03:55 +00:00
|
|
|
OnRequest* = proc(id: array[32, byte], ask: StorageAsk) {.gcsafe, upraises:[].}
|
2022-03-28 15:24:28 +00:00
|
|
|
OnOffer* = proc(offer: StorageOffer) {.gcsafe, upraises:[].}
|
2022-03-29 09:20:07 +00:00
|
|
|
OnSelect* = proc(offerId: array[32, byte]) {.gcsafe, upraises: [].}
|
2022-03-23 12:57:48 +00:00
|
|
|
|
2022-03-31 08:46:03 +00:00
|
|
|
method requestStorage*(market: Market,
|
|
|
|
request: StorageRequest):
|
|
|
|
Future[StorageRequest] {.base, async.} =
|
2022-03-23 12:57:48 +00:00
|
|
|
raiseAssert("not implemented")
|
2022-03-28 10:28:22 +00:00
|
|
|
|
2022-03-31 09:07:39 +00:00
|
|
|
method offerStorage*(market: Market,
|
|
|
|
offer: StorageOffer):
|
|
|
|
Future[StorageOffer] {.base, async.} =
|
2022-03-28 10:28:22 +00:00
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
|
|
|
method selectOffer*(market: Market, id: array[32, byte]) {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
|
|
|
method subscribeRequests*(market: Market,
|
|
|
|
callback: OnRequest):
|
|
|
|
Future[Subscription] {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
|
|
|
method subscribeOffers*(market: Market,
|
|
|
|
requestId: array[32, byte],
|
|
|
|
callback: OnOffer):
|
|
|
|
Future[Subscription] {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
2022-03-29 09:20:07 +00:00
|
|
|
method subscribeSelection*(market: Market,
|
|
|
|
requestId: array[32, byte],
|
|
|
|
callback: OnSelect):
|
|
|
|
Future[Subscription] {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
2022-03-31 08:24:06 +00:00
|
|
|
method unsubscribe*(subscription: Subscription) {.base, async, upraises:[].} =
|
2022-03-28 10:28:22 +00:00
|
|
|
raiseAssert("not implemented")
|