viem 2.28.3 → 2.28.4
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/CHANGELOG.md +6 -0
- package/_cjs/actions/wallet/getCallsStatus.js.map +1 -1
- package/_cjs/actions/wallet/getCapabilities.js.map +1 -1
- package/_cjs/actions/wallet/sendCalls.js +18 -2
- package/_cjs/actions/wallet/sendCalls.js.map +1 -1
- package/_cjs/chains/definitions/plumeMainnet.js +4 -4
- package/_cjs/chains/definitions/plumeMainnet.js.map +1 -1
- package/_cjs/chains/definitions/plumeSepolia.js +4 -4
- package/_cjs/chains/definitions/plumeSepolia.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/types/capabilities.js +3 -0
- package/_cjs/types/capabilities.js.map +1 -0
- package/_cjs/types/eip1193.js.map +1 -1
- package/_cjs/types/register.js +3 -0
- package/_cjs/types/register.js.map +1 -0
- package/_esm/actions/wallet/getCallsStatus.js.map +1 -1
- package/_esm/actions/wallet/getCapabilities.js.map +1 -1
- package/_esm/actions/wallet/sendCalls.js +18 -2
- package/_esm/actions/wallet/sendCalls.js.map +1 -1
- package/_esm/chains/definitions/plumeMainnet.js +4 -4
- package/_esm/chains/definitions/plumeMainnet.js.map +1 -1
- package/_esm/chains/definitions/plumeSepolia.js +4 -4
- package/_esm/chains/definitions/plumeSepolia.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/types/capabilities.js +2 -0
- package/_esm/types/capabilities.js.map +1 -0
- package/_esm/types/eip1193.js.map +1 -1
- package/_esm/types/register.js +2 -0
- package/_esm/types/register.js.map +1 -0
- package/_types/actions/wallet/getCallsStatus.d.ts +3 -2
- package/_types/actions/wallet/getCallsStatus.d.ts.map +1 -1
- package/_types/actions/wallet/getCapabilities.d.ts +2 -2
- package/_types/actions/wallet/getCapabilities.d.ts.map +1 -1
- package/_types/actions/wallet/sendCalls.d.ts +7 -5
- package/_types/actions/wallet/sendCalls.d.ts.map +1 -1
- package/_types/chains/definitions/plumeMainnet.d.ts +4 -4
- package/_types/chains/definitions/plumeSepolia.d.ts +4 -4
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +8 -2
- package/_types/index.d.ts.map +1 -1
- package/_types/types/capabilities.d.ts +36 -0
- package/_types/types/capabilities.d.ts.map +1 -0
- package/_types/types/eip1193.d.ts +8 -13
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/types/register.d.ts +14 -0
- package/_types/types/register.d.ts.map +1 -0
- package/actions/wallet/getCallsStatus.ts +3 -5
- package/actions/wallet/getCapabilities.ts +12 -8
- package/actions/wallet/sendCalls.ts +32 -11
- package/chains/definitions/plumeMainnet.ts +4 -4
- package/chains/definitions/plumeSepolia.ts +4 -4
- package/errors/version.ts +1 -1
- package/index.ts +11 -3
- package/package.json +1 -1
- package/types/capabilities.ts +58 -0
- package/types/eip1193.ts +8 -18
- package/types/register.ts +15 -0
@@ -12,15 +12,15 @@ export const plumeSepolia = /*#__PURE__*/ defineChain({
|
|
12
12
|
},
|
13
13
|
rpcUrls: {
|
14
14
|
default: {
|
15
|
-
http: ['https://testnet-rpc.
|
16
|
-
webSocket: ['wss://testnet-rpc.
|
15
|
+
http: ['https://testnet-rpc.plume.org'],
|
16
|
+
webSocket: ['wss://testnet-rpc.plume.org'],
|
17
17
|
},
|
18
18
|
},
|
19
19
|
blockExplorers: {
|
20
20
|
default: {
|
21
21
|
name: 'Blockscout',
|
22
|
-
url: 'https://testnet-explorer.
|
23
|
-
apiUrl: 'https://testnet-explorer.
|
22
|
+
url: 'https://testnet-explorer.plume.org',
|
23
|
+
apiUrl: 'https://testnet-explorer.plume.org/api',
|
24
24
|
},
|
25
25
|
},
|
26
26
|
contracts: {
|
package/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '2.28.
|
1
|
+
export const version = '2.28.4'
|
package/index.ts
CHANGED
@@ -13,7 +13,6 @@ export {
|
|
13
13
|
type ParseAbiItem,
|
14
14
|
type ParseAbiParameter,
|
15
15
|
type ParseAbiParameters,
|
16
|
-
type ResolvedRegister,
|
17
16
|
type TypedData,
|
18
17
|
type TypedDataDomain,
|
19
18
|
type TypedDataParameter,
|
@@ -1105,6 +1104,16 @@ export type {
|
|
1105
1104
|
BlockTag,
|
1106
1105
|
Uncle,
|
1107
1106
|
} from './types/block.js'
|
1107
|
+
export type {
|
1108
|
+
Capabilities,
|
1109
|
+
/** @deprecated Use `Capabilities` instead. */
|
1110
|
+
Capabilities as WalletCapabilities,
|
1111
|
+
CapabilitiesSchema,
|
1112
|
+
/** @deprecated Use `ChainIdToCapabilities` instead. */
|
1113
|
+
ChainIdToCapabilities as WalletCapabilitiesRecord,
|
1114
|
+
ChainIdToCapabilities,
|
1115
|
+
ExtractCapabilities,
|
1116
|
+
} from './types/capabilities.js'
|
1108
1117
|
export type {
|
1109
1118
|
ByteArray,
|
1110
1119
|
Hash,
|
@@ -1133,8 +1142,6 @@ export type {
|
|
1133
1142
|
RpcSchema,
|
1134
1143
|
RpcSchemaOverride,
|
1135
1144
|
TestRpcSchema,
|
1136
|
-
WalletCapabilities,
|
1137
|
-
WalletCapabilitiesRecord,
|
1138
1145
|
WalletCallReceipt,
|
1139
1146
|
WalletGetCallsStatusReturnType,
|
1140
1147
|
WalletGrantPermissionsParameters,
|
@@ -1178,6 +1185,7 @@ export type {
|
|
1178
1185
|
SignedAuthorization,
|
1179
1186
|
SignedAuthorizationList,
|
1180
1187
|
} from './types/authorization.js'
|
1188
|
+
export type { ResolvedRegister } from './types/register.js'
|
1181
1189
|
export type {
|
1182
1190
|
Index,
|
1183
1191
|
Quantity,
|
package/package.json
CHANGED
@@ -0,0 +1,58 @@
|
|
1
|
+
import type { Hex } from './misc.js'
|
2
|
+
import type { ResolvedRegister } from './register.js'
|
3
|
+
import type { Prettify } from './utils.js'
|
4
|
+
|
5
|
+
export type CapabilitiesSchema = ResolvedRegister['CapabilitiesSchema']
|
6
|
+
|
7
|
+
export type DefaultCapabilitiesSchema = {
|
8
|
+
getCapabilities: {
|
9
|
+
ReturnType: {
|
10
|
+
atomic?:
|
11
|
+
| {
|
12
|
+
status: 'supported' | 'ready' | 'unsupported'
|
13
|
+
}
|
14
|
+
| undefined
|
15
|
+
paymasterService?:
|
16
|
+
| {
|
17
|
+
supported: boolean
|
18
|
+
}
|
19
|
+
| undefined
|
20
|
+
}
|
21
|
+
}
|
22
|
+
sendCalls: {
|
23
|
+
Request: {
|
24
|
+
paymasterService?:
|
25
|
+
| {
|
26
|
+
[chainId: number]: {
|
27
|
+
url: string
|
28
|
+
context?: Record<string, any> | undefined
|
29
|
+
}
|
30
|
+
}
|
31
|
+
| undefined
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
export type Capabilities<capabilities extends Record<string, any> = {}> = {
|
37
|
+
[key: string]: any
|
38
|
+
} & capabilities
|
39
|
+
|
40
|
+
export type ChainIdToCapabilities<
|
41
|
+
capabilities extends Capabilities = Capabilities,
|
42
|
+
id extends string | number = Hex,
|
43
|
+
> = {
|
44
|
+
[chainId in id]: capabilities
|
45
|
+
}
|
46
|
+
|
47
|
+
export type ExtractCapabilities<
|
48
|
+
method extends string,
|
49
|
+
key extends 'Request' | 'ReturnType',
|
50
|
+
> = Prettify<
|
51
|
+
method extends keyof CapabilitiesSchema
|
52
|
+
? CapabilitiesSchema[method] extends {
|
53
|
+
[k in key]: infer value extends Record<string, any>
|
54
|
+
}
|
55
|
+
? Capabilities<value>
|
56
|
+
: Capabilities
|
57
|
+
: Capabilities
|
58
|
+
>
|
package/types/eip1193.ts
CHANGED
@@ -9,6 +9,7 @@ import type {
|
|
9
9
|
RpcUserOperationReceipt,
|
10
10
|
} from '../account-abstraction/types/rpc.js'
|
11
11
|
import type { BlockTag } from './block.js'
|
12
|
+
import type { Capabilities, ChainIdToCapabilities } from './capabilities.js'
|
12
13
|
import type { Hash, Hex, LogTopic } from './misc.js'
|
13
14
|
import type { RpcStateOverride } from './rpc.js'
|
14
15
|
import type {
|
@@ -121,17 +122,6 @@ export type NetworkSync = {
|
|
121
122
|
startingBlock: Quantity
|
122
123
|
}
|
123
124
|
|
124
|
-
export type WalletCapabilities = {
|
125
|
-
[capability: string]: any
|
126
|
-
}
|
127
|
-
|
128
|
-
export type WalletCapabilitiesRecord<
|
129
|
-
capabilities extends WalletCapabilities = WalletCapabilities,
|
130
|
-
id extends string | number = Hex,
|
131
|
-
> = {
|
132
|
-
[chainId in id]: capabilities
|
133
|
-
}
|
134
|
-
|
135
125
|
export type WalletCallReceipt<quantity = Hex, status = Hex> = {
|
136
126
|
logs: {
|
137
127
|
address: Hex
|
@@ -187,13 +177,13 @@ export type WalletGrantPermissionsReturnType = {
|
|
187
177
|
}
|
188
178
|
|
189
179
|
export type WalletGetCallsStatusReturnType<
|
190
|
-
capabilities extends
|
180
|
+
capabilities extends Capabilities = Capabilities,
|
191
181
|
numberType = Hex,
|
192
182
|
bigintType = Hex,
|
193
183
|
receiptStatus = Hex,
|
194
184
|
> = {
|
195
185
|
atomic: boolean
|
196
|
-
capabilities?: capabilities |
|
186
|
+
capabilities?: capabilities | Capabilities | undefined
|
197
187
|
chainId: numberType
|
198
188
|
id: string
|
199
189
|
receipts?: WalletCallReceipt<bigintType, receiptStatus>[] | undefined
|
@@ -215,19 +205,19 @@ export type WalletPermission = {
|
|
215
205
|
}
|
216
206
|
|
217
207
|
export type WalletSendCallsParameters<
|
218
|
-
capabilities extends
|
208
|
+
capabilities extends Capabilities = Capabilities,
|
219
209
|
chainId extends Hex | number = Hex,
|
220
210
|
quantity extends Quantity | bigint = Quantity,
|
221
211
|
> = [
|
222
212
|
{
|
223
213
|
atomicRequired: boolean
|
224
214
|
calls: readonly {
|
225
|
-
capabilities?: capabilities |
|
215
|
+
capabilities?: capabilities | Capabilities | undefined
|
226
216
|
to?: Address | undefined
|
227
217
|
data?: Hex | undefined
|
228
218
|
value?: quantity | undefined
|
229
219
|
}[]
|
230
|
-
capabilities?: capabilities |
|
220
|
+
capabilities?: capabilities | Capabilities | undefined
|
231
221
|
chainId?: chainId | undefined
|
232
222
|
id?: string | undefined
|
233
223
|
from?: Address | undefined
|
@@ -236,7 +226,7 @@ export type WalletSendCallsParameters<
|
|
236
226
|
]
|
237
227
|
|
238
228
|
export type WalletSendCallsReturnType<
|
239
|
-
capabilities extends
|
229
|
+
capabilities extends Capabilities = Capabilities,
|
240
230
|
> = {
|
241
231
|
capabilities?: capabilities | undefined
|
242
232
|
id: string
|
@@ -1800,7 +1790,7 @@ export type WalletRpcSchema = [
|
|
1800
1790
|
| readonly [Address | undefined]
|
1801
1791
|
| readonly [Address | undefined, readonly Hex[] | undefined]
|
1802
1792
|
| undefined
|
1803
|
-
ReturnType: Prettify<
|
1793
|
+
ReturnType: Prettify<ChainIdToCapabilities>
|
1804
1794
|
},
|
1805
1795
|
/**
|
1806
1796
|
* @description Gets the wallets current permissions.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { DefaultCapabilitiesSchema } from './capabilities.js'
|
2
|
+
|
3
|
+
// biome-ignore lint/suspicious/noEmptyInterface:
|
4
|
+
export interface Register {}
|
5
|
+
|
6
|
+
export type ResolvedRegister = {
|
7
|
+
CapabilitiesSchema: Register extends { CapabilitiesSchema: infer schema }
|
8
|
+
? schema
|
9
|
+
: DefaultRegister['CapabilitiesSchema']
|
10
|
+
}
|
11
|
+
|
12
|
+
/** @internal */
|
13
|
+
type DefaultRegister = {
|
14
|
+
CapabilitiesSchema: DefaultCapabilitiesSchema
|
15
|
+
}
|