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
03ff6e04
Commit
03ff6e04
authored
Oct 04, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
type fixes
parent
4edeccbc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
12 deletions
+14
-12
tx.ts
data/tx.ts
+2
-2
txInternal.ts
data/txInternal.ts
+3
-3
transaction.ts
types/api/transaction.ts
+3
-3
TxStatus.tsx
ui/shared/TxStatus.tsx
+6
-4
No files found.
data/tx.ts
View file @
03ff6e04
/* eslint-disable max-len */
export
const
tx
=
{
hash
:
'
0x1ea365d2144796f793883534aa51bf20d23292b19478994eede23dfc599e7c34
'
,
status
:
'
success
'
as
TxStatus
,
status
:
'
ok
'
as
Transaction
[
'
status
'
]
,
block_num
:
15006918
,
confirmation_num
:
283
,
confirmation_duration
:
30
,
...
...
@@ -52,4 +52,4 @@ export const tx = {
export
type
TxType
=
'
contract-call
'
|
'
transaction
'
|
'
token-transfer
'
|
'
internal-tx
'
|
'
multicall
'
;
export
type
TxStatus
=
'
success
'
|
'
failed
'
|
'
pending
'
;
import
type
{
Transaction
}
from
'
types/api/transaction
'
;
data/txInternal.ts
View file @
03ff6e04
...
...
@@ -4,7 +4,7 @@ export const data = [
{
id
:
1
,
type
:
'
call
'
as
TxInternalsType
,
status
:
'
success
'
as
const
,
status
:
'
ok
'
as
const
,
from
:
{
hash
:
'
0x12E80C27BfFBB76b4A8d26FF2bfd3C9f310FFA01
'
},
to
:
{
hash
:
'
0xF7A558692dFB5F456e291791da7FAE8Dd046574e
'
},
value
:
0.25207646303
,
...
...
@@ -13,7 +13,7 @@ export const data = [
{
id
:
2
,
type
:
'
delegate_call
'
as
TxInternalsType
,
status
:
'
success
'
as
const
,
status
:
'
error
'
as
const
,
from
:
{
hash
:
'
0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45
'
},
to
:
{
hash
:
'
0x12E80C27BfFBB76b4A8d26FF2bfd3C9f310FFA01
'
},
value
:
0.5633333
,
...
...
@@ -22,7 +22,7 @@ export const data = [
{
id
:
3
,
type
:
'
static_call
'
as
TxInternalsType
,
status
:
'
failed
'
as
const
,
status
:
'
error
'
as
const
,
from
:
{
hash
:
'
0x97Aa2EfcF35c0f4c9AaDDCa8c2330fa7A9533830
'
},
to
:
{
hash
:
'
0x35317007D203b8a86CA727ad44E473E40450E378
'
},
value
:
0.421152366
,
...
...
types/api/transaction.ts
View file @
03ff6e04
...
...
@@ -7,7 +7,7 @@ export interface Transaction {
hash
:
string
;
result
:
string
;
confirmations
:
number
;
status
:
string
;
status
:
'
ok
'
|
'
error
'
|
null
;
block
:
number
;
timestamp
:
string
;
confirmation_duration
:
Array
<
number
>
;
...
...
@@ -18,8 +18,8 @@ export interface Transaction {
fee
:
Fee
;
gas_price
:
number
;
type
:
number
;
gas_used
:
number
;
gas_limit
:
number
;
gas_used
:
string
;
gas_limit
:
string
;
max_fee_per_gas
?:
number
;
max_priority_fee_per_gas
?:
number
;
priority_fee
?:
number
;
...
...
ui/shared/TxStatus.tsx
View file @
03ff6e04
import
{
Tag
,
TagLabel
,
TagLeftIcon
,
Tooltip
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
Transaction
}
from
'
types/api/transaction
'
;
import
errorIcon
from
'
icons/status/error.svg
'
;
import
pendingIcon
from
'
icons/status/pending.svg
'
;
import
successIcon
from
'
icons/status/success.svg
'
;
export
interface
Props
{
status
:
'
success
'
|
'
failed
'
|
'
pending
'
;
status
:
Transaction
[
'
status
'
]
;
errorText
?:
string
;
}
...
...
@@ -16,17 +18,17 @@ const TxStatus = ({ status, errorText }: Props) => {
let
colorScheme
;
switch
(
status
)
{
case
'
success
'
:
case
'
ok
'
:
label
=
'
Success
'
;
icon
=
successIcon
;
colorScheme
=
'
green
'
;
break
;
case
'
failed
'
:
case
'
error
'
:
label
=
'
Failed
'
;
icon
=
errorIcon
;
colorScheme
=
'
red
'
;
break
;
case
'
pending
'
:
case
null
:
label
=
'
Pending
'
;
icon
=
pendingIcon
;
// FIXME: it's not gray on mockups
...
...
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