Merge branch 'master' of https://gitea.playpoolstudios.com/warlock/duelfi
This commit is contained in:
commit
28a16494c7
|
|
@ -6,7 +6,7 @@ interface PriceSelectionProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PriceSelection({ selectedPrice, onSelect }: PriceSelectionProps) {
|
export function PriceSelection({ selectedPrice, onSelect }: PriceSelectionProps) {
|
||||||
const presets = [0.01, 0.05, 0.1, 0.2, 0.5, 1.0];
|
const presets = [0.05, 0.1, 0.2, 0.5, 1.0];
|
||||||
const [inputValue, setInputValue] = useState<string>("");
|
const [inputValue, setInputValue] = useState<string>("");
|
||||||
const MIN_AMOUNT = 0.01;
|
const MIN_AMOUNT = 0.01;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ export default function YourGames({bets}:GameModalProps) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
const tx = await closeBet(wallet, selectedBet.id);
|
const tx = await closeBet(wallet, selectedBet.id, user?.id ?? "na");
|
||||||
|
|
||||||
const url = EXPLORER_TX_TEMPLATE.replace("{address}", tx);
|
const url = EXPLORER_TX_TEMPLATE.replace("{address}", tx);
|
||||||
connection.confirmTransaction(tx, CONFIRMATION_THRESHOLD).finally(()=>{
|
connection.confirmTransaction(tx, CONFIRMATION_THRESHOLD).finally(()=>{
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,10 @@ export type Bets = {
|
||||||
{
|
{
|
||||||
"name": "winner",
|
"name": "winner",
|
||||||
"type": "pubkey"
|
"type": "pubkey"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userid",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,10 @@
|
||||||
{
|
{
|
||||||
"name": "winner",
|
"name": "winner",
|
||||||
"type": "pubkey"
|
"type": "pubkey"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userid",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ export async function getVaultByAddress(wallets: ConnectedSolanaWallet, address:
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function closeBet(wallets: ConnectedSolanaWallet, betId: string): Promise<string> {
|
export async function closeBet(wallets: ConnectedSolanaWallet, uid:string, betId: string): Promise<string> {
|
||||||
try {
|
try {
|
||||||
const wallet = {
|
const wallet = {
|
||||||
publicKey: new PublicKey(wallets.address),
|
publicKey: new PublicKey(wallets.address),
|
||||||
|
|
@ -142,7 +142,7 @@ export async function closeBet(wallets: ConnectedSolanaWallet, betId: string): P
|
||||||
|
|
||||||
// Execute the closeBet transaction
|
// Execute the closeBet transaction
|
||||||
const tx = await program.methods
|
const tx = await program.methods
|
||||||
.closeBet(winner)
|
.closeBet(winner, uid)
|
||||||
.accounts({
|
.accounts({
|
||||||
betVault: chosenBet,
|
betVault: chosenBet,
|
||||||
betsList: bet_list_pda,
|
betsList: bet_list_pda,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user