@substrate/api-sidecar 20.6.1 → 20.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/package.json +2 -1
- package/build/src/chains-config/assetHubKusamaControllers.js +3 -0
- package/build/src/chains-config/assetHubKusamaControllers.js.map +1 -1
- package/build/src/chains-config/assetHubNextWestendControllers.js +3 -0
- package/build/src/chains-config/assetHubNextWestendControllers.js.map +1 -1
- package/build/src/chains-config/assetHubPolkadotControllers.js +3 -0
- package/build/src/chains-config/assetHubPolkadotControllers.js.map +1 -1
- package/build/src/chains-config/assetHubWestendControllers.js +3 -0
- package/build/src/chains-config/assetHubWestendControllers.js.map +1 -1
- package/build/src/controllers/controllerInjection.spec.js +2 -2
- package/build/src/controllers/controllerInjection.spec.js.map +1 -1
- package/build/src/controllers/index.d.ts +4 -1
- package/build/src/controllers/index.js +3 -0
- package/build/src/controllers/index.js.map +1 -1
- package/build/src/controllers/rc/accounts/RcAccountsStakingInfoController.d.ts +62 -0
- package/build/src/controllers/rc/accounts/RcAccountsStakingInfoController.js +113 -0
- package/build/src/controllers/rc/accounts/RcAccountsStakingInfoController.js.map +1 -0
- package/build/src/controllers/rc/accounts/RcAccountsStakingPayoutsController.d.ts +69 -0
- package/build/src/controllers/rc/accounts/RcAccountsStakingPayoutsController.js +192 -0
- package/build/src/controllers/rc/accounts/RcAccountsStakingPayoutsController.js.map +1 -0
- package/build/src/controllers/rc/accounts/RcAccountsVestingInfoController.d.ts +36 -0
- package/build/src/controllers/rc/accounts/RcAccountsVestingInfoController.js +81 -0
- package/build/src/controllers/rc/accounts/RcAccountsVestingInfoController.js.map +1 -0
- package/build/src/controllers/rc/accounts/index.d.ts +3 -0
- package/build/src/controllers/rc/accounts/index.js +7 -1
- package/build/src/controllers/rc/accounts/index.js.map +1 -1
- package/build/src/controllers/rc/pallets/RcPalletsStakingProgressController.js +1 -1
- package/build/src/controllers/rc/pallets/RcPalletsStakingProgressController.js.map +1 -1
- package/build/src/services/pallets/PalletsStakingProgressService.d.ts +5 -1
- package/build/src/services/pallets/PalletsStakingProgressService.js +4 -6
- package/build/src/services/pallets/PalletsStakingProgressService.js.map +1 -1
- package/build/src/services/pallets/PalletsStakingValidatorsService.js +9 -2
- package/build/src/services/pallets/PalletsStakingValidatorsService.js.map +1 -1
- package/build/src/types/responses/PalletStakingValidators.d.ts +9 -0
- package/package.json +2 -1
package/build/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "20.
|
|
2
|
+
"version": "20.7.1",
|
|
3
3
|
"name": "@substrate/api-sidecar",
|
|
4
4
|
"description": "REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.",
|
|
5
5
|
"homepage": "https://github.com/paritytech/substrate-api-sidecar#readme",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"build:calc": "bash ./calc/build.sh",
|
|
32
32
|
"build:docker": "docker build -t substrate-api-sidecar .",
|
|
33
33
|
"build:docs": "(cd docs && yarn && yarn build)",
|
|
34
|
+
"build:docsv2": "(cd docs-v2 && yarn && yarn build)",
|
|
34
35
|
"build:scripts": "substrate-exec-rimraf scripts/build/ && substrate-exec-tsc --project scripts/tsconfig.json",
|
|
35
36
|
"build:e2e-tests": "substrate-exec-rimraf e2e-tests/build/ && substrate-exec-tsc --project e2e-tests/tsconfig.json",
|
|
36
37
|
"bench": "yarn build:scripts && node scripts/build/runBenchmarks.js",
|
|
@@ -41,6 +41,9 @@ exports.assetHubKusamaControllers = {
|
|
|
41
41
|
'PalletsForeignAssets',
|
|
42
42
|
'RcAccountsBalanceInfo',
|
|
43
43
|
'RcAccountsProxyInfo',
|
|
44
|
+
'RcAccountsStakingInfo',
|
|
45
|
+
'RcAccountsStakingPayouts',
|
|
46
|
+
'RcAccountsVestingInfo',
|
|
44
47
|
'RcBlocks',
|
|
45
48
|
'RcBlocksExtrinsics',
|
|
46
49
|
'RcBlocksRawExtrinsics',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetHubKusamaControllers.js","sourceRoot":"","sources":["../../../src/chains-config/assetHubKusamaControllers.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAGxE,mCAA6D;AAE7D;;GAEG;AACU,QAAA,yBAAyB,GAAqB;IAC1D,WAAW,EAAE;QACZ,gBAAgB;QAChB,qBAAqB;QACrB,iBAAiB;QACjB,kBAAkB;QAClB,SAAS;QACT,QAAQ;QACR,kBAAkB;QAClB,qBAAqB;QACrB,aAAa;QACb,qBAAqB;QACrB,aAAa;QACb,eAAe;QACf,wBAAwB;QACxB,eAAe;QACf,eAAe;QACf,eAAe;QACf,sBAAsB;QACtB,uBAAuB;QACvB,qBAAqB;QACrB,UAAU;QACV,oBAAoB;QACpB,uBAAuB;QACvB,eAAe;QACf,iBAAiB;QACjB,wBAAwB;QACxB,iBAAiB;QACjB,iBAAiB;QACjB,0BAA0B;QAC1B,kBAAkB;QAClB,4BAA4B;QAC5B,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,eAAe;QACf,uBAAuB;QACvB,eAAe;QACf,aAAa;QACb,iBAAiB;QACjB,aAAa;QACb,mBAAmB;QACnB,wBAAwB;QACxB,qBAAqB;QACrB,mBAAmB;KACnB;IACD,OAAO,EAAE;QACR,SAAS,EAAE,IAAI;QACf,iBAAiB,EAAE,CAAC;QACpB,UAAU,EAAE,IAAA,oBAAY,GAAE;QAC1B,cAAc,EAAE,IAAI,4BAAoB,CAAC,IAAI,EAAE,IAAI,CAAC;KACpD;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"assetHubKusamaControllers.js","sourceRoot":"","sources":["../../../src/chains-config/assetHubKusamaControllers.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAGxE,mCAA6D;AAE7D;;GAEG;AACU,QAAA,yBAAyB,GAAqB;IAC1D,WAAW,EAAE;QACZ,gBAAgB;QAChB,qBAAqB;QACrB,iBAAiB;QACjB,kBAAkB;QAClB,SAAS;QACT,QAAQ;QACR,kBAAkB;QAClB,qBAAqB;QACrB,aAAa;QACb,qBAAqB;QACrB,aAAa;QACb,eAAe;QACf,wBAAwB;QACxB,eAAe;QACf,eAAe;QACf,eAAe;QACf,sBAAsB;QACtB,uBAAuB;QACvB,qBAAqB;QACrB,uBAAuB;QACvB,0BAA0B;QAC1B,uBAAuB;QACvB,UAAU;QACV,oBAAoB;QACpB,uBAAuB;QACvB,eAAe;QACf,iBAAiB;QACjB,wBAAwB;QACxB,iBAAiB;QACjB,iBAAiB;QACjB,0BAA0B;QAC1B,kBAAkB;QAClB,4BAA4B;QAC5B,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,eAAe;QACf,uBAAuB;QACvB,eAAe;QACf,aAAa;QACb,iBAAiB;QACjB,aAAa;QACb,mBAAmB;QACnB,wBAAwB;QACxB,qBAAqB;QACrB,mBAAmB;KACnB;IACD,OAAO,EAAE;QACR,SAAS,EAAE,IAAI;QACf,iBAAiB,EAAE,CAAC;QACpB,UAAU,EAAE,IAAA,oBAAY,GAAE;QAC1B,cAAc,EAAE,IAAI,4BAAoB,CAAC,IAAI,EAAE,IAAI,CAAC;KACpD;CACD,CAAC"}
|
|
@@ -52,6 +52,9 @@ exports.assetHubNextWestendControllers = {
|
|
|
52
52
|
'PalletsPoolAssets',
|
|
53
53
|
'RcAccountsBalanceInfo',
|
|
54
54
|
'RcAccountsProxyInfo',
|
|
55
|
+
'RcAccountsStakingInfo',
|
|
56
|
+
'RcAccountsStakingPayouts',
|
|
57
|
+
'RcAccountsVestingInfo',
|
|
55
58
|
'RcBlocks',
|
|
56
59
|
'RcBlocksExtrinsics',
|
|
57
60
|
'RcBlocksRawExtrinsics',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetHubNextWestendControllers.js","sourceRoot":"","sources":["../../../src/chains-config/assetHubNextWestendControllers.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAGxE,mCAA6D;AAE7D;;GAEG;AACU,QAAA,8BAA8B,GAAqB;IAC/D,WAAW,EAAE;QACZ,gBAAgB;QAChB,qBAAqB;QACrB,oBAAoB;QACpB,mBAAmB;QACnB,qBAAqB;QACrB,wBAAwB;QACxB,kBAAkB;QAClB,qBAAqB;QACrB,SAAS;QACT,QAAQ;QACR,kBAAkB;QAClB,qBAAqB;QACrB,aAAa;QACb,qBAAqB;QACrB,aAAa;QACb,eAAe;QACf,wBAAwB;QACxB,eAAe;QACf,sBAAsB;QACtB,eAAe;QACf,eAAe;QACf,sBAAsB;QACtB,wBAAwB;QACxB,yBAAyB;QACzB,wBAAwB;QACxB,0BAA0B;QAC1B,gBAAgB;QAChB,mBAAmB;QACnB,uBAAuB;QACvB,qBAAqB;QACrB,UAAU;QACV,oBAAoB;QACpB,uBAAuB;QACvB,eAAe;QACf,iBAAiB;QACjB,wBAAwB;QACxB,iBAAiB;QACjB,iBAAiB;QACjB,2BAA2B;QAC3B,0BAA0B;QAC1B,4BAA4B;QAC5B,kBAAkB;QAClB,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,eAAe;QACf,uBAAuB;QACvB,eAAe;QACf,aAAa;QACb,iBAAiB;QACjB,aAAa;QACb,mBAAmB;QACnB,wBAAwB;QACxB,qBAAqB;QACrB,mBAAmB;KACnB;IACD,OAAO,EAAE;QACR,SAAS,EAAE,IAAI;QACf,iBAAiB,EAAE,GAAG;QACtB,UAAU,EAAE,IAAA,oBAAY,GAAE;QAC1B,cAAc,EAAE,IAAI,4BAAoB,CAAC,IAAI,EAAE,IAAI,CAAC;KACpD;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"assetHubNextWestendControllers.js","sourceRoot":"","sources":["../../../src/chains-config/assetHubNextWestendControllers.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAGxE,mCAA6D;AAE7D;;GAEG;AACU,QAAA,8BAA8B,GAAqB;IAC/D,WAAW,EAAE;QACZ,gBAAgB;QAChB,qBAAqB;QACrB,oBAAoB;QACpB,mBAAmB;QACnB,qBAAqB;QACrB,wBAAwB;QACxB,kBAAkB;QAClB,qBAAqB;QACrB,SAAS;QACT,QAAQ;QACR,kBAAkB;QAClB,qBAAqB;QACrB,aAAa;QACb,qBAAqB;QACrB,aAAa;QACb,eAAe;QACf,wBAAwB;QACxB,eAAe;QACf,sBAAsB;QACtB,eAAe;QACf,eAAe;QACf,sBAAsB;QACtB,wBAAwB;QACxB,yBAAyB;QACzB,wBAAwB;QACxB,0BAA0B;QAC1B,gBAAgB;QAChB,mBAAmB;QACnB,uBAAuB;QACvB,qBAAqB;QACrB,uBAAuB;QACvB,0BAA0B;QAC1B,uBAAuB;QACvB,UAAU;QACV,oBAAoB;QACpB,uBAAuB;QACvB,eAAe;QACf,iBAAiB;QACjB,wBAAwB;QACxB,iBAAiB;QACjB,iBAAiB;QACjB,2BAA2B;QAC3B,0BAA0B;QAC1B,4BAA4B;QAC5B,kBAAkB;QAClB,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,eAAe;QACf,uBAAuB;QACvB,eAAe;QACf,aAAa;QACb,iBAAiB;QACjB,aAAa;QACb,mBAAmB;QACnB,wBAAwB;QACxB,qBAAqB;QACrB,mBAAmB;KACnB;IACD,OAAO,EAAE;QACR,SAAS,EAAE,IAAI;QACf,iBAAiB,EAAE,GAAG;QACtB,UAAU,EAAE,IAAA,oBAAY,GAAE;QAC1B,cAAc,EAAE,IAAI,4BAAoB,CAAC,IAAI,EAAE,IAAI,CAAC;KACpD;CACD,CAAC"}
|
|
@@ -43,6 +43,9 @@ exports.assetHubPolkadotControllers = {
|
|
|
43
43
|
'PalletsForeignAssets',
|
|
44
44
|
'RcAccountsBalanceInfo',
|
|
45
45
|
'RcAccountsProxyInfo',
|
|
46
|
+
'RcAccountsStakingInfo',
|
|
47
|
+
'RcAccountsStakingPayouts',
|
|
48
|
+
'RcAccountsVestingInfo',
|
|
46
49
|
'RcBlocks',
|
|
47
50
|
'RcBlocksExtrinsics',
|
|
48
51
|
'RcBlocksRawExtrinsics',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetHubPolkadotControllers.js","sourceRoot":"","sources":["../../../src/chains-config/assetHubPolkadotControllers.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAGxE,mCAA6D;AAE7D;;GAEG;AACU,QAAA,2BAA2B,GAAqB;IAC5D,WAAW,EAAE;QACZ,gBAAgB;QAChB,qBAAqB;QACrB,iBAAiB;QACjB,mBAAmB;QACnB,kBAAkB;QAClB,SAAS;QACT,QAAQ;QACR,kBAAkB;QAClB,qBAAqB;QACrB,aAAa;QACb,qBAAqB;QACrB,aAAa;QACb,eAAe;QACf,wBAAwB;QACxB,sBAAsB;QACtB,eAAe;QACf,eAAe;QACf,eAAe;QACf,sBAAsB;QACtB,uBAAuB;QACvB,qBAAqB;QACrB,UAAU;QACV,oBAAoB;QACpB,uBAAuB;QACvB,eAAe;QACf,iBAAiB;QACjB,wBAAwB;QACxB,iBAAiB;QACjB,iBAAiB;QACjB,0BAA0B;QAC1B,4BAA4B;QAC5B,kBAAkB;QAClB,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,eAAe;QACf,uBAAuB;QACvB,eAAe;QACf,aAAa;QACb,iBAAiB;QACjB,aAAa;QACb,mBAAmB;QACnB,wBAAwB;QACxB,qBAAqB;QACrB,mBAAmB;KACnB;IACD,OAAO,EAAE;QACR,SAAS,EAAE,IAAI;QACf,iBAAiB,EAAE,GAAG;QACtB,UAAU,EAAE,IAAA,oBAAY,GAAE;QAC1B,cAAc,EAAE,IAAI,4BAAoB,CAAC,IAAI,EAAE,IAAI,CAAC;KACpD;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"assetHubPolkadotControllers.js","sourceRoot":"","sources":["../../../src/chains-config/assetHubPolkadotControllers.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAGxE,mCAA6D;AAE7D;;GAEG;AACU,QAAA,2BAA2B,GAAqB;IAC5D,WAAW,EAAE;QACZ,gBAAgB;QAChB,qBAAqB;QACrB,iBAAiB;QACjB,mBAAmB;QACnB,kBAAkB;QAClB,SAAS;QACT,QAAQ;QACR,kBAAkB;QAClB,qBAAqB;QACrB,aAAa;QACb,qBAAqB;QACrB,aAAa;QACb,eAAe;QACf,wBAAwB;QACxB,sBAAsB;QACtB,eAAe;QACf,eAAe;QACf,eAAe;QACf,sBAAsB;QACtB,uBAAuB;QACvB,qBAAqB;QACrB,uBAAuB;QACvB,0BAA0B;QAC1B,uBAAuB;QACvB,UAAU;QACV,oBAAoB;QACpB,uBAAuB;QACvB,eAAe;QACf,iBAAiB;QACjB,wBAAwB;QACxB,iBAAiB;QACjB,iBAAiB;QACjB,0BAA0B;QAC1B,4BAA4B;QAC5B,kBAAkB;QAClB,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,eAAe;QACf,uBAAuB;QACvB,eAAe;QACf,aAAa;QACb,iBAAiB;QACjB,aAAa;QACb,mBAAmB;QACnB,wBAAwB;QACxB,qBAAqB;QACrB,mBAAmB;KACnB;IACD,OAAO,EAAE;QACR,SAAS,EAAE,IAAI;QACf,iBAAiB,EAAE,GAAG;QACtB,UAAU,EAAE,IAAA,oBAAY,GAAE;QAC1B,cAAc,EAAE,IAAI,4BAAoB,CAAC,IAAI,EAAE,IAAI,CAAC;KACpD;CACD,CAAC"}
|
|
@@ -52,6 +52,9 @@ exports.assetHubWestendControllers = {
|
|
|
52
52
|
'PalletsPoolAssets',
|
|
53
53
|
'RcAccountsBalanceInfo',
|
|
54
54
|
'RcAccountsProxyInfo',
|
|
55
|
+
'RcAccountsStakingInfo',
|
|
56
|
+
'RcAccountsStakingPayouts',
|
|
57
|
+
'RcAccountsVestingInfo',
|
|
55
58
|
'RcBlocks',
|
|
56
59
|
'RcBlocksExtrinsics',
|
|
57
60
|
'RcBlocksRawExtrinsics',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetHubWestendControllers.js","sourceRoot":"","sources":["../../../src/chains-config/assetHubWestendControllers.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAGxE,mCAA6D;AAE7D;;GAEG;AACU,QAAA,0BAA0B,GAAqB;IAC3D,WAAW,EAAE;QACZ,gBAAgB;QAChB,qBAAqB;QACrB,oBAAoB;QACpB,mBAAmB;QACnB,qBAAqB;QACrB,wBAAwB;QACxB,kBAAkB;QAClB,qBAAqB;QACrB,SAAS;QACT,QAAQ;QACR,kBAAkB;QAClB,qBAAqB;QACrB,aAAa;QACb,qBAAqB;QACrB,aAAa;QACb,eAAe;QACf,wBAAwB;QACxB,eAAe;QACf,sBAAsB;QACtB,eAAe;QACf,eAAe;QACf,sBAAsB;QACtB,wBAAwB;QACxB,yBAAyB;QACzB,wBAAwB;QACxB,0BAA0B;QAC1B,gBAAgB;QAChB,mBAAmB;QACnB,uBAAuB;QACvB,qBAAqB;QACrB,UAAU;QACV,oBAAoB;QACpB,uBAAuB;QACvB,eAAe;QACf,iBAAiB;QACjB,wBAAwB;QACxB,iBAAiB;QACjB,iBAAiB;QACjB,2BAA2B;QAC3B,0BAA0B;QAC1B,4BAA4B;QAC5B,0BAA0B;QAC1B,kBAAkB;QAClB,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,eAAe;QACf,uBAAuB;QACvB,eAAe;QACf,aAAa;QACb,iBAAiB;QACjB,aAAa;QACb,mBAAmB;QACnB,wBAAwB;QACxB,qBAAqB;QACrB,mBAAmB;KACnB;IACD,OAAO,EAAE;QACR,SAAS,EAAE,IAAI;QACf,iBAAiB,EAAE,GAAG;QACtB,UAAU,EAAE,IAAA,oBAAY,GAAE;QAC1B,cAAc,EAAE,IAAI,4BAAoB,CAAC,IAAI,EAAE,IAAI,CAAC;KACpD;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"assetHubWestendControllers.js","sourceRoot":"","sources":["../../../src/chains-config/assetHubWestendControll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AAE,IAAI,4BAAoB,CAAC,IAAI,EAAE,IAAI,CAAC;KACpD;CACD,CAAC"}
|
|
@@ -52,13 +52,13 @@ const chainsToNode = {
|
|
|
52
52
|
// 'asset-hub-kusama': 'wss://asset-hub-kusama-rpc.dwellir.com',
|
|
53
53
|
kusama: 'wss://kusama-rpc.dwellir.com',
|
|
54
54
|
// 'asset-hub-westend': 'wss://asset-hub-westend-rpc.dwellir.com',
|
|
55
|
-
astar: 'wss://astar-rpc.dwellir.com',
|
|
55
|
+
// astar: 'wss://astar-rpc.dwellir.com',
|
|
56
56
|
bifrost_polkadot: 'wss://bifrost-polkadot.ibp.network',
|
|
57
57
|
polkadot: 'wss://polkadot-rpc.dwellir.com',
|
|
58
58
|
'coretime-westend': 'wss://coretime-westend-rpc.dwellir.com',
|
|
59
59
|
'coretime-polkadot': 'wss://sys.ibp.network/coretime-polkadot',
|
|
60
60
|
crust: 'wss://crust-parachain.crustapps.net',
|
|
61
|
-
karura: 'wss://karura-rpc.dwellir.com',
|
|
61
|
+
// karura: 'wss://karura-rpc.dwellir.com',
|
|
62
62
|
// manta: 'wss://ws.manta.systems',
|
|
63
63
|
kilt: 'wss://kilt.ibp.network',
|
|
64
64
|
// 'asset-hub-polkadot': 'wss://asset-hub-polkadot-rpc.dwellir.com',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controllerInjection.spec.js","sourceRoot":"","sources":["../../../src/controllers/controllerInjection.spec.ts"],"names":[],"mappings":";AAAA,iGAAiG;;AAEjG,uCAAuD;AAGvD,gDAAoD;AACpD,oDAAuE;AACvE,4EAAyE;AACzE,wBAAgC;AAEhC;;;;;GAKG;AAEH,MAAM,iBAAiB,GAAmB;IACzC,OAAO,EAAE;QACR,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,IAAI;QACV,kBAAkB,EAAE,IAAI;QACxB,QAAQ,EAAE,OAAO;QACjB,oBAAoB,EAAE,KAAK;KAC3B;IACD,SAAS,EAAE;QACV,GAAG,EAAE,EAAE;QACP,eAAe,EAAE,EAAE;QACnB,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,EAAE;QACd,KAAK,EAAE,EAAE;QACT,cAAc,EAAE,IAAI;KACpB;IACD,GAAG,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,KAAK;QACZ,UAAU,EAAE,EAAE;QACd,mBAAmB,EAAE,CAAC;QACtB,eAAe,EAAE,CAAC;KAClB;IACD,OAAO,EAAE;QACR,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,CAAC;QACZ,mBAAmB,EAAE,KAAK;KAC1B;CACD,CAAC;AAEF,MAAM,YAAY,GAA2B;IAC5C,gEAAgE;IAChE,MAAM,EAAE,8BAA8B;IACtC,kEAAkE;IAClE,
|
|
1
|
+
{"version":3,"file":"controllerInjection.spec.js","sourceRoot":"","sources":["../../../src/controllers/controllerInjection.spec.ts"],"names":[],"mappings":";AAAA,iGAAiG;;AAEjG,uCAAuD;AAGvD,gDAAoD;AACpD,oDAAuE;AACvE,4EAAyE;AACzE,wBAAgC;AAEhC;;;;;GAKG;AAEH,MAAM,iBAAiB,GAAmB;IACzC,OAAO,EAAE;QACR,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,IAAI;QACV,kBAAkB,EAAE,IAAI;QACxB,QAAQ,EAAE,OAAO;QACjB,oBAAoB,EAAE,KAAK;KAC3B;IACD,SAAS,EAAE;QACV,GAAG,EAAE,EAAE;QACP,eAAe,EAAE,EAAE;QACnB,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,EAAE;QACd,KAAK,EAAE,EAAE;QACT,cAAc,EAAE,IAAI;KACpB;IACD,GAAG,EAAE;QACJ,KAAK,EAAE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CAAC,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { CoretimeChain, CoretimeGeneric } from './coretime';
|
|
|
6
6
|
import { NodeNetwork, NodeTransactionPool, NodeVersion } from './node';
|
|
7
7
|
import { PalletsAssetConversion, PalletsAssets, PalletsConsts, PalletsDispatchables, PalletsErrors, PalletsEvents, PalletsForeignAssets, PalletsNominationPools, PalletsOnGoingReferenda, PalletsPoolAssets, PalletsStakingProgress, PalletsStakingValidators, PalletsStorage } from './pallets';
|
|
8
8
|
import { Paras } from './paras';
|
|
9
|
-
import { RcAccountsBalanceInfo, RcAccountsProxyInfo } from './rc/accounts';
|
|
9
|
+
import { RcAccountsBalanceInfo, RcAccountsProxyInfo, RcAccountsStakingInfo, RcAccountsStakingPayouts, RcAccountsVestingInfo } from './rc/accounts';
|
|
10
10
|
import { RcBlocks, RcBlocksExtrinsics, RcBlocksRawExtrinsics, RcBlocksTrace } from './rc/blocks';
|
|
11
11
|
import { RcNodeNetwork, RcNodeTransactionPool, RcNodeVersion } from './rc/node';
|
|
12
12
|
import { RcPalletsConsts, RcPalletsDispatchables, RcPalletsErrors, RcPalletsEvents, RcPalletsOnGoingReferenda, RcPalletsStakingProgress, RcPalletsStakingValidators, RcPalletsStorage } from './rc/pallets';
|
|
@@ -51,6 +51,9 @@ export declare const controllers: {
|
|
|
51
51
|
NodeVersion: typeof NodeVersion;
|
|
52
52
|
RcAccountsBalanceInfo: typeof RcAccountsBalanceInfo;
|
|
53
53
|
RcAccountsProxyInfo: typeof RcAccountsProxyInfo;
|
|
54
|
+
RcAccountsStakingInfo: typeof RcAccountsStakingInfo;
|
|
55
|
+
RcAccountsStakingPayouts: typeof RcAccountsStakingPayouts;
|
|
56
|
+
RcAccountsVestingInfo: typeof RcAccountsVestingInfo;
|
|
54
57
|
RcBlocks: typeof RcBlocks;
|
|
55
58
|
RcBlocksExtrinsics: typeof RcBlocksExtrinsics;
|
|
56
59
|
RcBlocksRawExtrinsics: typeof RcBlocksRawExtrinsics;
|
|
@@ -69,6 +69,9 @@ exports.controllers = {
|
|
|
69
69
|
NodeVersion: node_1.NodeVersion,
|
|
70
70
|
RcAccountsBalanceInfo: accounts_2.RcAccountsBalanceInfo,
|
|
71
71
|
RcAccountsProxyInfo: accounts_2.RcAccountsProxyInfo,
|
|
72
|
+
RcAccountsStakingInfo: accounts_2.RcAccountsStakingInfo,
|
|
73
|
+
RcAccountsStakingPayouts: accounts_2.RcAccountsStakingPayouts,
|
|
74
|
+
RcAccountsVestingInfo: accounts_2.RcAccountsVestingInfo,
|
|
72
75
|
RcBlocks: blocks_2.RcBlocks,
|
|
73
76
|
RcBlocksExtrinsics: blocks_2.RcBlocksExtrinsics,
|
|
74
77
|
RcBlocksRawExtrinsics: blocks_2.RcBlocksRawExtrinsics,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAExE,yCAWoB;AACpB,+BAAgC;AAChC,qCAAsF;AACtF,2CAA2C;AAC3C,yCAA4D;AAC5D,iCAAuE;AACvE,uCAcmB;AACnB,mCAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAExE,yCAWoB;AACpB,+BAAgC;AAChC,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ArB,gCAAqB;IACrB,QAAQ,EAAR,iBAAQ;IACR,kBAAkB,EAAlB,2BAAkB;IAClB,qBAAqB,EAArB,8BAAqB;IACrB,aAAa,EAAb,sBAAa;IACb,eAAe,EAAf,yBAAe;IACf,sBAAsB,EAAtB,gCAAsB;IACtB,eAAe,EAAf,yBAAe;IACf,eAAe,EAAf,yBAAe;IACf,yBAAyB,EAAzB,mCAAyB;IACzB,wBAAwB,EAAxB,kCAAwB;IACxB,0BAA0B,EAA1B,oCAA0B;IAC1B,gBAAgB,EAAhB,0BAAgB;IAChB,aAAa,EAAb,uBAAa;IACb,iBAAiB,EAAjB,2BAAiB;IACjB,aAAa,EAAb,uBAAa;IACb,aAAa,EAAb,oBAAa;IACb,qBAAqB,EAArB,4BAAqB;IACrB,aAAa,EAAb,oBAAa;IACb,WAAW,EAAX,qBAAW;IACX,eAAe,EAAf,yBAAe;IACf,WAAW,EAAX,qBAAW;IACX,iBAAiB,EAAjB,+BAAiB;IACjB,sBAAsB,EAAtB,oCAAsB;IACtB,mBAAmB,EAAnB,iCAAmB;IACnB,iBAAiB,EAAjB,+BAAiB;IACjB,KAAK,EAAL,aAAK;IACL,eAAe,EAAf,0BAAe;IACf,aAAa,EAAb,wBAAa;CACb,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AccountsStakingInfoService } from '../../../services';
|
|
2
|
+
import AbstractController from '../../AbstractController';
|
|
3
|
+
/**
|
|
4
|
+
* GET staking information for an address on the relay chain.
|
|
5
|
+
*
|
|
6
|
+
* Paths:
|
|
7
|
+
* - `address`: The _Stash_ address for staking.
|
|
8
|
+
*
|
|
9
|
+
* Query:
|
|
10
|
+
* - (Optional)`at`: Block at which to retrieve staking information at. Block
|
|
11
|
+
* identifier, as the block height or block hash. Defaults to most recent block.
|
|
12
|
+
* - (Optional) `includeClaimedRewards`: Controls whether or not the `claimedRewards`
|
|
13
|
+
* field is included in the response. Defaults to `true`.
|
|
14
|
+
* If set to `false`:
|
|
15
|
+
* - the field `claimedRewards` will be omitted from the response and
|
|
16
|
+
* - all internal calculations for claimed rewards in `AccountsStakingInfoService`
|
|
17
|
+
* will be skipped, potentially speeding up the response time.
|
|
18
|
+
*
|
|
19
|
+
* Returns:
|
|
20
|
+
* - `at`: Block number and hash at which the call was made.
|
|
21
|
+
* - `rewardDestination`: The account to which rewards will be paid. Can be 'Staked' (Stash
|
|
22
|
+
* account, adding to the amount at stake), 'Stash' (Stash address, not adding to the amount at
|
|
23
|
+
* stake), 'Controller' (Controller address), or 'Account(AccountId)' (address identified by AccountId).
|
|
24
|
+
* - `controller`: Controller address for the given Stash.
|
|
25
|
+
* - `numSlashingSpans`: Number of slashing spans on Stash account; `null` if provided address is
|
|
26
|
+
* not a Controller.
|
|
27
|
+
* - `staking`: The staking ledger. Empty object if provided address is not a Controller.
|
|
28
|
+
* - `stash`: The stash account whose balance is actually locked and at stake.
|
|
29
|
+
* - `total`: The total amount of the stash's balance that we are currently accounting for.
|
|
30
|
+
* Simply `active + unlocking`.
|
|
31
|
+
* - `active`: The total amount of the stash's balance that will be at stake in any forthcoming
|
|
32
|
+
* eras.
|
|
33
|
+
* - `unlocking`: Any balance that is becoming free, which may eventually be transferred out of
|
|
34
|
+
* the stash (assuming it doesn't get slashed first). Represented as an array of objects, each
|
|
35
|
+
* with an `era` at which `value` will be unlocked.
|
|
36
|
+
* - `claimedRewards`: Array of eras for which the stakers behind a validator have claimed
|
|
37
|
+
* rewards. Only updated for _validators._
|
|
38
|
+
*
|
|
39
|
+
* Note: Runtime versions of Kusama less than 1062 will either have `lastReward` in place of
|
|
40
|
+
* `claimedRewards`, or no field at all. This is related to changes in reward distribution. See:
|
|
41
|
+
* - Lazy Payouts: https://github.com/paritytech/substrate/pull/4474
|
|
42
|
+
* - Simple Payouts: https://github.com/paritytech/substrate/pull/5406
|
|
43
|
+
*
|
|
44
|
+
* Substrate Reference:
|
|
45
|
+
* - Staking Pallet: https://crates.parity.io/pallet_staking/index.html
|
|
46
|
+
* - `RewardDestination`: https://crates.parity.io/pallet_staking/enum.RewardDestination.html
|
|
47
|
+
* - `Bonded`: https://crates.parity.io/pallet_staking/struct.Bonded.html
|
|
48
|
+
* - `StakingLedger`: https://crates.parity.io/pallet_staking/struct.StakingLedger.html
|
|
49
|
+
*/
|
|
50
|
+
export default class RcAccountsStakingInfoController extends AbstractController<AccountsStakingInfoService> {
|
|
51
|
+
static controllerName: string;
|
|
52
|
+
static requiredPallets: string[][];
|
|
53
|
+
constructor(_api: string);
|
|
54
|
+
protected initRoutes(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Get the latest account staking summary of `address` on the relay chain.
|
|
57
|
+
*
|
|
58
|
+
* @param req Express Request
|
|
59
|
+
* @param res Express Response
|
|
60
|
+
*/
|
|
61
|
+
private getAccountStakingInfo;
|
|
62
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
|
|
3
|
+
// This file is part of Substrate API Sidecar.
|
|
4
|
+
//
|
|
5
|
+
// Substrate API Sidecar is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU General Public License
|
|
16
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const apiRegistry_1 = require("../../../apiRegistry");
|
|
22
|
+
const middleware_1 = require("../../../middleware");
|
|
23
|
+
const services_1 = require("../../../services");
|
|
24
|
+
const AbstractController_1 = __importDefault(require("../../AbstractController"));
|
|
25
|
+
/**
|
|
26
|
+
* GET staking information for an address on the relay chain.
|
|
27
|
+
*
|
|
28
|
+
* Paths:
|
|
29
|
+
* - `address`: The _Stash_ address for staking.
|
|
30
|
+
*
|
|
31
|
+
* Query:
|
|
32
|
+
* - (Optional)`at`: Block at which to retrieve staking information at. Block
|
|
33
|
+
* identifier, as the block height or block hash. Defaults to most recent block.
|
|
34
|
+
* - (Optional) `includeClaimedRewards`: Controls whether or not the `claimedRewards`
|
|
35
|
+
* field is included in the response. Defaults to `true`.
|
|
36
|
+
* If set to `false`:
|
|
37
|
+
* - the field `claimedRewards` will be omitted from the response and
|
|
38
|
+
* - all internal calculations for claimed rewards in `AccountsStakingInfoService`
|
|
39
|
+
* will be skipped, potentially speeding up the response time.
|
|
40
|
+
*
|
|
41
|
+
* Returns:
|
|
42
|
+
* - `at`: Block number and hash at which the call was made.
|
|
43
|
+
* - `rewardDestination`: The account to which rewards will be paid. Can be 'Staked' (Stash
|
|
44
|
+
* account, adding to the amount at stake), 'Stash' (Stash address, not adding to the amount at
|
|
45
|
+
* stake), 'Controller' (Controller address), or 'Account(AccountId)' (address identified by AccountId).
|
|
46
|
+
* - `controller`: Controller address for the given Stash.
|
|
47
|
+
* - `numSlashingSpans`: Number of slashing spans on Stash account; `null` if provided address is
|
|
48
|
+
* not a Controller.
|
|
49
|
+
* - `staking`: The staking ledger. Empty object if provided address is not a Controller.
|
|
50
|
+
* - `stash`: The stash account whose balance is actually locked and at stake.
|
|
51
|
+
* - `total`: The total amount of the stash's balance that we are currently accounting for.
|
|
52
|
+
* Simply `active + unlocking`.
|
|
53
|
+
* - `active`: The total amount of the stash's balance that will be at stake in any forthcoming
|
|
54
|
+
* eras.
|
|
55
|
+
* - `unlocking`: Any balance that is becoming free, which may eventually be transferred out of
|
|
56
|
+
* the stash (assuming it doesn't get slashed first). Represented as an array of objects, each
|
|
57
|
+
* with an `era` at which `value` will be unlocked.
|
|
58
|
+
* - `claimedRewards`: Array of eras for which the stakers behind a validator have claimed
|
|
59
|
+
* rewards. Only updated for _validators._
|
|
60
|
+
*
|
|
61
|
+
* Note: Runtime versions of Kusama less than 1062 will either have `lastReward` in place of
|
|
62
|
+
* `claimedRewards`, or no field at all. This is related to changes in reward distribution. See:
|
|
63
|
+
* - Lazy Payouts: https://github.com/paritytech/substrate/pull/4474
|
|
64
|
+
* - Simple Payouts: https://github.com/paritytech/substrate/pull/5406
|
|
65
|
+
*
|
|
66
|
+
* Substrate Reference:
|
|
67
|
+
* - Staking Pallet: https://crates.parity.io/pallet_staking/index.html
|
|
68
|
+
* - `RewardDestination`: https://crates.parity.io/pallet_staking/enum.RewardDestination.html
|
|
69
|
+
* - `Bonded`: https://crates.parity.io/pallet_staking/struct.Bonded.html
|
|
70
|
+
* - `StakingLedger`: https://crates.parity.io/pallet_staking/struct.StakingLedger.html
|
|
71
|
+
*/
|
|
72
|
+
class RcAccountsStakingInfoController extends AbstractController_1.default {
|
|
73
|
+
constructor(_api) {
|
|
74
|
+
var _a;
|
|
75
|
+
const rcApiSpecName = (_a = apiRegistry_1.ApiPromiseRegistry.getSpecNameByType('relay')) === null || _a === void 0 ? void 0 : _a.values();
|
|
76
|
+
const rcSpecName = rcApiSpecName ? Array.from(rcApiSpecName)[0] : undefined;
|
|
77
|
+
if (!rcSpecName) {
|
|
78
|
+
throw new Error('Relay chain API spec name is not defined.');
|
|
79
|
+
}
|
|
80
|
+
super(rcSpecName, '/rc/accounts/:address/staking-info', new services_1.AccountsStakingInfoService(rcSpecName));
|
|
81
|
+
/**
|
|
82
|
+
* Get the latest account staking summary of `address` on the relay chain.
|
|
83
|
+
*
|
|
84
|
+
* @param req Express Request
|
|
85
|
+
* @param res Express Response
|
|
86
|
+
*/
|
|
87
|
+
this.getAccountStakingInfo = async ({ params: { address }, query: { at, includeClaimedRewards } }, res) => {
|
|
88
|
+
var _a;
|
|
89
|
+
const rcApi = (_a = apiRegistry_1.ApiPromiseRegistry.getApiByType('relay')[0]) === null || _a === void 0 ? void 0 : _a.api;
|
|
90
|
+
if (!rcApi) {
|
|
91
|
+
throw new Error('Relay chain API not found, please use SAS_SUBSTRATE_MULTI_CHAIN_URL env variable');
|
|
92
|
+
}
|
|
93
|
+
const includeClaimedRewardsArg = includeClaimedRewards !== 'false';
|
|
94
|
+
const hash = await this.getHashFromAt(at, { api: rcApi });
|
|
95
|
+
const result = await this.service.fetchAccountStakingInfo(hash, includeClaimedRewardsArg, address);
|
|
96
|
+
RcAccountsStakingInfoController.sanitizedSend(res, result);
|
|
97
|
+
};
|
|
98
|
+
this.initRoutes();
|
|
99
|
+
}
|
|
100
|
+
initRoutes() {
|
|
101
|
+
this.router.use(this.path, middleware_1.validateAddress, (0, middleware_1.validateBoolean)(['includeClaimedRewards']));
|
|
102
|
+
this.safeMountAsyncGetHandlers([['', this.getAccountStakingInfo]]);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
RcAccountsStakingInfoController.controllerName = 'RcAccountsStakingInfo';
|
|
106
|
+
RcAccountsStakingInfoController.requiredPallets = [
|
|
107
|
+
['Staking', 'System'],
|
|
108
|
+
['ParachainStaking', 'ParachainSystem'],
|
|
109
|
+
['ParachainStaking', 'System'],
|
|
110
|
+
['Staking', 'ParachainSystem'],
|
|
111
|
+
];
|
|
112
|
+
exports.default = RcAccountsStakingInfoController;
|
|
113
|
+
//# sourceMappingURL=RcAccountsStakingInfoController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RcAccountsStakingInfoController.js","sourceRoot":"","sources":["../../../../../src/controllers/rc/accounts/RcAccountsStakingInfoController.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,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EAAE,CAAC,CAAC;YAC1D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,CAAC,CAAC;YAEnG,+BAA+B,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC5D,CAAC,CAAC;QA/BD,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;IAES,UAAU;QACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,4BAAe,EAAE,IAAA,4BAAe,EAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;QAExF,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC;;AAtBM,8CAAc,GAAG,uBAAuB,AAA1B,CAA2B;AACzC,+CAAe,GAAG;IACxB,CAAC,SAAS,EAAE,QAAQ,CAAC;IACrB,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;IACvC,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC9B,CAAC,SAAS,EAAE,iBAAiB,CAAC;CAC9B,AALqB,CAKpB;kBAPkB,+BAA+B"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { AccountsStakingPayoutsService } from '../../../services';
|
|
2
|
+
import AbstractController from '../../AbstractController';
|
|
3
|
+
/**
|
|
4
|
+
* GET payout information for a stash account on the relay chain.
|
|
5
|
+
*
|
|
6
|
+
* Path params:
|
|
7
|
+
* - `address`: SS58 address of the account. Must be a _Stash_ account.
|
|
8
|
+
*
|
|
9
|
+
* Query params:
|
|
10
|
+
* - (Optional) `depth`: The number of eras to query for payouts of. Must be less
|
|
11
|
+
* than `HISTORY_DEPTH`. In cases where `era - (depth -1)` is less
|
|
12
|
+
* than 0, the first era queried will be 0. Defaults to 1.
|
|
13
|
+
* - (Optional) `era`: The era to query at. Max era payout info is available for
|
|
14
|
+
* is the latest finished era: `active_era - 1`. Defaults to `active_era - 1`.
|
|
15
|
+
* - (Optional) `unclaimedOnly`: Only return unclaimed rewards. Defaults to true.
|
|
16
|
+
*
|
|
17
|
+
* Returns:
|
|
18
|
+
* - `at`:
|
|
19
|
+
* - `hash`: The block's hash.
|
|
20
|
+
* - `height`: The block's height.
|
|
21
|
+
* - `eraPayouts`: array of
|
|
22
|
+
* - `era`: Era this information is associated with.
|
|
23
|
+
* - `totalEraRewardPoints`: Total reward points for the era.
|
|
24
|
+
* - `totalEraPayout`: Total payout for the era. Validators split the payout
|
|
25
|
+
* based on the portion of `totalEraRewardPoints` they have.
|
|
26
|
+
* - `payouts`: array of
|
|
27
|
+
* - `validatorId`: AccountId of the validator the payout is coming from.
|
|
28
|
+
* - `nominatorStakingPayout`: Payout for the reward destination associated with the
|
|
29
|
+
* accountId the query was made for.
|
|
30
|
+
* - `claimed`: Whether or not the reward has been claimed.
|
|
31
|
+
* - `totalValidatorRewardPoints`: Number of reward points earned by the validator.
|
|
32
|
+
* - `validatorCommission`: The percentage of the total payout that the validator
|
|
33
|
+
* takes as commission, expressed as a Perbill.
|
|
34
|
+
* - `totalValidatorExposure`: The sum of the validator's and its nominators' stake.
|
|
35
|
+
* - `nominatorExposure`: The amount of stake the nominator has behind the validator.
|
|
36
|
+
*
|
|
37
|
+
* Description:
|
|
38
|
+
* Returns payout information for the last specified eras on the relay chain. If specifying both
|
|
39
|
+
* the depth and era query params, this endpoint will return information for
|
|
40
|
+
* (era - depth) through era. (i.e. if depth=5 and era=20 information will be
|
|
41
|
+
* returned for eras 16 through 20). N.B. You cannot query eras less then
|
|
42
|
+
* `current_era - HISTORY_DEPTH`.
|
|
43
|
+
*
|
|
44
|
+
* N.B. The `nominator*` fields correspond to the address being queried, even if it
|
|
45
|
+
* is a validator's _stash_ address. This is because a validator is technically
|
|
46
|
+
* nominating itself.
|
|
47
|
+
*
|
|
48
|
+
* `payouts` Is an array of payouts for a nominating stash address and information
|
|
49
|
+
* about the validator they were nominating. `eraPayouts` contains an array of
|
|
50
|
+
* objects that has staking reward metadata for each era, and an array of the
|
|
51
|
+
* aformentioned payouts.
|
|
52
|
+
*/
|
|
53
|
+
export default class RcAccountsStakingPayoutsController extends AbstractController<AccountsStakingPayoutsService> {
|
|
54
|
+
static controllerName: string;
|
|
55
|
+
static requiredPallets: string[][];
|
|
56
|
+
constructor(_api: string);
|
|
57
|
+
protected initRoutes(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Get the payouts of `address` for `depth` starting from the `era` on the relay chain.
|
|
60
|
+
*
|
|
61
|
+
* @param req Express Request
|
|
62
|
+
* @param res Express Response
|
|
63
|
+
*/
|
|
64
|
+
private getStakingPayoutsByAccountId;
|
|
65
|
+
private sanitizeDepth;
|
|
66
|
+
private getEraAndHash;
|
|
67
|
+
private getCurrentEra;
|
|
68
|
+
private getActiveEra;
|
|
69
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
|
|
3
|
+
// This file is part of Substrate API Sidecar.
|
|
4
|
+
//
|
|
5
|
+
// Substrate API Sidecar is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU General Public License
|
|
16
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const types_1 = require("@polkadot/types");
|
|
22
|
+
const bn_js_1 = __importDefault(require("bn.js"));
|
|
23
|
+
const http_errors_1 = require("http-errors");
|
|
24
|
+
const apiRegistry_1 = require("../../../apiRegistry");
|
|
25
|
+
const middleware_1 = require("../../../middleware");
|
|
26
|
+
const services_1 = require("../../../services");
|
|
27
|
+
const kusamaEarlyErasBlockInfo_json_1 = __importDefault(require("../../../services/accounts/kusamaEarlyErasBlockInfo.json"));
|
|
28
|
+
const AbstractController_1 = __importDefault(require("../../AbstractController"));
|
|
29
|
+
/**
|
|
30
|
+
* GET payout information for a stash account on the relay chain.
|
|
31
|
+
*
|
|
32
|
+
* Path params:
|
|
33
|
+
* - `address`: SS58 address of the account. Must be a _Stash_ account.
|
|
34
|
+
*
|
|
35
|
+
* Query params:
|
|
36
|
+
* - (Optional) `depth`: The number of eras to query for payouts of. Must be less
|
|
37
|
+
* than `HISTORY_DEPTH`. In cases where `era - (depth -1)` is less
|
|
38
|
+
* than 0, the first era queried will be 0. Defaults to 1.
|
|
39
|
+
* - (Optional) `era`: The era to query at. Max era payout info is available for
|
|
40
|
+
* is the latest finished era: `active_era - 1`. Defaults to `active_era - 1`.
|
|
41
|
+
* - (Optional) `unclaimedOnly`: Only return unclaimed rewards. Defaults to true.
|
|
42
|
+
*
|
|
43
|
+
* Returns:
|
|
44
|
+
* - `at`:
|
|
45
|
+
* - `hash`: The block's hash.
|
|
46
|
+
* - `height`: The block's height.
|
|
47
|
+
* - `eraPayouts`: array of
|
|
48
|
+
* - `era`: Era this information is associated with.
|
|
49
|
+
* - `totalEraRewardPoints`: Total reward points for the era.
|
|
50
|
+
* - `totalEraPayout`: Total payout for the era. Validators split the payout
|
|
51
|
+
* based on the portion of `totalEraRewardPoints` they have.
|
|
52
|
+
* - `payouts`: array of
|
|
53
|
+
* - `validatorId`: AccountId of the validator the payout is coming from.
|
|
54
|
+
* - `nominatorStakingPayout`: Payout for the reward destination associated with the
|
|
55
|
+
* accountId the query was made for.
|
|
56
|
+
* - `claimed`: Whether or not the reward has been claimed.
|
|
57
|
+
* - `totalValidatorRewardPoints`: Number of reward points earned by the validator.
|
|
58
|
+
* - `validatorCommission`: The percentage of the total payout that the validator
|
|
59
|
+
* takes as commission, expressed as a Perbill.
|
|
60
|
+
* - `totalValidatorExposure`: The sum of the validator's and its nominators' stake.
|
|
61
|
+
* - `nominatorExposure`: The amount of stake the nominator has behind the validator.
|
|
62
|
+
*
|
|
63
|
+
* Description:
|
|
64
|
+
* Returns payout information for the last specified eras on the relay chain. If specifying both
|
|
65
|
+
* the depth and era query params, this endpoint will return information for
|
|
66
|
+
* (era - depth) through era. (i.e. if depth=5 and era=20 information will be
|
|
67
|
+
* returned for eras 16 through 20). N.B. You cannot query eras less then
|
|
68
|
+
* `current_era - HISTORY_DEPTH`.
|
|
69
|
+
*
|
|
70
|
+
* N.B. The `nominator*` fields correspond to the address being queried, even if it
|
|
71
|
+
* is a validator's _stash_ address. This is because a validator is technically
|
|
72
|
+
* nominating itself.
|
|
73
|
+
*
|
|
74
|
+
* `payouts` Is an array of payouts for a nominating stash address and information
|
|
75
|
+
* about the validator they were nominating. `eraPayouts` contains an array of
|
|
76
|
+
* objects that has staking reward metadata for each era, and an array of the
|
|
77
|
+
* aformentioned payouts.
|
|
78
|
+
*/
|
|
79
|
+
class RcAccountsStakingPayoutsController extends AbstractController_1.default {
|
|
80
|
+
constructor(_api) {
|
|
81
|
+
var _a;
|
|
82
|
+
const rcApiSpecName = (_a = apiRegistry_1.ApiPromiseRegistry.getSpecNameByType('relay')) === null || _a === void 0 ? void 0 : _a.values();
|
|
83
|
+
const rcSpecName = rcApiSpecName ? Array.from(rcApiSpecName)[0] : undefined;
|
|
84
|
+
if (!rcSpecName) {
|
|
85
|
+
throw new Error('Relay chain API spec name is not defined.');
|
|
86
|
+
}
|
|
87
|
+
super(rcSpecName, '/rc/accounts/:address/staking-payouts', new services_1.AccountsStakingPayoutsService(rcSpecName));
|
|
88
|
+
/**
|
|
89
|
+
* Get the payouts of `address` for `depth` starting from the `era` on the relay chain.
|
|
90
|
+
*
|
|
91
|
+
* @param req Express Request
|
|
92
|
+
* @param res Express Response
|
|
93
|
+
*/
|
|
94
|
+
this.getStakingPayoutsByAccountId = async ({ params: { address }, query: { depth, era, unclaimedOnly, at } }, res) => {
|
|
95
|
+
var _a;
|
|
96
|
+
const rcApi = (_a = apiRegistry_1.ApiPromiseRegistry.getApiByType('relay')[0]) === null || _a === void 0 ? void 0 : _a.api;
|
|
97
|
+
if (!rcApi) {
|
|
98
|
+
throw new Error('Relay chain API not found, please use SAS_SUBSTRATE_MULTI_CHAIN_URL env variable');
|
|
99
|
+
}
|
|
100
|
+
const { specName } = this;
|
|
101
|
+
const isKusama = specName.toString().toLowerCase() === 'kusama';
|
|
102
|
+
let hash = await this.getHashFromAt(at, { api: rcApi });
|
|
103
|
+
let apiAt = await rcApi.at(hash);
|
|
104
|
+
const { eraArg, currentEra } = await this.getEraAndHash(apiAt, this.verifyAndCastOr('era', era, undefined));
|
|
105
|
+
const sanitizedDepth = this.sanitizeDepth({
|
|
106
|
+
isKusama,
|
|
107
|
+
depth: depth === null || depth === void 0 ? void 0 : depth.toString(),
|
|
108
|
+
era: era === null || era === void 0 ? void 0 : era.toString(),
|
|
109
|
+
currentEra,
|
|
110
|
+
});
|
|
111
|
+
if (isKusama && currentEra < 518) {
|
|
112
|
+
const earlyErasBlockInfo = kusamaEarlyErasBlockInfo_json_1.default;
|
|
113
|
+
const block = earlyErasBlockInfo[currentEra].start;
|
|
114
|
+
hash = await this.getHashFromAt(block.toString(), { api: rcApi });
|
|
115
|
+
apiAt = await rcApi.at(hash);
|
|
116
|
+
}
|
|
117
|
+
if (!apiAt.query.staking) {
|
|
118
|
+
throw new http_errors_1.BadRequest('Staking pallet not found for queried runtime');
|
|
119
|
+
}
|
|
120
|
+
// For RC endpoints, we always use the regular fetchAccountStakingPayout method
|
|
121
|
+
// since we're querying the relay chain directly
|
|
122
|
+
const result = await this.service.fetchAccountStakingPayout(hash, address, this.verifyAndCastOr('depth', sanitizedDepth, 1), eraArg, unclaimedOnly === 'false' ? false : true, currentEra, apiAt);
|
|
123
|
+
RcAccountsStakingPayoutsController.sanitizedSend(res, result);
|
|
124
|
+
};
|
|
125
|
+
this.initRoutes();
|
|
126
|
+
}
|
|
127
|
+
initRoutes() {
|
|
128
|
+
this.router.use(this.path, middleware_1.validateAddress, (0, middleware_1.validateBoolean)(['unclaimedOnly']));
|
|
129
|
+
this.safeMountAsyncGetHandlers([['', this.getStakingPayoutsByAccountId]]);
|
|
130
|
+
}
|
|
131
|
+
sanitizeDepth({ isKusama, depth, era, currentEra, }) {
|
|
132
|
+
if (!isKusama)
|
|
133
|
+
return depth;
|
|
134
|
+
if (currentEra <= 519) {
|
|
135
|
+
if (depth !== undefined)
|
|
136
|
+
throw new http_errors_1.InternalServerError('The `depth` query parameter is disabled for eras less than 518.');
|
|
137
|
+
if (era !== undefined)
|
|
138
|
+
throw new http_errors_1.InternalServerError('The `era` query parameter is disabled for eras less than 518.');
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
if (depth) {
|
|
142
|
+
return Math.min(Number(depth), currentEra - 518).toString();
|
|
143
|
+
}
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
async getEraAndHash(apiAt, era) {
|
|
147
|
+
const currentEra = await this.getCurrentEra(apiAt);
|
|
148
|
+
const activeEra = await this.getActiveEra(apiAt, currentEra);
|
|
149
|
+
if (era !== undefined && era > activeEra - 1) {
|
|
150
|
+
throw new http_errors_1.BadRequest(`The specified era (${era}) is too large. Largest era payout info is available for is ${activeEra - 1}`);
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
eraArg: era !== null && era !== void 0 ? era : activeEra - 1,
|
|
154
|
+
currentEra,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
async getCurrentEra(apiAt) {
|
|
158
|
+
const currentEraMaybe = (await apiAt.query.staking.currentEra());
|
|
159
|
+
if (currentEraMaybe instanceof types_1.Option) {
|
|
160
|
+
if (currentEraMaybe.isNone)
|
|
161
|
+
throw new http_errors_1.InternalServerError('CurrentEra is None when Some was expected');
|
|
162
|
+
return currentEraMaybe.unwrap().toNumber();
|
|
163
|
+
}
|
|
164
|
+
if (currentEraMaybe instanceof bn_js_1.default) {
|
|
165
|
+
return currentEraMaybe.toNumber();
|
|
166
|
+
}
|
|
167
|
+
throw new http_errors_1.InternalServerError('Query for current_era returned a non-processable result.');
|
|
168
|
+
}
|
|
169
|
+
async getActiveEra(apiAt, currentEra) {
|
|
170
|
+
if (!apiAt.query.staking.activeEra) {
|
|
171
|
+
const sessionIndex = (await apiAt.query.session.currentIndex()).toNumber();
|
|
172
|
+
return currentEra < 518 || sessionIndex % 6 > 0 ? currentEra : currentEra - 1;
|
|
173
|
+
}
|
|
174
|
+
const activeEraOption = await apiAt.query.staking.activeEra();
|
|
175
|
+
if (activeEraOption.isNone) {
|
|
176
|
+
const historicActiveEra = await apiAt.query.staking.currentEra();
|
|
177
|
+
if (historicActiveEra.isNone)
|
|
178
|
+
throw new http_errors_1.InternalServerError('ActiveEra is None when Some was expected');
|
|
179
|
+
return historicActiveEra.unwrap().toNumber();
|
|
180
|
+
}
|
|
181
|
+
return activeEraOption.unwrap().index.toNumber();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
RcAccountsStakingPayoutsController.controllerName = 'RcAccountsStakingPayouts';
|
|
185
|
+
RcAccountsStakingPayoutsController.requiredPallets = [
|
|
186
|
+
['Staking', 'System'],
|
|
187
|
+
['ParachainStaking', 'ParachainSystem'],
|
|
188
|
+
['ParachainStaking', 'System'],
|
|
189
|
+
['Staking', 'ParachainSystem'],
|
|
190
|
+
];
|
|
191
|
+
exports.default = RcAccountsStakingPayoutsController;
|
|
192
|
+
//# sourceMappingURL=RcAccountsStakingPayoutsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RcAccountsStakingPayoutsController.js","sourceRoot":"","sources":["../../../../../src/controllers/rc/accounts/RcAccountsStakingPayoutsController.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;AAGxE,2CAA8C;AAC9C,kDAAuB;AAEvB,6CAA8D;AAE9D,sDAA0D;AAC1D,oDAAuE;AACvE,gDAAkE;AAElE,6HAAgG;AAEhG,kFAA0D;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAqB,kCAAmC,SAAQ,4BAAiD;IAShH,YAAY,IAAY;;QACvB,MAAM,aAAa,GAAG,MAAA,gCAAkB,CAAC,iBAAiB,CAAC,OAAO,CAAC,0CAAE,MAAM,EAAE,CAAC;QAC9E,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5E,IAAI,CAAC,UAAU,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC9D,CAAC;QACD,KAAK,CAAC,UAAU,EAAE,uCAAuC,EAAE,IAAI,wCAA6B,CAAC,UAAU,CAAC,CAAC,CAAC;QAU3G;;;;;WAKG;QACK,iCAA4B,GAAkC,KAAK,EAC1E,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE,EACjE,GAAG,EACa,EAAE;;YAClB,MAAM,KAAK,GAAG,MAAA,gCAAkB,CAAC,YA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AC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YACpC,MAAM,YAAY,GAAG,CAAC,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC3E,OAAO,UAAU,GAAG,GAAG,IAAI,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC;QAC/E,CAAC;QAED,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QAC9D,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;YAC5B,MAAM,iBAAiB,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACjE,IAAI,iBAAiB,CAAC,MAAM;gBAAE,MAAM,IAAI,iCAAmB,CAAC,0CAA0C,CAAC,CAAC;YACxG,OAAO,iBAAiB,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;QAC9C,CAAC;QAED,OAAO,eAAe,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAClD,CAAC;;AAzJM,iDAAc,GAAG,0BAA0B,AAA7B,CAA8B;AAC5C,kDAAe,GAAG;IACxB,CAAC,SAAS,EAAE,QAAQ,CAAC;IACrB,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;IACvC,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC9B,CAAC,SAAS,EAAE,iBAAiB,CAAC;CAC9B,AALqB,CAKpB;kBAPkB,kCAAkC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AccountsVestingInfoService } from '../../../services';
|
|
2
|
+
import AbstractController from '../../AbstractController';
|
|
3
|
+
/**
|
|
4
|
+
* GET vesting information for an address on the relay chain.
|
|
5
|
+
*
|
|
6
|
+
* Paths:
|
|
7
|
+
* - `address`: Address to query.
|
|
8
|
+
*
|
|
9
|
+
* Query params:
|
|
10
|
+
* - (Optional)`at`: Block at which to retrieve vesting information at. Block
|
|
11
|
+
* identifier, as the block height or block hash. Defaults to most recent block.
|
|
12
|
+
*
|
|
13
|
+
* Returns:
|
|
14
|
+
* - `at`: Block number and hash at which the call was made.
|
|
15
|
+
* - `vesting`: Vesting schedule for an account.
|
|
16
|
+
* - `locked`: Number of tokens locked at start.
|
|
17
|
+
* - `perBlock`: Number of tokens that gets unlocked every block after `startingBlock`.
|
|
18
|
+
* - `startingBlock`: Starting block for unlocking(vesting).
|
|
19
|
+
*
|
|
20
|
+
* Substrate Reference:
|
|
21
|
+
* - Vesting Pallet: https://crates.parity.io/pallet_vesting/index.html
|
|
22
|
+
* - `VestingInfo`: https://crates.parity.io/pallet_vesting/struct.VestingInfo.html
|
|
23
|
+
*/
|
|
24
|
+
export default class RcAccountsVestingInfoController extends AbstractController<AccountsVestingInfoService> {
|
|
25
|
+
static controllerName: string;
|
|
26
|
+
static requiredPallets: string[][];
|
|
27
|
+
constructor(_api: string);
|
|
28
|
+
protected initRoutes(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Get vesting information for an account on the relay chain.
|
|
31
|
+
*
|
|
32
|
+
* @param req Express Request
|
|
33
|
+
* @param res Express Response
|
|
34
|
+
*/
|
|
35
|
+
private getAccountVestingInfo;
|
|
36
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
|
|
3
|
+
// This file is part of Substrate API Sidecar.
|
|
4
|
+
//
|
|
5
|
+
// Substrate API Sidecar is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU General Public License
|
|
16
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const apiRegistry_1 = require("../../../apiRegistry");
|
|
22
|
+
const middleware_1 = require("../../../middleware");
|
|
23
|
+
const services_1 = require("../../../services");
|
|
24
|
+
const AbstractController_1 = __importDefault(require("../../AbstractController"));
|
|
25
|
+
/**
|
|
26
|
+
* GET vesting information for an address on the relay chain.
|
|
27
|
+
*
|
|
28
|
+
* Paths:
|
|
29
|
+
* - `address`: Address to query.
|
|
30
|
+
*
|
|
31
|
+
* Query params:
|
|
32
|
+
* - (Optional)`at`: Block at which to retrieve vesting information at. Block
|
|
33
|
+
* identifier, as the block height or block hash. Defaults to most recent block.
|
|
34
|
+
*
|
|
35
|
+
* Returns:
|
|
36
|
+
* - `at`: Block number and hash at which the call was made.
|
|
37
|
+
* - `vesting`: Vesting schedule for an account.
|
|
38
|
+
* - `locked`: Number of tokens locked at start.
|
|
39
|
+
* - `perBlock`: Number of tokens that gets unlocked every block after `startingBlock`.
|
|
40
|
+
* - `startingBlock`: Starting block for unlocking(vesting).
|
|
41
|
+
*
|
|
42
|
+
* Substrate Reference:
|
|
43
|
+
* - Vesting Pallet: https://crates.parity.io/pallet_vesting/index.html
|
|
44
|
+
* - `VestingInfo`: https://crates.parity.io/pallet_vesting/struct.VestingInfo.html
|
|
45
|
+
*/
|
|
46
|
+
class RcAccountsVestingInfoController extends AbstractController_1.default {
|
|
47
|
+
constructor(_api) {
|
|
48
|
+
var _a;
|
|
49
|
+
const rcApiSpecName = (_a = apiRegistry_1.ApiPromiseRegistry.getSpecNameByType('relay')) === null || _a === void 0 ? void 0 : _a.values();
|
|
50
|
+
const rcSpecName = rcApiSpecName ? Array.from(rcApiSpecName)[0] : undefined;
|
|
51
|
+
if (!rcSpecName) {
|
|
52
|
+
throw new Error('Relay chain API spec name is not defined.');
|
|
53
|
+
}
|
|
54
|
+
super(rcSpecName, '/rc/accounts/:address/vesting-info', new services_1.AccountsVestingInfoService(rcSpecName));
|
|
55
|
+
/**
|
|
56
|
+
* Get vesting information for an account on the relay chain.
|
|
57
|
+
*
|
|
58
|
+
* @param req Express Request
|
|
59
|
+
* @param res Express Response
|
|
60
|
+
*/
|
|
61
|
+
this.getAccountVestingInfo = async ({ params: { address }, query: { at } }, res) => {
|
|
62
|
+
var _a;
|
|
63
|
+
const rcApi = (_a = apiRegistry_1.ApiPromiseRegistry.getApiByType('relay')[0]) === null || _a === void 0 ? void 0 : _a.api;
|
|
64
|
+
if (!rcApi) {
|
|
65
|
+
throw new Error('Relay chain API not found, please use SAS_SUBSTRATE_MULTI_CHAIN_URL env variable');
|
|
66
|
+
}
|
|
67
|
+
const hash = await this.getHashFromAt(at, { api: rcApi });
|
|
68
|
+
const result = await this.service.fetchAccountVestingInfo(hash, address);
|
|
69
|
+
RcAccountsVestingInfoController.sanitizedSend(res, result);
|
|
70
|
+
};
|
|
71
|
+
this.initRoutes();
|
|
72
|
+
}
|
|
73
|
+
initRoutes() {
|
|
74
|
+
this.router.use(this.path, middleware_1.validateAddress);
|
|
75
|
+
this.safeMountAsyncGetHandlers([['', this.getAccountVestingInfo]]);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
RcAccountsVestingInfoController.controllerName = 'RcAccountsVestingInfo';
|
|
79
|
+
RcAccountsVestingInfoController.requiredPallets = [['Vesting'], ['CalamariVesting']];
|
|
80
|
+
exports.default = RcAccountsVestingInfoController;
|
|
81
|
+
//# sourceMappingURL=RcAccountsVestingInfoController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RcAccountsVestingInfoController.js","sourceRoot":"","sources":["../../../../../src/controllers/rc/accounts/RcAccountsVestingInfoController.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;AAKxE,sDAA0D;AAC1D,oDAAsD;AACtD,gDAA+D;AAC/D,kFAA0D;AAE1D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAqB,+BAAgC,SAAQ,4BAA8C;IAI1G,YAAY,IAAY;;QACvB,MAAM,aAAa,GAAG,MAAA,gCAAkB,CAAC,iBAAiB,CAAC,OAAO,CAAC,0CAAE,MAAM,EAAE,CAAC;QAC9E,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5E,IAAI,CAAC,UAAU,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC9D,CAAC;QACD,KAAK,CAAC,UAAU,EAAE,oCAAoC,EAAE,IAAI,qCAA0B,CAAC,UAAU,CAAC,CAAC,CAAC;QAUrG;;;;;WAKG;QACK,0BAAqB,GAAkC,KAAK,EACnE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EACtC,GAAG,EACa,EAAE;;YAClB,MAAM,KAAK,GAAG,MAAA,gCAAkB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,0CAAE,GAAG,CAAC;YAE/D,IAAI,CAAC,KAAK,EAAE,CAAC;gBACZ,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;YACrG,CAAC;YAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;YAC1D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAEzE,+BAA+B,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC5D,CAAC,CAAC;QA7BD,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;IAES,UAAU;QACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,4BAAe,CAAC,CAAC;QAE5C,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC;;AAjBM,8CAAc,GAAG,uBAAuB,AAA1B,CAA2B;AACzC,+CAAe,GAAG,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,AAArC,CAAsC;kBAFxC,+BAA+B"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export { default as RcAccountsBalanceInfo } from './RcAccountsBalanceInfoController';
|
|
2
2
|
export { default as RcAccountsProxyInfo } from './RcAccountsProxyInfoController';
|
|
3
|
+
export { default as RcAccountsStakingInfo } from './RcAccountsStakingInfoController';
|
|
4
|
+
export { default as RcAccountsStakingPayouts } from './RcAccountsStakingPayoutsController';
|
|
5
|
+
export { default as RcAccountsVestingInfo } from './RcAccountsVestingInfoController';
|
|
@@ -18,9 +18,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.RcAccountsProxyInfo = exports.RcAccountsBalanceInfo = void 0;
|
|
21
|
+
exports.RcAccountsVestingInfo = exports.RcAccountsStakingPayouts = exports.RcAccountsStakingInfo = exports.RcAccountsProxyInfo = exports.RcAccountsBalanceInfo = void 0;
|
|
22
22
|
var RcAccountsBalanceInfoController_1 = require("./RcAccountsBalanceInfoController");
|
|
23
23
|
Object.defineProperty(exports, "RcAccountsBalanceInfo", { enumerable: true, get: function () { return __importDefault(RcAccountsBalanceInfoController_1).default; } });
|
|
24
24
|
var RcAccountsProxyInfoController_1 = require("./RcAccountsProxyInfoController");
|
|
25
25
|
Object.defineProperty(exports, "RcAccountsProxyInfo", { enumerable: true, get: function () { return __importDefault(RcAccountsProxyInfoController_1).default; } });
|
|
26
|
+
var RcAccountsStakingInfoController_1 = require("./RcAccountsStakingInfoController");
|
|
27
|
+
Object.defineProperty(exports, "RcAccountsStakingInfo", { enumerable: true, get: function () { return __importDefault(RcAccountsStakingInfoController_1).default; } });
|
|
28
|
+
var RcAccountsStakingPayoutsController_1 = require("./RcAccountsStakingPayoutsController");
|
|
29
|
+
Object.defineProperty(exports, "RcAccountsStakingPayouts", { enumerable: true, get: function () { return __importDefault(RcAccountsStakingPayoutsController_1).default; } });
|
|
30
|
+
var RcAccountsVestingInfoController_1 = require("./RcAccountsVestingInfoController");
|
|
31
|
+
Object.defineProperty(exports, "RcAccountsVestingInfo", { enumerable: true, get: function () { return __importDefault(RcAccountsVestingInfoController_1).default; } });
|
|
26
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/controllers/rc/accounts/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;;AAExE,qFAAqF;AAA5E,yJAAA,OAAO,OAAyB;AACzC,iFAAiF;AAAxE,qJAAA,OAAO,OAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/controllers/rc/accounts/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;;AAExE,qFAAqF;AAA5E,yJAAA,OAAO,OAAyB;AACzC,iFAAiF;AAAxE,qJAAA,OAAO,OAAuB;AACvC,qFAAqF;AAA5E,yJAAA,OAAO,OAAyB;AACzC,2FAA2F;AAAlF,+JAAA,OAAO,OAA4B;AAC5C,qFAAqF;AAA5E,yJAAA,OAAO,OAAyB"}
|
|
@@ -104,7 +104,7 @@ class RcPalletsStakingProgressController extends AbstractController_1.default {
|
|
|
104
104
|
throw new Error('Relay chain API not found, please use SAS_SUBSTRATE_MULTI_CHAIN_URL env variable');
|
|
105
105
|
}
|
|
106
106
|
const hash = await this.getHashFromAt(at);
|
|
107
|
-
const result = await this.service.derivePalletStakingProgress(hash);
|
|
107
|
+
const result = await this.service.derivePalletStakingProgress(hash, { isRcCall: true });
|
|
108
108
|
RcPalletsStakingProgressController.sanitizedSend(res, result);
|
|
109
109
|
};
|
|
110
110
|
this.initRoutes();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RcPalletsStakingProgressController.js","sourceRoot":"","sources":["../../../../../src/controllers/rc/pallets/RcPalletsStakingProgressController.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE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D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;YAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YACxF,kCAAkC,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC,CAAC;QAvBD,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;IAES,UAAU;QACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,+BAAkB,CAAC,CAAC;QAC/C,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC;;AAlBM,iDAAc,GAAG,0BAA0B,AAA7B,CAA8B;AAC5C,kDAAe,GAAG;IACxB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC;IAC9B,CAAC,kBAAkB,EAAE,SAAS,CAAC;CAC/B,AAHqB,CAGpB;kBALkB,kCAAkC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { BlockHash } from '@polkadot/types/interfaces';
|
|
2
2
|
import { IPalletStakingProgress } from 'src/types/responses';
|
|
3
3
|
import { AbstractService } from '../AbstractService';
|
|
4
|
+
interface IStakingProgressOptions {
|
|
5
|
+
isRcCall?: boolean;
|
|
6
|
+
}
|
|
4
7
|
export declare class PalletsStakingProgressService extends AbstractService {
|
|
5
8
|
/**
|
|
6
9
|
* Fetch and derive generalized staking information at a given block.
|
|
7
10
|
*
|
|
8
11
|
* @param hash `BlockHash` to make call at
|
|
9
12
|
*/
|
|
10
|
-
derivePalletStakingProgress(hash: BlockHash): Promise<IPalletStakingProgress>;
|
|
13
|
+
derivePalletStakingProgress(hash: BlockHash, options?: IStakingProgressOptions): Promise<IPalletStakingProgress>;
|
|
11
14
|
/**
|
|
12
15
|
* Derive session and era progress for Asset Hub using time-based BABE calculations
|
|
13
16
|
*
|
|
@@ -83,3 +86,4 @@ export declare class PalletsStakingProgressService extends AbstractService {
|
|
|
83
86
|
*/
|
|
84
87
|
private calculateSessionIndexFromSkippedEpochs;
|
|
85
88
|
}
|
|
89
|
+
export {};
|
|
@@ -30,11 +30,9 @@ class PalletsStakingProgressService extends AbstractService_1.AbstractService {
|
|
|
30
30
|
*
|
|
31
31
|
* @param hash `BlockHash` to make call at
|
|
32
32
|
*/
|
|
33
|
-
async derivePalletStakingProgress(hash) {
|
|
33
|
+
async derivePalletStakingProgress(hash, options = {}) {
|
|
34
34
|
var _a;
|
|
35
|
-
const { api
|
|
36
|
-
const apiType = apiRegistry_1.ApiPromiseRegistry.getTypeBySpecName(specName);
|
|
37
|
-
const isApiAssetHub = apiType === 'assethub';
|
|
35
|
+
const { api } = this;
|
|
38
36
|
const RCApiPromise = this.assetHubInfo.isAssetHub ? apiRegistry_1.ApiPromiseRegistry.getApiByType('relay') : null;
|
|
39
37
|
if (this.assetHubInfo.isAssetHub && !(RCApiPromise === null || RCApiPromise === void 0 ? void 0 : RCApiPromise.length)) {
|
|
40
38
|
throw new Error('Relay chain API not found');
|
|
@@ -43,7 +41,7 @@ class PalletsStakingProgressService extends AbstractService_1.AbstractService {
|
|
|
43
41
|
if (historicApi.query.staking === undefined) {
|
|
44
42
|
throw new Error('Staking pallet not found for queried runtime');
|
|
45
43
|
}
|
|
46
|
-
const sessionValidators = this.assetHubInfo.isAssetHub &&
|
|
44
|
+
const sessionValidators = this.assetHubInfo.isAssetHub && !options.isRcCall
|
|
47
45
|
? RCApiPromise[0].api.query.session.validators
|
|
48
46
|
: historicApi.query.session.validators;
|
|
49
47
|
if (!sessionValidators) {
|
|
@@ -66,7 +64,7 @@ class PalletsStakingProgressService extends AbstractService_1.AbstractService {
|
|
|
66
64
|
eraElectionPromise = await historicApi.query.staking.eraElectionStatus();
|
|
67
65
|
}
|
|
68
66
|
let deriveSessionAndEra;
|
|
69
|
-
if (this.assetHubInfo.isAssetHub && this.assetHubInfo.isAssetHubMigrated &&
|
|
67
|
+
if (this.assetHubInfo.isAssetHub && this.assetHubInfo.isAssetHubMigrated && !options.isRcCall) {
|
|
70
68
|
deriveSessionAndEra = this.deriveSessionAndEraProgressAssetHub(historicApi, RCApiPromise === null || RCApiPromise === void 0 ? void 0 : RCApiPromise[0].api);
|
|
71
69
|
}
|
|
72
70
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PalletsStakingProgressService.js","sourceRoot":"","sources":["../../../../src/services/pallets/PalletsStakingProgressService.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;;AAOxE,kDAAuB;AACvB,6CAAkD;AAGlD,0DAA8D;AAC9D,uDAAqD;AACrD,wDAAqD;
|
|
1
|
+
{"version":3,"file":"PalletsStakingProgressService.js","sourceRoot":"","sources":["../../../../src/services/pallets/PalletsStakingProgressService.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;;AAOxE,kDAAuB;AACvB,6CAAkD;AAGlD,0DAA8D;AAC9D,uDAAqD;AACrD,wDAAqD;AAMrD,MAAa,6BAA8B,SAAQ,iCAAe;IACjE;;;;OAIG;IACH,KAAK,CAAC,2BAA2B,CAChC,IAAe,EACf,UAAmC,EAAE;;QAErC,MAAM,EAAE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QAED,gEAAgE;QAChE,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;QACrE,MAAM,eAAe,GAAG,iBAAiB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACnE,mEAAmE;QACnE,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAErD,OAAO,YAAY,CAAC;IACrB,CAAC;CACD;AAnWD,sEAmWC"}
|
|
@@ -33,7 +33,7 @@ class PalletsStakingValidatorsService extends AbstractService_1.AbstractService
|
|
|
33
33
|
// for the incoming era.
|
|
34
34
|
const validatorsToBeChilled = [];
|
|
35
35
|
const validatorsActiveSet = await this.getActiveValidators(historicApi);
|
|
36
|
-
validatorsEntries.map(([key]) => {
|
|
36
|
+
validatorsEntries.map(([key, prefs]) => {
|
|
37
37
|
const address = key.args.map((k) => k.toString())[0];
|
|
38
38
|
let status;
|
|
39
39
|
if (validatorsActiveSet.has(address)) {
|
|
@@ -43,8 +43,15 @@ class PalletsStakingValidatorsService extends AbstractService_1.AbstractService
|
|
|
43
43
|
else {
|
|
44
44
|
status = 'waiting';
|
|
45
45
|
}
|
|
46
|
-
validators.push({
|
|
46
|
+
validators.push({
|
|
47
|
+
address,
|
|
48
|
+
status,
|
|
49
|
+
commission: prefs.commission ? prefs.commission.unwrap().toString() : undefined,
|
|
50
|
+
blocked: prefs.blocked ? prefs.blocked.isTrue : false,
|
|
51
|
+
});
|
|
47
52
|
});
|
|
53
|
+
// Any validators remaining in validatorsActiveSet are active in the current session
|
|
54
|
+
// but don't have entries in staking.validators, which means they're being chilled
|
|
48
55
|
if (validatorsActiveSet.size > 0) {
|
|
49
56
|
validatorsActiveSet.forEach((address) => {
|
|
50
57
|
validators.push({ address, status: 'active' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PalletsStakingValidatorsService.js","sourceRoot":"","sources":["../../../../src/services/pallets/PalletsStakingValidatorsService.ts"],"names":[],"mappings":";;;AAoBA,wDAAqD;AAErD,MAAa,+BAAgC,SAAQ,iCAAe;IACnE;;;;;;;OAOG;IACH,KAAK,CAAC,6BAA6B,CAAC,IAAe;QAClD,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACrB,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QAEvC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,iBAAiB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACzD,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;YAC7B,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE;SAC9C,CAAC,CAAC;QAEH,MAAM,EAAE,GAAG;YACV,IAAI;YACJ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;SACpC,CAAC;QAEF,mEAAmE;QACnE,oEAAoE;QACpE,mDAAmD;QACnD,MAAM,UAAU,GAAiB,EAAE,CAAC;QACpC,uEAAuE;QACvE,wBAAwB;QACxB,MAAM,qBAAqB,GAAiB,EAAE,CAAC;QAC/C,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;QAExE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"PalletsStakingValidatorsService.js","sourceRoot":"","sources":["../../../../src/services/pallets/PalletsStakingValidatorsService.ts"],"names":[],"mappings":";;;AAoBA,wDAAqD;AAErD,MAAa,+BAAgC,SAAQ,iCAAe;IACnE;;;;;;;OAOG;IACH,KAAK,CAAC,6BAA6B,CAAC,I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C,UAAU,EAAE,CAAC;gBACtE,IAAI,gBAAgB,CAAC,MAAM;oBAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;gBACnF,SAAS,GAAG,gBAAgB,CAAC,MAAM,EAAE,CAAC;YACvC,CAAC;iBAAM,CAAC;gBACP,SAAS,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC;YAC5C,CAAC;YAED,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACjF,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACzE,CAAC;aAAM,CAAC;YACP,MAAM,gBAAgB,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YAEtE,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;gBACxC,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC7C,CAAC;QACF,CAAC;QAED,OAAO,mBAAmB,CAAC;IAC5B,CAAC;CACD;AAtGD,0EAsGC"}
|
|
@@ -10,6 +10,15 @@ export interface IValidator {
|
|
|
10
10
|
* `waiting` means that the validator did not get into the active set this era.
|
|
11
11
|
*/
|
|
12
12
|
status: string;
|
|
13
|
+
/**
|
|
14
|
+
* The validator's commission rate as a percentage string (e.g., "1000000000" for 100%).
|
|
15
|
+
* This field represents the commission the validator takes from staking rewards.
|
|
16
|
+
*/
|
|
17
|
+
commission?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the validator is blocked from receiving new nominations.
|
|
20
|
+
*/
|
|
21
|
+
blocked?: boolean;
|
|
13
22
|
}
|
|
14
23
|
export interface IPalletStakingValidator {
|
|
15
24
|
at: IAt;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "20.
|
|
2
|
+
"version": "20.7.1",
|
|
3
3
|
"name": "@substrate/api-sidecar",
|
|
4
4
|
"description": "REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.",
|
|
5
5
|
"homepage": "https://github.com/paritytech/substrate-api-sidecar#readme",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"build:calc": "bash ./calc/build.sh",
|
|
32
32
|
"build:docker": "docker build -t substrate-api-sidecar .",
|
|
33
33
|
"build:docs": "(cd docs && yarn && yarn build)",
|
|
34
|
+
"build:docsv2": "(cd docs-v2 && yarn && yarn build)",
|
|
34
35
|
"build:scripts": "substrate-exec-rimraf scripts/build/ && substrate-exec-tsc --project scripts/tsconfig.json",
|
|
35
36
|
"build:e2e-tests": "substrate-exec-rimraf e2e-tests/build/ && substrate-exec-tsc --project e2e-tests/tsconfig.json",
|
|
36
37
|
"bench": "yarn build:scripts && node scripts/build/runBenchmarks.js",
|