UNPKG

@goat-sdk/plugin-betswirl

Version:

<div align="center"> <a href="https://github.com/goat-sdk/goat">

2 lines (1 loc) 963 B
import{a as s,b as a,c,d as u}from"./chunk-3NOEXPMQ.mjs";import{b as i,c as m}from"./chunk-2EYWWA44.mjs";import{a as r}from"./chunk-YSXGDEY5.mjs";import{createTool as A}from"@goat-sdk/core";import{z as b}from"zod";import{CASINO_GAME_TYPE as E,Dice as h,MAX_SELECTABLE_DICE_NUMBER as d,MIN_SELECTABLE_DICE_NUMBER as I}from"@betswirl/sdk-core";function k(e,p){return A({name:"betswirl_dice",description:"Play the BetSwirl Dice. The player is betting that the rolled number will be above this chosen number. The user input also contains the bet amount (in ether unit), and the token symbol.",parameters:b.object({number:b.number().gte(I).lte(d).describe("The number to bet on"),...i,...m(E.DICE)})},async t=>{let o=t.number,n=await s(e,t.token),B=a(t.betAmount,n),T=await c(e,E.DICE,h.encodeInput(o),h.getMultiplier(o),{betAmount:B,betToken:n,betCount:1,receiver:e.getAddress(),stopGain:0n,stopLoss:0n});return await u(e,T,p)})}r(k,"createDiceTool");export{k as a};