Update fullstack guidelines to use 'bun' instead of 'npm' for testing; modify package.json to lock specific versions of dependencies for consistency; adjust TypeScript code for improved type handling in simulateExecuteOrder function; enhance swap-tokens test with additional parameters for better coverage.
This commit is contained in:
@@ -95,6 +95,7 @@ Key Principles
|
||||
- you have to pass from controller -> application -> repository, do not inject repository inside controllers
|
||||
- dont use command line to edit file, use agent mode capabilities to do it
|
||||
- when dividing, make sure variable is not zero
|
||||
- to test a single ts test you can run : npm run test:single test/plugins/test-name-file.test.tsx
|
||||
- to test a single ts test you can run : bun run test:single test/plugins/test-name-file.test.tsx
|
||||
- do not implement business logic on the controller, keep the business logic for Service files
|
||||
- When adding new property to and Orleans state, always add the property after the last one and increment the id
|
||||
- Do not use "npm" use only "bun" command for Web3Proxy and WebApp
|
||||
|
||||
@@ -43,28 +43,32 @@
|
||||
"@fastify/swagger-ui": "^5.0.1",
|
||||
"@fastify/type-provider-typebox": "^5.0.0",
|
||||
"@fastify/under-pressure": "^9.0.1",
|
||||
"@gelatonetwork/relay-sdk": "^5.6.0",
|
||||
"@gelatonetwork/relay-sdk": "5.6.0",
|
||||
"@infisical/sdk": "^4.0.6",
|
||||
"@privy-io/server-auth": "^1.18.12",
|
||||
"@sentry/node": "^8.55.0",
|
||||
"@sinclair/typebox": "^0.34.11",
|
||||
"canonicalize": "^2.0.0",
|
||||
"concurrently": "^9.2.1",
|
||||
"cross-fetch": "^4.1.0",
|
||||
"crypto-js": "^4.2.0",
|
||||
"cross-fetch": "4.0.0",
|
||||
"crypto-js": "4.2.0",
|
||||
"csv-stringify": "^6.5.2",
|
||||
"ethers": "^6.13.5",
|
||||
"fastify": "^5.0.0",
|
||||
"fastify-cli": "^7.3.0",
|
||||
"fastify-plugin": "^5.0.1",
|
||||
"form-data": "^4.0.1",
|
||||
"graphql": "15.8.0",
|
||||
"isomorphic-performance": "5.1.1",
|
||||
"knex": "^3.1.0",
|
||||
"lodash": "^4.17.21",
|
||||
"lodash": "4.17.21",
|
||||
"mysql2": "^3.11.3",
|
||||
"postgrator": "^8.0.0",
|
||||
"query-string": "^9.1.1",
|
||||
"query-string": "7.1.1",
|
||||
"redis": "^5.8.2",
|
||||
"viem": "2.37.1",
|
||||
"typescript": "5.4.2",
|
||||
"universal-perf-hooks": "1.0.1",
|
||||
"viem": "^2.37.1",
|
||||
"vitest": "^3.0.8",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
@@ -76,7 +80,6 @@
|
||||
"fastify-tsconfig": "^3.0.0",
|
||||
"glob": "^11.0.0",
|
||||
"neostandard": "^0.12.0",
|
||||
"tsx": "^4.19.1",
|
||||
"typescript": "~5.8.2"
|
||||
"tsx": "^4.19.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Abi, Address, decodeErrorResult, encodeFunctionData, withRetry } from "viem";
|
||||
import {Abi, Address, decodeErrorResult, encodeFunctionData, withRetry} from "viem";
|
||||
|
||||
import { abis } from "../abis/index.js";
|
||||
import { getContract } from "../configs/contracts.js";
|
||||
import { convertTokenAddress } from "../configs/tokens.js";
|
||||
import { SwapPricingType } from "../types/orders.js";
|
||||
import { TokenPrices, TokensData } from "../types/tokens.js";
|
||||
import {abis} from "../abis/index.js";
|
||||
import {getContract} from "../configs/contracts.js";
|
||||
import {convertTokenAddress} from "../configs/tokens.js";
|
||||
import {SwapPricingType} from "../types/orders.js";
|
||||
import {TokenPrices, TokensData} from "../types/tokens.js";
|
||||
|
||||
import type { GmxSdk } from "..";
|
||||
import { extractTxnError } from "./errors/index.js";
|
||||
import { convertToContractPrice, getTokenData } from "./tokens.js";
|
||||
import type {GmxSdk} from "..";
|
||||
import {extractTxnError} from "./errors/index.js";
|
||||
import {convertToContractPrice, getTokenData} from "./tokens.js";
|
||||
|
||||
export type PriceOverrides = {
|
||||
[address: string]: TokenPrices | undefined;
|
||||
@@ -53,8 +53,7 @@ export async function simulateExecuteOrder(sdk: GmxSdk, p: SimulateExecuteParams
|
||||
abi: abis.Multicall as Abi,
|
||||
functionName: "getCurrentBlockTimestamp",
|
||||
args: [],
|
||||
authorizationList: [],
|
||||
});
|
||||
} as any);
|
||||
|
||||
const blockNumber = await client.getBlockNumber();
|
||||
|
||||
|
||||
@@ -15,7 +15,10 @@ describe('swap tokens implementation', () => {
|
||||
sdk,
|
||||
Ticker.BTC,
|
||||
Ticker.USDC,
|
||||
0.00007559
|
||||
0.00006893,
|
||||
'market',
|
||||
undefined,
|
||||
0.5
|
||||
)
|
||||
|
||||
assert.strictEqual(typeof result, 'string')
|
||||
|
||||
Reference in New Issue
Block a user