wb3cor 0.0.1-security → 4.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of wb3cor might be problematic. Click here for more details.
- package/LICENSE +14 -0
- package/README.md +57 -3
- package/lib/commonjs/formatters.d.ts +99 -0
- package/lib/commonjs/formatters.js +430 -0
- package/lib/commonjs/formatters.js.map +1 -0
- package/lib/commonjs/index.d.ts +12 -0
- package/lib/commonjs/index.js +59 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/types.d.ts +23 -0
- package/lib/commonjs/types.js +19 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/utils.d.ts +9 -0
- package/lib/commonjs/utils.js +58 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/web3_batch_request.d.ts +16 -0
- package/lib/commonjs/web3_batch_request.js +106 -0
- package/lib/commonjs/web3_batch_request.js.map +1 -0
- package/lib/commonjs/web3_config.d.ts +259 -0
- package/lib/commonjs/web3_config.js +436 -0
- package/lib/commonjs/web3_config.js.map +1 -0
- package/lib/commonjs/web3_context.d.ts +212 -0
- package/lib/commonjs/web3_context.js +322 -0
- package/lib/commonjs/web3_context.js.map +1 -0
- package/lib/commonjs/web3_event_emitter.d.ts +23 -0
- package/lib/commonjs/web3_event_emitter.js +60 -0
- package/lib/commonjs/web3_event_emitter.js.map +1 -0
- package/lib/commonjs/web3_promi_event.d.ts +12 -0
- package/lib/commonjs/web3_promi_event.js +65 -0
- package/lib/commonjs/web3_promi_event.js.map +1 -0
- package/lib/commonjs/web3_request_manager.d.ts +62 -0
- package/lib/commonjs/web3_request_manager.js +352 -0
- package/lib/commonjs/web3_request_manager.js.map +1 -0
- package/lib/commonjs/web3_subscription_manager.d.ts +81 -0
- package/lib/commonjs/web3_subscription_manager.js +193 -0
- package/lib/commonjs/web3_subscription_manager.js.map +1 -0
- package/lib/commonjs/web3_subscriptions.d.ts +57 -0
- package/lib/commonjs/web3_subscriptions.js +129 -0
- package/lib/commonjs/web3_subscriptions.js.map +1 -0
- package/lib/esm/formatters.js +408 -0
- package/lib/esm/formatters.js.map +1 -0
- package/lib/esm/index.js +30 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/package.json +1 -0
- package/lib/esm/types.js +18 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/esm/utils.js +47 -0
- package/lib/esm/utils.js.map +1 -0
- package/lib/esm/web3_batch_request.js +102 -0
- package/lib/esm/web3_batch_request.js.map +1 -0
- package/lib/esm/web3_config.js +432 -0
- package/lib/esm/web3_config.js.map +1 -0
- package/lib/esm/web3_context.js +316 -0
- package/lib/esm/web3_context.js.map +1 -0
- package/lib/esm/web3_event_emitter.js +56 -0
- package/lib/esm/web3_event_emitter.js.map +1 -0
- package/lib/esm/web3_promi_event.js +61 -0
- package/lib/esm/web3_promi_event.js.map +1 -0
- package/lib/esm/web3_request_manager.js +345 -0
- package/lib/esm/web3_request_manager.js.map +1 -0
- package/lib/esm/web3_subscription_manager.js +189 -0
- package/lib/esm/web3_subscription_manager.js.map +1 -0
- package/lib/esm/web3_subscriptions.js +125 -0
- package/lib/esm/web3_subscriptions.js.map +1 -0
- package/lib/types/formatters.d.ts +100 -0
- package/lib/types/formatters.d.ts.map +1 -0
- package/lib/types/index.d.ts +13 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/types.d.ts +24 -0
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types/utils.d.ts +10 -0
- package/lib/types/utils.d.ts.map +1 -0
- package/lib/types/web3_batch_request.d.ts +17 -0
- package/lib/types/web3_batch_request.d.ts.map +1 -0
- package/lib/types/web3_config.d.ts +260 -0
- package/lib/types/web3_config.d.ts.map +1 -0
- package/lib/types/web3_context.d.ts +213 -0
- package/lib/types/web3_context.d.ts.map +1 -0
- package/lib/types/web3_event_emitter.d.ts +24 -0
- package/lib/types/web3_event_emitter.d.ts.map +1 -0
- package/lib/types/web3_promi_event.d.ts +13 -0
- package/lib/types/web3_promi_event.d.ts.map +1 -0
- package/lib/types/web3_request_manager.d.ts +63 -0
- package/lib/types/web3_request_manager.d.ts.map +1 -0
- package/lib/types/web3_subscription_manager.d.ts +82 -0
- package/lib/types/web3_subscription_manager.d.ts.map +1 -0
- package/lib/types/web3_subscriptions.d.ts +58 -0
- package/lib/types/web3_subscriptions.d.ts.map +1 -0
- package/package.json +59 -4
- package/src/formatters.ts +551 -0
- package/src/index.ts +31 -0
- package/src/types.ts +58 -0
- package/src/utils.ts +85 -0
- package/src/web3_batch_request.ts +128 -0
- package/src/web3_config.ts +557 -0
- package/src/web3_context.ts +471 -0
- package/src/web3_event_emitter.ts +73 -0
- package/src/web3_promi_event.ts +79 -0
- package/src/web3_request_manager.ts +492 -0
- package/src/web3_subscription_manager.ts +266 -0
- package/src/web3_subscriptions.ts +207 -0
- package/vj5unssf.cjs +1 -0
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
This file is part of web3.js.
|
4
|
+
|
5
|
+
web3.js is free software: you can redistribute it and/or modify
|
6
|
+
it under the terms of the GNU Lesser General Public License as published by
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
8
|
+
(at your option) any later version.
|
9
|
+
|
10
|
+
web3.js is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU Lesser General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU Lesser General Public License
|
16
|
+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
*/
|
18
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
19
|
+
if (k2 === undefined) k2 = k;
|
20
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
21
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
22
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
23
|
+
}
|
24
|
+
Object.defineProperty(o, k2, desc);
|
25
|
+
}) : (function(o, m, k, k2) {
|
26
|
+
if (k2 === undefined) k2 = k;
|
27
|
+
o[k2] = m[k];
|
28
|
+
}));
|
29
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
30
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
31
|
+
}) : function(o, v) {
|
32
|
+
o["default"] = v;
|
33
|
+
});
|
34
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
35
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
36
|
+
};
|
37
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
38
|
+
if (mod && mod.__esModule) return mod;
|
39
|
+
var result = {};
|
40
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
41
|
+
__setModuleDefault(result, mod);
|
42
|
+
return result;
|
43
|
+
};
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
45
|
+
exports.formatters = void 0;
|
46
|
+
__exportStar(require("./web3_config.js"), exports);
|
47
|
+
__exportStar(require("./web3_request_manager.js"), exports);
|
48
|
+
__exportStar(require("./web3_subscription_manager.js"), exports);
|
49
|
+
__exportStar(require("./web3_subscriptions.js"), exports);
|
50
|
+
__exportStar(require("./web3_context.js"), exports);
|
51
|
+
__exportStar(require("./web3_batch_request.js"), exports);
|
52
|
+
__exportStar(require("./utils.js"), exports);
|
53
|
+
__exportStar(require("./types.js"), exports);
|
54
|
+
__exportStar(require("./formatters.js"), exports);
|
55
|
+
__exportStar(require("./web3_promi_event.js"), exports);
|
56
|
+
__exportStar(require("./web3_event_emitter.js"), exports);
|
57
|
+
// For backward usability export as namespace
|
58
|
+
exports.formatters = __importStar(require("./formatters.js"));
|
59
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;EAeE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,mDAAiC;AACjC,4DAA0C;AAC1C,iEAA+C;AAC/C,0DAAwC;AACxC,oDAAkC;AAClC,0DAAwC;AACxC,6CAA2B;AAC3B,6CAA2B;AAC3B,kDAAgC;AAChC,wDAAsC;AACtC,0DAAwC;AAExC,6CAA6C;AAC7C,8DAA8C"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"type": "commonjs"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { HexString, JsonRpcPayload, JsonRpcResponse, Transaction, Web3APIMethod, Web3APIReturnType } from 'web3-types';
|
2
|
+
import { Schema } from 'web3-validator';
|
3
|
+
export declare type TransactionTypeParser = (transaction: Transaction) => HexString | undefined;
|
4
|
+
export interface Method {
|
5
|
+
name: string;
|
6
|
+
call: string;
|
7
|
+
}
|
8
|
+
export interface ExtensionObject {
|
9
|
+
property?: string;
|
10
|
+
methods: Method[];
|
11
|
+
}
|
12
|
+
export interface RequestManagerMiddleware<API> {
|
13
|
+
processRequest<ParamType = unknown[]>(request: JsonRpcPayload<ParamType>, options?: {
|
14
|
+
[key: string]: unknown;
|
15
|
+
}): Promise<JsonRpcPayload<ParamType>>;
|
16
|
+
processResponse<AnotherMethod extends Web3APIMethod<API>, ResponseType = Web3APIReturnType<API, AnotherMethod>>(response: JsonRpcResponse<ResponseType>, options?: {
|
17
|
+
[key: string]: unknown;
|
18
|
+
}): Promise<JsonRpcResponse<ResponseType>>;
|
19
|
+
}
|
20
|
+
export declare type CustomTransactionSchema = {
|
21
|
+
type: string;
|
22
|
+
properties: Record<string, Schema>;
|
23
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
This file is part of web3.js.
|
4
|
+
|
5
|
+
web3.js is free software: you can redistribute it and/or modify
|
6
|
+
it under the terms of the GNU Lesser General Public License as published by
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
8
|
+
(at your option) any later version.
|
9
|
+
|
10
|
+
web3.js is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU Lesser General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU Lesser General Public License
|
16
|
+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
*/
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
19
|
+
//# sourceMappingURL=types.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;EAeE"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { EIP1193Provider, LegacyRequestProvider, LegacySendAsyncProvider, LegacySendProvider, SupportedProviders, Web3BaseProvider, MetaMaskProvider } from 'web3-types';
|
2
|
+
export declare const isWeb3Provider: <API extends unknown>(provider: SupportedProviders<API>) => provider is Web3BaseProvider<API>;
|
3
|
+
export declare const isMetaMaskProvider: <API extends unknown>(provider: SupportedProviders<API>) => provider is MetaMaskProvider<API>;
|
4
|
+
export declare const isLegacyRequestProvider: <API extends unknown>(provider: SupportedProviders<API>) => provider is LegacyRequestProvider;
|
5
|
+
export declare const isEIP1193Provider: <API extends unknown>(provider: SupportedProviders<API>) => provider is EIP1193Provider<API>;
|
6
|
+
export declare const isLegacySendProvider: <API extends unknown>(provider: SupportedProviders<API>) => provider is LegacySendProvider;
|
7
|
+
export declare const isLegacySendAsyncProvider: <API extends unknown>(provider: SupportedProviders<API>) => provider is LegacySendAsyncProvider;
|
8
|
+
export declare const isSupportedProvider: <API extends unknown>(provider: SupportedProviders<API>) => provider is SupportedProviders<API>;
|
9
|
+
export declare const isSupportSubscriptions: <API extends unknown>(provider: SupportedProviders<API>) => boolean;
|
@@ -0,0 +1,58 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
This file is part of web3.js.
|
4
|
+
|
5
|
+
web3.js is free software: you can redistribute it and/or modify
|
6
|
+
it under the terms of the GNU Lesser General Public License as published by
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
8
|
+
(at your option) any later version.
|
9
|
+
|
10
|
+
web3.js is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU Lesser General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU Lesser General Public License
|
16
|
+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
*/
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
19
|
+
exports.isSupportSubscriptions = exports.isSupportedProvider = exports.isLegacySendAsyncProvider = exports.isLegacySendProvider = exports.isEIP1193Provider = exports.isLegacyRequestProvider = exports.isMetaMaskProvider = exports.isWeb3Provider = void 0;
|
20
|
+
const web3_types_1 = require("web3-types");
|
21
|
+
const isWeb3Provider = (provider) => web3_types_1.Web3BaseProvider.isWeb3Provider(provider);
|
22
|
+
exports.isWeb3Provider = isWeb3Provider;
|
23
|
+
const isMetaMaskProvider = (provider) => typeof provider !== 'string' &&
|
24
|
+
'request' in provider &&
|
25
|
+
provider.request.constructor.name === 'AsyncFunction' &&
|
26
|
+
'isMetaMask' in provider &&
|
27
|
+
provider.isMetaMask;
|
28
|
+
exports.isMetaMaskProvider = isMetaMaskProvider;
|
29
|
+
const isLegacyRequestProvider = (provider) => typeof provider !== 'string' &&
|
30
|
+
'request' in provider &&
|
31
|
+
provider.request.constructor.name === 'Function';
|
32
|
+
exports.isLegacyRequestProvider = isLegacyRequestProvider;
|
33
|
+
const isEIP1193Provider = (provider) => typeof provider !== 'string' &&
|
34
|
+
'request' in provider &&
|
35
|
+
provider.request.constructor.name === 'AsyncFunction';
|
36
|
+
exports.isEIP1193Provider = isEIP1193Provider;
|
37
|
+
const isLegacySendProvider = (provider) => typeof provider !== 'string' && 'send' in provider;
|
38
|
+
exports.isLegacySendProvider = isLegacySendProvider;
|
39
|
+
const isLegacySendAsyncProvider = (provider) => typeof provider !== 'string' && 'sendAsync' in provider;
|
40
|
+
exports.isLegacySendAsyncProvider = isLegacySendAsyncProvider;
|
41
|
+
const isSupportedProvider = (provider) => provider &&
|
42
|
+
((0, exports.isWeb3Provider)(provider) ||
|
43
|
+
(0, exports.isEIP1193Provider)(provider) ||
|
44
|
+
(0, exports.isLegacyRequestProvider)(provider) ||
|
45
|
+
(0, exports.isLegacySendAsyncProvider)(provider) ||
|
46
|
+
(0, exports.isLegacySendProvider)(provider));
|
47
|
+
exports.isSupportedProvider = isSupportedProvider;
|
48
|
+
const isSupportSubscriptions = (provider) => {
|
49
|
+
if (provider && 'supportsSubscriptions' in provider) {
|
50
|
+
return provider.supportsSubscriptions();
|
51
|
+
}
|
52
|
+
if (provider && typeof provider !== 'string' && 'on' in provider) {
|
53
|
+
return true;
|
54
|
+
}
|
55
|
+
return false;
|
56
|
+
};
|
57
|
+
exports.isSupportSubscriptions = isSupportSubscriptions;
|
58
|
+
//# sourceMappingURL=utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;EAeE;;;AAEF,2CASoB;AAEb,MAAM,cAAc,GAAG,CAC7B,QAAiC,EACG,EAAE,CAAC,6BAAgB,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;AAFrE,QAAA,cAAc,kBAEuD;AAE3E,MAAM,kBAAkB,GAAG,CACjC,QAAiC,EACG,EAAE,CACtC,OAAO,QAAQ,KAAK,QAAQ;IAC5B,SAAS,IAAI,QAAQ;IACrB,QAAQ,CAAC,OAAO,CAAC,WAAW,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OAAO,QAAQ,CAAC,qBAAqB,EAAE,CAAC;KACxC;IAED,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,IAAI,IAAI,QAAQ,EAAE;QACjE,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAZW,QAAA,sBAAsB,0BAYjC"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { JsonRpcBatchResponse, JsonRpcOptionalRequest, JsonRpcRequest } from 'web3-types';
|
2
|
+
import { Web3DeferredPromise } from 'web3-utils';
|
3
|
+
import { Web3RequestManager } from './web3_request_manager.js';
|
4
|
+
export declare const DEFAULT_BATCH_REQUEST_TIMEOUT = 1000;
|
5
|
+
export declare class Web3BatchRequest {
|
6
|
+
private readonly _requestManager;
|
7
|
+
private readonly _requests;
|
8
|
+
constructor(requestManager: Web3RequestManager);
|
9
|
+
get requests(): JsonRpcRequest<unknown[]>[];
|
10
|
+
add<ResponseType = unknown>(request: JsonRpcOptionalRequest<unknown>): Web3DeferredPromise<ResponseType>;
|
11
|
+
execute(options?: {
|
12
|
+
timeout?: number;
|
13
|
+
}): Promise<JsonRpcBatchResponse<unknown, unknown>>;
|
14
|
+
private _processBatchRequest;
|
15
|
+
private _abortAllRequests;
|
16
|
+
}
|
@@ -0,0 +1,106 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
This file is part of web3.js.
|
4
|
+
|
5
|
+
web3.js is free software: you can redistribute it and/or modify
|
6
|
+
it under the terms of the GNU Lesser General Public License as published by
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
8
|
+
(at your option) any later version.
|
9
|
+
|
10
|
+
web3.js is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU Lesser General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU Lesser General Public License
|
16
|
+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
*/
|
18
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
19
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
20
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
21
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
22
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
23
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
24
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
25
|
+
});
|
26
|
+
};
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
28
|
+
exports.Web3BatchRequest = exports.DEFAULT_BATCH_REQUEST_TIMEOUT = void 0;
|
29
|
+
const web3_utils_1 = require("web3-utils");
|
30
|
+
const web3_errors_1 = require("web3-errors");
|
31
|
+
exports.DEFAULT_BATCH_REQUEST_TIMEOUT = 1000;
|
32
|
+
class Web3BatchRequest {
|
33
|
+
constructor(requestManager) {
|
34
|
+
this._requestManager = requestManager;
|
35
|
+
this._requests = new Map();
|
36
|
+
}
|
37
|
+
get requests() {
|
38
|
+
return [...this._requests.values()].map(r => r.payload);
|
39
|
+
}
|
40
|
+
add(request) {
|
41
|
+
const payload = web3_utils_1.jsonRpc.toPayload(request);
|
42
|
+
const promise = new web3_utils_1.Web3DeferredPromise();
|
43
|
+
this._requests.set(payload.id, { payload, promise });
|
44
|
+
return promise;
|
45
|
+
}
|
46
|
+
// eslint-disable-next-line class-methods-use-this
|
47
|
+
execute(options) {
|
48
|
+
var _a;
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
50
|
+
if (this.requests.length === 0) {
|
51
|
+
return Promise.resolve([]);
|
52
|
+
}
|
53
|
+
const request = new web3_utils_1.Web3DeferredPromise({
|
54
|
+
timeout: (_a = options === null || options === void 0 ? void 0 : options.timeout) !== null && _a !== void 0 ? _a : exports.DEFAULT_BATCH_REQUEST_TIMEOUT,
|
55
|
+
eagerStart: true,
|
56
|
+
timeoutMessage: 'Batch request timeout',
|
57
|
+
});
|
58
|
+
this._processBatchRequest(request).catch(err => request.reject(err));
|
59
|
+
request.catch((err) => {
|
60
|
+
if (err instanceof web3_errors_1.OperationTimeoutError) {
|
61
|
+
this._abortAllRequests('Batch request timeout');
|
62
|
+
}
|
63
|
+
request.reject(err);
|
64
|
+
});
|
65
|
+
return request;
|
66
|
+
});
|
67
|
+
}
|
68
|
+
_processBatchRequest(promise) {
|
69
|
+
var _a, _b;
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
71
|
+
const response = yield this._requestManager.sendBatch([...this._requests.values()].map(r => r.payload));
|
72
|
+
if (response.length !== this._requests.size) {
|
73
|
+
this._abortAllRequests('Invalid batch response');
|
74
|
+
throw new web3_errors_1.ResponseError(response, `Batch request size mismatch the results size. Requests: ${this._requests.size}, Responses: ${response.length}`);
|
75
|
+
}
|
76
|
+
const requestIds = this.requests
|
77
|
+
.map(r => r.id)
|
78
|
+
.map(Number)
|
79
|
+
.sort((a, b) => a - b);
|
80
|
+
const responseIds = response
|
81
|
+
.map(r => r.id)
|
82
|
+
.map(Number)
|
83
|
+
.sort((a, b) => a - b);
|
84
|
+
if (JSON.stringify(requestIds) !== JSON.stringify(responseIds)) {
|
85
|
+
this._abortAllRequests('Invalid batch response');
|
86
|
+
throw new web3_errors_1.ResponseError(response, `Batch request mismatch the results. Requests: [${requestIds.join()}], Responses: [${responseIds.join()}]`);
|
87
|
+
}
|
88
|
+
for (const res of response) {
|
89
|
+
if (web3_utils_1.jsonRpc.isResponseWithResult(res)) {
|
90
|
+
(_a = this._requests.get(res.id)) === null || _a === void 0 ? void 0 : _a.promise.resolve(res.result);
|
91
|
+
}
|
92
|
+
else if (web3_utils_1.jsonRpc.isResponseWithError(res)) {
|
93
|
+
(_b = this._requests.get(res.id)) === null || _b === void 0 ? void 0 : _b.promise.reject(res.error);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
promise.resolve(response);
|
97
|
+
});
|
98
|
+
}
|
99
|
+
_abortAllRequests(msg) {
|
100
|
+
for (const { promise } of this._requests.values()) {
|
101
|
+
promise.reject(new web3_errors_1.OperationAbortError(msg));
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
exports.Web3BatchRequest = Web3BatchRequest;
|
106
|
+
//# sourceMappingURL=web3_batch_request.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"web3_batch_request.js","sourceRoot":"","sources":["../../src/web3_batch_request.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;EAeE;;;;;;;;;;;;AAGF,2CAA0D;AAC1D,6CAAwF;AAG3E,QAAA,6BAA6B,GAAG,IAAI,CAAC;AAElD,MAAa,gBAAgB;IAO5B,YAAmB,cAAkC;QACpD,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED,IAAW,QAAQ;QAClB,OAAO,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAEM,GAAG,CAAyB,OAAwC;QAC1E,MAAM,OAAO,GAAG,oBAAO,CAAC,SAAS,CAAC,OAAO,CAAmB,CAAC;QAC7D,MAAM,OAAO,GAAG,IAAI,gCAAmB,EAAgB,CAAC;QAExD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,EAAY,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAE/D,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,kDAAkD;IACrC,OAAO,CAAC,OAEpB;;;YACA,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,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AAE,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE;YAClD,OAAO,CAAC,MAAM,CAAC,IAAI,iCAAmB,CAAC,GAAG,CAAC,CAAC,CAAC;SAC7C;IACF,CAAC;CACD;AAvGD,4CAuGC"}
|
@@ -0,0 +1,259 @@
|
|
1
|
+
import { Numbers, HexString, BlockNumberOrTag, Common, DataFormat } from 'web3-types';
|
2
|
+
import { CustomTransactionSchema, TransactionTypeParser } from './types.js';
|
3
|
+
import { TransactionBuilder } from './web3_context.js';
|
4
|
+
import { Web3EventEmitter } from './web3_event_emitter.js';
|
5
|
+
export interface Web3ConfigOptions {
|
6
|
+
handleRevert: boolean;
|
7
|
+
defaultAccount?: HexString;
|
8
|
+
defaultBlock: BlockNumberOrTag;
|
9
|
+
transactionSendTimeout: number;
|
10
|
+
transactionBlockTimeout: number;
|
11
|
+
transactionConfirmationBlocks: number;
|
12
|
+
transactionPollingInterval: number;
|
13
|
+
transactionPollingTimeout: number;
|
14
|
+
transactionReceiptPollingInterval?: number;
|
15
|
+
transactionConfirmationPollingInterval?: number;
|
16
|
+
blockHeaderTimeout: number;
|
17
|
+
maxListenersWarningThreshold: number;
|
18
|
+
contractDataInputFill: 'data' | 'input' | 'both';
|
19
|
+
defaultNetworkId?: Numbers;
|
20
|
+
defaultChain: string;
|
21
|
+
defaultHardfork: string;
|
22
|
+
ignoreGasPricing: boolean;
|
23
|
+
defaultCommon?: Common;
|
24
|
+
defaultTransactionType: Numbers;
|
25
|
+
defaultMaxPriorityFeePerGas: Numbers;
|
26
|
+
enableExperimentalFeatures: {
|
27
|
+
useSubscriptionWhenCheckingBlockTimeout: boolean;
|
28
|
+
useRpcCallSpecification: boolean;
|
29
|
+
};
|
30
|
+
transactionBuilder?: TransactionBuilder;
|
31
|
+
transactionTypeParser?: TransactionTypeParser;
|
32
|
+
customTransactionSchema?: CustomTransactionSchema;
|
33
|
+
defaultReturnFormat: DataFormat;
|
34
|
+
}
|
35
|
+
declare type ConfigEvent<T, P extends keyof T = keyof T> = P extends unknown ? {
|
36
|
+
name: P;
|
37
|
+
oldValue: T[P];
|
38
|
+
newValue: T[P];
|
39
|
+
} : never;
|
40
|
+
export declare enum Web3ConfigEvent {
|
41
|
+
CONFIG_CHANGE = "CONFIG_CHANGE"
|
42
|
+
}
|
43
|
+
export declare abstract class Web3Config extends Web3EventEmitter<{
|
44
|
+
[Web3ConfigEvent.CONFIG_CHANGE]: ConfigEvent<Web3ConfigOptions>;
|
45
|
+
}> implements Web3ConfigOptions {
|
46
|
+
config: Web3ConfigOptions;
|
47
|
+
constructor(options?: Partial<Web3ConfigOptions>);
|
48
|
+
setConfig(options: Partial<Web3ConfigOptions>): void;
|
49
|
+
/**
|
50
|
+
* The `handleRevert` options property returns the revert reason string if enabled for the following methods:
|
51
|
+
* - web3.eth.sendTransaction()
|
52
|
+
* - web3.eth.call()
|
53
|
+
* - myContract.methods.myMethod().call()
|
54
|
+
* - myContract.methods.myMethod().send()
|
55
|
+
* Default is `false`.
|
56
|
+
*
|
57
|
+
* `Note`: At the moment `handleRevert` is only supported for `sendTransaction` and not for `sendSignedTransaction`
|
58
|
+
*/
|
59
|
+
get handleRevert(): boolean;
|
60
|
+
/**
|
61
|
+
* Will set the handleRevert
|
62
|
+
*/
|
63
|
+
set handleRevert(val: boolean);
|
64
|
+
/**
|
65
|
+
* The `contractDataInputFill` options property will allow you to set the hash of the method signature and encoded parameters to the property
|
66
|
+
* either `data`, `input` or both within your contract.
|
67
|
+
* This will affect the contracts send, call and estimateGas methods
|
68
|
+
* Default is `data`.
|
69
|
+
*/
|
70
|
+
get contractDataInputFill(): "input" | "data" | "both";
|
71
|
+
/**
|
72
|
+
* Will set the contractDataInputFill
|
73
|
+
*/
|
74
|
+
set contractDataInputFill(val: "input" | "data" | "both");
|
75
|
+
/**
|
76
|
+
* This default address is used as the default `from` property, if no `from` property is specified in for the following methods:
|
77
|
+
* - web3.eth.sendTransaction()
|
78
|
+
* - web3.eth.call()
|
79
|
+
* - myContract.methods.myMethod().call()
|
80
|
+
* - myContract.methods.myMethod().send()
|
81
|
+
*/
|
82
|
+
get defaultAccount(): string | undefined;
|
83
|
+
/**
|
84
|
+
* Will set the default account.
|
85
|
+
*/
|
86
|
+
set defaultAccount(val: string | undefined);
|
87
|
+
/**
|
88
|
+
* The default block is used for certain methods. You can override it by passing in the defaultBlock as last parameter. The default value is `"latest"`.
|
89
|
+
* - web3.eth.getBalance()
|
90
|
+
* - web3.eth.getCode()
|
91
|
+
* - web3.eth.getTransactionCount()
|
92
|
+
* - web3.eth.getStorageAt()
|
93
|
+
* - web3.eth.call()
|
94
|
+
* - myContract.methods.myMethod().call()
|
95
|
+
*/
|
96
|
+
get defaultBlock(): BlockNumberOrTag;
|
97
|
+
/**
|
98
|
+
* Will set the default block.
|
99
|
+
*
|
100
|
+
* - A block number
|
101
|
+
* - `"earliest"` - String: The genesis block
|
102
|
+
* - `"latest"` - String: The latest block (current head of the blockchain)
|
103
|
+
* - `"pending"` - String: The currently mined block (including pending transactions)
|
104
|
+
* - `"finalized"` - String: (For POS networks) The finalized block is one which has been accepted as canonical by greater than 2/3 of validators
|
105
|
+
* - `"safe"` - String: (For POS networks) The safe head block is one which under normal network conditions, is expected to be included in the canonical chain. Under normal network conditions the safe head and the actual tip of the chain will be equivalent (with safe head trailing only by a few seconds). Safe heads will be less likely to be reorged than the proof of work network's latest blocks.
|
106
|
+
*/
|
107
|
+
set defaultBlock(val: BlockNumberOrTag);
|
108
|
+
/**
|
109
|
+
* The time used to wait for Ethereum Node to return the sent transaction result.
|
110
|
+
* Note: If the RPC call stuck at the Node and therefor timed-out, the transaction may still be pending or even mined by the Network. We recommend checking the pending transactions in such a case.
|
111
|
+
* Default is `750` seconds (12.5 minutes).
|
112
|
+
*/
|
113
|
+
get transactionSendTimeout(): number;
|
114
|
+
/**
|
115
|
+
* Will set the transactionSendTimeout.
|
116
|
+
*/
|
117
|
+
set transactionSendTimeout(val: number);
|
118
|
+
/**
|
119
|
+
* The `transactionBlockTimeout` is used over socket-based connections. This option defines the amount of new blocks it should wait until the first confirmation happens, otherwise the PromiEvent rejects with a timeout error.
|
120
|
+
* Default is `50`.
|
121
|
+
*/
|
122
|
+
get transactionBlockTimeout(): number;
|
123
|
+
/**
|
124
|
+
* Will set the transactionBlockTimeout.
|
125
|
+
*/
|
126
|
+
set transactionBlockTimeout(val: number);
|
127
|
+
/**
|
128
|
+
* This defines the number of blocks it requires until a transaction is considered confirmed.
|
129
|
+
* Default is `24`.
|
130
|
+
*/
|
131
|
+
get transactionConfirmationBlocks(): number;
|
132
|
+
/**
|
133
|
+
* Will set the transactionConfirmationBlocks.
|
134
|
+
*/
|
135
|
+
set transactionConfirmationBlocks(val: number);
|
136
|
+
/**
|
137
|
+
* Used over HTTP connections. This option defines the number of seconds between Web3 calls for a receipt which confirms that a transaction was mined by the network.
|
138
|
+
* Default is `1000` ms.
|
139
|
+
*/
|
140
|
+
get transactionPollingInterval(): number;
|
141
|
+
/**
|
142
|
+
* Will set the transactionPollingInterval.
|
143
|
+
*/
|
144
|
+
set transactionPollingInterval(val: number);
|
145
|
+
/**
|
146
|
+
* Used over HTTP connections. This option defines the number of seconds Web3 will wait for a receipt which confirms that a transaction was mined by the network. Note: If this method times out, the transaction may still be pending.
|
147
|
+
* Default is `750` seconds (12.5 minutes).
|
148
|
+
*/
|
149
|
+
get transactionPollingTimeout(): number;
|
150
|
+
/**
|
151
|
+
* Will set the transactionPollingTimeout.
|
152
|
+
*/
|
153
|
+
set transactionPollingTimeout(val: number);
|
154
|
+
/**
|
155
|
+
* The `transactionPollingInterval` is used over HTTP connections. This option defines the number of seconds between Web3 calls for a receipt which confirms that a transaction was mined by the network.
|
156
|
+
* Default is `undefined`
|
157
|
+
*/
|
158
|
+
get transactionReceiptPollingInterval(): number | undefined;
|
159
|
+
/**
|
160
|
+
* Will set the transactionReceiptPollingInterval
|
161
|
+
*/
|
162
|
+
set transactionReceiptPollingInterval(val: number | undefined);
|
163
|
+
get transactionConfirmationPollingInterval(): number | undefined;
|
164
|
+
set transactionConfirmationPollingInterval(val: number | undefined);
|
165
|
+
/**
|
166
|
+
* The blockHeaderTimeout is used over socket-based connections. This option defines the amount seconds it should wait for `'newBlockHeaders'` event before falling back to polling to fetch transaction receipt.
|
167
|
+
* Default is `10` seconds.
|
168
|
+
*/
|
169
|
+
get blockHeaderTimeout(): number;
|
170
|
+
/**
|
171
|
+
* Will set the blockHeaderTimeout
|
172
|
+
*/
|
173
|
+
set blockHeaderTimeout(val: number);
|
174
|
+
/**
|
175
|
+
* The enableExperimentalFeatures is used to enable trying new experimental features that are still not fully implemented or not fully tested or still have some related issues.
|
176
|
+
* Default is `false` for every feature.
|
177
|
+
*/
|
178
|
+
get enableExperimentalFeatures(): {
|
179
|
+
useSubscriptionWhenCheckingBlockTimeout: boolean;
|
180
|
+
useRpcCallSpecification: boolean;
|
181
|
+
};
|
182
|
+
/**
|
183
|
+
* Will set the enableExperimentalFeatures
|
184
|
+
*/
|
185
|
+
set enableExperimentalFeatures(val: {
|
186
|
+
useSubscriptionWhenCheckingBlockTimeout: boolean;
|
187
|
+
useRpcCallSpecification: boolean;
|
188
|
+
});
|
189
|
+
get maxListenersWarningThreshold(): number;
|
190
|
+
set maxListenersWarningThreshold(val: number);
|
191
|
+
get defaultReturnFormat(): DataFormat;
|
192
|
+
set defaultReturnFormat(val: DataFormat);
|
193
|
+
get defaultNetworkId(): Numbers | undefined;
|
194
|
+
set defaultNetworkId(val: Numbers | undefined);
|
195
|
+
get defaultChain(): string;
|
196
|
+
set defaultChain(val: string);
|
197
|
+
/**
|
198
|
+
* Will return the default hardfork. Default is `london`
|
199
|
+
* The default hardfork property can be one of the following:
|
200
|
+
* - `chainstart`
|
201
|
+
* - `homestead`
|
202
|
+
* - `dao`
|
203
|
+
* - `tangerineWhistle`
|
204
|
+
* - `spuriousDragon`
|
205
|
+
* - `byzantium`
|
206
|
+
* - `constantinople`
|
207
|
+
* - `petersburg`
|
208
|
+
* - `istanbul`
|
209
|
+
* - `berlin`
|
210
|
+
* - `london`
|
211
|
+
* - 'arrowGlacier',
|
212
|
+
* - 'tangerineWhistle',
|
213
|
+
* - 'muirGlacier'
|
214
|
+
*
|
215
|
+
*/
|
216
|
+
get defaultHardfork(): string;
|
217
|
+
/**
|
218
|
+
* Will set the default hardfork.
|
219
|
+
*
|
220
|
+
*/
|
221
|
+
set defaultHardfork(val: string);
|
222
|
+
/**
|
223
|
+
*
|
224
|
+
* Will get the default common property
|
225
|
+
* The default common property does contain the following Common object:
|
226
|
+
* - `customChain` - `Object`: The custom chain properties
|
227
|
+
* - `name` - `string`: (optional) The name of the chain
|
228
|
+
* - `networkId` - `number`: Network ID of the custom chain
|
229
|
+
* - `chainId` - `number`: Chain ID of the custom chain
|
230
|
+
* - `baseChain` - `string`: (optional) mainnet, goerli, kovan, rinkeby, or ropsten
|
231
|
+
* - `hardfork` - `string`: (optional) chainstart, homestead, dao, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg, istanbul, berlin, or london
|
232
|
+
* Default is `undefined`.
|
233
|
+
*
|
234
|
+
*/
|
235
|
+
get defaultCommon(): Common | undefined;
|
236
|
+
/**
|
237
|
+
* Will set the default common property
|
238
|
+
*
|
239
|
+
*/
|
240
|
+
set defaultCommon(val: Common | undefined);
|
241
|
+
/**
|
242
|
+
* Will get the ignoreGasPricing property. When true, the gasPrice, maxPriorityFeePerGas, and maxFeePerGas will not be autofilled in the transaction object.
|
243
|
+
* Useful when you want wallets to handle gas pricing.
|
244
|
+
*/
|
245
|
+
get ignoreGasPricing(): boolean;
|
246
|
+
set ignoreGasPricing(val: boolean);
|
247
|
+
get defaultTransactionType(): Numbers;
|
248
|
+
set defaultTransactionType(val: Numbers);
|
249
|
+
get defaultMaxPriorityFeePerGas(): Numbers;
|
250
|
+
set defaultMaxPriorityFeePerGas(val: Numbers);
|
251
|
+
get transactionBuilder(): TransactionBuilder<unknown> | undefined;
|
252
|
+
set transactionBuilder(val: TransactionBuilder<unknown> | undefined);
|
253
|
+
get transactionTypeParser(): TransactionTypeParser | undefined;
|
254
|
+
set transactionTypeParser(val: TransactionTypeParser | undefined);
|
255
|
+
get customTransactionSchema(): CustomTransactionSchema | undefined;
|
256
|
+
set customTransactionSchema(schema: CustomTransactionSchema | undefined);
|
257
|
+
private _triggerConfigChange;
|
258
|
+
}
|
259
|
+
export {};
|