genlayer-js 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +5 -3
- package/dist/{clients-CD8MilSg.d.ts → clients-ByaMqS8n.d.ts} +5 -5
- package/dist/{clients-puliY5_u.d.cts → clients-DiSeCTYZ.d.cts} +5 -5
- package/dist/index.cjs +7 -9
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -9
- package/dist/types/index.cjs +1 -5
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +0 -4
- package/package.json +1 -1
- package/src/accounts/actions.ts +8 -2
- package/src/client/client.ts +5 -11
- package/src/contracts/actions.ts +3 -5
- package/src/transactions/actions.ts +2 -6
- package/src/types/accounts.ts +1 -1
- package/src/types/clients.ts +16 -11
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -30,19 +30,21 @@ import { simulator } from 'genlayer-js/chains';
|
|
|
30
30
|
import { createClient } from "genlayer-js";
|
|
31
31
|
|
|
32
32
|
const client = createClient({
|
|
33
|
-
|
|
33
|
+
chain: simulator,
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
+
const transactionHash = "0x...";
|
|
37
|
+
|
|
36
38
|
const transaction = await client.getTransaction({ hash: transactionHash })
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
###
|
|
41
|
+
### Reading a contract
|
|
40
42
|
```typescript
|
|
41
43
|
import { simulator } from 'genlayer-js/chains';
|
|
42
44
|
import { createClient } from "genlayer-js";
|
|
43
45
|
|
|
44
46
|
const client = createClient({
|
|
45
|
-
|
|
47
|
+
chain: simulator,
|
|
46
48
|
});
|
|
47
49
|
|
|
48
50
|
const result = await client.readContract({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Client, Transport, PublicActions, Account } from 'viem';
|
|
2
2
|
import { S as SimulatorChain } from './chains-CtZJFz4Q.js';
|
|
3
3
|
|
|
4
4
|
type Address$1 = `0x${string}` & {
|
|
@@ -74,8 +74,8 @@ type GenLayerMethod = {
|
|
|
74
74
|
method: "eth_getTransactionCount";
|
|
75
75
|
params: [address: string];
|
|
76
76
|
};
|
|
77
|
-
type GenLayerClient<
|
|
78
|
-
request: Client<
|
|
77
|
+
type GenLayerClient<TSimulatorChain extends SimulatorChain> = Omit<Client<Transport, TSimulatorChain>, "transport" | "getTransaction" | "readContract"> & Omit<PublicActions<Transport, TSimulatorChain>, "readContract" | "getTransaction"> & {
|
|
78
|
+
request: Client<Transport, TSimulatorChain>["request"] & {
|
|
79
79
|
<TMethod extends GenLayerMethod>(args: Extract<GenLayerMethod, {
|
|
80
80
|
method: TMethod["method"];
|
|
81
81
|
}>): Promise<unknown>;
|
|
@@ -84,13 +84,13 @@ type GenLayerClient<TTransport extends Transport, TSimulatorChain extends Simula
|
|
|
84
84
|
account?: Account;
|
|
85
85
|
address: Address$1;
|
|
86
86
|
functionName: string;
|
|
87
|
-
args:
|
|
87
|
+
args: CalldataEncodable[];
|
|
88
88
|
}) => Promise<any>;
|
|
89
89
|
writeContract: (args: {
|
|
90
90
|
account?: Account;
|
|
91
91
|
address: Address$1;
|
|
92
92
|
functionName: string;
|
|
93
|
-
args:
|
|
93
|
+
args: CalldataEncodable[];
|
|
94
94
|
value: bigint;
|
|
95
95
|
}) => Promise<any>;
|
|
96
96
|
deployContract: (args: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Client, Transport, PublicActions, Account } from 'viem';
|
|
2
2
|
import { S as SimulatorChain } from './chains-CtZJFz4Q.cjs';
|
|
3
3
|
|
|
4
4
|
type Address$1 = `0x${string}` & {
|
|
@@ -74,8 +74,8 @@ type GenLayerMethod = {
|
|
|
74
74
|
method: "eth_getTransactionCount";
|
|
75
75
|
params: [address: string];
|
|
76
76
|
};
|
|
77
|
-
type GenLayerClient<
|
|
78
|
-
request: Client<
|
|
77
|
+
type GenLayerClient<TSimulatorChain extends SimulatorChain> = Omit<Client<Transport, TSimulatorChain>, "transport" | "getTransaction" | "readContract"> & Omit<PublicActions<Transport, TSimulatorChain>, "readContract" | "getTransaction"> & {
|
|
78
|
+
request: Client<Transport, TSimulatorChain>["request"] & {
|
|
79
79
|
<TMethod extends GenLayerMethod>(args: Extract<GenLayerMethod, {
|
|
80
80
|
method: TMethod["method"];
|
|
81
81
|
}>): Promise<unknown>;
|
|
@@ -84,13 +84,13 @@ type GenLayerClient<TTransport extends Transport, TSimulatorChain extends Simula
|
|
|
84
84
|
account?: Account;
|
|
85
85
|
address: Address$1;
|
|
86
86
|
functionName: string;
|
|
87
|
-
args:
|
|
87
|
+
args: CalldataEncodable[];
|
|
88
88
|
}) => Promise<any>;
|
|
89
89
|
writeContract: (args: {
|
|
90
90
|
account?: Account;
|
|
91
91
|
address: Address$1;
|
|
92
92
|
functionName: string;
|
|
93
|
-
args:
|
|
93
|
+
args: CalldataEncodable[];
|
|
94
94
|
value: bigint;
|
|
95
95
|
}) => Promise<any>;
|
|
96
96
|
deployContract: (args: {
|
package/dist/index.cjs
CHANGED
|
@@ -23,9 +23,13 @@ function accountActions(client) {
|
|
|
23
23
|
});
|
|
24
24
|
},
|
|
25
25
|
getCurrentNonce: async ({ address }) => {
|
|
26
|
+
const addressToUse = address || _optionalChain([client, 'access', _3 => _3.account, 'optionalAccess', _4 => _4.address]);
|
|
27
|
+
if (!addressToUse) {
|
|
28
|
+
throw new Error("No address provided and no account is connected");
|
|
29
|
+
}
|
|
26
30
|
return client.request({
|
|
27
31
|
method: "eth_getTransactionCount",
|
|
28
|
-
params: [
|
|
32
|
+
params: [addressToUse]
|
|
29
33
|
});
|
|
30
34
|
}
|
|
31
35
|
};
|
|
@@ -318,14 +322,8 @@ var createClient = (config = { chain: _chunkBAGFDCQEcjs.simulator }) => {
|
|
|
318
322
|
chain: chainConfig,
|
|
319
323
|
transport: _viem.http.call(void 0, rpcUrl),
|
|
320
324
|
...config.account ? { account: config.account } : {}
|
|
321
|
-
}).extend(_viem.publicActions).extend((client) => accountActions(client)).extend(
|
|
322
|
-
|
|
323
|
-
).extend(
|
|
324
|
-
(client) => contractActions(client)
|
|
325
|
-
);
|
|
326
|
-
const genLayerClient = overrideContractActions(
|
|
327
|
-
baseClient
|
|
328
|
-
);
|
|
325
|
+
}).extend(_viem.publicActions).extend((client) => accountActions(client)).extend((client) => transactionActions(client)).extend((client) => contractActions(client));
|
|
326
|
+
const genLayerClient = overrideContractActions(baseClient);
|
|
329
327
|
return genLayerClient;
|
|
330
328
|
};
|
|
331
329
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
|
-
import {
|
|
2
|
+
import { Account } from 'viem';
|
|
3
3
|
import { S as SimulatorChain } from './chains-CtZJFz4Q.cjs';
|
|
4
|
-
import { G as GenLayerClient } from './clients-
|
|
4
|
+
import { G as GenLayerClient } from './clients-DiSeCTYZ.cjs';
|
|
5
5
|
import * as abitype from 'abitype';
|
|
6
6
|
import * as viem__types_experimental_eip7702_types_authorization from 'viem/_types/experimental/eip7702/types/authorization';
|
|
7
7
|
import * as viem_accounts from 'viem/accounts';
|
|
@@ -31,7 +31,7 @@ interface ClientConfig {
|
|
|
31
31
|
endpoint?: string;
|
|
32
32
|
account?: Account;
|
|
33
33
|
}
|
|
34
|
-
declare const createClient: (config?: ClientConfig) => GenLayerClient<
|
|
34
|
+
declare const createClient: (config?: ClientConfig) => GenLayerClient<SimulatorChain>;
|
|
35
35
|
|
|
36
36
|
declare const generatePrivateKey: () => `0x${string}`;
|
|
37
37
|
declare const createAccount: (accountPrivateKey?: `0x${string}`) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
|
-
import {
|
|
2
|
+
import { Account } from 'viem';
|
|
3
3
|
import { S as SimulatorChain } from './chains-CtZJFz4Q.js';
|
|
4
|
-
import { G as GenLayerClient } from './clients-
|
|
4
|
+
import { G as GenLayerClient } from './clients-ByaMqS8n.js';
|
|
5
5
|
import * as abitype from 'abitype';
|
|
6
6
|
import * as viem__types_experimental_eip7702_types_authorization from 'viem/_types/experimental/eip7702/types/authorization';
|
|
7
7
|
import * as viem_accounts from 'viem/accounts';
|
|
@@ -31,7 +31,7 @@ interface ClientConfig {
|
|
|
31
31
|
endpoint?: string;
|
|
32
32
|
account?: Account;
|
|
33
33
|
}
|
|
34
|
-
declare const createClient: (config?: ClientConfig) => GenLayerClient<
|
|
34
|
+
declare const createClient: (config?: ClientConfig) => GenLayerClient<SimulatorChain>;
|
|
35
35
|
|
|
36
36
|
declare const generatePrivateKey: () => `0x${string}`;
|
|
37
37
|
declare const createAccount: (accountPrivateKey?: `0x${string}`) => {
|
package/dist/index.js
CHANGED
|
@@ -23,9 +23,13 @@ function accountActions(client) {
|
|
|
23
23
|
});
|
|
24
24
|
},
|
|
25
25
|
getCurrentNonce: async ({ address }) => {
|
|
26
|
+
const addressToUse = address || client.account?.address;
|
|
27
|
+
if (!addressToUse) {
|
|
28
|
+
throw new Error("No address provided and no account is connected");
|
|
29
|
+
}
|
|
26
30
|
return client.request({
|
|
27
31
|
method: "eth_getTransactionCount",
|
|
28
|
-
params: [
|
|
32
|
+
params: [addressToUse]
|
|
29
33
|
});
|
|
30
34
|
}
|
|
31
35
|
};
|
|
@@ -318,14 +322,8 @@ var createClient = (config = { chain: simulator }) => {
|
|
|
318
322
|
chain: chainConfig,
|
|
319
323
|
transport: http(rpcUrl),
|
|
320
324
|
...config.account ? { account: config.account } : {}
|
|
321
|
-
}).extend(publicActions).extend((client) => accountActions(client)).extend(
|
|
322
|
-
|
|
323
|
-
).extend(
|
|
324
|
-
(client) => contractActions(client)
|
|
325
|
-
);
|
|
326
|
-
const genLayerClient = overrideContractActions(
|
|
327
|
-
baseClient
|
|
328
|
-
);
|
|
325
|
+
}).extend(publicActions).extend((client) => accountActions(client)).extend((client) => transactionActions(client)).extend((client) => contractActions(client));
|
|
326
|
+
const genLayerClient = overrideContractActions(baseClient);
|
|
329
327
|
return genLayerClient;
|
|
330
328
|
};
|
|
331
329
|
|
package/dist/types/index.cjs
CHANGED
|
@@ -3,9 +3,5 @@
|
|
|
3
3
|
var _chunkYI62SDKVcjs = require('../chunk-YI62SDKV.cjs');
|
|
4
4
|
require('../chunk-75ZPJI57.cjs');
|
|
5
5
|
|
|
6
|
-
// src/types/accounts.ts
|
|
7
|
-
var _viem = require('viem');
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.Account = _viem.Account; exports.TransactionStatus = _chunkYI62SDKVcjs.TransactionStatus;
|
|
7
|
+
exports.TransactionStatus = _chunkYI62SDKVcjs.TransactionStatus;
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Address, C as CalldataEncodable, G as GenLayerClient, a as GenLayerMethod, d as GenLayerTransaction, M as MethodDescription, T as TransactionData, e as TransactionDataElement, b as TransactionHash, c as TransactionStatus } from '../clients-
|
|
1
|
+
export { A as Address, C as CalldataEncodable, G as GenLayerClient, a as GenLayerMethod, d as GenLayerTransaction, M as MethodDescription, T as TransactionData, e as TransactionDataElement, b as TransactionHash, c as TransactionStatus } from '../clients-DiSeCTYZ.cjs';
|
|
2
2
|
export { S as SimulatorChain } from '../chains-CtZJFz4Q.cjs';
|
|
3
3
|
export { Account } from 'viem';
|
|
4
4
|
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Address, C as CalldataEncodable, G as GenLayerClient, a as GenLayerMethod, d as GenLayerTransaction, M as MethodDescription, T as TransactionData, e as TransactionDataElement, b as TransactionHash, c as TransactionStatus } from '../clients-
|
|
1
|
+
export { A as Address, C as CalldataEncodable, G as GenLayerClient, a as GenLayerMethod, d as GenLayerTransaction, M as MethodDescription, T as TransactionData, e as TransactionDataElement, b as TransactionHash, c as TransactionStatus } from '../clients-ByaMqS8n.js';
|
|
2
2
|
export { S as SimulatorChain } from '../chains-CtZJFz4Q.js';
|
|
3
3
|
export { Account } from 'viem';
|
|
4
4
|
|
package/dist/types/index.js
CHANGED
package/package.json
CHANGED
package/src/accounts/actions.ts
CHANGED
|
@@ -6,7 +6,7 @@ export function accountActions<
|
|
|
6
6
|
transport extends Transport = Transport,
|
|
7
7
|
chain extends SimulatorChain | undefined = SimulatorChain | undefined,
|
|
8
8
|
account extends Account | undefined = Account | undefined,
|
|
9
|
-
>(client: GenLayerClient<
|
|
9
|
+
>(client: GenLayerClient<SimulatorChain>) {
|
|
10
10
|
return {
|
|
11
11
|
fundAccount: async ({address, amount}: {address: string; amount: number}): Promise<TransactionHash> => {
|
|
12
12
|
if (client.chain?.id !== simulator.id) {
|
|
@@ -19,9 +19,15 @@ export function accountActions<
|
|
|
19
19
|
}) as Promise<TransactionHash>;
|
|
20
20
|
},
|
|
21
21
|
getCurrentNonce: async ({address}: {address: string}): Promise<number> => {
|
|
22
|
+
const addressToUse = address || client.account?.address;
|
|
23
|
+
|
|
24
|
+
if (!addressToUse) {
|
|
25
|
+
throw new Error("No address provided and no account is connected");
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
return client.request({
|
|
23
29
|
method: "eth_getTransactionCount",
|
|
24
|
-
params: [
|
|
30
|
+
params: [addressToUse],
|
|
25
31
|
}) as Promise<number>;
|
|
26
32
|
},
|
|
27
33
|
};
|
package/src/client/client.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Account, createClient as createViemClient, http, publicActions
|
|
1
|
+
import {Account, createClient as createViemClient, http, publicActions} from "viem";
|
|
2
2
|
import {simulator} from "../chains/simulator";
|
|
3
3
|
import {accountActions} from "../accounts/actions";
|
|
4
4
|
import {contractActions, overrideContractActions} from "../contracts/actions";
|
|
@@ -31,17 +31,11 @@ export const createClient = (config: ClientConfig = {chain: simulator}) => {
|
|
|
31
31
|
...(config.account ? {account: config.account} : {}),
|
|
32
32
|
})
|
|
33
33
|
.extend(publicActions)
|
|
34
|
-
.extend(client => accountActions(client as unknown as GenLayerClient<
|
|
35
|
-
.extend(client =>
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
.extend(client =>
|
|
39
|
-
contractActions(client as unknown as GenLayerClient<Transport, SimulatorChain, Account>),
|
|
40
|
-
);
|
|
34
|
+
.extend(client => accountActions(client as unknown as GenLayerClient<SimulatorChain>))
|
|
35
|
+
.extend(client => transactionActions(client as unknown as GenLayerClient<SimulatorChain>))
|
|
36
|
+
.extend(client => contractActions(client as unknown as GenLayerClient<SimulatorChain>));
|
|
41
37
|
|
|
42
|
-
const genLayerClient = overrideContractActions(
|
|
43
|
-
baseClient as unknown as GenLayerClient<Transport, SimulatorChain, Account>,
|
|
44
|
-
);
|
|
38
|
+
const genLayerClient = overrideContractActions(baseClient as unknown as GenLayerClient<SimulatorChain>);
|
|
45
39
|
|
|
46
40
|
return genLayerClient;
|
|
47
41
|
};
|
package/src/contracts/actions.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {Transport, Account, Address} from "viem";
|
|
2
|
-
|
|
3
1
|
import {encode, serialize, encodeAndSerialize} from "@/abi/calldata/encoder";
|
|
4
|
-
import {ContractSchema, SimulatorChain, GenLayerClient, CalldataEncodable} from "@/types";
|
|
2
|
+
import {Account, ContractSchema, SimulatorChain, GenLayerClient, CalldataEncodable, Address} from "@/types";
|
|
5
3
|
|
|
6
|
-
export const contractActions = (client: GenLayerClient<
|
|
4
|
+
export const contractActions = (client: GenLayerClient<SimulatorChain>) => {
|
|
7
5
|
return {
|
|
8
6
|
getContractSchema: async (address: string): Promise<ContractSchema> => {
|
|
9
7
|
const schema = (await client.request({
|
|
@@ -22,7 +20,7 @@ export const contractActions = (client: GenLayerClient<Transport, SimulatorChain
|
|
|
22
20
|
};
|
|
23
21
|
};
|
|
24
22
|
|
|
25
|
-
export const overrideContractActions = (client: GenLayerClient<
|
|
23
|
+
export const overrideContractActions = (client: GenLayerClient<SimulatorChain>) => {
|
|
26
24
|
client.readContract = async (args: {
|
|
27
25
|
account?: Account;
|
|
28
26
|
address: Address;
|
|
@@ -2,13 +2,9 @@ import {GenLayerClient} from "../types/clients";
|
|
|
2
2
|
import {TransactionHash, TransactionStatus, GenLayerTransaction} from "../types/transactions";
|
|
3
3
|
import {transactionsConfig} from "../config/transactions";
|
|
4
4
|
import {sleep} from "../utils/async";
|
|
5
|
-
import {ITransactionActions} from "./ITransactionActions";
|
|
6
|
-
import {Account, Transport} from "viem";
|
|
7
5
|
import {SimulatorChain} from "@/types";
|
|
8
6
|
|
|
9
|
-
export const transactionActions = (
|
|
10
|
-
client: GenLayerClient<Transport, SimulatorChain, Account>,
|
|
11
|
-
): ITransactionActions => ({
|
|
7
|
+
export const transactionActions = (client: GenLayerClient<SimulatorChain>) => ({
|
|
12
8
|
waitForTransactionReceipt: async ({
|
|
13
9
|
hash,
|
|
14
10
|
status = TransactionStatus.FINALIZED,
|
|
@@ -20,7 +16,7 @@ export const transactionActions = (
|
|
|
20
16
|
interval?: number;
|
|
21
17
|
retries?: number;
|
|
22
18
|
}): Promise<GenLayerTransaction> => {
|
|
23
|
-
const transaction =
|
|
19
|
+
const transaction = await client.getTransaction({hash});
|
|
24
20
|
|
|
25
21
|
if (!transaction) {
|
|
26
22
|
throw new Error("Transaction not found");
|
package/src/types/accounts.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {Account} from "viem";
|
|
1
|
+
export type {Account} from "viem";
|
|
2
2
|
export type Address = `0x${string}` & {length: 42};
|
package/src/types/clients.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {Transport, Client, PublicActions} from "viem";
|
|
2
2
|
import {GenLayerTransaction, TransactionHash, TransactionStatus} from "./transactions";
|
|
3
3
|
import {SimulatorChain} from "./chains";
|
|
4
|
-
import {Address} from "./accounts";
|
|
4
|
+
import {Address, Account} from "./accounts";
|
|
5
5
|
import {CalldataEncodable} from "./calldata";
|
|
6
6
|
|
|
7
7
|
export type GenLayerMethod =
|
|
@@ -13,13 +13,18 @@ export type GenLayerMethod =
|
|
|
13
13
|
| {method: "gen_getContractSchemaForCode"; params: [contractCode: string]}
|
|
14
14
|
| {method: "eth_getTransactionCount"; params: [address: string]};
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
/*
|
|
17
|
+
Take all the properties from PublicActions<Transport, TSimulatorChain>
|
|
18
|
+
Remove the transport, readContract, and getTransaction properties
|
|
19
|
+
The resulting type will have everything from PublicActions EXCEPT those
|
|
20
|
+
two properties which are added later
|
|
21
|
+
*/
|
|
22
|
+
export type GenLayerClient<TSimulatorChain extends SimulatorChain> = Omit<
|
|
23
|
+
Client<Transport, TSimulatorChain>,
|
|
24
|
+
"transport" | "getTransaction" | "readContract"
|
|
25
|
+
> &
|
|
26
|
+
Omit<PublicActions<Transport, TSimulatorChain>, "readContract" | "getTransaction"> & {
|
|
27
|
+
request: Client<Transport, TSimulatorChain>["request"] & {
|
|
23
28
|
<TMethod extends GenLayerMethod>(
|
|
24
29
|
args: Extract<GenLayerMethod, {method: TMethod["method"]}>,
|
|
25
30
|
): Promise<unknown>;
|
|
@@ -28,13 +33,13 @@ export type GenLayerClient<
|
|
|
28
33
|
account?: Account;
|
|
29
34
|
address: Address;
|
|
30
35
|
functionName: string;
|
|
31
|
-
args:
|
|
36
|
+
args: CalldataEncodable[];
|
|
32
37
|
}) => Promise<any>;
|
|
33
38
|
writeContract: (args: {
|
|
34
39
|
account?: Account;
|
|
35
40
|
address: Address;
|
|
36
41
|
functionName: string;
|
|
37
|
-
args:
|
|
42
|
+
args: CalldataEncodable[];
|
|
38
43
|
value: bigint;
|
|
39
44
|
}) => Promise<any>;
|
|
40
45
|
deployContract: (args: {account?: Account; code: string; args: CalldataEncodable[]}) => Promise<any>;
|