4irelabs-blackchain-smart-contract
Advanced tools
Comparing version 0.0.38 to 0.0.39
/// <reference types="node" /> | ||
/// <reference types="bn.js" /> | ||
import { Character, PlayerAccount, Clas, Weapon, Armor, BCError, Dungeon, Difficulty, Shield, BattleLog, Potion, UpgradeStats, Materials, Consumables } from "./types"; | ||
import { Character, PlayerAccount, Clas, Weapon, Armor, BCError, Dungeon, Difficulty, Shield, BattleLog, Potion, UpgradeStats, Materials, Consumables, MaterialType, MaterialLot, ConsumableLot } from "./types"; | ||
import * as Anchor from "@project-serum/anchor"; | ||
@@ -25,7 +24,11 @@ import { BlackchainProgram } from "../idl/blackchain_program"; | ||
sendTransaction(buffer: Buffer): Promise<string | BCError>; | ||
lockCharacter(character: PublicKey): Promise<Buffer | BCError>; | ||
lockWeapon(weapon: PublicKey): Promise<Buffer | BCError>; | ||
lockArmor(armor: PublicKey): Promise<Buffer | BCError>; | ||
lockShield(shield: PublicKey): Promise<Buffer | BCError>; | ||
lockDungeon(dungeon: PublicKey): Promise<Buffer | BCError>; | ||
lockCharacter(character: PublicKey, price: number): Promise<Buffer | BCError>; | ||
lockWeapon(weapon: PublicKey, price: number): Promise<Buffer | BCError>; | ||
lockArmor(armor: PublicKey, price: number): Promise<Buffer | BCError>; | ||
lockShield(shield: PublicKey, price: number): Promise<Buffer | BCError>; | ||
lockDungeon(dungeon: PublicKey, price: number): Promise<Buffer | BCError>; | ||
lockConsumable(price: number, amount: number, type: Potion): Promise<[Buffer, PublicKey] | BCError>; | ||
unlockConsumable(consumable: PublicKey): Promise<Buffer | BCError>; | ||
lockMaterial(price: number, amount: number, type: MaterialType): Promise<[Buffer, PublicKey] | BCError>; | ||
unlockMaterial(material: PublicKey): Promise<Buffer | BCError>; | ||
unlockCharacter(character: PublicKey): Promise<Buffer | BCError>; | ||
@@ -65,2 +68,6 @@ unlockWeapon(weapon: PublicKey): Promise<Buffer | BCError>; | ||
getConsumables(address?: PublicKey): Promise<[PublicKey, Consumables] | null>; | ||
getMaterialLot(address: PublicKey): Promise<MaterialLot | null>; | ||
getMaterialLotList(address?: PublicKey): Promise<[PublicKey, MaterialLot][] | null>; | ||
getConsumableLot(address: PublicKey): Promise<ConsumableLot | null>; | ||
getConsumableLotList(address?: PublicKey): Promise<[PublicKey, ConsumableLot][] | null>; | ||
getRoomsCount(address?: PublicKey): Promise<BN | null>; | ||
@@ -67,0 +74,0 @@ getGoldCount(address?: PublicKey): Promise<BN | null>; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="bn.js" /> | ||
import * as Anchor from "@project-serum/anchor"; | ||
@@ -10,4 +9,4 @@ import { TypeDef } from "@project-serum/anchor/dist/cjs/program/namespace/types"; | ||
}; | ||
export declare type PlayerAccount = TypeDef<BlackchainProgram["accounts"]["5"], Anchor.IdlTypes<BlackchainProgram>>; | ||
declare type WeaponAccount = TypeDef<BlackchainProgram["accounts"]["7"], Anchor.IdlTypes<BlackchainProgram>>; | ||
export declare type PlayerAccount = TypeDef<BlackchainProgram["accounts"]["7"], Anchor.IdlTypes<BlackchainProgram>>; | ||
declare type WeaponAccount = TypeDef<BlackchainProgram["accounts"]["9"], Anchor.IdlTypes<BlackchainProgram>>; | ||
export declare type Weapon = Omit<WeaponAccount, "bonuses" | "rank"> & { | ||
@@ -23,7 +22,7 @@ bonuses: Bonus[]; | ||
}; | ||
declare type DungeonAccount = TypeDef<BlackchainProgram["accounts"]["3"], Anchor.IdlTypes<BlackchainProgram>>; | ||
declare type DungeonAccount = TypeDef<BlackchainProgram["accounts"]["4"], Anchor.IdlTypes<BlackchainProgram>>; | ||
export declare type Dungeon = Omit<DungeonAccount, "branches"> & { | ||
branches: Branches; | ||
}; | ||
declare type ShieldAccount = TypeDef<BlackchainProgram["accounts"]["6"], Anchor.IdlTypes<BlackchainProgram>>; | ||
declare type ShieldAccount = TypeDef<BlackchainProgram["accounts"]["8"], Anchor.IdlTypes<BlackchainProgram>>; | ||
export declare type Shield = Omit<ShieldAccount, "status"> & { | ||
@@ -33,3 +32,3 @@ status: Status; | ||
}; | ||
declare type MaterialsAccount = TypeDef<BlackchainProgram["accounts"]["4"], Anchor.IdlTypes<BlackchainProgram>>; | ||
declare type MaterialsAccount = TypeDef<BlackchainProgram["accounts"]["5"], Anchor.IdlTypes<BlackchainProgram>>; | ||
export declare type Materials = Omit<MaterialsAccount, "materials"> & { | ||
@@ -48,2 +47,10 @@ materials: { | ||
}; | ||
declare type MaterialLotAccount = TypeDef<BlackchainProgram["accounts"]["6"], Anchor.IdlTypes<BlackchainProgram>>; | ||
export declare type MaterialLot = Omit<MaterialLotAccount, "typ"> & { | ||
typ: MaterialType; | ||
}; | ||
declare type ConsumableLotAccount = TypeDef<BlackchainProgram["accounts"]["3"], Anchor.IdlTypes<BlackchainProgram>>; | ||
export declare type ConsumableLot = Omit<ConsumableLotAccount, "typ"> & { | ||
typ: Potion; | ||
}; | ||
export declare function enumEq<T>(fst: T, snd: T): boolean; | ||
@@ -57,2 +64,5 @@ export declare const RankEnum: { | ||
}; | ||
Rare: { | ||
rare: {}; | ||
}; | ||
Epic: { | ||
@@ -946,3 +956,3 @@ epic: {}; | ||
chestOpened: number; | ||
items: Artifact; | ||
items: Artifact[]; | ||
materials: Drop<MaterialType>[]; | ||
@@ -949,0 +959,0 @@ consumables: Drop<Potion>[]; |
@@ -11,2 +11,3 @@ "use strict"; | ||
Common: { common: {} }, | ||
Rare: { rare: {} }, | ||
Epic: { epic: {} }, | ||
@@ -13,0 +14,0 @@ Mythic: { mythic: {} }, |
@@ -1,2 +0,1 @@ | ||
/// <reference types="bn.js" /> | ||
import { BN } from "@project-serum/anchor"; | ||
@@ -3,0 +2,0 @@ import { PublicKey } from "@solana/web3.js"; |
{ | ||
"name": "4irelabs-blackchain-smart-contract", | ||
"version": "0.0.38", | ||
"version": "0.0.39", | ||
"description": "Integration with Solana API", | ||
@@ -13,3 +13,6 @@ "author": "", | ||
"devDependencies": { | ||
"typescript": "^4.5.5" | ||
"@types/jest": "^27.4.1", | ||
"jest": "^27.5.1", | ||
"typescript": "^4.5.5", | ||
"ts-jest": "^27.1.3" | ||
}, | ||
@@ -19,8 +22,8 @@ "scripts": { | ||
"start": "node dist/src/index.js", | ||
"watch": "yarn tsc -w" | ||
"watch": "yarn tsc -w", | ||
"test": "yarn build && jest --runInBand" | ||
}, | ||
"dependencies": { | ||
"@project-serum/anchor": "^0.20.1", | ||
"@project-serum/anchor": "^0.23.0", | ||
"@solana/spl-token": "^0.1.8", | ||
"@solana/web3.js": "^1.32.0", | ||
"@types/bignumber.js": "^5.0.0", | ||
@@ -27,0 +30,0 @@ "bignumber.js": "^9.0.2", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
487012
6
17
14747
4
+ Added@project-serum/anchor@0.23.0(transitive)
+ Addedcross-fetch@3.1.8(transitive)
+ Addedtslib@2.6.3(transitive)
- Removed@solana/web3.js@^1.32.0
- Removed@project-serum/anchor@0.20.1(transitive)