viem 2.56.2 → 2.56.5
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/account-abstraction/actions/bundler/getUserOperation.js +3 -3
- package/_cjs/account-abstraction/actions/bundler/getUserOperation.js.map +1 -1
- package/_cjs/chains/definitions/tempo.js +8 -0
- package/_cjs/chains/definitions/tempo.js.map +1 -1
- package/_cjs/chains/definitions/tempoModerato.js +8 -0
- package/_cjs/chains/definitions/tempoModerato.js.map +1 -1
- package/_cjs/chains/definitions/whitechainSepolia.js +25 -1
- package/_cjs/chains/definitions/whitechainSepolia.js.map +1 -1
- package/_cjs/chains/definitions/xgrTestnet.js +26 -0
- package/_cjs/chains/definitions/xgrTestnet.js.map +1 -0
- package/_cjs/chains/index.js +4 -2
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/linea/actions/estimateGas.js +10 -2
- package/_cjs/linea/actions/estimateGas.js.map +1 -1
- package/_cjs/tempo/Multisig.js +109 -6
- package/_cjs/tempo/Multisig.js.map +1 -1
- package/_cjs/tempo/Zone.js.map +1 -1
- package/_cjs/tempo/actions/earn/deployment.js +24 -6
- package/_cjs/tempo/actions/earn/deployment.js.map +1 -1
- package/_cjs/utils/siwe/createSiweMessage.js +1 -1
- package/_cjs/utils/siwe/createSiweMessage.js.map +1 -1
- package/_cjs/utils/siwe/parseSiweMessage.js +1 -1
- package/_cjs/utils/siwe/parseSiweMessage.js.map +1 -1
- package/_esm/account-abstraction/actions/bundler/getUserOperation.js +3 -3
- package/_esm/account-abstraction/actions/bundler/getUserOperation.js.map +1 -1
- package/_esm/chains/definitions/tempo.js +8 -0
- package/_esm/chains/definitions/tempo.js.map +1 -1
- package/_esm/chains/definitions/tempoModerato.js +8 -0
- package/_esm/chains/definitions/tempoModerato.js.map +1 -1
- package/_esm/chains/definitions/whitechainSepolia.js +25 -1
- package/_esm/chains/definitions/whitechainSepolia.js.map +1 -1
- package/_esm/chains/definitions/xgrTestnet.js +23 -0
- package/_esm/chains/definitions/xgrTestnet.js.map +1 -0
- package/_esm/chains/index.js +1 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/linea/actions/estimateGas.js +10 -2
- package/_esm/linea/actions/estimateGas.js.map +1 -1
- package/_esm/tempo/Multisig.js +112 -6
- package/_esm/tempo/Multisig.js.map +1 -1
- package/_esm/tempo/Zone.js +1 -2
- package/_esm/tempo/Zone.js.map +1 -1
- package/_esm/tempo/actions/earn/deployment.js +24 -7
- package/_esm/tempo/actions/earn/deployment.js.map +1 -1
- package/_esm/utils/siwe/createSiweMessage.js +1 -1
- package/_esm/utils/siwe/createSiweMessage.js.map +1 -1
- package/_esm/utils/siwe/parseSiweMessage.js +1 -1
- package/_esm/utils/siwe/parseSiweMessage.js.map +1 -1
- package/_types/account-abstraction/actions/bundler/getUserOperation.d.ts +9 -9
- package/_types/account-abstraction/actions/bundler/getUserOperation.d.ts.map +1 -1
- package/_types/account-abstraction/types/userOperation.d.ts +6 -3
- package/_types/account-abstraction/types/userOperation.d.ts.map +1 -1
- package/_types/chains/definitions/tempo.d.ts +16 -9
- package/_types/chains/definitions/tempo.d.ts.map +1 -1
- package/_types/chains/definitions/tempoModerato.d.ts +16 -9
- package/_types/chains/definitions/tempoModerato.d.ts.map +1 -1
- package/_types/chains/definitions/whitechainSepolia.d.ts +281 -4
- package/_types/chains/definitions/whitechainSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/xgrTestnet.d.ts +51 -0
- package/_types/chains/definitions/xgrTestnet.d.ts.map +1 -0
- package/_types/chains/index.d.ts +1 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/linea/actions/estimateGas.d.ts.map +1 -1
- package/_types/linea/types/rpc.d.ts +2 -2
- package/_types/linea/types/rpc.d.ts.map +1 -1
- package/_types/tempo/Multisig.d.ts +6 -1
- package/_types/tempo/Multisig.d.ts.map +1 -1
- package/_types/tempo/Zone.d.ts +35 -6669
- package/_types/tempo/Zone.d.ts.map +1 -1
- package/_types/tempo/actions/earn/deployment.d.ts +2 -3
- package/_types/tempo/actions/earn/deployment.d.ts.map +1 -1
- package/account-abstraction/actions/bundler/getUserOperation.ts +9 -9
- package/account-abstraction/types/userOperation.ts +6 -3
- package/chains/definitions/tempo.ts +8 -0
- package/chains/definitions/tempoModerato.ts +8 -0
- package/chains/definitions/whitechainSepolia.ts +26 -1
- package/chains/definitions/xgrTestnet.ts +23 -0
- package/chains/index.ts +1 -0
- package/errors/version.ts +1 -1
- package/linea/actions/estimateGas.ts +11 -1
- package/linea/types/rpc.ts +2 -1
- package/package.json +1 -1
- package/tempo/Multisig.ts +150 -9
- package/tempo/Zone.ts +30 -4
- package/tempo/actions/earn/deployment.ts +24 -9
- package/utils/siwe/createSiweMessage.ts +1 -1
- package/utils/siwe/parseSiweMessage.ts +1 -1
|
@@ -17,6 +17,7 @@ import { zeroAddress } from '../../../constants/address.js'
|
|
|
17
17
|
import { maxUint64, maxUint256 } from '../../../constants/number.js'
|
|
18
18
|
import { AccountNotFoundError } from '../../../errors/account.js'
|
|
19
19
|
import { BaseError, type BaseErrorType } from '../../../errors/base.js'
|
|
20
|
+
import { ChainNotFoundError } from '../../../errors/chain.js'
|
|
20
21
|
import { TransactionReceiptRevertedError } from '../../../errors/transaction.js'
|
|
21
22
|
import type { Chain } from '../../../types/chain.js'
|
|
22
23
|
import type { GetEventArgs } from '../../../types/contract.js'
|
|
@@ -25,6 +26,7 @@ import type { Compute } from '../../../types/utils.js'
|
|
|
25
26
|
import { getAbiItem } from '../../../utils/abi/getAbiItem.js'
|
|
26
27
|
import { parseEventLogs } from '../../../utils/abi/parseEventLogs.js'
|
|
27
28
|
import { isAddressEqual } from '../../../utils/address/isAddressEqual.js'
|
|
29
|
+
import { getChainContractAddress } from '../../../utils/chain/getChainContractAddress.js'
|
|
28
30
|
import * as Abis from '../../Abis.js'
|
|
29
31
|
import * as Addresses from '../../Addresses.js'
|
|
30
32
|
import type {
|
|
@@ -913,7 +915,6 @@ export class DeployErc4626StackError extends BaseError {
|
|
|
913
915
|
* })
|
|
914
916
|
* const result = await Actions.earn.deployErc4626StackSync(client, {
|
|
915
917
|
* deploymentId: '0x...',
|
|
916
|
-
* factories: { earn: '0x...', erc4626Engine: '0x...' },
|
|
917
918
|
* venue: '0x...',
|
|
918
919
|
* })
|
|
919
920
|
* ```
|
|
@@ -946,6 +947,20 @@ export async function deployErc4626StackSync<
|
|
|
946
947
|
)
|
|
947
948
|
throw new Error('`bindingAccount` must match `owner`.')
|
|
948
949
|
|
|
950
|
+
const factories = (() => {
|
|
951
|
+
if (parameters.factories) return parameters.factories
|
|
952
|
+
if (!client.chain) throw new ChainNotFoundError()
|
|
953
|
+
return {
|
|
954
|
+
earn: getChainContractAddress({
|
|
955
|
+
chain: client.chain,
|
|
956
|
+
contract: 'earnFactory',
|
|
957
|
+
}),
|
|
958
|
+
erc4626Engine: getChainContractAddress({
|
|
959
|
+
chain: client.chain,
|
|
960
|
+
contract: 'erc4626EngineFactory',
|
|
961
|
+
}),
|
|
962
|
+
}
|
|
963
|
+
})()
|
|
949
964
|
validateDeploymentId(parameters.deploymentId)
|
|
950
965
|
if (
|
|
951
966
|
parameters.resume &&
|
|
@@ -954,7 +969,7 @@ export async function deployErc4626StackSync<
|
|
|
954
969
|
)
|
|
955
970
|
throw new Error('The resumed deployment ID does not match `deploymentId`.')
|
|
956
971
|
await validateContracts(client, {
|
|
957
|
-
factories
|
|
972
|
+
factories,
|
|
958
973
|
venue: parameters.venue,
|
|
959
974
|
})
|
|
960
975
|
|
|
@@ -973,7 +988,7 @@ export async function deployErc4626StackSync<
|
|
|
973
988
|
}
|
|
974
989
|
const engineArgs = {
|
|
975
990
|
deploymentId: parameters.deploymentId,
|
|
976
|
-
factory:
|
|
991
|
+
factory: factories.erc4626Engine,
|
|
977
992
|
name: parameters.name,
|
|
978
993
|
owner,
|
|
979
994
|
symbol: parameters.symbol,
|
|
@@ -1028,7 +1043,7 @@ export async function deployErc4626StackSync<
|
|
|
1028
1043
|
if ((receipt as TransactionReceipt).status === 'pending')
|
|
1029
1044
|
return { receipt } as never
|
|
1030
1045
|
createErc4626Engine.extractEvent(receipt.logs, {
|
|
1031
|
-
factory:
|
|
1046
|
+
factory: factories.erc4626Engine,
|
|
1032
1047
|
})
|
|
1033
1048
|
}
|
|
1034
1049
|
await verifyEngine(client, engineArgs, predictedEngine)
|
|
@@ -1041,7 +1056,7 @@ export async function deployErc4626StackSync<
|
|
|
1041
1056
|
deploymentId: parameters.deploymentId,
|
|
1042
1057
|
distributor: parameters.distributor,
|
|
1043
1058
|
engine: predictedEngine,
|
|
1044
|
-
factory:
|
|
1059
|
+
factory: factories.earn,
|
|
1045
1060
|
fees: parameters.fees,
|
|
1046
1061
|
owner,
|
|
1047
1062
|
transferPolicyId: parameters.transferPolicyId,
|
|
@@ -1084,7 +1099,7 @@ export async function deployErc4626StackSync<
|
|
|
1084
1099
|
if ((receipt as TransactionReceipt).status === 'pending')
|
|
1085
1100
|
return { receipt } as never
|
|
1086
1101
|
const { args } = createStack.extractEvent(receipt.logs, {
|
|
1087
|
-
factory:
|
|
1102
|
+
factory: factories.earn,
|
|
1088
1103
|
})
|
|
1089
1104
|
state.vault = args.earnVault
|
|
1090
1105
|
if (
|
|
@@ -1103,7 +1118,7 @@ export async function deployErc4626StackSync<
|
|
|
1103
1118
|
if (!state.vault) {
|
|
1104
1119
|
const event = await findStackDeployment(client, {
|
|
1105
1120
|
earnShare: predicted.earnShare,
|
|
1106
|
-
factory:
|
|
1121
|
+
factory: factories.earn,
|
|
1107
1122
|
fromBlock: parameters.fromBlock,
|
|
1108
1123
|
})
|
|
1109
1124
|
state.vault = event.args.earnVault
|
|
@@ -1203,8 +1218,8 @@ export namespace deployErc4626StackSync {
|
|
|
1203
1218
|
deploymentId: Hex.Hex
|
|
1204
1219
|
/** Optional protected fee distributor. */
|
|
1205
1220
|
distributor?: EarnDistributorConfiguration | undefined
|
|
1206
|
-
/** Reviewed factory pair from one Earn release. */
|
|
1207
|
-
factories
|
|
1221
|
+
/** Reviewed factory pair from one Earn release. @default `client.chain.contracts` */
|
|
1222
|
+
factories?: EarnFactoryAddresses | undefined
|
|
1208
1223
|
/** Initial fee configuration. Omit for fee-free deployment. */
|
|
1209
1224
|
fees?: EarnFeeConfiguration | undefined
|
|
1210
1225
|
/** First block to search for a prior factory deployment event. */
|
|
@@ -175,4 +175,4 @@ const ipRegex =
|
|
|
175
175
|
/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$/
|
|
176
176
|
const localhostRegex = /^localhost(:[0-9]{1,5})?$/
|
|
177
177
|
const nonceRegex = /^[a-zA-Z0-9]{8,}$/
|
|
178
|
-
const schemeRegex = /^([a-zA-Z][a-zA-Z0-9
|
|
178
|
+
const schemeRegex = /^([a-zA-Z][a-zA-Z0-9+\-.]*)$/
|
|
@@ -65,7 +65,7 @@ export function parseSiweMessage(
|
|
|
65
65
|
|
|
66
66
|
// https://regexr.com/80gdj
|
|
67
67
|
const prefixRegex =
|
|
68
|
-
/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9
|
|
68
|
+
/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+\-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/
|
|
69
69
|
|
|
70
70
|
// https://regexr.com/80gf9
|
|
71
71
|
const suffixRegex =
|