New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

gameblix-sdk-dev

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gameblix-sdk-dev

Typescript SDK to interact with GamebliX program.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

spl-casino-dev-sdk

Installation

yarn add spl-casino-dev-sdk

Global

Load SDK wrappers

import { SplCasinoSDK, AdminWrapper } from "spl-casino-dev-sdk";
import { SolanaProvider } from "@saberhq/solana-contrib";

const wallet = useWallet();
const { connection } = useConnection();

const provider = SolanaProvider.init({
  connection,
  wallet: wallet as any,
  opts: {
    preflightCommitment: "finalized",
    commitment: "finalized",
  },
});
const splCasinoSDK = SplCasinoSDK.load({ provider });
const adminWrapper = new AdminWrapper(splCasinoSDK, wallet.publickKey.toString()); // wallet.publickKey should be String

Get global states - admin wrapper

  let info = await adminWrapper.getGlobalInfo();

Bot

import { SplCasinoSDK, BotWrapper } from "spl-casino-dev-sdk";
import { SolanaProvider } from "@saberhq/solana-contrib";

const wallet = useWallet();
const { connection } = useConnection();

const provider = SolanaProvider.init({
  connection,
  wallet: wallet as any,
  opts: {
    preflightCommitment: "finalized",
    commitment: "finalized",
  },
});
const splCasinoSDK = SplCasinoSDK.load({ provider });
const botWrapper = new BotWrapper(splCasinoSDK, wallet.publickKey.toString()); // wallet.publickKey should be String

유저, 유저칩 추가 및 칩 구매 - 봇 영력

첫 유저, 유저에 한해서 첫 칩구매 ( 유저가 직접 월렛으로 구매하는 케이스 ) Signer: 유저, 봇 Check diagram.xlsx

  const tx = await botWrapper.addUserAndCreateUserChipAndPurchase({
    depositTokenAmount,  // token amount; 예시: 3.412 USDC => 3.412
    userChipTokenMintAddressStr, 
  });

유저, 유저칩 추가 및 칩 구매 - 봇 영력

첫 유저, 유저에 한해서 첫 칩구매 ( 유저가 credit으로 칩을 구매하는 케이스 ) 먼저 유저가 이 RPC를 호출하고, 크레딧으로 구입 팝업을 띄운 후 유저입금이 완료되면 purchaseChipByCredit를 호출 해 주어야 함. Signer: 유저, 봇 Check diagram.xlsx

  const tx = await botWrapper.addUserAndCreateUserChip({
    userChipTokenMintAddressStr, 
  });

유저 추가 - 봇 영력

첫 유저, 유저에 한해서 첫 칩구매 유저가 첫 가입 시 유저를 추가해 주어야 하며 혹은 유저가 첫 칩 구매시 위의 함수를 호출 해 주어도 됨. Signer: 유저, 봇 Check diagram.xlsx

  const tx = await botWrapper.addUser({});

유저, 유저칩 추가 및 칩 구매 - 봇 영력

유저에 한해서 첫 칩구매 ( 유저가 직접 월렛으로 구매하는 케이스 ) Signer: 유저, 봇 Check diagram.xlsx

  const tx = await botWrapper.createUserChipAndPurchase({
    depositTokenAmount,  // token amount; 예시: 3.412 USDC => 3.412
    userChipTokenMintAddressStr, 
  });

유저, 유저칩 추가 및 칩 구매 - 봇 영력

유저에 한해서 첫 칩구매 ( 유저가 credit으로 칩을 구매하는 케이스 ) 먼저 유저가 이 RPC를 호출하고, 크레딧으로 구입 팝업을 띄운 후 유저입금이 완료되면 아래의 purchaseChipByCredit를 호출 해 주어야 함. Signer: 유저, 봇 Check diagram.xlsx

  const tx = await botWrapper.createUserChip({
    userChipTokenMintAddressStr, 
  });

칩 구매 - 봇 영력

유저에 한해서 첫 칩구매 ( 유저가 credit으로 칩을 구매하는 케이스 ) 유저입금이 완료되면 호출 Signer: 입금월렛, 봇 Check diagram.xlsx

  const tx = await botWrapper.purchaseChipByCredit({
    depositTokenAmount,   // token amount; 예시: 3.412 USDC => 3.412
    userWalletStr,
    userChipTokenMintAddressStr,
  });

칩 구매 - 봇 영력

