Socket
Socket
Sign inDemoInstall

web3-types

Package Overview
Dependencies
Maintainers
2
Versions
292
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.1-alpha.4 to 1.0.0-rc.0

lib/eth_abi_types.d.ts

61

lib/apis/eth_execution_api.d.ts

@@ -1,2 +0,2 @@

import { Address, HexString32Bytes, Uint, HexStringBytes, HexStringSingleByte, HexString256Bytes, Topic, HexString8Bytes, Uint256, BlockNumberOrTag, Filter, AccessList, TransactionHash, Uncles } from '../eth_types';
import { Address, HexString32Bytes, Uint, HexStringBytes, HexStringSingleByte, HexString256Bytes, FeeHistoryBase, HexString8Bytes, Uint256, BlockNumberOrTag, Filter, AccessList, TransactionHash, TransactionReceiptBase, BlockBase, LogBase } from '../eth_types';
import { HexString } from '../primitives_types';

@@ -69,52 +69,5 @@ export interface TransactionCallAPI {

};
export interface BlockAPI {
readonly parentHash: HexString32Bytes;
readonly sha3Uncles: HexString32Bytes;
readonly miner: HexString;
readonly stateRoot: HexString32Bytes;
readonly transactionsRoot: HexString32Bytes;
readonly receiptsRoot: HexString32Bytes;
readonly logsBloom?: HexString256Bytes;
readonly difficulty?: Uint;
readonly number?: Uint;
readonly gasLimit: Uint;
readonly gasUsed: Uint;
readonly timestamp: Uint;
readonly extraData: HexStringBytes;
readonly mixHash: HexString32Bytes;
readonly nonce?: Uint;
readonly totalDifficulty: Uint;
readonly baseFeePerGas?: Uint;
readonly size: Uint;
readonly transactions: TransactionHash[] | TransactionInfoAPI[];
readonly uncles: Uncles;
readonly hash?: HexString32Bytes;
}
export interface LogAPI {
readonly removed?: boolean;
readonly logIndex?: Uint;
readonly transactionIndex?: Uint;
readonly transactionHash?: HexString32Bytes;
readonly blockHash?: HexString32Bytes;
readonly blockNumber?: Uint;
readonly address?: Address;
readonly data?: HexStringBytes;
readonly topics?: Topic | Topic[];
}
export interface TransactionReceiptAPI {
readonly transactionHash: HexString32Bytes;
readonly transactionIndex: Uint;
readonly blockHash: HexString32Bytes;
readonly blockNumber: Uint;
readonly from: Address;
readonly to: Address;
readonly cumulativeGasUsed: Uint;
readonly gasUsed: Uint;
readonly contractAddress?: Address;
readonly logs: LogAPI[];
readonly logsBloom: HexString256Bytes;
readonly root: HexString32Bytes;
readonly status: '0x1' | '0x0';
readonly effectiveGasPrice: Uint;
}
export declare type BlockAPI = BlockBase<HexString32Bytes, HexString, Uint, HexStringBytes, TransactionHash[] | TransactionInfoAPI[], HexString256Bytes>;
export declare type LogAPI = LogBase<Uint, HexString32Bytes>;
export declare type TransactionReceiptAPI = TransactionReceiptBase<Uint, HexString32Bytes, HexString256Bytes, LogAPI>;
export declare type SyncingStatusAPI = {

@@ -125,7 +78,3 @@ startingBlock: Uint;

} | boolean;
export interface FeeHistoryResultAPI {
readonly oldestBlock: Uint;
readonly baseFeePerGas: Uint;
readonly reward: number[][];
}
export declare type FeeHistoryResultAPI = FeeHistoryBase<Uint>;
export declare type FilterResultsAPI = HexString32Bytes[] | LogAPI[];

@@ -132,0 +81,0 @@ export interface CompileResultAPI {

@@ -18,5 +18,7 @@ import { Bytes, HexString, Numbers } from './primitives_types';

LATEST = "latest",
PENDING = "pending"
PENDING = "pending",
SAFE = "safe",
FINALIZED = "finalized"
}
export declare type BlockTag = 'earliest' | 'latest' | 'pending';
export declare type BlockTag = `${BlockTags}`;
export declare type BlockNumberOrTag = Numbers | BlockTag;

