@latticexyz/common 2.2.18-9fa07c8489f1fbf167d0db01cd9aaa645a29c8e2 → 2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e
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/dist/actions.js +1 -39
- package/dist/actions.js.map +1 -1
- package/dist/chains.js +1 -75
- package/dist/chains.js.map +1 -1
- package/dist/chunk-6FIKI2CG.js +2 -0
- package/dist/{chunk-MYWRXQQH.js.map → chunk-6FIKI2CG.js.map} +1 -1
- package/dist/chunk-DPUUE7NM.js +2 -0
- package/dist/{chunk-Z6SVAIZN.js.map → chunk-DPUUE7NM.js.map} +1 -1
- package/dist/chunk-QQCZY3XJ.js +2 -0
- package/dist/{chunk-MF5NFUW7.js.map → chunk-QQCZY3XJ.js.map} +1 -1
- package/dist/chunk-TCWGPC6G.js +2 -0
- package/dist/{chunk-MK6UECU7.js.map → chunk-TCWGPC6G.js.map} +1 -1
- package/dist/chunk-ZIUX7JCQ.js +2 -0
- package/dist/{chunk-D4GDXAMP.js.map → chunk-ZIUX7JCQ.js.map} +1 -1
- package/dist/chunk-ZV2KGJCD.js +2 -0
- package/dist/{chunk-IYZZFDNO.js.map → chunk-ZV2KGJCD.js.map} +1 -1
- package/dist/codegen.js +49 -706
- package/dist/codegen.js.map +1 -1
- package/dist/errors.js +1 -6
- package/dist/foundry.js +2 -71
- package/dist/foundry.js.map +1 -1
- package/dist/index.js +1 -233
- package/dist/index.js.map +1 -1
- package/dist/internal.js +9 -205
- package/dist/internal.js.map +1 -1
- package/dist/kms.js +1 -168
- package/dist/kms.js.map +1 -1
- package/dist/utils.js +1 -122
- package/dist/utils.js.map +1 -1
- package/package.json +16 -104
- package/dist/actions.cjs +0 -334
- package/dist/actions.cjs.map +0 -1
- package/dist/actions.d.cts +0 -27
- package/dist/chains.cjs +0 -106
- package/dist/chains.cjs.map +0 -1
- package/dist/chains.d.cts +0 -968
- package/dist/chunk-D4GDXAMP.js +0 -64
- package/dist/chunk-IYZZFDNO.js +0 -16
- package/dist/chunk-MF5NFUW7.js +0 -12
- package/dist/chunk-MK6UECU7.js +0 -11
- package/dist/chunk-MYWRXQQH.js +0 -208
- package/dist/chunk-Z6SVAIZN.js +0 -70
- package/dist/codegen.cjs +0 -889
- package/dist/codegen.cjs.map +0 -1
- package/dist/codegen.d.cts +0 -228
- package/dist/errors.cjs +0 -38
- package/dist/errors.cjs.map +0 -1
- package/dist/errors.d.cts +0 -5
- package/dist/foundry.cjs +0 -105
- package/dist/foundry.cjs.map +0 -1
- package/dist/foundry.d.cts +0 -69
- package/dist/getContract-CA0EdVg6.d.cts +0 -20
- package/dist/index.cjs +0 -597
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -160
- package/dist/internal.cjs +0 -459
- package/dist/internal.cjs.map +0 -1
- package/dist/internal.d.cts +0 -36
- package/dist/kms.cjs +0 -204
- package/dist/kms.cjs.map +0 -1
- package/dist/kms.d.cts +0 -18
- package/dist/type-utils.cjs +0 -19
- package/dist/type-utils.cjs.map +0 -1
- package/dist/type-utils.d.cts +0 -19
- package/dist/utils.cjs +0 -174
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.d.cts +0 -40
package/dist/kms.cjs
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/exports/kms.ts
|
|
31
|
-
var kms_exports = {};
|
|
32
|
-
__export(kms_exports, {
|
|
33
|
-
kmsKeyToAccount: () => kmsKeyToAccount
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(kms_exports);
|
|
36
|
-
|
|
37
|
-
// src/account/kms/kmsKeyToAccount.ts
|
|
38
|
-
var import_client_kms3 = require("@aws-sdk/client-kms");
|
|
39
|
-
var import_viem4 = require("viem");
|
|
40
|
-
var import_accounts = require("viem/accounts");
|
|
41
|
-
|
|
42
|
-
// src/account/kms/signWithKms.ts
|
|
43
|
-
var import_viem2 = require("viem");
|
|
44
|
-
var import_utils = require("viem/utils");
|
|
45
|
-
|
|
46
|
-
// src/account/kms/sign.ts
|
|
47
|
-
var import_client_kms = require("@aws-sdk/client-kms");
|
|
48
|
-
var import_viem = require("viem");
|
|
49
|
-
async function sign({
|
|
50
|
-
keyId,
|
|
51
|
-
hash,
|
|
52
|
-
client
|
|
53
|
-
}) {
|
|
54
|
-
const formatted = Buffer.from((0, import_viem.fromHex)(hash, "bytes"));
|
|
55
|
-
const command = new import_client_kms.SignCommand({
|
|
56
|
-
KeyId: keyId,
|
|
57
|
-
Message: formatted,
|
|
58
|
-
SigningAlgorithm: "ECDSA_SHA_256",
|
|
59
|
-
MessageType: "DIGEST"
|
|
60
|
-
});
|
|
61
|
-
return client.send(command);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// src/account/kms/signWithKms.ts
|
|
65
|
-
var import_asn1 = __toESM(require("asn1.js"), 1);
|
|
66
|
-
var EcdsaSigAsnParse = import_asn1.default.define("EcdsaSig", function() {
|
|
67
|
-
this.seq().obj(this.key("r").int(), this.key("s").int());
|
|
68
|
-
});
|
|
69
|
-
async function getRS(signParams) {
|
|
70
|
-
const signature = await sign(signParams);
|
|
71
|
-
if (signature.Signature === void 0) {
|
|
72
|
-
throw new Error("Signature is undefined.");
|
|
73
|
-
}
|
|
74
|
-
const decoded = EcdsaSigAsnParse.decode(Buffer.from(signature.Signature), "der");
|
|
75
|
-
const r = BigInt(decoded.r);
|
|
76
|
-
let s = BigInt(decoded.s);
|
|
77
|
-
const secp256k1N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
|
|
78
|
-
const secp256k1halfN = secp256k1N / 2n;
|
|
79
|
-
if (s > secp256k1halfN) {
|
|
80
|
-
s = secp256k1N - s;
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
r: (0, import_viem2.toHex)(r),
|
|
84
|
-
s: (0, import_viem2.toHex)(s)
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
async function getRecovery(hash, r, s, expectedAddress) {
|
|
88
|
-
let recovery;
|
|
89
|
-
for (recovery = 0; recovery <= 1; recovery++) {
|
|
90
|
-
const signature = (0, import_viem2.signatureToHex)({
|
|
91
|
-
r,
|
|
92
|
-
s,
|
|
93
|
-
v: recovery ? 28n : 27n,
|
|
94
|
-
yParity: recovery
|
|
95
|
-
});
|
|
96
|
-
const address = await (0, import_utils.recoverAddress)({ hash, signature });
|
|
97
|
-
if ((0, import_viem2.isAddressEqual)(address, expectedAddress)) {
|
|
98
|
-
return recovery;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
throw new Error("Failed to calculate recovery param");
|
|
102
|
-
}
|
|
103
|
-
async function signWithKms({ hash, address, keyId, client }) {
|
|
104
|
-
const { r, s } = await getRS({ keyId, hash, client });
|
|
105
|
-
const recovery = await getRecovery(hash, r, s, address);
|
|
106
|
-
return {
|
|
107
|
-
r,
|
|
108
|
-
s,
|
|
109
|
-
v: recovery ? 28n : 27n,
|
|
110
|
-
yParity: recovery
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// src/account/kms/getAddressFromKms.ts
|
|
115
|
-
var import_viem3 = require("viem");
|
|
116
|
-
var import_utils2 = require("viem/utils");
|
|
117
|
-
|
|
118
|
-
// src/account/kms/getPublicKey.ts
|
|
119
|
-
var import_client_kms2 = require("@aws-sdk/client-kms");
|
|
120
|
-
function getPublicKey({
|
|
121
|
-
keyId,
|
|
122
|
-
client
|
|
123
|
-
}) {
|
|
124
|
-
const command = new import_client_kms2.GetPublicKeyCommand({ KeyId: keyId });
|
|
125
|
-
return client.send(command);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// src/account/kms/getAddressFromKms.ts
|
|
129
|
-
var import_asn12 = __toESM(require("asn1.js"), 1);
|
|
130
|
-
var EcdsaPubKey = import_asn12.default.define("EcdsaPubKey", function() {
|
|
131
|
-
this.seq().obj(this.key("algo").seq().obj(this.key("a").objid(), this.key("b").objid()), this.key("pubKey").bitstr());
|
|
132
|
-
});
|
|
133
|
-
function publicKeyKmsToAddress(publicKey) {
|
|
134
|
-
const res = EcdsaPubKey.decode(Buffer.from(publicKey));
|
|
135
|
-
const publicKeyBuffer = res.pubKey.data;
|
|
136
|
-
const publicKeyHex = (0, import_viem3.toHex)(publicKeyBuffer);
|
|
137
|
-
const address = (0, import_utils2.publicKeyToAddress)(publicKeyHex);
|
|
138
|
-
return address;
|
|
139
|
-
}
|
|
140
|
-
async function getAddressFromKms({
|
|
141
|
-
keyId,
|
|
142
|
-
client
|
|
143
|
-
}) {
|
|
144
|
-
const KMSKey = await getPublicKey({ keyId, client });
|
|
145
|
-
return publicKeyKmsToAddress(KMSKey.PublicKey);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// src/account/kms/kmsKeyToAccount.ts
|
|
149
|
-
async function kmsKeyToAccount({
|
|
150
|
-
keyId,
|
|
151
|
-
client = new import_client_kms3.KMSClient()
|
|
152
|
-
}) {
|
|
153
|
-
const address = await getAddressFromKms({ keyId, client });
|
|
154
|
-
const account = (0, import_accounts.toAccount)({
|
|
155
|
-
address,
|
|
156
|
-
async signMessage({ message }) {
|
|
157
|
-
const signature = await signWithKms({
|
|
158
|
-
client,
|
|
159
|
-
keyId,
|
|
160
|
-
hash: (0, import_viem4.hashMessage)(message),
|
|
161
|
-
address
|
|
162
|
-
});
|
|
163
|
-
return (0, import_viem4.signatureToHex)(signature);
|
|
164
|
-
},
|
|
165
|
-
// The logic of this function should be align with viem's signTransaction
|
|
166
|
-
// https://github.com/wevm/viem/blob/main/src/accounts/utils/signTransaction.ts
|
|
167
|
-
async signTransaction(transaction, { serializer = import_viem4.serializeTransaction } = {}) {
|
|
168
|
-
const signableTransaction = (() => {
|
|
169
|
-
if (transaction.type === "eip4844")
|
|
170
|
-
return {
|
|
171
|
-
...transaction,
|
|
172
|
-
sidecars: false
|
|
173
|
-
};
|
|
174
|
-
return transaction;
|
|
175
|
-
})();
|
|
176
|
-
const signature = await signWithKms({
|
|
177
|
-
client,
|
|
178
|
-
keyId,
|
|
179
|
-
hash: (0, import_viem4.keccak256)(serializer(signableTransaction)),
|
|
180
|
-
address
|
|
181
|
-
});
|
|
182
|
-
return serializer(transaction, signature);
|
|
183
|
-
},
|
|
184
|
-
async signTypedData(typedData) {
|
|
185
|
-
const signature = await signWithKms({
|
|
186
|
-
client,
|
|
187
|
-
keyId,
|
|
188
|
-
hash: (0, import_viem4.hashTypedData)(typedData),
|
|
189
|
-
address
|
|
190
|
-
});
|
|
191
|
-
return (0, import_viem4.signatureToHex)(signature);
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
return {
|
|
195
|
-
...account,
|
|
196
|
-
source: "aws-kms",
|
|
197
|
-
getKeyId: () => keyId
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
201
|
-
0 && (module.exports = {
|
|
202
|
-
kmsKeyToAccount
|
|
203
|
-
});
|
|
204
|
-
//# sourceMappingURL=kms.cjs.map
|
package/dist/kms.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/exports/kms.ts","../src/account/kms/kmsKeyToAccount.ts","../src/account/kms/signWithKms.ts","../src/account/kms/sign.ts","../src/account/kms/getAddressFromKms.ts","../src/account/kms/getPublicKey.ts"],"sourcesContent":["export { kmsKeyToAccount, type KmsKeyToAccountOptions, type KmsAccount } from \"../account/kms/kmsKeyToAccount\";\n","import { KMSClient } from \"@aws-sdk/client-kms\";\nimport { LocalAccount, hashMessage, hashTypedData, keccak256, serializeTransaction, signatureToHex } from \"viem\";\nimport { toAccount } from \"viem/accounts\";\nimport { signWithKms } from \"./signWithKms\";\nimport { getAddressFromKms } from \"./getAddressFromKms\";\n\nexport type KmsKeyToAccountOptions = {\n keyId: string;\n client?: KMSClient;\n};\n\nexport type KmsAccount = LocalAccount<\"aws-kms\"> & {\n getKeyId(): string;\n};\n\n/**\n * @description Creates an Account from a KMS key.\n *\n * @returns A Local Account.\n */\nexport async function kmsKeyToAccount({\n keyId,\n client = new KMSClient(),\n}: KmsKeyToAccountOptions): Promise<KmsAccount> {\n const address = await getAddressFromKms({ keyId, client });\n\n const account = toAccount({\n address,\n async signMessage({ message }) {\n const signature = await signWithKms({\n client,\n keyId,\n hash: hashMessage(message),\n address,\n });\n\n return signatureToHex(signature);\n },\n // The logic of this function should be align with viem's signTransaction\n // https://github.com/wevm/viem/blob/main/src/accounts/utils/signTransaction.ts\n async signTransaction(transaction, { serializer = serializeTransaction } = {}) {\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n const signableTransaction = (() => {\n // For EIP-4844 Transactions, we want to sign the transaction payload body (tx_payload_body) without the sidecars (ie. without the network wrapper).\n // See: https://github.com/ethereum/EIPs/blob/e00f4daa66bd56e2dbd5f1d36d09fd613811a48b/EIPS/eip-4844.md#networking\n if (transaction.type === \"eip4844\")\n return {\n ...transaction,\n sidecars: false,\n };\n return transaction;\n })();\n\n const signature = await signWithKms({\n client,\n keyId,\n hash: keccak256(serializer(signableTransaction)),\n address,\n });\n\n return serializer(transaction, signature);\n },\n async signTypedData(typedData) {\n const signature = await signWithKms({\n client,\n keyId,\n hash: hashTypedData(typedData),\n address,\n });\n\n return signatureToHex(signature);\n },\n });\n\n return {\n ...account,\n source: \"aws-kms\",\n getKeyId: () => keyId,\n };\n}\n","import { Hex, Signature, isAddressEqual, signatureToHex, toHex } from \"viem\";\nimport { recoverAddress } from \"viem/utils\";\nimport { KMSClient, SignCommandInput } from \"@aws-sdk/client-kms\";\nimport { sign } from \"./sign\";\n// @ts-expect-error Could not find a declaration file for module 'asn1.js'.\nimport asn1 from \"asn1.js\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst EcdsaSigAsnParse = asn1.define(\"EcdsaSig\", function (this: any) {\n this.seq().obj(this.key(\"r\").int(), this.key(\"s\").int());\n});\n\nasync function getRS(signParams: {\n hash: Hex;\n keyId: SignCommandInput[\"KeyId\"];\n client: KMSClient;\n}): Promise<{ r: Hex; s: Hex }> {\n const signature = await sign(signParams);\n\n if (signature.Signature === undefined) {\n throw new Error(\"Signature is undefined.\");\n }\n\n const decoded = EcdsaSigAsnParse.decode(Buffer.from(signature.Signature), \"der\");\n\n const r = BigInt(decoded.r);\n let s = BigInt(decoded.s);\n\n const secp256k1N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n const secp256k1halfN = secp256k1N / 2n;\n\n if (s > secp256k1halfN) {\n s = secp256k1N - s;\n }\n\n return {\n r: toHex(r),\n s: toHex(s),\n };\n}\n\nasync function getRecovery(hash: Hex, r: Hex, s: Hex, expectedAddress: Hex): Promise<number> {\n let recovery: number;\n for (recovery = 0; recovery <= 1; recovery++) {\n const signature = signatureToHex({\n r,\n s,\n v: recovery ? 28n : 27n,\n yParity: recovery,\n });\n\n const address = await recoverAddress({ hash, signature });\n\n if (isAddressEqual(address, expectedAddress)) {\n return recovery;\n }\n }\n throw new Error(\"Failed to calculate recovery param\");\n}\n\ntype SignParameters = {\n hash: Hex;\n keyId: SignCommandInput[\"KeyId\"];\n client: KMSClient;\n address: Hex;\n};\n\ntype SignReturnType = Signature;\n\n/**\n * @description Signs a hash with a given KMS key.\n *\n * @param hash The hash to sign.\n *\n * @returns The signature.\n */\nexport async function signWithKms({ hash, address, keyId, client }: SignParameters): Promise<SignReturnType> {\n const { r, s } = await getRS({ keyId, hash, client });\n const recovery = await getRecovery(hash, r, s, address);\n\n return {\n r,\n s,\n v: recovery ? 28n : 27n,\n yParity: recovery,\n };\n}\n","import { KMSClient, SignCommand, SignCommandInput, SignCommandOutput } from \"@aws-sdk/client-kms\";\nimport { Hex, fromHex } from \"viem\";\n\nexport async function sign({\n keyId,\n hash,\n client,\n}: {\n hash: Hex;\n keyId: SignCommandInput[\"KeyId\"];\n client: KMSClient;\n}): Promise<SignCommandOutput> {\n const formatted = Buffer.from(fromHex(hash, \"bytes\"));\n\n const command = new SignCommand({\n KeyId: keyId,\n Message: formatted,\n SigningAlgorithm: \"ECDSA_SHA_256\",\n MessageType: \"DIGEST\",\n });\n\n return client.send(command);\n}\n","import { Address, toHex } from \"viem\";\nimport { publicKeyToAddress } from \"viem/utils\";\nimport { GetPublicKeyCommandInput, KMSClient } from \"@aws-sdk/client-kms\";\nimport { getPublicKey } from \"./getPublicKey\";\n// @ts-expect-error Could not find a declaration file for module 'asn1.js'.\nimport asn1 from \"asn1.js\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst EcdsaPubKey = asn1.define(\"EcdsaPubKey\", function (this: any) {\n this.seq().obj(this.key(\"algo\").seq().obj(this.key(\"a\").objid(), this.key(\"b\").objid()), this.key(\"pubKey\").bitstr());\n});\n\nfunction publicKeyKmsToAddress(publicKey: Uint8Array): Address {\n const res = EcdsaPubKey.decode(Buffer.from(publicKey));\n\n const publicKeyBuffer: Buffer = res.pubKey.data;\n\n const publicKeyHex = toHex(publicKeyBuffer);\n const address = publicKeyToAddress(publicKeyHex);\n\n return address;\n}\n\nexport async function getAddressFromKms({\n keyId,\n client,\n}: {\n keyId: GetPublicKeyCommandInput[\"KeyId\"];\n client: KMSClient;\n}): Promise<Address> {\n const KMSKey = await getPublicKey({ keyId, client });\n\n return publicKeyKmsToAddress(KMSKey.PublicKey as Uint8Array);\n}\n","import {\n GetPublicKeyCommand,\n GetPublicKeyCommandInput,\n GetPublicKeyCommandOutput,\n KMSClient,\n} from \"@aws-sdk/client-kms\";\n\nexport function getPublicKey({\n keyId,\n client,\n}: {\n keyId: GetPublicKeyCommandInput[\"KeyId\"];\n client: KMSClient;\n}): Promise<GetPublicKeyCommandOutput> {\n const command = new GetPublicKeyCommand({ KeyId: keyId });\n\n return client.send(command);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,qBAA0B;AAC1B,IAAAC,eAA0G;AAC1G,sBAA0B;;;ACF1B,IAAAC,eAAsE;AACtE,mBAA+B;;;ACD/B,wBAA4E;AAC5E,kBAA6B;AAE7B,eAAsB,KAAK;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AACF,GAI+B;AAC7B,QAAM,YAAY,OAAO,SAAK,qBAAQ,MAAM,OAAO,CAAC;AAEpD,QAAM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OAAO,CAAC;AAEzD,QAAM,cAAU,2BAAU;AAAA,IACxB;AAAA,IACA,MAAM,YAAY,EAAE,QAAQ,GAAG;AAC7B,YAAM,YAAY,MAAM,YAAY;AAAA,QAClC;AAAA,QACA;AAAA,QACA,UAAM,0BAAY,OAAO;AAAA,QACzB;AAAA,MACF,CAAC;AAED,iBAAO,6BAAe,SAAS;AAAA,IACjC;AAAA;AAAA;AAAA,IAGA,MAAM,gBAAgB,aAAa,EAAE,aAAa,kCAAqB,IAAI,CAAC,GAAG;AAE7E,YAAM,uBAAuB,MAAM;AAGjC,YAAI,YAAY,SAAS;AACvB,iBAAO;AAAA,YACL,GAAG;AAAA,YACH,UAAU;AAAA,UACZ;AACF,eAAO;AAAA,MACT,GAAG;AAEH,YAAM,YAAY,MAAM,YAAY;AAAA,QAClC;AAAA,QACA;AAAA,QACA,UAAM,wBAAU,WAAW,mBAAmB,CAAC;AAAA,QAC/C;AAAA,MACF,CAAC;AAED,aAAO,WAAW,aAAa,SAAS;AAAA,IAC1C;AAAA,IACA,MAAM,cAAc,WAAW;AAC7B,YAAM,YAAY,MAAM,YAAY;AAAA,QAClC;AAAA,QACA;AAAA,QACA,UAAM,4BAAc,SAAS;AAAA,QAC7B;AAAA,MACF,CAAC;AAED,iBAAO,6BAAe,SAAS;AAAA,IACjC;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL,GAAG;AAAA,IACH,QAAQ;AAAA,IACR,UAAU,MAAM;AAAA,EAClB;AACF;","names":["import_client_kms","import_viem","import_viem","asn1","import_viem","import_utils","import_client_kms","import_asn1","asn1"]}
|
package/dist/kms.d.cts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { KMSClient } from '@aws-sdk/client-kms';
|
|
2
|
-
import { LocalAccount } from 'viem';
|
|
3
|
-
|
|
4
|
-
type KmsKeyToAccountOptions = {
|
|
5
|
-
keyId: string;
|
|
6
|
-
client?: KMSClient;
|
|
7
|
-
};
|
|
8
|
-
type KmsAccount = LocalAccount<"aws-kms"> & {
|
|
9
|
-
getKeyId(): string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* @description Creates an Account from a KMS key.
|
|
13
|
-
*
|
|
14
|
-
* @returns A Local Account.
|
|
15
|
-
*/
|
|
16
|
-
declare function kmsKeyToAccount({ keyId, client, }: KmsKeyToAccountOptions): Promise<KmsAccount>;
|
|
17
|
-
|
|
18
|
-
export { type KmsAccount, type KmsKeyToAccountOptions, kmsKeyToAccount };
|
package/dist/type-utils.cjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/type-utils/index.ts
|
|
17
|
-
var type_utils_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(type_utils_exports);
|
|
19
|
-
//# sourceMappingURL=type-utils.cjs.map
|
package/dist/type-utils.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/type-utils/index.ts"],"sourcesContent":["export * from \"./abi\";\nexport * from \"./common\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/type-utils.d.cts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AbiType, StaticArray } from '@latticexyz/schema-type/deprecated';
|
|
2
|
-
|
|
3
|
-
type RequireKeys<T extends Record<string, unknown>, P extends string> = T & Required<Pick<T, P>>;
|
|
4
|
-
type StringForUnion = string & Record<never, never>;
|
|
5
|
-
type AsDependent<T> = T extends infer P ? P : never;
|
|
6
|
-
type OrDefault<T, Default> = T extends undefined ? Default : T;
|
|
7
|
-
type OrDefaults<T extends object, Defaults> = {
|
|
8
|
-
[key in keyof Defaults]: key extends keyof T ? OrDefault<T[key], Defaults[key]> : Defaults[key];
|
|
9
|
-
};
|
|
10
|
-
type UnionOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
|
|
11
|
-
type UnionKeys<T> = T extends any ? keyof T : never;
|
|
12
|
-
type UnionPick<T, K extends UnionKeys<T>> = T extends any ? Pick<T, Extract<K, keyof T>> : never;
|
|
13
|
-
type ReverseMap<T extends Record<any, any>> = {
|
|
14
|
-
[K in keyof T as T[K]]: K;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
type ExtractUserTypes<UnknownTypes extends StringForUnion> = Exclude<UnknownTypes, AbiType | StaticArray>;
|
|
18
|
-
|
|
19
|
-
export type { AsDependent, ExtractUserTypes, OrDefault, OrDefaults, RequireKeys, ReverseMap, StringForUnion, UnionKeys, UnionOmit, UnionPick };
|
package/dist/utils.cjs
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/utils/index.ts
|
|
21
|
-
var utils_exports = {};
|
|
22
|
-
__export(utils_exports, {
|
|
23
|
-
assertExhaustive: () => assertExhaustive,
|
|
24
|
-
bigIntMax: () => bigIntMax,
|
|
25
|
-
bigIntMin: () => bigIntMin,
|
|
26
|
-
bigIntSort: () => bigIntSort,
|
|
27
|
-
chunk: () => chunk,
|
|
28
|
-
groupBy: () => groupBy,
|
|
29
|
-
identity: () => identity,
|
|
30
|
-
includes: () => includes,
|
|
31
|
-
indent: () => indent,
|
|
32
|
-
isDefined: () => isDefined,
|
|
33
|
-
isNotNull: () => isNotNull,
|
|
34
|
-
iteratorToArray: () => iteratorToArray,
|
|
35
|
-
mapObject: () => mapObject,
|
|
36
|
-
unique: () => unique,
|
|
37
|
-
uniqueBy: () => uniqueBy,
|
|
38
|
-
wait: () => wait,
|
|
39
|
-
waitForIdle: () => waitForIdle
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(utils_exports);
|
|
42
|
-
|
|
43
|
-
// src/utils/assertExhaustive.ts
|
|
44
|
-
function assertExhaustive(value, message) {
|
|
45
|
-
throw new Error(message ?? `Unexpected value: ${value}`);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// src/utils/bigIntMax.ts
|
|
49
|
-
function bigIntMax(...args) {
|
|
50
|
-
return args.reduce((m, e) => e > m ? e : m);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// src/utils/bigIntMin.ts
|
|
54
|
-
function bigIntMin(...args) {
|
|
55
|
-
return args.reduce((m, e) => e < m ? e : m);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// src/utils/bigIntSort.ts
|
|
59
|
-
function bigIntSort(a, b) {
|
|
60
|
-
return a < b ? -1 : a > b ? 1 : 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// src/utils/chunk.ts
|
|
64
|
-
function* chunk(arr, n) {
|
|
65
|
-
for (let i = 0; i < arr.length; i += n) {
|
|
66
|
-
yield arr.slice(i, i + n);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// src/utils/groupBy.ts
|
|
71
|
-
function groupBy(values, getKey) {
|
|
72
|
-
const map = /* @__PURE__ */ new Map();
|
|
73
|
-
for (const value of values) {
|
|
74
|
-
const key = getKey(value);
|
|
75
|
-
if (!map.has(key)) map.set(key, []);
|
|
76
|
-
map.get(key).push(value);
|
|
77
|
-
}
|
|
78
|
-
return map;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// src/utils/identity.ts
|
|
82
|
-
function identity(value) {
|
|
83
|
-
return value;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// src/utils/includes.ts
|
|
87
|
-
function includes(items, value) {
|
|
88
|
-
return items.includes(value);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// src/utils/indent.ts
|
|
92
|
-
function indent(message, indentation = " ") {
|
|
93
|
-
return message.replaceAll(/(^|\n)/g, `$1${indentation}`);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// src/utils/isDefined.ts
|
|
97
|
-
function isDefined(argument) {
|
|
98
|
-
return argument !== void 0;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// src/utils/isNotNull.ts
|
|
102
|
-
function isNotNull(argument) {
|
|
103
|
-
return argument !== null;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// src/utils/iteratorToArray.ts
|
|
107
|
-
async function iteratorToArray(iterator) {
|
|
108
|
-
const items = [];
|
|
109
|
-
for await (const item of iterator) {
|
|
110
|
-
items.push(item);
|
|
111
|
-
}
|
|
112
|
-
return items;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// src/utils/mapObject.ts
|
|
116
|
-
function mapObject(source, valueMap) {
|
|
117
|
-
return Object.fromEntries(
|
|
118
|
-
Object.entries(source).map(([key, value]) => [key, valueMap(value, key)])
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// src/utils/unique.ts
|
|
123
|
-
function unique(values) {
|
|
124
|
-
return Array.from(new Set(values));
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// src/utils/uniqueBy.ts
|
|
128
|
-
function uniqueBy(values, getKey) {
|
|
129
|
-
const map = /* @__PURE__ */ new Map();
|
|
130
|
-
for (const value of values) {
|
|
131
|
-
const key = getKey(value);
|
|
132
|
-
if (!map.has(key)) {
|
|
133
|
-
map.set(key, value);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return Array.from(map.values());
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// src/utils/wait.ts
|
|
140
|
-
function wait(ms) {
|
|
141
|
-
return new Promise((resolve) => setTimeout(() => resolve(), ms));
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// src/utils/waitForIdle.ts
|
|
145
|
-
function waitForIdle() {
|
|
146
|
-
return new Promise((resolve) => {
|
|
147
|
-
if (typeof requestIdleCallback !== "undefined") {
|
|
148
|
-
requestIdleCallback(() => resolve());
|
|
149
|
-
} else {
|
|
150
|
-
setTimeout(() => resolve(), 1);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
155
|
-
0 && (module.exports = {
|
|
156
|
-
assertExhaustive,
|
|
157
|
-
bigIntMax,
|
|
158
|
-
bigIntMin,
|
|
159
|
-
bigIntSort,
|
|
160
|
-
chunk,
|
|
161
|
-
groupBy,
|
|
162
|
-
identity,
|
|
163
|
-
includes,
|
|
164
|
-
indent,
|
|
165
|
-
isDefined,
|
|
166
|
-
isNotNull,
|
|
167
|
-
iteratorToArray,
|
|
168
|
-
mapObject,
|
|
169
|
-
unique,
|
|
170
|
-
uniqueBy,
|
|
171
|
-
wait,
|
|
172
|
-
waitForIdle
|
|
173
|
-
});
|
|
174
|
-
//# sourceMappingURL=utils.cjs.map
|
package/dist/utils.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/index.ts","../src/utils/assertExhaustive.ts","../src/utils/bigIntMax.ts","../src/utils/bigIntMin.ts","../src/utils/bigIntSort.ts","../src/utils/chunk.ts","../src/utils/groupBy.ts","../src/utils/identity.ts","../src/utils/includes.ts","../src/utils/indent.ts","../src/utils/isDefined.ts","../src/utils/isNotNull.ts","../src/utils/iteratorToArray.ts","../src/utils/mapObject.ts","../src/utils/unique.ts","../src/utils/uniqueBy.ts","../src/utils/wait.ts","../src/utils/waitForIdle.ts"],"sourcesContent":["export * from \"./assertExhaustive\";\nexport * from \"./bigIntMax\";\nexport * from \"./bigIntMin\";\nexport * from \"./bigIntSort\";\nexport * from \"./chunk\";\nexport * from \"./groupBy\";\nexport * from \"./identity\";\nexport * from \"./includes\";\nexport * from \"./indent\";\nexport * from \"./isDefined\";\nexport * from \"./isNotNull\";\nexport * from \"./iteratorToArray\";\nexport * from \"./mapObject\";\nexport * from \"./unique\";\nexport * from \"./uniqueBy\";\nexport * from \"./wait\";\nexport * from \"./waitForIdle\";\n","export function assertExhaustive(value: never, message?: string): never {\n throw new Error(message ?? `Unexpected value: ${value}`);\n}\n","export function bigIntMax(...args: bigint[]): bigint {\n return args.reduce((m, e) => (e > m ? e : m));\n}\n","export function bigIntMin(...args: bigint[]): bigint {\n return args.reduce((m, e) => (e < m ? e : m));\n}\n","export function bigIntSort(a: bigint, b: bigint): -1 | 0 | 1 {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n","export function* chunk<T>(arr: readonly T[], n: number): Generator<readonly T[], void> {\n for (let i = 0; i < arr.length; i += n) {\n yield arr.slice(i, i + n);\n }\n}\n","export function groupBy<value, key>(\n values: readonly value[],\n getKey: (value: value) => key,\n): Map<key, readonly value[]> {\n const map = new Map<key, readonly value[]>();\n for (const value of values) {\n const key = getKey(value);\n if (!map.has(key)) map.set(key, []);\n (map.get(key) as value[]).push(value);\n }\n return map;\n}\n","export function identity<T>(value: T): T {\n return value;\n}\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function includes<item>(items: item[], value: any): value is item {\n return items.includes(value);\n}\n","export function indent(message: string, indentation = \" \"): string {\n return message.replaceAll(/(^|\\n)/g, `$1${indentation}`);\n}\n","export function isDefined<T>(argument: T | undefined): argument is T {\n return argument !== undefined;\n}\n","export function isNotNull<T>(argument: T | null): argument is T {\n return argument !== null;\n}\n","export async function iteratorToArray<T>(iterator: AsyncIterable<T>): Promise<readonly T[]> {\n const items: T[] = [];\n for await (const item of iterator) {\n items.push(item);\n }\n return items;\n}\n","/**\n * Map each key of a source object via a given valueMap function\n */\nexport function mapObject<\n Source extends Record<string | number | symbol, unknown>,\n Target extends { [key in keyof Source]: unknown },\n>(source: Source, valueMap: (value: Source[typeof key], key: keyof Source) => Target[typeof key]): Target {\n return Object.fromEntries(\n Object.entries(source).map(([key, value]) => [key, valueMap(value as Source[keyof Source], key)]),\n ) as Target;\n}\n","export function unique<value>(values: readonly value[]): readonly value[] {\n return Array.from(new Set(values));\n}\n","export function uniqueBy<value, key>(values: readonly value[], getKey: (value: value) => key): readonly value[] {\n const map = new Map<key, value>();\n for (const value of values) {\n const key = getKey(value);\n if (!map.has(key)) {\n map.set(key, value);\n }\n }\n return Array.from(map.values());\n}\n","export function wait(ms: number): Promise<void> {\n return new Promise<void>((resolve) => setTimeout(() => resolve(), ms));\n}\n","export function waitForIdle(): Promise<void> {\n return new Promise<void>((resolve) => {\n if (typeof requestIdleCallback !== \"undefined\") {\n requestIdleCallback(() => resolve());\n } else {\n setTimeout(()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AAO,aAAa;AACtB;;;ACFO,SAAS,UAAa,UAAmC;AAC9D,SAAO,aAAa;AACtB;;;ACFA,eAAsB,gBAAmB,UAAmD;AAC1F,QAAM,QAAa,CAAC;AACpB,mBAAiB,QAAQ,UAAU;AACjC,UAAM,KAAK,IAAI;AAAA,EACjB;AACA,SAAO;AACT;;;ACHO,SAAS,UAGd,QAAgB,UAAwF;AACxG,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQ,MAAM,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,SAAS,OAA+B,GAAG,CAAC,CAAC;AAAA,EAClG;AACF;;;ACVO,SAAS,OAAc,QAA4C;AACxE,SAAO,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC;AACnC;;;ACFO,SAAS,SAAqB,QAA0B,QAAiD;AAC9G,QAAM,MAAM,oBAAI,IAAgB;AAChC,aAAW,SAAS,QAAQ;AAC1B,UAAM,MAAM,OAAO,KAAK;AACxB,QAAI,CAAC,IAAI,IAAI,GAAG,GAAG;AACjB,UAAI,IAAI,KAAK,KAAK;AAAA,IACpB;AAAA,EACF;AACA,SAAO,MAAM,KAAK,IAAI,OAAO,CAAC;AAChC;;;ACTO,SAAS,KAAK,IAA2B;AAC9C,SAAO,IAAI,QAAc,CAAC,YAAY,WAAW,MAAM,QAAQ,GAAG,EAAE,CAAC;AACvE;;;ACFO,SAAS,cAA6B;AAC3C,SAAO,IAAI,QAAc,CAAC,YAAY;AACpC,QAAI,OAAO,wBAAwB,aAAa;AAC9C,0BAAoB,MAAM,QAAQ,CAAC;AAAA,IACrC,OAAO;AACL,iBAAW,MAAM,QAAQ,GAAG,CAAC;AAAA,IAC/B;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/dist/utils.d.cts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
declare function assertExhaustive(value: never, message?: string): never;
|
|
2
|
-
|
|
3
|
-
declare function bigIntMax(...args: bigint[]): bigint;
|
|
4
|
-
|
|
5
|
-
declare function bigIntMin(...args: bigint[]): bigint;
|
|
6
|
-
|
|
7
|
-
declare function bigIntSort(a: bigint, b: bigint): -1 | 0 | 1;
|
|
8
|
-
|
|
9
|
-
declare function chunk<T>(arr: readonly T[], n: number): Generator<readonly T[], void>;
|
|
10
|
-
|
|
11
|
-
declare function groupBy<value, key>(values: readonly value[], getKey: (value: value) => key): Map<key, readonly value[]>;
|
|
12
|
-
|
|
13
|
-
declare function identity<T>(value: T): T;
|
|
14
|
-
|
|
15
|
-
declare function includes<item>(items: item[], value: any): value is item;
|
|
16
|
-
|
|
17
|
-
declare function indent(message: string, indentation?: string): string;
|
|
18
|
-
|
|
19
|
-
declare function isDefined<T>(argument: T | undefined): argument is T;
|
|
20
|
-
|
|
21
|
-
declare function isNotNull<T>(argument: T | null): argument is T;
|
|
22
|
-
|
|
23
|
-
declare function iteratorToArray<T>(iterator: AsyncIterable<T>): Promise<readonly T[]>;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Map each key of a source object via a given valueMap function
|
|
27
|
-
*/
|
|
28
|
-
declare function mapObject<Source extends Record<string | number | symbol, unknown>, Target extends {
|
|
29
|
-
[key in keyof Source]: unknown;
|
|
30
|
-
}>(source: Source, valueMap: (value: Source[typeof key], key: keyof Source) => Target[typeof key]): Target;
|
|
31
|
-
|
|
32
|
-
declare function unique<value>(values: readonly value[]): readonly value[];
|
|
33
|
-
|
|
34
|
-
declare function uniqueBy<value, key>(values: readonly value[], getKey: (value: value) => key): readonly value[];
|
|
35
|
-
|
|
36
|
-
declare function wait(ms: number): Promise<void>;
|
|
37
|
-
|
|
38
|
-
declare function waitForIdle(): Promise<void>;
|
|
39
|
-
|
|
40
|
-
export { assertExhaustive, bigIntMax, bigIntMin, bigIntSort, chunk, groupBy, identity, includes, indent, isDefined, isNotNull, iteratorToArray, mapObject, unique, uniqueBy, wait, waitForIdle };
|