Skip to content

Commit

Permalink
feat(bot): wip
Browse files Browse the repository at this point in the history
  • Loading branch information
1Mateus committed Apr 11, 2023
1 parent dbcb137 commit abc293f
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 50 deletions.
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

2 changes: 1 addition & 1 deletion packages/contracts/tests-ts/src/constants/merkle-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const FT_DECIMALS = "000000";

export const NEAR_DECIMALS = "000000000000000000000000";

export const HAPI_ONE_TESTNET = "proxy.hapi-npo.testnet";
export const HAPI_ONE_TESTNET = "dev-1681141193055-11311550135061";

export const Q =
"21888242871839275222246405745257275088548364400416034343698204186575808495617";
Expand Down
6 changes: 6 additions & 0 deletions packages/denylist-bot/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
GRAPHQL_URL="https://api.thegraph.com/subgraphs/name/hack-a-chain/hyc_mainnet"
RPC_URL="https://rpc.testnet.near.org/"
PRIVATE_KEY=""
ACCOUNT_ID=""
HYC_CONTRACT=""
NEAR_NETWORK="testnet"
25 changes: 0 additions & 25 deletions packages/denylist-bot/jest.config copy.js

This file was deleted.

5 changes: 1 addition & 4 deletions packages/denylist-bot/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ export default {
useESM: true,
},
},
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
"^(\\.{1,2}/.*)\\.js$": "$1",
},
testEnvironment: "miniflare",
forceExit: true,
transform: {},
verbose: true,
detectOpenHandles: true,
clearMocks: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Process from "process";
import { Buffer } from "buffer";
import type { Env } from "../types/env";
import type { Env } from "./types/env";
import { connect, keyStores, KeyPair, providers } from "near-api-js";

/* tslint:disable */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import testnetSetup from "./test_setup.json";
import { consumer } from "../src/services/consumer";
import { consumer } from "./consumer";
import testnetSetup from "../../test_setup.json";
import { setupNear, viewFunction } from "../near";
import { describe, expect, jest, it, beforeAll } from '@jest/globals';
import { setupNear, viewFunction } from "../src//utils/near";

const payload = {
counter: '34',
Expand Down Expand Up @@ -74,6 +74,6 @@ describe("Test all service actions", () => {
},
);

expect(inDenylist).toEqual(true);
expect(inDenylist).toEqual(false);
});
});
2 changes: 1 addition & 1 deletion packages/denylist-bot/src/services/consumer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Env } from "../types/env";
import { AttachedGas } from "../constants";
import { setupNear, viewFunction } from "../utils/near";
import { setupNear, viewFunction } from "../near";
import type { QueuedData } from "../types/pagination";

const riskMap: any = {
Expand Down
6 changes: 3 additions & 3 deletions packages/denylist-bot/src/services/request.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { Env } from "@/types/env";
import { getHapioneEntriesQuery } from "@/query";
import { FeederState, FetchResponseInterface } from "@/types/pagination";
import type { Env } from "../types/env";
import { getHapioneEntriesQuery } from "../query";
import type { FeederState, FetchResponseInterface } from "../types/pagination";

export const sendRequest = async (counter: FeederState, env: Env): Promise<FetchResponseInterface> => {
const response = await fetch(env.GRAPHQL_URL, {
Expand Down
7 changes: 0 additions & 7 deletions packages/denylist-bot/test/tsconfig.json

This file was deleted.

0 comments on commit abc293f

Please sign in to comment.