Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a679079
feat: 🎸 add developer test coverage endpoint
polymath-eric Jul 17, 2025
3f26242
fix: 🐛 create schedule dto
sansan Jul 24, 2025
ed4e30e
fix: 🐛 enforce type transformation
sansan Jul 24, 2025
bc3a189
fix: 🐛 route order in checkpoints controller
sansan Jul 24, 2025
e1807c5
fix: 🐛 swagger annotation
sansan Jul 25, 2025
69045da
chore: 🤖 upgrade to yarn v4
polymath-eric Aug 1, 2025
f8b8326
chore: 🤖 Add integration test to release step
polymath-eric Aug 5, 2025
790fa76
fix: 🐛 dryRun and manualInstruction return
sansan Aug 13, 2025
e83a364
chore: 🤖 enable corepack for release
polymath-eric Aug 14, 2025
7cd805e
feat: 🎸 get transfer restrictions
sansan Aug 21, 2025
9d41024
chore: 🤖 update sdk to 28
sansan Aug 27, 2025
7317991
feat: 🎸 add/set/remove transfer restrictions
sansan Aug 28, 2025
e951632
feat: 🎸 get tresury balance
sansan Sep 24, 2025
e66e21f
feat: 🎸 venue filtering
sansan Sep 25, 2025
dac431c
feat: 🎸 get protocol fees
sansan Sep 24, 2025
460beee
feat: 🎸 setStats getStats
sansan Sep 2, 2025
623ee20
chore: 🤖 disable e2e for release
sansan Oct 1, 2025
83b1712
fix: 🐛 release stage
sansan Oct 3, 2025
45822a5
fix: 🐛 corepack permission issues
sansan Oct 3, 2025
1269175
fix: 🐛 transfer restrictions
sansan Oct 22, 2025
f6c7fb4
feat: 🎸 abdicate from permission group
sansan Oct 24, 2025
eca5157
feat: 🎸 assign identity to different permission group
sansan Oct 24, 2025
f8aac8b
fix: 🐛 multiple issues
sansan Oct 30, 2025
2d62064
chore: 🤖 bump NestJS and other deps
prashantasdeveloper Oct 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/authenticate-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
tags:
- v*
release:
type: [published]

jobs:
push_to_registry:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: install dependencies
run: yarn --frozen-lockfile
run: yarn --immutable
- name: test
run: yarn test:integration
46 changes: 27 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@ on:
- synchronize
- reopened


jobs:
lint:
name: Linting
runs-on: ubuntu-latest
env:
CI: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v3
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
cache: 'yarn'
- name: install dependencies
run: yarn --frozen-lockfile
run: yarn --immutable
- name: lint
run: yarn lint

Expand All @@ -39,15 +40,17 @@ jobs:
env:
CI: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v3
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
cache: 'yarn'
- name: install dependencies
run: yarn --frozen-lockfile
run: yarn --immutable
- name: build
run: yarn build

Expand All @@ -57,15 +60,17 @@ jobs:
env:
CI: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v3
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
cache: 'yarn'
- name: install dependencies
run: yarn --frozen-lockfile
run: yarn --immutable
- name: test
run: yarn test:cov

Expand All @@ -75,16 +80,20 @@ jobs:
needs: [lint, build, test]
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 1
- uses: actions/setup-node@v3
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
cache: 'yarn'
- name: install dependencies
run: yarn --frozen-lockfile
run: yarn --immutable
# - name: integration test
# run: yarn test:integration
- name: Setup SSH signing key
run: |
echo "$SSH_KEY_PRIVATE" | tr -d '\r' > /tmp/id_ed25519
Expand Down Expand Up @@ -113,7 +122,7 @@ jobs:
- name: Clear SSH key
run: |
shred /tmp/id_ed25519

check-fast-forward:
name: Check if fast forwarding is possible
runs-on: ubuntu-latest
Expand All @@ -137,4 +146,3 @@ jobs:
# never post a comment. (In all cases the information is
# still available in the step's summary.)
comment: never
# TODO @polymath-eric: add SonarCloud step when the account confusion is sorted
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/dist
/node_modules
polymesh-rest-api-swagger-spec.json
.yarn/*

# Logs
logs
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
26 changes: 14 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
FROM node:lts-alpine3.17 AS builder

RUN apk add --no-cache \
python3 \
make \
cmake \
g++ \
jq
python3 \
make \
cmake \
g++ \
jq

WORKDIR /app/builder
RUN chown -R node: /app
RUN corepack enable

USER node

COPY --chown=node:node . .

ENV YARN_ENABLE_SCRIPTS=false

RUN yarn install \
--ignore-scripts \
--frozen-lockfile \
--no-progress && \
yarn build && \
yarn remove $(cat package.json | jq -r '.devDependencies | keys | join(" ")') && \
rm -r /home/node/.cache/
--immutable \
--inline-builds \
--mode=skip-build && \
yarn build && \
yarn remove $(cat package.json | jq -r '.devDependencies | keys | join(" ")') && \
rm -r /home/node/.cache/

FROM node:lts-alpine3.17
WORKDIR /home/node
Expand All @@ -33,4 +36,3 @@ COPY --chown=node:node . /home/node

USER node
CMD [ "node", "dist/main.js" ]

111 changes: 68 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"prepare": "husky install",
"dedupe": "npx yarn-deduplicate yarn.lock",
"prebuild": "rimraf dist",
"postinstall": "rimraf node_modules/@polymeshassociation/polymesh-sdk/node_modules/@polkadot/{util-crypto,wasm-crypto,util,wasm-bridge} && rimraf node_modules/@polymeshassociation/{hashicorp-vault-signing-manager,fireblocks-signing-manager}/node_modules/@polkadot/{util,util-crypto,wasm-bridge}",
"postinstall": "rimraf --glob 'node_modules/@polymeshassociation/polymesh-sdk/node_modules/@polkadot/{util-crypto,wasm-crypto,util,wasm-bridge}' && rimraf --glob 'node_modules/@polymeshassociation/{hashicorp-vault-signing-manager,fireblocks-signing-manager}/node_modules/@polkadot/{util,util-crypto,wasm-bridge}'",
"build": "nest build",
"commit": "npx git-cz",
"format": "prettier-eslint --write \"src/**/*.ts\" \"test/**/*.ts\"",
Expand All @@ -34,60 +34,63 @@
"postgres:dev:migration:generate": "source ./postgres.dev.config && yarn postgres migration:generate",
"postgres:dev:migration:run": "source ./postgres.dev.config && yarn postgres migration:run",
"postgres:dev:migration:revert": "source ./postgres.dev.config && yarn postgres migration:revert",
"postgres:migration:run": "yarn postgres migration:run"
"postgres:migration:run": "yarn postgres migration:run",
"docker:build": "docker build -t polymeshassociation/polymesh-rest-api:local .",
"docker:build:no-cache": "docker build --no-cache -t polymeshassociation/polymesh-rest-api:local ."
},
"dependencies": {
"@golevelup/ts-jest": "^0.3.3",
"@nestjs/axios": "^3.0.2",
"@nestjs/common": "^10.3.7",
"@nestjs/config": "^3.2.2",
"@nestjs/core": "^10.3.7",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.3.7",
"@nestjs/schedule": "^4.0.2",
"@nestjs/swagger": "^7.3.1",
"@nestjs/typeorm": "^10.0.2",
"@golevelup/ts-jest": "0.3.3",
"@nestjs/axios": "^4.0.1",
"@nestjs/common": "^11.1.6",
"@nestjs/config": "^4.0.2",
"@nestjs/core": "^11.1.6",
"@nestjs/passport": "^11.0.5",
"@nestjs/platform-express": "^11.1.6",
"@nestjs/schedule": "^6.0.1",
"@nestjs/swagger": "^11.2.0",
"@nestjs/typeorm": "^11.0.0",
"@polymeshassociation/fireblocks-signing-manager": "^2.5.0",
"@polymeshassociation/hashicorp-vault-signing-manager": "^3.4.0",
"@polymeshassociation/local-signing-manager": "^3.3.0",
"@polymeshassociation/polymesh-sdk": "27.7.0",
"@polymeshassociation/signing-manager-types": "^3.2.0",
"@polymeshassociation/hashicorp-vault-signing-manager": "^3.5.0",
"@polymeshassociation/local-signing-manager": "^3.5.2",
"@polymeshassociation/polymesh-sdk": "v29.1.0-beta.9",
"@polymeshassociation/polymesh-types": "^6.2.0",
"@polymeshassociation/signing-manager-types": "^3.4.2",
"class-transformer": "0.5.1",
"class-validator": "^0.14.0",
"joi": "17.4.0",
"json-stable-stringify": "^1.0.2",
"joi": "18.0.1",
"json-stable-stringify": "^1.3.0",
"lodash": "4.17.21",
"passport": "^0.7.0",
"passport-custom": "^1.1.1",
"passport-headerapikey": "^1.2.2",
"pg": "^8.11.5",
"pg": "^8.16.3",
"reflect-metadata": "0.2.2",
"rhea-promise": "^3.0.1",
"rimraf": "3.0.2",
"rxjs": "^7.5.7",
"swagger-ui-express": "5.0.0",
"typeorm": "^0.3.17"
"rxjs": "^7.8.2",
"swagger-ui-express": "5.0.1",
"typeorm": "^0.3.27"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "7.22.11",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@nestjs/cli": "^10.1.17",
"@nestjs/schematics": "^10.0.2",
"@nestjs/testing": "^10.2.4",
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
"@nestjs/cli": "^11.0.10",
"@nestjs/schematics": "^11.0.8",
"@nestjs/testing": "^11.1.6",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/npm": "^11.0.0",
"@types/axios": "^0.14.0",
"@types/cron": "^1.7.3",
"@types/express": "4.17.17",
"@semantic-release/exec": "^7.1.0",
"@semantic-release/npm": "^12.0.2",
"@types/axios": "^0.14.4",
"@types/cron": "^2.4.3",
"@types/express": "5.0.3",
"@types/jest": "29.5.4",
"@types/jest-when": "^3.5.2",
"@types/json-stable-stringify": "^1.0.34",
"@types/jest-when": "^3.5.5",
"@types/json-stable-stringify": "^1.2.0",
"@types/lodash": "^4.14.197",
"@types/node": "^18.15.11",
"@types/passport": "^1.0.11",
"@types/supertest": "2.0.12",
"@types/passport": "^1.0.17",
"@types/supertest": "6.0.3",
"@typescript-eslint/eslint-plugin": "6.9.1",
"@typescript-eslint/parser": "6.9.1",
"@zerollup/ts-transform-paths": "1.7.11",
Expand All @@ -103,22 +106,44 @@
"eslint-plugin-simple-import-sort": "10.0.0",
"husky": "8.0.3",
"jest": "29.7.0",
"jest-when": "^3.6.0",
"jest-when": "^3.7.0",
"lint-staged": "14.0.1",
"path-to-regexp": "^8.3.0",
"prettier": "2.8.8",
"prettier-eslint": "15.0.1",
"prettier-eslint-cli": "7.1.0",
"semantic-release": "^22.0.0",
"supertest": "6.1.3",
"ts-jest": "29.1.1",
"ts-loader": "9.4.4",
"ts-node": "10.9.1",
"semantic-release": "^24.2.9",
"supertest": "7.1.4",
"ts-jest": "29.4.4",
"ts-loader": "9.5.4",
"ts-node": "10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "4.8.2"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
},
"resolutions": {
"@polkadot/api": "11.2.1",
"@polkadot/api-augment": "11.2.1",
"@polkadot/api-base": "11.2.1",
"@polkadot/api-derive": "11.2.1",
"@polkadot/rpc-augment": "11.2.1",
"@polkadot/rpc-core": "11.2.1",
"@polkadot/rpc-provider": "11.2.1",
"@polkadot/types": "11.2.1",
"@polkadot/types-augment": "11.2.1",
"@polkadot/types-codec": "11.2.1",
"@polkadot/types-create": "11.2.1",
"@polkadot/types-known": "11.2.1",
"@polkadot/types-support": "11.2.1",
"@polkadot/util": "12.6.2",
"@polkadot/util-crypto": "12.6.2",
"@polkadot/networks": "12.6.2",
"@polkadot/keyring": "12.6.2",
"@polkadot/x-bigint": "12.6.2"
},
"packageManager": "[email protected]+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c"
}
13 changes: 13 additions & 0 deletions src/accounts/accounts.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import * as identityUtil from '~/identities/identities.util';
import { AccountModel } from '~/identities/models/account.model';
import { IdentityModel } from '~/identities/models/identity.model';
import { IdentitySignerModel } from '~/identities/models/identity-signer.model';
import { TreasuryBalanceModel } from '~/network/models/treasury-balance.model';
import { NetworkService } from '~/network/network.service';
import { SubsidyService } from '~/subsidy/subsidy.service';
import { extrinsic, processedTxResult, testValues } from '~/test-utils/consts';
Expand Down Expand Up @@ -295,6 +296,18 @@ describe('AccountsController', () => {
});
});

describe('getTreasuryBalance', () => {
it('should call the service and return the treasury balance', async () => {
const balance = new BigNumber(100);

mockNetworkService.getTreasuryBalance.mockResolvedValue(balance);

const result = await controller.getTreasuryBalance();

expect(result).toEqual(new TreasuryBalanceModel({ balance }));
});
});

describe('getDetails', () => {
const fakeIdentityModel = 'fakeIdentityModel' as unknown as IdentityModel;

Expand Down
Loading
Loading