web3-types
Advanced tools
Comparing version 1.2.0 to 1.2.1-dev.3060994.0
@@ -14,3 +14,3 @@ import { Address } from './eth_types.js'; | ||
[key: string]: unknown; | ||
name?: string; | ||
name: string; | ||
type: string; | ||
@@ -17,0 +17,0 @@ } |
@@ -5,2 +5,3 @@ import { Address, Uint } from './eth_types.js'; | ||
import { EthExecutionAPI } from './apis/eth_execution_api.js'; | ||
import { AbiFragment, ContractAbi } from './eth_abi_types.js'; | ||
export interface ContractInitOptions { | ||
@@ -59,1 +60,76 @@ /** | ||
} | ||
export declare type ContractAbiWithSignature = ReadonlyArray<AbiFragment & { | ||
signature: HexString; | ||
}>; | ||
export interface ContractOptions { | ||
/** | ||
* The maximum gas provided for a transaction (gas limit). | ||
*/ | ||
readonly gas?: Uint; | ||
/** | ||
* The gas price in wei to use for transactions. | ||
*/ | ||
readonly gasPrice?: Uint; | ||
/** | ||
* The address transactions should be made from. | ||
*/ | ||
readonly from?: Address; | ||
/** | ||
* The byte code of the contract. Used when the contract gets {@link Contract.deploy | deployed} | ||
*/ | ||
readonly input?: Bytes; | ||
/** | ||
* The byte code of the contract. Used when the contract gets {@link Contract.deploy | deployed} | ||
*/ | ||
readonly data?: Bytes; | ||
/** | ||
* The {@doclink glossary/json_interface | json interface} object derived from the [ABI](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) of this contract. | ||
* | ||
* Re-setting this will regenerate the methods and events of the contract instance. | ||
* | ||
* ```ts | ||
* myContract.options.jsonInterface; | ||
* > [{ | ||
* "type":"function", | ||
* "name":"foo", | ||
* "inputs": [{"name":"a","type":"uint256"}], | ||
* "outputs": [{"name":"b","type":"address"}], | ||
* "signature": "0x...", | ||
* },{ | ||
* "type":"event", | ||
* "name":"Event", | ||
* "inputs": [{"name":"a","type":"uint256","indexed":true},{"name":"b","type":"bytes32","indexed":false}], | ||
* "signature": "0x...", | ||
* }] | ||
* | ||
* // Set a new ABI interface | ||
* // Note: the "signature" of every function and event's ABI is not needed to be provided when assigning. | ||
* // It will be calculated and set automatically inside the setter. | ||
* myContract.options.jsonInterface = [...]; | ||
* ``` | ||
*/ | ||
get jsonInterface(): ContractAbiWithSignature; | ||
set jsonInterface(value: ContractAbi); | ||
/** | ||
* The address used for this contract instance. All transactions generated by web3.js from this contract will contain this address as the `to`. | ||
* | ||
* The address will be stored in lowercase. | ||
* | ||
* ```ts | ||
* myContract.options.address; | ||
* > '0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae' | ||
* | ||
* // set a new address | ||
* myContract.options.address = '0x1234FFDD...'; | ||
* ``` | ||
*/ | ||
address?: Address; | ||
/** | ||
* The max priority fee per gas to use for transactions. | ||
*/ | ||
maxPriorityFeePerGas?: Uint; | ||
/** | ||
* The max fee per gas to use for transactions. | ||
*/ | ||
maxFeePerGas?: Uint; | ||
} |
@@ -259,2 +259,20 @@ import { Bytes, HexString, Numbers } from './primitives_types.js'; | ||
} | ||
export interface EventLog { | ||
readonly event: string; | ||
readonly id?: string; | ||
readonly logIndex?: bigint | number | string; | ||
readonly transactionIndex?: bigint | number | string; | ||
readonly transactionHash?: HexString32Bytes; | ||
readonly blockHash?: HexString32Bytes; | ||
readonly blockNumber?: bigint | number | string; | ||
readonly address: string; | ||
readonly topics: HexString[]; | ||
readonly data: HexString; | ||
readonly raw?: { | ||
data: string; | ||
topics: unknown[]; | ||
}; | ||
readonly returnValues: Record<string, unknown>; | ||
readonly signature?: HexString; | ||
} | ||
export interface TransactionReceiptBase<numberType, hashByteType, logsBloomByteType, logsType> { | ||
@@ -276,2 +294,5 @@ readonly transactionHash: hashByteType; | ||
readonly type?: numberType; | ||
events?: { | ||
[key: string]: EventLog; | ||
}; | ||
} | ||
@@ -278,0 +299,0 @@ export declare type TransactionReceipt = TransactionReceiptBase<Numbers, Bytes, Bytes, Log>; |
@@ -14,3 +14,3 @@ import { Address } from './eth_types.js'; | ||
[key: string]: unknown; | ||
name?: string; | ||
name: string; | ||
type: string; | ||
@@ -17,0 +17,0 @@ } |
@@ -5,2 +5,3 @@ import { Address, Uint } from './eth_types.js'; | ||
import { EthExecutionAPI } from './apis/eth_execution_api.js'; | ||
import { AbiFragment, ContractAbi } from './eth_abi_types.js'; | ||
export interface ContractInitOptions { | ||
@@ -59,2 +60,77 @@ /** | ||
} | ||
export declare type ContractAbiWithSignature = ReadonlyArray<AbiFragment & { | ||
signature: HexString; | ||
}>; | ||
export interface ContractOptions { | ||
/** | ||
* The maximum gas provided for a transaction (gas limit). | ||
*/ | ||
readonly gas?: Uint; | ||
/** | ||
* The gas price in wei to use for transactions. | ||
*/ | ||
readonly gasPrice?: Uint; | ||
/** | ||
* The address transactions should be made from. | ||
*/ | ||
readonly from?: Address; | ||
/** | ||
* The byte code of the contract. Used when the contract gets {@link Contract.deploy | deployed} | ||
*/ | ||
readonly input?: Bytes; | ||
/** | ||
* The byte code of the contract. Used when the contract gets {@link Contract.deploy | deployed} | ||
*/ | ||
readonly data?: Bytes; | ||
/** | ||
* The {@doclink glossary/json_interface | json interface} object derived from the [ABI](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) of this contract. | ||
* | ||
* Re-setting this will regenerate the methods and events of the contract instance. | ||
* | ||
* ```ts | ||
* myContract.options.jsonInterface; | ||
* > [{ | ||
* "type":"function", | ||
* "name":"foo", | ||
* "inputs": [{"name":"a","type":"uint256"}], | ||
* "outputs": [{"name":"b","type":"address"}], | ||
* "signature": "0x...", | ||
* },{ | ||
* "type":"event", | ||
* "name":"Event", | ||
* "inputs": [{"name":"a","type":"uint256","indexed":true},{"name":"b","type":"bytes32","indexed":false}], | ||
* "signature": "0x...", | ||
* }] | ||
* | ||
* // Set a new ABI interface | ||
* // Note: the "signature" of every function and event's ABI is not needed to be provided when assigning. | ||
* // It will be calculated and set automatically inside the setter. | ||
* myContract.options.jsonInterface = [...]; | ||
* ``` | ||
*/ | ||
get jsonInterface(): ContractAbiWithSignature; | ||
set jsonInterface(value: ContractAbi); | ||
/** | ||
* The address used for this contract instance. All transactions generated by web3.js from this contract will contain this address as the `to`. | ||
* | ||
* The address will be stored in lowercase. | ||
* | ||
* ```ts | ||
* myContract.options.address; | ||
* > '0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae' | ||
* | ||
* // set a new address | ||
* myContract.options.address = '0x1234FFDD...'; | ||
* ``` | ||
*/ | ||
address?: Address; | ||
/** | ||
* The max priority fee per gas to use for transactions. | ||
*/ | ||
maxPriorityFeePerGas?: Uint; | ||
/** | ||
* The max fee per gas to use for transactions. | ||
*/ | ||
maxFeePerGas?: Uint; | ||
} | ||
//# sourceMappingURL=eth_contract_types.d.ts.map |
@@ -259,2 +259,20 @@ import { Bytes, HexString, Numbers } from './primitives_types.js'; | ||
} | ||
export interface EventLog { | ||
readonly event: string; | ||
readonly id?: string; | ||
readonly logIndex?: bigint | number | string; | ||
readonly transactionIndex?: bigint | number | string; | ||
readonly transactionHash?: HexString32Bytes; | ||
readonly blockHash?: HexString32Bytes; | ||
readonly blockNumber?: bigint | number | string; | ||
readonly address: string; | ||
readonly topics: HexString[]; | ||
readonly data: HexString; | ||
readonly raw?: { | ||
data: string; | ||
topics: unknown[]; | ||
}; | ||
readonly returnValues: Record<string, unknown>; | ||
readonly signature?: HexString; | ||
} | ||
export interface TransactionReceiptBase<numberType, hashByteType, logsBloomByteType, logsType> { | ||
@@ -276,2 +294,5 @@ readonly transactionHash: hashByteType; | ||
readonly type?: numberType; | ||
events?: { | ||
[key: string]: EventLog; | ||
}; | ||
} | ||
@@ -278,0 +299,0 @@ export declare type TransactionReceipt = TransactionReceiptBase<Numbers, Bytes, Bytes, Log>; |
{ | ||
"name": "web3-types", | ||
"version": "1.2.0", | ||
"version": "1.2.1-dev.3060994.0+3060994", | ||
"description": "Provide the common data structures and interfaces for web3 modules.", | ||
@@ -28,3 +28,3 @@ "main": "./lib/commonjs/index.js", | ||
"prebuild": "yarn clean", | ||
"build": "yarn build:cjs & yarn build:esm & yarn build:types", | ||
"build": "concurrently --kill-others-on-fail \"yarn:build:*(!check)\"", | ||
"build:cjs": "tsc --build tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./lib/commonjs/package.json", | ||
@@ -60,3 +60,3 @@ "build:esm": "tsc --build tsconfig.esm.json && echo '{\"type\": \"module\"}' > ./lib/esm/package.json", | ||
}, | ||
"gitHead": "2543fd184bc354f3fdb61bb021c41311f03b683f" | ||
"gitHead": "3060994b7264998050145d2ae87f2f843262a776" | ||
} |
@@ -66,3 +66,3 @@ /* | ||
[key: string]: unknown; | ||
name?: string; | ||
name: string; | ||
type: string; | ||
@@ -69,0 +69,0 @@ } |
@@ -22,2 +22,3 @@ /* | ||
import { EthExecutionAPI } from './apis/eth_execution_api.js'; | ||
import { AbiFragment, ContractAbi } from './eth_abi_types.js'; | ||
@@ -84,1 +85,76 @@ export interface ContractInitOptions { | ||
} | ||
export type ContractAbiWithSignature = ReadonlyArray<AbiFragment & { signature: HexString }>; | ||
export interface ContractOptions { | ||
/** | ||
* The maximum gas provided for a transaction (gas limit). | ||
*/ | ||
readonly gas?: Uint; | ||
/** | ||
* The gas price in wei to use for transactions. | ||
*/ | ||
readonly gasPrice?: Uint; | ||
/** | ||
* The address transactions should be made from. | ||
*/ | ||
readonly from?: Address; | ||
/** | ||
* The byte code of the contract. Used when the contract gets {@link Contract.deploy | deployed} | ||
*/ | ||
readonly input?: Bytes; | ||
/** | ||
* The byte code of the contract. Used when the contract gets {@link Contract.deploy | deployed} | ||
*/ | ||
readonly data?: Bytes; | ||
/** | ||
* The {@doclink glossary/json_interface | json interface} object derived from the [ABI](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) of this contract. | ||
* | ||
* Re-setting this will regenerate the methods and events of the contract instance. | ||
* | ||
* ```ts | ||
* myContract.options.jsonInterface; | ||
* > [{ | ||
* "type":"function", | ||
* "name":"foo", | ||
* "inputs": [{"name":"a","type":"uint256"}], | ||
* "outputs": [{"name":"b","type":"address"}], | ||
* "signature": "0x...", | ||
* },{ | ||
* "type":"event", | ||
* "name":"Event", | ||
* "inputs": [{"name":"a","type":"uint256","indexed":true},{"name":"b","type":"bytes32","indexed":false}], | ||
* "signature": "0x...", | ||
* }] | ||
* | ||
* // Set a new ABI interface | ||
* // Note: the "signature" of every function and event's ABI is not needed to be provided when assigning. | ||
* // It will be calculated and set automatically inside the setter. | ||
* myContract.options.jsonInterface = [...]; | ||
* ``` | ||
*/ | ||
get jsonInterface(): ContractAbiWithSignature; | ||
set jsonInterface(value: ContractAbi); | ||
/** | ||
* The address used for this contract instance. All transactions generated by web3.js from this contract will contain this address as the `to`. | ||
* | ||
* The address will be stored in lowercase. | ||
* | ||
* ```ts | ||
* myContract.options.address; | ||
* > '0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae' | ||
* | ||
* // set a new address | ||
* myContract.options.address = '0x1234FFDD...'; | ||
* ``` | ||
*/ | ||
address?: Address; // All transactions generated by web3.js from this contract will contain this address as the "to". | ||
/** | ||
* The max priority fee per gas to use for transactions. | ||
*/ | ||
maxPriorityFeePerGas?: Uint; | ||
/** | ||
* The max fee per gas to use for transactions. | ||
*/ | ||
maxFeePerGas?: Uint; | ||
} |
@@ -315,2 +315,19 @@ /* | ||
} | ||
export interface EventLog { | ||
readonly event: string; | ||
readonly id?: string; | ||
readonly logIndex?: bigint | number | string; | ||
readonly transactionIndex?: bigint | number | string; | ||
readonly transactionHash?: HexString32Bytes; | ||
readonly blockHash?: HexString32Bytes; | ||
readonly blockNumber?: bigint | number | string; | ||
readonly address: string; | ||
readonly topics: HexString[]; | ||
readonly data: HexString; | ||
readonly raw?: { data: string; topics: unknown[] }; | ||
readonly returnValues: Record<string, unknown>; | ||
readonly signature?: HexString; | ||
} | ||
export interface TransactionReceiptBase<numberType, hashByteType, logsBloomByteType, logsType> { | ||
@@ -332,2 +349,3 @@ readonly transactionHash: hashByteType; | ||
readonly type?: numberType; | ||
events?: { [key: string]: EventLog }; | ||
} | ||
@@ -334,0 +352,0 @@ |
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
284482
5233
2
1