@@ -181,29 +183,2 @@ export interface Proof {

export declare type Receipt = Record<string, unknown>;
export declare type Components = {
name: string;
type: string;
indexed?: boolean;
components?: Components[];
};
export declare type AbiInput = {
name: string;
type: string;
components?: Components;
index?: boolean;
internalType?: string;
};
export declare type JsonFunctionInterface = {
type: 'function';
name: string;
inputs: Components[];
outputs?: AbiInput[];
stateMutability?: string;
};
export declare type JsonEventInterface = {
type: 'event';
name: string;
inputs: Components[];
indexed: boolean;
anonymous: boolean;
};
export interface Filter {

@@ -215,7 +190,2 @@ readonly fromBlock?: BlockNumberOrTag;

}
export declare type AbiParameter = {
readonly name: string;
readonly type: string;
readonly components?: ReadonlyArray<AbiParameter | string>;
};
export interface AccessListEntry {

@@ -226,33 +196,41 @@ readonly address?: Address;

export declare type AccessList = AccessListEntry[];
export declare type AccessListResult = {
readonly accessList?: AccessList;
readonly gasUsed?: Numbers;
};
export declare type ValidChains = 'goerli' | 'kovan' | 'mainnet' | 'rinkeby' | 'ropsten' | 'sepolia';
export declare type Hardfork = 'arrowGlacier' | 'berlin' | 'byzantium' | 'chainstart' | 'constantinople' | 'dao' | 'homestead' | 'istanbul' | 'london' | 'merge' | 'muirGlacier' | 'petersburg' | 'shanghai' | 'spuriousDragon' | 'tangerineWhistle';
export interface Log {
export interface LogBase<NumberType, ByteType> {
readonly removed?: boolean;
readonly logIndex?: Numbers;
readonly transactionIndex?: Numbers;
readonly transactionHash?: Bytes;
readonly blockHash?: Bytes;
readonly blockNumber?: Numbers;
readonly logIndex?: NumberType;
readonly transactionIndex?: NumberType;
readonly transactionHash?: ByteType;
readonly blockHash?: ByteType;
readonly blockNumber?: NumberType;
readonly address?: Address;
readonly data?: Bytes;
readonly topics?: Bytes[];
readonly data?: ByteType;
readonly topics?: ByteType[];
readonly id?: string;
}
export interface TransactionReceipt {
readonly transactionHash: Bytes;
readonly transactionIndex: Numbers;
readonly blockHash: Bytes;
readonly blockNumber: Numbers;
export interface Log extends LogBase<Numbers, Bytes> {
readonly id?: string;
}
export interface TransactionReceiptBase<numberType, hashByteType, logsBloomByteType, logsType> {
readonly transactionHash: hashByteType;
readonly transactionIndex: numberType;
readonly blockHash: hashByteType;
readonly blockNumber: numberType;
readonly from: Address;
readonly to: Address;
readonly cumulativeGasUsed: Numbers;
readonly gasUsed: Numbers;
readonly effectiveGasPrice?: Numbers;
readonly cumulativeGasUsed: numberType;
readonly gasUsed: numberType;
readonly effectiveGasPrice?: numberType;
readonly contractAddress?: Address;
readonly logs: Log[];
readonly logsBloom: Bytes;
readonly root: Bytes;
readonly status: Numbers;
readonly type?: Numbers;
readonly logs: logsType[];
readonly logsBloom: logsBloomByteType;
readonly root: hashByteType;
readonly status: numberType;
readonly type?: numberType;
}
export declare type TransactionReceipt = TransactionReceiptBase<Numbers, Bytes, Bytes, Log>;
export interface CustomChain {

@@ -294,2 +272,5 @@ name?: string;

}
export interface TransactionForAccessList extends Transaction {
from: Address;
}
export interface TransactionCall extends Transaction {

@@ -340,31 +321,33 @@ to: Address;

export declare type PopulatedUnsignedTransaction = PopulatedUnsignedBaseTransaction | PopulatedUnsignedEip2930Transaction | PopulatedUnsignedEip1559Transaction;
export interface Block {
readonly parentHash: Bytes;
readonly sha3Uncles: Bytes;
readonly miner: Bytes;
readonly stateRoot: Bytes;
readonly transactionsRoot: Bytes;
readonly receiptsRoot: Bytes;
readonly logsBloom?: Bytes;
readonly difficulty?: Numbers;
readonly number: Numbers;
readonly gasLimit: Numbers;
readonly gasUsed: Numbers;
readonly timestamp: Numbers;
readonly extraData: Bytes;
readonly mixHash: Bytes;
readonly nonce: Numbers;
readonly totalDifficulty: Numbers;
readonly baseFeePerGas?: Numbers;
readonly size: Numbers;
readonly transactions: TransactionHash[] | TransactionInfo[];
export interface BlockBase<ByteType, HexStringType, NumberType, extraDataType, TransactionTypes, logsBloomType> {
readonly parentHash: ByteType;
readonly sha3Uncles: ByteType;
readonly miner: HexStringType;
readonly stateRoot: ByteType;
readonly transactionsRoot: ByteType;
readonly receiptsRoot: ByteType;
readonly logsBloom?: logsBloomType;
readonly difficulty?: NumberType;
readonly number: NumberType;
readonly gasLimit: NumberType;
readonly gasUsed: NumberType;
readonly timestamp: NumberType;
readonly extraData: extraDataType;
readonly mixHash: ByteType;
readonly nonce: NumberType;
readonly totalDifficulty: NumberType;
readonly baseFeePerGas?: NumberType;
readonly size: NumberType;
readonly transactions: TransactionTypes;
readonly uncles: Uncles;
readonly hash?: Bytes;
readonly hash?: ByteType;
}
export interface FeeHistory {
readonly oldestBlock: Numbers;
readonly baseFeePerGas: Numbers;
readonly reward: Numbers[][];
readonly gasUsedRatio: Numbers;
export declare type Block = BlockBase<Bytes, Bytes, Numbers, Bytes, TransactionHash[] | TransactionInfo[], Bytes>;
export interface FeeHistoryBase<NumberType> {
readonly oldestBlock: NumberType;
readonly baseFeePerGas: NumberType;
readonly reward: NumberType[][];
readonly gasUsedRatio: NumberType[];
}
export declare type FeeHistory = FeeHistoryBase<Numbers>;
export interface StorageProof {

@@ -371,0 +354,0 @@ readonly key: Bytes;

@@ -9,3 +9,5 @@ "use strict";

BlockTags["PENDING"] = "pending";
BlockTags["SAFE"] = "safe";
BlockTags["FINALIZED"] = "finalized";
})(BlockTags = exports.BlockTags || (exports.BlockTags = {}));
//# sourceMappingURL=eth_types.js.map

@@ -7,2 +7,3 @@ export * from './error_types';

export * from './eth_types';
export * from './eth_abi_types';
export * from './json_rpc_types';

@@ -9,0 +10,0 @@ export * from './primitives_types';

@@ -23,2 +23,3 @@ "use strict";

__exportStar(require("./eth_types"), exports);
__exportStar(require("./eth_abi_types"), exports);
__exportStar(require("./json_rpc_types"), exports);

@@ -25,0 +26,0 @@ __exportStar(require("./primitives_types"), exports);

@@ -5,2 +5,3 @@ /// <reference types="node" />

export declare type Numbers = number | bigint | string | HexString;
export declare const TypedArray: any;
//# sourceMappingURL=primitives_types.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypedArray = void 0;
exports.TypedArray = Object.getPrototypeOf(Uint8Array);
//# sourceMappingURL=primitives_types.js.map

@@ -8,7 +8,7 @@ /// <reference types="node" />

import { Web3EthExecutionAPI } from './apis/web3_eth_execution_api';
import { Web3DeferredPromise } from './web3_deferred_promise_type';
import { Web3DeferredPromiseInterface } from './web3_deferred_promise_type';
declare const symbol: unique symbol;
export interface SocketRequestItem<API extends Web3APISpec, Method extends Web3APIMethod<API>, ResponseType> {
payload: Web3APIPayload<API, Method>;
deferredPromise: Web3DeferredPromise<ResponseType>;
deferredPromise: Web3DeferredPromiseInterface<ResponseType>;
}

@@ -15,0 +15,0 @@ export declare type Web3ProviderStatus = 'connecting' | 'connected' | 'disconnected';

@@ -1,2 +0,2 @@

export interface Web3DeferredPromise<T> extends Promise<T> {
export interface Web3DeferredPromiseInterface<T> extends Promise<T> {
state: 'pending' | 'fulfilled' | 'rejected';

@@ -3,0 +3,0 @@ resolve(value: T | PromiseLike<T>): void;

{
"name": "web3-types",
"version": "0.1.1-alpha.4",
"version": "1.0.0-rc.0",
"description": "Provide the common data structures and interfaces for web3 modules.",

@@ -9,2 +9,6 @@ "main": "lib/index.js",

"license": "LGPL-3.0",
"engines": {
"node": ">=14",
"npm": ">=6.12.0"
},
"files": [

@@ -22,3 +26,4 @@ "lib/**/*"

"test": "jest --config=./test/unit/jest.config.js",
"test:coverage": "jest --config=./test/unit/jest.config.js --coverage=true --coverage-reporters=text",
"test:coverage:unit": "jest --config=./test/unit/jest.config.js --coverage=true --passWithNoTests --coverage-reporters=text",
"test:coverage:integration": "jest --config=./test/integration/jest.config.js --passWithNoTests --coverage=true --coverage-reporters=text",
"test:ci": "jest --coverage=true --coverage-reporters=json --verbose",

@@ -44,3 +49,3 @@ "test:watch": "npm test -- --watch",

},
"gitHead": "ae1ae53c9192ddef32931c3cbf68c2a7e2946ec5"
"gitHead": "e7d290c6921755dde95a029dec4d98aef05d4929"
}

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

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc