Skip to content

Commit 88f46e6

Browse files
authored
Merge pull request #15 from Azuro-protocol/migrate-to-sdk-v7-toolkit-v6
migrate to sdk v7 and toolkit v6
2 parents 97331fe + 1390e75 commit 88f46e6

23 files changed

Lines changed: 351 additions & 1324 deletions

File tree

package-lock.json

Lines changed: 253 additions & 1224 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
"dev": "npm run watch-icons & next dev",
1010
"build": "npm run build-icons && next build",
1111
"start": "next start",
12+
"lint-ts": "tsc --noEmit",
1213
"lint": "next lint && tsc --noEmit",
1314
"------ Icons --------------------------------------------------------------------------": "",
1415
"watch-icons": "node bin/icons --watch",
1516
"build-icons": "node bin/icons"
1617
},
1718
"dependencies": {
1819
"@azuro-org/dictionaries": "^3.0.28",
19-
"@azuro-org/sdk": "6.2.2",
20+
"@azuro-org/sdk": "7.0.2",
2021
"@azuro-org/sdk-social-aa-connector": "^1.1.8",
21-
"@azuro-org/toolkit": "5.1.8",
22+
"@azuro-org/toolkit": "6.0.1",
2223
"@floating-ui/react-dom-interactions": "^0.13.3",
2324
"@glidejs/glide": "^3.6.2",
2425
"@headlessui/react": "2.2.9",
@@ -28,14 +29,14 @@
2829
"@locmod/intl": "1.0.5",
2930
"@locmod/local-storage": "1.0.4",
3031
"@locmod/modal": "3.0.2",
31-
"axios": "^1.13.1",
32+
"axios": "^1.13.5",
3233
"classnames": "^2.5.1",
3334
"cookies-next": "^5.1.0",
3435
"copy-to-clipboard": "^3.3.3",
3536
"dayjs": "^1.11.13",
3637
"formular": "3.1.6",
3738
"graphql": "^16.9.0",
38-
"next": "15.5.9",
39+
"next": "15.5.12",
3940
"react": "^19.2.3",
4041
"react-dom": "^19.2.3",
4142
"react-xmasonry": "^3.0.6",

src/app/[sportSlug]/[countrySlug]/[leagueSlug]/[gameId]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useEffect } from 'react'
44
import { useGame, useGameState } from '@azuro-org/sdk'
5-
import { GameState, type GameQuery } from '@azuro-org/toolkit'
5+
import { GameState, type GameData } from '@azuro-org/toolkit'
66
import { useParams } from 'next/navigation'
77
import { liveStatisticsGameIdStore } from 'helpers/stores'
88

@@ -11,7 +11,7 @@ import Markets, { MarketsSkeleton } from 'compositions/event/Markets/Markets'
1111

1212

1313
type ContentProps = {
14-
game: NonNullable<GameQuery['game']>
14+
game: GameData
1515
}
1616

1717
const Content: React.FC<ContentProps> = ({ game }) => {

src/compositions/AcceptedBets/AcceptedBets.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const AcceptedBets: React.FC = () => {
4040
affiliate: process.env.NEXT_PUBLIC_AFFILIATE_ADDRESS as Address,
4141
},
4242
itemsPerPage: 500,
43-
orderDir: OrderDirection.Desc,
4443
}
4544
const { data, isLoading } = useBets(props)
4645

