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.2-alpha.0 to 8.0.2-beta.0

dist/cjs/index.js

50

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

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

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

@@ -24,8 +34,32 @@ export interface RequestArguments {

}
export interface ProviderConnectInfo {
readonly chainId: string;
}
export interface ProviderRpcError extends Error {
message: string;
code: number;
data?: unknown;
}
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.
* This property must be defined while the connector is active.
*/
provider: Provider | undefined;
protected readonly actions: Actions;
provider: Provider | undefined;
deactivate?(): Promise<void>;
/**
* @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);
abstract activate(): Promise<void>;
/**
* Initiate a connection.
*/
abstract activate(...args: unknown[]): Promise<void> | void;
/**
* Initiate a disconnect.
*/
deactivate(...args: unknown[]): Promise<void> | void;
}
export 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;
}
/**
* Initiate a disconnect.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
deactivate(...args) {
this.actions.reportError(undefined);
}
}

29

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.2-alpha.0",
"version": "8.0.2-beta.0",
"type": "module",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/*"
],
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
},
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"main": "./dist/cjs/index.js",
"scripts": {
"prebuild": "rm -rf dist",
"build": "tsc",
"build": "tsc && tsc --project tsconfig.cjs.json",
"start": "tsc --watch"
},
"peerDependencies": {
"zustand": "^3.5.10"
"dependencies": {
"zustand": "^4.0.0-beta.0"
},
"gitHead": "d530f87688f3cbe10ec33ea2351c2add505861e6"
"gitHead": "1bb87f2036a4f70b11aaf9b3c9c165f12811d8de"
}
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