Skip to content

Commit

Permalink
[TS SDK V2] Add Indexer account queries (#10216)
Browse files Browse the repository at this point in the history
* implement account indexer queries

* add indexer account api queries

* address feedback
  • Loading branch information
0xmaayan authored Sep 28, 2023
1 parent c2c8ce3 commit 6d749f1
Show file tree
Hide file tree
Showing 33 changed files with 12,476 additions and 690 deletions.
4 changes: 2 additions & 2 deletions ecosystem/typescript/sdk_v2/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
es2021: true,
node: true,
},
ignorePatterns: ["*.js", "examples/*", "src/indexer/generated/**", "scripts/publish_ans_contract.ts"],
ignorePatterns: ["*.js", "examples/*", "scripts/publish_ans_contract.ts", "src/types/generated/**"],
extends: ["airbnb-base", "airbnb-typescript/base", "prettier"],
parser: "@typescript-eslint/parser",
parserOptions: {
Expand All @@ -16,7 +16,7 @@ module.exports = {
plugins: ["@typescript-eslint"],
rules: {
quotes: ["error", "double"],
"max-len": ["error", 120],
"max-len": ["error", 130],
"import/extensions": ["error", "never"],
"max-classes-per-file": ["error", 10],
"import/prefer-default-export": "off",
Expand Down
1 change: 1 addition & 0 deletions ecosystem/typescript/sdk_v2/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
.aptos
.env
examples/
src/types/generated/types.ts
3 changes: 1 addition & 2 deletions ecosystem/typescript/sdk_v2/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
src/generated/*
src/indexer/generated/**
dist/
2 changes: 1 addition & 1 deletion ecosystem/typescript/sdk_v2/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
testEnvironment: "node",
coveragePathIgnorePatterns: ["./types/*", "./utils/memoize-decorator.ts", "./utils/hd-key.ts"],
coveragePathIgnorePatterns: ["./src/internal/queries/", "./src/types/generated"],
testPathIgnorePatterns: ["dist/*"],
collectCoverage: true,
setupFiles: ["dotenv/config"],
Expand Down
34 changes: 15 additions & 19 deletions ecosystem/typescript/sdk_v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,26 @@
"engines": {
"node": ">=11.0.0"
},
"main": "dist/cjs/index.js",
"module": "dist/esm/index.mjs",
"main": "dist/node/index.js",
"module": "dist/node/index.mjs",
"exports": {
"node": {
"types": "./dist/src/index.d.ts",
"require": "./dist/cjs/index.js",
"import": "./dist/cjs/index.js"
},
"types": "./dist/types/index.d.ts",
"default": "./dist/esm/index.mjs"
".": {
"import": "./dist/node/index.mjs",
"require": "./dist/node/index.js",
"types": "./dist/types/index.d.ts"
}
},
"scripts": {
"build:clean": "rm -rf dist",
"build": "pnpm build:clean && pnpm run _build:types && pnpm _build:esm && pnpm _build:cjs && pnpm _build:browser",
"build": "pnpm build:clean && pnpm run _build:types && pnpm _build:node && pnpm _build:browser",
"_build:browser": "tsup src/index.ts --platform browser --format iife --global-name aptosSDK --minify --out-dir dist/browser",
"_build:esm": "tsup src/index.ts --format esm --dts --out-dir dist/esm",
"_build:cjs": "tsup src/index.ts --format cjs --dts --out-dir dist/cjs",
"_build:node": "tsup src/index.ts --platform node --format esm,cjs --dts --out-dir dist/node",
"_build:types": "tsup src/types/index.ts --dts --out-dir dist/types",
"generate-openapi-response-types": "openapi -i ../../../../api/doc/spec.yaml -o ./src/types/generated --exportCore=false --exportServices=false",
"_fmt": "prettier 'src/**/*.ts' 'tests/**/*.ts' '.eslintrc.js'",
"fmt": "pnpm _fmt --write",
"lint": "eslint \"**/*.ts\"",
"test": "pnpm jest"
"test": "pnpm jest",
"indexer-codegen": "graphql-codegen --config ./src/types/codegen.yaml"
},
"dependencies": {
"@aptos-labs/aptos-client": "^0.0.2",
Expand All @@ -38,25 +35,24 @@
"tweetnacl": "1.0.3"
},
"devDependencies": {
"@types/jest": "28.1.8",
"@types/node": "18.6.2",
"@graphql-codegen/cli": "^2.13.5",
"@graphql-codegen/import-types-preset": "^2.2.3",
"@graphql-codegen/typescript": "^2.7.3",
"@graphql-codegen/typescript-graphql-request": "^4.5.8",
"@graphql-codegen/typescript-operations": "^2.5.3",
"@types/jest": "28.1.8",
"@types/node": "18.6.2",
"@typescript-eslint/eslint-plugin": "5.36.2",
"@typescript-eslint/parser": "5.36.2",
"graphql": "^16.5.0",
"graphql-request": "5.1.0",
"dotenv": "16.0.2",
"eslint": "8.23.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.26.0",
"graphql": "^16.5.0",
"graphql-request": "5.1.0",
"jest": "28.1.3",
"openapi-typescript-codegen": "https://github.com/aptos-labs/openapi-typescript-codegen/releases/download/v0.24.0-p1/openapi-typescript-codegen-v0.24.0-p1.tgz",
"prettier": "2.6.2",
"ts-jest": "28.0.8",
"ts-loader": "9.3.1",
Expand Down
Loading

0 comments on commit 6d749f1

Please sign in to comment.