wagmi 3.6.13 → 3.6.15
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/tempo/hooks/wallet.js +10 -8
- package/dist/esm/tempo/hooks/wallet.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/tempo/hooks/wallet.d.ts +11 -9
- package/dist/types/tempo/hooks/wallet.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/tempo/hooks/wallet.ts +19 -17
- package/src/version.ts +1 -1
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '3.6.
|
|
1
|
+
export const version = '3.6.15';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -4,27 +4,29 @@ import type { ConfigParameter } from '@wagmi/core/internal';
|
|
|
4
4
|
import { Actions } from '@wagmi/core/tempo';
|
|
5
5
|
import { type UseMutationParameters } from '../../utils/query.js';
|
|
6
6
|
/**
|
|
7
|
-
* Hook for
|
|
7
|
+
* Hook for transferring a TIP-20 token. By default, submits the transfer
|
|
8
|
+
* without showing an editable UI. Pass `editable: true` to open the
|
|
9
|
+
* wallet's send UI with optional pre-filled fields.
|
|
8
10
|
*
|
|
9
11
|
* @example
|
|
10
12
|
* ```tsx
|
|
11
13
|
* import { Hooks } from 'wagmi/tempo'
|
|
12
14
|
*
|
|
13
15
|
* function App() {
|
|
14
|
-
* const { mutate, isPending } = Hooks.wallet.
|
|
16
|
+
* const { mutate, isPending } = Hooks.wallet.useTransfer()
|
|
15
17
|
*
|
|
16
18
|
* return (
|
|
17
19
|
* <button
|
|
18
20
|
* onClick={() =>
|
|
19
21
|
* mutate({
|
|
22
|
+
* amount: '1.5',
|
|
20
23
|
* to: '0x...',
|
|
21
|
-
* token: '
|
|
22
|
-
* value: '1.5',
|
|
24
|
+
* token: 'pathUSD',
|
|
23
25
|
* })
|
|
24
26
|
* }
|
|
25
27
|
* disabled={isPending}
|
|
26
28
|
* >
|
|
27
|
-
*
|
|
29
|
+
* Transfer
|
|
28
30
|
* </button>
|
|
29
31
|
* )
|
|
30
32
|
* }
|
|
@@ -33,12 +35,12 @@ import { type UseMutationParameters } from '../../utils/query.js';
|
|
|
33
35
|
* @param parameters - Parameters.
|
|
34
36
|
* @returns Mutation result.
|
|
35
37
|
*/
|
|
36
|
-
export declare function
|
|
37
|
-
export declare namespace
|
|
38
|
+
export declare function useTransfer<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useTransfer.Parameters<config, context>): useTransfer.ReturnType<config, context>;
|
|
39
|
+
export declare namespace useTransfer {
|
|
38
40
|
type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
|
|
39
|
-
mutation?: UseMutationParameters<Actions.wallet.
|
|
41
|
+
mutation?: UseMutationParameters<Actions.wallet.transfer.ReturnValue, Actions.wallet.transfer.ErrorType, Actions.wallet.transfer.Parameters<config>, context> | undefined;
|
|
40
42
|
};
|
|
41
|
-
type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.wallet.
|
|
43
|
+
type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.wallet.transfer.ReturnValue, Actions.wallet.transfer.ErrorType, Actions.wallet.transfer.Parameters<config>, context>;
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
46
|
* Hook for opening the wallet swap flow with optional pre-filled swap fields.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../../src/tempo/hooks/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,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gB,UAAU,CACxB,MAAM,SAAS,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,EAClD,OAAO,GAAG,OAAO,EAEjB,UAAU,GAAE,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,CAAM,GACtD,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAUxC;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,KAAK,UAAU,CACb,MAAM,SAAS,MAAM,GAAG,MAAM,EAC9B,OAAO,GAAG,OAAO,IACf,eAAe,CAAC,MAAM,CAAC,GAAG;QAC5B,QAAQ,CAAC,EACL,qBAAqB,CACnB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAClC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,EAChC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EACzC,OAAO,CACR,GACD,SAAS,CAAA;KACd,CAAA;IAED,KAAK,UAAU,CACb,MAAM,SAAS,MAAM,GAAG,MAAM,EAC9B,OAAO,GAAG,OAAO,IACf,iBAAiB,CACnB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAClC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,EAChC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EACzC,OAAO,CACR,CAAA;CACF"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "3.6.
|
|
1
|
+
export declare const version = "3.6.15";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wagmi",
|
|
3
3
|
"description": "React Hooks for Ethereum",
|
|
4
|
-
"version": "3.6.
|
|
4
|
+
"version": "3.6.15",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"use-sync-external-store": "1.4.0",
|
|
95
|
-
"@wagmi/connectors": "8.0.
|
|
96
|
-
"@wagmi/core": "3.4.
|
|
95
|
+
"@wagmi/connectors": "8.0.14",
|
|
96
|
+
"@wagmi/core": "3.4.12"
|
|
97
97
|
},
|
|
98
98
|
"contributors": [
|
|
99
99
|
"awkweb.eth <t@wevm.dev>",
|
|
@@ -6,27 +6,29 @@ import { useConfig } from '../../hooks/useConfig.js'
|
|
|
6
6
|
import { type UseMutationParameters, useMutation } from '../../utils/query.js'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Hook for
|
|
9
|
+
* Hook for transferring a TIP-20 token. By default, submits the transfer
|
|
10
|
+
* without showing an editable UI. Pass `editable: true` to open the
|
|
11
|
+
* wallet's send UI with optional pre-filled fields.
|
|
10
12
|
*
|
|
11
13
|
* @example
|
|
12
14
|
* ```tsx
|
|
13
15
|
* import { Hooks } from 'wagmi/tempo'
|
|
14
16
|
*
|
|
15
17
|
* function App() {
|
|
16
|
-
* const { mutate, isPending } = Hooks.wallet.
|
|
18
|
+
* const { mutate, isPending } = Hooks.wallet.useTransfer()
|
|
17
19
|
*
|
|
18
20
|
* return (
|
|
19
21
|
* <button
|
|
20
22
|
* onClick={() =>
|
|
21
23
|
* mutate({
|
|
24
|
+
* amount: '1.5',
|
|
22
25
|
* to: '0x...',
|
|
23
|
-
* token: '
|
|
24
|
-
* value: '1.5',
|
|
26
|
+
* token: 'pathUSD',
|
|
25
27
|
* })
|
|
26
28
|
* }
|
|
27
29
|
* disabled={isPending}
|
|
28
30
|
* >
|
|
29
|
-
*
|
|
31
|
+
* Transfer
|
|
30
32
|
* </button>
|
|
31
33
|
* )
|
|
32
34
|
* }
|
|
@@ -35,33 +37,33 @@ import { type UseMutationParameters, useMutation } from '../../utils/query.js'
|
|
|
35
37
|
* @param parameters - Parameters.
|
|
36
38
|
* @returns Mutation result.
|
|
37
39
|
*/
|
|
38
|
-
export function
|
|
40
|
+
export function useTransfer<
|
|
39
41
|
config extends Config = ResolvedRegister['config'],
|
|
40
42
|
context = unknown,
|
|
41
43
|
>(
|
|
42
|
-
parameters:
|
|
43
|
-
):
|
|
44
|
+
parameters: useTransfer.Parameters<config, context> = {},
|
|
45
|
+
): useTransfer.ReturnType<config, context> {
|
|
44
46
|
const { mutation } = parameters
|
|
45
47
|
const config = useConfig(parameters)
|
|
46
48
|
return useMutation({
|
|
47
49
|
...mutation,
|
|
48
50
|
async mutationFn(variables) {
|
|
49
|
-
return Actions.wallet.
|
|
51
|
+
return Actions.wallet.transfer(config, variables)
|
|
50
52
|
},
|
|
51
|
-
mutationKey: ['wallet', '
|
|
53
|
+
mutationKey: ['wallet', 'transfer'],
|
|
52
54
|
})
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
export declare namespace
|
|
57
|
+
export declare namespace useTransfer {
|
|
56
58
|
type Parameters<
|
|
57
59
|
config extends Config = Config,
|
|
58
60
|
context = unknown,
|
|
59
61
|
> = ConfigParameter<config> & {
|
|
60
62
|
mutation?:
|
|
61
63
|
| UseMutationParameters<
|
|
62
|
-
Actions.wallet.
|
|
63
|
-
Actions.wallet.
|
|
64
|
-
Actions.wallet.
|
|
64
|
+
Actions.wallet.transfer.ReturnValue,
|
|
65
|
+
Actions.wallet.transfer.ErrorType,
|
|
66
|
+
Actions.wallet.transfer.Parameters<config>,
|
|
65
67
|
context
|
|
66
68
|
>
|
|
67
69
|
| undefined
|
|
@@ -71,9 +73,9 @@ export declare namespace useSend {
|
|
|
71
73
|
config extends Config = Config,
|
|
72
74
|
context = unknown,
|
|
73
75
|
> = UseMutationResult<
|
|
74
|
-
Actions.wallet.
|
|
75
|
-
Actions.wallet.
|
|
76
|
-
Actions.wallet.
|
|
76
|
+
Actions.wallet.transfer.ReturnValue,
|
|
77
|
+
Actions.wallet.transfer.ErrorType,
|
|
78
|
+
Actions.wallet.transfer.Parameters<config>,
|
|
77
79
|
context
|
|
78
80
|
>
|
|
79
81
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '3.6.
|
|
1
|
+
export const version = '3.6.15'
|