diff --git a/packages/engine/paima-rest/src/controllers/AchievementsController.ts b/packages/engine/paima-rest/src/controllers/AchievementsController.ts index be34f260..9863f88b 100644 --- a/packages/engine/paima-rest/src/controllers/AchievementsController.ts +++ b/packages/engine/paima-rest/src/controllers/AchievementsController.ts @@ -1,7 +1,7 @@ import { Controller, Get, Path, Query, Route } from 'tsoa'; -import { EngineService } from '../EngineService'; +import { EngineService } from '../EngineService.js'; import { ENV } from '@paima/utils'; -import { +import type { AchievementService, AchievementPublicList, PlayerAchievements, @@ -65,6 +65,6 @@ export class AchievementsController extends Controller { @Query() name?: string ): Promise { const wallet = await service().getNftOwner(nft_address); - return this.wallet(wallet, name); + return await this.wallet(wallet, name); } } diff --git a/packages/engine/paima-standalone/src/utils/import.ts b/packages/engine/paima-standalone/src/utils/import.ts index d9c2d7e5..234ed2a8 100644 --- a/packages/engine/paima-standalone/src/utils/import.ts +++ b/packages/engine/paima-standalone/src/utils/import.ts @@ -7,9 +7,11 @@ interface GameCodeCjs { default: GameStateTransitionFunctionRouter; } /** - * Reads repackaged user's code placed next to the executable in `gameCode.cjs` file + * Reads packaged user's code placed next to the executable in `gameCode.cjs` file. */ export function importGameStateTransitionRouter(): GameStateTransitionFunctionRouter { + // dynamic import cannot be used here due to PKG limitations + // eslint-disable-next-line @typescript-eslint/no-var-requires return (require(`${process.cwd()}/${ROUTER_FILENAME}`) as GameCodeCjs).default; } @@ -19,7 +21,7 @@ export interface EndpointsCjs { AchievementService?: new () => AchievementService; } /** - * Reads repackaged user's code placed next to the executable in `endpoints.cjs` file + * Reads packaged user's code placed next to the executable in `endpoints.cjs` file. */ export function importEndpoints(): EndpointsCjs { return require(`${process.cwd()}/${API_FILENAME}`); @@ -28,7 +30,7 @@ export function importEndpoints(): EndpointsCjs { export const GAME_OPENAPI_FILENAME = 'packaged/openapi.json'; export type OpenApiJson = object; /** - * Reads repackaged user's code placed next to the executable in `endpoints.cjs` file + * Reads packaged user's OpenAPI definitions placed next to the executable in `openapi.json` file. */ export function importOpenApiJson(): OpenApiJson | undefined { try { diff --git a/packages/engine/paima-standalone/src/utils/input.ts b/packages/engine/paima-standalone/src/utils/input.ts index ce7234bd..36bc6650 100644 --- a/packages/engine/paima-standalone/src/utils/input.ts +++ b/packages/engine/paima-standalone/src/utils/input.ts @@ -108,7 +108,7 @@ export const runPaimaEngine = async (): Promise => { process.exit(0); } - const [_, config] = await GlobalConfig.mainEvmConfig(); + const [, config] = await GlobalConfig.mainEvmConfig(); // Check that packed game code is available if (checkForPackedGameCode()) { diff --git a/packages/node-sdk/paima-utils-backend/src/achievements.ts b/packages/node-sdk/paima-utils-backend/src/achievements.ts index 8c8cd357..c37a803e 100644 --- a/packages/node-sdk/paima-utils-backend/src/achievements.ts +++ b/packages/node-sdk/paima-utils-backend/src/achievements.ts @@ -26,7 +26,7 @@ export interface Player { /** e.g. addr1234... or 0x1234... */ wallet: string; /** Optional wallet-type */ - walletType?: 'cardano' | 'evm' | 'polkadot' | 'algorand' | string; + walletType?: string; // ex: 'cardano' | 'evm' | 'polkadot' | 'algorand' /** If data for specific user: e.g., "1", "player-1", "unique-name", etc. */ userId?: string; /** Player display name */ diff --git a/packages/node-sdk/paima-utils-backend/src/index.ts b/packages/node-sdk/paima-utils-backend/src/index.ts index b6659375..bfb40d0d 100644 --- a/packages/node-sdk/paima-utils-backend/src/index.ts +++ b/packages/node-sdk/paima-utils-backend/src/index.ts @@ -3,7 +3,7 @@ import Crypto from 'crypto'; export { parseSecurityYaml } from './security.js'; export * from './cde-access.js'; export type * from './types.js'; -export * from './achievements'; +export * from './achievements.js'; export function hashTogether(data: string[]): string { return Crypto.createHash('sha256').update(data.join()).digest('base64');