Socket
Socket
Sign inDemoInstall

4irelabs-blackchain-smart-contract

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

4irelabs-blackchain-smart-contract - npm Package Compare versions

Comparing version 0.0.21 to 0.0.22

4

dist/src/blackchainApi.d.ts
/// <reference types="node" />
/// <reference types="bn.js" />
import { Character, PlayerAccount, Clas, Weapon, Armor, BCError, Dungeon, Difficulty, Shield } from "./types";
import { Character, PlayerAccount, Clas, Weapon, Armor, BCError, Dungeon, Difficulty, Shield, BattleLog } from "./types";
import * as Anchor from "@project-serum/anchor";

@@ -20,3 +20,3 @@ import { BlackchainProgram } from "../idl/blackchain_program";

raid(dungeon: PublicKey, characterPubkey: PublicKey): Promise<Buffer | BCError>;
getBattleLog(sign: string): Promise<string | BCError>;
getBattleLog(sign: string): Promise<BattleLog | BCError>;
sendTransaction(buffer: Buffer): Promise<string | BCError>;

@@ -23,0 +23,0 @@ lockCharacter(character: PublicKey): Promise<Buffer | BCError>;

@@ -228,6 +228,10 @@ "use strict";

const dungeon = web3_js_1.Keypair.generate();
const dungeons = yield this.getDungeonList();
const dungeonName = Math.max(...(dungeons && dungeons.length !== 0
? dungeons.map((dungeon) => dungeon[1].id)
: [0]));
const dungeonIndex = (yield this.program.account.playerAccount.fetch(playerPubkey)).dungeons.findIndex((key) => key.toString() == constants_1.DEFAULT_PUBLIC_KEY);
const [feePdaAccount, pdaBump] = yield (0, utils_1.getProgramWalletPublicKey)(this.programId);
try {
yield this.program.rpc.scoutDungeon(new anchor_1.BN(dungeonIndex), difficulty, {
yield this.program.rpc.scoutDungeon(new anchor_1.BN(dungeonIndex), difficulty, dungeonName + 1, {
accounts: {

@@ -326,4 +330,14 @@ playerAccount: playerPubkey,

return types_1.BCErrorEnum.InvalidArgument;
const battleLog = logs.filter((x) => x.slice(0, 14) == "Program log: @");
return battleLog[0].slice(16, battleLog[0].length - 1);
//this.program.addEventListener()
const battleLogStr = logs.filter((x) => x.slice(0, 14) == "Program log: @");
const battleLog = JSON.parse(battleLogStr[0].slice(16, battleLogStr[0].length));
return {
lastHp: battleLog.lastHp,
receivedExp: new anchor_1.BN(battleLog.receivedExp),
receivedGold: new anchor_1.BN(battleLog.receivedGold),
battleLog: battleLog.battleLog,
complete: battleLog.complete,
chestOpened: battleLog.chestOpened,
items: battleLog.items,
};
});

@@ -330,0 +344,0 @@ }

@@ -88,2 +88,3 @@ export declare const DEFAULT_PUBLIC_KEY = "11111111111111111111111111111111";

};
export declare const requiredExp: number[];
export declare const ErrorsRegex: {

@@ -90,0 +91,0 @@ InvalidArgument: RegExp;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ErrorsRegex = exports.ClassList = exports.Cluster = exports.PLAYER_ACCOUNT_SPACE = exports.DEFAULT_PUBLIC_KEY = void 0;
exports.ErrorsRegex = exports.requiredExp = exports.ClassList = exports.Cluster = exports.PLAYER_ACCOUNT_SPACE = exports.DEFAULT_PUBLIC_KEY = void 0;
const types_1 = require("./types");

@@ -78,2 +78,5 @@ exports.DEFAULT_PUBLIC_KEY = "11111111111111111111111111111111";

};
exports.requiredExp = [
0, 2500, 3750, 5250, 7350, 10290, 14406, 20169, 28236, 39531,
];
exports.ErrorsRegex = {

@@ -80,0 +83,0 @@ InvalidArgument: new RegExp("invalid program argument"),

@@ -894,2 +894,11 @@ /// <reference types="bn.js" />

export declare type EnemyType = typeof EnemyTypeEnum[keyof typeof EnemyTypeEnum];
export declare type BattleLog = {
lastHp: number;
receivedExp: Anchor.BN;
receivedGold: Anchor.BN;
battleLog: string;
complete: number;
chestOpened: number;
items: string[];
};
export {};
{
"name": "4irelabs-blackchain-smart-contract",
"version": "0.0.21",
"version": "0.0.22",
"description": "Integration with Solana API",

@@ -5,0 +5,0 @@ "author": "",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc