Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

web3-types

Package Overview
Dependencies
Maintainers
4
Versions
347
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-types - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1-dev.171b413.0

76

lib/commonjs/eth_contract_types.d.ts

@@ -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>;

@@ -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>;

4

package.json
{
"name": "web3-types",
"version": "1.2.0",
"version": "1.2.1-dev.171b413.0+171b413",
"description": "Provide the common data structures and interfaces for web3 modules.",

@@ -59,3 +59,3 @@ "main": "./lib/commonjs/index.js",

},
"gitHead": "2543fd184bc354f3fdb61bb021c41311f03b683f"
"gitHead": "171b413ae61a6cc5466a8501ed6dd513e83749c6"
}

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc