@0x/web3-wrapper
Advanced tools
Comparing version 5.0.0 to 6.0.0
[ | ||
{ | ||
"version": "6.0.0", | ||
"changes": [ | ||
{ | ||
"note": "Add support for EIP1193 providers & Web3.js providers >= 1.0-beta.38", | ||
"pr": 1627 | ||
}, | ||
{ | ||
"note": "Update provider params to type SupportedProvider which outlines all supported providers", | ||
"pr": 1627 | ||
} | ||
], | ||
"timestamp": 1551130135 | ||
}, | ||
{ | ||
"version": "5.0.0", | ||
@@ -4,0 +18,0 @@ "changes": [ |
@@ -8,2 +8,7 @@ <!-- | ||
## v6.0.0 - _February 25, 2019_ | ||
* Add support for EIP1193 providers & Web3.js providers >= 1.0-beta.38 (#1627) | ||
* Update provider params to type SupportedProvider which outlines all supported providers (#1627) | ||
## v5.0.0 - _February 9, 2019_ | ||
@@ -10,0 +15,0 @@ |
export { Web3Wrapper } from './web3_wrapper'; | ||
export { marshaller } from './marshaller'; | ||
export { AbiDecoder, DecodedCalldata } from '@0x/utils'; | ||
export { BlockParam, TxData, Provider, TransactionReceipt, Transaction, TraceParams, TransactionTrace, BlockWithoutTransactionData, LogEntry, FilterObject, CallData, TransactionReceiptWithDecodedLogs, BlockWithTransactionData, LogTopic, JSONRPCRequestPayload, TransactionReceiptStatus, DecodedLogArgs, StructLog, JSONRPCErrorCallback, BlockParamLiteral, ContractEventArg, DecodedLogEntry, LogEntryEvent, OpCode, TxDataPayable, JSONRPCResponsePayload, JSONRPCResponseError, RawLogEntry, DecodedLogEntryEvent, LogWithDecodedArgs, AbiDefinition, RawLog, FunctionAbi, EventAbi, EventParameter, MethodAbi, ConstructorAbi, FallbackAbi, DataItem, ConstructorStateMutability, StateMutability, } from 'ethereum-types'; | ||
export { BlockParam, TxData, SupportedProvider, TransactionReceipt, Transaction, TraceParams, TransactionTrace, BlockWithoutTransactionData, LogEntry, FilterObject, CallData, TransactionReceiptWithDecodedLogs, BlockWithTransactionData, LogTopic, JSONRPCRequestPayload, TransactionReceiptStatus, DecodedLogArgs, StructLog, BlockParamLiteral, ContractEventArg, DecodedLogEntry, LogEntryEvent, OpCode, TxDataPayable, JSONRPCErrorCallback, JSONRPCResponsePayload, JSONRPCResponseError, RawLogEntry, DecodedLogEntryEvent, LogWithDecodedArgs, AbiDefinition, RawLog, FunctionAbi, EventAbi, EventParameter, MethodAbi, ConstructorAbi, FallbackAbi, DataItem, ConstructorStateMutability, StateMutability, Web3JsProvider, GanacheProvider, EIP1193Provider, ZeroExProvider, EIP1193Event, Web3JsV1Provider, Web3JsV2Provider, Web3JsV3Provider, } from 'ethereum-types'; | ||
export { Web3WrapperErrors, NodeType, CallDataRPC, BlockWithoutTransactionDataRPC, BlockWithTransactionDataRPC, TransactionReceiptStatusRPC, TransactionReceiptRPC, LogEntryRPC, TransactionRPC, TxDataRPC, } from './types'; | ||
//# sourceMappingURL=index.d.ts.map |
import { AbiDecoder, BigNumber } from '@0x/utils'; | ||
import { BlockParam, BlockWithoutTransactionData, BlockWithTransactionData, CallData, FilterObject, JSONRPCRequestPayload, LogEntry, Provider, TraceParams, Transaction, TransactionReceipt, TransactionReceiptWithDecodedLogs, TransactionTrace, TxData } from 'ethereum-types'; | ||
import { BlockParam, BlockWithoutTransactionData, BlockWithTransactionData, CallData, FilterObject, JSONRPCRequestPayload, LogEntry, SupportedProvider, TraceParams, Transaction, TransactionReceipt, TransactionReceiptWithDecodedLogs, TransactionTrace, TxData } from 'ethereum-types'; | ||
import { NodeType } from './types'; | ||
@@ -14,2 +14,3 @@ /** | ||
private _provider; | ||
private readonly _supportedProvider; | ||
private readonly _txDefaults; | ||
@@ -57,3 +58,3 @@ private _jsonRpcRequestId; | ||
*/ | ||
constructor(provider: Provider, txDefaults?: Partial<TxData>); | ||
constructor(supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>); | ||
/** | ||
@@ -68,3 +69,3 @@ * Get the contract defaults set to the Web3Wrapper instance | ||
*/ | ||
getProvider(): Provider; | ||
getProvider(): SupportedProvider; | ||
/** | ||
@@ -74,3 +75,3 @@ * Update the used Web3 provider | ||
*/ | ||
setProvider(provider: Provider): void; | ||
setProvider(supportedProvider: SupportedProvider): void; | ||
/** | ||
@@ -77,0 +78,0 @@ * Check whether an address is available through the backing provider. This can be |
@@ -75,3 +75,3 @@ "use strict"; | ||
*/ | ||
function Web3Wrapper(provider, txDefaults) { | ||
function Web3Wrapper(supportedProvider, txDefaults) { | ||
/** | ||
@@ -81,11 +81,5 @@ * Flag to check if this instance is of type Web3Wrapper | ||
this.isZeroExWeb3Wrapper = true; | ||
assert_1.assert.isWeb3Provider('provider', provider); | ||
if (_.isUndefined(provider.sendAsync)) { | ||
// Web3@1.0 provider doesn't support synchronous http requests, | ||
// so it only has an async `send` method, instead of a `send` and `sendAsync` in web3@0.x.x` | ||
// We re-assign the send method so that Web3@1.0 providers work with @0x/web3-wrapper | ||
provider.sendAsync = provider.send; | ||
} | ||
this.abiDecoder = new utils_1.AbiDecoder([]); | ||
this._provider = provider; | ||
this._supportedProvider = supportedProvider; | ||
this._provider = utils_1.providerUtils.standardizeOrThrow(supportedProvider); | ||
this._txDefaults = txDefaults || {}; | ||
@@ -197,3 +191,3 @@ this._jsonRpcRequestId = 1; | ||
Web3Wrapper.prototype.getProvider = function () { | ||
return this._provider; | ||
return this._supportedProvider; | ||
}; | ||
@@ -204,4 +198,4 @@ /** | ||
*/ | ||
Web3Wrapper.prototype.setProvider = function (provider) { | ||
assert_1.assert.isWeb3Provider('provider', provider); | ||
Web3Wrapper.prototype.setProvider = function (supportedProvider) { | ||
var provider = utils_1.providerUtils.standardizeOrThrow(supportedProvider); | ||
this._provider = provider; | ||
@@ -208,0 +202,0 @@ }; |
{ | ||
"name": "@0x/web3-wrapper", | ||
"version": "5.0.0", | ||
"version": "6.0.0", | ||
"engines": { | ||
@@ -40,3 +40,2 @@ "node": ">=6.12" | ||
"@0x/tslint-config": "^3.0.0", | ||
"@types/ganache-core": "^2.1.2", | ||
"@types/lodash": "4.14.104", | ||
@@ -58,7 +57,7 @@ "chai": "^4.0.1", | ||
"dependencies": { | ||
"@0x/assert": "^2.0.3", | ||
"@0x/json-schemas": "^3.0.3", | ||
"@0x/typescript-typings": "^4.0.0", | ||
"@0x/utils": "^4.1.0", | ||
"ethereum-types": "^2.0.0", | ||
"@0x/assert": "^2.0.4", | ||
"@0x/json-schemas": "^3.0.4", | ||
"@0x/typescript-typings": "^4.1.0", | ||
"@0x/utils": "^4.2.0", | ||
"ethereum-types": "^2.1.0", | ||
"ethereumjs-util": "^5.1.1", | ||
@@ -71,3 +70,3 @@ "ethers": "~4.0.4", | ||
}, | ||
"gitHead": "e909faa3ef9cea5d9b4044b993251e98afdb0d19" | ||
"gitHead": "5934eb0559c7f25bde025a79554ba3632e63af2e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
15
2722
170227
36
Updated@0x/assert@^2.0.4
Updated@0x/json-schemas@^3.0.4
Updated@0x/utils@^4.2.0
Updatedethereum-types@^2.1.0