Comparing version 4.8.0 to 4.8.1-dev.12c2515.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.0", | ||
"version": "4.8.1-dev.12c2515.0+12c2515", | ||
"description": "Ethereum JavaScript API", | ||
@@ -43,3 +43,3 @@ "main": "./lib/commonjs/index.js", | ||
"build:check": "node -e \"require('./lib')\"", | ||
"lint": "eslint --ext .js,.ts .", | ||
"lint": "eslint --cache --cache-strategy content --ext .ts .", | ||
"lint:fix": "eslint --fix --ext .js,.ts .", | ||
@@ -87,23 +87,23 @@ "format": "prettier --write '**/*'", | ||
"typescript": "^4.7.4", | ||
"web3-providers-ipc": "^4.0.7" | ||
"web3-providers-ipc": "4.0.8-dev.12c2515.0+12c2515" | ||
}, | ||
"dependencies": { | ||
"web3-core": "^4.3.2", | ||
"web3-errors": "^1.1.4", | ||
"web3-eth": "^4.6.0", | ||
"web3-eth-abi": "^4.2.1", | ||
"web3-eth-accounts": "^4.1.2", | ||
"web3-eth-contract": "^4.4.0", | ||
"web3-eth-ens": "^4.2.0", | ||
"web3-eth-iban": "^4.0.7", | ||
"web3-eth-personal": "^4.0.8", | ||
"web3-net": "^4.0.7", | ||
"web3-providers-http": "^4.1.0", | ||
"web3-providers-ws": "^4.0.7", | ||
"web3-rpc-methods": "^1.2.0", | ||
"web3-types": "^1.6.0", | ||
"web3-utils": "^4.2.3", | ||
"web3-validator": "^2.0.5" | ||
"web3-core": "4.3.3-dev.12c2515.0+12c2515", | ||
"web3-errors": "1.1.5-dev.12c2515.0+12c2515", | ||
"web3-eth": "4.6.1-dev.12c2515.0+12c2515", | ||
"web3-eth-abi": "4.2.2-dev.12c2515.0+12c2515", | ||
"web3-eth-accounts": "4.1.3-dev.12c2515.0+12c2515", | ||
"web3-eth-contract": "4.4.1-dev.12c2515.0+12c2515", | ||
"web3-eth-ens": "4.2.1-dev.12c2515.0+12c2515", | ||
"web3-eth-iban": "4.0.8-dev.12c2515.0+12c2515", | ||
"web3-eth-personal": "4.0.9-dev.12c2515.0+12c2515", | ||
"web3-net": "4.0.8-dev.12c2515.0+12c2515", | ||
"web3-providers-http": "4.1.1-dev.12c2515.0+12c2515", | ||
"web3-providers-ws": "4.0.8-dev.12c2515.0+12c2515", | ||
"web3-rpc-methods": "1.2.1-dev.12c2515.0+12c2515", | ||
"web3-types": "1.6.1-dev.12c2515.0+12c2515", | ||
"web3-utils": "4.2.4-dev.12c2515.0+12c2515", | ||
"web3-validator": "2.0.6-dev.12c2515.0+12c2515" | ||
}, | ||
"gitHead": "93eeccb96d7bcddfa49ed4c4848dbf55b825546c" | ||
"gitHead": "12c251589198129781d24d2327d67ead9f20b3e8" | ||
} |
@@ -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
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
3316541
5930
2
1
- Removed@adraffy/ens-normalize@1.11.0(transitive)
- Removed@ethereumjs/rlp@4.0.15.0.2(transitive)
- Removed@noble/curves@1.4.2(transitive)
- Removed@noble/hashes@1.4.0(transitive)
- Removed@scure/base@1.1.9(transitive)
- Removed@scure/bip32@1.4.0(transitive)
- Removed@scure/bip39@1.3.0(transitive)
- Removed@types/node@22.7.4(transitive)
- Removed@types/ws@8.5.3(transitive)
- Removedabitype@0.7.1(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcrc-32@1.2.2(transitive)
- Removedcross-fetch@4.0.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedethereum-cryptography@2.2.1(transitive)
- Removedeventemitter3@5.0.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedisomorphic-ws@5.0.0(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedtr46@0.0.3(transitive)
- Removedtypescript@5.6.2(transitive)
- Removedundici-types@6.19.8(transitive)
- Removedutil@0.12.5(transitive)
- Removedweb3-core@4.6.0(transitive)
- Removedweb3-errors@1.3.0(transitive)
- Removedweb3-eth@4.9.0(transitive)
- Removedweb3-eth-abi@4.2.4(transitive)
- Removedweb3-eth-accounts@4.2.1(transitive)
- Removedweb3-eth-contract@4.7.0(transitive)
- Removedweb3-eth-ens@4.4.0(transitive)
- Removedweb3-eth-iban@4.0.7(transitive)
- Removedweb3-eth-personal@4.1.0(transitive)
- Removedweb3-net@4.1.0(transitive)
- Removedweb3-providers-http@4.2.0(transitive)
- Removedweb3-providers-ipc@4.0.7(transitive)
- Removedweb3-providers-ws@4.0.8(transitive)
- Removedweb3-rpc-methods@1.3.0(transitive)
- Removedweb3-types@1.8.0(transitive)
- Removedweb3-utils@4.3.1(transitive)
- Removedweb3-validator@2.0.6(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
- Removedws@8.18.0(transitive)
- Removedzod@3.23.8(transitive)