Skip to content

Commit

Permalink
get Parachain balances, refactor getBalance and getDecimals (#217)
Browse files Browse the repository at this point in the history
* update readme

* add function to get chain balances by address

* --wip-- [skip ci]

* add logic to get tokens balances for chain and address, change getBalance and getDecimals to work without signer

* fix unit tests

* change sdk to return AssetAmount

* add e2e tests for getBalances, remove darwiniaPangoro, fix erc20public to use contract address

* change to map and get balances in parallel

* add HydraDX Alphanet

* add to chains config

* add HydraDX alphanet e2e test

* add HydraDX e2e test with FTM and HDX balances

* add hydraDxAlphanet to chainsMap

* add changeset

* change version to minor

* remove viem from config

* fix HydraDX Alphanet decimals, add more e2e tests

* Update packages/sdk/README.md

Co-authored-by: mmaurello <[email protected]>

* Update packages/sdk/README.md

Co-authored-by: mmaurello <[email protected]>

* Update packages/sdk/README.md

Co-authored-by: mmaurello <[email protected]>

* Update packages/config/src/chains.ts

Co-authored-by: mmaurello <[email protected]>

* fix nativeCurrency

* add usdc wh and ftm wh to moonbase beta

* add tokens to config

* add e2e test for moonbase beta

* add wFTM.wh to moonbase-alpha

* fix erc20 contract call

* add missing configurations for moonbase-alpha

* add usdc.wh contract address

* update snapshots

* add DEV -> HydraDX Alpha to config

* fix integrations

* Updated deps and ESLint, TypeScript fixes

* Updated actions

* Fixed lint action

* Updated endpoints monitoring action

* Moved viem to peerDeps in types package

* Improve Dev version script, fix acc tets, add more info to the pipeline

* try to fix pipeline

* add console.logs to pipeline

* install but to actions

* fix the script with dev versions

* fix check websockets script

* fix snapshots for acc tests

---------

Co-authored-by: mmaurello <[email protected]>
Co-authored-by: Mario J Maurello <[email protected]>
Co-authored-by: Elmar Kenigs <[email protected]>
  • Loading branch information
4 people authored Apr 16, 2024
1 parent ff22ecc commit db25ff4
Show file tree
Hide file tree
Showing 60 changed files with 2,976 additions and 1,636 deletions.
8 changes: 8 additions & 0 deletions .changeset/twelve-bats-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@moonbeam-network/xcm-builder': minor
'@moonbeam-network/xcm-config': minor
'@moonbeam-network/xcm-types': minor
'@moonbeam-network/xcm-sdk': minor
---

Add function to get balances, get balances and decimals without signer, add HydraDX Alphanet
19 changes: 15 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"extends": ["airbnb-base", "airbnb-typescript/base", "prettier"],
"plugins": [
// this should be last
"extends": [
"airbnb-base",
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"prettier"
],
"plugins": ["@typescript-eslint", "import", "prettier"],
"parserOptions": {
"project": "./tsconfig.json"
},
Expand All @@ -25,6 +30,12 @@
"sort-keys": ["error"],
"import/prefer-default-export": "off",
"import/no-default-export": "error",
"import/no-cycle": "off"
"import/no-unresolved": "error",
"import/no-cycle": [
2,
{
"maxDepth": "∞"
}
]
}
}
6 changes: 3 additions & 3 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: ⚙️ Setup Node.js environment
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: 'npm'

- run: npm ci --ignore-scripts
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: build
name: lint

on: push

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
unit:
lint:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: ⚙️ Setup Node.js environment
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: 'npm'

- run: npm ci --ignore-scripts
Expand All @@ -25,3 +25,5 @@ jobs:
- name: 🧪 Run TypeCheck
run: npm run typecheck

- name: 🧪 Run ESLint
run: npm run lint
23 changes: 0 additions & 23 deletions .github/workflows/lint.yml

This file was deleted.

21 changes: 16 additions & 5 deletions .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: ⚙️ Setup Node.js environment
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: 'npm'

- uses: oven-sh/setup-bun@v1

- name: 🔐 Authenticate with NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Update npm
run: npm i -g npm@latest

- name: node/npm version
run: node --version && npm --version

- run: npm ci --ignore-scripts

- name: ✌️ Update versions
run: npx bun ./scripts/update-dev-versions.ts
- name: ✌️ Update versions (BUN)
run: bun ./scripts/update-dev-versions.ts

- name: ✌️ Print versions
run: find ./packages -name 'package.json' -not -path '*/node_modules/*' -exec grep -H 'version' {} +

- name: 🛠️ Build
run: npm run build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: ⚙️ Setup Node.js environment
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: 'npm'

- run: npm ci --ignore-scripts
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: ⚙️ Setup Node.js environment
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: 'npm'

- run: npm ci --ignore-scripts
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/xcm-wss-endpoints-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ jobs:

steps:
- name: 🤘 checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: ⚙️ Setup Node.js environment
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: 'npm'
- uses: oven-sh/setup-bun@v1

- name: Update npm
run: npm i -g npm@9
Expand All @@ -30,4 +31,4 @@ jobs:
run: npm run build

- name: 💻 Run script
run: npx bun ./scripts/check-websockets.ts --slack-wh=${{ secrets.SLACK_WEBHOOK_URL }}
run: bun ./scripts/check-websockets.ts --slack-wh=${{ secrets.SLACK_WEBHOOK_URL }}
Loading

0 comments on commit db25ff4

Please sign in to comment.