Skip to content

Commit

Permalink
Merge branch 'main' into feat/aptos-configurator
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaquinBattilana committed Dec 10, 2024
2 parents b4b0868 + e8d775c commit 2cafd4e
Show file tree
Hide file tree
Showing 17 changed files with 1,361 additions and 1,042 deletions.
4 changes: 2 additions & 2 deletions examples/admin/mintUnderlyings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Account, AccountAddress, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
import { UnderlyingTokensClient } from "../../src/clients/underlyingTokensClient";
import { PoolClient } from "../../src/clients/poolClient";
import { AptosProvider } from "../../src/clients";
import { testnetConfig } from "../../src/configs/testnet";
import { DEFAULT_TESTNET_CONFIG } from "../../src/configs/testnet";

const UNDERLYING_MANAGER_PRIVATE_KEY = "0x0";
const ADDRESSES_TO_FUND = ["0x0"].map((addr) =>
Expand All @@ -12,7 +12,7 @@ const fundAmount = BigInt(1000);

(async () => {
// global aptos provider
const aptosProvider = AptosProvider.fromConfig(testnetConfig);
const aptosProvider = AptosProvider.fromConfig(DEFAULT_TESTNET_CONFIG);
// all underlying-tokens-related operations client
const underlyingTokensClient = new UnderlyingTokensClient(aptosProvider);
// all pool-related operations client
Expand Down
4 changes: 2 additions & 2 deletions examples/admin/setAssetPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import dotenv from "dotenv";
import { Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
import { OracleClient, PoolClient } from "../../src/clients";
import { AptosProvider } from "../../src/clients/aptosProvider";
import { testnetConfig } from "../../src/configs/testnet";
import { DEFAULT_TESTNET_CONFIG } from "../../src/configs/testnet";

dotenv.config();

Expand All @@ -15,7 +15,7 @@ const priceMapper = {

(async () => {
// global aptos provider
const aptosProvider = AptosProvider.fromConfig(testnetConfig);
const aptosProvider = AptosProvider.fromConfig(DEFAULT_TESTNET_CONFIG);

if (!process.env.AAVE_MOCK_ORACLE_PRIVATE_KEY) {
throw new Error(`AAVE_MOCK_ORACLE_PRIVATE_KEY env was not found`);
Expand Down
4 changes: 2 additions & 2 deletions examples/quiries/getAptos.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Account, AccountAddress, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
import { AptosProvider } from "../../src/clients";
import { testnetConfig } from "../../src/configs/testnet";
import { DEFAULT_TESTNET_CONFIG } from "../../src/configs/testnet";

const aptFunderPrivateKey = "0x0";
const addressesToFund = ["0x0"].map((addr) => AccountAddress.fromString(addr));
const fundAmount = BigInt(0.5);

(async () => {
// global aptos provider
const aptosProvider = AptosProvider.fromConfig(testnetConfig);
const aptosProvider = AptosProvider.fromConfig(DEFAULT_TESTNET_CONFIG);

try {
// set the tx sender
Expand Down
4 changes: 2 additions & 2 deletions examples/quiries/getUserData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { UnderlyingTokensClient } from "../../src/clients/underlyingTokensClient
import { UiPoolDataProviderClient } from "../../src/clients/uiPoolDataProvider";
import { PoolClient } from "../../src/clients/poolClient";
import { AptosProvider } from "../../src/clients/aptosProvider";
import { testnetConfig } from "../../src/configs/testnet";
import { DEFAULT_TESTNET_CONFIG } from "../../src/configs/testnet";

const USER_APTOS_ACCOUNT = "0x0";

(async () => {
// global aptos provider
const aptosProvider = AptosProvider.fromConfig(testnetConfig);
const aptosProvider = AptosProvider.fromConfig(DEFAULT_TESTNET_CONFIG);

const uiPoolDataProviderClient = new UiPoolDataProviderClient(aptosProvider);
const poolClient = new PoolClient(aptosProvider);
Expand Down
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
71 changes: 41 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@aave/aave-v3-aptos-ts-sdk",
"version": "0.0.19",
"version": "0.0.24",
"description": "Aave's typescript sdk for Aptos",
"main": "dist/cmd/index.js",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"scripts": {
"up": "pnpm update",
"check": "pnpm outdated",
"audit": "pnpm audit --audit-level=high",
"upgrade": "pnpm run up && pnpm run check && pnpm run build",
"clean-dist": "rimraf dist/*",
"build-esm": "tsc --project tsconfig.esm.json",
Expand All @@ -22,16 +23,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 @@ -67,56 +68,66 @@
"bundle.min.js"
],
"dependencies": {
"@aptos-labs/ts-sdk": "^1.31.0",
"@aptos-labs/ts-sdk": "^1.33.1",
"bignumber.js": "^9.1.2",
"buffer": "^6.0.3",
"crypto-js": "^4.2.0",
"dotenv": "^16.4.5",
"dotenv": "^16.4.6",
"ethers": "^6.13.4",
"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.0"
"yaml": "^2.6.1"
},
"devDependencies": {
"@types/bn.js": "^5.1.6",
"@types/jest": "^29.5.14",
"@types/node": "^22.8.6",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"@types/node": "^22.10.1",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"chalk": "^5.3.0",
"eslint": "^9.13.0",
"eslint": "^9.16.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsdoc": "^50.4.3",
"eslint-plugin-jsdoc": "^50.6.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-tsdoc": "^0.3.0",
"husky": "^9.1.6",
"eslint-plugin-promise": "^7.2.1",
"eslint-plugin-tsdoc": "^0.4.0",
"husky": "^9.1.7",
"jest": "^29.7.0",
"jsdom": "^25.0.1",
"node-ts": "^6.1.3",
"npm-run-all": "^4.1.5",
"ora": "^8.1.0",
"prettier": "^3.3.3",
"ora": "^8.1.1",
"prettier": "^3.4.1",
"prettier-eslint": "^16.3.0",
"prettier-standard": "^16.4.1",
"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-eslint": "^8.12.2",
"webpack": "^5.96.1",
"typedoc": "^0.27.2",
"typescript": "^5.7.2",
"typescript-eslint": "^8.17.0",
"webpack": "^5.97.0",
"webpack-cli": "^5.1.4"
},
"optionalDependencies": {
"bufferutil": "^4.0.8",
"utf-8-validate": "^6.0.4"
"utf-8-validate": "^6.0.5"
},
"pnpm": {
"overrides": {
"trim@<0.0.3": ">=0.0.3",
"postcss@<7.0.36": ">=7.0.36",
"postcss@<8.4.31": ">=8.4.31",
"minimatch@<3.0.5": ">=3.0.5",
"minimist@>=1.0.0 <1.2.6": ">=1.2.6",
"semver@>=6.0.0 <6.3.1": ">=6.3.1"
}
}
}
Loading

0 comments on commit 2cafd4e

Please sign in to comment.