Skip to content

Commit

Permalink
add tsx and fixed imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mpsc0x committed Nov 25, 2024
1 parent dee6a6a commit 671ca82
Show file tree
Hide file tree
Showing 6 changed files with 598 additions and 232 deletions.
4 changes: 2 additions & 2 deletions examples/users/borrow.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Account, Ed25519Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
import { PoolClient } from "../../src/clients/poolClient";
import { AptosProvider, CoreClient } from "../../src/clients";
import { testnetConfig } from "../../src/configs/testnet";
import { DEFAULT_TESTNET_CONFIG } from "../../src/configs";

const USER_APTOS_ACCOUNT_PRIVATE_KEY = "0x0";
const CURRENCY_TO_BORROW = "DAI";
const AMOUNT_TO_BORROW = "100";

(async () => {
// global aptos provider
const aptosProvider = AptosProvider.fromConfig(testnetConfig);
const aptosProvider = AptosProvider.fromConfig(DEFAULT_TESTNET_CONFIG);
// all pool-related operations client
const poolClient = new PoolClient(aptosProvider);
// user account
Expand Down
4 changes: 2 additions & 2 deletions examples/users/repay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MaxUint256 } from "ethers";
import { BigNumber } from "bignumber.js";
import { PoolClient } from "../../src/clients/poolClient";
import { AptosProvider, CoreClient } from "../../src/clients";
import { testnetConfig } from "../../src/configs/testnet";
import { DEFAULT_TESTNET_CONFIG } from "../../src/configs";

const USER_APTOS_ACCOUNT_PRIVATE_KEY = "0x0";
const CURRENCY_TO_REPAY = "DAI";
Expand All @@ -12,7 +12,7 @@ const USE_A_TOKENS = true;

(async () => {
// global aptos provider
const aptosProvider = AptosProvider.fromConfig(testnetConfig);
const aptosProvider = AptosProvider.fromConfig(DEFAULT_TESTNET_CONFIG);
// all pool-related operations client
const poolClient = new PoolClient(aptosProvider);
// user account
Expand Down
4 changes: 2 additions & 2 deletions examples/users/supply.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Account, Ed25519Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
import { PoolClient } from "../../src/clients/poolClient";
import { AptosProvider, CoreClient } from "../../src/clients";
import { testnetConfig } from "../../src/configs/testnet";
import { DEFAULT_TESTNET_CONFIG } from "../../src/configs";

const USER_APTOS_ACCOUNT_PRIVATE_KEY = "0x0";
const CURRENCY_TO_SUPPLY = "DAI";
const AMOUNT_TO_SUPPLY = "100";

(async () => {
// global aptos provider
const aptosProvider = AptosProvider.fromConfig(testnetConfig);
const aptosProvider = AptosProvider.fromConfig(DEFAULT_TESTNET_CONFIG);
// all pool-related operations client
const poolClient = new PoolClient(aptosProvider);
// user account
Expand Down
4 changes: 2 additions & 2 deletions examples/users/withdraw.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Account, Ed25519Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
import { PoolClient } from "../../src/clients/poolClient";
import { AptosProvider, CoreClient } from "../../src/clients";
import { testnetConfig } from "../../src/configs/testnet";
import { DEFAULT_TESTNET_CONFIG } from "../../src/configs";

const USER_APTOS_ACCOUNT_PRIVATE_KEY = "0x0";
const CURRENCY_TO_WITHDRAW = "DAI";
const AMOUNT_TO_WITHDRAW = "100";

(async () => {
// global aptos provider
const aptosProvider = AptosProvider.fromConfig(testnetConfig);
const aptosProvider = AptosProvider.fromConfig(DEFAULT_TESTNET_CONFIG);
// all pool-related operations client
const poolClient = new PoolClient(aptosProvider);
// user account
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"update-version-patch": "pnpm version patch",
"test": "jest",
"test:cov": "jest --coverage",
"supply": "ts-node examples/users/supply.ts",
"borrow": "ts-node examples/users/borrow.ts",
"withdraw": "ts-node examples/users/withdraw.ts",
"repay": "ts-node examples/users/repay.ts",
"get-aptos": "ts-node examples/quiries/getAptos.ts",
"get-addresses": "ts-node examples/quiries/getAddresses.ts",
"get-user-data": "ts-node examples/quiries/getUserData.ts",
"setup-testnet": "ts-node examples/admin/setupTestnet.ts",
"mint-underlyings": "ts-node examples/admin/mintUnderlyings.ts",
"set-asset-prices": "ts-node examples/admin/setAssetPrices.ts",
"supply": "tsx examples/users/supply.ts",
"borrow": "tsx examples/users/borrow.ts",
"withdraw": "tsx examples/users/withdraw.ts",
"repay": "tsx examples/users/repay.ts",
"get-aptos": "tsx examples/quiries/getAptos.ts",
"get-addresses": "tsx examples/quiries/getAddresses.ts",
"get-user-data": "tsx examples/quiries/getUserData.ts",
"setup-testnet": "tsx examples/admin/setupTestnet.ts",
"mint-underlyings": "tsx examples/admin/mintUnderlyings.ts",
"set-asset-prices": "tsx examples/admin/setAssetPrices.ts",
"lint": "eslint . --no-cache --ignore-pattern 'bundle.js'",
"lint:fix": "eslint . --fix --no-cache --ignore-pattern 'bundle.js'",
"prettier": "prettier --check .",
Expand Down Expand Up @@ -73,13 +73,14 @@
"events": "^3.3.0",
"jest-environment-jsdom": "^29.7.0",
"tslib": "^2.8.1",
"tsx": "^4.19.2",
"util": "^0.12.5",
"yaml": "^2.6.1"
},
"devDependencies": {
"@types/bn.js": "^5.1.6",
"@types/jest": "^29.5.14",
"@types/node": "^22.9.0",
"@types/node": "^22.9.3",
"@typescript-eslint/eslint-plugin": "^8.15.0",
"@typescript-eslint/parser": "^8.15.0",
"chalk": "^5.3.0",
Expand All @@ -92,7 +93,7 @@
"eslint-plugin-jsdoc": "^50.5.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-tsdoc": "^0.3.0",
"eslint-plugin-tsdoc": "^0.4.0",
"husky": "^9.1.7",
"jest": "^29.7.0",
"jsdom": "^25.0.1",
Expand All @@ -105,9 +106,8 @@
"rimraf": "^6.0.1",
"ts-jest": "^29.2.5",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"typedoc": "^0.26.11",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"typescript-eslint": "^8.15.0",
"webpack": "^5.96.1",
"webpack-cli": "^5.1.4"
Expand Down
Loading

0 comments on commit 671ca82

Please sign in to comment.