@streamflow/distributor 7.5.2 → 7.5.3-alpha.cffa362.20250508190445
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +3073 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +10 -0
- package/dist/cjs/solana/descriptor/aligned_distributor.cjs +4 -0
- package/dist/cjs/solana/descriptor/aligned_distributor.cjs.map +1 -0
- package/dist/cjs/solana/descriptor/aligned_distributor.d.cts +932 -0
- package/dist/cjs/solana/descriptor/merkle_distributor.cjs +4 -0
- package/dist/cjs/solana/descriptor/merkle_distributor.cjs.map +1 -0
- package/dist/cjs/solana/descriptor/merkle_distributor.d.cts +1128 -0
- package/dist/cjs/solana/index.cjs +3067 -0
- package/dist/cjs/solana/index.cjs.map +1 -0
- package/dist/cjs/solana/index.d.cts +1485 -0
- package/dist/esm/index.d.ts +10 -1
- package/dist/esm/index.js +3047 -1
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/solana/descriptor/aligned_distributor.d.ts +3 -1
- package/dist/esm/solana/descriptor/aligned_distributor.js +3 -1
- package/dist/esm/solana/descriptor/aligned_distributor.js.map +1 -0
- package/dist/esm/solana/descriptor/idl/aligned_distributor.json +851 -1182
- package/dist/esm/solana/descriptor/idl/merkle_distributor.json +1030 -0
- package/dist/esm/solana/descriptor/merkle_distributor.d.ts +3 -1
- package/dist/esm/solana/descriptor/merkle_distributor.js +3 -1
- package/dist/esm/solana/descriptor/merkle_distributor.js.map +1 -0
- package/dist/esm/solana/index.d.ts +1485 -7
- package/dist/esm/solana/index.js +3019 -7
- package/dist/esm/solana/index.js.map +1 -0
- package/package.json +50 -22
- package/dist/cjs/index.js +0 -27
- package/dist/cjs/solana/clients/BaseDistributorClient.js +0 -276
- package/dist/cjs/solana/clients/SolanaAlignedDistributorClient.js +0 -116
- package/dist/cjs/solana/clients/SolanaDistributorClient.js +0 -17
- package/dist/cjs/solana/clients/index.js +0 -10
- package/dist/cjs/solana/constants.js +0 -28
- package/dist/cjs/solana/descriptor/aligned_distributor.js +0 -2
- package/dist/cjs/solana/descriptor/idl/aligned_distributor.json +0 -1255
- package/dist/cjs/solana/descriptor/merkle_distributor.js +0 -2
- package/dist/cjs/solana/generated/accounts/ClaimStatus.js +0 -135
- package/dist/cjs/solana/generated/accounts/MerkleDistributor.js +0 -215
- package/dist/cjs/solana/generated/accounts/index.js +0 -7
- package/dist/cjs/solana/generated/errors/anchor.js +0 -712
- package/dist/cjs/solana/generated/errors/custom.js +0 -321
- package/dist/cjs/solana/generated/errors/index.js +0 -64
- package/dist/cjs/solana/generated/instructions/claimLocked.js +0 -22
- package/dist/cjs/solana/generated/instructions/clawback.js +0 -21
- package/dist/cjs/solana/generated/instructions/closeClaim.js +0 -57
- package/dist/cjs/solana/generated/instructions/index.js +0 -17
- package/dist/cjs/solana/generated/instructions/newClaim.js +0 -59
- package/dist/cjs/solana/generated/instructions/newDistributor.js +0 -104
- package/dist/cjs/solana/generated/instructions/setAdmin.js +0 -17
- package/dist/cjs/solana/generated/instructions/setClawbackReceiver.js +0 -17
- package/dist/cjs/solana/generated/programId.js +0 -8
- package/dist/cjs/solana/index.js +0 -36
- package/dist/cjs/solana/types.js +0 -159
- package/dist/cjs/solana/utils.js +0 -75
- package/dist/esm/solana/clients/BaseDistributorClient.d.ts +0 -43
- package/dist/esm/solana/clients/BaseDistributorClient.js +0 -274
- package/dist/esm/solana/clients/SolanaAlignedDistributorClient.d.ts +0 -16
- package/dist/esm/solana/clients/SolanaAlignedDistributorClient.js +0 -111
- package/dist/esm/solana/clients/SolanaDistributorClient.d.ts +0 -8
- package/dist/esm/solana/clients/SolanaDistributorClient.js +0 -11
- package/dist/esm/solana/clients/index.d.ts +0 -2
- package/dist/esm/solana/clients/index.js +0 -2
- package/dist/esm/solana/constants.d.ts +0 -24
- package/dist/esm/solana/constants.js +0 -25
- package/dist/esm/solana/generated/accounts/ClaimStatus.d.ts +0 -83
- package/dist/esm/solana/generated/accounts/ClaimStatus.js +0 -127
- package/dist/esm/solana/generated/accounts/MerkleDistributor.d.ts +0 -179
- package/dist/esm/solana/generated/accounts/MerkleDistributor.js +0 -239
- package/dist/esm/solana/generated/accounts/index.d.ts +0 -4
- package/dist/esm/solana/generated/accounts/index.js +0 -2
- package/dist/esm/solana/generated/errors/anchor.d.ts +0 -434
- package/dist/esm/solana/generated/errors/anchor.js +0 -707
- package/dist/esm/solana/generated/errors/custom.d.ts +0 -194
- package/dist/esm/solana/generated/errors/custom.js +0 -317
- package/dist/esm/solana/generated/errors/index.d.ts +0 -5
- package/dist/esm/solana/generated/errors/index.js +0 -37
- package/dist/esm/solana/generated/instructions/claimLocked.d.ts +0 -23
- package/dist/esm/solana/generated/instructions/claimLocked.js +0 -19
- package/dist/esm/solana/generated/instructions/clawback.d.ts +0 -17
- package/dist/esm/solana/generated/instructions/clawback.js +0 -18
- package/dist/esm/solana/generated/instructions/closeClaim.d.ts +0 -22
- package/dist/esm/solana/generated/instructions/closeClaim.js +0 -30
- package/dist/esm/solana/generated/instructions/index.d.ts +0 -14
- package/dist/esm/solana/generated/instructions/index.js +0 -7
- package/dist/esm/solana/generated/instructions/newClaim.d.ts +0 -29
- package/dist/esm/solana/generated/instructions/newClaim.js +0 -32
- package/dist/esm/solana/generated/instructions/newDistributor.d.ts +0 -58
- package/dist/esm/solana/generated/instructions/newDistributor.js +0 -77
- package/dist/esm/solana/generated/instructions/setAdmin.d.ts +0 -10
- package/dist/esm/solana/generated/instructions/setAdmin.js +0 -14
- package/dist/esm/solana/generated/instructions/setClawbackReceiver.d.ts +0 -10
- package/dist/esm/solana/generated/instructions/setClawbackReceiver.js +0 -14
- package/dist/esm/solana/generated/programId.d.ts +0 -3
- package/dist/esm/solana/generated/programId.js +0 -5
- package/dist/esm/solana/types.d.ts +0 -258
- package/dist/esm/solana/types.js +0 -156
- package/dist/esm/solana/utils.d.ts +0 -14
- package/dist/esm/solana/utils.js +0 -65
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClaimsLimitReached = exports.InvalidAmounts = exports.VestingAlreadyFinished = exports.NoVestingAmount = exports.DurationUpdateNotAllowed = exports.InvalidUnlockPeriod = exports.ClaimsAreNotClosable = exports.ClaimIsClosed = exports.InvalidMint = exports.TimestampsNotInFuture = exports.StartTimestampAfterEnd = exports.ArithmeticError = exports.ClaimExpired = exports.SameAdmin = exports.ClawbackReceiverIsTokenVault = exports.SameClawbackReceiver = exports.ClawbackAlreadyClaimed = exports.ClawbackBeforeStart = exports.OwnerMismatch = exports.Unauthorized = exports.MaxNodesExceeded = exports.ExceededMaxClaim = exports.InvalidProof = exports.InsufficientUnlockedTokens = void 0;
|
|
4
|
-
exports.fromCode = fromCode;
|
|
5
|
-
class InsufficientUnlockedTokens extends Error {
|
|
6
|
-
constructor(logs) {
|
|
7
|
-
super("6000: Insufficient unlocked tokens");
|
|
8
|
-
this.logs = logs;
|
|
9
|
-
this.code = 6000;
|
|
10
|
-
this.name = "InsufficientUnlockedTokens";
|
|
11
|
-
this.msg = "Insufficient unlocked tokens";
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.InsufficientUnlockedTokens = InsufficientUnlockedTokens;
|
|
15
|
-
InsufficientUnlockedTokens.code = 6000;
|
|
16
|
-
class InvalidProof extends Error {
|
|
17
|
-
constructor(logs) {
|
|
18
|
-
super("6001: Invalid Merkle proof");
|
|
19
|
-
this.logs = logs;
|
|
20
|
-
this.code = 6001;
|
|
21
|
-
this.name = "InvalidProof";
|
|
22
|
-
this.msg = "Invalid Merkle proof";
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.InvalidProof = InvalidProof;
|
|
26
|
-
InvalidProof.code = 6001;
|
|
27
|
-
class ExceededMaxClaim extends Error {
|
|
28
|
-
constructor(logs) {
|
|
29
|
-
super("6002: Exceeded maximum claim amount");
|
|
30
|
-
this.logs = logs;
|
|
31
|
-
this.code = 6002;
|
|
32
|
-
this.name = "ExceededMaxClaim";
|
|
33
|
-
this.msg = "Exceeded maximum claim amount";
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.ExceededMaxClaim = ExceededMaxClaim;
|
|
37
|
-
ExceededMaxClaim.code = 6002;
|
|
38
|
-
class MaxNodesExceeded extends Error {
|
|
39
|
-
constructor(logs) {
|
|
40
|
-
super("6003: Exceeded maximum node count");
|
|
41
|
-
this.logs = logs;
|
|
42
|
-
this.code = 6003;
|
|
43
|
-
this.name = "MaxNodesExceeded";
|
|
44
|
-
this.msg = "Exceeded maximum node count";
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.MaxNodesExceeded = MaxNodesExceeded;
|
|
48
|
-
MaxNodesExceeded.code = 6003;
|
|
49
|
-
class Unauthorized extends Error {
|
|
50
|
-
constructor(logs) {
|
|
51
|
-
super("6004: Account is not authorized to execute this instruction");
|
|
52
|
-
this.logs = logs;
|
|
53
|
-
this.code = 6004;
|
|
54
|
-
this.name = "Unauthorized";
|
|
55
|
-
this.msg = "Account is not authorized to execute this instruction";
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.Unauthorized = Unauthorized;
|
|
59
|
-
Unauthorized.code = 6004;
|
|
60
|
-
class OwnerMismatch extends Error {
|
|
61
|
-
constructor(logs) {
|
|
62
|
-
super("6005: Token account owner did not match intended owner");
|
|
63
|
-
this.logs = logs;
|
|
64
|
-
this.code = 6005;
|
|
65
|
-
this.name = "OwnerMismatch";
|
|
66
|
-
this.msg = "Token account owner did not match intended owner";
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.OwnerMismatch = OwnerMismatch;
|
|
70
|
-
OwnerMismatch.code = 6005;
|
|
71
|
-
class ClawbackBeforeStart extends Error {
|
|
72
|
-
constructor(logs) {
|
|
73
|
-
super("6006: Attempted clawback before start");
|
|
74
|
-
this.logs = logs;
|
|
75
|
-
this.code = 6006;
|
|
76
|
-
this.name = "ClawbackBeforeStart";
|
|
77
|
-
this.msg = "Attempted clawback before start";
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.ClawbackBeforeStart = ClawbackBeforeStart;
|
|
81
|
-
ClawbackBeforeStart.code = 6006;
|
|
82
|
-
class ClawbackAlreadyClaimed extends Error {
|
|
83
|
-
constructor(logs) {
|
|
84
|
-
super("6007: Clawback already claimed");
|
|
85
|
-
this.logs = logs;
|
|
86
|
-
this.code = 6007;
|
|
87
|
-
this.name = "ClawbackAlreadyClaimed";
|
|
88
|
-
this.msg = "Clawback already claimed";
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.ClawbackAlreadyClaimed = ClawbackAlreadyClaimed;
|
|
92
|
-
ClawbackAlreadyClaimed.code = 6007;
|
|
93
|
-
class SameClawbackReceiver extends Error {
|
|
94
|
-
constructor(logs) {
|
|
95
|
-
super("6008: New and old Clawback receivers are identical");
|
|
96
|
-
this.logs = logs;
|
|
97
|
-
this.code = 6008;
|
|
98
|
-
this.name = "SameClawbackReceiver";
|
|
99
|
-
this.msg = "New and old Clawback receivers are identical";
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.SameClawbackReceiver = SameClawbackReceiver;
|
|
103
|
-
SameClawbackReceiver.code = 6008;
|
|
104
|
-
class ClawbackReceiverIsTokenVault extends Error {
|
|
105
|
-
constructor(logs) {
|
|
106
|
-
super("6009: Clawback receiver can not be the Token Vault");
|
|
107
|
-
this.logs = logs;
|
|
108
|
-
this.code = 6009;
|
|
109
|
-
this.name = "ClawbackReceiverIsTokenVault";
|
|
110
|
-
this.msg = "Clawback receiver can not be the Token Vault";
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.ClawbackReceiverIsTokenVault = ClawbackReceiverIsTokenVault;
|
|
114
|
-
ClawbackReceiverIsTokenVault.code = 6009;
|
|
115
|
-
class SameAdmin extends Error {
|
|
116
|
-
constructor(logs) {
|
|
117
|
-
super("6010: New and old admin are identical");
|
|
118
|
-
this.logs = logs;
|
|
119
|
-
this.code = 6010;
|
|
120
|
-
this.name = "SameAdmin";
|
|
121
|
-
this.msg = "New and old admin are identical";
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.SameAdmin = SameAdmin;
|
|
125
|
-
SameAdmin.code = 6010;
|
|
126
|
-
class ClaimExpired extends Error {
|
|
127
|
-
constructor(logs) {
|
|
128
|
-
super("6011: Claim window expired");
|
|
129
|
-
this.logs = logs;
|
|
130
|
-
this.code = 6011;
|
|
131
|
-
this.name = "ClaimExpired";
|
|
132
|
-
this.msg = "Claim window expired";
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
exports.ClaimExpired = ClaimExpired;
|
|
136
|
-
ClaimExpired.code = 6011;
|
|
137
|
-
class ArithmeticError extends Error {
|
|
138
|
-
constructor(logs) {
|
|
139
|
-
super("6012: Arithmetic Error (overflow/underflow)");
|
|
140
|
-
this.logs = logs;
|
|
141
|
-
this.code = 6012;
|
|
142
|
-
this.name = "ArithmeticError";
|
|
143
|
-
this.msg = "Arithmetic Error (overflow/underflow)";
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
exports.ArithmeticError = ArithmeticError;
|
|
147
|
-
ArithmeticError.code = 6012;
|
|
148
|
-
class StartTimestampAfterEnd extends Error {
|
|
149
|
-
constructor(logs) {
|
|
150
|
-
super("6013: Start Timestamp cannot be after end Timestamp");
|
|
151
|
-
this.logs = logs;
|
|
152
|
-
this.code = 6013;
|
|
153
|
-
this.name = "StartTimestampAfterEnd";
|
|
154
|
-
this.msg = "Start Timestamp cannot be after end Timestamp";
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
exports.StartTimestampAfterEnd = StartTimestampAfterEnd;
|
|
158
|
-
StartTimestampAfterEnd.code = 6013;
|
|
159
|
-
class TimestampsNotInFuture extends Error {
|
|
160
|
-
constructor(logs) {
|
|
161
|
-
super("6014: Timestamps cannot be in the past");
|
|
162
|
-
this.logs = logs;
|
|
163
|
-
this.code = 6014;
|
|
164
|
-
this.name = "TimestampsNotInFuture";
|
|
165
|
-
this.msg = "Timestamps cannot be in the past";
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
exports.TimestampsNotInFuture = TimestampsNotInFuture;
|
|
169
|
-
TimestampsNotInFuture.code = 6014;
|
|
170
|
-
class InvalidMint extends Error {
|
|
171
|
-
constructor(logs) {
|
|
172
|
-
super("6015: Invalid Mint");
|
|
173
|
-
this.logs = logs;
|
|
174
|
-
this.code = 6015;
|
|
175
|
-
this.name = "InvalidMint";
|
|
176
|
-
this.msg = "Invalid Mint";
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
exports.InvalidMint = InvalidMint;
|
|
180
|
-
InvalidMint.code = 6015;
|
|
181
|
-
class ClaimIsClosed extends Error {
|
|
182
|
-
constructor(logs) {
|
|
183
|
-
super("6016: Claim is closed");
|
|
184
|
-
this.logs = logs;
|
|
185
|
-
this.code = 6016;
|
|
186
|
-
this.name = "ClaimIsClosed";
|
|
187
|
-
this.msg = "Claim is closed";
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
exports.ClaimIsClosed = ClaimIsClosed;
|
|
191
|
-
ClaimIsClosed.code = 6016;
|
|
192
|
-
class ClaimsAreNotClosable extends Error {
|
|
193
|
-
constructor(logs) {
|
|
194
|
-
super("6017: Claims are not closable");
|
|
195
|
-
this.logs = logs;
|
|
196
|
-
this.code = 6017;
|
|
197
|
-
this.name = "ClaimsAreNotClosable";
|
|
198
|
-
this.msg = "Claims are not closable";
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
exports.ClaimsAreNotClosable = ClaimsAreNotClosable;
|
|
202
|
-
ClaimsAreNotClosable.code = 6017;
|
|
203
|
-
class InvalidUnlockPeriod extends Error {
|
|
204
|
-
constructor(logs) {
|
|
205
|
-
super("6018: Invalid unlock period");
|
|
206
|
-
this.logs = logs;
|
|
207
|
-
this.code = 6018;
|
|
208
|
-
this.name = "InvalidUnlockPeriod";
|
|
209
|
-
this.msg = "Invalid unlock period";
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
exports.InvalidUnlockPeriod = InvalidUnlockPeriod;
|
|
213
|
-
InvalidUnlockPeriod.code = 6018;
|
|
214
|
-
class DurationUpdateNotAllowed extends Error {
|
|
215
|
-
constructor(logs) {
|
|
216
|
-
super("6019: Duration update is not allowed");
|
|
217
|
-
this.logs = logs;
|
|
218
|
-
this.code = 6019;
|
|
219
|
-
this.name = "DurationUpdateNotAllowed";
|
|
220
|
-
this.msg = "Duration update is not allowed";
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
exports.DurationUpdateNotAllowed = DurationUpdateNotAllowed;
|
|
224
|
-
DurationUpdateNotAllowed.code = 6019;
|
|
225
|
-
class NoVestingAmount extends Error {
|
|
226
|
-
constructor(logs) {
|
|
227
|
-
super("6020: Vesting amounts are not set");
|
|
228
|
-
this.logs = logs;
|
|
229
|
-
this.code = 6020;
|
|
230
|
-
this.name = "NoVestingAmount";
|
|
231
|
-
this.msg = "Vesting amounts are not set";
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
exports.NoVestingAmount = NoVestingAmount;
|
|
235
|
-
NoVestingAmount.code = 6020;
|
|
236
|
-
class VestingAlreadyFinished extends Error {
|
|
237
|
-
constructor(logs) {
|
|
238
|
-
super("6021: Vesting already finished");
|
|
239
|
-
this.logs = logs;
|
|
240
|
-
this.code = 6021;
|
|
241
|
-
this.name = "VestingAlreadyFinished";
|
|
242
|
-
this.msg = "Vesting already finished";
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
exports.VestingAlreadyFinished = VestingAlreadyFinished;
|
|
246
|
-
VestingAlreadyFinished.code = 6021;
|
|
247
|
-
class InvalidAmounts extends Error {
|
|
248
|
-
constructor(logs) {
|
|
249
|
-
super("6022: Provided amounts are invalid");
|
|
250
|
-
this.logs = logs;
|
|
251
|
-
this.code = 6022;
|
|
252
|
-
this.name = "InvalidAmounts";
|
|
253
|
-
this.msg = "Provided amounts are invalid";
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
exports.InvalidAmounts = InvalidAmounts;
|
|
257
|
-
InvalidAmounts.code = 6022;
|
|
258
|
-
class ClaimsLimitReached extends Error {
|
|
259
|
-
constructor(logs) {
|
|
260
|
-
super("6023: Claims limit has been reached");
|
|
261
|
-
this.logs = logs;
|
|
262
|
-
this.code = 6023;
|
|
263
|
-
this.name = "ClaimsLimitReached";
|
|
264
|
-
this.msg = "Claims limit has been reached";
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
exports.ClaimsLimitReached = ClaimsLimitReached;
|
|
268
|
-
ClaimsLimitReached.code = 6023;
|
|
269
|
-
function fromCode(code, logs) {
|
|
270
|
-
switch (code) {
|
|
271
|
-
case 6000:
|
|
272
|
-
return new InsufficientUnlockedTokens(logs);
|
|
273
|
-
case 6001:
|
|
274
|
-
return new InvalidProof(logs);
|
|
275
|
-
case 6002:
|
|
276
|
-
return new ExceededMaxClaim(logs);
|
|
277
|
-
case 6003:
|
|
278
|
-
return new MaxNodesExceeded(logs);
|
|
279
|
-
case 6004:
|
|
280
|
-
return new Unauthorized(logs);
|
|
281
|
-
case 6005:
|
|
282
|
-
return new OwnerMismatch(logs);
|
|
283
|
-
case 6006:
|
|
284
|
-
return new ClawbackBeforeStart(logs);
|
|
285
|
-
case 6007:
|
|
286
|
-
return new ClawbackAlreadyClaimed(logs);
|
|
287
|
-
case 6008:
|
|
288
|
-
return new SameClawbackReceiver(logs);
|
|
289
|
-
case 6009:
|
|
290
|
-
return new ClawbackReceiverIsTokenVault(logs);
|
|
291
|
-
case 6010:
|
|
292
|
-
return new SameAdmin(logs);
|
|
293
|
-
case 6011:
|
|
294
|
-
return new ClaimExpired(logs);
|
|
295
|
-
case 6012:
|
|
296
|
-
return new ArithmeticError(logs);
|
|
297
|
-
case 6013:
|
|
298
|
-
return new StartTimestampAfterEnd(logs);
|
|
299
|
-
case 6014:
|
|
300
|
-
return new TimestampsNotInFuture(logs);
|
|
301
|
-
case 6015:
|
|
302
|
-
return new InvalidMint(logs);
|
|
303
|
-
case 6016:
|
|
304
|
-
return new ClaimIsClosed(logs);
|
|
305
|
-
case 6017:
|
|
306
|
-
return new ClaimsAreNotClosable(logs);
|
|
307
|
-
case 6018:
|
|
308
|
-
return new InvalidUnlockPeriod(logs);
|
|
309
|
-
case 6019:
|
|
310
|
-
return new DurationUpdateNotAllowed(logs);
|
|
311
|
-
case 6020:
|
|
312
|
-
return new NoVestingAmount(logs);
|
|
313
|
-
case 6021:
|
|
314
|
-
return new VestingAlreadyFinished(logs);
|
|
315
|
-
case 6022:
|
|
316
|
-
return new InvalidAmounts(logs);
|
|
317
|
-
case 6023:
|
|
318
|
-
return new ClaimsLimitReached(logs);
|
|
319
|
-
}
|
|
320
|
-
return null;
|
|
321
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.fromCode = fromCode;
|
|
27
|
-
exports.fromTxError = fromTxError;
|
|
28
|
-
const programId_1 = require("../programId");
|
|
29
|
-
const anchor = __importStar(require("./anchor"));
|
|
30
|
-
const custom = __importStar(require("./custom"));
|
|
31
|
-
function fromCode(code, logs) {
|
|
32
|
-
return code >= 6000 ? custom.fromCode(code, logs) : anchor.fromCode(code, logs);
|
|
33
|
-
}
|
|
34
|
-
function hasOwnProperty(obj, prop) {
|
|
35
|
-
return Object.hasOwnProperty.call(obj, prop);
|
|
36
|
-
}
|
|
37
|
-
const errorRe = /Program (\w+) failed: custom program error: (\w+)/;
|
|
38
|
-
function fromTxError(err, programId = programId_1.PROGRAM_ID) {
|
|
39
|
-
if (typeof err !== "object" || err === null || !hasOwnProperty(err, "logs") || !Array.isArray(err.logs)) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
let firstMatch = null;
|
|
43
|
-
for (const logLine of err.logs) {
|
|
44
|
-
firstMatch = errorRe.exec(logLine);
|
|
45
|
-
if (firstMatch !== null) {
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if (firstMatch === null) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
const [programIdRaw, codeRaw] = firstMatch.slice(1);
|
|
53
|
-
if (programIdRaw !== programId.toString()) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
let errorCode;
|
|
57
|
-
try {
|
|
58
|
-
errorCode = parseInt(codeRaw, 16);
|
|
59
|
-
}
|
|
60
|
-
catch (parseErr) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
return fromCode(errorCode, err.logs);
|
|
64
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.claimLocked = claimLocked;
|
|
4
|
-
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
const programId_1 = require("../programId");
|
|
6
|
-
function claimLocked(accounts, programId = programId_1.PROGRAM_ID) {
|
|
7
|
-
const keys = [
|
|
8
|
-
{ pubkey: accounts.distributor, isSigner: false, isWritable: true },
|
|
9
|
-
{ pubkey: accounts.claimStatus, isSigner: false, isWritable: true },
|
|
10
|
-
{ pubkey: accounts.from, isSigner: false, isWritable: true },
|
|
11
|
-
{ pubkey: accounts.to, isSigner: false, isWritable: true },
|
|
12
|
-
{ pubkey: accounts.claimant, isSigner: true, isWritable: true },
|
|
13
|
-
{ pubkey: accounts.mint, isSigner: false, isWritable: false },
|
|
14
|
-
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
15
|
-
{ pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
|
|
16
|
-
{ pubkey: accounts.program, isSigner: false, isWritable: false },
|
|
17
|
-
];
|
|
18
|
-
const identifier = Buffer.from([34, 206, 181, 23, 11, 207, 147, 90]);
|
|
19
|
-
const data = identifier;
|
|
20
|
-
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
21
|
-
return ix;
|
|
22
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.clawback = clawback;
|
|
4
|
-
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
const buffer_1 = require("buffer");
|
|
6
|
-
const programId_1 = require("../programId");
|
|
7
|
-
function clawback(accounts, programId = programId_1.PROGRAM_ID) {
|
|
8
|
-
const keys = [
|
|
9
|
-
{ pubkey: accounts.distributor, isSigner: false, isWritable: true },
|
|
10
|
-
{ pubkey: accounts.from, isSigner: false, isWritable: true },
|
|
11
|
-
{ pubkey: accounts.to, isSigner: false, isWritable: true },
|
|
12
|
-
{ pubkey: accounts.admin, isSigner: true, isWritable: true },
|
|
13
|
-
{ pubkey: accounts.mint, isSigner: false, isWritable: false },
|
|
14
|
-
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
15
|
-
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
16
|
-
];
|
|
17
|
-
const identifier = buffer_1.Buffer.from([111, 92, 142, 79, 33, 234, 82, 27]);
|
|
18
|
-
const data = identifier;
|
|
19
|
-
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
20
|
-
return ix;
|
|
21
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.layout = void 0;
|
|
27
|
-
exports.closeClaim = closeClaim;
|
|
28
|
-
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
29
|
-
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
30
|
-
const buffer_1 = require("buffer");
|
|
31
|
-
const programId_1 = require("../programId");
|
|
32
|
-
exports.layout = borsh.struct([
|
|
33
|
-
borsh.option(borsh.u64(), "amountUnlocked"),
|
|
34
|
-
borsh.option(borsh.u64(), "amountLocked"),
|
|
35
|
-
borsh.option(borsh.vec(borsh.array(borsh.u8(), 32)), "proof"),
|
|
36
|
-
]);
|
|
37
|
-
function closeClaim(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
38
|
-
const keys = [
|
|
39
|
-
{ pubkey: accounts.distributor, isSigner: false, isWritable: true },
|
|
40
|
-
{ pubkey: accounts.adminOrClaimant, isSigner: true, isWritable: true },
|
|
41
|
-
{ pubkey: accounts.claimant, isSigner: false, isWritable: false },
|
|
42
|
-
{ pubkey: accounts.claimStatus, isSigner: false, isWritable: true },
|
|
43
|
-
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
44
|
-
{ pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
|
|
45
|
-
{ pubkey: accounts.program, isSigner: false, isWritable: false },
|
|
46
|
-
];
|
|
47
|
-
const identifier = buffer_1.Buffer.from([42, 177, 165, 35, 213, 179, 211, 19]);
|
|
48
|
-
const buffer = buffer_1.Buffer.alloc(1000);
|
|
49
|
-
const len = exports.layout.encode({
|
|
50
|
-
amountUnlocked: args.amountUnlocked ?? null,
|
|
51
|
-
amountLocked: args.amountLocked ?? null,
|
|
52
|
-
proof: args.proof ?? null,
|
|
53
|
-
}, buffer);
|
|
54
|
-
const data = buffer_1.Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
55
|
-
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
56
|
-
return ix;
|
|
57
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setAdmin = exports.setClawbackReceiver = exports.closeClaim = exports.clawback = exports.claimLocked = exports.newClaim = exports.newDistributor = void 0;
|
|
4
|
-
var newDistributor_1 = require("./newDistributor");
|
|
5
|
-
Object.defineProperty(exports, "newDistributor", { enumerable: true, get: function () { return newDistributor_1.newDistributor; } });
|
|
6
|
-
var newClaim_1 = require("./newClaim");
|
|
7
|
-
Object.defineProperty(exports, "newClaim", { enumerable: true, get: function () { return newClaim_1.newClaim; } });
|
|
8
|
-
var claimLocked_1 = require("./claimLocked");
|
|
9
|
-
Object.defineProperty(exports, "claimLocked", { enumerable: true, get: function () { return claimLocked_1.claimLocked; } });
|
|
10
|
-
var clawback_1 = require("./clawback");
|
|
11
|
-
Object.defineProperty(exports, "clawback", { enumerable: true, get: function () { return clawback_1.clawback; } });
|
|
12
|
-
var closeClaim_1 = require("./closeClaim");
|
|
13
|
-
Object.defineProperty(exports, "closeClaim", { enumerable: true, get: function () { return closeClaim_1.closeClaim; } });
|
|
14
|
-
var setClawbackReceiver_1 = require("./setClawbackReceiver");
|
|
15
|
-
Object.defineProperty(exports, "setClawbackReceiver", { enumerable: true, get: function () { return setClawbackReceiver_1.setClawbackReceiver; } });
|
|
16
|
-
var setAdmin_1 = require("./setAdmin");
|
|
17
|
-
Object.defineProperty(exports, "setAdmin", { enumerable: true, get: function () { return setAdmin_1.setAdmin; } });
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.layout = void 0;
|
|
27
|
-
exports.newClaim = newClaim;
|
|
28
|
-
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
29
|
-
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
30
|
-
const programId_1 = require("../programId");
|
|
31
|
-
exports.layout = borsh.struct([
|
|
32
|
-
borsh.u64("amountUnlocked"),
|
|
33
|
-
borsh.u64("amountLocked"),
|
|
34
|
-
borsh.vec(borsh.array(borsh.u8(), 32), "proof"),
|
|
35
|
-
]);
|
|
36
|
-
function newClaim(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
37
|
-
const keys = [
|
|
38
|
-
{ pubkey: accounts.distributor, isSigner: false, isWritable: true },
|
|
39
|
-
{ pubkey: accounts.claimStatus, isSigner: false, isWritable: true },
|
|
40
|
-
{ pubkey: accounts.from, isSigner: false, isWritable: true },
|
|
41
|
-
{ pubkey: accounts.to, isSigner: false, isWritable: true },
|
|
42
|
-
{ pubkey: accounts.claimant, isSigner: true, isWritable: true },
|
|
43
|
-
{ pubkey: accounts.mint, isSigner: false, isWritable: false },
|
|
44
|
-
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
45
|
-
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
46
|
-
{ pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
|
|
47
|
-
{ pubkey: accounts.program, isSigner: false, isWritable: false },
|
|
48
|
-
];
|
|
49
|
-
const identifier = Buffer.from([78, 177, 98, 123, 210, 21, 187, 83]);
|
|
50
|
-
const buffer = Buffer.alloc(1000);
|
|
51
|
-
const len = exports.layout.encode({
|
|
52
|
-
amountUnlocked: args.amountUnlocked,
|
|
53
|
-
amountLocked: args.amountLocked,
|
|
54
|
-
proof: args.proof,
|
|
55
|
-
}, buffer);
|
|
56
|
-
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
57
|
-
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
58
|
-
return ix;
|
|
59
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.layout = void 0;
|
|
27
|
-
exports.newDistributor = newDistributor;
|
|
28
|
-
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
29
|
-
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
30
|
-
const buffer_1 = require("buffer");
|
|
31
|
-
const programId_1 = require("../programId");
|
|
32
|
-
exports.layout = borsh.struct([
|
|
33
|
-
borsh.u64("version"),
|
|
34
|
-
borsh.array(borsh.u8(), 32, "root"),
|
|
35
|
-
borsh.u64("maxTotalClaim"),
|
|
36
|
-
borsh.u64("maxNumNodes"),
|
|
37
|
-
borsh.u64("unlockPeriod"),
|
|
38
|
-
borsh.u64("startVestingTs"),
|
|
39
|
-
borsh.u64("endVestingTs"),
|
|
40
|
-
borsh.u64("clawbackStartTs"),
|
|
41
|
-
borsh.bool("claimsClosableByAdmin"),
|
|
42
|
-
borsh.option(borsh.bool(), "canUpdateDuration"),
|
|
43
|
-
borsh.option(borsh.u64(), "totalAmountUnlocked"),
|
|
44
|
-
borsh.option(borsh.u64(), "totalAmountLocked"),
|
|
45
|
-
borsh.option(borsh.bool(), "claimsClosableByClaimant"),
|
|
46
|
-
borsh.option(borsh.u16(), "claimsLimit"),
|
|
47
|
-
]);
|
|
48
|
-
/**
|
|
49
|
-
* READ THE FOLLOWING:
|
|
50
|
-
*
|
|
51
|
-
* This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.
|
|
52
|
-
*
|
|
53
|
-
* An attack could look like:
|
|
54
|
-
* - A legitimate user opens a new distributor.
|
|
55
|
-
* - Someone observes the call to this instruction.
|
|
56
|
-
* - They replace the clawback_receiver, admin, or time parameters with their own.
|
|
57
|
-
*
|
|
58
|
-
* One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own
|
|
59
|
-
* and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,
|
|
60
|
-
* the attacker can steal all funds from the distributor to their own clawback_receiver account.
|
|
61
|
-
*
|
|
62
|
-
* HOW TO AVOID:
|
|
63
|
-
* - When you call into this instruction, ensure your transaction succeeds.
|
|
64
|
-
* - To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and
|
|
65
|
-
* assert the parameters are what you expect, most importantly the clawback_receiver and admin.
|
|
66
|
-
* - If your transaction fails, double check the value on-chain matches what you expect.
|
|
67
|
-
*/
|
|
68
|
-
function newDistributor(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
69
|
-
const keys = [
|
|
70
|
-
{ pubkey: accounts.distributor, isSigner: false, isWritable: true },
|
|
71
|
-
{ pubkey: accounts.clawbackReceiver, isSigner: false, isWritable: true },
|
|
72
|
-
{ pubkey: accounts.mint, isSigner: false, isWritable: false },
|
|
73
|
-
{ pubkey: accounts.tokenVault, isSigner: false, isWritable: true },
|
|
74
|
-
{ pubkey: accounts.admin, isSigner: true, isWritable: true },
|
|
75
|
-
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
76
|
-
{
|
|
77
|
-
pubkey: accounts.associatedTokenProgram,
|
|
78
|
-
isSigner: false,
|
|
79
|
-
isWritable: false,
|
|
80
|
-
},
|
|
81
|
-
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
82
|
-
];
|
|
83
|
-
const identifier = buffer_1.Buffer.from([32, 139, 112, 171, 0, 2, 225, 155]);
|
|
84
|
-
const buffer = buffer_1.Buffer.alloc(1000);
|
|
85
|
-
const len = exports.layout.encode({
|
|
86
|
-
version: args.version,
|
|
87
|
-
root: args.root,
|
|
88
|
-
maxTotalClaim: args.maxTotalClaim,
|
|
89
|
-
maxNumNodes: args.maxNumNodes,
|
|
90
|
-
unlockPeriod: args.unlockPeriod,
|
|
91
|
-
startVestingTs: args.startVestingTs,
|
|
92
|
-
endVestingTs: args.endVestingTs,
|
|
93
|
-
clawbackStartTs: args.clawbackStartTs,
|
|
94
|
-
claimsClosableByAdmin: args.claimsClosableByAdmin,
|
|
95
|
-
canUpdateDuration: null,
|
|
96
|
-
totalAmountUnlocked: null,
|
|
97
|
-
totalAmountLocked: null,
|
|
98
|
-
claimsClosableByClaimant: args.claimsClosableByClaimant ?? null,
|
|
99
|
-
claimsLimit: args.claimsLimit ?? null,
|
|
100
|
-
}, buffer);
|
|
101
|
-
const data = buffer_1.Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
102
|
-
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
103
|
-
return ix;
|
|
104
|
-
}
|