Skip to content

Commit b49e619

Browse files
Merge pull request #395 from blockfrost/feat/drep-exp
feat: DRep expiration and last active epoch
2 parents 2f69bd5 + c465de9 commit b49e619

8 files changed

Lines changed: 154 additions & 13 deletions

File tree

blockfrost-openapi.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6358,27 +6358,45 @@ components:
63586358
active:
63596359
type: boolean
63606360
description: Registration state of the DRep
6361+
deprecated: true
63616362
active_epoch:
63626363
type: integer
63636364
nullable: true
6364-
description: Epoch of the most recent action - registration or deregistration
6365+
description: Epoch of the most recent registration
6366+
deprecated: true
63656367
has_script:
63666368
type: boolean
63676369
description: Flag which shows if this DRep credentials are a script hash
6370+
retired:
6371+
type: boolean
6372+
description: Indicates the registration state of the DRep. Set to `true` if the DRep has been deregistered; otherwise, `false`.
6373+
expired:
6374+
type: boolean
6375+
description: Indicates whether the DRep has been inactive for a consecutive number of epochs (determined by a epoch parameter `drep_activity`)
6376+
last_active_epoch:
6377+
type: integer
6378+
nullable: true
6379+
description: Epoch of the most recent action - registration, update, deregistration or voting
63686380
required:
63696381
- drep_id
63706382
- hex
63716383
- amount
63726384
- active
63736385
- active_epoch
63746386
- has_script
6387+
- retired
6388+
- expired
6389+
- last_active_epoch
63756390
example:
63766391
drep_id: drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc
63776392
hex: a61261172624e8333ceff098648d90f8e404e2e36d5b5f5985cbd35d
63786393
amount: '2000000'
63796394
active: true
63806395
active_epoch: 420
63816396
has_script: true
6397+
last_active_epoch: 509
6398+
retired: false
6399+
expired: false
63826400
drep_delegators:
63836401
type: array
63846402
items:

docs/blockfrost-openapi.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6663,27 +6663,51 @@ components:
66636663
active:
66646664
type: boolean
66656665
description: Registration state of the DRep
6666+
deprecated: true
66666667
active_epoch:
66676668
type: integer
66686669
nullable: true
6669-
description: Epoch of the most recent action - registration or deregistration
6670+
description: Epoch of the most recent registration
6671+
deprecated: true
66706672
has_script:
66716673
type: boolean
66726674
description: Flag which shows if this DRep credentials are a script hash
6675+
retired:
6676+
type: boolean
6677+
description: >-
6678+
Indicates the registration state of the DRep. Set to `true` if the
6679+
DRep has been deregistered; otherwise, `false`.
6680+
expired:
6681+
type: boolean
6682+
description: >-
6683+
Indicates whether the DRep has been inactive for a consecutive
6684+
number of epochs (determined by a epoch parameter `drep_activity`)
6685+
last_active_epoch:
6686+
type: integer
6687+
nullable: true
6688+
description: >-
6689+
Epoch of the most recent action - registration, update,
6690+
deregistration or voting
66736691
required:
66746692
- drep_id
66756693
- hex
66766694
- amount
66776695
- active
66786696
- active_epoch
66796697
- has_script
6698+
- retired
6699+
- expired
6700+
- last_active_epoch
66806701
example:
66816702
drep_id: drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc
66826703
hex: a61261172624e8333ceff098648d90f8e404e2e36d5b5f5985cbd35d
66836704
amount: '2000000'
66846705
active: true
66856706
active_epoch: 420
66866707
has_script: true
6708+
last_active_epoch: 509
6709+
retired: false
6710+
expired: false
66876711
drep_delegators:
66886712
type: array
66896713
items:

json-schema.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