이미 이 칩을 구매한 적이 있는 유저에 한해서 직접 이 함수를 호출하여 칩 구매 ( 유저가 직접 월렛으로 구매하는 케이스 ) 유저입금이 완료되면 호출 Signer: 유저, 봇 Check diagram.xlsx

  const tx = await botWrapper.purchaseChipByUser({
    depositTokenAmount,   // token amount; 예시: 3.412 USDC => 3.412
    userChipTokenMintAddressStr,
  });

유저, 유저칩 추가 및 칩 구매 - 봇 영력

유저가 게임방에 들어가기 전에 칩을 락 거는 부분 게임 진행 시에는 칩을 재구매 할 수 없음 룸을 나갔다가 다시 들어와야 함. Signer: 유저, 봇 Check diagram.xlsx

  const tx = await botWrapper.joinRoom({
    userChipTokenMintAddressStr, 
    playerChipTokenAmount, // token amount; 예시: 3.412 USDC => 3.412
  });

유저, 유저칩 추가 및 칩 구매 - 봇 영력

유저가 게임방에 들어가기 전에 칩을 락 거는 부분 게임 진행 시에는 칩을 재구매 할 수 없음 룸을 나갔다가 다시 들어와야 함. Signer: 관리자 혹은 봇 Check diagram.xlsx

  const tx = await botWrapper.setUserStatus({
    userWalletStr, 
    isUnblocked, // true: 해제 false: 차단
  });

플랫폼에서 이용중인 토큰의 리스트 - 봇 영력

Check diagram.xlsx

  const tx = await botWrapper.getPlatformChips();

플랫폼의 토큰 정보 - 봇 영력

Check diagram.xlsx

  const tx = await botWrapper.getPlatformChipInfo({
    chipTokenMintAddressStr
  });

User

import { SplCasinoSDK, UserWrapper } from "spl-casino-dev-sdk";
import { SolanaProvider } from "@saberhq/solana-contrib";

const wallet = useWallet();
const { connection } = useConnection();

const provider = SolanaProvider.init({
  connection,
  wallet: wallet as any,
  opts: {
    preflightCommitment: "finalized",
    commitment: "finalized",
  },
});
const splCasinoSDK = SplCasinoSDK.load({ provider });
const userWrapper = new UserWrapper(splCasinoSDK, wallet.publickKey.toString()); // wallet.publickKey should be String

언락 되어 있는 영력안에서 유저가 환전할 때 - 유저 영력

수수료는 플랫폼으로 회수 됨 chipTokenAmount는 수수료를 포함한 전액 - 유저에게서 차감되는 액 Signer: 유저, 봇

InsufficientChipAmount오류의 의미는 유저의 언락 된 양이 부족하다는 의미 Check diagram.xlsx [checklist] No.4

  const tx = await userWrapper.claimUserFund({
    userChipTokenMintAddressStr,
    chipTokenAmount,  // chip token amount; 예시: 3.412 USDC => 3.412
    feePercentage, // 1000 = 100%, 0 = free
  });

방에서 나올 때 호출 - 유저 영력

수수료가 있는 경우 뱅커에게 충전되고 나올 때 갖고 나오는 양(currentPlayerChipTokenAmount)은 수수료를 뺀 나머지 금액 currentPlayerChipTokenAmount 수수료를 뺀 나머지 금액 Signer: 유저, 봇

DisabledChip오류의 의미는 플랫폼이 이 칩의 거래를 임시 중단 하였다는 의미 Check diagram.xlsx [checklist] No.4

  const tx = await userWrapper.exitGame({
    gameTokenMintAddressStr,
    currentPlayerChipTokenAmount,  // chip token amount; 예시: 3.412 USDC => 3.412
  });

플랫폼내의 유저리스트 - 유저 영력

보안상 문제일 경우 이 RPC 삭제 상의

  let users = await userWrapper.getUsers();

유저 정보 - 유저 영력

보안상 문제일 경우 이 RPC 삭제 상의

  let user = await userWrapper.getUserInfo({
    userWalletStr // String
  });

유저의 보유 칩 리스트 - 유저 영력

보안상 문제일 경우 이 RPC 삭제 상의

  let users = await userWrapper.getUserChips(
    userPda
  );

유저의 보유 칩 정보 - 유저 영력

보안상 문제일 경우 이 RPC 삭제 상의

  let user = await userWrapper.getUserChipInfo({
    userPda,
    userChipTokenMintAddressStr,
  });

Keywords

solana casino

FAQs

Package last updated on 12 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts