@solana-mobile/guardian-client 0.0.0-stage → 0.1.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.
- package/README.md +8 -2
- package/dist/src/index.js +4641 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/index.mjs +4282 -0
- package/dist/src/index.mjs.map +1 -0
- package/dist/types/generated/accounts/appAccount.d.ts +50 -0
- package/dist/types/generated/accounts/guardiansConfig.d.ts +54 -0
- package/dist/types/generated/accounts/index.d.ts +10 -0
- package/dist/types/generated/accounts/pendingRegistry.d.ts +35 -0
- package/dist/types/generated/constants/guardian.d.ts +8 -0
- package/dist/types/generated/constants/index.d.ts +8 -0
- package/dist/types/generated/errors/guardian.d.ts +95 -0
- package/dist/types/generated/errors/index.d.ts +8 -0
- package/dist/types/generated/events/appAuthorityAccepted.d.ts +42 -0
- package/dist/types/generated/events/appAuthorityProposed.d.ts +42 -0
- package/dist/types/generated/events/appDeveloperUpdated.d.ts +42 -0
- package/dist/types/generated/events/appRegistered.d.ts +42 -0
- package/dist/types/generated/events/configAuthorityAccepted.d.ts +38 -0
- package/dist/types/generated/events/configAuthorityProposed.d.ts +38 -0
- package/dist/types/generated/events/configInitialized.d.ts +46 -0
- package/dist/types/generated/events/configUpdated.d.ts +52 -0
- package/dist/types/generated/events/guardianAdded.d.ts +34 -0
- package/dist/types/generated/events/guardianRegistered.d.ts +46 -0
- package/dist/types/generated/events/guardianRemoved.d.ts +42 -0
- package/dist/types/generated/events/guardianVoteAuthorityRotated.d.ts +42 -0
- package/dist/types/generated/events/index.d.ts +25 -0
- package/dist/types/generated/events/releaseApproved.d.ts +27 -0
- package/dist/types/generated/events/releaseCancelled.d.ts +38 -0
- package/dist/types/generated/events/releaseExpired.d.ts +38 -0
- package/dist/types/generated/events/releaseProposed.d.ts +42 -0
- package/dist/types/generated/events/releaseRejected.d.ts +27 -0
- package/dist/types/generated/events/voteCast.d.ts +55 -0
- package/dist/types/generated/index.d.ts +15 -0
- package/dist/types/generated/instructions/acceptAppAuthority.d.ts +71 -0
- package/dist/types/generated/instructions/acceptConfigAuthority.d.ts +71 -0
- package/dist/types/generated/instructions/addGuardian.d.ts +90 -0
- package/dist/types/generated/instructions/cancelRelease.d.ts +78 -0
- package/dist/types/generated/instructions/expireRelease.d.ts +71 -0
- package/dist/types/generated/instructions/index.d.ts +24 -0
- package/dist/types/generated/instructions/initializeConfig.d.ts +135 -0
- package/dist/types/generated/instructions/proposeAppAuthority.d.ts +76 -0
- package/dist/types/generated/instructions/proposeConfigAuthority.d.ts +76 -0
- package/dist/types/generated/instructions/proposeRelease.d.ts +121 -0
- package/dist/types/generated/instructions/registerApp.d.ts +87 -0
- package/dist/types/generated/instructions/registerGuardian.d.ts +120 -0
- package/dist/types/generated/instructions/removeGuardian.d.ts +120 -0
- package/dist/types/generated/instructions/rotateVoteAuthority.d.ts +80 -0
- package/dist/types/generated/instructions/setAppDeveloper.d.ts +112 -0
- package/dist/types/generated/instructions/updateConfig.d.ts +88 -0
- package/dist/types/generated/instructions/vote.d.ts +116 -0
- package/dist/types/generated/instructions/writeReleaseManifest.d.ts +104 -0
- package/dist/types/generated/pdas/bondVault.d.ts +11 -0
- package/dist/types/generated/pdas/guardiansConfig.d.ts +11 -0
- package/dist/types/generated/pdas/index.d.ts +10 -0
- package/dist/types/generated/pdas/pendingRegistry.d.ts +11 -0
- package/dist/types/generated/programs/guardian.d.ts +179 -0
- package/dist/types/generated/programs/index.d.ts +8 -0
- package/dist/types/generated/types/bondInfo.d.ts +19 -0
- package/dist/types/generated/types/guardianInfo.d.ts +19 -0
- package/dist/types/generated/types/index.d.ts +14 -0
- package/dist/types/generated/types/pendingRelease.d.ts +29 -0
- package/dist/types/generated/types/publishedApp.d.ts +16 -0
- package/dist/types/generated/types/releaseManifest.d.ts +45 -0
- package/dist/types/generated/types/releaseResolution.d.ts +65 -0
- package/dist/types/generated/types/voteFinding.d.ts +24 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/manifest.d.ts +72 -0
- package/dist/types/proposal.d.ts +66 -0
- package/package.json +58 -3
|
@@ -0,0 +1,4641 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var kit = require('@solana/kit');
|
|
4
|
+
var programClientCore = require('@solana/program-client-core');
|
|
5
|
+
|
|
6
|
+
// src/generated/accounts/appAccount.ts
|
|
7
|
+
function getBondInfoEncoder() {
|
|
8
|
+
return kit.getStructEncoder([
|
|
9
|
+
["mint", kit.getAddressEncoder()],
|
|
10
|
+
["amount", kit.getU64Encoder()]
|
|
11
|
+
]);
|
|
12
|
+
}
|
|
13
|
+
function getBondInfoDecoder() {
|
|
14
|
+
return kit.getStructDecoder([
|
|
15
|
+
["mint", kit.getAddressDecoder()],
|
|
16
|
+
["amount", kit.getU64Decoder()]
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
function getBondInfoCodec() {
|
|
20
|
+
return kit.combineCodec(getBondInfoEncoder(), getBondInfoDecoder());
|
|
21
|
+
}
|
|
22
|
+
function getGuardianInfoEncoder() {
|
|
23
|
+
return kit.getStructEncoder([
|
|
24
|
+
["voteAuthority", kit.getAddressEncoder()],
|
|
25
|
+
["bond", kit.getU64Encoder()]
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
function getGuardianInfoDecoder() {
|
|
29
|
+
return kit.getStructDecoder([
|
|
30
|
+
["voteAuthority", kit.getAddressDecoder()],
|
|
31
|
+
["bond", kit.getU64Decoder()]
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
function getGuardianInfoCodec() {
|
|
35
|
+
return kit.combineCodec(getGuardianInfoEncoder(), getGuardianInfoDecoder());
|
|
36
|
+
}
|
|
37
|
+
function getPendingReleaseEncoder() {
|
|
38
|
+
return kit.getDiscriminatedUnionEncoder([
|
|
39
|
+
["None", kit.getUnitEncoder()],
|
|
40
|
+
["Pending", kit.getStructEncoder([["fields", kit.getTupleEncoder([getReleaseManifestEncoder()])]])]
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
function getPendingReleaseDecoder() {
|
|
44
|
+
return kit.getDiscriminatedUnionDecoder([
|
|
45
|
+
["None", kit.getUnitDecoder()],
|
|
46
|
+
["Pending", kit.getStructDecoder([["fields", kit.getTupleDecoder([getReleaseManifestDecoder()])]])]
|
|
47
|
+
]);
|
|
48
|
+
}
|
|
49
|
+
function getPendingReleaseCodec() {
|
|
50
|
+
return kit.combineCodec(getPendingReleaseEncoder(), getPendingReleaseDecoder());
|
|
51
|
+
}
|
|
52
|
+
function pendingRelease(kind, data) {
|
|
53
|
+
return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...data ?? {} };
|
|
54
|
+
}
|
|
55
|
+
function isPendingRelease(kind, value) {
|
|
56
|
+
return value.__kind === kind;
|
|
57
|
+
}
|
|
58
|
+
function getPublishedAppEncoder() {
|
|
59
|
+
return kit.getStructEncoder([
|
|
60
|
+
["versionCode", kit.getU32Encoder()],
|
|
61
|
+
["manifestHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)]
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
function getPublishedAppDecoder() {
|
|
65
|
+
return kit.getStructDecoder([
|
|
66
|
+
["versionCode", kit.getU32Decoder()],
|
|
67
|
+
["manifestHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)]
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
function getPublishedAppCodec() {
|
|
71
|
+
return kit.combineCodec(getPublishedAppEncoder(), getPublishedAppDecoder());
|
|
72
|
+
}
|
|
73
|
+
function getReleaseManifestEncoder() {
|
|
74
|
+
return kit.getStructEncoder([
|
|
75
|
+
["versionCode", kit.getU32Encoder()],
|
|
76
|
+
["finalized", kit.getBooleanEncoder()],
|
|
77
|
+
["guardianNonce", kit.getU32Encoder()],
|
|
78
|
+
["manifestHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
79
|
+
["policyBundleHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
80
|
+
["resolved", kit.getBooleanEncoder()],
|
|
81
|
+
["approved", kit.getBooleanEncoder()],
|
|
82
|
+
["quorumTs", kit.getI64Encoder()],
|
|
83
|
+
["votingDeadline", kit.getI64Encoder()],
|
|
84
|
+
["finalizeTs", kit.getI64Encoder()],
|
|
85
|
+
["finalizeSeq", kit.getU64Encoder()],
|
|
86
|
+
["previousFinalizeTs", kit.getI64Encoder()],
|
|
87
|
+
["certificateSha256", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
88
|
+
["data", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
89
|
+
["votes", kit.getMapEncoder(kit.getAddressEncoder(), kit.getBooleanEncoder())]
|
|
90
|
+
]);
|
|
91
|
+
}
|
|
92
|
+
function getReleaseManifestDecoder() {
|
|
93
|
+
return kit.getStructDecoder([
|
|
94
|
+
["versionCode", kit.getU32Decoder()],
|
|
95
|
+
["finalized", kit.getBooleanDecoder()],
|
|
96
|
+
["guardianNonce", kit.getU32Decoder()],
|
|
97
|
+
["manifestHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
98
|
+
["policyBundleHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
99
|
+
["resolved", kit.getBooleanDecoder()],
|
|
100
|
+
["approved", kit.getBooleanDecoder()],
|
|
101
|
+
["quorumTs", kit.getI64Decoder()],
|
|
102
|
+
["votingDeadline", kit.getI64Decoder()],
|
|
103
|
+
["finalizeTs", kit.getI64Decoder()],
|
|
104
|
+
["finalizeSeq", kit.getU64Decoder()],
|
|
105
|
+
["previousFinalizeTs", kit.getI64Decoder()],
|
|
106
|
+
["certificateSha256", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
107
|
+
["data", kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())],
|
|
108
|
+
["votes", kit.getMapDecoder(kit.getAddressDecoder(), kit.getBooleanDecoder())]
|
|
109
|
+
]);
|
|
110
|
+
}
|
|
111
|
+
function getReleaseManifestCodec() {
|
|
112
|
+
return kit.combineCodec(getReleaseManifestEncoder(), getReleaseManifestDecoder());
|
|
113
|
+
}
|
|
114
|
+
function getReleaseResolutionEncoder() {
|
|
115
|
+
return kit.getStructEncoder([
|
|
116
|
+
["version", kit.getU8Encoder()],
|
|
117
|
+
["seq", kit.getU64Encoder()],
|
|
118
|
+
["app", kit.getAddressEncoder()],
|
|
119
|
+
["versionCode", kit.getU32Encoder()],
|
|
120
|
+
["manifestHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
121
|
+
["certificateSha256", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
122
|
+
["guardianNonce", kit.getU32Encoder()],
|
|
123
|
+
["approvals", kit.getArrayEncoder(kit.getAddressEncoder())],
|
|
124
|
+
["rejections", kit.getArrayEncoder(kit.getAddressEncoder())],
|
|
125
|
+
["manifest", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())]
|
|
126
|
+
]);
|
|
127
|
+
}
|
|
128
|
+
function getReleaseResolutionDecoder() {
|
|
129
|
+
return kit.getStructDecoder([
|
|
130
|
+
["version", kit.getU8Decoder()],
|
|
131
|
+
["seq", kit.getU64Decoder()],
|
|
132
|
+
["app", kit.getAddressDecoder()],
|
|
133
|
+
["versionCode", kit.getU32Decoder()],
|
|
134
|
+
["manifestHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
135
|
+
["certificateSha256", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
136
|
+
["guardianNonce", kit.getU32Decoder()],
|
|
137
|
+
["approvals", kit.getArrayDecoder(kit.getAddressDecoder())],
|
|
138
|
+
["rejections", kit.getArrayDecoder(kit.getAddressDecoder())],
|
|
139
|
+
["manifest", kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())]
|
|
140
|
+
]);
|
|
141
|
+
}
|
|
142
|
+
function getReleaseResolutionCodec() {
|
|
143
|
+
return kit.combineCodec(getReleaseResolutionEncoder(), getReleaseResolutionDecoder());
|
|
144
|
+
}
|
|
145
|
+
function getVoteFindingEncoder() {
|
|
146
|
+
return kit.getStructEncoder([
|
|
147
|
+
["code", kit.getU16Encoder()],
|
|
148
|
+
["status", kit.getU8Encoder()],
|
|
149
|
+
["detail", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())]
|
|
150
|
+
]);
|
|
151
|
+
}
|
|
152
|
+
function getVoteFindingDecoder() {
|
|
153
|
+
return kit.getStructDecoder([
|
|
154
|
+
["code", kit.getU16Decoder()],
|
|
155
|
+
["status", kit.getU8Decoder()],
|
|
156
|
+
["detail", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())]
|
|
157
|
+
]);
|
|
158
|
+
}
|
|
159
|
+
function getVoteFindingCodec() {
|
|
160
|
+
return kit.combineCodec(getVoteFindingEncoder(), getVoteFindingDecoder());
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// src/generated/accounts/appAccount.ts
|
|
164
|
+
var APP_ACCOUNT_DISCRIMINATOR = new Uint8Array([189, 192, 243, 151, 141, 78, 227, 17]);
|
|
165
|
+
function getAppAccountDiscriminatorBytes() {
|
|
166
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(APP_ACCOUNT_DISCRIMINATOR);
|
|
167
|
+
}
|
|
168
|
+
function getAppAccountEncoder() {
|
|
169
|
+
return kit.transformEncoder(
|
|
170
|
+
kit.getStructEncoder([
|
|
171
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
172
|
+
["version", kit.getU8Encoder()],
|
|
173
|
+
["authority", kit.getAddressEncoder()],
|
|
174
|
+
["pendingAuthority", kit.getAddressEncoder()],
|
|
175
|
+
["eventSeq", kit.getU64Encoder()],
|
|
176
|
+
["lastResolvedVersion", kit.getU32Encoder()],
|
|
177
|
+
["lastFinalizeTs", kit.getI64Encoder()],
|
|
178
|
+
["signingCertificate", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
179
|
+
["name", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())],
|
|
180
|
+
["developers", kit.getSetEncoder(kit.getAddressEncoder())],
|
|
181
|
+
["publishedVersions", kit.getArrayEncoder(getPublishedAppEncoder())],
|
|
182
|
+
["pendingRelease", getPendingReleaseEncoder()]
|
|
183
|
+
]),
|
|
184
|
+
(value) => ({ ...value, discriminator: APP_ACCOUNT_DISCRIMINATOR })
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
function getAppAccountDecoder() {
|
|
188
|
+
return kit.getStructDecoder([
|
|
189
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
190
|
+
["version", kit.getU8Decoder()],
|
|
191
|
+
["authority", kit.getAddressDecoder()],
|
|
192
|
+
["pendingAuthority", kit.getAddressDecoder()],
|
|
193
|
+
["eventSeq", kit.getU64Decoder()],
|
|
194
|
+
["lastResolvedVersion", kit.getU32Decoder()],
|
|
195
|
+
["lastFinalizeTs", kit.getI64Decoder()],
|
|
196
|
+
["signingCertificate", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
197
|
+
["name", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())],
|
|
198
|
+
["developers", kit.getSetDecoder(kit.getAddressDecoder())],
|
|
199
|
+
["publishedVersions", kit.getArrayDecoder(getPublishedAppDecoder())],
|
|
200
|
+
["pendingRelease", getPendingReleaseDecoder()]
|
|
201
|
+
]);
|
|
202
|
+
}
|
|
203
|
+
function getAppAccountCodec() {
|
|
204
|
+
return kit.combineCodec(getAppAccountEncoder(), getAppAccountDecoder());
|
|
205
|
+
}
|
|
206
|
+
function decodeAppAccount(encodedAccount) {
|
|
207
|
+
return kit.decodeAccount(encodedAccount, getAppAccountDecoder());
|
|
208
|
+
}
|
|
209
|
+
async function fetchAppAccount(rpc, address, config) {
|
|
210
|
+
const maybeAccount = await fetchMaybeAppAccount(rpc, address, config);
|
|
211
|
+
kit.assertAccountExists(maybeAccount);
|
|
212
|
+
return maybeAccount;
|
|
213
|
+
}
|
|
214
|
+
async function fetchMaybeAppAccount(rpc, address, config) {
|
|
215
|
+
const maybeAccount = await kit.fetchEncodedAccount(
|
|
216
|
+
rpc,
|
|
217
|
+
typeof address === "string" ? address : address.address,
|
|
218
|
+
config
|
|
219
|
+
);
|
|
220
|
+
return decodeAppAccount(maybeAccount);
|
|
221
|
+
}
|
|
222
|
+
async function fetchAllAppAccount(rpc, addresses, config) {
|
|
223
|
+
const maybeAccounts = await fetchAllMaybeAppAccount(rpc, addresses, config);
|
|
224
|
+
kit.assertAccountsExist(maybeAccounts);
|
|
225
|
+
return maybeAccounts;
|
|
226
|
+
}
|
|
227
|
+
async function fetchAllMaybeAppAccount(rpc, addresses, config) {
|
|
228
|
+
const maybeAccounts = await kit.fetchEncodedAccounts(
|
|
229
|
+
rpc,
|
|
230
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
231
|
+
config
|
|
232
|
+
);
|
|
233
|
+
return maybeAccounts.map((maybeAccount) => decodeAppAccount(maybeAccount));
|
|
234
|
+
}
|
|
235
|
+
var GUARDIANS_CONFIG_DISCRIMINATOR = new Uint8Array([96, 9, 56, 96, 215, 120, 26, 206]);
|
|
236
|
+
function getGuardiansConfigDiscriminatorBytes() {
|
|
237
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(GUARDIANS_CONFIG_DISCRIMINATOR);
|
|
238
|
+
}
|
|
239
|
+
function getGuardiansConfigEncoder() {
|
|
240
|
+
return kit.transformEncoder(
|
|
241
|
+
kit.getStructEncoder([
|
|
242
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
243
|
+
["version", kit.getU8Encoder()],
|
|
244
|
+
["bump", kit.getU8Encoder()],
|
|
245
|
+
["authority", kit.getAddressEncoder()],
|
|
246
|
+
["pendingAuthority", kit.getAddressEncoder()],
|
|
247
|
+
["bond", getBondInfoEncoder()],
|
|
248
|
+
["updateNonce", kit.getU32Encoder()],
|
|
249
|
+
["eventSeq", kit.getU64Encoder()],
|
|
250
|
+
["policyBundleHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
251
|
+
["voteWindow", kit.getU32Encoder()],
|
|
252
|
+
["votingPeriod", kit.getU32Encoder()],
|
|
253
|
+
["pendingGuardians", kit.getSetEncoder(kit.getAddressEncoder())],
|
|
254
|
+
["guardians", kit.getMapEncoder(kit.getAddressEncoder(), getGuardianInfoEncoder())],
|
|
255
|
+
["voters", kit.getMapEncoder(kit.getAddressEncoder(), kit.getAddressEncoder())]
|
|
256
|
+
]),
|
|
257
|
+
(value) => ({ ...value, discriminator: GUARDIANS_CONFIG_DISCRIMINATOR })
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
function getGuardiansConfigDecoder() {
|
|
261
|
+
return kit.getStructDecoder([
|
|
262
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
263
|
+
["version", kit.getU8Decoder()],
|
|
264
|
+
["bump", kit.getU8Decoder()],
|
|
265
|
+
["authority", kit.getAddressDecoder()],
|
|
266
|
+
["pendingAuthority", kit.getAddressDecoder()],
|
|
267
|
+
["bond", getBondInfoDecoder()],
|
|
268
|
+
["updateNonce", kit.getU32Decoder()],
|
|
269
|
+
["eventSeq", kit.getU64Decoder()],
|
|
270
|
+
["policyBundleHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
271
|
+
["voteWindow", kit.getU32Decoder()],
|
|
272
|
+
["votingPeriod", kit.getU32Decoder()],
|
|
273
|
+
["pendingGuardians", kit.getSetDecoder(kit.getAddressDecoder())],
|
|
274
|
+
["guardians", kit.getMapDecoder(kit.getAddressDecoder(), getGuardianInfoDecoder())],
|
|
275
|
+
["voters", kit.getMapDecoder(kit.getAddressDecoder(), kit.getAddressDecoder())]
|
|
276
|
+
]);
|
|
277
|
+
}
|
|
278
|
+
function getGuardiansConfigCodec() {
|
|
279
|
+
return kit.combineCodec(getGuardiansConfigEncoder(), getGuardiansConfigDecoder());
|
|
280
|
+
}
|
|
281
|
+
function decodeGuardiansConfig(encodedAccount) {
|
|
282
|
+
return kit.decodeAccount(encodedAccount, getGuardiansConfigDecoder());
|
|
283
|
+
}
|
|
284
|
+
async function fetchGuardiansConfig(rpc, address, config) {
|
|
285
|
+
const maybeAccount = await fetchMaybeGuardiansConfig(rpc, address, config);
|
|
286
|
+
kit.assertAccountExists(maybeAccount);
|
|
287
|
+
return maybeAccount;
|
|
288
|
+
}
|
|
289
|
+
async function fetchMaybeGuardiansConfig(rpc, address, config) {
|
|
290
|
+
const maybeAccount = await kit.fetchEncodedAccount(
|
|
291
|
+
rpc,
|
|
292
|
+
typeof address === "string" ? address : address.address,
|
|
293
|
+
config
|
|
294
|
+
);
|
|
295
|
+
return decodeGuardiansConfig(maybeAccount);
|
|
296
|
+
}
|
|
297
|
+
async function fetchAllGuardiansConfig(rpc, addresses, config) {
|
|
298
|
+
const maybeAccounts = await fetchAllMaybeGuardiansConfig(rpc, addresses, config);
|
|
299
|
+
kit.assertAccountsExist(maybeAccounts);
|
|
300
|
+
return maybeAccounts;
|
|
301
|
+
}
|
|
302
|
+
async function fetchAllMaybeGuardiansConfig(rpc, addresses, config) {
|
|
303
|
+
const maybeAccounts = await kit.fetchEncodedAccounts(
|
|
304
|
+
rpc,
|
|
305
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
306
|
+
config
|
|
307
|
+
);
|
|
308
|
+
return maybeAccounts.map((maybeAccount) => decodeGuardiansConfig(maybeAccount));
|
|
309
|
+
}
|
|
310
|
+
var PENDING_REGISTRY_DISCRIMINATOR = new Uint8Array([190, 252, 14, 196, 56, 47, 120, 61]);
|
|
311
|
+
function getPendingRegistryDiscriminatorBytes() {
|
|
312
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(PENDING_REGISTRY_DISCRIMINATOR);
|
|
313
|
+
}
|
|
314
|
+
function getPendingRegistryEncoder() {
|
|
315
|
+
return kit.transformEncoder(
|
|
316
|
+
kit.getStructEncoder([
|
|
317
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
318
|
+
["version", kit.getU8Encoder()],
|
|
319
|
+
["bump", kit.getU8Encoder()],
|
|
320
|
+
["finalizeSeq", kit.getU64Encoder()],
|
|
321
|
+
["pending", kit.getSetEncoder(kit.getAddressEncoder())]
|
|
322
|
+
]),
|
|
323
|
+
(value) => ({ ...value, discriminator: PENDING_REGISTRY_DISCRIMINATOR })
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
function getPendingRegistryDecoder() {
|
|
327
|
+
return kit.getStructDecoder([
|
|
328
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
329
|
+
["version", kit.getU8Decoder()],
|
|
330
|
+
["bump", kit.getU8Decoder()],
|
|
331
|
+
["finalizeSeq", kit.getU64Decoder()],
|
|
332
|
+
["pending", kit.getSetDecoder(kit.getAddressDecoder())]
|
|
333
|
+
]);
|
|
334
|
+
}
|
|
335
|
+
function getPendingRegistryCodec() {
|
|
336
|
+
return kit.combineCodec(getPendingRegistryEncoder(), getPendingRegistryDecoder());
|
|
337
|
+
}
|
|
338
|
+
function decodePendingRegistry(encodedAccount) {
|
|
339
|
+
return kit.decodeAccount(encodedAccount, getPendingRegistryDecoder());
|
|
340
|
+
}
|
|
341
|
+
async function fetchPendingRegistry(rpc, address, config) {
|
|
342
|
+
const maybeAccount = await fetchMaybePendingRegistry(rpc, address, config);
|
|
343
|
+
kit.assertAccountExists(maybeAccount);
|
|
344
|
+
return maybeAccount;
|
|
345
|
+
}
|
|
346
|
+
async function fetchMaybePendingRegistry(rpc, address, config) {
|
|
347
|
+
const maybeAccount = await kit.fetchEncodedAccount(
|
|
348
|
+
rpc,
|
|
349
|
+
typeof address === "string" ? address : address.address,
|
|
350
|
+
config
|
|
351
|
+
);
|
|
352
|
+
return decodePendingRegistry(maybeAccount);
|
|
353
|
+
}
|
|
354
|
+
async function fetchAllPendingRegistry(rpc, addresses, config) {
|
|
355
|
+
const maybeAccounts = await fetchAllMaybePendingRegistry(rpc, addresses, config);
|
|
356
|
+
kit.assertAccountsExist(maybeAccounts);
|
|
357
|
+
return maybeAccounts;
|
|
358
|
+
}
|
|
359
|
+
async function fetchAllMaybePendingRegistry(rpc, addresses, config) {
|
|
360
|
+
const maybeAccounts = await kit.fetchEncodedAccounts(
|
|
361
|
+
rpc,
|
|
362
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
363
|
+
config
|
|
364
|
+
);
|
|
365
|
+
return maybeAccounts.map((maybeAccount) => decodePendingRegistry(maybeAccount));
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// src/generated/constants/guardian.ts
|
|
369
|
+
var MAX_MANIFEST_LEN = 8051;
|
|
370
|
+
var ACCEPT_APP_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
371
|
+
227,
|
|
372
|
+
109,
|
|
373
|
+
248,
|
|
374
|
+
178,
|
|
375
|
+
27,
|
|
376
|
+
2,
|
|
377
|
+
126,
|
|
378
|
+
21
|
|
379
|
+
]);
|
|
380
|
+
function getAcceptAppAuthorityDiscriminatorBytes() {
|
|
381
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(ACCEPT_APP_AUTHORITY_DISCRIMINATOR);
|
|
382
|
+
}
|
|
383
|
+
function getAcceptAppAuthorityInstructionDataEncoder() {
|
|
384
|
+
return kit.transformEncoder(kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]), (value) => ({
|
|
385
|
+
...value,
|
|
386
|
+
discriminator: ACCEPT_APP_AUTHORITY_DISCRIMINATOR
|
|
387
|
+
}));
|
|
388
|
+
}
|
|
389
|
+
function getAcceptAppAuthorityInstructionDataDecoder() {
|
|
390
|
+
return kit.getStructDecoder([["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)]]);
|
|
391
|
+
}
|
|
392
|
+
function getAcceptAppAuthorityInstructionDataCodec() {
|
|
393
|
+
return kit.combineCodec(getAcceptAppAuthorityInstructionDataEncoder(), getAcceptAppAuthorityInstructionDataDecoder());
|
|
394
|
+
}
|
|
395
|
+
async function getAcceptAppAuthorityInstructionAsync(input, config) {
|
|
396
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
397
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
398
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
399
|
+
const originalAccounts = {
|
|
400
|
+
newAuthority: { value: input.newAuthority ?? null, isSigner: true, isWritable: false },
|
|
401
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
402
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
403
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
404
|
+
};
|
|
405
|
+
const accounts = originalAccounts;
|
|
406
|
+
if (!accounts.eventAuthority.value) {
|
|
407
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
408
|
+
programAddress,
|
|
409
|
+
seeds: [
|
|
410
|
+
kit.getBytesEncoder().encode(
|
|
411
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
412
|
+
)
|
|
413
|
+
]
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
if (!accounts.program.value) {
|
|
417
|
+
accounts.program.value = programAddress;
|
|
418
|
+
accounts.program.isWritable = false;
|
|
419
|
+
}
|
|
420
|
+
return Object.freeze({
|
|
421
|
+
accounts: [
|
|
422
|
+
getAccountMeta("newAuthority", accounts.newAuthority),
|
|
423
|
+
getAccountMeta("app", accounts.app),
|
|
424
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
425
|
+
getAccountMeta("program", accounts.program)
|
|
426
|
+
],
|
|
427
|
+
data: getAcceptAppAuthorityInstructionDataEncoder().encode({}),
|
|
428
|
+
programAddress
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
function getAcceptAppAuthorityInstruction(input, config) {
|
|
432
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
433
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
434
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
435
|
+
const originalAccounts = {
|
|
436
|
+
newAuthority: { value: input.newAuthority ?? null, isSigner: true, isWritable: false },
|
|
437
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
438
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
439
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
440
|
+
};
|
|
441
|
+
const accounts = originalAccounts;
|
|
442
|
+
if (!accounts.program.value) {
|
|
443
|
+
accounts.program.value = programAddress;
|
|
444
|
+
accounts.program.isWritable = false;
|
|
445
|
+
}
|
|
446
|
+
return Object.freeze({
|
|
447
|
+
accounts: [
|
|
448
|
+
getAccountMeta("newAuthority", accounts.newAuthority),
|
|
449
|
+
getAccountMeta("app", accounts.app),
|
|
450
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
451
|
+
getAccountMeta("program", accounts.program)
|
|
452
|
+
],
|
|
453
|
+
data: getAcceptAppAuthorityInstructionDataEncoder().encode({}),
|
|
454
|
+
programAddress
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
function parseAcceptAppAuthorityInstruction(instruction) {
|
|
458
|
+
if (instruction.accounts.length < 4) {
|
|
459
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
460
|
+
actualAccountMetas: instruction.accounts.length,
|
|
461
|
+
expectedAccountMetas: 4
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
let accountIndex = 0;
|
|
465
|
+
const getNextAccount = () => {
|
|
466
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
467
|
+
accountIndex += 1;
|
|
468
|
+
return accountMeta;
|
|
469
|
+
};
|
|
470
|
+
return {
|
|
471
|
+
programAddress: instruction.programAddress,
|
|
472
|
+
accounts: {
|
|
473
|
+
newAuthority: getNextAccount(),
|
|
474
|
+
app: getNextAccount(),
|
|
475
|
+
eventAuthority: getNextAccount(),
|
|
476
|
+
program: getNextAccount()
|
|
477
|
+
},
|
|
478
|
+
data: getAcceptAppAuthorityInstructionDataDecoder().decode(instruction.data)
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
var ACCEPT_CONFIG_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
482
|
+
138,
|
|
483
|
+
34,
|
|
484
|
+
130,
|
|
485
|
+
16,
|
|
486
|
+
252,
|
|
487
|
+
207,
|
|
488
|
+
24,
|
|
489
|
+
90
|
|
490
|
+
]);
|
|
491
|
+
function getAcceptConfigAuthorityDiscriminatorBytes() {
|
|
492
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(ACCEPT_CONFIG_AUTHORITY_DISCRIMINATOR);
|
|
493
|
+
}
|
|
494
|
+
function getAcceptConfigAuthorityInstructionDataEncoder() {
|
|
495
|
+
return kit.transformEncoder(kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]), (value) => ({
|
|
496
|
+
...value,
|
|
497
|
+
discriminator: ACCEPT_CONFIG_AUTHORITY_DISCRIMINATOR
|
|
498
|
+
}));
|
|
499
|
+
}
|
|
500
|
+
function getAcceptConfigAuthorityInstructionDataDecoder() {
|
|
501
|
+
return kit.getStructDecoder([["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)]]);
|
|
502
|
+
}
|
|
503
|
+
function getAcceptConfigAuthorityInstructionDataCodec() {
|
|
504
|
+
return kit.combineCodec(
|
|
505
|
+
getAcceptConfigAuthorityInstructionDataEncoder(),
|
|
506
|
+
getAcceptConfigAuthorityInstructionDataDecoder()
|
|
507
|
+
);
|
|
508
|
+
}
|
|
509
|
+
async function getAcceptConfigAuthorityInstructionAsync(input, config) {
|
|
510
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
511
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
512
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
513
|
+
const originalAccounts = {
|
|
514
|
+
newAuthority: { value: input.newAuthority ?? null, isSigner: true, isWritable: false },
|
|
515
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
516
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
517
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
518
|
+
};
|
|
519
|
+
const accounts = originalAccounts;
|
|
520
|
+
if (!accounts.config.value) {
|
|
521
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
522
|
+
programAddress,
|
|
523
|
+
seeds: [
|
|
524
|
+
kit.getBytesEncoder().encode(new Uint8Array([71, 85, 65, 82, 68, 73, 65, 78, 95, 67, 79, 78, 70, 73, 71]))
|
|
525
|
+
]
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
if (!accounts.eventAuthority.value) {
|
|
529
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
530
|
+
programAddress,
|
|
531
|
+
seeds: [
|
|
532
|
+
kit.getBytesEncoder().encode(
|
|
533
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
534
|
+
)
|
|
535
|
+
]
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
if (!accounts.program.value) {
|
|
539
|
+
accounts.program.value = programAddress;
|
|
540
|
+
accounts.program.isWritable = false;
|
|
541
|
+
}
|
|
542
|
+
return Object.freeze({
|
|
543
|
+
accounts: [
|
|
544
|
+
getAccountMeta("newAuthority", accounts.newAuthority),
|
|
545
|
+
getAccountMeta("config", accounts.config),
|
|
546
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
547
|
+
getAccountMeta("program", accounts.program)
|
|
548
|
+
],
|
|
549
|
+
data: getAcceptConfigAuthorityInstructionDataEncoder().encode({}),
|
|
550
|
+
programAddress
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
function getAcceptConfigAuthorityInstruction(input, config) {
|
|
554
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
555
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
556
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
557
|
+
const originalAccounts = {
|
|
558
|
+
newAuthority: { value: input.newAuthority ?? null, isSigner: true, isWritable: false },
|
|
559
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
560
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
561
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
562
|
+
};
|
|
563
|
+
const accounts = originalAccounts;
|
|
564
|
+
if (!accounts.program.value) {
|
|
565
|
+
accounts.program.value = programAddress;
|
|
566
|
+
accounts.program.isWritable = false;
|
|
567
|
+
}
|
|
568
|
+
return Object.freeze({
|
|
569
|
+
accounts: [
|
|
570
|
+
getAccountMeta("newAuthority", accounts.newAuthority),
|
|
571
|
+
getAccountMeta("config", accounts.config),
|
|
572
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
573
|
+
getAccountMeta("program", accounts.program)
|
|
574
|
+
],
|
|
575
|
+
data: getAcceptConfigAuthorityInstructionDataEncoder().encode({}),
|
|
576
|
+
programAddress
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
function parseAcceptConfigAuthorityInstruction(instruction) {
|
|
580
|
+
if (instruction.accounts.length < 4) {
|
|
581
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
582
|
+
actualAccountMetas: instruction.accounts.length,
|
|
583
|
+
expectedAccountMetas: 4
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
let accountIndex = 0;
|
|
587
|
+
const getNextAccount = () => {
|
|
588
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
589
|
+
accountIndex += 1;
|
|
590
|
+
return accountMeta;
|
|
591
|
+
};
|
|
592
|
+
return {
|
|
593
|
+
programAddress: instruction.programAddress,
|
|
594
|
+
accounts: {
|
|
595
|
+
newAuthority: getNextAccount(),
|
|
596
|
+
config: getNextAccount(),
|
|
597
|
+
eventAuthority: getNextAccount(),
|
|
598
|
+
program: getNextAccount()
|
|
599
|
+
},
|
|
600
|
+
data: getAcceptConfigAuthorityInstructionDataDecoder().decode(instruction.data)
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
var ADD_GUARDIAN_DISCRIMINATOR = new Uint8Array([167, 189, 170, 27, 74, 240, 201, 241]);
|
|
604
|
+
function getAddGuardianDiscriminatorBytes() {
|
|
605
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(ADD_GUARDIAN_DISCRIMINATOR);
|
|
606
|
+
}
|
|
607
|
+
function getAddGuardianInstructionDataEncoder() {
|
|
608
|
+
return kit.transformEncoder(
|
|
609
|
+
kit.getStructEncoder([
|
|
610
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
611
|
+
["guardian", kit.getAddressEncoder()]
|
|
612
|
+
]),
|
|
613
|
+
(value) => ({ ...value, discriminator: ADD_GUARDIAN_DISCRIMINATOR })
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
function getAddGuardianInstructionDataDecoder() {
|
|
617
|
+
return kit.getStructDecoder([
|
|
618
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
619
|
+
["guardian", kit.getAddressDecoder()]
|
|
620
|
+
]);
|
|
621
|
+
}
|
|
622
|
+
function getAddGuardianInstructionDataCodec() {
|
|
623
|
+
return kit.combineCodec(getAddGuardianInstructionDataEncoder(), getAddGuardianInstructionDataDecoder());
|
|
624
|
+
}
|
|
625
|
+
async function getAddGuardianInstructionAsync(input, config) {
|
|
626
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
627
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
628
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
629
|
+
const originalAccounts = {
|
|
630
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
631
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
632
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
633
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
634
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
635
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
636
|
+
};
|
|
637
|
+
const accounts = originalAccounts;
|
|
638
|
+
const args = { ...input };
|
|
639
|
+
if (!accounts.config.value) {
|
|
640
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
641
|
+
programAddress,
|
|
642
|
+
seeds: [
|
|
643
|
+
kit.getBytesEncoder().encode(new Uint8Array([71, 85, 65, 82, 68, 73, 65, 78, 95, 67, 79, 78, 70, 73, 71]))
|
|
644
|
+
]
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
if (!accounts.systemProgram.value) {
|
|
648
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
649
|
+
}
|
|
650
|
+
if (!accounts.eventAuthority.value) {
|
|
651
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
652
|
+
programAddress,
|
|
653
|
+
seeds: [
|
|
654
|
+
kit.getBytesEncoder().encode(
|
|
655
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
656
|
+
)
|
|
657
|
+
]
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
if (!accounts.program.value) {
|
|
661
|
+
accounts.program.value = programAddress;
|
|
662
|
+
accounts.program.isWritable = false;
|
|
663
|
+
}
|
|
664
|
+
return Object.freeze({
|
|
665
|
+
accounts: [
|
|
666
|
+
getAccountMeta("funder", accounts.funder),
|
|
667
|
+
getAccountMeta("authority", accounts.authority),
|
|
668
|
+
getAccountMeta("config", accounts.config),
|
|
669
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
670
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
671
|
+
getAccountMeta("program", accounts.program)
|
|
672
|
+
],
|
|
673
|
+
data: getAddGuardianInstructionDataEncoder().encode(args),
|
|
674
|
+
programAddress
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
function getAddGuardianInstruction(input, config) {
|
|
678
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
679
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
680
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
681
|
+
const originalAccounts = {
|
|
682
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
683
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
684
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
685
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
686
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
687
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
688
|
+
};
|
|
689
|
+
const accounts = originalAccounts;
|
|
690
|
+
const args = { ...input };
|
|
691
|
+
if (!accounts.systemProgram.value) {
|
|
692
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
693
|
+
}
|
|
694
|
+
if (!accounts.program.value) {
|
|
695
|
+
accounts.program.value = programAddress;
|
|
696
|
+
accounts.program.isWritable = false;
|
|
697
|
+
}
|
|
698
|
+
return Object.freeze({
|
|
699
|
+
accounts: [
|
|
700
|
+
getAccountMeta("funder", accounts.funder),
|
|
701
|
+
getAccountMeta("authority", accounts.authority),
|
|
702
|
+
getAccountMeta("config", accounts.config),
|
|
703
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
704
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
705
|
+
getAccountMeta("program", accounts.program)
|
|
706
|
+
],
|
|
707
|
+
data: getAddGuardianInstructionDataEncoder().encode(args),
|
|
708
|
+
programAddress
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
function parseAddGuardianInstruction(instruction) {
|
|
712
|
+
if (instruction.accounts.length < 6) {
|
|
713
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
714
|
+
actualAccountMetas: instruction.accounts.length,
|
|
715
|
+
expectedAccountMetas: 6
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
let accountIndex = 0;
|
|
719
|
+
const getNextAccount = () => {
|
|
720
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
721
|
+
accountIndex += 1;
|
|
722
|
+
return accountMeta;
|
|
723
|
+
};
|
|
724
|
+
return {
|
|
725
|
+
programAddress: instruction.programAddress,
|
|
726
|
+
accounts: {
|
|
727
|
+
funder: getNextAccount(),
|
|
728
|
+
authority: getNextAccount(),
|
|
729
|
+
config: getNextAccount(),
|
|
730
|
+
systemProgram: getNextAccount(),
|
|
731
|
+
eventAuthority: getNextAccount(),
|
|
732
|
+
program: getNextAccount()
|
|
733
|
+
},
|
|
734
|
+
data: getAddGuardianInstructionDataDecoder().decode(instruction.data)
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
var CANCEL_RELEASE_DISCRIMINATOR = new Uint8Array([109, 170, 172, 190, 125, 251, 1, 66]);
|
|
738
|
+
function getCancelReleaseDiscriminatorBytes() {
|
|
739
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(CANCEL_RELEASE_DISCRIMINATOR);
|
|
740
|
+
}
|
|
741
|
+
function getCancelReleaseInstructionDataEncoder() {
|
|
742
|
+
return kit.transformEncoder(kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]), (value) => ({
|
|
743
|
+
...value,
|
|
744
|
+
discriminator: CANCEL_RELEASE_DISCRIMINATOR
|
|
745
|
+
}));
|
|
746
|
+
}
|
|
747
|
+
function getCancelReleaseInstructionDataDecoder() {
|
|
748
|
+
return kit.getStructDecoder([["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)]]);
|
|
749
|
+
}
|
|
750
|
+
function getCancelReleaseInstructionDataCodec() {
|
|
751
|
+
return kit.combineCodec(getCancelReleaseInstructionDataEncoder(), getCancelReleaseInstructionDataDecoder());
|
|
752
|
+
}
|
|
753
|
+
async function getCancelReleaseInstructionAsync(input, config) {
|
|
754
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
755
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
756
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
757
|
+
const originalAccounts = {
|
|
758
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
759
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
760
|
+
registry: { value: input.registry ?? null, isSigner: false, isWritable: true },
|
|
761
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
762
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
763
|
+
};
|
|
764
|
+
const accounts = originalAccounts;
|
|
765
|
+
if (!accounts.registry.value) {
|
|
766
|
+
accounts.registry.value = await kit.getProgramDerivedAddress({
|
|
767
|
+
programAddress,
|
|
768
|
+
seeds: [
|
|
769
|
+
kit.getBytesEncoder().encode(
|
|
770
|
+
new Uint8Array([80, 69, 78, 68, 73, 78, 71, 95, 82, 69, 71, 73, 83, 84, 82, 89])
|
|
771
|
+
)
|
|
772
|
+
]
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
if (!accounts.eventAuthority.value) {
|
|
776
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
777
|
+
programAddress,
|
|
778
|
+
seeds: [
|
|
779
|
+
kit.getBytesEncoder().encode(
|
|
780
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
781
|
+
)
|
|
782
|
+
]
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
if (!accounts.program.value) {
|
|
786
|
+
accounts.program.value = programAddress;
|
|
787
|
+
accounts.program.isWritable = false;
|
|
788
|
+
}
|
|
789
|
+
return Object.freeze({
|
|
790
|
+
accounts: [
|
|
791
|
+
getAccountMeta("authority", accounts.authority),
|
|
792
|
+
getAccountMeta("app", accounts.app),
|
|
793
|
+
getAccountMeta("registry", accounts.registry),
|
|
794
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
795
|
+
getAccountMeta("program", accounts.program)
|
|
796
|
+
],
|
|
797
|
+
data: getCancelReleaseInstructionDataEncoder().encode({}),
|
|
798
|
+
programAddress
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
function getCancelReleaseInstruction(input, config) {
|
|
802
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
803
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
804
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
805
|
+
const originalAccounts = {
|
|
806
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
807
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
808
|
+
registry: { value: input.registry ?? null, isSigner: false, isWritable: true },
|
|
809
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
810
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
811
|
+
};
|
|
812
|
+
const accounts = originalAccounts;
|
|
813
|
+
if (!accounts.program.value) {
|
|
814
|
+
accounts.program.value = programAddress;
|
|
815
|
+
accounts.program.isWritable = false;
|
|
816
|
+
}
|
|
817
|
+
return Object.freeze({
|
|
818
|
+
accounts: [
|
|
819
|
+
getAccountMeta("authority", accounts.authority),
|
|
820
|
+
getAccountMeta("app", accounts.app),
|
|
821
|
+
getAccountMeta("registry", accounts.registry),
|
|
822
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
823
|
+
getAccountMeta("program", accounts.program)
|
|
824
|
+
],
|
|
825
|
+
data: getCancelReleaseInstructionDataEncoder().encode({}),
|
|
826
|
+
programAddress
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
function parseCancelReleaseInstruction(instruction) {
|
|
830
|
+
if (instruction.accounts.length < 5) {
|
|
831
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
832
|
+
actualAccountMetas: instruction.accounts.length,
|
|
833
|
+
expectedAccountMetas: 5
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
let accountIndex = 0;
|
|
837
|
+
const getNextAccount = () => {
|
|
838
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
839
|
+
accountIndex += 1;
|
|
840
|
+
return accountMeta;
|
|
841
|
+
};
|
|
842
|
+
return {
|
|
843
|
+
programAddress: instruction.programAddress,
|
|
844
|
+
accounts: {
|
|
845
|
+
authority: getNextAccount(),
|
|
846
|
+
app: getNextAccount(),
|
|
847
|
+
registry: getNextAccount(),
|
|
848
|
+
eventAuthority: getNextAccount(),
|
|
849
|
+
program: getNextAccount()
|
|
850
|
+
},
|
|
851
|
+
data: getCancelReleaseInstructionDataDecoder().decode(instruction.data)
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
var EXPIRE_RELEASE_DISCRIMINATOR = new Uint8Array([174, 239, 151, 37, 202, 177, 207, 99]);
|
|
855
|
+
function getExpireReleaseDiscriminatorBytes() {
|
|
856
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(EXPIRE_RELEASE_DISCRIMINATOR);
|
|
857
|
+
}
|
|
858
|
+
function getExpireReleaseInstructionDataEncoder() {
|
|
859
|
+
return kit.transformEncoder(kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]), (value) => ({
|
|
860
|
+
...value,
|
|
861
|
+
discriminator: EXPIRE_RELEASE_DISCRIMINATOR
|
|
862
|
+
}));
|
|
863
|
+
}
|
|
864
|
+
function getExpireReleaseInstructionDataDecoder() {
|
|
865
|
+
return kit.getStructDecoder([["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)]]);
|
|
866
|
+
}
|
|
867
|
+
function getExpireReleaseInstructionDataCodec() {
|
|
868
|
+
return kit.combineCodec(getExpireReleaseInstructionDataEncoder(), getExpireReleaseInstructionDataDecoder());
|
|
869
|
+
}
|
|
870
|
+
async function getExpireReleaseInstructionAsync(input, config) {
|
|
871
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
872
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
873
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
874
|
+
const originalAccounts = {
|
|
875
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
876
|
+
registry: { value: input.registry ?? null, isSigner: false, isWritable: true },
|
|
877
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
878
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
879
|
+
};
|
|
880
|
+
const accounts = originalAccounts;
|
|
881
|
+
if (!accounts.registry.value) {
|
|
882
|
+
accounts.registry.value = await kit.getProgramDerivedAddress({
|
|
883
|
+
programAddress,
|
|
884
|
+
seeds: [
|
|
885
|
+
kit.getBytesEncoder().encode(
|
|
886
|
+
new Uint8Array([80, 69, 78, 68, 73, 78, 71, 95, 82, 69, 71, 73, 83, 84, 82, 89])
|
|
887
|
+
)
|
|
888
|
+
]
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
if (!accounts.eventAuthority.value) {
|
|
892
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
893
|
+
programAddress,
|
|
894
|
+
seeds: [
|
|
895
|
+
kit.getBytesEncoder().encode(
|
|
896
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
897
|
+
)
|
|
898
|
+
]
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
if (!accounts.program.value) {
|
|
902
|
+
accounts.program.value = programAddress;
|
|
903
|
+
accounts.program.isWritable = false;
|
|
904
|
+
}
|
|
905
|
+
return Object.freeze({
|
|
906
|
+
accounts: [
|
|
907
|
+
getAccountMeta("app", accounts.app),
|
|
908
|
+
getAccountMeta("registry", accounts.registry),
|
|
909
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
910
|
+
getAccountMeta("program", accounts.program)
|
|
911
|
+
],
|
|
912
|
+
data: getExpireReleaseInstructionDataEncoder().encode({}),
|
|
913
|
+
programAddress
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
function getExpireReleaseInstruction(input, config) {
|
|
917
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
918
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
919
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
920
|
+
const originalAccounts = {
|
|
921
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
922
|
+
registry: { value: input.registry ?? null, isSigner: false, isWritable: true },
|
|
923
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
924
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
925
|
+
};
|
|
926
|
+
const accounts = originalAccounts;
|
|
927
|
+
if (!accounts.program.value) {
|
|
928
|
+
accounts.program.value = programAddress;
|
|
929
|
+
accounts.program.isWritable = false;
|
|
930
|
+
}
|
|
931
|
+
return Object.freeze({
|
|
932
|
+
accounts: [
|
|
933
|
+
getAccountMeta("app", accounts.app),
|
|
934
|
+
getAccountMeta("registry", accounts.registry),
|
|
935
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
936
|
+
getAccountMeta("program", accounts.program)
|
|
937
|
+
],
|
|
938
|
+
data: getExpireReleaseInstructionDataEncoder().encode({}),
|
|
939
|
+
programAddress
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
function parseExpireReleaseInstruction(instruction) {
|
|
943
|
+
if (instruction.accounts.length < 4) {
|
|
944
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
945
|
+
actualAccountMetas: instruction.accounts.length,
|
|
946
|
+
expectedAccountMetas: 4
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
let accountIndex = 0;
|
|
950
|
+
const getNextAccount = () => {
|
|
951
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
952
|
+
accountIndex += 1;
|
|
953
|
+
return accountMeta;
|
|
954
|
+
};
|
|
955
|
+
return {
|
|
956
|
+
programAddress: instruction.programAddress,
|
|
957
|
+
accounts: {
|
|
958
|
+
app: getNextAccount(),
|
|
959
|
+
registry: getNextAccount(),
|
|
960
|
+
eventAuthority: getNextAccount(),
|
|
961
|
+
program: getNextAccount()
|
|
962
|
+
},
|
|
963
|
+
data: getExpireReleaseInstructionDataDecoder().decode(instruction.data)
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
var INITIALIZE_CONFIG_DISCRIMINATOR = new Uint8Array([208, 127, 21, 1, 194, 190, 196, 70]);
|
|
967
|
+
function getInitializeConfigDiscriminatorBytes() {
|
|
968
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(INITIALIZE_CONFIG_DISCRIMINATOR);
|
|
969
|
+
}
|
|
970
|
+
function getInitializeConfigInstructionDataEncoder() {
|
|
971
|
+
return kit.transformEncoder(
|
|
972
|
+
kit.getStructEncoder([
|
|
973
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
974
|
+
["authority", kit.getAddressEncoder()],
|
|
975
|
+
["voteWindow", kit.getU32Encoder()],
|
|
976
|
+
["votingPeriod", kit.getU32Encoder()]
|
|
977
|
+
]),
|
|
978
|
+
(value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR })
|
|
979
|
+
);
|
|
980
|
+
}
|
|
981
|
+
function getInitializeConfigInstructionDataDecoder() {
|
|
982
|
+
return kit.getStructDecoder([
|
|
983
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
984
|
+
["authority", kit.getAddressDecoder()],
|
|
985
|
+
["voteWindow", kit.getU32Decoder()],
|
|
986
|
+
["votingPeriod", kit.getU32Decoder()]
|
|
987
|
+
]);
|
|
988
|
+
}
|
|
989
|
+
function getInitializeConfigInstructionDataCodec() {
|
|
990
|
+
return kit.combineCodec(getInitializeConfigInstructionDataEncoder(), getInitializeConfigInstructionDataDecoder());
|
|
991
|
+
}
|
|
992
|
+
async function getInitializeConfigInstructionAsync(input, config) {
|
|
993
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
994
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
995
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
996
|
+
const originalAccounts = {
|
|
997
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
998
|
+
setupAuthority: { value: input.setupAuthority ?? null, isSigner: "either", isWritable: false },
|
|
999
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
1000
|
+
registry: { value: input.registry ?? null, isSigner: false, isWritable: true },
|
|
1001
|
+
bondMint: { value: input.bondMint ?? null, isSigner: false, isWritable: false },
|
|
1002
|
+
bondVault: { value: input.bondVault ?? null, isSigner: false, isWritable: true },
|
|
1003
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
1004
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1005
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1006
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1007
|
+
};
|
|
1008
|
+
const accounts = originalAccounts;
|
|
1009
|
+
const args = { ...input };
|
|
1010
|
+
if (!accounts.setupAuthority.value) {
|
|
1011
|
+
accounts.setupAuthority.value = "setup9dEwHLaDMvUwEsigW9nkXYHVenLMPzToyx3cpj";
|
|
1012
|
+
}
|
|
1013
|
+
if (!accounts.config.value) {
|
|
1014
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
1015
|
+
programAddress,
|
|
1016
|
+
seeds: [
|
|
1017
|
+
kit.getBytesEncoder().encode(new Uint8Array([71, 85, 65, 82, 68, 73, 65, 78, 95, 67, 79, 78, 70, 73, 71]))
|
|
1018
|
+
]
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
if (!accounts.registry.value) {
|
|
1022
|
+
accounts.registry.value = await kit.getProgramDerivedAddress({
|
|
1023
|
+
programAddress,
|
|
1024
|
+
seeds: [
|
|
1025
|
+
kit.getBytesEncoder().encode(
|
|
1026
|
+
new Uint8Array([80, 69, 78, 68, 73, 78, 71, 95, 82, 69, 71, 73, 83, 84, 82, 89])
|
|
1027
|
+
)
|
|
1028
|
+
]
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
if (!accounts.bondVault.value) {
|
|
1032
|
+
accounts.bondVault.value = await kit.getProgramDerivedAddress({
|
|
1033
|
+
programAddress,
|
|
1034
|
+
seeds: [kit.getBytesEncoder().encode(new Uint8Array([66, 79, 78, 68, 95, 86, 65, 85, 76, 84]))]
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
if (!accounts.tokenProgram.value) {
|
|
1038
|
+
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1039
|
+
}
|
|
1040
|
+
if (!accounts.systemProgram.value) {
|
|
1041
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1042
|
+
}
|
|
1043
|
+
if (!accounts.eventAuthority.value) {
|
|
1044
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
1045
|
+
programAddress,
|
|
1046
|
+
seeds: [
|
|
1047
|
+
kit.getBytesEncoder().encode(
|
|
1048
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
1049
|
+
)
|
|
1050
|
+
]
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
if (!accounts.program.value) {
|
|
1054
|
+
accounts.program.value = programAddress;
|
|
1055
|
+
accounts.program.isWritable = false;
|
|
1056
|
+
}
|
|
1057
|
+
return Object.freeze({
|
|
1058
|
+
accounts: [
|
|
1059
|
+
getAccountMeta("funder", accounts.funder),
|
|
1060
|
+
getAccountMeta("setupAuthority", accounts.setupAuthority),
|
|
1061
|
+
getAccountMeta("config", accounts.config),
|
|
1062
|
+
getAccountMeta("registry", accounts.registry),
|
|
1063
|
+
getAccountMeta("bondMint", accounts.bondMint),
|
|
1064
|
+
getAccountMeta("bondVault", accounts.bondVault),
|
|
1065
|
+
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1066
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1067
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1068
|
+
getAccountMeta("program", accounts.program)
|
|
1069
|
+
],
|
|
1070
|
+
data: getInitializeConfigInstructionDataEncoder().encode(args),
|
|
1071
|
+
programAddress
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
function getInitializeConfigInstruction(input, config) {
|
|
1075
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1076
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1077
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1078
|
+
const originalAccounts = {
|
|
1079
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
1080
|
+
setupAuthority: { value: input.setupAuthority ?? null, isSigner: "either", isWritable: false },
|
|
1081
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
1082
|
+
registry: { value: input.registry ?? null, isSigner: false, isWritable: true },
|
|
1083
|
+
bondMint: { value: input.bondMint ?? null, isSigner: false, isWritable: false },
|
|
1084
|
+
bondVault: { value: input.bondVault ?? null, isSigner: false, isWritable: true },
|
|
1085
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
1086
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1087
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1088
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1089
|
+
};
|
|
1090
|
+
const accounts = originalAccounts;
|
|
1091
|
+
const args = { ...input };
|
|
1092
|
+
if (!accounts.setupAuthority.value) {
|
|
1093
|
+
accounts.setupAuthority.value = "setup9dEwHLaDMvUwEsigW9nkXYHVenLMPzToyx3cpj";
|
|
1094
|
+
}
|
|
1095
|
+
if (!accounts.tokenProgram.value) {
|
|
1096
|
+
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1097
|
+
}
|
|
1098
|
+
if (!accounts.systemProgram.value) {
|
|
1099
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1100
|
+
}
|
|
1101
|
+
if (!accounts.program.value) {
|
|
1102
|
+
accounts.program.value = programAddress;
|
|
1103
|
+
accounts.program.isWritable = false;
|
|
1104
|
+
}
|
|
1105
|
+
return Object.freeze({
|
|
1106
|
+
accounts: [
|
|
1107
|
+
getAccountMeta("funder", accounts.funder),
|
|
1108
|
+
getAccountMeta("setupAuthority", accounts.setupAuthority),
|
|
1109
|
+
getAccountMeta("config", accounts.config),
|
|
1110
|
+
getAccountMeta("registry", accounts.registry),
|
|
1111
|
+
getAccountMeta("bondMint", accounts.bondMint),
|
|
1112
|
+
getAccountMeta("bondVault", accounts.bondVault),
|
|
1113
|
+
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1114
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1115
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1116
|
+
getAccountMeta("program", accounts.program)
|
|
1117
|
+
],
|
|
1118
|
+
data: getInitializeConfigInstructionDataEncoder().encode(args),
|
|
1119
|
+
programAddress
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
function parseInitializeConfigInstruction(instruction) {
|
|
1123
|
+
if (instruction.accounts.length < 10) {
|
|
1124
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1125
|
+
actualAccountMetas: instruction.accounts.length,
|
|
1126
|
+
expectedAccountMetas: 10
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
let accountIndex = 0;
|
|
1130
|
+
const getNextAccount = () => {
|
|
1131
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1132
|
+
accountIndex += 1;
|
|
1133
|
+
return accountMeta;
|
|
1134
|
+
};
|
|
1135
|
+
return {
|
|
1136
|
+
programAddress: instruction.programAddress,
|
|
1137
|
+
accounts: {
|
|
1138
|
+
funder: getNextAccount(),
|
|
1139
|
+
setupAuthority: getNextAccount(),
|
|
1140
|
+
config: getNextAccount(),
|
|
1141
|
+
registry: getNextAccount(),
|
|
1142
|
+
bondMint: getNextAccount(),
|
|
1143
|
+
bondVault: getNextAccount(),
|
|
1144
|
+
tokenProgram: getNextAccount(),
|
|
1145
|
+
systemProgram: getNextAccount(),
|
|
1146
|
+
eventAuthority: getNextAccount(),
|
|
1147
|
+
program: getNextAccount()
|
|
1148
|
+
},
|
|
1149
|
+
data: getInitializeConfigInstructionDataDecoder().decode(instruction.data)
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
var PROPOSE_APP_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
1153
|
+
147,
|
|
1154
|
+
62,
|
|
1155
|
+
16,
|
|
1156
|
+
95,
|
|
1157
|
+
39,
|
|
1158
|
+
187,
|
|
1159
|
+
25,
|
|
1160
|
+
15
|
|
1161
|
+
]);
|
|
1162
|
+
function getProposeAppAuthorityDiscriminatorBytes() {
|
|
1163
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(PROPOSE_APP_AUTHORITY_DISCRIMINATOR);
|
|
1164
|
+
}
|
|
1165
|
+
function getProposeAppAuthorityInstructionDataEncoder() {
|
|
1166
|
+
return kit.transformEncoder(
|
|
1167
|
+
kit.getStructEncoder([
|
|
1168
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1169
|
+
["newAuthority", kit.getAddressEncoder()]
|
|
1170
|
+
]),
|
|
1171
|
+
(value) => ({ ...value, discriminator: PROPOSE_APP_AUTHORITY_DISCRIMINATOR })
|
|
1172
|
+
);
|
|
1173
|
+
}
|
|
1174
|
+
function getProposeAppAuthorityInstructionDataDecoder() {
|
|
1175
|
+
return kit.getStructDecoder([
|
|
1176
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1177
|
+
["newAuthority", kit.getAddressDecoder()]
|
|
1178
|
+
]);
|
|
1179
|
+
}
|
|
1180
|
+
function getProposeAppAuthorityInstructionDataCodec() {
|
|
1181
|
+
return kit.combineCodec(getProposeAppAuthorityInstructionDataEncoder(), getProposeAppAuthorityInstructionDataDecoder());
|
|
1182
|
+
}
|
|
1183
|
+
async function getProposeAppAuthorityInstructionAsync(input, config) {
|
|
1184
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1185
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1186
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1187
|
+
const originalAccounts = {
|
|
1188
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
1189
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
1190
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1191
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1192
|
+
};
|
|
1193
|
+
const accounts = originalAccounts;
|
|
1194
|
+
const args = { ...input };
|
|
1195
|
+
if (!accounts.eventAuthority.value) {
|
|
1196
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
1197
|
+
programAddress,
|
|
1198
|
+
seeds: [
|
|
1199
|
+
kit.getBytesEncoder().encode(
|
|
1200
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
1201
|
+
)
|
|
1202
|
+
]
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
1205
|
+
if (!accounts.program.value) {
|
|
1206
|
+
accounts.program.value = programAddress;
|
|
1207
|
+
accounts.program.isWritable = false;
|
|
1208
|
+
}
|
|
1209
|
+
return Object.freeze({
|
|
1210
|
+
accounts: [
|
|
1211
|
+
getAccountMeta("authority", accounts.authority),
|
|
1212
|
+
getAccountMeta("app", accounts.app),
|
|
1213
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1214
|
+
getAccountMeta("program", accounts.program)
|
|
1215
|
+
],
|
|
1216
|
+
data: getProposeAppAuthorityInstructionDataEncoder().encode(args),
|
|
1217
|
+
programAddress
|
|
1218
|
+
});
|
|
1219
|
+
}
|
|
1220
|
+
function getProposeAppAuthorityInstruction(input, config) {
|
|
1221
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1222
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1223
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1224
|
+
const originalAccounts = {
|
|
1225
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
1226
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
1227
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1228
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1229
|
+
};
|
|
1230
|
+
const accounts = originalAccounts;
|
|
1231
|
+
const args = { ...input };
|
|
1232
|
+
if (!accounts.program.value) {
|
|
1233
|
+
accounts.program.value = programAddress;
|
|
1234
|
+
accounts.program.isWritable = false;
|
|
1235
|
+
}
|
|
1236
|
+
return Object.freeze({
|
|
1237
|
+
accounts: [
|
|
1238
|
+
getAccountMeta("authority", accounts.authority),
|
|
1239
|
+
getAccountMeta("app", accounts.app),
|
|
1240
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1241
|
+
getAccountMeta("program", accounts.program)
|
|
1242
|
+
],
|
|
1243
|
+
data: getProposeAppAuthorityInstructionDataEncoder().encode(args),
|
|
1244
|
+
programAddress
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
function parseProposeAppAuthorityInstruction(instruction) {
|
|
1248
|
+
if (instruction.accounts.length < 4) {
|
|
1249
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1250
|
+
actualAccountMetas: instruction.accounts.length,
|
|
1251
|
+
expectedAccountMetas: 4
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
let accountIndex = 0;
|
|
1255
|
+
const getNextAccount = () => {
|
|
1256
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1257
|
+
accountIndex += 1;
|
|
1258
|
+
return accountMeta;
|
|
1259
|
+
};
|
|
1260
|
+
return {
|
|
1261
|
+
programAddress: instruction.programAddress,
|
|
1262
|
+
accounts: {
|
|
1263
|
+
authority: getNextAccount(),
|
|
1264
|
+
app: getNextAccount(),
|
|
1265
|
+
eventAuthority: getNextAccount(),
|
|
1266
|
+
program: getNextAccount()
|
|
1267
|
+
},
|
|
1268
|
+
data: getProposeAppAuthorityInstructionDataDecoder().decode(instruction.data)
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1271
|
+
var PROPOSE_CONFIG_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
1272
|
+
31,
|
|
1273
|
+
229,
|
|
1274
|
+
9,
|
|
1275
|
+
231,
|
|
1276
|
+
45,
|
|
1277
|
+
153,
|
|
1278
|
+
123,
|
|
1279
|
+
235
|
|
1280
|
+
]);
|
|
1281
|
+
function getProposeConfigAuthorityDiscriminatorBytes() {
|
|
1282
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(PROPOSE_CONFIG_AUTHORITY_DISCRIMINATOR);
|
|
1283
|
+
}
|
|
1284
|
+
function getProposeConfigAuthorityInstructionDataEncoder() {
|
|
1285
|
+
return kit.transformEncoder(
|
|
1286
|
+
kit.getStructEncoder([
|
|
1287
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1288
|
+
["newAuthority", kit.getAddressEncoder()]
|
|
1289
|
+
]),
|
|
1290
|
+
(value) => ({ ...value, discriminator: PROPOSE_CONFIG_AUTHORITY_DISCRIMINATOR })
|
|
1291
|
+
);
|
|
1292
|
+
}
|
|
1293
|
+
function getProposeConfigAuthorityInstructionDataDecoder() {
|
|
1294
|
+
return kit.getStructDecoder([
|
|
1295
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1296
|
+
["newAuthority", kit.getAddressDecoder()]
|
|
1297
|
+
]);
|
|
1298
|
+
}
|
|
1299
|
+
function getProposeConfigAuthorityInstructionDataCodec() {
|
|
1300
|
+
return kit.combineCodec(
|
|
1301
|
+
getProposeConfigAuthorityInstructionDataEncoder(),
|
|
1302
|
+
getProposeConfigAuthorityInstructionDataDecoder()
|
|
1303
|
+
);
|
|
1304
|
+
}
|
|
1305
|
+
async function getProposeConfigAuthorityInstructionAsync(input, config) {
|
|
1306
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1307
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1308
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1309
|
+
const originalAccounts = {
|
|
1310
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
1311
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
1312
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1313
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1314
|
+
};
|
|
1315
|
+
const accounts = originalAccounts;
|
|
1316
|
+
const args = { ...input };
|
|
1317
|
+
if (!accounts.config.value) {
|
|
1318
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
1319
|
+
programAddress,
|
|
1320
|
+
seeds: [
|
|
1321
|
+
kit.getBytesEncoder().encode(new Uint8Array([71, 85, 65, 82, 68, 73, 65, 78, 95, 67, 79, 78, 70, 73, 71]))
|
|
1322
|
+
]
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
if (!accounts.eventAuthority.value) {
|
|
1326
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
1327
|
+
programAddress,
|
|
1328
|
+
seeds: [
|
|
1329
|
+
kit.getBytesEncoder().encode(
|
|
1330
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
1331
|
+
)
|
|
1332
|
+
]
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
if (!accounts.program.value) {
|
|
1336
|
+
accounts.program.value = programAddress;
|
|
1337
|
+
accounts.program.isWritable = false;
|
|
1338
|
+
}
|
|
1339
|
+
return Object.freeze({
|
|
1340
|
+
accounts: [
|
|
1341
|
+
getAccountMeta("authority", accounts.authority),
|
|
1342
|
+
getAccountMeta("config", accounts.config),
|
|
1343
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1344
|
+
getAccountMeta("program", accounts.program)
|
|
1345
|
+
],
|
|
1346
|
+
data: getProposeConfigAuthorityInstructionDataEncoder().encode(
|
|
1347
|
+
args
|
|
1348
|
+
),
|
|
1349
|
+
programAddress
|
|
1350
|
+
});
|
|
1351
|
+
}
|
|
1352
|
+
function getProposeConfigAuthorityInstruction(input, config) {
|
|
1353
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1354
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1355
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1356
|
+
const originalAccounts = {
|
|
1357
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
1358
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
1359
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1360
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1361
|
+
};
|
|
1362
|
+
const accounts = originalAccounts;
|
|
1363
|
+
const args = { ...input };
|
|
1364
|
+
if (!accounts.program.value) {
|
|
1365
|
+
accounts.program.value = programAddress;
|
|
1366
|
+
accounts.program.isWritable = false;
|
|
1367
|
+
}
|
|
1368
|
+
return Object.freeze({
|
|
1369
|
+
accounts: [
|
|
1370
|
+
getAccountMeta("authority", accounts.authority),
|
|
1371
|
+
getAccountMeta("config", accounts.config),
|
|
1372
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1373
|
+
getAccountMeta("program", accounts.program)
|
|
1374
|
+
],
|
|
1375
|
+
data: getProposeConfigAuthorityInstructionDataEncoder().encode(
|
|
1376
|
+
args
|
|
1377
|
+
),
|
|
1378
|
+
programAddress
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1381
|
+
function parseProposeConfigAuthorityInstruction(instruction) {
|
|
1382
|
+
if (instruction.accounts.length < 4) {
|
|
1383
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1384
|
+
actualAccountMetas: instruction.accounts.length,
|
|
1385
|
+
expectedAccountMetas: 4
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
let accountIndex = 0;
|
|
1389
|
+
const getNextAccount = () => {
|
|
1390
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1391
|
+
accountIndex += 1;
|
|
1392
|
+
return accountMeta;
|
|
1393
|
+
};
|
|
1394
|
+
return {
|
|
1395
|
+
programAddress: instruction.programAddress,
|
|
1396
|
+
accounts: {
|
|
1397
|
+
authority: getNextAccount(),
|
|
1398
|
+
config: getNextAccount(),
|
|
1399
|
+
eventAuthority: getNextAccount(),
|
|
1400
|
+
program: getNextAccount()
|
|
1401
|
+
},
|
|
1402
|
+
data: getProposeConfigAuthorityInstructionDataDecoder().decode(instruction.data)
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1405
|
+
var PROPOSE_RELEASE_DISCRIMINATOR = new Uint8Array([156, 43, 186, 24, 116, 44, 17, 71]);
|
|
1406
|
+
function getProposeReleaseDiscriminatorBytes() {
|
|
1407
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(PROPOSE_RELEASE_DISCRIMINATOR);
|
|
1408
|
+
}
|
|
1409
|
+
function getProposeReleaseInstructionDataEncoder() {
|
|
1410
|
+
return kit.transformEncoder(
|
|
1411
|
+
kit.getStructEncoder([
|
|
1412
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1413
|
+
["versionCode", kit.getU32Encoder()],
|
|
1414
|
+
["manifestHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
1415
|
+
["certificateSha256", kit.fixEncoderSize(kit.getBytesEncoder(), 32)]
|
|
1416
|
+
]),
|
|
1417
|
+
(value) => ({ ...value, discriminator: PROPOSE_RELEASE_DISCRIMINATOR })
|
|
1418
|
+
);
|
|
1419
|
+
}
|
|
1420
|
+
function getProposeReleaseInstructionDataDecoder() {
|
|
1421
|
+
return kit.getStructDecoder([
|
|
1422
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1423
|
+
["versionCode", kit.getU32Decoder()],
|
|
1424
|
+
["manifestHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
1425
|
+
["certificateSha256", kit.fixDecoderSize(kit.getBytesDecoder(), 32)]
|
|
1426
|
+
]);
|
|
1427
|
+
}
|
|
1428
|
+
function getProposeReleaseInstructionDataCodec() {
|
|
1429
|
+
return kit.combineCodec(getProposeReleaseInstructionDataEncoder(), getProposeReleaseInstructionDataDecoder());
|
|
1430
|
+
}
|
|
1431
|
+
async function getProposeReleaseInstructionAsync(input, config) {
|
|
1432
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1433
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1434
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1435
|
+
const originalAccounts = {
|
|
1436
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
1437
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
1438
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
1439
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: false },
|
|
1440
|
+
registry: { value: input.registry ?? null, isSigner: false, isWritable: true },
|
|
1441
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1442
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1443
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1444
|
+
};
|
|
1445
|
+
const accounts = originalAccounts;
|
|
1446
|
+
const args = { ...input };
|
|
1447
|
+
if (!accounts.config.value) {
|
|
1448
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
1449
|
+
programAddress,
|
|
1450
|
+
seeds: [
|
|
1451
|
+
kit.getBytesEncoder().encode(new Uint8Array([71, 85, 65, 82, 68, 73, 65, 78, 95, 67, 79, 78, 70, 73, 71]))
|
|
1452
|
+
]
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
if (!accounts.registry.value) {
|
|
1456
|
+
accounts.registry.value = await kit.getProgramDerivedAddress({
|
|
1457
|
+
programAddress,
|
|
1458
|
+
seeds: [
|
|
1459
|
+
kit.getBytesEncoder().encode(
|
|
1460
|
+
new Uint8Array([80, 69, 78, 68, 73, 78, 71, 95, 82, 69, 71, 73, 83, 84, 82, 89])
|
|
1461
|
+
)
|
|
1462
|
+
]
|
|
1463
|
+
});
|
|
1464
|
+
}
|
|
1465
|
+
if (!accounts.systemProgram.value) {
|
|
1466
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1467
|
+
}
|
|
1468
|
+
if (!accounts.eventAuthority.value) {
|
|
1469
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
1470
|
+
programAddress,
|
|
1471
|
+
seeds: [
|
|
1472
|
+
kit.getBytesEncoder().encode(
|
|
1473
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
1474
|
+
)
|
|
1475
|
+
]
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
if (!accounts.program.value) {
|
|
1479
|
+
accounts.program.value = programAddress;
|
|
1480
|
+
accounts.program.isWritable = false;
|
|
1481
|
+
}
|
|
1482
|
+
return Object.freeze({
|
|
1483
|
+
accounts: [
|
|
1484
|
+
getAccountMeta("funder", accounts.funder),
|
|
1485
|
+
getAccountMeta("authority", accounts.authority),
|
|
1486
|
+
getAccountMeta("app", accounts.app),
|
|
1487
|
+
getAccountMeta("config", accounts.config),
|
|
1488
|
+
getAccountMeta("registry", accounts.registry),
|
|
1489
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1490
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1491
|
+
getAccountMeta("program", accounts.program)
|
|
1492
|
+
],
|
|
1493
|
+
data: getProposeReleaseInstructionDataEncoder().encode(args),
|
|
1494
|
+
programAddress
|
|
1495
|
+
});
|
|
1496
|
+
}
|
|
1497
|
+
function getProposeReleaseInstruction(input, config) {
|
|
1498
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1499
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1500
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1501
|
+
const originalAccounts = {
|
|
1502
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
1503
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
1504
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
1505
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: false },
|
|
1506
|
+
registry: { value: input.registry ?? null, isSigner: false, isWritable: true },
|
|
1507
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1508
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1509
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1510
|
+
};
|
|
1511
|
+
const accounts = originalAccounts;
|
|
1512
|
+
const args = { ...input };
|
|
1513
|
+
if (!accounts.systemProgram.value) {
|
|
1514
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1515
|
+
}
|
|
1516
|
+
if (!accounts.program.value) {
|
|
1517
|
+
accounts.program.value = programAddress;
|
|
1518
|
+
accounts.program.isWritable = false;
|
|
1519
|
+
}
|
|
1520
|
+
return Object.freeze({
|
|
1521
|
+
accounts: [
|
|
1522
|
+
getAccountMeta("funder", accounts.funder),
|
|
1523
|
+
getAccountMeta("authority", accounts.authority),
|
|
1524
|
+
getAccountMeta("app", accounts.app),
|
|
1525
|
+
getAccountMeta("config", accounts.config),
|
|
1526
|
+
getAccountMeta("registry", accounts.registry),
|
|
1527
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1528
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1529
|
+
getAccountMeta("program", accounts.program)
|
|
1530
|
+
],
|
|
1531
|
+
data: getProposeReleaseInstructionDataEncoder().encode(args),
|
|
1532
|
+
programAddress
|
|
1533
|
+
});
|
|
1534
|
+
}
|
|
1535
|
+
function parseProposeReleaseInstruction(instruction) {
|
|
1536
|
+
if (instruction.accounts.length < 8) {
|
|
1537
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1538
|
+
actualAccountMetas: instruction.accounts.length,
|
|
1539
|
+
expectedAccountMetas: 8
|
|
1540
|
+
});
|
|
1541
|
+
}
|
|
1542
|
+
let accountIndex = 0;
|
|
1543
|
+
const getNextAccount = () => {
|
|
1544
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1545
|
+
accountIndex += 1;
|
|
1546
|
+
return accountMeta;
|
|
1547
|
+
};
|
|
1548
|
+
return {
|
|
1549
|
+
programAddress: instruction.programAddress,
|
|
1550
|
+
accounts: {
|
|
1551
|
+
funder: getNextAccount(),
|
|
1552
|
+
authority: getNextAccount(),
|
|
1553
|
+
app: getNextAccount(),
|
|
1554
|
+
config: getNextAccount(),
|
|
1555
|
+
registry: getNextAccount(),
|
|
1556
|
+
systemProgram: getNextAccount(),
|
|
1557
|
+
eventAuthority: getNextAccount(),
|
|
1558
|
+
program: getNextAccount()
|
|
1559
|
+
},
|
|
1560
|
+
data: getProposeReleaseInstructionDataDecoder().decode(instruction.data)
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
var REGISTER_APP_DISCRIMINATOR = new Uint8Array([5, 248, 20, 126, 12, 159, 9, 242]);
|
|
1564
|
+
function getRegisterAppDiscriminatorBytes() {
|
|
1565
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(REGISTER_APP_DISCRIMINATOR);
|
|
1566
|
+
}
|
|
1567
|
+
function getRegisterAppInstructionDataEncoder() {
|
|
1568
|
+
return kit.transformEncoder(
|
|
1569
|
+
kit.getStructEncoder([
|
|
1570
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1571
|
+
["authority", kit.getAddressEncoder()],
|
|
1572
|
+
["name", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())]
|
|
1573
|
+
]),
|
|
1574
|
+
(value) => ({ ...value, discriminator: REGISTER_APP_DISCRIMINATOR })
|
|
1575
|
+
);
|
|
1576
|
+
}
|
|
1577
|
+
function getRegisterAppInstructionDataDecoder() {
|
|
1578
|
+
return kit.getStructDecoder([
|
|
1579
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1580
|
+
["authority", kit.getAddressDecoder()],
|
|
1581
|
+
["name", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())]
|
|
1582
|
+
]);
|
|
1583
|
+
}
|
|
1584
|
+
function getRegisterAppInstructionDataCodec() {
|
|
1585
|
+
return kit.combineCodec(getRegisterAppInstructionDataEncoder(), getRegisterAppInstructionDataDecoder());
|
|
1586
|
+
}
|
|
1587
|
+
async function getRegisterAppInstructionAsync(input, config) {
|
|
1588
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1589
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1590
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1591
|
+
const originalAccounts = {
|
|
1592
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
1593
|
+
app: { value: input.app ?? null, isSigner: true, isWritable: true },
|
|
1594
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1595
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1596
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1597
|
+
};
|
|
1598
|
+
const accounts = originalAccounts;
|
|
1599
|
+
const args = { ...input };
|
|
1600
|
+
if (!accounts.systemProgram.value) {
|
|
1601
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1602
|
+
}
|
|
1603
|
+
if (!accounts.eventAuthority.value) {
|
|
1604
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
1605
|
+
programAddress,
|
|
1606
|
+
seeds: [
|
|
1607
|
+
kit.getBytesEncoder().encode(
|
|
1608
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
1609
|
+
)
|
|
1610
|
+
]
|
|
1611
|
+
});
|
|
1612
|
+
}
|
|
1613
|
+
if (!accounts.program.value) {
|
|
1614
|
+
accounts.program.value = programAddress;
|
|
1615
|
+
accounts.program.isWritable = false;
|
|
1616
|
+
}
|
|
1617
|
+
return Object.freeze({
|
|
1618
|
+
accounts: [
|
|
1619
|
+
getAccountMeta("funder", accounts.funder),
|
|
1620
|
+
getAccountMeta("app", accounts.app),
|
|
1621
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1622
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1623
|
+
getAccountMeta("program", accounts.program)
|
|
1624
|
+
],
|
|
1625
|
+
data: getRegisterAppInstructionDataEncoder().encode(args),
|
|
1626
|
+
programAddress
|
|
1627
|
+
});
|
|
1628
|
+
}
|
|
1629
|
+
function getRegisterAppInstruction(input, config) {
|
|
1630
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1631
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1632
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1633
|
+
const originalAccounts = {
|
|
1634
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
1635
|
+
app: { value: input.app ?? null, isSigner: true, isWritable: true },
|
|
1636
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1637
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1638
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1639
|
+
};
|
|
1640
|
+
const accounts = originalAccounts;
|
|
1641
|
+
const args = { ...input };
|
|
1642
|
+
if (!accounts.systemProgram.value) {
|
|
1643
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1644
|
+
}
|
|
1645
|
+
if (!accounts.program.value) {
|
|
1646
|
+
accounts.program.value = programAddress;
|
|
1647
|
+
accounts.program.isWritable = false;
|
|
1648
|
+
}
|
|
1649
|
+
return Object.freeze({
|
|
1650
|
+
accounts: [
|
|
1651
|
+
getAccountMeta("funder", accounts.funder),
|
|
1652
|
+
getAccountMeta("app", accounts.app),
|
|
1653
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1654
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1655
|
+
getAccountMeta("program", accounts.program)
|
|
1656
|
+
],
|
|
1657
|
+
data: getRegisterAppInstructionDataEncoder().encode(args),
|
|
1658
|
+
programAddress
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
function parseRegisterAppInstruction(instruction) {
|
|
1662
|
+
if (instruction.accounts.length < 5) {
|
|
1663
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1664
|
+
actualAccountMetas: instruction.accounts.length,
|
|
1665
|
+
expectedAccountMetas: 5
|
|
1666
|
+
});
|
|
1667
|
+
}
|
|
1668
|
+
let accountIndex = 0;
|
|
1669
|
+
const getNextAccount = () => {
|
|
1670
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1671
|
+
accountIndex += 1;
|
|
1672
|
+
return accountMeta;
|
|
1673
|
+
};
|
|
1674
|
+
return {
|
|
1675
|
+
programAddress: instruction.programAddress,
|
|
1676
|
+
accounts: {
|
|
1677
|
+
funder: getNextAccount(),
|
|
1678
|
+
app: getNextAccount(),
|
|
1679
|
+
systemProgram: getNextAccount(),
|
|
1680
|
+
eventAuthority: getNextAccount(),
|
|
1681
|
+
program: getNextAccount()
|
|
1682
|
+
},
|
|
1683
|
+
data: getRegisterAppInstructionDataDecoder().decode(instruction.data)
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
var REGISTER_GUARDIAN_DISCRIMINATOR = new Uint8Array([
|
|
1687
|
+
21,
|
|
1688
|
+
206,
|
|
1689
|
+
243,
|
|
1690
|
+
116,
|
|
1691
|
+
97,
|
|
1692
|
+
100,
|
|
1693
|
+
230,
|
|
1694
|
+
59
|
|
1695
|
+
]);
|
|
1696
|
+
function getRegisterGuardianDiscriminatorBytes() {
|
|
1697
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(REGISTER_GUARDIAN_DISCRIMINATOR);
|
|
1698
|
+
}
|
|
1699
|
+
function getRegisterGuardianInstructionDataEncoder() {
|
|
1700
|
+
return kit.transformEncoder(
|
|
1701
|
+
kit.getStructEncoder([
|
|
1702
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1703
|
+
["voteAuthority", kit.getAddressEncoder()]
|
|
1704
|
+
]),
|
|
1705
|
+
(value) => ({ ...value, discriminator: REGISTER_GUARDIAN_DISCRIMINATOR })
|
|
1706
|
+
);
|
|
1707
|
+
}
|
|
1708
|
+
function getRegisterGuardianInstructionDataDecoder() {
|
|
1709
|
+
return kit.getStructDecoder([
|
|
1710
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1711
|
+
["voteAuthority", kit.getAddressDecoder()]
|
|
1712
|
+
]);
|
|
1713
|
+
}
|
|
1714
|
+
function getRegisterGuardianInstructionDataCodec() {
|
|
1715
|
+
return kit.combineCodec(getRegisterGuardianInstructionDataEncoder(), getRegisterGuardianInstructionDataDecoder());
|
|
1716
|
+
}
|
|
1717
|
+
async function getRegisterGuardianInstructionAsync(input, config) {
|
|
1718
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1719
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1720
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1721
|
+
const originalAccounts = {
|
|
1722
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
1723
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
1724
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
1725
|
+
bondSource: { value: input.bondSource ?? null, isSigner: false, isWritable: true },
|
|
1726
|
+
bondVault: { value: input.bondVault ?? null, isSigner: false, isWritable: true },
|
|
1727
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
1728
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1729
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1730
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1731
|
+
};
|
|
1732
|
+
const accounts = originalAccounts;
|
|
1733
|
+
const args = { ...input };
|
|
1734
|
+
if (!accounts.config.value) {
|
|
1735
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
1736
|
+
programAddress,
|
|
1737
|
+
seeds: [
|
|
1738
|
+
kit.getBytesEncoder().encode(new Uint8Array([71, 85, 65, 82, 68, 73, 65, 78, 95, 67, 79, 78, 70, 73, 71]))
|
|
1739
|
+
]
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
if (!accounts.bondVault.value) {
|
|
1743
|
+
accounts.bondVault.value = await kit.getProgramDerivedAddress({
|
|
1744
|
+
programAddress,
|
|
1745
|
+
seeds: [kit.getBytesEncoder().encode(new Uint8Array([66, 79, 78, 68, 95, 86, 65, 85, 76, 84]))]
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1748
|
+
if (!accounts.tokenProgram.value) {
|
|
1749
|
+
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1750
|
+
}
|
|
1751
|
+
if (!accounts.systemProgram.value) {
|
|
1752
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1753
|
+
}
|
|
1754
|
+
if (!accounts.eventAuthority.value) {
|
|
1755
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
1756
|
+
programAddress,
|
|
1757
|
+
seeds: [
|
|
1758
|
+
kit.getBytesEncoder().encode(
|
|
1759
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
1760
|
+
)
|
|
1761
|
+
]
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
if (!accounts.program.value) {
|
|
1765
|
+
accounts.program.value = programAddress;
|
|
1766
|
+
accounts.program.isWritable = false;
|
|
1767
|
+
}
|
|
1768
|
+
return Object.freeze({
|
|
1769
|
+
accounts: [
|
|
1770
|
+
getAccountMeta("funder", accounts.funder),
|
|
1771
|
+
getAccountMeta("authority", accounts.authority),
|
|
1772
|
+
getAccountMeta("config", accounts.config),
|
|
1773
|
+
getAccountMeta("bondSource", accounts.bondSource),
|
|
1774
|
+
getAccountMeta("bondVault", accounts.bondVault),
|
|
1775
|
+
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1776
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1777
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1778
|
+
getAccountMeta("program", accounts.program)
|
|
1779
|
+
],
|
|
1780
|
+
data: getRegisterGuardianInstructionDataEncoder().encode(args),
|
|
1781
|
+
programAddress
|
|
1782
|
+
});
|
|
1783
|
+
}
|
|
1784
|
+
function getRegisterGuardianInstruction(input, config) {
|
|
1785
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1786
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1787
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1788
|
+
const originalAccounts = {
|
|
1789
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
1790
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
1791
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
1792
|
+
bondSource: { value: input.bondSource ?? null, isSigner: false, isWritable: true },
|
|
1793
|
+
bondVault: { value: input.bondVault ?? null, isSigner: false, isWritable: true },
|
|
1794
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
1795
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1796
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1797
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1798
|
+
};
|
|
1799
|
+
const accounts = originalAccounts;
|
|
1800
|
+
const args = { ...input };
|
|
1801
|
+
if (!accounts.tokenProgram.value) {
|
|
1802
|
+
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1803
|
+
}
|
|
1804
|
+
if (!accounts.systemProgram.value) {
|
|
1805
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1806
|
+
}
|
|
1807
|
+
if (!accounts.program.value) {
|
|
1808
|
+
accounts.program.value = programAddress;
|
|
1809
|
+
accounts.program.isWritable = false;
|
|
1810
|
+
}
|
|
1811
|
+
return Object.freeze({
|
|
1812
|
+
accounts: [
|
|
1813
|
+
getAccountMeta("funder", accounts.funder),
|
|
1814
|
+
getAccountMeta("authority", accounts.authority),
|
|
1815
|
+
getAccountMeta("config", accounts.config),
|
|
1816
|
+
getAccountMeta("bondSource", accounts.bondSource),
|
|
1817
|
+
getAccountMeta("bondVault", accounts.bondVault),
|
|
1818
|
+
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1819
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1820
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1821
|
+
getAccountMeta("program", accounts.program)
|
|
1822
|
+
],
|
|
1823
|
+
data: getRegisterGuardianInstructionDataEncoder().encode(args),
|
|
1824
|
+
programAddress
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1827
|
+
function parseRegisterGuardianInstruction(instruction) {
|
|
1828
|
+
if (instruction.accounts.length < 9) {
|
|
1829
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1830
|
+
actualAccountMetas: instruction.accounts.length,
|
|
1831
|
+
expectedAccountMetas: 9
|
|
1832
|
+
});
|
|
1833
|
+
}
|
|
1834
|
+
let accountIndex = 0;
|
|
1835
|
+
const getNextAccount = () => {
|
|
1836
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1837
|
+
accountIndex += 1;
|
|
1838
|
+
return accountMeta;
|
|
1839
|
+
};
|
|
1840
|
+
return {
|
|
1841
|
+
programAddress: instruction.programAddress,
|
|
1842
|
+
accounts: {
|
|
1843
|
+
funder: getNextAccount(),
|
|
1844
|
+
authority: getNextAccount(),
|
|
1845
|
+
config: getNextAccount(),
|
|
1846
|
+
bondSource: getNextAccount(),
|
|
1847
|
+
bondVault: getNextAccount(),
|
|
1848
|
+
tokenProgram: getNextAccount(),
|
|
1849
|
+
systemProgram: getNextAccount(),
|
|
1850
|
+
eventAuthority: getNextAccount(),
|
|
1851
|
+
program: getNextAccount()
|
|
1852
|
+
},
|
|
1853
|
+
data: getRegisterGuardianInstructionDataDecoder().decode(instruction.data)
|
|
1854
|
+
};
|
|
1855
|
+
}
|
|
1856
|
+
var REMOVE_GUARDIAN_DISCRIMINATOR = new Uint8Array([72, 117, 160, 244, 155, 185, 71, 18]);
|
|
1857
|
+
function getRemoveGuardianDiscriminatorBytes() {
|
|
1858
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(REMOVE_GUARDIAN_DISCRIMINATOR);
|
|
1859
|
+
}
|
|
1860
|
+
function getRemoveGuardianInstructionDataEncoder() {
|
|
1861
|
+
return kit.transformEncoder(
|
|
1862
|
+
kit.getStructEncoder([
|
|
1863
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1864
|
+
["guardian", kit.getAddressEncoder()]
|
|
1865
|
+
]),
|
|
1866
|
+
(value) => ({ ...value, discriminator: REMOVE_GUARDIAN_DISCRIMINATOR })
|
|
1867
|
+
);
|
|
1868
|
+
}
|
|
1869
|
+
function getRemoveGuardianInstructionDataDecoder() {
|
|
1870
|
+
return kit.getStructDecoder([
|
|
1871
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1872
|
+
["guardian", kit.getAddressDecoder()]
|
|
1873
|
+
]);
|
|
1874
|
+
}
|
|
1875
|
+
function getRemoveGuardianInstructionDataCodec() {
|
|
1876
|
+
return kit.combineCodec(getRemoveGuardianInstructionDataEncoder(), getRemoveGuardianInstructionDataDecoder());
|
|
1877
|
+
}
|
|
1878
|
+
async function getRemoveGuardianInstructionAsync(input, config) {
|
|
1879
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1880
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1881
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1882
|
+
const originalAccounts = {
|
|
1883
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
1884
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
1885
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
1886
|
+
bondVault: { value: input.bondVault ?? null, isSigner: false, isWritable: true },
|
|
1887
|
+
destination: { value: input.destination ?? null, isSigner: false, isWritable: true },
|
|
1888
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
1889
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1890
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1891
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1892
|
+
};
|
|
1893
|
+
const accounts = originalAccounts;
|
|
1894
|
+
const args = { ...input };
|
|
1895
|
+
if (!accounts.config.value) {
|
|
1896
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
1897
|
+
programAddress,
|
|
1898
|
+
seeds: [
|
|
1899
|
+
kit.getBytesEncoder().encode(new Uint8Array([71, 85, 65, 82, 68, 73, 65, 78, 95, 67, 79, 78, 70, 73, 71]))
|
|
1900
|
+
]
|
|
1901
|
+
});
|
|
1902
|
+
}
|
|
1903
|
+
if (!accounts.bondVault.value) {
|
|
1904
|
+
accounts.bondVault.value = await kit.getProgramDerivedAddress({
|
|
1905
|
+
programAddress,
|
|
1906
|
+
seeds: [kit.getBytesEncoder().encode(new Uint8Array([66, 79, 78, 68, 95, 86, 65, 85, 76, 84]))]
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
if (!accounts.tokenProgram.value) {
|
|
1910
|
+
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1911
|
+
}
|
|
1912
|
+
if (!accounts.systemProgram.value) {
|
|
1913
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1914
|
+
}
|
|
1915
|
+
if (!accounts.eventAuthority.value) {
|
|
1916
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
1917
|
+
programAddress,
|
|
1918
|
+
seeds: [
|
|
1919
|
+
kit.getBytesEncoder().encode(
|
|
1920
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
1921
|
+
)
|
|
1922
|
+
]
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
if (!accounts.program.value) {
|
|
1926
|
+
accounts.program.value = programAddress;
|
|
1927
|
+
accounts.program.isWritable = false;
|
|
1928
|
+
}
|
|
1929
|
+
return Object.freeze({
|
|
1930
|
+
accounts: [
|
|
1931
|
+
getAccountMeta("funder", accounts.funder),
|
|
1932
|
+
getAccountMeta("authority", accounts.authority),
|
|
1933
|
+
getAccountMeta("config", accounts.config),
|
|
1934
|
+
getAccountMeta("bondVault", accounts.bondVault),
|
|
1935
|
+
getAccountMeta("destination", accounts.destination),
|
|
1936
|
+
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1937
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1938
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1939
|
+
getAccountMeta("program", accounts.program)
|
|
1940
|
+
],
|
|
1941
|
+
data: getRemoveGuardianInstructionDataEncoder().encode(args),
|
|
1942
|
+
programAddress
|
|
1943
|
+
});
|
|
1944
|
+
}
|
|
1945
|
+
function getRemoveGuardianInstruction(input, config) {
|
|
1946
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
1947
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1948
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1949
|
+
const originalAccounts = {
|
|
1950
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
1951
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
1952
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
1953
|
+
bondVault: { value: input.bondVault ?? null, isSigner: false, isWritable: true },
|
|
1954
|
+
destination: { value: input.destination ?? null, isSigner: false, isWritable: true },
|
|
1955
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
1956
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1957
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1958
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
1959
|
+
};
|
|
1960
|
+
const accounts = originalAccounts;
|
|
1961
|
+
const args = { ...input };
|
|
1962
|
+
if (!accounts.tokenProgram.value) {
|
|
1963
|
+
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1964
|
+
}
|
|
1965
|
+
if (!accounts.systemProgram.value) {
|
|
1966
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1967
|
+
}
|
|
1968
|
+
if (!accounts.program.value) {
|
|
1969
|
+
accounts.program.value = programAddress;
|
|
1970
|
+
accounts.program.isWritable = false;
|
|
1971
|
+
}
|
|
1972
|
+
return Object.freeze({
|
|
1973
|
+
accounts: [
|
|
1974
|
+
getAccountMeta("funder", accounts.funder),
|
|
1975
|
+
getAccountMeta("authority", accounts.authority),
|
|
1976
|
+
getAccountMeta("config", accounts.config),
|
|
1977
|
+
getAccountMeta("bondVault", accounts.bondVault),
|
|
1978
|
+
getAccountMeta("destination", accounts.destination),
|
|
1979
|
+
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1980
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1981
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1982
|
+
getAccountMeta("program", accounts.program)
|
|
1983
|
+
],
|
|
1984
|
+
data: getRemoveGuardianInstructionDataEncoder().encode(args),
|
|
1985
|
+
programAddress
|
|
1986
|
+
});
|
|
1987
|
+
}
|
|
1988
|
+
function parseRemoveGuardianInstruction(instruction) {
|
|
1989
|
+
if (instruction.accounts.length < 9) {
|
|
1990
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1991
|
+
actualAccountMetas: instruction.accounts.length,
|
|
1992
|
+
expectedAccountMetas: 9
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
let accountIndex = 0;
|
|
1996
|
+
const getNextAccount = () => {
|
|
1997
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1998
|
+
accountIndex += 1;
|
|
1999
|
+
return accountMeta;
|
|
2000
|
+
};
|
|
2001
|
+
const getNextOptionalAccount = () => {
|
|
2002
|
+
const accountMeta = getNextAccount();
|
|
2003
|
+
return accountMeta.address === GUARDIAN_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
2004
|
+
};
|
|
2005
|
+
return {
|
|
2006
|
+
programAddress: instruction.programAddress,
|
|
2007
|
+
accounts: {
|
|
2008
|
+
funder: getNextAccount(),
|
|
2009
|
+
authority: getNextAccount(),
|
|
2010
|
+
config: getNextAccount(),
|
|
2011
|
+
bondVault: getNextAccount(),
|
|
2012
|
+
destination: getNextOptionalAccount(),
|
|
2013
|
+
tokenProgram: getNextAccount(),
|
|
2014
|
+
systemProgram: getNextAccount(),
|
|
2015
|
+
eventAuthority: getNextAccount(),
|
|
2016
|
+
program: getNextAccount()
|
|
2017
|
+
},
|
|
2018
|
+
data: getRemoveGuardianInstructionDataDecoder().decode(instruction.data)
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
var ROTATE_VOTE_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
2022
|
+
153,
|
|
2023
|
+
199,
|
|
2024
|
+
84,
|
|
2025
|
+
126,
|
|
2026
|
+
148,
|
|
2027
|
+
220,
|
|
2028
|
+
80,
|
|
2029
|
+
34
|
|
2030
|
+
]);
|
|
2031
|
+
function getRotateVoteAuthorityDiscriminatorBytes() {
|
|
2032
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(ROTATE_VOTE_AUTHORITY_DISCRIMINATOR);
|
|
2033
|
+
}
|
|
2034
|
+
function getRotateVoteAuthorityInstructionDataEncoder() {
|
|
2035
|
+
return kit.transformEncoder(
|
|
2036
|
+
kit.getStructEncoder([
|
|
2037
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2038
|
+
["guardian", kit.getAddressEncoder()],
|
|
2039
|
+
["newVoteAuthority", kit.getAddressEncoder()]
|
|
2040
|
+
]),
|
|
2041
|
+
(value) => ({ ...value, discriminator: ROTATE_VOTE_AUTHORITY_DISCRIMINATOR })
|
|
2042
|
+
);
|
|
2043
|
+
}
|
|
2044
|
+
function getRotateVoteAuthorityInstructionDataDecoder() {
|
|
2045
|
+
return kit.getStructDecoder([
|
|
2046
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2047
|
+
["guardian", kit.getAddressDecoder()],
|
|
2048
|
+
["newVoteAuthority", kit.getAddressDecoder()]
|
|
2049
|
+
]);
|
|
2050
|
+
}
|
|
2051
|
+
function getRotateVoteAuthorityInstructionDataCodec() {
|
|
2052
|
+
return kit.combineCodec(getRotateVoteAuthorityInstructionDataEncoder(), getRotateVoteAuthorityInstructionDataDecoder());
|
|
2053
|
+
}
|
|
2054
|
+
async function getRotateVoteAuthorityInstructionAsync(input, config) {
|
|
2055
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
2056
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2057
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2058
|
+
const originalAccounts = {
|
|
2059
|
+
signer: { value: input.signer ?? null, isSigner: true, isWritable: false },
|
|
2060
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
2061
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2062
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
2063
|
+
};
|
|
2064
|
+
const accounts = originalAccounts;
|
|
2065
|
+
const args = { ...input };
|
|
2066
|
+
if (!accounts.config.value) {
|
|
2067
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
2068
|
+
programAddress,
|
|
2069
|
+
seeds: [
|
|
2070
|
+
kit.getBytesEncoder().encode(new Uint8Array([71, 85, 65, 82, 68, 73, 65, 78, 95, 67, 79, 78, 70, 73, 71]))
|
|
2071
|
+
]
|
|
2072
|
+
});
|
|
2073
|
+
}
|
|
2074
|
+
if (!accounts.eventAuthority.value) {
|
|
2075
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
2076
|
+
programAddress,
|
|
2077
|
+
seeds: [
|
|
2078
|
+
kit.getBytesEncoder().encode(
|
|
2079
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
2080
|
+
)
|
|
2081
|
+
]
|
|
2082
|
+
});
|
|
2083
|
+
}
|
|
2084
|
+
if (!accounts.program.value) {
|
|
2085
|
+
accounts.program.value = programAddress;
|
|
2086
|
+
accounts.program.isWritable = false;
|
|
2087
|
+
}
|
|
2088
|
+
return Object.freeze({
|
|
2089
|
+
accounts: [
|
|
2090
|
+
getAccountMeta("signer", accounts.signer),
|
|
2091
|
+
getAccountMeta("config", accounts.config),
|
|
2092
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
2093
|
+
getAccountMeta("program", accounts.program)
|
|
2094
|
+
],
|
|
2095
|
+
data: getRotateVoteAuthorityInstructionDataEncoder().encode(args),
|
|
2096
|
+
programAddress
|
|
2097
|
+
});
|
|
2098
|
+
}
|
|
2099
|
+
function getRotateVoteAuthorityInstruction(input, config) {
|
|
2100
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
2101
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2102
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2103
|
+
const originalAccounts = {
|
|
2104
|
+
signer: { value: input.signer ?? null, isSigner: true, isWritable: false },
|
|
2105
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
2106
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2107
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
2108
|
+
};
|
|
2109
|
+
const accounts = originalAccounts;
|
|
2110
|
+
const args = { ...input };
|
|
2111
|
+
if (!accounts.program.value) {
|
|
2112
|
+
accounts.program.value = programAddress;
|
|
2113
|
+
accounts.program.isWritable = false;
|
|
2114
|
+
}
|
|
2115
|
+
return Object.freeze({
|
|
2116
|
+
accounts: [
|
|
2117
|
+
getAccountMeta("signer", accounts.signer),
|
|
2118
|
+
getAccountMeta("config", accounts.config),
|
|
2119
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
2120
|
+
getAccountMeta("program", accounts.program)
|
|
2121
|
+
],
|
|
2122
|
+
data: getRotateVoteAuthorityInstructionDataEncoder().encode(args),
|
|
2123
|
+
programAddress
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2126
|
+
function parseRotateVoteAuthorityInstruction(instruction) {
|
|
2127
|
+
if (instruction.accounts.length < 4) {
|
|
2128
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2129
|
+
actualAccountMetas: instruction.accounts.length,
|
|
2130
|
+
expectedAccountMetas: 4
|
|
2131
|
+
});
|
|
2132
|
+
}
|
|
2133
|
+
let accountIndex = 0;
|
|
2134
|
+
const getNextAccount = () => {
|
|
2135
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
2136
|
+
accountIndex += 1;
|
|
2137
|
+
return accountMeta;
|
|
2138
|
+
};
|
|
2139
|
+
return {
|
|
2140
|
+
programAddress: instruction.programAddress,
|
|
2141
|
+
accounts: {
|
|
2142
|
+
signer: getNextAccount(),
|
|
2143
|
+
config: getNextAccount(),
|
|
2144
|
+
eventAuthority: getNextAccount(),
|
|
2145
|
+
program: getNextAccount()
|
|
2146
|
+
},
|
|
2147
|
+
data: getRotateVoteAuthorityInstructionDataDecoder().decode(instruction.data)
|
|
2148
|
+
};
|
|
2149
|
+
}
|
|
2150
|
+
var SET_APP_DEVELOPER_DISCRIMINATOR = new Uint8Array([53, 1, 26, 238, 175, 84, 152, 48]);
|
|
2151
|
+
function getSetAppDeveloperDiscriminatorBytes() {
|
|
2152
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(SET_APP_DEVELOPER_DISCRIMINATOR);
|
|
2153
|
+
}
|
|
2154
|
+
function getSetAppDeveloperInstructionDataEncoder() {
|
|
2155
|
+
return kit.transformEncoder(
|
|
2156
|
+
kit.getStructEncoder([
|
|
2157
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2158
|
+
["developer", kit.getAddressEncoder()],
|
|
2159
|
+
["allowed", kit.getBooleanEncoder()]
|
|
2160
|
+
]),
|
|
2161
|
+
(value) => ({ ...value, discriminator: SET_APP_DEVELOPER_DISCRIMINATOR })
|
|
2162
|
+
);
|
|
2163
|
+
}
|
|
2164
|
+
function getSetAppDeveloperInstructionDataDecoder() {
|
|
2165
|
+
return kit.getStructDecoder([
|
|
2166
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2167
|
+
["developer", kit.getAddressDecoder()],
|
|
2168
|
+
["allowed", kit.getBooleanDecoder()]
|
|
2169
|
+
]);
|
|
2170
|
+
}
|
|
2171
|
+
function getSetAppDeveloperInstructionDataCodec() {
|
|
2172
|
+
return kit.combineCodec(getSetAppDeveloperInstructionDataEncoder(), getSetAppDeveloperInstructionDataDecoder());
|
|
2173
|
+
}
|
|
2174
|
+
async function getSetAppDeveloperInstructionAsync(input, config) {
|
|
2175
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
2176
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2177
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2178
|
+
const originalAccounts = {
|
|
2179
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
2180
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
2181
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
2182
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
2183
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2184
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
2185
|
+
};
|
|
2186
|
+
const accounts = originalAccounts;
|
|
2187
|
+
const args = { ...input };
|
|
2188
|
+
if (!accounts.systemProgram.value) {
|
|
2189
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2190
|
+
}
|
|
2191
|
+
if (!accounts.eventAuthority.value) {
|
|
2192
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
2193
|
+
programAddress,
|
|
2194
|
+
seeds: [
|
|
2195
|
+
kit.getBytesEncoder().encode(
|
|
2196
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
2197
|
+
)
|
|
2198
|
+
]
|
|
2199
|
+
});
|
|
2200
|
+
}
|
|
2201
|
+
if (!accounts.program.value) {
|
|
2202
|
+
accounts.program.value = programAddress;
|
|
2203
|
+
accounts.program.isWritable = false;
|
|
2204
|
+
}
|
|
2205
|
+
return Object.freeze({
|
|
2206
|
+
accounts: [
|
|
2207
|
+
getAccountMeta("funder", accounts.funder),
|
|
2208
|
+
getAccountMeta("authority", accounts.authority),
|
|
2209
|
+
getAccountMeta("app", accounts.app),
|
|
2210
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
2211
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
2212
|
+
getAccountMeta("program", accounts.program)
|
|
2213
|
+
],
|
|
2214
|
+
data: getSetAppDeveloperInstructionDataEncoder().encode(args),
|
|
2215
|
+
programAddress
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
function getSetAppDeveloperInstruction(input, config) {
|
|
2219
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
2220
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2221
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2222
|
+
const originalAccounts = {
|
|
2223
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
2224
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
2225
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
2226
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
2227
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2228
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
2229
|
+
};
|
|
2230
|
+
const accounts = originalAccounts;
|
|
2231
|
+
const args = { ...input };
|
|
2232
|
+
if (!accounts.systemProgram.value) {
|
|
2233
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2234
|
+
}
|
|
2235
|
+
if (!accounts.program.value) {
|
|
2236
|
+
accounts.program.value = programAddress;
|
|
2237
|
+
accounts.program.isWritable = false;
|
|
2238
|
+
}
|
|
2239
|
+
return Object.freeze({
|
|
2240
|
+
accounts: [
|
|
2241
|
+
getAccountMeta("funder", accounts.funder),
|
|
2242
|
+
getAccountMeta("authority", accounts.authority),
|
|
2243
|
+
getAccountMeta("app", accounts.app),
|
|
2244
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
2245
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
2246
|
+
getAccountMeta("program", accounts.program)
|
|
2247
|
+
],
|
|
2248
|
+
data: getSetAppDeveloperInstructionDataEncoder().encode(args),
|
|
2249
|
+
programAddress
|
|
2250
|
+
});
|
|
2251
|
+
}
|
|
2252
|
+
function parseSetAppDeveloperInstruction(instruction) {
|
|
2253
|
+
if (instruction.accounts.length < 6) {
|
|
2254
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2255
|
+
actualAccountMetas: instruction.accounts.length,
|
|
2256
|
+
expectedAccountMetas: 6
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
let accountIndex = 0;
|
|
2260
|
+
const getNextAccount = () => {
|
|
2261
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
2262
|
+
accountIndex += 1;
|
|
2263
|
+
return accountMeta;
|
|
2264
|
+
};
|
|
2265
|
+
return {
|
|
2266
|
+
programAddress: instruction.programAddress,
|
|
2267
|
+
accounts: {
|
|
2268
|
+
funder: getNextAccount(),
|
|
2269
|
+
authority: getNextAccount(),
|
|
2270
|
+
app: getNextAccount(),
|
|
2271
|
+
systemProgram: getNextAccount(),
|
|
2272
|
+
eventAuthority: getNextAccount(),
|
|
2273
|
+
program: getNextAccount()
|
|
2274
|
+
},
|
|
2275
|
+
data: getSetAppDeveloperInstructionDataDecoder().decode(instruction.data)
|
|
2276
|
+
};
|
|
2277
|
+
}
|
|
2278
|
+
var UPDATE_CONFIG_DISCRIMINATOR = new Uint8Array([29, 158, 252, 191, 10, 83, 219, 99]);
|
|
2279
|
+
function getUpdateConfigDiscriminatorBytes() {
|
|
2280
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(UPDATE_CONFIG_DISCRIMINATOR);
|
|
2281
|
+
}
|
|
2282
|
+
function getUpdateConfigInstructionDataEncoder() {
|
|
2283
|
+
return kit.transformEncoder(
|
|
2284
|
+
kit.getStructEncoder([
|
|
2285
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2286
|
+
["bondAmount", kit.getOptionEncoder(kit.getU64Encoder())],
|
|
2287
|
+
["policyBundleHash", kit.getOptionEncoder(kit.fixEncoderSize(kit.getBytesEncoder(), 32))],
|
|
2288
|
+
["voteWindow", kit.getOptionEncoder(kit.getU32Encoder())],
|
|
2289
|
+
["votingPeriod", kit.getOptionEncoder(kit.getU32Encoder())]
|
|
2290
|
+
]),
|
|
2291
|
+
(value) => ({ ...value, discriminator: UPDATE_CONFIG_DISCRIMINATOR })
|
|
2292
|
+
);
|
|
2293
|
+
}
|
|
2294
|
+
function getUpdateConfigInstructionDataDecoder() {
|
|
2295
|
+
return kit.getStructDecoder([
|
|
2296
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2297
|
+
["bondAmount", kit.getOptionDecoder(kit.getU64Decoder())],
|
|
2298
|
+
["policyBundleHash", kit.getOptionDecoder(kit.fixDecoderSize(kit.getBytesDecoder(), 32))],
|
|
2299
|
+
["voteWindow", kit.getOptionDecoder(kit.getU32Decoder())],
|
|
2300
|
+
["votingPeriod", kit.getOptionDecoder(kit.getU32Decoder())]
|
|
2301
|
+
]);
|
|
2302
|
+
}
|
|
2303
|
+
function getUpdateConfigInstructionDataCodec() {
|
|
2304
|
+
return kit.combineCodec(getUpdateConfigInstructionDataEncoder(), getUpdateConfigInstructionDataDecoder());
|
|
2305
|
+
}
|
|
2306
|
+
async function getUpdateConfigInstructionAsync(input, config) {
|
|
2307
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
2308
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2309
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2310
|
+
const originalAccounts = {
|
|
2311
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
2312
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
2313
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2314
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
2315
|
+
};
|
|
2316
|
+
const accounts = originalAccounts;
|
|
2317
|
+
const args = { ...input };
|
|
2318
|
+
if (!accounts.config.value) {
|
|
2319
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
2320
|
+
programAddress,
|
|
2321
|
+
seeds: [
|
|
2322
|
+
kit.getBytesEncoder().encode(new Uint8Array([71, 85, 65, 82, 68, 73, 65, 78, 95, 67, 79, 78, 70, 73, 71]))
|
|
2323
|
+
]
|
|
2324
|
+
});
|
|
2325
|
+
}
|
|
2326
|
+
if (!accounts.eventAuthority.value) {
|
|
2327
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
2328
|
+
programAddress,
|
|
2329
|
+
seeds: [
|
|
2330
|
+
kit.getBytesEncoder().encode(
|
|
2331
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
2332
|
+
)
|
|
2333
|
+
]
|
|
2334
|
+
});
|
|
2335
|
+
}
|
|
2336
|
+
if (!accounts.program.value) {
|
|
2337
|
+
accounts.program.value = programAddress;
|
|
2338
|
+
accounts.program.isWritable = false;
|
|
2339
|
+
}
|
|
2340
|
+
return Object.freeze({
|
|
2341
|
+
accounts: [
|
|
2342
|
+
getAccountMeta("authority", accounts.authority),
|
|
2343
|
+
getAccountMeta("config", accounts.config),
|
|
2344
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
2345
|
+
getAccountMeta("program", accounts.program)
|
|
2346
|
+
],
|
|
2347
|
+
data: getUpdateConfigInstructionDataEncoder().encode(args),
|
|
2348
|
+
programAddress
|
|
2349
|
+
});
|
|
2350
|
+
}
|
|
2351
|
+
function getUpdateConfigInstruction(input, config) {
|
|
2352
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
2353
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2354
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2355
|
+
const originalAccounts = {
|
|
2356
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
2357
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: true },
|
|
2358
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2359
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
2360
|
+
};
|
|
2361
|
+
const accounts = originalAccounts;
|
|
2362
|
+
const args = { ...input };
|
|
2363
|
+
if (!accounts.program.value) {
|
|
2364
|
+
accounts.program.value = programAddress;
|
|
2365
|
+
accounts.program.isWritable = false;
|
|
2366
|
+
}
|
|
2367
|
+
return Object.freeze({
|
|
2368
|
+
accounts: [
|
|
2369
|
+
getAccountMeta("authority", accounts.authority),
|
|
2370
|
+
getAccountMeta("config", accounts.config),
|
|
2371
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
2372
|
+
getAccountMeta("program", accounts.program)
|
|
2373
|
+
],
|
|
2374
|
+
data: getUpdateConfigInstructionDataEncoder().encode(args),
|
|
2375
|
+
programAddress
|
|
2376
|
+
});
|
|
2377
|
+
}
|
|
2378
|
+
function parseUpdateConfigInstruction(instruction) {
|
|
2379
|
+
if (instruction.accounts.length < 4) {
|
|
2380
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2381
|
+
actualAccountMetas: instruction.accounts.length,
|
|
2382
|
+
expectedAccountMetas: 4
|
|
2383
|
+
});
|
|
2384
|
+
}
|
|
2385
|
+
let accountIndex = 0;
|
|
2386
|
+
const getNextAccount = () => {
|
|
2387
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
2388
|
+
accountIndex += 1;
|
|
2389
|
+
return accountMeta;
|
|
2390
|
+
};
|
|
2391
|
+
return {
|
|
2392
|
+
programAddress: instruction.programAddress,
|
|
2393
|
+
accounts: {
|
|
2394
|
+
authority: getNextAccount(),
|
|
2395
|
+
config: getNextAccount(),
|
|
2396
|
+
eventAuthority: getNextAccount(),
|
|
2397
|
+
program: getNextAccount()
|
|
2398
|
+
},
|
|
2399
|
+
data: getUpdateConfigInstructionDataDecoder().decode(instruction.data)
|
|
2400
|
+
};
|
|
2401
|
+
}
|
|
2402
|
+
var VOTE_DISCRIMINATOR = new Uint8Array([227, 110, 155, 23, 136, 126, 172, 25]);
|
|
2403
|
+
function getVoteDiscriminatorBytes() {
|
|
2404
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(VOTE_DISCRIMINATOR);
|
|
2405
|
+
}
|
|
2406
|
+
function getVoteInstructionDataEncoder() {
|
|
2407
|
+
return kit.transformEncoder(
|
|
2408
|
+
kit.getStructEncoder([
|
|
2409
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2410
|
+
["approve", kit.getBooleanEncoder()],
|
|
2411
|
+
["versionCode", kit.getU32Encoder()],
|
|
2412
|
+
["manifestHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
2413
|
+
["policyBundleHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
2414
|
+
["findings", kit.getArrayEncoder(getVoteFindingEncoder())]
|
|
2415
|
+
]),
|
|
2416
|
+
(value) => ({ ...value, discriminator: VOTE_DISCRIMINATOR })
|
|
2417
|
+
);
|
|
2418
|
+
}
|
|
2419
|
+
function getVoteInstructionDataDecoder() {
|
|
2420
|
+
return kit.getStructDecoder([
|
|
2421
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2422
|
+
["approve", kit.getBooleanDecoder()],
|
|
2423
|
+
["versionCode", kit.getU32Decoder()],
|
|
2424
|
+
["manifestHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
2425
|
+
["policyBundleHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
2426
|
+
["findings", kit.getArrayDecoder(getVoteFindingDecoder())]
|
|
2427
|
+
]);
|
|
2428
|
+
}
|
|
2429
|
+
function getVoteInstructionDataCodec() {
|
|
2430
|
+
return kit.combineCodec(getVoteInstructionDataEncoder(), getVoteInstructionDataDecoder());
|
|
2431
|
+
}
|
|
2432
|
+
async function getVoteInstructionAsync(input, config) {
|
|
2433
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
2434
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2435
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2436
|
+
const originalAccounts = {
|
|
2437
|
+
voteAuthority: { value: input.voteAuthority ?? null, isSigner: true, isWritable: false },
|
|
2438
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: false },
|
|
2439
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
2440
|
+
registry: { value: input.registry ?? null, isSigner: false, isWritable: true },
|
|
2441
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2442
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
2443
|
+
};
|
|
2444
|
+
const accounts = originalAccounts;
|
|
2445
|
+
const args = { ...input };
|
|
2446
|
+
if (!accounts.config.value) {
|
|
2447
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
2448
|
+
programAddress,
|
|
2449
|
+
seeds: [
|
|
2450
|
+
kit.getBytesEncoder().encode(new Uint8Array([71, 85, 65, 82, 68, 73, 65, 78, 95, 67, 79, 78, 70, 73, 71]))
|
|
2451
|
+
]
|
|
2452
|
+
});
|
|
2453
|
+
}
|
|
2454
|
+
if (!accounts.registry.value) {
|
|
2455
|
+
accounts.registry.value = await kit.getProgramDerivedAddress({
|
|
2456
|
+
programAddress,
|
|
2457
|
+
seeds: [
|
|
2458
|
+
kit.getBytesEncoder().encode(
|
|
2459
|
+
new Uint8Array([80, 69, 78, 68, 73, 78, 71, 95, 82, 69, 71, 73, 83, 84, 82, 89])
|
|
2460
|
+
)
|
|
2461
|
+
]
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2464
|
+
if (!accounts.eventAuthority.value) {
|
|
2465
|
+
accounts.eventAuthority.value = await kit.getProgramDerivedAddress({
|
|
2466
|
+
programAddress,
|
|
2467
|
+
seeds: [
|
|
2468
|
+
kit.getBytesEncoder().encode(
|
|
2469
|
+
new Uint8Array([95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
2470
|
+
)
|
|
2471
|
+
]
|
|
2472
|
+
});
|
|
2473
|
+
}
|
|
2474
|
+
if (!accounts.program.value) {
|
|
2475
|
+
accounts.program.value = programAddress;
|
|
2476
|
+
accounts.program.isWritable = false;
|
|
2477
|
+
}
|
|
2478
|
+
return Object.freeze({
|
|
2479
|
+
accounts: [
|
|
2480
|
+
getAccountMeta("voteAuthority", accounts.voteAuthority),
|
|
2481
|
+
getAccountMeta("config", accounts.config),
|
|
2482
|
+
getAccountMeta("app", accounts.app),
|
|
2483
|
+
getAccountMeta("registry", accounts.registry),
|
|
2484
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
2485
|
+
getAccountMeta("program", accounts.program)
|
|
2486
|
+
],
|
|
2487
|
+
data: getVoteInstructionDataEncoder().encode(args),
|
|
2488
|
+
programAddress
|
|
2489
|
+
});
|
|
2490
|
+
}
|
|
2491
|
+
function getVoteInstruction(input, config) {
|
|
2492
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
2493
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2494
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2495
|
+
const originalAccounts = {
|
|
2496
|
+
voteAuthority: { value: input.voteAuthority ?? null, isSigner: true, isWritable: false },
|
|
2497
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: false },
|
|
2498
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
2499
|
+
registry: { value: input.registry ?? null, isSigner: false, isWritable: true },
|
|
2500
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2501
|
+
program: { value: input.program ?? null, isSigner: false, isWritable: false }
|
|
2502
|
+
};
|
|
2503
|
+
const accounts = originalAccounts;
|
|
2504
|
+
const args = { ...input };
|
|
2505
|
+
if (!accounts.program.value) {
|
|
2506
|
+
accounts.program.value = programAddress;
|
|
2507
|
+
accounts.program.isWritable = false;
|
|
2508
|
+
}
|
|
2509
|
+
return Object.freeze({
|
|
2510
|
+
accounts: [
|
|
2511
|
+
getAccountMeta("voteAuthority", accounts.voteAuthority),
|
|
2512
|
+
getAccountMeta("config", accounts.config),
|
|
2513
|
+
getAccountMeta("app", accounts.app),
|
|
2514
|
+
getAccountMeta("registry", accounts.registry),
|
|
2515
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
2516
|
+
getAccountMeta("program", accounts.program)
|
|
2517
|
+
],
|
|
2518
|
+
data: getVoteInstructionDataEncoder().encode(args),
|
|
2519
|
+
programAddress
|
|
2520
|
+
});
|
|
2521
|
+
}
|
|
2522
|
+
function parseVoteInstruction(instruction) {
|
|
2523
|
+
if (instruction.accounts.length < 6) {
|
|
2524
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2525
|
+
actualAccountMetas: instruction.accounts.length,
|
|
2526
|
+
expectedAccountMetas: 6
|
|
2527
|
+
});
|
|
2528
|
+
}
|
|
2529
|
+
let accountIndex = 0;
|
|
2530
|
+
const getNextAccount = () => {
|
|
2531
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
2532
|
+
accountIndex += 1;
|
|
2533
|
+
return accountMeta;
|
|
2534
|
+
};
|
|
2535
|
+
return {
|
|
2536
|
+
programAddress: instruction.programAddress,
|
|
2537
|
+
accounts: {
|
|
2538
|
+
voteAuthority: getNextAccount(),
|
|
2539
|
+
config: getNextAccount(),
|
|
2540
|
+
app: getNextAccount(),
|
|
2541
|
+
registry: getNextAccount(),
|
|
2542
|
+
eventAuthority: getNextAccount(),
|
|
2543
|
+
program: getNextAccount()
|
|
2544
|
+
},
|
|
2545
|
+
data: getVoteInstructionDataDecoder().decode(instruction.data)
|
|
2546
|
+
};
|
|
2547
|
+
}
|
|
2548
|
+
var WRITE_RELEASE_MANIFEST_DISCRIMINATOR = new Uint8Array([
|
|
2549
|
+
98,
|
|
2550
|
+
30,
|
|
2551
|
+
102,
|
|
2552
|
+
216,
|
|
2553
|
+
54,
|
|
2554
|
+
58,
|
|
2555
|
+
138,
|
|
2556
|
+
114
|
|
2557
|
+
]);
|
|
2558
|
+
function getWriteReleaseManifestDiscriminatorBytes() {
|
|
2559
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(WRITE_RELEASE_MANIFEST_DISCRIMINATOR);
|
|
2560
|
+
}
|
|
2561
|
+
function getWriteReleaseManifestInstructionDataEncoder() {
|
|
2562
|
+
return kit.transformEncoder(
|
|
2563
|
+
kit.getStructEncoder([
|
|
2564
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2565
|
+
["versionCode", kit.getU32Encoder()],
|
|
2566
|
+
["manifestLen", kit.getU32Encoder()],
|
|
2567
|
+
["offset", kit.getU32Encoder()],
|
|
2568
|
+
["bytes", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())]
|
|
2569
|
+
]),
|
|
2570
|
+
(value) => ({ ...value, discriminator: WRITE_RELEASE_MANIFEST_DISCRIMINATOR })
|
|
2571
|
+
);
|
|
2572
|
+
}
|
|
2573
|
+
function getWriteReleaseManifestInstructionDataDecoder() {
|
|
2574
|
+
return kit.getStructDecoder([
|
|
2575
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2576
|
+
["versionCode", kit.getU32Decoder()],
|
|
2577
|
+
["manifestLen", kit.getU32Decoder()],
|
|
2578
|
+
["offset", kit.getU32Decoder()],
|
|
2579
|
+
["bytes", kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())]
|
|
2580
|
+
]);
|
|
2581
|
+
}
|
|
2582
|
+
function getWriteReleaseManifestInstructionDataCodec() {
|
|
2583
|
+
return kit.combineCodec(
|
|
2584
|
+
getWriteReleaseManifestInstructionDataEncoder(),
|
|
2585
|
+
getWriteReleaseManifestInstructionDataDecoder()
|
|
2586
|
+
);
|
|
2587
|
+
}
|
|
2588
|
+
async function getWriteReleaseManifestInstructionAsync(input, config) {
|
|
2589
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
2590
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2591
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2592
|
+
const originalAccounts = {
|
|
2593
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
2594
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
2595
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
2596
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: false },
|
|
2597
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false }
|
|
2598
|
+
};
|
|
2599
|
+
const accounts = originalAccounts;
|
|
2600
|
+
const args = { ...input };
|
|
2601
|
+
if (!accounts.config.value) {
|
|
2602
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
2603
|
+
programAddress,
|
|
2604
|
+
seeds: [
|
|
2605
|
+
kit.getBytesEncoder().encode(new Uint8Array([71, 85, 65, 82, 68, 73, 65, 78, 95, 67, 79, 78, 70, 73, 71]))
|
|
2606
|
+
]
|
|
2607
|
+
});
|
|
2608
|
+
}
|
|
2609
|
+
if (!accounts.systemProgram.value) {
|
|
2610
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2611
|
+
}
|
|
2612
|
+
return Object.freeze({
|
|
2613
|
+
accounts: [
|
|
2614
|
+
getAccountMeta("funder", accounts.funder),
|
|
2615
|
+
getAccountMeta("authority", accounts.authority),
|
|
2616
|
+
getAccountMeta("app", accounts.app),
|
|
2617
|
+
getAccountMeta("config", accounts.config),
|
|
2618
|
+
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
2619
|
+
],
|
|
2620
|
+
data: getWriteReleaseManifestInstructionDataEncoder().encode(args),
|
|
2621
|
+
programAddress
|
|
2622
|
+
});
|
|
2623
|
+
}
|
|
2624
|
+
function getWriteReleaseManifestInstruction(input, config) {
|
|
2625
|
+
const programAddressInput = config?.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
2626
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2627
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2628
|
+
const originalAccounts = {
|
|
2629
|
+
funder: { value: input.funder ?? null, isSigner: true, isWritable: true },
|
|
2630
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: false },
|
|
2631
|
+
app: { value: input.app ?? null, isSigner: false, isWritable: true },
|
|
2632
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: false },
|
|
2633
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false }
|
|
2634
|
+
};
|
|
2635
|
+
const accounts = originalAccounts;
|
|
2636
|
+
const args = { ...input };
|
|
2637
|
+
if (!accounts.systemProgram.value) {
|
|
2638
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2639
|
+
}
|
|
2640
|
+
return Object.freeze({
|
|
2641
|
+
accounts: [
|
|
2642
|
+
getAccountMeta("funder", accounts.funder),
|
|
2643
|
+
getAccountMeta("authority", accounts.authority),
|
|
2644
|
+
getAccountMeta("app", accounts.app),
|
|
2645
|
+
getAccountMeta("config", accounts.config),
|
|
2646
|
+
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
2647
|
+
],
|
|
2648
|
+
data: getWriteReleaseManifestInstructionDataEncoder().encode(args),
|
|
2649
|
+
programAddress
|
|
2650
|
+
});
|
|
2651
|
+
}
|
|
2652
|
+
function parseWriteReleaseManifestInstruction(instruction) {
|
|
2653
|
+
if (instruction.accounts.length < 5) {
|
|
2654
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2655
|
+
actualAccountMetas: instruction.accounts.length,
|
|
2656
|
+
expectedAccountMetas: 5
|
|
2657
|
+
});
|
|
2658
|
+
}
|
|
2659
|
+
let accountIndex = 0;
|
|
2660
|
+
const getNextAccount = () => {
|
|
2661
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
2662
|
+
accountIndex += 1;
|
|
2663
|
+
return accountMeta;
|
|
2664
|
+
};
|
|
2665
|
+
return {
|
|
2666
|
+
programAddress: instruction.programAddress,
|
|
2667
|
+
accounts: {
|
|
2668
|
+
funder: getNextAccount(),
|
|
2669
|
+
authority: getNextAccount(),
|
|
2670
|
+
app: getNextAccount(),
|
|
2671
|
+
config: getNextAccount(),
|
|
2672
|
+
systemProgram: getNextAccount()
|
|
2673
|
+
},
|
|
2674
|
+
data: getWriteReleaseManifestInstructionDataDecoder().decode(instruction.data)
|
|
2675
|
+
};
|
|
2676
|
+
}
|
|
2677
|
+
async function findBondVaultPda(config = {}) {
|
|
2678
|
+
const {
|
|
2679
|
+
programAddress: programAddressInput = "GUARDsVUfAaydbPU6QGcpWRLUkExaULtaygwEtkdhZAD"
|
|
2680
|
+
} = config;
|
|
2681
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2682
|
+
return await kit.getProgramDerivedAddress({ programAddress, seeds: [kit.getUtf8Encoder().encode("BOND_VAULT")] });
|
|
2683
|
+
}
|
|
2684
|
+
async function findGuardiansConfigPda(config = {}) {
|
|
2685
|
+
const {
|
|
2686
|
+
programAddress: programAddressInput = "GUARDsVUfAaydbPU6QGcpWRLUkExaULtaygwEtkdhZAD"
|
|
2687
|
+
} = config;
|
|
2688
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2689
|
+
return await kit.getProgramDerivedAddress({ programAddress, seeds: [kit.getUtf8Encoder().encode("GUARDIAN_CONFIG")] });
|
|
2690
|
+
}
|
|
2691
|
+
async function findPendingRegistryPda(config = {}) {
|
|
2692
|
+
const {
|
|
2693
|
+
programAddress: programAddressInput = "GUARDsVUfAaydbPU6QGcpWRLUkExaULtaygwEtkdhZAD"
|
|
2694
|
+
} = config;
|
|
2695
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2696
|
+
return await kit.getProgramDerivedAddress({ programAddress, seeds: [kit.getUtf8Encoder().encode("PENDING_REGISTRY")] });
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
// src/generated/programs/guardian.ts
|
|
2700
|
+
var GUARDIAN_PROGRAM_ADDRESS = "GUARDsVUfAaydbPU6QGcpWRLUkExaULtaygwEtkdhZAD";
|
|
2701
|
+
var GuardianAccount = /* @__PURE__ */ ((GuardianAccount2) => {
|
|
2702
|
+
GuardianAccount2[GuardianAccount2["AppAccount"] = 0] = "AppAccount";
|
|
2703
|
+
GuardianAccount2[GuardianAccount2["GuardiansConfig"] = 1] = "GuardiansConfig";
|
|
2704
|
+
GuardianAccount2[GuardianAccount2["PendingRegistry"] = 2] = "PendingRegistry";
|
|
2705
|
+
return GuardianAccount2;
|
|
2706
|
+
})(GuardianAccount || {});
|
|
2707
|
+
function identifyGuardianAccount(account) {
|
|
2708
|
+
const data = "data" in account ? account.data : account;
|
|
2709
|
+
if (kit.containsBytes(
|
|
2710
|
+
data,
|
|
2711
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([189, 192, 243, 151, 141, 78, 227, 17])),
|
|
2712
|
+
0
|
|
2713
|
+
)) {
|
|
2714
|
+
return 0 /* AppAccount */;
|
|
2715
|
+
}
|
|
2716
|
+
if (kit.containsBytes(
|
|
2717
|
+
data,
|
|
2718
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([96, 9, 56, 96, 215, 120, 26, 206])),
|
|
2719
|
+
0
|
|
2720
|
+
)) {
|
|
2721
|
+
return 1 /* GuardiansConfig */;
|
|
2722
|
+
}
|
|
2723
|
+
if (kit.containsBytes(
|
|
2724
|
+
data,
|
|
2725
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([190, 252, 14, 196, 56, 47, 120, 61])),
|
|
2726
|
+
0
|
|
2727
|
+
)) {
|
|
2728
|
+
return 2 /* PendingRegistry */;
|
|
2729
|
+
}
|
|
2730
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, {
|
|
2731
|
+
accountData: data,
|
|
2732
|
+
programName: "guardian"
|
|
2733
|
+
});
|
|
2734
|
+
}
|
|
2735
|
+
var GuardianEvent = /* @__PURE__ */ ((GuardianEvent2) => {
|
|
2736
|
+
GuardianEvent2[GuardianEvent2["AppAuthorityAccepted"] = 0] = "AppAuthorityAccepted";
|
|
2737
|
+
GuardianEvent2[GuardianEvent2["AppAuthorityProposed"] = 1] = "AppAuthorityProposed";
|
|
2738
|
+
GuardianEvent2[GuardianEvent2["AppDeveloperUpdated"] = 2] = "AppDeveloperUpdated";
|
|
2739
|
+
GuardianEvent2[GuardianEvent2["AppRegistered"] = 3] = "AppRegistered";
|
|
2740
|
+
GuardianEvent2[GuardianEvent2["ConfigAuthorityAccepted"] = 4] = "ConfigAuthorityAccepted";
|
|
2741
|
+
GuardianEvent2[GuardianEvent2["ConfigAuthorityProposed"] = 5] = "ConfigAuthorityProposed";
|
|
2742
|
+
GuardianEvent2[GuardianEvent2["ConfigInitialized"] = 6] = "ConfigInitialized";
|
|
2743
|
+
GuardianEvent2[GuardianEvent2["ConfigUpdated"] = 7] = "ConfigUpdated";
|
|
2744
|
+
GuardianEvent2[GuardianEvent2["GuardianAdded"] = 8] = "GuardianAdded";
|
|
2745
|
+
GuardianEvent2[GuardianEvent2["GuardianRegistered"] = 9] = "GuardianRegistered";
|
|
2746
|
+
GuardianEvent2[GuardianEvent2["GuardianRemoved"] = 10] = "GuardianRemoved";
|
|
2747
|
+
GuardianEvent2[GuardianEvent2["GuardianVoteAuthorityRotated"] = 11] = "GuardianVoteAuthorityRotated";
|
|
2748
|
+
GuardianEvent2[GuardianEvent2["ReleaseApproved"] = 12] = "ReleaseApproved";
|
|
2749
|
+
GuardianEvent2[GuardianEvent2["ReleaseCancelled"] = 13] = "ReleaseCancelled";
|
|
2750
|
+
GuardianEvent2[GuardianEvent2["ReleaseExpired"] = 14] = "ReleaseExpired";
|
|
2751
|
+
GuardianEvent2[GuardianEvent2["ReleaseProposed"] = 15] = "ReleaseProposed";
|
|
2752
|
+
GuardianEvent2[GuardianEvent2["ReleaseRejected"] = 16] = "ReleaseRejected";
|
|
2753
|
+
GuardianEvent2[GuardianEvent2["VoteCast"] = 17] = "VoteCast";
|
|
2754
|
+
return GuardianEvent2;
|
|
2755
|
+
})(GuardianEvent || {});
|
|
2756
|
+
function identifyGuardianEvent(event) {
|
|
2757
|
+
const data = "data" in event ? event.data : event;
|
|
2758
|
+
if (kit.containsBytes(
|
|
2759
|
+
data,
|
|
2760
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([216, 100, 38, 168, 184, 157, 141, 247])),
|
|
2761
|
+
0
|
|
2762
|
+
)) {
|
|
2763
|
+
return 0 /* AppAuthorityAccepted */;
|
|
2764
|
+
}
|
|
2765
|
+
if (kit.containsBytes(
|
|
2766
|
+
data,
|
|
2767
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([17, 143, 174, 4, 147, 110, 126, 84])),
|
|
2768
|
+
0
|
|
2769
|
+
)) {
|
|
2770
|
+
return 1 /* AppAuthorityProposed */;
|
|
2771
|
+
}
|
|
2772
|
+
if (kit.containsBytes(
|
|
2773
|
+
data,
|
|
2774
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([132, 135, 205, 60, 48, 208, 44, 171])),
|
|
2775
|
+
0
|
|
2776
|
+
)) {
|
|
2777
|
+
return 2 /* AppDeveloperUpdated */;
|
|
2778
|
+
}
|
|
2779
|
+
if (kit.containsBytes(
|
|
2780
|
+
data,
|
|
2781
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([99, 12, 19, 34, 85, 60, 170, 229])),
|
|
2782
|
+
0
|
|
2783
|
+
)) {
|
|
2784
|
+
return 3 /* AppRegistered */;
|
|
2785
|
+
}
|
|
2786
|
+
if (kit.containsBytes(
|
|
2787
|
+
data,
|
|
2788
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([166, 249, 198, 239, 64, 193, 191, 242])),
|
|
2789
|
+
0
|
|
2790
|
+
)) {
|
|
2791
|
+
return 4 /* ConfigAuthorityAccepted */;
|
|
2792
|
+
}
|
|
2793
|
+
if (kit.containsBytes(
|
|
2794
|
+
data,
|
|
2795
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([125, 29, 33, 186, 153, 16, 155, 229])),
|
|
2796
|
+
0
|
|
2797
|
+
)) {
|
|
2798
|
+
return 5 /* ConfigAuthorityProposed */;
|
|
2799
|
+
}
|
|
2800
|
+
if (kit.containsBytes(
|
|
2801
|
+
data,
|
|
2802
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([181, 49, 200, 156, 19, 167, 178, 91])),
|
|
2803
|
+
0
|
|
2804
|
+
)) {
|
|
2805
|
+
return 6 /* ConfigInitialized */;
|
|
2806
|
+
}
|
|
2807
|
+
if (kit.containsBytes(
|
|
2808
|
+
data,
|
|
2809
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([40, 241, 230, 122, 11, 19, 198, 194])),
|
|
2810
|
+
0
|
|
2811
|
+
)) {
|
|
2812
|
+
return 7 /* ConfigUpdated */;
|
|
2813
|
+
}
|
|
2814
|
+
if (kit.containsBytes(
|
|
2815
|
+
data,
|
|
2816
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([151, 0, 228, 5, 239, 58, 162, 18])),
|
|
2817
|
+
0
|
|
2818
|
+
)) {
|
|
2819
|
+
return 8 /* GuardianAdded */;
|
|
2820
|
+
}
|
|
2821
|
+
if (kit.containsBytes(
|
|
2822
|
+
data,
|
|
2823
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([255, 23, 109, 119, 11, 122, 209, 103])),
|
|
2824
|
+
0
|
|
2825
|
+
)) {
|
|
2826
|
+
return 9 /* GuardianRegistered */;
|
|
2827
|
+
}
|
|
2828
|
+
if (kit.containsBytes(
|
|
2829
|
+
data,
|
|
2830
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([225, 27, 117, 56, 241, 196, 5, 56])),
|
|
2831
|
+
0
|
|
2832
|
+
)) {
|
|
2833
|
+
return 10 /* GuardianRemoved */;
|
|
2834
|
+
}
|
|
2835
|
+
if (kit.containsBytes(
|
|
2836
|
+
data,
|
|
2837
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([182, 81, 245, 184, 174, 85, 224, 213])),
|
|
2838
|
+
0
|
|
2839
|
+
)) {
|
|
2840
|
+
return 11 /* GuardianVoteAuthorityRotated */;
|
|
2841
|
+
}
|
|
2842
|
+
if (kit.containsBytes(
|
|
2843
|
+
data,
|
|
2844
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([246, 7, 17, 99, 160, 10, 151, 253])),
|
|
2845
|
+
0
|
|
2846
|
+
)) {
|
|
2847
|
+
return 12 /* ReleaseApproved */;
|
|
2848
|
+
}
|
|
2849
|
+
if (kit.containsBytes(
|
|
2850
|
+
data,
|
|
2851
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([107, 100, 38, 206, 48, 27, 92, 178])),
|
|
2852
|
+
0
|
|
2853
|
+
)) {
|
|
2854
|
+
return 13 /* ReleaseCancelled */;
|
|
2855
|
+
}
|
|
2856
|
+
if (kit.containsBytes(
|
|
2857
|
+
data,
|
|
2858
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([185, 185, 92, 34, 95, 198, 124, 51])),
|
|
2859
|
+
0
|
|
2860
|
+
)) {
|
|
2861
|
+
return 14 /* ReleaseExpired */;
|
|
2862
|
+
}
|
|
2863
|
+
if (kit.containsBytes(
|
|
2864
|
+
data,
|
|
2865
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([245, 225, 27, 20, 64, 160, 146, 183])),
|
|
2866
|
+
0
|
|
2867
|
+
)) {
|
|
2868
|
+
return 15 /* ReleaseProposed */;
|
|
2869
|
+
}
|
|
2870
|
+
if (kit.containsBytes(
|
|
2871
|
+
data,
|
|
2872
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([144, 93, 149, 105, 200, 85, 92, 126])),
|
|
2873
|
+
0
|
|
2874
|
+
)) {
|
|
2875
|
+
return 16 /* ReleaseRejected */;
|
|
2876
|
+
}
|
|
2877
|
+
if (kit.containsBytes(
|
|
2878
|
+
data,
|
|
2879
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([39, 53, 195, 104, 188, 17, 225, 213])),
|
|
2880
|
+
0
|
|
2881
|
+
)) {
|
|
2882
|
+
return 17 /* VoteCast */;
|
|
2883
|
+
}
|
|
2884
|
+
throw new Error("The provided event could not be identified as a guardian event.");
|
|
2885
|
+
}
|
|
2886
|
+
var GuardianInstruction = /* @__PURE__ */ ((GuardianInstruction2) => {
|
|
2887
|
+
GuardianInstruction2[GuardianInstruction2["AcceptAppAuthority"] = 0] = "AcceptAppAuthority";
|
|
2888
|
+
GuardianInstruction2[GuardianInstruction2["AcceptConfigAuthority"] = 1] = "AcceptConfigAuthority";
|
|
2889
|
+
GuardianInstruction2[GuardianInstruction2["AddGuardian"] = 2] = "AddGuardian";
|
|
2890
|
+
GuardianInstruction2[GuardianInstruction2["CancelRelease"] = 3] = "CancelRelease";
|
|
2891
|
+
GuardianInstruction2[GuardianInstruction2["ExpireRelease"] = 4] = "ExpireRelease";
|
|
2892
|
+
GuardianInstruction2[GuardianInstruction2["InitializeConfig"] = 5] = "InitializeConfig";
|
|
2893
|
+
GuardianInstruction2[GuardianInstruction2["ProposeAppAuthority"] = 6] = "ProposeAppAuthority";
|
|
2894
|
+
GuardianInstruction2[GuardianInstruction2["ProposeConfigAuthority"] = 7] = "ProposeConfigAuthority";
|
|
2895
|
+
GuardianInstruction2[GuardianInstruction2["ProposeRelease"] = 8] = "ProposeRelease";
|
|
2896
|
+
GuardianInstruction2[GuardianInstruction2["RegisterApp"] = 9] = "RegisterApp";
|
|
2897
|
+
GuardianInstruction2[GuardianInstruction2["RegisterGuardian"] = 10] = "RegisterGuardian";
|
|
2898
|
+
GuardianInstruction2[GuardianInstruction2["RemoveGuardian"] = 11] = "RemoveGuardian";
|
|
2899
|
+
GuardianInstruction2[GuardianInstruction2["RotateVoteAuthority"] = 12] = "RotateVoteAuthority";
|
|
2900
|
+
GuardianInstruction2[GuardianInstruction2["SetAppDeveloper"] = 13] = "SetAppDeveloper";
|
|
2901
|
+
GuardianInstruction2[GuardianInstruction2["UpdateConfig"] = 14] = "UpdateConfig";
|
|
2902
|
+
GuardianInstruction2[GuardianInstruction2["Vote"] = 15] = "Vote";
|
|
2903
|
+
GuardianInstruction2[GuardianInstruction2["WriteReleaseManifest"] = 16] = "WriteReleaseManifest";
|
|
2904
|
+
return GuardianInstruction2;
|
|
2905
|
+
})(GuardianInstruction || {});
|
|
2906
|
+
function identifyGuardianInstruction(instruction) {
|
|
2907
|
+
const data = "data" in instruction ? instruction.data : instruction;
|
|
2908
|
+
if (kit.containsBytes(
|
|
2909
|
+
data,
|
|
2910
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([227, 109, 248, 178, 27, 2, 126, 21])),
|
|
2911
|
+
0
|
|
2912
|
+
)) {
|
|
2913
|
+
return 0 /* AcceptAppAuthority */;
|
|
2914
|
+
}
|
|
2915
|
+
if (kit.containsBytes(
|
|
2916
|
+
data,
|
|
2917
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([138, 34, 130, 16, 252, 207, 24, 90])),
|
|
2918
|
+
0
|
|
2919
|
+
)) {
|
|
2920
|
+
return 1 /* AcceptConfigAuthority */;
|
|
2921
|
+
}
|
|
2922
|
+
if (kit.containsBytes(
|
|
2923
|
+
data,
|
|
2924
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([167, 189, 170, 27, 74, 240, 201, 241])),
|
|
2925
|
+
0
|
|
2926
|
+
)) {
|
|
2927
|
+
return 2 /* AddGuardian */;
|
|
2928
|
+
}
|
|
2929
|
+
if (kit.containsBytes(
|
|
2930
|
+
data,
|
|
2931
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([109, 170, 172, 190, 125, 251, 1, 66])),
|
|
2932
|
+
0
|
|
2933
|
+
)) {
|
|
2934
|
+
return 3 /* CancelRelease */;
|
|
2935
|
+
}
|
|
2936
|
+
if (kit.containsBytes(
|
|
2937
|
+
data,
|
|
2938
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([174, 239, 151, 37, 202, 177, 207, 99])),
|
|
2939
|
+
0
|
|
2940
|
+
)) {
|
|
2941
|
+
return 4 /* ExpireRelease */;
|
|
2942
|
+
}
|
|
2943
|
+
if (kit.containsBytes(
|
|
2944
|
+
data,
|
|
2945
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([208, 127, 21, 1, 194, 190, 196, 70])),
|
|
2946
|
+
0
|
|
2947
|
+
)) {
|
|
2948
|
+
return 5 /* InitializeConfig */;
|
|
2949
|
+
}
|
|
2950
|
+
if (kit.containsBytes(
|
|
2951
|
+
data,
|
|
2952
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([147, 62, 16, 95, 39, 187, 25, 15])),
|
|
2953
|
+
0
|
|
2954
|
+
)) {
|
|
2955
|
+
return 6 /* ProposeAppAuthority */;
|
|
2956
|
+
}
|
|
2957
|
+
if (kit.containsBytes(
|
|
2958
|
+
data,
|
|
2959
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([31, 229, 9, 231, 45, 153, 123, 235])),
|
|
2960
|
+
0
|
|
2961
|
+
)) {
|
|
2962
|
+
return 7 /* ProposeConfigAuthority */;
|
|
2963
|
+
}
|
|
2964
|
+
if (kit.containsBytes(
|
|
2965
|
+
data,
|
|
2966
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([156, 43, 186, 24, 116, 44, 17, 71])),
|
|
2967
|
+
0
|
|
2968
|
+
)) {
|
|
2969
|
+
return 8 /* ProposeRelease */;
|
|
2970
|
+
}
|
|
2971
|
+
if (kit.containsBytes(
|
|
2972
|
+
data,
|
|
2973
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([5, 248, 20, 126, 12, 159, 9, 242])),
|
|
2974
|
+
0
|
|
2975
|
+
)) {
|
|
2976
|
+
return 9 /* RegisterApp */;
|
|
2977
|
+
}
|
|
2978
|
+
if (kit.containsBytes(
|
|
2979
|
+
data,
|
|
2980
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([21, 206, 243, 116, 97, 100, 230, 59])),
|
|
2981
|
+
0
|
|
2982
|
+
)) {
|
|
2983
|
+
return 10 /* RegisterGuardian */;
|
|
2984
|
+
}
|
|
2985
|
+
if (kit.containsBytes(
|
|
2986
|
+
data,
|
|
2987
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([72, 117, 160, 244, 155, 185, 71, 18])),
|
|
2988
|
+
0
|
|
2989
|
+
)) {
|
|
2990
|
+
return 11 /* RemoveGuardian */;
|
|
2991
|
+
}
|
|
2992
|
+
if (kit.containsBytes(
|
|
2993
|
+
data,
|
|
2994
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([153, 199, 84, 126, 148, 220, 80, 34])),
|
|
2995
|
+
0
|
|
2996
|
+
)) {
|
|
2997
|
+
return 12 /* RotateVoteAuthority */;
|
|
2998
|
+
}
|
|
2999
|
+
if (kit.containsBytes(
|
|
3000
|
+
data,
|
|
3001
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([53, 1, 26, 238, 175, 84, 152, 48])),
|
|
3002
|
+
0
|
|
3003
|
+
)) {
|
|
3004
|
+
return 13 /* SetAppDeveloper */;
|
|
3005
|
+
}
|
|
3006
|
+
if (kit.containsBytes(
|
|
3007
|
+
data,
|
|
3008
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([29, 158, 252, 191, 10, 83, 219, 99])),
|
|
3009
|
+
0
|
|
3010
|
+
)) {
|
|
3011
|
+
return 14 /* UpdateConfig */;
|
|
3012
|
+
}
|
|
3013
|
+
if (kit.containsBytes(
|
|
3014
|
+
data,
|
|
3015
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([227, 110, 155, 23, 136, 126, 172, 25])),
|
|
3016
|
+
0
|
|
3017
|
+
)) {
|
|
3018
|
+
return 15 /* Vote */;
|
|
3019
|
+
}
|
|
3020
|
+
if (kit.containsBytes(
|
|
3021
|
+
data,
|
|
3022
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(new Uint8Array([98, 30, 102, 216, 54, 58, 138, 114])),
|
|
3023
|
+
0
|
|
3024
|
+
)) {
|
|
3025
|
+
return 16 /* WriteReleaseManifest */;
|
|
3026
|
+
}
|
|
3027
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {
|
|
3028
|
+
instructionData: data,
|
|
3029
|
+
programName: "guardian"
|
|
3030
|
+
});
|
|
3031
|
+
}
|
|
3032
|
+
function parseGuardianInstruction(instruction) {
|
|
3033
|
+
const instructionType = identifyGuardianInstruction(instruction);
|
|
3034
|
+
switch (instructionType) {
|
|
3035
|
+
case 0 /* AcceptAppAuthority */: {
|
|
3036
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3037
|
+
return {
|
|
3038
|
+
instructionType: 0 /* AcceptAppAuthority */,
|
|
3039
|
+
...parseAcceptAppAuthorityInstruction(instruction)
|
|
3040
|
+
};
|
|
3041
|
+
}
|
|
3042
|
+
case 1 /* AcceptConfigAuthority */: {
|
|
3043
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3044
|
+
return {
|
|
3045
|
+
instructionType: 1 /* AcceptConfigAuthority */,
|
|
3046
|
+
...parseAcceptConfigAuthorityInstruction(instruction)
|
|
3047
|
+
};
|
|
3048
|
+
}
|
|
3049
|
+
case 2 /* AddGuardian */: {
|
|
3050
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3051
|
+
return { instructionType: 2 /* AddGuardian */, ...parseAddGuardianInstruction(instruction) };
|
|
3052
|
+
}
|
|
3053
|
+
case 3 /* CancelRelease */: {
|
|
3054
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3055
|
+
return {
|
|
3056
|
+
instructionType: 3 /* CancelRelease */,
|
|
3057
|
+
...parseCancelReleaseInstruction(instruction)
|
|
3058
|
+
};
|
|
3059
|
+
}
|
|
3060
|
+
case 4 /* ExpireRelease */: {
|
|
3061
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3062
|
+
return {
|
|
3063
|
+
instructionType: 4 /* ExpireRelease */,
|
|
3064
|
+
...parseExpireReleaseInstruction(instruction)
|
|
3065
|
+
};
|
|
3066
|
+
}
|
|
3067
|
+
case 5 /* InitializeConfig */: {
|
|
3068
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3069
|
+
return {
|
|
3070
|
+
instructionType: 5 /* InitializeConfig */,
|
|
3071
|
+
...parseInitializeConfigInstruction(instruction)
|
|
3072
|
+
};
|
|
3073
|
+
}
|
|
3074
|
+
case 6 /* ProposeAppAuthority */: {
|
|
3075
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3076
|
+
return {
|
|
3077
|
+
instructionType: 6 /* ProposeAppAuthority */,
|
|
3078
|
+
...parseProposeAppAuthorityInstruction(instruction)
|
|
3079
|
+
};
|
|
3080
|
+
}
|
|
3081
|
+
case 7 /* ProposeConfigAuthority */: {
|
|
3082
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3083
|
+
return {
|
|
3084
|
+
instructionType: 7 /* ProposeConfigAuthority */,
|
|
3085
|
+
...parseProposeConfigAuthorityInstruction(instruction)
|
|
3086
|
+
};
|
|
3087
|
+
}
|
|
3088
|
+
case 8 /* ProposeRelease */: {
|
|
3089
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3090
|
+
return {
|
|
3091
|
+
instructionType: 8 /* ProposeRelease */,
|
|
3092
|
+
...parseProposeReleaseInstruction(instruction)
|
|
3093
|
+
};
|
|
3094
|
+
}
|
|
3095
|
+
case 9 /* RegisterApp */: {
|
|
3096
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3097
|
+
return { instructionType: 9 /* RegisterApp */, ...parseRegisterAppInstruction(instruction) };
|
|
3098
|
+
}
|
|
3099
|
+
case 10 /* RegisterGuardian */: {
|
|
3100
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3101
|
+
return {
|
|
3102
|
+
instructionType: 10 /* RegisterGuardian */,
|
|
3103
|
+
...parseRegisterGuardianInstruction(instruction)
|
|
3104
|
+
};
|
|
3105
|
+
}
|
|
3106
|
+
case 11 /* RemoveGuardian */: {
|
|
3107
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3108
|
+
return {
|
|
3109
|
+
instructionType: 11 /* RemoveGuardian */,
|
|
3110
|
+
...parseRemoveGuardianInstruction(instruction)
|
|
3111
|
+
};
|
|
3112
|
+
}
|
|
3113
|
+
case 12 /* RotateVoteAuthority */: {
|
|
3114
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3115
|
+
return {
|
|
3116
|
+
instructionType: 12 /* RotateVoteAuthority */,
|
|
3117
|
+
...parseRotateVoteAuthorityInstruction(instruction)
|
|
3118
|
+
};
|
|
3119
|
+
}
|
|
3120
|
+
case 13 /* SetAppDeveloper */: {
|
|
3121
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3122
|
+
return {
|
|
3123
|
+
instructionType: 13 /* SetAppDeveloper */,
|
|
3124
|
+
...parseSetAppDeveloperInstruction(instruction)
|
|
3125
|
+
};
|
|
3126
|
+
}
|
|
3127
|
+
case 14 /* UpdateConfig */: {
|
|
3128
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3129
|
+
return { instructionType: 14 /* UpdateConfig */, ...parseUpdateConfigInstruction(instruction) };
|
|
3130
|
+
}
|
|
3131
|
+
case 15 /* Vote */: {
|
|
3132
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3133
|
+
return { instructionType: 15 /* Vote */, ...parseVoteInstruction(instruction) };
|
|
3134
|
+
}
|
|
3135
|
+
case 16 /* WriteReleaseManifest */: {
|
|
3136
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
3137
|
+
return {
|
|
3138
|
+
instructionType: 16 /* WriteReleaseManifest */,
|
|
3139
|
+
...parseWriteReleaseManifestInstruction(instruction)
|
|
3140
|
+
};
|
|
3141
|
+
}
|
|
3142
|
+
default:
|
|
3143
|
+
throw new kit.SolanaError(kit.SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
|
|
3144
|
+
instructionType,
|
|
3145
|
+
programName: "guardian"
|
|
3146
|
+
});
|
|
3147
|
+
}
|
|
3148
|
+
}
|
|
3149
|
+
function guardianProgram(config = {}) {
|
|
3150
|
+
return (client) => {
|
|
3151
|
+
return kit.extendClient(client, {
|
|
3152
|
+
guardian: {
|
|
3153
|
+
accounts: {
|
|
3154
|
+
appAccount: programClientCore.addSelfFetchFunctions(client, getAppAccountCodec()),
|
|
3155
|
+
guardiansConfig: programClientCore.addSelfFetchFunctions(client, getGuardiansConfigCodec()),
|
|
3156
|
+
pendingRegistry: programClientCore.addSelfFetchFunctions(client, getPendingRegistryCodec())
|
|
3157
|
+
},
|
|
3158
|
+
instructions: {
|
|
3159
|
+
acceptAppAuthority: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3160
|
+
client,
|
|
3161
|
+
getAcceptAppAuthorityInstructionAsync(input, {
|
|
3162
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3163
|
+
})
|
|
3164
|
+
),
|
|
3165
|
+
acceptConfigAuthority: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3166
|
+
client,
|
|
3167
|
+
getAcceptConfigAuthorityInstructionAsync(input, {
|
|
3168
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3169
|
+
})
|
|
3170
|
+
),
|
|
3171
|
+
addGuardian: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3172
|
+
client,
|
|
3173
|
+
getAddGuardianInstructionAsync(input, {
|
|
3174
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3175
|
+
})
|
|
3176
|
+
),
|
|
3177
|
+
cancelRelease: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3178
|
+
client,
|
|
3179
|
+
getCancelReleaseInstructionAsync(input, {
|
|
3180
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3181
|
+
})
|
|
3182
|
+
),
|
|
3183
|
+
expireRelease: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3184
|
+
client,
|
|
3185
|
+
getExpireReleaseInstructionAsync(input, {
|
|
3186
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3187
|
+
})
|
|
3188
|
+
),
|
|
3189
|
+
initializeConfig: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3190
|
+
client,
|
|
3191
|
+
getInitializeConfigInstructionAsync(input, {
|
|
3192
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3193
|
+
})
|
|
3194
|
+
),
|
|
3195
|
+
proposeAppAuthority: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3196
|
+
client,
|
|
3197
|
+
getProposeAppAuthorityInstructionAsync(input, {
|
|
3198
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3199
|
+
})
|
|
3200
|
+
),
|
|
3201
|
+
proposeConfigAuthority: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3202
|
+
client,
|
|
3203
|
+
getProposeConfigAuthorityInstructionAsync(input, {
|
|
3204
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3205
|
+
})
|
|
3206
|
+
),
|
|
3207
|
+
proposeRelease: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3208
|
+
client,
|
|
3209
|
+
getProposeReleaseInstructionAsync(input, {
|
|
3210
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3211
|
+
})
|
|
3212
|
+
),
|
|
3213
|
+
registerApp: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3214
|
+
client,
|
|
3215
|
+
getRegisterAppInstructionAsync(input, {
|
|
3216
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3217
|
+
})
|
|
3218
|
+
),
|
|
3219
|
+
registerGuardian: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3220
|
+
client,
|
|
3221
|
+
getRegisterGuardianInstructionAsync(input, {
|
|
3222
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3223
|
+
})
|
|
3224
|
+
),
|
|
3225
|
+
removeGuardian: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3226
|
+
client,
|
|
3227
|
+
getRemoveGuardianInstructionAsync(input, {
|
|
3228
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3229
|
+
})
|
|
3230
|
+
),
|
|
3231
|
+
rotateVoteAuthority: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3232
|
+
client,
|
|
3233
|
+
getRotateVoteAuthorityInstructionAsync(input, {
|
|
3234
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3235
|
+
})
|
|
3236
|
+
),
|
|
3237
|
+
setAppDeveloper: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3238
|
+
client,
|
|
3239
|
+
getSetAppDeveloperInstructionAsync(input, {
|
|
3240
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3241
|
+
})
|
|
3242
|
+
),
|
|
3243
|
+
updateConfig: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3244
|
+
client,
|
|
3245
|
+
getUpdateConfigInstructionAsync(input, {
|
|
3246
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3247
|
+
})
|
|
3248
|
+
),
|
|
3249
|
+
vote: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3250
|
+
client,
|
|
3251
|
+
getVoteInstructionAsync(input, {
|
|
3252
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3253
|
+
})
|
|
3254
|
+
),
|
|
3255
|
+
writeReleaseManifest: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
3256
|
+
client,
|
|
3257
|
+
getWriteReleaseManifestInstructionAsync(input, {
|
|
3258
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3259
|
+
})
|
|
3260
|
+
)
|
|
3261
|
+
},
|
|
3262
|
+
pdas: {
|
|
3263
|
+
guardiansConfig: (pdaConfig) => findGuardiansConfigPda({ programAddress: pdaConfig?.programAddress ?? config.programAddress }),
|
|
3264
|
+
pendingRegistry: (pdaConfig) => findPendingRegistryPda({ programAddress: pdaConfig?.programAddress ?? config.programAddress }),
|
|
3265
|
+
bondVault: (pdaConfig) => findBondVaultPda({ programAddress: pdaConfig?.programAddress ?? config.programAddress })
|
|
3266
|
+
},
|
|
3267
|
+
identifyAccount: identifyGuardianAccount,
|
|
3268
|
+
identifyInstruction: identifyGuardianInstruction,
|
|
3269
|
+
parseInstruction: parseGuardianInstruction
|
|
3270
|
+
}
|
|
3271
|
+
});
|
|
3272
|
+
};
|
|
3273
|
+
}
|
|
3274
|
+
|
|
3275
|
+
// src/generated/errors/guardian.ts
|
|
3276
|
+
var GUARDIAN_ERROR__INCORRECT_AUTHORITY = 6e3;
|
|
3277
|
+
var GUARDIAN_ERROR__INVALID_GUARDIAN = 6001;
|
|
3278
|
+
var GUARDIAN_ERROR__UNAUTHORIZED_VOTE_AUTHORITY = 6002;
|
|
3279
|
+
var GUARDIAN_ERROR__GUARDIAN_NOT_PENDING = 6003;
|
|
3280
|
+
var GUARDIAN_ERROR__KEY_IN_USE = 6004;
|
|
3281
|
+
var GUARDIAN_ERROR__INCORRECT_BOND_DESTINATION = 6005;
|
|
3282
|
+
var GUARDIAN_ERROR__RELEASE_ALREADY_PENDING = 6006;
|
|
3283
|
+
var GUARDIAN_ERROR__NO_PENDING_RELEASE = 6007;
|
|
3284
|
+
var GUARDIAN_ERROR__RELEASE_NOT_FINALIZED = 6008;
|
|
3285
|
+
var GUARDIAN_ERROR__CANNOT_CANCEL_RESOLVED_RELEASE = 6009;
|
|
3286
|
+
var GUARDIAN_ERROR__VERSION_CODE_MISMATCH = 6010;
|
|
3287
|
+
var GUARDIAN_ERROR__VERSION_CODE_NOT_INCREASING = 6011;
|
|
3288
|
+
var GUARDIAN_ERROR__MANIFEST_HASH_MISMATCH = 6012;
|
|
3289
|
+
var GUARDIAN_ERROR__MANIFEST_TOO_LARGE = 6013;
|
|
3290
|
+
var GUARDIAN_ERROR__VOTE_FINDINGS_TOO_LARGE = 6014;
|
|
3291
|
+
var GUARDIAN_ERROR__POLICY_BUNDLE_NOT_ATTESTED = 6015;
|
|
3292
|
+
var GUARDIAN_ERROR__POLICY_BUNDLE_MISMATCH = 6016;
|
|
3293
|
+
var GUARDIAN_ERROR__INVALID_POLICY_BUNDLE_HASH = 6017;
|
|
3294
|
+
var GUARDIAN_ERROR__VOTE_WINDOW_OPEN = 6018;
|
|
3295
|
+
var GUARDIAN_ERROR__VOTE_WINDOW_CLOSED = 6019;
|
|
3296
|
+
var GUARDIAN_ERROR__ALREADY_VOTED = 6020;
|
|
3297
|
+
var GUARDIAN_ERROR__GUARDIAN_SET_CHANGED_SINCE_QUORUM = 6021;
|
|
3298
|
+
var GUARDIAN_ERROR__TOO_MANY_GUARDIANS = 6022;
|
|
3299
|
+
var GUARDIAN_ERROR__OVERFLOW = 6023;
|
|
3300
|
+
var GUARDIAN_ERROR__INVALID_VOTING_PERIOD = 6024;
|
|
3301
|
+
var GUARDIAN_ERROR__NO_PENDING_CONFIG_AUTHORITY = 6025;
|
|
3302
|
+
var GUARDIAN_ERROR__INCORRECT_PENDING_CONFIG_AUTHORITY = 6026;
|
|
3303
|
+
var GUARDIAN_ERROR__VOTING_DEADLINE_PASSED = 6027;
|
|
3304
|
+
var GUARDIAN_ERROR__RELEASE_NOT_EXPIRED = 6028;
|
|
3305
|
+
var GUARDIAN_ERROR__VERSION_CODE_TOO_LARGE = 6029;
|
|
3306
|
+
var GUARDIAN_ERROR__FUNDER_NOT_WALLET = 6030;
|
|
3307
|
+
var GUARDIAN_ERROR__TOO_MANY_DEVELOPERS = 6031;
|
|
3308
|
+
var GUARDIAN_ERROR__CERTIFICATE_NOT_SET = 6032;
|
|
3309
|
+
var GUARDIAN_ERROR__MANIFEST_LENGTH_MISMATCH = 6033;
|
|
3310
|
+
var GUARDIAN_ERROR__MANIFEST_WRITE_OUT_OF_BOUNDS = 6034;
|
|
3311
|
+
var GUARDIAN_ERROR__NO_PENDING_APP_AUTHORITY = 6035;
|
|
3312
|
+
var GUARDIAN_ERROR__INCORRECT_PENDING_APP_AUTHORITY = 6036;
|
|
3313
|
+
var guardianErrorMessages;
|
|
3314
|
+
if (process.env["NODE_ENV"] !== "production") {
|
|
3315
|
+
guardianErrorMessages = {
|
|
3316
|
+
[GUARDIAN_ERROR__ALREADY_VOTED]: `This guardian already voted on the resolved release`,
|
|
3317
|
+
[GUARDIAN_ERROR__CANNOT_CANCEL_RESOLVED_RELEASE]: `The release has resolved and can no longer be cancelled`,
|
|
3318
|
+
[GUARDIAN_ERROR__CERTIFICATE_NOT_SET]: `The release has no signing certificate, so it cannot be finalized`,
|
|
3319
|
+
[GUARDIAN_ERROR__FUNDER_NOT_WALLET]: `The funder must be a wallet owned by the System Program`,
|
|
3320
|
+
[GUARDIAN_ERROR__GUARDIAN_NOT_PENDING]: `Guardian has not been admitted as pending`,
|
|
3321
|
+
[GUARDIAN_ERROR__GUARDIAN_SET_CHANGED_SINCE_QUORUM]: `The guardian set changed after this release resolved, so it takes no late votes`,
|
|
3322
|
+
[GUARDIAN_ERROR__INCORRECT_AUTHORITY]: `Incorrect authority`,
|
|
3323
|
+
[GUARDIAN_ERROR__INCORRECT_BOND_DESTINATION]: `Bond refund destination is not owned by the guardian`,
|
|
3324
|
+
[GUARDIAN_ERROR__INCORRECT_PENDING_APP_AUTHORITY]: `Signer is not the pending app authority`,
|
|
3325
|
+
[GUARDIAN_ERROR__INCORRECT_PENDING_CONFIG_AUTHORITY]: `Signer is not the pending config authority`,
|
|
3326
|
+
[GUARDIAN_ERROR__INVALID_GUARDIAN]: `Provided guardian is not in the guardian set`,
|
|
3327
|
+
[GUARDIAN_ERROR__INVALID_POLICY_BUNDLE_HASH]: `Policy bundle hash must be non-zero`,
|
|
3328
|
+
[GUARDIAN_ERROR__INVALID_VOTING_PERIOD]: `The voting period must be at least one second`,
|
|
3329
|
+
[GUARDIAN_ERROR__KEY_IN_USE]: `Key already belongs to a guardian, a pending guardian, or a vote authority`,
|
|
3330
|
+
[GUARDIAN_ERROR__MANIFEST_HASH_MISMATCH]: `The manifest hash does not match the pending release`,
|
|
3331
|
+
[GUARDIAN_ERROR__MANIFEST_LENGTH_MISMATCH]: `The manifest length differs from the upload in progress`,
|
|
3332
|
+
[GUARDIAN_ERROR__MANIFEST_TOO_LARGE]: `Manifest exceeds the maximum length`,
|
|
3333
|
+
[GUARDIAN_ERROR__MANIFEST_WRITE_OUT_OF_BOUNDS]: `The chunk ends past the manifest buffer`,
|
|
3334
|
+
[GUARDIAN_ERROR__NO_PENDING_APP_AUTHORITY]: `No app authority transfer is pending`,
|
|
3335
|
+
[GUARDIAN_ERROR__NO_PENDING_CONFIG_AUTHORITY]: `No config authority transfer is pending`,
|
|
3336
|
+
[GUARDIAN_ERROR__NO_PENDING_RELEASE]: `No release is pending for this app`,
|
|
3337
|
+
[GUARDIAN_ERROR__OVERFLOW]: `Arithmetic overflow`,
|
|
3338
|
+
[GUARDIAN_ERROR__POLICY_BUNDLE_MISMATCH]: `Vote names a different policy bundle than the pending release was finalized under`,
|
|
3339
|
+
[GUARDIAN_ERROR__POLICY_BUNDLE_NOT_ATTESTED]: `The config has no policy bundle hash set, so a release cannot be finalized`,
|
|
3340
|
+
[GUARDIAN_ERROR__RELEASE_ALREADY_PENDING]: `A finalized release is already pending for this app`,
|
|
3341
|
+
[GUARDIAN_ERROR__RELEASE_NOT_EXPIRED]: `The release has not expired`,
|
|
3342
|
+
[GUARDIAN_ERROR__RELEASE_NOT_FINALIZED]: `The pending release upload is not finalized yet`,
|
|
3343
|
+
[GUARDIAN_ERROR__TOO_MANY_DEVELOPERS]: `The app already lists the most developer keys allowed`,
|
|
3344
|
+
[GUARDIAN_ERROR__TOO_MANY_GUARDIANS]: `The guardian set is full`,
|
|
3345
|
+
[GUARDIAN_ERROR__UNAUTHORIZED_VOTE_AUTHORITY]: `Signer is not a registered vote authority`,
|
|
3346
|
+
[GUARDIAN_ERROR__VERSION_CODE_MISMATCH]: `Uploaded chunk or vote targets a different version code than the pending one`,
|
|
3347
|
+
[GUARDIAN_ERROR__VERSION_CODE_NOT_INCREASING]: `Version code must exceed the app's last resolved version code`,
|
|
3348
|
+
[GUARDIAN_ERROR__VERSION_CODE_TOO_LARGE]: `The version code is above Android's maximum`,
|
|
3349
|
+
[GUARDIAN_ERROR__VOTE_FINDINGS_TOO_LARGE]: `Vote findings exceed the maximum encoded length`,
|
|
3350
|
+
[GUARDIAN_ERROR__VOTE_WINDOW_CLOSED]: `The vote window of this resolved release has closed`,
|
|
3351
|
+
[GUARDIAN_ERROR__VOTE_WINDOW_OPEN]: `The last resolved release is still taking late votes; propose once its vote window closes, every guardian has voted, or the guardian set changes`,
|
|
3352
|
+
[GUARDIAN_ERROR__VOTING_DEADLINE_PASSED]: `The release's voting deadline has passed`
|
|
3353
|
+
};
|
|
3354
|
+
}
|
|
3355
|
+
function getGuardianErrorMessage(code) {
|
|
3356
|
+
if (process.env["NODE_ENV"] !== "production") {
|
|
3357
|
+
return guardianErrorMessages[code];
|
|
3358
|
+
}
|
|
3359
|
+
return "Error message not available in production bundles.";
|
|
3360
|
+
}
|
|
3361
|
+
function isGuardianError(error, transactionMessage, code, config = {}) {
|
|
3362
|
+
const programAddressInput = config.programAddress ?? GUARDIAN_PROGRAM_ADDRESS;
|
|
3363
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
3364
|
+
return kit.isProgramError(error, transactionMessage, programAddress, code);
|
|
3365
|
+
}
|
|
3366
|
+
var APP_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3367
|
+
216,
|
|
3368
|
+
100,
|
|
3369
|
+
38,
|
|
3370
|
+
168,
|
|
3371
|
+
184,
|
|
3372
|
+
157,
|
|
3373
|
+
141,
|
|
3374
|
+
247
|
|
3375
|
+
]);
|
|
3376
|
+
function getAppAuthorityAcceptedEventDiscriminatorBytes() {
|
|
3377
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(APP_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR);
|
|
3378
|
+
}
|
|
3379
|
+
function getAppAuthorityAcceptedEventEncoder() {
|
|
3380
|
+
return kit.getHiddenPrefixEncoder(
|
|
3381
|
+
kit.getStructEncoder([
|
|
3382
|
+
["version", kit.getU8Encoder()],
|
|
3383
|
+
["seq", kit.getU64Encoder()],
|
|
3384
|
+
["app", kit.getAddressEncoder()],
|
|
3385
|
+
["oldAuthority", kit.getAddressEncoder()],
|
|
3386
|
+
["newAuthority", kit.getAddressEncoder()]
|
|
3387
|
+
]),
|
|
3388
|
+
[kit.getConstantEncoder(APP_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR)]
|
|
3389
|
+
);
|
|
3390
|
+
}
|
|
3391
|
+
function getAppAuthorityAcceptedEventDecoder() {
|
|
3392
|
+
return kit.getHiddenPrefixDecoder(
|
|
3393
|
+
kit.getStructDecoder([
|
|
3394
|
+
["version", kit.getU8Decoder()],
|
|
3395
|
+
["seq", kit.getU64Decoder()],
|
|
3396
|
+
["app", kit.getAddressDecoder()],
|
|
3397
|
+
["oldAuthority", kit.getAddressDecoder()],
|
|
3398
|
+
["newAuthority", kit.getAddressDecoder()]
|
|
3399
|
+
]),
|
|
3400
|
+
[kit.getConstantDecoder(APP_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR)]
|
|
3401
|
+
);
|
|
3402
|
+
}
|
|
3403
|
+
function getAppAuthorityAcceptedEventCodec() {
|
|
3404
|
+
return kit.combineCodec(getAppAuthorityAcceptedEventEncoder(), getAppAuthorityAcceptedEventDecoder());
|
|
3405
|
+
}
|
|
3406
|
+
function parseAppAuthorityAcceptedEvent(data) {
|
|
3407
|
+
if (kit.containsBytes(data, APP_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR, 0)) {
|
|
3408
|
+
return getAppAuthorityAcceptedEventDecoder().decode(data);
|
|
3409
|
+
}
|
|
3410
|
+
throw new Error('The provided data does not match the "AppAuthorityAcceptedEvent" event discriminators.');
|
|
3411
|
+
}
|
|
3412
|
+
var APP_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3413
|
+
17,
|
|
3414
|
+
143,
|
|
3415
|
+
174,
|
|
3416
|
+
4,
|
|
3417
|
+
147,
|
|
3418
|
+
110,
|
|
3419
|
+
126,
|
|
3420
|
+
84
|
|
3421
|
+
]);
|
|
3422
|
+
function getAppAuthorityProposedEventDiscriminatorBytes() {
|
|
3423
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(APP_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR);
|
|
3424
|
+
}
|
|
3425
|
+
function getAppAuthorityProposedEventEncoder() {
|
|
3426
|
+
return kit.getHiddenPrefixEncoder(
|
|
3427
|
+
kit.getStructEncoder([
|
|
3428
|
+
["version", kit.getU8Encoder()],
|
|
3429
|
+
["seq", kit.getU64Encoder()],
|
|
3430
|
+
["app", kit.getAddressEncoder()],
|
|
3431
|
+
["authority", kit.getAddressEncoder()],
|
|
3432
|
+
["proposed", kit.getAddressEncoder()]
|
|
3433
|
+
]),
|
|
3434
|
+
[kit.getConstantEncoder(APP_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR)]
|
|
3435
|
+
);
|
|
3436
|
+
}
|
|
3437
|
+
function getAppAuthorityProposedEventDecoder() {
|
|
3438
|
+
return kit.getHiddenPrefixDecoder(
|
|
3439
|
+
kit.getStructDecoder([
|
|
3440
|
+
["version", kit.getU8Decoder()],
|
|
3441
|
+
["seq", kit.getU64Decoder()],
|
|
3442
|
+
["app", kit.getAddressDecoder()],
|
|
3443
|
+
["authority", kit.getAddressDecoder()],
|
|
3444
|
+
["proposed", kit.getAddressDecoder()]
|
|
3445
|
+
]),
|
|
3446
|
+
[kit.getConstantDecoder(APP_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR)]
|
|
3447
|
+
);
|
|
3448
|
+
}
|
|
3449
|
+
function getAppAuthorityProposedEventCodec() {
|
|
3450
|
+
return kit.combineCodec(getAppAuthorityProposedEventEncoder(), getAppAuthorityProposedEventDecoder());
|
|
3451
|
+
}
|
|
3452
|
+
function parseAppAuthorityProposedEvent(data) {
|
|
3453
|
+
if (kit.containsBytes(data, APP_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR, 0)) {
|
|
3454
|
+
return getAppAuthorityProposedEventDecoder().decode(data);
|
|
3455
|
+
}
|
|
3456
|
+
throw new Error('The provided data does not match the "AppAuthorityProposedEvent" event discriminators.');
|
|
3457
|
+
}
|
|
3458
|
+
var APP_DEVELOPER_UPDATED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3459
|
+
132,
|
|
3460
|
+
135,
|
|
3461
|
+
205,
|
|
3462
|
+
60,
|
|
3463
|
+
48,
|
|
3464
|
+
208,
|
|
3465
|
+
44,
|
|
3466
|
+
171
|
|
3467
|
+
]);
|
|
3468
|
+
function getAppDeveloperUpdatedEventDiscriminatorBytes() {
|
|
3469
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(APP_DEVELOPER_UPDATED_EVENT_DISCRIMINATOR);
|
|
3470
|
+
}
|
|
3471
|
+
function getAppDeveloperUpdatedEventEncoder() {
|
|
3472
|
+
return kit.getHiddenPrefixEncoder(
|
|
3473
|
+
kit.getStructEncoder([
|
|
3474
|
+
["version", kit.getU8Encoder()],
|
|
3475
|
+
["seq", kit.getU64Encoder()],
|
|
3476
|
+
["app", kit.getAddressEncoder()],
|
|
3477
|
+
["developer", kit.getAddressEncoder()],
|
|
3478
|
+
["allowed", kit.getBooleanEncoder()]
|
|
3479
|
+
]),
|
|
3480
|
+
[kit.getConstantEncoder(APP_DEVELOPER_UPDATED_EVENT_DISCRIMINATOR)]
|
|
3481
|
+
);
|
|
3482
|
+
}
|
|
3483
|
+
function getAppDeveloperUpdatedEventDecoder() {
|
|
3484
|
+
return kit.getHiddenPrefixDecoder(
|
|
3485
|
+
kit.getStructDecoder([
|
|
3486
|
+
["version", kit.getU8Decoder()],
|
|
3487
|
+
["seq", kit.getU64Decoder()],
|
|
3488
|
+
["app", kit.getAddressDecoder()],
|
|
3489
|
+
["developer", kit.getAddressDecoder()],
|
|
3490
|
+
["allowed", kit.getBooleanDecoder()]
|
|
3491
|
+
]),
|
|
3492
|
+
[kit.getConstantDecoder(APP_DEVELOPER_UPDATED_EVENT_DISCRIMINATOR)]
|
|
3493
|
+
);
|
|
3494
|
+
}
|
|
3495
|
+
function getAppDeveloperUpdatedEventCodec() {
|
|
3496
|
+
return kit.combineCodec(getAppDeveloperUpdatedEventEncoder(), getAppDeveloperUpdatedEventDecoder());
|
|
3497
|
+
}
|
|
3498
|
+
function parseAppDeveloperUpdatedEvent(data) {
|
|
3499
|
+
if (kit.containsBytes(data, APP_DEVELOPER_UPDATED_EVENT_DISCRIMINATOR, 0)) {
|
|
3500
|
+
return getAppDeveloperUpdatedEventDecoder().decode(data);
|
|
3501
|
+
}
|
|
3502
|
+
throw new Error('The provided data does not match the "AppDeveloperUpdatedEvent" event discriminators.');
|
|
3503
|
+
}
|
|
3504
|
+
var APP_REGISTERED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3505
|
+
99,
|
|
3506
|
+
12,
|
|
3507
|
+
19,
|
|
3508
|
+
34,
|
|
3509
|
+
85,
|
|
3510
|
+
60,
|
|
3511
|
+
170,
|
|
3512
|
+
229
|
|
3513
|
+
]);
|
|
3514
|
+
function getAppRegisteredEventDiscriminatorBytes() {
|
|
3515
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(APP_REGISTERED_EVENT_DISCRIMINATOR);
|
|
3516
|
+
}
|
|
3517
|
+
function getAppRegisteredEventEncoder() {
|
|
3518
|
+
return kit.getHiddenPrefixEncoder(
|
|
3519
|
+
kit.getStructEncoder([
|
|
3520
|
+
["version", kit.getU8Encoder()],
|
|
3521
|
+
["seq", kit.getU64Encoder()],
|
|
3522
|
+
["app", kit.getAddressEncoder()],
|
|
3523
|
+
["authority", kit.getAddressEncoder()],
|
|
3524
|
+
["name", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())]
|
|
3525
|
+
]),
|
|
3526
|
+
[kit.getConstantEncoder(APP_REGISTERED_EVENT_DISCRIMINATOR)]
|
|
3527
|
+
);
|
|
3528
|
+
}
|
|
3529
|
+
function getAppRegisteredEventDecoder() {
|
|
3530
|
+
return kit.getHiddenPrefixDecoder(
|
|
3531
|
+
kit.getStructDecoder([
|
|
3532
|
+
["version", kit.getU8Decoder()],
|
|
3533
|
+
["seq", kit.getU64Decoder()],
|
|
3534
|
+
["app", kit.getAddressDecoder()],
|
|
3535
|
+
["authority", kit.getAddressDecoder()],
|
|
3536
|
+
["name", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())]
|
|
3537
|
+
]),
|
|
3538
|
+
[kit.getConstantDecoder(APP_REGISTERED_EVENT_DISCRIMINATOR)]
|
|
3539
|
+
);
|
|
3540
|
+
}
|
|
3541
|
+
function getAppRegisteredEventCodec() {
|
|
3542
|
+
return kit.combineCodec(getAppRegisteredEventEncoder(), getAppRegisteredEventDecoder());
|
|
3543
|
+
}
|
|
3544
|
+
function parseAppRegisteredEvent(data) {
|
|
3545
|
+
if (kit.containsBytes(data, APP_REGISTERED_EVENT_DISCRIMINATOR, 0)) {
|
|
3546
|
+
return getAppRegisteredEventDecoder().decode(data);
|
|
3547
|
+
}
|
|
3548
|
+
throw new Error('The provided data does not match the "AppRegisteredEvent" event discriminators.');
|
|
3549
|
+
}
|
|
3550
|
+
var CONFIG_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3551
|
+
166,
|
|
3552
|
+
249,
|
|
3553
|
+
198,
|
|
3554
|
+
239,
|
|
3555
|
+
64,
|
|
3556
|
+
193,
|
|
3557
|
+
191,
|
|
3558
|
+
242
|
|
3559
|
+
]);
|
|
3560
|
+
function getConfigAuthorityAcceptedEventDiscriminatorBytes() {
|
|
3561
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(CONFIG_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR);
|
|
3562
|
+
}
|
|
3563
|
+
function getConfigAuthorityAcceptedEventEncoder() {
|
|
3564
|
+
return kit.getHiddenPrefixEncoder(
|
|
3565
|
+
kit.getStructEncoder([
|
|
3566
|
+
["version", kit.getU8Encoder()],
|
|
3567
|
+
["seq", kit.getU64Encoder()],
|
|
3568
|
+
["oldAuthority", kit.getAddressEncoder()],
|
|
3569
|
+
["newAuthority", kit.getAddressEncoder()]
|
|
3570
|
+
]),
|
|
3571
|
+
[kit.getConstantEncoder(CONFIG_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR)]
|
|
3572
|
+
);
|
|
3573
|
+
}
|
|
3574
|
+
function getConfigAuthorityAcceptedEventDecoder() {
|
|
3575
|
+
return kit.getHiddenPrefixDecoder(
|
|
3576
|
+
kit.getStructDecoder([
|
|
3577
|
+
["version", kit.getU8Decoder()],
|
|
3578
|
+
["seq", kit.getU64Decoder()],
|
|
3579
|
+
["oldAuthority", kit.getAddressDecoder()],
|
|
3580
|
+
["newAuthority", kit.getAddressDecoder()]
|
|
3581
|
+
]),
|
|
3582
|
+
[kit.getConstantDecoder(CONFIG_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR)]
|
|
3583
|
+
);
|
|
3584
|
+
}
|
|
3585
|
+
function getConfigAuthorityAcceptedEventCodec() {
|
|
3586
|
+
return kit.combineCodec(getConfigAuthorityAcceptedEventEncoder(), getConfigAuthorityAcceptedEventDecoder());
|
|
3587
|
+
}
|
|
3588
|
+
function parseConfigAuthorityAcceptedEvent(data) {
|
|
3589
|
+
if (kit.containsBytes(data, CONFIG_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR, 0)) {
|
|
3590
|
+
return getConfigAuthorityAcceptedEventDecoder().decode(data);
|
|
3591
|
+
}
|
|
3592
|
+
throw new Error('The provided data does not match the "ConfigAuthorityAcceptedEvent" event discriminators.');
|
|
3593
|
+
}
|
|
3594
|
+
var CONFIG_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3595
|
+
125,
|
|
3596
|
+
29,
|
|
3597
|
+
33,
|
|
3598
|
+
186,
|
|
3599
|
+
153,
|
|
3600
|
+
16,
|
|
3601
|
+
155,
|
|
3602
|
+
229
|
|
3603
|
+
]);
|
|
3604
|
+
function getConfigAuthorityProposedEventDiscriminatorBytes() {
|
|
3605
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(CONFIG_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR);
|
|
3606
|
+
}
|
|
3607
|
+
function getConfigAuthorityProposedEventEncoder() {
|
|
3608
|
+
return kit.getHiddenPrefixEncoder(
|
|
3609
|
+
kit.getStructEncoder([
|
|
3610
|
+
["version", kit.getU8Encoder()],
|
|
3611
|
+
["seq", kit.getU64Encoder()],
|
|
3612
|
+
["authority", kit.getAddressEncoder()],
|
|
3613
|
+
["proposed", kit.getAddressEncoder()]
|
|
3614
|
+
]),
|
|
3615
|
+
[kit.getConstantEncoder(CONFIG_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR)]
|
|
3616
|
+
);
|
|
3617
|
+
}
|
|
3618
|
+
function getConfigAuthorityProposedEventDecoder() {
|
|
3619
|
+
return kit.getHiddenPrefixDecoder(
|
|
3620
|
+
kit.getStructDecoder([
|
|
3621
|
+
["version", kit.getU8Decoder()],
|
|
3622
|
+
["seq", kit.getU64Decoder()],
|
|
3623
|
+
["authority", kit.getAddressDecoder()],
|
|
3624
|
+
["proposed", kit.getAddressDecoder()]
|
|
3625
|
+
]),
|
|
3626
|
+
[kit.getConstantDecoder(CONFIG_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR)]
|
|
3627
|
+
);
|
|
3628
|
+
}
|
|
3629
|
+
function getConfigAuthorityProposedEventCodec() {
|
|
3630
|
+
return kit.combineCodec(getConfigAuthorityProposedEventEncoder(), getConfigAuthorityProposedEventDecoder());
|
|
3631
|
+
}
|
|
3632
|
+
function parseConfigAuthorityProposedEvent(data) {
|
|
3633
|
+
if (kit.containsBytes(data, CONFIG_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR, 0)) {
|
|
3634
|
+
return getConfigAuthorityProposedEventDecoder().decode(data);
|
|
3635
|
+
}
|
|
3636
|
+
throw new Error('The provided data does not match the "ConfigAuthorityProposedEvent" event discriminators.');
|
|
3637
|
+
}
|
|
3638
|
+
var CONFIG_INITIALIZED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3639
|
+
181,
|
|
3640
|
+
49,
|
|
3641
|
+
200,
|
|
3642
|
+
156,
|
|
3643
|
+
19,
|
|
3644
|
+
167,
|
|
3645
|
+
178,
|
|
3646
|
+
91
|
|
3647
|
+
]);
|
|
3648
|
+
function getConfigInitializedEventDiscriminatorBytes() {
|
|
3649
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(CONFIG_INITIALIZED_EVENT_DISCRIMINATOR);
|
|
3650
|
+
}
|
|
3651
|
+
function getConfigInitializedEventEncoder() {
|
|
3652
|
+
return kit.getHiddenPrefixEncoder(
|
|
3653
|
+
kit.getStructEncoder([
|
|
3654
|
+
["version", kit.getU8Encoder()],
|
|
3655
|
+
["seq", kit.getU64Encoder()],
|
|
3656
|
+
["authority", kit.getAddressEncoder()],
|
|
3657
|
+
["bondMint", kit.getAddressEncoder()],
|
|
3658
|
+
["voteWindow", kit.getU32Encoder()],
|
|
3659
|
+
["votingPeriod", kit.getU32Encoder()]
|
|
3660
|
+
]),
|
|
3661
|
+
[kit.getConstantEncoder(CONFIG_INITIALIZED_EVENT_DISCRIMINATOR)]
|
|
3662
|
+
);
|
|
3663
|
+
}
|
|
3664
|
+
function getConfigInitializedEventDecoder() {
|
|
3665
|
+
return kit.getHiddenPrefixDecoder(
|
|
3666
|
+
kit.getStructDecoder([
|
|
3667
|
+
["version", kit.getU8Decoder()],
|
|
3668
|
+
["seq", kit.getU64Decoder()],
|
|
3669
|
+
["authority", kit.getAddressDecoder()],
|
|
3670
|
+
["bondMint", kit.getAddressDecoder()],
|
|
3671
|
+
["voteWindow", kit.getU32Decoder()],
|
|
3672
|
+
["votingPeriod", kit.getU32Decoder()]
|
|
3673
|
+
]),
|
|
3674
|
+
[kit.getConstantDecoder(CONFIG_INITIALIZED_EVENT_DISCRIMINATOR)]
|
|
3675
|
+
);
|
|
3676
|
+
}
|
|
3677
|
+
function getConfigInitializedEventCodec() {
|
|
3678
|
+
return kit.combineCodec(getConfigInitializedEventEncoder(), getConfigInitializedEventDecoder());
|
|
3679
|
+
}
|
|
3680
|
+
function parseConfigInitializedEvent(data) {
|
|
3681
|
+
if (kit.containsBytes(data, CONFIG_INITIALIZED_EVENT_DISCRIMINATOR, 0)) {
|
|
3682
|
+
return getConfigInitializedEventDecoder().decode(data);
|
|
3683
|
+
}
|
|
3684
|
+
throw new Error('The provided data does not match the "ConfigInitializedEvent" event discriminators.');
|
|
3685
|
+
}
|
|
3686
|
+
var CONFIG_UPDATED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3687
|
+
40,
|
|
3688
|
+
241,
|
|
3689
|
+
230,
|
|
3690
|
+
122,
|
|
3691
|
+
11,
|
|
3692
|
+
19,
|
|
3693
|
+
198,
|
|
3694
|
+
194
|
|
3695
|
+
]);
|
|
3696
|
+
function getConfigUpdatedEventDiscriminatorBytes() {
|
|
3697
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(CONFIG_UPDATED_EVENT_DISCRIMINATOR);
|
|
3698
|
+
}
|
|
3699
|
+
function getConfigUpdatedEventEncoder() {
|
|
3700
|
+
return kit.getHiddenPrefixEncoder(
|
|
3701
|
+
kit.getStructEncoder([
|
|
3702
|
+
["version", kit.getU8Encoder()],
|
|
3703
|
+
["seq", kit.getU64Encoder()],
|
|
3704
|
+
["bondAmount", kit.getU64Encoder()],
|
|
3705
|
+
["policyBundleHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
3706
|
+
["voteWindow", kit.getU32Encoder()],
|
|
3707
|
+
["votingPeriod", kit.getU32Encoder()]
|
|
3708
|
+
]),
|
|
3709
|
+
[kit.getConstantEncoder(CONFIG_UPDATED_EVENT_DISCRIMINATOR)]
|
|
3710
|
+
);
|
|
3711
|
+
}
|
|
3712
|
+
function getConfigUpdatedEventDecoder() {
|
|
3713
|
+
return kit.getHiddenPrefixDecoder(
|
|
3714
|
+
kit.getStructDecoder([
|
|
3715
|
+
["version", kit.getU8Decoder()],
|
|
3716
|
+
["seq", kit.getU64Decoder()],
|
|
3717
|
+
["bondAmount", kit.getU64Decoder()],
|
|
3718
|
+
["policyBundleHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
3719
|
+
["voteWindow", kit.getU32Decoder()],
|
|
3720
|
+
["votingPeriod", kit.getU32Decoder()]
|
|
3721
|
+
]),
|
|
3722
|
+
[kit.getConstantDecoder(CONFIG_UPDATED_EVENT_DISCRIMINATOR)]
|
|
3723
|
+
);
|
|
3724
|
+
}
|
|
3725
|
+
function getConfigUpdatedEventCodec() {
|
|
3726
|
+
return kit.combineCodec(getConfigUpdatedEventEncoder(), getConfigUpdatedEventDecoder());
|
|
3727
|
+
}
|
|
3728
|
+
function parseConfigUpdatedEvent(data) {
|
|
3729
|
+
if (kit.containsBytes(data, CONFIG_UPDATED_EVENT_DISCRIMINATOR, 0)) {
|
|
3730
|
+
return getConfigUpdatedEventDecoder().decode(data);
|
|
3731
|
+
}
|
|
3732
|
+
throw new Error('The provided data does not match the "ConfigUpdatedEvent" event discriminators.');
|
|
3733
|
+
}
|
|
3734
|
+
var GUARDIAN_ADDED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3735
|
+
151,
|
|
3736
|
+
0,
|
|
3737
|
+
228,
|
|
3738
|
+
5,
|
|
3739
|
+
239,
|
|
3740
|
+
58,
|
|
3741
|
+
162,
|
|
3742
|
+
18
|
|
3743
|
+
]);
|
|
3744
|
+
function getGuardianAddedEventDiscriminatorBytes() {
|
|
3745
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(GUARDIAN_ADDED_EVENT_DISCRIMINATOR);
|
|
3746
|
+
}
|
|
3747
|
+
function getGuardianAddedEventEncoder() {
|
|
3748
|
+
return kit.getHiddenPrefixEncoder(
|
|
3749
|
+
kit.getStructEncoder([
|
|
3750
|
+
["version", kit.getU8Encoder()],
|
|
3751
|
+
["seq", kit.getU64Encoder()],
|
|
3752
|
+
["guardian", kit.getAddressEncoder()]
|
|
3753
|
+
]),
|
|
3754
|
+
[kit.getConstantEncoder(GUARDIAN_ADDED_EVENT_DISCRIMINATOR)]
|
|
3755
|
+
);
|
|
3756
|
+
}
|
|
3757
|
+
function getGuardianAddedEventDecoder() {
|
|
3758
|
+
return kit.getHiddenPrefixDecoder(
|
|
3759
|
+
kit.getStructDecoder([
|
|
3760
|
+
["version", kit.getU8Decoder()],
|
|
3761
|
+
["seq", kit.getU64Decoder()],
|
|
3762
|
+
["guardian", kit.getAddressDecoder()]
|
|
3763
|
+
]),
|
|
3764
|
+
[kit.getConstantDecoder(GUARDIAN_ADDED_EVENT_DISCRIMINATOR)]
|
|
3765
|
+
);
|
|
3766
|
+
}
|
|
3767
|
+
function getGuardianAddedEventCodec() {
|
|
3768
|
+
return kit.combineCodec(getGuardianAddedEventEncoder(), getGuardianAddedEventDecoder());
|
|
3769
|
+
}
|
|
3770
|
+
function parseGuardianAddedEvent(data) {
|
|
3771
|
+
if (kit.containsBytes(data, GUARDIAN_ADDED_EVENT_DISCRIMINATOR, 0)) {
|
|
3772
|
+
return getGuardianAddedEventDecoder().decode(data);
|
|
3773
|
+
}
|
|
3774
|
+
throw new Error('The provided data does not match the "GuardianAddedEvent" event discriminators.');
|
|
3775
|
+
}
|
|
3776
|
+
var GUARDIAN_REGISTERED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3777
|
+
255,
|
|
3778
|
+
23,
|
|
3779
|
+
109,
|
|
3780
|
+
119,
|
|
3781
|
+
11,
|
|
3782
|
+
122,
|
|
3783
|
+
209,
|
|
3784
|
+
103
|
|
3785
|
+
]);
|
|
3786
|
+
function getGuardianRegisteredEventDiscriminatorBytes() {
|
|
3787
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(GUARDIAN_REGISTERED_EVENT_DISCRIMINATOR);
|
|
3788
|
+
}
|
|
3789
|
+
function getGuardianRegisteredEventEncoder() {
|
|
3790
|
+
return kit.getHiddenPrefixEncoder(
|
|
3791
|
+
kit.getStructEncoder([
|
|
3792
|
+
["version", kit.getU8Encoder()],
|
|
3793
|
+
["seq", kit.getU64Encoder()],
|
|
3794
|
+
["guardian", kit.getAddressEncoder()],
|
|
3795
|
+
["voteAuthority", kit.getAddressEncoder()],
|
|
3796
|
+
["bond", kit.getU64Encoder()],
|
|
3797
|
+
["updateNonce", kit.getU32Encoder()]
|
|
3798
|
+
]),
|
|
3799
|
+
[kit.getConstantEncoder(GUARDIAN_REGISTERED_EVENT_DISCRIMINATOR)]
|
|
3800
|
+
);
|
|
3801
|
+
}
|
|
3802
|
+
function getGuardianRegisteredEventDecoder() {
|
|
3803
|
+
return kit.getHiddenPrefixDecoder(
|
|
3804
|
+
kit.getStructDecoder([
|
|
3805
|
+
["version", kit.getU8Decoder()],
|
|
3806
|
+
["seq", kit.getU64Decoder()],
|
|
3807
|
+
["guardian", kit.getAddressDecoder()],
|
|
3808
|
+
["voteAuthority", kit.getAddressDecoder()],
|
|
3809
|
+
["bond", kit.getU64Decoder()],
|
|
3810
|
+
["updateNonce", kit.getU32Decoder()]
|
|
3811
|
+
]),
|
|
3812
|
+
[kit.getConstantDecoder(GUARDIAN_REGISTERED_EVENT_DISCRIMINATOR)]
|
|
3813
|
+
);
|
|
3814
|
+
}
|
|
3815
|
+
function getGuardianRegisteredEventCodec() {
|
|
3816
|
+
return kit.combineCodec(getGuardianRegisteredEventEncoder(), getGuardianRegisteredEventDecoder());
|
|
3817
|
+
}
|
|
3818
|
+
function parseGuardianRegisteredEvent(data) {
|
|
3819
|
+
if (kit.containsBytes(data, GUARDIAN_REGISTERED_EVENT_DISCRIMINATOR, 0)) {
|
|
3820
|
+
return getGuardianRegisteredEventDecoder().decode(data);
|
|
3821
|
+
}
|
|
3822
|
+
throw new Error('The provided data does not match the "GuardianRegisteredEvent" event discriminators.');
|
|
3823
|
+
}
|
|
3824
|
+
var GUARDIAN_REMOVED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3825
|
+
225,
|
|
3826
|
+
27,
|
|
3827
|
+
117,
|
|
3828
|
+
56,
|
|
3829
|
+
241,
|
|
3830
|
+
196,
|
|
3831
|
+
5,
|
|
3832
|
+
56
|
|
3833
|
+
]);
|
|
3834
|
+
function getGuardianRemovedEventDiscriminatorBytes() {
|
|
3835
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(GUARDIAN_REMOVED_EVENT_DISCRIMINATOR);
|
|
3836
|
+
}
|
|
3837
|
+
function getGuardianRemovedEventEncoder() {
|
|
3838
|
+
return kit.getHiddenPrefixEncoder(
|
|
3839
|
+
kit.getStructEncoder([
|
|
3840
|
+
["version", kit.getU8Encoder()],
|
|
3841
|
+
["seq", kit.getU64Encoder()],
|
|
3842
|
+
["guardian", kit.getAddressEncoder()],
|
|
3843
|
+
["refunded", kit.getU64Encoder()],
|
|
3844
|
+
["updateNonce", kit.getU32Encoder()]
|
|
3845
|
+
]),
|
|
3846
|
+
[kit.getConstantEncoder(GUARDIAN_REMOVED_EVENT_DISCRIMINATOR)]
|
|
3847
|
+
);
|
|
3848
|
+
}
|
|
3849
|
+
function getGuardianRemovedEventDecoder() {
|
|
3850
|
+
return kit.getHiddenPrefixDecoder(
|
|
3851
|
+
kit.getStructDecoder([
|
|
3852
|
+
["version", kit.getU8Decoder()],
|
|
3853
|
+
["seq", kit.getU64Decoder()],
|
|
3854
|
+
["guardian", kit.getAddressDecoder()],
|
|
3855
|
+
["refunded", kit.getU64Decoder()],
|
|
3856
|
+
["updateNonce", kit.getU32Decoder()]
|
|
3857
|
+
]),
|
|
3858
|
+
[kit.getConstantDecoder(GUARDIAN_REMOVED_EVENT_DISCRIMINATOR)]
|
|
3859
|
+
);
|
|
3860
|
+
}
|
|
3861
|
+
function getGuardianRemovedEventCodec() {
|
|
3862
|
+
return kit.combineCodec(getGuardianRemovedEventEncoder(), getGuardianRemovedEventDecoder());
|
|
3863
|
+
}
|
|
3864
|
+
function parseGuardianRemovedEvent(data) {
|
|
3865
|
+
if (kit.containsBytes(data, GUARDIAN_REMOVED_EVENT_DISCRIMINATOR, 0)) {
|
|
3866
|
+
return getGuardianRemovedEventDecoder().decode(data);
|
|
3867
|
+
}
|
|
3868
|
+
throw new Error('The provided data does not match the "GuardianRemovedEvent" event discriminators.');
|
|
3869
|
+
}
|
|
3870
|
+
var GUARDIAN_VOTE_AUTHORITY_ROTATED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3871
|
+
182,
|
|
3872
|
+
81,
|
|
3873
|
+
245,
|
|
3874
|
+
184,
|
|
3875
|
+
174,
|
|
3876
|
+
85,
|
|
3877
|
+
224,
|
|
3878
|
+
213
|
|
3879
|
+
]);
|
|
3880
|
+
function getGuardianVoteAuthorityRotatedEventDiscriminatorBytes() {
|
|
3881
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(GUARDIAN_VOTE_AUTHORITY_ROTATED_EVENT_DISCRIMINATOR);
|
|
3882
|
+
}
|
|
3883
|
+
function getGuardianVoteAuthorityRotatedEventEncoder() {
|
|
3884
|
+
return kit.getHiddenPrefixEncoder(
|
|
3885
|
+
kit.getStructEncoder([
|
|
3886
|
+
["version", kit.getU8Encoder()],
|
|
3887
|
+
["seq", kit.getU64Encoder()],
|
|
3888
|
+
["guardian", kit.getAddressEncoder()],
|
|
3889
|
+
["oldVoteAuthority", kit.getAddressEncoder()],
|
|
3890
|
+
["newVoteAuthority", kit.getAddressEncoder()]
|
|
3891
|
+
]),
|
|
3892
|
+
[kit.getConstantEncoder(GUARDIAN_VOTE_AUTHORITY_ROTATED_EVENT_DISCRIMINATOR)]
|
|
3893
|
+
);
|
|
3894
|
+
}
|
|
3895
|
+
function getGuardianVoteAuthorityRotatedEventDecoder() {
|
|
3896
|
+
return kit.getHiddenPrefixDecoder(
|
|
3897
|
+
kit.getStructDecoder([
|
|
3898
|
+
["version", kit.getU8Decoder()],
|
|
3899
|
+
["seq", kit.getU64Decoder()],
|
|
3900
|
+
["guardian", kit.getAddressDecoder()],
|
|
3901
|
+
["oldVoteAuthority", kit.getAddressDecoder()],
|
|
3902
|
+
["newVoteAuthority", kit.getAddressDecoder()]
|
|
3903
|
+
]),
|
|
3904
|
+
[kit.getConstantDecoder(GUARDIAN_VOTE_AUTHORITY_ROTATED_EVENT_DISCRIMINATOR)]
|
|
3905
|
+
);
|
|
3906
|
+
}
|
|
3907
|
+
function getGuardianVoteAuthorityRotatedEventCodec() {
|
|
3908
|
+
return kit.combineCodec(getGuardianVoteAuthorityRotatedEventEncoder(), getGuardianVoteAuthorityRotatedEventDecoder());
|
|
3909
|
+
}
|
|
3910
|
+
function parseGuardianVoteAuthorityRotatedEvent(data) {
|
|
3911
|
+
if (kit.containsBytes(data, GUARDIAN_VOTE_AUTHORITY_ROTATED_EVENT_DISCRIMINATOR, 0)) {
|
|
3912
|
+
return getGuardianVoteAuthorityRotatedEventDecoder().decode(data);
|
|
3913
|
+
}
|
|
3914
|
+
throw new Error('The provided data does not match the "GuardianVoteAuthorityRotatedEvent" event discriminators.');
|
|
3915
|
+
}
|
|
3916
|
+
var RELEASE_APPROVED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3917
|
+
246,
|
|
3918
|
+
7,
|
|
3919
|
+
17,
|
|
3920
|
+
99,
|
|
3921
|
+
160,
|
|
3922
|
+
10,
|
|
3923
|
+
151,
|
|
3924
|
+
253
|
|
3925
|
+
]);
|
|
3926
|
+
function getReleaseApprovedEventDiscriminatorBytes() {
|
|
3927
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(RELEASE_APPROVED_EVENT_DISCRIMINATOR);
|
|
3928
|
+
}
|
|
3929
|
+
function getReleaseApprovedEventEncoder() {
|
|
3930
|
+
return kit.getHiddenPrefixEncoder(kit.getStructEncoder([["resolution", getReleaseResolutionEncoder()]]), [
|
|
3931
|
+
kit.getConstantEncoder(RELEASE_APPROVED_EVENT_DISCRIMINATOR)
|
|
3932
|
+
]);
|
|
3933
|
+
}
|
|
3934
|
+
function getReleaseApprovedEventDecoder() {
|
|
3935
|
+
return kit.getHiddenPrefixDecoder(kit.getStructDecoder([["resolution", getReleaseResolutionDecoder()]]), [
|
|
3936
|
+
kit.getConstantDecoder(RELEASE_APPROVED_EVENT_DISCRIMINATOR)
|
|
3937
|
+
]);
|
|
3938
|
+
}
|
|
3939
|
+
function getReleaseApprovedEventCodec() {
|
|
3940
|
+
return kit.combineCodec(getReleaseApprovedEventEncoder(), getReleaseApprovedEventDecoder());
|
|
3941
|
+
}
|
|
3942
|
+
function parseReleaseApprovedEvent(data) {
|
|
3943
|
+
if (kit.containsBytes(data, RELEASE_APPROVED_EVENT_DISCRIMINATOR, 0)) {
|
|
3944
|
+
return getReleaseApprovedEventDecoder().decode(data);
|
|
3945
|
+
}
|
|
3946
|
+
throw new Error('The provided data does not match the "ReleaseApprovedEvent" event discriminators.');
|
|
3947
|
+
}
|
|
3948
|
+
var RELEASE_CANCELLED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3949
|
+
107,
|
|
3950
|
+
100,
|
|
3951
|
+
38,
|
|
3952
|
+
206,
|
|
3953
|
+
48,
|
|
3954
|
+
27,
|
|
3955
|
+
92,
|
|
3956
|
+
178
|
|
3957
|
+
]);
|
|
3958
|
+
function getReleaseCancelledEventDiscriminatorBytes() {
|
|
3959
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(RELEASE_CANCELLED_EVENT_DISCRIMINATOR);
|
|
3960
|
+
}
|
|
3961
|
+
function getReleaseCancelledEventEncoder() {
|
|
3962
|
+
return kit.getHiddenPrefixEncoder(
|
|
3963
|
+
kit.getStructEncoder([
|
|
3964
|
+
["version", kit.getU8Encoder()],
|
|
3965
|
+
["seq", kit.getU64Encoder()],
|
|
3966
|
+
["app", kit.getAddressEncoder()],
|
|
3967
|
+
["versionCode", kit.getU32Encoder()]
|
|
3968
|
+
]),
|
|
3969
|
+
[kit.getConstantEncoder(RELEASE_CANCELLED_EVENT_DISCRIMINATOR)]
|
|
3970
|
+
);
|
|
3971
|
+
}
|
|
3972
|
+
function getReleaseCancelledEventDecoder() {
|
|
3973
|
+
return kit.getHiddenPrefixDecoder(
|
|
3974
|
+
kit.getStructDecoder([
|
|
3975
|
+
["version", kit.getU8Decoder()],
|
|
3976
|
+
["seq", kit.getU64Decoder()],
|
|
3977
|
+
["app", kit.getAddressDecoder()],
|
|
3978
|
+
["versionCode", kit.getU32Decoder()]
|
|
3979
|
+
]),
|
|
3980
|
+
[kit.getConstantDecoder(RELEASE_CANCELLED_EVENT_DISCRIMINATOR)]
|
|
3981
|
+
);
|
|
3982
|
+
}
|
|
3983
|
+
function getReleaseCancelledEventCodec() {
|
|
3984
|
+
return kit.combineCodec(getReleaseCancelledEventEncoder(), getReleaseCancelledEventDecoder());
|
|
3985
|
+
}
|
|
3986
|
+
function parseReleaseCancelledEvent(data) {
|
|
3987
|
+
if (kit.containsBytes(data, RELEASE_CANCELLED_EVENT_DISCRIMINATOR, 0)) {
|
|
3988
|
+
return getReleaseCancelledEventDecoder().decode(data);
|
|
3989
|
+
}
|
|
3990
|
+
throw new Error('The provided data does not match the "ReleaseCancelledEvent" event discriminators.');
|
|
3991
|
+
}
|
|
3992
|
+
var RELEASE_EXPIRED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3993
|
+
185,
|
|
3994
|
+
185,
|
|
3995
|
+
92,
|
|
3996
|
+
34,
|
|
3997
|
+
95,
|
|
3998
|
+
198,
|
|
3999
|
+
124,
|
|
4000
|
+
51
|
|
4001
|
+
]);
|
|
4002
|
+
function getReleaseExpiredEventDiscriminatorBytes() {
|
|
4003
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(RELEASE_EXPIRED_EVENT_DISCRIMINATOR);
|
|
4004
|
+
}
|
|
4005
|
+
function getReleaseExpiredEventEncoder() {
|
|
4006
|
+
return kit.getHiddenPrefixEncoder(
|
|
4007
|
+
kit.getStructEncoder([
|
|
4008
|
+
["version", kit.getU8Encoder()],
|
|
4009
|
+
["seq", kit.getU64Encoder()],
|
|
4010
|
+
["app", kit.getAddressEncoder()],
|
|
4011
|
+
["versionCode", kit.getU32Encoder()]
|
|
4012
|
+
]),
|
|
4013
|
+
[kit.getConstantEncoder(RELEASE_EXPIRED_EVENT_DISCRIMINATOR)]
|
|
4014
|
+
);
|
|
4015
|
+
}
|
|
4016
|
+
function getReleaseExpiredEventDecoder() {
|
|
4017
|
+
return kit.getHiddenPrefixDecoder(
|
|
4018
|
+
kit.getStructDecoder([
|
|
4019
|
+
["version", kit.getU8Decoder()],
|
|
4020
|
+
["seq", kit.getU64Decoder()],
|
|
4021
|
+
["app", kit.getAddressDecoder()],
|
|
4022
|
+
["versionCode", kit.getU32Decoder()]
|
|
4023
|
+
]),
|
|
4024
|
+
[kit.getConstantDecoder(RELEASE_EXPIRED_EVENT_DISCRIMINATOR)]
|
|
4025
|
+
);
|
|
4026
|
+
}
|
|
4027
|
+
function getReleaseExpiredEventCodec() {
|
|
4028
|
+
return kit.combineCodec(getReleaseExpiredEventEncoder(), getReleaseExpiredEventDecoder());
|
|
4029
|
+
}
|
|
4030
|
+
function parseReleaseExpiredEvent(data) {
|
|
4031
|
+
if (kit.containsBytes(data, RELEASE_EXPIRED_EVENT_DISCRIMINATOR, 0)) {
|
|
4032
|
+
return getReleaseExpiredEventDecoder().decode(data);
|
|
4033
|
+
}
|
|
4034
|
+
throw new Error('The provided data does not match the "ReleaseExpiredEvent" event discriminators.');
|
|
4035
|
+
}
|
|
4036
|
+
var RELEASE_PROPOSED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
4037
|
+
245,
|
|
4038
|
+
225,
|
|
4039
|
+
27,
|
|
4040
|
+
20,
|
|
4041
|
+
64,
|
|
4042
|
+
160,
|
|
4043
|
+
146,
|
|
4044
|
+
183
|
|
4045
|
+
]);
|
|
4046
|
+
function getReleaseProposedEventDiscriminatorBytes() {
|
|
4047
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(RELEASE_PROPOSED_EVENT_DISCRIMINATOR);
|
|
4048
|
+
}
|
|
4049
|
+
function getReleaseProposedEventEncoder() {
|
|
4050
|
+
return kit.getHiddenPrefixEncoder(
|
|
4051
|
+
kit.getStructEncoder([
|
|
4052
|
+
["version", kit.getU8Encoder()],
|
|
4053
|
+
["seq", kit.getU64Encoder()],
|
|
4054
|
+
["app", kit.getAddressEncoder()],
|
|
4055
|
+
["versionCode", kit.getU32Encoder()],
|
|
4056
|
+
["policyBundleHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)]
|
|
4057
|
+
]),
|
|
4058
|
+
[kit.getConstantEncoder(RELEASE_PROPOSED_EVENT_DISCRIMINATOR)]
|
|
4059
|
+
);
|
|
4060
|
+
}
|
|
4061
|
+
function getReleaseProposedEventDecoder() {
|
|
4062
|
+
return kit.getHiddenPrefixDecoder(
|
|
4063
|
+
kit.getStructDecoder([
|
|
4064
|
+
["version", kit.getU8Decoder()],
|
|
4065
|
+
["seq", kit.getU64Decoder()],
|
|
4066
|
+
["app", kit.getAddressDecoder()],
|
|
4067
|
+
["versionCode", kit.getU32Decoder()],
|
|
4068
|
+
["policyBundleHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)]
|
|
4069
|
+
]),
|
|
4070
|
+
[kit.getConstantDecoder(RELEASE_PROPOSED_EVENT_DISCRIMINATOR)]
|
|
4071
|
+
);
|
|
4072
|
+
}
|
|
4073
|
+
function getReleaseProposedEventCodec() {
|
|
4074
|
+
return kit.combineCodec(getReleaseProposedEventEncoder(), getReleaseProposedEventDecoder());
|
|
4075
|
+
}
|
|
4076
|
+
function parseReleaseProposedEvent(data) {
|
|
4077
|
+
if (kit.containsBytes(data, RELEASE_PROPOSED_EVENT_DISCRIMINATOR, 0)) {
|
|
4078
|
+
return getReleaseProposedEventDecoder().decode(data);
|
|
4079
|
+
}
|
|
4080
|
+
throw new Error('The provided data does not match the "ReleaseProposedEvent" event discriminators.');
|
|
4081
|
+
}
|
|
4082
|
+
var RELEASE_REJECTED_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
4083
|
+
144,
|
|
4084
|
+
93,
|
|
4085
|
+
149,
|
|
4086
|
+
105,
|
|
4087
|
+
200,
|
|
4088
|
+
85,
|
|
4089
|
+
92,
|
|
4090
|
+
126
|
|
4091
|
+
]);
|
|
4092
|
+
function getReleaseRejectedEventDiscriminatorBytes() {
|
|
4093
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(RELEASE_REJECTED_EVENT_DISCRIMINATOR);
|
|
4094
|
+
}
|
|
4095
|
+
function getReleaseRejectedEventEncoder() {
|
|
4096
|
+
return kit.getHiddenPrefixEncoder(kit.getStructEncoder([["resolution", getReleaseResolutionEncoder()]]), [
|
|
4097
|
+
kit.getConstantEncoder(RELEASE_REJECTED_EVENT_DISCRIMINATOR)
|
|
4098
|
+
]);
|
|
4099
|
+
}
|
|
4100
|
+
function getReleaseRejectedEventDecoder() {
|
|
4101
|
+
return kit.getHiddenPrefixDecoder(kit.getStructDecoder([["resolution", getReleaseResolutionDecoder()]]), [
|
|
4102
|
+
kit.getConstantDecoder(RELEASE_REJECTED_EVENT_DISCRIMINATOR)
|
|
4103
|
+
]);
|
|
4104
|
+
}
|
|
4105
|
+
function getReleaseRejectedEventCodec() {
|
|
4106
|
+
return kit.combineCodec(getReleaseRejectedEventEncoder(), getReleaseRejectedEventDecoder());
|
|
4107
|
+
}
|
|
4108
|
+
function parseReleaseRejectedEvent(data) {
|
|
4109
|
+
if (kit.containsBytes(data, RELEASE_REJECTED_EVENT_DISCRIMINATOR, 0)) {
|
|
4110
|
+
return getReleaseRejectedEventDecoder().decode(data);
|
|
4111
|
+
}
|
|
4112
|
+
throw new Error('The provided data does not match the "ReleaseRejectedEvent" event discriminators.');
|
|
4113
|
+
}
|
|
4114
|
+
var VOTE_CAST_EVENT_DISCRIMINATOR = new Uint8Array([39, 53, 195, 104, 188, 17, 225, 213]);
|
|
4115
|
+
function getVoteCastEventDiscriminatorBytes() {
|
|
4116
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(VOTE_CAST_EVENT_DISCRIMINATOR);
|
|
4117
|
+
}
|
|
4118
|
+
function getVoteCastEventEncoder() {
|
|
4119
|
+
return kit.getHiddenPrefixEncoder(
|
|
4120
|
+
kit.getStructEncoder([
|
|
4121
|
+
["version", kit.getU8Encoder()],
|
|
4122
|
+
["seq", kit.getU64Encoder()],
|
|
4123
|
+
["app", kit.getAddressEncoder()],
|
|
4124
|
+
["versionCode", kit.getU32Encoder()],
|
|
4125
|
+
["guardian", kit.getAddressEncoder()],
|
|
4126
|
+
["approve", kit.getBooleanEncoder()],
|
|
4127
|
+
["policyBundleHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
4128
|
+
["findings", kit.getArrayEncoder(getVoteFindingEncoder())]
|
|
4129
|
+
]),
|
|
4130
|
+
[kit.getConstantEncoder(VOTE_CAST_EVENT_DISCRIMINATOR)]
|
|
4131
|
+
);
|
|
4132
|
+
}
|
|
4133
|
+
function getVoteCastEventDecoder() {
|
|
4134
|
+
return kit.getHiddenPrefixDecoder(
|
|
4135
|
+
kit.getStructDecoder([
|
|
4136
|
+
["version", kit.getU8Decoder()],
|
|
4137
|
+
["seq", kit.getU64Decoder()],
|
|
4138
|
+
["app", kit.getAddressDecoder()],
|
|
4139
|
+
["versionCode", kit.getU32Decoder()],
|
|
4140
|
+
["guardian", kit.getAddressDecoder()],
|
|
4141
|
+
["approve", kit.getBooleanDecoder()],
|
|
4142
|
+
["policyBundleHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
4143
|
+
["findings", kit.getArrayDecoder(getVoteFindingDecoder())]
|
|
4144
|
+
]),
|
|
4145
|
+
[kit.getConstantDecoder(VOTE_CAST_EVENT_DISCRIMINATOR)]
|
|
4146
|
+
);
|
|
4147
|
+
}
|
|
4148
|
+
function getVoteCastEventCodec() {
|
|
4149
|
+
return kit.combineCodec(getVoteCastEventEncoder(), getVoteCastEventDecoder());
|
|
4150
|
+
}
|
|
4151
|
+
function parseVoteCastEvent(data) {
|
|
4152
|
+
if (kit.containsBytes(data, VOTE_CAST_EVENT_DISCRIMINATOR, 0)) {
|
|
4153
|
+
return getVoteCastEventDecoder().decode(data);
|
|
4154
|
+
}
|
|
4155
|
+
throw new Error('The provided data does not match the "VoteCastEvent" event discriminators.');
|
|
4156
|
+
}
|
|
4157
|
+
var DEFAULT_MANIFEST_CHUNK = 800;
|
|
4158
|
+
function getManifestChunks(manifest, chunkSize = DEFAULT_MANIFEST_CHUNK) {
|
|
4159
|
+
if (!Number.isInteger(chunkSize) || chunkSize <= 0) {
|
|
4160
|
+
throw new Error(`chunk size must be a positive integer, got ${chunkSize}`);
|
|
4161
|
+
}
|
|
4162
|
+
if (manifest.length === 0) return [{ offset: 0, bytes: manifest }];
|
|
4163
|
+
const chunks = [];
|
|
4164
|
+
for (let offset = 0; offset < manifest.length; offset += chunkSize) {
|
|
4165
|
+
chunks.push({ offset, bytes: manifest.subarray(offset, offset + chunkSize) });
|
|
4166
|
+
}
|
|
4167
|
+
return chunks;
|
|
4168
|
+
}
|
|
4169
|
+
async function getManifestHash(manifest) {
|
|
4170
|
+
return new Uint8Array(await crypto.subtle.digest("SHA-256", new Uint8Array(manifest)));
|
|
4171
|
+
}
|
|
4172
|
+
var SCHEMA_V1 = new Uint8Array([1]);
|
|
4173
|
+
function getManifestEncoder() {
|
|
4174
|
+
return getManifestCodec();
|
|
4175
|
+
}
|
|
4176
|
+
function getManifestDecoder() {
|
|
4177
|
+
return getManifestCodec();
|
|
4178
|
+
}
|
|
4179
|
+
function getManifestCodec() {
|
|
4180
|
+
const v1 = kit.getHiddenPrefixCodec(
|
|
4181
|
+
kit.getStructCodec([
|
|
4182
|
+
["versionCode", kit.getU32Codec()],
|
|
4183
|
+
["package", getStringCodec()],
|
|
4184
|
+
["versionName", getStringCodec()],
|
|
4185
|
+
["minSdk", kit.getU32Codec()],
|
|
4186
|
+
["permissions", kit.getArrayCodec(getStringCodec())],
|
|
4187
|
+
[
|
|
4188
|
+
"apk",
|
|
4189
|
+
kit.getStructCodec([
|
|
4190
|
+
["uri", getStringCodec()],
|
|
4191
|
+
["sha256", getDigestCodec()]
|
|
4192
|
+
])
|
|
4193
|
+
],
|
|
4194
|
+
["terms", getStringCodec()],
|
|
4195
|
+
["privacy", getStringCodec()],
|
|
4196
|
+
["certificateSha256", getDigestCodec()],
|
|
4197
|
+
[
|
|
4198
|
+
"publisherSite",
|
|
4199
|
+
kit.combineCodec(kit.getNullableEncoder(getStringCodec()), getStrictNullableDecoder(getStringCodec()))
|
|
4200
|
+
]
|
|
4201
|
+
]),
|
|
4202
|
+
[kit.getConstantCodec(SCHEMA_V1)]
|
|
4203
|
+
);
|
|
4204
|
+
const manifest = kit.transformCodec(
|
|
4205
|
+
v1,
|
|
4206
|
+
({ __kind: _kind, ...fields }) => fields,
|
|
4207
|
+
(fields) => ({ __kind: "V1", ...fields })
|
|
4208
|
+
);
|
|
4209
|
+
return kit.combineCodec(manifest, rejectTrailingBytes(manifest));
|
|
4210
|
+
}
|
|
4211
|
+
function getStringCodec() {
|
|
4212
|
+
return kit.combineCodec(
|
|
4213
|
+
kit.addEncoderSizePrefix(kit.getUtf8Encoder({ fatal: true }), kit.getU32Encoder()),
|
|
4214
|
+
kit.addDecoderSizePrefix(
|
|
4215
|
+
kit.getUtf8Decoder({ fatal: true, ignoreBOM: true, removeNullCharacters: false }),
|
|
4216
|
+
kit.getU32Decoder()
|
|
4217
|
+
)
|
|
4218
|
+
);
|
|
4219
|
+
}
|
|
4220
|
+
function getDigestCodec() {
|
|
4221
|
+
return kit.fixCodecSize(kit.getBytesCodec(), 32);
|
|
4222
|
+
}
|
|
4223
|
+
function getStrictNullableDecoder(item) {
|
|
4224
|
+
return kit.createDecoder({
|
|
4225
|
+
read(bytes, offset) {
|
|
4226
|
+
const [tag, next] = kit.getU8Decoder().read(bytes, offset);
|
|
4227
|
+
if (tag === 0) return [null, next];
|
|
4228
|
+
if (tag === 1) return item.read(bytes, next);
|
|
4229
|
+
throw new Error(`invalid option tag ${tag} at byte ${offset}`);
|
|
4230
|
+
}
|
|
4231
|
+
});
|
|
4232
|
+
}
|
|
4233
|
+
function rejectTrailingBytes(decoder) {
|
|
4234
|
+
return kit.createDecoder({
|
|
4235
|
+
read(bytes, offset) {
|
|
4236
|
+
const [value, end] = decoder.read(bytes, offset);
|
|
4237
|
+
if (end !== bytes.length) throw new Error(`${bytes.length - end} trailing bytes after the manifest`);
|
|
4238
|
+
return [value, end];
|
|
4239
|
+
}
|
|
4240
|
+
});
|
|
4241
|
+
}
|
|
4242
|
+
|
|
4243
|
+
// src/proposal.ts
|
|
4244
|
+
function getPendingRelease(app) {
|
|
4245
|
+
return app.pendingRelease.__kind === "Pending" ? app.pendingRelease.fields[0] : null;
|
|
4246
|
+
}
|
|
4247
|
+
function getLateVoteWindow(pending, config, now) {
|
|
4248
|
+
if (!pending?.resolved) {
|
|
4249
|
+
return null;
|
|
4250
|
+
}
|
|
4251
|
+
const closesAt = pending.quorumTs + BigInt(config.voteWindow);
|
|
4252
|
+
const open = now < closesAt && pending.guardianNonce === config.updateNonce && pending.votes.size < config.guardians.size;
|
|
4253
|
+
return open ? { closesAt, votesCast: pending.votes.size, guardians: config.guardians.size } : null;
|
|
4254
|
+
}
|
|
4255
|
+
function getReleaseProposalStep(app, versionCode, manifestLength, clock) {
|
|
4256
|
+
if (!app) {
|
|
4257
|
+
return { kind: "write", written: null };
|
|
4258
|
+
}
|
|
4259
|
+
if (versionCode <= app.lastResolvedVersion) {
|
|
4260
|
+
return { kind: "spent" };
|
|
4261
|
+
}
|
|
4262
|
+
const pending = getPendingRelease(app);
|
|
4263
|
+
if (!pending) {
|
|
4264
|
+
return { kind: "write", written: null };
|
|
4265
|
+
}
|
|
4266
|
+
if (pending.resolved) {
|
|
4267
|
+
if (!clock) {
|
|
4268
|
+
throw new Error("The guardian config and cluster time are needed when a resolved release holds the slot");
|
|
4269
|
+
}
|
|
4270
|
+
const window = getLateVoteWindow(pending, clock.config, clock.now);
|
|
4271
|
+
return window ? { kind: "waitForLateVotes", window } : { kind: "write", written: null };
|
|
4272
|
+
}
|
|
4273
|
+
if (versionCode < pending.versionCode || versionCode === pending.versionCode && pending.finalized) {
|
|
4274
|
+
return { kind: "underReview", pendingVersionCode: pending.versionCode };
|
|
4275
|
+
}
|
|
4276
|
+
if (versionCode > pending.versionCode || pending.data.length !== manifestLength) {
|
|
4277
|
+
return { kind: "cancelFirst" };
|
|
4278
|
+
}
|
|
4279
|
+
return { kind: "write", written: pending.data };
|
|
4280
|
+
}
|
|
4281
|
+
|
|
4282
|
+
exports.ACCEPT_APP_AUTHORITY_DISCRIMINATOR = ACCEPT_APP_AUTHORITY_DISCRIMINATOR;
|
|
4283
|
+
exports.ACCEPT_CONFIG_AUTHORITY_DISCRIMINATOR = ACCEPT_CONFIG_AUTHORITY_DISCRIMINATOR;
|
|
4284
|
+
exports.ADD_GUARDIAN_DISCRIMINATOR = ADD_GUARDIAN_DISCRIMINATOR;
|
|
4285
|
+
exports.APP_ACCOUNT_DISCRIMINATOR = APP_ACCOUNT_DISCRIMINATOR;
|
|
4286
|
+
exports.APP_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR = APP_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR;
|
|
4287
|
+
exports.APP_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR = APP_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR;
|
|
4288
|
+
exports.APP_DEVELOPER_UPDATED_EVENT_DISCRIMINATOR = APP_DEVELOPER_UPDATED_EVENT_DISCRIMINATOR;
|
|
4289
|
+
exports.APP_REGISTERED_EVENT_DISCRIMINATOR = APP_REGISTERED_EVENT_DISCRIMINATOR;
|
|
4290
|
+
exports.CANCEL_RELEASE_DISCRIMINATOR = CANCEL_RELEASE_DISCRIMINATOR;
|
|
4291
|
+
exports.CONFIG_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR = CONFIG_AUTHORITY_ACCEPTED_EVENT_DISCRIMINATOR;
|
|
4292
|
+
exports.CONFIG_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR = CONFIG_AUTHORITY_PROPOSED_EVENT_DISCRIMINATOR;
|
|
4293
|
+
exports.CONFIG_INITIALIZED_EVENT_DISCRIMINATOR = CONFIG_INITIALIZED_EVENT_DISCRIMINATOR;
|
|
4294
|
+
exports.CONFIG_UPDATED_EVENT_DISCRIMINATOR = CONFIG_UPDATED_EVENT_DISCRIMINATOR;
|
|
4295
|
+
exports.DEFAULT_MANIFEST_CHUNK = DEFAULT_MANIFEST_CHUNK;
|
|
4296
|
+
exports.EXPIRE_RELEASE_DISCRIMINATOR = EXPIRE_RELEASE_DISCRIMINATOR;
|
|
4297
|
+
exports.GUARDIANS_CONFIG_DISCRIMINATOR = GUARDIANS_CONFIG_DISCRIMINATOR;
|
|
4298
|
+
exports.GUARDIAN_ADDED_EVENT_DISCRIMINATOR = GUARDIAN_ADDED_EVENT_DISCRIMINATOR;
|
|
4299
|
+
exports.GUARDIAN_ERROR__ALREADY_VOTED = GUARDIAN_ERROR__ALREADY_VOTED;
|
|
4300
|
+
exports.GUARDIAN_ERROR__CANNOT_CANCEL_RESOLVED_RELEASE = GUARDIAN_ERROR__CANNOT_CANCEL_RESOLVED_RELEASE;
|
|
4301
|
+
exports.GUARDIAN_ERROR__CERTIFICATE_NOT_SET = GUARDIAN_ERROR__CERTIFICATE_NOT_SET;
|
|
4302
|
+
exports.GUARDIAN_ERROR__FUNDER_NOT_WALLET = GUARDIAN_ERROR__FUNDER_NOT_WALLET;
|
|
4303
|
+
exports.GUARDIAN_ERROR__GUARDIAN_NOT_PENDING = GUARDIAN_ERROR__GUARDIAN_NOT_PENDING;
|
|
4304
|
+
exports.GUARDIAN_ERROR__GUARDIAN_SET_CHANGED_SINCE_QUORUM = GUARDIAN_ERROR__GUARDIAN_SET_CHANGED_SINCE_QUORUM;
|
|
4305
|
+
exports.GUARDIAN_ERROR__INCORRECT_AUTHORITY = GUARDIAN_ERROR__INCORRECT_AUTHORITY;
|
|
4306
|
+
exports.GUARDIAN_ERROR__INCORRECT_BOND_DESTINATION = GUARDIAN_ERROR__INCORRECT_BOND_DESTINATION;
|
|
4307
|
+
exports.GUARDIAN_ERROR__INCORRECT_PENDING_APP_AUTHORITY = GUARDIAN_ERROR__INCORRECT_PENDING_APP_AUTHORITY;
|
|
4308
|
+
exports.GUARDIAN_ERROR__INCORRECT_PENDING_CONFIG_AUTHORITY = GUARDIAN_ERROR__INCORRECT_PENDING_CONFIG_AUTHORITY;
|
|
4309
|
+
exports.GUARDIAN_ERROR__INVALID_GUARDIAN = GUARDIAN_ERROR__INVALID_GUARDIAN;
|
|
4310
|
+
exports.GUARDIAN_ERROR__INVALID_POLICY_BUNDLE_HASH = GUARDIAN_ERROR__INVALID_POLICY_BUNDLE_HASH;
|
|
4311
|
+
exports.GUARDIAN_ERROR__INVALID_VOTING_PERIOD = GUARDIAN_ERROR__INVALID_VOTING_PERIOD;
|
|
4312
|
+
exports.GUARDIAN_ERROR__KEY_IN_USE = GUARDIAN_ERROR__KEY_IN_USE;
|
|
4313
|
+
exports.GUARDIAN_ERROR__MANIFEST_HASH_MISMATCH = GUARDIAN_ERROR__MANIFEST_HASH_MISMATCH;
|
|
4314
|
+
exports.GUARDIAN_ERROR__MANIFEST_LENGTH_MISMATCH = GUARDIAN_ERROR__MANIFEST_LENGTH_MISMATCH;
|
|
4315
|
+
exports.GUARDIAN_ERROR__MANIFEST_TOO_LARGE = GUARDIAN_ERROR__MANIFEST_TOO_LARGE;
|
|
4316
|
+
exports.GUARDIAN_ERROR__MANIFEST_WRITE_OUT_OF_BOUNDS = GUARDIAN_ERROR__MANIFEST_WRITE_OUT_OF_BOUNDS;
|
|
4317
|
+
exports.GUARDIAN_ERROR__NO_PENDING_APP_AUTHORITY = GUARDIAN_ERROR__NO_PENDING_APP_AUTHORITY;
|
|
4318
|
+
exports.GUARDIAN_ERROR__NO_PENDING_CONFIG_AUTHORITY = GUARDIAN_ERROR__NO_PENDING_CONFIG_AUTHORITY;
|
|
4319
|
+
exports.GUARDIAN_ERROR__NO_PENDING_RELEASE = GUARDIAN_ERROR__NO_PENDING_RELEASE;
|
|
4320
|
+
exports.GUARDIAN_ERROR__OVERFLOW = GUARDIAN_ERROR__OVERFLOW;
|
|
4321
|
+
exports.GUARDIAN_ERROR__POLICY_BUNDLE_MISMATCH = GUARDIAN_ERROR__POLICY_BUNDLE_MISMATCH;
|
|
4322
|
+
exports.GUARDIAN_ERROR__POLICY_BUNDLE_NOT_ATTESTED = GUARDIAN_ERROR__POLICY_BUNDLE_NOT_ATTESTED;
|
|
4323
|
+
exports.GUARDIAN_ERROR__RELEASE_ALREADY_PENDING = GUARDIAN_ERROR__RELEASE_ALREADY_PENDING;
|
|
4324
|
+
exports.GUARDIAN_ERROR__RELEASE_NOT_EXPIRED = GUARDIAN_ERROR__RELEASE_NOT_EXPIRED;
|
|
4325
|
+
exports.GUARDIAN_ERROR__RELEASE_NOT_FINALIZED = GUARDIAN_ERROR__RELEASE_NOT_FINALIZED;
|
|
4326
|
+
exports.GUARDIAN_ERROR__TOO_MANY_DEVELOPERS = GUARDIAN_ERROR__TOO_MANY_DEVELOPERS;
|
|
4327
|
+
exports.GUARDIAN_ERROR__TOO_MANY_GUARDIANS = GUARDIAN_ERROR__TOO_MANY_GUARDIANS;
|
|
4328
|
+
exports.GUARDIAN_ERROR__UNAUTHORIZED_VOTE_AUTHORITY = GUARDIAN_ERROR__UNAUTHORIZED_VOTE_AUTHORITY;
|
|
4329
|
+
exports.GUARDIAN_ERROR__VERSION_CODE_MISMATCH = GUARDIAN_ERROR__VERSION_CODE_MISMATCH;
|
|
4330
|
+
exports.GUARDIAN_ERROR__VERSION_CODE_NOT_INCREASING = GUARDIAN_ERROR__VERSION_CODE_NOT_INCREASING;
|
|
4331
|
+
exports.GUARDIAN_ERROR__VERSION_CODE_TOO_LARGE = GUARDIAN_ERROR__VERSION_CODE_TOO_LARGE;
|
|
4332
|
+
exports.GUARDIAN_ERROR__VOTE_FINDINGS_TOO_LARGE = GUARDIAN_ERROR__VOTE_FINDINGS_TOO_LARGE;
|
|
4333
|
+
exports.GUARDIAN_ERROR__VOTE_WINDOW_CLOSED = GUARDIAN_ERROR__VOTE_WINDOW_CLOSED;
|
|
4334
|
+
exports.GUARDIAN_ERROR__VOTE_WINDOW_OPEN = GUARDIAN_ERROR__VOTE_WINDOW_OPEN;
|
|
4335
|
+
exports.GUARDIAN_ERROR__VOTING_DEADLINE_PASSED = GUARDIAN_ERROR__VOTING_DEADLINE_PASSED;
|
|
4336
|
+
exports.GUARDIAN_PROGRAM_ADDRESS = GUARDIAN_PROGRAM_ADDRESS;
|
|
4337
|
+
exports.GUARDIAN_REGISTERED_EVENT_DISCRIMINATOR = GUARDIAN_REGISTERED_EVENT_DISCRIMINATOR;
|
|
4338
|
+
exports.GUARDIAN_REMOVED_EVENT_DISCRIMINATOR = GUARDIAN_REMOVED_EVENT_DISCRIMINATOR;
|
|
4339
|
+
exports.GUARDIAN_VOTE_AUTHORITY_ROTATED_EVENT_DISCRIMINATOR = GUARDIAN_VOTE_AUTHORITY_ROTATED_EVENT_DISCRIMINATOR;
|
|
4340
|
+
exports.GuardianAccount = GuardianAccount;
|
|
4341
|
+
exports.GuardianEvent = GuardianEvent;
|
|
4342
|
+
exports.GuardianInstruction = GuardianInstruction;
|
|
4343
|
+
exports.INITIALIZE_CONFIG_DISCRIMINATOR = INITIALIZE_CONFIG_DISCRIMINATOR;
|
|
4344
|
+
exports.MAX_MANIFEST_LEN = MAX_MANIFEST_LEN;
|
|
4345
|
+
exports.PENDING_REGISTRY_DISCRIMINATOR = PENDING_REGISTRY_DISCRIMINATOR;
|
|
4346
|
+
exports.PROPOSE_APP_AUTHORITY_DISCRIMINATOR = PROPOSE_APP_AUTHORITY_DISCRIMINATOR;
|
|
4347
|
+
exports.PROPOSE_CONFIG_AUTHORITY_DISCRIMINATOR = PROPOSE_CONFIG_AUTHORITY_DISCRIMINATOR;
|
|
4348
|
+
exports.PROPOSE_RELEASE_DISCRIMINATOR = PROPOSE_RELEASE_DISCRIMINATOR;
|
|
4349
|
+
exports.REGISTER_APP_DISCRIMINATOR = REGISTER_APP_DISCRIMINATOR;
|
|
4350
|
+
exports.REGISTER_GUARDIAN_DISCRIMINATOR = REGISTER_GUARDIAN_DISCRIMINATOR;
|
|
4351
|
+
exports.RELEASE_APPROVED_EVENT_DISCRIMINATOR = RELEASE_APPROVED_EVENT_DISCRIMINATOR;
|
|
4352
|
+
exports.RELEASE_CANCELLED_EVENT_DISCRIMINATOR = RELEASE_CANCELLED_EVENT_DISCRIMINATOR;
|
|
4353
|
+
exports.RELEASE_EXPIRED_EVENT_DISCRIMINATOR = RELEASE_EXPIRED_EVENT_DISCRIMINATOR;
|
|
4354
|
+
exports.RELEASE_PROPOSED_EVENT_DISCRIMINATOR = RELEASE_PROPOSED_EVENT_DISCRIMINATOR;
|
|
4355
|
+
exports.RELEASE_REJECTED_EVENT_DISCRIMINATOR = RELEASE_REJECTED_EVENT_DISCRIMINATOR;
|
|
4356
|
+
exports.REMOVE_GUARDIAN_DISCRIMINATOR = REMOVE_GUARDIAN_DISCRIMINATOR;
|
|
4357
|
+
exports.ROTATE_VOTE_AUTHORITY_DISCRIMINATOR = ROTATE_VOTE_AUTHORITY_DISCRIMINATOR;
|
|
4358
|
+
exports.SET_APP_DEVELOPER_DISCRIMINATOR = SET_APP_DEVELOPER_DISCRIMINATOR;
|
|
4359
|
+
exports.UPDATE_CONFIG_DISCRIMINATOR = UPDATE_CONFIG_DISCRIMINATOR;
|
|
4360
|
+
exports.VOTE_CAST_EVENT_DISCRIMINATOR = VOTE_CAST_EVENT_DISCRIMINATOR;
|
|
4361
|
+
exports.VOTE_DISCRIMINATOR = VOTE_DISCRIMINATOR;
|
|
4362
|
+
exports.WRITE_RELEASE_MANIFEST_DISCRIMINATOR = WRITE_RELEASE_MANIFEST_DISCRIMINATOR;
|
|
4363
|
+
exports.decodeAppAccount = decodeAppAccount;
|
|
4364
|
+
exports.decodeGuardiansConfig = decodeGuardiansConfig;
|
|
4365
|
+
exports.decodePendingRegistry = decodePendingRegistry;
|
|
4366
|
+
exports.fetchAllAppAccount = fetchAllAppAccount;
|
|
4367
|
+
exports.fetchAllGuardiansConfig = fetchAllGuardiansConfig;
|
|
4368
|
+
exports.fetchAllMaybeAppAccount = fetchAllMaybeAppAccount;
|
|
4369
|
+
exports.fetchAllMaybeGuardiansConfig = fetchAllMaybeGuardiansConfig;
|
|
4370
|
+
exports.fetchAllMaybePendingRegistry = fetchAllMaybePendingRegistry;
|
|
4371
|
+
exports.fetchAllPendingRegistry = fetchAllPendingRegistry;
|
|
4372
|
+
exports.fetchAppAccount = fetchAppAccount;
|
|
4373
|
+
exports.fetchGuardiansConfig = fetchGuardiansConfig;
|
|
4374
|
+
exports.fetchMaybeAppAccount = fetchMaybeAppAccount;
|
|
4375
|
+
exports.fetchMaybeGuardiansConfig = fetchMaybeGuardiansConfig;
|
|
4376
|
+
exports.fetchMaybePendingRegistry = fetchMaybePendingRegistry;
|
|
4377
|
+
exports.fetchPendingRegistry = fetchPendingRegistry;
|
|
4378
|
+
exports.findBondVaultPda = findBondVaultPda;
|
|
4379
|
+
exports.findGuardiansConfigPda = findGuardiansConfigPda;
|
|
4380
|
+
exports.findPendingRegistryPda = findPendingRegistryPda;
|
|
4381
|
+
exports.getAcceptAppAuthorityDiscriminatorBytes = getAcceptAppAuthorityDiscriminatorBytes;
|
|
4382
|
+
exports.getAcceptAppAuthorityInstruction = getAcceptAppAuthorityInstruction;
|
|
4383
|
+
exports.getAcceptAppAuthorityInstructionAsync = getAcceptAppAuthorityInstructionAsync;
|
|
4384
|
+
exports.getAcceptAppAuthorityInstructionDataCodec = getAcceptAppAuthorityInstructionDataCodec;
|
|
4385
|
+
exports.getAcceptAppAuthorityInstructionDataDecoder = getAcceptAppAuthorityInstructionDataDecoder;
|
|
4386
|
+
exports.getAcceptAppAuthorityInstructionDataEncoder = getAcceptAppAuthorityInstructionDataEncoder;
|
|
4387
|
+
exports.getAcceptConfigAuthorityDiscriminatorBytes = getAcceptConfigAuthorityDiscriminatorBytes;
|
|
4388
|
+
exports.getAcceptConfigAuthorityInstruction = getAcceptConfigAuthorityInstruction;
|
|
4389
|
+
exports.getAcceptConfigAuthorityInstructionAsync = getAcceptConfigAuthorityInstructionAsync;
|
|
4390
|
+
exports.getAcceptConfigAuthorityInstructionDataCodec = getAcceptConfigAuthorityInstructionDataCodec;
|
|
4391
|
+
exports.getAcceptConfigAuthorityInstructionDataDecoder = getAcceptConfigAuthorityInstructionDataDecoder;
|
|
4392
|
+
exports.getAcceptConfigAuthorityInstructionDataEncoder = getAcceptConfigAuthorityInstructionDataEncoder;
|
|
4393
|
+
exports.getAddGuardianDiscriminatorBytes = getAddGuardianDiscriminatorBytes;
|
|
4394
|
+
exports.getAddGuardianInstruction = getAddGuardianInstruction;
|
|
4395
|
+
exports.getAddGuardianInstructionAsync = getAddGuardianInstructionAsync;
|
|
4396
|
+
exports.getAddGuardianInstructionDataCodec = getAddGuardianInstructionDataCodec;
|
|
4397
|
+
exports.getAddGuardianInstructionDataDecoder = getAddGuardianInstructionDataDecoder;
|
|
4398
|
+
exports.getAddGuardianInstructionDataEncoder = getAddGuardianInstructionDataEncoder;
|
|
4399
|
+
exports.getAppAccountCodec = getAppAccountCodec;
|
|
4400
|
+
exports.getAppAccountDecoder = getAppAccountDecoder;
|
|
4401
|
+
exports.getAppAccountDiscriminatorBytes = getAppAccountDiscriminatorBytes;
|
|
4402
|
+
exports.getAppAccountEncoder = getAppAccountEncoder;
|
|
4403
|
+
exports.getAppAuthorityAcceptedEventCodec = getAppAuthorityAcceptedEventCodec;
|
|
4404
|
+
exports.getAppAuthorityAcceptedEventDecoder = getAppAuthorityAcceptedEventDecoder;
|
|
4405
|
+
exports.getAppAuthorityAcceptedEventDiscriminatorBytes = getAppAuthorityAcceptedEventDiscriminatorBytes;
|
|
4406
|
+
exports.getAppAuthorityAcceptedEventEncoder = getAppAuthorityAcceptedEventEncoder;
|
|
4407
|
+
exports.getAppAuthorityProposedEventCodec = getAppAuthorityProposedEventCodec;
|
|
4408
|
+
exports.getAppAuthorityProposedEventDecoder = getAppAuthorityProposedEventDecoder;
|
|
4409
|
+
exports.getAppAuthorityProposedEventDiscriminatorBytes = getAppAuthorityProposedEventDiscriminatorBytes;
|
|
4410
|
+
exports.getAppAuthorityProposedEventEncoder = getAppAuthorityProposedEventEncoder;
|
|
4411
|
+
exports.getAppDeveloperUpdatedEventCodec = getAppDeveloperUpdatedEventCodec;
|
|
4412
|
+
exports.getAppDeveloperUpdatedEventDecoder = getAppDeveloperUpdatedEventDecoder;
|
|
4413
|
+
exports.getAppDeveloperUpdatedEventDiscriminatorBytes = getAppDeveloperUpdatedEventDiscriminatorBytes;
|
|
4414
|
+
exports.getAppDeveloperUpdatedEventEncoder = getAppDeveloperUpdatedEventEncoder;
|
|
4415
|
+
exports.getAppRegisteredEventCodec = getAppRegisteredEventCodec;
|
|
4416
|
+
exports.getAppRegisteredEventDecoder = getAppRegisteredEventDecoder;
|
|
4417
|
+
exports.getAppRegisteredEventDiscriminatorBytes = getAppRegisteredEventDiscriminatorBytes;
|
|
4418
|
+
exports.getAppRegisteredEventEncoder = getAppRegisteredEventEncoder;
|
|
4419
|
+
exports.getBondInfoCodec = getBondInfoCodec;
|
|
4420
|
+
exports.getBondInfoDecoder = getBondInfoDecoder;
|
|
4421
|
+
exports.getBondInfoEncoder = getBondInfoEncoder;
|
|
4422
|
+
exports.getCancelReleaseDiscriminatorBytes = getCancelReleaseDiscriminatorBytes;
|
|
4423
|
+
exports.getCancelReleaseInstruction = getCancelReleaseInstruction;
|
|
4424
|
+
exports.getCancelReleaseInstructionAsync = getCancelReleaseInstructionAsync;
|
|
4425
|
+
exports.getCancelReleaseInstructionDataCodec = getCancelReleaseInstructionDataCodec;
|
|
4426
|
+
exports.getCancelReleaseInstructionDataDecoder = getCancelReleaseInstructionDataDecoder;
|
|
4427
|
+
exports.getCancelReleaseInstructionDataEncoder = getCancelReleaseInstructionDataEncoder;
|
|
4428
|
+
exports.getConfigAuthorityAcceptedEventCodec = getConfigAuthorityAcceptedEventCodec;
|
|
4429
|
+
exports.getConfigAuthorityAcceptedEventDecoder = getConfigAuthorityAcceptedEventDecoder;
|
|
4430
|
+
exports.getConfigAuthorityAcceptedEventDiscriminatorBytes = getConfigAuthorityAcceptedEventDiscriminatorBytes;
|
|
4431
|
+
exports.getConfigAuthorityAcceptedEventEncoder = getConfigAuthorityAcceptedEventEncoder;
|
|
4432
|
+
exports.getConfigAuthorityProposedEventCodec = getConfigAuthorityProposedEventCodec;
|
|
4433
|
+
exports.getConfigAuthorityProposedEventDecoder = getConfigAuthorityProposedEventDecoder;
|
|
4434
|
+
exports.getConfigAuthorityProposedEventDiscriminatorBytes = getConfigAuthorityProposedEventDiscriminatorBytes;
|
|
4435
|
+
exports.getConfigAuthorityProposedEventEncoder = getConfigAuthorityProposedEventEncoder;
|
|
4436
|
+
exports.getConfigInitializedEventCodec = getConfigInitializedEventCodec;
|
|
4437
|
+
exports.getConfigInitializedEventDecoder = getConfigInitializedEventDecoder;
|
|
4438
|
+
exports.getConfigInitializedEventDiscriminatorBytes = getConfigInitializedEventDiscriminatorBytes;
|
|
4439
|
+
exports.getConfigInitializedEventEncoder = getConfigInitializedEventEncoder;
|
|
4440
|
+
exports.getConfigUpdatedEventCodec = getConfigUpdatedEventCodec;
|
|
4441
|
+
exports.getConfigUpdatedEventDecoder = getConfigUpdatedEventDecoder;
|
|
4442
|
+
exports.getConfigUpdatedEventDiscriminatorBytes = getConfigUpdatedEventDiscriminatorBytes;
|
|
4443
|
+
exports.getConfigUpdatedEventEncoder = getConfigUpdatedEventEncoder;
|
|
4444
|
+
exports.getExpireReleaseDiscriminatorBytes = getExpireReleaseDiscriminatorBytes;
|
|
4445
|
+
exports.getExpireReleaseInstruction = getExpireReleaseInstruction;
|
|
4446
|
+
exports.getExpireReleaseInstructionAsync = getExpireReleaseInstructionAsync;
|
|
4447
|
+
exports.getExpireReleaseInstructionDataCodec = getExpireReleaseInstructionDataCodec;
|
|
4448
|
+
exports.getExpireReleaseInstructionDataDecoder = getExpireReleaseInstructionDataDecoder;
|
|
4449
|
+
exports.getExpireReleaseInstructionDataEncoder = getExpireReleaseInstructionDataEncoder;
|
|
4450
|
+
exports.getGuardianAddedEventCodec = getGuardianAddedEventCodec;
|
|
4451
|
+
exports.getGuardianAddedEventDecoder = getGuardianAddedEventDecoder;
|
|
4452
|
+
exports.getGuardianAddedEventDiscriminatorBytes = getGuardianAddedEventDiscriminatorBytes;
|
|
4453
|
+
exports.getGuardianAddedEventEncoder = getGuardianAddedEventEncoder;
|
|
4454
|
+
exports.getGuardianErrorMessage = getGuardianErrorMessage;
|
|
4455
|
+
exports.getGuardianInfoCodec = getGuardianInfoCodec;
|
|
4456
|
+
exports.getGuardianInfoDecoder = getGuardianInfoDecoder;
|
|
4457
|
+
exports.getGuardianInfoEncoder = getGuardianInfoEncoder;
|
|
4458
|
+
exports.getGuardianRegisteredEventCodec = getGuardianRegisteredEventCodec;
|
|
4459
|
+
exports.getGuardianRegisteredEventDecoder = getGuardianRegisteredEventDecoder;
|
|
4460
|
+
exports.getGuardianRegisteredEventDiscriminatorBytes = getGuardianRegisteredEventDiscriminatorBytes;
|
|
4461
|
+
exports.getGuardianRegisteredEventEncoder = getGuardianRegisteredEventEncoder;
|
|
4462
|
+
exports.getGuardianRemovedEventCodec = getGuardianRemovedEventCodec;
|
|
4463
|
+
exports.getGuardianRemovedEventDecoder = getGuardianRemovedEventDecoder;
|
|
4464
|
+
exports.getGuardianRemovedEventDiscriminatorBytes = getGuardianRemovedEventDiscriminatorBytes;
|
|
4465
|
+
exports.getGuardianRemovedEventEncoder = getGuardianRemovedEventEncoder;
|
|
4466
|
+
exports.getGuardianVoteAuthorityRotatedEventCodec = getGuardianVoteAuthorityRotatedEventCodec;
|
|
4467
|
+
exports.getGuardianVoteAuthorityRotatedEventDecoder = getGuardianVoteAuthorityRotatedEventDecoder;
|
|
4468
|
+
exports.getGuardianVoteAuthorityRotatedEventDiscriminatorBytes = getGuardianVoteAuthorityRotatedEventDiscriminatorBytes;
|
|
4469
|
+
exports.getGuardianVoteAuthorityRotatedEventEncoder = getGuardianVoteAuthorityRotatedEventEncoder;
|
|
4470
|
+
exports.getGuardiansConfigCodec = getGuardiansConfigCodec;
|
|
4471
|
+
exports.getGuardiansConfigDecoder = getGuardiansConfigDecoder;
|
|
4472
|
+
exports.getGuardiansConfigDiscriminatorBytes = getGuardiansConfigDiscriminatorBytes;
|
|
4473
|
+
exports.getGuardiansConfigEncoder = getGuardiansConfigEncoder;
|
|
4474
|
+
exports.getInitializeConfigDiscriminatorBytes = getInitializeConfigDiscriminatorBytes;
|
|
4475
|
+
exports.getInitializeConfigInstruction = getInitializeConfigInstruction;
|
|
4476
|
+
exports.getInitializeConfigInstructionAsync = getInitializeConfigInstructionAsync;
|
|
4477
|
+
exports.getInitializeConfigInstructionDataCodec = getInitializeConfigInstructionDataCodec;
|
|
4478
|
+
exports.getInitializeConfigInstructionDataDecoder = getInitializeConfigInstructionDataDecoder;
|
|
4479
|
+
exports.getInitializeConfigInstructionDataEncoder = getInitializeConfigInstructionDataEncoder;
|
|
4480
|
+
exports.getLateVoteWindow = getLateVoteWindow;
|
|
4481
|
+
exports.getManifestChunks = getManifestChunks;
|
|
4482
|
+
exports.getManifestCodec = getManifestCodec;
|
|
4483
|
+
exports.getManifestDecoder = getManifestDecoder;
|
|
4484
|
+
exports.getManifestEncoder = getManifestEncoder;
|
|
4485
|
+
exports.getManifestHash = getManifestHash;
|
|
4486
|
+
exports.getPendingRegistryCodec = getPendingRegistryCodec;
|
|
4487
|
+
exports.getPendingRegistryDecoder = getPendingRegistryDecoder;
|
|
4488
|
+
exports.getPendingRegistryDiscriminatorBytes = getPendingRegistryDiscriminatorBytes;
|
|
4489
|
+
exports.getPendingRegistryEncoder = getPendingRegistryEncoder;
|
|
4490
|
+
exports.getPendingRelease = getPendingRelease;
|
|
4491
|
+
exports.getPendingReleaseCodec = getPendingReleaseCodec;
|
|
4492
|
+
exports.getPendingReleaseDecoder = getPendingReleaseDecoder;
|
|
4493
|
+
exports.getPendingReleaseEncoder = getPendingReleaseEncoder;
|
|
4494
|
+
exports.getProposeAppAuthorityDiscriminatorBytes = getProposeAppAuthorityDiscriminatorBytes;
|
|
4495
|
+
exports.getProposeAppAuthorityInstruction = getProposeAppAuthorityInstruction;
|
|
4496
|
+
exports.getProposeAppAuthorityInstructionAsync = getProposeAppAuthorityInstructionAsync;
|
|
4497
|
+
exports.getProposeAppAuthorityInstructionDataCodec = getProposeAppAuthorityInstructionDataCodec;
|
|
4498
|
+
exports.getProposeAppAuthorityInstructionDataDecoder = getProposeAppAuthorityInstructionDataDecoder;
|
|
4499
|
+
exports.getProposeAppAuthorityInstructionDataEncoder = getProposeAppAuthorityInstructionDataEncoder;
|
|
4500
|
+
exports.getProposeConfigAuthorityDiscriminatorBytes = getProposeConfigAuthorityDiscriminatorBytes;
|
|
4501
|
+
exports.getProposeConfigAuthorityInstruction = getProposeConfigAuthorityInstruction;
|
|
4502
|
+
exports.getProposeConfigAuthorityInstructionAsync = getProposeConfigAuthorityInstructionAsync;
|
|
4503
|
+
exports.getProposeConfigAuthorityInstructionDataCodec = getProposeConfigAuthorityInstructionDataCodec;
|
|
4504
|
+
exports.getProposeConfigAuthorityInstructionDataDecoder = getProposeConfigAuthorityInstructionDataDecoder;
|
|
4505
|
+
exports.getProposeConfigAuthorityInstructionDataEncoder = getProposeConfigAuthorityInstructionDataEncoder;
|
|
4506
|
+
exports.getProposeReleaseDiscriminatorBytes = getProposeReleaseDiscriminatorBytes;
|
|
4507
|
+
exports.getProposeReleaseInstruction = getProposeReleaseInstruction;
|
|
4508
|
+
exports.getProposeReleaseInstructionAsync = getProposeReleaseInstructionAsync;
|
|
4509
|
+
exports.getProposeReleaseInstructionDataCodec = getProposeReleaseInstructionDataCodec;
|
|
4510
|
+
exports.getProposeReleaseInstructionDataDecoder = getProposeReleaseInstructionDataDecoder;
|
|
4511
|
+
exports.getProposeReleaseInstructionDataEncoder = getProposeReleaseInstructionDataEncoder;
|
|
4512
|
+
exports.getPublishedAppCodec = getPublishedAppCodec;
|
|
4513
|
+
exports.getPublishedAppDecoder = getPublishedAppDecoder;
|
|
4514
|
+
exports.getPublishedAppEncoder = getPublishedAppEncoder;
|
|
4515
|
+
exports.getRegisterAppDiscriminatorBytes = getRegisterAppDiscriminatorBytes;
|
|
4516
|
+
exports.getRegisterAppInstruction = getRegisterAppInstruction;
|
|
4517
|
+
exports.getRegisterAppInstructionAsync = getRegisterAppInstructionAsync;
|
|
4518
|
+
exports.getRegisterAppInstructionDataCodec = getRegisterAppInstructionDataCodec;
|
|
4519
|
+
exports.getRegisterAppInstructionDataDecoder = getRegisterAppInstructionDataDecoder;
|
|
4520
|
+
exports.getRegisterAppInstructionDataEncoder = getRegisterAppInstructionDataEncoder;
|
|
4521
|
+
exports.getRegisterGuardianDiscriminatorBytes = getRegisterGuardianDiscriminatorBytes;
|
|
4522
|
+
exports.getRegisterGuardianInstruction = getRegisterGuardianInstruction;
|
|
4523
|
+
exports.getRegisterGuardianInstructionAsync = getRegisterGuardianInstructionAsync;
|
|
4524
|
+
exports.getRegisterGuardianInstructionDataCodec = getRegisterGuardianInstructionDataCodec;
|
|
4525
|
+
exports.getRegisterGuardianInstructionDataDecoder = getRegisterGuardianInstructionDataDecoder;
|
|
4526
|
+
exports.getRegisterGuardianInstructionDataEncoder = getRegisterGuardianInstructionDataEncoder;
|
|
4527
|
+
exports.getReleaseApprovedEventCodec = getReleaseApprovedEventCodec;
|
|
4528
|
+
exports.getReleaseApprovedEventDecoder = getReleaseApprovedEventDecoder;
|
|
4529
|
+
exports.getReleaseApprovedEventDiscriminatorBytes = getReleaseApprovedEventDiscriminatorBytes;
|
|
4530
|
+
exports.getReleaseApprovedEventEncoder = getReleaseApprovedEventEncoder;
|
|
4531
|
+
exports.getReleaseCancelledEventCodec = getReleaseCancelledEventCodec;
|
|
4532
|
+
exports.getReleaseCancelledEventDecoder = getReleaseCancelledEventDecoder;
|
|
4533
|
+
exports.getReleaseCancelledEventDiscriminatorBytes = getReleaseCancelledEventDiscriminatorBytes;
|
|
4534
|
+
exports.getReleaseCancelledEventEncoder = getReleaseCancelledEventEncoder;
|
|
4535
|
+
exports.getReleaseExpiredEventCodec = getReleaseExpiredEventCodec;
|
|
4536
|
+
exports.getReleaseExpiredEventDecoder = getReleaseExpiredEventDecoder;
|
|
4537
|
+
exports.getReleaseExpiredEventDiscriminatorBytes = getReleaseExpiredEventDiscriminatorBytes;
|
|
4538
|
+
exports.getReleaseExpiredEventEncoder = getReleaseExpiredEventEncoder;
|
|
4539
|
+
exports.getReleaseManifestCodec = getReleaseManifestCodec;
|
|
4540
|
+
exports.getReleaseManifestDecoder = getReleaseManifestDecoder;
|
|
4541
|
+
exports.getReleaseManifestEncoder = getReleaseManifestEncoder;
|
|
4542
|
+
exports.getReleaseProposalStep = getReleaseProposalStep;
|
|
4543
|
+
exports.getReleaseProposedEventCodec = getReleaseProposedEventCodec;
|
|
4544
|
+
exports.getReleaseProposedEventDecoder = getReleaseProposedEventDecoder;
|
|
4545
|
+
exports.getReleaseProposedEventDiscriminatorBytes = getReleaseProposedEventDiscriminatorBytes;
|
|
4546
|
+
exports.getReleaseProposedEventEncoder = getReleaseProposedEventEncoder;
|
|
4547
|
+
exports.getReleaseRejectedEventCodec = getReleaseRejectedEventCodec;
|
|
4548
|
+
exports.getReleaseRejectedEventDecoder = getReleaseRejectedEventDecoder;
|
|
4549
|
+
exports.getReleaseRejectedEventDiscriminatorBytes = getReleaseRejectedEventDiscriminatorBytes;
|
|
4550
|
+
exports.getReleaseRejectedEventEncoder = getReleaseRejectedEventEncoder;
|
|
4551
|
+
exports.getReleaseResolutionCodec = getReleaseResolutionCodec;
|
|
4552
|
+
exports.getReleaseResolutionDecoder = getReleaseResolutionDecoder;
|
|
4553
|
+
exports.getReleaseResolutionEncoder = getReleaseResolutionEncoder;
|
|
4554
|
+
exports.getRemoveGuardianDiscriminatorBytes = getRemoveGuardianDiscriminatorBytes;
|
|
4555
|
+
exports.getRemoveGuardianInstruction = getRemoveGuardianInstruction;
|
|
4556
|
+
exports.getRemoveGuardianInstructionAsync = getRemoveGuardianInstructionAsync;
|
|
4557
|
+
exports.getRemoveGuardianInstructionDataCodec = getRemoveGuardianInstructionDataCodec;
|
|
4558
|
+
exports.getRemoveGuardianInstructionDataDecoder = getRemoveGuardianInstructionDataDecoder;
|
|
4559
|
+
exports.getRemoveGuardianInstructionDataEncoder = getRemoveGuardianInstructionDataEncoder;
|
|
4560
|
+
exports.getRotateVoteAuthorityDiscriminatorBytes = getRotateVoteAuthorityDiscriminatorBytes;
|
|
4561
|
+
exports.getRotateVoteAuthorityInstruction = getRotateVoteAuthorityInstruction;
|
|
4562
|
+
exports.getRotateVoteAuthorityInstructionAsync = getRotateVoteAuthorityInstructionAsync;
|
|
4563
|
+
exports.getRotateVoteAuthorityInstructionDataCodec = getRotateVoteAuthorityInstructionDataCodec;
|
|
4564
|
+
exports.getRotateVoteAuthorityInstructionDataDecoder = getRotateVoteAuthorityInstructionDataDecoder;
|
|
4565
|
+
exports.getRotateVoteAuthorityInstructionDataEncoder = getRotateVoteAuthorityInstructionDataEncoder;
|
|
4566
|
+
exports.getSetAppDeveloperDiscriminatorBytes = getSetAppDeveloperDiscriminatorBytes;
|
|
4567
|
+
exports.getSetAppDeveloperInstruction = getSetAppDeveloperInstruction;
|
|
4568
|
+
exports.getSetAppDeveloperInstructionAsync = getSetAppDeveloperInstructionAsync;
|
|
4569
|
+
exports.getSetAppDeveloperInstructionDataCodec = getSetAppDeveloperInstructionDataCodec;
|
|
4570
|
+
exports.getSetAppDeveloperInstructionDataDecoder = getSetAppDeveloperInstructionDataDecoder;
|
|
4571
|
+
exports.getSetAppDeveloperInstructionDataEncoder = getSetAppDeveloperInstructionDataEncoder;
|
|
4572
|
+
exports.getUpdateConfigDiscriminatorBytes = getUpdateConfigDiscriminatorBytes;
|
|
4573
|
+
exports.getUpdateConfigInstruction = getUpdateConfigInstruction;
|
|
4574
|
+
exports.getUpdateConfigInstructionAsync = getUpdateConfigInstructionAsync;
|
|
4575
|
+
exports.getUpdateConfigInstructionDataCodec = getUpdateConfigInstructionDataCodec;
|
|
4576
|
+
exports.getUpdateConfigInstructionDataDecoder = getUpdateConfigInstructionDataDecoder;
|
|
4577
|
+
exports.getUpdateConfigInstructionDataEncoder = getUpdateConfigInstructionDataEncoder;
|
|
4578
|
+
exports.getVoteCastEventCodec = getVoteCastEventCodec;
|
|
4579
|
+
exports.getVoteCastEventDecoder = getVoteCastEventDecoder;
|
|
4580
|
+
exports.getVoteCastEventDiscriminatorBytes = getVoteCastEventDiscriminatorBytes;
|
|
4581
|
+
exports.getVoteCastEventEncoder = getVoteCastEventEncoder;
|
|
4582
|
+
exports.getVoteDiscriminatorBytes = getVoteDiscriminatorBytes;
|
|
4583
|
+
exports.getVoteFindingCodec = getVoteFindingCodec;
|
|
4584
|
+
exports.getVoteFindingDecoder = getVoteFindingDecoder;
|
|
4585
|
+
exports.getVoteFindingEncoder = getVoteFindingEncoder;
|
|
4586
|
+
exports.getVoteInstruction = getVoteInstruction;
|
|
4587
|
+
exports.getVoteInstructionAsync = getVoteInstructionAsync;
|
|
4588
|
+
exports.getVoteInstructionDataCodec = getVoteInstructionDataCodec;
|
|
4589
|
+
exports.getVoteInstructionDataDecoder = getVoteInstructionDataDecoder;
|
|
4590
|
+
exports.getVoteInstructionDataEncoder = getVoteInstructionDataEncoder;
|
|
4591
|
+
exports.getWriteReleaseManifestDiscriminatorBytes = getWriteReleaseManifestDiscriminatorBytes;
|
|
4592
|
+
exports.getWriteReleaseManifestInstruction = getWriteReleaseManifestInstruction;
|
|
4593
|
+
exports.getWriteReleaseManifestInstructionAsync = getWriteReleaseManifestInstructionAsync;
|
|
4594
|
+
exports.getWriteReleaseManifestInstructionDataCodec = getWriteReleaseManifestInstructionDataCodec;
|
|
4595
|
+
exports.getWriteReleaseManifestInstructionDataDecoder = getWriteReleaseManifestInstructionDataDecoder;
|
|
4596
|
+
exports.getWriteReleaseManifestInstructionDataEncoder = getWriteReleaseManifestInstructionDataEncoder;
|
|
4597
|
+
exports.guardianProgram = guardianProgram;
|
|
4598
|
+
exports.identifyGuardianAccount = identifyGuardianAccount;
|
|
4599
|
+
exports.identifyGuardianEvent = identifyGuardianEvent;
|
|
4600
|
+
exports.identifyGuardianInstruction = identifyGuardianInstruction;
|
|
4601
|
+
exports.isGuardianError = isGuardianError;
|
|
4602
|
+
exports.isPendingRelease = isPendingRelease;
|
|
4603
|
+
exports.parseAcceptAppAuthorityInstruction = parseAcceptAppAuthorityInstruction;
|
|
4604
|
+
exports.parseAcceptConfigAuthorityInstruction = parseAcceptConfigAuthorityInstruction;
|
|
4605
|
+
exports.parseAddGuardianInstruction = parseAddGuardianInstruction;
|
|
4606
|
+
exports.parseAppAuthorityAcceptedEvent = parseAppAuthorityAcceptedEvent;
|
|
4607
|
+
exports.parseAppAuthorityProposedEvent = parseAppAuthorityProposedEvent;
|
|
4608
|
+
exports.parseAppDeveloperUpdatedEvent = parseAppDeveloperUpdatedEvent;
|
|
4609
|
+
exports.parseAppRegisteredEvent = parseAppRegisteredEvent;
|
|
4610
|
+
exports.parseCancelReleaseInstruction = parseCancelReleaseInstruction;
|
|
4611
|
+
exports.parseConfigAuthorityAcceptedEvent = parseConfigAuthorityAcceptedEvent;
|
|
4612
|
+
exports.parseConfigAuthorityProposedEvent = parseConfigAuthorityProposedEvent;
|
|
4613
|
+
exports.parseConfigInitializedEvent = parseConfigInitializedEvent;
|
|
4614
|
+
exports.parseConfigUpdatedEvent = parseConfigUpdatedEvent;
|
|
4615
|
+
exports.parseExpireReleaseInstruction = parseExpireReleaseInstruction;
|
|
4616
|
+
exports.parseGuardianAddedEvent = parseGuardianAddedEvent;
|
|
4617
|
+
exports.parseGuardianInstruction = parseGuardianInstruction;
|
|
4618
|
+
exports.parseGuardianRegisteredEvent = parseGuardianRegisteredEvent;
|
|
4619
|
+
exports.parseGuardianRemovedEvent = parseGuardianRemovedEvent;
|
|
4620
|
+
exports.parseGuardianVoteAuthorityRotatedEvent = parseGuardianVoteAuthorityRotatedEvent;
|
|
4621
|
+
exports.parseInitializeConfigInstruction = parseInitializeConfigInstruction;
|
|
4622
|
+
exports.parseProposeAppAuthorityInstruction = parseProposeAppAuthorityInstruction;
|
|
4623
|
+
exports.parseProposeConfigAuthorityInstruction = parseProposeConfigAuthorityInstruction;
|
|
4624
|
+
exports.parseProposeReleaseInstruction = parseProposeReleaseInstruction;
|
|
4625
|
+
exports.parseRegisterAppInstruction = parseRegisterAppInstruction;
|
|
4626
|
+
exports.parseRegisterGuardianInstruction = parseRegisterGuardianInstruction;
|
|
4627
|
+
exports.parseReleaseApprovedEvent = parseReleaseApprovedEvent;
|
|
4628
|
+
exports.parseReleaseCancelledEvent = parseReleaseCancelledEvent;
|
|
4629
|
+
exports.parseReleaseExpiredEvent = parseReleaseExpiredEvent;
|
|
4630
|
+
exports.parseReleaseProposedEvent = parseReleaseProposedEvent;
|
|
4631
|
+
exports.parseReleaseRejectedEvent = parseReleaseRejectedEvent;
|
|
4632
|
+
exports.parseRemoveGuardianInstruction = parseRemoveGuardianInstruction;
|
|
4633
|
+
exports.parseRotateVoteAuthorityInstruction = parseRotateVoteAuthorityInstruction;
|
|
4634
|
+
exports.parseSetAppDeveloperInstruction = parseSetAppDeveloperInstruction;
|
|
4635
|
+
exports.parseUpdateConfigInstruction = parseUpdateConfigInstruction;
|
|
4636
|
+
exports.parseVoteCastEvent = parseVoteCastEvent;
|
|
4637
|
+
exports.parseVoteInstruction = parseVoteInstruction;
|
|
4638
|
+
exports.parseWriteReleaseManifestInstruction = parseWriteReleaseManifestInstruction;
|
|
4639
|
+
exports.pendingRelease = pendingRelease;
|
|
4640
|
+
//# sourceMappingURL=index.js.map
|
|
4641
|
+
//# sourceMappingURL=index.js.map
|