Skip to content

Commit

Permalink
add - adding typescript defs for cert objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Eric Bassett committed Aug 3, 2020
1 parent dd33734 commit 92aa631
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions src/Transactions/types.ts
Expand Up @@ -14,6 +14,7 @@ export interface TransactionFrag {
outputs: TransOutputFrag[]; // technically a TransactionOutput fragment
txIndex: number;
withdrawals: TransOutputFrag[];
certificates: Certificate[];
}
export interface BlockFrag {
number: number;
Expand All @@ -32,3 +33,59 @@ export interface TransOutputFrag {
address: string;
amount: string;
}

export type Certificate = StakeRegistration | StakeDeregistration | StakeDelegation | PoolRegistration | PoolRetirement | MoveInstantaneousRewardsCert;

export interface StakeRegistration {
kind: "StakeRegistration";
stakeCredential: string;
}
export interface StakeDeregistration{
kind: "StakeDeregistration";
stakeCredential: string;
}
export interface StakeDelegation{
kind: "StakeDelegation";
stakeCredential: string;
poolKeyHash: string;
}
export interface PoolRegistration{
kind: "PoolRegistration";
poolParams: PoolParams;
}
export interface PoolRetirement{
kind: "PoolRetirement";
poolKeyHash: string;
epoch: number;

}
export interface MoveInstantaneousRewardsCert{
kind: "MoveInstantaneousRewardsCert";
pot: "Reserve" | "Treasury";
rewards: string[];
}

export interface PoolParams {
operator: string;
vrfKeyHash: string
pledge: string;
cost: string;
margin: number;
rewardAccount: string;
poolOwners: string[];
relays: PoolRelay[];
poolMetadata: null | PoolMetadata;
}

export interface PoolMetadata {
url: string;
metadataHash: string;
}

export interface PoolRelay {
ipv4: string;
ipv6: string;
dnsName: string;
dnsSrvName: string
port: string;
}

0 comments on commit 92aa631

Please sign in to comment.