openapi.json

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8698,16 +8698,31 @@
86988698
},
86998699
"active": {
87008700
"type": "boolean",
8701-
"description": "Registration state of the DRep"
8701+
"description": "Registration state of the DRep",
8702+
"deprecated": true
87028703
},
87038704
"active_epoch": {
87048705
"type": "integer",
87058706
"nullable": true,
8706-
"description": "Epoch of the most recent action - registration or deregistration"
8707+
"description": "Epoch of the most recent registration",
8708+
"deprecated": true
87078709
},
87088710
"has_script": {
87098711
"type": "boolean",
87108712
"description": "Flag which shows if this DRep credentials are a script hash"
8713+
},
8714+
"retired": {
8715+
"type": "boolean",
8716+
"description": "Indicates the registration state of the DRep. Set to `true` if the DRep has been deregistered; otherwise, `false`."
8717+
},
8718+
"expired": {
8719+
"type": "boolean",
8720+
"description": "Indicates whether the DRep has been inactive for a consecutive number of epochs (determined by a epoch parameter `drep_activity`)"
8721+
},
8722+
"last_active_epoch": {
8723+
"type": "integer",
8724+
"nullable": true,
8725+
"description": "Epoch of the most recent action - registration, update, deregistration or voting"
87118726
}
87128727
},
87138728
"required": [
@@ -8716,15 +8731,21 @@
87168731
"amount",
87178732
"active",
87188733
"active_epoch",
8719-
"has_script"
8734+
"has_script",
8735+
"retired",
8736+
"expired",
8737+
"last_active_epoch"
87208738
],
87218739
"example": {
87228740
"drep_id": "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc",
87238741
"hex": "a61261172624e8333ceff098648d90f8e404e2e36d5b5f5985cbd35d",
87248742
"amount": "2000000",
87258743
"active": true,
87268744
"active_epoch": 420,
8727-
"has_script": true
8745+
"has_script": true,
8746+
"last_active_epoch": 509,
8747+
"retired": false,
8748+
"expired": false
87288749
}
87298750
},
87308751
"drep_delegators": {

openapi.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6663,27 +6663,51 @@ components:
66636663
active:
66646664
type: boolean
66656665
description: Registration state of the DRep
6666+
deprecated: true
66666667
active_epoch:
66676668
type: integer
66686669
nullable: true
6669-
description: Epoch of the most recent action - registration or deregistration
6670+
description: Epoch of the most recent registration
6671+
deprecated: true
66706672
has_script:
66716673
type: boolean
66726674
description: Flag which shows if this DRep credentials are a script hash
6675+
retired:
6676+
type: boolean
6677+
description: >-
6678+
Indicates the registration state of the DRep. Set to `true` if the
6679+
DRep has been deregistered; otherwise, `false`.
6680+
expired:
6681+
type: boolean
6682+
description: >-
6683+
Indicates whether the DRep has been inactive for a consecutive
6684+
number of epochs (determined by a epoch parameter `drep_activity`)
6685+
last_active_epoch:
6686+
type: integer
6687+
nullable: true
6688+
description: >-
6689+
Epoch of the most recent action - registration, update,
6690+
deregistration or voting
66736691
required:
66746692
- drep_id
66756693
- hex
66766694
- amount
66776695
- active
66786696
- active_epoch
66796697
- has_script
6698+
- retired
6699+
- expired
6700+
- last_active_epoch
66806701
example:
66816702
drep_id: drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc
66826703
hex: a61261172624e8333ceff098648d90f8e404e2e36d5b5f5985cbd35d
66836704
amount: '2000000'
66846705
active: true
66856706
active_epoch: 420
66866707
has_script: true
6708+
last_active_epoch: 509
6709+
retired: false
6710+
expired: false
66876711
drep_delegators:
66886712
type: array
66896713
items:

src/generated-types.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6739,7 +6739,10 @@ export interface components {
67396739
* "amount": "2000000",
67406740
* "active": true,
67416741
* "active_epoch": 420,
6742-
* "has_script": true
6742+
* "has_script": true,
6743+
* "last_active_epoch": 509,
6744+
* "retired": false,
6745+
* "expired": false
67436746
* } */
67446747
drep: {
67456748
/** @description Bech32 encoded DRep address */
@@ -6748,12 +6751,24 @@ export interface components {
67486751
hex: string;
67496752
/** @description The total amount of voting power this DRep is delegated. */
67506753
amount: string;
6751-
/** @description Registration state of the DRep */
6754+
/**
6755+
* @deprecated
6756+
* @description Registration state of the DRep
6757+
*/
67526758
active: boolean;
6753-
/** @description Epoch of the most recent action - registration or deregistration */
6759+
/**
6760+
* @deprecated
6761+
* @description Epoch of the most recent registration
6762+
*/
67546763
active_epoch: number | null;
67556764
/** @description Flag which shows if this DRep credentials are a script hash */
67566765
has_script: boolean;
6766+
/** @description Indicates the registration state of the DRep. Set to `true` if the DRep has been deregistered; otherwise, `false`. */
6767+
retired: boolean;
6768+
/** @description Indicates whether the DRep has been inactive for a consecutive number of epochs (determined by a epoch parameter `drep_activity`) */
6769+
expired: boolean;
6770+
/** @description Epoch of the most recent action - registration, update, deregistration or voting */
6771+
last_active_epoch: number | null;
67576772
};
67586773
/** @example [
67596774
* {

src/schemas/governance/drep.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,25 @@ properties:
1212
active:
1313
type: boolean
1414
description: Registration state of the DRep
15+
deprecated: true
1516
active_epoch:
1617
type: integer
1718
nullable: true
18-
description: Epoch of the most recent action - registration or deregistration
19+
description: Epoch of the most recent registration
20+
deprecated: true
1921
has_script:
2022
type: boolean
2123
description: Flag which shows if this DRep credentials are a script hash
24+
retired:
25+
type: boolean
26+
description: Indicates the registration state of the DRep. Set to `true` if the DRep has been deregistered; otherwise, `false`.
27+
expired:
28+
type: boolean
29+
description: Indicates whether the DRep has been inactive for a consecutive number of epochs (determined by a epoch parameter `drep_activity`)
30+
last_active_epoch:
31+
type: integer
32+
nullable: true
33+
description: Epoch of the most recent action - registration, update, deregistration or voting
2234

2335
required:
2436
- drep_id
@@ -27,10 +39,16 @@ required:
2739
- active
2840
- active_epoch
2941
- has_script
42+
- retired
43+
- expired
44+
- last_active_epoch
3045
example:
3146
drep_id: drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc
3247
hex: a61261172624e8333ceff098648d90f8e404e2e36d5b5f5985cbd35d
3348
amount: "2000000"
3449
active: true
3550
active_epoch: 420
3651
has_script: true
52+
last_active_epoch: 509
53+
retired: false
54+
expired: false

test/tests/__snapshots__/get-schema-for-endpoint.test.ts.snap

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10936,16 +10936,21 @@ under which it is valid
1093610936
"active_epoch": 420,
1093710937
"amount": "2000000",
1093810938
"drep_id": "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc",
10939+
"expired": false,
1093910940
"has_script": true,
1094010941
"hex": "a61261172624e8333ceff098648d90f8e404e2e36d5b5f5985cbd35d",
10942+
"last_active_epoch": 509,
10943+
"retired": false,
1094110944
},
1094210945
"properties": {
1094310946
"active": {
10947+
"deprecated": true,
1094410948
"description": "Registration state of the DRep",
1094510949
"type": "boolean",
1094610950
},
1094710951
"active_epoch": {
10948-
"description": "Epoch of the most recent action - registration or deregistration",
10952+
"deprecated": true,
10953+
"description": "Epoch of the most recent registration",
1094910954
"nullable": true,
1095010955
"type": "integer",
1095110956
},
@@ -10957,6 +10962,10 @@ under which it is valid
1095710962
"description": "Bech32 encoded DRep address",
1095810963
"type": "string",
1095910964
},
10965+
"expired": {
10966+
"description": "Indicates whether the DRep has been inactive for a consecutive number of epochs (determined by a epoch parameter \`drep_activity\`)",
10967+
"type": "boolean",
10968+
},
1096010969
"has_script": {
1096110970
"description": "Flag which shows if this DRep credentials are a script hash",
1096210971
"type": "boolean",
@@ -10965,6 +10974,15 @@ under which it is valid
1096510974
"description": "The raw bytes of the DRep",
1096610975
"type": "string",
1096710976
},
10977+
"last_active_epoch": {
10978+
"description": "Epoch of the most recent action - registration, update, deregistration or voting",
10979+
"nullable": true,
10980+
"type": "integer",
10981+
},
10982+
"retired": {
10983+
"description": "Indicates the registration state of the DRep. Set to \`true\` if the DRep has been deregistered; otherwise, \`false\`.",
10984+
"type": "boolean",
10985+
},
1096810986
},
1096910987
"required": [
1097010988
"drep_id",
@@ -10973,6 +10991,9 @@ under which it is valid
1097310991
"active",
1097410992
"active_epoch",
1097510993
"has_script",
10994+
"retired",
10995+
"expired",
10996+
"last_active_epoch",
1097610997
],
1097710998
"type": "object",
1097810999
},

0 commit comments

Comments
 (0)