Skip to content

Commit 3880465

Browse files
authored
Merge pull request #155 from AbstractSDK/believathon
Believathon XION Example
2 parents e3822ce + 3ea926d commit 3880465

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+5604
-185
lines changed

.changeset/big-llamas-scream.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"wagemos-xion-nextjs": minor
3+
"@abstract-money/provider-xion": minor
4+
"wagemos-cosmoskit-nextjs": patch
5+
"wagemos-graz-nextjs": patch
6+
"@abstract-money/core": patch
7+
---
8+
9+
Update xion abstraxion dep

.changeset/loud-boxes-breathe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@abstract-money/actions-xion": minor
3+
---
4+
5+
Update XION actions with better names

examples/wagemos-cosmoskit-nextjs/src/app/_components/place-bet-dialog.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {
3737
SelectValue,
3838
} from '../../components/ui/select'
3939
import { useToast } from '../../components/ui/use-toast'
40+
import { ROUND_ACCOUNT_ID, ROUND_CHAIN_NAME } from '../_lib/constants'
4041

4142
const placeBetSchema = z.object({
4243
amount: z.coerce
@@ -63,8 +64,8 @@ export function PlaceBetDialog({ round }: { round: RoundResponse }) {
6364

6465
const { mutateAsync: placeBetAsync, isLoading } =
6566
betting.mutations.usePlaceBet({
66-
accountId: stringToAccountId('neutron-18'),
67-
chainName: 'neutron',
67+
accountId: stringToAccountId(ROUND_ACCOUNT_ID),
68+
chainName: ROUND_CHAIN_NAME,
6869
})
6970

7071
const onSubmit: SubmitHandler<z.infer<typeof placeBetSchema>> = useCallback(

examples/wagemos-cosmoskit-nextjs/src/app/_components/wallet-button.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import { useChain } from '@cosmos-kit/react'
33
import { useCallback } from 'react'
44
import { Button } from '../../components/ui/button'
55
import { useToast } from '../../components/ui/use-toast'
6+
import { ROUND_CHAIN_NAME } from '../_lib/constants'
67

7-
function DisconnectButton({ chainName = 'neutron' }: { chainName?: string }) {
8+
function DisconnectButton({
9+
chainName = ROUND_CHAIN_NAME,
10+
}: { chainName?: string }) {
811
const { disconnect, address } = useChain(chainName)
912

1013
const { toast } = useToast()
@@ -44,7 +47,9 @@ function DisconnectButton({ chainName = 'neutron' }: { chainName?: string }) {
4447
)
4548
}
4649

47-
function ConnectButton({ chainName = 'neutron' }: { chainName?: string }) {
50+
function ConnectButton({
51+
chainName = ROUND_CHAIN_NAME,
52+
}: { chainName?: string }) {
4853
const { connect } = useChain(chainName)
4954

5055
const { toast } = useToast()
@@ -63,7 +68,7 @@ function ConnectButton({ chainName = 'neutron' }: { chainName?: string }) {
6368
}
6469

6570
export function WalletButton({
66-
chainName = 'neutron',
71+
chainName = ROUND_CHAIN_NAME,
6772
}: { chainName?: string }) {
6873
const { isWalletConnected: isConnected } = useChain(chainName)
6974
if (isConnected) {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const ROUND_ACCOUNT_ID = 'neutron-18';
2+
3+
export const ROUND_CHAIN_NAME = 'neutron';

examples/wagemos-cosmoskit-nextjs/src/app/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ import {
1818
RoundWinningTeam,
1919
} from './_components/round'
2020
import { WalletButton } from './_components/wallet-button'
21+
import { ROUND_ACCOUNT_ID, ROUND_CHAIN_NAME } from './_lib/constants'
2122

2223
export default function Home() {
2324
const { data, isLoading, isError } = betting.queries.useListRounds({
2425
args: {},
25-
accountId: stringToAccountId('neutron-18'),
26-
chainName: 'neutron',
26+
accountId: stringToAccountId(ROUND_ACCOUNT_ID),
27+
chainName: ROUND_CHAIN_NAME,
2728
})
2829
if (isLoading) return <p>Loading...</p>
2930
if (isError) return <p>Error</p>

examples/wagemos-graz-nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"typecheck": "tsc --noEmit",
1010
"lint": "next lint",
1111
"postinstall": "pnpm generate",
12-
"generate": "graz generate -g -M neutron,osmosis -T neutrontestnet,osmosistestnet"
12+
"generate": "graz generate -g -M neutron,osmosis -T neutrontestnet,osmosistestnet,xiontestnet"
1313
},
1414
"dependencies": {
1515
"@abstract-money/core": "workspace:*",

examples/wagemos-graz-nextjs/src/_generated/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import {
4949
// React
5050
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5151

52-
export const BETTING_MODULE_ID = 'abstract:betting'
52+
export const BETTING_MODULE_ID = 'wagemos:betting'
5353

5454
export const betting = {
5555
queries: {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const ROUND_ACCOUNT_ID = 'neutron-5';
1+
export const ROUND_ACCOUNT_ID = 'neutrontestnet-67';
22
export const ROUND_CHAIN_NAME = "neutrontestnet";
33
export const CHAIN_IDS = ["pion-1"];
44
// export const CHAIN_IDS = ["neutron-1", "osmosis-1", "pion-1"];

examples/wagemos-graz-nextjs/src/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const poppins = Poppins({
3333
})
3434
const abstractConfig = createConfig({
3535
provider: grazProvider,
36-
apiUrl: 'http://localhost:4001/graphql',
36+
apiUrl: 'https://api-hackmos-2024.up.railway.app/',
3737
})
3838

3939
export default function RootLayout({

0 commit comments

Comments
 (0)