@solfund/idl 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +505 -0
- package/dist/index.d.cts +361 -0
- package/dist/index.d.ts +361 -0
- package/dist/index.js +473 -0
- package/package.json +1 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
var import_node_module = require("node:module");
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
7
|
+
var __toCommonJS = (from) => {
|
|
8
|
+
var entry = __moduleCache.get(from), desc;
|
|
9
|
+
if (entry)
|
|
10
|
+
return entry;
|
|
11
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
13
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
}));
|
|
17
|
+
__moduleCache.set(from, entry);
|
|
18
|
+
return entry;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, {
|
|
23
|
+
get: all[name],
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
set: (newValue) => all[name] = () => newValue
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// index.ts
|
|
31
|
+
var exports_anchor_crowdfunding_idl = {};
|
|
32
|
+
__export(exports_anchor_crowdfunding_idl, {
|
|
33
|
+
IDL: () => anchor_solana_crowdfunding_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(exports_anchor_crowdfunding_idl);
|
|
36
|
+
// anchor_solana_crowdfunding.json
|
|
37
|
+
var anchor_solana_crowdfunding_default = {
|
|
38
|
+
address: "BM4pzjf5fqdeX7cKtRgVARK2PLKBiM4PU2xPZFEZkSff",
|
|
39
|
+
metadata: {
|
|
40
|
+
name: "anchor_solana_crowdfunding",
|
|
41
|
+
version: "0.1.0",
|
|
42
|
+
spec: "0.1.0",
|
|
43
|
+
description: "Created with Anchor"
|
|
44
|
+
},
|
|
45
|
+
instructions: [
|
|
46
|
+
{
|
|
47
|
+
name: "cancel_campaign",
|
|
48
|
+
discriminator: [66, 10, 32, 138, 122, 36, 134, 202],
|
|
49
|
+
accounts: [
|
|
50
|
+
{
|
|
51
|
+
name: "campaign",
|
|
52
|
+
writable: true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "creator",
|
|
56
|
+
signer: true
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
args: []
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "contribute",
|
|
63
|
+
discriminator: [82, 33, 68, 131, 32, 0, 205, 95],
|
|
64
|
+
accounts: [
|
|
65
|
+
{
|
|
66
|
+
name: "campaign",
|
|
67
|
+
writable: true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "contribution",
|
|
71
|
+
writable: true,
|
|
72
|
+
pda: {
|
|
73
|
+
seeds: [
|
|
74
|
+
{
|
|
75
|
+
kind: "const",
|
|
76
|
+
value: [99, 111, 110, 116, 114, 105, 98, 117, 116, 105, 111, 110]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
kind: "account",
|
|
80
|
+
path: "campaign"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
kind: "account",
|
|
84
|
+
path: "contributor"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "contributor",
|
|
91
|
+
writable: true,
|
|
92
|
+
signer: true
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "system_program",
|
|
96
|
+
address: "11111111111111111111111111111111"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
args: [
|
|
100
|
+
{
|
|
101
|
+
name: "amount",
|
|
102
|
+
type: "u64"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "create_campaign",
|
|
108
|
+
discriminator: [111, 131, 187, 98, 160, 193, 114, 244],
|
|
109
|
+
accounts: [
|
|
110
|
+
{
|
|
111
|
+
name: "campaign",
|
|
112
|
+
writable: true,
|
|
113
|
+
pda: {
|
|
114
|
+
seeds: [
|
|
115
|
+
{
|
|
116
|
+
kind: "const",
|
|
117
|
+
value: [99, 97, 109, 112, 97, 105, 103, 110]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
kind: "account",
|
|
121
|
+
path: "creator"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
kind: "arg",
|
|
125
|
+
path: "title"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "creator",
|
|
132
|
+
writable: true,
|
|
133
|
+
signer: true
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "system_program",
|
|
137
|
+
address: "11111111111111111111111111111111"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
args: [
|
|
141
|
+
{
|
|
142
|
+
name: "title",
|
|
143
|
+
type: "string"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "target_amount",
|
|
147
|
+
type: "u64"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "deadline",
|
|
151
|
+
type: "i64"
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "create_contribution",
|
|
157
|
+
discriminator: [239, 215, 102, 103, 123, 112, 178, 68],
|
|
158
|
+
accounts: [
|
|
159
|
+
{
|
|
160
|
+
name: "campaign"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "contribution",
|
|
164
|
+
writable: true,
|
|
165
|
+
pda: {
|
|
166
|
+
seeds: [
|
|
167
|
+
{
|
|
168
|
+
kind: "const",
|
|
169
|
+
value: [99, 111, 110, 116, 114, 105, 98, 117, 116, 105, 111, 110]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
kind: "account",
|
|
173
|
+
path: "campaign"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
kind: "account",
|
|
177
|
+
path: "contributor"
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "contributor",
|
|
184
|
+
writable: true,
|
|
185
|
+
signer: true
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: "system_program",
|
|
189
|
+
address: "11111111111111111111111111111111"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
args: []
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "refund",
|
|
196
|
+
discriminator: [2, 96, 183, 251, 63, 208, 46, 46],
|
|
197
|
+
accounts: [
|
|
198
|
+
{
|
|
199
|
+
name: "campaign",
|
|
200
|
+
writable: true
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "contribution",
|
|
204
|
+
writable: true
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "contributor",
|
|
208
|
+
writable: true,
|
|
209
|
+
signer: true
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
args: []
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: "withdraw",
|
|
216
|
+
discriminator: [183, 18, 70, 156, 148, 109, 161, 34],
|
|
217
|
+
accounts: [
|
|
218
|
+
{
|
|
219
|
+
name: "campaign",
|
|
220
|
+
writable: true
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "creator",
|
|
224
|
+
writable: true,
|
|
225
|
+
signer: true
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
args: []
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
accounts: [
|
|
232
|
+
{
|
|
233
|
+
name: "Campaign",
|
|
234
|
+
discriminator: [50, 40, 49, 11, 157, 220, 229, 192]
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: "Contribution",
|
|
238
|
+
discriminator: [182, 187, 14, 111, 72, 167, 242, 212]
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
events: [
|
|
242
|
+
{
|
|
243
|
+
name: "CampaignCancelled",
|
|
244
|
+
discriminator: [121, 171, 21, 55, 56, 234, 121, 44]
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: "CampaignCreated",
|
|
248
|
+
discriminator: [9, 98, 69, 61, 53, 131, 64, 152]
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: "ContributionMade",
|
|
252
|
+
discriminator: [81, 218, 72, 109, 93, 96, 131, 199]
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: "FundsWithdrawn",
|
|
256
|
+
discriminator: [56, 130, 230, 154, 35, 92, 11, 118]
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: "RefundIssued",
|
|
260
|
+
discriminator: [249, 16, 159, 159, 93, 186, 145, 206]
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
errors: [
|
|
264
|
+
{
|
|
265
|
+
code: 6000,
|
|
266
|
+
name: "TitleTooLong",
|
|
267
|
+
msg: "Title exceeds maximum length of 100 characters"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
code: 6001,
|
|
271
|
+
name: "InvalidAmount",
|
|
272
|
+
msg: "Amount must be greater than zero"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
code: 6002,
|
|
276
|
+
name: "InvalidDeadline",
|
|
277
|
+
msg: "Deadline must be in the future"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
code: 6003,
|
|
281
|
+
name: "CampaignNotActive",
|
|
282
|
+
msg: "Campaign is not active"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
code: 6004,
|
|
286
|
+
name: "CampaignEnded",
|
|
287
|
+
msg: "Campaign has already ended"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
code: 6005,
|
|
291
|
+
name: "CampaignNotEnded",
|
|
292
|
+
msg: "Campaign has not ended yet"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
code: 6006,
|
|
296
|
+
name: "AlreadyWithdrawn",
|
|
297
|
+
msg: "Funds have already been withdrawn"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
code: 6007,
|
|
301
|
+
name: "TargetNotReached",
|
|
302
|
+
msg: "Target amount not reached"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
code: 6008,
|
|
306
|
+
name: "TargetReached",
|
|
307
|
+
msg: "Target amount has been reached, no refunds available"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
code: 6009,
|
|
311
|
+
name: "AlreadyRefunded",
|
|
312
|
+
msg: "Contribution has already been refunded"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
code: 6010,
|
|
316
|
+
name: "Unauthorized",
|
|
317
|
+
msg: "Unauthorized action"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
code: 6011,
|
|
321
|
+
name: "Overflow",
|
|
322
|
+
msg: "Numerical overflow occurred"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
code: 6012,
|
|
326
|
+
name: "CampaignHasContributions",
|
|
327
|
+
msg: "Cannot cancel campaign with existing contributions"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
code: 6013,
|
|
331
|
+
name: "InsufficientFunds",
|
|
332
|
+
msg: "Insufficient funds in account"
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
types: [
|
|
336
|
+
{
|
|
337
|
+
name: "Campaign",
|
|
338
|
+
type: {
|
|
339
|
+
kind: "struct",
|
|
340
|
+
fields: [
|
|
341
|
+
{
|
|
342
|
+
name: "creator",
|
|
343
|
+
type: "pubkey"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
name: "title",
|
|
347
|
+
type: "string"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: "target_amount",
|
|
351
|
+
type: "u64"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: "amount_raised",
|
|
355
|
+
type: "u64"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
name: "deadline",
|
|
359
|
+
type: "i64"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
name: "is_active",
|
|
363
|
+
type: "bool"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
name: "withdrawn",
|
|
367
|
+
type: "bool"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
name: "bump",
|
|
371
|
+
type: "u8"
|
|
372
|
+
}
|
|
373
|
+
]
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: "CampaignCancelled",
|
|
378
|
+
type: {
|
|
379
|
+
kind: "struct",
|
|
380
|
+
fields: [
|
|
381
|
+
{
|
|
382
|
+
name: "campaign",
|
|
383
|
+
type: "pubkey"
|
|
384
|
+
}
|
|
385
|
+
]
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
name: "CampaignCreated",
|
|
390
|
+
type: {
|
|
391
|
+
kind: "struct",
|
|
392
|
+
fields: [
|
|
393
|
+
{
|
|
394
|
+
name: "campaign",
|
|
395
|
+
type: "pubkey"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: "creator",
|
|
399
|
+
type: "pubkey"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: "target_amount",
|
|
403
|
+
type: "u64"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
name: "deadline",
|
|
407
|
+
type: "i64"
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
name: "Contribution",
|
|
414
|
+
type: {
|
|
415
|
+
kind: "struct",
|
|
416
|
+
fields: [
|
|
417
|
+
{
|
|
418
|
+
name: "campaign",
|
|
419
|
+
type: "pubkey"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
name: "contributor",
|
|
423
|
+
type: "pubkey"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: "amount",
|
|
427
|
+
type: "u64"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
name: "refunded",
|
|
431
|
+
type: "bool"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
name: "bump",
|
|
435
|
+
type: "u8"
|
|
436
|
+
}
|
|
437
|
+
]
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: "ContributionMade",
|
|
442
|
+
type: {
|
|
443
|
+
kind: "struct",
|
|
444
|
+
fields: [
|
|
445
|
+
{
|
|
446
|
+
name: "campaign",
|
|
447
|
+
type: "pubkey"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: "contributor",
|
|
451
|
+
type: "pubkey"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
name: "amount",
|
|
455
|
+
type: "u64"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
name: "total_raised",
|
|
459
|
+
type: "u64"
|
|
460
|
+
}
|
|
461
|
+
]
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
name: "FundsWithdrawn",
|
|
466
|
+
type: {
|
|
467
|
+
kind: "struct",
|
|
468
|
+
fields: [
|
|
469
|
+
{
|
|
470
|
+
name: "campaign",
|
|
471
|
+
type: "pubkey"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
name: "creator",
|
|
475
|
+
type: "pubkey"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
name: "amount",
|
|
479
|
+
type: "u64"
|
|
480
|
+
}
|
|
481
|
+
]
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
name: "RefundIssued",
|
|
486
|
+
type: {
|
|
487
|
+
kind: "struct",
|
|
488
|
+
fields: [
|
|
489
|
+
{
|
|
490
|
+
name: "campaign",
|
|
491
|
+
type: "pubkey"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
name: "contributor",
|
|
495
|
+
type: "pubkey"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
name: "amount",
|
|
499
|
+
type: "u64"
|
|
500
|
+
}
|
|
501
|
+
]
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
]
|
|
505
|
+
};
|