src/compositions/AcceptedBets/components/BetCard/BetCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type BetCardProps = {
2020
const BetCard: React.FC<BetCardProps> = ({ bet }) => {
2121
const {
2222
tokenId, createdAt, status: graphBetStatus, amount, outcomes, freebetId,
23-
isWin, isCashedOut,
23+
isWin, isCashedOut, orderState,
2424
} = bet
2525

2626
const { betToken } = useChain()
@@ -45,6 +45,7 @@ const BetCard: React.FC<BetCardProps> = ({ bet }) => {
4545
Boolean(games.length) && (
4646
<BetStatus
4747
graphBetStatus={graphBetStatus}
48+
orderState={orderState}
4849
games={games}
4950
isWin={isWin}
5051
isCashedOut={isCashedOut}

src/compositions/AcceptedBets/components/BetDetailsModal/BetDetailsModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ const BetDetailsModal: ModalComponent<BetDetailsModalProps> = (props) => {
152152
const { appChain, betToken } = useChain()
153153

154154
const {
155-
tokenId, createdAt, status: graphBetStatus, amount, outcomes, freebetId, totalOdds, possibleWin,
155+
tokenId, createdAt, orderState, status: graphBetStatus, amount, outcomes, freebetId, totalOdds, possibleWin,
156156
isWin, isCashedOut,
157157
} = bet
158158

@@ -191,6 +191,7 @@ const BetDetailsModal: ModalComponent<BetDetailsModalProps> = (props) => {
191191
Boolean(games.length) && (
192192
<BetStatus
193193
graphBetStatus={graphBetStatus}
194+
orderState={orderState}
194195
games={games}
195196
isWin={isWin}
196197
isCashedOut={isCashedOut}

src/compositions/BetStatus/BetStatus.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React, { useMemo } from 'react'
2-
import { getBetStatus, type GraphBetStatus, type GameQuery, BetStatus as TBetStatus } from '@azuro-org/toolkit'
2+
import {
3+
getBetStatus, type GraphBetStatus, type GameData, BetStatus as TBetStatus, BetOrderState,
4+
} from '@azuro-org/toolkit'
35
import { Message } from '@locmod/intl'
46
import cx from 'classnames'
57

@@ -30,11 +32,21 @@ const statusData: Data = {
3032
title: messages[TBetStatus.Canceled],
3133
color: 'text-grey-60',
3234
},
35+
[TBetStatus.Rejected]: {
36+
icon: 'interface/declined',
37+
title: messages[TBetStatus.Canceled],
38+
color: 'text-grey-60',
39+
},
3340
[TBetStatus.PendingResolution]: {
3441
icon: 'interface/pending',
3542
title: messages[TBetStatus.PendingResolution],
3643
color: 'text-accent-blue',
3744
},
45+
[TBetStatus.Preparing]: {
46+
icon: 'interface/pending',
47+
title: messages[TBetStatus.Preparing],
48+
color: 'text-accent-blue',
49+
},
3850
[TBetStatus.Resolved]: {
3951
icon: 'interface/win',
4052
title: messages[TBetStatus.Resolved],
@@ -43,19 +55,21 @@ const statusData: Data = {
4355
}
4456

4557
type BetStatusProps = {
46-
graphBetStatus: GraphBetStatus
47-
games: NonNullable<GameQuery['game']>[]
58+
graphBetStatus: GraphBetStatus | null
59+
orderState: BetOrderState
60+
games: GameData[]
4861
isWin: boolean | null
4962
isCashedOut: boolean
5063
}
5164

52-
const BetStatus: React.FC<BetStatusProps> = ({ graphBetStatus, games, isWin, isCashedOut }) => {
65+
const BetStatus: React.FC<BetStatusProps> = ({ graphBetStatus, orderState, games, isWin, isCashedOut }) => {
5366
const betStatus = useMemo(() => {
5467
return getBetStatus({
5568
graphStatus: graphBetStatus,
69+
orderState,
5670
games: games!,
5771
})
58-
}, [])
72+
}, [graphBetStatus, orderState, games])
5973

6074
let { icon, title, color } = statusData[betStatus]
6175

src/compositions/BetStatus/messages.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default {
1717
[BetStatus.Resolved]: {
1818
en: 'Resolved',
1919
},
20+
[BetStatus.Preparing]: {
21+
en: 'Preparing',
22+
},
2023
win: {
2124
en: 'Won',
2225
},

src/compositions/LiveStatistics/LiveStatistics.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useParams } from 'next/navigation'
55
import { Message } from '@locmod/intl'
66
import cx from 'classnames'
77
import { useGame, useLiveStatistics } from '@azuro-org/sdk'
8-
import { type GamesQuery } from '@azuro-org/toolkit'
8+
import { type GameData } from '@azuro-org/toolkit'
99
import { useIsMounted } from 'hooks'
1010
import { closeModal } from '@locmod/modal'
1111
import { liveStatisticsGameIdStore } from 'helpers/stores'
@@ -21,7 +21,7 @@ import messages from './messages'
2121

2222
type ContentProps = {
2323
storeGameId: string
24-
game: GamesQuery['games'][0]
24+
game: GameData
2525
isGamePage: boolean
2626
withCollapse?: boolean
2727
withClearButton?: boolean

src/compositions/LiveStatistics/components/ScoreBoard/ScoreBoard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { type GamesQuery } from '@azuro-org/toolkit'
1+
import { type GameData } from '@azuro-org/toolkit'
22

33
import { OpponentLogo } from 'components/dataDisplay'
44

55
import TotalScore, { type TotalScoreProps } from '../TotalScore/TotalScore'
66

77

88
type ScoreBoardProps = {
9-
participants: GamesQuery['games'][0]['participants']
9+
participants: GameData['participants']
1010
} & TotalScoreProps
1111

1212
const ScoreBoard: React.FC<ScoreBoardProps> = ({ sportId, scoreBoard, participants }) => {

0 commit comments

Comments
 (0)