@wagmi/vue 0.3.4 → 0.4.1
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/dist/esm/composables/useConnect.js.map +1 -1
- package/dist/esm/composables/useConnection.js +17 -0
- package/dist/esm/composables/useConnection.js.map +1 -0
- package/dist/esm/composables/{useAccountEffect.js → useConnectionEffect.js} +5 -5
- package/dist/esm/composables/useConnectionEffect.js.map +1 -0
- package/dist/esm/composables/useConnectorClient.js +2 -2
- package/dist/esm/composables/useConnectorClient.js.map +1 -1
- package/dist/esm/composables/useDisconnect.js.map +1 -1
- package/dist/esm/composables/useSwitchChain.js.map +1 -1
- package/dist/esm/composables/{useSwitchAccount.js → useSwitchConnection.js} +7 -5
- package/dist/esm/composables/useSwitchConnection.js.map +1 -0
- package/dist/esm/exports/index.js +10 -4
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/nuxt/module.js +6 -3
- package/dist/esm/nuxt/module.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/composables/useConnect.d.ts +1 -0
- package/dist/types/composables/useConnect.d.ts.map +1 -1
- package/dist/types/composables/useConnection.d.ts +8 -0
- package/dist/types/composables/useConnection.d.ts.map +1 -0
- package/dist/types/composables/useConnectionEffect.d.ts +15 -0
- package/dist/types/composables/useConnectionEffect.d.ts.map +1 -0
- package/dist/types/composables/useDisconnect.d.ts +1 -0
- package/dist/types/composables/useDisconnect.d.ts.map +1 -1
- package/dist/types/composables/useSwitchChain.d.ts +1 -0
- package/dist/types/composables/useSwitchChain.d.ts.map +1 -1
- package/dist/types/composables/useSwitchConnection.d.ts +22 -0
- package/dist/types/composables/useSwitchConnection.d.ts.map +1 -0
- package/dist/types/exports/index.d.ts +20 -4
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/nuxt/module.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +4 -8
- package/src/composables/useConnect.ts +1 -0
- package/src/composables/useConnection.ts +39 -0
- package/src/composables/{useAccountEffect.ts → useConnectionEffect.ts} +8 -6
- package/src/composables/useConnectorClient.ts +2 -2
- package/src/composables/useDisconnect.ts +1 -0
- package/src/composables/useSwitchChain.ts +1 -0
- package/src/composables/{useSwitchAccount.ts → useSwitchConnection.ts} +28 -21
- package/src/exports/index.ts +42 -18
- package/src/nuxt/module.ts +6 -3
- package/src/version.ts +1 -1
- package/actions/experimental/package.json +0 -5
- package/dist/esm/composables/useAccount.js +0 -17
- package/dist/esm/composables/useAccount.js.map +0 -1
- package/dist/esm/composables/useAccountEffect.js.map +0 -1
- package/dist/esm/composables/useSwitchAccount.js.map +0 -1
- package/dist/esm/exports/actions/experimental.js +0 -7
- package/dist/esm/exports/actions/experimental.js.map +0 -1
- package/dist/types/composables/useAccount.d.ts +0 -8
- package/dist/types/composables/useAccount.d.ts.map +0 -1
- package/dist/types/composables/useAccountEffect.d.ts +0 -15
- package/dist/types/composables/useAccountEffect.d.ts.map +0 -1
- package/dist/types/composables/useSwitchAccount.d.ts +0 -17
- package/dist/types/composables/useSwitchAccount.d.ts.map +0 -1
- package/dist/types/exports/actions/experimental.d.ts +0 -2
- package/dist/types/exports/actions/experimental.d.ts.map +0 -1
- package/src/composables/useAccount.ts +0 -37
- package/src/exports/actions/experimental.ts +0 -7
package/src/nuxt/module.ts
CHANGED
|
@@ -24,8 +24,8 @@ export const wagmiModule: NuxtModule<WagmiModuleOptions> =
|
|
|
24
24
|
// Add auto imports
|
|
25
25
|
const composables = resolve('./runtime/composables')
|
|
26
26
|
const names = [
|
|
27
|
-
'useAccount'
|
|
28
|
-
'useAccountEffect'
|
|
27
|
+
'useAccount' /** @deprecated */,
|
|
28
|
+
'useAccountEffect' /** @deprecated */,
|
|
29
29
|
'useBalance',
|
|
30
30
|
'useBlockNumber',
|
|
31
31
|
'useChainId',
|
|
@@ -33,6 +33,8 @@ export const wagmiModule: NuxtModule<WagmiModuleOptions> =
|
|
|
33
33
|
'useClient',
|
|
34
34
|
'useConfig',
|
|
35
35
|
'useConnect',
|
|
36
|
+
'useConnection',
|
|
37
|
+
'useConnectionEffect',
|
|
36
38
|
'useConnections',
|
|
37
39
|
'useConnectorClient',
|
|
38
40
|
'useConnectors',
|
|
@@ -47,8 +49,9 @@ export const wagmiModule: NuxtModule<WagmiModuleOptions> =
|
|
|
47
49
|
'useSignMessage',
|
|
48
50
|
'useSignTypedData',
|
|
49
51
|
'useSimulateContract',
|
|
50
|
-
'useSwitchAccount'
|
|
52
|
+
'useSwitchAccount' /** @deprecated */,
|
|
51
53
|
'useSwitchChain',
|
|
54
|
+
'useSwitchConnection',
|
|
52
55
|
'useTransaction',
|
|
53
56
|
'useTransactionReceipt',
|
|
54
57
|
'useWaitForTransactionReceipt',
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.
|
|
1
|
+
export const version = '0.4.1'
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { getAccount, watchAccount, } from '@wagmi/core';
|
|
2
|
-
import { onScopeDispose, reactive, readonly, toRefs } from 'vue';
|
|
3
|
-
import { updateState } from '../utils/updateState.js';
|
|
4
|
-
import { useConfig } from './useConfig.js';
|
|
5
|
-
/** https://wagmi.sh/vue/api/composables/useAccount */
|
|
6
|
-
export function useAccount(parameters = {}) {
|
|
7
|
-
const config = useConfig(parameters);
|
|
8
|
-
const account = reactive(getAccount(config));
|
|
9
|
-
const unsubscribe = watchAccount(config, {
|
|
10
|
-
onChange(data) {
|
|
11
|
-
updateState(account, data);
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
onScopeDispose(() => unsubscribe());
|
|
15
|
-
return toRefs(readonly(account));
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=useAccount.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccount.js","sourceRoot":"","sources":["../../../src/composables/useAccount.ts"],"names":[],"mappings":"AAAA,O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A;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAkCpD,4DAA4D;AAC5D,MAAM,UAAU,gBAAgB,CAI9B,aAA0D,EAAE;IAE5D,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAA;IAE/B,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,CAAA;IACpC,MAAM,WAAW,GAAG,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;IAE9C,MAAM,eAAe,GAAG,4BAA4B,CAAC,MAAM,CAAC,CAAA;IAC5D,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,GAAG,WAAW,CAAC;QACrD,GAAG,QAAQ;QACX,GAAG,eAAe;KACnB,CAAC,CAAA;IAEF,OAAO;QACL,GAAG,MAAM;QACT,UAAU,EAAE,QAAQ,CAAC,GAAG,EAAE,CACxB,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAC5D;QACD,aAAa,EAAE,MAAM;QACrB,kBAAkB,EAAE,WAAW;KAChC,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// @wagmi/core/experimental
|
|
3
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
4
|
-
// biome-ignore lint/performance/noBarrelFile: entrypoint module
|
|
5
|
-
// biome-ignore lint/performance/noReExportAll: entrypoint module
|
|
6
|
-
export * from '@wagmi/core/experimental';
|
|
7
|
-
//# sourceMappingURL=experimental.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.js","sourceRoot":"","sources":["../../../../src/exports/actions/experimental.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,2BAA2B;AAC3B,gFAAgF;AAEhF,gEAAgE;AAChE,iEAAiE;AACjE,cAAc,0BAA0B,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type Config, type GetAccountReturnType, type ResolvedRegister } from '@wagmi/core';
|
|
2
|
-
import { type ToRefs } from 'vue';
|
|
3
|
-
import type { ConfigParameter } from '../types/properties.js';
|
|
4
|
-
export type UseAccountParameters<config extends Config = Config> = ConfigParameter<config>;
|
|
5
|
-
export type UseAccountReturnType<config extends Config = Config> = ToRefs<GetAccountReturnType<config>>;
|
|
6
|
-
/** https://wagmi.sh/vue/api/composables/useAccount */
|
|
7
|
-
export declare function useAccount<config extends Config = ResolvedRegister['config']>(parameters?: UseAccountParameters<config>): UseAccountReturnType<config>;
|
|
8
|
-
//# sourceMappingURL=useAccount.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccount.d.ts","sourceRoot":"","sources":["../../../src/composables/useAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EAEtB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAsC,KAAK,MAAM,EAAU,MAAM,KAAK,CAAA;AAE7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAI7D,MAAM,MAAM,oBAAoB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAC7D,eAAe,CAAC,MAAM,CAAC,CAAA;AAEzB,MAAM,MAAM,oBAAoB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,CACvE,oBAAoB,CAAC,MAAM,CAAC,CAC7B,CAAA;AAED,sDAAsD;AACtD,wBAAgB,UAAU,CAAC,MAAM,SAAS,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,EAC3E,UAAU,GAAE,oBAAoB,CAAC,MAAM,CAAM,GAC5C,oBAAoB,CAAC,MAAM,CAAC,CAa9B"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type GetAccountReturnType } from '@wagmi/core';
|
|
2
|
-
import type { Compute } from '@wagmi/core/internal';
|
|
3
|
-
import type { ConfigParameter } from '../types/properties.js';
|
|
4
|
-
import type { DeepMaybeRef } from '../types/ref.js';
|
|
5
|
-
export type UseAccountEffectParameters = Compute<DeepMaybeRef<{
|
|
6
|
-
onConnect?(data: Compute<Pick<Extract<GetAccountReturnType, {
|
|
7
|
-
status: 'connected';
|
|
8
|
-
}>, 'address' | 'addresses' | 'chain' | 'chainId' | 'connector'> & {
|
|
9
|
-
isReconnected: boolean;
|
|
10
|
-
}>): void;
|
|
11
|
-
onDisconnect?(): void;
|
|
12
|
-
} & ConfigParameter>>;
|
|
13
|
-
/** https://wagmi.sh/vue/api/composables/useAccountEffect */
|
|
14
|
-
export declare function useAccountEffect(parameters?: UseAccountEffectParameters): void;
|
|
15
|
-
//# sourceMappingURL=useAccountEffect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountEffect.d.ts","sourceRoot":"","sources":["../../../src/composables/useAccountEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAgB,MAAM,aAAa,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAGnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAInD,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAC9C,YAAY,CACV;IACE,SAAS,CAAC,CACR,IAAI,EAAE,OAAO,CACX,IAAI,CACF,OAAO,CAAC,oBAAoB,EAAE;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE,CAAC,EACtD,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,CAC5D,GAAG;QACF,aAAa,EAAE,OAAO,CAAA;KACvB,CACF,GACA,IAAI,CAAA;IACP,YAAY,CAAC,IAAI,IAAI,CAAA;CACtB,GAAG,eAAe,CACpB,CACF,CAAA;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,UAAU,GAAE,0BAA+B,QAqC3E"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Config, Connector, ResolvedRegister, SwitchAccountErrorType } from '@wagmi/core';
|
|
2
|
-
import type { Compute } from '@wagmi/core/internal';
|
|
3
|
-
import { type SwitchAccountData, type SwitchAccountMutate, type SwitchAccountMutateAsync, type SwitchAccountVariables } from '@wagmi/core/query';
|
|
4
|
-
import { type Ref } from 'vue';
|
|
5
|
-
import type { ConfigParameter } from '../types/properties.js';
|
|
6
|
-
import type { UseMutationParameters, UseMutationReturnType } from '../utils/query.js';
|
|
7
|
-
export type UseSwitchAccountParameters<config extends Config = Config, context = unknown> = Compute<ConfigParameter<config> & {
|
|
8
|
-
mutation?: UseMutationParameters<SwitchAccountData<config>, SwitchAccountErrorType, SwitchAccountVariables, context> | undefined;
|
|
9
|
-
}>;
|
|
10
|
-
export type UseSwitchAccountReturnType<config extends Config = Config, context = unknown> = Compute<UseMutationReturnType<SwitchAccountData<config>, SwitchAccountErrorType, SwitchAccountVariables, context> & {
|
|
11
|
-
connectors: Ref<readonly Connector[]>;
|
|
12
|
-
switchAccount: SwitchAccountMutate<config, context>;
|
|
13
|
-
switchAccountAsync: SwitchAccountMutateAsync<config, context>;
|
|
14
|
-
}>;
|
|
15
|
-
/** https://wagmi.sh/vue/api/composables/useSwitchAccount */
|
|
16
|
-
export declare function useSwitchAccount<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: UseSwitchAccountParameters<config, context>): UseSwitchAccountReturnType<config, context>;
|
|
17
|
-
//# sourceMappingURL=useSwitchAccount.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSwitchAccount.d.ts","sourceRoot":"","sources":["../../../src/composables/useSwitchAccount.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,sBAAs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,OAAO,CAAM,GAC3D,0BAA0B,CAAC,MAAM,EAAE,OAAO,CAAC,CAoB7C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../../../../src/exports/actions/experimental.ts"],"names":[],"mappings":"AAMA,cAAc,0BAA0B,CAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type Config,
|
|
3
|
-
type GetAccountReturnType,
|
|
4
|
-
getAccount,
|
|
5
|
-
type ResolvedRegister,
|
|
6
|
-
watchAccount,
|
|
7
|
-
} from '@wagmi/core'
|
|
8
|
-
import { onScopeDispose, reactive, readonly, type ToRefs, toRefs } from 'vue'
|
|
9
|
-
|
|
10
|
-
import type { ConfigParameter } from '../types/properties.js'
|
|
11
|
-
import { updateState } from '../utils/updateState.js'
|
|
12
|
-
import { useConfig } from './useConfig.js'
|
|
13
|
-
|
|
14
|
-
export type UseAccountParameters<config extends Config = Config> =
|
|
15
|
-
ConfigParameter<config>
|
|
16
|
-
|
|
17
|
-
export type UseAccountReturnType<config extends Config = Config> = ToRefs<
|
|
18
|
-
GetAccountReturnType<config>
|
|
19
|
-
>
|
|
20
|
-
|
|
21
|
-
/** https://wagmi.sh/vue/api/composables/useAccount */
|
|
22
|
-
export function useAccount<config extends Config = ResolvedRegister['config']>(
|
|
23
|
-
parameters: UseAccountParameters<config> = {},
|
|
24
|
-
): UseAccountReturnType<config> {
|
|
25
|
-
const config = useConfig(parameters)
|
|
26
|
-
|
|
27
|
-
const account = reactive(getAccount(config))
|
|
28
|
-
|
|
29
|
-
const unsubscribe = watchAccount(config, {
|
|
30
|
-
onChange(data) {
|
|
31
|
-
updateState(account, data)
|
|
32
|
-
},
|
|
33
|
-
})
|
|
34
|
-
onScopeDispose(() => unsubscribe())
|
|
35
|
-
|
|
36
|
-
return toRefs(readonly(account)) as UseAccountReturnType<config>
|
|
37
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// @wagmi/core/experimental
|
|
3
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
4
|
-
|
|
5
|
-
// biome-ignore lint/performance/noBarrelFile: entrypoint module
|
|
6
|
-
// biome-ignore lint/performance/noReExportAll: entrypoint module
|
|
7
|
-
export * from '@wagmi/core/experimental'
|