Skip to content

Commit

Permalink
[935] Migration to spark-ts-sdk (#2)
Browse files Browse the repository at this point in the history
* feat: moving to sdk

* merged

* feat: update sdk version

* feat: update matcher

* fix: build

* fix: correct server

* added contract id in .env file

* added predev script

---------

Co-authored-by: alexey <[email protected]>
Co-authored-by: Paul <[email protected]>
Co-authored-by: Paul <[email protected]>
  • Loading branch information
4 people authored Apr 30, 2024
1 parent 87d2577 commit 5a2b2a6
Show file tree
Hide file tree
Showing 74 changed files with 2,462 additions and 26,486 deletions.
14,565 changes: 2,399 additions & 12,166 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"scripts": {
"test": "jest",
"start": "node dist/server.js",
"predev": "lsof -ti :$PORT | xargs kill -9",
"dev": "nodemon",
"build": "tsc --p tsconfig.build.json",
"format": "prettier --write \"src/**/*.{ts,js,tsx,jsx,css}\""
Expand All @@ -33,11 +34,12 @@
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-prettier": "^3.1.4",
"prettier": "^2.8.8",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"typescript": "^4.9.5"
},
"dependencies": {
"@apollo/client": "^3.8.10",
"@compolabs/spark-ts-sdk": "^0.0.4",
"@ethersproject/bignumber": "^5.7.0",
"@fuel-ts/wallet": "^0.69.1",
"@types/request": "^2.48.8",
Expand All @@ -52,11 +54,12 @@
"errorhandler": "^1.5.1",
"ethers": "^6.10.0",
"express": "^4.18.2",
"fuels": "^0.77.0",
"fuels": "^0.79.0",
"graphql": "^16.8.1",
"jest": "^29.0.3",
"mobx": "^6.12.3",
"node-cron": "^3.0.2",
"nodemon": "^3.1.0",
"request": "^2.88.2",
"ts-jest": "^29.0.1",
"tsdef": "^0.0.14"
Expand Down
27 changes: 27 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { BETA_TOKENS } from "@compolabs/spark-ts-sdk";

interface Asset {
address: string;
symbol: string;
decimals: number;
}

export const TOKENS_LIST: Asset[] = Object.values(BETA_TOKENS).map(
({ decimals, assetId, symbol }) => ({
address: assetId,
symbol,
decimals,
})
);

export const TOKENS_BY_SYMBOL: Record<string, Asset> = TOKENS_LIST.reduce(
(acc, t) => ({ ...acc, [t.symbol]: t }),
{}
);

export const TOKENS_BY_ASSET_ID: Record<string, Asset> = TOKENS_LIST.reduce(
(acc, t) => ({ ...acc, [t.address.toLowerCase()]: t }),
{}
);

export const INDEXER_URL = "https://indexer.spark-defi.com";
49 changes: 0 additions & 49 deletions src/sdk/blockchain/BlockchainNetworkFactory.ts

This file was deleted.

35 changes: 0 additions & 35 deletions src/sdk/blockchain/NetworkError.ts

This file was deleted.

87 changes: 0 additions & 87 deletions src/sdk/blockchain/abstract/BlockchainNetwork.ts

This file was deleted.

Loading

0 comments on commit 5a2b2a6

Please sign in to comment.