@solana/subscriptions 0.5.0-beta.1 → 0.6.0-beta.1
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 +2 -0
- package/dist/index.cjs +1796 -840
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +910 -397
- package/dist/index.d.ts +910 -397
- package/dist/index.js +1671 -660
- package/dist/index.js.map +1 -1
- package/package.json +15 -17
package/dist/index.js
CHANGED
|
@@ -14,11 +14,15 @@ import {
|
|
|
14
14
|
} from "@solana/kit";
|
|
15
15
|
|
|
16
16
|
// src/generated/pdas/eventAuthority.ts
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
getProgramDerivedAddress,
|
|
19
|
+
getUtf8Encoder
|
|
20
|
+
} from "@solana/kit";
|
|
18
21
|
async function findEventAuthorityPda(config = {}) {
|
|
19
22
|
const {
|
|
20
|
-
programAddress = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
23
|
+
programAddress: programAddressInput = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
21
24
|
} = config;
|
|
25
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
22
26
|
return await getProgramDerivedAddress({ programAddress, seeds: [getUtf8Encoder().encode("event_authority")] });
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -31,8 +35,9 @@ import {
|
|
|
31
35
|
} from "@solana/kit";
|
|
32
36
|
async function findFixedDelegationPda(seeds, config = {}) {
|
|
33
37
|
const {
|
|
34
|
-
programAddress = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
38
|
+
programAddress: programAddressInput = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
35
39
|
} = config;
|
|
40
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
36
41
|
return await getProgramDerivedAddress2({
|
|
37
42
|
programAddress,
|
|
38
43
|
seeds: [
|
|
@@ -54,8 +59,9 @@ import {
|
|
|
54
59
|
} from "@solana/kit";
|
|
55
60
|
async function findPlanPda(seeds, config = {}) {
|
|
56
61
|
const {
|
|
57
|
-
programAddress = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
62
|
+
programAddress: programAddressInput = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
58
63
|
} = config;
|
|
64
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
59
65
|
return await getProgramDerivedAddress3({
|
|
60
66
|
programAddress,
|
|
61
67
|
seeds: [
|
|
@@ -75,8 +81,9 @@ import {
|
|
|
75
81
|
} from "@solana/kit";
|
|
76
82
|
async function findRecurringDelegationPda(seeds, config = {}) {
|
|
77
83
|
const {
|
|
78
|
-
programAddress = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
84
|
+
programAddress: programAddressInput = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
79
85
|
} = config;
|
|
86
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
80
87
|
return await getProgramDerivedAddress4({
|
|
81
88
|
programAddress,
|
|
82
89
|
seeds: [
|
|
@@ -97,8 +104,9 @@ import {
|
|
|
97
104
|
} from "@solana/kit";
|
|
98
105
|
async function findSubscriptionAuthorityPda(seeds, config = {}) {
|
|
99
106
|
const {
|
|
100
|
-
programAddress = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
107
|
+
programAddress: programAddressInput = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
101
108
|
} = config;
|
|
109
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
102
110
|
return await getProgramDerivedAddress5({
|
|
103
111
|
programAddress,
|
|
104
112
|
seeds: [
|
|
@@ -117,8 +125,9 @@ import {
|
|
|
117
125
|
} from "@solana/kit";
|
|
118
126
|
async function findSubscriptionDelegationPda(seeds, config = {}) {
|
|
119
127
|
const {
|
|
120
|
-
programAddress = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
128
|
+
programAddress: programAddressInput = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
121
129
|
} = config;
|
|
130
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
122
131
|
return await getProgramDerivedAddress6({
|
|
123
132
|
programAddress,
|
|
124
133
|
seeds: [
|
|
@@ -129,6 +138,23 @@ async function findSubscriptionDelegationPda(seeds, config = {}) {
|
|
|
129
138
|
});
|
|
130
139
|
}
|
|
131
140
|
|
|
141
|
+
// src/generated/pdas/transferContext.ts
|
|
142
|
+
import {
|
|
143
|
+
getAddressEncoder as getAddressEncoder6,
|
|
144
|
+
getProgramDerivedAddress as getProgramDerivedAddress7,
|
|
145
|
+
getUtf8Encoder as getUtf8Encoder7
|
|
146
|
+
} from "@solana/kit";
|
|
147
|
+
async function findTransferContextPda(seeds, config = {}) {
|
|
148
|
+
const {
|
|
149
|
+
programAddress: programAddressInput = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44"
|
|
150
|
+
} = config;
|
|
151
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
152
|
+
return await getProgramDerivedAddress7({
|
|
153
|
+
programAddress,
|
|
154
|
+
seeds: [getUtf8Encoder7().encode("TransferContext"), getAddressEncoder6().encode(seeds.subscriptionAuthority)]
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
132
158
|
// src/generated/accounts/eventAuthority.ts
|
|
133
159
|
function getEventAuthorityEncoder() {
|
|
134
160
|
return getStructEncoder([]);
|
|
@@ -148,7 +174,11 @@ async function fetchEventAuthority(rpc, address, config) {
|
|
|
148
174
|
return maybeAccount;
|
|
149
175
|
}
|
|
150
176
|
async function fetchMaybeEventAuthority(rpc, address, config) {
|
|
151
|
-
const maybeAccount = await fetchEncodedAccount(
|
|
177
|
+
const maybeAccount = await fetchEncodedAccount(
|
|
178
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
179
|
+
typeof address === "string" ? address : address.address,
|
|
180
|
+
config
|
|
181
|
+
);
|
|
152
182
|
return decodeEventAuthority(maybeAccount);
|
|
153
183
|
}
|
|
154
184
|
async function fetchAllEventAuthority(rpc, addresses, config) {
|
|
@@ -157,7 +187,11 @@ async function fetchAllEventAuthority(rpc, addresses, config) {
|
|
|
157
187
|
return maybeAccounts;
|
|
158
188
|
}
|
|
159
189
|
async function fetchAllMaybeEventAuthority(rpc, addresses, config) {
|
|
160
|
-
const maybeAccounts = await fetchEncodedAccounts(
|
|
190
|
+
const maybeAccounts = await fetchEncodedAccounts(
|
|
191
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
192
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
193
|
+
config
|
|
194
|
+
);
|
|
161
195
|
return maybeAccounts.map((maybeAccount) => decodeEventAuthority(maybeAccount));
|
|
162
196
|
}
|
|
163
197
|
async function fetchEventAuthorityFromSeeds(rpc, config = {}) {
|
|
@@ -180,7 +214,7 @@ import {
|
|
|
180
214
|
fetchEncodedAccount as fetchEncodedAccount2,
|
|
181
215
|
fetchEncodedAccounts as fetchEncodedAccounts2,
|
|
182
216
|
getAddressDecoder as getAddressDecoder6,
|
|
183
|
-
getAddressEncoder as
|
|
217
|
+
getAddressEncoder as getAddressEncoder12,
|
|
184
218
|
getI64Decoder as getI64Decoder10,
|
|
185
219
|
getI64Encoder as getI64Encoder10,
|
|
186
220
|
getStructDecoder as getStructDecoder12,
|
|
@@ -201,6 +235,7 @@ var AccountDiscriminator = /* @__PURE__ */ ((AccountDiscriminator2) => {
|
|
|
201
235
|
AccountDiscriminator2[AccountDiscriminator2["FixedDelegation"] = 2] = "FixedDelegation";
|
|
202
236
|
AccountDiscriminator2[AccountDiscriminator2["RecurringDelegation"] = 3] = "RecurringDelegation";
|
|
203
237
|
AccountDiscriminator2[AccountDiscriminator2["SubscriptionDelegation"] = 4] = "SubscriptionDelegation";
|
|
238
|
+
AccountDiscriminator2[AccountDiscriminator2["TransferContext"] = 5] = "TransferContext";
|
|
204
239
|
return AccountDiscriminator2;
|
|
205
240
|
})(AccountDiscriminator || {});
|
|
206
241
|
function getAccountDiscriminatorEncoder() {
|
|
@@ -299,7 +334,7 @@ function getCreateRecurringDelegationDataCodec() {
|
|
|
299
334
|
import {
|
|
300
335
|
combineCodec as combineCodec6,
|
|
301
336
|
getAddressDecoder,
|
|
302
|
-
getAddressEncoder as
|
|
337
|
+
getAddressEncoder as getAddressEncoder7,
|
|
303
338
|
getI64Decoder as getI64Decoder4,
|
|
304
339
|
getI64Encoder as getI64Encoder4,
|
|
305
340
|
getStructDecoder as getStructDecoder5,
|
|
@@ -312,9 +347,9 @@ function getHeaderEncoder() {
|
|
|
312
347
|
["discriminator", getU8Encoder()],
|
|
313
348
|
["version", getU8Encoder()],
|
|
314
349
|
["bump", getU8Encoder()],
|
|
315
|
-
["delegator",
|
|
316
|
-
["delegatee",
|
|
317
|
-
["payer",
|
|
350
|
+
["delegator", getAddressEncoder7()],
|
|
351
|
+
["delegatee", getAddressEncoder7()],
|
|
352
|
+
["payer", getAddressEncoder7()],
|
|
318
353
|
["initId", getI64Encoder4()]
|
|
319
354
|
]);
|
|
320
355
|
}
|
|
@@ -339,7 +374,7 @@ import {
|
|
|
339
374
|
fixDecoderSize,
|
|
340
375
|
fixEncoderSize,
|
|
341
376
|
getAddressDecoder as getAddressDecoder2,
|
|
342
|
-
getAddressEncoder as
|
|
377
|
+
getAddressEncoder as getAddressEncoder8,
|
|
343
378
|
getArrayDecoder,
|
|
344
379
|
getArrayEncoder,
|
|
345
380
|
getI64Decoder as getI64Decoder5,
|
|
@@ -349,17 +384,17 @@ import {
|
|
|
349
384
|
getU64Decoder as getU64Decoder3,
|
|
350
385
|
getU64Encoder as getU64Encoder6,
|
|
351
386
|
getUtf8Decoder,
|
|
352
|
-
getUtf8Encoder as
|
|
387
|
+
getUtf8Encoder as getUtf8Encoder8
|
|
353
388
|
} from "@solana/kit";
|
|
354
389
|
function getPlanDataEncoder() {
|
|
355
390
|
return getStructEncoder6([
|
|
356
391
|
["planId", getU64Encoder6()],
|
|
357
|
-
["mint",
|
|
392
|
+
["mint", getAddressEncoder8()],
|
|
358
393
|
["terms", getPlanTermsEncoder()],
|
|
359
394
|
["endTs", getI64Encoder5()],
|
|
360
|
-
["destinations", getArrayEncoder(
|
|
361
|
-
["pullers", getArrayEncoder(
|
|
362
|
-
["metadataUri", fixEncoderSize(
|
|
395
|
+
["destinations", getArrayEncoder(getAddressEncoder8(), { size: 4 })],
|
|
396
|
+
["pullers", getArrayEncoder(getAddressEncoder8(), { size: 4 })],
|
|
397
|
+
["metadataUri", fixEncoderSize(getUtf8Encoder8(), 128)]
|
|
363
398
|
]);
|
|
364
399
|
}
|
|
365
400
|
function getPlanDataDecoder() {
|
|
@@ -448,7 +483,7 @@ function getResumeDataCodec() {
|
|
|
448
483
|
import {
|
|
449
484
|
combineCodec as combineCodec11,
|
|
450
485
|
getAddressDecoder as getAddressDecoder3,
|
|
451
|
-
getAddressEncoder as
|
|
486
|
+
getAddressEncoder as getAddressEncoder9,
|
|
452
487
|
getI64Decoder as getI64Decoder8,
|
|
453
488
|
getI64Encoder as getI64Encoder8,
|
|
454
489
|
getStructDecoder as getStructDecoder9,
|
|
@@ -462,7 +497,7 @@ function getSubscribeDataEncoder() {
|
|
|
462
497
|
return getStructEncoder9([
|
|
463
498
|
["planId", getU64Encoder8()],
|
|
464
499
|
["planBump", getU8Encoder2()],
|
|
465
|
-
["expectedMint",
|
|
500
|
+
["expectedMint", getAddressEncoder9()],
|
|
466
501
|
["expectedAmount", getU64Encoder8()],
|
|
467
502
|
["expectedPeriodHours", getU64Encoder8()],
|
|
468
503
|
["expectedCreatedAt", getI64Encoder8()],
|
|
@@ -488,7 +523,7 @@ function getSubscribeDataCodec() {
|
|
|
488
523
|
import {
|
|
489
524
|
combineCodec as combineCodec12,
|
|
490
525
|
getAddressDecoder as getAddressDecoder4,
|
|
491
|
-
getAddressEncoder as
|
|
526
|
+
getAddressEncoder as getAddressEncoder10,
|
|
492
527
|
getStructDecoder as getStructDecoder10,
|
|
493
528
|
getStructEncoder as getStructEncoder10,
|
|
494
529
|
getU64Decoder as getU64Decoder6,
|
|
@@ -497,8 +532,8 @@ import {
|
|
|
497
532
|
function getTransferDataEncoder() {
|
|
498
533
|
return getStructEncoder10([
|
|
499
534
|
["amount", getU64Encoder9()],
|
|
500
|
-
["delegator",
|
|
501
|
-
["mint",
|
|
535
|
+
["delegator", getAddressEncoder10()],
|
|
536
|
+
["mint", getAddressEncoder10()]
|
|
502
537
|
]);
|
|
503
538
|
}
|
|
504
539
|
function getTransferDataDecoder() {
|
|
@@ -518,7 +553,7 @@ import {
|
|
|
518
553
|
fixDecoderSize as fixDecoderSize2,
|
|
519
554
|
fixEncoderSize as fixEncoderSize2,
|
|
520
555
|
getAddressDecoder as getAddressDecoder5,
|
|
521
|
-
getAddressEncoder as
|
|
556
|
+
getAddressEncoder as getAddressEncoder11,
|
|
522
557
|
getArrayDecoder as getArrayDecoder2,
|
|
523
558
|
getArrayEncoder as getArrayEncoder2,
|
|
524
559
|
getI64Decoder as getI64Decoder9,
|
|
@@ -528,18 +563,18 @@ import {
|
|
|
528
563
|
getU8Decoder as getU8Decoder3,
|
|
529
564
|
getU8Encoder as getU8Encoder3,
|
|
530
565
|
getUtf8Decoder as getUtf8Decoder2,
|
|
531
|
-
getUtf8Encoder as
|
|
566
|
+
getUtf8Encoder as getUtf8Encoder9
|
|
532
567
|
} from "@solana/kit";
|
|
533
568
|
function getUpdatePlanDataEncoder() {
|
|
534
569
|
return getStructEncoder11([
|
|
535
570
|
["status", getU8Encoder3()],
|
|
536
571
|
["endTs", getI64Encoder9()],
|
|
537
|
-
["pullers", getArrayEncoder2(
|
|
538
|
-
["metadataUri", fixEncoderSize2(
|
|
572
|
+
["pullers", getArrayEncoder2(getAddressEncoder11(), { size: 4 })],
|
|
573
|
+
["metadataUri", fixEncoderSize2(getUtf8Encoder9(), 128)],
|
|
539
574
|
["expectedCreatedAt", getI64Encoder9()],
|
|
540
575
|
["expectedEndTs", getI64Encoder9()],
|
|
541
|
-
["expectedPullers", getArrayEncoder2(
|
|
542
|
-
["expectedMetadataUri", fixEncoderSize2(
|
|
576
|
+
["expectedPullers", getArrayEncoder2(getAddressEncoder11(), { size: 4 })],
|
|
577
|
+
["expectedMetadataUri", fixEncoderSize2(getUtf8Encoder9(), 128)]
|
|
543
578
|
]);
|
|
544
579
|
}
|
|
545
580
|
function getUpdatePlanDataDecoder() {
|
|
@@ -562,8 +597,8 @@ function getUpdatePlanDataCodec() {
|
|
|
562
597
|
function getFixedDelegationEncoder() {
|
|
563
598
|
return getStructEncoder12([
|
|
564
599
|
["header", getHeaderEncoder()],
|
|
565
|
-
["subscriptionAuthority",
|
|
566
|
-
["mint",
|
|
600
|
+
["subscriptionAuthority", getAddressEncoder12()],
|
|
601
|
+
["mint", getAddressEncoder12()],
|
|
567
602
|
["amount", getU64Encoder10()],
|
|
568
603
|
["expiryTs", getI64Encoder10()]
|
|
569
604
|
]);
|
|
@@ -589,7 +624,11 @@ async function fetchFixedDelegation(rpc, address, config) {
|
|
|
589
624
|
return maybeAccount;
|
|
590
625
|
}
|
|
591
626
|
async function fetchMaybeFixedDelegation(rpc, address, config) {
|
|
592
|
-
const maybeAccount = await fetchEncodedAccount2(
|
|
627
|
+
const maybeAccount = await fetchEncodedAccount2(
|
|
628
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
629
|
+
typeof address === "string" ? address : address.address,
|
|
630
|
+
config
|
|
631
|
+
);
|
|
593
632
|
return decodeFixedDelegation(maybeAccount);
|
|
594
633
|
}
|
|
595
634
|
async function fetchAllFixedDelegation(rpc, addresses, config) {
|
|
@@ -598,7 +637,11 @@ async function fetchAllFixedDelegation(rpc, addresses, config) {
|
|
|
598
637
|
return maybeAccounts;
|
|
599
638
|
}
|
|
600
639
|
async function fetchAllMaybeFixedDelegation(rpc, addresses, config) {
|
|
601
|
-
const maybeAccounts = await fetchEncodedAccounts2(
|
|
640
|
+
const maybeAccounts = await fetchEncodedAccounts2(
|
|
641
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
642
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
643
|
+
config
|
|
644
|
+
);
|
|
602
645
|
return maybeAccounts.map((maybeAccount) => decodeFixedDelegation(maybeAccount));
|
|
603
646
|
}
|
|
604
647
|
async function fetchFixedDelegationFromSeeds(rpc, seeds, config = {}) {
|
|
@@ -621,7 +664,7 @@ import {
|
|
|
621
664
|
fetchEncodedAccount as fetchEncodedAccount3,
|
|
622
665
|
fetchEncodedAccounts as fetchEncodedAccounts3,
|
|
623
666
|
getAddressDecoder as getAddressDecoder7,
|
|
624
|
-
getAddressEncoder as
|
|
667
|
+
getAddressEncoder as getAddressEncoder13,
|
|
625
668
|
getStructDecoder as getStructDecoder13,
|
|
626
669
|
getStructEncoder as getStructEncoder13,
|
|
627
670
|
getU8Decoder as getU8Decoder4,
|
|
@@ -630,7 +673,7 @@ import {
|
|
|
630
673
|
function getPlanEncoder() {
|
|
631
674
|
return getStructEncoder13([
|
|
632
675
|
["discriminator", getU8Encoder4()],
|
|
633
|
-
["owner",
|
|
676
|
+
["owner", getAddressEncoder13()],
|
|
634
677
|
["bump", getU8Encoder4()],
|
|
635
678
|
["status", getU8Encoder4()],
|
|
636
679
|
["data", getPlanDataEncoder()]
|
|
@@ -657,7 +700,11 @@ async function fetchPlan(rpc, address, config) {
|
|
|
657
700
|
return maybeAccount;
|
|
658
701
|
}
|
|
659
702
|
async function fetchMaybePlan(rpc, address, config) {
|
|
660
|
-
const maybeAccount = await fetchEncodedAccount3(
|
|
703
|
+
const maybeAccount = await fetchEncodedAccount3(
|
|
704
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
705
|
+
typeof address === "string" ? address : address.address,
|
|
706
|
+
config
|
|
707
|
+
);
|
|
661
708
|
return decodePlan(maybeAccount);
|
|
662
709
|
}
|
|
663
710
|
async function fetchAllPlan(rpc, addresses, config) {
|
|
@@ -666,7 +713,11 @@ async function fetchAllPlan(rpc, addresses, config) {
|
|
|
666
713
|
return maybeAccounts;
|
|
667
714
|
}
|
|
668
715
|
async function fetchAllMaybePlan(rpc, addresses, config) {
|
|
669
|
-
const maybeAccounts = await fetchEncodedAccounts3(
|
|
716
|
+
const maybeAccounts = await fetchEncodedAccounts3(
|
|
717
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
718
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
719
|
+
config
|
|
720
|
+
);
|
|
670
721
|
return maybeAccounts.map((maybeAccount) => decodePlan(maybeAccount));
|
|
671
722
|
}
|
|
672
723
|
async function fetchPlanFromSeeds(rpc, seeds, config = {}) {
|
|
@@ -689,7 +740,7 @@ import {
|
|
|
689
740
|
fetchEncodedAccount as fetchEncodedAccount4,
|
|
690
741
|
fetchEncodedAccounts as fetchEncodedAccounts4,
|
|
691
742
|
getAddressDecoder as getAddressDecoder8,
|
|
692
|
-
getAddressEncoder as
|
|
743
|
+
getAddressEncoder as getAddressEncoder14,
|
|
693
744
|
getI64Decoder as getI64Decoder11,
|
|
694
745
|
getI64Encoder as getI64Encoder11,
|
|
695
746
|
getStructDecoder as getStructDecoder14,
|
|
@@ -700,8 +751,8 @@ import {
|
|
|
700
751
|
function getRecurringDelegationEncoder() {
|
|
701
752
|
return getStructEncoder14([
|
|
702
753
|
["header", getHeaderEncoder()],
|
|
703
|
-
["subscriptionAuthority",
|
|
704
|
-
["mint",
|
|
754
|
+
["subscriptionAuthority", getAddressEncoder14()],
|
|
755
|
+
["mint", getAddressEncoder14()],
|
|
705
756
|
["currentPeriodStartTs", getI64Encoder11()],
|
|
706
757
|
["periodLengthS", getU64Encoder11()],
|
|
707
758
|
["expiryTs", getI64Encoder11()],
|
|
@@ -733,7 +784,11 @@ async function fetchRecurringDelegation(rpc, address, config) {
|
|
|
733
784
|
return maybeAccount;
|
|
734
785
|
}
|
|
735
786
|
async function fetchMaybeRecurringDelegation(rpc, address, config) {
|
|
736
|
-
const maybeAccount = await fetchEncodedAccount4(
|
|
787
|
+
const maybeAccount = await fetchEncodedAccount4(
|
|
788
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
789
|
+
typeof address === "string" ? address : address.address,
|
|
790
|
+
config
|
|
791
|
+
);
|
|
737
792
|
return decodeRecurringDelegation(maybeAccount);
|
|
738
793
|
}
|
|
739
794
|
async function fetchAllRecurringDelegation(rpc, addresses, config) {
|
|
@@ -742,7 +797,11 @@ async function fetchAllRecurringDelegation(rpc, addresses, config) {
|
|
|
742
797
|
return maybeAccounts;
|
|
743
798
|
}
|
|
744
799
|
async function fetchAllMaybeRecurringDelegation(rpc, addresses, config) {
|
|
745
|
-
const maybeAccounts = await fetchEncodedAccounts4(
|
|
800
|
+
const maybeAccounts = await fetchEncodedAccounts4(
|
|
801
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
802
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
803
|
+
config
|
|
804
|
+
);
|
|
746
805
|
return maybeAccounts.map((maybeAccount) => decodeRecurringDelegation(maybeAccount));
|
|
747
806
|
}
|
|
748
807
|
async function fetchRecurringDelegationFromSeeds(rpc, seeds, config = {}) {
|
|
@@ -765,7 +824,7 @@ import {
|
|
|
765
824
|
fetchEncodedAccount as fetchEncodedAccount5,
|
|
766
825
|
fetchEncodedAccounts as fetchEncodedAccounts5,
|
|
767
826
|
getAddressDecoder as getAddressDecoder9,
|
|
768
|
-
getAddressEncoder as
|
|
827
|
+
getAddressEncoder as getAddressEncoder15,
|
|
769
828
|
getI64Decoder as getI64Decoder12,
|
|
770
829
|
getI64Encoder as getI64Encoder12,
|
|
771
830
|
getStructDecoder as getStructDecoder15,
|
|
@@ -776,9 +835,9 @@ import {
|
|
|
776
835
|
function getSubscriptionAuthorityEncoder() {
|
|
777
836
|
return getStructEncoder15([
|
|
778
837
|
["discriminator", getU8Encoder5()],
|
|
779
|
-
["user",
|
|
780
|
-
["tokenMint",
|
|
781
|
-
["payer",
|
|
838
|
+
["user", getAddressEncoder15()],
|
|
839
|
+
["tokenMint", getAddressEncoder15()],
|
|
840
|
+
["payer", getAddressEncoder15()],
|
|
782
841
|
["bump", getU8Encoder5()],
|
|
783
842
|
["initId", getI64Encoder12()]
|
|
784
843
|
]);
|
|
@@ -805,7 +864,11 @@ async function fetchSubscriptionAuthority(rpc, address, config) {
|
|
|
805
864
|
return maybeAccount;
|
|
806
865
|
}
|
|
807
866
|
async function fetchMaybeSubscriptionAuthority(rpc, address, config) {
|
|
808
|
-
const maybeAccount = await fetchEncodedAccount5(
|
|
867
|
+
const maybeAccount = await fetchEncodedAccount5(
|
|
868
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
869
|
+
typeof address === "string" ? address : address.address,
|
|
870
|
+
config
|
|
871
|
+
);
|
|
809
872
|
return decodeSubscriptionAuthority(maybeAccount);
|
|
810
873
|
}
|
|
811
874
|
async function fetchAllSubscriptionAuthority(rpc, addresses, config) {
|
|
@@ -814,7 +877,11 @@ async function fetchAllSubscriptionAuthority(rpc, addresses, config) {
|
|
|
814
877
|
return maybeAccounts;
|
|
815
878
|
}
|
|
816
879
|
async function fetchAllMaybeSubscriptionAuthority(rpc, addresses, config) {
|
|
817
|
-
const maybeAccounts = await fetchEncodedAccounts5(
|
|
880
|
+
const maybeAccounts = await fetchEncodedAccounts5(
|
|
881
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
882
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
883
|
+
config
|
|
884
|
+
);
|
|
818
885
|
return maybeAccounts.map((maybeAccount) => decodeSubscriptionAuthority(maybeAccount));
|
|
819
886
|
}
|
|
820
887
|
async function fetchSubscriptionAuthorityFromSeeds(rpc, seeds, config = {}) {
|
|
@@ -873,7 +940,11 @@ async function fetchSubscriptionDelegation(rpc, address, config) {
|
|
|
873
940
|
return maybeAccount;
|
|
874
941
|
}
|
|
875
942
|
async function fetchMaybeSubscriptionDelegation(rpc, address, config) {
|
|
876
|
-
const maybeAccount = await fetchEncodedAccount6(
|
|
943
|
+
const maybeAccount = await fetchEncodedAccount6(
|
|
944
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
945
|
+
typeof address === "string" ? address : address.address,
|
|
946
|
+
config
|
|
947
|
+
);
|
|
877
948
|
return decodeSubscriptionDelegation(maybeAccount);
|
|
878
949
|
}
|
|
879
950
|
async function fetchAllSubscriptionDelegation(rpc, addresses, config) {
|
|
@@ -882,7 +953,11 @@ async function fetchAllSubscriptionDelegation(rpc, addresses, config) {
|
|
|
882
953
|
return maybeAccounts;
|
|
883
954
|
}
|
|
884
955
|
async function fetchAllMaybeSubscriptionDelegation(rpc, addresses, config) {
|
|
885
|
-
const maybeAccounts = await fetchEncodedAccounts6(
|
|
956
|
+
const maybeAccounts = await fetchEncodedAccounts6(
|
|
957
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
958
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
959
|
+
config
|
|
960
|
+
);
|
|
886
961
|
return maybeAccounts.map((maybeAccount) => decodeSubscriptionDelegation(maybeAccount));
|
|
887
962
|
}
|
|
888
963
|
async function fetchSubscriptionDelegationFromSeeds(rpc, seeds, config = {}) {
|
|
@@ -896,6 +971,82 @@ async function fetchMaybeSubscriptionDelegationFromSeeds(rpc, seeds, config = {}
|
|
|
896
971
|
return await fetchMaybeSubscriptionDelegation(rpc, address, fetchConfig);
|
|
897
972
|
}
|
|
898
973
|
|
|
974
|
+
// src/generated/accounts/transferContext.ts
|
|
975
|
+
import {
|
|
976
|
+
assertAccountExists as assertAccountExists7,
|
|
977
|
+
assertAccountsExist as assertAccountsExist7,
|
|
978
|
+
combineCodec as combineCodec19,
|
|
979
|
+
decodeAccount as decodeAccount7,
|
|
980
|
+
fetchEncodedAccount as fetchEncodedAccount7,
|
|
981
|
+
fetchEncodedAccounts as fetchEncodedAccounts7,
|
|
982
|
+
getAddressDecoder as getAddressDecoder10,
|
|
983
|
+
getAddressEncoder as getAddressEncoder16,
|
|
984
|
+
getStructDecoder as getStructDecoder17,
|
|
985
|
+
getStructEncoder as getStructEncoder17,
|
|
986
|
+
getU8Decoder as getU8Decoder6,
|
|
987
|
+
getU8Encoder as getU8Encoder6
|
|
988
|
+
} from "@solana/kit";
|
|
989
|
+
function getTransferContextEncoder() {
|
|
990
|
+
return getStructEncoder17([
|
|
991
|
+
["discriminator", getU8Encoder6()],
|
|
992
|
+
["version", getU8Encoder6()],
|
|
993
|
+
["initiator", getAddressEncoder16()],
|
|
994
|
+
["delegation", getAddressEncoder16()],
|
|
995
|
+
["delegationKind", getU8Encoder6()]
|
|
996
|
+
]);
|
|
997
|
+
}
|
|
998
|
+
function getTransferContextDecoder() {
|
|
999
|
+
return getStructDecoder17([
|
|
1000
|
+
["discriminator", getU8Decoder6()],
|
|
1001
|
+
["version", getU8Decoder6()],
|
|
1002
|
+
["initiator", getAddressDecoder10()],
|
|
1003
|
+
["delegation", getAddressDecoder10()],
|
|
1004
|
+
["delegationKind", getU8Decoder6()]
|
|
1005
|
+
]);
|
|
1006
|
+
}
|
|
1007
|
+
function getTransferContextCodec() {
|
|
1008
|
+
return combineCodec19(getTransferContextEncoder(), getTransferContextDecoder());
|
|
1009
|
+
}
|
|
1010
|
+
function decodeTransferContext(encodedAccount) {
|
|
1011
|
+
return decodeAccount7(encodedAccount, getTransferContextDecoder());
|
|
1012
|
+
}
|
|
1013
|
+
async function fetchTransferContext(rpc, address, config) {
|
|
1014
|
+
const maybeAccount = await fetchMaybeTransferContext(rpc, address, config);
|
|
1015
|
+
assertAccountExists7(maybeAccount);
|
|
1016
|
+
return maybeAccount;
|
|
1017
|
+
}
|
|
1018
|
+
async function fetchMaybeTransferContext(rpc, address, config) {
|
|
1019
|
+
const maybeAccount = await fetchEncodedAccount7(
|
|
1020
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
1021
|
+
typeof address === "string" ? address : address.address,
|
|
1022
|
+
config
|
|
1023
|
+
);
|
|
1024
|
+
return decodeTransferContext(maybeAccount);
|
|
1025
|
+
}
|
|
1026
|
+
async function fetchAllTransferContext(rpc, addresses, config) {
|
|
1027
|
+
const maybeAccounts = await fetchAllMaybeTransferContext(rpc, addresses, config);
|
|
1028
|
+
assertAccountsExist7(maybeAccounts);
|
|
1029
|
+
return maybeAccounts;
|
|
1030
|
+
}
|
|
1031
|
+
async function fetchAllMaybeTransferContext(rpc, addresses, config) {
|
|
1032
|
+
const maybeAccounts = await fetchEncodedAccounts7(
|
|
1033
|
+
"rpc" in rpc ? rpc.rpc : rpc,
|
|
1034
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
1035
|
+
config
|
|
1036
|
+
);
|
|
1037
|
+
return maybeAccounts.map((maybeAccount) => decodeTransferContext(maybeAccount));
|
|
1038
|
+
}
|
|
1039
|
+
async function fetchTransferContextFromSeeds(rpc, seeds, config = {}) {
|
|
1040
|
+
const maybeAccount = await fetchMaybeTransferContextFromSeeds(rpc, seeds, config);
|
|
1041
|
+
assertAccountExists7(maybeAccount);
|
|
1042
|
+
return maybeAccount;
|
|
1043
|
+
}
|
|
1044
|
+
async function fetchMaybeTransferContextFromSeeds(rpc, seeds, config = {}) {
|
|
1045
|
+
const { programAddress, ...fetchConfig } = config;
|
|
1046
|
+
const [address] = await findTransferContextPda(seeds, { programAddress });
|
|
1047
|
+
return await fetchMaybeTransferContext(rpc, address, fetchConfig);
|
|
1048
|
+
}
|
|
1049
|
+
|
|
899
1050
|
// src/generated/errors/subscriptions.ts
|
|
900
1051
|
import {
|
|
901
1052
|
isProgramError
|
|
@@ -906,10 +1057,10 @@ import {
|
|
|
906
1057
|
assertIsInstructionWithAccounts,
|
|
907
1058
|
containsBytes,
|
|
908
1059
|
extendClient,
|
|
909
|
-
getU8Encoder as
|
|
1060
|
+
getU8Encoder as getU8Encoder26,
|
|
910
1061
|
SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,
|
|
911
1062
|
SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,
|
|
912
|
-
SolanaError as
|
|
1063
|
+
SolanaError as SolanaError20
|
|
913
1064
|
} from "@solana/kit";
|
|
914
1065
|
import {
|
|
915
1066
|
addSelfFetchFunctions,
|
|
@@ -918,13 +1069,13 @@ import {
|
|
|
918
1069
|
|
|
919
1070
|
// src/generated/instructions/cancelSubscription.ts
|
|
920
1071
|
import {
|
|
921
|
-
combineCodec as
|
|
922
|
-
getProgramDerivedAddress as
|
|
923
|
-
getStructDecoder as
|
|
924
|
-
getStructEncoder as
|
|
925
|
-
getU8Decoder as
|
|
926
|
-
getU8Encoder as
|
|
927
|
-
getUtf8Encoder as
|
|
1072
|
+
combineCodec as combineCodec20,
|
|
1073
|
+
getProgramDerivedAddress as getProgramDerivedAddress8,
|
|
1074
|
+
getStructDecoder as getStructDecoder18,
|
|
1075
|
+
getStructEncoder as getStructEncoder18,
|
|
1076
|
+
getU8Decoder as getU8Decoder7,
|
|
1077
|
+
getU8Encoder as getU8Encoder7,
|
|
1078
|
+
getUtf8Encoder as getUtf8Encoder10,
|
|
928
1079
|
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
929
1080
|
SolanaError,
|
|
930
1081
|
transformEncoder
|
|
@@ -935,47 +1086,51 @@ import {
|
|
|
935
1086
|
} from "@solana/program-client-core";
|
|
936
1087
|
var CANCEL_SUBSCRIPTION_DISCRIMINATOR = 12;
|
|
937
1088
|
function getCancelSubscriptionDiscriminatorBytes() {
|
|
938
|
-
return
|
|
1089
|
+
return getU8Encoder7().encode(CANCEL_SUBSCRIPTION_DISCRIMINATOR);
|
|
939
1090
|
}
|
|
940
1091
|
function getCancelSubscriptionInstructionDataEncoder() {
|
|
941
|
-
return transformEncoder(
|
|
1092
|
+
return transformEncoder(getStructEncoder18([["discriminator", getU8Encoder7()]]), (value) => ({
|
|
942
1093
|
...value,
|
|
943
1094
|
discriminator: CANCEL_SUBSCRIPTION_DISCRIMINATOR
|
|
944
1095
|
}));
|
|
945
1096
|
}
|
|
946
1097
|
function getCancelSubscriptionInstructionDataDecoder() {
|
|
947
|
-
return
|
|
1098
|
+
return getStructDecoder18([["discriminator", getU8Decoder7()]]);
|
|
948
1099
|
}
|
|
949
1100
|
function getCancelSubscriptionInstructionDataCodec() {
|
|
950
|
-
return
|
|
1101
|
+
return combineCodec20(getCancelSubscriptionInstructionDataEncoder(), getCancelSubscriptionInstructionDataDecoder());
|
|
951
1102
|
}
|
|
952
1103
|
async function getCancelSubscriptionInstructionAsync(input, config) {
|
|
953
|
-
const
|
|
1104
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1105
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1106
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
954
1107
|
const originalAccounts = {
|
|
955
|
-
subscriber: { value: input.subscriber ?? null, isWritable: false },
|
|
956
|
-
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
957
|
-
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
958
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
959
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
1108
|
+
subscriber: { value: input.subscriber ?? null, isSigner: true, isWritable: false },
|
|
1109
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: false },
|
|
1110
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isSigner: false, isWritable: true },
|
|
1111
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1112
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
960
1113
|
};
|
|
961
1114
|
const accounts = originalAccounts;
|
|
962
1115
|
if (!accounts.subscriptionPda.value) {
|
|
963
|
-
accounts.subscriptionPda.value = await findSubscriptionDelegationPda(
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
1116
|
+
accounts.subscriptionPda.value = await findSubscriptionDelegationPda(
|
|
1117
|
+
{
|
|
1118
|
+
planPda: getAddressFromResolvedInstructionAccount("planPda", accounts.planPda.value),
|
|
1119
|
+
subscriber: getAddressFromResolvedInstructionAccount("subscriber", accounts.subscriber.value)
|
|
1120
|
+
},
|
|
1121
|
+
{ programAddress }
|
|
1122
|
+
);
|
|
967
1123
|
}
|
|
968
1124
|
if (!accounts.eventAuthority.value) {
|
|
969
|
-
accounts.eventAuthority.value = await
|
|
1125
|
+
accounts.eventAuthority.value = await getProgramDerivedAddress8({
|
|
970
1126
|
programAddress,
|
|
971
|
-
seeds: [
|
|
1127
|
+
seeds: [getUtf8Encoder10().encode("event_authority")]
|
|
972
1128
|
});
|
|
973
1129
|
}
|
|
974
1130
|
if (!accounts.selfProgram.value) {
|
|
975
1131
|
accounts.selfProgram.value = programAddress;
|
|
976
1132
|
accounts.selfProgram.isWritable = false;
|
|
977
1133
|
}
|
|
978
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
979
1134
|
return Object.freeze({
|
|
980
1135
|
accounts: [
|
|
981
1136
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -989,20 +1144,21 @@ async function getCancelSubscriptionInstructionAsync(input, config) {
|
|
|
989
1144
|
});
|
|
990
1145
|
}
|
|
991
1146
|
function getCancelSubscriptionInstruction(input, config) {
|
|
992
|
-
const
|
|
1147
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1148
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1149
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
993
1150
|
const originalAccounts = {
|
|
994
|
-
subscriber: { value: input.subscriber ?? null, isWritable: false },
|
|
995
|
-
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
996
|
-
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
997
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
998
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
1151
|
+
subscriber: { value: input.subscriber ?? null, isSigner: true, isWritable: false },
|
|
1152
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: false },
|
|
1153
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isSigner: false, isWritable: true },
|
|
1154
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1155
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
999
1156
|
};
|
|
1000
1157
|
const accounts = originalAccounts;
|
|
1001
1158
|
if (!accounts.selfProgram.value) {
|
|
1002
1159
|
accounts.selfProgram.value = programAddress;
|
|
1003
1160
|
accounts.selfProgram.isWritable = false;
|
|
1004
1161
|
}
|
|
1005
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1006
1162
|
return Object.freeze({
|
|
1007
1163
|
accounts: [
|
|
1008
1164
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -1043,13 +1199,13 @@ function parseCancelSubscriptionInstruction(instruction) {
|
|
|
1043
1199
|
|
|
1044
1200
|
// src/generated/instructions/cancelSubscriptionNow.ts
|
|
1045
1201
|
import {
|
|
1046
|
-
combineCodec as
|
|
1047
|
-
getProgramDerivedAddress as
|
|
1048
|
-
getStructDecoder as
|
|
1049
|
-
getStructEncoder as
|
|
1050
|
-
getU8Decoder as
|
|
1051
|
-
getU8Encoder as
|
|
1052
|
-
getUtf8Encoder as
|
|
1202
|
+
combineCodec as combineCodec21,
|
|
1203
|
+
getProgramDerivedAddress as getProgramDerivedAddress9,
|
|
1204
|
+
getStructDecoder as getStructDecoder19,
|
|
1205
|
+
getStructEncoder as getStructEncoder19,
|
|
1206
|
+
getU8Decoder as getU8Decoder8,
|
|
1207
|
+
getU8Encoder as getU8Encoder8,
|
|
1208
|
+
getUtf8Encoder as getUtf8Encoder11,
|
|
1053
1209
|
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS2,
|
|
1054
1210
|
SolanaError as SolanaError2,
|
|
1055
1211
|
transformEncoder as transformEncoder2
|
|
@@ -1060,58 +1216,62 @@ import {
|
|
|
1060
1216
|
} from "@solana/program-client-core";
|
|
1061
1217
|
var CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR = 17;
|
|
1062
1218
|
function getCancelSubscriptionNowDiscriminatorBytes() {
|
|
1063
|
-
return
|
|
1219
|
+
return getU8Encoder8().encode(CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR);
|
|
1064
1220
|
}
|
|
1065
1221
|
function getCancelSubscriptionNowInstructionDataEncoder() {
|
|
1066
1222
|
return transformEncoder2(
|
|
1067
|
-
|
|
1068
|
-
["discriminator",
|
|
1223
|
+
getStructEncoder19([
|
|
1224
|
+
["discriminator", getU8Encoder8()],
|
|
1069
1225
|
["cancelSubscriptionNowData", getCancelSubscriptionNowDataEncoder()]
|
|
1070
1226
|
]),
|
|
1071
1227
|
(value) => ({ ...value, discriminator: CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR })
|
|
1072
1228
|
);
|
|
1073
1229
|
}
|
|
1074
1230
|
function getCancelSubscriptionNowInstructionDataDecoder() {
|
|
1075
|
-
return
|
|
1076
|
-
["discriminator",
|
|
1231
|
+
return getStructDecoder19([
|
|
1232
|
+
["discriminator", getU8Decoder8()],
|
|
1077
1233
|
["cancelSubscriptionNowData", getCancelSubscriptionNowDataDecoder()]
|
|
1078
1234
|
]);
|
|
1079
1235
|
}
|
|
1080
1236
|
function getCancelSubscriptionNowInstructionDataCodec() {
|
|
1081
|
-
return
|
|
1237
|
+
return combineCodec21(
|
|
1082
1238
|
getCancelSubscriptionNowInstructionDataEncoder(),
|
|
1083
1239
|
getCancelSubscriptionNowInstructionDataDecoder()
|
|
1084
1240
|
);
|
|
1085
1241
|
}
|
|
1086
1242
|
async function getCancelSubscriptionNowInstructionAsync(input, config) {
|
|
1087
|
-
const
|
|
1243
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1244
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1245
|
+
const getAccountMeta = getAccountMetaFactory2(programAddress, "programId");
|
|
1088
1246
|
const originalAccounts = {
|
|
1089
|
-
subscriber: { value: input.subscriber ?? null, isWritable: false },
|
|
1090
|
-
merchant: { value: input.merchant ?? null, isWritable: false },
|
|
1091
|
-
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
1092
|
-
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
1093
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
1094
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
1247
|
+
subscriber: { value: input.subscriber ?? null, isSigner: true, isWritable: false },
|
|
1248
|
+
merchant: { value: input.merchant ?? null, isSigner: true, isWritable: false },
|
|
1249
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: false },
|
|
1250
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isSigner: false, isWritable: true },
|
|
1251
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1252
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
1095
1253
|
};
|
|
1096
1254
|
const accounts = originalAccounts;
|
|
1097
1255
|
const args = { ...input };
|
|
1098
1256
|
if (!accounts.subscriptionPda.value) {
|
|
1099
|
-
accounts.subscriptionPda.value = await findSubscriptionDelegationPda(
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1257
|
+
accounts.subscriptionPda.value = await findSubscriptionDelegationPda(
|
|
1258
|
+
{
|
|
1259
|
+
planPda: getAddressFromResolvedInstructionAccount2("planPda", accounts.planPda.value),
|
|
1260
|
+
subscriber: getAddressFromResolvedInstructionAccount2("subscriber", accounts.subscriber.value)
|
|
1261
|
+
},
|
|
1262
|
+
{ programAddress }
|
|
1263
|
+
);
|
|
1103
1264
|
}
|
|
1104
1265
|
if (!accounts.eventAuthority.value) {
|
|
1105
|
-
accounts.eventAuthority.value = await
|
|
1266
|
+
accounts.eventAuthority.value = await getProgramDerivedAddress9({
|
|
1106
1267
|
programAddress,
|
|
1107
|
-
seeds: [
|
|
1268
|
+
seeds: [getUtf8Encoder11().encode("event_authority")]
|
|
1108
1269
|
});
|
|
1109
1270
|
}
|
|
1110
1271
|
if (!accounts.selfProgram.value) {
|
|
1111
1272
|
accounts.selfProgram.value = programAddress;
|
|
1112
1273
|
accounts.selfProgram.isWritable = false;
|
|
1113
1274
|
}
|
|
1114
|
-
const getAccountMeta = getAccountMetaFactory2(programAddress, "programId");
|
|
1115
1275
|
return Object.freeze({
|
|
1116
1276
|
accounts: [
|
|
1117
1277
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -1126,14 +1286,16 @@ async function getCancelSubscriptionNowInstructionAsync(input, config) {
|
|
|
1126
1286
|
});
|
|
1127
1287
|
}
|
|
1128
1288
|
function getCancelSubscriptionNowInstruction(input, config) {
|
|
1129
|
-
const
|
|
1289
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1290
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1291
|
+
const getAccountMeta = getAccountMetaFactory2(programAddress, "programId");
|
|
1130
1292
|
const originalAccounts = {
|
|
1131
|
-
subscriber: { value: input.subscriber ?? null, isWritable: false },
|
|
1132
|
-
merchant: { value: input.merchant ?? null, isWritable: false },
|
|
1133
|
-
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
1134
|
-
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
1135
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
1136
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
1293
|
+
subscriber: { value: input.subscriber ?? null, isSigner: true, isWritable: false },
|
|
1294
|
+
merchant: { value: input.merchant ?? null, isSigner: true, isWritable: false },
|
|
1295
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: false },
|
|
1296
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isSigner: false, isWritable: true },
|
|
1297
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
1298
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
1137
1299
|
};
|
|
1138
1300
|
const accounts = originalAccounts;
|
|
1139
1301
|
const args = { ...input };
|
|
@@ -1141,7 +1303,6 @@ function getCancelSubscriptionNowInstruction(input, config) {
|
|
|
1141
1303
|
accounts.selfProgram.value = programAddress;
|
|
1142
1304
|
accounts.selfProgram.isWritable = false;
|
|
1143
1305
|
}
|
|
1144
|
-
const getAccountMeta = getAccountMetaFactory2(programAddress, "programId");
|
|
1145
1306
|
return Object.freeze({
|
|
1146
1307
|
accounts: [
|
|
1147
1308
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -1184,44 +1345,47 @@ function parseCancelSubscriptionNowInstruction(instruction) {
|
|
|
1184
1345
|
|
|
1185
1346
|
// src/generated/instructions/closeSubscriptionAuthority.ts
|
|
1186
1347
|
import {
|
|
1187
|
-
combineCodec as
|
|
1188
|
-
getStructDecoder as
|
|
1189
|
-
getStructEncoder as
|
|
1190
|
-
getU8Decoder as
|
|
1191
|
-
getU8Encoder as
|
|
1348
|
+
combineCodec as combineCodec22,
|
|
1349
|
+
getStructDecoder as getStructDecoder20,
|
|
1350
|
+
getStructEncoder as getStructEncoder20,
|
|
1351
|
+
getU8Decoder as getU8Decoder9,
|
|
1352
|
+
getU8Encoder as getU8Encoder9,
|
|
1192
1353
|
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS3,
|
|
1193
1354
|
SolanaError as SolanaError3,
|
|
1194
1355
|
transformEncoder as transformEncoder3
|
|
1195
1356
|
} from "@solana/kit";
|
|
1196
|
-
import {
|
|
1357
|
+
import {
|
|
1358
|
+
getAccountMetaFactory as getAccountMetaFactory3
|
|
1359
|
+
} from "@solana/program-client-core";
|
|
1197
1360
|
var CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 6;
|
|
1198
1361
|
function getCloseSubscriptionAuthorityDiscriminatorBytes() {
|
|
1199
|
-
return
|
|
1362
|
+
return getU8Encoder9().encode(CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);
|
|
1200
1363
|
}
|
|
1201
1364
|
function getCloseSubscriptionAuthorityInstructionDataEncoder() {
|
|
1202
|
-
return transformEncoder3(
|
|
1365
|
+
return transformEncoder3(getStructEncoder20([["discriminator", getU8Encoder9()]]), (value) => ({
|
|
1203
1366
|
...value,
|
|
1204
1367
|
discriminator: CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR
|
|
1205
1368
|
}));
|
|
1206
1369
|
}
|
|
1207
1370
|
function getCloseSubscriptionAuthorityInstructionDataDecoder() {
|
|
1208
|
-
return
|
|
1371
|
+
return getStructDecoder20([["discriminator", getU8Decoder9()]]);
|
|
1209
1372
|
}
|
|
1210
1373
|
function getCloseSubscriptionAuthorityInstructionDataCodec() {
|
|
1211
|
-
return
|
|
1374
|
+
return combineCodec22(
|
|
1212
1375
|
getCloseSubscriptionAuthorityInstructionDataEncoder(),
|
|
1213
1376
|
getCloseSubscriptionAuthorityInstructionDataDecoder()
|
|
1214
1377
|
);
|
|
1215
1378
|
}
|
|
1216
1379
|
function getCloseSubscriptionAuthorityInstruction(input, config) {
|
|
1217
|
-
const
|
|
1380
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1381
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1382
|
+
const getAccountMeta = getAccountMetaFactory3(programAddress, "omitted");
|
|
1218
1383
|
const originalAccounts = {
|
|
1219
|
-
user: { value: input.user ?? null, isWritable: true },
|
|
1220
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },
|
|
1221
|
-
receiver: { value: input.receiver ?? null, isWritable: true }
|
|
1384
|
+
user: { value: input.user ?? null, isSigner: true, isWritable: true },
|
|
1385
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: true },
|
|
1386
|
+
receiver: { value: input.receiver ?? null, isSigner: false, isWritable: true }
|
|
1222
1387
|
};
|
|
1223
1388
|
const accounts = originalAccounts;
|
|
1224
|
-
const getAccountMeta = getAccountMetaFactory3(programAddress, "omitted");
|
|
1225
1389
|
return Object.freeze({
|
|
1226
1390
|
accounts: [
|
|
1227
1391
|
getAccountMeta("user", accounts.user),
|
|
@@ -1264,57 +1428,60 @@ function parseCloseSubscriptionAuthorityInstruction(instruction) {
|
|
|
1264
1428
|
|
|
1265
1429
|
// src/generated/instructions/createFixedDelegation.ts
|
|
1266
1430
|
import {
|
|
1267
|
-
combineCodec as
|
|
1268
|
-
getStructDecoder as
|
|
1269
|
-
getStructEncoder as
|
|
1270
|
-
getU8Decoder as
|
|
1271
|
-
getU8Encoder as
|
|
1431
|
+
combineCodec as combineCodec23,
|
|
1432
|
+
getStructDecoder as getStructDecoder21,
|
|
1433
|
+
getStructEncoder as getStructEncoder21,
|
|
1434
|
+
getU8Decoder as getU8Decoder10,
|
|
1435
|
+
getU8Encoder as getU8Encoder10,
|
|
1272
1436
|
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS4,
|
|
1273
1437
|
SolanaError as SolanaError4,
|
|
1274
1438
|
transformEncoder as transformEncoder4
|
|
1275
1439
|
} from "@solana/kit";
|
|
1276
|
-
import {
|
|
1440
|
+
import {
|
|
1441
|
+
getAccountMetaFactory as getAccountMetaFactory4
|
|
1442
|
+
} from "@solana/program-client-core";
|
|
1277
1443
|
var CREATE_FIXED_DELEGATION_DISCRIMINATOR = 1;
|
|
1278
1444
|
function getCreateFixedDelegationDiscriminatorBytes() {
|
|
1279
|
-
return
|
|
1445
|
+
return getU8Encoder10().encode(CREATE_FIXED_DELEGATION_DISCRIMINATOR);
|
|
1280
1446
|
}
|
|
1281
1447
|
function getCreateFixedDelegationInstructionDataEncoder() {
|
|
1282
1448
|
return transformEncoder4(
|
|
1283
|
-
|
|
1284
|
-
["discriminator",
|
|
1449
|
+
getStructEncoder21([
|
|
1450
|
+
["discriminator", getU8Encoder10()],
|
|
1285
1451
|
["fixedDelegation", getCreateFixedDelegationDataEncoder()]
|
|
1286
1452
|
]),
|
|
1287
1453
|
(value) => ({ ...value, discriminator: CREATE_FIXED_DELEGATION_DISCRIMINATOR })
|
|
1288
1454
|
);
|
|
1289
1455
|
}
|
|
1290
1456
|
function getCreateFixedDelegationInstructionDataDecoder() {
|
|
1291
|
-
return
|
|
1292
|
-
["discriminator",
|
|
1457
|
+
return getStructDecoder21([
|
|
1458
|
+
["discriminator", getU8Decoder10()],
|
|
1293
1459
|
["fixedDelegation", getCreateFixedDelegationDataDecoder()]
|
|
1294
1460
|
]);
|
|
1295
1461
|
}
|
|
1296
1462
|
function getCreateFixedDelegationInstructionDataCodec() {
|
|
1297
|
-
return
|
|
1463
|
+
return combineCodec23(
|
|
1298
1464
|
getCreateFixedDelegationInstructionDataEncoder(),
|
|
1299
1465
|
getCreateFixedDelegationInstructionDataDecoder()
|
|
1300
1466
|
);
|
|
1301
1467
|
}
|
|
1302
1468
|
function getCreateFixedDelegationInstruction(input, config) {
|
|
1303
|
-
const
|
|
1469
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1470
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1471
|
+
const getAccountMeta = getAccountMetaFactory4(programAddress, "omitted");
|
|
1304
1472
|
const originalAccounts = {
|
|
1305
|
-
delegator: { value: input.delegator ?? null, isWritable: true },
|
|
1306
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },
|
|
1307
|
-
delegationAccount: { value: input.delegationAccount ?? null, isWritable: true },
|
|
1308
|
-
delegatee: { value: input.delegatee ?? null, isWritable: false },
|
|
1309
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
1310
|
-
payer: { value: input.payer ?? null, isWritable: true }
|
|
1473
|
+
delegator: { value: input.delegator ?? null, isSigner: true, isWritable: true },
|
|
1474
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false },
|
|
1475
|
+
delegationAccount: { value: input.delegationAccount ?? null, isSigner: false, isWritable: true },
|
|
1476
|
+
delegatee: { value: input.delegatee ?? null, isSigner: false, isWritable: false },
|
|
1477
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1478
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true }
|
|
1311
1479
|
};
|
|
1312
1480
|
const accounts = originalAccounts;
|
|
1313
1481
|
const args = { ...input };
|
|
1314
1482
|
if (!accounts.systemProgram.value) {
|
|
1315
1483
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1316
1484
|
}
|
|
1317
|
-
const getAccountMeta = getAccountMetaFactory4(programAddress, "omitted");
|
|
1318
1485
|
return Object.freeze({
|
|
1319
1486
|
accounts: [
|
|
1320
1487
|
getAccountMeta("delegator", accounts.delegator),
|
|
@@ -1363,47 +1530,51 @@ function parseCreateFixedDelegationInstruction(instruction) {
|
|
|
1363
1530
|
|
|
1364
1531
|
// src/generated/instructions/createPlan.ts
|
|
1365
1532
|
import {
|
|
1366
|
-
combineCodec as
|
|
1367
|
-
getStructDecoder as
|
|
1368
|
-
getStructEncoder as
|
|
1369
|
-
getU8Decoder as
|
|
1370
|
-
getU8Encoder as
|
|
1533
|
+
combineCodec as combineCodec24,
|
|
1534
|
+
getStructDecoder as getStructDecoder22,
|
|
1535
|
+
getStructEncoder as getStructEncoder22,
|
|
1536
|
+
getU8Decoder as getU8Decoder11,
|
|
1537
|
+
getU8Encoder as getU8Encoder11,
|
|
1371
1538
|
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS5,
|
|
1372
1539
|
SolanaError as SolanaError5,
|
|
1373
1540
|
transformEncoder as transformEncoder5
|
|
1374
1541
|
} from "@solana/kit";
|
|
1375
|
-
import {
|
|
1542
|
+
import {
|
|
1543
|
+
getAccountMetaFactory as getAccountMetaFactory5
|
|
1544
|
+
} from "@solana/program-client-core";
|
|
1376
1545
|
var CREATE_PLAN_DISCRIMINATOR = 7;
|
|
1377
1546
|
function getCreatePlanDiscriminatorBytes() {
|
|
1378
|
-
return
|
|
1547
|
+
return getU8Encoder11().encode(CREATE_PLAN_DISCRIMINATOR);
|
|
1379
1548
|
}
|
|
1380
1549
|
function getCreatePlanInstructionDataEncoder() {
|
|
1381
1550
|
return transformEncoder5(
|
|
1382
|
-
|
|
1383
|
-
["discriminator",
|
|
1551
|
+
getStructEncoder22([
|
|
1552
|
+
["discriminator", getU8Encoder11()],
|
|
1384
1553
|
["planData", getPlanDataEncoder()]
|
|
1385
1554
|
]),
|
|
1386
1555
|
(value) => ({ ...value, discriminator: CREATE_PLAN_DISCRIMINATOR })
|
|
1387
1556
|
);
|
|
1388
1557
|
}
|
|
1389
1558
|
function getCreatePlanInstructionDataDecoder() {
|
|
1390
|
-
return
|
|
1391
|
-
["discriminator",
|
|
1559
|
+
return getStructDecoder22([
|
|
1560
|
+
["discriminator", getU8Decoder11()],
|
|
1392
1561
|
["planData", getPlanDataDecoder()]
|
|
1393
1562
|
]);
|
|
1394
1563
|
}
|
|
1395
1564
|
function getCreatePlanInstructionDataCodec() {
|
|
1396
|
-
return
|
|
1565
|
+
return combineCodec24(getCreatePlanInstructionDataEncoder(), getCreatePlanInstructionDataDecoder());
|
|
1397
1566
|
}
|
|
1398
1567
|
function getCreatePlanInstruction(input, config) {
|
|
1399
|
-
const
|
|
1568
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1569
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1570
|
+
const getAccountMeta = getAccountMetaFactory5(programAddress, "omitted");
|
|
1400
1571
|
const originalAccounts = {
|
|
1401
|
-
merchant: { value: input.merchant ?? null, isWritable: true },
|
|
1402
|
-
planPda: { value: input.planPda ?? null, isWritable: true },
|
|
1403
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
1404
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
1405
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1406
|
-
payer: { value: input.payer ?? null, isWritable: true }
|
|
1572
|
+
merchant: { value: input.merchant ?? null, isSigner: true, isWritable: true },
|
|
1573
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: true },
|
|
1574
|
+
tokenMint: { value: input.tokenMint ?? null, isSigner: false, isWritable: false },
|
|
1575
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1576
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
1577
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true }
|
|
1407
1578
|
};
|
|
1408
1579
|
const accounts = originalAccounts;
|
|
1409
1580
|
const args = { ...input };
|
|
@@ -1413,7 +1584,6 @@ function getCreatePlanInstruction(input, config) {
|
|
|
1413
1584
|
if (!accounts.tokenProgram.value) {
|
|
1414
1585
|
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1415
1586
|
}
|
|
1416
|
-
const getAccountMeta = getAccountMetaFactory5(programAddress, "omitted");
|
|
1417
1587
|
return Object.freeze({
|
|
1418
1588
|
accounts: [
|
|
1419
1589
|
getAccountMeta("merchant", accounts.merchant),
|
|
@@ -1462,57 +1632,60 @@ function parseCreatePlanInstruction(instruction) {
|
|
|
1462
1632
|
|
|
1463
1633
|
// src/generated/instructions/createRecurringDelegation.ts
|
|
1464
1634
|
import {
|
|
1465
|
-
combineCodec as
|
|
1466
|
-
getStructDecoder as
|
|
1467
|
-
getStructEncoder as
|
|
1468
|
-
getU8Decoder as
|
|
1469
|
-
getU8Encoder as
|
|
1635
|
+
combineCodec as combineCodec25,
|
|
1636
|
+
getStructDecoder as getStructDecoder23,
|
|
1637
|
+
getStructEncoder as getStructEncoder23,
|
|
1638
|
+
getU8Decoder as getU8Decoder12,
|
|
1639
|
+
getU8Encoder as getU8Encoder12,
|
|
1470
1640
|
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS6,
|
|
1471
1641
|
SolanaError as SolanaError6,
|
|
1472
1642
|
transformEncoder as transformEncoder6
|
|
1473
1643
|
} from "@solana/kit";
|
|
1474
|
-
import {
|
|
1644
|
+
import {
|
|
1645
|
+
getAccountMetaFactory as getAccountMetaFactory6
|
|
1646
|
+
} from "@solana/program-client-core";
|
|
1475
1647
|
var CREATE_RECURRING_DELEGATION_DISCRIMINATOR = 2;
|
|
1476
1648
|
function getCreateRecurringDelegationDiscriminatorBytes() {
|
|
1477
|
-
return
|
|
1649
|
+
return getU8Encoder12().encode(CREATE_RECURRING_DELEGATION_DISCRIMINATOR);
|
|
1478
1650
|
}
|
|
1479
1651
|
function getCreateRecurringDelegationInstructionDataEncoder() {
|
|
1480
1652
|
return transformEncoder6(
|
|
1481
|
-
|
|
1482
|
-
["discriminator",
|
|
1653
|
+
getStructEncoder23([
|
|
1654
|
+
["discriminator", getU8Encoder12()],
|
|
1483
1655
|
["recurringDelegation", getCreateRecurringDelegationDataEncoder()]
|
|
1484
1656
|
]),
|
|
1485
1657
|
(value) => ({ ...value, discriminator: CREATE_RECURRING_DELEGATION_DISCRIMINATOR })
|
|
1486
1658
|
);
|
|
1487
1659
|
}
|
|
1488
1660
|
function getCreateRecurringDelegationInstructionDataDecoder() {
|
|
1489
|
-
return
|
|
1490
|
-
["discriminator",
|
|
1661
|
+
return getStructDecoder23([
|
|
1662
|
+
["discriminator", getU8Decoder12()],
|
|
1491
1663
|
["recurringDelegation", getCreateRecurringDelegationDataDecoder()]
|
|
1492
1664
|
]);
|
|
1493
1665
|
}
|
|
1494
1666
|
function getCreateRecurringDelegationInstructionDataCodec() {
|
|
1495
|
-
return
|
|
1667
|
+
return combineCodec25(
|
|
1496
1668
|
getCreateRecurringDelegationInstructionDataEncoder(),
|
|
1497
1669
|
getCreateRecurringDelegationInstructionDataDecoder()
|
|
1498
1670
|
);
|
|
1499
1671
|
}
|
|
1500
1672
|
function getCreateRecurringDelegationInstruction(input, config) {
|
|
1501
|
-
const
|
|
1673
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1674
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1675
|
+
const getAccountMeta = getAccountMetaFactory6(programAddress, "omitted");
|
|
1502
1676
|
const originalAccounts = {
|
|
1503
|
-
delegator: { value: input.delegator ?? null, isWritable: true },
|
|
1504
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },
|
|
1505
|
-
delegationAccount: { value: input.delegationAccount ?? null, isWritable: true },
|
|
1506
|
-
delegatee: { value: input.delegatee ?? null, isWritable: false },
|
|
1507
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
1508
|
-
payer: { value: input.payer ?? null, isWritable: true }
|
|
1677
|
+
delegator: { value: input.delegator ?? null, isSigner: true, isWritable: true },
|
|
1678
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false },
|
|
1679
|
+
delegationAccount: { value: input.delegationAccount ?? null, isSigner: false, isWritable: true },
|
|
1680
|
+
delegatee: { value: input.delegatee ?? null, isSigner: false, isWritable: false },
|
|
1681
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1682
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true }
|
|
1509
1683
|
};
|
|
1510
1684
|
const accounts = originalAccounts;
|
|
1511
1685
|
const args = { ...input };
|
|
1512
1686
|
if (!accounts.systemProgram.value) {
|
|
1513
1687
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1514
1688
|
}
|
|
1515
|
-
const getAccountMeta = getAccountMetaFactory6(programAddress, "omitted");
|
|
1516
1689
|
return Object.freeze({
|
|
1517
1690
|
accounts: [
|
|
1518
1691
|
getAccountMeta("delegator", accounts.delegator),
|
|
@@ -1563,40 +1736,43 @@ function parseCreateRecurringDelegationInstruction(instruction) {
|
|
|
1563
1736
|
|
|
1564
1737
|
// src/generated/instructions/deletePlan.ts
|
|
1565
1738
|
import {
|
|
1566
|
-
combineCodec as
|
|
1567
|
-
getStructDecoder as
|
|
1568
|
-
getStructEncoder as
|
|
1569
|
-
getU8Decoder as
|
|
1570
|
-
getU8Encoder as
|
|
1739
|
+
combineCodec as combineCodec26,
|
|
1740
|
+
getStructDecoder as getStructDecoder24,
|
|
1741
|
+
getStructEncoder as getStructEncoder24,
|
|
1742
|
+
getU8Decoder as getU8Decoder13,
|
|
1743
|
+
getU8Encoder as getU8Encoder13,
|
|
1571
1744
|
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS7,
|
|
1572
1745
|
SolanaError as SolanaError7,
|
|
1573
1746
|
transformEncoder as transformEncoder7
|
|
1574
1747
|
} from "@solana/kit";
|
|
1575
|
-
import {
|
|
1748
|
+
import {
|
|
1749
|
+
getAccountMetaFactory as getAccountMetaFactory7
|
|
1750
|
+
} from "@solana/program-client-core";
|
|
1576
1751
|
var DELETE_PLAN_DISCRIMINATOR = 9;
|
|
1577
1752
|
function getDeletePlanDiscriminatorBytes() {
|
|
1578
|
-
return
|
|
1753
|
+
return getU8Encoder13().encode(DELETE_PLAN_DISCRIMINATOR);
|
|
1579
1754
|
}
|
|
1580
1755
|
function getDeletePlanInstructionDataEncoder() {
|
|
1581
|
-
return transformEncoder7(
|
|
1756
|
+
return transformEncoder7(getStructEncoder24([["discriminator", getU8Encoder13()]]), (value) => ({
|
|
1582
1757
|
...value,
|
|
1583
1758
|
discriminator: DELETE_PLAN_DISCRIMINATOR
|
|
1584
1759
|
}));
|
|
1585
1760
|
}
|
|
1586
1761
|
function getDeletePlanInstructionDataDecoder() {
|
|
1587
|
-
return
|
|
1762
|
+
return getStructDecoder24([["discriminator", getU8Decoder13()]]);
|
|
1588
1763
|
}
|
|
1589
1764
|
function getDeletePlanInstructionDataCodec() {
|
|
1590
|
-
return
|
|
1765
|
+
return combineCodec26(getDeletePlanInstructionDataEncoder(), getDeletePlanInstructionDataDecoder());
|
|
1591
1766
|
}
|
|
1592
1767
|
function getDeletePlanInstruction(input, config) {
|
|
1593
|
-
const
|
|
1768
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1769
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1770
|
+
const getAccountMeta = getAccountMetaFactory7(programAddress, "programId");
|
|
1594
1771
|
const originalAccounts = {
|
|
1595
|
-
owner: { value: input.owner ?? null, isWritable: true },
|
|
1596
|
-
planPda: { value: input.planPda ?? null, isWritable: true }
|
|
1772
|
+
owner: { value: input.owner ?? null, isSigner: true, isWritable: true },
|
|
1773
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: true }
|
|
1597
1774
|
};
|
|
1598
1775
|
const accounts = originalAccounts;
|
|
1599
|
-
const getAccountMeta = getAccountMetaFactory7(programAddress, "programId");
|
|
1600
1776
|
return Object.freeze({
|
|
1601
1777
|
accounts: [getAccountMeta("owner", accounts.owner), getAccountMeta("planPda", accounts.planPda)],
|
|
1602
1778
|
data: getDeletePlanInstructionDataEncoder().encode({}),
|
|
@@ -1625,11 +1801,11 @@ function parseDeletePlanInstruction(instruction) {
|
|
|
1625
1801
|
|
|
1626
1802
|
// src/generated/instructions/initSubscriptionAuthority.ts
|
|
1627
1803
|
import {
|
|
1628
|
-
combineCodec as
|
|
1629
|
-
getStructDecoder as
|
|
1630
|
-
getStructEncoder as
|
|
1631
|
-
getU8Decoder as
|
|
1632
|
-
getU8Encoder as
|
|
1804
|
+
combineCodec as combineCodec27,
|
|
1805
|
+
getStructDecoder as getStructDecoder25,
|
|
1806
|
+
getStructEncoder as getStructEncoder25,
|
|
1807
|
+
getU8Decoder as getU8Decoder14,
|
|
1808
|
+
getU8Encoder as getU8Encoder14,
|
|
1633
1809
|
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS8,
|
|
1634
1810
|
SolanaError as SolanaError8,
|
|
1635
1811
|
transformEncoder as transformEncoder8
|
|
@@ -1640,45 +1816,49 @@ import {
|
|
|
1640
1816
|
} from "@solana/program-client-core";
|
|
1641
1817
|
var INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 0;
|
|
1642
1818
|
function getInitSubscriptionAuthorityDiscriminatorBytes() {
|
|
1643
|
-
return
|
|
1819
|
+
return getU8Encoder14().encode(INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);
|
|
1644
1820
|
}
|
|
1645
1821
|
function getInitSubscriptionAuthorityInstructionDataEncoder() {
|
|
1646
|
-
return transformEncoder8(
|
|
1822
|
+
return transformEncoder8(getStructEncoder25([["discriminator", getU8Encoder14()]]), (value) => ({
|
|
1647
1823
|
...value,
|
|
1648
1824
|
discriminator: INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR
|
|
1649
1825
|
}));
|
|
1650
1826
|
}
|
|
1651
1827
|
function getInitSubscriptionAuthorityInstructionDataDecoder() {
|
|
1652
|
-
return
|
|
1828
|
+
return getStructDecoder25([["discriminator", getU8Decoder14()]]);
|
|
1653
1829
|
}
|
|
1654
1830
|
function getInitSubscriptionAuthorityInstructionDataCodec() {
|
|
1655
|
-
return
|
|
1831
|
+
return combineCodec27(
|
|
1656
1832
|
getInitSubscriptionAuthorityInstructionDataEncoder(),
|
|
1657
1833
|
getInitSubscriptionAuthorityInstructionDataDecoder()
|
|
1658
1834
|
);
|
|
1659
1835
|
}
|
|
1660
1836
|
async function getInitSubscriptionAuthorityInstructionAsync(input, config) {
|
|
1661
|
-
const
|
|
1837
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1838
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1839
|
+
const getAccountMeta = getAccountMetaFactory8(programAddress, "omitted");
|
|
1662
1840
|
const originalAccounts = {
|
|
1663
|
-
owner: { value: input.owner ?? null, isWritable: true },
|
|
1664
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },
|
|
1665
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
1666
|
-
userAta: { value: input.userAta ?? null, isWritable: true },
|
|
1667
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
1668
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1669
|
-
payer: { value: input.payer ?? null, isWritable: true }
|
|
1841
|
+
owner: { value: input.owner ?? null, isSigner: true, isWritable: true },
|
|
1842
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: true },
|
|
1843
|
+
tokenMint: { value: input.tokenMint ?? null, isSigner: false, isWritable: false },
|
|
1844
|
+
userAta: { value: input.userAta ?? null, isSigner: false, isWritable: true },
|
|
1845
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1846
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
1847
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true }
|
|
1670
1848
|
};
|
|
1671
1849
|
const accounts = originalAccounts;
|
|
1672
1850
|
if (!accounts.subscriptionAuthority.value) {
|
|
1673
|
-
accounts.subscriptionAuthority.value = await findSubscriptionAuthorityPda(
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1851
|
+
accounts.subscriptionAuthority.value = await findSubscriptionAuthorityPda(
|
|
1852
|
+
{
|
|
1853
|
+
user: getAddressFromResolvedInstructionAccount3("owner", accounts.owner.value),
|
|
1854
|
+
tokenMint: getAddressFromResolvedInstructionAccount3("tokenMint", accounts.tokenMint.value)
|
|
1855
|
+
},
|
|
1856
|
+
{ programAddress }
|
|
1857
|
+
);
|
|
1677
1858
|
}
|
|
1678
1859
|
if (!accounts.systemProgram.value) {
|
|
1679
1860
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1680
1861
|
}
|
|
1681
|
-
const getAccountMeta = getAccountMetaFactory8(programAddress, "omitted");
|
|
1682
1862
|
return Object.freeze({
|
|
1683
1863
|
accounts: [
|
|
1684
1864
|
getAccountMeta("owner", accounts.owner),
|
|
@@ -1694,21 +1874,22 @@ async function getInitSubscriptionAuthorityInstructionAsync(input, config) {
|
|
|
1694
1874
|
});
|
|
1695
1875
|
}
|
|
1696
1876
|
function getInitSubscriptionAuthorityInstruction(input, config) {
|
|
1697
|
-
const
|
|
1877
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1878
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1879
|
+
const getAccountMeta = getAccountMetaFactory8(programAddress, "omitted");
|
|
1698
1880
|
const originalAccounts = {
|
|
1699
|
-
owner: { value: input.owner ?? null, isWritable: true },
|
|
1700
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },
|
|
1701
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
1702
|
-
userAta: { value: input.userAta ?? null, isWritable: true },
|
|
1703
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
1704
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1705
|
-
payer: { value: input.payer ?? null, isWritable: true }
|
|
1881
|
+
owner: { value: input.owner ?? null, isSigner: true, isWritable: true },
|
|
1882
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: true },
|
|
1883
|
+
tokenMint: { value: input.tokenMint ?? null, isSigner: false, isWritable: false },
|
|
1884
|
+
userAta: { value: input.userAta ?? null, isSigner: false, isWritable: true },
|
|
1885
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
1886
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
1887
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true }
|
|
1706
1888
|
};
|
|
1707
1889
|
const accounts = originalAccounts;
|
|
1708
1890
|
if (!accounts.systemProgram.value) {
|
|
1709
1891
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1710
1892
|
}
|
|
1711
|
-
const getAccountMeta = getAccountMetaFactory8(programAddress, "omitted");
|
|
1712
1893
|
return Object.freeze({
|
|
1713
1894
|
accounts: [
|
|
1714
1895
|
getAccountMeta("owner", accounts.owner),
|
|
@@ -1757,74 +1938,146 @@ function parseInitSubscriptionAuthorityInstruction(instruction) {
|
|
|
1757
1938
|
};
|
|
1758
1939
|
}
|
|
1759
1940
|
|
|
1760
|
-
// src/generated/instructions/
|
|
1941
|
+
// src/generated/instructions/reclaimExcessRent.ts
|
|
1761
1942
|
import {
|
|
1762
|
-
combineCodec as
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
getU8Encoder as getU8Encoder14,
|
|
1768
|
-
getUtf8Encoder as getUtf8Encoder11,
|
|
1943
|
+
combineCodec as combineCodec28,
|
|
1944
|
+
getStructDecoder as getStructDecoder26,
|
|
1945
|
+
getStructEncoder as getStructEncoder26,
|
|
1946
|
+
getU8Decoder as getU8Decoder15,
|
|
1947
|
+
getU8Encoder as getU8Encoder15,
|
|
1769
1948
|
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS9,
|
|
1770
1949
|
SolanaError as SolanaError9,
|
|
1771
1950
|
transformEncoder as transformEncoder9
|
|
1772
1951
|
} from "@solana/kit";
|
|
1773
1952
|
import {
|
|
1774
|
-
getAccountMetaFactory as getAccountMetaFactory9
|
|
1953
|
+
getAccountMetaFactory as getAccountMetaFactory9
|
|
1954
|
+
} from "@solana/program-client-core";
|
|
1955
|
+
var RECLAIM_EXCESS_RENT_DISCRIMINATOR = 18;
|
|
1956
|
+
function getReclaimExcessRentDiscriminatorBytes() {
|
|
1957
|
+
return getU8Encoder15().encode(RECLAIM_EXCESS_RENT_DISCRIMINATOR);
|
|
1958
|
+
}
|
|
1959
|
+
function getReclaimExcessRentInstructionDataEncoder() {
|
|
1960
|
+
return transformEncoder9(getStructEncoder26([["discriminator", getU8Encoder15()]]), (value) => ({
|
|
1961
|
+
...value,
|
|
1962
|
+
discriminator: RECLAIM_EXCESS_RENT_DISCRIMINATOR
|
|
1963
|
+
}));
|
|
1964
|
+
}
|
|
1965
|
+
function getReclaimExcessRentInstructionDataDecoder() {
|
|
1966
|
+
return getStructDecoder26([["discriminator", getU8Decoder15()]]);
|
|
1967
|
+
}
|
|
1968
|
+
function getReclaimExcessRentInstructionDataCodec() {
|
|
1969
|
+
return combineCodec28(getReclaimExcessRentInstructionDataEncoder(), getReclaimExcessRentInstructionDataDecoder());
|
|
1970
|
+
}
|
|
1971
|
+
function getReclaimExcessRentInstruction(input, config) {
|
|
1972
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1973
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1974
|
+
const getAccountMeta = getAccountMetaFactory9(programAddress, "programId");
|
|
1975
|
+
const originalAccounts = {
|
|
1976
|
+
targetAccount: { value: input.targetAccount ?? null, isSigner: false, isWritable: true },
|
|
1977
|
+
receiver: { value: input.receiver ?? null, isSigner: false, isWritable: true }
|
|
1978
|
+
};
|
|
1979
|
+
const accounts = originalAccounts;
|
|
1980
|
+
return Object.freeze({
|
|
1981
|
+
accounts: [
|
|
1982
|
+
getAccountMeta("targetAccount", accounts.targetAccount),
|
|
1983
|
+
getAccountMeta("receiver", accounts.receiver)
|
|
1984
|
+
],
|
|
1985
|
+
data: getReclaimExcessRentInstructionDataEncoder().encode({}),
|
|
1986
|
+
programAddress
|
|
1987
|
+
});
|
|
1988
|
+
}
|
|
1989
|
+
function parseReclaimExcessRentInstruction(instruction) {
|
|
1990
|
+
if (instruction.accounts.length < 2) {
|
|
1991
|
+
throw new SolanaError9(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS9, {
|
|
1992
|
+
actualAccountMetas: instruction.accounts.length,
|
|
1993
|
+
expectedAccountMetas: 2
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
let accountIndex = 0;
|
|
1997
|
+
const getNextAccount = () => {
|
|
1998
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1999
|
+
accountIndex += 1;
|
|
2000
|
+
return accountMeta;
|
|
2001
|
+
};
|
|
2002
|
+
return {
|
|
2003
|
+
programAddress: instruction.programAddress,
|
|
2004
|
+
accounts: { targetAccount: getNextAccount(), receiver: getNextAccount() },
|
|
2005
|
+
data: getReclaimExcessRentInstructionDataDecoder().decode(instruction.data)
|
|
2006
|
+
};
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
// src/generated/instructions/resumeSubscription.ts
|
|
2010
|
+
import {
|
|
2011
|
+
combineCodec as combineCodec29,
|
|
2012
|
+
getProgramDerivedAddress as getProgramDerivedAddress10,
|
|
2013
|
+
getStructDecoder as getStructDecoder27,
|
|
2014
|
+
getStructEncoder as getStructEncoder27,
|
|
2015
|
+
getU8Decoder as getU8Decoder16,
|
|
2016
|
+
getU8Encoder as getU8Encoder16,
|
|
2017
|
+
getUtf8Encoder as getUtf8Encoder12,
|
|
2018
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS10,
|
|
2019
|
+
SolanaError as SolanaError10,
|
|
2020
|
+
transformEncoder as transformEncoder10
|
|
2021
|
+
} from "@solana/kit";
|
|
2022
|
+
import {
|
|
2023
|
+
getAccountMetaFactory as getAccountMetaFactory10,
|
|
1775
2024
|
getAddressFromResolvedInstructionAccount as getAddressFromResolvedInstructionAccount4
|
|
1776
2025
|
} from "@solana/program-client-core";
|
|
1777
2026
|
var RESUME_SUBSCRIPTION_DISCRIMINATOR = 13;
|
|
1778
2027
|
function getResumeSubscriptionDiscriminatorBytes() {
|
|
1779
|
-
return
|
|
2028
|
+
return getU8Encoder16().encode(RESUME_SUBSCRIPTION_DISCRIMINATOR);
|
|
1780
2029
|
}
|
|
1781
2030
|
function getResumeSubscriptionInstructionDataEncoder() {
|
|
1782
|
-
return
|
|
1783
|
-
|
|
1784
|
-
["discriminator",
|
|
2031
|
+
return transformEncoder10(
|
|
2032
|
+
getStructEncoder27([
|
|
2033
|
+
["discriminator", getU8Encoder16()],
|
|
1785
2034
|
["resumeData", getResumeDataEncoder()]
|
|
1786
2035
|
]),
|
|
1787
2036
|
(value) => ({ ...value, discriminator: RESUME_SUBSCRIPTION_DISCRIMINATOR })
|
|
1788
2037
|
);
|
|
1789
2038
|
}
|
|
1790
2039
|
function getResumeSubscriptionInstructionDataDecoder() {
|
|
1791
|
-
return
|
|
1792
|
-
["discriminator",
|
|
2040
|
+
return getStructDecoder27([
|
|
2041
|
+
["discriminator", getU8Decoder16()],
|
|
1793
2042
|
["resumeData", getResumeDataDecoder()]
|
|
1794
2043
|
]);
|
|
1795
2044
|
}
|
|
1796
2045
|
function getResumeSubscriptionInstructionDataCodec() {
|
|
1797
|
-
return
|
|
2046
|
+
return combineCodec29(getResumeSubscriptionInstructionDataEncoder(), getResumeSubscriptionInstructionDataDecoder());
|
|
1798
2047
|
}
|
|
1799
2048
|
async function getResumeSubscriptionInstructionAsync(input, config) {
|
|
1800
|
-
const
|
|
2049
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2050
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2051
|
+
const getAccountMeta = getAccountMetaFactory10(programAddress, "programId");
|
|
1801
2052
|
const originalAccounts = {
|
|
1802
|
-
subscriber: { value: input.subscriber ?? null, isWritable: false },
|
|
1803
|
-
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
1804
|
-
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
1805
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },
|
|
1806
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
1807
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
2053
|
+
subscriber: { value: input.subscriber ?? null, isSigner: true, isWritable: false },
|
|
2054
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: false },
|
|
2055
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isSigner: false, isWritable: true },
|
|
2056
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false },
|
|
2057
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2058
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
1808
2059
|
};
|
|
1809
2060
|
const accounts = originalAccounts;
|
|
1810
2061
|
const args = { ...input };
|
|
1811
2062
|
if (!accounts.subscriptionPda.value) {
|
|
1812
|
-
accounts.subscriptionPda.value = await findSubscriptionDelegationPda(
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
2063
|
+
accounts.subscriptionPda.value = await findSubscriptionDelegationPda(
|
|
2064
|
+
{
|
|
2065
|
+
planPda: getAddressFromResolvedInstructionAccount4("planPda", accounts.planPda.value),
|
|
2066
|
+
subscriber: getAddressFromResolvedInstructionAccount4("subscriber", accounts.subscriber.value)
|
|
2067
|
+
},
|
|
2068
|
+
{ programAddress }
|
|
2069
|
+
);
|
|
1816
2070
|
}
|
|
1817
2071
|
if (!accounts.eventAuthority.value) {
|
|
1818
|
-
accounts.eventAuthority.value = await
|
|
2072
|
+
accounts.eventAuthority.value = await getProgramDerivedAddress10({
|
|
1819
2073
|
programAddress,
|
|
1820
|
-
seeds: [
|
|
2074
|
+
seeds: [getUtf8Encoder12().encode("event_authority")]
|
|
1821
2075
|
});
|
|
1822
2076
|
}
|
|
1823
2077
|
if (!accounts.selfProgram.value) {
|
|
1824
2078
|
accounts.selfProgram.value = programAddress;
|
|
1825
2079
|
accounts.selfProgram.isWritable = false;
|
|
1826
2080
|
}
|
|
1827
|
-
const getAccountMeta = getAccountMetaFactory9(programAddress, "programId");
|
|
1828
2081
|
return Object.freeze({
|
|
1829
2082
|
accounts: [
|
|
1830
2083
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -1839,14 +2092,16 @@ async function getResumeSubscriptionInstructionAsync(input, config) {
|
|
|
1839
2092
|
});
|
|
1840
2093
|
}
|
|
1841
2094
|
function getResumeSubscriptionInstruction(input, config) {
|
|
1842
|
-
const
|
|
2095
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2096
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2097
|
+
const getAccountMeta = getAccountMetaFactory10(programAddress, "programId");
|
|
1843
2098
|
const originalAccounts = {
|
|
1844
|
-
subscriber: { value: input.subscriber ?? null, isWritable: false },
|
|
1845
|
-
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
1846
|
-
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
1847
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },
|
|
1848
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
1849
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
2099
|
+
subscriber: { value: input.subscriber ?? null, isSigner: true, isWritable: false },
|
|
2100
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: false },
|
|
2101
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isSigner: false, isWritable: true },
|
|
2102
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false },
|
|
2103
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2104
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
1850
2105
|
};
|
|
1851
2106
|
const accounts = originalAccounts;
|
|
1852
2107
|
const args = { ...input };
|
|
@@ -1854,7 +2109,6 @@ function getResumeSubscriptionInstruction(input, config) {
|
|
|
1854
2109
|
accounts.selfProgram.value = programAddress;
|
|
1855
2110
|
accounts.selfProgram.isWritable = false;
|
|
1856
2111
|
}
|
|
1857
|
-
const getAccountMeta = getAccountMetaFactory9(programAddress, "programId");
|
|
1858
2112
|
return Object.freeze({
|
|
1859
2113
|
accounts: [
|
|
1860
2114
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -1870,7 +2124,7 @@ function getResumeSubscriptionInstruction(input, config) {
|
|
|
1870
2124
|
}
|
|
1871
2125
|
function parseResumeSubscriptionInstruction(instruction) {
|
|
1872
2126
|
if (instruction.accounts.length < 6) {
|
|
1873
|
-
throw new
|
|
2127
|
+
throw new SolanaError10(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS10, {
|
|
1874
2128
|
actualAccountMetas: instruction.accounts.length,
|
|
1875
2129
|
expectedAccountMetas: 6
|
|
1876
2130
|
});
|
|
@@ -1897,44 +2151,47 @@ function parseResumeSubscriptionInstruction(instruction) {
|
|
|
1897
2151
|
|
|
1898
2152
|
// src/generated/instructions/revokeAbandonedDelegation.ts
|
|
1899
2153
|
import {
|
|
1900
|
-
combineCodec as
|
|
1901
|
-
getStructDecoder as
|
|
1902
|
-
getStructEncoder as
|
|
1903
|
-
getU8Decoder as
|
|
1904
|
-
getU8Encoder as
|
|
1905
|
-
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as
|
|
1906
|
-
SolanaError as
|
|
1907
|
-
transformEncoder as
|
|
2154
|
+
combineCodec as combineCodec30,
|
|
2155
|
+
getStructDecoder as getStructDecoder28,
|
|
2156
|
+
getStructEncoder as getStructEncoder28,
|
|
2157
|
+
getU8Decoder as getU8Decoder17,
|
|
2158
|
+
getU8Encoder as getU8Encoder17,
|
|
2159
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS11,
|
|
2160
|
+
SolanaError as SolanaError11,
|
|
2161
|
+
transformEncoder as transformEncoder11
|
|
1908
2162
|
} from "@solana/kit";
|
|
1909
|
-
import {
|
|
2163
|
+
import {
|
|
2164
|
+
getAccountMetaFactory as getAccountMetaFactory11
|
|
2165
|
+
} from "@solana/program-client-core";
|
|
1910
2166
|
var REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR = 15;
|
|
1911
2167
|
function getRevokeAbandonedDelegationDiscriminatorBytes() {
|
|
1912
|
-
return
|
|
2168
|
+
return getU8Encoder17().encode(REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR);
|
|
1913
2169
|
}
|
|
1914
2170
|
function getRevokeAbandonedDelegationInstructionDataEncoder() {
|
|
1915
|
-
return
|
|
2171
|
+
return transformEncoder11(getStructEncoder28([["discriminator", getU8Encoder17()]]), (value) => ({
|
|
1916
2172
|
...value,
|
|
1917
2173
|
discriminator: REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR
|
|
1918
2174
|
}));
|
|
1919
2175
|
}
|
|
1920
2176
|
function getRevokeAbandonedDelegationInstructionDataDecoder() {
|
|
1921
|
-
return
|
|
2177
|
+
return getStructDecoder28([["discriminator", getU8Decoder17()]]);
|
|
1922
2178
|
}
|
|
1923
2179
|
function getRevokeAbandonedDelegationInstructionDataCodec() {
|
|
1924
|
-
return
|
|
2180
|
+
return combineCodec30(
|
|
1925
2181
|
getRevokeAbandonedDelegationInstructionDataEncoder(),
|
|
1926
2182
|
getRevokeAbandonedDelegationInstructionDataDecoder()
|
|
1927
2183
|
);
|
|
1928
2184
|
}
|
|
1929
2185
|
function getRevokeAbandonedDelegationInstruction(input, config) {
|
|
1930
|
-
const
|
|
2186
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2187
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2188
|
+
const getAccountMeta = getAccountMetaFactory11(programAddress, "programId");
|
|
1931
2189
|
const originalAccounts = {
|
|
1932
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
1933
|
-
delegationAccount: { value: input.delegationAccount ?? null, isWritable: true },
|
|
1934
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false }
|
|
2190
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true },
|
|
2191
|
+
delegationAccount: { value: input.delegationAccount ?? null, isSigner: false, isWritable: true },
|
|
2192
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false }
|
|
1935
2193
|
};
|
|
1936
2194
|
const accounts = originalAccounts;
|
|
1937
|
-
const getAccountMeta = getAccountMetaFactory10(programAddress, "programId");
|
|
1938
2195
|
return Object.freeze({
|
|
1939
2196
|
accounts: [
|
|
1940
2197
|
getAccountMeta("payer", accounts.payer),
|
|
@@ -1947,7 +2204,7 @@ function getRevokeAbandonedDelegationInstruction(input, config) {
|
|
|
1947
2204
|
}
|
|
1948
2205
|
function parseRevokeAbandonedDelegationInstruction(instruction) {
|
|
1949
2206
|
if (instruction.accounts.length < 3) {
|
|
1950
|
-
throw new
|
|
2207
|
+
throw new SolanaError11(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS11, {
|
|
1951
2208
|
actualAccountMetas: instruction.accounts.length,
|
|
1952
2209
|
expectedAccountMetas: 3
|
|
1953
2210
|
});
|
|
@@ -1971,45 +2228,48 @@ function parseRevokeAbandonedDelegationInstruction(instruction) {
|
|
|
1971
2228
|
|
|
1972
2229
|
// src/generated/instructions/revokeAbandonedSubscription.ts
|
|
1973
2230
|
import {
|
|
1974
|
-
combineCodec as
|
|
1975
|
-
getStructDecoder as
|
|
1976
|
-
getStructEncoder as
|
|
1977
|
-
getU8Decoder as
|
|
1978
|
-
getU8Encoder as
|
|
1979
|
-
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as
|
|
1980
|
-
SolanaError as
|
|
1981
|
-
transformEncoder as
|
|
2231
|
+
combineCodec as combineCodec31,
|
|
2232
|
+
getStructDecoder as getStructDecoder29,
|
|
2233
|
+
getStructEncoder as getStructEncoder29,
|
|
2234
|
+
getU8Decoder as getU8Decoder18,
|
|
2235
|
+
getU8Encoder as getU8Encoder18,
|
|
2236
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS12,
|
|
2237
|
+
SolanaError as SolanaError12,
|
|
2238
|
+
transformEncoder as transformEncoder12
|
|
1982
2239
|
} from "@solana/kit";
|
|
1983
|
-
import {
|
|
2240
|
+
import {
|
|
2241
|
+
getAccountMetaFactory as getAccountMetaFactory12
|
|
2242
|
+
} from "@solana/program-client-core";
|
|
1984
2243
|
var REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR = 16;
|
|
1985
2244
|
function getRevokeAbandonedSubscriptionDiscriminatorBytes() {
|
|
1986
|
-
return
|
|
2245
|
+
return getU8Encoder18().encode(REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR);
|
|
1987
2246
|
}
|
|
1988
2247
|
function getRevokeAbandonedSubscriptionInstructionDataEncoder() {
|
|
1989
|
-
return
|
|
2248
|
+
return transformEncoder12(getStructEncoder29([["discriminator", getU8Encoder18()]]), (value) => ({
|
|
1990
2249
|
...value,
|
|
1991
2250
|
discriminator: REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR
|
|
1992
2251
|
}));
|
|
1993
2252
|
}
|
|
1994
2253
|
function getRevokeAbandonedSubscriptionInstructionDataDecoder() {
|
|
1995
|
-
return
|
|
2254
|
+
return getStructDecoder29([["discriminator", getU8Decoder18()]]);
|
|
1996
2255
|
}
|
|
1997
2256
|
function getRevokeAbandonedSubscriptionInstructionDataCodec() {
|
|
1998
|
-
return
|
|
2257
|
+
return combineCodec31(
|
|
1999
2258
|
getRevokeAbandonedSubscriptionInstructionDataEncoder(),
|
|
2000
2259
|
getRevokeAbandonedSubscriptionInstructionDataDecoder()
|
|
2001
2260
|
);
|
|
2002
2261
|
}
|
|
2003
2262
|
function getRevokeAbandonedSubscriptionInstruction(input, config) {
|
|
2004
|
-
const
|
|
2263
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2264
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2265
|
+
const getAccountMeta = getAccountMetaFactory12(programAddress, "programId");
|
|
2005
2266
|
const originalAccounts = {
|
|
2006
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
2007
|
-
subscriptionAccount: { value: input.subscriptionAccount ?? null, isWritable: true },
|
|
2008
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },
|
|
2009
|
-
planPda: { value: input.planPda ?? null, isWritable: false }
|
|
2267
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true },
|
|
2268
|
+
subscriptionAccount: { value: input.subscriptionAccount ?? null, isSigner: false, isWritable: true },
|
|
2269
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false },
|
|
2270
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: false }
|
|
2010
2271
|
};
|
|
2011
2272
|
const accounts = originalAccounts;
|
|
2012
|
-
const getAccountMeta = getAccountMetaFactory11(programAddress, "programId");
|
|
2013
2273
|
return Object.freeze({
|
|
2014
2274
|
accounts: [
|
|
2015
2275
|
getAccountMeta("payer", accounts.payer),
|
|
@@ -2023,7 +2283,7 @@ function getRevokeAbandonedSubscriptionInstruction(input, config) {
|
|
|
2023
2283
|
}
|
|
2024
2284
|
function parseRevokeAbandonedSubscriptionInstruction(instruction) {
|
|
2025
2285
|
if (instruction.accounts.length < 4) {
|
|
2026
|
-
throw new
|
|
2286
|
+
throw new SolanaError12(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS12, {
|
|
2027
2287
|
actualAccountMetas: instruction.accounts.length,
|
|
2028
2288
|
expectedAccountMetas: 4
|
|
2029
2289
|
});
|
|
@@ -2048,40 +2308,43 @@ function parseRevokeAbandonedSubscriptionInstruction(instruction) {
|
|
|
2048
2308
|
|
|
2049
2309
|
// src/generated/instructions/revokeDelegation.ts
|
|
2050
2310
|
import {
|
|
2051
|
-
combineCodec as
|
|
2052
|
-
getStructDecoder as
|
|
2053
|
-
getStructEncoder as
|
|
2054
|
-
getU8Decoder as
|
|
2055
|
-
getU8Encoder as
|
|
2056
|
-
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as
|
|
2057
|
-
SolanaError as
|
|
2058
|
-
transformEncoder as
|
|
2311
|
+
combineCodec as combineCodec32,
|
|
2312
|
+
getStructDecoder as getStructDecoder30,
|
|
2313
|
+
getStructEncoder as getStructEncoder30,
|
|
2314
|
+
getU8Decoder as getU8Decoder19,
|
|
2315
|
+
getU8Encoder as getU8Encoder19,
|
|
2316
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS13,
|
|
2317
|
+
SolanaError as SolanaError13,
|
|
2318
|
+
transformEncoder as transformEncoder13
|
|
2059
2319
|
} from "@solana/kit";
|
|
2060
|
-
import {
|
|
2320
|
+
import {
|
|
2321
|
+
getAccountMetaFactory as getAccountMetaFactory13
|
|
2322
|
+
} from "@solana/program-client-core";
|
|
2061
2323
|
var REVOKE_DELEGATION_DISCRIMINATOR = 3;
|
|
2062
2324
|
function getRevokeDelegationDiscriminatorBytes() {
|
|
2063
|
-
return
|
|
2325
|
+
return getU8Encoder19().encode(REVOKE_DELEGATION_DISCRIMINATOR);
|
|
2064
2326
|
}
|
|
2065
2327
|
function getRevokeDelegationInstructionDataEncoder() {
|
|
2066
|
-
return
|
|
2328
|
+
return transformEncoder13(getStructEncoder30([["discriminator", getU8Encoder19()]]), (value) => ({
|
|
2067
2329
|
...value,
|
|
2068
2330
|
discriminator: REVOKE_DELEGATION_DISCRIMINATOR
|
|
2069
2331
|
}));
|
|
2070
2332
|
}
|
|
2071
2333
|
function getRevokeDelegationInstructionDataDecoder() {
|
|
2072
|
-
return
|
|
2334
|
+
return getStructDecoder30([["discriminator", getU8Decoder19()]]);
|
|
2073
2335
|
}
|
|
2074
2336
|
function getRevokeDelegationInstructionDataCodec() {
|
|
2075
|
-
return
|
|
2337
|
+
return combineCodec32(getRevokeDelegationInstructionDataEncoder(), getRevokeDelegationInstructionDataDecoder());
|
|
2076
2338
|
}
|
|
2077
2339
|
function getRevokeDelegationInstruction(input, config) {
|
|
2078
|
-
const
|
|
2340
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2341
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2342
|
+
const getAccountMeta = getAccountMetaFactory13(programAddress, "programId");
|
|
2079
2343
|
const originalAccounts = {
|
|
2080
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
2081
|
-
delegationAccount: { value: input.delegationAccount ?? null, isWritable: true }
|
|
2344
|
+
authority: { value: input.authority ?? null, isSigner: true, isWritable: true },
|
|
2345
|
+
delegationAccount: { value: input.delegationAccount ?? null, isSigner: false, isWritable: true }
|
|
2082
2346
|
};
|
|
2083
2347
|
const accounts = originalAccounts;
|
|
2084
|
-
const getAccountMeta = getAccountMetaFactory12(programAddress, "programId");
|
|
2085
2348
|
return Object.freeze({
|
|
2086
2349
|
accounts: [
|
|
2087
2350
|
getAccountMeta("authority", accounts.authority),
|
|
@@ -2093,7 +2356,7 @@ function getRevokeDelegationInstruction(input, config) {
|
|
|
2093
2356
|
}
|
|
2094
2357
|
function parseRevokeDelegationInstruction(instruction) {
|
|
2095
2358
|
if (instruction.accounts.length < 2) {
|
|
2096
|
-
throw new
|
|
2359
|
+
throw new SolanaError13(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS13, {
|
|
2097
2360
|
actualAccountMetas: instruction.accounts.length,
|
|
2098
2361
|
expectedAccountMetas: 2
|
|
2099
2362
|
});
|
|
@@ -2113,56 +2376,60 @@ function parseRevokeDelegationInstruction(instruction) {
|
|
|
2113
2376
|
|
|
2114
2377
|
// src/generated/instructions/revokeSubscriptionAuthority.ts
|
|
2115
2378
|
import {
|
|
2116
|
-
combineCodec as
|
|
2117
|
-
getStructDecoder as
|
|
2118
|
-
getStructEncoder as
|
|
2119
|
-
getU8Decoder as
|
|
2120
|
-
getU8Encoder as
|
|
2121
|
-
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as
|
|
2122
|
-
SolanaError as
|
|
2123
|
-
transformEncoder as
|
|
2379
|
+
combineCodec as combineCodec33,
|
|
2380
|
+
getStructDecoder as getStructDecoder31,
|
|
2381
|
+
getStructEncoder as getStructEncoder31,
|
|
2382
|
+
getU8Decoder as getU8Decoder20,
|
|
2383
|
+
getU8Encoder as getU8Encoder20,
|
|
2384
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS14,
|
|
2385
|
+
SolanaError as SolanaError14,
|
|
2386
|
+
transformEncoder as transformEncoder14
|
|
2124
2387
|
} from "@solana/kit";
|
|
2125
2388
|
import {
|
|
2126
|
-
getAccountMetaFactory as
|
|
2389
|
+
getAccountMetaFactory as getAccountMetaFactory14,
|
|
2127
2390
|
getAddressFromResolvedInstructionAccount as getAddressFromResolvedInstructionAccount5
|
|
2128
2391
|
} from "@solana/program-client-core";
|
|
2129
2392
|
var REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 14;
|
|
2130
2393
|
function getRevokeSubscriptionAuthorityDiscriminatorBytes() {
|
|
2131
|
-
return
|
|
2394
|
+
return getU8Encoder20().encode(REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);
|
|
2132
2395
|
}
|
|
2133
2396
|
function getRevokeSubscriptionAuthorityInstructionDataEncoder() {
|
|
2134
|
-
return
|
|
2397
|
+
return transformEncoder14(getStructEncoder31([["discriminator", getU8Encoder20()]]), (value) => ({
|
|
2135
2398
|
...value,
|
|
2136
2399
|
discriminator: REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR
|
|
2137
2400
|
}));
|
|
2138
2401
|
}
|
|
2139
2402
|
function getRevokeSubscriptionAuthorityInstructionDataDecoder() {
|
|
2140
|
-
return
|
|
2403
|
+
return getStructDecoder31([["discriminator", getU8Decoder20()]]);
|
|
2141
2404
|
}
|
|
2142
2405
|
function getRevokeSubscriptionAuthorityInstructionDataCodec() {
|
|
2143
|
-
return
|
|
2406
|
+
return combineCodec33(
|
|
2144
2407
|
getRevokeSubscriptionAuthorityInstructionDataEncoder(),
|
|
2145
2408
|
getRevokeSubscriptionAuthorityInstructionDataDecoder()
|
|
2146
2409
|
);
|
|
2147
2410
|
}
|
|
2148
2411
|
async function getRevokeSubscriptionAuthorityInstructionAsync(input, config) {
|
|
2149
|
-
const
|
|
2412
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2413
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2414
|
+
const getAccountMeta = getAccountMetaFactory14(programAddress, "omitted");
|
|
2150
2415
|
const originalAccounts = {
|
|
2151
|
-
user: { value: input.user ?? null, isWritable: true },
|
|
2152
|
-
userAta: { value: input.userAta ?? null, isWritable: true },
|
|
2153
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
2154
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
2155
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },
|
|
2156
|
-
receiver: { value: input.receiver ?? null, isWritable: true }
|
|
2416
|
+
user: { value: input.user ?? null, isSigner: true, isWritable: true },
|
|
2417
|
+
userAta: { value: input.userAta ?? null, isSigner: false, isWritable: true },
|
|
2418
|
+
tokenMint: { value: input.tokenMint ?? null, isSigner: false, isWritable: false },
|
|
2419
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
2420
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: true },
|
|
2421
|
+
receiver: { value: input.receiver ?? null, isSigner: false, isWritable: true }
|
|
2157
2422
|
};
|
|
2158
2423
|
const accounts = originalAccounts;
|
|
2159
2424
|
if (!accounts.subscriptionAuthority.value) {
|
|
2160
|
-
accounts.subscriptionAuthority.value = await findSubscriptionAuthorityPda(
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2425
|
+
accounts.subscriptionAuthority.value = await findSubscriptionAuthorityPda(
|
|
2426
|
+
{
|
|
2427
|
+
user: getAddressFromResolvedInstructionAccount5("user", accounts.user.value),
|
|
2428
|
+
tokenMint: getAddressFromResolvedInstructionAccount5("tokenMint", accounts.tokenMint.value)
|
|
2429
|
+
},
|
|
2430
|
+
{ programAddress }
|
|
2431
|
+
);
|
|
2164
2432
|
}
|
|
2165
|
-
const getAccountMeta = getAccountMetaFactory13(programAddress, "omitted");
|
|
2166
2433
|
return Object.freeze({
|
|
2167
2434
|
accounts: [
|
|
2168
2435
|
getAccountMeta("user", accounts.user),
|
|
@@ -2177,17 +2444,18 @@ async function getRevokeSubscriptionAuthorityInstructionAsync(input, config) {
|
|
|
2177
2444
|
});
|
|
2178
2445
|
}
|
|
2179
2446
|
function getRevokeSubscriptionAuthorityInstruction(input, config) {
|
|
2180
|
-
const
|
|
2447
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2448
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2449
|
+
const getAccountMeta = getAccountMetaFactory14(programAddress, "omitted");
|
|
2181
2450
|
const originalAccounts = {
|
|
2182
|
-
user: { value: input.user ?? null, isWritable: true },
|
|
2183
|
-
userAta: { value: input.userAta ?? null, isWritable: true },
|
|
2184
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
2185
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
2186
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },
|
|
2187
|
-
receiver: { value: input.receiver ?? null, isWritable: true }
|
|
2451
|
+
user: { value: input.user ?? null, isSigner: true, isWritable: true },
|
|
2452
|
+
userAta: { value: input.userAta ?? null, isSigner: false, isWritable: true },
|
|
2453
|
+
tokenMint: { value: input.tokenMint ?? null, isSigner: false, isWritable: false },
|
|
2454
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
2455
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: true },
|
|
2456
|
+
receiver: { value: input.receiver ?? null, isSigner: false, isWritable: true }
|
|
2188
2457
|
};
|
|
2189
2458
|
const accounts = originalAccounts;
|
|
2190
|
-
const getAccountMeta = getAccountMetaFactory13(programAddress, "omitted");
|
|
2191
2459
|
return Object.freeze({
|
|
2192
2460
|
accounts: [
|
|
2193
2461
|
getAccountMeta("user", accounts.user),
|
|
@@ -2203,7 +2471,7 @@ function getRevokeSubscriptionAuthorityInstruction(input, config) {
|
|
|
2203
2471
|
}
|
|
2204
2472
|
function parseRevokeSubscriptionAuthorityInstruction(instruction) {
|
|
2205
2473
|
if (instruction.accounts.length < 5) {
|
|
2206
|
-
throw new
|
|
2474
|
+
throw new SolanaError14(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS14, {
|
|
2207
2475
|
actualAccountMetas: instruction.accounts.length,
|
|
2208
2476
|
expectedAccountMetas: 5
|
|
2209
2477
|
});
|
|
@@ -2236,78 +2504,82 @@ function parseRevokeSubscriptionAuthorityInstruction(instruction) {
|
|
|
2236
2504
|
|
|
2237
2505
|
// src/generated/instructions/subscribe.ts
|
|
2238
2506
|
import {
|
|
2239
|
-
combineCodec as
|
|
2240
|
-
getProgramDerivedAddress as
|
|
2241
|
-
getStructDecoder as
|
|
2242
|
-
getStructEncoder as
|
|
2243
|
-
getU8Decoder as
|
|
2244
|
-
getU8Encoder as
|
|
2245
|
-
getUtf8Encoder as
|
|
2246
|
-
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as
|
|
2247
|
-
SolanaError as
|
|
2248
|
-
transformEncoder as
|
|
2507
|
+
combineCodec as combineCodec34,
|
|
2508
|
+
getProgramDerivedAddress as getProgramDerivedAddress11,
|
|
2509
|
+
getStructDecoder as getStructDecoder32,
|
|
2510
|
+
getStructEncoder as getStructEncoder32,
|
|
2511
|
+
getU8Decoder as getU8Decoder21,
|
|
2512
|
+
getU8Encoder as getU8Encoder21,
|
|
2513
|
+
getUtf8Encoder as getUtf8Encoder13,
|
|
2514
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS15,
|
|
2515
|
+
SolanaError as SolanaError15,
|
|
2516
|
+
transformEncoder as transformEncoder15
|
|
2249
2517
|
} from "@solana/kit";
|
|
2250
2518
|
import {
|
|
2251
|
-
getAccountMetaFactory as
|
|
2519
|
+
getAccountMetaFactory as getAccountMetaFactory15,
|
|
2252
2520
|
getAddressFromResolvedInstructionAccount as getAddressFromResolvedInstructionAccount6
|
|
2253
2521
|
} from "@solana/program-client-core";
|
|
2254
2522
|
var SUBSCRIBE_DISCRIMINATOR = 11;
|
|
2255
2523
|
function getSubscribeDiscriminatorBytes() {
|
|
2256
|
-
return
|
|
2524
|
+
return getU8Encoder21().encode(SUBSCRIBE_DISCRIMINATOR);
|
|
2257
2525
|
}
|
|
2258
2526
|
function getSubscribeInstructionDataEncoder() {
|
|
2259
|
-
return
|
|
2260
|
-
|
|
2261
|
-
["discriminator",
|
|
2527
|
+
return transformEncoder15(
|
|
2528
|
+
getStructEncoder32([
|
|
2529
|
+
["discriminator", getU8Encoder21()],
|
|
2262
2530
|
["subscribeData", getSubscribeDataEncoder()]
|
|
2263
2531
|
]),
|
|
2264
2532
|
(value) => ({ ...value, discriminator: SUBSCRIBE_DISCRIMINATOR })
|
|
2265
2533
|
);
|
|
2266
2534
|
}
|
|
2267
2535
|
function getSubscribeInstructionDataDecoder() {
|
|
2268
|
-
return
|
|
2269
|
-
["discriminator",
|
|
2536
|
+
return getStructDecoder32([
|
|
2537
|
+
["discriminator", getU8Decoder21()],
|
|
2270
2538
|
["subscribeData", getSubscribeDataDecoder()]
|
|
2271
2539
|
]);
|
|
2272
2540
|
}
|
|
2273
2541
|
function getSubscribeInstructionDataCodec() {
|
|
2274
|
-
return
|
|
2542
|
+
return combineCodec34(getSubscribeInstructionDataEncoder(), getSubscribeInstructionDataDecoder());
|
|
2275
2543
|
}
|
|
2276
2544
|
async function getSubscribeInstructionAsync(input, config) {
|
|
2277
|
-
const
|
|
2545
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2546
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2547
|
+
const getAccountMeta = getAccountMetaFactory15(programAddress, "omitted");
|
|
2278
2548
|
const originalAccounts = {
|
|
2279
|
-
subscriber: { value: input.subscriber ?? null, isWritable: true },
|
|
2280
|
-
merchant: { value: input.merchant ?? null, isWritable: false },
|
|
2281
|
-
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
2282
|
-
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
2283
|
-
subscriptionAuthorityPda: { value: input.subscriptionAuthorityPda ?? null, isWritable: false },
|
|
2284
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
2285
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
2286
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false },
|
|
2287
|
-
payer: { value: input.payer ?? null, isWritable: true }
|
|
2549
|
+
subscriber: { value: input.subscriber ?? null, isSigner: true, isWritable: true },
|
|
2550
|
+
merchant: { value: input.merchant ?? null, isSigner: false, isWritable: false },
|
|
2551
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: false },
|
|
2552
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isSigner: false, isWritable: true },
|
|
2553
|
+
subscriptionAuthorityPda: { value: input.subscriptionAuthorityPda ?? null, isSigner: false, isWritable: false },
|
|
2554
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
2555
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2556
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false },
|
|
2557
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true }
|
|
2288
2558
|
};
|
|
2289
2559
|
const accounts = originalAccounts;
|
|
2290
2560
|
const args = { ...input };
|
|
2291
2561
|
if (!accounts.subscriptionPda.value) {
|
|
2292
|
-
accounts.subscriptionPda.value = await findSubscriptionDelegationPda(
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2562
|
+
accounts.subscriptionPda.value = await findSubscriptionDelegationPda(
|
|
2563
|
+
{
|
|
2564
|
+
planPda: getAddressFromResolvedInstructionAccount6("planPda", accounts.planPda.value),
|
|
2565
|
+
subscriber: getAddressFromResolvedInstructionAccount6("subscriber", accounts.subscriber.value)
|
|
2566
|
+
},
|
|
2567
|
+
{ programAddress }
|
|
2568
|
+
);
|
|
2296
2569
|
}
|
|
2297
2570
|
if (!accounts.systemProgram.value) {
|
|
2298
2571
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2299
2572
|
}
|
|
2300
2573
|
if (!accounts.eventAuthority.value) {
|
|
2301
|
-
accounts.eventAuthority.value = await
|
|
2574
|
+
accounts.eventAuthority.value = await getProgramDerivedAddress11({
|
|
2302
2575
|
programAddress,
|
|
2303
|
-
seeds: [
|
|
2576
|
+
seeds: [getUtf8Encoder13().encode("event_authority")]
|
|
2304
2577
|
});
|
|
2305
2578
|
}
|
|
2306
2579
|
if (!accounts.selfProgram.value) {
|
|
2307
2580
|
accounts.selfProgram.value = programAddress;
|
|
2308
2581
|
accounts.selfProgram.isWritable = false;
|
|
2309
2582
|
}
|
|
2310
|
-
const getAccountMeta = getAccountMetaFactory14(programAddress, "omitted");
|
|
2311
2583
|
return Object.freeze({
|
|
2312
2584
|
accounts: [
|
|
2313
2585
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -2325,17 +2597,19 @@ async function getSubscribeInstructionAsync(input, config) {
|
|
|
2325
2597
|
});
|
|
2326
2598
|
}
|
|
2327
2599
|
function getSubscribeInstruction(input, config) {
|
|
2328
|
-
const
|
|
2600
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2601
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2602
|
+
const getAccountMeta = getAccountMetaFactory15(programAddress, "omitted");
|
|
2329
2603
|
const originalAccounts = {
|
|
2330
|
-
subscriber: { value: input.subscriber ?? null, isWritable: true },
|
|
2331
|
-
merchant: { value: input.merchant ?? null, isWritable: false },
|
|
2332
|
-
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
2333
|
-
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
2334
|
-
subscriptionAuthorityPda: { value: input.subscriptionAuthorityPda ?? null, isWritable: false },
|
|
2335
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
2336
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
2337
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false },
|
|
2338
|
-
payer: { value: input.payer ?? null, isWritable: true }
|
|
2604
|
+
subscriber: { value: input.subscriber ?? null, isSigner: true, isWritable: true },
|
|
2605
|
+
merchant: { value: input.merchant ?? null, isSigner: false, isWritable: false },
|
|
2606
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: false },
|
|
2607
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isSigner: false, isWritable: true },
|
|
2608
|
+
subscriptionAuthorityPda: { value: input.subscriptionAuthorityPda ?? null, isSigner: false, isWritable: false },
|
|
2609
|
+
systemProgram: { value: input.systemProgram ?? null, isSigner: false, isWritable: false },
|
|
2610
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2611
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false },
|
|
2612
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true }
|
|
2339
2613
|
};
|
|
2340
2614
|
const accounts = originalAccounts;
|
|
2341
2615
|
const args = { ...input };
|
|
@@ -2346,7 +2620,6 @@ function getSubscribeInstruction(input, config) {
|
|
|
2346
2620
|
accounts.selfProgram.value = programAddress;
|
|
2347
2621
|
accounts.selfProgram.isWritable = false;
|
|
2348
2622
|
}
|
|
2349
|
-
const getAccountMeta = getAccountMetaFactory14(programAddress, "omitted");
|
|
2350
2623
|
return Object.freeze({
|
|
2351
2624
|
accounts: [
|
|
2352
2625
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -2365,7 +2638,7 @@ function getSubscribeInstruction(input, config) {
|
|
|
2365
2638
|
}
|
|
2366
2639
|
function parseSubscribeInstruction(instruction) {
|
|
2367
2640
|
if (instruction.accounts.length < 8) {
|
|
2368
|
-
throw new
|
|
2641
|
+
throw new SolanaError15(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS15, {
|
|
2369
2642
|
actualAccountMetas: instruction.accounts.length,
|
|
2370
2643
|
expectedAccountMetas: 8
|
|
2371
2644
|
});
|
|
@@ -2401,66 +2674,69 @@ function parseSubscribeInstruction(instruction) {
|
|
|
2401
2674
|
|
|
2402
2675
|
// src/generated/instructions/transferFixed.ts
|
|
2403
2676
|
import {
|
|
2404
|
-
combineCodec as
|
|
2405
|
-
getProgramDerivedAddress as
|
|
2406
|
-
getStructDecoder as
|
|
2407
|
-
getStructEncoder as
|
|
2408
|
-
getU8Decoder as
|
|
2409
|
-
getU8Encoder as
|
|
2410
|
-
getUtf8Encoder as
|
|
2411
|
-
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as
|
|
2412
|
-
SolanaError as
|
|
2413
|
-
transformEncoder as
|
|
2677
|
+
combineCodec as combineCodec35,
|
|
2678
|
+
getProgramDerivedAddress as getProgramDerivedAddress12,
|
|
2679
|
+
getStructDecoder as getStructDecoder33,
|
|
2680
|
+
getStructEncoder as getStructEncoder33,
|
|
2681
|
+
getU8Decoder as getU8Decoder22,
|
|
2682
|
+
getU8Encoder as getU8Encoder22,
|
|
2683
|
+
getUtf8Encoder as getUtf8Encoder14,
|
|
2684
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS16,
|
|
2685
|
+
SolanaError as SolanaError16,
|
|
2686
|
+
transformEncoder as transformEncoder16
|
|
2414
2687
|
} from "@solana/kit";
|
|
2415
|
-
import {
|
|
2688
|
+
import {
|
|
2689
|
+
getAccountMetaFactory as getAccountMetaFactory16
|
|
2690
|
+
} from "@solana/program-client-core";
|
|
2416
2691
|
var TRANSFER_FIXED_DISCRIMINATOR = 4;
|
|
2417
2692
|
function getTransferFixedDiscriminatorBytes() {
|
|
2418
|
-
return
|
|
2693
|
+
return getU8Encoder22().encode(TRANSFER_FIXED_DISCRIMINATOR);
|
|
2419
2694
|
}
|
|
2420
2695
|
function getTransferFixedInstructionDataEncoder() {
|
|
2421
|
-
return
|
|
2422
|
-
|
|
2423
|
-
["discriminator",
|
|
2696
|
+
return transformEncoder16(
|
|
2697
|
+
getStructEncoder33([
|
|
2698
|
+
["discriminator", getU8Encoder22()],
|
|
2424
2699
|
["transferData", getTransferDataEncoder()]
|
|
2425
2700
|
]),
|
|
2426
2701
|
(value) => ({ ...value, discriminator: TRANSFER_FIXED_DISCRIMINATOR })
|
|
2427
2702
|
);
|
|
2428
2703
|
}
|
|
2429
2704
|
function getTransferFixedInstructionDataDecoder() {
|
|
2430
|
-
return
|
|
2431
|
-
["discriminator",
|
|
2705
|
+
return getStructDecoder33([
|
|
2706
|
+
["discriminator", getU8Decoder22()],
|
|
2432
2707
|
["transferData", getTransferDataDecoder()]
|
|
2433
2708
|
]);
|
|
2434
2709
|
}
|
|
2435
2710
|
function getTransferFixedInstructionDataCodec() {
|
|
2436
|
-
return
|
|
2711
|
+
return combineCodec35(getTransferFixedInstructionDataEncoder(), getTransferFixedInstructionDataDecoder());
|
|
2437
2712
|
}
|
|
2438
2713
|
async function getTransferFixedInstructionAsync(input, config) {
|
|
2439
|
-
const
|
|
2714
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2715
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2716
|
+
const getAccountMeta = getAccountMetaFactory16(programAddress, "programId");
|
|
2440
2717
|
const originalAccounts = {
|
|
2441
|
-
delegationPda: { value: input.delegationPda ?? null, isWritable: true },
|
|
2442
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },
|
|
2443
|
-
delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },
|
|
2444
|
-
receiverAta: { value: input.receiverAta ?? null, isWritable: true },
|
|
2445
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
2446
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
2447
|
-
delegatee: { value: input.delegatee ?? null, isWritable: false },
|
|
2448
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
2449
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
2718
|
+
delegationPda: { value: input.delegationPda ?? null, isSigner: false, isWritable: true },
|
|
2719
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false },
|
|
2720
|
+
delegatorAta: { value: input.delegatorAta ?? null, isSigner: false, isWritable: true },
|
|
2721
|
+
receiverAta: { value: input.receiverAta ?? null, isSigner: false, isWritable: true },
|
|
2722
|
+
tokenMint: { value: input.tokenMint ?? null, isSigner: false, isWritable: false },
|
|
2723
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
2724
|
+
delegatee: { value: input.delegatee ?? null, isSigner: true, isWritable: false },
|
|
2725
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2726
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
2450
2727
|
};
|
|
2451
2728
|
const accounts = originalAccounts;
|
|
2452
2729
|
const args = { ...input };
|
|
2453
2730
|
if (!accounts.eventAuthority.value) {
|
|
2454
|
-
accounts.eventAuthority.value = await
|
|
2731
|
+
accounts.eventAuthority.value = await getProgramDerivedAddress12({
|
|
2455
2732
|
programAddress,
|
|
2456
|
-
seeds: [
|
|
2733
|
+
seeds: [getUtf8Encoder14().encode("event_authority")]
|
|
2457
2734
|
});
|
|
2458
2735
|
}
|
|
2459
2736
|
if (!accounts.selfProgram.value) {
|
|
2460
2737
|
accounts.selfProgram.value = programAddress;
|
|
2461
2738
|
accounts.selfProgram.isWritable = false;
|
|
2462
2739
|
}
|
|
2463
|
-
const getAccountMeta = getAccountMetaFactory15(programAddress, "programId");
|
|
2464
2740
|
return Object.freeze({
|
|
2465
2741
|
accounts: [
|
|
2466
2742
|
getAccountMeta("delegationPda", accounts.delegationPda),
|
|
@@ -2478,17 +2754,19 @@ async function getTransferFixedInstructionAsync(input, config) {
|
|
|
2478
2754
|
});
|
|
2479
2755
|
}
|
|
2480
2756
|
function getTransferFixedInstruction(input, config) {
|
|
2481
|
-
const
|
|
2757
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2758
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2759
|
+
const getAccountMeta = getAccountMetaFactory16(programAddress, "programId");
|
|
2482
2760
|
const originalAccounts = {
|
|
2483
|
-
delegationPda: { value: input.delegationPda ?? null, isWritable: true },
|
|
2484
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },
|
|
2485
|
-
delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },
|
|
2486
|
-
receiverAta: { value: input.receiverAta ?? null, isWritable: true },
|
|
2487
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
2488
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
2489
|
-
delegatee: { value: input.delegatee ?? null, isWritable: false },
|
|
2490
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
2491
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
2761
|
+
delegationPda: { value: input.delegationPda ?? null, isSigner: false, isWritable: true },
|
|
2762
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false },
|
|
2763
|
+
delegatorAta: { value: input.delegatorAta ?? null, isSigner: false, isWritable: true },
|
|
2764
|
+
receiverAta: { value: input.receiverAta ?? null, isSigner: false, isWritable: true },
|
|
2765
|
+
tokenMint: { value: input.tokenMint ?? null, isSigner: false, isWritable: false },
|
|
2766
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
2767
|
+
delegatee: { value: input.delegatee ?? null, isSigner: true, isWritable: false },
|
|
2768
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2769
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
2492
2770
|
};
|
|
2493
2771
|
const accounts = originalAccounts;
|
|
2494
2772
|
const args = { ...input };
|
|
@@ -2496,7 +2774,6 @@ function getTransferFixedInstruction(input, config) {
|
|
|
2496
2774
|
accounts.selfProgram.value = programAddress;
|
|
2497
2775
|
accounts.selfProgram.isWritable = false;
|
|
2498
2776
|
}
|
|
2499
|
-
const getAccountMeta = getAccountMetaFactory15(programAddress, "programId");
|
|
2500
2777
|
return Object.freeze({
|
|
2501
2778
|
accounts: [
|
|
2502
2779
|
getAccountMeta("delegationPda", accounts.delegationPda),
|
|
@@ -2515,7 +2792,7 @@ function getTransferFixedInstruction(input, config) {
|
|
|
2515
2792
|
}
|
|
2516
2793
|
function parseTransferFixedInstruction(instruction) {
|
|
2517
2794
|
if (instruction.accounts.length < 9) {
|
|
2518
|
-
throw new
|
|
2795
|
+
throw new SolanaError16(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS16, {
|
|
2519
2796
|
actualAccountMetas: instruction.accounts.length,
|
|
2520
2797
|
expectedAccountMetas: 9
|
|
2521
2798
|
});
|
|
@@ -2545,66 +2822,69 @@ function parseTransferFixedInstruction(instruction) {
|
|
|
2545
2822
|
|
|
2546
2823
|
// src/generated/instructions/transferRecurring.ts
|
|
2547
2824
|
import {
|
|
2548
|
-
combineCodec as
|
|
2549
|
-
getProgramDerivedAddress as
|
|
2550
|
-
getStructDecoder as
|
|
2551
|
-
getStructEncoder as
|
|
2552
|
-
getU8Decoder as
|
|
2553
|
-
getU8Encoder as
|
|
2554
|
-
getUtf8Encoder as
|
|
2555
|
-
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as
|
|
2556
|
-
SolanaError as
|
|
2557
|
-
transformEncoder as
|
|
2825
|
+
combineCodec as combineCodec36,
|
|
2826
|
+
getProgramDerivedAddress as getProgramDerivedAddress13,
|
|
2827
|
+
getStructDecoder as getStructDecoder34,
|
|
2828
|
+
getStructEncoder as getStructEncoder34,
|
|
2829
|
+
getU8Decoder as getU8Decoder23,
|
|
2830
|
+
getU8Encoder as getU8Encoder23,
|
|
2831
|
+
getUtf8Encoder as getUtf8Encoder15,
|
|
2832
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS17,
|
|
2833
|
+
SolanaError as SolanaError17,
|
|
2834
|
+
transformEncoder as transformEncoder17
|
|
2558
2835
|
} from "@solana/kit";
|
|
2559
|
-
import {
|
|
2836
|
+
import {
|
|
2837
|
+
getAccountMetaFactory as getAccountMetaFactory17
|
|
2838
|
+
} from "@solana/program-client-core";
|
|
2560
2839
|
var TRANSFER_RECURRING_DISCRIMINATOR = 5;
|
|
2561
2840
|
function getTransferRecurringDiscriminatorBytes() {
|
|
2562
|
-
return
|
|
2841
|
+
return getU8Encoder23().encode(TRANSFER_RECURRING_DISCRIMINATOR);
|
|
2563
2842
|
}
|
|
2564
2843
|
function getTransferRecurringInstructionDataEncoder() {
|
|
2565
|
-
return
|
|
2566
|
-
|
|
2567
|
-
["discriminator",
|
|
2844
|
+
return transformEncoder17(
|
|
2845
|
+
getStructEncoder34([
|
|
2846
|
+
["discriminator", getU8Encoder23()],
|
|
2568
2847
|
["transferData", getTransferDataEncoder()]
|
|
2569
2848
|
]),
|
|
2570
2849
|
(value) => ({ ...value, discriminator: TRANSFER_RECURRING_DISCRIMINATOR })
|
|
2571
2850
|
);
|
|
2572
2851
|
}
|
|
2573
2852
|
function getTransferRecurringInstructionDataDecoder() {
|
|
2574
|
-
return
|
|
2575
|
-
["discriminator",
|
|
2853
|
+
return getStructDecoder34([
|
|
2854
|
+
["discriminator", getU8Decoder23()],
|
|
2576
2855
|
["transferData", getTransferDataDecoder()]
|
|
2577
2856
|
]);
|
|
2578
2857
|
}
|
|
2579
2858
|
function getTransferRecurringInstructionDataCodec() {
|
|
2580
|
-
return
|
|
2859
|
+
return combineCodec36(getTransferRecurringInstructionDataEncoder(), getTransferRecurringInstructionDataDecoder());
|
|
2581
2860
|
}
|
|
2582
2861
|
async function getTransferRecurringInstructionAsync(input, config) {
|
|
2583
|
-
const
|
|
2862
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2863
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2864
|
+
const getAccountMeta = getAccountMetaFactory17(programAddress, "programId");
|
|
2584
2865
|
const originalAccounts = {
|
|
2585
|
-
delegationPda: { value: input.delegationPda ?? null, isWritable: true },
|
|
2586
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },
|
|
2587
|
-
delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },
|
|
2588
|
-
receiverAta: { value: input.receiverAta ?? null, isWritable: true },
|
|
2589
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
2590
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
2591
|
-
delegatee: { value: input.delegatee ?? null, isWritable: false },
|
|
2592
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
2593
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
2866
|
+
delegationPda: { value: input.delegationPda ?? null, isSigner: false, isWritable: true },
|
|
2867
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false },
|
|
2868
|
+
delegatorAta: { value: input.delegatorAta ?? null, isSigner: false, isWritable: true },
|
|
2869
|
+
receiverAta: { value: input.receiverAta ?? null, isSigner: false, isWritable: true },
|
|
2870
|
+
tokenMint: { value: input.tokenMint ?? null, isSigner: false, isWritable: false },
|
|
2871
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
2872
|
+
delegatee: { value: input.delegatee ?? null, isSigner: true, isWritable: false },
|
|
2873
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2874
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
2594
2875
|
};
|
|
2595
2876
|
const accounts = originalAccounts;
|
|
2596
2877
|
const args = { ...input };
|
|
2597
2878
|
if (!accounts.eventAuthority.value) {
|
|
2598
|
-
accounts.eventAuthority.value = await
|
|
2879
|
+
accounts.eventAuthority.value = await getProgramDerivedAddress13({
|
|
2599
2880
|
programAddress,
|
|
2600
|
-
seeds: [
|
|
2881
|
+
seeds: [getUtf8Encoder15().encode("event_authority")]
|
|
2601
2882
|
});
|
|
2602
2883
|
}
|
|
2603
2884
|
if (!accounts.selfProgram.value) {
|
|
2604
2885
|
accounts.selfProgram.value = programAddress;
|
|
2605
2886
|
accounts.selfProgram.isWritable = false;
|
|
2606
2887
|
}
|
|
2607
|
-
const getAccountMeta = getAccountMetaFactory16(programAddress, "programId");
|
|
2608
2888
|
return Object.freeze({
|
|
2609
2889
|
accounts: [
|
|
2610
2890
|
getAccountMeta("delegationPda", accounts.delegationPda),
|
|
@@ -2622,17 +2902,19 @@ async function getTransferRecurringInstructionAsync(input, config) {
|
|
|
2622
2902
|
});
|
|
2623
2903
|
}
|
|
2624
2904
|
function getTransferRecurringInstruction(input, config) {
|
|
2625
|
-
const
|
|
2905
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
2906
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
2907
|
+
const getAccountMeta = getAccountMetaFactory17(programAddress, "programId");
|
|
2626
2908
|
const originalAccounts = {
|
|
2627
|
-
delegationPda: { value: input.delegationPda ?? null, isWritable: true },
|
|
2628
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },
|
|
2629
|
-
delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },
|
|
2630
|
-
receiverAta: { value: input.receiverAta ?? null, isWritable: true },
|
|
2631
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
2632
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
2633
|
-
delegatee: { value: input.delegatee ?? null, isWritable: false },
|
|
2634
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
2635
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
2909
|
+
delegationPda: { value: input.delegationPda ?? null, isSigner: false, isWritable: true },
|
|
2910
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false },
|
|
2911
|
+
delegatorAta: { value: input.delegatorAta ?? null, isSigner: false, isWritable: true },
|
|
2912
|
+
receiverAta: { value: input.receiverAta ?? null, isSigner: false, isWritable: true },
|
|
2913
|
+
tokenMint: { value: input.tokenMint ?? null, isSigner: false, isWritable: false },
|
|
2914
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
2915
|
+
delegatee: { value: input.delegatee ?? null, isSigner: true, isWritable: false },
|
|
2916
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
2917
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
2636
2918
|
};
|
|
2637
2919
|
const accounts = originalAccounts;
|
|
2638
2920
|
const args = { ...input };
|
|
@@ -2640,7 +2922,6 @@ function getTransferRecurringInstruction(input, config) {
|
|
|
2640
2922
|
accounts.selfProgram.value = programAddress;
|
|
2641
2923
|
accounts.selfProgram.isWritable = false;
|
|
2642
2924
|
}
|
|
2643
|
-
const getAccountMeta = getAccountMetaFactory16(programAddress, "programId");
|
|
2644
2925
|
return Object.freeze({
|
|
2645
2926
|
accounts: [
|
|
2646
2927
|
getAccountMeta("delegationPda", accounts.delegationPda),
|
|
@@ -2659,7 +2940,7 @@ function getTransferRecurringInstruction(input, config) {
|
|
|
2659
2940
|
}
|
|
2660
2941
|
function parseTransferRecurringInstruction(instruction) {
|
|
2661
2942
|
if (instruction.accounts.length < 9) {
|
|
2662
|
-
throw new
|
|
2943
|
+
throw new SolanaError17(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS17, {
|
|
2663
2944
|
actualAccountMetas: instruction.accounts.length,
|
|
2664
2945
|
expectedAccountMetas: 9
|
|
2665
2946
|
});
|
|
@@ -2689,70 +2970,73 @@ function parseTransferRecurringInstruction(instruction) {
|
|
|
2689
2970
|
|
|
2690
2971
|
// src/generated/instructions/transferSubscription.ts
|
|
2691
2972
|
import {
|
|
2692
|
-
combineCodec as
|
|
2693
|
-
getProgramDerivedAddress as
|
|
2694
|
-
getStructDecoder as
|
|
2695
|
-
getStructEncoder as
|
|
2696
|
-
getU8Decoder as
|
|
2697
|
-
getU8Encoder as
|
|
2698
|
-
getUtf8Encoder as
|
|
2699
|
-
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as
|
|
2700
|
-
SolanaError as
|
|
2701
|
-
transformEncoder as
|
|
2973
|
+
combineCodec as combineCodec37,
|
|
2974
|
+
getProgramDerivedAddress as getProgramDerivedAddress14,
|
|
2975
|
+
getStructDecoder as getStructDecoder35,
|
|
2976
|
+
getStructEncoder as getStructEncoder35,
|
|
2977
|
+
getU8Decoder as getU8Decoder24,
|
|
2978
|
+
getU8Encoder as getU8Encoder24,
|
|
2979
|
+
getUtf8Encoder as getUtf8Encoder16,
|
|
2980
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS18,
|
|
2981
|
+
SolanaError as SolanaError18,
|
|
2982
|
+
transformEncoder as transformEncoder18
|
|
2702
2983
|
} from "@solana/kit";
|
|
2703
|
-
import {
|
|
2984
|
+
import {
|
|
2985
|
+
getAccountMetaFactory as getAccountMetaFactory18
|
|
2986
|
+
} from "@solana/program-client-core";
|
|
2704
2987
|
var TRANSFER_SUBSCRIPTION_DISCRIMINATOR = 10;
|
|
2705
2988
|
function getTransferSubscriptionDiscriminatorBytes() {
|
|
2706
|
-
return
|
|
2989
|
+
return getU8Encoder24().encode(TRANSFER_SUBSCRIPTION_DISCRIMINATOR);
|
|
2707
2990
|
}
|
|
2708
2991
|
function getTransferSubscriptionInstructionDataEncoder() {
|
|
2709
|
-
return
|
|
2710
|
-
|
|
2711
|
-
["discriminator",
|
|
2992
|
+
return transformEncoder18(
|
|
2993
|
+
getStructEncoder35([
|
|
2994
|
+
["discriminator", getU8Encoder24()],
|
|
2712
2995
|
["transferData", getTransferDataEncoder()]
|
|
2713
2996
|
]),
|
|
2714
2997
|
(value) => ({ ...value, discriminator: TRANSFER_SUBSCRIPTION_DISCRIMINATOR })
|
|
2715
2998
|
);
|
|
2716
2999
|
}
|
|
2717
3000
|
function getTransferSubscriptionInstructionDataDecoder() {
|
|
2718
|
-
return
|
|
2719
|
-
["discriminator",
|
|
3001
|
+
return getStructDecoder35([
|
|
3002
|
+
["discriminator", getU8Decoder24()],
|
|
2720
3003
|
["transferData", getTransferDataDecoder()]
|
|
2721
3004
|
]);
|
|
2722
3005
|
}
|
|
2723
3006
|
function getTransferSubscriptionInstructionDataCodec() {
|
|
2724
|
-
return
|
|
3007
|
+
return combineCodec37(
|
|
2725
3008
|
getTransferSubscriptionInstructionDataEncoder(),
|
|
2726
3009
|
getTransferSubscriptionInstructionDataDecoder()
|
|
2727
3010
|
);
|
|
2728
3011
|
}
|
|
2729
3012
|
async function getTransferSubscriptionInstructionAsync(input, config) {
|
|
2730
|
-
const
|
|
3013
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
3014
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
3015
|
+
const getAccountMeta = getAccountMetaFactory18(programAddress, "programId");
|
|
2731
3016
|
const originalAccounts = {
|
|
2732
|
-
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
2733
|
-
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
2734
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },
|
|
2735
|
-
delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },
|
|
2736
|
-
receiverAta: { value: input.receiverAta ?? null, isWritable: true },
|
|
2737
|
-
caller: { value: input.caller ?? null, isWritable: false },
|
|
2738
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
2739
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
2740
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
2741
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
3017
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isSigner: false, isWritable: true },
|
|
3018
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: false },
|
|
3019
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false },
|
|
3020
|
+
delegatorAta: { value: input.delegatorAta ?? null, isSigner: false, isWritable: true },
|
|
3021
|
+
receiverAta: { value: input.receiverAta ?? null, isSigner: false, isWritable: true },
|
|
3022
|
+
caller: { value: input.caller ?? null, isSigner: true, isWritable: false },
|
|
3023
|
+
tokenMint: { value: input.tokenMint ?? null, isSigner: false, isWritable: false },
|
|
3024
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
3025
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
3026
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
2742
3027
|
};
|
|
2743
3028
|
const accounts = originalAccounts;
|
|
2744
3029
|
const args = { ...input };
|
|
2745
3030
|
if (!accounts.eventAuthority.value) {
|
|
2746
|
-
accounts.eventAuthority.value = await
|
|
3031
|
+
accounts.eventAuthority.value = await getProgramDerivedAddress14({
|
|
2747
3032
|
programAddress,
|
|
2748
|
-
seeds: [
|
|
3033
|
+
seeds: [getUtf8Encoder16().encode("event_authority")]
|
|
2749
3034
|
});
|
|
2750
3035
|
}
|
|
2751
3036
|
if (!accounts.selfProgram.value) {
|
|
2752
3037
|
accounts.selfProgram.value = programAddress;
|
|
2753
3038
|
accounts.selfProgram.isWritable = false;
|
|
2754
3039
|
}
|
|
2755
|
-
const getAccountMeta = getAccountMetaFactory17(programAddress, "programId");
|
|
2756
3040
|
return Object.freeze({
|
|
2757
3041
|
accounts: [
|
|
2758
3042
|
getAccountMeta("subscriptionPda", accounts.subscriptionPda),
|
|
@@ -2771,18 +3055,20 @@ async function getTransferSubscriptionInstructionAsync(input, config) {
|
|
|
2771
3055
|
});
|
|
2772
3056
|
}
|
|
2773
3057
|
function getTransferSubscriptionInstruction(input, config) {
|
|
2774
|
-
const
|
|
3058
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
3059
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
3060
|
+
const getAccountMeta = getAccountMetaFactory18(programAddress, "programId");
|
|
2775
3061
|
const originalAccounts = {
|
|
2776
|
-
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
2777
|
-
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
2778
|
-
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },
|
|
2779
|
-
delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },
|
|
2780
|
-
receiverAta: { value: input.receiverAta ?? null, isWritable: true },
|
|
2781
|
-
caller: { value: input.caller ?? null, isWritable: false },
|
|
2782
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
2783
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
2784
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
2785
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
3062
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isSigner: false, isWritable: true },
|
|
3063
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: false },
|
|
3064
|
+
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isSigner: false, isWritable: false },
|
|
3065
|
+
delegatorAta: { value: input.delegatorAta ?? null, isSigner: false, isWritable: true },
|
|
3066
|
+
receiverAta: { value: input.receiverAta ?? null, isSigner: false, isWritable: true },
|
|
3067
|
+
caller: { value: input.caller ?? null, isSigner: true, isWritable: false },
|
|
3068
|
+
tokenMint: { value: input.tokenMint ?? null, isSigner: false, isWritable: false },
|
|
3069
|
+
tokenProgram: { value: input.tokenProgram ?? null, isSigner: false, isWritable: false },
|
|
3070
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
3071
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
2786
3072
|
};
|
|
2787
3073
|
const accounts = originalAccounts;
|
|
2788
3074
|
const args = { ...input };
|
|
@@ -2790,7 +3076,6 @@ function getTransferSubscriptionInstruction(input, config) {
|
|
|
2790
3076
|
accounts.selfProgram.value = programAddress;
|
|
2791
3077
|
accounts.selfProgram.isWritable = false;
|
|
2792
3078
|
}
|
|
2793
|
-
const getAccountMeta = getAccountMetaFactory17(programAddress, "programId");
|
|
2794
3079
|
return Object.freeze({
|
|
2795
3080
|
accounts: [
|
|
2796
3081
|
getAccountMeta("subscriptionPda", accounts.subscriptionPda),
|
|
@@ -2810,7 +3095,7 @@ function getTransferSubscriptionInstruction(input, config) {
|
|
|
2810
3095
|
}
|
|
2811
3096
|
function parseTransferSubscriptionInstruction(instruction) {
|
|
2812
3097
|
if (instruction.accounts.length < 10) {
|
|
2813
|
-
throw new
|
|
3098
|
+
throw new SolanaError18(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS18, {
|
|
2814
3099
|
actualAccountMetas: instruction.accounts.length,
|
|
2815
3100
|
expectedAccountMetas: 10
|
|
2816
3101
|
});
|
|
@@ -2841,61 +3126,64 @@ function parseTransferSubscriptionInstruction(instruction) {
|
|
|
2841
3126
|
|
|
2842
3127
|
// src/generated/instructions/updatePlan.ts
|
|
2843
3128
|
import {
|
|
2844
|
-
combineCodec as
|
|
2845
|
-
getProgramDerivedAddress as
|
|
2846
|
-
getStructDecoder as
|
|
2847
|
-
getStructEncoder as
|
|
2848
|
-
getU8Decoder as
|
|
2849
|
-
getU8Encoder as
|
|
2850
|
-
getUtf8Encoder as
|
|
2851
|
-
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as
|
|
2852
|
-
SolanaError as
|
|
2853
|
-
transformEncoder as
|
|
3129
|
+
combineCodec as combineCodec38,
|
|
3130
|
+
getProgramDerivedAddress as getProgramDerivedAddress15,
|
|
3131
|
+
getStructDecoder as getStructDecoder36,
|
|
3132
|
+
getStructEncoder as getStructEncoder36,
|
|
3133
|
+
getU8Decoder as getU8Decoder25,
|
|
3134
|
+
getU8Encoder as getU8Encoder25,
|
|
3135
|
+
getUtf8Encoder as getUtf8Encoder17,
|
|
3136
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS19,
|
|
3137
|
+
SolanaError as SolanaError19,
|
|
3138
|
+
transformEncoder as transformEncoder19
|
|
2854
3139
|
} from "@solana/kit";
|
|
2855
|
-
import {
|
|
3140
|
+
import {
|
|
3141
|
+
getAccountMetaFactory as getAccountMetaFactory19
|
|
3142
|
+
} from "@solana/program-client-core";
|
|
2856
3143
|
var UPDATE_PLAN_DISCRIMINATOR = 8;
|
|
2857
3144
|
function getUpdatePlanDiscriminatorBytes() {
|
|
2858
|
-
return
|
|
3145
|
+
return getU8Encoder25().encode(UPDATE_PLAN_DISCRIMINATOR);
|
|
2859
3146
|
}
|
|
2860
3147
|
function getUpdatePlanInstructionDataEncoder() {
|
|
2861
|
-
return
|
|
2862
|
-
|
|
2863
|
-
["discriminator",
|
|
3148
|
+
return transformEncoder19(
|
|
3149
|
+
getStructEncoder36([
|
|
3150
|
+
["discriminator", getU8Encoder25()],
|
|
2864
3151
|
["updatePlanData", getUpdatePlanDataEncoder()]
|
|
2865
3152
|
]),
|
|
2866
3153
|
(value) => ({ ...value, discriminator: UPDATE_PLAN_DISCRIMINATOR })
|
|
2867
3154
|
);
|
|
2868
3155
|
}
|
|
2869
3156
|
function getUpdatePlanInstructionDataDecoder() {
|
|
2870
|
-
return
|
|
2871
|
-
["discriminator",
|
|
3157
|
+
return getStructDecoder36([
|
|
3158
|
+
["discriminator", getU8Decoder25()],
|
|
2872
3159
|
["updatePlanData", getUpdatePlanDataDecoder()]
|
|
2873
3160
|
]);
|
|
2874
3161
|
}
|
|
2875
3162
|
function getUpdatePlanInstructionDataCodec() {
|
|
2876
|
-
return
|
|
3163
|
+
return combineCodec38(getUpdatePlanInstructionDataEncoder(), getUpdatePlanInstructionDataDecoder());
|
|
2877
3164
|
}
|
|
2878
3165
|
async function getUpdatePlanInstructionAsync(input, config) {
|
|
2879
|
-
const
|
|
3166
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
3167
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
3168
|
+
const getAccountMeta = getAccountMetaFactory19(programAddress, "programId");
|
|
2880
3169
|
const originalAccounts = {
|
|
2881
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
2882
|
-
planPda: { value: input.planPda ?? null, isWritable: true },
|
|
2883
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
2884
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
3170
|
+
owner: { value: input.owner ?? null, isSigner: true, isWritable: false },
|
|
3171
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: true },
|
|
3172
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
3173
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
2885
3174
|
};
|
|
2886
3175
|
const accounts = originalAccounts;
|
|
2887
3176
|
const args = { ...input };
|
|
2888
3177
|
if (!accounts.eventAuthority.value) {
|
|
2889
|
-
accounts.eventAuthority.value = await
|
|
3178
|
+
accounts.eventAuthority.value = await getProgramDerivedAddress15({
|
|
2890
3179
|
programAddress,
|
|
2891
|
-
seeds: [
|
|
3180
|
+
seeds: [getUtf8Encoder17().encode("event_authority")]
|
|
2892
3181
|
});
|
|
2893
3182
|
}
|
|
2894
3183
|
if (!accounts.selfProgram.value) {
|
|
2895
3184
|
accounts.selfProgram.value = programAddress;
|
|
2896
3185
|
accounts.selfProgram.isWritable = false;
|
|
2897
3186
|
}
|
|
2898
|
-
const getAccountMeta = getAccountMetaFactory18(programAddress, "programId");
|
|
2899
3187
|
return Object.freeze({
|
|
2900
3188
|
accounts: [
|
|
2901
3189
|
getAccountMeta("owner", accounts.owner),
|
|
@@ -2908,12 +3196,14 @@ async function getUpdatePlanInstructionAsync(input, config) {
|
|
|
2908
3196
|
});
|
|
2909
3197
|
}
|
|
2910
3198
|
function getUpdatePlanInstruction(input, config) {
|
|
2911
|
-
const
|
|
3199
|
+
const programAddressInput = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
3200
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
3201
|
+
const getAccountMeta = getAccountMetaFactory19(programAddress, "programId");
|
|
2912
3202
|
const originalAccounts = {
|
|
2913
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
2914
|
-
planPda: { value: input.planPda ?? null, isWritable: true },
|
|
2915
|
-
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
2916
|
-
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
3203
|
+
owner: { value: input.owner ?? null, isSigner: true, isWritable: false },
|
|
3204
|
+
planPda: { value: input.planPda ?? null, isSigner: false, isWritable: true },
|
|
3205
|
+
eventAuthority: { value: input.eventAuthority ?? null, isSigner: false, isWritable: false },
|
|
3206
|
+
selfProgram: { value: input.selfProgram ?? null, isSigner: false, isWritable: false }
|
|
2917
3207
|
};
|
|
2918
3208
|
const accounts = originalAccounts;
|
|
2919
3209
|
const args = { ...input };
|
|
@@ -2921,7 +3211,6 @@ function getUpdatePlanInstruction(input, config) {
|
|
|
2921
3211
|
accounts.selfProgram.value = programAddress;
|
|
2922
3212
|
accounts.selfProgram.isWritable = false;
|
|
2923
3213
|
}
|
|
2924
|
-
const getAccountMeta = getAccountMetaFactory18(programAddress, "programId");
|
|
2925
3214
|
return Object.freeze({
|
|
2926
3215
|
accounts: [
|
|
2927
3216
|
getAccountMeta("owner", accounts.owner),
|
|
@@ -2935,7 +3224,7 @@ function getUpdatePlanInstruction(input, config) {
|
|
|
2935
3224
|
}
|
|
2936
3225
|
function parseUpdatePlanInstruction(instruction) {
|
|
2937
3226
|
if (instruction.accounts.length < 4) {
|
|
2938
|
-
throw new
|
|
3227
|
+
throw new SolanaError19(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS19, {
|
|
2939
3228
|
actualAccountMetas: instruction.accounts.length,
|
|
2940
3229
|
expectedAccountMetas: 4
|
|
2941
3230
|
});
|
|
@@ -2966,9 +3255,45 @@ var SubscriptionsAccount = /* @__PURE__ */ ((SubscriptionsAccount2) => {
|
|
|
2966
3255
|
SubscriptionsAccount2[SubscriptionsAccount2["RecurringDelegation"] = 2] = "RecurringDelegation";
|
|
2967
3256
|
SubscriptionsAccount2[SubscriptionsAccount2["SubscriptionAuthority"] = 3] = "SubscriptionAuthority";
|
|
2968
3257
|
SubscriptionsAccount2[SubscriptionsAccount2["SubscriptionDelegation"] = 4] = "SubscriptionDelegation";
|
|
2969
|
-
SubscriptionsAccount2[SubscriptionsAccount2["
|
|
3258
|
+
SubscriptionsAccount2[SubscriptionsAccount2["TransferContext"] = 5] = "TransferContext";
|
|
3259
|
+
SubscriptionsAccount2[SubscriptionsAccount2["EventAuthority"] = 6] = "EventAuthority";
|
|
2970
3260
|
return SubscriptionsAccount2;
|
|
2971
3261
|
})(SubscriptionsAccount || {});
|
|
3262
|
+
var SubscriptionsEvent = /* @__PURE__ */ ((SubscriptionsEvent2) => {
|
|
3263
|
+
SubscriptionsEvent2[SubscriptionsEvent2["FixedTransferEvent"] = 0] = "FixedTransferEvent";
|
|
3264
|
+
SubscriptionsEvent2[SubscriptionsEvent2["PlanUpdatedEvent"] = 1] = "PlanUpdatedEvent";
|
|
3265
|
+
SubscriptionsEvent2[SubscriptionsEvent2["RecurringTransferEvent"] = 2] = "RecurringTransferEvent";
|
|
3266
|
+
SubscriptionsEvent2[SubscriptionsEvent2["SubscriptionCancelledEvent"] = 3] = "SubscriptionCancelledEvent";
|
|
3267
|
+
SubscriptionsEvent2[SubscriptionsEvent2["SubscriptionCreatedEvent"] = 4] = "SubscriptionCreatedEvent";
|
|
3268
|
+
SubscriptionsEvent2[SubscriptionsEvent2["SubscriptionResumedEvent"] = 5] = "SubscriptionResumedEvent";
|
|
3269
|
+
SubscriptionsEvent2[SubscriptionsEvent2["SubscriptionTransferEvent"] = 6] = "SubscriptionTransferEvent";
|
|
3270
|
+
return SubscriptionsEvent2;
|
|
3271
|
+
})(SubscriptionsEvent || {});
|
|
3272
|
+
function identifySubscriptionsEvent(event) {
|
|
3273
|
+
const data = "data" in event ? event.data : event;
|
|
3274
|
+
if (containsBytes(data, new Uint8Array([228, 69, 165, 46, 81, 203, 154, 29]), 0) && containsBytes(data, new Uint8Array([3]), 8)) {
|
|
3275
|
+
return 0 /* FixedTransferEvent */;
|
|
3276
|
+
}
|
|
3277
|
+
if (containsBytes(data, new Uint8Array([228, 69, 165, 46, 81, 203, 154, 29]), 0) && containsBytes(data, new Uint8Array([6]), 8)) {
|
|
3278
|
+
return 1 /* PlanUpdatedEvent */;
|
|
3279
|
+
}
|
|
3280
|
+
if (containsBytes(data, new Uint8Array([228, 69, 165, 46, 81, 203, 154, 29]), 0) && containsBytes(data, new Uint8Array([4]), 8)) {
|
|
3281
|
+
return 2 /* RecurringTransferEvent */;
|
|
3282
|
+
}
|
|
3283
|
+
if (containsBytes(data, new Uint8Array([228, 69, 165, 46, 81, 203, 154, 29]), 0) && containsBytes(data, new Uint8Array([1]), 8)) {
|
|
3284
|
+
return 3 /* SubscriptionCancelledEvent */;
|
|
3285
|
+
}
|
|
3286
|
+
if (containsBytes(data, new Uint8Array([228, 69, 165, 46, 81, 203, 154, 29]), 0) && containsBytes(data, new Uint8Array([0]), 8)) {
|
|
3287
|
+
return 4 /* SubscriptionCreatedEvent */;
|
|
3288
|
+
}
|
|
3289
|
+
if (containsBytes(data, new Uint8Array([228, 69, 165, 46, 81, 203, 154, 29]), 0) && containsBytes(data, new Uint8Array([5]), 8)) {
|
|
3290
|
+
return 5 /* SubscriptionResumedEvent */;
|
|
3291
|
+
}
|
|
3292
|
+
if (containsBytes(data, new Uint8Array([228, 69, 165, 46, 81, 203, 154, 29]), 0) && containsBytes(data, new Uint8Array([2]), 8)) {
|
|
3293
|
+
return 6 /* SubscriptionTransferEvent */;
|
|
3294
|
+
}
|
|
3295
|
+
throw new Error("The provided event could not be identified as a subscriptions event.");
|
|
3296
|
+
}
|
|
2972
3297
|
var SubscriptionsInstruction = /* @__PURE__ */ ((SubscriptionsInstruction2) => {
|
|
2973
3298
|
SubscriptionsInstruction2[SubscriptionsInstruction2["InitSubscriptionAuthority"] = 0] = "InitSubscriptionAuthority";
|
|
2974
3299
|
SubscriptionsInstruction2[SubscriptionsInstruction2["CreateFixedDelegation"] = 1] = "CreateFixedDelegation";
|
|
@@ -2988,65 +3313,69 @@ var SubscriptionsInstruction = /* @__PURE__ */ ((SubscriptionsInstruction2) => {
|
|
|
2988
3313
|
SubscriptionsInstruction2[SubscriptionsInstruction2["RevokeAbandonedDelegation"] = 15] = "RevokeAbandonedDelegation";
|
|
2989
3314
|
SubscriptionsInstruction2[SubscriptionsInstruction2["RevokeAbandonedSubscription"] = 16] = "RevokeAbandonedSubscription";
|
|
2990
3315
|
SubscriptionsInstruction2[SubscriptionsInstruction2["CancelSubscriptionNow"] = 17] = "CancelSubscriptionNow";
|
|
3316
|
+
SubscriptionsInstruction2[SubscriptionsInstruction2["ReclaimExcessRent"] = 18] = "ReclaimExcessRent";
|
|
2991
3317
|
return SubscriptionsInstruction2;
|
|
2992
3318
|
})(SubscriptionsInstruction || {});
|
|
2993
3319
|
function identifySubscriptionsInstruction(instruction) {
|
|
2994
3320
|
const data = "data" in instruction ? instruction.data : instruction;
|
|
2995
|
-
if (containsBytes(data,
|
|
3321
|
+
if (containsBytes(data, getU8Encoder26().encode(0), 0)) {
|
|
2996
3322
|
return 0 /* InitSubscriptionAuthority */;
|
|
2997
3323
|
}
|
|
2998
|
-
if (containsBytes(data,
|
|
3324
|
+
if (containsBytes(data, getU8Encoder26().encode(1), 0)) {
|
|
2999
3325
|
return 1 /* CreateFixedDelegation */;
|
|
3000
3326
|
}
|
|
3001
|
-
if (containsBytes(data,
|
|
3327
|
+
if (containsBytes(data, getU8Encoder26().encode(2), 0)) {
|
|
3002
3328
|
return 2 /* CreateRecurringDelegation */;
|
|
3003
3329
|
}
|
|
3004
|
-
if (containsBytes(data,
|
|
3330
|
+
if (containsBytes(data, getU8Encoder26().encode(3), 0)) {
|
|
3005
3331
|
return 3 /* RevokeDelegation */;
|
|
3006
3332
|
}
|
|
3007
|
-
if (containsBytes(data,
|
|
3333
|
+
if (containsBytes(data, getU8Encoder26().encode(4), 0)) {
|
|
3008
3334
|
return 4 /* TransferFixed */;
|
|
3009
3335
|
}
|
|
3010
|
-
if (containsBytes(data,
|
|
3336
|
+
if (containsBytes(data, getU8Encoder26().encode(5), 0)) {
|
|
3011
3337
|
return 5 /* TransferRecurring */;
|
|
3012
3338
|
}
|
|
3013
|
-
if (containsBytes(data,
|
|
3339
|
+
if (containsBytes(data, getU8Encoder26().encode(6), 0)) {
|
|
3014
3340
|
return 6 /* CloseSubscriptionAuthority */;
|
|
3015
3341
|
}
|
|
3016
|
-
if (containsBytes(data,
|
|
3342
|
+
if (containsBytes(data, getU8Encoder26().encode(7), 0)) {
|
|
3017
3343
|
return 7 /* CreatePlan */;
|
|
3018
3344
|
}
|
|
3019
|
-
if (containsBytes(data,
|
|
3345
|
+
if (containsBytes(data, getU8Encoder26().encode(8), 0)) {
|
|
3020
3346
|
return 8 /* UpdatePlan */;
|
|
3021
3347
|
}
|
|
3022
|
-
if (containsBytes(data,
|
|
3348
|
+
if (containsBytes(data, getU8Encoder26().encode(9), 0)) {
|
|
3023
3349
|
return 9 /* DeletePlan */;
|
|
3024
3350
|
}
|
|
3025
|
-
if (containsBytes(data,
|
|
3351
|
+
if (containsBytes(data, getU8Encoder26().encode(10), 0)) {
|
|
3026
3352
|
return 10 /* TransferSubscription */;
|
|
3027
3353
|
}
|
|
3028
|
-
if (containsBytes(data,
|
|
3354
|
+
if (containsBytes(data, getU8Encoder26().encode(11), 0)) {
|
|
3029
3355
|
return 11 /* Subscribe */;
|
|
3030
3356
|
}
|
|
3031
|
-
if (containsBytes(data,
|
|
3357
|
+
if (containsBytes(data, getU8Encoder26().encode(12), 0)) {
|
|
3032
3358
|
return 12 /* CancelSubscription */;
|
|
3033
3359
|
}
|
|
3034
|
-
if (containsBytes(data,
|
|
3360
|
+
if (containsBytes(data, getU8Encoder26().encode(13), 0)) {
|
|
3035
3361
|
return 13 /* ResumeSubscription */;
|
|
3036
3362
|
}
|
|
3037
|
-
if (containsBytes(data,
|
|
3363
|
+
if (containsBytes(data, getU8Encoder26().encode(14), 0)) {
|
|
3038
3364
|
return 14 /* RevokeSubscriptionAuthority */;
|
|
3039
3365
|
}
|
|
3040
|
-
if (containsBytes(data,
|
|
3366
|
+
if (containsBytes(data, getU8Encoder26().encode(15), 0)) {
|
|
3041
3367
|
return 15 /* RevokeAbandonedDelegation */;
|
|
3042
3368
|
}
|
|
3043
|
-
if (containsBytes(data,
|
|
3369
|
+
if (containsBytes(data, getU8Encoder26().encode(16), 0)) {
|
|
3044
3370
|
return 16 /* RevokeAbandonedSubscription */;
|
|
3045
3371
|
}
|
|
3046
|
-
if (containsBytes(data,
|
|
3372
|
+
if (containsBytes(data, getU8Encoder26().encode(17), 0)) {
|
|
3047
3373
|
return 17 /* CancelSubscriptionNow */;
|
|
3048
3374
|
}
|
|
3049
|
-
|
|
3375
|
+
if (containsBytes(data, getU8Encoder26().encode(18), 0)) {
|
|
3376
|
+
return 18 /* ReclaimExcessRent */;
|
|
3377
|
+
}
|
|
3378
|
+
throw new SolanaError20(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {
|
|
3050
3379
|
instructionData: data,
|
|
3051
3380
|
programName: "subscriptions"
|
|
3052
3381
|
});
|
|
@@ -3168,14 +3497,21 @@ function parseSubscriptionsInstruction(instruction) {
|
|
|
3168
3497
|
...parseCancelSubscriptionNowInstruction(instruction)
|
|
3169
3498
|
};
|
|
3170
3499
|
}
|
|
3500
|
+
case 18 /* ReclaimExcessRent */: {
|
|
3501
|
+
assertIsInstructionWithAccounts(instruction);
|
|
3502
|
+
return {
|
|
3503
|
+
instructionType: 18 /* ReclaimExcessRent */,
|
|
3504
|
+
...parseReclaimExcessRentInstruction(instruction)
|
|
3505
|
+
};
|
|
3506
|
+
}
|
|
3171
3507
|
default:
|
|
3172
|
-
throw new
|
|
3508
|
+
throw new SolanaError20(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
|
|
3173
3509
|
instructionType,
|
|
3174
3510
|
programName: "subscriptions"
|
|
3175
3511
|
});
|
|
3176
3512
|
}
|
|
3177
3513
|
}
|
|
3178
|
-
function subscriptionsProgram() {
|
|
3514
|
+
function subscriptionsProgram(config = {}) {
|
|
3179
3515
|
return (client) => {
|
|
3180
3516
|
return extendClient(client, {
|
|
3181
3517
|
subscriptions: {
|
|
@@ -3185,35 +3521,143 @@ function subscriptionsProgram() {
|
|
|
3185
3521
|
recurringDelegation: addSelfFetchFunctions(client, getRecurringDelegationCodec()),
|
|
3186
3522
|
subscriptionAuthority: addSelfFetchFunctions(client, getSubscriptionAuthorityCodec()),
|
|
3187
3523
|
subscriptionDelegation: addSelfFetchFunctions(client, getSubscriptionDelegationCodec()),
|
|
3524
|
+
transferContext: addSelfFetchFunctions(client, getTransferContextCodec()),
|
|
3188
3525
|
eventAuthority: addSelfFetchFunctions(client, getEventAuthorityCodec())
|
|
3189
3526
|
},
|
|
3190
3527
|
instructions: {
|
|
3191
|
-
initSubscriptionAuthority: (input) => addSelfPlanAndSendFunctions(
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3528
|
+
initSubscriptionAuthority: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3529
|
+
client,
|
|
3530
|
+
getInitSubscriptionAuthorityInstructionAsync(input, {
|
|
3531
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3532
|
+
})
|
|
3533
|
+
),
|
|
3534
|
+
createFixedDelegation: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3535
|
+
client,
|
|
3536
|
+
getCreateFixedDelegationInstruction(input, {
|
|
3537
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3538
|
+
})
|
|
3539
|
+
),
|
|
3540
|
+
createRecurringDelegation: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3541
|
+
client,
|
|
3542
|
+
getCreateRecurringDelegationInstruction(input, {
|
|
3543
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3544
|
+
})
|
|
3545
|
+
),
|
|
3546
|
+
revokeDelegation: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3547
|
+
client,
|
|
3548
|
+
getRevokeDelegationInstruction(input, {
|
|
3549
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3550
|
+
})
|
|
3551
|
+
),
|
|
3552
|
+
transferFixed: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3553
|
+
client,
|
|
3554
|
+
getTransferFixedInstructionAsync(input, {
|
|
3555
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3556
|
+
})
|
|
3557
|
+
),
|
|
3558
|
+
transferRecurring: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3559
|
+
client,
|
|
3560
|
+
getTransferRecurringInstructionAsync(input, {
|
|
3561
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3562
|
+
})
|
|
3563
|
+
),
|
|
3564
|
+
closeSubscriptionAuthority: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3565
|
+
client,
|
|
3566
|
+
getCloseSubscriptionAuthorityInstruction(input, {
|
|
3567
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3568
|
+
})
|
|
3569
|
+
),
|
|
3570
|
+
createPlan: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3571
|
+
client,
|
|
3572
|
+
getCreatePlanInstruction(input, {
|
|
3573
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3574
|
+
})
|
|
3575
|
+
),
|
|
3576
|
+
updatePlan: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3577
|
+
client,
|
|
3578
|
+
getUpdatePlanInstructionAsync(input, {
|
|
3579
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3580
|
+
})
|
|
3581
|
+
),
|
|
3582
|
+
deletePlan: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3583
|
+
client,
|
|
3584
|
+
getDeletePlanInstruction(input, {
|
|
3585
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3586
|
+
})
|
|
3587
|
+
),
|
|
3588
|
+
transferSubscription: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3589
|
+
client,
|
|
3590
|
+
getTransferSubscriptionInstructionAsync(input, {
|
|
3591
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3592
|
+
})
|
|
3593
|
+
),
|
|
3594
|
+
subscribe: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3595
|
+
client,
|
|
3596
|
+
getSubscribeInstructionAsync(input, {
|
|
3597
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3598
|
+
})
|
|
3599
|
+
),
|
|
3600
|
+
cancelSubscription: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3601
|
+
client,
|
|
3602
|
+
getCancelSubscriptionInstructionAsync(input, {
|
|
3603
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3604
|
+
})
|
|
3605
|
+
),
|
|
3606
|
+
resumeSubscription: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3607
|
+
client,
|
|
3608
|
+
getResumeSubscriptionInstructionAsync(input, {
|
|
3609
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3610
|
+
})
|
|
3611
|
+
),
|
|
3612
|
+
revokeSubscriptionAuthority: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3613
|
+
client,
|
|
3614
|
+
getRevokeSubscriptionAuthorityInstructionAsync(input, {
|
|
3615
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3616
|
+
})
|
|
3617
|
+
),
|
|
3618
|
+
revokeAbandonedDelegation: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3619
|
+
client,
|
|
3620
|
+
getRevokeAbandonedDelegationInstruction(input, {
|
|
3621
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3622
|
+
})
|
|
3623
|
+
),
|
|
3624
|
+
revokeAbandonedSubscription: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3625
|
+
client,
|
|
3626
|
+
getRevokeAbandonedSubscriptionInstruction(input, {
|
|
3627
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3628
|
+
})
|
|
3629
|
+
),
|
|
3630
|
+
cancelSubscriptionNow: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3631
|
+
client,
|
|
3632
|
+
getCancelSubscriptionNowInstructionAsync(input, {
|
|
3633
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3634
|
+
})
|
|
3635
|
+
),
|
|
3636
|
+
reclaimExcessRent: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
3637
|
+
client,
|
|
3638
|
+
getReclaimExcessRentInstruction(input, {
|
|
3639
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
3640
|
+
})
|
|
3641
|
+
)
|
|
3209
3642
|
},
|
|
3210
3643
|
pdas: {
|
|
3211
|
-
fixedDelegation: findFixedDelegationPda,
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3644
|
+
fixedDelegation: (seeds, pdaConfig2) => findFixedDelegationPda(seeds, {
|
|
3645
|
+
programAddress: pdaConfig2?.programAddress ?? config.programAddress
|
|
3646
|
+
}),
|
|
3647
|
+
plan: (seeds, pdaConfig2) => findPlanPda(seeds, { programAddress: pdaConfig2?.programAddress ?? config.programAddress }),
|
|
3648
|
+
recurringDelegation: (seeds, pdaConfig2) => findRecurringDelegationPda(seeds, {
|
|
3649
|
+
programAddress: pdaConfig2?.programAddress ?? config.programAddress
|
|
3650
|
+
}),
|
|
3651
|
+
subscriptionAuthority: (seeds, pdaConfig2) => findSubscriptionAuthorityPda(seeds, {
|
|
3652
|
+
programAddress: pdaConfig2?.programAddress ?? config.programAddress
|
|
3653
|
+
}),
|
|
3654
|
+
subscriptionDelegation: (seeds, pdaConfig2) => findSubscriptionDelegationPda(seeds, {
|
|
3655
|
+
programAddress: pdaConfig2?.programAddress ?? config.programAddress
|
|
3656
|
+
}),
|
|
3657
|
+
transferContext: (seeds, pdaConfig2) => findTransferContextPda(seeds, {
|
|
3658
|
+
programAddress: pdaConfig2?.programAddress ?? config.programAddress
|
|
3659
|
+
}),
|
|
3660
|
+
eventAuthority: (pdaConfig2) => findEventAuthorityPda({ programAddress: pdaConfig2?.programAddress ?? config.programAddress })
|
|
3217
3661
|
},
|
|
3218
3662
|
identifyInstruction: identifySubscriptionsInstruction,
|
|
3219
3663
|
parseInstruction: parseSubscriptionsInstruction
|
|
@@ -3261,6 +3705,7 @@ var SUBSCRIPTIONS_ERROR__MIGRATION_REQUIRED = 134;
|
|
|
3261
3705
|
var SUBSCRIPTIONS_ERROR__DELEGATION_ALREADY_EXISTS = 135;
|
|
3262
3706
|
var SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY = 136;
|
|
3263
3707
|
var SUBSCRIPTIONS_ERROR__TRANSFER_HOOK_TOO_MANY_ACCOUNTS = 137;
|
|
3708
|
+
var SUBSCRIPTIONS_ERROR__NO_EXCESS_LAMPORTS = 138;
|
|
3264
3709
|
var SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_LIMIT = 300;
|
|
3265
3710
|
var SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_EXPIRY_IN_PAST = 301;
|
|
3266
3711
|
var SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_AMOUNT_ZERO = 302;
|
|
@@ -3354,6 +3799,7 @@ if (process.env["NODE_ENV"] !== "production") {
|
|
|
3354
3799
|
[SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_FEE]: `Mint has TransferFee extension`,
|
|
3355
3800
|
[SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_HOOK]: `Mint has TransferHook extension`,
|
|
3356
3801
|
[SUBSCRIPTIONS_ERROR__MINT_MISMATCH]: `Token mint mismatch`,
|
|
3802
|
+
[SUBSCRIPTIONS_ERROR__NO_EXCESS_LAMPORTS]: `Account holds no lamports above the rent-exempt minimum`,
|
|
3357
3803
|
[SUBSCRIPTIONS_ERROR__NOT_ENOUGH_ACCOUNT_KEYS]: `Not enough account keys provided`,
|
|
3358
3804
|
[SUBSCRIPTIONS_ERROR__NOT_PLAN_OWNER]: `Caller is not the plan owner`,
|
|
3359
3805
|
[SUBSCRIPTIONS_ERROR__NOT_SIGNER]: `Account must be a signer`,
|
|
@@ -3390,8 +3836,437 @@ function getSubscriptionsErrorMessage(code) {
|
|
|
3390
3836
|
}
|
|
3391
3837
|
return "Error message not available in production bundles.";
|
|
3392
3838
|
}
|
|
3393
|
-
function isSubscriptionsError(error, transactionMessage, code) {
|
|
3394
|
-
|
|
3839
|
+
function isSubscriptionsError(error, transactionMessage, code, config = {}) {
|
|
3840
|
+
const programAddressInput = config.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
3841
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
3842
|
+
return isProgramError(error, transactionMessage, programAddress, code);
|
|
3843
|
+
}
|
|
3844
|
+
|
|
3845
|
+
// src/generated/events/fixedTransferEvent.ts
|
|
3846
|
+
import {
|
|
3847
|
+
combineCodec as combineCodec39,
|
|
3848
|
+
containsBytes as containsBytes2,
|
|
3849
|
+
getAddressDecoder as getAddressDecoder11,
|
|
3850
|
+
getAddressEncoder as getAddressEncoder17,
|
|
3851
|
+
getBytesEncoder,
|
|
3852
|
+
getStructDecoder as getStructDecoder37,
|
|
3853
|
+
getStructEncoder as getStructEncoder37,
|
|
3854
|
+
getU64Decoder as getU64Decoder10,
|
|
3855
|
+
getU64Encoder as getU64Encoder13
|
|
3856
|
+
} from "@solana/kit";
|
|
3857
|
+
var FIXED_TRANSFER_EVENT_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3858
|
+
228,
|
|
3859
|
+
69,
|
|
3860
|
+
165,
|
|
3861
|
+
46,
|
|
3862
|
+
81,
|
|
3863
|
+
203,
|
|
3864
|
+
154,
|
|
3865
|
+
29
|
|
3866
|
+
]);
|
|
3867
|
+
function getFixedTransferEventEventDiscriminatorBytes() {
|
|
3868
|
+
return getBytesEncoder().encode(FIXED_TRANSFER_EVENT_EVENT_DISCRIMINATOR);
|
|
3869
|
+
}
|
|
3870
|
+
var FIXED_TRANSFER_EVENT_EVENT_DISCRIMINATOR2 = new Uint8Array([3]);
|
|
3871
|
+
function getFixedTransferEventEventDiscriminator2Bytes() {
|
|
3872
|
+
return getBytesEncoder().encode(FIXED_TRANSFER_EVENT_EVENT_DISCRIMINATOR2);
|
|
3873
|
+
}
|
|
3874
|
+
function getFixedTransferEventEventEncoder() {
|
|
3875
|
+
return getStructEncoder37([
|
|
3876
|
+
["delegation", getAddressEncoder17()],
|
|
3877
|
+
["delegator", getAddressEncoder17()],
|
|
3878
|
+
["delegatee", getAddressEncoder17()],
|
|
3879
|
+
["mint", getAddressEncoder17()],
|
|
3880
|
+
["amount", getU64Encoder13()],
|
|
3881
|
+
["remainingAmount", getU64Encoder13()],
|
|
3882
|
+
["receiver", getAddressEncoder17()],
|
|
3883
|
+
["receiverTokenAccount", getAddressEncoder17()]
|
|
3884
|
+
]);
|
|
3885
|
+
}
|
|
3886
|
+
function getFixedTransferEventEventDecoder() {
|
|
3887
|
+
return getStructDecoder37([
|
|
3888
|
+
["delegation", getAddressDecoder11()],
|
|
3889
|
+
["delegator", getAddressDecoder11()],
|
|
3890
|
+
["delegatee", getAddressDecoder11()],
|
|
3891
|
+
["mint", getAddressDecoder11()],
|
|
3892
|
+
["amount", getU64Decoder10()],
|
|
3893
|
+
["remainingAmount", getU64Decoder10()],
|
|
3894
|
+
["receiver", getAddressDecoder11()],
|
|
3895
|
+
["receiverTokenAccount", getAddressDecoder11()]
|
|
3896
|
+
]);
|
|
3897
|
+
}
|
|
3898
|
+
function getFixedTransferEventEventCodec() {
|
|
3899
|
+
return combineCodec39(getFixedTransferEventEventEncoder(), getFixedTransferEventEventDecoder());
|
|
3900
|
+
}
|
|
3901
|
+
function parseFixedTransferEventEvent(data) {
|
|
3902
|
+
if (containsBytes2(data, FIXED_TRANSFER_EVENT_EVENT_DISCRIMINATOR, 0) && containsBytes2(data, FIXED_TRANSFER_EVENT_EVENT_DISCRIMINATOR2, 8)) {
|
|
3903
|
+
return getFixedTransferEventEventDecoder().decode(data);
|
|
3904
|
+
}
|
|
3905
|
+
throw new Error('The provided data does not match the "FixedTransferEventEvent" event discriminators.');
|
|
3906
|
+
}
|
|
3907
|
+
|
|
3908
|
+
// src/generated/events/planUpdatedEvent.ts
|
|
3909
|
+
import {
|
|
3910
|
+
combineCodec as combineCodec40,
|
|
3911
|
+
containsBytes as containsBytes3,
|
|
3912
|
+
getAddressDecoder as getAddressDecoder12,
|
|
3913
|
+
getAddressEncoder as getAddressEncoder18,
|
|
3914
|
+
getArrayDecoder as getArrayDecoder3,
|
|
3915
|
+
getArrayEncoder as getArrayEncoder3,
|
|
3916
|
+
getBytesEncoder as getBytesEncoder2,
|
|
3917
|
+
getI64Decoder as getI64Decoder14,
|
|
3918
|
+
getI64Encoder as getI64Encoder14,
|
|
3919
|
+
getStructDecoder as getStructDecoder38,
|
|
3920
|
+
getStructEncoder as getStructEncoder38,
|
|
3921
|
+
getU8Decoder as getU8Decoder26,
|
|
3922
|
+
getU8Encoder as getU8Encoder27
|
|
3923
|
+
} from "@solana/kit";
|
|
3924
|
+
var PLAN_UPDATED_EVENT_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3925
|
+
228,
|
|
3926
|
+
69,
|
|
3927
|
+
165,
|
|
3928
|
+
46,
|
|
3929
|
+
81,
|
|
3930
|
+
203,
|
|
3931
|
+
154,
|
|
3932
|
+
29
|
|
3933
|
+
]);
|
|
3934
|
+
function getPlanUpdatedEventEventDiscriminatorBytes() {
|
|
3935
|
+
return getBytesEncoder2().encode(PLAN_UPDATED_EVENT_EVENT_DISCRIMINATOR);
|
|
3936
|
+
}
|
|
3937
|
+
var PLAN_UPDATED_EVENT_EVENT_DISCRIMINATOR2 = new Uint8Array([6]);
|
|
3938
|
+
function getPlanUpdatedEventEventDiscriminator2Bytes() {
|
|
3939
|
+
return getBytesEncoder2().encode(PLAN_UPDATED_EVENT_EVENT_DISCRIMINATOR2);
|
|
3940
|
+
}
|
|
3941
|
+
function getPlanUpdatedEventEventEncoder() {
|
|
3942
|
+
return getStructEncoder38([
|
|
3943
|
+
["plan", getAddressEncoder18()],
|
|
3944
|
+
["owner", getAddressEncoder18()],
|
|
3945
|
+
["status", getU8Encoder27()],
|
|
3946
|
+
["endTs", getI64Encoder14()],
|
|
3947
|
+
["pullers", getArrayEncoder3(getAddressEncoder18(), { size: 4 })]
|
|
3948
|
+
]);
|
|
3949
|
+
}
|
|
3950
|
+
function getPlanUpdatedEventEventDecoder() {
|
|
3951
|
+
return getStructDecoder38([
|
|
3952
|
+
["plan", getAddressDecoder12()],
|
|
3953
|
+
["owner", getAddressDecoder12()],
|
|
3954
|
+
["status", getU8Decoder26()],
|
|
3955
|
+
["endTs", getI64Decoder14()],
|
|
3956
|
+
["pullers", getArrayDecoder3(getAddressDecoder12(), { size: 4 })]
|
|
3957
|
+
]);
|
|
3958
|
+
}
|
|
3959
|
+
function getPlanUpdatedEventEventCodec() {
|
|
3960
|
+
return combineCodec40(getPlanUpdatedEventEventEncoder(), getPlanUpdatedEventEventDecoder());
|
|
3961
|
+
}
|
|
3962
|
+
function parsePlanUpdatedEventEvent(data) {
|
|
3963
|
+
if (containsBytes3(data, PLAN_UPDATED_EVENT_EVENT_DISCRIMINATOR, 0) && containsBytes3(data, PLAN_UPDATED_EVENT_EVENT_DISCRIMINATOR2, 8)) {
|
|
3964
|
+
return getPlanUpdatedEventEventDecoder().decode(data);
|
|
3965
|
+
}
|
|
3966
|
+
throw new Error('The provided data does not match the "PlanUpdatedEventEvent" event discriminators.');
|
|
3967
|
+
}
|
|
3968
|
+
|
|
3969
|
+
// src/generated/events/recurringTransferEvent.ts
|
|
3970
|
+
import {
|
|
3971
|
+
combineCodec as combineCodec41,
|
|
3972
|
+
containsBytes as containsBytes4,
|
|
3973
|
+
getAddressDecoder as getAddressDecoder13,
|
|
3974
|
+
getAddressEncoder as getAddressEncoder19,
|
|
3975
|
+
getBytesEncoder as getBytesEncoder3,
|
|
3976
|
+
getI64Decoder as getI64Decoder15,
|
|
3977
|
+
getI64Encoder as getI64Encoder15,
|
|
3978
|
+
getStructDecoder as getStructDecoder39,
|
|
3979
|
+
getStructEncoder as getStructEncoder39,
|
|
3980
|
+
getU64Decoder as getU64Decoder11,
|
|
3981
|
+
getU64Encoder as getU64Encoder14
|
|
3982
|
+
} from "@solana/kit";
|
|
3983
|
+
var RECURRING_TRANSFER_EVENT_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
3984
|
+
228,
|
|
3985
|
+
69,
|
|
3986
|
+
165,
|
|
3987
|
+
46,
|
|
3988
|
+
81,
|
|
3989
|
+
203,
|
|
3990
|
+
154,
|
|
3991
|
+
29
|
|
3992
|
+
]);
|
|
3993
|
+
function getRecurringTransferEventEventDiscriminatorBytes() {
|
|
3994
|
+
return getBytesEncoder3().encode(RECURRING_TRANSFER_EVENT_EVENT_DISCRIMINATOR);
|
|
3995
|
+
}
|
|
3996
|
+
var RECURRING_TRANSFER_EVENT_EVENT_DISCRIMINATOR2 = new Uint8Array([4]);
|
|
3997
|
+
function getRecurringTransferEventEventDiscriminator2Bytes() {
|
|
3998
|
+
return getBytesEncoder3().encode(RECURRING_TRANSFER_EVENT_EVENT_DISCRIMINATOR2);
|
|
3999
|
+
}
|
|
4000
|
+
function getRecurringTransferEventEventEncoder() {
|
|
4001
|
+
return getStructEncoder39([
|
|
4002
|
+
["delegation", getAddressEncoder19()],
|
|
4003
|
+
["delegator", getAddressEncoder19()],
|
|
4004
|
+
["delegatee", getAddressEncoder19()],
|
|
4005
|
+
["mint", getAddressEncoder19()],
|
|
4006
|
+
["amount", getU64Encoder14()],
|
|
4007
|
+
["periodStartTs", getI64Encoder15()],
|
|
4008
|
+
["periodEndTs", getI64Encoder15()],
|
|
4009
|
+
["amountPulledInPeriod", getU64Encoder14()],
|
|
4010
|
+
["receiver", getAddressEncoder19()],
|
|
4011
|
+
["receiverTokenAccount", getAddressEncoder19()]
|
|
4012
|
+
]);
|
|
4013
|
+
}
|
|
4014
|
+
function getRecurringTransferEventEventDecoder() {
|
|
4015
|
+
return getStructDecoder39([
|
|
4016
|
+
["delegation", getAddressDecoder13()],
|
|
4017
|
+
["delegator", getAddressDecoder13()],
|
|
4018
|
+
["delegatee", getAddressDecoder13()],
|
|
4019
|
+
["mint", getAddressDecoder13()],
|
|
4020
|
+
["amount", getU64Decoder11()],
|
|
4021
|
+
["periodStartTs", getI64Decoder15()],
|
|
4022
|
+
["periodEndTs", getI64Decoder15()],
|
|
4023
|
+
["amountPulledInPeriod", getU64Decoder11()],
|
|
4024
|
+
["receiver", getAddressDecoder13()],
|
|
4025
|
+
["receiverTokenAccount", getAddressDecoder13()]
|
|
4026
|
+
]);
|
|
4027
|
+
}
|
|
4028
|
+
function getRecurringTransferEventEventCodec() {
|
|
4029
|
+
return combineCodec41(getRecurringTransferEventEventEncoder(), getRecurringTransferEventEventDecoder());
|
|
4030
|
+
}
|
|
4031
|
+
function parseRecurringTransferEventEvent(data) {
|
|
4032
|
+
if (containsBytes4(data, RECURRING_TRANSFER_EVENT_EVENT_DISCRIMINATOR, 0) && containsBytes4(data, RECURRING_TRANSFER_EVENT_EVENT_DISCRIMINATOR2, 8)) {
|
|
4033
|
+
return getRecurringTransferEventEventDecoder().decode(data);
|
|
4034
|
+
}
|
|
4035
|
+
throw new Error('The provided data does not match the "RecurringTransferEventEvent" event discriminators.');
|
|
4036
|
+
}
|
|
4037
|
+
|
|
4038
|
+
// src/generated/events/subscriptionCancelledEvent.ts
|
|
4039
|
+
import {
|
|
4040
|
+
combineCodec as combineCodec42,
|
|
4041
|
+
containsBytes as containsBytes5,
|
|
4042
|
+
getAddressDecoder as getAddressDecoder14,
|
|
4043
|
+
getAddressEncoder as getAddressEncoder20,
|
|
4044
|
+
getBytesEncoder as getBytesEncoder4,
|
|
4045
|
+
getI64Decoder as getI64Decoder16,
|
|
4046
|
+
getI64Encoder as getI64Encoder16,
|
|
4047
|
+
getStructDecoder as getStructDecoder40,
|
|
4048
|
+
getStructEncoder as getStructEncoder40
|
|
4049
|
+
} from "@solana/kit";
|
|
4050
|
+
var SUBSCRIPTION_CANCELLED_EVENT_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
4051
|
+
228,
|
|
4052
|
+
69,
|
|
4053
|
+
165,
|
|
4054
|
+
46,
|
|
4055
|
+
81,
|
|
4056
|
+
203,
|
|
4057
|
+
154,
|
|
4058
|
+
29
|
|
4059
|
+
]);
|
|
4060
|
+
function getSubscriptionCancelledEventEventDiscriminatorBytes() {
|
|
4061
|
+
return getBytesEncoder4().encode(SUBSCRIPTION_CANCELLED_EVENT_EVENT_DISCRIMINATOR);
|
|
4062
|
+
}
|
|
4063
|
+
var SUBSCRIPTION_CANCELLED_EVENT_EVENT_DISCRIMINATOR2 = new Uint8Array([1]);
|
|
4064
|
+
function getSubscriptionCancelledEventEventDiscriminator2Bytes() {
|
|
4065
|
+
return getBytesEncoder4().encode(SUBSCRIPTION_CANCELLED_EVENT_EVENT_DISCRIMINATOR2);
|
|
4066
|
+
}
|
|
4067
|
+
function getSubscriptionCancelledEventEventEncoder() {
|
|
4068
|
+
return getStructEncoder40([
|
|
4069
|
+
["plan", getAddressEncoder20()],
|
|
4070
|
+
["subscriber", getAddressEncoder20()],
|
|
4071
|
+
["expiresAtTs", getI64Encoder16()]
|
|
4072
|
+
]);
|
|
4073
|
+
}
|
|
4074
|
+
function getSubscriptionCancelledEventEventDecoder() {
|
|
4075
|
+
return getStructDecoder40([
|
|
4076
|
+
["plan", getAddressDecoder14()],
|
|
4077
|
+
["subscriber", getAddressDecoder14()],
|
|
4078
|
+
["expiresAtTs", getI64Decoder16()]
|
|
4079
|
+
]);
|
|
4080
|
+
}
|
|
4081
|
+
function getSubscriptionCancelledEventEventCodec() {
|
|
4082
|
+
return combineCodec42(getSubscriptionCancelledEventEventEncoder(), getSubscriptionCancelledEventEventDecoder());
|
|
4083
|
+
}
|
|
4084
|
+
function parseSubscriptionCancelledEventEvent(data) {
|
|
4085
|
+
if (containsBytes5(data, SUBSCRIPTION_CANCELLED_EVENT_EVENT_DISCRIMINATOR, 0) && containsBytes5(data, SUBSCRIPTION_CANCELLED_EVENT_EVENT_DISCRIMINATOR2, 8)) {
|
|
4086
|
+
return getSubscriptionCancelledEventEventDecoder().decode(data);
|
|
4087
|
+
}
|
|
4088
|
+
throw new Error('The provided data does not match the "SubscriptionCancelledEventEvent" event discriminators.');
|
|
4089
|
+
}
|
|
4090
|
+
|
|
4091
|
+
// src/generated/events/subscriptionCreatedEvent.ts
|
|
4092
|
+
import {
|
|
4093
|
+
combineCodec as combineCodec43,
|
|
4094
|
+
containsBytes as containsBytes6,
|
|
4095
|
+
getAddressDecoder as getAddressDecoder15,
|
|
4096
|
+
getAddressEncoder as getAddressEncoder21,
|
|
4097
|
+
getBytesEncoder as getBytesEncoder5,
|
|
4098
|
+
getI64Decoder as getI64Decoder17,
|
|
4099
|
+
getI64Encoder as getI64Encoder17,
|
|
4100
|
+
getStructDecoder as getStructDecoder41,
|
|
4101
|
+
getStructEncoder as getStructEncoder41
|
|
4102
|
+
} from "@solana/kit";
|
|
4103
|
+
var SUBSCRIPTION_CREATED_EVENT_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
4104
|
+
228,
|
|
4105
|
+
69,
|
|
4106
|
+
165,
|
|
4107
|
+
46,
|
|
4108
|
+
81,
|
|
4109
|
+
203,
|
|
4110
|
+
154,
|
|
4111
|
+
29
|
|
4112
|
+
]);
|
|
4113
|
+
function getSubscriptionCreatedEventEventDiscriminatorBytes() {
|
|
4114
|
+
return getBytesEncoder5().encode(SUBSCRIPTION_CREATED_EVENT_EVENT_DISCRIMINATOR);
|
|
4115
|
+
}
|
|
4116
|
+
var SUBSCRIPTION_CREATED_EVENT_EVENT_DISCRIMINATOR2 = new Uint8Array([0]);
|
|
4117
|
+
function getSubscriptionCreatedEventEventDiscriminator2Bytes() {
|
|
4118
|
+
return getBytesEncoder5().encode(SUBSCRIPTION_CREATED_EVENT_EVENT_DISCRIMINATOR2);
|
|
4119
|
+
}
|
|
4120
|
+
function getSubscriptionCreatedEventEventEncoder() {
|
|
4121
|
+
return getStructEncoder41([
|
|
4122
|
+
["plan", getAddressEncoder21()],
|
|
4123
|
+
["subscriber", getAddressEncoder21()],
|
|
4124
|
+
["mint", getAddressEncoder21()],
|
|
4125
|
+
["createdTs", getI64Encoder17()],
|
|
4126
|
+
["payer", getAddressEncoder21()]
|
|
4127
|
+
]);
|
|
4128
|
+
}
|
|
4129
|
+
function getSubscriptionCreatedEventEventDecoder() {
|
|
4130
|
+
return getStructDecoder41([
|
|
4131
|
+
["plan", getAddressDecoder15()],
|
|
4132
|
+
["subscriber", getAddressDecoder15()],
|
|
4133
|
+
["mint", getAddressDecoder15()],
|
|
4134
|
+
["createdTs", getI64Decoder17()],
|
|
4135
|
+
["payer", getAddressDecoder15()]
|
|
4136
|
+
]);
|
|
4137
|
+
}
|
|
4138
|
+
function getSubscriptionCreatedEventEventCodec() {
|
|
4139
|
+
return combineCodec43(getSubscriptionCreatedEventEventEncoder(), getSubscriptionCreatedEventEventDecoder());
|
|
4140
|
+
}
|
|
4141
|
+
function parseSubscriptionCreatedEventEvent(data) {
|
|
4142
|
+
if (containsBytes6(data, SUBSCRIPTION_CREATED_EVENT_EVENT_DISCRIMINATOR, 0) && containsBytes6(data, SUBSCRIPTION_CREATED_EVENT_EVENT_DISCRIMINATOR2, 8)) {
|
|
4143
|
+
return getSubscriptionCreatedEventEventDecoder().decode(data);
|
|
4144
|
+
}
|
|
4145
|
+
throw new Error('The provided data does not match the "SubscriptionCreatedEventEvent" event discriminators.');
|
|
4146
|
+
}
|
|
4147
|
+
|
|
4148
|
+
// src/generated/events/subscriptionResumedEvent.ts
|
|
4149
|
+
import {
|
|
4150
|
+
combineCodec as combineCodec44,
|
|
4151
|
+
containsBytes as containsBytes7,
|
|
4152
|
+
getAddressDecoder as getAddressDecoder16,
|
|
4153
|
+
getAddressEncoder as getAddressEncoder22,
|
|
4154
|
+
getBytesEncoder as getBytesEncoder6,
|
|
4155
|
+
getI64Decoder as getI64Decoder18,
|
|
4156
|
+
getI64Encoder as getI64Encoder18,
|
|
4157
|
+
getStructDecoder as getStructDecoder42,
|
|
4158
|
+
getStructEncoder as getStructEncoder42
|
|
4159
|
+
} from "@solana/kit";
|
|
4160
|
+
var SUBSCRIPTION_RESUMED_EVENT_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
4161
|
+
228,
|
|
4162
|
+
69,
|
|
4163
|
+
165,
|
|
4164
|
+
46,
|
|
4165
|
+
81,
|
|
4166
|
+
203,
|
|
4167
|
+
154,
|
|
4168
|
+
29
|
|
4169
|
+
]);
|
|
4170
|
+
function getSubscriptionResumedEventEventDiscriminatorBytes() {
|
|
4171
|
+
return getBytesEncoder6().encode(SUBSCRIPTION_RESUMED_EVENT_EVENT_DISCRIMINATOR);
|
|
4172
|
+
}
|
|
4173
|
+
var SUBSCRIPTION_RESUMED_EVENT_EVENT_DISCRIMINATOR2 = new Uint8Array([5]);
|
|
4174
|
+
function getSubscriptionResumedEventEventDiscriminator2Bytes() {
|
|
4175
|
+
return getBytesEncoder6().encode(SUBSCRIPTION_RESUMED_EVENT_EVENT_DISCRIMINATOR2);
|
|
4176
|
+
}
|
|
4177
|
+
function getSubscriptionResumedEventEventEncoder() {
|
|
4178
|
+
return getStructEncoder42([
|
|
4179
|
+
["plan", getAddressEncoder22()],
|
|
4180
|
+
["subscriber", getAddressEncoder22()],
|
|
4181
|
+
["resumedTs", getI64Encoder18()]
|
|
4182
|
+
]);
|
|
4183
|
+
}
|
|
4184
|
+
function getSubscriptionResumedEventEventDecoder() {
|
|
4185
|
+
return getStructDecoder42([
|
|
4186
|
+
["plan", getAddressDecoder16()],
|
|
4187
|
+
["subscriber", getAddressDecoder16()],
|
|
4188
|
+
["resumedTs", getI64Decoder18()]
|
|
4189
|
+
]);
|
|
4190
|
+
}
|
|
4191
|
+
function getSubscriptionResumedEventEventCodec() {
|
|
4192
|
+
return combineCodec44(getSubscriptionResumedEventEventEncoder(), getSubscriptionResumedEventEventDecoder());
|
|
4193
|
+
}
|
|
4194
|
+
function parseSubscriptionResumedEventEvent(data) {
|
|
4195
|
+
if (containsBytes7(data, SUBSCRIPTION_RESUMED_EVENT_EVENT_DISCRIMINATOR, 0) && containsBytes7(data, SUBSCRIPTION_RESUMED_EVENT_EVENT_DISCRIMINATOR2, 8)) {
|
|
4196
|
+
return getSubscriptionResumedEventEventDecoder().decode(data);
|
|
4197
|
+
}
|
|
4198
|
+
throw new Error('The provided data does not match the "SubscriptionResumedEventEvent" event discriminators.');
|
|
4199
|
+
}
|
|
4200
|
+
|
|
4201
|
+
// src/generated/events/subscriptionTransferEvent.ts
|
|
4202
|
+
import {
|
|
4203
|
+
combineCodec as combineCodec45,
|
|
4204
|
+
containsBytes as containsBytes8,
|
|
4205
|
+
getAddressDecoder as getAddressDecoder17,
|
|
4206
|
+
getAddressEncoder as getAddressEncoder23,
|
|
4207
|
+
getBytesEncoder as getBytesEncoder7,
|
|
4208
|
+
getI64Decoder as getI64Decoder19,
|
|
4209
|
+
getI64Encoder as getI64Encoder19,
|
|
4210
|
+
getStructDecoder as getStructDecoder43,
|
|
4211
|
+
getStructEncoder as getStructEncoder43,
|
|
4212
|
+
getU64Decoder as getU64Decoder12,
|
|
4213
|
+
getU64Encoder as getU64Encoder15
|
|
4214
|
+
} from "@solana/kit";
|
|
4215
|
+
var SUBSCRIPTION_TRANSFER_EVENT_EVENT_DISCRIMINATOR = new Uint8Array([
|
|
4216
|
+
228,
|
|
4217
|
+
69,
|
|
4218
|
+
165,
|
|
4219
|
+
46,
|
|
4220
|
+
81,
|
|
4221
|
+
203,
|
|
4222
|
+
154,
|
|
4223
|
+
29
|
|
4224
|
+
]);
|
|
4225
|
+
function getSubscriptionTransferEventEventDiscriminatorBytes() {
|
|
4226
|
+
return getBytesEncoder7().encode(SUBSCRIPTION_TRANSFER_EVENT_EVENT_DISCRIMINATOR);
|
|
4227
|
+
}
|
|
4228
|
+
var SUBSCRIPTION_TRANSFER_EVENT_EVENT_DISCRIMINATOR2 = new Uint8Array([2]);
|
|
4229
|
+
function getSubscriptionTransferEventEventDiscriminator2Bytes() {
|
|
4230
|
+
return getBytesEncoder7().encode(SUBSCRIPTION_TRANSFER_EVENT_EVENT_DISCRIMINATOR2);
|
|
4231
|
+
}
|
|
4232
|
+
function getSubscriptionTransferEventEventEncoder() {
|
|
4233
|
+
return getStructEncoder43([
|
|
4234
|
+
["subscription", getAddressEncoder23()],
|
|
4235
|
+
["plan", getAddressEncoder23()],
|
|
4236
|
+
["delegator", getAddressEncoder23()],
|
|
4237
|
+
["mint", getAddressEncoder23()],
|
|
4238
|
+
["amount", getU64Encoder15()],
|
|
4239
|
+
["periodStartTs", getI64Encoder19()],
|
|
4240
|
+
["periodEndTs", getI64Encoder19()],
|
|
4241
|
+
["amountPulledInPeriod", getU64Encoder15()],
|
|
4242
|
+
["receiver", getAddressEncoder23()],
|
|
4243
|
+
["receiverTokenAccount", getAddressEncoder23()],
|
|
4244
|
+
["puller", getAddressEncoder23()]
|
|
4245
|
+
]);
|
|
4246
|
+
}
|
|
4247
|
+
function getSubscriptionTransferEventEventDecoder() {
|
|
4248
|
+
return getStructDecoder43([
|
|
4249
|
+
["subscription", getAddressDecoder17()],
|
|
4250
|
+
["plan", getAddressDecoder17()],
|
|
4251
|
+
["delegator", getAddressDecoder17()],
|
|
4252
|
+
["mint", getAddressDecoder17()],
|
|
4253
|
+
["amount", getU64Decoder12()],
|
|
4254
|
+
["periodStartTs", getI64Decoder19()],
|
|
4255
|
+
["periodEndTs", getI64Decoder19()],
|
|
4256
|
+
["amountPulledInPeriod", getU64Decoder12()],
|
|
4257
|
+
["receiver", getAddressDecoder17()],
|
|
4258
|
+
["receiverTokenAccount", getAddressDecoder17()],
|
|
4259
|
+
["puller", getAddressDecoder17()]
|
|
4260
|
+
]);
|
|
4261
|
+
}
|
|
4262
|
+
function getSubscriptionTransferEventEventCodec() {
|
|
4263
|
+
return combineCodec45(getSubscriptionTransferEventEventEncoder(), getSubscriptionTransferEventEventDecoder());
|
|
4264
|
+
}
|
|
4265
|
+
function parseSubscriptionTransferEventEvent(data) {
|
|
4266
|
+
if (containsBytes8(data, SUBSCRIPTION_TRANSFER_EVENT_EVENT_DISCRIMINATOR, 0) && containsBytes8(data, SUBSCRIPTION_TRANSFER_EVENT_EVENT_DISCRIMINATOR2, 8)) {
|
|
4267
|
+
return getSubscriptionTransferEventEventDecoder().decode(data);
|
|
4268
|
+
}
|
|
4269
|
+
throw new Error('The provided data does not match the "SubscriptionTransferEventEvent" event discriminators.');
|
|
3395
4270
|
}
|
|
3396
4271
|
|
|
3397
4272
|
// src/constants.ts
|
|
@@ -3541,14 +4416,32 @@ import {
|
|
|
3541
4416
|
import { addSelfPlanAndSendFunctions as addSelfPlanAndSendFunctions2 } from "@solana/program-client-core";
|
|
3542
4417
|
import { findAssociatedTokenPda } from "@solana-program/token";
|
|
3543
4418
|
|
|
4419
|
+
// src/transfer-context.ts
|
|
4420
|
+
var TRANSFER_CONTEXT_VERSION = 1;
|
|
4421
|
+
async function buildPendingTransferContext(input) {
|
|
4422
|
+
const [address] = await findTransferContextPda(
|
|
4423
|
+
{ subscriptionAuthority: input.subscriptionAuthority },
|
|
4424
|
+
{ programAddress: input.programAddress }
|
|
4425
|
+
);
|
|
4426
|
+
const data = getTransferContextEncoder().encode({
|
|
4427
|
+
delegation: input.delegation,
|
|
4428
|
+
delegationKind: input.delegationKind,
|
|
4429
|
+
discriminator: 5 /* TransferContext */,
|
|
4430
|
+
initiator: input.initiator,
|
|
4431
|
+
version: TRANSFER_CONTEXT_VERSION
|
|
4432
|
+
});
|
|
4433
|
+
return { address, data, initiator: input.initiator };
|
|
4434
|
+
}
|
|
4435
|
+
|
|
3544
4436
|
// src/transfer-hook.ts
|
|
3545
4437
|
import {
|
|
3546
4438
|
AccountRole,
|
|
3547
|
-
fetchEncodedAccount as
|
|
3548
|
-
getAddressDecoder as
|
|
3549
|
-
getAddressEncoder as
|
|
3550
|
-
getProgramDerivedAddress as
|
|
4439
|
+
fetchEncodedAccount as fetchEncodedAccount8,
|
|
4440
|
+
getAddressDecoder as getAddressDecoder18,
|
|
4441
|
+
getAddressEncoder as getAddressEncoder24,
|
|
4442
|
+
getProgramDerivedAddress as getProgramDerivedAddress16
|
|
3551
4443
|
} from "@solana/kit";
|
|
4444
|
+
import { SYSTEM_PROGRAM_ADDRESS } from "@solana-program/system";
|
|
3552
4445
|
import { fetchMint, TOKEN_2022_PROGRAM_ADDRESS } from "@solana-program/token-2022";
|
|
3553
4446
|
var DEFAULT_ADDRESS = "11111111111111111111111111111111";
|
|
3554
4447
|
var EXTRA_ACCOUNT_METAS_SEED = "extra-account-metas";
|
|
@@ -3558,16 +4451,17 @@ var EXTRA_ACCOUNT_META_LEN = 35;
|
|
|
3558
4451
|
var ADDRESS_LEN = 32;
|
|
3559
4452
|
var PDA_PROGRAM_INDEX_OFFSET = 1 << 7;
|
|
3560
4453
|
var EXECUTE_DISCRIMINATOR = Uint8Array.from([105, 37, 101, 197, 75, 251, 102, 26]);
|
|
3561
|
-
var addressDecoder =
|
|
3562
|
-
var addressEncoder =
|
|
4454
|
+
var addressDecoder = getAddressDecoder18();
|
|
4455
|
+
var addressEncoder = getAddressEncoder24();
|
|
3563
4456
|
function roleFor(isSigner, isWritable) {
|
|
3564
4457
|
if (isSigner && isWritable) return AccountRole.WRITABLE_SIGNER;
|
|
3565
4458
|
if (isSigner) return AccountRole.READONLY_SIGNER;
|
|
3566
4459
|
if (isWritable) return AccountRole.WRITABLE;
|
|
3567
4460
|
return AccountRole.READONLY;
|
|
3568
4461
|
}
|
|
3569
|
-
async function fetchData(rpc, address) {
|
|
3570
|
-
|
|
4462
|
+
async function fetchData(rpc, address, pending) {
|
|
4463
|
+
if (pending && pending.address === address) return pending.data;
|
|
4464
|
+
const account = await fetchEncodedAccount8(rpc, address);
|
|
3571
4465
|
if (!account.exists) throw new Error("transfer hook: referenced account not found");
|
|
3572
4466
|
return account.data;
|
|
3573
4467
|
}
|
|
@@ -3596,7 +4490,7 @@ function readMetas(data) {
|
|
|
3596
4490
|
}
|
|
3597
4491
|
return metas;
|
|
3598
4492
|
}
|
|
3599
|
-
async function unpackSeeds(config, previous, instructionData, rpc) {
|
|
4493
|
+
async function unpackSeeds(config, previous, instructionData, rpc, pending) {
|
|
3600
4494
|
const seeds = [];
|
|
3601
4495
|
let i = 0;
|
|
3602
4496
|
while (i < 32) {
|
|
@@ -3616,7 +4510,7 @@ async function unpackSeeds(config, previous, instructionData, rpc) {
|
|
|
3616
4510
|
i += 2;
|
|
3617
4511
|
} else if (discriminator === 4) {
|
|
3618
4512
|
const [accountIndex, dataIndex, length] = [rest[0], rest[1], rest[2]];
|
|
3619
|
-
const data = await fetchData(rpc, previous[accountIndex].address);
|
|
4513
|
+
const data = await fetchData(rpc, previous[accountIndex].address, pending);
|
|
3620
4514
|
seeds.push(data.subarray(dataIndex, dataIndex + length));
|
|
3621
4515
|
i += 4;
|
|
3622
4516
|
} else {
|
|
@@ -3625,7 +4519,7 @@ async function unpackSeeds(config, previous, instructionData, rpc) {
|
|
|
3625
4519
|
}
|
|
3626
4520
|
return seeds;
|
|
3627
4521
|
}
|
|
3628
|
-
async function unpackAddressData(config, previous, instructionData, rpc) {
|
|
4522
|
+
async function unpackAddressData(config, previous, instructionData, rpc, pending) {
|
|
3629
4523
|
const rest = config.subarray(1);
|
|
3630
4524
|
if (config[0] === 1) {
|
|
3631
4525
|
const offset = rest[0];
|
|
@@ -3633,22 +4527,22 @@ async function unpackAddressData(config, previous, instructionData, rpc) {
|
|
|
3633
4527
|
}
|
|
3634
4528
|
if (config[0] === 2) {
|
|
3635
4529
|
const [accountIndex, offset] = [rest[0], rest[1]];
|
|
3636
|
-
const data = await fetchData(rpc, previous[accountIndex].address);
|
|
4530
|
+
const data = await fetchData(rpc, previous[accountIndex].address, pending);
|
|
3637
4531
|
return addressDecoder.decode(data.subarray(offset, offset + ADDRESS_LEN));
|
|
3638
4532
|
}
|
|
3639
4533
|
throw new Error("transfer hook: invalid address data");
|
|
3640
4534
|
}
|
|
3641
|
-
async function resolveMeta(meta, previous, instructionData, hookProgram, rpc) {
|
|
4535
|
+
async function resolveMeta(meta, previous, instructionData, hookProgram, rpc, pending) {
|
|
3642
4536
|
const role = roleFor(meta.isSigner, meta.isWritable);
|
|
3643
4537
|
if (meta.discriminator === 0) {
|
|
3644
4538
|
return { address: addressDecoder.decode(meta.addressConfig), role };
|
|
3645
4539
|
}
|
|
3646
4540
|
if (meta.discriminator === 2) {
|
|
3647
|
-
return { address: await unpackAddressData(meta.addressConfig, previous, instructionData, rpc), role };
|
|
4541
|
+
return { address: await unpackAddressData(meta.addressConfig, previous, instructionData, rpc, pending), role };
|
|
3648
4542
|
}
|
|
3649
4543
|
const programId = meta.discriminator === 1 ? hookProgram : previous[meta.discriminator - PDA_PROGRAM_INDEX_OFFSET].address;
|
|
3650
|
-
const seeds = await unpackSeeds(meta.addressConfig, previous, instructionData, rpc);
|
|
3651
|
-
const [pda] = await
|
|
4544
|
+
const seeds = await unpackSeeds(meta.addressConfig, previous, instructionData, rpc, pending);
|
|
4545
|
+
const [pda] = await getProgramDerivedAddress16({ programAddress: programId, seeds });
|
|
3652
4546
|
return { address: pda, role };
|
|
3653
4547
|
}
|
|
3654
4548
|
async function resolveTransferHookAccounts(rpc, args) {
|
|
@@ -3659,7 +4553,7 @@ async function resolveTransferHookAccounts(rpc, args) {
|
|
|
3659
4553
|
const hook = extensions.find((extension) => extension.__kind === "TransferHook");
|
|
3660
4554
|
if (!hook || hook.programId === DEFAULT_ADDRESS) return [];
|
|
3661
4555
|
const hookProgram = hook.programId;
|
|
3662
|
-
const [validationPda] = await
|
|
4556
|
+
const [validationPda] = await getProgramDerivedAddress16({
|
|
3663
4557
|
programAddress: hookProgram,
|
|
3664
4558
|
seeds: [EXTRA_ACCOUNT_METAS_SEED, addressEncoder.encode(args.mint)]
|
|
3665
4559
|
});
|
|
@@ -3667,7 +4561,7 @@ async function resolveTransferHookAccounts(rpc, args) {
|
|
|
3667
4561
|
{ address: hookProgram, role: AccountRole.READONLY },
|
|
3668
4562
|
{ address: validationPda, role: AccountRole.READONLY }
|
|
3669
4563
|
];
|
|
3670
|
-
const validationAccount = await
|
|
4564
|
+
const validationAccount = await fetchEncodedAccount8(rpc, validationPda);
|
|
3671
4565
|
if (!validationAccount.exists) return trailing;
|
|
3672
4566
|
const instructionData = executeInstructionData(args.amount);
|
|
3673
4567
|
const previous = [
|
|
@@ -3677,11 +4571,21 @@ async function resolveTransferHookAccounts(rpc, args) {
|
|
|
3677
4571
|
{ address: args.authority, role: AccountRole.READONLY },
|
|
3678
4572
|
{ address: validationPda, role: AccountRole.READONLY }
|
|
3679
4573
|
];
|
|
4574
|
+
let contextInitiator;
|
|
3680
4575
|
for (const meta of readMetas(validationAccount.data)) {
|
|
3681
|
-
const resolved = await resolveMeta(meta, previous, instructionData, hookProgram, rpc);
|
|
4576
|
+
const resolved = await resolveMeta(meta, previous, instructionData, hookProgram, rpc, args.transferContext);
|
|
3682
4577
|
previous.push(resolved);
|
|
4578
|
+
if (args.transferContext && resolved.address === args.transferContext.address) {
|
|
4579
|
+
contextInitiator = args.transferContext.initiator;
|
|
4580
|
+
trailing.push({ address: resolved.address, role: AccountRole.WRITABLE });
|
|
4581
|
+
continue;
|
|
4582
|
+
}
|
|
3683
4583
|
trailing.push(resolved);
|
|
3684
4584
|
}
|
|
4585
|
+
if (contextInitiator) {
|
|
4586
|
+
trailing.push({ address: SYSTEM_PROGRAM_ADDRESS, role: AccountRole.READONLY });
|
|
4587
|
+
trailing.push({ address: contextInitiator, role: AccountRole.WRITABLE });
|
|
4588
|
+
}
|
|
3685
4589
|
return trailing;
|
|
3686
4590
|
}
|
|
3687
4591
|
|
|
@@ -4162,7 +5066,7 @@ function subscriptionsProgram2() {
|
|
|
4162
5066
|
}
|
|
4163
5067
|
return subscriptionAuthority.data.initId;
|
|
4164
5068
|
};
|
|
4165
|
-
const resolveDelegationHookAccounts = async (input) => {
|
|
5069
|
+
const resolveDelegationHookAccounts = async (input, initiator, delegationKind) => {
|
|
4166
5070
|
const [subscriptionAuthority] = await findSubscriptionAuthorityPda(
|
|
4167
5071
|
{ tokenMint: input.tokenMint, user: input.delegator },
|
|
4168
5072
|
pdaConfig(input.programAddress)
|
|
@@ -4174,6 +5078,13 @@ function subscriptionsProgram2() {
|
|
|
4174
5078
|
mint: input.tokenMint,
|
|
4175
5079
|
source: input.delegatorAta,
|
|
4176
5080
|
tokenProgram: input.tokenProgram,
|
|
5081
|
+
transferContext: await buildPendingTransferContext({
|
|
5082
|
+
delegation: input.delegationPda,
|
|
5083
|
+
delegationKind,
|
|
5084
|
+
initiator,
|
|
5085
|
+
programAddress: input.programAddress,
|
|
5086
|
+
subscriptionAuthority
|
|
5087
|
+
}),
|
|
4177
5088
|
transferHookAccounts: input.transferHookAccounts
|
|
4178
5089
|
});
|
|
4179
5090
|
};
|
|
@@ -4337,19 +5248,33 @@ function subscriptionsProgram2() {
|
|
|
4337
5248
|
),
|
|
4338
5249
|
transferFixed: (input) => addSelfPlanAndSendFunctions2(
|
|
4339
5250
|
client,
|
|
4340
|
-
(async () =>
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
5251
|
+
(async () => {
|
|
5252
|
+
const delegatee = input.delegatee ?? client.identity;
|
|
5253
|
+
return await getTransferFixedOverlayInstructionAsync({
|
|
5254
|
+
...input,
|
|
5255
|
+
delegatee,
|
|
5256
|
+
transferHookAccounts: await resolveDelegationHookAccounts(
|
|
5257
|
+
input,
|
|
5258
|
+
delegatee.address,
|
|
5259
|
+
2 /* FixedDelegation */
|
|
5260
|
+
)
|
|
5261
|
+
});
|
|
5262
|
+
})()
|
|
4345
5263
|
),
|
|
4346
5264
|
transferRecurring: (input) => addSelfPlanAndSendFunctions2(
|
|
4347
5265
|
client,
|
|
4348
|
-
(async () =>
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
5266
|
+
(async () => {
|
|
5267
|
+
const delegatee = input.delegatee ?? client.identity;
|
|
5268
|
+
return await getTransferRecurringOverlayInstructionAsync({
|
|
5269
|
+
...input,
|
|
5270
|
+
delegatee,
|
|
5271
|
+
transferHookAccounts: await resolveDelegationHookAccounts(
|
|
5272
|
+
input,
|
|
5273
|
+
delegatee.address,
|
|
5274
|
+
3 /* RecurringDelegation */
|
|
5275
|
+
)
|
|
5276
|
+
});
|
|
5277
|
+
})()
|
|
4353
5278
|
),
|
|
4354
5279
|
transferSubscription: (input) => addSelfPlanAndSendFunctions2(
|
|
4355
5280
|
client,
|
|
@@ -4363,6 +5288,7 @@ function subscriptionsProgram2() {
|
|
|
4363
5288
|
owner: input.delegator,
|
|
4364
5289
|
tokenProgram: input.tokenProgram
|
|
4365
5290
|
});
|
|
5291
|
+
const caller = input.caller ?? client.identity;
|
|
4366
5292
|
const transferHookAccounts = await resolveTransferHookAccounts(c.rpc, {
|
|
4367
5293
|
amount: input.amount,
|
|
4368
5294
|
authority: subscriptionAuthority,
|
|
@@ -4370,11 +5296,18 @@ function subscriptionsProgram2() {
|
|
|
4370
5296
|
mint: input.tokenMint,
|
|
4371
5297
|
source: delegatorAta,
|
|
4372
5298
|
tokenProgram: input.tokenProgram,
|
|
5299
|
+
transferContext: await buildPendingTransferContext({
|
|
5300
|
+
delegation: input.subscriptionPda,
|
|
5301
|
+
delegationKind: 4 /* SubscriptionDelegation */,
|
|
5302
|
+
initiator: caller.address,
|
|
5303
|
+
programAddress: input.programAddress,
|
|
5304
|
+
subscriptionAuthority
|
|
5305
|
+
}),
|
|
4373
5306
|
transferHookAccounts: input.transferHookAccounts
|
|
4374
5307
|
});
|
|
4375
5308
|
return await getTransferSubscriptionOverlayInstructionAsync({
|
|
4376
5309
|
...input,
|
|
4377
|
-
caller
|
|
5310
|
+
caller,
|
|
4378
5311
|
transferHookAccounts
|
|
4379
5312
|
});
|
|
4380
5313
|
})()
|
|
@@ -4427,6 +5360,8 @@ export {
|
|
|
4427
5360
|
DELETE_PLAN_DISCRIMINATOR,
|
|
4428
5361
|
DISCRIMINATOR_OFFSET,
|
|
4429
5362
|
EVENT_AUTHORITY_SEED,
|
|
5363
|
+
FIXED_TRANSFER_EVENT_EVENT_DISCRIMINATOR,
|
|
5364
|
+
FIXED_TRANSFER_EVENT_EVENT_DISCRIMINATOR2,
|
|
4430
5365
|
INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR,
|
|
4431
5366
|
MAX_PLAN_DESTINATIONS,
|
|
4432
5367
|
MAX_PLAN_PULLERS,
|
|
@@ -4434,8 +5369,13 @@ export {
|
|
|
4434
5369
|
PLAN_OWNER_OFFSET,
|
|
4435
5370
|
PLAN_SEED,
|
|
4436
5371
|
PLAN_SIZE,
|
|
5372
|
+
PLAN_UPDATED_EVENT_EVENT_DISCRIMINATOR,
|
|
5373
|
+
PLAN_UPDATED_EVENT_EVENT_DISCRIMINATOR2,
|
|
4437
5374
|
PROGRAM_ID,
|
|
4438
5375
|
PlanStatus,
|
|
5376
|
+
RECLAIM_EXCESS_RENT_DISCRIMINATOR,
|
|
5377
|
+
RECURRING_TRANSFER_EVENT_EVENT_DISCRIMINATOR,
|
|
5378
|
+
RECURRING_TRANSFER_EVENT_EVENT_DISCRIMINATOR2,
|
|
4439
5379
|
RESUME_SUBSCRIPTION_DISCRIMINATOR,
|
|
4440
5380
|
REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR,
|
|
4441
5381
|
REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR,
|
|
@@ -4496,6 +5436,7 @@ export {
|
|
|
4496
5436
|
SUBSCRIPTIONS_ERROR__NOT_PLAN_OWNER,
|
|
4497
5437
|
SUBSCRIPTIONS_ERROR__NOT_SIGNER,
|
|
4498
5438
|
SUBSCRIPTIONS_ERROR__NOT_SYSTEM_PROGRAM,
|
|
5439
|
+
SUBSCRIPTIONS_ERROR__NO_EXCESS_LAMPORTS,
|
|
4499
5440
|
SUBSCRIPTIONS_ERROR__PERIOD_NOT_ELAPSED,
|
|
4500
5441
|
SUBSCRIPTIONS_ERROR__PLAN_ALREADY_EXISTS,
|
|
4501
5442
|
SUBSCRIPTIONS_ERROR__PLAN_CLOSED,
|
|
@@ -4522,9 +5463,18 @@ export {
|
|
|
4522
5463
|
SUBSCRIPTIONS_ERROR__UNAUTHORIZED_DESTINATION,
|
|
4523
5464
|
SUBSCRIPTIONS_PROGRAM_ADDRESS,
|
|
4524
5465
|
SUBSCRIPTION_AUTHORITY_SEED,
|
|
5466
|
+
SUBSCRIPTION_CANCELLED_EVENT_EVENT_DISCRIMINATOR,
|
|
5467
|
+
SUBSCRIPTION_CANCELLED_EVENT_EVENT_DISCRIMINATOR2,
|
|
5468
|
+
SUBSCRIPTION_CREATED_EVENT_EVENT_DISCRIMINATOR,
|
|
5469
|
+
SUBSCRIPTION_CREATED_EVENT_EVENT_DISCRIMINATOR2,
|
|
5470
|
+
SUBSCRIPTION_RESUMED_EVENT_EVENT_DISCRIMINATOR,
|
|
5471
|
+
SUBSCRIPTION_RESUMED_EVENT_EVENT_DISCRIMINATOR2,
|
|
4525
5472
|
SUBSCRIPTION_SEED,
|
|
4526
5473
|
SUBSCRIPTION_SIZE,
|
|
5474
|
+
SUBSCRIPTION_TRANSFER_EVENT_EVENT_DISCRIMINATOR,
|
|
5475
|
+
SUBSCRIPTION_TRANSFER_EVENT_EVENT_DISCRIMINATOR2,
|
|
4527
5476
|
SubscriptionsAccount,
|
|
5477
|
+
SubscriptionsEvent,
|
|
4528
5478
|
SubscriptionsInstruction,
|
|
4529
5479
|
TRANSFER_FIXED_DISCRIMINATOR,
|
|
4530
5480
|
TRANSFER_RECURRING_DISCRIMINATOR,
|
|
@@ -4534,6 +5484,7 @@ export {
|
|
|
4534
5484
|
UPDATE_PLAN_DISCRIMINATOR,
|
|
4535
5485
|
ValidationError,
|
|
4536
5486
|
ZERO_ADDRESS,
|
|
5487
|
+
buildPendingTransferContext,
|
|
4537
5488
|
decodeDelegationAccount,
|
|
4538
5489
|
decodeEventAuthority,
|
|
4539
5490
|
decodeFixedDelegation,
|
|
@@ -4541,6 +5492,7 @@ export {
|
|
|
4541
5492
|
decodeRecurringDelegation,
|
|
4542
5493
|
decodeSubscriptionAuthority,
|
|
4543
5494
|
decodeSubscriptionDelegation,
|
|
5495
|
+
decodeTransferContext,
|
|
4544
5496
|
fetchAllEventAuthority,
|
|
4545
5497
|
fetchAllFixedDelegation,
|
|
4546
5498
|
fetchAllMaybeEventAuthority,
|
|
@@ -4549,10 +5501,12 @@ export {
|
|
|
4549
5501
|
fetchAllMaybeRecurringDelegation,
|
|
4550
5502
|
fetchAllMaybeSubscriptionAuthority,
|
|
4551
5503
|
fetchAllMaybeSubscriptionDelegation,
|
|
5504
|
+
fetchAllMaybeTransferContext,
|
|
4552
5505
|
fetchAllPlan,
|
|
4553
5506
|
fetchAllRecurringDelegation,
|
|
4554
5507
|
fetchAllSubscriptionAuthority,
|
|
4555
5508
|
fetchAllSubscriptionDelegation,
|
|
5509
|
+
fetchAllTransferContext,
|
|
4556
5510
|
fetchDelegationsByDelegatee,
|
|
4557
5511
|
fetchDelegationsByDelegator,
|
|
4558
5512
|
fetchEventAuthority,
|
|
@@ -4571,6 +5525,8 @@ export {
|
|
|
4571
5525
|
fetchMaybeSubscriptionAuthorityFromSeeds,
|
|
4572
5526
|
fetchMaybeSubscriptionDelegation,
|
|
4573
5527
|
fetchMaybeSubscriptionDelegationFromSeeds,
|
|
5528
|
+
fetchMaybeTransferContext,
|
|
5529
|
+
fetchMaybeTransferContextFromSeeds,
|
|
4574
5530
|
fetchPlan,
|
|
4575
5531
|
fetchPlanFromSeeds,
|
|
4576
5532
|
fetchPlansForOwner,
|
|
@@ -4581,12 +5537,15 @@ export {
|
|
|
4581
5537
|
fetchSubscriptionDelegation,
|
|
4582
5538
|
fetchSubscriptionDelegationFromSeeds,
|
|
4583
5539
|
fetchSubscriptionsForUser,
|
|
5540
|
+
fetchTransferContext,
|
|
5541
|
+
fetchTransferContextFromSeeds,
|
|
4584
5542
|
findEventAuthorityPda,
|
|
4585
5543
|
findFixedDelegationPda,
|
|
4586
5544
|
findPlanPda,
|
|
4587
5545
|
findRecurringDelegationPda,
|
|
4588
5546
|
findSubscriptionAuthorityPda,
|
|
4589
5547
|
findSubscriptionDelegationPda,
|
|
5548
|
+
findTransferContextPda,
|
|
4590
5549
|
getAccountDiscriminatorCodec,
|
|
4591
5550
|
getAccountDiscriminatorDecoder,
|
|
4592
5551
|
getAccountDiscriminatorEncoder,
|
|
@@ -4649,6 +5608,11 @@ export {
|
|
|
4649
5608
|
getFixedDelegationCodec,
|
|
4650
5609
|
getFixedDelegationDecoder,
|
|
4651
5610
|
getFixedDelegationEncoder,
|
|
5611
|
+
getFixedTransferEventEventCodec,
|
|
5612
|
+
getFixedTransferEventEventDecoder,
|
|
5613
|
+
getFixedTransferEventEventDiscriminator2Bytes,
|
|
5614
|
+
getFixedTransferEventEventDiscriminatorBytes,
|
|
5615
|
+
getFixedTransferEventEventEncoder,
|
|
4652
5616
|
getHeaderCodec,
|
|
4653
5617
|
getHeaderDecoder,
|
|
4654
5618
|
getHeaderEncoder,
|
|
@@ -4671,9 +5635,24 @@ export {
|
|
|
4671
5635
|
getPlanTermsCodec,
|
|
4672
5636
|
getPlanTermsDecoder,
|
|
4673
5637
|
getPlanTermsEncoder,
|
|
5638
|
+
getPlanUpdatedEventEventCodec,
|
|
5639
|
+
getPlanUpdatedEventEventDecoder,
|
|
5640
|
+
getPlanUpdatedEventEventDiscriminator2Bytes,
|
|
5641
|
+
getPlanUpdatedEventEventDiscriminatorBytes,
|
|
5642
|
+
getPlanUpdatedEventEventEncoder,
|
|
5643
|
+
getReclaimExcessRentDiscriminatorBytes,
|
|
5644
|
+
getReclaimExcessRentInstruction,
|
|
5645
|
+
getReclaimExcessRentInstructionDataCodec,
|
|
5646
|
+
getReclaimExcessRentInstructionDataDecoder,
|
|
5647
|
+
getReclaimExcessRentInstructionDataEncoder,
|
|
4674
5648
|
getRecurringDelegationCodec,
|
|
4675
5649
|
getRecurringDelegationDecoder,
|
|
4676
5650
|
getRecurringDelegationEncoder,
|
|
5651
|
+
getRecurringTransferEventEventCodec,
|
|
5652
|
+
getRecurringTransferEventEventDecoder,
|
|
5653
|
+
getRecurringTransferEventEventDiscriminator2Bytes,
|
|
5654
|
+
getRecurringTransferEventEventDiscriminatorBytes,
|
|
5655
|
+
getRecurringTransferEventEventEncoder,
|
|
4677
5656
|
getResumeDataCodec,
|
|
4678
5657
|
getResumeDataDecoder,
|
|
4679
5658
|
getResumeDataEncoder,
|
|
@@ -4721,10 +5700,33 @@ export {
|
|
|
4721
5700
|
getSubscriptionAuthorityCodec,
|
|
4722
5701
|
getSubscriptionAuthorityDecoder,
|
|
4723
5702
|
getSubscriptionAuthorityEncoder,
|
|
5703
|
+
getSubscriptionCancelledEventEventCodec,
|
|
5704
|
+
getSubscriptionCancelledEventEventDecoder,
|
|
5705
|
+
getSubscriptionCancelledEventEventDiscriminator2Bytes,
|
|
5706
|
+
getSubscriptionCancelledEventEventDiscriminatorBytes,
|
|
5707
|
+
getSubscriptionCancelledEventEventEncoder,
|
|
5708
|
+
getSubscriptionCreatedEventEventCodec,
|
|
5709
|
+
getSubscriptionCreatedEventEventDecoder,
|
|
5710
|
+
getSubscriptionCreatedEventEventDiscriminator2Bytes,
|
|
5711
|
+
getSubscriptionCreatedEventEventDiscriminatorBytes,
|
|
5712
|
+
getSubscriptionCreatedEventEventEncoder,
|
|
4724
5713
|
getSubscriptionDelegationCodec,
|
|
4725
5714
|
getSubscriptionDelegationDecoder,
|
|
4726
5715
|
getSubscriptionDelegationEncoder,
|
|
5716
|
+
getSubscriptionResumedEventEventCodec,
|
|
5717
|
+
getSubscriptionResumedEventEventDecoder,
|
|
5718
|
+
getSubscriptionResumedEventEventDiscriminator2Bytes,
|
|
5719
|
+
getSubscriptionResumedEventEventDiscriminatorBytes,
|
|
5720
|
+
getSubscriptionResumedEventEventEncoder,
|
|
5721
|
+
getSubscriptionTransferEventEventCodec,
|
|
5722
|
+
getSubscriptionTransferEventEventDecoder,
|
|
5723
|
+
getSubscriptionTransferEventEventDiscriminator2Bytes,
|
|
5724
|
+
getSubscriptionTransferEventEventDiscriminatorBytes,
|
|
5725
|
+
getSubscriptionTransferEventEventEncoder,
|
|
4727
5726
|
getSubscriptionsErrorMessage,
|
|
5727
|
+
getTransferContextCodec,
|
|
5728
|
+
getTransferContextDecoder,
|
|
5729
|
+
getTransferContextEncoder,
|
|
4728
5730
|
getTransferDataCodec,
|
|
4729
5731
|
getTransferDataDecoder,
|
|
4730
5732
|
getTransferDataEncoder,
|
|
@@ -4759,6 +5761,7 @@ export {
|
|
|
4759
5761
|
getUpdatePlanInstructionDataDecoder,
|
|
4760
5762
|
getUpdatePlanInstructionDataEncoder,
|
|
4761
5763
|
getUpdatePlanOverlayInstruction,
|
|
5764
|
+
identifySubscriptionsEvent,
|
|
4762
5765
|
identifySubscriptionsInstruction,
|
|
4763
5766
|
isSubscriptionsError,
|
|
4764
5767
|
parseCancelSubscriptionInstruction,
|
|
@@ -4768,13 +5771,21 @@ export {
|
|
|
4768
5771
|
parseCreatePlanInstruction,
|
|
4769
5772
|
parseCreateRecurringDelegationInstruction,
|
|
4770
5773
|
parseDeletePlanInstruction,
|
|
5774
|
+
parseFixedTransferEventEvent,
|
|
4771
5775
|
parseInitSubscriptionAuthorityInstruction,
|
|
5776
|
+
parsePlanUpdatedEventEvent,
|
|
5777
|
+
parseReclaimExcessRentInstruction,
|
|
5778
|
+
parseRecurringTransferEventEvent,
|
|
4772
5779
|
parseResumeSubscriptionInstruction,
|
|
4773
5780
|
parseRevokeAbandonedDelegationInstruction,
|
|
4774
5781
|
parseRevokeAbandonedSubscriptionInstruction,
|
|
4775
5782
|
parseRevokeDelegationInstruction,
|
|
4776
5783
|
parseRevokeSubscriptionAuthorityInstruction,
|
|
4777
5784
|
parseSubscribeInstruction,
|
|
5785
|
+
parseSubscriptionCancelledEventEvent,
|
|
5786
|
+
parseSubscriptionCreatedEventEvent,
|
|
5787
|
+
parseSubscriptionResumedEventEvent,
|
|
5788
|
+
parseSubscriptionTransferEventEvent,
|
|
4778
5789
|
parseSubscriptionsInstruction,
|
|
4779
5790
|
parseTransferFixedInstruction,
|
|
4780
5791
|
parseTransferRecurringInstruction,
|