@streamflow/distributor 7.0.0-alpha.2 → 7.0.0-alpha.20

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.
Files changed (54) hide show
  1. package/README.md +19 -3
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/solana/clients/BaseDistributorClient.js +222 -0
  4. package/dist/cjs/solana/clients/SolanaAlignedDistributorClient.js +104 -0
  5. package/dist/cjs/solana/clients/SolanaDistributorClient.js +17 -0
  6. package/dist/cjs/solana/clients/index.js +10 -0
  7. package/dist/cjs/solana/constants.js +22 -9
  8. package/dist/cjs/solana/descriptor/aligned_distributor.js +2 -0
  9. package/dist/cjs/solana/descriptor/idl/aligned_distributor.json +1242 -0
  10. package/dist/cjs/solana/generated/accounts/ClaimStatus.js +56 -114
  11. package/dist/cjs/solana/generated/accounts/MerkleDistributor.js +96 -129
  12. package/dist/cjs/solana/generated/errors/anchor.js +540 -717
  13. package/dist/cjs/solana/generated/errors/custom.js +171 -243
  14. package/dist/cjs/solana/generated/errors/index.js +12 -51
  15. package/dist/cjs/solana/generated/instructions/claimLocked.js +7 -8
  16. package/dist/cjs/solana/generated/instructions/clawback.js +8 -9
  17. package/dist/cjs/solana/generated/instructions/closeClaim.js +8 -9
  18. package/dist/cjs/solana/generated/instructions/newClaim.js +10 -11
  19. package/dist/cjs/solana/generated/instructions/newDistributor.js +17 -12
  20. package/dist/cjs/solana/generated/instructions/setAdmin.js +8 -9
  21. package/dist/cjs/solana/generated/instructions/setClawbackReceiver.js +8 -9
  22. package/dist/cjs/solana/generated/programId.js +1 -1
  23. package/dist/cjs/solana/index.js +8 -12
  24. package/dist/cjs/solana/utils.js +46 -94
  25. package/dist/esm/index.d.ts +1 -1
  26. package/dist/esm/index.js +1 -1
  27. package/dist/esm/solana/clients/BaseDistributorClient.d.ts +39 -0
  28. package/dist/esm/solana/{client.js → clients/BaseDistributorClient.js} +97 -66
  29. package/dist/esm/solana/clients/SolanaAlignedDistributorClient.d.ts +14 -0
  30. package/dist/esm/solana/clients/SolanaAlignedDistributorClient.js +99 -0
  31. package/dist/esm/solana/clients/SolanaDistributorClient.d.ts +8 -0
  32. package/dist/esm/solana/clients/SolanaDistributorClient.js +11 -0
  33. package/dist/esm/solana/clients/index.d.ts +2 -0
  34. package/dist/esm/solana/clients/index.js +2 -0
  35. package/dist/esm/solana/constants.d.ts +15 -0
  36. package/dist/esm/solana/constants.js +14 -0
  37. package/dist/esm/solana/descriptor/aligned_distributor.d.ts +918 -0
  38. package/dist/esm/solana/descriptor/aligned_distributor.js +1 -0
  39. package/dist/esm/solana/descriptor/idl/aligned_distributor.json +1242 -0
  40. package/dist/esm/solana/generated/accounts/ClaimStatus.d.ts +17 -17
  41. package/dist/esm/solana/generated/accounts/ClaimStatus.js +13 -13
  42. package/dist/esm/solana/generated/accounts/MerkleDistributor.d.ts +55 -25
  43. package/dist/esm/solana/generated/accounts/MerkleDistributor.js +53 -18
  44. package/dist/esm/solana/generated/instructions/newClaim.d.ts +3 -3
  45. package/dist/esm/solana/generated/instructions/newDistributor.d.ts +8 -8
  46. package/dist/esm/solana/generated/instructions/newDistributor.js +6 -0
  47. package/dist/esm/solana/index.d.ts +7 -7
  48. package/dist/esm/solana/index.js +7 -7
  49. package/dist/esm/solana/types.d.ts +49 -4
  50. package/dist/esm/solana/utils.d.ts +2 -1
  51. package/dist/esm/solana/utils.js +11 -6
  52. package/package.json +9 -7
  53. package/dist/cjs/solana/client.js +0 -365
  54. package/dist/esm/solana/client.d.ts +0 -36
