@goat-sdk/plugin-betswirl
Version:
<div align="center"> <a href="https://github.com/goat-sdk/goat">
2 lines (1 loc) • 1.03 kB
JavaScript
import{a as i,b as u,c as a,d as b}from"./chunk-3NOEXPMQ.mjs";import{b as s,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 T}from"zod";import{CASINO_GAME_TYPE as c,MAX_SELECTABLE_ROULETTE_NUMBER as E,MIN_SELECTABLE_ROULETTE_NUMBER as L,Roulette as h}from"@betswirl/sdk-core";function k(e,p){return A({name:"betswirl_roulette",description:"Play the BetSwirl Roulette. The player is betting that the rolled number will be one of the chosen numbers. The user input also contains the bet amount (in ether unit), and the token symbol.",parameters:T.object({numbers:T.number().gte(L).lte(E).array().min(1).max(E).describe("The numbers to bet on"),...s,...m(c.ROULETTE)})},async t=>{let o=t.numbers,n=await i(e,t.token),l=u(t.betAmount,n),B=await a(e,c.ROULETTE,h.encodeInput(o),h.getMultiplier(o),{betAmount:l,betToken:n,betCount:1,receiver:e.getAddress(),stopGain:0n,stopLoss:0n});return await b(e,B,p)})}r(k,"createRouletteTool");export{k as a};