viem 2.50.3 → 2.51.0
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 +28 -0
- package/_cjs/actions/index.js +5 -3
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/public/createAccessList.js +3 -0
- package/_cjs/actions/public/createAccessList.js.map +1 -1
- package/_cjs/actions/public/getBlockReceipts.js +19 -0
- package/_cjs/actions/public/getBlockReceipts.js.map +1 -0
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/chains/definitions/somnia.js +7 -0
- package/_cjs/chains/definitions/somnia.js.map +1 -1
- package/_cjs/chains/definitions/somniaTestnet.js +3 -2
- package/_cjs/chains/definitions/somniaTestnet.js.map +1 -1
- package/_cjs/clients/decorators/public.js +2 -0
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/op-stack/actions/buildProveWithdrawal.js +10 -2
- package/_cjs/op-stack/actions/buildProveWithdrawal.js.map +1 -1
- package/_cjs/op-stack/actions/getGame.js.map +1 -1
- package/_cjs/op-stack/actions/getGames.js +3 -1
- package/_cjs/op-stack/actions/getGames.js.map +1 -1
- package/_cjs/op-stack/actions/getTimeToProve.js +3 -3
- package/_cjs/op-stack/actions/getTimeToProve.js.map +1 -1
- package/_cjs/op-stack/actions/getWithdrawalStatus.js +1 -1
- package/_cjs/op-stack/actions/getWithdrawalStatus.js.map +1 -1
- package/_cjs/op-stack/actions/waitToProve.js +4 -3
- package/_cjs/op-stack/actions/waitToProve.js.map +1 -1
- package/_cjs/op-stack/gameTypes.js +9 -0
- package/_cjs/op-stack/gameTypes.js.map +1 -0
- package/_cjs/op-stack/index.js +7 -1
- package/_cjs/op-stack/index.js.map +1 -1
- package/_cjs/op-stack/utils/getL2BlockNumberAtTimestamp.js +29 -0
- package/_cjs/op-stack/utils/getL2BlockNumberAtTimestamp.js.map +1 -0
- package/_cjs/tempo/Abis.js +477 -11
- package/_cjs/tempo/Abis.js.map +1 -1
- package/_cjs/tempo/Account.js +27 -1
- package/_cjs/tempo/Account.js.map +1 -1
- package/_cjs/tempo/Decorator.js +17 -0
- package/_cjs/tempo/Decorator.js.map +1 -1
- package/_cjs/tempo/Transaction.js +10 -2
- package/_cjs/tempo/Transaction.js.map +1 -1
- package/_cjs/tempo/actions/channel.js +377 -0
- package/_cjs/tempo/actions/channel.js.map +1 -0
- package/_cjs/tempo/actions/index.js +2 -1
- package/_cjs/tempo/actions/index.js.map +1 -1
- package/_cjs/tempo/actions/token.js +57 -27
- package/_cjs/tempo/actions/token.js.map +1 -1
- package/_cjs/tempo/index.js +2 -1
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/utils/formatters/transactionRequest.js.map +1 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_esm/actions/index.js +1 -0
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/public/createAccessList.js +3 -0
- package/_esm/actions/public/createAccessList.js.map +1 -1
- package/_esm/actions/public/getBlockReceipts.js +39 -0
- package/_esm/actions/public/getBlockReceipts.js.map +1 -0
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/chains/definitions/somnia.js +7 -0
- package/_esm/chains/definitions/somnia.js.map +1 -1
- package/_esm/chains/definitions/somniaTestnet.js +3 -2
- package/_esm/chains/definitions/somniaTestnet.js.map +1 -1
- package/_esm/clients/decorators/public.js +2 -0
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/op-stack/actions/buildProveWithdrawal.js +10 -2
- package/_esm/op-stack/actions/buildProveWithdrawal.js.map +1 -1
- package/_esm/op-stack/actions/getGame.js.map +1 -1
- package/_esm/op-stack/actions/getGames.js +3 -1
- package/_esm/op-stack/actions/getGames.js.map +1 -1
- package/_esm/op-stack/actions/getTimeToProve.js +3 -3
- package/_esm/op-stack/actions/getTimeToProve.js.map +1 -1
- package/_esm/op-stack/actions/getWithdrawalStatus.js +1 -1
- package/_esm/op-stack/actions/getWithdrawalStatus.js.map +1 -1
- package/_esm/op-stack/actions/waitToProve.js +4 -3
- package/_esm/op-stack/actions/waitToProve.js.map +1 -1
- package/_esm/op-stack/gameTypes.js +9 -0
- package/_esm/op-stack/gameTypes.js.map +1 -0
- package/_esm/op-stack/index.js +2 -0
- package/_esm/op-stack/index.js.map +1 -1
- package/_esm/op-stack/utils/getL2BlockNumberAtTimestamp.js +33 -0
- package/_esm/op-stack/utils/getL2BlockNumberAtTimestamp.js.map +1 -0
- package/_esm/tempo/Abis.js +476 -10
- package/_esm/tempo/Abis.js.map +1 -1
- package/_esm/tempo/Account.js +27 -2
- package/_esm/tempo/Account.js.map +1 -1
- package/_esm/tempo/Decorator.js +17 -0
- package/_esm/tempo/Decorator.js.map +1 -1
- package/_esm/tempo/Transaction.js +16 -11
- package/_esm/tempo/Transaction.js.map +1 -1
- package/_esm/tempo/actions/channel.js +736 -0
- package/_esm/tempo/actions/channel.js.map +1 -0
- package/_esm/tempo/actions/index.js +1 -0
- package/_esm/tempo/actions/index.js.map +1 -1
- package/_esm/tempo/actions/token.js +61 -28
- package/_esm/tempo/actions/token.js.map +1 -1
- package/_esm/tempo/index.js +1 -1
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/utils/formatters/transactionRequest.js.map +1 -1
- package/_esm/utils/index.js.map +1 -1
- package/_types/actions/index.d.ts +1 -0
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/public/createAccessList.d.ts +2 -1
- package/_types/actions/public/createAccessList.d.ts.map +1 -1
- package/_types/actions/public/getBlockReceipts.d.ts +53 -0
- package/_types/actions/public/getBlockReceipts.d.ts.map +1 -0
- package/_types/actions/wallet/prepareTransactionRequest.d.ts +4 -5
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/chains/definitions/somnia.d.ts +7 -10
- package/_types/chains/definitions/somnia.d.ts.map +1 -1
- package/_types/chains/definitions/somniaTestnet.d.ts +3 -3
- package/_types/chains/definitions/somniaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempo.d.ts +8 -8
- package/_types/chains/definitions/tempoDevnet.d.ts +8 -8
- package/_types/chains/definitions/tempoLocalnet.d.ts +8 -8
- package/_types/chains/definitions/tempoModerato.d.ts +8 -8
- package/_types/chains/index.d.ts +44 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/decorators/public.d.ts +23 -0
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +2 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/op-stack/actions/buildProveWithdrawal.d.ts +2 -1
- package/_types/op-stack/actions/buildProveWithdrawal.d.ts.map +1 -1
- package/_types/op-stack/actions/getGame.d.ts +7 -0
- package/_types/op-stack/actions/getGame.d.ts.map +1 -1
- package/_types/op-stack/actions/getGames.d.ts +7 -0
- package/_types/op-stack/actions/getGames.d.ts.map +1 -1
- package/_types/op-stack/actions/getTimeToProve.d.ts +4 -0
- package/_types/op-stack/actions/getTimeToProve.d.ts.map +1 -1
- package/_types/op-stack/actions/getWithdrawalStatus.d.ts +4 -0
- package/_types/op-stack/actions/getWithdrawalStatus.d.ts.map +1 -1
- package/_types/op-stack/actions/waitToProve.d.ts +4 -0
- package/_types/op-stack/actions/waitToProve.d.ts.map +1 -1
- package/_types/op-stack/gameTypes.d.ts +7 -0
- package/_types/op-stack/gameTypes.d.ts.map +1 -0
- package/_types/op-stack/index.d.ts +2 -0
- package/_types/op-stack/index.d.ts.map +1 -1
- package/_types/op-stack/utils/getL2BlockNumberAtTimestamp.d.ts +21 -0
- package/_types/op-stack/utils/getL2BlockNumberAtTimestamp.d.ts.map +1 -0
- package/_types/tempo/Abis.d.ts +3784 -2271
- package/_types/tempo/Abis.d.ts.map +1 -1
- package/_types/tempo/Account.d.ts +32 -1
- package/_types/tempo/Account.d.ts.map +1 -1
- package/_types/tempo/Decorator.d.ts +246 -1
- package/_types/tempo/Decorator.d.ts.map +1 -1
- package/_types/tempo/Transaction.d.ts.map +1 -1
- package/_types/tempo/actions/accessKey.d.ts +339 -0
- package/_types/tempo/actions/accessKey.d.ts.map +1 -1
- package/_types/tempo/actions/channel.d.ts +4390 -0
- package/_types/tempo/actions/channel.d.ts.map +1 -0
- package/_types/tempo/actions/dex.d.ts +140 -0
- package/_types/tempo/actions/dex.d.ts.map +1 -1
- package/_types/tempo/actions/fee.d.ts +0 -48
- package/_types/tempo/actions/fee.d.ts.map +1 -1
- package/_types/tempo/actions/index.d.ts +1 -0
- package/_types/tempo/actions/index.d.ts.map +1 -1
- package/_types/tempo/actions/reward.d.ts +74 -18
- package/_types/tempo/actions/reward.d.ts.map +1 -1
- package/_types/tempo/actions/token.d.ts +629 -141
- package/_types/tempo/actions/token.d.ts.map +1 -1
- package/_types/tempo/actions/virtualAddress.d.ts +11 -0
- package/_types/tempo/actions/virtualAddress.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +1 -1
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +13 -0
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +6 -1
- package/_types/utils/formatters/transactionRequest.d.ts.map +1 -1
- package/_types/utils/index.d.ts +1 -1
- package/_types/utils/index.d.ts.map +1 -1
- package/actions/index.ts +6 -0
- package/actions/public/createAccessList.ts +4 -0
- package/actions/public/getBlockReceipts.ts +101 -0
- package/actions/wallet/prepareTransactionRequest.ts +7 -10
- package/chains/definitions/somnia.ts +7 -0
- package/chains/definitions/somniaTestnet.ts +3 -2
- package/chains/index.ts +50 -0
- package/clients/decorators/public.ts +30 -0
- package/errors/version.ts +1 -1
- package/index.ts +6 -0
- package/op-stack/actions/buildProveWithdrawal.ts +17 -2
- package/op-stack/actions/getGame.ts +7 -0
- package/op-stack/actions/getGames.ts +10 -1
- package/op-stack/actions/getTimeToProve.ts +7 -3
- package/op-stack/actions/getWithdrawalStatus.ts +6 -1
- package/op-stack/actions/waitToProve.ts +8 -3
- package/op-stack/gameTypes.ts +9 -0
- package/op-stack/index.ts +7 -1
- package/op-stack/utils/getL2BlockNumberAtTimestamp.ts +57 -0
- package/package.json +2 -2
- package/tempo/Abis.ts +477 -10
- package/tempo/Account.ts +67 -2
- package/tempo/Decorator.ts +299 -1
- package/tempo/Transaction.ts +18 -11
- package/tempo/actions/channel.ts +1197 -0
- package/tempo/actions/index.ts +1 -0
- package/tempo/actions/token.ts +85 -26
- package/tempo/index.ts +1 -0
- package/types/eip1193.ts +13 -0
- package/utils/formatters/transactionRequest.ts +13 -1
- package/utils/index.ts +1 -0
package/tempo/actions/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// biome-ignore lint/performance/noBarrelFile: _
|
|
2
2
|
export * as accessKey from './accessKey.js'
|
|
3
3
|
export * as amm from './amm.js'
|
|
4
|
+
export * as channel from './channel.js'
|
|
4
5
|
export * as dex from './dex.js'
|
|
5
6
|
export * as faucet from './faucet.js'
|
|
6
7
|
export * as fee from './fee.js'
|
package/tempo/actions/token.ts
CHANGED
|
@@ -879,6 +879,7 @@ export namespace changeTransferPolicySync {
|
|
|
879
879
|
* name: 'My Token',
|
|
880
880
|
* symbol: 'MTK',
|
|
881
881
|
* currency: 'USD',
|
|
882
|
+
* logoURI: 'https://example.com/token.svg',
|
|
882
883
|
* })
|
|
883
884
|
* ```
|
|
884
885
|
*
|
|
@@ -913,6 +914,8 @@ export namespace create {
|
|
|
913
914
|
currency: string
|
|
914
915
|
/** Token name. */
|
|
915
916
|
name: string
|
|
917
|
+
/** Logo URI. Requires a T5-enabled Tempo chain. */
|
|
918
|
+
logoURI?: string | undefined
|
|
916
919
|
/** Quote token. */
|
|
917
920
|
quoteToken?: TokenId.TokenIdOrAddress | undefined
|
|
918
921
|
/** Unique salt. @default Hex.random(32) */
|
|
@@ -983,6 +986,7 @@ export namespace create {
|
|
|
983
986
|
* name: 'My Token',
|
|
984
987
|
* symbol: 'MTK',
|
|
985
988
|
* currency: 'USD',
|
|
989
|
+
* logoURI: 'https://example.com/token.svg',
|
|
986
990
|
* admin: '0xfeed...fede',
|
|
987
991
|
* }),
|
|
988
992
|
* ]
|
|
@@ -997,6 +1001,7 @@ export namespace create {
|
|
|
997
1001
|
name,
|
|
998
1002
|
symbol,
|
|
999
1003
|
currency,
|
|
1004
|
+
logoURI,
|
|
1000
1005
|
quoteToken = Addresses.pathUsd,
|
|
1001
1006
|
admin,
|
|
1002
1007
|
salt = Hex.random(32),
|
|
@@ -1004,14 +1009,25 @@ export namespace create {
|
|
|
1004
1009
|
return defineCall({
|
|
1005
1010
|
address: Addresses.tip20Factory,
|
|
1006
1011
|
abi: Abis.tip20Factory,
|
|
1007
|
-
args:
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1012
|
+
args:
|
|
1013
|
+
typeof logoURI === 'string'
|
|
1014
|
+
? [
|
|
1015
|
+
name,
|
|
1016
|
+
symbol,
|
|
1017
|
+
currency,
|
|
1018
|
+
TokenId.toAddress(quoteToken),
|
|
1019
|
+
admin,
|
|
1020
|
+
salt,
|
|
1021
|
+
logoURI,
|
|
1022
|
+
]
|
|
1023
|
+
: [
|
|
1024
|
+
name,
|
|
1025
|
+
symbol,
|
|
1026
|
+
currency,
|
|
1027
|
+
TokenId.toAddress(quoteToken),
|
|
1028
|
+
admin,
|
|
1029
|
+
salt,
|
|
1030
|
+
],
|
|
1015
1031
|
functionName: 'createToken',
|
|
1016
1032
|
})
|
|
1017
1033
|
}
|
|
@@ -1054,6 +1070,7 @@ export namespace create {
|
|
|
1054
1070
|
* name: 'My Token',
|
|
1055
1071
|
* symbol: 'MTK',
|
|
1056
1072
|
* currency: 'USD',
|
|
1073
|
+
* logoURI: 'https://example.com/token.svg',
|
|
1057
1074
|
* })
|
|
1058
1075
|
* ```
|
|
1059
1076
|
*
|
|
@@ -1264,7 +1281,7 @@ export namespace getBalance {
|
|
|
1264
1281
|
}
|
|
1265
1282
|
|
|
1266
1283
|
/**
|
|
1267
|
-
* Gets TIP20 token metadata including name, symbol, currency, decimals, and total supply.
|
|
1284
|
+
* Gets TIP20 token metadata including name, symbol, logo URI, currency, decimals, and total supply.
|
|
1268
1285
|
*
|
|
1269
1286
|
* @example
|
|
1270
1287
|
* ```ts
|
|
@@ -1310,6 +1327,11 @@ export async function getMetadata<chain extends Chain | undefined>(
|
|
|
1310
1327
|
abi,
|
|
1311
1328
|
functionName: 'decimals',
|
|
1312
1329
|
},
|
|
1330
|
+
{
|
|
1331
|
+
address,
|
|
1332
|
+
abi,
|
|
1333
|
+
functionName: 'logoURI',
|
|
1334
|
+
},
|
|
1313
1335
|
{
|
|
1314
1336
|
address,
|
|
1315
1337
|
abi,
|
|
@@ -1326,14 +1348,15 @@ export async function getMetadata<chain extends Chain | undefined>(
|
|
|
1326
1348
|
functionName: 'totalSupply',
|
|
1327
1349
|
},
|
|
1328
1350
|
] as const,
|
|
1329
|
-
allowFailure:
|
|
1351
|
+
allowFailure: true,
|
|
1330
1352
|
deployless: true,
|
|
1331
|
-
}).then(([currency, decimals, name, symbol, totalSupply]) => ({
|
|
1332
|
-
name,
|
|
1333
|
-
symbol,
|
|
1334
|
-
currency,
|
|
1335
|
-
decimals,
|
|
1336
|
-
|
|
1353
|
+
}).then(([currency, decimals, logoURI, name, symbol, totalSupply]) => ({
|
|
1354
|
+
name: unwrapMulticallResult(name),
|
|
1355
|
+
symbol: unwrapMulticallResult(symbol),
|
|
1356
|
+
currency: unwrapMulticallResult(currency),
|
|
1357
|
+
decimals: unwrapMulticallResult(decimals),
|
|
1358
|
+
logoURI: unwrapMulticallResult(logoURI, ''),
|
|
1359
|
+
totalSupply: unwrapMulticallResult(totalSupply),
|
|
1337
1360
|
}))
|
|
1338
1361
|
|
|
1339
1362
|
return multicall(client, {
|
|
@@ -1349,6 +1372,11 @@ export async function getMetadata<chain extends Chain | undefined>(
|
|
|
1349
1372
|
abi,
|
|
1350
1373
|
functionName: 'decimals',
|
|
1351
1374
|
},
|
|
1375
|
+
{
|
|
1376
|
+
address,
|
|
1377
|
+
abi,
|
|
1378
|
+
functionName: 'logoURI',
|
|
1379
|
+
},
|
|
1352
1380
|
{
|
|
1353
1381
|
address,
|
|
1354
1382
|
abi,
|
|
@@ -1385,12 +1413,13 @@ export async function getMetadata<chain extends Chain | undefined>(
|
|
|
1385
1413
|
functionName: 'transferPolicyId',
|
|
1386
1414
|
},
|
|
1387
1415
|
] as const,
|
|
1388
|
-
allowFailure:
|
|
1416
|
+
allowFailure: true,
|
|
1389
1417
|
deployless: true,
|
|
1390
1418
|
}).then(
|
|
1391
1419
|
([
|
|
1392
1420
|
currency,
|
|
1393
1421
|
decimals,
|
|
1422
|
+
logoURI,
|
|
1394
1423
|
quoteToken,
|
|
1395
1424
|
name,
|
|
1396
1425
|
paused,
|
|
@@ -1399,19 +1428,44 @@ export async function getMetadata<chain extends Chain | undefined>(
|
|
|
1399
1428
|
totalSupply,
|
|
1400
1429
|
transferPolicyId,
|
|
1401
1430
|
]) => ({
|
|
1402
|
-
name,
|
|
1403
|
-
symbol,
|
|
1404
|
-
currency,
|
|
1405
|
-
decimals,
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1431
|
+
name: unwrapMulticallResult(name),
|
|
1432
|
+
symbol: unwrapMulticallResult(symbol),
|
|
1433
|
+
currency: unwrapMulticallResult(currency),
|
|
1434
|
+
decimals: unwrapMulticallResult(decimals),
|
|
1435
|
+
logoURI: unwrapMulticallResult(logoURI, ''),
|
|
1436
|
+
quoteToken: unwrapMulticallResult(quoteToken),
|
|
1437
|
+
totalSupply: unwrapMulticallResult(totalSupply),
|
|
1438
|
+
paused: unwrapMulticallResult(paused),
|
|
1439
|
+
supplyCap: unwrapMulticallResult(supplyCap),
|
|
1440
|
+
transferPolicyId: unwrapMulticallResult(transferPolicyId),
|
|
1411
1441
|
}),
|
|
1412
1442
|
)
|
|
1413
1443
|
}
|
|
1414
1444
|
|
|
1445
|
+
function unwrapMulticallResult<result>(
|
|
1446
|
+
response:
|
|
1447
|
+
| { result: result; status: 'success' }
|
|
1448
|
+
| { error: unknown; status: 'failure' },
|
|
1449
|
+
): result
|
|
1450
|
+
function unwrapMulticallResult<result>(
|
|
1451
|
+
response:
|
|
1452
|
+
| { result: result; status: 'success' }
|
|
1453
|
+
| { error: unknown; status: 'failure' },
|
|
1454
|
+
fallback: result,
|
|
1455
|
+
): result
|
|
1456
|
+
function unwrapMulticallResult<result>(
|
|
1457
|
+
response:
|
|
1458
|
+
| { result: result; status: 'success' }
|
|
1459
|
+
| { error: unknown; status: 'failure' },
|
|
1460
|
+
...fallback: [] | [result]
|
|
1461
|
+
) {
|
|
1462
|
+
if (response.status === 'failure') {
|
|
1463
|
+
if (fallback.length > 0) return fallback[0]
|
|
1464
|
+
throw response.error
|
|
1465
|
+
}
|
|
1466
|
+
return response.result
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1415
1469
|
export declare namespace getMetadata {
|
|
1416
1470
|
export type Parameters = {
|
|
1417
1471
|
/** Address or ID of the TIP20 token. */
|
|
@@ -1427,6 +1481,11 @@ export declare namespace getMetadata {
|
|
|
1427
1481
|
* Decimals of the token.
|
|
1428
1482
|
*/
|
|
1429
1483
|
decimals: number
|
|
1484
|
+
/**
|
|
1485
|
+
* Logo URI of the token. Returns an empty string if unset or unsupported
|
|
1486
|
+
* by the active Tempo hardfork.
|
|
1487
|
+
*/
|
|
1488
|
+
logoURI: string
|
|
1430
1489
|
/**
|
|
1431
1490
|
* Quote token.
|
|
1432
1491
|
*
|
package/tempo/index.ts
CHANGED
package/types/eip1193.ts
CHANGED
|
@@ -706,6 +706,7 @@ export type PublicRpcSchema = [
|
|
|
706
706
|
]
|
|
707
707
|
ReturnType: {
|
|
708
708
|
accessList: AccessList
|
|
709
|
+
error?: string | undefined
|
|
709
710
|
gasUsed: Quantity
|
|
710
711
|
}
|
|
711
712
|
},
|
|
@@ -867,6 +868,18 @@ export type PublicRpcSchema = [
|
|
|
867
868
|
]
|
|
868
869
|
ReturnType: Block | null
|
|
869
870
|
},
|
|
871
|
+
/**
|
|
872
|
+
* @description Returns the receipts of a block specified by block number, block tag, or block hash
|
|
873
|
+
* @link https://ethereum.github.io/execution-apis/api/methods/eth_getBlockReceipts/
|
|
874
|
+
* @example
|
|
875
|
+
* provider.request({ method: 'eth_getBlockReceipts', params: ['latest'] })
|
|
876
|
+
* // => [{ ... }, { ... }]
|
|
877
|
+
*/
|
|
878
|
+
{
|
|
879
|
+
Method: 'eth_getBlockReceipts'
|
|
880
|
+
Parameters: [block: BlockNumber | BlockTag | Hash]
|
|
881
|
+
ReturnType: TransactionReceipt[] | null
|
|
882
|
+
},
|
|
870
883
|
/**
|
|
871
884
|
* @description Returns the number of transactions in a block specified by block hash
|
|
872
885
|
* @link https://eips.ethereum.org/EIPS/eip-1474
|
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
RpcTransactionRequest,
|
|
12
12
|
} from '../../types/rpc.js'
|
|
13
13
|
import type { TransactionRequest } from '../../types/transaction.js'
|
|
14
|
-
import type { ExactPartial } from '../../types/utils.js'
|
|
14
|
+
import type { ExactPartial, UnionOmit } from '../../types/utils.js'
|
|
15
15
|
import { bytesToHex, numberToHex } from '../encoding/toHex.js'
|
|
16
16
|
import { type DefineFormatterErrorType, defineFormatter } from './formatter.js'
|
|
17
17
|
|
|
@@ -23,6 +23,18 @@ export type FormattedTransactionRequest<
|
|
|
23
23
|
TransactionRequest
|
|
24
24
|
>
|
|
25
25
|
|
|
26
|
+
export type ExtractFormattedTransactionRequest<
|
|
27
|
+
chain extends Chain | undefined,
|
|
28
|
+
request extends { type?: string | undefined },
|
|
29
|
+
///
|
|
30
|
+
_transactionRequest = UnionOmit<FormattedTransactionRequest<chain>, 'from'>,
|
|
31
|
+
_transactionType = request['type'],
|
|
32
|
+
> = _transactionRequest extends { type?: infer type | undefined }
|
|
33
|
+
? Extract<_transactionType, type> extends never
|
|
34
|
+
? never
|
|
35
|
+
: _transactionRequest
|
|
36
|
+
: never
|
|
37
|
+
|
|
26
38
|
export const rpcTransactionType = {
|
|
27
39
|
legacy: '0x0',
|
|
28
40
|
eip2930: '0x1',
|
package/utils/index.ts
CHANGED