@jpool/bond-sdk 0.9.0-next.0 → 0.9.0-next.10
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/dist/index.d.mts +1224 -618
- package/dist/index.d.ts +1224 -618
- package/dist/index.js +6050 -557
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6019 -561
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PublicKey,
|
|
3
|
-
import
|
|
1
|
+
import { Fee } from '@solana/spl-stake-pool/src/layouts';
|
|
2
|
+
import { PublicKey, TransactionInstruction, Connection, PublicKeyInitData, Transaction, VersionedTransaction, Keypair } from '@solana/web3.js';
|
|
3
|
+
import BN from 'bn.js';
|
|
4
|
+
import { IdlTypes, IdlAccounts, Program, Provider } from '@coral-xyz/anchor';
|
|
5
|
+
|
|
6
|
+
type StakePoolManager = {
|
|
7
|
+
stakePoolAddress: PublicKey;
|
|
8
|
+
depositSol: (lamports: BN) => TransactionInstruction;
|
|
9
|
+
withdrawSol: (poolTokens: BN) => TransactionInstruction;
|
|
10
|
+
readonly exchangeRate: number;
|
|
11
|
+
readonly withdrawSolFee: Fee;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
declare const JPOOL_STAKE_POOL: PublicKey;
|
|
15
|
+
declare enum Seeds {
|
|
16
|
+
GlobalState = "global_state",
|
|
17
|
+
BondState = "bond_state",
|
|
18
|
+
ValidatorBond = "validator_bond",
|
|
19
|
+
PerformanceBond = "performance",
|
|
20
|
+
CrowdFundingBond = "crowdfunding"
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Program IDs for different environments
|
|
24
|
+
*/
|
|
25
|
+
declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
4
26
|
|
|
5
27
|
/**
|
|
6
28
|
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
@@ -9,71 +31,50 @@ import { BN, AnchorProvider, Program } from '@coral-xyz/anchor';
|
|
|
9
31
|
* IDL can be found at `target/idl/jbond.json`.
|
|
10
32
|
*/
|
|
11
33
|
type Jbond = {
|
|
12
|
-
address:
|
|
13
|
-
metadata: {
|
|
14
|
-
name:
|
|
15
|
-
version:
|
|
16
|
-
spec:
|
|
17
|
-
description:
|
|
34
|
+
"address": "DBuUGWbLz8CkAMQiagMfrQzj8SSg1rHQJWrTSc97HWfR";
|
|
35
|
+
"metadata": {
|
|
36
|
+
"name": "jbond";
|
|
37
|
+
"version": "0.2.1";
|
|
38
|
+
"spec": "0.1.0";
|
|
39
|
+
"description": "Jpool Bond Program";
|
|
18
40
|
};
|
|
19
|
-
instructions: [
|
|
41
|
+
"instructions": [
|
|
20
42
|
{
|
|
21
|
-
name:
|
|
22
|
-
docs: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
43
|
+
"name": "bondClaim";
|
|
44
|
+
"docs": [
|
|
45
|
+
"Claims compensation for a validator.",
|
|
46
|
+
"Transfers funds from the validator's bond account to reserve.",
|
|
47
|
+
"",
|
|
48
|
+
"# Arguments",
|
|
49
|
+
"* `amount` - Amount of compensation to claim (must be positive).",
|
|
50
|
+
"",
|
|
51
|
+
"# Errors",
|
|
52
|
+
"Fails if the authority is invalid, if the validator is not active,",
|
|
53
|
+
"if the amount is zero, or if there are insufficient funds."
|
|
32
54
|
];
|
|
33
|
-
discriminator: [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
55
|
+
"discriminator": [
|
|
56
|
+
151,
|
|
57
|
+
92,
|
|
58
|
+
10,
|
|
59
|
+
205,
|
|
60
|
+
66,
|
|
61
|
+
250,
|
|
62
|
+
188,
|
|
63
|
+
129
|
|
42
64
|
];
|
|
43
|
-
accounts: [
|
|
65
|
+
"accounts": [
|
|
44
66
|
{
|
|
45
|
-
name:
|
|
46
|
-
writable: true;
|
|
47
|
-
pda: {
|
|
48
|
-
seeds: [
|
|
49
|
-
{
|
|
50
|
-
kind: 'const';
|
|
51
|
-
value: [
|
|
52
|
-
103,
|
|
53
|
-
108,
|
|
54
|
-
111,
|
|
55
|
-
98,
|
|
56
|
-
97,
|
|
57
|
-
108,
|
|
58
|
-
95,
|
|
59
|
-
115,
|
|
60
|
-
116,
|
|
61
|
-
97,
|
|
62
|
-
116,
|
|
63
|
-
101
|
|
64
|
-
];
|
|
65
|
-
}
|
|
66
|
-
];
|
|
67
|
-
};
|
|
67
|
+
"name": "bondState";
|
|
68
|
+
"writable": true;
|
|
68
69
|
},
|
|
69
70
|
{
|
|
70
|
-
name:
|
|
71
|
-
writable: true;
|
|
72
|
-
pda: {
|
|
73
|
-
seeds: [
|
|
71
|
+
"name": "validatorBond";
|
|
72
|
+
"writable": true;
|
|
73
|
+
"pda": {
|
|
74
|
+
"seeds": [
|
|
74
75
|
{
|
|
75
|
-
kind:
|
|
76
|
-
value: [
|
|
76
|
+
"kind": "const";
|
|
77
|
+
"value": [
|
|
77
78
|
118,
|
|
78
79
|
97,
|
|
79
80
|
108,
|
|
@@ -91,138 +92,138 @@ type Jbond = {
|
|
|
91
92
|
];
|
|
92
93
|
},
|
|
93
94
|
{
|
|
94
|
-
kind:
|
|
95
|
-
path:
|
|
96
|
-
|
|
95
|
+
"kind": "account";
|
|
96
|
+
"path": "bondState";
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"kind": "account";
|
|
100
|
+
"path": "validator_bond.vote_account";
|
|
101
|
+
"account": "validatorBond";
|
|
97
102
|
}
|
|
98
103
|
];
|
|
99
104
|
};
|
|
100
105
|
},
|
|
101
106
|
{
|
|
102
|
-
name:
|
|
103
|
-
writable: true;
|
|
107
|
+
"name": "reserve";
|
|
108
|
+
"writable": true;
|
|
104
109
|
},
|
|
105
110
|
{
|
|
106
|
-
name:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
"name": "authority";
|
|
112
|
+
"signer": true;
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "bondTokenAccount";
|
|
116
|
+
"writable": true;
|
|
117
|
+
"optional": true;
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "reserveTokenAccount";
|
|
121
|
+
"writable": true;
|
|
122
|
+
"optional": true;
|
|
111
123
|
},
|
|
112
124
|
{
|
|
113
|
-
name:
|
|
114
|
-
|
|
125
|
+
"name": "stakeAccount";
|
|
126
|
+
"writable": true;
|
|
127
|
+
"optional": true;
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "systemProgram";
|
|
131
|
+
"address": "11111111111111111111111111111111";
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "tokenProgram";
|
|
135
|
+
"optional": true;
|
|
136
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "stakeProgram";
|
|
140
|
+
"optional": true;
|
|
115
141
|
}
|
|
116
142
|
];
|
|
117
|
-
args: [
|
|
143
|
+
"args": [
|
|
118
144
|
{
|
|
119
|
-
name:
|
|
120
|
-
type:
|
|
145
|
+
"name": "amount";
|
|
146
|
+
"type": "u64";
|
|
121
147
|
}
|
|
122
148
|
];
|
|
123
149
|
},
|
|
124
150
|
{
|
|
125
|
-
name:
|
|
126
|
-
docs: [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
'',
|
|
130
|
-
'# Arguments',
|
|
131
|
-
'* `data` - Configuration data containing optional new authority and reserve keys.',
|
|
132
|
-
'',
|
|
133
|
-
'# Errors',
|
|
134
|
-
'Fails if the signer is not authorized to update the global configuration.'
|
|
151
|
+
"name": "bondConfigure";
|
|
152
|
+
"docs": [
|
|
153
|
+
"Updates bond configuration, including authority and reserve fields.",
|
|
154
|
+
"Allows changing the bond's authority and updating the reserve account."
|
|
135
155
|
];
|
|
136
|
-
discriminator: [
|
|
137
|
-
|
|
138
|
-
|
|
156
|
+
"discriminator": [
|
|
157
|
+
61,
|
|
158
|
+
42,
|
|
159
|
+
106,
|
|
160
|
+
235,
|
|
139
161
|
108,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
54,
|
|
144
|
-
217
|
|
162
|
+
57,
|
|
163
|
+
65,
|
|
164
|
+
20
|
|
145
165
|
];
|
|
146
|
-
accounts: [
|
|
166
|
+
"accounts": [
|
|
147
167
|
{
|
|
148
|
-
name:
|
|
149
|
-
writable: true;
|
|
150
|
-
pda: {
|
|
151
|
-
seeds: [
|
|
152
|
-
{
|
|
153
|
-
kind: 'const';
|
|
154
|
-
value: [
|
|
155
|
-
103,
|
|
156
|
-
108,
|
|
157
|
-
111,
|
|
158
|
-
98,
|
|
159
|
-
97,
|
|
160
|
-
108,
|
|
161
|
-
95,
|
|
162
|
-
115,
|
|
163
|
-
116,
|
|
164
|
-
97,
|
|
165
|
-
116,
|
|
166
|
-
101
|
|
167
|
-
];
|
|
168
|
-
}
|
|
169
|
-
];
|
|
170
|
-
};
|
|
168
|
+
"name": "bondState";
|
|
169
|
+
"writable": true;
|
|
171
170
|
},
|
|
172
171
|
{
|
|
173
|
-
name:
|
|
174
|
-
signer: true;
|
|
175
|
-
relations: [
|
|
176
|
-
|
|
172
|
+
"name": "authority";
|
|
173
|
+
"signer": true;
|
|
174
|
+
"relations": [
|
|
175
|
+
"bondState"
|
|
177
176
|
];
|
|
178
177
|
}
|
|
179
178
|
];
|
|
180
|
-
args: [
|
|
179
|
+
"args": [
|
|
181
180
|
{
|
|
182
|
-
name:
|
|
183
|
-
type: {
|
|
184
|
-
defined: {
|
|
185
|
-
name:
|
|
181
|
+
"name": "data";
|
|
182
|
+
"type": {
|
|
183
|
+
"defined": {
|
|
184
|
+
"name": "bondConfigureData";
|
|
186
185
|
};
|
|
187
186
|
};
|
|
188
187
|
}
|
|
189
188
|
];
|
|
190
189
|
},
|
|
191
190
|
{
|
|
192
|
-
name:
|
|
193
|
-
docs: [
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
191
|
+
"name": "bondInitialize";
|
|
192
|
+
"docs": [
|
|
193
|
+
"Initializes state for the bond.",
|
|
194
|
+
"Sets the authority and reserve account for managing validator bonds.",
|
|
195
|
+
"",
|
|
196
|
+
"# Errors",
|
|
197
|
+
"Fails if the global state account is already initialized or if the payer lacks",
|
|
198
|
+
"sufficient funds."
|
|
200
199
|
];
|
|
201
|
-
discriminator: [
|
|
202
|
-
|
|
200
|
+
"discriminator": [
|
|
201
|
+
230,
|
|
202
|
+
3,
|
|
203
|
+
121,
|
|
204
|
+
94,
|
|
205
|
+
147,
|
|
206
|
+
203,
|
|
203
207
|
175,
|
|
204
|
-
|
|
205
|
-
31,
|
|
206
|
-
13,
|
|
207
|
-
152,
|
|
208
|
-
155,
|
|
209
|
-
237
|
|
208
|
+
210
|
|
210
209
|
];
|
|
211
|
-
accounts: [
|
|
210
|
+
"accounts": [
|
|
212
211
|
{
|
|
213
|
-
name:
|
|
214
|
-
writable: true;
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
"name": "globalState";
|
|
213
|
+
"writable": true;
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"name": "bondState";
|
|
217
|
+
"writable": true;
|
|
218
|
+
"pda": {
|
|
219
|
+
"seeds": [
|
|
217
220
|
{
|
|
218
|
-
kind:
|
|
219
|
-
value: [
|
|
220
|
-
103,
|
|
221
|
-
108,
|
|
222
|
-
111,
|
|
221
|
+
"kind": "const";
|
|
222
|
+
"value": [
|
|
223
223
|
98,
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
111,
|
|
225
|
+
110,
|
|
226
|
+
100,
|
|
226
227
|
95,
|
|
227
228
|
115,
|
|
228
229
|
116,
|
|
@@ -230,83 +231,96 @@ type Jbond = {
|
|
|
230
231
|
116,
|
|
231
232
|
101
|
|
232
233
|
];
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"kind": "arg";
|
|
237
|
+
"path": "data.bond_type";
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"kind": "arg";
|
|
241
|
+
"path": "data.name";
|
|
233
242
|
}
|
|
234
243
|
];
|
|
235
244
|
};
|
|
236
245
|
},
|
|
237
246
|
{
|
|
238
|
-
name:
|
|
239
|
-
writable: true;
|
|
240
|
-
signer: true;
|
|
247
|
+
"name": "authority";
|
|
248
|
+
"writable": true;
|
|
249
|
+
"signer": true;
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"name": "reserve";
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "associatedTokenProgram";
|
|
256
|
+
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "systemProgram";
|
|
260
|
+
"address": "11111111111111111111111111111111";
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "tokenProgram";
|
|
264
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
241
265
|
},
|
|
242
266
|
{
|
|
243
|
-
name:
|
|
267
|
+
"name": "reserveTokenAccount";
|
|
268
|
+
"writable": true;
|
|
269
|
+
"optional": true;
|
|
244
270
|
},
|
|
245
271
|
{
|
|
246
|
-
name:
|
|
247
|
-
|
|
272
|
+
"name": "mint";
|
|
273
|
+
"optional": true;
|
|
274
|
+
}
|
|
275
|
+
];
|
|
276
|
+
"args": [
|
|
277
|
+
{
|
|
278
|
+
"name": "data";
|
|
279
|
+
"type": {
|
|
280
|
+
"defined": {
|
|
281
|
+
"name": "bondInitializeData";
|
|
282
|
+
};
|
|
283
|
+
};
|
|
248
284
|
}
|
|
249
285
|
];
|
|
250
|
-
args: [];
|
|
251
286
|
},
|
|
252
287
|
{
|
|
253
|
-
name:
|
|
254
|
-
docs: [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
288
|
+
"name": "bondRegister";
|
|
289
|
+
"docs": [
|
|
290
|
+
"Registers a new validator with the bond.",
|
|
291
|
+
"Sets up the validator's bond account and deposits initial collateral.",
|
|
292
|
+
"",
|
|
293
|
+
"# Arguments",
|
|
294
|
+
"* `initial_collateral` - Amount of collateral to lock (must be positive).",
|
|
295
|
+
"* `withdrawal_authority` - Optional key that can withdraw collateral later.",
|
|
296
|
+
"",
|
|
297
|
+
"# Errors",
|
|
298
|
+
"Fails if the validator is already registered, if the vote account is invalid,",
|
|
299
|
+
"or if the initial collateral transfer fails."
|
|
265
300
|
];
|
|
266
|
-
discriminator: [
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
301
|
+
"discriminator": [
|
|
302
|
+
117,
|
|
303
|
+
127,
|
|
304
|
+
78,
|
|
305
|
+
103,
|
|
306
|
+
166,
|
|
307
|
+
175,
|
|
308
|
+
163,
|
|
309
|
+
83
|
|
275
310
|
];
|
|
276
|
-
accounts: [
|
|
311
|
+
"accounts": [
|
|
277
312
|
{
|
|
278
|
-
name:
|
|
279
|
-
writable: true;
|
|
280
|
-
pda: {
|
|
281
|
-
seeds: [
|
|
282
|
-
{
|
|
283
|
-
kind: 'const';
|
|
284
|
-
value: [
|
|
285
|
-
103,
|
|
286
|
-
108,
|
|
287
|
-
111,
|
|
288
|
-
98,
|
|
289
|
-
97,
|
|
290
|
-
108,
|
|
291
|
-
95,
|
|
292
|
-
115,
|
|
293
|
-
116,
|
|
294
|
-
97,
|
|
295
|
-
116,
|
|
296
|
-
101
|
|
297
|
-
];
|
|
298
|
-
}
|
|
299
|
-
];
|
|
300
|
-
};
|
|
313
|
+
"name": "bondState";
|
|
314
|
+
"writable": true;
|
|
301
315
|
},
|
|
302
316
|
{
|
|
303
|
-
name:
|
|
304
|
-
writable: true;
|
|
305
|
-
pda: {
|
|
306
|
-
seeds: [
|
|
317
|
+
"name": "validatorBond";
|
|
318
|
+
"writable": true;
|
|
319
|
+
"pda": {
|
|
320
|
+
"seeds": [
|
|
307
321
|
{
|
|
308
|
-
kind:
|
|
309
|
-
value: [
|
|
322
|
+
"kind": "const";
|
|
323
|
+
"value": [
|
|
310
324
|
118,
|
|
311
325
|
97,
|
|
312
326
|
108,
|
|
@@ -324,70 +338,99 @@ type Jbond = {
|
|
|
324
338
|
];
|
|
325
339
|
},
|
|
326
340
|
{
|
|
327
|
-
kind:
|
|
328
|
-
path:
|
|
341
|
+
"kind": "account";
|
|
342
|
+
"path": "bondState";
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"kind": "account";
|
|
346
|
+
"path": "voteAccount";
|
|
329
347
|
}
|
|
330
348
|
];
|
|
331
349
|
};
|
|
332
350
|
},
|
|
333
351
|
{
|
|
334
|
-
name:
|
|
352
|
+
"name": "identity";
|
|
335
353
|
},
|
|
336
354
|
{
|
|
337
|
-
name:
|
|
355
|
+
"name": "voteAccount";
|
|
338
356
|
},
|
|
339
357
|
{
|
|
340
|
-
name:
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
358
|
+
"name": "creator";
|
|
359
|
+
"writable": true;
|
|
360
|
+
"signer": true;
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"name": "systemProgram";
|
|
364
|
+
"address": "11111111111111111111111111111111";
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"name": "tokenProgram";
|
|
368
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
346
369
|
},
|
|
347
370
|
{
|
|
348
|
-
name:
|
|
349
|
-
address:
|
|
371
|
+
"name": "associatedTokenProgram";
|
|
372
|
+
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"name": "bondTokenAccount";
|
|
376
|
+
"writable": true;
|
|
377
|
+
"optional": true;
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"name": "mint";
|
|
381
|
+
"optional": true;
|
|
350
382
|
}
|
|
351
383
|
];
|
|
352
|
-
args: [
|
|
384
|
+
"args": [
|
|
385
|
+
{
|
|
386
|
+
"name": "bondType";
|
|
387
|
+
"type": {
|
|
388
|
+
"defined": {
|
|
389
|
+
"name": "bondType";
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
},
|
|
353
393
|
{
|
|
354
|
-
name:
|
|
355
|
-
type:
|
|
394
|
+
"name": "bondName";
|
|
395
|
+
"type": "string";
|
|
356
396
|
}
|
|
357
397
|
];
|
|
358
398
|
},
|
|
359
399
|
{
|
|
360
|
-
name:
|
|
361
|
-
docs: [
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
400
|
+
"name": "bondSetWithdrawAuthority";
|
|
401
|
+
"docs": [
|
|
402
|
+
"Sets a new withdrawal authority for a validator's bond account.",
|
|
403
|
+
"Allows changing who can withdraw collateral in the future.",
|
|
404
|
+
"",
|
|
405
|
+
"# Arguments",
|
|
406
|
+
"* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
|
|
407
|
+
"identity).",
|
|
408
|
+
"",
|
|
409
|
+
"# Errors",
|
|
410
|
+
"Fails if the signer is not authorized to change the withdrawal authority."
|
|
371
411
|
];
|
|
372
|
-
discriminator: [
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
412
|
+
"discriminator": [
|
|
413
|
+
212,
|
|
414
|
+
162,
|
|
415
|
+
53,
|
|
416
|
+
130,
|
|
417
|
+
91,
|
|
418
|
+
158,
|
|
419
|
+
61,
|
|
420
|
+
166
|
|
381
421
|
];
|
|
382
|
-
accounts: [
|
|
422
|
+
"accounts": [
|
|
383
423
|
{
|
|
384
|
-
name:
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
424
|
+
"name": "bondState";
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"name": "validatorBond";
|
|
428
|
+
"writable": true;
|
|
429
|
+
"pda": {
|
|
430
|
+
"seeds": [
|
|
388
431
|
{
|
|
389
|
-
kind:
|
|
390
|
-
value: [
|
|
432
|
+
"kind": "const";
|
|
433
|
+
"value": [
|
|
391
434
|
118,
|
|
392
435
|
97,
|
|
393
436
|
108,
|
|
@@ -405,56 +448,64 @@ type Jbond = {
|
|
|
405
448
|
];
|
|
406
449
|
},
|
|
407
450
|
{
|
|
408
|
-
kind:
|
|
409
|
-
path:
|
|
410
|
-
|
|
451
|
+
"kind": "account";
|
|
452
|
+
"path": "bondState";
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"kind": "account";
|
|
456
|
+
"path": "validator_bond.vote_account";
|
|
457
|
+
"account": "validatorBond";
|
|
411
458
|
}
|
|
412
459
|
];
|
|
413
460
|
};
|
|
414
461
|
},
|
|
415
462
|
{
|
|
416
|
-
name:
|
|
417
|
-
signer: true;
|
|
463
|
+
"name": "identity";
|
|
464
|
+
"signer": true;
|
|
418
465
|
},
|
|
419
466
|
{
|
|
420
|
-
name:
|
|
421
|
-
optional: true;
|
|
467
|
+
"name": "newWithdrawAuthority";
|
|
468
|
+
"optional": true;
|
|
422
469
|
}
|
|
423
470
|
];
|
|
424
|
-
args: [];
|
|
471
|
+
"args": [];
|
|
425
472
|
},
|
|
426
473
|
{
|
|
427
|
-
name:
|
|
428
|
-
docs: [
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
474
|
+
"name": "bondTopUp";
|
|
475
|
+
"docs": [
|
|
476
|
+
"Adds additional collateral to an existing validator's bond.",
|
|
477
|
+
"Increases the collateral balance, enhancing the validator's stake.",
|
|
478
|
+
"",
|
|
479
|
+
"# Arguments",
|
|
480
|
+
"* `amount` - Amount to add.",
|
|
481
|
+
"",
|
|
482
|
+
"# Errors",
|
|
483
|
+
"Fails if the validator is not active, if the amount is zero,",
|
|
484
|
+
"or if the transfer of funds fails."
|
|
438
485
|
];
|
|
439
|
-
discriminator: [
|
|
440
|
-
|
|
486
|
+
"discriminator": [
|
|
487
|
+
132,
|
|
441
488
|
225,
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
489
|
+
254,
|
|
490
|
+
187,
|
|
491
|
+
152,
|
|
492
|
+
162,
|
|
493
|
+
176,
|
|
494
|
+
66
|
|
448
495
|
];
|
|
449
|
-
accounts: [
|
|
496
|
+
"accounts": [
|
|
497
|
+
{
|
|
498
|
+
"name": "bondState";
|
|
499
|
+
"writable": true;
|
|
500
|
+
},
|
|
450
501
|
{
|
|
451
|
-
name:
|
|
452
|
-
writable: true;
|
|
453
|
-
pda: {
|
|
454
|
-
seeds: [
|
|
502
|
+
"name": "validatorBond";
|
|
503
|
+
"writable": true;
|
|
504
|
+
"pda": {
|
|
505
|
+
"seeds": [
|
|
455
506
|
{
|
|
456
|
-
kind:
|
|
457
|
-
value: [
|
|
507
|
+
"kind": "const";
|
|
508
|
+
"value": [
|
|
458
509
|
118,
|
|
459
510
|
97,
|
|
460
511
|
108,
|
|
@@ -472,63 +523,95 @@ type Jbond = {
|
|
|
472
523
|
];
|
|
473
524
|
},
|
|
474
525
|
{
|
|
475
|
-
kind:
|
|
476
|
-
path:
|
|
477
|
-
|
|
526
|
+
"kind": "account";
|
|
527
|
+
"path": "bondState";
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"kind": "account";
|
|
531
|
+
"path": "validator_bond.vote_account";
|
|
532
|
+
"account": "validatorBond";
|
|
478
533
|
}
|
|
479
534
|
];
|
|
480
535
|
};
|
|
481
536
|
},
|
|
482
537
|
{
|
|
483
|
-
name:
|
|
484
|
-
writable: true;
|
|
485
|
-
signer: true;
|
|
538
|
+
"name": "payer";
|
|
539
|
+
"writable": true;
|
|
540
|
+
"signer": true;
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
"name": "payerTokenAccount";
|
|
544
|
+
"writable": true;
|
|
545
|
+
"optional": true;
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"name": "bondTokenAccount";
|
|
549
|
+
"writable": true;
|
|
550
|
+
"optional": true;
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"name": "stakeAccount";
|
|
554
|
+
"writable": true;
|
|
555
|
+
"optional": true;
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"name": "systemProgram";
|
|
559
|
+
"address": "11111111111111111111111111111111";
|
|
486
560
|
},
|
|
487
561
|
{
|
|
488
|
-
name:
|
|
489
|
-
|
|
562
|
+
"name": "tokenProgram";
|
|
563
|
+
"optional": true;
|
|
564
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"name": "stakeProgram";
|
|
568
|
+
"optional": true;
|
|
490
569
|
}
|
|
491
570
|
];
|
|
492
|
-
args: [
|
|
571
|
+
"args": [
|
|
493
572
|
{
|
|
494
|
-
name:
|
|
495
|
-
type:
|
|
573
|
+
"name": "amount";
|
|
574
|
+
"type": "u64";
|
|
496
575
|
}
|
|
497
576
|
];
|
|
498
577
|
},
|
|
499
578
|
{
|
|
500
|
-
name:
|
|
501
|
-
docs: [
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
579
|
+
"name": "bondWithdraw";
|
|
580
|
+
"docs": [
|
|
581
|
+
"Withdraws collateral from a validator's bond.",
|
|
582
|
+
"Decreases the collateral balance, allowing the validator to reclaim funds.",
|
|
583
|
+
"",
|
|
584
|
+
"# Arguments",
|
|
585
|
+
"* `amount` - Amount to withdraw (must not exceed available balance).",
|
|
586
|
+
"",
|
|
587
|
+
"# Errors",
|
|
588
|
+
"Fails if the validator is not active, if the amount is zero,",
|
|
589
|
+
"if the withdrawal authority is invalid, or if the withdrawal would",
|
|
590
|
+
"leave insufficient collateral."
|
|
512
591
|
];
|
|
513
|
-
discriminator: [
|
|
514
|
-
|
|
515
|
-
|
|
592
|
+
"discriminator": [
|
|
593
|
+
99,
|
|
594
|
+
64,
|
|
595
|
+
127,
|
|
596
|
+
178,
|
|
597
|
+
53,
|
|
598
|
+
117,
|
|
516
599
|
70,
|
|
517
|
-
|
|
518
|
-
148,
|
|
519
|
-
109,
|
|
520
|
-
161,
|
|
521
|
-
34
|
|
600
|
+
204
|
|
522
601
|
];
|
|
523
|
-
accounts: [
|
|
602
|
+
"accounts": [
|
|
524
603
|
{
|
|
525
|
-
name:
|
|
526
|
-
writable: true;
|
|
527
|
-
|
|
528
|
-
|
|
604
|
+
"name": "bondState";
|
|
605
|
+
"writable": true;
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"name": "validatorBond";
|
|
609
|
+
"writable": true;
|
|
610
|
+
"pda": {
|
|
611
|
+
"seeds": [
|
|
529
612
|
{
|
|
530
|
-
kind:
|
|
531
|
-
value: [
|
|
613
|
+
"kind": "const";
|
|
614
|
+
"value": [
|
|
532
615
|
118,
|
|
533
616
|
97,
|
|
534
617
|
108,
|
|
@@ -546,43 +629,226 @@ type Jbond = {
|
|
|
546
629
|
];
|
|
547
630
|
},
|
|
548
631
|
{
|
|
549
|
-
kind:
|
|
550
|
-
path:
|
|
551
|
-
|
|
632
|
+
"kind": "account";
|
|
633
|
+
"path": "bondState";
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"kind": "account";
|
|
637
|
+
"path": "validator_bond.vote_account";
|
|
638
|
+
"account": "validatorBond";
|
|
552
639
|
}
|
|
553
640
|
];
|
|
554
641
|
};
|
|
555
642
|
},
|
|
556
643
|
{
|
|
557
|
-
name:
|
|
558
|
-
writable: true;
|
|
559
|
-
signer: true;
|
|
644
|
+
"name": "withdrawalAuthority";
|
|
645
|
+
"writable": true;
|
|
646
|
+
"signer": true;
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"name": "destination";
|
|
650
|
+
"writable": true;
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"name": "destinationTokenAccount";
|
|
654
|
+
"writable": true;
|
|
655
|
+
"optional": true;
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"name": "bondTokenAccount";
|
|
659
|
+
"writable": true;
|
|
660
|
+
"optional": true;
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"name": "stakeAccount";
|
|
664
|
+
"writable": true;
|
|
665
|
+
"optional": true;
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
"name": "systemProgram";
|
|
669
|
+
"address": "11111111111111111111111111111111";
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"name": "tokenProgram";
|
|
673
|
+
"optional": true;
|
|
674
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"name": "stakeProgram";
|
|
678
|
+
"optional": true;
|
|
679
|
+
}
|
|
680
|
+
];
|
|
681
|
+
"args": [
|
|
682
|
+
{
|
|
683
|
+
"name": "amount";
|
|
684
|
+
"type": "u64";
|
|
685
|
+
}
|
|
686
|
+
];
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"name": "globalConfigure";
|
|
690
|
+
"discriminator": [
|
|
691
|
+
67,
|
|
692
|
+
142,
|
|
693
|
+
164,
|
|
694
|
+
250,
|
|
695
|
+
90,
|
|
696
|
+
233,
|
|
697
|
+
144,
|
|
698
|
+
187
|
|
699
|
+
];
|
|
700
|
+
"accounts": [
|
|
701
|
+
{
|
|
702
|
+
"name": "globalState";
|
|
703
|
+
"writable": true;
|
|
704
|
+
"pda": {
|
|
705
|
+
"seeds": [
|
|
706
|
+
{
|
|
707
|
+
"kind": "const";
|
|
708
|
+
"value": [
|
|
709
|
+
103,
|
|
710
|
+
108,
|
|
711
|
+
111,
|
|
712
|
+
98,
|
|
713
|
+
97,
|
|
714
|
+
108,
|
|
715
|
+
95,
|
|
716
|
+
115,
|
|
717
|
+
116,
|
|
718
|
+
97,
|
|
719
|
+
116,
|
|
720
|
+
101
|
|
721
|
+
];
|
|
722
|
+
}
|
|
723
|
+
];
|
|
724
|
+
};
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"name": "authority";
|
|
728
|
+
"signer": true;
|
|
729
|
+
"relations": [
|
|
730
|
+
"globalState"
|
|
731
|
+
];
|
|
732
|
+
}
|
|
733
|
+
];
|
|
734
|
+
"args": [
|
|
735
|
+
{
|
|
736
|
+
"name": "data";
|
|
737
|
+
"type": {
|
|
738
|
+
"defined": {
|
|
739
|
+
"name": "globalConfigureData";
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
];
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
"name": "globalInitialize";
|
|
747
|
+
"docs": [
|
|
748
|
+
"----------------------------- Global Instructions ----------------------------"
|
|
749
|
+
];
|
|
750
|
+
"discriminator": [
|
|
751
|
+
30,
|
|
752
|
+
79,
|
|
753
|
+
193,
|
|
754
|
+
205,
|
|
755
|
+
75,
|
|
756
|
+
42,
|
|
757
|
+
223,
|
|
758
|
+
196
|
|
759
|
+
];
|
|
760
|
+
"accounts": [
|
|
761
|
+
{
|
|
762
|
+
"name": "globalState";
|
|
763
|
+
"writable": true;
|
|
764
|
+
"pda": {
|
|
765
|
+
"seeds": [
|
|
766
|
+
{
|
|
767
|
+
"kind": "const";
|
|
768
|
+
"value": [
|
|
769
|
+
103,
|
|
770
|
+
108,
|
|
771
|
+
111,
|
|
772
|
+
98,
|
|
773
|
+
97,
|
|
774
|
+
108,
|
|
775
|
+
95,
|
|
776
|
+
115,
|
|
777
|
+
116,
|
|
778
|
+
97,
|
|
779
|
+
116,
|
|
780
|
+
101
|
|
781
|
+
];
|
|
782
|
+
}
|
|
783
|
+
];
|
|
784
|
+
};
|
|
560
785
|
},
|
|
561
786
|
{
|
|
562
|
-
name:
|
|
563
|
-
writable: true;
|
|
787
|
+
"name": "authority";
|
|
788
|
+
"writable": true;
|
|
789
|
+
"signer": true;
|
|
564
790
|
},
|
|
565
791
|
{
|
|
566
|
-
name:
|
|
567
|
-
address:
|
|
792
|
+
"name": "systemProgram";
|
|
793
|
+
"address": "11111111111111111111111111111111";
|
|
794
|
+
}
|
|
795
|
+
];
|
|
796
|
+
"args": [];
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
"name": "sessionStart";
|
|
800
|
+
"docs": [
|
|
801
|
+
"Starts a paused bond, allowing deposits and withdrawals to resume."
|
|
802
|
+
];
|
|
803
|
+
"discriminator": [
|
|
804
|
+
132,
|
|
805
|
+
93,
|
|
806
|
+
83,
|
|
807
|
+
152,
|
|
808
|
+
141,
|
|
809
|
+
32,
|
|
810
|
+
58,
|
|
811
|
+
92
|
|
812
|
+
];
|
|
813
|
+
"accounts": [
|
|
814
|
+
{
|
|
815
|
+
"name": "bondState";
|
|
816
|
+
"writable": true;
|
|
568
817
|
},
|
|
569
818
|
{
|
|
570
|
-
name:
|
|
571
|
-
|
|
819
|
+
"name": "authority";
|
|
820
|
+
"writable": true;
|
|
821
|
+
"signer": true;
|
|
822
|
+
"relations": [
|
|
823
|
+
"bondState"
|
|
824
|
+
];
|
|
572
825
|
}
|
|
573
826
|
];
|
|
574
|
-
args: [
|
|
827
|
+
"args": [
|
|
575
828
|
{
|
|
576
|
-
name:
|
|
577
|
-
type:
|
|
829
|
+
"name": "durationSecs";
|
|
830
|
+
"type": "u64";
|
|
578
831
|
}
|
|
579
832
|
];
|
|
580
833
|
}
|
|
581
834
|
];
|
|
582
|
-
accounts: [
|
|
835
|
+
"accounts": [
|
|
836
|
+
{
|
|
837
|
+
"name": "bondState";
|
|
838
|
+
"discriminator": [
|
|
839
|
+
251,
|
|
840
|
+
95,
|
|
841
|
+
76,
|
|
842
|
+
47,
|
|
843
|
+
191,
|
|
844
|
+
108,
|
|
845
|
+
163,
|
|
846
|
+
92
|
|
847
|
+
];
|
|
848
|
+
},
|
|
583
849
|
{
|
|
584
|
-
name:
|
|
585
|
-
discriminator: [
|
|
850
|
+
"name": "globalState";
|
|
851
|
+
"discriminator": [
|
|
586
852
|
163,
|
|
587
853
|
46,
|
|
588
854
|
74,
|
|
@@ -594,8 +860,8 @@ type Jbond = {
|
|
|
594
860
|
];
|
|
595
861
|
},
|
|
596
862
|
{
|
|
597
|
-
name:
|
|
598
|
-
discriminator: [
|
|
863
|
+
"name": "validatorBond";
|
|
864
|
+
"discriminator": [
|
|
599
865
|
82,
|
|
600
866
|
127,
|
|
601
867
|
243,
|
|
@@ -607,10 +873,36 @@ type Jbond = {
|
|
|
607
873
|
];
|
|
608
874
|
}
|
|
609
875
|
];
|
|
610
|
-
events: [
|
|
876
|
+
"events": [
|
|
877
|
+
{
|
|
878
|
+
"name": "bondFinished";
|
|
879
|
+
"discriminator": [
|
|
880
|
+
223,
|
|
881
|
+
254,
|
|
882
|
+
3,
|
|
883
|
+
161,
|
|
884
|
+
90,
|
|
885
|
+
190,
|
|
886
|
+
150,
|
|
887
|
+
191
|
|
888
|
+
];
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
"name": "bondStarted";
|
|
892
|
+
"discriminator": [
|
|
893
|
+
235,
|
|
894
|
+
69,
|
|
895
|
+
80,
|
|
896
|
+
63,
|
|
897
|
+
209,
|
|
898
|
+
252,
|
|
899
|
+
232,
|
|
900
|
+
64
|
|
901
|
+
];
|
|
902
|
+
},
|
|
611
903
|
{
|
|
612
|
-
name:
|
|
613
|
-
discriminator: [
|
|
904
|
+
"name": "collateralToppedUp";
|
|
905
|
+
"discriminator": [
|
|
614
906
|
189,
|
|
615
907
|
137,
|
|
616
908
|
204,
|
|
@@ -622,8 +914,8 @@ type Jbond = {
|
|
|
622
914
|
];
|
|
623
915
|
},
|
|
624
916
|
{
|
|
625
|
-
name:
|
|
626
|
-
discriminator: [
|
|
917
|
+
"name": "collateralWithdrawn";
|
|
918
|
+
"discriminator": [
|
|
627
919
|
51,
|
|
628
920
|
224,
|
|
629
921
|
133,
|
|
@@ -635,8 +927,8 @@ type Jbond = {
|
|
|
635
927
|
];
|
|
636
928
|
},
|
|
637
929
|
{
|
|
638
|
-
name:
|
|
639
|
-
discriminator: [
|
|
930
|
+
"name": "compensationClaimed";
|
|
931
|
+
"discriminator": [
|
|
640
932
|
36,
|
|
641
933
|
159,
|
|
642
934
|
41,
|
|
@@ -648,8 +940,8 @@ type Jbond = {
|
|
|
648
940
|
];
|
|
649
941
|
},
|
|
650
942
|
{
|
|
651
|
-
name:
|
|
652
|
-
discriminator: [
|
|
943
|
+
"name": "validatorRegistered";
|
|
944
|
+
"discriminator": [
|
|
653
945
|
20,
|
|
654
946
|
20,
|
|
655
947
|
190,
|
|
@@ -661,347 +953,606 @@ type Jbond = {
|
|
|
661
953
|
];
|
|
662
954
|
}
|
|
663
955
|
];
|
|
664
|
-
errors: [
|
|
956
|
+
"errors": [
|
|
957
|
+
{
|
|
958
|
+
"code": 6000;
|
|
959
|
+
"name": "invalidVoteAccount";
|
|
960
|
+
"msg": "Invalid vote account";
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
"code": 6001;
|
|
964
|
+
"name": "identityMismatch";
|
|
965
|
+
"msg": "Identity does not match vote account";
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
"code": 6002;
|
|
969
|
+
"name": "insufficientCollateral";
|
|
970
|
+
"msg": "Insufficient collateral amount";
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
"code": 6003;
|
|
974
|
+
"name": "targetAprTooLow";
|
|
975
|
+
"msg": "Target APR is below minimum threshold";
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"code": 6004;
|
|
979
|
+
"name": "mathOverflow";
|
|
980
|
+
"msg": "Math overflow";
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"code": 6005;
|
|
984
|
+
"name": "invalidAmount";
|
|
985
|
+
"msg": "Invalid amount";
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
"code": 6006;
|
|
989
|
+
"name": "validatorNotActive";
|
|
990
|
+
"msg": "Validator bond account is not active";
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
"code": 6007;
|
|
994
|
+
"name": "validatorAlreadyRegistered";
|
|
995
|
+
"msg": "Validator already registered";
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
"code": 6008;
|
|
999
|
+
"name": "unauthorized";
|
|
1000
|
+
"msg": "unauthorized";
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
"code": 6009;
|
|
1004
|
+
"name": "withdrawalLockedNearEpochEnd";
|
|
1005
|
+
"msg": "Withdrawals are locked near the end of the epoch.";
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
"code": 6010;
|
|
1009
|
+
"name": "missingTokenAccounts";
|
|
1010
|
+
"msg": "Missing token accounts for token collateral type";
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"code": 6011;
|
|
1014
|
+
"name": "missingTokenProgram";
|
|
1015
|
+
"msg": "Token program is required for token collateral type";
|
|
1016
|
+
},
|
|
665
1017
|
{
|
|
666
|
-
code:
|
|
667
|
-
name:
|
|
668
|
-
msg:
|
|
1018
|
+
"code": 6012;
|
|
1019
|
+
"name": "invalidMint";
|
|
1020
|
+
"msg": "Invalid mint for token collateral type";
|
|
669
1021
|
},
|
|
670
1022
|
{
|
|
671
|
-
code:
|
|
672
|
-
name:
|
|
673
|
-
msg:
|
|
1023
|
+
"code": 6013;
|
|
1024
|
+
"name": "missingStakeAccount";
|
|
1025
|
+
"msg": "Stake account is required for stake account collateral type";
|
|
674
1026
|
},
|
|
675
1027
|
{
|
|
676
|
-
code:
|
|
677
|
-
name:
|
|
678
|
-
msg:
|
|
1028
|
+
"code": 6014;
|
|
1029
|
+
"name": "missingStakeProgram";
|
|
1030
|
+
"msg": "Stake program is required for stake account collateral type";
|
|
679
1031
|
},
|
|
680
1032
|
{
|
|
681
|
-
code:
|
|
682
|
-
name:
|
|
683
|
-
msg:
|
|
1033
|
+
"code": 6015;
|
|
1034
|
+
"name": "bondFinished";
|
|
1035
|
+
"msg": "Bond is finished (deposits/withdrawals disabled)";
|
|
684
1036
|
},
|
|
685
1037
|
{
|
|
686
|
-
code:
|
|
687
|
-
name:
|
|
688
|
-
msg:
|
|
1038
|
+
"code": 6016;
|
|
1039
|
+
"name": "bondNotFinished";
|
|
1040
|
+
"msg": "Bond is not finished";
|
|
689
1041
|
},
|
|
690
1042
|
{
|
|
691
|
-
code:
|
|
692
|
-
name:
|
|
693
|
-
msg:
|
|
1043
|
+
"code": 6017;
|
|
1044
|
+
"name": "unsupportedCollateralType";
|
|
1045
|
+
"msg": "Unsupported collateral type";
|
|
694
1046
|
},
|
|
695
1047
|
{
|
|
696
|
-
code:
|
|
697
|
-
name:
|
|
698
|
-
msg:
|
|
1048
|
+
"code": 6018;
|
|
1049
|
+
"name": "overflow";
|
|
1050
|
+
"msg": "Math operation overflowed";
|
|
699
1051
|
},
|
|
700
1052
|
{
|
|
701
|
-
code:
|
|
702
|
-
name:
|
|
703
|
-
msg:
|
|
1053
|
+
"code": 6019;
|
|
1054
|
+
"name": "incorrectBondType";
|
|
1055
|
+
"msg": "Incorrect bond type for this operation";
|
|
704
1056
|
},
|
|
705
1057
|
{
|
|
706
|
-
code:
|
|
707
|
-
name:
|
|
708
|
-
msg: '
|
|
1058
|
+
"code": 6020;
|
|
1059
|
+
"name": "bondNotFinishable";
|
|
1060
|
+
"msg": "This bond type can't be finished";
|
|
709
1061
|
},
|
|
710
1062
|
{
|
|
711
|
-
code:
|
|
712
|
-
name:
|
|
713
|
-
msg:
|
|
1063
|
+
"code": 6021;
|
|
1064
|
+
"name": "invalidArgument";
|
|
1065
|
+
"msg": "Invalid argument provided";
|
|
714
1066
|
}
|
|
715
1067
|
];
|
|
716
|
-
types: [
|
|
1068
|
+
"types": [
|
|
717
1069
|
{
|
|
718
|
-
name:
|
|
719
|
-
type: {
|
|
720
|
-
kind:
|
|
721
|
-
fields: [
|
|
1070
|
+
"name": "bondConfigureData";
|
|
1071
|
+
"type": {
|
|
1072
|
+
"kind": "struct";
|
|
1073
|
+
"fields": [
|
|
722
1074
|
{
|
|
723
|
-
name:
|
|
724
|
-
type:
|
|
1075
|
+
"name": "newReserve";
|
|
1076
|
+
"type": {
|
|
1077
|
+
"option": "pubkey";
|
|
1078
|
+
};
|
|
725
1079
|
},
|
|
726
1080
|
{
|
|
727
|
-
name:
|
|
728
|
-
type:
|
|
1081
|
+
"name": "newAuthority";
|
|
1082
|
+
"type": {
|
|
1083
|
+
"option": "pubkey";
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
];
|
|
1087
|
+
};
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
"name": "bondFinished";
|
|
1091
|
+
"type": {
|
|
1092
|
+
"kind": "struct";
|
|
1093
|
+
"fields": [
|
|
1094
|
+
{
|
|
1095
|
+
"name": "bond";
|
|
1096
|
+
"type": "pubkey";
|
|
729
1097
|
},
|
|
730
1098
|
{
|
|
731
|
-
name:
|
|
732
|
-
type:
|
|
1099
|
+
"name": "authority";
|
|
1100
|
+
"type": "pubkey";
|
|
733
1101
|
},
|
|
734
1102
|
{
|
|
735
|
-
name:
|
|
736
|
-
type:
|
|
1103
|
+
"name": "timestamp";
|
|
1104
|
+
"type": "i64";
|
|
737
1105
|
}
|
|
738
1106
|
];
|
|
739
1107
|
};
|
|
740
1108
|
},
|
|
741
1109
|
{
|
|
742
|
-
name:
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
1110
|
+
"name": "bondInitializeData";
|
|
1111
|
+
"docs": [
|
|
1112
|
+
"Data required to initialize a performance bond"
|
|
1113
|
+
];
|
|
1114
|
+
"type": {
|
|
1115
|
+
"kind": "struct";
|
|
1116
|
+
"fields": [
|
|
746
1117
|
{
|
|
747
|
-
name:
|
|
748
|
-
type:
|
|
1118
|
+
"name": "name";
|
|
1119
|
+
"type": "string";
|
|
749
1120
|
},
|
|
750
1121
|
{
|
|
751
|
-
name:
|
|
752
|
-
type:
|
|
1122
|
+
"name": "bondType";
|
|
1123
|
+
"type": {
|
|
1124
|
+
"defined": {
|
|
1125
|
+
"name": "bondType";
|
|
1126
|
+
};
|
|
1127
|
+
};
|
|
753
1128
|
},
|
|
754
1129
|
{
|
|
755
|
-
name:
|
|
756
|
-
type:
|
|
1130
|
+
"name": "reserve";
|
|
1131
|
+
"type": "pubkey";
|
|
757
1132
|
},
|
|
758
1133
|
{
|
|
759
|
-
name:
|
|
760
|
-
type:
|
|
1134
|
+
"name": "collateralType";
|
|
1135
|
+
"type": {
|
|
1136
|
+
"defined": {
|
|
1137
|
+
"name": "collateralType";
|
|
1138
|
+
};
|
|
1139
|
+
};
|
|
761
1140
|
}
|
|
762
1141
|
];
|
|
763
1142
|
};
|
|
764
1143
|
},
|
|
765
1144
|
{
|
|
766
|
-
name:
|
|
767
|
-
type: {
|
|
768
|
-
kind:
|
|
769
|
-
fields: [
|
|
1145
|
+
"name": "bondStarted";
|
|
1146
|
+
"type": {
|
|
1147
|
+
"kind": "struct";
|
|
1148
|
+
"fields": [
|
|
1149
|
+
{
|
|
1150
|
+
"name": "bond";
|
|
1151
|
+
"type": "pubkey";
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
"name": "authority";
|
|
1155
|
+
"type": "pubkey";
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
"name": "timestamp";
|
|
1159
|
+
"type": "i64";
|
|
1160
|
+
}
|
|
1161
|
+
];
|
|
1162
|
+
};
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
"name": "bondState";
|
|
1166
|
+
"type": {
|
|
1167
|
+
"kind": "struct";
|
|
1168
|
+
"fields": [
|
|
1169
|
+
{
|
|
1170
|
+
"name": "name";
|
|
1171
|
+
"type": "string";
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
"name": "bondType";
|
|
1175
|
+
"docs": [
|
|
1176
|
+
"The type of bond (e.g., Performance, Crowdfunding)"
|
|
1177
|
+
];
|
|
1178
|
+
"type": {
|
|
1179
|
+
"defined": {
|
|
1180
|
+
"name": "bondType";
|
|
1181
|
+
};
|
|
1182
|
+
};
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
"name": "collateralType";
|
|
1186
|
+
"docs": [
|
|
1187
|
+
"The type of collateral accepted for this bond"
|
|
1188
|
+
];
|
|
1189
|
+
"type": {
|
|
1190
|
+
"defined": {
|
|
1191
|
+
"name": "collateralType";
|
|
1192
|
+
};
|
|
1193
|
+
};
|
|
1194
|
+
},
|
|
770
1195
|
{
|
|
771
|
-
name:
|
|
772
|
-
|
|
1196
|
+
"name": "reserve";
|
|
1197
|
+
"docs": [
|
|
1198
|
+
"Reserve account where collateral is held"
|
|
1199
|
+
];
|
|
1200
|
+
"type": "pubkey";
|
|
773
1201
|
},
|
|
774
1202
|
{
|
|
775
|
-
name:
|
|
776
|
-
|
|
1203
|
+
"name": "authority";
|
|
1204
|
+
"docs": [
|
|
1205
|
+
"Authority allowed to manage the bond configuration"
|
|
1206
|
+
];
|
|
1207
|
+
"type": "pubkey";
|
|
777
1208
|
},
|
|
778
1209
|
{
|
|
779
|
-
name:
|
|
780
|
-
|
|
1210
|
+
"name": "sessionId";
|
|
1211
|
+
"docs": [
|
|
1212
|
+
"Unique identifier for the bonding session"
|
|
1213
|
+
];
|
|
1214
|
+
"type": "u32";
|
|
781
1215
|
},
|
|
782
1216
|
{
|
|
783
|
-
name:
|
|
784
|
-
|
|
1217
|
+
"name": "totalMembers";
|
|
1218
|
+
"docs": [
|
|
1219
|
+
"Total number of users who have participated in the bond"
|
|
1220
|
+
];
|
|
1221
|
+
"type": "u16";
|
|
785
1222
|
},
|
|
786
1223
|
{
|
|
787
|
-
name:
|
|
788
|
-
|
|
1224
|
+
"name": "totalCompensationAmount";
|
|
1225
|
+
"docs": [
|
|
1226
|
+
"Total compensation amount paid out"
|
|
1227
|
+
];
|
|
1228
|
+
"type": "u64";
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
"name": "sessionStartTs";
|
|
1232
|
+
"docs": [
|
|
1233
|
+
"Start timestamp of the current session (unix seconds). 0 — not set."
|
|
1234
|
+
];
|
|
1235
|
+
"type": "i64";
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
"name": "sessionFinishTs";
|
|
1239
|
+
"docs": [
|
|
1240
|
+
"Finish timestamp of the current session (unix seconds). 0 — not set."
|
|
1241
|
+
];
|
|
1242
|
+
"type": "i64";
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
"name": "bump";
|
|
1246
|
+
"docs": [
|
|
1247
|
+
"Bump for the PDA"
|
|
1248
|
+
];
|
|
1249
|
+
"type": "u8";
|
|
789
1250
|
}
|
|
790
1251
|
];
|
|
791
1252
|
};
|
|
792
1253
|
},
|
|
793
1254
|
{
|
|
794
|
-
name:
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
1255
|
+
"name": "bondType";
|
|
1256
|
+
"docs": [
|
|
1257
|
+
"Types of bonds supported by the program"
|
|
1258
|
+
];
|
|
1259
|
+
"type": {
|
|
1260
|
+
"kind": "enum";
|
|
1261
|
+
"variants": [
|
|
798
1262
|
{
|
|
799
|
-
name:
|
|
800
|
-
type: {
|
|
801
|
-
option: 'pubkey';
|
|
802
|
-
};
|
|
1263
|
+
"name": "performance";
|
|
803
1264
|
},
|
|
804
1265
|
{
|
|
805
|
-
name:
|
|
806
|
-
type: {
|
|
807
|
-
option: 'pubkey';
|
|
808
|
-
};
|
|
1266
|
+
"name": "crowdfunding";
|
|
809
1267
|
}
|
|
810
1268
|
];
|
|
811
1269
|
};
|
|
812
1270
|
},
|
|
813
1271
|
{
|
|
814
|
-
name:
|
|
815
|
-
type: {
|
|
816
|
-
kind:
|
|
817
|
-
fields: [
|
|
1272
|
+
"name": "collateralToppedUp";
|
|
1273
|
+
"type": {
|
|
1274
|
+
"kind": "struct";
|
|
1275
|
+
"fields": [
|
|
818
1276
|
{
|
|
819
|
-
name:
|
|
820
|
-
|
|
821
|
-
'The authority allowed to manage the program'
|
|
822
|
-
];
|
|
823
|
-
type: 'pubkey';
|
|
1277
|
+
"name": "validator";
|
|
1278
|
+
"type": "pubkey";
|
|
824
1279
|
},
|
|
825
1280
|
{
|
|
826
|
-
name:
|
|
827
|
-
|
|
828
|
-
'The reserve vault holding SOL for bonding and compensation'
|
|
829
|
-
];
|
|
830
|
-
type: 'pubkey';
|
|
1281
|
+
"name": "amount";
|
|
1282
|
+
"type": "u64";
|
|
831
1283
|
},
|
|
832
1284
|
{
|
|
833
|
-
name:
|
|
834
|
-
|
|
835
|
-
'Total number of registered validators'
|
|
836
|
-
];
|
|
837
|
-
type: 'u16';
|
|
1285
|
+
"name": "postBalance";
|
|
1286
|
+
"type": "u64";
|
|
838
1287
|
},
|
|
839
1288
|
{
|
|
840
|
-
name:
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
1289
|
+
"name": "timestamp";
|
|
1290
|
+
"type": "i64";
|
|
1291
|
+
}
|
|
1292
|
+
];
|
|
1293
|
+
};
|
|
1294
|
+
},
|
|
1295
|
+
{
|
|
1296
|
+
"name": "collateralType";
|
|
1297
|
+
"docs": [
|
|
1298
|
+
"Types of collateral that can be used for bond deposit"
|
|
1299
|
+
];
|
|
1300
|
+
"type": {
|
|
1301
|
+
"kind": "enum";
|
|
1302
|
+
"variants": [
|
|
1303
|
+
{
|
|
1304
|
+
"name": "native";
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
"name": "stakeAccount";
|
|
845
1308
|
},
|
|
846
1309
|
{
|
|
847
|
-
name:
|
|
848
|
-
|
|
849
|
-
|
|
1310
|
+
"name": "token";
|
|
1311
|
+
"fields": [
|
|
1312
|
+
"pubkey"
|
|
850
1313
|
];
|
|
851
|
-
type: 'u8';
|
|
852
1314
|
}
|
|
853
1315
|
];
|
|
854
1316
|
};
|
|
855
1317
|
},
|
|
856
1318
|
{
|
|
857
|
-
name:
|
|
858
|
-
type: {
|
|
859
|
-
kind:
|
|
860
|
-
fields: [
|
|
1319
|
+
"name": "collateralWithdrawn";
|
|
1320
|
+
"type": {
|
|
1321
|
+
"kind": "struct";
|
|
1322
|
+
"fields": [
|
|
861
1323
|
{
|
|
862
|
-
name:
|
|
863
|
-
|
|
864
|
-
'The validator identity pubkey'
|
|
865
|
-
];
|
|
866
|
-
type: 'pubkey';
|
|
1324
|
+
"name": "validator";
|
|
1325
|
+
"type": "pubkey";
|
|
867
1326
|
},
|
|
868
1327
|
{
|
|
869
|
-
name:
|
|
870
|
-
|
|
871
|
-
'The validator vote account pubkey'
|
|
872
|
-
];
|
|
873
|
-
type: 'pubkey';
|
|
1328
|
+
"name": "amount";
|
|
1329
|
+
"type": "u64";
|
|
874
1330
|
},
|
|
875
1331
|
{
|
|
876
|
-
name:
|
|
877
|
-
|
|
878
|
-
'Creator of the validator bond account'
|
|
879
|
-
];
|
|
880
|
-
type: 'pubkey';
|
|
1332
|
+
"name": "postBalance";
|
|
1333
|
+
"type": "u64";
|
|
881
1334
|
},
|
|
882
1335
|
{
|
|
883
|
-
name:
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
1336
|
+
"name": "timestamp";
|
|
1337
|
+
"type": "i64";
|
|
1338
|
+
}
|
|
1339
|
+
];
|
|
1340
|
+
};
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
"name": "compensationClaimed";
|
|
1344
|
+
"type": {
|
|
1345
|
+
"kind": "struct";
|
|
1346
|
+
"fields": [
|
|
1347
|
+
{
|
|
1348
|
+
"name": "validator";
|
|
1349
|
+
"type": "pubkey";
|
|
890
1350
|
},
|
|
891
1351
|
{
|
|
892
|
-
name:
|
|
893
|
-
|
|
894
|
-
'Total compensation claimed for the validator'
|
|
895
|
-
];
|
|
896
|
-
type: 'u64';
|
|
1352
|
+
"name": "amount";
|
|
1353
|
+
"type": "u64";
|
|
897
1354
|
},
|
|
898
1355
|
{
|
|
899
|
-
name:
|
|
900
|
-
|
|
901
|
-
'Last compensation amount claimed'
|
|
902
|
-
];
|
|
903
|
-
type: 'u64';
|
|
1356
|
+
"name": "postBalance";
|
|
1357
|
+
"type": "u64";
|
|
904
1358
|
},
|
|
905
1359
|
{
|
|
906
|
-
name:
|
|
907
|
-
|
|
908
|
-
'Last epoch when compensation was claimed'
|
|
909
|
-
];
|
|
910
|
-
type: 'u64';
|
|
1360
|
+
"name": "epoch";
|
|
1361
|
+
"type": "u64";
|
|
911
1362
|
},
|
|
912
1363
|
{
|
|
913
|
-
name:
|
|
914
|
-
|
|
915
|
-
|
|
1364
|
+
"name": "timestamp";
|
|
1365
|
+
"type": "i64";
|
|
1366
|
+
}
|
|
1367
|
+
];
|
|
1368
|
+
};
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
"name": "globalConfigureData";
|
|
1372
|
+
"type": {
|
|
1373
|
+
"kind": "struct";
|
|
1374
|
+
"fields": [
|
|
1375
|
+
{
|
|
1376
|
+
"name": "newAuthority";
|
|
1377
|
+
"type": {
|
|
1378
|
+
"option": "pubkey";
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
];
|
|
1382
|
+
};
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
"name": "globalState";
|
|
1386
|
+
"type": {
|
|
1387
|
+
"kind": "struct";
|
|
1388
|
+
"fields": [
|
|
1389
|
+
{
|
|
1390
|
+
"name": "bonds";
|
|
1391
|
+
"docs": [
|
|
1392
|
+
"List of all registered bonds"
|
|
916
1393
|
];
|
|
917
|
-
type:
|
|
1394
|
+
"type": {
|
|
1395
|
+
"vec": "pubkey";
|
|
1396
|
+
};
|
|
918
1397
|
},
|
|
919
1398
|
{
|
|
920
|
-
name:
|
|
921
|
-
docs: [
|
|
922
|
-
|
|
1399
|
+
"name": "authority";
|
|
1400
|
+
"docs": [
|
|
1401
|
+
"The authority allowed to manage the program"
|
|
923
1402
|
];
|
|
924
|
-
type:
|
|
1403
|
+
"type": "pubkey";
|
|
925
1404
|
},
|
|
926
1405
|
{
|
|
927
|
-
name:
|
|
928
|
-
docs: [
|
|
929
|
-
|
|
1406
|
+
"name": "bump";
|
|
1407
|
+
"docs": [
|
|
1408
|
+
"Bump for the PDA"
|
|
930
1409
|
];
|
|
931
|
-
type:
|
|
1410
|
+
"type": "u8";
|
|
932
1411
|
}
|
|
933
1412
|
];
|
|
934
1413
|
};
|
|
935
1414
|
},
|
|
936
1415
|
{
|
|
937
|
-
name:
|
|
938
|
-
type: {
|
|
939
|
-
kind:
|
|
940
|
-
fields: [
|
|
1416
|
+
"name": "validatorBond";
|
|
1417
|
+
"type": {
|
|
1418
|
+
"kind": "struct";
|
|
1419
|
+
"fields": [
|
|
1420
|
+
{
|
|
1421
|
+
"name": "bond";
|
|
1422
|
+
"type": "pubkey";
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
"name": "identity";
|
|
1426
|
+
"type": "pubkey";
|
|
1427
|
+
},
|
|
941
1428
|
{
|
|
942
|
-
name:
|
|
943
|
-
type:
|
|
1429
|
+
"name": "voteAccount";
|
|
1430
|
+
"type": "pubkey";
|
|
944
1431
|
},
|
|
945
1432
|
{
|
|
946
|
-
name:
|
|
947
|
-
type:
|
|
1433
|
+
"name": "creator";
|
|
1434
|
+
"type": "pubkey";
|
|
948
1435
|
},
|
|
949
1436
|
{
|
|
950
|
-
name:
|
|
951
|
-
type:
|
|
1437
|
+
"name": "withdrawalAuthority";
|
|
1438
|
+
"type": {
|
|
1439
|
+
"option": "pubkey";
|
|
1440
|
+
};
|
|
952
1441
|
},
|
|
953
1442
|
{
|
|
954
|
-
name:
|
|
955
|
-
type:
|
|
1443
|
+
"name": "totalCompensationAmount";
|
|
1444
|
+
"type": "u64";
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
"name": "lastCompensationAmount";
|
|
1448
|
+
"type": "u64";
|
|
1449
|
+
},
|
|
1450
|
+
{
|
|
1451
|
+
"name": "lastCompensationEpoch";
|
|
1452
|
+
"type": "u64";
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
"name": "createdAt";
|
|
1456
|
+
"type": "i64";
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
"name": "isActive";
|
|
1460
|
+
"type": "bool";
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
"name": "bump";
|
|
1464
|
+
"type": "u8";
|
|
1465
|
+
}
|
|
1466
|
+
];
|
|
1467
|
+
};
|
|
1468
|
+
},
|
|
1469
|
+
{
|
|
1470
|
+
"name": "validatorRegistered";
|
|
1471
|
+
"type": {
|
|
1472
|
+
"kind": "struct";
|
|
1473
|
+
"fields": [
|
|
1474
|
+
{
|
|
1475
|
+
"name": "identity";
|
|
1476
|
+
"type": "pubkey";
|
|
1477
|
+
},
|
|
1478
|
+
{
|
|
1479
|
+
"name": "voteAccount";
|
|
1480
|
+
"type": "pubkey";
|
|
1481
|
+
},
|
|
1482
|
+
{
|
|
1483
|
+
"name": "timestamp";
|
|
1484
|
+
"type": "i64";
|
|
956
1485
|
}
|
|
957
1486
|
];
|
|
958
1487
|
};
|
|
959
1488
|
}
|
|
960
1489
|
];
|
|
1490
|
+
"constants": [
|
|
1491
|
+
{
|
|
1492
|
+
"name": "epochLockedSlotTail";
|
|
1493
|
+
"docs": [
|
|
1494
|
+
"Epoch slot index at the end of an epoch after which withdrawals are locked"
|
|
1495
|
+
];
|
|
1496
|
+
"type": "u64";
|
|
1497
|
+
"value": "420000";
|
|
1498
|
+
}
|
|
1499
|
+
];
|
|
961
1500
|
};
|
|
962
1501
|
|
|
963
|
-
type GlobalState =
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1502
|
+
type GlobalState = IdlAccounts<Jbond>['globalState'];
|
|
1503
|
+
type BondState = IdlAccounts<Jbond>['bondState'];
|
|
1504
|
+
type ValidatorBond = IdlAccounts<Jbond>['validatorBond'];
|
|
1505
|
+
type BondType = IdlTypes<Jbond>['bondType'];
|
|
1506
|
+
type CollateralType = IdlTypes<Jbond>['collateralType'];
|
|
1507
|
+
type BondStateStats = {
|
|
1508
|
+
totalCollected: number;
|
|
1509
|
+
status: SessionStatus;
|
|
969
1510
|
};
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
creator: PublicKey;
|
|
974
|
-
withdrawalAuthority: PublicKey | null;
|
|
975
|
-
totalCompensationAmount: BN;
|
|
976
|
-
lastCompensationAmount: BN;
|
|
977
|
-
lastCompensationEpoch: BN;
|
|
978
|
-
isActive: boolean;
|
|
979
|
-
createdAt: BN;
|
|
980
|
-
bump: number;
|
|
1511
|
+
declare const bondTypeToSeed: {
|
|
1512
|
+
performance: Seeds;
|
|
1513
|
+
crowdfunding: Seeds;
|
|
981
1514
|
};
|
|
982
|
-
|
|
1515
|
+
declare const BondTypeVariant: {
|
|
1516
|
+
Performance: BondType;
|
|
1517
|
+
Crowdfunding: BondType;
|
|
1518
|
+
};
|
|
1519
|
+
type GlobalInitializeProps = {
|
|
983
1520
|
authority?: PublicKey;
|
|
1521
|
+
};
|
|
1522
|
+
type BondInitializeProps = {
|
|
1523
|
+
bondType: BondType;
|
|
1524
|
+
name: string;
|
|
1525
|
+
authority?: PublicKey;
|
|
1526
|
+
collateralType: CollateralType;
|
|
984
1527
|
reserve: PublicKey;
|
|
985
1528
|
};
|
|
986
1529
|
type RegisterValidatorProps = {
|
|
1530
|
+
bondType: BondType;
|
|
1531
|
+
name: string;
|
|
987
1532
|
identity: PublicKey;
|
|
988
1533
|
voteAccount: PublicKey;
|
|
989
|
-
initialCollateral: number;
|
|
990
1534
|
creator?: PublicKey;
|
|
991
1535
|
};
|
|
992
1536
|
type TopUpCollateralProps = {
|
|
993
|
-
|
|
1537
|
+
bondType: BondType;
|
|
1538
|
+
name: string;
|
|
1539
|
+
identity: PublicKey;
|
|
994
1540
|
voteAccount: PublicKey;
|
|
1541
|
+
collateral: BondCollateral;
|
|
995
1542
|
payer?: PublicKey;
|
|
996
1543
|
};
|
|
997
1544
|
type WithdrawCollateralProps = {
|
|
998
|
-
|
|
1545
|
+
bondType: BondType;
|
|
1546
|
+
name: string;
|
|
1547
|
+
withdraw: BondCollateral;
|
|
999
1548
|
voteAccount: PublicKey;
|
|
1000
1549
|
destination?: PublicKey;
|
|
1001
1550
|
withdrawalAuthority?: PublicKey;
|
|
1002
1551
|
};
|
|
1003
1552
|
type ClaimProps = {
|
|
1004
|
-
|
|
1553
|
+
bondType: BondType;
|
|
1554
|
+
name: string;
|
|
1555
|
+
claim: BondCollateral;
|
|
1005
1556
|
voteAccount: PublicKey;
|
|
1006
1557
|
reserve?: PublicKey;
|
|
1007
1558
|
authority?: PublicKey;
|
|
@@ -1018,12 +1569,20 @@ type GetHistoryGroupedProps = {
|
|
|
1018
1569
|
voteAccount: PublicKey;
|
|
1019
1570
|
epochsCount?: number;
|
|
1020
1571
|
};
|
|
1021
|
-
type
|
|
1572
|
+
type BondConfigureProps = {
|
|
1573
|
+
bondType: BondType;
|
|
1574
|
+
name: string;
|
|
1022
1575
|
authority?: PublicKey;
|
|
1023
1576
|
newAuthority?: PublicKey;
|
|
1024
1577
|
newReserve?: PublicKey;
|
|
1025
1578
|
};
|
|
1579
|
+
type GlobalConfigureProps = {
|
|
1580
|
+
authority?: PublicKey;
|
|
1581
|
+
newAuthority?: PublicKey;
|
|
1582
|
+
};
|
|
1026
1583
|
type SetWithdrawAuthorityProps = {
|
|
1584
|
+
bondType: BondType;
|
|
1585
|
+
name: string;
|
|
1027
1586
|
voteAccount: PublicKey;
|
|
1028
1587
|
newWithdrawAuthority?: PublicKey | null;
|
|
1029
1588
|
identity?: PublicKey;
|
|
@@ -1049,6 +1608,34 @@ declare enum BondTransactionType {
|
|
|
1049
1608
|
Withdrawal = "withdrawal",
|
|
1050
1609
|
Compensation = "compensation"
|
|
1051
1610
|
}
|
|
1611
|
+
type BondCollateral = {
|
|
1612
|
+
amount?: number;
|
|
1613
|
+
mint?: PublicKey;
|
|
1614
|
+
stakeAccount?: PublicKey;
|
|
1615
|
+
};
|
|
1616
|
+
declare enum SessionStatus {
|
|
1617
|
+
Live = 0,
|
|
1618
|
+
Finished = 1
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
type GetHistoryOpts = {
|
|
1622
|
+
cluster?: 'mainnet-beta' | 'testnet' | 'devnet';
|
|
1623
|
+
limit?: number;
|
|
1624
|
+
before?: string;
|
|
1625
|
+
until?: string;
|
|
1626
|
+
};
|
|
1627
|
+
declare class HistoryManager {
|
|
1628
|
+
private program;
|
|
1629
|
+
private connection;
|
|
1630
|
+
private programId;
|
|
1631
|
+
private discCache;
|
|
1632
|
+
constructor(program: Program<Jbond>, connection: Connection, programId: PublicKey);
|
|
1633
|
+
getHistory(bondType: BondType, vote: PublicKeyInitData, pdaDeriver: (bondType: BondType, vote: PublicKeyInitData) => [PublicKey, number], options?: GetHistoryOpts): Promise<TransactionHistoryItem[]>;
|
|
1634
|
+
private fetchSignaturesForAddress;
|
|
1635
|
+
private fetchParsedTransactions;
|
|
1636
|
+
private getInstructionDiscriminator;
|
|
1637
|
+
private decodeInstructionData;
|
|
1638
|
+
}
|
|
1052
1639
|
|
|
1053
1640
|
type Wallet = {
|
|
1054
1641
|
publicKey: PublicKey;
|
|
@@ -1076,14 +1663,14 @@ declare enum BondClientEnv {
|
|
|
1076
1663
|
* Options for configuring the JBondClient.
|
|
1077
1664
|
*/
|
|
1078
1665
|
type ClientOptions = {
|
|
1079
|
-
programId?: PublicKey;
|
|
1080
1666
|
debug?: boolean;
|
|
1081
1667
|
} & Record<string, any>;
|
|
1082
1668
|
declare class JBondClient {
|
|
1083
|
-
readonly provider:
|
|
1669
|
+
readonly provider: Provider;
|
|
1084
1670
|
readonly options: ClientOptions;
|
|
1085
1671
|
readonly program: Program<Jbond>;
|
|
1086
|
-
|
|
1672
|
+
readonly history: HistoryManager;
|
|
1673
|
+
constructor(provider: Provider, options?: ClientOptions);
|
|
1087
1674
|
/**
|
|
1088
1675
|
* Creates an instance of `JBondClient` using a provided connection and wallet.
|
|
1089
1676
|
*/
|
|
@@ -1095,7 +1682,7 @@ declare class JBondClient {
|
|
|
1095
1682
|
/**
|
|
1096
1683
|
* Get the current program ID.
|
|
1097
1684
|
*/
|
|
1098
|
-
get programId():
|
|
1685
|
+
get programId(): any;
|
|
1099
1686
|
/**
|
|
1100
1687
|
* Get the current connection.
|
|
1101
1688
|
*/
|
|
@@ -1108,131 +1695,150 @@ declare class JBondClient {
|
|
|
1108
1695
|
* Configure a specific option.
|
|
1109
1696
|
*/
|
|
1110
1697
|
configureEnv<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
|
|
1698
|
+
private getBondTypeSeed;
|
|
1111
1699
|
/**
|
|
1112
1700
|
* Program Derived Addresses (PDAs)
|
|
1113
1701
|
*/
|
|
1114
1702
|
pda: {
|
|
1115
1703
|
globalState: () => [PublicKey, number];
|
|
1116
|
-
|
|
1704
|
+
bondState: (bondType: BondType, bondName: string) => [PublicKey, number];
|
|
1705
|
+
validatorBond: (bondType: BondType, bondName: string, vote: PublicKeyInitData) => [PublicKey, number];
|
|
1117
1706
|
};
|
|
1707
|
+
globalInitialize(props: GlobalInitializeProps): Promise<string | undefined>;
|
|
1118
1708
|
/**
|
|
1119
1709
|
* Initialize the program
|
|
1120
1710
|
* Default authority is the provider's wallet
|
|
1121
1711
|
*/
|
|
1122
|
-
|
|
1712
|
+
bondInitialize(props: BondInitializeProps): Promise<string | undefined>;
|
|
1123
1713
|
/**
|
|
1124
1714
|
* Register a new validator
|
|
1125
1715
|
* Default creator is the provider's wallet
|
|
1126
1716
|
*/
|
|
1127
|
-
registerValidator(props: RegisterValidatorProps): Promise<string>;
|
|
1717
|
+
registerValidator(props: RegisterValidatorProps): Promise<string | undefined>;
|
|
1128
1718
|
/**
|
|
1129
1719
|
* Top up collateral
|
|
1130
1720
|
* Default payer is the provider's wallet
|
|
1131
1721
|
*/
|
|
1132
|
-
topUpCollateral(props: TopUpCollateralProps): Promise<string>;
|
|
1722
|
+
topUpCollateral(props: TopUpCollateralProps): Promise<string | undefined>;
|
|
1133
1723
|
/**
|
|
1134
1724
|
* Withdraw collateral
|
|
1135
1725
|
* Default withdrawal authority is the provider's wallet
|
|
1136
1726
|
* Default destination is the provider's wallet
|
|
1137
1727
|
* @return Transaction signature
|
|
1138
1728
|
*/
|
|
1139
|
-
withdrawCollateral(props: WithdrawCollateralProps): Promise<string>;
|
|
1729
|
+
withdrawCollateral(props: WithdrawCollateralProps): Promise<string | undefined>;
|
|
1140
1730
|
/**
|
|
1141
1731
|
* Claim compensation
|
|
1142
1732
|
* Default authority is the provider's wallet
|
|
1143
1733
|
* @return Transaction signature
|
|
1144
1734
|
*/
|
|
1145
|
-
claimCompensation(props: ClaimProps): Promise<string>;
|
|
1735
|
+
claimCompensation(props: ClaimProps): Promise<string | undefined>;
|
|
1146
1736
|
/**
|
|
1147
1737
|
* Update global configuration for the program
|
|
1148
1738
|
* Default authority is the provider's wallet
|
|
1149
1739
|
* Only the current authority can call this
|
|
1150
1740
|
* @return Transaction signature
|
|
1151
1741
|
*/
|
|
1152
|
-
|
|
1742
|
+
globalConfigure(props: GlobalConfigureProps): Promise<string | undefined>;
|
|
1743
|
+
/**
|
|
1744
|
+
* Update global configuration for the program
|
|
1745
|
+
* Default authority is the provider's wallet
|
|
1746
|
+
* Only the current authority can call this
|
|
1747
|
+
* @return Transaction signature
|
|
1748
|
+
*/
|
|
1749
|
+
bondConfigure(props: BondConfigureProps): Promise<string | undefined>;
|
|
1153
1750
|
/**
|
|
1154
1751
|
* Set withdrawal authority for validator bond
|
|
1155
1752
|
* Only the validator identity can call this
|
|
1156
1753
|
* Default identity is the provider's wallet
|
|
1157
1754
|
* @return Transaction signature
|
|
1158
1755
|
*/
|
|
1159
|
-
setWithdrawAuthority(props: SetWithdrawAuthorityProps): Promise<string>;
|
|
1756
|
+
setWithdrawAuthority(props: SetWithdrawAuthorityProps): Promise<string | undefined>;
|
|
1757
|
+
bondStart(props: {
|
|
1758
|
+
bondType: BondType;
|
|
1759
|
+
name: string;
|
|
1760
|
+
duration_secs: number;
|
|
1761
|
+
}): Promise<string | undefined>;
|
|
1762
|
+
bondFinish(props: {
|
|
1763
|
+
bondType: BondType;
|
|
1764
|
+
name: string;
|
|
1765
|
+
}): Promise<string | undefined>;
|
|
1766
|
+
buildBondGlobalStateInitializeIx(props: GlobalInitializeProps): Promise<TransactionInstruction>;
|
|
1160
1767
|
/**
|
|
1161
|
-
* Build
|
|
1162
|
-
*/
|
|
1163
|
-
buildInitializeInstruction(props: InitializeProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1164
|
-
/**
|
|
1165
|
-
* Build register validator instruction
|
|
1166
|
-
*/
|
|
1167
|
-
buildRegisterValidatorInstruction(props: RegisterValidatorProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1168
|
-
/**
|
|
1169
|
-
* Build top up collateral instruction
|
|
1170
|
-
*/
|
|
1171
|
-
buildTopUpCollateralInstruction(props: TopUpCollateralProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1172
|
-
/**
|
|
1173
|
-
* Build withdraw collateral instruction
|
|
1768
|
+
* Build configure instruction
|
|
1174
1769
|
*/
|
|
1175
|
-
|
|
1770
|
+
buildGlobalConfigureInstruction(props: GlobalConfigureProps): Promise<TransactionInstruction>;
|
|
1176
1771
|
/**
|
|
1177
|
-
* Build
|
|
1772
|
+
* Build initialize instruction
|
|
1178
1773
|
*/
|
|
1179
|
-
|
|
1774
|
+
buildBondInitializeIx(props: BondInitializeProps): Promise<TransactionInstruction>;
|
|
1775
|
+
buildConfigureIx(props: BondConfigureProps): Promise<TransactionInstruction>;
|
|
1776
|
+
buildRegisterIx(props: RegisterValidatorProps): Promise<TransactionInstruction>;
|
|
1777
|
+
buildTopUpIXs(props: TopUpCollateralProps): Promise<TransactionInstruction[]>;
|
|
1778
|
+
buildWithdrawIx(props: WithdrawCollateralProps): Promise<TransactionInstruction>;
|
|
1779
|
+
buildClaimIx(props: ClaimProps): Promise<TransactionInstruction>;
|
|
1780
|
+
buildSetWithdrawAuthorityIx(props: SetWithdrawAuthorityProps): Promise<TransactionInstruction>;
|
|
1781
|
+
buildBondFinishIx(_props: {
|
|
1782
|
+
bondType: BondType;
|
|
1783
|
+
name: string;
|
|
1784
|
+
}): Promise<TransactionInstruction>;
|
|
1785
|
+
buildBondStartIx(props: {
|
|
1786
|
+
bondType: BondType;
|
|
1787
|
+
name: string;
|
|
1788
|
+
duration_secs: number;
|
|
1789
|
+
}): Promise<TransactionInstruction>;
|
|
1180
1790
|
/**
|
|
1181
|
-
*
|
|
1791
|
+
* Fetch global state or throw if not found
|
|
1182
1792
|
*/
|
|
1183
|
-
|
|
1793
|
+
getGlobalState(): Promise<GlobalState>;
|
|
1794
|
+
getBondState(bondType: BondType, bondName: string): Promise<BondState>;
|
|
1184
1795
|
/**
|
|
1185
|
-
*
|
|
1796
|
+
* Get all bond states with total collected collateral
|
|
1186
1797
|
*/
|
|
1187
|
-
|
|
1798
|
+
getAllBondStates(bondType: BondType): Promise<Array<[BondState, BondStateStats]>>;
|
|
1188
1799
|
/**
|
|
1189
|
-
*
|
|
1800
|
+
* Get session status for bond state
|
|
1190
1801
|
*/
|
|
1191
|
-
|
|
1802
|
+
private getBondStateSessionStatus;
|
|
1803
|
+
/** Get all validator bonds for a given bond state */
|
|
1804
|
+
private getValidatorBondsByState;
|
|
1192
1805
|
/**
|
|
1193
1806
|
* Fetch validator bond data or null if not found
|
|
1807
|
+
* @param bondType
|
|
1808
|
+
* @param bondName
|
|
1194
1809
|
* @param vote
|
|
1195
1810
|
*/
|
|
1196
|
-
getValidatorBond(vote: PublicKeyInitData): Promise<ValidatorBond | null>;
|
|
1811
|
+
getValidatorBond(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<ValidatorBond | null>;
|
|
1197
1812
|
/**
|
|
1198
|
-
* Get
|
|
1199
|
-
* @param vote - Vote account public key
|
|
1200
|
-
* @return Balance in SOL
|
|
1813
|
+
* Get bond collateral type
|
|
1201
1814
|
*/
|
|
1202
|
-
|
|
1815
|
+
getBondCollateralType(bondType: BondType, bondName: string): Promise<CollateralType>;
|
|
1203
1816
|
/**
|
|
1204
|
-
* Get
|
|
1205
|
-
* @param
|
|
1206
|
-
* @param
|
|
1207
|
-
* @
|
|
1817
|
+
* Get validator bond account balance (in SOL)
|
|
1818
|
+
* @param bondType - Type of the bond
|
|
1819
|
+
* @param bondName - Name of the bond
|
|
1820
|
+
* @param vote - Vote account public key
|
|
1821
|
+
* @return Balance in lamports
|
|
1208
1822
|
*/
|
|
1209
|
-
|
|
1823
|
+
getValidatorBondBalance(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<number>;
|
|
1210
1824
|
/**
|
|
1211
|
-
*
|
|
1825
|
+
* Load stake pool account and cache it if not already cached
|
|
1826
|
+
* @private
|
|
1212
1827
|
*/
|
|
1213
|
-
|
|
1214
|
-
cluster?: 'mainnet-beta' | 'testnet' | 'devnet';
|
|
1215
|
-
limit?: number;
|
|
1216
|
-
before?: string;
|
|
1217
|
-
until?: string;
|
|
1218
|
-
}): Promise<TransactionHistoryItem[]>;
|
|
1828
|
+
private loadStakePoolAccount;
|
|
1219
1829
|
/**
|
|
1220
|
-
*
|
|
1221
|
-
* @param voteAccount
|
|
1222
|
-
* @param pageSize
|
|
1830
|
+
* Manages the interaction with a stake pool, allowing deposits and withdrawals of SOL.
|
|
1223
1831
|
*/
|
|
1224
|
-
|
|
1832
|
+
stakePoolManager(props?: {
|
|
1833
|
+
user?: PublicKey;
|
|
1834
|
+
}): Promise<StakePoolManager>;
|
|
1225
1835
|
/**
|
|
1226
|
-
*
|
|
1227
|
-
*
|
|
1228
|
-
*
|
|
1836
|
+
* Ensures that a valid user is provided. If a user is not explicitly passed
|
|
1837
|
+
* in the properties, it defaults to the provider's public key.
|
|
1838
|
+
* Throws an error if no user is available.
|
|
1229
1839
|
*/
|
|
1230
|
-
private
|
|
1840
|
+
private ensureUser;
|
|
1841
|
+
private lamports;
|
|
1231
1842
|
}
|
|
1232
1843
|
|
|
1233
|
-
|
|
1234
|
-
* Program IDs for different environments
|
|
1235
|
-
*/
|
|
1236
|
-
declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
1237
|
-
|
|
1238
|
-
export { BondClientEnv, BondTransactionType, type ClaimProps, type ClientOptions, type ConfigureProps, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalState, type InitializeProps, JBondClient, type Jbond, NodeWallet, type RegisterValidatorProps, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps };
|
|
1844
|
+
export { BondClientEnv, type BondCollateral, type BondConfigureProps, type BondInitializeProps, type BondState, type BondStateStats, BondTransactionType, type BondType, BondTypeVariant, type ClaimProps, type ClientOptions, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JPOOL_STAKE_POOL, type Jbond, NodeWallet, type RegisterValidatorProps, Seeds, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps, bondTypeToSeed };
|