Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [24.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: ./package-lock.json
- run: npx lerna@6 bootstrap
- run: npx lerna@6 run lint
- run: npm ci
- run: npx lerna run lint
env:
CI: true
11 changes: 6 additions & 5 deletions .github/workflows/npm-publish-specific-package-not-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ jobs:
run:
working-directory: ./
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 24
registry-url: https://registry.npmjs.org/
cache: npm
cache-dependency-path: ./package-lock.json

- run: npx lerna@6 bootstrap
- run: npx lerna@6 run build
- run: npm ci
- run: npx lerna run build

- name: Create release (only for all packages)
env:
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/publish-not-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ jobs:
run:
working-directory: ./
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 24
registry-url: https://registry.npmjs.org/
cache-dependency-path: ./package-lock.json
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies
run: npm ci

- run: npx lerna@6 bootstrap
- run: npx lerna@6 run build
- name: Build packages
run: npx lerna run build

- name: Create release
env:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ jobs:
run:
working-directory: ./
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 24
registry-url: https://registry.npmjs.org/
cache: npm
cache-dependency-path: ./package-lock.json

- run: npx lerna@6 bootstrap
- run: npx lerna@6 run build
- run: npm ci
- run: npx lerna run build

- name: Create release
env:
Expand All @@ -43,4 +44,4 @@ jobs:
- name: Publish to npmjs
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npx lerna@6 publish from-package --yes
run: npx lerna publish from-package --yes
12 changes: 6 additions & 6 deletions .github/workflows/unit.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [24.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: ./package-lock.json
- run: npx lerna@6 bootstrap
- run: npx lerna@6 run build
- run: npx lerna@6 run test
- run: npm ci
- run: npx lerna run build
- run: npx lerna run test
env:
CI: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ tsconfig.tsbuildinfo
.idea/
.npmrc
*.log
*.tsbuildinfo
*.tsbuildinfo
storage
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ This package contains a set of utilities commonly used in the MultiversX Microse
It relies on the following peer dependencies which must be installed in the parent package:

- @multiversx/sdk-core
- @nestjs/common v9
- @nestjs/swagger v9
- @nestjs/common v11
- @nestjs/swagger v11

`ContractLoader` was removed in v7; load contracts in your application code and pass them to the query and transaction helpers directly.

## Documentation

Expand Down Expand Up @@ -129,18 +131,9 @@ If you need something else please make sure to check our [CacheService](packages

### Smart Contract Interactions

This package is for dApps that interacts with smart contracts

#### Contract Loader

Uses Singleton pattern and load a [SmartContract](https://github.com/multiversx/mx-sdk-erdjs/blob/main/src/smartcontracts/smartContract.ts) from an abi path.
You can also load multiple contracts with same abi.

```
const cLoader = new ContractLoader(ABI_PATH, CONTRACT_INTERFACE);
This package is for dApps that interacts with smart contracts.

const sc = await cLoader.getContract(CONTRACT_ADDRESS);
```
`ContractLoader` is no longer part of this release line.

#### Contract Query Runner

Expand All @@ -149,13 +142,13 @@ Execute contract queries using a multiversx proxy provider (api/gateway).
```
const cRunner = new ContractQueryRunner(new ApiNetworkProvider(this.apiConfigService.getApiUrl()));

const contract = await this.contractLoader.getContract(CONTRACT_ADDRESS);
const query = smartContract.methodsExplicit.getTotalLockedAssetSupply([]);

const interaction: Interaction = contract.methodsExplicit.getTotalLockedAssetSupply([]);

const queryResponse = await cRunner.runQuery(contract, interaction);
const queryResponse = await cRunner.runQuery(query, chainId, abi);
```

`smartContract` is created in your application code from `@multiversx/sdk-core`; the helper only needs the query, chain ID, and optional ABI.

#### Contract Transaction Generator

Create transactions from smart contract interactions using and multiversx proxy provider (api/gateway).
Expand Down
56 changes: 56 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const js = require('@eslint/js');
const tseslint = require('typescript-eslint');
const globals = require('globals');

module.exports = [
{
ignores: [
'node_modules/**',
'dist/**',
'lib/**',
'coverage/**',
'.next/**',
'build/**',
'**/*.js',
'**/*.config.js',
'**/*.config.mjs',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
globals: {
...globals.node,
},
parser: tseslint.parser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-wrapper-objects': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
'no-object-constructor': 'off',
'no-useless-escape': 'off',
'preserve-caught-error': 'off',
'no-cond-assign': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
},
},
];
Empty file removed eslintrc.json
Empty file.
15 changes: 14 additions & 1 deletion jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,21 @@
"rootDir": ".",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
"^.+\\.(t|j)s$": [
"ts-jest",
{
"tsconfig": {
"types": [
"node",
"jest"
]
}
}
]
},
"transformIgnorePatterns": [
"/node_modules/"
],
"collectCoverageFrom": [
"**/*.(t|j)s"
],
Expand Down
3 changes: 1 addition & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "6.0.0",
"version": "7.0.0",
"packages": [
"packages/*"
],
Expand Down
Loading
Loading