@wagmi/core 0.8.19 → 0.9.0-cjs
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/chains.js +71 -71
- package/dist/{chunk-TQJMA6J5.js → chunk-55IO54NW.js} +258 -266
- package/dist/chunk-BHJV5MXX.js +72 -72
- package/dist/chunk-BVC4KGLQ.js +8 -8
- package/dist/chunk-EQOEZP46.js +5 -5
- package/dist/chunk-KFW652VN.js +6 -6
- package/dist/chunk-KX4UEHS5.js +1 -0
- package/dist/chunk-MQXBDTVK.js +7 -7
- package/dist/connectors/coinbaseWallet.js +5 -5
- package/dist/connectors/index.js +9 -9
- package/dist/connectors/injected.js +7 -7
- package/dist/connectors/ledger.js +5 -5
- package/dist/connectors/metaMask.js +5 -5
- package/dist/connectors/mock.js +9 -9
- package/dist/connectors/walletConnect.js +5 -5
- package/dist/{contracts-9eb7706c.d.ts → contracts-b112c24e.d.ts} +1 -1
- package/dist/index-35b6525c.d.ts +49 -0
- package/dist/index.d.ts +28 -19
- package/dist/index.js +164 -164
- package/dist/internal/index.d.ts +3 -2
- package/dist/internal/index.js +8 -8
- package/dist/internal/test.d.ts +174 -2
- package/dist/internal/test.js +25 -25
- package/dist/providers/alchemy.d.ts +4 -3
- package/dist/providers/alchemy.js +11 -11
- package/dist/providers/infura.d.ts +4 -3
- package/dist/providers/infura.js +11 -11
- package/dist/providers/jsonRpc.d.ts +3 -2
- package/dist/providers/jsonRpc.js +8 -8
- package/dist/providers/public.d.ts +4 -3
- package/dist/providers/public.js +7 -7
- package/package.json +10 -17
- package/dist/index-1260a84c.d.ts +0 -189
package/dist/chunk-BHJV5MXX.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/chains.ts
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var _chains = require('@wagmi/chains');
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
exports.arbitrum = _chains.arbitrum; exports.arbitrumGoerli = _chains.arbitrumGoerli; exports.avalanche = _chains.avalanche; exports.avalancheFuji = _chains.avalancheFuji; exports.bsc = _chains.bsc; exports.bscTestnet = _chains.bscTestnet; exports.crossbell = _chains.crossbell; exports.evmos = _chains.evmos; exports.evmosTestnet = _chains.evmosTestnet; exports.fantom = _chains.fantom; exports.fantomTestnet = _chains.fantomTestnet; exports.foundry = _chains.foundry; exports.goerli = _chains.goerli; exports.gnosis = _chains.gnosis; exports.gnosisChiado = _chains.gnosisChiado; exports.hardhat = _chains.hardhat; exports.filecoin = _chains.filecoin; exports.filecoinHyperspace = _chains.filecoinHyperspace; exports.iotex = _chains.iotex; exports.iotexTestnet = _chains.iotexTestnet; exports.localhost = _chains.localhost; exports.mainnet = _chains.mainnet; exports.metis = _chains.metis; exports.metisGoerli = _chains.metisGoerli; exports.optimism = _chains.optimism; exports.optimismGoerli = _chains.optimismGoerli; exports.polygon = _chains.polygon; exports.polygonMumbai = _chains.polygonMumbai; exports.sepolia = _chains.sepolia; exports.taraxa = _chains.taraxa; exports.taraxaTestnet = _chains.taraxaTestnet; exports.zkSync = _chains.zkSync; exports.zkSyncTestnet = _chains.zkSyncTestnet;
|
package/dist/chunk-BVC4KGLQ.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/connectors/index.ts
|
|
2
|
+
var _connectors = require('@wagmi/connectors');
|
|
3
|
+
var _injected = require('@wagmi/connectors/injected');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.Connector = _connectors.Connector; exports.InjectedConnector = _injected.InjectedConnector;
|
package/dist/chunk-EQOEZP46.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/connectors/injected.ts
|
|
2
|
+
var _injected = require('@wagmi/connectors/injected');
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
exports.InjectedConnector = _injected.InjectedConnector;
|
package/dist/chunk-KFW652VN.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/connectors/mock.ts
|
|
2
|
+
var _mock = require('@wagmi/connectors/mock');
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.MockConnector = _mock.MockConnector; exports.MockProvider = _mock.MockProvider;
|
package/dist/chunk-KX4UEHS5.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/chunk-MQXBDTVK.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __accessCheck = (obj, member, msg) => {
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __accessCheck = (obj, member, msg) => {
|
|
2
2
|
if (!member.has(obj))
|
|
3
3
|
throw TypeError("Cannot " + msg);
|
|
4
4
|
};
|
|
@@ -21,9 +21,9 @@ var __privateMethod = (obj, member, method) => {
|
|
|
21
21
|
return method;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateMethod = __privateMethod;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
|
|
2
2
|
|
|
3
3
|
// src/connectors/coinbaseWallet.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var _coinbaseWallet = require('@wagmi/connectors/coinbaseWallet');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.CoinbaseWalletConnector = _coinbaseWallet.CoinbaseWalletConnector;
|
package/dist/connectors/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkBVC4KGLQjs = require('../chunk-BVC4KGLQ.js');
|
|
5
|
+
require('../chunk-MQXBDTVK.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.Connector = _chunkBVC4KGLQjs.Connector; exports.InjectedConnector = _chunkBVC4KGLQjs.InjectedConnector;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkEQOEZP46js = require('../chunk-EQOEZP46.js');
|
|
4
|
+
require('../chunk-MQXBDTVK.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.InjectedConnector = _chunkEQOEZP46js.InjectedConnector;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
|
|
2
2
|
|
|
3
3
|
// src/connectors/ledger.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var _ledger = require('@wagmi/connectors/ledger');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.LedgerConnector = _ledger.LedgerConnector;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
|
|
2
2
|
|
|
3
3
|
// src/connectors/metaMask.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var _metaMask = require('@wagmi/connectors/metaMask');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.MetaMaskConnector = _metaMask.MetaMaskConnector;
|
package/dist/connectors/mock.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkKFW652VNjs = require('../chunk-KFW652VN.js');
|
|
5
|
+
require('../chunk-MQXBDTVK.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.MockConnector = _chunkKFW652VNjs.MockConnector; exports.MockProvider = _chunkKFW652VNjs.MockProvider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
|
|
2
2
|
|
|
3
3
|
// src/connectors/walletConnect.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var _walletConnect = require('@wagmi/connectors/walletConnect');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.WalletConnectConnector = _walletConnect.WalletConnectConnector;
|
|
@@ -196,4 +196,4 @@ type Event<TAbiEvent extends AbiEvent> = Omit<ethers.Event, 'args' | 'event' | '
|
|
|
196
196
|
eventSignature: AbiItemName<TAbiEvent, true>;
|
|
197
197
|
};
|
|
198
198
|
|
|
199
|
-
export { AbiItemName as A, CountOccurrences as C, Event as E, GetConfig as G, IsUnknown as I, UnionToIntersection as U, GetOverridesForAbiStateMutability as a, Contract as b, ContractsConfig as c, ContractsResult as d, GetReturnType as e };
|
|
199
|
+
export { AbiItemName as A, CountOccurrences as C, Event as E, GetConfig as G, IsUnknown as I, UnionToIntersection as U, GetOverridesForAbiStateMutability as a, Contract as b, ContractsConfig as c, ContractsResult as d, GetReturnType as e, GetFunctionName as f, GetArgs as g };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Ethereum } from '@wagmi/connectors';
|
|
2
|
+
import { Address, TypedData, TypedDataToPrimitiveTypes, TypedDataDomain, ResolvedConfig } from 'abitype';
|
|
3
|
+
import { BigNumber, providers, Signer as Signer$1 } from 'ethers';
|
|
4
|
+
import { Chain } from '@wagmi/chains';
|
|
5
|
+
|
|
6
|
+
declare const units: readonly ["wei", "kwei", "mwei", "gwei", "szabo", "finney", "ether"];
|
|
7
|
+
|
|
8
|
+
declare module 'abitype' {
|
|
9
|
+
interface Config {
|
|
10
|
+
BigIntType: BigNumber;
|
|
11
|
+
IntType: number;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
declare module 'ethers/lib/utils.js' {
|
|
15
|
+
function getAddress(address: string): Address;
|
|
16
|
+
function isAddress(address: string): address is Address;
|
|
17
|
+
function verifyTypedData<TTypedData extends TypedData, TSchema extends TypedDataToPrimitiveTypes<TTypedData>>(domain: TypedDataDomain, types: TTypedData, value: TSchema[keyof TSchema] extends infer TValue ? {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
} extends TValue ? Record<string, any> : TValue : never, signature: {
|
|
20
|
+
r: string;
|
|
21
|
+
s?: string;
|
|
22
|
+
_vs?: string;
|
|
23
|
+
recoveryParam?: number;
|
|
24
|
+
v?: number;
|
|
25
|
+
} | ResolvedConfig['BytesType'] | string): string;
|
|
26
|
+
}
|
|
27
|
+
type Hash = `0x${string}`;
|
|
28
|
+
type ChainProviderFn<TChain extends Chain = Chain, TProvider extends Provider = providers.BaseProvider, TWebSocketProvider extends WebSocketProvider = providers.WebSocketProvider> = (chain: TChain) => {
|
|
29
|
+
chain: TChain;
|
|
30
|
+
provider: () => ProviderWithFallbackConfig<TProvider>;
|
|
31
|
+
webSocketProvider?: () => TWebSocketProvider;
|
|
32
|
+
} | null;
|
|
33
|
+
type FallbackProviderConfig = Omit<providers.FallbackProviderConfig, 'provider'>;
|
|
34
|
+
type ProviderWithFallbackConfig<TProvider extends Provider = Provider> = TProvider & FallbackProviderConfig;
|
|
35
|
+
type Provider = providers.BaseProvider & {
|
|
36
|
+
chains?: Chain[];
|
|
37
|
+
};
|
|
38
|
+
type WebSocketProvider = providers.WebSocketProvider & {
|
|
39
|
+
chains?: Chain[];
|
|
40
|
+
};
|
|
41
|
+
type Signer = Signer$1;
|
|
42
|
+
type Unit = (typeof units)[number];
|
|
43
|
+
declare global {
|
|
44
|
+
interface Window {
|
|
45
|
+
ethereum?: Ethereum;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { ChainProviderFn as C, FallbackProviderConfig as F, Hash as H, Provider as P, Signer as S, Unit as U, WebSocketProvider as W, ProviderWithFallbackConfig as a, units as u };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,16 +3,16 @@ import { Chain } from '@wagmi/chains';
|
|
|
3
3
|
export { Chain, goerli, mainnet } from '@wagmi/chains';
|
|
4
4
|
import { Mutate, StoreApi } from 'zustand/vanilla';
|
|
5
5
|
import { Connector, ConnectorData } from '@wagmi/connectors';
|
|
6
|
-
export { Connector, ConnectorData, ConnectorEvents } from '@wagmi/connectors';
|
|
7
|
-
import { P as Provider, W as WebSocketProvider, U as Unit, S as Signer, H as Hash, C as ChainProviderFn, a as ProviderWithFallbackConfig } from './index-
|
|
8
|
-
export { C as ChainProviderFn,
|
|
6
|
+
export { Connector, ConnectorData, ConnectorEvents, Ethereum } from '@wagmi/connectors';
|
|
7
|
+
import { P as Provider, W as WebSocketProvider, U as Unit, S as Signer, H as Hash, C as ChainProviderFn, a as ProviderWithFallbackConfig } from './index-35b6525c.js';
|
|
8
|
+
export { C as ChainProviderFn, F as FallbackProviderConfig, H as Hash, P as Provider, a as ProviderWithFallbackConfig, S as Signer, U as Unit, W as WebSocketProvider, u as units } from './index-35b6525c.js';
|
|
9
9
|
import { Address, ResolvedConfig, TypedData, TypedDataToPrimitiveTypes, TypedDataDomain, Narrow, Abi, ExtractAbiFunction, ExtractAbiEventNames, AbiParametersToPrimitiveTypes, ExtractAbiEvent, AbiFunction, AbiParameter, AbiParameterToPrimitiveType, AbiEvent, ExtractAbiFunctionNames } from 'abitype';
|
|
10
10
|
export { Address } from 'abitype';
|
|
11
11
|
import { PopulatedTransaction, Signer as Signer$1, providers, Contract as Contract$1, ethers, Transaction, ContractInterface } from 'ethers';
|
|
12
|
-
import { G as GetConfig, a as GetOverridesForAbiStateMutability, U as UnionToIntersection, C as CountOccurrences, A as AbiItemName, I as IsUnknown, E as Event, b as Contract$2, c as ContractsConfig, d as ContractsResult, e as GetReturnType } from './contracts-
|
|
12
|
+
import { G as GetConfig, a as GetOverridesForAbiStateMutability, U as UnionToIntersection, C as CountOccurrences, A as AbiItemName, I as IsUnknown, E as Event, b as Contract$2, c as ContractsConfig, d as ContractsResult, e as GetReturnType, f as GetFunctionName, g as GetArgs } from './contracts-b112c24e.js';
|
|
13
13
|
import { TransactionResponse } from '@ethersproject/providers';
|
|
14
14
|
export { InjectedConnector, InjectedConnectorOptions } from '@wagmi/connectors/injected';
|
|
15
|
-
import * as
|
|
15
|
+
import * as abitype_dist_abi_78346466 from 'abitype/dist/abi-78346466';
|
|
16
16
|
|
|
17
17
|
type BaseStorage = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;
|
|
18
18
|
type ClientStorage = {
|
|
@@ -1049,9 +1049,9 @@ type FetchTokenResult = {
|
|
|
1049
1049
|
declare function fetchToken({ address, chainId, formatUnits: units, }: FetchTokenArgs): Promise<FetchTokenResult>;
|
|
1050
1050
|
|
|
1051
1051
|
type StateMutability$1 = 'nonpayable' | 'payable';
|
|
1052
|
-
type PrepareWriteContractConfig<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TSigner extends Signer = Signer> = GetConfig<TAbi, TFunctionName, StateMutability$1> & {
|
|
1052
|
+
type PrepareWriteContractConfig<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TChainId extends number = number, TSigner extends Signer = Signer> = GetConfig<TAbi, TFunctionName, StateMutability$1> & {
|
|
1053
1053
|
/** Chain id to use for provider */
|
|
1054
|
-
chainId?: number;
|
|
1054
|
+
chainId?: TChainId | number;
|
|
1055
1055
|
/** Overrides */
|
|
1056
1056
|
overrides?: GetOverridesForAbiStateMutability<[
|
|
1057
1057
|
TAbi,
|
|
@@ -1067,10 +1067,10 @@ type Request$1 = PopulatedTransaction & {
|
|
|
1067
1067
|
to: Address;
|
|
1068
1068
|
gasLimit: NonNullable<PopulatedTransaction['gasLimit']>;
|
|
1069
1069
|
};
|
|
1070
|
-
type PrepareWriteContractResult<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = {
|
|
1070
|
+
type PrepareWriteContractResult<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TChainId extends number = number> = {
|
|
1071
1071
|
abi: TAbi extends Abi ? [ExtractAbiFunction<TAbi, TFunctionName>] : TAbi;
|
|
1072
1072
|
address: Address;
|
|
1073
|
-
chainId?:
|
|
1073
|
+
chainId?: TChainId;
|
|
1074
1074
|
functionName: TFunctionName;
|
|
1075
1075
|
mode: 'prepared';
|
|
1076
1076
|
request: Request$1;
|
|
@@ -1090,7 +1090,7 @@ type PrepareWriteContractResult<TAbi extends Abi | readonly unknown[] = Abi, TFu
|
|
|
1090
1090
|
* })
|
|
1091
1091
|
* const result = await writeContract(config)
|
|
1092
1092
|
*/
|
|
1093
|
-
declare function prepareWriteContract<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TSigner extends Signer = Signer>({ abi, address, chainId, functionName, overrides, signer: signer_, ...config }: PrepareWriteContractConfig<TAbi, TFunctionName, TSigner>): Promise<PrepareWriteContractResult<TAbi, TFunctionName>>;
|
|
1093
|
+
declare function prepareWriteContract<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChainId extends number, TSigner extends Signer = Signer>({ abi, address, chainId, functionName, overrides, signer: signer_, ...config }: PrepareWriteContractConfig<TAbi, TFunctionName, TChainId, TSigner>): Promise<PrepareWriteContractResult<TAbi, TFunctionName, TChainId>>;
|
|
1094
1094
|
|
|
1095
1095
|
type GetContractArgs<TAbi extends Abi | readonly unknown[] = Abi> = {
|
|
1096
1096
|
/** Contract address */
|
|
@@ -1434,9 +1434,13 @@ type WriteContractPreparedArgs<TAbi extends Abi | readonly unknown[], TFunctionN
|
|
|
1434
1434
|
chainId?: number;
|
|
1435
1435
|
/** Request to submit transaction for */
|
|
1436
1436
|
request: Request;
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1437
|
+
/** Contract ABI */
|
|
1438
|
+
abi: Narrow<TAbi>;
|
|
1439
|
+
/** Contract address */
|
|
1440
|
+
address: Address;
|
|
1441
|
+
/** Function to invoke on the contract */
|
|
1442
|
+
functionName: GetFunctionName<TAbi, TFunctionName, 'nonpayable' | 'payable'>;
|
|
1443
|
+
};
|
|
1440
1444
|
type WriteContractUnpreparedArgs<TAbi extends Abi | readonly unknown[], TFunctionName extends string> = {
|
|
1441
1445
|
/**
|
|
1442
1446
|
* `recklesslyUnprepared`: Allow to pass through unprepared config. Note: This has
|
|
@@ -1458,9 +1462,14 @@ type WriteContractUnpreparedArgs<TAbi extends Abi | readonly unknown[], TFunctio
|
|
|
1458
1462
|
infer TAbi_ extends Abi,
|
|
1459
1463
|
infer TFunctionName_ extends string
|
|
1460
1464
|
] ? ExtractAbiFunction<TAbi_, TFunctionName_>['stateMutability'] : 'nonpayable' | 'payable'>;
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1465
|
+
/** Contract ABI */
|
|
1466
|
+
abi: Narrow<TAbi>;
|
|
1467
|
+
/** Contract address */
|
|
1468
|
+
address: Address;
|
|
1469
|
+
/** Function to invoke on the contract */
|
|
1470
|
+
functionName: GetFunctionName<TAbi, TFunctionName, 'nonpayable' | 'payable'>;
|
|
1471
|
+
} & GetArgs<TAbi, TFunctionName>;
|
|
1472
|
+
type WriteContractArgs<TAbi extends Abi | readonly unknown[], TFunctionName extends string> = WriteContractPreparedArgs<TAbi, TFunctionName> | WriteContractUnpreparedArgs<TAbi, TFunctionName>;
|
|
1464
1473
|
type WriteContractResult = SendTransactionResult;
|
|
1465
1474
|
/**
|
|
1466
1475
|
* @description Function to call a contract write method.
|
|
@@ -1478,7 +1487,7 @@ type WriteContractResult = SendTransactionResult;
|
|
|
1478
1487
|
* })
|
|
1479
1488
|
* const result = await writeContract(config)
|
|
1480
1489
|
*/
|
|
1481
|
-
declare function writeContract<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TSigner extends Signer = Signer>(
|
|
1490
|
+
declare function writeContract<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TSigner extends Signer = Signer>(config: WriteContractUnpreparedArgs<TAbi, TFunctionName> | WriteContractPreparedArgs<TAbi, TFunctionName>): Promise<WriteContractResult>;
|
|
1482
1491
|
|
|
1483
1492
|
type FetchEnsAddressArgs = {
|
|
1484
1493
|
/** Chain id to use for provider */
|
|
@@ -1707,7 +1716,7 @@ type ConfigureChainsConfig = {
|
|
|
1707
1716
|
targetQuorum: number;
|
|
1708
1717
|
minQuorum?: number;
|
|
1709
1718
|
});
|
|
1710
|
-
declare function configureChains<
|
|
1719
|
+
declare function configureChains<TChain extends Chain = Chain, TProvider extends Provider = Provider, TWebSocketProvider extends WebSocketProvider = WebSocketProvider>(defaultChains: TChain[], providers: ChainProviderFn<TChain, TProvider, TWebSocketProvider>[], { minQuorum, pollingInterval, targetQuorum, stallTimeout, }?: ConfigureChainsConfig): {
|
|
1711
1720
|
readonly chains: TChain[];
|
|
1712
1721
|
readonly provider: ({ chainId }: {
|
|
1713
1722
|
chainId?: number | undefined;
|
|
@@ -1730,7 +1739,7 @@ declare function deserialize(cachedString: string): any;
|
|
|
1730
1739
|
declare function minimizeContractInterface<TAbi extends Abi | readonly unknown[]>(config: {
|
|
1731
1740
|
abi: TAbi;
|
|
1732
1741
|
functionName: TAbi extends Abi ? ExtractAbiFunctionNames<TAbi> : string;
|
|
1733
|
-
}): string[] | (
|
|
1742
|
+
}): string[] | (abitype_dist_abi_78346466.q | abitype_dist_abi_78346466.p | abitype_dist_abi_78346466.o)[];
|
|
1734
1743
|
|
|
1735
1744
|
declare function normalizeChainId(chainId: string | number | bigint): number;
|
|
1736
1745
|
|