@venly/web3-provider
Advanced tools
Comparing version 3.3.0-develop.0 to 3.3.0-develop.1
import { PollingBlockTracker } from 'eth-block-tracker'; | ||
export default function createJsonRpcClient({ rpcUrl, chainId }: any): { | ||
networkMiddleware: import("json-rpc-engine").JsonRpcMiddleware<unknown, unknown>; | ||
export default function createJsonRpcClient({ rpcUrl, chainId, venlyConnect }: any): { | ||
networkMiddleware: import("@metamask/json-rpc-engine").JsonRpcMiddleware<import("@metamask/utils").JsonRpcParams, import("@metamask/utils").Json>; | ||
blockTracker: PollingBlockTracker; | ||
}; |
@@ -12,4 +12,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const json_rpc_engine_1 = require("json-rpc-engine"); | ||
const json_rpc_engine_1 = require("@metamask/json-rpc-engine"); | ||
const eth_json_rpc_middleware_1 = require("@metamask/eth-json-rpc-middleware"); | ||
const createFetchMiddleware_1 = require("./createFetchMiddleware"); | ||
const eth_json_rpc_provider_1 = require("@metamask/eth-json-rpc-provider"); | ||
@@ -19,5 +20,5 @@ const eth_block_tracker_1 = require("eth-block-tracker"); | ||
const SECOND = MILLISECOND * 1000; | ||
function createJsonRpcClient({ rpcUrl, chainId }) { | ||
function createJsonRpcClient({ rpcUrl, chainId, venlyConnect }) { | ||
const blockTrackerOpts = {}; | ||
const fetchMiddleware = (0, eth_json_rpc_middleware_1.createFetchMiddleware)({ btoa, fetch, rpcUrl }); | ||
const fetchMiddleware = (0, createFetchMiddleware_1.createFetchMiddleware)({ btoa, fetch, rpcUrl, venlyConnect }); | ||
const blockProvider = (0, eth_json_rpc_provider_1.providerFromMiddleware)(fetchMiddleware); | ||
@@ -24,0 +25,0 @@ const blockTracker = new eth_block_tracker_1.PollingBlockTracker(Object.assign(Object.assign({}, blockTrackerOpts), { provider: blockProvider })); |
@@ -25,3 +25,3 @@ "use strict"; | ||
const types_1 = require("./types"); | ||
const json_rpc_engine_1 = require("json-rpc-engine"); | ||
const json_rpc_engine_1 = require("@metamask/json-rpc-engine"); | ||
const eth_json_rpc_provider_1 = require("@metamask/eth-json-rpc-provider"); | ||
@@ -125,3 +125,3 @@ const providerFromEngine_1 = __importDefault(require("./providerFromEngine")); | ||
const chainId = types_1.CHAIN_IDS[options.secretType][options.environment]; | ||
const { networkMiddleware, blockTracker } = (0, createJsonRpcClient_1.default)({ rpcUrl, chainId }); | ||
const { networkMiddleware, blockTracker } = (0, createJsonRpcClient_1.default)({ rpcUrl, chainId, venlyConnect: this.venlyController.venlyConnect }); | ||
this._blockTracker = blockTracker; | ||
@@ -128,0 +128,0 @@ const networkProvider = (0, eth_json_rpc_provider_1.providerFromMiddleware)(networkMiddleware); |
@@ -14,3 +14,3 @@ "use strict"; | ||
const index_1 = require("./index"); | ||
const json_rpc_engine_1 = require("json-rpc-engine"); | ||
const json_rpc_engine_1 = require("@metamask/json-rpc-engine"); | ||
const eth_json_rpc_middleware_1 = require("@metamask/eth-json-rpc-middleware"); | ||
@@ -17,0 +17,0 @@ require('isomorphic-fetch'); |
@@ -1,1 +0,1 @@ | ||
export default function createVenlyMiddleware({ getAccounts, processDecryptMessage, processEncryptionPublicKey, processEthSignMessage, processPersonalMessage, processTransaction, processSignTransaction, processTypedMessage, processTypedMessageV3, processTypedMessageV4, getPendingNonce, getTransactionByHash, getPendingTransactions, changeSecretType }: any): import("json-rpc-engine").JsonRpcMiddleware<unknown, unknown>; | ||
export default function createVenlyMiddleware({ getAccounts, processDecryptMessage, processEncryptionPublicKey, processEthSignMessage, processPersonalMessage, processTransaction, processSignTransaction, processTypedMessage, processTypedMessageV3, processTypedMessageV4, getPendingNonce, getTransactionByHash, getPendingTransactions, changeSecretType }: any): import("@metamask/json-rpc-engine").JsonRpcMiddleware<import("@metamask/utils").JsonRpcParams, import("@metamask/utils").Json>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const json_rpc_engine_1 = require("json-rpc-engine"); | ||
const json_rpc_engine_1 = require("@metamask/json-rpc-engine"); | ||
const eth_json_rpc_middleware_1 = require("@metamask/eth-json-rpc-middleware"); | ||
@@ -5,0 +5,0 @@ const pending_1 = require("./pending"); |
import SafeEventEmitter from '@metamask/safe-event-emitter'; | ||
import type { JsonRpcEngine, JsonRpcRequest } from 'json-rpc-engine'; | ||
import type { JsonRpcEngine } from '@metamask/json-rpc-engine'; | ||
import type { JsonRpcRequest } from '@metamask/utils'; | ||
/** | ||
@@ -21,3 +22,3 @@ * Construct an Ethereum provider from the given JSON-RPC engine. | ||
}); | ||
request: (req: JsonRpcRequest<unknown>) => Promise<unknown>; | ||
request: (req: JsonRpcRequest) => Promise<unknown>; | ||
/** | ||
@@ -29,3 +30,3 @@ * Send a provider request asynchronously. | ||
*/ | ||
sendAsync: (req: JsonRpcRequest<unknown>, callback: (error: unknown, providerRes?: any) => void) => void; | ||
sendAsync: (req: JsonRpcRequest, callback: (error: unknown, providerRes?: any) => void) => void; | ||
/** | ||
@@ -41,4 +42,4 @@ * Send a provider request asynchronously. | ||
*/ | ||
send: (req: JsonRpcRequest<unknown>, callback: (error: unknown, providerRes?: any) => void) => void; | ||
send: (req: JsonRpcRequest, callback: (error: unknown, providerRes?: any) => void) => void; | ||
} | ||
export {}; |
@@ -10,1 +10,3 @@ export declare const CHAIN_IDS: { | ||
}; | ||
export type BlockData = string | string[]; | ||
export type Block = Record<string, BlockData>; |
export declare function formatTxMetaForRpcResult(txMeta: any): any; | ||
/** | ||
* Wait the specified number of milliseconds. | ||
* | ||
* @param duration - The number of milliseconds to wait. | ||
* @returns A promise that resolves after the specified amount of time. | ||
*/ | ||
export declare function timeout(duration: number): Promise<void>; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatTxMetaForRpcResult = void 0; | ||
exports.timeout = exports.formatTxMetaForRpcResult = void 0; | ||
const TRANSACTION_ENVELOPE_TYPES = { | ||
@@ -41,1 +50,13 @@ LEGACY: '0x0', | ||
exports.formatTxMetaForRpcResult = formatTxMetaForRpcResult; | ||
/** | ||
* Wait the specified number of milliseconds. | ||
* | ||
* @param duration - The number of milliseconds to wait. | ||
* @returns A promise that resolves after the specified amount of time. | ||
*/ | ||
function timeout(duration) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return new Promise((resolve) => setTimeout(resolve, duration)); | ||
}); | ||
} | ||
exports.timeout = timeout; |
{ | ||
"name": "@venly/web3-provider", | ||
"version": "3.3.0-develop.0", | ||
"version": "3.3.0-develop.1", | ||
"description": "Venly enabled Web3 Provider for the web", | ||
@@ -41,18 +41,27 @@ "main": "dist/index.js", | ||
"@ethersproject/bignumber": "^5.7.0", | ||
"@metamask/eth-json-rpc-middleware": "^11.0.0", | ||
"@metamask/eth-json-rpc-provider": "^1.0.0", | ||
"@venly/connect": "^2.2.1", | ||
"eth-block-tracker": "^7.0.0", | ||
"eth-json-rpc-filters": "^6.0.0", | ||
"json-rpc-engine": "^6.1.0" | ||
"@metamask/eth-json-rpc-middleware": "^12.0.0", | ||
"@metamask/eth-json-rpc-provider": "^2.1.0", | ||
"@metamask/json-rpc-engine": "^7.1.1", | ||
"@metamask/rpc-errors": "^6.0.0", | ||
"@metamask/utils": "^8.1.0", | ||
"@venly/connect": "^2.2.3", | ||
"eth-block-tracker": "^8.0.0", | ||
"eth-json-rpc-filters": "^6.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.0", | ||
"assert": "^2.1.0", | ||
"browserify-zlib": "^0.2.0", | ||
"buffer": "^6.0.3", | ||
"https-browserify": "^1.0.0", | ||
"isomorphic-fetch": "^3.0.0", | ||
"jest": "^29.5.0", | ||
"process": "^0.11.10", | ||
"stream-browserify": "^3.0.0", | ||
"stream-http": "^3.2.0", | ||
"ts-jest": "^29.0.5", | ||
"ts-loader": "^9.4.2", | ||
"typescript": "^4.9.5", | ||
"url": "^0.11.3", | ||
"util": "^0.12.5", | ||
"webpack": "^5.75.0", | ||
@@ -59,0 +68,0 @@ "webpack-cli": "^5.0.1" |
/*! | ||
* The buffer module from node.js, for the browser. | ||
* | ||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> | ||
* @license MIT | ||
*/ | ||
/*! | ||
* The buffer module from node.js, for the browser. | ||
* | ||
* @author Feross Aboukhadijeh <https://feross.org> | ||
@@ -8,10 +15,11 @@ * @license MIT | ||
/*! Case - v1.6.2 - 2020-03-24 | ||
* Copyright (c) 2020 Nathan Bubna; Licensed MIT, GPL */ | ||
/*! https://mths.be/punycode v1.4.1 by @mathias */ | ||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ | ||
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ | ||
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ | ||
/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ | ||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ | ||
@@ -18,0 +26,0 @@ /** |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
804201
29
1403
9
17
1
12
+ Added@metamask/rpc-errors@^6.0.0
+ Added@metamask/utils@^8.1.0
+ Added@metamask/abi-utils@2.0.4(transitive)
+ Added@metamask/eth-block-tracker@9.0.3(transitive)
+ Added@metamask/eth-json-rpc-middleware@12.1.2(transitive)
+ Added@metamask/eth-json-rpc-provider@2.3.23.0.2(transitive)
+ Added@metamask/eth-sig-util@7.0.3(transitive)
+ Added@metamask/json-rpc-engine@8.0.2(transitive)
+ Addedeth-block-tracker@8.1.0(transitive)
+ Addedklona@2.0.6(transitive)
- Removedjson-rpc-engine@^6.1.0
- Removed@metamask/abi-utils@1.2.0(transitive)
- Removed@metamask/eth-json-rpc-middleware@11.0.2(transitive)
- Removed@metamask/eth-json-rpc-provider@1.0.1(transitive)
- Removed@metamask/eth-sig-util@6.0.2(transitive)
- Removed@metamask/utils@3.6.05.0.2(transitive)
- Removedclone@2.1.2(transitive)
- Removedeth-block-tracker@7.1.0(transitive)
- Removedethjs-util@0.1.6(transitive)
- Removedis-hex-prefixed@1.0.0(transitive)
- Removedpify@3.0.0(transitive)
- Removedstrip-hex-prefix@1.0.0(transitive)
- Removedsuperstruct@1.0.4(transitive)
- Removedtweetnacl-util@0.15.1(transitive)
Updated@venly/connect@^2.2.3
Updatedeth-block-tracker@^8.0.0
Updatedeth-json-rpc-filters@^6.0.1