@wagmi/core 3.4.8 → 3.4.9

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.
@@ -8,5 +8,6 @@ export * as nonce from './nonce.js';
8
8
  export * as policy from './policy.js';
9
9
  export * as reward from './reward.js';
10
10
  export * as token from './token.js';
11
+ export * as wallet from './wallet.js';
11
12
  export * as zone from './zone.js';
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tempo/actions/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,qDAAqD;AACrD,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tempo/actions/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,qDAAqD;AACrD,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA"}
@@ -0,0 +1,113 @@
1
+ import { Actions } from 'viem/tempo';
2
+ import { getConnectorClient, } from '../../actions/getConnectorClient.js';
3
+ /**
4
+ * Opens the wallet send flow with optional pre-filled send fields.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { createConfig, http } from '@wagmi/core'
9
+ * import { tempo } from '@wagmi/core/chains'
10
+ * import { Actions } from '@wagmi/core/tempo'
11
+ *
12
+ * const config = createConfig({
13
+ * chains: [tempo],
14
+ * transports: {
15
+ * [tempo.id]: http(),
16
+ * },
17
+ * })
18
+ *
19
+ * const { receipt } = await Actions.wallet.send(config, {
20
+ * to: '0x...',
21
+ * token: '0x...',
22
+ * value: '1.5',
23
+ * })
24
+ * ```
25
+ *
26
+ * @param config - Config.
27
+ * @param parameters - Parameters.
28
+ * @returns The submitted send receipt and chain ID.
29
+ */
30
+ export async function send(config, parameters = {}) {
31
+ const { account, chainId, connector, ...rest } = parameters;
32
+ const client = await getConnectorClient(config, {
33
+ account,
34
+ assertChainId: false,
35
+ chainId,
36
+ connector,
37
+ });
38
+ return Actions.wallet.send(client, rest);
39
+ }
40
+ /**
41
+ * Opens the wallet swap flow with optional pre-filled swap fields.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * import { createConfig, http } from '@wagmi/core'
46
+ * import { tempo } from '@wagmi/core/chains'
47
+ * import { Actions } from '@wagmi/core/tempo'
48
+ *
49
+ * const config = createConfig({
50
+ * chains: [tempo],
51
+ * transports: {
52
+ * [tempo.id]: http(),
53
+ * },
54
+ * })
55
+ *
56
+ * const { receipt } = await Actions.wallet.swap(config, {
57
+ * amount: '1.5',
58
+ * token: '0x...',
59
+ * type: 'sell',
60
+ * })
61
+ * ```
62
+ *
63
+ * @param config - Config.
64
+ * @param parameters - Parameters.
65
+ * @returns The submitted swap receipt.
66
+ */
67
+ export async function swap(config, parameters = {}) {
68
+ const { account, chainId, connector, ...rest } = parameters;
69
+ const client = await getConnectorClient(config, {
70
+ account,
71
+ assertChainId: false,
72
+ chainId,
73
+ connector,
74
+ });
75
+ return Actions.wallet.swap(client, rest);
76
+ }
77
+ /**
78
+ * Opens the wallet deposit flow with optional pre-filled deposit fields.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * import { createConfig, http } from '@wagmi/core'
83
+ * import { mainnet } from '@wagmi/core/chains'
84
+ * import { Actions } from '@wagmi/core/tempo'
85
+ *
86
+ * const config = createConfig({
87
+ * chains: [mainnet],
88
+ * transports: {
89
+ * [mainnet.id]: http(),
90
+ * },
91
+ * })
92
+ *
93
+ * const result = await Actions.wallet.deposit(config, {
94
+ * token: '0x...',
95
+ * value: '1.5',
96
+ * })
97
+ * ```
98
+ *
99
+ * @param config - Config.
100
+ * @param parameters - Parameters.
101
+ * @returns Receipts for onchain deposit operations, when applicable.
102
+ */
103
+ export async function deposit(config, parameters = {}) {
104
+ const { account, chainId, connector, ...rest } = parameters;
105
+ const client = await getConnectorClient(config, {
106
+ account,
107
+ assertChainId: false,
108
+ chainId,
109
+ connector,
110
+ });
111
+ return Actions.wallet.deposit(client, { ...rest, chainId });
112
+ }
113
+ //# sourceMappingURL=wallet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../../../src/tempo/actions/wallet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAEL,kBAAkB,GACnB,MAAM,qCAAqC,CAAA;AAgB5C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,MAAc,EACd,aAAsC,EAAE;IAExC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAA;IAE3D,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE;QAC9C,OAA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