viem 2.27.0 → 2.27.1-canary-20250417045626
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 +14 -0
- package/_cjs/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js +17 -10
- package/_cjs/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -1
- package/_cjs/chains/definitions/coreTestnet1.js +31 -0
- package/_cjs/chains/definitions/coreTestnet1.js.map +1 -0
- package/_cjs/chains/definitions/coreTestnet2.js +31 -0
- package/_cjs/chains/definitions/coreTestnet2.js.map +1 -0
- package/_cjs/chains/definitions/metis.js +1 -2
- package/_cjs/chains/definitions/metis.js.map +1 -1
- package/_cjs/chains/definitions/metisSepolia.js +1 -1
- package/_cjs/chains/definitions/metisSepolia.js.map +1 -1
- package/_cjs/chains/definitions/newton.js +1 -1
- package/_cjs/chains/definitions/newton.js.map +1 -1
- package/_cjs/chains/definitions/skale/calypso.js +2 -2
- package/_cjs/chains/definitions/skale/calypso.js.map +1 -1
- package/_cjs/chains/definitions/skale/europa.js +2 -2
- package/_cjs/chains/definitions/skale/europa.js.map +1 -1
- package/_cjs/chains/definitions/skale/exorde.js +1 -1
- package/_cjs/chains/definitions/skale/nebula.js +2 -2
- package/_cjs/chains/definitions/skale/nebula.js.map +1 -1
- package/_cjs/chains/definitions/skale/titan.js +2 -2
- package/_cjs/chains/definitions/skale/titan.js.map +1 -1
- package/_cjs/chains/definitions/skale/titanTestnet.js +1 -1
- package/_cjs/chains/definitions/skale/titanTestnet.js.map +1 -1
- package/_cjs/chains/index.js +15 -11
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/errors/version.js.map +1 -1
- package/_esm/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js +16 -9
- package/_esm/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -1
- package/_esm/chains/definitions/coreTestnet1.js +28 -0
- package/_esm/chains/definitions/coreTestnet1.js.map +1 -0
- package/_esm/chains/definitions/coreTestnet2.js +28 -0
- package/_esm/chains/definitions/coreTestnet2.js.map +1 -0
- package/_esm/chains/definitions/metis.js +1 -2
- package/_esm/chains/definitions/metis.js.map +1 -1
- package/_esm/chains/definitions/metisSepolia.js +1 -1
- package/_esm/chains/definitions/metisSepolia.js.map +1 -1
- package/_esm/chains/definitions/newton.js +1 -1
- package/_esm/chains/definitions/newton.js.map +1 -1
- package/_esm/chains/definitions/skale/calypso.js +2 -2
- package/_esm/chains/definitions/skale/calypso.js.map +1 -1
- package/_esm/chains/definitions/skale/europa.js +2 -2
- package/_esm/chains/definitions/skale/europa.js.map +1 -1
- package/_esm/chains/definitions/skale/exorde.js +1 -1
- package/_esm/chains/definitions/skale/nebula.js +2 -2
- package/_esm/chains/definitions/skale/nebula.js.map +1 -1
- package/_esm/chains/definitions/skale/titan.js +2 -2
- package/_esm/chains/definitions/skale/titan.js.map +1 -1
- package/_esm/chains/definitions/skale/titanTestnet.js +1 -1
- package/_esm/chains/definitions/skale/titanTestnet.js.map +1 -1
- package/_esm/chains/index.js +5 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/errors/version.js.map +1 -1
- package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts +25 -2
- package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts.map +1 -1
- package/_types/chains/definitions/coreTestnet1.d.ts +35 -0
- package/_types/chains/definitions/coreTestnet1.d.ts.map +1 -0
- package/_types/chains/definitions/coreTestnet2.d.ts +35 -0
- package/_types/chains/definitions/coreTestnet2.d.ts.map +1 -0
- package/_types/chains/definitions/metis.d.ts +2 -1
- package/_types/chains/definitions/metis.d.ts.map +1 -1
- package/_types/chains/definitions/metisSepolia.d.ts +2 -1
- package/_types/chains/definitions/metisSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/newton.d.ts +1 -1
- package/_types/chains/definitions/skale/calypso.d.ts +1 -1
- package/_types/chains/definitions/skale/europa.d.ts +1 -1
- package/_types/chains/definitions/skale/exorde.d.ts +1 -1
- package/_types/chains/definitions/skale/nebula.d.ts +1 -1
- package/_types/chains/definitions/skale/titan.d.ts +1 -1
- package/_types/chains/definitions/skale/titanTestnet.d.ts +1 -1
- package/_types/chains/index.d.ts +5 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/errors/version.d.ts.map +1 -1
- package/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.ts +24 -9
- package/chains/definitions/coreTestnet1.ts +28 -0
- package/chains/definitions/coreTestnet2.ts +28 -0
- package/chains/definitions/metis.ts +1 -2
- package/chains/definitions/metisSepolia.ts +1 -1
- package/chains/definitions/newton.ts +1 -1
- package/chains/definitions/skale/calypso.ts +2 -2
- package/chains/definitions/skale/europa.ts +2 -2
- package/chains/definitions/skale/exorde.ts +1 -1
- package/chains/definitions/skale/nebula.ts +2 -2
- package/chains/definitions/skale/titan.ts +2 -2
- package/chains/definitions/skale/titanTestnet.ts +1 -1
- package/chains/index.ts +5 -0
- package/errors/version.ts +1 -1
- package/package.json +1 -1
@@ -177,14 +177,14 @@ export async function toCoinbaseSmartAccount(
|
|
177
177
|
async sign(parameters) {
|
178
178
|
const address = await this.getAddress()
|
179
179
|
|
180
|
-
const
|
180
|
+
const typedData = toReplaySafeTypedData({
|
181
181
|
address,
|
182
182
|
chainId: client.chain!.id,
|
183
183
|
hash: parameters.hash,
|
184
184
|
})
|
185
185
|
|
186
186
|
if (owner.type === 'address') throw new Error('owner cannot sign')
|
187
|
-
const signature = await
|
187
|
+
const signature = await signTypedData({ owner, typedData })
|
188
188
|
|
189
189
|
return wrapSignature({
|
190
190
|
ownerIndex,
|
@@ -196,14 +196,14 @@ export async function toCoinbaseSmartAccount(
|
|
196
196
|
const { message } = parameters
|
197
197
|
const address = await this.getAddress()
|
198
198
|
|
199
|
-
const
|
199
|
+
const typedData = toReplaySafeTypedData({
|
200
200
|
address,
|
201
201
|
chainId: client.chain!.id,
|
202
202
|
hash: hashMessage(message),
|
203
203
|
})
|
204
204
|
|
205
205
|
if (owner.type === 'address') throw new Error('owner cannot sign')
|
206
|
-
const signature = await
|
206
|
+
const signature = await signTypedData({ owner, typedData })
|
207
207
|
|
208
208
|
return wrapSignature({
|
209
209
|
ownerIndex,
|
@@ -216,7 +216,7 @@ export async function toCoinbaseSmartAccount(
|
|
216
216
|
parameters as TypedDataDefinition<TypedData, string>
|
217
217
|
const address = await this.getAddress()
|
218
218
|
|
219
|
-
const
|
219
|
+
const typedData = toReplaySafeTypedData({
|
220
220
|
address,
|
221
221
|
chainId: client.chain!.id,
|
222
222
|
hash: hashTypedData({
|
@@ -228,7 +228,7 @@ export async function toCoinbaseSmartAccount(
|
|
228
228
|
})
|
229
229
|
|
230
230
|
if (owner.type === 'address') throw new Error('owner cannot sign')
|
231
|
-
const signature = await
|
231
|
+
const signature = await signTypedData({ owner, typedData })
|
232
232
|
|
233
233
|
return wrapSignature({
|
234
234
|
ownerIndex,
|
@@ -278,6 +278,21 @@ export async function toCoinbaseSmartAccount(
|
|
278
278
|
// Utilities
|
279
279
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
280
280
|
|
281
|
+
/** @internal */
|
282
|
+
export async function signTypedData({
|
283
|
+
typedData,
|
284
|
+
owner,
|
285
|
+
}: {
|
286
|
+
typedData: TypedDataDefinition
|
287
|
+
owner: OneOf<LocalAccount | WebAuthnAccount>
|
288
|
+
}) {
|
289
|
+
if (owner.type === 'local' && owner.signTypedData)
|
290
|
+
return owner.signTypedData(typedData)
|
291
|
+
|
292
|
+
const hash = hashTypedData(typedData)
|
293
|
+
return sign({ hash, owner })
|
294
|
+
}
|
295
|
+
|
281
296
|
/** @internal */
|
282
297
|
export async function sign({
|
283
298
|
hash,
|
@@ -297,12 +312,12 @@ export async function sign({
|
|
297
312
|
}
|
298
313
|
|
299
314
|
/** @internal */
|
300
|
-
export function
|
315
|
+
export function toReplaySafeTypedData({
|
301
316
|
address,
|
302
317
|
chainId,
|
303
318
|
hash,
|
304
319
|
}: { address: Address; chainId: number; hash: Hash }) {
|
305
|
-
return
|
320
|
+
return {
|
306
321
|
domain: {
|
307
322
|
chainId,
|
308
323
|
name: 'Coinbase Smart Wallet',
|
@@ -321,7 +336,7 @@ export function toReplaySafeHash({
|
|
321
336
|
message: {
|
322
337
|
hash,
|
323
338
|
},
|
324
|
-
}
|
339
|
+
} as const
|
325
340
|
}
|
326
341
|
|
327
342
|
/** @internal */
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
|
3
|
+
export const coreTestnet1 = /*#__PURE__*/ defineChain({
|
4
|
+
id: 1115,
|
5
|
+
name: 'Core Testnet',
|
6
|
+
nativeCurrency: {
|
7
|
+
decimals: 18,
|
8
|
+
name: 'tCore',
|
9
|
+
symbol: 'TCORE',
|
10
|
+
},
|
11
|
+
rpcUrls: {
|
12
|
+
default: { http: ['https://rpc.test.btcs.network'] },
|
13
|
+
},
|
14
|
+
blockExplorers: {
|
15
|
+
default: {
|
16
|
+
name: 'Core Testnet',
|
17
|
+
url: 'https://scan.test.btcs.network',
|
18
|
+
apiUrl: 'https://api.test.btcs.network/api',
|
19
|
+
},
|
20
|
+
},
|
21
|
+
contracts: {
|
22
|
+
multicall3: {
|
23
|
+
address: '0xCcddF20A1932537123C2E48Bd8e00b108B8f7569',
|
24
|
+
blockCreated: 29_350_509,
|
25
|
+
},
|
26
|
+
},
|
27
|
+
testnet: true,
|
28
|
+
})
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
|
3
|
+
export const coreTestnet2 = /*#__PURE__*/ defineChain({
|
4
|
+
id: 1114,
|
5
|
+
name: 'Core Testnet2',
|
6
|
+
nativeCurrency: {
|
7
|
+
decimals: 18,
|
8
|
+
name: 'tCore2',
|
9
|
+
symbol: 'TCORE2',
|
10
|
+
},
|
11
|
+
rpcUrls: {
|
12
|
+
default: { http: ['https://rpc.test2.btcs.network'] },
|
13
|
+
},
|
14
|
+
blockExplorers: {
|
15
|
+
default: {
|
16
|
+
name: 'Core Testnet2',
|
17
|
+
url: 'https://scan.test2.btcs.network',
|
18
|
+
apiUrl: 'https://api.test2.btcs.network/api',
|
19
|
+
},
|
20
|
+
},
|
21
|
+
contracts: {
|
22
|
+
multicall3: {
|
23
|
+
address: '0x3CB285ff3Cd5C7C7e570b1E7DE3De17A0f985e56',
|
24
|
+
blockCreated: 3_838_600,
|
25
|
+
},
|
26
|
+
},
|
27
|
+
testnet: true,
|
28
|
+
})
|
@@ -17,11 +17,10 @@ export const metis = /*#__PURE__*/ defineChain({
|
|
17
17
|
'https://metis-andromeda.rpc.thirdweb.com',
|
18
18
|
'https://metis-andromeda.gateway.tenderly.co',
|
19
19
|
'https://metis.api.onfinality.io/public',
|
20
|
-
'wss://metis-rpc.publicnode.com',
|
21
20
|
'https://andromeda.metis.io/?owner=1088',
|
22
|
-
'wss://metis.drpc.org',
|
23
21
|
'https://metis-mainnet.public.blastapi.io',
|
24
22
|
],
|
23
|
+
webSocket: ['wss://metis-rpc.publicnode.com', 'wss://metis.drpc.org'],
|
25
24
|
},
|
26
25
|
},
|
27
26
|
blockExplorers: {
|
@@ -11,11 +11,11 @@ export const metisSepolia = /*#__PURE__*/ defineChain({
|
|
11
11
|
rpcUrls: {
|
12
12
|
default: {
|
13
13
|
http: [
|
14
|
-
'wss://metis-sepolia-rpc.publicnode.com',
|
15
14
|
'https://sepolia.metisdevops.link',
|
16
15
|
'https://metis-sepolia-rpc.publicnode.com',
|
17
16
|
'https://metis-sepolia.gateway.tenderly.co',
|
18
17
|
],
|
18
|
+
webSocket: ['wss://metis-sepolia-rpc.publicnode.com'],
|
19
19
|
},
|
20
20
|
},
|
21
21
|
blockExplorers: {
|
@@ -2,7 +2,7 @@ import { defineChain } from '../../../utils/chain/defineChain.js'
|
|
2
2
|
|
3
3
|
export const skaleCalypso = /*#__PURE__*/ defineChain({
|
4
4
|
id: 1_564_830_818,
|
5
|
-
name: 'SKALE
|
5
|
+
name: 'SKALE Calypso Hub',
|
6
6
|
nativeCurrency: { name: 'sFUEL', symbol: 'sFUEL', decimals: 18 },
|
7
7
|
rpcUrls: {
|
8
8
|
default: {
|
@@ -21,7 +21,7 @@ export const skaleCalypso = /*#__PURE__*/ defineChain({
|
|
21
21
|
contracts: {
|
22
22
|
multicall3: {
|
23
23
|
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
24
|
-
blockCreated:
|
24
|
+
blockCreated: 3_107_626,
|
25
25
|
},
|
26
26
|
},
|
27
27
|
})
|
@@ -2,7 +2,7 @@ import { defineChain } from '../../../utils/chain/defineChain.js'
|
|
2
2
|
|
3
3
|
export const skaleEuropa = /*#__PURE__*/ defineChain({
|
4
4
|
id: 2_046_399_126,
|
5
|
-
name: 'SKALE
|
5
|
+
name: 'SKALE Europa Hub',
|
6
6
|
nativeCurrency: { name: 'sFUEL', symbol: 'sFUEL', decimals: 18 },
|
7
7
|
rpcUrls: {
|
8
8
|
default: {
|
@@ -19,7 +19,7 @@ export const skaleEuropa = /*#__PURE__*/ defineChain({
|
|
19
19
|
contracts: {
|
20
20
|
multicall3: {
|
21
21
|
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
22
|
-
blockCreated:
|
22
|
+
blockCreated: 3_113_495,
|
23
23
|
},
|
24
24
|
},
|
25
25
|
})
|
@@ -2,7 +2,7 @@ import { defineChain } from '../../../utils/chain/defineChain.js'
|
|
2
2
|
|
3
3
|
export const skaleExorde = /*#__PURE__*/ defineChain({
|
4
4
|
id: 2_139_927_552,
|
5
|
-
name: '
|
5
|
+
name: 'Exorde Network',
|
6
6
|
nativeCurrency: { name: 'sFUEL', symbol: 'sFUEL', decimals: 18 },
|
7
7
|
rpcUrls: {
|
8
8
|
default: {
|
@@ -2,7 +2,7 @@ import { defineChain } from '../../../utils/chain/defineChain.js'
|
|
2
2
|
|
3
3
|
export const skaleNebula = /*#__PURE__*/ defineChain({
|
4
4
|
id: 1_482_601_649,
|
5
|
-
name: 'SKALE
|
5
|
+
name: 'SKALE Nebula Hub',
|
6
6
|
nativeCurrency: { name: 'sFUEL', symbol: 'sFUEL', decimals: 18 },
|
7
7
|
rpcUrls: {
|
8
8
|
default: {
|
@@ -19,7 +19,7 @@ export const skaleNebula = /*#__PURE__*/ defineChain({
|
|
19
19
|
contracts: {
|
20
20
|
multicall3: {
|
21
21
|
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
22
|
-
blockCreated:
|
22
|
+
blockCreated: 2_372_986,
|
23
23
|
},
|
24
24
|
},
|
25
25
|
})
|
@@ -2,7 +2,7 @@ import { defineChain } from '../../../utils/chain/defineChain.js'
|
|
2
2
|
|
3
3
|
export const skaleTitan = /*#__PURE__*/ defineChain({
|
4
4
|
id: 1_350_216_234,
|
5
|
-
name: 'SKALE
|
5
|
+
name: 'SKALE Titan Hub',
|
6
6
|
nativeCurrency: { name: 'sFUEL', symbol: 'sFUEL', decimals: 18 },
|
7
7
|
rpcUrls: {
|
8
8
|
default: {
|
@@ -19,7 +19,7 @@ export const skaleTitan = /*#__PURE__*/ defineChain({
|
|
19
19
|
contracts: {
|
20
20
|
multicall3: {
|
21
21
|
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
22
|
-
blockCreated:
|
22
|
+
blockCreated: 2_076_458,
|
23
23
|
},
|
24
24
|
},
|
25
25
|
})
|
@@ -2,7 +2,7 @@ import { defineChain } from '../../../utils/chain/defineChain.js'
|
|
2
2
|
|
3
3
|
export const skaleTitanTestnet = /*#__PURE__*/ defineChain({
|
4
4
|
id: 1_020_352_220,
|
5
|
-
name: 'SKALE Titan
|
5
|
+
name: 'SKALE Titan Testnet',
|
6
6
|
nativeCurrency: { name: 'sFUEL', symbol: 'sFUEL', decimals: 18 },
|
7
7
|
rpcUrls: {
|
8
8
|
default: {
|
package/chains/index.ts
CHANGED
@@ -98,6 +98,8 @@ export { coinex } from './definitions/coinex.js'
|
|
98
98
|
export { confluxESpace } from './definitions/confluxESpace.js'
|
99
99
|
export { confluxESpaceTestnet } from './definitions/confluxESpaceTestnet.js'
|
100
100
|
export { coreDao } from './definitions/coreDao.js'
|
101
|
+
export { coreTestnet1 } from './definitions/coreTestnet1.js'
|
102
|
+
export { coreTestnet2 } from './definitions/coreTestnet2.js'
|
101
103
|
export { corn } from './definitions/corn.js'
|
102
104
|
export { cornTestnet } from './definitions/cornTestnet.js'
|
103
105
|
export { crab } from './definitions/crab.js'
|
@@ -461,13 +463,16 @@ export { skaleBlockBrawlers } from './definitions/skale/brawl.js'
|
|
461
463
|
export { skaleCalypso } from './definitions/skale/calypso.js'
|
462
464
|
export { skaleCalypsoTestnet } from './definitions/skale/calypsoTestnet.js'
|
463
465
|
export { skaleCryptoBlades } from './definitions/skale/cryptoBlades.js'
|
466
|
+
/** @deprecated */
|
464
467
|
export { skaleCryptoColosseum } from './definitions/skale/cryptoColosseum.js'
|
465
468
|
export { skaleEuropa } from './definitions/skale/europa.js'
|
466
469
|
export { skaleEuropaTestnet } from './definitions/skale/europaTestnet.js'
|
467
470
|
export { skaleExorde } from './definitions/skale/exorde.js'
|
471
|
+
/** @deprecated */
|
468
472
|
export { skaleHumanProtocol } from './definitions/skale/humanProtocol.js'
|
469
473
|
export { skaleNebula } from './definitions/skale/nebula.js'
|
470
474
|
export { skaleNebulaTestnet } from './definitions/skale/nebulaTestnet.js'
|
475
|
+
/** @deprecated Use `skaleEuropa` instead.*/
|
471
476
|
export { skaleRazor } from './definitions/skale/razor.js'
|
472
477
|
export { skaleTitan } from './definitions/skale/titan.js'
|
473
478
|
export { skaleTitanTestnet } from './definitions/skale/titanTestnet.js'
|
package/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '2.27.
|
1
|
+
export const version = '2.27.1-canary-20250417045626'
|