@jaw.id/wagmi 0.0.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/README.md +147 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/lib/Actions.d.ts +2 -0
- package/dist/lib/Actions.d.ts.map +1 -0
- package/dist/lib/Actions.js +1 -0
- package/dist/lib/Connector.d.ts +30 -0
- package/dist/lib/Connector.d.ts.map +1 -0
- package/dist/lib/Connector.js +254 -0
- package/dist/lib/Connector.test.d.ts +2 -0
- package/dist/lib/Connector.test.d.ts.map +1 -0
- package/dist/lib/Connector.test.js +18 -0
- package/dist/lib/Hooks.d.ts +2 -0
- package/dist/lib/Hooks.d.ts.map +1 -0
- package/dist/lib/Hooks.js +1 -0
- package/dist/lib/Query.d.ts +2 -0
- package/dist/lib/Query.d.ts.map +1 -0
- package/dist/lib/Query.js +1 -0
- package/dist/lib/internal/core.d.ts +264 -0
- package/dist/lib/internal/core.d.ts.map +1 -0
- package/dist/lib/internal/core.js +248 -0
- package/dist/lib/internal/query.d.ts +98 -0
- package/dist/lib/internal/query.d.ts.map +1 -0
- package/dist/lib/internal/query.js +67 -0
- package/dist/lib/internal/react.d.ts +247 -0
- package/dist/lib/internal/react.d.ts.map +1 -0
- package/dist/lib/internal/react.js +517 -0
- package/package.json +43 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { type Config, type Connector } from '@wagmi/core';
|
|
2
|
+
import type { Address, Hex } from 'viem';
|
|
3
|
+
import { type PermissionsDetail, type WalletGrantPermissionsResponse, type WalletGetPermissionsResponse, type RevokePermissionApiResponse, type WalletConnectCapabilities, type WalletGetAssetsResponse, type AssetType, type AssetFilter, type PersonalSignRequestData, type TypedDataRequestData, type WalletGetCallsHistoryResponse } from '@jaw.id/core';
|
|
4
|
+
import type { AccountWithCapabilities } from '../Connector.js';
|
|
5
|
+
export declare namespace connect {
|
|
6
|
+
type Parameters = {
|
|
7
|
+
/** The connector to use for connection */
|
|
8
|
+
connector: Connector;
|
|
9
|
+
/** Optional chain ID to connect to */
|
|
10
|
+
chainId?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Capabilities to request during connection.
|
|
13
|
+
* When provided, uses wallet_connect instead of eth_requestAccounts.
|
|
14
|
+
*/
|
|
15
|
+
capabilities?: WalletConnectCapabilities;
|
|
16
|
+
/** Force reconnection even if already connected */
|
|
17
|
+
force?: boolean;
|
|
18
|
+
};
|
|
19
|
+
type ReturnType = {
|
|
20
|
+
/** Connected accounts (with capabilities if requested) */
|
|
21
|
+
accounts: readonly Address[] | readonly AccountWithCapabilities[];
|
|
22
|
+
/** Connected chain ID */
|
|
23
|
+
chainId: number;
|
|
24
|
+
};
|
|
25
|
+
type ErrorType = Error;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Connects to the wallet using the specified connector.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* // Basic connect
|
|
33
|
+
* const result = await Actions.connect(config, {
|
|
34
|
+
* connector: jawWallet({ apiKey: 'xxx' }),
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* // Connect with capabilities (subname issuance)
|
|
38
|
+
* const result = await Actions.connect(config, {
|
|
39
|
+
* connector: jawWallet({ apiKey: 'xxx' }),
|
|
40
|
+
* capabilities: {
|
|
41
|
+
* subnameTextRecords: [
|
|
42
|
+
* { key: 'avatar', value: 'https://example.com/avatar.png' },
|
|
43
|
+
* ],
|
|
44
|
+
* },
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function connect<config extends Config>(config: config, parameters: connect.Parameters): Promise<connect.ReturnType>;
|
|
49
|
+
export declare namespace grantPermissions {
|
|
50
|
+
type Parameters<config extends Config = Config> = {
|
|
51
|
+
address?: Address;
|
|
52
|
+
chainId?: number;
|
|
53
|
+
connector?: Connector;
|
|
54
|
+
/** Timestamp this permission is valid until (exclusive, unix seconds) */
|
|
55
|
+
expiry: number;
|
|
56
|
+
/** Spender address */
|
|
57
|
+
spender: Address;
|
|
58
|
+
/** Permissions details */
|
|
59
|
+
permissions: PermissionsDetail;
|
|
60
|
+
};
|
|
61
|
+
type ReturnType = WalletGrantPermissionsResponse;
|
|
62
|
+
type ErrorType = Error;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Grants permissions to a spender address.
|
|
66
|
+
* This calls wallet_grantPermissions on the connected wallet.
|
|
67
|
+
*/
|
|
68
|
+
export declare function grantPermissions<config extends Config>(config: config, parameters: grantPermissions.Parameters<config>): Promise<grantPermissions.ReturnType>;
|
|
69
|
+
export declare namespace getPermissions {
|
|
70
|
+
type Parameters<config extends Config = Config> = {
|
|
71
|
+
address?: Address;
|
|
72
|
+
chainId?: number;
|
|
73
|
+
connector?: Connector;
|
|
74
|
+
};
|
|
75
|
+
type ReturnType = WalletGetPermissionsResponse;
|
|
76
|
+
type ErrorType = Error;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Gets the current permissions for an address.
|
|
80
|
+
* This calls wallet_getPermissions on the connected wallet.
|
|
81
|
+
*/
|
|
82
|
+
export declare function getPermissions<config extends Config>(config: config, parameters?: getPermissions.Parameters<config>): Promise<getPermissions.ReturnType>;
|
|
83
|
+
export declare namespace revokePermissions {
|
|
84
|
+
type Parameters<config extends Config = Config> = {
|
|
85
|
+
address?: Address;
|
|
86
|
+
chainId?: number;
|
|
87
|
+
connector?: Connector;
|
|
88
|
+
/** ID of the permission to revoke (permission hash from contract) */
|
|
89
|
+
id: `0x${string}`;
|
|
90
|
+
};
|
|
91
|
+
type ReturnType = RevokePermissionApiResponse;
|
|
92
|
+
type ErrorType = Error;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Revokes a permission by its ID.
|
|
96
|
+
* This calls wallet_revokePermissions on the connected wallet.
|
|
97
|
+
*/
|
|
98
|
+
export declare function revokePermissions<config extends Config>(config: config, parameters: revokePermissions.Parameters<config>): Promise<revokePermissions.ReturnType>;
|
|
99
|
+
export declare namespace disconnect {
|
|
100
|
+
type Parameters = {
|
|
101
|
+
/** Specific connector to disconnect from. If omitted, disconnects active connector. */
|
|
102
|
+
connector?: Connector;
|
|
103
|
+
};
|
|
104
|
+
type ReturnType = void;
|
|
105
|
+
type ErrorType = Error;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Disconnects from the wallet.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* // Disconnect active connector
|
|
113
|
+
* await Actions.disconnect(config);
|
|
114
|
+
*
|
|
115
|
+
* // Disconnect specific connector
|
|
116
|
+
* await Actions.disconnect(config, { connector: jawWallet({ apiKey: 'xxx' }) });
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare function disconnect<config extends Config>(config: config, parameters?: disconnect.Parameters): Promise<disconnect.ReturnType>;
|
|
120
|
+
export declare namespace getAssets {
|
|
121
|
+
type Parameters<config extends Config = Config> = {
|
|
122
|
+
/** Address of the account to get assets for */
|
|
123
|
+
address?: Address;
|
|
124
|
+
chainId?: number;
|
|
125
|
+
connector?: Connector;
|
|
126
|
+
/** Narrows results to specified chain IDs (hex format like "0x1") */
|
|
127
|
+
chainFilter?: string[];
|
|
128
|
+
/** Restricts results by asset category */
|
|
129
|
+
assetTypeFilter?: AssetType[];
|
|
130
|
+
/** Filters by specific assets per chain */
|
|
131
|
+
assetFilter?: AssetFilter;
|
|
132
|
+
};
|
|
133
|
+
type ReturnType = WalletGetAssetsResponse;
|
|
134
|
+
type ErrorType = Error;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Gets the assets for an address.
|
|
138
|
+
* This calls wallet_getAssets on the connected wallet.
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* const assets = await Actions.getAssets(config, {
|
|
143
|
+
* chainFilter: ['0x1', '0xa'], // Mainnet and Optimism
|
|
144
|
+
* });
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
export declare function getAssets<config extends Config>(config: config, parameters?: getAssets.Parameters<config>): Promise<getAssets.ReturnType>;
|
|
148
|
+
/** Response type for wallet_getCapabilities (EIP-5792) */
|
|
149
|
+
export type WalletGetCapabilitiesResponse = Record<Hex, Record<string, unknown>>;
|
|
150
|
+
export declare namespace getCapabilities {
|
|
151
|
+
type Parameters<config extends Config = Config> = {
|
|
152
|
+
/** Address of the account to get capabilities for (optional) */
|
|
153
|
+
address?: Address;
|
|
154
|
+
chainId?: number;
|
|
155
|
+
connector?: Connector;
|
|
156
|
+
/** Filter by specific chain IDs (hex format like "0x1") */
|
|
157
|
+
chainFilter?: Hex[];
|
|
158
|
+
};
|
|
159
|
+
type ReturnType = WalletGetCapabilitiesResponse;
|
|
160
|
+
type ErrorType = Error;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Gets the wallet capabilities for an address.
|
|
164
|
+
* This calls wallet_getCapabilities on the wallet (EIP-5792).
|
|
165
|
+
* Can be called without a connected account.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```ts
|
|
169
|
+
* // Get capabilities for all chains
|
|
170
|
+
* const capabilities = await Actions.getCapabilities(config, {});
|
|
171
|
+
*
|
|
172
|
+
* // Get capabilities for specific address
|
|
173
|
+
* const capabilities = await Actions.getCapabilities(config, {
|
|
174
|
+
* address: '0x...',
|
|
175
|
+
* });
|
|
176
|
+
*
|
|
177
|
+
* // Get capabilities filtered by chains
|
|
178
|
+
* const capabilities = await Actions.getCapabilities(config, {
|
|
179
|
+
* chainFilter: ['0x1', '0xa'], // Mainnet and Optimism
|
|
180
|
+
* });
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
export declare function getCapabilities<config extends Config>(config: config, parameters?: getCapabilities.Parameters<config>): Promise<getCapabilities.ReturnType>;
|
|
184
|
+
export declare namespace sign {
|
|
185
|
+
type Parameters<config extends Config = Config> = {
|
|
186
|
+
address?: Address;
|
|
187
|
+
chainId?: number;
|
|
188
|
+
connector?: Connector;
|
|
189
|
+
/** The signing request - supports personal sign (0x45) and typed data (0x01) */
|
|
190
|
+
request: PersonalSignRequestData | TypedDataRequestData;
|
|
191
|
+
};
|
|
192
|
+
type ReturnType = Hex;
|
|
193
|
+
type ErrorType = Error;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Signs a message using the wallet_sign method (ERC-7871).
|
|
197
|
+
* This is a unified signing method that combines personal_sign and eth_signTypedData_v4.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* // Personal sign (EIP-191)
|
|
202
|
+
* const signature = await Actions.sign(config, {
|
|
203
|
+
* request: {
|
|
204
|
+
* type: '0x45',
|
|
205
|
+
* data: { message: 'Hello World' },
|
|
206
|
+
* },
|
|
207
|
+
* });
|
|
208
|
+
*
|
|
209
|
+
* // Typed data sign (EIP-712)
|
|
210
|
+
* const signature = await Actions.sign(config, {
|
|
211
|
+
* request: {
|
|
212
|
+
* type: '0x01',
|
|
213
|
+
* data: {
|
|
214
|
+
* types: { ... },
|
|
215
|
+
* primaryType: 'Mail',
|
|
216
|
+
* domain: { ... },
|
|
217
|
+
* message: { ... },
|
|
218
|
+
* },
|
|
219
|
+
* },
|
|
220
|
+
* });
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
export declare function sign<config extends Config>(config: config, parameters: sign.Parameters<config>): Promise<sign.ReturnType>;
|
|
224
|
+
export declare namespace getCallsHistory {
|
|
225
|
+
type Parameters<config extends Config = Config> = {
|
|
226
|
+
/** Address of the account to get calls history for (required when not connected) */
|
|
227
|
+
address?: Address;
|
|
228
|
+
chainId?: number;
|
|
229
|
+
connector?: Connector;
|
|
230
|
+
/** Optional index cursor for pagination */
|
|
231
|
+
index?: number;
|
|
232
|
+
/** Maximum number of bundles to return (default: 20) */
|
|
233
|
+
limit?: number;
|
|
234
|
+
/** Sort direction based on index (default: 'desc' - newest first) */
|
|
235
|
+
sort?: 'asc' | 'desc';
|
|
236
|
+
};
|
|
237
|
+
type ReturnType = WalletGetCallsHistoryResponse;
|
|
238
|
+
type ErrorType = Error;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Gets the calls history for an address.
|
|
242
|
+
* This calls wallet_getCallsHistory on the wallet.
|
|
243
|
+
* Can be called without a connected account if address is provided.
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* ```ts
|
|
247
|
+
* // Get calls history for connected account
|
|
248
|
+
* const history = await Actions.getCallsHistory(config, {});
|
|
249
|
+
*
|
|
250
|
+
* // Get calls history for specific address (works without connection)
|
|
251
|
+
* const history = await Actions.getCallsHistory(config, {
|
|
252
|
+
* address: '0x...',
|
|
253
|
+
* });
|
|
254
|
+
*
|
|
255
|
+
* // With pagination
|
|
256
|
+
* const history = await Actions.getCallsHistory(config, {
|
|
257
|
+
* address: '0x...',
|
|
258
|
+
* limit: 10,
|
|
259
|
+
* sort: 'desc',
|
|
260
|
+
* });
|
|
261
|
+
* ```
|
|
262
|
+
*/
|
|
263
|
+
export declare function getCallsHistory<config extends Config>(config: config, parameters?: getCallsHistory.Parameters<config>): Promise<getCallsHistory.ReturnType>;
|
|
264
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/lib/internal/core.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,SAAS,EAGf,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5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QACjB,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,2CAA2C;QAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,wDAAwD;QACxD,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,qEAAqE;QACrE,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;KACvB,CAAC;IAEF,KAAY,UAAU,GAAG,6BAA6B,CAAC;IACvD,KAAY,SAAS,GAAG,KAAK,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,eAAe,CAAC,MAAM,SAAS,MAAM,EACzD,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,eAAe,CAAC,UAAU,CAAC,MAAM,CAAM,GAClD,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAqBrC"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { getConnectorClient, disconnect as wagmiDisconnect, } from '@wagmi/core';
|
|
2
|
+
/**
|
|
3
|
+
* Connects to the wallet using the specified connector.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* // Basic connect
|
|
8
|
+
* const result = await Actions.connect(config, {
|
|
9
|
+
* connector: jawWallet({ apiKey: 'xxx' }),
|
|
10
|
+
* });
|
|
11
|
+
*
|
|
12
|
+
* // Connect with capabilities (subname issuance)
|
|
13
|
+
* const result = await Actions.connect(config, {
|
|
14
|
+
* connector: jawWallet({ apiKey: 'xxx' }),
|
|
15
|
+
* capabilities: {
|
|
16
|
+
* subnameTextRecords: [
|
|
17
|
+
* { key: 'avatar', value: 'https://example.com/avatar.png' },
|
|
18
|
+
* ],
|
|
19
|
+
* },
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export async function connect(config, parameters) {
|
|
24
|
+
const { connector, chainId, capabilities } = parameters;
|
|
25
|
+
const result = await connector.connect({ chainId, capabilities });
|
|
26
|
+
return {
|
|
27
|
+
accounts: result.accounts,
|
|
28
|
+
chainId: result.chainId,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Grants permissions to a spender address.
|
|
33
|
+
* This calls wallet_grantPermissions on the connected wallet.
|
|
34
|
+
*/
|
|
35
|
+
export async function grantPermissions(config, parameters) {
|
|
36
|
+
const { address, chainId, connector, expiry, spender, permissions } = parameters;
|
|
37
|
+
const client = await getConnectorClient(config, {
|
|
38
|
+
account: address,
|
|
39
|
+
chainId,
|
|
40
|
+
connector,
|
|
41
|
+
});
|
|
42
|
+
const result = await client.request({
|
|
43
|
+
method: 'wallet_grantPermissions',
|
|
44
|
+
params: [{
|
|
45
|
+
expiry,
|
|
46
|
+
spender,
|
|
47
|
+
permissions,
|
|
48
|
+
chainId: chainId ? `0x${chainId.toString(16)}` : undefined,
|
|
49
|
+
}],
|
|
50
|
+
});
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Gets the current permissions for an address.
|
|
55
|
+
* This calls wallet_getPermissions on the connected wallet.
|
|
56
|
+
*/
|
|
57
|
+
export async function getPermissions(config, parameters = {}) {
|
|
58
|
+
const { address, chainId, connector } = parameters;
|
|
59
|
+
const client = await getConnectorClient(config, {
|
|
60
|
+
account: address,
|
|
61
|
+
chainId,
|
|
62
|
+
connector,
|
|
63
|
+
});
|
|
64
|
+
const result = await client.request({
|
|
65
|
+
method: 'wallet_getPermissions',
|
|
66
|
+
params: [{ address }],
|
|
67
|
+
});
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Revokes a permission by its ID.
|
|
72
|
+
* This calls wallet_revokePermissions on the connected wallet.
|
|
73
|
+
*/
|
|
74
|
+
export async function revokePermissions(config, parameters) {
|
|
75
|
+
const { address, chainId, connector, id } = parameters;
|
|
76
|
+
const client = await getConnectorClient(config, {
|
|
77
|
+
account: address,
|
|
78
|
+
chainId,
|
|
79
|
+
connector,
|
|
80
|
+
});
|
|
81
|
+
const result = await client.request({
|
|
82
|
+
method: 'wallet_revokePermissions',
|
|
83
|
+
params: [{ address, id }],
|
|
84
|
+
});
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Disconnects from the wallet.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* // Disconnect active connector
|
|
93
|
+
* await Actions.disconnect(config);
|
|
94
|
+
*
|
|
95
|
+
* // Disconnect specific connector
|
|
96
|
+
* await Actions.disconnect(config, { connector: jawWallet({ apiKey: 'xxx' }) });
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export async function disconnect(config, parameters = {}) {
|
|
100
|
+
const { connector } = parameters;
|
|
101
|
+
await wagmiDisconnect(config, { connector });
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Gets the assets for an address.
|
|
105
|
+
* This calls wallet_getAssets on the connected wallet.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* const assets = await Actions.getAssets(config, {
|
|
110
|
+
* chainFilter: ['0x1', '0xa'], // Mainnet and Optimism
|
|
111
|
+
* });
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export async function getAssets(config, parameters = {}) {
|
|
115
|
+
const { address, chainId, connector, chainFilter, assetTypeFilter, assetFilter } = parameters;
|
|
116
|
+
const client = await getConnectorClient(config, {
|
|
117
|
+
account: address,
|
|
118
|
+
chainId,
|
|
119
|
+
connector,
|
|
120
|
+
});
|
|
121
|
+
const result = await client.request({
|
|
122
|
+
method: 'wallet_getAssets',
|
|
123
|
+
params: [{
|
|
124
|
+
account: address,
|
|
125
|
+
chainFilter,
|
|
126
|
+
assetTypeFilter,
|
|
127
|
+
assetFilter,
|
|
128
|
+
}],
|
|
129
|
+
});
|
|
130
|
+
return result;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Gets the wallet capabilities for an address.
|
|
134
|
+
* This calls wallet_getCapabilities on the wallet (EIP-5792).
|
|
135
|
+
* Can be called without a connected account.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* // Get capabilities for all chains
|
|
140
|
+
* const capabilities = await Actions.getCapabilities(config, {});
|
|
141
|
+
*
|
|
142
|
+
* // Get capabilities for specific address
|
|
143
|
+
* const capabilities = await Actions.getCapabilities(config, {
|
|
144
|
+
* address: '0x...',
|
|
145
|
+
* });
|
|
146
|
+
*
|
|
147
|
+
* // Get capabilities filtered by chains
|
|
148
|
+
* const capabilities = await Actions.getCapabilities(config, {
|
|
149
|
+
* chainFilter: ['0x1', '0xa'], // Mainnet and Optimism
|
|
150
|
+
* });
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
export async function getCapabilities(config, parameters = {}) {
|
|
154
|
+
const { address, chainId, connector, chainFilter } = parameters;
|
|
155
|
+
const client = await getConnectorClient(config, {
|
|
156
|
+
account: address,
|
|
157
|
+
chainId,
|
|
158
|
+
connector,
|
|
159
|
+
});
|
|
160
|
+
const result = await client.request({
|
|
161
|
+
method: 'wallet_getCapabilities',
|
|
162
|
+
params: [address, chainFilter],
|
|
163
|
+
});
|
|
164
|
+
return result;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Signs a message using the wallet_sign method (ERC-7871).
|
|
168
|
+
* This is a unified signing method that combines personal_sign and eth_signTypedData_v4.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```ts
|
|
172
|
+
* // Personal sign (EIP-191)
|
|
173
|
+
* const signature = await Actions.sign(config, {
|
|
174
|
+
* request: {
|
|
175
|
+
* type: '0x45',
|
|
176
|
+
* data: { message: 'Hello World' },
|
|
177
|
+
* },
|
|
178
|
+
* });
|
|
179
|
+
*
|
|
180
|
+
* // Typed data sign (EIP-712)
|
|
181
|
+
* const signature = await Actions.sign(config, {
|
|
182
|
+
* request: {
|
|
183
|
+
* type: '0x01',
|
|
184
|
+
* data: {
|
|
185
|
+
* types: { ... },
|
|
186
|
+
* primaryType: 'Mail',
|
|
187
|
+
* domain: { ... },
|
|
188
|
+
* message: { ... },
|
|
189
|
+
* },
|
|
190
|
+
* },
|
|
191
|
+
* });
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
export async function sign(config, parameters) {
|
|
195
|
+
const { address, chainId, connector, request } = parameters;
|
|
196
|
+
const client = await getConnectorClient(config, {
|
|
197
|
+
account: address,
|
|
198
|
+
chainId,
|
|
199
|
+
connector,
|
|
200
|
+
});
|
|
201
|
+
const result = await client.request({
|
|
202
|
+
method: 'wallet_sign',
|
|
203
|
+
params: [{ request }],
|
|
204
|
+
});
|
|
205
|
+
return result;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Gets the calls history for an address.
|
|
209
|
+
* This calls wallet_getCallsHistory on the wallet.
|
|
210
|
+
* Can be called without a connected account if address is provided.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* // Get calls history for connected account
|
|
215
|
+
* const history = await Actions.getCallsHistory(config, {});
|
|
216
|
+
*
|
|
217
|
+
* // Get calls history for specific address (works without connection)
|
|
218
|
+
* const history = await Actions.getCallsHistory(config, {
|
|
219
|
+
* address: '0x...',
|
|
220
|
+
* });
|
|
221
|
+
*
|
|
222
|
+
* // With pagination
|
|
223
|
+
* const history = await Actions.getCallsHistory(config, {
|
|
224
|
+
* address: '0x...',
|
|
225
|
+
* limit: 10,
|
|
226
|
+
* sort: 'desc',
|
|
227
|
+
* });
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
export async function getCallsHistory(config, parameters = {}) {
|
|
231
|
+
const { address, chainId, connector, index, limit, sort } = parameters;
|
|
232
|
+
const client = await getConnectorClient(config, {
|
|
233
|
+
account: address,
|
|
234
|
+
chainId,
|
|
235
|
+
connector,
|
|
236
|
+
});
|
|
237
|
+
const result = await client.request({
|
|
238
|
+
method: 'wallet_getCallsHistory',
|
|
239
|
+
params: [{
|
|
240
|
+
address,
|
|
241
|
+
chainId,
|
|
242
|
+
index,
|
|
243
|
+
limit,
|
|
244
|
+
sort,
|
|
245
|
+
}],
|
|
246
|
+
});
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Config, Connector } from '@wagmi/core';
|
|
2
|
+
import type { Address, Hex } from 'viem';
|
|
3
|
+
import type { AssetType, AssetFilter } from '@jaw.id/core';
|
|
4
|
+
export declare namespace getCapabilitiesQueryKey {
|
|
5
|
+
type Parameters<config extends Config = Config> = {
|
|
6
|
+
address?: Address;
|
|
7
|
+
chainId?: number;
|
|
8
|
+
connector?: Connector;
|
|
9
|
+
chainFilter?: Hex[];
|
|
10
|
+
};
|
|
11
|
+
type Value<config extends Config = Config> = readonly [
|
|
12
|
+
'capabilities',
|
|
13
|
+
{
|
|
14
|
+
address: Address | undefined;
|
|
15
|
+
chainId: number | undefined;
|
|
16
|
+
connectorUid: string | undefined;
|
|
17
|
+
chainFilter: Hex[] | undefined;
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates a query key for getCapabilities.
|
|
23
|
+
* Used by useCapabilities hook and for cache invalidation.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getCapabilitiesQueryKey<config extends Config>(parameters: getCapabilitiesQueryKey.Parameters<config>): getCapabilitiesQueryKey.Value<config>;
|
|
26
|
+
export declare namespace getPermissionsQueryKey {
|
|
27
|
+
type Parameters<config extends Config = Config> = {
|
|
28
|
+
address?: Address;
|
|
29
|
+
chainId?: number;
|
|
30
|
+
connector?: Connector;
|
|
31
|
+
};
|
|
32
|
+
type Value<config extends Config = Config> = readonly [
|
|
33
|
+
'permissions',
|
|
34
|
+
{
|
|
35
|
+
address: Address | undefined;
|
|
36
|
+
chainId: number | undefined;
|
|
37
|
+
connectorUid: string | undefined;
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates a query key for getPermissions.
|
|
43
|
+
* Used by usePermissions hook and for cache invalidation.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getPermissionsQueryKey<config extends Config>(parameters: getPermissionsQueryKey.Parameters<config>): getPermissionsQueryKey.Value<config>;
|
|
46
|
+
export declare namespace getAssetsQueryKey {
|
|
47
|
+
type Parameters<config extends Config = Config> = {
|
|
48
|
+
address?: Address;
|
|
49
|
+
chainId?: number;
|
|
50
|
+
connector?: Connector;
|
|
51
|
+
chainFilter?: string[];
|
|
52
|
+
assetTypeFilter?: AssetType[];
|
|
53
|
+
assetFilter?: AssetFilter;
|
|
54
|
+
};
|
|
55
|
+
type Value<config extends Config = Config> = readonly [
|
|
56
|
+
'assets',
|
|
57
|
+
{
|
|
58
|
+
address: Address | undefined;
|
|
59
|
+
chainId: number | undefined;
|
|
60
|
+
connectorUid: string | undefined;
|
|
61
|
+
chainFilter: string[] | undefined;
|
|
62
|
+
assetTypeFilter: AssetType[] | undefined;
|
|
63
|
+
assetFilter: AssetFilter | undefined;
|
|
64
|
+
}
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Creates a query key for getAssets.
|
|
69
|
+
* Used by useGetAssets hook and for cache invalidation.
|
|
70
|
+
*/
|
|
71
|
+
export declare function getAssetsQueryKey<config extends Config>(parameters: getAssetsQueryKey.Parameters<config>): getAssetsQueryKey.Value<config>;
|
|
72
|
+
export declare namespace getCallsHistoryQueryKey {
|
|
73
|
+
type Parameters<config extends Config = Config> = {
|
|
74
|
+
address?: Address;
|
|
75
|
+
chainId?: number;
|
|
76
|
+
connector?: Connector;
|
|
77
|
+
index?: number;
|
|
78
|
+
limit?: number;
|
|
79
|
+
sort?: 'asc' | 'desc';
|
|
80
|
+
};
|
|
81
|
+
type Value<config extends Config = Config> = readonly [
|
|
82
|
+
'callsHistory',
|
|
83
|
+
{
|
|
84
|
+
address: Address | undefined;
|
|
85
|
+
chainId: number | undefined;
|
|
86
|
+
connectorUid: string | undefined;
|
|
87
|
+
index: number | undefined;
|
|
88
|
+
limit: number | undefined;
|
|
89
|
+
sort: 'asc' | 'desc' | undefined;
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Creates a query key for getCallsHistory.
|
|
95
|
+
* Used by useCallsHistory hook and for cache invalidation.
|
|
96
|
+
*/
|
|
97
|
+
export declare function getCallsHistoryQueryKey<config extends Config>(parameters: getCallsHistoryQueryKey.Parameters<config>): getCallsHistoryQueryKey.Value<config>;
|
|
98
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/lib/internal/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAM3D,yBAAiB,uBAAuB,CAAC;IACvC,KAAY,UAAU,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAAI;QACvD,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,WAAW,CAAC,EAAE,GAAG,EAAE,CAAC;KACrB,CAAC;IAEF,KAAY,KAAK,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAAI,SAAS;QAC3D,cAAc;QACd;YACE,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;YAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;YAC5B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;YACjC,WAAW,EAAE,GAAG,EAAE,GAAG,SAAS,C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B,CAAC,UAAU,CAAC,MAAM,CAAC,GACrD,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,CAavC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a query key for getCapabilities.
|
|
3
|
+
* Used by useCapabilities hook and for cache invalidation.
|
|
4
|
+
*/
|
|
5
|
+
export function getCapabilitiesQueryKey(parameters) {
|
|
6
|
+
const { address, chainId, connector, chainFilter } = parameters;
|
|
7
|
+
return [
|
|
8
|
+
'capabilities',
|
|
9
|
+
{
|
|
10
|
+
address,
|
|
11
|
+
chainId,
|
|
12
|
+
connectorUid: connector?.uid,
|
|
13
|
+
chainFilter,
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Creates a query key for getPermissions.
|
|
19
|
+
* Used by usePermissions hook and for cache invalidation.
|
|
20
|
+
*/
|
|
21
|
+
export function getPermissionsQueryKey(parameters) {
|
|
22
|
+
const { address, chainId, connector } = parameters;
|
|
23
|
+
return [
|
|
24
|
+
'permissions',
|
|
25
|
+
{
|
|
26
|
+
address,
|
|
27
|
+
chainId,
|
|
28
|
+
connectorUid: connector?.uid,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Creates a query key for getAssets.
|
|
34
|
+
* Used by useGetAssets hook and for cache invalidation.
|
|
35
|
+
*/
|
|
36
|
+
export function getAssetsQueryKey(parameters) {
|
|
37
|
+
const { address, chainId, connector, chainFilter, assetTypeFilter, assetFilter } = parameters;
|
|
38
|
+
return [
|
|
39
|
+
'assets',
|
|
40
|
+
{
|
|
41
|
+
address,
|
|
42
|
+
chainId,
|
|
43
|
+
connectorUid: connector?.uid,
|
|
44
|
+
chainFilter,
|
|
45
|
+
assetTypeFilter,
|
|
46
|
+
assetFilter,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Creates a query key for getCallsHistory.
|
|
52
|
+
* Used by useCallsHistory hook and for cache invalidation.
|
|
53
|
+
*/
|
|
54
|
+
export function getCallsHistoryQueryKey(parameters) {
|
|
55
|
+
const { address, chainId, connector, index, limit, sort } = parameters;
|
|
56
|
+
return [
|
|
57
|
+
'callsHistory',
|
|
58
|
+
{
|
|
59
|
+
address,
|
|
60
|
+
chainId,
|
|
61
|
+
connectorUid: connector?.uid,
|
|
62
|
+
index,
|
|
63
|
+
limit,
|
|
64
|
+
sort,
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
}
|