Skip to content

Commit

Permalink
Feature/staking module (#553)
Browse files Browse the repository at this point in the history
* add StakingModule skeleton

* add stats methods

* add basic subscriptions and extrinsics

* wip extrinsics

* submit extrinsic signer

* added get account pair & pass pair to staking extrinsics

* add elected validator request

* improve methods

* improve methods

* remove unused code

* Bump

* Fix issue

* Update types

---------

Co-authored-by: Stefan Popov <[email protected]>
Co-authored-by: Stefan Popov <[email protected]>
  • Loading branch information
3 people authored Jul 14, 2023
1 parent aedec24 commit 74185d7
Show file tree
Hide file tree
Showing 16 changed files with 1,009 additions and 404 deletions.
4 changes: 2 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sora-substrate/api",
"version": "1.18.3",
"version": "1.18.4",
"license": "Apache-2.0",
"main": "./build/index.js",
"typings": "./build/index.d.ts",
Expand All @@ -10,6 +10,6 @@
"dependencies": {
"@open-web3/orml-api-derive": "1.1.4",
"@polkadot/api": "9.14.2",
"@sora-substrate/types": "1.18.3"
"@sora-substrate/types": "1.18.4"
}
}
4 changes: 2 additions & 2 deletions packages/connection/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@sora-substrate/connection",
"version": "1.18.3",
"version": "1.18.4",
"license": "Apache-2.0",
"main": "./build/index.js",
"typings": "./build/index.d.ts",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@sora-substrate/api": "1.18.3"
"@sora-substrate/api": "1.18.4"
}
}
4 changes: 2 additions & 2 deletions packages/liquidity-proxy/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@sora-substrate/liquidity-proxy",
"version": "1.18.3",
"version": "1.18.4",
"license": "Apache-2.0",
"main": "./build/index.js",
"typings": "./build/index.d.ts",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@sora-substrate/math": "1.18.3"
"@sora-substrate/math": "1.18.4"
}
}
2 changes: 1 addition & 1 deletion packages/math/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sora-substrate/math",
"version": "1.18.3",
"version": "1.18.4",
"license": "Apache-2.0",
"main": "./build/index.js",
"typings": "./build/index.d.ts",
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": "@sora-substrate/type-definitions",
"version": "1.18.3",
"version": "1.18.4",
"license": "Apache-2.0",
"main": "./build/index.js",
"typings": "./build/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sora-substrate/types",
"version": "1.18.3",
"version": "1.18.4",
"license": "Apache-2.0",
"main": "./build/index.js",
"typings": "./build/index.d.ts",
Expand All @@ -13,7 +13,7 @@
"@polkadot/api": "9.14.2",
"@polkadot/typegen": "9.14.2",
"@polkadot/types": "9.14.2",
"@sora-substrate/type-definitions": "1.18.3"
"@sora-substrate/type-definitions": "1.18.4"
},
"devDependencies": {
"@types/websocket": "^1.0.0",
Expand Down
12 changes: 8 additions & 4 deletions packages/types/src/interfaces/augment-api-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2015,14 +2015,14 @@ declare module '@polkadot/api-base/types/errors' {
* There are no bids/asks for the price
**/
NoDataForPrice: AugmentedError<ApiType>;
/**
* The asset is not allowed to be base. Only dex base asset can be a quote asset for order book
**/
NotAllowedBaseAsset: AugmentedError<ApiType>;
/**
* Orderbooks cannot be created with given dex id.
**/
NotAllowedDEXId: AugmentedError<ApiType>;
/**
* The asset is not allowed to be quote. Only the dex base asset can be a quote asset for order book
**/
NotAllowedQuoteAsset: AugmentedError<ApiType>;
/**
* There is not enough liquidity in the order book to cover the deal
**/
Expand Down Expand Up @@ -2051,6 +2051,10 @@ declare module '@polkadot/api-base/types/errors' {
* Indicated limit for slippage has not been met during transaction execution.
**/
SlippageLimitExceeded: AugmentedError<ApiType>;
/**
* Synthetic assets are forbidden for order book.
**/
SyntheticAssetIsForbidden: AugmentedError<ApiType>;
/**
* Tick size & step lot size are too big and their multiplication overflows Balance
**/
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/interfaces/augment-api-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,7 @@ declare module '@polkadot/api-base/types/submittable' {
};
orderBook: {
cancelLimitOrder: AugmentedSubmittable<(orderBookId: OrderBookOrderBookId | { dexId?: any; base?: any; quote?: any } | string | Uint8Array, orderId: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [OrderBookOrderBookId, u128]>;
cancelLimitOrdersBatch: AugmentedSubmittable<(limitOrdersToCancel: Vec<ITuple<[OrderBookOrderBookId, Vec<u128>]>> | ([OrderBookOrderBookId | { dexId?: any; base?: any; quote?: any } | string | Uint8Array, Vec<u128> | (u128 | AnyNumber | Uint8Array)[]])[]) => SubmittableExtrinsic<ApiType>, [Vec<ITuple<[OrderBookOrderBookId, Vec<u128>]>>]>;
changeOrderbookStatus: AugmentedSubmittable<(orderBookId: OrderBookOrderBookId | { dexId?: any; base?: any; quote?: any } | string | Uint8Array, status: OrderBookOrderBookStatus | 'Trade' | 'PlaceAndCancel' | 'OnlyCancel' | 'Stop' | number | Uint8Array) => SubmittableExtrinsic<ApiType>, [OrderBookOrderBookId, OrderBookOrderBookStatus]>;
createOrderbook: AugmentedSubmittable<(orderBookId: OrderBookOrderBookId | { dexId?: any; base?: any; quote?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [OrderBookOrderBookId]>;
deleteOrderbook: AugmentedSubmittable<(orderBookId: OrderBookOrderBookId | { dexId?: any; base?: any; quote?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [OrderBookOrderBookId]>;
Expand Down
Loading

0 comments on commit 74185d7

Please sign in to comment.