diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 164223b3e3..ed467cafb7 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -63,7 +63,7 @@ jobs: strategy: matrix: typescript-version: ['5.0.4', '5.1.6', '5.2.2', 'latest'] - viem-version: ['2.0.0', 'latest'] + viem-version: ['2.8.3', 'latest'] steps: - name: Clone repository diff --git a/package.json b/package.json index e6f98255d3..ec78131b08 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "sherif": "^0.8.1", "simple-git-hooks": "^2.9.0", "typescript": "5.3.2", - "viem": "2.8.2", + "viem": "2.8.3", "vitest": "^0.34.5" }, "packageManager": "pnpm@8.10.5", diff --git a/packages/core/src/actions/call.test.ts b/packages/core/src/actions/call.test.ts index 3e5d166120..e0b714d14b 100644 --- a/packages/core/src/actions/call.test.ts +++ b/packages/core/src/actions/call.test.ts @@ -64,17 +64,17 @@ test('nonce too low', async () => { nonce: 0, }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - "Nonce provided for the transaction is lower than the current nonce of the account. - Try increasing the nonce or find the latest nonce with \`getTransactionCount\`. + "Nonce provided for the transaction is lower than the current nonce of the account. + Try increasing the nonce or find the latest nonce with \`getTransactionCount\`. - Raw Call Arguments: - from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 - to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 - data: 0x06fdde03 - nonce: 0 + Raw Call Arguments: + from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 + data: 0x06fdde03 + nonce: 0 - Details: nonce too low - Version: viem@2.0.0" + Details: nonce too low + Version: viem@2.8.2" `) }) @@ -86,24 +86,24 @@ test('insufficient funds', async () => { value: parseEther('100000'), }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - "The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account. - - This error could arise when the account does not have enough funds to: - - pay for the total gas fee, - - pay for the value to send. - - The cost of the transaction is calculated as \`gas * gas fee + value\`, where: - - \`gas\` is the amount of gas needed for transaction to execute, - - \`gas fee\` is the gas fee, - - \`value\` is the amount of ether to send to the recipient. - - Raw Call Arguments: - from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 - to: 0x70997970c51812dc3a010c7d01b50e0d17dc79c8 - value: 100000 ETH - - Details: Insufficient funds for gas * price + value - Version: viem@2.0.0" + "The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account. + + This error could arise when the account does not have enough funds to: + - pay for the total gas fee, + - pay for the value to send. + + The cost of the transaction is calculated as \`gas * gas fee + value\`, where: + - \`gas\` is the amount of gas needed for transaction to execute, + - \`gas fee\` is the gas fee, + - \`value\` is the amount of ether to send to the recipient. + + Raw Call Arguments: + from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + to: 0x70997970c51812dc3a010c7d01b50e0d17dc79c8 + value: 100000 ETH + + Details: Insufficient funds for gas * price + value + Version: viem@2.8.2" `) }) @@ -117,16 +117,16 @@ test('maxFeePerGas less than maxPriorityFeePerGas', async () => { maxPriorityFeePerGas: parseGwei('22'), }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - "The provided tip (\`maxPriorityFeePerGas\` = 22 gwei) cannot be higher than the fee cap (\`maxFeePerGas\` = 20 gwei). + "The provided tip (\`maxPriorityFeePerGas\` = 22 gwei) cannot be higher than the fee cap (\`maxFeePerGas\` = 20 gwei). - Raw Call Arguments: - from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 - to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 - data: 0x06fdde03 - maxFeePerGas: 20 gwei - maxPriorityFeePerGas: 22 gwei + Raw Call Arguments: + from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 + data: 0x06fdde03 + maxFeePerGas: 20 gwei + maxPriorityFeePerGas: 22 gwei - Version: viem@2.0.0" + Version: viem@2.8.2" `) }) @@ -146,7 +146,7 @@ test('contract revert (contract error)', async () => { data: 0xa0712d6800000000000000000000000000000000000000000000000000000000000001a4 Details: execution reverted: revert: Token ID is taken - Version: viem@2.0.0" + Version: viem@2.8.2" `) }) @@ -158,14 +158,14 @@ test('contract revert (insufficient params)', async () => { to: address.wagmiMintExample, }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - "Execution reverted for an unknown reason. + "Execution reverted for an unknown reason. - Raw Call Arguments: - from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 - to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 - data: 0xa0712d68 + Raw Call Arguments: + from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 + data: 0xa0712d68 - Details: execution reverted - Version: viem@2.0.0" + Details: execution reverted + Version: viem@2.8.2" `) }) diff --git a/packages/core/src/actions/connect.test.ts b/packages/core/src/actions/connect.test.ts index 47a62778d3..bb7e18e6ac 100644 --- a/packages/core/src/actions/connect.test.ts +++ b/packages/core/src/actions/connect.test.ts @@ -57,7 +57,7 @@ test('behavior: user rejected request', async () => { [UserRejectedRequestError: User rejected the request. Details: Failed to connect. - Version: viem@2.0.0] + Version: viem@2.8.2] `) }) diff --git a/packages/core/src/actions/getBalance.test.ts b/packages/core/src/actions/getBalance.test.ts index 38a75384e8..f2d7354c36 100644 --- a/packages/core/src/actions/getBalance.test.ts +++ b/packages/core/src/actions/getBalance.test.ts @@ -70,9 +70,9 @@ describe('getBalance', () => { ).resolves.toMatchInlineSnapshot(` { "decimals": 18, - "formatted": "3989.559062564299199392", + "formatted": "0.559062564299199392", "symbol": "DAI", - "value": 3989559062564299199392n, + "value": 559062564299199392n, } `) }) diff --git a/packages/core/src/actions/getBlock.test.ts b/packages/core/src/actions/getBlock.test.ts index 2e041b79c8..6f95505b9b 100644 --- a/packages/core/src/actions/getBlock.test.ts +++ b/packages/core/src/actions/getBlock.test.ts @@ -16,126 +16,128 @@ test('args: blockNumber', async () => { ) expect(block).toMatchInlineSnapshot(` { - "baseFeePerGas": 31986155981n, + "baseFeePerGas": 24076814055n, + "blobGasUsed": undefined, "chainId": 1, "difficulty": 0n, - "extraData": "0x626f62612d6275696c6465722e636f6d", + "excessBlobGas": undefined, + "extraData": "0x546974616e2028746974616e6275696c6465722e78797a29", "gasLimit": 30000000n, - "gasUsed": 10413493n, - "hash": "0x03a96587556ab955c3456f809368bd2f7a190964ff00962a586c246ef39c93f5", - "logsBloom": "0x103141420cb0c3103b2013128c89300b12070c417c06810cb009102443524b02702dc1c8089006080a033bc3188495060a118242c82168030200df2948aa01012642d68a49a38e292d07413a880909a2c92000195064ce8415359412ec2023a07e5205000a14082182ce6488182a2ac3251064338499dea8420d0cba774aa221277307500c8298b1485c8879824250005040102d810018fb4e20684208126880e2a1894019916814234244c008b20ca004110e88004090282c640e0e1002036011d20002c25012140031708209ff008048c0c2ea80e04a166a1fe30a8203b10021f0600810810180180520a08e215aa88f043430e24841401419101c2440164b", - "miner": "0x3b64216ad1a58f61538b4fa1b27327675ab7ed67", - "mixHash": "0xdac10159cb5c8251f8ca656d74c5c32c08ef13b10cabc8bb09908a404d52eecf", + "gasUsed": 26325393n, + "hash": "0xcfa5df46abf1521f68ae72a7f7c4661949f4fb08a3d1296fe8082f6580a414e0", + "logsBloom": "0x2df3b5a24d2d57e7d73f96dbfea3577b1d5fbaacfcb9b5fb86db74d2e4ffd1e48bba050c33edada84fe477213937158c1e95d3da9f457f6f36e3ff0afdffcb667c5ee5f9e3ddffa9db1af6bbf15fcbbca5139717d5eedab4daa63cd8bb7dfa3e976b1e7023e2dc4586cef3caa0b73d6ff2ba3afb989c9f58f6b67bb4ed596c5aeb78cef51f69ad3675df70ffbd2aa6576d7c9e3debd00cccec3b69fc617b8568bfe588f7e126ef591f34ddd0d8b68c28b7ed45b46af3a7bb75c0e2fe4bec54fb772c87ae6f7efcdfb13139b758cfda4d98dffe426fef6d1c2e55f36b5bb1f0a2aef7bcbdf83d31ea646cf6ef3fe9d8b9af2ad4197f7ea2de462bd029fdef7e6f", + "miner": "0x4838b106fce9647bdf1e7877bf73ce8b0bad5f97", + "mixHash": "0x92ac9cd6e57bacd7c7d3e9b087c3907b1c085e284eec2dce7379a847cb4c9940", "nonce": "0x0000000000000000", - "number": 18677381n, - "parentHash": "0x26b6b1583f45019f38f62a3bfa026e2b3213d92a3996a527d23554d5d71e29fd", - "receiptsRoot": "0xc4d6b5c42258d5a6861e25e99f2929bb8a7456d52ac6e6a96e5c3bcd8bfe2e0a", + "number": 19258213n, + "parentHash": "0x40cb7885ad596d0397d664a4dc9ef5c2011c09e9a62b386f838f5f5362582ebb", + "receiptsRoot": "0x910a69ba396ab4f59c2c77aa413e941fc4da97a021b8d8bbf12c125bfc42d9d3", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - "size": 141249n, - "stateRoot": "0x01cb576afed4f3f56c86529507ed9951b2849d8895c02fa9a35ab7771695b26c", - "timestamp": 1701262235n, + "size": 158252n, + "stateRoot": "0x6e27207d219b0251dbc2fde71f3cde8e33703261f032056453c27275500dddbc", + "timestamp": 1708302299n, "totalDifficulty": 58750003716598352816469n, - "transactionsRoot": "0xd99b2a58709a3690d962f9cb8d6b941455143c5fe24fc5540bd6ff4d06e6d7ea", + "transactionsRoot": "0x897dba26a3a940b62f86da6e5fec5f71312ad7c871a4031db79dee67442c9d1e", "uncles": [], "withdrawals": [ { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x1053ffc", - "index": "0x190fb46", - "validatorIndex": "0xf3ab6", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x112da72", + "index": "0x21ec946", + "validatorIndex": "0x5cd8e", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x103ec51", - "index": "0x190fb47", - "validatorIndex": "0xf3ab7", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x1119345", + "index": "0x21ec947", + "validatorIndex": "0x5cd8f", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x1052bbc", - "index": "0x190fb48", - "validatorIndex": "0xf3ab8", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x110e2ca", + "index": "0x21ec948", + "validatorIndex": "0x5cd90", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x1041aee", - "index": "0x190fb49", - "validatorIndex": "0xf3ab9", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x1119245", + "index": "0x21ec949", + "validatorIndex": "0x5cd91", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x104e073", - "index": "0x190fb4a", - "validatorIndex": "0xf3aba", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x1115a03", + "index": "0x21ec94a", + "validatorIndex": "0x5cd92", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x10480de", - "index": "0x190fb4b", - "validatorIndex": "0xf3abb", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x111cf3f", + "index": "0x21ec94b", + "validatorIndex": "0x5cd93", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x104ab57", - "index": "0x190fb4c", - "validatorIndex": "0xf3abc", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x1106006", + "index": "0x21ec94c", + "validatorIndex": "0x5cd94", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x383fece", - "index": "0x190fb4d", - "validatorIndex": "0xf3abd", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x1115bb3", + "index": "0x21ec94d", + "validatorIndex": "0x5cd95", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x1057082", - "index": "0x190fb4e", - "validatorIndex": "0xf3abe", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x111e0d9", + "index": "0x21ec94e", + "validatorIndex": "0x5cd96", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x1048c65", - "index": "0x190fb4f", - "validatorIndex": "0xf3abf", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x110829f", + "index": "0x21ec94f", + "validatorIndex": "0x5cd97", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x10405de", - "index": "0x190fb50", - "validatorIndex": "0xf3ac0", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x11029ab", + "index": "0x21ec950", + "validatorIndex": "0x5cd98", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x105e565", - "index": "0x190fb51", - "validatorIndex": "0xf3ac1", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x11140a6", + "index": "0x21ec951", + "validatorIndex": "0x5cd99", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x1041e0e", - "index": "0x190fb52", - "validatorIndex": "0xf3ac2", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x111396c", + "index": "0x21ec952", + "validatorIndex": "0x5cd9a", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x1048d6e", - "index": "0x190fb53", - "validatorIndex": "0xf3ac3", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x110de16", + "index": "0x21ec953", + "validatorIndex": "0x5cd9b", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x104db30", - "index": "0x190fb54", - "validatorIndex": "0xf3ac4", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x1121062", + "index": "0x21ec954", + "validatorIndex": "0x5cd9c", }, { - "address": "0xf20b338752976878754518183873602902360704", - "amount": "0x10421f6", - "index": "0x190fb55", - "validatorIndex": "0xf3ac5", + "address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f", + "amount": "0x11188bc", + "index": "0x21ec955", + "validatorIndex": "0x5cd9d", }, ], - "withdrawalsRoot": "0xd67d00f01ac780dd7292e464f0873611c0b9cfaf7d630400ed04abf312cb53f4", + "withdrawalsRoot": "0x26638497bd55075025ac2362d92bd789ac1232fd50c4b3866565280318027950", } `) }) diff --git a/packages/core/src/actions/getToken.test.ts b/packages/core/src/actions/getToken.test.ts index 392a2a2e83..8b8d6102e6 100644 --- a/packages/core/src/actions/getToken.test.ts +++ b/packages/core/src/actions/getToken.test.ts @@ -78,7 +78,7 @@ test('behavior: bogus token', async () => { address: 0xa0cf798816d4b9b9866b5330eea46a18382f251e function: decimals() - Docs: https://viem.sh/docs/contract/multicall.html - Version: viem@2.0.0" + Docs: https://viem.sh/docs/contract/multicall + Version: viem@2.8.2" `) }) diff --git a/packages/core/src/actions/prepareTransactionRequest.test.ts b/packages/core/src/actions/prepareTransactionRequest.test.ts index 8deaad6a63..1a40e6591c 100644 --- a/packages/core/src/actions/prepareTransactionRequest.test.ts +++ b/packages/core/src/actions/prepareTransactionRequest.test.ts @@ -26,6 +26,7 @@ test('default', async () => { } = request expect(rest).toMatchInlineSnapshot(` { + "chainId": 1, "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "to": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8", "type": "eip1559", @@ -55,6 +56,7 @@ test('parameters: account', async () => { expect(rest).toMatchInlineSnapshot(` { "account": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "chainId": 1, "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "to": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8", "type": "eip1559", @@ -83,6 +85,7 @@ test('parameters: connector', async () => { } = request expect(rest).toMatchInlineSnapshot(` { + "chainId": 1, "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "to": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8", "type": "eip1559", @@ -120,6 +123,7 @@ test('behavior: local account', async () => { "source": "privateKey", "type": "local", }, + "chainId": 1, "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "to": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8", "type": "eip1559", diff --git a/packages/core/src/actions/readContracts.test.ts b/packages/core/src/actions/readContracts.test.ts index 6d888ac316..f48fc8145d 100644 --- a/packages/core/src/actions/readContracts.test.ts +++ b/packages/core/src/actions/readContracts.test.ts @@ -396,8 +396,8 @@ test('throws if allowFailure=false & a contract method fails', async () => { function: tokenOfOwnerByIndex(address owner, uint256 index) args: (0xA0Cf798816D4b9b9866b5330EEa46a18382f251e, 69420) - Docs: https://viem.sh/docs/contract/readContract.html - Version: viem@2.0.0" + Docs: https://viem.sh/docs/contract/readContract + Version: viem@2.8.2" `, ) }) @@ -449,8 +449,8 @@ test('allowFailure=true & a contract method fails', async () => { function: tokenOfOwnerByIndex(address owner, uint256 index) args: (0xA0Cf798816D4b9b9866b5330EEa46a18382f251e, 69420) - Docs: https://viem.sh/docs/contract/readContract.html - Version: viem@2.0.0], + Docs: https://viem.sh/docs/contract/readContract + Version: viem@2.8.2], "result": undefined, "status": "failure", }, @@ -463,8 +463,8 @@ test('allowFailure=true & a contract method fails', async () => { function: tokenOfOwnerByIndex(address owner, uint256 index) args: (0xA0Cf798816D4b9b9866b5330EEa46a18382f251e, 69421) - Docs: https://viem.sh/docs/contract/readContract.html - Version: viem@2.0.0], + Docs: https://viem.sh/docs/contract/readContract + Version: viem@2.8.2], "result": undefined, "status": "failure", }, @@ -501,8 +501,8 @@ test('throws if allowFailure=false & encoding contract function data fails', asy function: ownerOf(uint256 tokenId) args: (1e+31) - Docs: https://viem.sh/docs/contract/readContract.html - Version: viem@2.0.0" + Docs: https://viem.sh/docs/contract/readContract + Version: viem@2.8.2" `, ) }) @@ -560,8 +560,8 @@ test('allowFailure=true & encoding contract function data fails', async () => { function: ownerOf(uint256 tokenId) args: (1e+31) - Docs: https://viem.sh/docs/contract/readContract.html - Version: viem@2.0.0], + Docs: https://viem.sh/docs/contract/readContract + Version: viem@2.8.2], "result": undefined, "status": "failure", }, @@ -578,8 +578,8 @@ test('allowFailure=true & encoding contract function data fails', async () => { function: ownerOf(uint256 tokenId) args: (1e+31) - Docs: https://viem.sh/docs/contract/readContract.html - Version: viem@2.0.0], + Docs: https://viem.sh/docs/contract/readContract + Version: viem@2.8.2], "result": undefined, "status": "failure", }, @@ -616,8 +616,8 @@ test('should throw if allowFailure=false & a contract has no response', async () function: love(address) args: (0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC) - Docs: https://viem.sh/docs/contract/readContract.html - Version: viem@2.0.0" + Docs: https://viem.sh/docs/contract/readContract + Version: viem@2.8.2" `, ) }) @@ -668,8 +668,8 @@ test('allowFailure=true & a contract has no response', async () => { function: love(address) args: (0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC) - Docs: https://viem.sh/docs/contract/readContract.html - Version: viem@2.0.0], + Docs: https://viem.sh/docs/contract/readContract + Version: viem@2.8.2], "result": undefined, "status": "failure", }, diff --git a/packages/core/src/actions/sendTransaction.test.ts b/packages/core/src/actions/sendTransaction.test.ts index 28bc7b1718..869290e291 100644 --- a/packages/core/src/actions/sendTransaction.test.ts +++ b/packages/core/src/actions/sendTransaction.test.ts @@ -78,7 +78,7 @@ test('behavior: value exceeds balance', async () => { gas: 21000 Details: Insufficient funds for gas * price + value - Version: viem@2.0.0" + Version: viem@2.8.2" `) await disconnect(config, { connector }) }) diff --git a/packages/core/src/actions/signMessage.test.ts b/packages/core/src/actions/signMessage.test.ts index f1d7b21f0f..2704df8038 100644 --- a/packages/core/src/actions/signMessage.test.ts +++ b/packages/core/src/actions/signMessage.test.ts @@ -51,7 +51,7 @@ test('behavior: user rejected request', async () => { [UserRejectedRequestError: User rejected the request. Details: Failed to sign message. - Version: viem@2.0.0] + Version: viem@2.8.2] `) await disconnect(config, { connector: connector_ }) }) diff --git a/packages/core/src/actions/signTypedData.test.ts b/packages/core/src/actions/signTypedData.test.ts index c80517ef22..b5e3362e5a 100644 --- a/packages/core/src/actions/signTypedData.test.ts +++ b/packages/core/src/actions/signTypedData.test.ts @@ -47,7 +47,7 @@ test('behavior: user rejected request', async () => { [UserRejectedRequestError: User rejected the request. Details: Failed to sign typed data. - Version: viem@2.0.0] + Version: viem@2.8.2] `) await disconnect(config, { connector: connector_ }) }) diff --git a/packages/core/src/actions/switchChain.test.ts b/packages/core/src/actions/switchChain.test.ts index 82cf5be0e1..169209bdb9 100644 --- a/packages/core/src/actions/switchChain.test.ts +++ b/packages/core/src/actions/switchChain.test.ts @@ -43,7 +43,7 @@ test('behavior: user rejected request', async () => { [UserRejectedRequestError: User rejected the request. Details: Failed to switch chain. - Version: viem@2.0.0] + Version: viem@2.8.2] `) await disconnect(config, { connector: connector_ }) }) diff --git a/packages/core/src/exports/index.ts b/packages/core/src/exports/index.ts index 45abdf9d93..b7116e088a 100644 --- a/packages/core/src/exports/index.ts +++ b/packages/core/src/exports/index.ts @@ -504,6 +504,8 @@ export { fallback } from '../transports/fallback.js' // Types //////////////////////////////////////////////////////////////////////////////// +export { type SelectChains } from '../types/chain.js' + export { type Register, type ResolvedRegister } from '../types/register.js' //////////////////////////////////////////////////////////////////////////////// diff --git a/packages/react/src/hooks/useBalance.test.ts b/packages/react/src/hooks/useBalance.test.ts index ec54708d79..8c21237cf5 100644 --- a/packages/react/src/hooks/useBalance.test.ts +++ b/packages/react/src/hooks/useBalance.test.ts @@ -124,9 +124,9 @@ test('parameters: token', async () => { { "data": { "decimals": 18, - "formatted": "3989.559062564299199392", + "formatted": "0.559062564299199392", "symbol": "DAI", - "value": 3989559062564299199392n, + "value": 559062564299199392n, }, "dataUpdatedAt": 1675209600000, "error": null, diff --git a/packages/react/src/hooks/useBlockNumber.test.ts b/packages/react/src/hooks/useBlockNumber.test.ts index 087505e14b..bd89d65640 100644 --- a/packages/react/src/hooks/useBlockNumber.test.ts +++ b/packages/react/src/hooks/useBlockNumber.test.ts @@ -13,7 +13,7 @@ test('mounts', async () => { expect(result.current).toMatchInlineSnapshot(` { - "data": 18677381n, + "data": 19258213n, "dataUpdatedAt": 1675209600000, "error": null, "errorUpdateCount": 0, @@ -54,7 +54,7 @@ test('parameters: watch', async () => { await waitFor(() => expect(result.current.isSuccess).toBeTruthy()) const blockNumber = result.current.data! - expect(result.current.data).toMatchInlineSnapshot('18677381n') + expect(result.current.data).toMatchInlineSnapshot('19258213n') await testClient.mainnet.mine({ blocks: 1 }) await waitFor(() => { diff --git a/packages/react/src/hooks/usePrepareTransactionRequest.test.ts b/packages/react/src/hooks/usePrepareTransactionRequest.test.ts index 19283083f5..d80f8660c4 100644 --- a/packages/react/src/hooks/usePrepareTransactionRequest.test.ts +++ b/packages/react/src/hooks/usePrepareTransactionRequest.test.ts @@ -33,6 +33,7 @@ test('default', async () => { expect(data).toMatchInlineSnapshot(` { + "chainId": 1, "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "to": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8", "type": "eip1559", diff --git a/packages/react/src/hooks/usePrepareTransactionRequest.ts b/packages/react/src/hooks/usePrepareTransactionRequest.ts index e38864c519..d68218a20f 100644 --- a/packages/react/src/hooks/usePrepareTransactionRequest.ts +++ b/packages/react/src/hooks/usePrepareTransactionRequest.ts @@ -4,6 +4,7 @@ import { type Config, type PrepareTransactionRequestErrorType, type ResolvedRegister, + type SelectChains, } from '@wagmi/core' import { type PrepareTransactionRequestData, @@ -14,7 +15,6 @@ import { import type { PrepareTransactionRequestQueryFnData } from '@wagmi/core/query' import { type PrepareTransactionRequestRequest as viem_PrepareTransactionRequestRequest } from 'viem' -import type { SelectChains } from '../../../core/src/types/chain.js' import { type ConfigParameter, type QueryParameter, diff --git a/packages/react/src/hooks/useWalletClient.ts b/packages/react/src/hooks/useWalletClient.ts index c0b1507450..e31240e860 100644 --- a/packages/react/src/hooks/useWalletClient.ts +++ b/packages/react/src/hooks/useWalletClient.ts @@ -96,5 +96,5 @@ export function useWalletClient< queryKey, enabled, staleTime: Infinity, - }) + } as any) as UseWalletClientReturnType } diff --git a/packages/test/src/chains.ts b/packages/test/src/chains.ts index 788170b996..df5521c481 100644 --- a/packages/test/src/chains.ts +++ b/packages/test/src/chains.ts @@ -19,7 +19,7 @@ export type Chain = Evaluate< const mainnetFork = { blockNumber: process.env.VITE_MAINNET_FORK_BLOCK_NUMBER ? BigInt(Number(process.env.VITE_MAINNET_FORK_BLOCK_NUMBER)) - : 18677381n, + : 19258213n, url: process.env.VITE_MAINNET_FORK_URL ?? 'https://cloudflare-eth.com', } as const satisfies Fork diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27fb7cbe25..eedc60130b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,8 +63,8 @@ importers: specifier: 5.3.2 version: 5.3.2 viem: - specifier: 2.8.2 - version: 2.8.2(typescript@5.3.2) + specifier: 2.8.3 + version: 2.8.3(typescript@5.3.2) vitest: specifier: ^0.34.5 version: 0.34.5(@vitest/ui@0.34.5)(happy-dom@12.2.1)(jsdom@20.0.3) @@ -11711,8 +11711,8 @@ packages: - zod dev: false - /viem@2.8.2(typescript@5.3.2): - resolution: {integrity: sha512-WIJshY+pAqGUVILNtULxZ9WKmbb0krRAzY8fbe3xxKy479nwfdIwnG2SD3CZj7WE888mzi90qniTWJBTdH2Etw==} + /viem@2.8.3(typescript@5.3.2): + resolution: {integrity: sha512-vvVTQL/vOS7jqpeu354+i/nnorfxvZiznKNgZXIl3NA8RuSO9jSU7roTSKIBmPUnA0OB7peMNphVf32Uq3CjQA==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: