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
493cdc6c
Commit
493cdc6c
authored
Oct 11, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token minted list
parent
e6354ba1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
14 deletions
+58
-14
routes.ts
lib/link/routes.ts
+4
-1
tokenTransfer.ts
types/api/tokenTransfer.ts
+16
-5
TokenSnippet.tsx
ui/shared/TokenSnippet.tsx
+1
-1
AddressLink.tsx
ui/shared/address/AddressLink.tsx
+1
-1
TokenTransfer.tsx
ui/tx/TokenTransfer.tsx
+20
-3
TxDecodedInputData.tsx
ui/tx/TxDecodedInputData.tsx
+1
-1
TxDetails.tsx
ui/tx/TxDetails.tsx
+15
-2
No files found.
lib/link/routes.ts
View file @
493cdc6c
...
@@ -95,9 +95,12 @@ export const ROUTES = {
...
@@ -95,9 +95,12 @@ export const ROUTES = {
crossNetworkNavigation
:
true
,
crossNetworkNavigation
:
true
,
},
},
token_index
:
{
token_index
:
{
pattern
:
`
${
BASE_PATH
}
/token/[
id
]`
,
pattern
:
`
${
BASE_PATH
}
/token/[
hash
]`
,
crossNetworkNavigation
:
true
,
crossNetworkNavigation
:
true
,
},
},
token_instance_item
:
{
pattern
:
`
${
BASE_PATH
}
/token/[hash]/instance/[id]`
,
},
// ADDRESSES
// ADDRESSES
address_index
:
{
address_index
:
{
...
...
types/api/tokenTransfer.ts
View file @
493cdc6c
import
type
{
AddressParam
}
from
'
./addressParams
'
;
import
type
{
AddressParam
}
from
'
./addressParams
'
;
export
interface
TokenTransfer
{
export
type
TokenTransfer
=
(
type
:
string
;
{
type
:
'
token_transfer
'
;
total
:
{
value
:
string
;
};
}
|
{
type
:
'
token_minting
'
;
total
:
{
token_id
:
string
;
};
}
)
&
TokenTransferBase
interface
TokenTransferBase
{
txHash
:
string
;
txHash
:
string
;
from
:
AddressParam
;
from
:
AddressParam
;
to
:
AddressParam
;
to
:
AddressParam
;
token_address
:
string
;
token_address
:
string
;
token_symbol
:
string
;
token_symbol
:
string
;
token_type
:
string
;
token_type
:
string
;
total
:
{
value
:
string
;
};
exchange_rate
:
string
;
exchange_rate
:
string
;
}
}
ui/shared/TokenSnippet.tsx
View file @
493cdc6c
...
@@ -14,7 +14,7 @@ interface Props {
...
@@ -14,7 +14,7 @@ interface Props {
const
TokenSnippet
=
({
symbol
,
hash
,
name
,
className
}:
Props
)
=>
{
const
TokenSnippet
=
({
symbol
,
hash
,
name
,
className
}:
Props
)
=>
{
const
link
=
useLink
();
const
link
=
useLink
();
const
url
=
link
(
'
token_index
'
,
{
id
:
hash
});
const
url
=
link
(
'
token_index
'
,
{
hash
});
return
(
return
(
<
Center
className=
{
className
}
columnGap=
{
1
}
>
<
Center
className=
{
className
}
columnGap=
{
1
}
>
...
...
ui/shared/address/AddressLink.tsx
View file @
493cdc6c
...
@@ -21,7 +21,7 @@ const AddressLink = ({ alias, type, className, truncation = 'dynamic', hash, id,
...
@@ -21,7 +21,7 @@ const AddressLink = ({ alias, type, className, truncation = 'dynamic', hash, id,
if
(
type
===
'
transaction
'
)
{
if
(
type
===
'
transaction
'
)
{
url
=
link
(
'
tx_index
'
,
{
id
:
id
||
hash
});
url
=
link
(
'
tx_index
'
,
{
id
:
id
||
hash
});
}
else
if
(
type
===
'
token
'
)
{
}
else
if
(
type
===
'
token
'
)
{
url
=
link
(
'
token_index
'
,
{
id
:
id
||
hash
});
url
=
link
(
'
token_index
'
,
{
hash
:
id
||
hash
});
}
else
if
(
type
===
'
block
'
)
{
}
else
if
(
type
===
'
block
'
)
{
url
=
link
(
'
block_index
'
,
{
id
:
id
||
hash
});
url
=
link
(
'
block_index
'
,
{
id
:
id
||
hash
});
}
else
{
}
else
{
...
...
ui/tx/TokenTransfer.tsx
View file @
493cdc6c
import
{
Flex
,
Icon
,
Text
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
Icon
,
Text
,
Link
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
TokenTransfer
as
TTokenTransfer
}
from
'
types/api/tokenTransfer
'
;
import
type
{
TokenTransfer
as
TTokenTransfer
}
from
'
types/api/tokenTransfer
'
;
import
rightArrowIcon
from
'
icons/arrows/east.svg
'
;
import
rightArrowIcon
from
'
icons/arrows/east.svg
'
;
import
{
space
}
from
'
lib/html-entities
'
;
import
{
space
}
from
'
lib/html-entities
'
;
import
useLink
from
'
lib/link/useLink
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
TokenSnippet
from
'
ui/shared/TokenSnippet
'
;
import
TokenSnippet
from
'
ui/shared/TokenSnippet
'
;
type
Props
=
TTokenTransfer
type
Props
=
TTokenTransfer
const
TokenTransfer
=
({
from
,
to
,
total
,
exchange_rate
:
exchangeRate
,
...
token
}:
Props
)
=>
{
const
TokenTransfer
=
({
from
,
to
,
total
,
exchange_rate
:
exchangeRate
,
type
,
...
token
}:
Props
)
=>
{
const
link
=
useLink
();
const
content
=
(()
=>
{
switch
(
type
)
{
case
'
token_transfer
'
:
return
(
<
CurrencyValue
value=
{
total
.
value
}
unit=
"ether"
exchangeRate=
{
exchangeRate
}
fontWeight=
{
600
}
/>
);
case
'
token_minting
'
:
{
const
url
=
link
(
'
token_instance_item
'
,
{
hash
:
token
.
token_address
,
id
:
total
.
token_id
});
return
<
Text
as=
"span"
>
Token ID [
<
Link
href=
{
url
}
>
{
total
.
token_id
}
</
Link
>
]
</
Text
>;
}
}
})();
return
(
return
(
<
Flex
alignItems=
"center"
flexWrap=
"wrap"
columnGap=
{
3
}
rowGap=
{
3
}
>
<
Flex
alignItems=
"center"
flexWrap=
"wrap"
columnGap=
{
3
}
rowGap=
{
3
}
>
<
Flex
alignItems=
"center"
>
<
Flex
alignItems=
"center"
>
...
@@ -20,7 +37,7 @@ const TokenTransfer = ({ from, to, total, exchange_rate: exchangeRate, ...token
...
@@ -20,7 +37,7 @@ const TokenTransfer = ({ from, to, total, exchange_rate: exchangeRate, ...token
<
AddressLink
fontWeight=
"500"
hash=
{
to
.
hash
}
truncation=
"constant"
/>
<
AddressLink
fontWeight=
"500"
hash=
{
to
.
hash
}
truncation=
"constant"
/>
</
Flex
>
</
Flex
>
<
Text
fontWeight=
{
500
}
as=
"span"
>
For:
{
space
}
<
Text
fontWeight=
{
500
}
as=
"span"
>
For:
{
space
}
<
CurrencyValue
value=
{
total
.
value
}
unit=
"ether"
exchangeRate=
{
exchangeRate
}
fontWeight=
{
600
}
/>
{
content
}
</
Text
>
</
Text
>
<
TokenSnippet
symbol=
{
token
.
token_symbol
}
hash=
{
token
.
token_address
}
name=
"Foo"
/>
<
TokenSnippet
symbol=
{
token
.
token_symbol
}
hash=
{
token
.
token_address
}
name=
"Foo"
/>
</
Flex
>
</
Flex
>
...
...
ui/tx/TxDecodedInputData.tsx
View file @
493cdc6c
...
@@ -164,7 +164,7 @@ const TxDecodedInputData = ({ data }: Props) => {
...
@@ -164,7 +164,7 @@ const TxDecodedInputData = ({ data }: Props) => {
</
Address
>
</
Address
>
)
:
(
)
:
(
<
Flex
alignItems=
"flex-start"
justifyContent=
"space-between"
whiteSpace=
"normal"
wordBreak=
"break-all"
>
<
Flex
alignItems=
"flex-start"
justifyContent=
"space-between"
whiteSpace=
"normal"
wordBreak=
"break-all"
>
<
Text
>
{
value
}
</
Text
>
<
Text
>
{
String
(
value
)
}
</
Text
>
<
CopyToClipboard
text=
{
value
}
/>
<
CopyToClipboard
text=
{
value
}
/>
</
Flex
>
</
Flex
>
)
}
)
}
...
...
ui/tx/TxDetails.tsx
View file @
493cdc6c
...
@@ -66,6 +66,9 @@ const TxDetails = () => {
...
@@ -66,6 +66,9 @@ const TxDetails = () => {
return
<
DataFetchAlert
/>;
return
<
DataFetchAlert
/>;
}
}
const
transferredTokens
=
data
.
token_transfers
?.
filter
(({
type
})
=>
type
===
'
token_transfer
'
)
||
[];
const
mintedTokens
=
data
.
token_transfers
?.
filter
(({
type
})
=>
type
===
'
token_minting
'
)
||
[];
return
(
return
(
<
Grid
columnGap=
{
8
}
rowGap=
{
{
base
:
3
,
lg
:
3
}
}
templateColumns=
{
{
base
:
'
minmax(0, 1fr)
'
,
lg
:
'
auto minmax(0, 1fr)
'
}
}
>
<
Grid
columnGap=
{
8
}
rowGap=
{
{
base
:
3
,
lg
:
3
}
}
templateColumns=
{
{
base
:
'
minmax(0, 1fr)
'
,
lg
:
'
auto minmax(0, 1fr)
'
}
}
>
<
DetailsInfoItem
<
DetailsInfoItem
...
@@ -155,13 +158,23 @@ const TxDetails = () => {
...
@@ -155,13 +158,23 @@ const TxDetails = () => {
</Tooltip> */
}
</Tooltip> */
}
{
/* <TokenSnippet symbol="UP" name="User Pay" hash="0xA17ed5dFc62D0a3E74D69a0503AE9FdA65d9f212" ml={ 3 }/> */
}
{
/* <TokenSnippet symbol="UP" name="User Pay" hash="0xA17ed5dFc62D0a3E74D69a0503AE9FdA65d9f212" ml={ 3 }/> */
}
</
DetailsInfoItem
>
</
DetailsInfoItem
>
{
(
data
.
token_transfers
?.
length
||
0
)
>
0
&&
(
{
transferredTokens
.
length
>
0
&&
(
<
DetailsInfoItem
<
DetailsInfoItem
title=
"Token transferred"
title=
"Token transferred"
hint=
"List of token transferred in the transaction."
hint=
"List of token transferred in the transaction."
>
>
<
Flex
flexDirection=
"column"
alignItems=
"flex-start"
rowGap=
{
5
}
w=
"100%"
>
<
Flex
flexDirection=
"column"
alignItems=
"flex-start"
rowGap=
{
5
}
w=
"100%"
>
{
data
.
token_transfers
?.
map
((
item
,
index
)
=>
<
TokenTransfer
key=
{
index
}
{
...
item
}
/>)
}
{
transferredTokens
.
map
((
item
,
index
)
=>
<
TokenTransfer
key=
{
index
}
{
...
item
}
/>)
}
</
Flex
>
</
DetailsInfoItem
>
)
}
{
mintedTokens
.
length
>
0
&&
(
<
DetailsInfoItem
title=
"Token Minted"
hint=
"List of token minted in the transaction."
>
<
Flex
flexDirection=
"column"
alignItems=
"flex-start"
rowGap=
{
5
}
w=
"100%"
>
{
mintedTokens
.
map
((
item
,
index
)
=>
<
TokenTransfer
key=
{
index
}
{
...
item
}
/>)
}
</
Flex
>
</
Flex
>
</
DetailsInfoItem
>
</
DetailsInfoItem
>
)
}
)
}
...
...
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