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
6ec31b69
Commit
6ec31b69
authored
May 30, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up
parent
d181a186
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
12 deletions
+4
-12
contract.ts
types/api/contract.ts
+0
-6
ContractMethodCallable.tsx
ui/address/contract/ContractMethodCallable.tsx
+4
-6
ContractWrite.pw.tsx_default_base-view-mobile-1.png
...ots__/ContractWrite.pw.tsx_default_base-view-mobile-1.png
+0
-0
ContractWrite.pw.tsx_mobile_base-view-mobile-1.png
...hots__/ContractWrite.pw.tsx_mobile_base-view-mobile-1.png
+0
-0
No files found.
types/api/contract.ts
View file @
6ec31b69
import
type
{
Abi
}
from
'
abitype
'
;
// import type { ArrayElement } from 'types/utils';
export
type
SmartContractMethodArgType
=
'
address
'
|
'
uint256
'
|
'
bool
'
|
'
string
'
|
'
bytes
'
|
'
bytes32
'
;
export
type
SmartContractMethodStateMutability
=
'
view
'
|
'
nonpayable
'
|
'
payable
'
;
...
...
@@ -82,19 +80,15 @@ export interface SmartContractWriteReceive {
}
export
type
SmartContractWriteMethod
=
SmartContractMethodBase
|
SmartContractWriteFallback
|
SmartContractWriteReceive
;
// export type SmartContractWriteMethod = ArrayElement<Abi> & {name?: string};
// export type SmartContractReadMethod = ArrayElement<Abi> & {name?: string};
export
type
SmartContractMethod
=
SmartContractReadMethod
|
SmartContractWriteMethod
;
// export type SmartContractMethodInput = ArrayElement<Abi> & {name?: string};
export
interface
SmartContractMethodInput
{
internalType
?:
SmartContractMethodArgType
;
name
:
string
;
type
:
SmartContractMethodArgType
;
}
// export type SmartContractMethodOutput = ArrayElement<Abi> & {name?: string};
export
interface
SmartContractMethodOutput
extends
SmartContractMethodInput
{
value
?:
string
;
}
...
...
ui/address/contract/ContractMethodCallable.tsx
View file @
6ec31b69
...
...
@@ -7,7 +7,6 @@ import { useForm } from 'react-hook-form';
import
type
{
MethodFormFields
,
ContractMethodCallResult
}
from
'
./types
'
;
import
type
{
SmartContractMethodInput
,
SmartContractMethod
}
from
'
types/api/contract
'
;
import
appConfig
from
'
configs/app/config
'
;
import
arrowIcon
from
'
icons/arrows/down-right.svg
'
;
import
ContractMethodField
from
'
./ContractMethodField
'
;
...
...
@@ -67,14 +66,13 @@ const ContractMethodCallable = <T extends SmartContractMethod>({ data, onSubmit,
const
[
result
,
setResult
]
=
React
.
useState
<
ContractMethodCallResult
<
T
>>
();
const
[
isLoading
,
setLoading
]
=
React
.
useState
(
false
);
const
inputs
=
React
.
useMemo
(()
=>
{
const
inputs
:
Array
<
SmartContractMethodInput
>
=
React
.
useMemo
(()
=>
{
return
[
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...(
'
inputs
'
in
data
?
data
.
inputs
as
Array
<
any
>
:
[]),
// todo_tom fix type
...(
'
inputs
'
in
data
?
data
.
inputs
:
[]),
...(
'
stateMutability
'
in
data
&&
data
.
stateMutability
===
'
payable
'
?
[
{
name
:
'
value
'
,
type
:
appConfig
.
network
.
currency
.
symbol
,
internalType
:
appConfig
.
network
.
currency
.
symbol
,
type
:
'
uint256
'
as
const
,
internalType
:
'
uint256
'
as
const
,
}
]
:
[]),
];
},
[
data
]);
...
...
ui/address/contract/__screenshots__/ContractWrite.pw.tsx_default_base-view-mobile-1.png
View replaced file @
d181a186
View file @
6ec31b69
90.8 KB
|
W:
|
H:
98.3 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/address/contract/__screenshots__/ContractWrite.pw.tsx_mobile_base-view-mobile-1.png
View replaced file @
d181a186
View file @
6ec31b69
93.2 KB
|
W:
|
H:
99 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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