-
Notifications
You must be signed in to change notification settings - Fork 10
/
runtime.ts
25 lines (22 loc) · 901 Bytes
/
runtime.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { RuntimeLifecycle } from "../api.js";
import { WalletAPI } from "@marlowe.io/wallet/api";
import { FPTSRestAPI, RestClient } from "@marlowe.io/runtime-rest-client";
import { mkPayoutLifecycle } from "./payouts.js";
import { mkContractLifecycle } from "./contracts.js";
import { mkApplicableActionsAPI } from "./applicable-actions.js";
import * as NewContract from "./new-contract-api.js";
export function mkRuntimeLifecycle(
deprecatedRestAPI: FPTSRestAPI,
restClient: RestClient,
wallet: WalletAPI
): RuntimeLifecycle {
const contracts = mkContractLifecycle(wallet, deprecatedRestAPI, restClient);
return {
wallet: wallet,
restClient,
contracts,
newContractAPI: NewContract.mkContractsAPI({ wallet, restClient }),
payouts: mkPayoutLifecycle(wallet, deprecatedRestAPI, restClient),
applicableActions: mkApplicableActionsAPI({ restClient, wallet }),
};
}