Skip to content

Commit

Permalink
Merge pull request #39 from setheum-js/2.1.0-dev
Browse files Browse the repository at this point in the history
2.1.0 dev
  • Loading branch information
balqaasem authored Dec 5, 2021
2 parents b0e94a4 + 8755868 commit a6735aa
Show file tree
Hide file tree
Showing 44 changed files with 8,902 additions and 12,612 deletions.
77 changes: 0 additions & 77 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

77 changes: 0 additions & 77 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

This file was deleted.

55 changes: 0 additions & 55 deletions .yarn/releases/yarn-2.4.2.cjs

This file was deleted.

13 changes: 0 additions & 13 deletions .yarnrc.yml

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"HuangLeiWan. <[email protected]>"
],
"license": "Apache-2",
"version": "2.0.1",
"version": "2.1.0",
"private": true,
"engines": {
"yarn": "^1.10.1"
"yarn": "^1.22.10"
},
"workspaces": [
"packages/*"
Expand Down
4 changes: 2 additions & 2 deletions packages/api-derive/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@setheum.js/api-derive",
"version": "2.0.1",
"version": "2.1.0",
"description": "Additional polkadot.js derives for Setheum Network",
"main": "index.js",
"author": "Setheum Labs",
Expand All @@ -15,7 +15,7 @@
},
"homepage": "https://github.com/setheum-js/setheum.js",
"dependencies": {
"@setheum.js/types": "2.0.1",
"@setheum.js/types": "2.1.0",
"@babel/runtime": "^7.10.2",
"@open-web3/orml-types": "^1.0.2-0",
"@polkadot/api-derive": "^6.3.1"
Expand Down
1 change: 0 additions & 1 deletion packages/api-derive/src/loan/loan-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export function loanType(
]).pipe(
map((result) => {
const constants = loanConstants(api);
const [globalInterestRatePerSec, debitExchangeRate, collateralParams] = result;

return {
currency,
Expand Down
6 changes: 3 additions & 3 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@setheum.js/api",
"version": "2.0.1",
"version": "2.1.0",
"description": "Setheum JS API",
"main": "index.js",
"author": "Setheum Developers",
Expand All @@ -15,8 +15,8 @@
},
"homepage": "https://github.com/setheum-js/setheum.js",
"dependencies": {
"@setheum.js/api-derive": "2.0.1",
"@setheum.js/types": "2.0.1",
"@setheum.js/api-derive": "2.1.0",
"@setheum.js/types": "2.1.0",
"@babel/runtime": "^7.10.2",
"@open-web3/orml-api-derive": "^1.0.2-0",
"@polkadot/api": "^6.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-util/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@setheum.js/app-util",
"version": "2.0.1",
"version": "2.1.0",
"description": "Utilities to work with Setheum Network",
"author": "Setheum Labs",
"main": "index.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@setheum.js/sdk-core",
"version": "2.0.1",
"version": "2.1.0",
"description": "the core of Setheum Network sdk",
"main": "index.js",
"author": "Setheum Labs",
Expand All @@ -15,8 +15,8 @@
},
"homepage": "https://github.com/setheum-js/setheum.js",
"dependencies": {
"@setheum.js/api": "2.0.1",
"@setheum.js/type-definitions": "2.0.1",
"@setheum.js/api": "2.1.0",
"@setheum.js/type-definitions": "2.1.0",
"@polkadot/api": "^6.3.1",
"@polkadot/types": "^6.3.1",
"@types/events": "^3.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/sdk-core/src/token.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,5 @@ describe('token', () => {

expect(Token.sort(setm, dnar)).toEqual([setm, dnar]);
expect(Token.sort(dnar, setm)).toEqual([setm, dnar]);
expect(Token.sort(dnar, setusd, setm)).toEqual([setm, setusd, dnar]);
});
});
6 changes: 3 additions & 3 deletions packages/sdk-loan/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@setheum.js/sdk-loan",
"version": "2.0.1",
"version": "2.1.0",
"description": "the loan sub module in Setheum Network sdk",
"main": "index.js",
"author": "Setheum Labs",
Expand All @@ -15,8 +15,8 @@
},
"homepage": "https://github.com/setheum-js/setheum.js",
"dependencies": {
"@setheum.js/api-derive": "2.0.1",
"@setheum.js/sdk-core": "2.0.1",
"@setheum.js/api-derive": "2.1.0",
"@setheum.js/sdk-core": "2.1.0",
"@polkadot/api": "^6.3.1",
"@polkadot/types": "^6.3.1",
"lodash": "^4.17.20",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-loan/src/loan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class LoanRx {

constructor(api: ApiRx, currency: MaybeCurrency, address: string, wallet: WalletRx) {
const collateralToken = wallet.getToken(currency);
const stableCoinToken = wallet.getToken(api.consts.cdpEngine.getSetUSDCurrencyId);
const stableCoinToken = wallet.getToken(api.consts.cdpEngine.getSetUSDId);

assert(collateralToken && stableCoinToken, `init the loan sdk failed, can't find useable token in currency chain`);

Expand Down
4 changes: 2 additions & 2 deletions packages/sdk-swap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@setheum.js/sdk-swap",
"version": "2.0.1",
"version": "2.1.0",
"description": "the swap sub module in Setheum Network sdk",
"main": "index.js",
"author": "Setheum Labs",
Expand All @@ -15,7 +15,7 @@
},
"homepage": "https://github.com/setheum-js/setheum.js",
"dependencies": {
"@setheum.js/sdk-core": "2.0.1",
"@setheum.js/sdk-core": "2.1.0",
"@polkadot/api": "^6.3.1",
"@polkadot/types": "^6.3.1",
"lodash": "^4.17.20",
Expand Down
20 changes: 7 additions & 13 deletions packages/sdk-swap/src/trade-graph.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,38 @@ describe('trade graph', () => {
const setusd = new Token('SETUSD');
const dnar = new Token('DNAR');
const serp = new Token('SERP');
const renbtc = new Token('RENBTC');
const setr = new Token('SETR');

test('create trade graph', () => {
const tradeGraph = new TradeGraph([
new TokenPair(setm, setusd),
new TokenPair(setm, dnar),
new TokenPair(setm, serp),
new TokenPair(setm, renbtc),
new TokenPair(dnar, renbtc)
new TokenPair(setm, setr),
new TokenPair(dnar, setr)
]);

expect(tradeGraph.getAdj(setm)).toEqual([setusd, dnar, serp, renbtc]);
expect(tradeGraph.getAdj(setm)).toEqual([setusd, dnar, serp, setr]);
expect(tradeGraph.getAdj(setusd)).toEqual([setm]);
expect(tradeGraph.getAdj(renbtc)).toEqual([setm, dnar]);
expect(tradeGraph.getAdj(setr)).toEqual([setm, dnar]);
});

test('get path should be work', () => {
const tradeGraph = new TradeGraph([
new TokenPair(setm, setusd),
new TokenPair(setm, dnar),
new TokenPair(setm, serp),
new TokenPair(setm, renbtc),
new TokenPair(dnar, renbtc),
new TokenPair(setm, setr),
new TokenPair(dnar, setr),
new TokenPair(dnar, setusd)
]);

const _dnar = new Token('DNAR');

const dnar2renbtc = tradeGraph.getPathes(_dnar, renbtc);

expect(dnar2renbtc[0]).toEqual([_dnar, setm, renbtc]);
expect(dnar2renbtc[1]).toEqual([_dnar, renbtc]);
expect(dnar2renbtc[2]).toEqual([_dnar, setusd, setm, renbtc]);

const setm2setusd = tradeGraph.getPathes(setm, setusd);

expect(setm2setusd[0]).toEqual([setm, setusd]);
expect(setm2setusd[1]).toEqual([setm, dnar, setusd]);
expect(setm2setusd[2]).toEqual([setm, renbtc, dnar, setusd]);
});
});
4 changes: 2 additions & 2 deletions packages/sdk-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@setheum.js/sdk-wallet",
"version": "2.0.1",
"version": "2.1.0",
"description": "the wallet sdk for Setheum network",
"main": "index.js",
"author": "Setgheum Labs",
Expand All @@ -15,7 +15,7 @@
},
"homepage": "https://github.com/setheum-js/setheum.js",
"dependencies": {
"@setheum.js/sdk-core": "2.0.1",
"@setheum.js/sdk-core": "2.1.0",
"@polkadot/api": "^6.3.1",
"@polkadot/types": "^6.3.1",
"lodash": "^4.17.20",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-wallet/src/config.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ORACLE_FEEDS_TOKEN = ['SETM', 'SERP', 'DNAR', 'SETR', 'SETUSD', 'RENBTC'];
export const ORACLE_FEEDS_TOKEN = ['SETM', 'SERP', 'DNAR', 'SETR', 'SETUSD'];
22 changes: 10 additions & 12 deletions packages/sdk-wallet/src/utils/get-existential-deposit-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ type ExistentialDepositConfig = {
// TODO: Update to match chain impl!
const EXISTENTIAL_DEPOSIT: ExistentialDepositConfig = {
setheum: {
SETM: new FixedPointNumber(0.1, 12),
SERP: new FixedPointNumber(0.01, 12),
DNAR: new FixedPointNumber(10 * 0.00001, 12),
SETR: new FixedPointNumber(50 * 0.00001, 12),
SETUSD: MAX,
RENBTC: MAX,
SETM: new FixedPointNumber(0.1, 18),
SERP: new FixedPointNumber(0.1, 18),
DNAR: new FixedPointNumber(0.1, 18),
SETR: new FixedPointNumber(0.1, 18),
SETUSD: new FixedPointNumber(0.1, 18),
},
dev: {
SETM: new FixedPointNumber(0.1, 12),
SERP: new FixedPointNumber(0.01, 12),
DNAR: new FixedPointNumber(10 * 0.00001, 12),
SETR: new FixedPointNumber(50 * 0.00001, 12),
SETUSD: MAX,
RENBTC: MAX,
SETM: new FixedPointNumber(0.1, 18),
SERP: new FixedPointNumber(0.1, 18),
DNAR: new FixedPointNumber(0.1, 18),
SETR: new FixedPointNumber(0.1, 18),
SETUSD: new FixedPointNumber(0.1, 18),
}
};

Expand Down
4 changes: 2 additions & 2 deletions packages/setcloud-pin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@setheum.js/setcloud-pin",
"version": "1.0.0",
"version": "2.1.0",
"description": "Decentralized SetCloud pin on Setheum Network",
"main": "src/index.js",
"license": "Apache-2.0",
Expand All @@ -19,7 +19,7 @@
"fix": "gts fix"
},
"dependencies": {
"@setheum.js/type-definitions": "^2.0.0",
"@setheum.js/type-definitions": "^2.1.0",
"@polkadot/api": "^4.2.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/type-definitions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@setheum.js/type-definitions",
"version": "2.0.1",
"version": "2.1.0",
"description": "Polkadot.js type definations for Setheum Network",
"main": "index.js",
"author": "Setheum Labs",
Expand Down
4 changes: 0 additions & 4 deletions packages/type-definitions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import market from './market';
import staking from './staking';
import swork from './swork';

// ecosystem
import renvmBridge from './renvmBridge';

import runtime from './runtime';
import { signedExtensions as setheumSignedExtensions } from './signedExtensions';
Expand Down Expand Up @@ -47,8 +45,6 @@ const setheumDefs = {
market,
staking,
swork,
// Bridges
renvmBridge,
};

export const types = {
Expand Down
7 changes: 2 additions & 5 deletions packages/type-definitions/src/json/types.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
"SERP": 1,
"DNAR": 2,
"SETR": 3,
"SETUSD": 4,
"RENBTC": 121
"SETUSD": 4
}
},
"DexShare": {
Expand All @@ -89,8 +88,7 @@
"AuthoritysOriginId": {
"_enum": [
"Root",
"Treasury",
"PublicFund"
"Treasury"
]
},
"SetheumDataProviderId": {
Expand All @@ -100,7 +98,6 @@
]
},
"TradingPair": "(CurrencyId, CurrencyId)",
"ChainBridgeChainId": "u8",
"PalletBalanceOf": "Balance",
"CollateralAuctionItem": {
"refundRecipient": "AccountId",
Expand Down
Loading

0 comments on commit a6735aa

Please sign in to comment.