Skip to content

Commit

Permalink
ALL-4358 Add Flare Tokens (#1057)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel authored Feb 7, 2024
1 parent 6b33e22 commit 8989a30
Show file tree
Hide file tree
Showing 269 changed files with 7,302 additions and 113,092 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
},
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
}
]
}
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ jobs:
node-version: '16'
- run: yarn --ignore-scripts --frozen-lockfile
# - run: npx nx-cloud start-ci-run
- run: npx nx affected --target=build --parallel --max-parallel=3 --skip-nx-cache
- run: npx nx affected --target=build --parallel --max-parallel=3
- run: yarn nx:fix
- run: yarn test:ci
#- run: npx nx-cloud stop-all-agents
- name: SonarCloud Scan
uses: SonarSource/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

# agents:
# if: ${{ github.head_ref != 'release' }}
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"eslint.packageManager": "yarn",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"eslint.validate": ["json"]
}
71 changes: 0 additions & 71 deletions CONTRIBUTING.md

This file was deleted.

41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ All examples of SDK usage will be found after completion at https://github.com/t
<summary style='font-size: 16px; font-weight: bold'>Usage with create-react-app (which uses Webpack 5)</summary>

Webpack v5 introduced breaking changes to Web3 library used in Tatum blockchain services. To enable Tatum SDK in React apps you need to follow workaround as per [stackoverflow discussion](https://stackoverflow.com/questions/66952972/cannot-add-web3-to-react-project)

``
#### 1. Install additional dependencies

```console
Expand Down Expand Up @@ -273,9 +273,42 @@ yarn add -D @esbuild-plugins/node-modules-polyfill

## Contributing

Contributions to the Tatum SDK are welcome. Please ensure
that you have tested your changes with a local client and have added unit test
coverage for your code.
### Development - Add a new chain (EVM)

#### 1. Pull repository

```console
$ git clone https://github.com/tatumio/tatum-js.git && cd tatum-js
```

#### 2. Install root dependencies

```console
$ yarn
```

#### 3. Add chain to the core package

Add currency constant to the `packages/api-client/src/lib/models/Currency.ts`.

Add blockchain constant to the `packages/shared/core/src/lib/models/Blockchain.ts`.

#### 4. Create a subpackage

Following command will generate whole structure (files and directories).

```console
$ yarn add:chain
```

As a template is used `blockchain-evm` generator in automation package.

#### 5. Generate API client from CoreApi
Copy new api_schema.json from Tatum API and run the following command:

```console
$ yarn generate:api
```

### Bugs and feature requests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export async function bscNftExpressExample() {
// Transfer an NFT from the smart contract (the contractAddress parameter in the request body) to the specified blockchain address (the to parameter in the request body).
const nftTransferred = (await bscSDK.nft.transferNFT({
chain: 'BSC',
value: '1',
to,
tokenId: '1000',
contractAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export async function cardanoVirtualAccountExample() {
xpub,
index: 0,
fee: '0.1',
attr: addressToFund,
address: recipientAddress,
})

Expand Down
1 change: 0 additions & 1 deletion examples/tron-example/src/app/tron.nft.example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export async function tronNftExample() {
// Transfer an NFT from the smart contract (the contractAddress parameter in the request body) to the specified blockchain address (the to parameter in the request body).
// https://apidoc.tatum.io/tag/NFT-(ERC-721-or-compatible)#operation/NftTransferErc721
const nftTransferred = (await tronSdk.nft.send.transferSignedTransaction({
value: '1',
to: receiverAddress,
tokenId,
contractAddress,
Expand Down
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{
"name": "tatumio",
"version": "2.2.44",
"version": "2.2.45",
"license": "MIT",
"repository": "https://github.com/tatumio/tatum-js",
"scripts": {
"start": "nx serve",
"build": "nx affected:build --skip-nx-cache",
"build": "nx affected:build",
"build:libs": "nx run-many --target=build --projects=$(nx affected:libs --plain --all cache | sed 's/ /,/g') --skip-nx-cache",
"build:prod": "nx affected:build --configuration=production --skip-nx-cache",
"build:all": "nx run-many --target=build --all --parallel --skip-nx-cache",
"build:all:prod": "nx run-many --target=build --configuration=production --all --parallel --skip-nx-cache",
"build:libs:prod": "nx run-many --target=build --configuration=production --skip-nx-cache --projects=$(nx affected:libs --plain --all cache | sed 's/ /,/g')",
"test:ci": "nx run-many --target=test --all --parallel --max-parallel=3 --coverage --coverageReporters=lcov && node ./tools/coverageMerger.js --skip-nx-cache",
"test:ci": "nx run-many --target=test --all --parallel --max-parallel=3 --coverage --coverageReporters=lcov && node ./tools/coverageMerger.js",
"lint": "nx affected:lint --parallel --skip-nx-cache",
"lint:all": "nx run-many --target=lint --all --parallel --skip-nx-cache",
"format": "nx format:write",
"test": "nx affected:test --parallel --skip-nx-cache",
"test": "nx affected:test --parallel",
"dep-graph": "nx dep-graph",
"generate-api": "openapi --exportCore false --useUnionTypes true --client axios --input ./packages/api-client/src/api_schema.json --output ./packages/api-client/src/generated",
"generate:api": "openapi --exportCore false --useUnionTypes true --client axios --input ./packages/api-client/src/api_schema.json --output ./packages/api-client/src/generated",
"add:chain": "nx g @tatumio/automation:blockchain-evm --directory=blockchain",
"release:current": "nxpm release $(./scripts/package-version.sh) --ci --fix",
"release:apply-version": "nxpm release $(./scripts/package-version.sh) --fix --dry-run || true",
"version:alpha": "npm --tag-version-prefix='' --no-git-tag-version version prerelease",
Expand Down Expand Up @@ -87,12 +88,14 @@
},
"devDependencies": {
"@nrwl/cli": "14.8.4",
"@nrwl/devkit": "14.8.4",
"@nrwl/eslint-plugin-nx": "14.8.4",
"@nrwl/jest": "14.8.4",
"@nrwl/js": "14.8.4",
"@nrwl/linter": "14.8.4",
"@nrwl/node": "14.8.4",
"@nrwl/nx-cloud": "15.0.0",
"@nrwl/nx-plugin": "14.8.4",
"@nrwl/workspace": "14.8.4",
"@types/bchaddrjs": "^0.4.0",
"@types/bignumber.js": "^5.0.0",
Expand All @@ -115,6 +118,8 @@
"glob": "^7.2.0",
"husky": "^7.0.4",
"jest": "28.1.3",
"jest-environment-jsdom": "28.1.1",
"jsonc-eslint-parser": "^2.1.0",
"nx": "14.8.4",
"openapi-typescript-codegen": "^0.12.5",
"patch-package": "^6.2.0",
Expand Down
Loading

0 comments on commit 8989a30

Please sign in to comment.