2022-03-23 12:57:48 +00:00
|
|
|
import pkg/chronos
|
2022-03-28 15:24:28 +00:00
|
|
|
import pkg/upraises
|
2022-06-15 12:12:34 +00:00
|
|
|
import pkg/questionable
|
2022-03-23 12:57:48 +00:00
|
|
|
import ./contracts/requests
|
2022-11-08 07:10:17 +00:00
|
|
|
import ./clock
|
2022-03-23 12:57:48 +00:00
|
|
|
|
|
|
|
export chronos
|
2022-06-15 12:12:34 +00:00
|
|
|
export questionable
|
2022-03-23 12:57:48 +00:00
|
|
|
export requests
|
2022-11-08 07:10:17 +00:00
|
|
|
export SecondsSince1970
|
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-08-17 04:18:30 +00:00
|
|
|
OnRequest* = proc(id: RequestId, ask: StorageAsk) {.gcsafe, upraises:[].}
|
|
|
|
OnFulfillment* = proc(requestId: RequestId) {.gcsafe, upraises: [].}
|
|
|
|
OnSlotFilled* = proc(requestId: RequestId, slotIndex: UInt256) {.gcsafe, upraises:[].}
|
|
|
|
OnRequestCancelled* = proc(requestId: RequestId) {.gcsafe, upraises:[].}
|
2022-11-08 07:10:17 +00:00
|
|
|
OnRequestFailed* = proc(requestId: RequestId) {.gcsafe, upraises:[].}
|
2022-03-23 12:57:48 +00:00
|
|
|
|
2022-07-04 12:14:56 +00:00
|
|
|
method getSigner*(market: Market): Future[Address] {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
2022-03-31 08:46:03 +00:00
|
|
|
method requestStorage*(market: Market,
|
2022-11-08 07:10:17 +00:00
|
|
|
request: StorageRequest) {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
|
|
|
method myRequests*(market: Market): Future[seq[RequestId]] {.base, async.} =
|
2022-03-23 12:57:48 +00:00
|
|
|
raiseAssert("not implemented")
|
2022-03-28 10:28:22 +00:00
|
|
|
|
2022-06-15 12:12:34 +00:00
|
|
|
method getRequest*(market: Market,
|
2022-08-17 02:29:44 +00:00
|
|
|
id: RequestId):
|
2022-06-15 12:12:34 +00:00
|
|
|
Future[?StorageRequest] {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
2022-11-08 07:10:17 +00:00
|
|
|
method getState*(market: Market,
|
|
|
|
requestId: RequestId): Future[?RequestState] {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
|
|
|
method getRequestEnd*(market: Market,
|
|
|
|
id: RequestId): Future[SecondsSince1970] {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
2022-07-21 12:32:38 +00:00
|
|
|
method getHost*(market: Market,
|
2022-08-17 02:29:44 +00:00
|
|
|
requestId: RequestId,
|
2022-07-21 12:32:38 +00:00
|
|
|
slotIndex: UInt256): Future[?Address] {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
2022-07-20 13:59:07 +00:00
|
|
|
method fillSlot*(market: Market,
|
2022-08-17 02:29:44 +00:00
|
|
|
requestId: RequestId,
|
2022-07-20 13:59:07 +00:00
|
|
|
slotIndex: UInt256,
|
|
|
|
proof: seq[byte]) {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
2022-08-18 06:01:47 +00:00
|
|
|
method withdrawFunds*(market: Market,
|
2022-08-17 04:18:30 +00:00
|
|
|
requestId: RequestId) {.base, async.} =
|
2022-08-18 06:01:47 +00:00
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
2022-03-28 10:28:22 +00:00
|
|
|
method subscribeRequests*(market: Market,
|
|
|
|
callback: OnRequest):
|
|
|
|
Future[Subscription] {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
2022-06-14 07:47:05 +00:00
|
|
|
method subscribeFulfillment*(market: Market,
|
2022-08-17 02:29:44 +00:00
|
|
|
requestId: RequestId,
|
2022-06-14 07:47:05 +00:00
|
|
|
callback: OnFulfillment):
|
|
|
|
Future[Subscription] {.base, async.} =
|
2022-03-29 09:20:07 +00:00
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
2022-07-21 12:32:38 +00:00
|
|
|
method subscribeSlotFilled*(market: Market,
|
2022-08-17 02:29:44 +00:00
|
|
|
requestId: RequestId,
|
2022-07-21 12:32:38 +00:00
|
|
|
slotIndex: UInt256,
|
|
|
|
callback: OnSlotFilled):
|
|
|
|
Future[Subscription] {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
2022-08-18 06:01:47 +00:00
|
|
|
method subscribeRequestCancelled*(market: Market,
|
2022-11-08 07:10:17 +00:00
|
|
|
requestId: RequestId,
|
|
|
|
callback: OnRequestCancelled):
|
|
|
|
Future[Subscription] {.base, async.} =
|
|
|
|
raiseAssert("not implemented")
|
|
|
|
|
|
|
|
method subscribeRequestFailed*(market: Market,
|
|
|
|
requestId: RequestId,
|
|
|
|
callback: OnRequestFailed):
|
|
|
|
Future[Subscription] {.base, async.} =
|
2022-08-18 06:01:47 +00:00
|
|
|
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")
|