UNPKG

@goat-sdk/plugin-betswirl

Version:

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

2 lines (1 loc) 914 B
import{a,b as c,c as m,d as u}from"./chunk-3NOEXPMQ.mjs";import{b as r,c as s}from"./chunk-2EYWWA44.mjs";import{a as i}from"./chunk-YSXGDEY5.mjs";import{createTool as A}from"@goat-sdk/core";import{z as T}from"zod";import{CASINO_GAME_TYPE as p,COINTOSS_FACE as S,CoinToss as h}from"@betswirl/sdk-core";function E(e,b){return A({name:"betswirl_coinToss",description:"Flip a coin on BetSwirl. The player is betting that the rolled face will be the one chosen. The user input also contains the bet amount (in ether unit), and the token symbol.",parameters:T.object({face:T.nativeEnum(S).describe("The face of the coin"),...r,...s(p.COINTOSS)})},async t=>{let o=t.face,n=await a(e,t.token),f=c(t.betAmount,n),d=await m(e,p.COINTOSS,h.encodeInput(o),h.getMultiplier(o),{betAmount:f,betToken:n,betCount:1,receiver:e.getAddress(),stopGain:0n,stopLoss:0n});return await u(e,d,b)})}i(E,"createCoinTossTool");export{E as a};