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
1d42903d
Commit
1d42903d
authored
Apr 23, 2025
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix return type
parent
6497cf35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
useRewardsActivity.tsx
lib/hooks/useRewardsActivity.tsx
+17
-17
No files found.
lib/hooks/useRewardsActivity.tsx
View file @
1d42903d
import
{
useCallback
,
useRef
,
useEffect
}
from
'
react
'
;
import
type
{
Pre
VerifyContract
Response
}
from
'
@blockscout/points-types
'
;
import
type
{
Pre
SubmitTransaction
Response
}
from
'
@blockscout/points-types
'
;
import
config
from
'
configs/app
'
;
import
useApiFetch
from
'
lib/api/useApiFetch
'
;
...
...
@@ -59,28 +59,28 @@ export default function useRewardsActivity() {
}
catch
{}
},
[
apiFetch
,
checkActivityPassQuery
.
data
,
apiToken
]);
const
trackTransaction
=
useCallback
(
async
(
from
:
string
,
to
:
string
)
=>
makeRequest
(
'
rewards_user_activity_track_tx
'
,
{
from_address
:
from
,
to_address
:
to
,
chain_id
:
config
.
chain
.
id
??
''
,
}),
[
makeRequest
],
);
const
trackTransaction
=
useCallback
(
async
(
from
:
string
,
to
:
string
)
=>
{
return
(
await
makeRequest
(
'
rewards_user_activity_track_tx
'
,
{
from_address
:
from
,
to_address
:
to
,
chain_id
:
config
.
chain
.
id
??
''
,
})
)
as
PreSubmitTransactionResponse
|
undefined
;
},
[
makeRequest
]);
const
trackTransactionConfirm
=
useCallback
((
hash
:
string
,
token
:
string
)
=>
makeRequest
(
'
rewards_user_activity_track_tx_confirm
'
,
{
tx_hash
:
hash
,
token
}),
[
makeRequest
],
);
const
trackContract
=
useCallback
(
async
(
address
:
string
)
=>
{
return
(
await
makeRequest
(
'
rewards_user_activity_track_contract
'
,
{
address
,
chain_id
:
config
.
chain
.
id
??
''
,
})
)
as
PreVerifyContractResponse
|
undefined
;
},
[
makeRequest
]);
const
trackContract
=
useCallback
(
async
(
address
:
string
)
=>
makeRequest
(
'
rewards_user_activity_track_contract
'
,
{
address
,
chain_id
:
config
.
chain
.
id
??
''
,
}),
[
makeRequest
],
);
const
trackUsage
=
useCallback
((
action
:
string
)
=>
{
// check here because this function is called on page load
...
...
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