@@ -1,287 +1,215 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.fromCode = 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;
19
- var InsufficientUnlockedTokens = /** @class */ (function (_super) {
20
- __extends(InsufficientUnlockedTokens, _super);
21
- function InsufficientUnlockedTokens(logs) {
22
- var _this = _super.call(this, "6000: Insufficient unlocked tokens") || this;
23
- _this.logs = logs;
24
- _this.code = 6000;
25
- _this.name = "InsufficientUnlockedTokens";
26
- _this.msg = "Insufficient unlocked tokens";
27
- return _this;
4
+ class InsufficientUnlockedTokens extends Error {
5
+ constructor(logs) {
6
+ super("6000: Insufficient unlocked tokens");
7
+ this.logs = logs;
8
+ this.code = 6000;
9
+ this.name = "InsufficientUnlockedTokens";
10
+ this.msg = "Insufficient unlocked tokens";
28
11
  }
29
- InsufficientUnlockedTokens.code = 6000;
30
- return InsufficientUnlockedTokens;
31
- }(Error));
12
+ }
32
13
  exports.InsufficientUnlockedTokens = InsufficientUnlockedTokens;
33
- var InvalidProof = /** @class */ (function (_super) {
34
- __extends(InvalidProof, _super);
35
- function InvalidProof(logs) {
36
- var _this = _super.call(this, "6001: Invalid Merkle proof") || this;
37
- _this.logs = logs;
38
- _this.code = 6001;
39
- _this.name = "InvalidProof";
40
- _this.msg = "Invalid Merkle proof";
41
- return _this;
14
+ InsufficientUnlockedTokens.code = 6000;
15
+ class InvalidProof extends Error {
16
+ constructor(logs) {
17
+ super("6001: Invalid Merkle proof");
18
+ this.logs = logs;
19
+ this.code = 6001;
20
+ this.name = "InvalidProof";
21
+ this.msg = "Invalid Merkle proof";
42
22
  }
43
- InvalidProof.code = 6001;
44
- return InvalidProof;
45
- }(Error));
23
+ }
46
24
  exports.InvalidProof = InvalidProof;
47
- var ExceededMaxClaim = /** @class */ (function (_super) {
48
- __extends(ExceededMaxClaim, _super);
49
- function ExceededMaxClaim(logs) {
50
- var _this = _super.call(this, "6002: Exceeded maximum claim amount") || this;
51
- _this.logs = logs;
52
- _this.code = 6002;
53
- _this.name = "ExceededMaxClaim";
54
- _this.msg = "Exceeded maximum claim amount";
55
- return _this;
25
+ InvalidProof.code = 6001;
26
+ class ExceededMaxClaim extends Error {
27
+ constructor(logs) {
28
+ super("6002: Exceeded maximum claim amount");
29
+ this.logs = logs;
30
+ this.code = 6002;
31
+ this.name = "ExceededMaxClaim";
32
+ this.msg = "Exceeded maximum claim amount";
56
33
  }
57
- ExceededMaxClaim.code = 6002;
58
- return ExceededMaxClaim;
59
- }(Error));
34
+ }
60
35
  exports.ExceededMaxClaim = ExceededMaxClaim;
61
- var MaxNodesExceeded = /** @class */ (function (_super) {
62
- __extends(MaxNodesExceeded, _super);
63
- function MaxNodesExceeded(logs) {
64
- var _this = _super.call(this, "6003: Exceeded maximum node count") || this;
65
- _this.logs = logs;
66
- _this.code = 6003;
67
- _this.name = "MaxNodesExceeded";
68
- _this.msg = "Exceeded maximum node count";
69
- return _this;
36
+ ExceededMaxClaim.code = 6002;
37
+ class MaxNodesExceeded extends Error {
38
+ constructor(logs) {
39
+ super("6003: Exceeded maximum node count");
40
+ this.logs = logs;
41
+ this.code = 6003;
42
+ this.name = "MaxNodesExceeded";
43
+ this.msg = "Exceeded maximum node count";
70
44
  }
71
- MaxNodesExceeded.code = 6003;
72
- return MaxNodesExceeded;
73
- }(Error));
45
+ }
74
46
  exports.MaxNodesExceeded = MaxNodesExceeded;
75
- var Unauthorized = /** @class */ (function (_super) {
76
- __extends(Unauthorized, _super);
77
- function Unauthorized(logs) {
78
- var _this = _super.call(this, "6004: Account is not authorized to execute this instruction") || this;
79
- _this.logs = logs;
80
- _this.code = 6004;
81
- _this.name = "Unauthorized";
82
- _this.msg = "Account is not authorized to execute this instruction";
83
- return _this;
47
+ MaxNodesExceeded.code = 6003;
48
+ class Unauthorized extends Error {
49
+ constructor(logs) {
50
+ super("6004: Account is not authorized to execute this instruction");
51
+ this.logs = logs;
52
+ this.code = 6004;
53
+ this.name = "Unauthorized";
54
+ this.msg = "Account is not authorized to execute this instruction";
84
55
  }
85
- Unauthorized.code = 6004;
86
- return Unauthorized;
87
- }(Error));
56
+ }
88
57
  exports.Unauthorized = Unauthorized;
89
- var OwnerMismatch = /** @class */ (function (_super) {
90
- __extends(OwnerMismatch, _super);
91
- function OwnerMismatch(logs) {
92
- var _this = _super.call(this, "6005: Token account owner did not match intended owner") || this;
93
- _this.logs = logs;
94
- _this.code = 6005;
95
- _this.name = "OwnerMismatch";
96
- _this.msg = "Token account owner did not match intended owner";
97
- return _this;
58
+ Unauthorized.code = 6004;
59
+ class OwnerMismatch extends Error {
60
+ constructor(logs) {
61
+ super("6005: Token account owner did not match intended owner");
62
+ this.logs = logs;
63
+ this.code = 6005;
64
+ this.name = "OwnerMismatch";
65
+ this.msg = "Token account owner did not match intended owner";
98
66
  }
99
- OwnerMismatch.code = 6005;
100
- return OwnerMismatch;
101
- }(Error));
67
+ }
102
68
  exports.OwnerMismatch = OwnerMismatch;
103
- var ClawbackBeforeStart = /** @class */ (function (_super) {
104
- __extends(ClawbackBeforeStart, _super);
105
- function ClawbackBeforeStart(logs) {
106
- var _this = _super.call(this, "6006: Attempted clawback before start") || this;
107
- _this.logs = logs;
108
- _this.code = 6006;
109
- _this.name = "ClawbackBeforeStart";
110
- _this.msg = "Attempted clawback before start";
111
- return _this;
69
+ OwnerMismatch.code = 6005;
70
+ class ClawbackBeforeStart extends Error {
71
+ constructor(logs) {
72
+ super("6006: Attempted clawback before start");
73
+ this.logs = logs;
74
+ this.code = 6006;
75
+ this.name = "ClawbackBeforeStart";
76
+ this.msg = "Attempted clawback before start";
112
77
  }
113
- ClawbackBeforeStart.code = 6006;
114
- return ClawbackBeforeStart;
115
- }(Error));
78
+ }
116
79
  exports.ClawbackBeforeStart = ClawbackBeforeStart;
117
- var ClawbackAlreadyClaimed = /** @class */ (function (_super) {
118
- __extends(ClawbackAlreadyClaimed, _super);
119
- function ClawbackAlreadyClaimed(logs) {
120
- var _this = _super.call(this, "6007: Clawback already claimed") || this;
121
- _this.logs = logs;
122
- _this.code = 6007;
123
- _this.name = "ClawbackAlreadyClaimed";
124
- _this.msg = "Clawback already claimed";
125
- return _this;
80
+ ClawbackBeforeStart.code = 6006;
81
+ class ClawbackAlreadyClaimed extends Error {
82
+ constructor(logs) {
83
+ super("6007: Clawback already claimed");
84
+ this.logs = logs;
85
+ this.code = 6007;
86
+ this.name = "ClawbackAlreadyClaimed";
87
+ this.msg = "Clawback already claimed";
126
88
  }
127
- ClawbackAlreadyClaimed.code = 6007;
128
- return ClawbackAlreadyClaimed;
129
- }(Error));
89
+ }
130
90
  exports.ClawbackAlreadyClaimed = ClawbackAlreadyClaimed;
131
- var SameClawbackReceiver = /** @class */ (function (_super) {
132
- __extends(SameClawbackReceiver, _super);
133
- function SameClawbackReceiver(logs) {
134
- var _this = _super.call(this, "6008: New and old Clawback receivers are identical") || this;
135
- _this.logs = logs;
136
- _this.code = 6008;
137
- _this.name = "SameClawbackReceiver";
138
- _this.msg = "New and old Clawback receivers are identical";
139
- return _this;
91
+ ClawbackAlreadyClaimed.code = 6007;
92
+ class SameClawbackReceiver extends Error {
93
+ constructor(logs) {
94
+ super("6008: New and old Clawback receivers are identical");
95
+ this.logs = logs;
96
+ this.code = 6008;
97
+ this.name = "SameClawbackReceiver";
98
+ this.msg = "New and old Clawback receivers are identical";
140
99
  }
141
- SameClawbackReceiver.code = 6008;
142
- return SameClawbackReceiver;
143
- }(Error));
100
+ }
144
101
  exports.SameClawbackReceiver = SameClawbackReceiver;
145
- var ClawbackReceiverIsTokenVault = /** @class */ (function (_super) {
146
- __extends(ClawbackReceiverIsTokenVault, _super);
147
- function ClawbackReceiverIsTokenVault(logs) {
148
- var _this = _super.call(this, "6009: Clawback receiver can not be the Token Vault") || this;
149
- _this.logs = logs;
150
- _this.code = 6009;
151
- _this.name = "ClawbackReceiverIsTokenVault";
152
- _this.msg = "Clawback receiver can not be the Token Vault";
153
- return _this;
102
+ SameClawbackReceiver.code = 6008;
103
+ class ClawbackReceiverIsTokenVault extends Error {
104
+ constructor(logs) {
105
+ super("6009: Clawback receiver can not be the Token Vault");
106
+ this.logs = logs;
107
+ this.code = 6009;
108
+ this.name = "ClawbackReceiverIsTokenVault";
109
+ this.msg = "Clawback receiver can not be the Token Vault";
154
110
  }
155
- ClawbackReceiverIsTokenVault.code = 6009;
156
- return ClawbackReceiverIsTokenVault;
157
- }(Error));
111
+ }
158
112
  exports.ClawbackReceiverIsTokenVault = ClawbackReceiverIsTokenVault;
159
- var SameAdmin = /** @class */ (function (_super) {
160
- __extends(SameAdmin, _super);
161
- function SameAdmin(logs) {
162
- var _this = _super.call(this, "6010: New and old admin are identical") || this;
163
- _this.logs = logs;
164
- _this.code = 6010;
165
- _this.name = "SameAdmin";
166
- _this.msg = "New and old admin are identical";
167
- return _this;
113
+ ClawbackReceiverIsTokenVault.code = 6009;
114
+ class SameAdmin extends Error {
115
+ constructor(logs) {
116
+ super("6010: New and old admin are identical");
117
+ this.logs = logs;
118
+ this.code = 6010;
119
+ this.name = "SameAdmin";
120
+ this.msg = "New and old admin are identical";
168
121
  }
169
- SameAdmin.code = 6010;
170
- return SameAdmin;
171
- }(Error));
122
+ }
172
123
  exports.SameAdmin = SameAdmin;
173
- var ClaimExpired = /** @class */ (function (_super) {
174
- __extends(ClaimExpired, _super);
175
- function ClaimExpired(logs) {
176
- var _this = _super.call(this, "6011: Claim window expired") || this;
177
- _this.logs = logs;
178
- _this.code = 6011;
179
- _this.name = "ClaimExpired";
180
- _this.msg = "Claim window expired";
181
- return _this;
124
+ SameAdmin.code = 6010;
125
+ class ClaimExpired extends Error {
126
+ constructor(logs) {
127
+ super("6011: Claim window expired");
128
+ this.logs = logs;
129
+ this.code = 6011;
130
+ this.name = "ClaimExpired";
131
+ this.msg = "Claim window expired";
182
132
  }
183
- ClaimExpired.code = 6011;
184
- return ClaimExpired;
185
- }(Error));
133
+ }
186
134
  exports.ClaimExpired = ClaimExpired;
187
- var ArithmeticError = /** @class */ (function (_super) {
188
- __extends(ArithmeticError, _super);
189
- function ArithmeticError(logs) {
190
- var _this = _super.call(this, "6012: Arithmetic Error (overflow/underflow)") || this;
191
- _this.logs = logs;
192
- _this.code = 6012;
193
- _this.name = "ArithmeticError";
194
- _this.msg = "Arithmetic Error (overflow/underflow)";
195
- return _this;
135
+ ClaimExpired.code = 6011;
136
+ class ArithmeticError extends Error {
137
+ constructor(logs) {
138
+ super("6012: Arithmetic Error (overflow/underflow)");
139
+ this.logs = logs;
140
+ this.code = 6012;
141
+ this.name = "ArithmeticError";
142
+ this.msg = "Arithmetic Error (overflow/underflow)";
196
143
  }
197
- ArithmeticError.code = 6012;
198
- return ArithmeticError;
199
- }(Error));
144
+ }
200
145
  exports.ArithmeticError = ArithmeticError;
201
- var StartTimestampAfterEnd = /** @class */ (function (_super) {
202
- __extends(StartTimestampAfterEnd, _super);
203
- function StartTimestampAfterEnd(logs) {
204
- var _this = _super.call(this, "6013: Start Timestamp cannot be after end Timestamp") || this;
205
- _this.logs = logs;
206
- _this.code = 6013;
207
- _this.name = "StartTimestampAfterEnd";
208
- _this.msg = "Start Timestamp cannot be after end Timestamp";
209
- return _this;
146
+ ArithmeticError.code = 6012;
147
+ class StartTimestampAfterEnd extends Error {
148
+ constructor(logs) {
149
+ super("6013: Start Timestamp cannot be after end Timestamp");
150
+ this.logs = logs;
151
+ this.code = 6013;
152
+ this.name = "StartTimestampAfterEnd";
153
+ this.msg = "Start Timestamp cannot be after end Timestamp";
210
154
  }
211
- StartTimestampAfterEnd.code = 6013;
212
- return StartTimestampAfterEnd;
213
- }(Error));
155
+ }
214
156
  exports.StartTimestampAfterEnd = StartTimestampAfterEnd;
215
- var TimestampsNotInFuture = /** @class */ (function (_super) {
216
- __extends(TimestampsNotInFuture, _super);
217
- function TimestampsNotInFuture(logs) {
218
- var _this = _super.call(this, "6014: Timestamps cannot be in the past") || this;
219
- _this.logs = logs;
220
- _this.code = 6014;
221
- _this.name = "TimestampsNotInFuture";
222
- _this.msg = "Timestamps cannot be in the past";
223
- return _this;
157
+ StartTimestampAfterEnd.code = 6013;
158
+ class TimestampsNotInFuture extends Error {
159
+ constructor(logs) {
160
+ super("6014: Timestamps cannot be in the past");
161
+ this.logs = logs;
162
+ this.code = 6014;
163
+ this.name = "TimestampsNotInFuture";
164
+ this.msg = "Timestamps cannot be in the past";
224
165
  }
225
- TimestampsNotInFuture.code = 6014;
226
- return TimestampsNotInFuture;
227
- }(Error));
166
+ }
228
167
  exports.TimestampsNotInFuture = TimestampsNotInFuture;
229
- var InvalidMint = /** @class */ (function (_super) {
230
- __extends(InvalidMint, _super);
231
- function InvalidMint(logs) {
232
- var _this = _super.call(this, "6015: Invalid Mint") || this;
233
- _this.logs = logs;
234
- _this.code = 6015;
235
- _this.name = "InvalidMint";
236
- _this.msg = "Invalid Mint";
237
- return _this;
168
+ TimestampsNotInFuture.code = 6014;
169
+ class InvalidMint extends Error {
170
+ constructor(logs) {
171
+ super("6015: Invalid Mint");
172
+ this.logs = logs;
173
+ this.code = 6015;
174
+ this.name = "InvalidMint";
175
+ this.msg = "Invalid Mint";
238
176
  }
239
- InvalidMint.code = 6015;
240
- return InvalidMint;
241
- }(Error));
177
+ }
242
178
  exports.InvalidMint = InvalidMint;
243
- var ClaimIsClosed = /** @class */ (function (_super) {
244
- __extends(ClaimIsClosed, _super);
245
- function ClaimIsClosed(logs) {
246
- var _this = _super.call(this, "6016: Claim is closed") || this;
247
- _this.logs = logs;
248
- _this.code = 6016;
249
- _this.name = "ClaimIsClosed";
250
- _this.msg = "Claim is closed";
251
- return _this;
179
+ InvalidMint.code = 6015;
180
+ class ClaimIsClosed extends Error {
181
+ constructor(logs) {
182
+ super("6016: Claim is closed");
183
+ this.logs = logs;
184
+ this.code = 6016;
185
+ this.name = "ClaimIsClosed";
186
+ this.msg = "Claim is closed";
252
187
  }
253
- ClaimIsClosed.code = 6016;
254
- return ClaimIsClosed;
255
- }(Error));
188
+ }
256
189
  exports.ClaimIsClosed = ClaimIsClosed;
257
- var ClaimsAreNotClosable = /** @class */ (function (_super) {
258
- __extends(ClaimsAreNotClosable, _super);
259
- function ClaimsAreNotClosable(logs) {
260
- var _this = _super.call(this, "6017: Claims are not closable") || this;
261
- _this.logs = logs;
262
- _this.code = 6017;
263
- _this.name = "ClaimsAreNotClosable";
264
- _this.msg = "Claims are not closable";
265
- return _this;
190
+ ClaimIsClosed.code = 6016;
191
+ class ClaimsAreNotClosable extends Error {
192
+ constructor(logs) {
193
+ super("6017: Claims are not closable");
194
+ this.logs = logs;
195
+ this.code = 6017;
196
+ this.name = "ClaimsAreNotClosable";
197
+ this.msg = "Claims are not closable";
266
198
  }
267
- ClaimsAreNotClosable.code = 6017;
268
- return ClaimsAreNotClosable;
269
- }(Error));
199
+ }
270
200
  exports.ClaimsAreNotClosable = ClaimsAreNotClosable;
271
- var InvalidUnlockPeriod = /** @class */ (function (_super) {
272
- __extends(InvalidUnlockPeriod, _super);
273
- function InvalidUnlockPeriod(logs) {
274
- var _this = _super.call(this, "6018: Invalid unlock period") || this;
275
- _this.logs = logs;
276
- _this.code = 6018;
277
- _this.name = "InvalidUnlockPeriod";
278
- _this.msg = "Invalid unlock period";
279
- return _this;
201
+ ClaimsAreNotClosable.code = 6017;
202
+ class InvalidUnlockPeriod extends Error {
203
+ constructor(logs) {
204
+ super("6018: Invalid unlock period");
205
+ this.logs = logs;
206
+ this.code = 6018;
207
+ this.name = "InvalidUnlockPeriod";
208
+ this.msg = "Invalid unlock period";
280
209
  }
281
- InvalidUnlockPeriod.code = 6018;
282
- return InvalidUnlockPeriod;
283
- }(Error));
210
+ }
284
211
  exports.InvalidUnlockPeriod = InvalidUnlockPeriod;
212
+ InvalidUnlockPeriod.code = 6018;
285
213
  function fromCode(code, logs) {
286
214
  switch (code) {
287
215
  case 6000:
@@ -22,38 +22,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __values = (this && this.__values) || function(o) {
26
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
27
- if (m) return m.call(o);
28
- if (o && typeof o.length === "number") return {
29
- next: function () {
30
- if (o && i >= o.length) o = void 0;
31
- return { value: o && o[i++], done: !o };
32
- }
33
- };
34
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
35
- };
36
- var __read = (this && this.__read) || function (o, n) {
37
- var m = typeof Symbol === "function" && o[Symbol.iterator];
38
- if (!m) return o;
39
- var i = m.call(o), r, ar = [], e;
40
- try {
41
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
42
- }
43
- catch (error) { e = { error: error }; }
44
- finally {
45
- try {
46
- if (r && !r.done && (m = i["return"])) m.call(i);
47
- }
48
- finally { if (e) throw e.error; }
49
- }
50
- return ar;
51
- };
52
25
  Object.defineProperty(exports, "__esModule", { value: true });
53
26
  exports.fromTxError = exports.fromCode = void 0;
54
- var programId_1 = require("../programId");
55
- var anchor = __importStar(require("./anchor"));
56
- var custom = __importStar(require("./custom"));
27
+ const programId_1 = require("../programId");
28
+ const anchor = __importStar(require("./anchor"));
29
+ const custom = __importStar(require("./custom"));
57
30
  function fromCode(code, logs) {
58
31
  return code >= 6000 ? custom.fromCode(code, logs) : anchor.fromCode(code, logs);
59
32
  }
@@ -61,38 +34,26 @@ exports.fromCode = fromCode;
61
34
  function hasOwnProperty(obj, prop) {
62
35
  return Object.hasOwnProperty.call(obj, prop);
63
36
  }
64
- var errorRe = /Program (\w+) failed: custom program error: (\w+)/;
65
- function fromTxError(err, programId) {
66
- var e_1, _a;
67
- if (programId === void 0) { programId = programId_1.PROGRAM_ID; }
37
+ const errorRe = /Program (\w+) failed: custom program error: (\w+)/;
38
+ function fromTxError(err, programId = programId_1.PROGRAM_ID) {
68
39
  if (typeof err !== "object" || err === null || !hasOwnProperty(err, "logs") || !Array.isArray(err.logs)) {
69
40
  return null;
70
41
  }
71
- var firstMatch = null;
72
- try {
73
- for (var _b = __values(err.logs), _c = _b.next(); !_c.done; _c = _b.next()) {
74
- var logLine = _c.value;
75
- firstMatch = errorRe.exec(logLine);
76
- if (firstMatch !== null) {
77
- break;
78
- }
79
- }
80
- }
81
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
82
- finally {
83
- try {
84
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
42
+ let firstMatch = null;
43
+ for (const logLine of err.logs) {
44
+ firstMatch = errorRe.exec(logLine);
45
+ if (firstMatch !== null) {
46
+ break;
85
47
  }
86
- finally { if (e_1) throw e_1.error; }
87
48
  }
88
49
  if (firstMatch === null) {
89
50
  return null;
90
51
  }
91
- var _d = __read(firstMatch.slice(1), 2), programIdRaw = _d[0], codeRaw = _d[1];
52
+ const [programIdRaw, codeRaw] = firstMatch.slice(1);
92
53
  if (programIdRaw !== programId.toString()) {
93
54
  return null;
94
55
  }
95
- var errorCode;
56
+ let errorCode;
96
57
  try {
97
58
  errorCode = parseInt(codeRaw, 16);
98
59
  }
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.claimLocked = void 0;
4
- var web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
5
- var programId_1 = require("../programId");
6
- function claimLocked(accounts, programId) {
7
- if (programId === void 0) { programId = programId_1.PROGRAM_ID; }
8
- var keys = [
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 = [
9
8
  { pubkey: accounts.distributor, isSigner: false, isWritable: true },
10
9
  { pubkey: accounts.claimStatus, isSigner: false, isWritable: true },
11
10
  { pubkey: accounts.from, isSigner: false, isWritable: true },
@@ -16,9 +15,9 @@ function claimLocked(accounts, programId) {
16
15
  { pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
17
16
  { pubkey: accounts.program, isSigner: false, isWritable: false },
18
17
  ];
19
- var identifier = Buffer.from([34, 206, 181, 23, 11, 207, 147, 90]);
20
- var data = identifier;
21
- var ix = new web3_js_1.TransactionInstruction({ keys: keys, programId: programId, data: data });
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 });
22
21
  return ix;
23
22
  }
24
23
  exports.claimLocked = claimLocked;
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.clawback = void 0;
4
- var web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
5
- var buffer_1 = require("buffer");
6
- var programId_1 = require("../programId");
7
- function clawback(accounts, programId) {
8
- if (programId === void 0) { programId = programId_1.PROGRAM_ID; }
9
- var keys = [
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 = [
10
9
  { pubkey: accounts.distributor, isSigner: false, isWritable: true },
11
10
  { pubkey: accounts.from, isSigner: false, isWritable: true },
12
11
  { pubkey: accounts.to, isSigner: false, isWritable: true },
@@ -15,9 +14,9 @@ function clawback(accounts, programId) {
15
14
  { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
16
15
  { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
17
16
  ];
18
- var identifier = buffer_1.Buffer.from([111, 92, 142, 79, 33, 234, 82, 27]);
19
- var data = identifier;
20
- var ix = new web3_js_1.TransactionInstruction({ keys: keys, programId: programId, data: data });
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 });
21
20
  return ix;
22
21
  }
23
22
  exports.clawback = clawback;
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.closeClaim = void 0;
4
- var web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
5
- var buffer_1 = require("buffer");
6
- var programId_1 = require("../programId");
7
- function closeClaim(accounts, programId) {
8
- if (programId === void 0) { programId = programId_1.PROGRAM_ID; }
9
- var keys = [
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 closeClaim(accounts, programId = programId_1.PROGRAM_ID) {
8
+ const keys = [
10
9
  { pubkey: accounts.distributor, isSigner: false, isWritable: true },
11
10
  { pubkey: accounts.admin, isSigner: true, isWritable: true },
12
11
  { pubkey: accounts.claimant, isSigner: false, isWritable: false },
@@ -15,9 +14,9 @@ function closeClaim(accounts, programId) {
15
14
  { pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
16
15
  { pubkey: accounts.program, isSigner: false, isWritable: false },
17
16
  ];
18
- var identifier = buffer_1.Buffer.from([42, 177, 165, 35, 213, 179, 211, 19]);
19
- var data = identifier;
20
- var ix = new web3_js_1.TransactionInstruction({ keys: keys, programId: programId, data: data });
17
+ const identifier = buffer_1.Buffer.from([42, 177, 165, 35, 213, 179, 211, 19]);
18
+ const data = identifier;
19
+ const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
21
20
  return ix;
22
21
  }
23
22
  exports.closeClaim = closeClaim;