@@ -8,104 +8,115 @@ const view: ModElement[] = [
8
8
topLeftBadge : "{{embed.metadata.nft.collection.creator.username}}" ,
9
9
elements : [
10
10
{
11
- type : "horizontal -layout" ,
11
+ type : "vertical -layout" ,
12
12
elements : [
13
13
{
14
- type : "avatar" ,
15
- src : "{{api}}/nft-chain-logo?chain={{embed.metadata.nft.collection.chain}}" ,
16
- } ,
17
- {
18
- type : "text" ,
19
- label : "{{embed.metadata.nft.collection.name}}" ,
20
- } ,
21
- {
22
- if : {
23
- value : "{{user.wallet.address}}" ,
24
- match : {
25
- NOT : {
26
- equals : "" ,
27
- } ,
28
- } ,
29
- } ,
30
- then : {
31
- if : {
32
- value : "{{refs.mintTx.hash}}" ,
33
- match : {
34
- NOT : {
35
- equals : "" ,
14
+ type : "horizontal-layout" ,
15
+ elements : [
16
+ {
17
+ type : "horizontal-layout" ,
18
+ elements : [
19
+ {
20
+ type : "avatar" ,
21
+ src : "{{api}}/nft-chain-logo?chain={{embed.metadata.nft.collection.chain}}" ,
36
22
} ,
37
- } ,
23
+ {
24
+ type : "text" ,
25
+ label : "{{embed.metadata.nft.collection.name}}" ,
26
+ } ,
27
+ ] ,
38
28
} ,
39
- then : {
29
+ {
40
30
if : {
41
- value : "{{refs.mintTx.isSuccess }}" ,
31
+ value : "{{user.wallet.address }}" ,
42
32
match : {
43
- equals : "true" ,
33
+ NOT : {
34
+ equals : "" ,
35
+ } ,
44
36
} ,
45
37
} ,
46
38
then : {
47
- type : "link" ,
48
- label : "View NFT" ,
49
- url : "{{refs.txDataRequest.response.data.explorer.url}}/tx/{{refs.mintTx.hash}}" ,
50
- } ,
51
- else : {
52
39
if : {
53
- value : "{{refs.mintTx.isSuccess }}" ,
40
+ value : "{{refs.mintTx.hash }}" ,
54
41
match : {
55
- equals : "false" ,
42
+ NOT : {
43
+ equals : "" ,
44
+ } ,
56
45
} ,
57
46
} ,
58
47
then : {
59
- type : "link" ,
60
- label : "Failed" ,
61
- variant : "link" ,
62
- url : "{{refs.txDataRequest.response.data.explorer.url}}/tx/{{refs.mintTx.hash}}" ,
63
- } ,
64
- else : {
65
- type : "horizontal-layout" ,
66
- elements : [
67
- {
48
+ if : {
49
+ value : "{{refs.mintTx.isSuccess}}" ,
50
+ match : {
51
+ equals : "true" ,
52
+ } ,
53
+ } ,
54
+ then : {
55
+ type : "link" ,
56
+ label : "View NFT" ,
57
+ url : "{{refs.txDataRequest.response.data.explorer.url}}/tx/{{refs.mintTx.hash}}" ,
58
+ } ,
59
+ else : {
60
+ if : {
61
+ value : "{{refs.mintTx.isSuccess}}" ,
62
+ match : {
63
+ equals : "false" ,
64
+ } ,
65
+ } ,
66
+ then : {
68
67
type : "link" ,
69
- label : "Confirming... " ,
68
+ label : "Failed " ,
70
69
variant : "link" ,
71
70
url : "{{refs.txDataRequest.response.data.explorer.url}}/tx/{{refs.mintTx.hash}}" ,
72
71
} ,
73
- {
74
- type : "circular-progress" ,
72
+ else : {
73
+ type : "horizontal-layout" ,
74
+ elements : [
75
+ {
76
+ type : "link" ,
77
+ label : "Confirming..." ,
78
+ variant : "link" ,
79
+ url : "{{refs.txDataRequest.response.data.explorer.url}}/tx/{{refs.mintTx.hash}}" ,
80
+ } ,
81
+ {
82
+ type : "circular-progress" ,
83
+ } ,
84
+ ] ,
75
85
} ,
76
- ] ,
86
+ } ,
77
87
} ,
78
- } ,
79
- } ,
80
- else : {
81
- type : "button" ,
82
- label : "Mint" ,
83
- onclick : {
84
- type : "GET" ,
85
- ref : "txDataRequest" ,
86
- url : "{{api}}/nft-minter?taker={{user.wallet.address}}&itemId={{embed.metadata.nft.collection.id}}/{{embed.metadata.nft.tokenId}}" ,
87
- onsuccess : {
88
- type : "SENDETHTRANSACTION" ,
89
- ref : "mintTx" ,
90
- txData : {
91
- from : "{{refs.txDataRequest.response.data.data.from}}" ,
92
- to : "{{refs.txDataRequest.response.data.data.to}}" ,
93
- value : "{{refs.txDataRequest.response.data.data.value}}" ,
94
- data : "{{refs.txDataRequest.response.data.data.data}}" ,
88
+ else : {
89
+ type : "button" ,
90
+ label : "Mint" ,
91
+ onclick : {
92
+ type : "GET" ,
93
+ ref : "txDataRequest" ,
94
+ url : "{{api}}/nft-minter?taker={{user.wallet.address}}&itemId={{embed.metadata.nft.collection.id}}/{{embed.metadata.nft.tokenId}}" ,
95
+ onsuccess : {
96
+ type : "SENDETHTRANSACTION" ,
97
+ ref : "mintTx" ,
98
+ txData : {
99
+ from : "{{refs.txDataRequest.response.data.data.from}}" ,
100
+ to : "{{refs.txDataRequest.response.data.data.to}}" ,
101
+ value :
102
+ "{{refs.txDataRequest.response.data.data.value}}" ,
103
+ data : "{{refs.txDataRequest.response.data.data.data}}" ,
104
+ } ,
105
+ chainId : "{{refs.txDataRequest.response.data.chainId}}" ,
106
+ } ,
95
107
} ,
96
- chainId : "{{refs.txDataRequest.response.data.chainId}}" ,
108
+ } ,
109
+ } ,
110
+ else : {
111
+ type : "button" ,
112
+ label : "Mint" ,
113
+ onclick : {
114
+ type : "OPENLINK" ,
115
+ url : "{{embed.metadata.nft.mintUrl}}" ,
97
116
} ,
98
117
} ,
99
118
} ,
100
- } ,
101
- else : {
102
- type : "button" ,
103
- label : "Mint" ,
104
- onclick : {
105
- type : "OPENLINK" ,
106
- url : "{{embed.metadata.nft.mintUrl}}" ,
107
- } ,
108
- } ,
119
+ ] ,
109
120
} ,
110
121
] ,
111
122
} ,
0 commit comments