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

@web3-react/types

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web3-react/types - npm Package Compare versions

Comparing version 8.0.15-alpha.0 to 8.0.15-beta.0

README.md

68

dist/index.d.ts
/// <reference types="node" />
import type { EventEmitter } from 'node:events';
import type { State, StoreApi } from 'zustand/vanilla';
import type { State, StoreApi } from 'zustand';
export interface Web3ReactState extends State {

@@ -11,10 +11,16 @@ chainId: number | undefined;

export declare type Web3ReactStore = StoreApi<Web3ReactState>;
export interface Web3ReactStateUpdate {
chainId?: number;
accounts?: string[];
}
export declare type Web3ReactStateUpdate = {
chainId: number;
accounts: string[];
} | {
chainId: number;
accounts?: never;
} | {
chainId?: never;
accounts: string[];
};
export interface Actions {
startActivation: () => () => void;
update: (stateUpdate: Web3ReactStateUpdate) => void;
reportError: (error: Error) => void;
reportError: (error: Error | undefined) => void;
}

@@ -36,12 +42,54 @@ export interface RequestArguments {

}
export interface ProviderMessage {
readonly type: string;
readonly data: unknown;
export interface AddEthereumChainParameter {
chainId: number;
chainName: string;
nativeCurrency: {
name: string;
symbol: string;
decimals: 18;
};
rpcUrls: string[];
blockExplorerUrls?: string[];
iconUrls?: string[];
}
export interface WatchAssetParameters {
address: string;
symbol: string;
decimals: number;
image: string;
}
export declare abstract class Connector {
/**
* An
* EIP-1193 ({@link https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md}) and
* EIP-1102 ({@link https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1102.md}) compliant provider.
* May also comply with EIP-3085 ({@link https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3085.md}).
* This property must be defined while the connector is active, unless a customProvider is provided.
*/
provider: Provider | undefined;
/**
* An optional property meant to allow ethers providers to be used directly rather than via the experimental
* 1193 bridge. If desired, this property must be defined while the connector is active, in which case it will
* be preferred over provider.
*/
customProvider: unknown | undefined;
protected readonly actions: Actions;
/**
* @param actions - Methods bound to a zustand store that tracks the state of the connector.
* Actions are used by the connector to report changes in connection status.
*/
constructor(actions: Actions);
protected get serverSide(): boolean;
/**
* Attempt to initiate a connection, failing silently
*/
connectEagerly?(...args: unknown[]): Promise<void> | void;
/**
* Initiate a connection.
*/
abstract activate(...args: unknown[]): Promise<void> | void;
deactivate?(...args: unknown[]): Promise<void> | void;
/**
* Initiate a disconnect.
*/
deactivate(...args: unknown[]): Promise<void> | void;
}

@@ -1,5 +0,23 @@

export class Connector {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Connector = void 0;
class Connector {
/**
* @param actions - Methods bound to a zustand store that tracks the state of the connector.
* Actions are used by the connector to report changes in connection status.
*/
constructor(actions) {
this.actions = actions;
}
get serverSide() {
return typeof window === 'undefined';
}
/**
* Initiate a disconnect.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
deactivate(...args) {
this.actions.reportError(undefined);
}
}
exports.Connector = Connector;

25

package.json
{
"name": "@web3-react/types",
"keywords": [
"web3-react"
],
"author": "Noah Zinsmeister <noahwz@gmail.com>",
"license": "GPL-3.0-or-later",
"repository": "github:NoahZinsmeister/web3-react",
"publishConfig": {
"access": "public"
},
"version": "8.0.15-alpha.0",
"type": "module",
"version": "8.0.15-beta.0",
"files": [
"dist/*"
],
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
},
"type": "commonjs",
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"main": "./dist/cjs/index.js",
"main": "./dist/index.js",
"exports": "./dist/index.js",
"scripts": {
"prebuild": "rm -rf dist",
"build": "tsc && tsc --project tsconfig.cjs.json",
"build": "tsc",
"start": "tsc --watch"
},
"dependencies": {
"zustand": "^4.0.0-beta.0"
"zustand": "^4.0.0-rc.0"
},
"gitHead": "a2e294ebdec567b9fc2f81a7254d1dc1f20c8860"
"gitHead": "ec71a5320da216107bc784f7ee0beb39f2e46493"
}
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