@jpool/bond-sdk 0.0.1-next.0

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.
@@ -0,0 +1,96 @@
1
+ import type { BN } from '@coral-xyz/anchor'
2
+ import type { PublicKey } from '@solana/web3.js'
3
+
4
+ export type Config = {
5
+ rpcUrl: string
6
+ programId: PublicKey
7
+ reserveAddress: PublicKey
8
+ }
9
+
10
+ export type ValidatorBondAccount = {
11
+ identity: PublicKey
12
+ voteAccount: PublicKey
13
+ withdrawalAuthority?: string
14
+ totalWithdrawn: number
15
+ lastWithdrawalEpoch: number
16
+ isActive: boolean
17
+ createdAt: number
18
+ bump: number
19
+ }
20
+
21
+ export type InitializeProps = {
22
+ authority: PublicKey
23
+ }
24
+
25
+ export type RegisterValidatorProps = {
26
+ creator: PublicKey
27
+ identity: PublicKey
28
+ voteAccount: PublicKey
29
+ initialCollateral: number
30
+ withdrawalAuthority?: PublicKey
31
+ }
32
+
33
+ export type TopUpCollateralProps = {
34
+ user: PublicKey
35
+ voteAccount: PublicKey
36
+ amount: number
37
+ }
38
+
39
+ export type WithdrawCollateralProps = {
40
+ withdrawalAuthority: PublicKey
41
+ voteAccount: PublicKey
42
+ destination: PublicKey
43
+ amount: number
44
+ }
45
+
46
+ export type WithdrawCompensationProps = {
47
+ authority: PublicKey
48
+ voteAccount: PublicKey
49
+ amount: number
50
+ }
51
+
52
+ export type GetHistoryProps = {
53
+ voteAccount: PublicKey
54
+ options?: {
55
+ limit?: number
56
+ before?: string
57
+ until?: string
58
+ }
59
+ }
60
+
61
+ export type GetHistoryGroupedProps = {
62
+ voteAccount: PublicKey
63
+ epochsCount?: number
64
+ }
65
+
66
+ export type GlobalState = {
67
+ authority: PublicKey
68
+ totalValidators: number
69
+ totalCollateral: BN
70
+ totalWithdrawn: BN
71
+ bump: number
72
+ }
73
+
74
+ export type EpochHistoryItem = {
75
+ epoch: number
76
+ deposits: number
77
+ withdrawals: number
78
+ balanceChange: number
79
+ signatures: string[]
80
+ }
81
+
82
+ export type TransactionHistoryItem = {
83
+ signature: string
84
+ slot: number
85
+ epoch: number
86
+ type: BondTransactionType
87
+ amount: number
88
+ beforeBalance?: number
89
+ afterBalance?: number
90
+ }
91
+
92
+ export enum BondTransactionType {
93
+ Deposit = 'deposit',
94
+ Withdrawal = 'withdrawal',
95
+ Compensation = 'compensation',
96
+ }