Skip to content

Commit

Permalink
chore: fix lint and missing rpc calls in rpcHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabadesso committed Aug 31, 2024
1 parent c6775a6 commit 37fab2c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
3 changes: 0 additions & 3 deletions packages/hathor-rpc-handler/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
ignores: [
'dist/**/*.js',
],
rules: {
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/hathor-rpc-handler/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */

module.exports = {
export default {
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['<rootDir>/__tests__/mocks/']
Expand Down
3 changes: 2 additions & 1 deletion packages/hathor-rpc-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@hathor/hathor-rpc-handler",
"version": "0.0.24",
"license": "MIT",
"type": "module",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand All @@ -12,7 +13,7 @@
"node": ">=20"
},
"scripts": {
"lint": "eslint .",
"lint": "eslint . --ignore-pattern 'dist/*'",
"test": "jest",
"build": "tsc --declaration",
"watch": "tsc -w"
Expand Down
14 changes: 14 additions & 0 deletions packages/hathor-rpc-handler/src/rpcHandler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
SignWithAddressRpcRequest,
RpcResponse,
CreateTokenRpcRequest,
SignOracleDataRpcRequest,
} from '../types';
import {
getAddress,
Expand All @@ -30,6 +31,7 @@ import {
signWithAddress,
} from '../rpcMethods';
import { InvalidRpcMethod } from '../errors';
import { createToken } from '../rpcMethods/createToken';

export const handleRpcRequest = async (
request: RpcRequest,
Expand Down Expand Up @@ -68,6 +70,18 @@ export const handleRpcRequest = async (
requestMetadata,
promptHandler,
);
case RpcMethods.CreateToken: return createToken(
request as CreateTokenRpcRequest,
wallet,
requestMetadata,
promptHandler,
);
case RpcMethods.SignOracleData: return signOracleData(
request as SignOracleDataRpcRequest,
wallet,
requestMetadata,
promptHandler,
);
case RpcMethods.SendNanoContractTx: return sendNanoContractTx(
request as SendNanoContractRpcRequest,
wallet,
Expand Down
1 change: 1 addition & 0 deletions packages/hathor-rpc-handler/src/types/rpcResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ export type RpcResponse = GetAddressResponse
| GetBalanceResponse
| GetConnectedNetworkResponse
| CreateTokenResponse
| SignOracleDataResponse
| GetUtxosResponse;

0 comments on commit 37fab2c

Please sign in to comment.