@metamask-previews/controller-utils 11.2.0-preview-9edcf0e0 → 11.2.0-preview-cf09c0a
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/constants.cjs +138 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/{types/constants.d.ts → constants.d.cts} +2 -2
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.mts +117 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +133 -54
- package/dist/constants.mjs.map +1 -1
- package/dist/index.cjs +48 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{types/index.d.ts → index.d.cts} +6 -6
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +4 -137
- package/dist/index.mjs.map +1 -1
- package/dist/logger.cjs +7 -0
- package/dist/logger.cjs.map +1 -0
- package/dist/{types/logger.d.ts → logger.d.cts} +2 -2
- package/dist/logger.d.cts.map +1 -0
- package/dist/logger.d.mts +5 -0
- package/dist/logger.d.mts.map +1 -0
- package/dist/logger.mjs +3 -8
- package/dist/logger.mjs.map +1 -1
- package/dist/siwe.cjs +128 -0
- package/dist/siwe.cjs.map +1 -0
- package/dist/{types/siwe.d.ts → siwe.d.cts} +2 -2
- package/dist/siwe.d.cts.map +1 -0
- package/dist/siwe.d.mts +68 -0
- package/dist/siwe.d.mts.map +1 -0
- package/dist/siwe.mjs +120 -10
- package/dist/siwe.mjs.map +1 -1
- package/dist/types.cjs +107 -0
- package/dist/types.cjs.map +1 -0
- package/dist/{types/types.d.ts → types.d.cts} +1 -1
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +132 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +100 -21
- package/dist/types.mjs.map +1 -1
- package/dist/util.cjs +512 -0
- package/dist/util.cjs.map +1 -0
- package/dist/{types/util.d.ts → util.d.cts} +4 -4
- package/dist/util.d.cts.map +1 -0
- package/dist/util.d.mts +243 -0
- package/dist/util.d.mts.map +1 -0
- package/dist/util.mjs +488 -59
- package/dist/util.mjs.map +1 -1
- package/package.json +12 -7
- package/dist/chunk-2DKE2P5J.mjs +0 -306
- package/dist/chunk-2DKE2P5J.mjs.map +0 -1
- package/dist/chunk-6LGAYF2M.mjs +0 -147
- package/dist/chunk-6LGAYF2M.mjs.map +0 -1
- package/dist/chunk-CQMU5S2P.mjs +0 -85
- package/dist/chunk-CQMU5S2P.mjs.map +0 -1
- package/dist/chunk-DBJSLKNR.js +0 -9
- package/dist/chunk-DBJSLKNR.js.map +0 -1
- package/dist/chunk-M6G3ISXG.js +0 -86
- package/dist/chunk-M6G3ISXG.js.map +0 -1
- package/dist/chunk-MG6F6B4L.js +0 -147
- package/dist/chunk-MG6F6B4L.js.map +0 -1
- package/dist/chunk-RZFCNKW4.mjs +0 -9
- package/dist/chunk-RZFCNKW4.mjs.map +0 -1
- package/dist/chunk-SAQIILOG.js +0 -306
- package/dist/chunk-SAQIILOG.js.map +0 -1
- package/dist/chunk-VDEIYYE4.mjs +0 -86
- package/dist/chunk-VDEIYYE4.mjs.map +0 -1
- package/dist/chunk-XH4YXW3J.js +0 -85
- package/dist/chunk-XH4YXW3J.js.map +0 -1
- package/dist/constants.js +0 -56
- package/dist/constants.js.map +0 -1
- package/dist/index.js +0 -138
- package/dist/index.js.map +0 -1
- package/dist/logger.js +0 -9
- package/dist/logger.js.map +0 -1
- package/dist/siwe.js +0 -12
- package/dist/siwe.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/logger.d.ts.map +0 -1
- package/dist/types/siwe.d.ts.map +0 -1
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/util.d.ts.map +0 -1
- package/dist/types.js +0 -23
- package/dist/types.js.map +0 -1
- package/dist/util.js +0 -61
- package/dist/util.js.map +0 -1
package/dist/types.cjs
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NetworkNickname = exports.BlockExplorerUrl = exports.NetworksTicker = exports.ChainId = exports.BuiltInNetworkName = exports.isInfuraNetworkType = exports.isNetworkType = exports.NetworkType = exports.InfuraNetworkType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The names of built-in Infura networks
|
|
6
|
+
*/
|
|
7
|
+
exports.InfuraNetworkType = {
|
|
8
|
+
mainnet: 'mainnet',
|
|
9
|
+
goerli: 'goerli',
|
|
10
|
+
sepolia: 'sepolia',
|
|
11
|
+
'linea-goerli': 'linea-goerli',
|
|
12
|
+
'linea-sepolia': 'linea-sepolia',
|
|
13
|
+
'linea-mainnet': 'linea-mainnet',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The "network type"; either the name of a built-in network, or "rpc" for custom networks.
|
|
17
|
+
*/
|
|
18
|
+
exports.NetworkType = {
|
|
19
|
+
...exports.InfuraNetworkType,
|
|
20
|
+
rpc: 'rpc',
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A helper to determine whether a given input is NetworkType.
|
|
24
|
+
*
|
|
25
|
+
* @param val - the value to check whether it is NetworkType or not.
|
|
26
|
+
* @returns boolean indicating whether or not the argument is NetworkType.
|
|
27
|
+
*/
|
|
28
|
+
function isNetworkType(val) {
|
|
29
|
+
return Object.values(exports.NetworkType).includes(val);
|
|
30
|
+
}
|
|
31
|
+
exports.isNetworkType = isNetworkType;
|
|
32
|
+
/**
|
|
33
|
+
* A type guard to determine whether the input is an InfuraNetworkType.
|
|
34
|
+
*
|
|
35
|
+
* @param value - The value to check.
|
|
36
|
+
* @returns True if the given value is within the InfuraNetworkType enum,
|
|
37
|
+
* false otherwise.
|
|
38
|
+
*/
|
|
39
|
+
function isInfuraNetworkType(value) {
|
|
40
|
+
const infuraNetworkTypes = Object.keys(exports.InfuraNetworkType);
|
|
41
|
+
return infuraNetworkTypes.includes(value);
|
|
42
|
+
}
|
|
43
|
+
exports.isInfuraNetworkType = isInfuraNetworkType;
|
|
44
|
+
/**
|
|
45
|
+
* Names of networks built into the wallet.
|
|
46
|
+
*
|
|
47
|
+
* This includes both Infura and non-Infura networks.
|
|
48
|
+
*/
|
|
49
|
+
var BuiltInNetworkName;
|
|
50
|
+
(function (BuiltInNetworkName) {
|
|
51
|
+
BuiltInNetworkName["Mainnet"] = "mainnet";
|
|
52
|
+
BuiltInNetworkName["Goerli"] = "goerli";
|
|
53
|
+
BuiltInNetworkName["Sepolia"] = "sepolia";
|
|
54
|
+
BuiltInNetworkName["LineaGoerli"] = "linea-goerli";
|
|
55
|
+
BuiltInNetworkName["LineaSepolia"] = "linea-sepolia";
|
|
56
|
+
BuiltInNetworkName["LineaMainnet"] = "linea-mainnet";
|
|
57
|
+
BuiltInNetworkName["Aurora"] = "aurora";
|
|
58
|
+
})(BuiltInNetworkName || (exports.BuiltInNetworkName = BuiltInNetworkName = {}));
|
|
59
|
+
/**
|
|
60
|
+
* Decimal string chain IDs of built-in networks, by name.
|
|
61
|
+
*
|
|
62
|
+
* `toHex` not invoked to avoid cyclic dependency
|
|
63
|
+
*/
|
|
64
|
+
exports.ChainId = {
|
|
65
|
+
[BuiltInNetworkName.Mainnet]: '0x1',
|
|
66
|
+
[BuiltInNetworkName.Goerli]: '0x5',
|
|
67
|
+
[BuiltInNetworkName.Sepolia]: '0xaa36a7',
|
|
68
|
+
[BuiltInNetworkName.Aurora]: '0x4e454152',
|
|
69
|
+
[BuiltInNetworkName.LineaGoerli]: '0xe704',
|
|
70
|
+
[BuiltInNetworkName.LineaSepolia]: '0xe705',
|
|
71
|
+
[BuiltInNetworkName.LineaMainnet]: '0xe708', // toHex(59144)
|
|
72
|
+
};
|
|
73
|
+
var NetworksTicker;
|
|
74
|
+
(function (NetworksTicker) {
|
|
75
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
77
|
+
NetworksTicker["mainnet"] = "ETH";
|
|
78
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
80
|
+
NetworksTicker["goerli"] = "GoerliETH";
|
|
81
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
83
|
+
NetworksTicker["sepolia"] = "SepoliaETH";
|
|
84
|
+
NetworksTicker["linea-goerli"] = "LineaETH";
|
|
85
|
+
NetworksTicker["linea-sepolia"] = "LineaETH";
|
|
86
|
+
NetworksTicker["linea-mainnet"] = "ETH";
|
|
87
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
89
|
+
NetworksTicker["rpc"] = "";
|
|
90
|
+
})(NetworksTicker || (exports.NetworksTicker = NetworksTicker = {}));
|
|
91
|
+
exports.BlockExplorerUrl = {
|
|
92
|
+
[BuiltInNetworkName.Mainnet]: 'https://etherscan.io',
|
|
93
|
+
[BuiltInNetworkName.Goerli]: 'https://goerli.etherscan.io',
|
|
94
|
+
[BuiltInNetworkName.Sepolia]: 'https://sepolia.etherscan.io',
|
|
95
|
+
[BuiltInNetworkName.LineaGoerli]: 'https://goerli.lineascan.build',
|
|
96
|
+
[BuiltInNetworkName.LineaSepolia]: 'https://sepolia.lineascan.build',
|
|
97
|
+
[BuiltInNetworkName.LineaMainnet]: 'https://lineascan.build',
|
|
98
|
+
};
|
|
99
|
+
exports.NetworkNickname = {
|
|
100
|
+
[BuiltInNetworkName.Mainnet]: 'Mainnet',
|
|
101
|
+
[BuiltInNetworkName.Goerli]: 'Goerli',
|
|
102
|
+
[BuiltInNetworkName.Sepolia]: 'Sepolia',
|
|
103
|
+
[BuiltInNetworkName.LineaGoerli]: 'Linea Goerli',
|
|
104
|
+
[BuiltInNetworkName.LineaSepolia]: 'Linea Sepolia',
|
|
105
|
+
[BuiltInNetworkName.LineaMainnet]: 'Linea Mainnet',
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,iBAAiB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,cAAc;IAC9B,eAAe,EAAE,eAAe;IAChC,eAAe,EAAE,eAAe;CACxB,CAAC;AAKX;;GAEG;AACU,QAAA,WAAW,GAAG;IACzB,GAAG,yBAAiB;IACpB,GAAG,EAAE,KAAK;CACF,CAAC;AAIX;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,GAAW;IACvC,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAW,CAAC,CAAC,QAAQ,CAAC,GAAkB,CAAC,CAAC;AACjE,CAAC;AAFD,sCAEC;AAED;;;;;;GAMG;AACH,SAAgB,mBAAmB,CACjC,KAAc;IAEd,MAAM,kBAAkB,GAAc,MAAM,CAAC,IAAI,CAAC,yBAAiB,CAAC,CAAC;IACrE,OAAO,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC;AALD,kDAKC;AAED;;;;GAIG;AACH,IAAY,kBAQX;AARD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;IACnB,kDAA4B,CAAA;IAC5B,oDAA8B,CAAA;IAC9B,oDAA8B,CAAA;IAC9B,uCAAiB,CAAA;AACnB,CAAC,EARW,kBAAkB,kCAAlB,kBAAkB,QAQ7B;AAED;;;;GAIG;AACU,QAAA,OAAO,GAAG;IACrB,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,KAAK;IACn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AAC,WAAW,CAAC,EAAE,cAAc;IAChD,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,eAAe;IAClD,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,eAAe;CACE,CAAC","sourcesContent":["/**\n * The names of built-in Infura networks\n */\nexport const InfuraNetworkType = {\n mainnet: 'mainnet',\n goerli: 'goerli',\n sepolia: 'sepolia',\n 'linea-goerli': 'linea-goerli',\n 'linea-sepolia': 'linea-sepolia',\n 'linea-mainnet': 'linea-mainnet',\n} as const;\n\nexport type InfuraNetworkType =\n (typeof InfuraNetworkType)[keyof typeof InfuraNetworkType];\n\n/**\n * The \"network type\"; either the name of a built-in network, or \"rpc\" for custom networks.\n */\nexport const NetworkType = {\n ...InfuraNetworkType,\n rpc: 'rpc',\n} as const;\n\nexport type NetworkType = (typeof NetworkType)[keyof typeof NetworkType];\n\n/**\n * A helper to determine whether a given input is NetworkType.\n *\n * @param val - the value to check whether it is NetworkType or not.\n * @returns boolean indicating whether or not the argument is NetworkType.\n */\nexport function isNetworkType(val: string): val is NetworkType {\n return Object.values(NetworkType).includes(val as NetworkType);\n}\n\n/**\n * A type guard to determine whether the input is an InfuraNetworkType.\n *\n * @param value - The value to check.\n * @returns True if the given value is within the InfuraNetworkType enum,\n * false otherwise.\n */\nexport function isInfuraNetworkType(\n value: unknown,\n): value is InfuraNetworkType {\n const infuraNetworkTypes: unknown[] = Object.keys(InfuraNetworkType);\n return infuraNetworkTypes.includes(value);\n}\n\n/**\n * Names of networks built into the wallet.\n *\n * This includes both Infura and non-Infura networks.\n */\nexport enum BuiltInNetworkName {\n Mainnet = 'mainnet',\n Goerli = 'goerli',\n Sepolia = 'sepolia',\n LineaGoerli = 'linea-goerli',\n LineaSepolia = 'linea-sepolia',\n LineaMainnet = 'linea-mainnet',\n Aurora = 'aurora',\n}\n\n/**\n * Decimal string chain IDs of built-in networks, by name.\n *\n * `toHex` not invoked to avoid cyclic dependency\n */\nexport const ChainId = {\n [BuiltInNetworkName.Mainnet]: '0x1', // toHex(1)\n [BuiltInNetworkName.Goerli]: '0x5', // toHex(5)\n [BuiltInNetworkName.Sepolia]: '0xaa36a7', // toHex(11155111)\n [BuiltInNetworkName.Aurora]: '0x4e454152', // toHex(1313161554)\n [BuiltInNetworkName.LineaGoerli]: '0xe704', // toHex(59140)\n [BuiltInNetworkName.LineaSepolia]: '0xe705', // toHex(59141)\n [BuiltInNetworkName.LineaMainnet]: '0xe708', // toHex(59144)\n} as const;\nexport type ChainId = (typeof ChainId)[keyof typeof ChainId];\n\nexport enum NetworksTicker {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n mainnet = 'ETH',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n goerli = 'GoerliETH',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n sepolia = 'SepoliaETH',\n 'linea-goerli' = 'LineaETH',\n 'linea-sepolia' = 'LineaETH',\n 'linea-mainnet' = 'ETH',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n rpc = '',\n}\n\nexport const BlockExplorerUrl = {\n [BuiltInNetworkName.Mainnet]: 'https://etherscan.io',\n [BuiltInNetworkName.Goerli]: 'https://goerli.etherscan.io',\n [BuiltInNetworkName.Sepolia]: 'https://sepolia.etherscan.io',\n [BuiltInNetworkName.LineaGoerli]: 'https://goerli.lineascan.build',\n [BuiltInNetworkName.LineaSepolia]: 'https://sepolia.lineascan.build',\n [BuiltInNetworkName.LineaMainnet]: 'https://lineascan.build',\n} as const satisfies Record<InfuraNetworkType, string>;\nexport type BlockExplorerUrl =\n (typeof BlockExplorerUrl)[keyof typeof BlockExplorerUrl];\n\nexport const NetworkNickname = {\n [BuiltInNetworkName.Mainnet]: 'Mainnet',\n [BuiltInNetworkName.Goerli]: 'Goerli',\n [BuiltInNetworkName.Sepolia]: 'Sepolia',\n [BuiltInNetworkName.LineaGoerli]: 'Linea Goerli',\n [BuiltInNetworkName.LineaSepolia]: 'Linea Sepolia',\n [BuiltInNetworkName.LineaMainnet]: 'Linea Mainnet',\n} as const satisfies Record<InfuraNetworkType, string>;\nexport type NetworkNickname =\n (typeof NetworkNickname)[keyof typeof NetworkNickname];\n\n/**\n * Makes a selection of keys in a Record optional.\n *\n * @template Type - The Record that you want to operate on.\n * @template Key - The union of keys you want to make optional.\n */\n// TODO: Move to @metamask/utils\nexport type Partialize<Type, Key extends keyof Type> = Omit<Type, Key> &\n Partial<Pick<Type, Key>>;\n\n/** A context in which to execute a trace, in order to generate nested timings. */\nexport type TraceContext = unknown;\n\n/** Request to trace an operation. */\nexport type TraceRequest = {\n /** Additional data to include in the trace. */\n data?: Record<string, number | string | boolean>;\n\n /** Name of the operation. */\n name: string;\n\n /**\n * Unique identifier for the trace.\n * Required if starting a trace and not providing a callback.\n */\n id?: string;\n\n /** Trace context in which to execute the operation. */\n parentContext?: TraceContext;\n\n /** Additional tags to include in the trace to filter results. */\n tags?: Record<string, number | string | boolean>;\n};\n\n/** Callback that traces the performance of an operation. */\nexport type TraceCallback = <ReturnType>(\n /** Request to trace the performance of an operation. */\n request: TraceRequest,\n\n /**\n * Callback to trace.\n * Thrown errors will not be caught, but the trace will still be recorded.\n * @param context - The context in which the operation is running.\n */\n fn?: (context?: TraceContext) => ReturnType,\n) => Promise<ReturnType>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;CAOpB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;CAGd,CAAC;AA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C;AAE3B,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;AAEnC,qCAAqC;AACrC,MAAM,MAAM,YAAY,GAAG;IACzB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IAEjD,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,uDAAuD;IACvD,aAAa,CAAC,EAAE,YAAY,CAAC;IAE7B,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CAClD,CAAC;AAEF,4DAA4D;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,UAAU;AACrC,wDAAwD;AACxD,OAAO,EAAE,YAAY;AAErB;;;;GAIG;AACH,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,KAAK,UAAU,KACxC,OAAO,CAAC,UAAU,CAAC,CAAC"}
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The names of built-in Infura networks
|
|
3
|
+
*/
|
|
4
|
+
export declare const InfuraNetworkType: {
|
|
5
|
+
readonly mainnet: "mainnet";
|
|
6
|
+
readonly goerli: "goerli";
|
|
7
|
+
readonly sepolia: "sepolia";
|
|
8
|
+
readonly 'linea-goerli': "linea-goerli";
|
|
9
|
+
readonly 'linea-sepolia': "linea-sepolia";
|
|
10
|
+
readonly 'linea-mainnet': "linea-mainnet";
|
|
11
|
+
};
|
|
12
|
+
export type InfuraNetworkType = (typeof InfuraNetworkType)[keyof typeof InfuraNetworkType];
|
|
13
|
+
/**
|
|
14
|
+
* The "network type"; either the name of a built-in network, or "rpc" for custom networks.
|
|
15
|
+
*/
|
|
16
|
+
export declare const NetworkType: {
|
|
17
|
+
readonly rpc: "rpc";
|
|
18
|
+
readonly mainnet: "mainnet";
|
|
19
|
+
readonly goerli: "goerli";
|
|
20
|
+
readonly sepolia: "sepolia";
|
|
21
|
+
readonly 'linea-goerli': "linea-goerli";
|
|
22
|
+
readonly 'linea-sepolia': "linea-sepolia";
|
|
23
|
+
readonly 'linea-mainnet': "linea-mainnet";
|
|
24
|
+
};
|
|
25
|
+
export type NetworkType = (typeof NetworkType)[keyof typeof NetworkType];
|
|
26
|
+
/**
|
|
27
|
+
* A helper to determine whether a given input is NetworkType.
|
|
28
|
+
*
|
|
29
|
+
* @param val - the value to check whether it is NetworkType or not.
|
|
30
|
+
* @returns boolean indicating whether or not the argument is NetworkType.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isNetworkType(val: string): val is NetworkType;
|
|
33
|
+
/**
|
|
34
|
+
* A type guard to determine whether the input is an InfuraNetworkType.
|
|
35
|
+
*
|
|
36
|
+
* @param value - The value to check.
|
|
37
|
+
* @returns True if the given value is within the InfuraNetworkType enum,
|
|
38
|
+
* false otherwise.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isInfuraNetworkType(value: unknown): value is InfuraNetworkType;
|
|
41
|
+
/**
|
|
42
|
+
* Names of networks built into the wallet.
|
|
43
|
+
*
|
|
44
|
+
* This includes both Infura and non-Infura networks.
|
|
45
|
+
*/
|
|
46
|
+
export declare enum BuiltInNetworkName {
|
|
47
|
+
Mainnet = "mainnet",
|
|
48
|
+
Goerli = "goerli",
|
|
49
|
+
Sepolia = "sepolia",
|
|
50
|
+
LineaGoerli = "linea-goerli",
|
|
51
|
+
LineaSepolia = "linea-sepolia",
|
|
52
|
+
LineaMainnet = "linea-mainnet",
|
|
53
|
+
Aurora = "aurora"
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Decimal string chain IDs of built-in networks, by name.
|
|
57
|
+
*
|
|
58
|
+
* `toHex` not invoked to avoid cyclic dependency
|
|
59
|
+
*/
|
|
60
|
+
export declare const ChainId: {
|
|
61
|
+
readonly mainnet: "0x1";
|
|
62
|
+
readonly goerli: "0x5";
|
|
63
|
+
readonly sepolia: "0xaa36a7";
|
|
64
|
+
readonly aurora: "0x4e454152";
|
|
65
|
+
readonly "linea-goerli": "0xe704";
|
|
66
|
+
readonly "linea-sepolia": "0xe705";
|
|
67
|
+
readonly "linea-mainnet": "0xe708";
|
|
68
|
+
};
|
|
69
|
+
export type ChainId = (typeof ChainId)[keyof typeof ChainId];
|
|
70
|
+
export declare enum NetworksTicker {
|
|
71
|
+
mainnet = "ETH",
|
|
72
|
+
goerli = "GoerliETH",
|
|
73
|
+
sepolia = "SepoliaETH",
|
|
74
|
+
'linea-goerli' = "LineaETH",
|
|
75
|
+
'linea-sepolia' = "LineaETH",
|
|
76
|
+
'linea-mainnet' = "ETH",
|
|
77
|
+
rpc = ""
|
|
78
|
+
}
|
|
79
|
+
export declare const BlockExplorerUrl: {
|
|
80
|
+
readonly mainnet: "https://etherscan.io";
|
|
81
|
+
readonly goerli: "https://goerli.etherscan.io";
|
|
82
|
+
readonly sepolia: "https://sepolia.etherscan.io";
|
|
83
|
+
readonly "linea-goerli": "https://goerli.lineascan.build";
|
|
84
|
+
readonly "linea-sepolia": "https://sepolia.lineascan.build";
|
|
85
|
+
readonly "linea-mainnet": "https://lineascan.build";
|
|
86
|
+
};
|
|
87
|
+
export type BlockExplorerUrl = (typeof BlockExplorerUrl)[keyof typeof BlockExplorerUrl];
|
|
88
|
+
export declare const NetworkNickname: {
|
|
89
|
+
readonly mainnet: "Mainnet";
|
|
90
|
+
readonly goerli: "Goerli";
|
|
91
|
+
readonly sepolia: "Sepolia";
|
|
92
|
+
readonly "linea-goerli": "Linea Goerli";
|
|
93
|
+
readonly "linea-sepolia": "Linea Sepolia";
|
|
94
|
+
readonly "linea-mainnet": "Linea Mainnet";
|
|
95
|
+
};
|
|
96
|
+
export type NetworkNickname = (typeof NetworkNickname)[keyof typeof NetworkNickname];
|
|
97
|
+
/**
|
|
98
|
+
* Makes a selection of keys in a Record optional.
|
|
99
|
+
*
|
|
100
|
+
* @template Type - The Record that you want to operate on.
|
|
101
|
+
* @template Key - The union of keys you want to make optional.
|
|
102
|
+
*/
|
|
103
|
+
export type Partialize<Type, Key extends keyof Type> = Omit<Type, Key> & Partial<Pick<Type, Key>>;
|
|
104
|
+
/** A context in which to execute a trace, in order to generate nested timings. */
|
|
105
|
+
export type TraceContext = unknown;
|
|
106
|
+
/** Request to trace an operation. */
|
|
107
|
+
export type TraceRequest = {
|
|
108
|
+
/** Additional data to include in the trace. */
|
|
109
|
+
data?: Record<string, number | string | boolean>;
|
|
110
|
+
/** Name of the operation. */
|
|
111
|
+
name: string;
|
|
112
|
+
/**
|
|
113
|
+
* Unique identifier for the trace.
|
|
114
|
+
* Required if starting a trace and not providing a callback.
|
|
115
|
+
*/
|
|
116
|
+
id?: string;
|
|
117
|
+
/** Trace context in which to execute the operation. */
|
|
118
|
+
parentContext?: TraceContext;
|
|
119
|
+
/** Additional tags to include in the trace to filter results. */
|
|
120
|
+
tags?: Record<string, number | string | boolean>;
|
|
121
|
+
};
|
|
122
|
+
/** Callback that traces the performance of an operation. */
|
|
123
|
+
export type TraceCallback = <ReturnType>(
|
|
124
|
+
/** Request to trace the performance of an operation. */
|
|
125
|
+
request: TraceRequest,
|
|
126
|
+
/**
|
|
127
|
+
* Callback to trace.
|
|
128
|
+
* Thrown errors will not be caught, but the trace will still be recorded.
|
|
129
|
+
* @param context - The context in which the operation is running.
|
|
130
|
+
*/
|
|
131
|
+
fn?: (context?: TraceContext) => ReturnType) => Promise<ReturnType>;
|
|
132
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;CAOpB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,iBAAiB,CAAC,CAAC,MA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C,IAAI,EAAE,GAAG,CAAC,GACpE,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AAE3B,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;AAEnC,qCAAqC;AACrC,MAAM,MAAM,YAAY,GAAG;IACzB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IAEjD,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,uDAAuD;IACvD,aAAa,CAAC,EAAE,YAAY,CAAC;IAE7B,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CAClD,CAAC;AAEF,4DAA4D;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,UAAU;AACrC,wDAAwD;AACxD,OAAO,EAAE,YAAY;AAErB;;;;GAIG;AACH,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,KAAK,UAAU,KACxC,OAAO,CAAC,UAAU,CAAC,CAAC"}
|
package/dist/types.mjs
CHANGED
|
@@ -1,23 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The names of built-in Infura networks
|
|
3
|
+
*/
|
|
4
|
+
export const InfuraNetworkType = {
|
|
5
|
+
mainnet: 'mainnet',
|
|
6
|
+
goerli: 'goerli',
|
|
7
|
+
sepolia: 'sepolia',
|
|
8
|
+
'linea-goerli': 'linea-goerli',
|
|
9
|
+
'linea-sepolia': 'linea-sepolia',
|
|
10
|
+
'linea-mainnet': 'linea-mainnet',
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The "network type"; either the name of a built-in network, or "rpc" for custom networks.
|
|
14
|
+
*/
|
|
15
|
+
export const NetworkType = {
|
|
16
|
+
...InfuraNetworkType,
|
|
17
|
+
rpc: 'rpc',
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A helper to determine whether a given input is NetworkType.
|
|
21
|
+
*
|
|
22
|
+
* @param val - the value to check whether it is NetworkType or not.
|
|
23
|
+
* @returns boolean indicating whether or not the argument is NetworkType.
|
|
24
|
+
*/
|
|
25
|
+
export function isNetworkType(val) {
|
|
26
|
+
return Object.values(NetworkType).includes(val);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A type guard to determine whether the input is an InfuraNetworkType.
|
|
30
|
+
*
|
|
31
|
+
* @param value - The value to check.
|
|
32
|
+
* @returns True if the given value is within the InfuraNetworkType enum,
|
|
33
|
+
* false otherwise.
|
|
34
|
+
*/
|
|
35
|
+
export function isInfuraNetworkType(value) {
|
|
36
|
+
const infuraNetworkTypes = Object.keys(InfuraNetworkType);
|
|
37
|
+
return infuraNetworkTypes.includes(value);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Names of networks built into the wallet.
|
|
41
|
+
*
|
|
42
|
+
* This includes both Infura and non-Infura networks.
|
|
43
|
+
*/
|
|
44
|
+
export var BuiltInNetworkName;
|
|
45
|
+
(function (BuiltInNetworkName) {
|
|
46
|
+
BuiltInNetworkName["Mainnet"] = "mainnet";
|
|
47
|
+
BuiltInNetworkName["Goerli"] = "goerli";
|
|
48
|
+
BuiltInNetworkName["Sepolia"] = "sepolia";
|
|
49
|
+
BuiltInNetworkName["LineaGoerli"] = "linea-goerli";
|
|
50
|
+
BuiltInNetworkName["LineaSepolia"] = "linea-sepolia";
|
|
51
|
+
BuiltInNetworkName["LineaMainnet"] = "linea-mainnet";
|
|
52
|
+
BuiltInNetworkName["Aurora"] = "aurora";
|
|
53
|
+
})(BuiltInNetworkName || (BuiltInNetworkName = {}));
|
|
54
|
+
/**
|
|
55
|
+
* Decimal string chain IDs of built-in networks, by name.
|
|
56
|
+
*
|
|
57
|
+
* `toHex` not invoked to avoid cyclic dependency
|
|
58
|
+
*/
|
|
59
|
+
export const ChainId = {
|
|
60
|
+
[BuiltInNetworkName.Mainnet]: '0x1',
|
|
61
|
+
[BuiltInNetworkName.Goerli]: '0x5',
|
|
62
|
+
[BuiltInNetworkName.Sepolia]: '0xaa36a7',
|
|
63
|
+
[BuiltInNetworkName.Aurora]: '0x4e454152',
|
|
64
|
+
[BuiltInNetworkName.LineaGoerli]: '0xe704',
|
|
65
|
+
[BuiltInNetworkName.LineaSepolia]: '0xe705',
|
|
66
|
+
[BuiltInNetworkName.LineaMainnet]: '0xe708', // toHex(59144)
|
|
67
|
+
};
|
|
68
|
+
export var NetworksTicker;
|
|
69
|
+
(function (NetworksTicker) {
|
|
70
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
72
|
+
NetworksTicker["mainnet"] = "ETH";
|
|
73
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
74
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
75
|
+
NetworksTicker["goerli"] = "GoerliETH";
|
|
76
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
78
|
+
NetworksTicker["sepolia"] = "SepoliaETH";
|
|
79
|
+
NetworksTicker["linea-goerli"] = "LineaETH";
|
|
80
|
+
NetworksTicker["linea-sepolia"] = "LineaETH";
|
|
81
|
+
NetworksTicker["linea-mainnet"] = "ETH";
|
|
82
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
84
|
+
NetworksTicker["rpc"] = "";
|
|
85
|
+
})(NetworksTicker || (NetworksTicker = {}));
|
|
86
|
+
export const BlockExplorerUrl = {
|
|
87
|
+
[BuiltInNetworkName.Mainnet]: 'https://etherscan.io',
|
|
88
|
+
[BuiltInNetworkName.Goerli]: 'https://goerli.etherscan.io',
|
|
89
|
+
[BuiltInNetworkName.Sepolia]: 'https://sepolia.etherscan.io',
|
|
90
|
+
[BuiltInNetworkName.LineaGoerli]: 'https://goerli.lineascan.build',
|
|
91
|
+
[BuiltInNetworkName.LineaSepolia]: 'https://sepolia.lineascan.build',
|
|
92
|
+
[BuiltInNetworkName.LineaMainnet]: 'https://lineascan.build',
|
|
93
|
+
};
|
|
94
|
+
export const NetworkNickname = {
|
|
95
|
+
[BuiltInNetworkName.Mainnet]: 'Mainnet',
|
|
96
|
+
[BuiltInNetworkName.Goerli]: 'Goerli',
|
|
97
|
+
[BuiltInNetworkName.Sepolia]: 'Sepolia',
|
|
98
|
+
[BuiltInNetworkName.LineaGoerli]: 'Linea Goerli',
|
|
99
|
+
[BuiltInNetworkName.LineaSepolia]: 'Linea Sepolia',
|
|
100
|
+
[BuiltInNetworkName.LineaMainnet]: 'Linea Mainnet',
|
|
22
101
|
};
|
|
23
102
|
//# sourceMappingURL=types.mjs.map
|
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,cAAc;IAC9B,eAAe,EAAE,eAAe;IAChC,eAAe,EAAE,eAAe;CACxB,CAAC;AAKX;;GAE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IACf,gFAAgF;IAChF,gEAAgE;IAChE,sCAAoB,CAAA;IACpB,gFAAgF;IAChF,gEAAgE;IAChE,wCAAsB,CAAA;IACtB,2CAA2B,CAAA;IAC3B,4CAA4B,CAAA;IAC5B,uCAAuB,CAAA;IACvB,gFAAgF;IAChF,gEAAgE;IAChE,0BAAQ,CAAA;AACV,CAAC,EAhBW,cAAc,KAAd,cAAc,QAgBzB;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,sBAAsB;IACpD,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,6BAA6B;IAC1D,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,8BAA8B;IAC5D,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,gCAAgC;IAClE,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,iCAAiC;IACpE,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,yBAAyB;CACR,CAAC;AAIvD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS;IACvC,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,QAAQ;IACrC,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS;IACvC,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,cAAc;IAChD,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,eAAe;IAClD,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,eAAe;CACE,CAAC","sourcesContent":["/**\n * The names of built-in Infura networks\n */\nexport const InfuraNetworkType = {\n mainnet: 'mainnet',\n goerli: 'goerli',\n sepolia: 'sepolia',\n 'linea-goerli': 'linea-goerli',\n 'linea-sepolia': 'linea-sepolia',\n 'linea-mainnet': 'linea-mainnet',\n} as const;\n\nexport type InfuraNetworkType =\n (typeof InfuraNetworkType)[keyof typeof InfuraNetworkType];\n\n/**\n * The \"network type\"; either the name of a built-in network, or \"rpc\" for custom networks.\n */\nexport const NetworkType = {\n ...InfuraNetworkType,\n rpc: 'rpc',\n} as const;\n\nexport type NetworkType = (typeof NetworkType)[keyof typeof NetworkType];\n\n/**\n * A helper to determine whether a given input is NetworkType.\n *\n * @param val - the value to check whether it is NetworkType or not.\n * @returns boolean indicating whether or not the argument is NetworkType.\n */\nexport function isNetworkType(val: string): val is NetworkType {\n return Object.values(NetworkType).includes(val as NetworkType);\n}\n\n/**\n * A type guard to determine whether the input is an InfuraNetworkType.\n *\n * @param value - The value to check.\n * @returns True if the given value is within the InfuraNetworkType enum,\n * false otherwise.\n */\nexport function isInfuraNetworkType(\n value: unknown,\n): value is InfuraNetworkType {\n const infuraNetworkTypes: unknown[] = Object.keys(InfuraNetworkType);\n return infuraNetworkTypes.includes(value);\n}\n\n/**\n * Names of networks built into the wallet.\n *\n * This includes both Infura and non-Infura networks.\n */\nexport enum BuiltInNetworkName {\n Mainnet = 'mainnet',\n Goerli = 'goerli',\n Sepolia = 'sepolia',\n LineaGoerli = 'linea-goerli',\n LineaSepolia = 'linea-sepolia',\n LineaMainnet = 'linea-mainnet',\n Aurora = 'aurora',\n}\n\n/**\n * Decimal string chain IDs of built-in networks, by name.\n *\n * `toHex` not invoked to avoid cyclic dependency\n */\nexport const ChainId = {\n [BuiltInNetworkName.Mainnet]: '0x1', // toHex(1)\n [BuiltInNetworkName.Goerli]: '0x5', // toHex(5)\n [BuiltInNetworkName.Sepolia]: '0xaa36a7', // toHex(11155111)\n [BuiltInNetworkName.Aurora]: '0x4e454152', // toHex(1313161554)\n [BuiltInNetworkName.LineaGoerli]: '0xe704', // toHex(59140)\n [BuiltInNetworkName.LineaSepolia]: '0xe705', // toHex(59141)\n [BuiltInNetworkName.LineaMainnet]: '0xe708', // toHex(59144)\n} as const;\nexport type ChainId = (typeof ChainId)[keyof typeof ChainId];\n\nexport enum NetworksTicker {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n mainnet = 'ETH',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n goerli = 'GoerliETH',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n sepolia = 'SepoliaETH',\n 'linea-goerli' = 'LineaETH',\n 'linea-sepolia' = 'LineaETH',\n 'linea-mainnet' = 'ETH',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n rpc = '',\n}\n\nexport const BlockExplorerUrl = {\n [BuiltInNetworkName.Mainnet]: 'https://etherscan.io',\n [BuiltInNetworkName.Goerli]: 'https://goerli.etherscan.io',\n [BuiltInNetworkName.Sepolia]: 'https://sepolia.etherscan.io',\n [BuiltInNetworkName.LineaGoerli]: 'https://goerli.lineascan.build',\n [BuiltInNetworkName.LineaSepolia]: 'https://sepolia.lineascan.build',\n [BuiltInNetworkName.LineaMainnet]: 'https://lineascan.build',\n} as const satisfies Record<InfuraNetworkType, string>;\nexport type BlockExplorerUrl =\n (typeof BlockExplorerUrl)[keyof typeof BlockExplorerUrl];\n\nexport const NetworkNickname = {\n [BuiltInNetworkName.Mainnet]: 'Mainnet',\n [BuiltInNetworkName.Goerli]: 'Goerli',\n [BuiltInNetworkName.Sepolia]: 'Sepolia',\n [BuiltInNetworkName.LineaGoerli]: 'Linea Goerli',\n [BuiltInNetworkName.LineaSepolia]: 'Linea Sepolia',\n [BuiltInNetworkName.LineaMainnet]: 'Linea Mainnet',\n} as const satisfies Record<InfuraNetworkType, string>;\nexport type NetworkNickname =\n (typeof NetworkNickname)[keyof typeof NetworkNickname];\n\n/**\n * Makes a selection of keys in a Record optional.\n *\n * @template Type - The Record that you want to operate on.\n * @template Key - The union of keys you want to make optional.\n */\n// TODO: Move to @metamask/utils\nexport type Partialize<Type, Key extends keyof Type> = Omit<Type, Key> &\n Partial<Pick<Type, Key>>;\n\n/** A context in which to execute a trace, in order to generate nested timings. */\nexport type TraceContext = unknown;\n\n/** Request to trace an operation. */\nexport type TraceRequest = {\n /** Additional data to include in the trace. */\n data?: Record<string, number | string | boolean>;\n\n /** Name of the operation. */\n name: string;\n\n /**\n * Unique identifier for the trace.\n * Required if starting a trace and not providing a callback.\n */\n id?: string;\n\n /** Trace context in which to execute the operation. */\n parentContext?: TraceContext;\n\n /** Additional tags to include in the trace to filter results. */\n tags?: Record<string, number | string | boolean>;\n};\n\n/** Callback that traces the performance of an operation. */\nexport type TraceCallback = <ReturnType>(\n /** Request to trace the performance of an operation. */\n request: TraceRequest,\n\n /**\n * Callback to trace.\n * Thrown errors will not be caught, but the trace will still be recorded.\n * @param context - The context in which the operation is running.\n */\n fn?: (context?: TraceContext) => ReturnType,\n) => Promise<ReturnType>;\n"]}
|