@rainbow-me/kit-hooks
Advanced tools
Comparing version 0.0.29 to 0.0.30
@@ -1,2 +0,1 @@ | ||
export * from 'use-ens'; | ||
export * from './useExplorerTxHistory'; | ||
@@ -3,0 +2,0 @@ export * from './useTxHistory'; |
// src/index.ts | ||
export * from "use-ens"; | ||
export * from "./useExplorerTxHistory.js"; | ||
@@ -4,0 +3,0 @@ export * from "./useTxHistory.js"; |
@@ -6,4 +6,4 @@ import { Web3Provider, BaseProvider } from '@ethersproject/providers'; | ||
}) => { | ||
avatar: string; | ||
avatar: string | undefined; | ||
domain: string; | ||
}; |
@@ -10,3 +10,3 @@ import type { TxHistoryFetcher } from '@rainbow-me/kit-utils'; | ||
export declare const useExplorerTxHistory: <Tx = any, P extends BaseProvider = Web3Provider>({ fetcher, address, options, provider }: { | ||
fetcher?: TxHistoryFetcher; | ||
fetcher?: TxHistoryFetcher<any, any, any> | undefined; | ||
provider: P; | ||
@@ -18,8 +18,8 @@ address: string; | ||
data: Tx[]; | ||
error: Error & { | ||
error: (Error & { | ||
data?: { | ||
message: string; | ||
code: string; | ||
}; | ||
}; | ||
} | undefined; | ||
}) | undefined; | ||
}; |
@@ -11,3 +11,3 @@ // src/useExplorerTxHistory.ts | ||
const [loading, setLoading] = useState(true); | ||
const [data, setData] = useState(); | ||
const [data, setData] = useState([]); | ||
const [error, setError] = useState(); | ||
@@ -14,0 +14,0 @@ useEffect(() => { |
@@ -10,3 +10,3 @@ import { BigNumber } from '@ethersproject/bignumber'; | ||
address: string; | ||
initialValue?: BigNumber; | ||
initialValue?: BigNumber | undefined; | ||
}) => string; |
@@ -12,4 +12,4 @@ import { Transaction } from '@ethersproject/transactions'; | ||
export declare const useTxHistory: ({ initialTxes, rememberHistory, provider }: { | ||
initialTxes?: TransactionWithStatus[]; | ||
rememberHistory?: boolean; | ||
initialTxes?: TransactionWithStatus[] | undefined; | ||
rememberHistory?: boolean | undefined; | ||
provider: BaseProvider; | ||
@@ -16,0 +16,0 @@ }) => { |
@@ -66,4 +66,6 @@ // src/useTxHistory.ts | ||
useEffect(() => { | ||
var _a; | ||
if (rememberHistory) { | ||
const txes2 = safeJSONParse(localStorage.getItem("rk-tx-history")) || []; | ||
const txHistory = localStorage.getItem("rk-tx-history"); | ||
const txes2 = txHistory ? (_a = safeJSONParse(txHistory)) != null ? _a : [] : []; | ||
set(txes2); | ||
@@ -70,0 +72,0 @@ } |
@@ -6,11 +6,11 @@ import { Web3Provider } from '@ethersproject/providers'; | ||
export declare const useWeb3State: () => { | ||
connector?: import("@web3-react/abstract-connector").AbstractConnector; | ||
chainId?: number; | ||
error?: Error; | ||
activate: (connector: import("@web3-react/abstract-connector").AbstractConnector, onError?: (error: Error) => void, throwErrors?: boolean) => Promise<void>; | ||
connector?: import("@web3-react/abstract-connector").AbstractConnector | undefined; | ||
chainId?: number | undefined; | ||
error?: Error | undefined; | ||
activate: (connector: import("@web3-react/abstract-connector").AbstractConnector, onError?: ((error: Error) => void) | undefined, throwErrors?: boolean | undefined) => Promise<void>; | ||
setError: (error: Error) => void; | ||
deactivate: () => void; | ||
provider: Web3Provider; | ||
provider: Web3Provider | undefined; | ||
isConnected: boolean; | ||
address: string; | ||
address: string | null | undefined; | ||
}; |
{ | ||
"name": "@rainbow-me/kit-hooks", | ||
"type": "module", | ||
"version": "0.0.29", | ||
"version": "0.0.30", | ||
"exports": { | ||
@@ -34,4 +34,3 @@ ".": "./dist/index.js", | ||
"@rainbow-me/kit-utils": "0.0.14", | ||
"@web3-react/abstract-connector": "^6.0.7", | ||
"use-ens": "0.0.16" | ||
"@web3-react/abstract-connector": "^6.0.7" | ||
}, | ||
@@ -57,5 +56,10 @@ "peerDependencies": { | ||
"build": "node build.js", | ||
"build:watch": "node build.js --watch", | ||
"dev": "pnpm build:watch & pnpm typegen:watch", | ||
"prebuild": "pnpm typegen", | ||
"typegen": "tsc --emitDeclarationOnly || true" | ||
} | ||
"typecheck": "pnpm tsc --noEmit", | ||
"typegen": "tsc --emitDeclarationOnly || true", | ||
"typegen:watch": "tsc --emitDeclarationOnly --watch" | ||
}, | ||
"readme": "# @rainbow-me/kit-hooks\n\nReact hooks for RainbowKit.\n\n## Install\n\n```sh\npnpm i @rainbow-me/kit-hooks\n```\n" | ||
} |
15516
8
24
449
- Removeduse-ens@0.0.16
- Removedget-ens@2.1.1(transitive)
- Removedreact-dom@19.0.0(transitive)
- Removedscheduler@0.25.0(transitive)
- Removeduse-ens@0.0.16(transitive)