web3
Advanced tools
Comparing version 4.8.1-dev.e29deea.0 to 4.8.1-dev.ebbbf1e.0
@@ -51,4 +51,7 @@ import { Bytes, Transaction } from 'web3-types'; | ||
wallet: Wallet; | ||
privateKeyToAddress: (privateKey: Bytes) => string; | ||
privateKeyToPublicKey: (privateKey: Bytes, isCompressed: boolean) => string; | ||
parseAndValidatePrivateKey: (data: Bytes, ignoreLength?: boolean) => Uint8Array; | ||
}; | ||
personal: Personal; | ||
} |
@@ -56,3 +56,2 @@ "use strict"; | ||
const web3_utils_1 = require("web3-utils"); | ||
const web3_types_1 = require("web3-types"); | ||
const web3_errors_1 = require("web3-errors"); | ||
@@ -96,3 +95,4 @@ const abi_js_1 = __importDefault(require("./abi.js")); | ||
constructor(jsonInterface, addressOrOptionsOrContext, optionsOrContextOrReturnFormat, contextOrReturnFormat, returnFormat) { | ||
if ((0, web3_utils_1.isContractInitOptions)(addressOrOptionsOrContext) && (0, web3_utils_1.isContractInitOptions)(optionsOrContextOrReturnFormat)) { | ||
if ((0, web3_utils_1.isContractInitOptions)(addressOrOptionsOrContext) && | ||
(0, web3_utils_1.isContractInitOptions)(optionsOrContextOrReturnFormat)) { | ||
throw new web3_errors_1.InvalidMethodParamsError('Should not provide options at both 2nd and 3rd parameters'); | ||
@@ -103,5 +103,7 @@ } | ||
let context; | ||
let dataFormat = web3_types_1.DEFAULT_RETURN_FORMAT; | ||
let dataFormat; | ||
// add validation so its not a breaking change | ||
if (!(0, web3_utils_1.isNullish)(addressOrOptionsOrContext) && typeof addressOrOptionsOrContext !== 'object' && typeof addressOrOptionsOrContext !== 'string') { | ||
if (!(0, web3_utils_1.isNullish)(addressOrOptionsOrContext) && | ||
typeof addressOrOptionsOrContext !== 'object' && | ||
typeof addressOrOptionsOrContext !== 'string') { | ||
throw new web3_errors_1.InvalidMethodParamsError(); | ||
@@ -108,0 +110,0 @@ } |
@@ -18,3 +18,3 @@ /* | ||
// eslint-disable-next-line max-classes-per-file | ||
import { Web3Context, isSupportedProvider } from 'web3-core'; | ||
import { Web3Context, isSupportedProvider, } from 'web3-core'; | ||
import { Web3Eth, registeredSubscriptions } from 'web3-eth'; | ||
@@ -28,3 +28,2 @@ import Contract from 'web3-eth-contract'; | ||
import { isNullish, isDataFormat, isContractInitOptions } from 'web3-utils'; | ||
import { DEFAULT_RETURN_FORMAT } from 'web3-types'; | ||
import { InvalidMethodParamsError } from 'web3-errors'; | ||
@@ -68,3 +67,4 @@ import abi from './abi.js'; | ||
constructor(jsonInterface, addressOrOptionsOrContext, optionsOrContextOrReturnFormat, contextOrReturnFormat, returnFormat) { | ||
if (isContractInitOptions(addressOrOptionsOrContext) && isContractInitOptions(optionsOrContextOrReturnFormat)) { | ||
if (isContractInitOptions(addressOrOptionsOrContext) && | ||
isContractInitOptions(optionsOrContextOrReturnFormat)) { | ||
throw new InvalidMethodParamsError('Should not provide options at both 2nd and 3rd parameters'); | ||
@@ -75,5 +75,7 @@ } | ||
let context; | ||
let dataFormat = DEFAULT_RETURN_FORMAT; | ||
let dataFormat; | ||
// add validation so its not a breaking change | ||
if (!isNullish(addressOrOptionsOrContext) && typeof addressOrOptionsOrContext !== 'object' && typeof addressOrOptionsOrContext !== 'string') { | ||
if (!isNullish(addressOrOptionsOrContext) && | ||
typeof addressOrOptionsOrContext !== 'object' && | ||
typeof addressOrOptionsOrContext !== 'string') { | ||
throw new InvalidMethodParamsError(); | ||
@@ -80,0 +82,0 @@ } |
@@ -51,2 +51,5 @@ import { Bytes, Transaction } from 'web3-types'; | ||
wallet: Wallet; | ||
privateKeyToAddress: (privateKey: Bytes) => string; | ||
privateKeyToPublicKey: (privateKey: Bytes, isCompressed: boolean) => string; | ||
parseAndValidatePrivateKey: (data: Bytes, ignoreLength?: boolean) => Uint8Array; | ||
}; | ||
@@ -53,0 +56,0 @@ personal: Personal; |
{ | ||
"name": "web3", | ||
"version": "4.8.1-dev.e29deea.0+e29deea", | ||
"version": "4.8.1-dev.ebbbf1e.0+ebbbf1e", | ||
"description": "Ethereum JavaScript API", | ||
@@ -86,23 +86,23 @@ "main": "./lib/commonjs/index.js", | ||
"typescript": "^4.7.4", | ||
"web3-providers-ipc": "4.0.8-dev.e29deea.0+e29deea" | ||
"web3-providers-ipc": "4.0.8-dev.ebbbf1e.0+ebbbf1e" | ||
}, | ||
"dependencies": { | ||
"web3-core": "4.3.3-dev.e29deea.0+e29deea", | ||
"web3-errors": "1.1.5-dev.e29deea.0+e29deea", | ||
"web3-eth": "4.6.1-dev.e29deea.0+e29deea", | ||
"web3-eth-abi": "4.2.2-dev.e29deea.0+e29deea", | ||
"web3-eth-accounts": "4.1.3-dev.e29deea.0+e29deea", | ||
"web3-eth-contract": "4.4.1-dev.e29deea.0+e29deea", | ||
"web3-eth-ens": "4.2.1-dev.e29deea.0+e29deea", | ||
"web3-eth-iban": "4.0.8-dev.e29deea.0+e29deea", | ||
"web3-eth-personal": "4.0.9-dev.e29deea.0+e29deea", | ||
"web3-net": "4.0.8-dev.e29deea.0+e29deea", | ||
"web3-providers-http": "4.1.1-dev.e29deea.0+e29deea", | ||
"web3-providers-ws": "4.0.8-dev.e29deea.0+e29deea", | ||
"web3-rpc-methods": "1.2.1-dev.e29deea.0+e29deea", | ||
"web3-types": "1.6.1-dev.e29deea.0+e29deea", | ||
"web3-utils": "4.2.4-dev.e29deea.0+e29deea", | ||
"web3-validator": "2.0.6-dev.e29deea.0+e29deea" | ||
"web3-core": "4.3.3-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-errors": "1.1.5-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-eth": "4.6.1-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-eth-abi": "4.2.2-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-eth-accounts": "4.1.3-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-eth-contract": "4.4.1-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-eth-ens": "4.2.1-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-eth-iban": "4.0.8-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-eth-personal": "4.0.9-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-net": "4.0.8-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-providers-http": "4.1.1-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-providers-ws": "4.0.8-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-rpc-methods": "1.2.1-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-types": "1.6.1-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-utils": "4.2.4-dev.ebbbf1e.0+ebbbf1e", | ||
"web3-validator": "2.0.6-dev.ebbbf1e.0+ebbbf1e" | ||
}, | ||
"gitHead": "e29deeac2bb9705d70c839cd825bc34a93cde1b6" | ||
"gitHead": "ebbbf1e8bb2562708f89de431fc630ea7d665624" | ||
} |
@@ -93,4 +93,7 @@ /* | ||
wallet: Wallet; | ||
privateKeyToAddress: (privateKey: Bytes) => string; | ||
privateKeyToPublicKey: (privateKey: Bytes, isCompressed: boolean) => string; | ||
parseAndValidatePrivateKey: (data: Bytes, ignoreLength?: boolean) => Uint8Array; | ||
}; | ||
personal: Personal; | ||
} |
@@ -23,3 +23,3 @@ /* | ||
Web3SubscriptionConstructor, | ||
isSupportedProvider | ||
isSupportedProvider, | ||
} from 'web3-core'; | ||
@@ -41,3 +41,2 @@ import { Web3Eth, RegisteredSubscription, registeredSubscriptions } from 'web3-eth'; | ||
DataFormat, | ||
DEFAULT_RETURN_FORMAT | ||
} from 'web3-types'; | ||
@@ -127,5 +126,6 @@ import { InvalidMethodParamsError } from 'web3-errors'; | ||
public constructor(jsonInterface: Abi); | ||
public constructor(jsonInterface: Abi, | ||
public constructor( | ||
jsonInterface: Abi, | ||
addressOrOptionsOrContext?: Address | ContractInitOptions | Web3Context, | ||
); | ||
); | ||
public constructor( | ||
@@ -136,20 +136,25 @@ jsonInterface: Abi, | ||
); | ||
public constructor(jsonInterface: Abi, | ||
public constructor( | ||
jsonInterface: Abi, | ||
addressOrOptionsOrContext?: Address | ContractInitOptions, | ||
optionsOrContextOrReturnFormat?: ContractInitOptions, | ||
contextOrReturnFormat?: Web3Context | DataFormat, | ||
); | ||
public constructor(jsonInterface: Abi, | ||
); | ||
public constructor( | ||
jsonInterface: Abi, | ||
addressOrOptionsOrContext?: Address | ContractInitOptions, | ||
optionsOrContextOrReturnFormat?: ContractInitOptions, | ||
contextOrReturnFormat?: Web3Context | DataFormat, | ||
); | ||
public constructor(jsonInterface: Abi, | ||
); | ||
public constructor( | ||
jsonInterface: Abi, | ||
addressOrOptionsOrContext?: Address | ContractInitOptions, | ||
optionsOrContextOrReturnFormat?: ContractInitOptions, | ||
contextOrReturnFormat?: Web3Context | DataFormat, | ||
returnFormat?: DataFormat | ||
) | ||
{ | ||
if (isContractInitOptions(addressOrOptionsOrContext) && isContractInitOptions(optionsOrContextOrReturnFormat)) { | ||
returnFormat?: DataFormat, | ||
) { | ||
if ( | ||
isContractInitOptions(addressOrOptionsOrContext) && | ||
isContractInitOptions(optionsOrContextOrReturnFormat) | ||
) { | ||
throw new InvalidMethodParamsError( | ||
@@ -162,6 +167,10 @@ 'Should not provide options at both 2nd and 3rd parameters', | ||
let context: Web3ContextObject; | ||
let dataFormat: DataFormat = DEFAULT_RETURN_FORMAT; | ||
let dataFormat: DataFormat | undefined; | ||
// add validation so its not a breaking change | ||
if (!isNullish(addressOrOptionsOrContext) && typeof addressOrOptionsOrContext !== 'object' && typeof addressOrOptionsOrContext !== 'string') { | ||
if ( | ||
!isNullish(addressOrOptionsOrContext) && | ||
typeof addressOrOptionsOrContext !== 'object' && | ||
typeof addressOrOptionsOrContext !== 'string' | ||
) { | ||
throw new InvalidMethodParamsError(); | ||
@@ -173,3 +182,3 @@ } | ||
} | ||
if (isContractInitOptions(addressOrOptionsOrContext)){ | ||
if (isContractInitOptions(addressOrOptionsOrContext)) { | ||
options = addressOrOptionsOrContext as object; | ||
@@ -179,3 +188,3 @@ } else if (isContractInitOptions(optionsOrContextOrReturnFormat)) { | ||
} else { | ||
options = {} | ||
options = {}; | ||
} | ||
@@ -193,3 +202,3 @@ | ||
if (returnFormat){ | ||
if (returnFormat) { | ||
dataFormat = returnFormat; | ||
@@ -202,3 +211,3 @@ } else if (isDataFormat(optionsOrContextOrReturnFormat)) { | ||
super(jsonInterface,address, options, context, dataFormat) | ||
super(jsonInterface, address, options, context, dataFormat); | ||
super.subscribeToContextEvents(self); | ||
@@ -205,0 +214,0 @@ } |
Sorry, the diff of this file is too big to display
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
Sorry, the diff of this file is not supported yet
3313123
5927