Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
11fe8c6f
Unverified
Commit
11fe8c6f
authored
Jun 13, 2024
by
tom goriunov
Committed by
GitHub
Jun 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Contract `Write` method returns a checksum error (#2021)
Fixes #2018
parent
c3420f6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
useCallMethodWalletClient.ts
ui/address/contract/ABI/useCallMethodWalletClient.ts
+5
-3
No files found.
ui/address/contract/ABI/useCallMethodWalletClient.ts
View file @
11fe8c6f
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
Abi
}
from
'
viem
'
;
import
{
getAddress
,
type
Abi
}
from
'
viem
'
;
import
{
useAccount
,
useWalletClient
,
useSwitchChain
}
from
'
wagmi
'
;
import
{
useAccount
,
useWalletClient
,
useSwitchChain
}
from
'
wagmi
'
;
import
type
{
ContractAbiItem
,
FormSubmitResult
}
from
'
./types
'
;
import
type
{
ContractAbiItem
,
FormSubmitResult
}
from
'
./types
'
;
...
@@ -32,10 +32,12 @@ export default function useCallMethodWalletClient(): (params: Params) => Promise
...
@@ -32,10 +32,12 @@ export default function useCallMethodWalletClient(): (params: Params) => Promise
await
switchChainAsync
?.({
chainId
:
Number
(
config
.
chain
.
id
)
});
await
switchChainAsync
?.({
chainId
:
Number
(
config
.
chain
.
id
)
});
}
}
const
address
=
getAddress
(
addressHash
);
if
(
item
.
type
===
'
receive
'
||
item
.
type
===
'
fallback
'
)
{
if
(
item
.
type
===
'
receive
'
||
item
.
type
===
'
fallback
'
)
{
const
value
=
getNativeCoinValue
(
args
[
0
]);
const
value
=
getNativeCoinValue
(
args
[
0
]);
const
hash
=
await
walletClient
.
sendTransaction
({
const
hash
=
await
walletClient
.
sendTransaction
({
to
:
address
Hash
as
`0x
${
string
}
`
|
undefined
,
to
:
address
,
value
,
value
,
});
});
return
{
source
:
'
wallet_client
'
,
result
:
{
hash
}
};
return
{
source
:
'
wallet_client
'
,
result
:
{
hash
}
};
...
@@ -61,7 +63,7 @@ export default function useCallMethodWalletClient(): (params: Params) => Promise
...
@@ -61,7 +63,7 @@ export default function useCallMethodWalletClient(): (params: Params) => Promise
// - https://github.com/blockscout/frontend/issues/1327
// - https://github.com/blockscout/frontend/issues/1327
abi
:
[
item
]
as
Abi
,
abi
:
[
item
]
as
Abi
,
functionName
:
methodName
,
functionName
:
methodName
,
address
:
addressHash
as
`0x
${
string
}
`
,
address
,
value
,
value
,
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment