@solana/subscriptions 0.4.0-rc.2 → 0.5.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 +29 -20
- package/dist/index.cjs +832 -551
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +197 -17
- package/dist/index.d.ts +197 -17
- package/dist/index.js +811 -522
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
AccountDiscriminator: () => AccountDiscriminator,
|
|
24
24
|
CANCEL_SUBSCRIPTION_DISCRIMINATOR: () => CANCEL_SUBSCRIPTION_DISCRIMINATOR,
|
|
25
|
+
CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR: () => CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR,
|
|
25
26
|
CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR: () => CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR,
|
|
26
27
|
CREATE_FIXED_DELEGATION_DISCRIMINATOR: () => CREATE_FIXED_DELEGATION_DISCRIMINATOR,
|
|
27
28
|
CREATE_PLAN_DISCRIMINATOR: () => CREATE_PLAN_DISCRIMINATOR,
|
|
@@ -115,6 +116,8 @@ __export(index_exports, {
|
|
|
115
116
|
SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_ON_LANDING_REQUIRES_EXPIRY: () => SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_ON_LANDING_REQUIRES_EXPIRY,
|
|
116
117
|
SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_GREATER_THAN_EXPIRY: () => SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_GREATER_THAN_EXPIRY,
|
|
117
118
|
SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_IN_PAST: () => SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_IN_PAST,
|
|
119
|
+
SUBSCRIPTIONS_ERROR__STALE_PLAN_APPROVAL: () => SUBSCRIPTIONS_ERROR__STALE_PLAN_APPROVAL,
|
|
120
|
+
SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_APPROVAL: () => SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_APPROVAL,
|
|
118
121
|
SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY: () => SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY,
|
|
119
122
|
SUBSCRIPTIONS_ERROR__SUBSCRIPTION_ALREADY_CANCELLED: () => SUBSCRIPTIONS_ERROR__SUBSCRIPTION_ALREADY_CANCELLED,
|
|
120
123
|
SUBSCRIPTIONS_ERROR__SUBSCRIPTION_CANCELLED: () => SUBSCRIPTIONS_ERROR__SUBSCRIPTION_CANCELLED,
|
|
@@ -134,6 +137,7 @@ __export(index_exports, {
|
|
|
134
137
|
TRANSFER_RECURRING_DISCRIMINATOR: () => TRANSFER_RECURRING_DISCRIMINATOR,
|
|
135
138
|
TRANSFER_SUBSCRIPTION_DISCRIMINATOR: () => TRANSFER_SUBSCRIPTION_DISCRIMINATOR,
|
|
136
139
|
U64_BYTE_SIZE: () => U64_BYTE_SIZE,
|
|
140
|
+
UNKNOWN_INIT_ID: () => UNKNOWN_INIT_ID,
|
|
137
141
|
UPDATE_PLAN_DISCRIMINATOR: () => UPDATE_PLAN_DISCRIMINATOR,
|
|
138
142
|
ValidationError: () => ValidationError,
|
|
139
143
|
ZERO_ADDRESS: () => ZERO_ADDRESS,
|
|
@@ -199,6 +203,16 @@ __export(index_exports, {
|
|
|
199
203
|
getCancelSubscriptionInstructionDataCodec: () => getCancelSubscriptionInstructionDataCodec,
|
|
200
204
|
getCancelSubscriptionInstructionDataDecoder: () => getCancelSubscriptionInstructionDataDecoder,
|
|
201
205
|
getCancelSubscriptionInstructionDataEncoder: () => getCancelSubscriptionInstructionDataEncoder,
|
|
206
|
+
getCancelSubscriptionNowDataCodec: () => getCancelSubscriptionNowDataCodec,
|
|
207
|
+
getCancelSubscriptionNowDataDecoder: () => getCancelSubscriptionNowDataDecoder,
|
|
208
|
+
getCancelSubscriptionNowDataEncoder: () => getCancelSubscriptionNowDataEncoder,
|
|
209
|
+
getCancelSubscriptionNowDiscriminatorBytes: () => getCancelSubscriptionNowDiscriminatorBytes,
|
|
210
|
+
getCancelSubscriptionNowInstruction: () => getCancelSubscriptionNowInstruction,
|
|
211
|
+
getCancelSubscriptionNowInstructionAsync: () => getCancelSubscriptionNowInstructionAsync,
|
|
212
|
+
getCancelSubscriptionNowInstructionDataCodec: () => getCancelSubscriptionNowInstructionDataCodec,
|
|
213
|
+
getCancelSubscriptionNowInstructionDataDecoder: () => getCancelSubscriptionNowInstructionDataDecoder,
|
|
214
|
+
getCancelSubscriptionNowInstructionDataEncoder: () => getCancelSubscriptionNowInstructionDataEncoder,
|
|
215
|
+
getCancelSubscriptionNowOverlayInstructionAsync: () => getCancelSubscriptionNowOverlayInstructionAsync,
|
|
202
216
|
getCancelSubscriptionOverlayInstructionAsync: () => getCancelSubscriptionOverlayInstructionAsync,
|
|
203
217
|
getCloseSubscriptionAuthorityDiscriminatorBytes: () => getCloseSubscriptionAuthorityDiscriminatorBytes,
|
|
204
218
|
getCloseSubscriptionAuthorityInstruction: () => getCloseSubscriptionAuthorityInstruction,
|
|
@@ -267,6 +281,9 @@ __export(index_exports, {
|
|
|
267
281
|
getRecurringDelegationCodec: () => getRecurringDelegationCodec,
|
|
268
282
|
getRecurringDelegationDecoder: () => getRecurringDelegationDecoder,
|
|
269
283
|
getRecurringDelegationEncoder: () => getRecurringDelegationEncoder,
|
|
284
|
+
getResumeDataCodec: () => getResumeDataCodec,
|
|
285
|
+
getResumeDataDecoder: () => getResumeDataDecoder,
|
|
286
|
+
getResumeDataEncoder: () => getResumeDataEncoder,
|
|
270
287
|
getResumeSubscriptionDiscriminatorBytes: () => getResumeSubscriptionDiscriminatorBytes,
|
|
271
288
|
getResumeSubscriptionInstruction: () => getResumeSubscriptionInstruction,
|
|
272
289
|
getResumeSubscriptionInstructionAsync: () => getResumeSubscriptionInstructionAsync,
|
|
@@ -352,6 +369,7 @@ __export(index_exports, {
|
|
|
352
369
|
identifySubscriptionsInstruction: () => identifySubscriptionsInstruction,
|
|
353
370
|
isSubscriptionsError: () => isSubscriptionsError,
|
|
354
371
|
parseCancelSubscriptionInstruction: () => parseCancelSubscriptionInstruction,
|
|
372
|
+
parseCancelSubscriptionNowInstruction: () => parseCancelSubscriptionNowInstruction,
|
|
355
373
|
parseCloseSubscriptionAuthorityInstruction: () => parseCloseSubscriptionAuthorityInstruction,
|
|
356
374
|
parseCreateFixedDelegationInstruction: () => parseCreateFixedDelegationInstruction,
|
|
357
375
|
parseCreatePlanInstruction: () => parseCreatePlanInstruction,
|
|
@@ -376,7 +394,7 @@ __export(index_exports, {
|
|
|
376
394
|
module.exports = __toCommonJS(index_exports);
|
|
377
395
|
|
|
378
396
|
// src/accounts/decode.ts
|
|
379
|
-
var
|
|
397
|
+
var import_kit45 = require("@solana/kit");
|
|
380
398
|
|
|
381
399
|
// src/generated/accounts/eventAuthority.ts
|
|
382
400
|
var import_kit7 = require("@solana/kit");
|
|
@@ -517,7 +535,7 @@ async function fetchMaybeEventAuthorityFromSeeds(rpc, config = {}) {
|
|
|
517
535
|
}
|
|
518
536
|
|
|
519
537
|
// src/generated/accounts/fixedDelegation.ts
|
|
520
|
-
var
|
|
538
|
+
var import_kit20 = require("@solana/kit");
|
|
521
539
|
|
|
522
540
|
// src/generated/types/accountDiscriminator.ts
|
|
523
541
|
var import_kit8 = require("@solana/kit");
|
|
@@ -539,263 +557,295 @@ function getAccountDiscriminatorCodec() {
|
|
|
539
557
|
return (0, import_kit8.combineCodec)(getAccountDiscriminatorEncoder(), getAccountDiscriminatorDecoder());
|
|
540
558
|
}
|
|
541
559
|
|
|
542
|
-
// src/generated/types/
|
|
560
|
+
// src/generated/types/cancelSubscriptionNowData.ts
|
|
543
561
|
var import_kit9 = require("@solana/kit");
|
|
544
|
-
function
|
|
545
|
-
return (0, import_kit9.getStructEncoder)([
|
|
546
|
-
["nonce", (0, import_kit9.getU64Encoder)()],
|
|
547
|
-
["amount", (0, import_kit9.getU64Encoder)()],
|
|
548
|
-
["expiryTs", (0, import_kit9.getI64Encoder)()],
|
|
549
|
-
["expectedSubscriptionAuthorityInitId", (0, import_kit9.getI64Encoder)()]
|
|
550
|
-
]);
|
|
562
|
+
function getCancelSubscriptionNowDataEncoder() {
|
|
563
|
+
return (0, import_kit9.getStructEncoder)([["expectedCurrentPeriodStartTs", (0, import_kit9.getI64Encoder)()]]);
|
|
551
564
|
}
|
|
552
|
-
function
|
|
553
|
-
return (0, import_kit9.getStructDecoder)([
|
|
554
|
-
["nonce", (0, import_kit9.getU64Decoder)()],
|
|
555
|
-
["amount", (0, import_kit9.getU64Decoder)()],
|
|
556
|
-
["expiryTs", (0, import_kit9.getI64Decoder)()],
|
|
557
|
-
["expectedSubscriptionAuthorityInitId", (0, import_kit9.getI64Decoder)()]
|
|
558
|
-
]);
|
|
565
|
+
function getCancelSubscriptionNowDataDecoder() {
|
|
566
|
+
return (0, import_kit9.getStructDecoder)([["expectedCurrentPeriodStartTs", (0, import_kit9.getI64Decoder)()]]);
|
|
559
567
|
}
|
|
560
|
-
function
|
|
561
|
-
return (0, import_kit9.combineCodec)(
|
|
568
|
+
function getCancelSubscriptionNowDataCodec() {
|
|
569
|
+
return (0, import_kit9.combineCodec)(getCancelSubscriptionNowDataEncoder(), getCancelSubscriptionNowDataDecoder());
|
|
562
570
|
}
|
|
563
571
|
|
|
564
|
-
// src/generated/types/
|
|
572
|
+
// src/generated/types/createFixedDelegationData.ts
|
|
565
573
|
var import_kit10 = require("@solana/kit");
|
|
566
|
-
function
|
|
574
|
+
function getCreateFixedDelegationDataEncoder() {
|
|
567
575
|
return (0, import_kit10.getStructEncoder)([
|
|
568
576
|
["nonce", (0, import_kit10.getU64Encoder)()],
|
|
569
|
-
["
|
|
570
|
-
["periodLengthS", (0, import_kit10.getU64Encoder)()],
|
|
571
|
-
["startTs", (0, import_kit10.getI64Encoder)()],
|
|
577
|
+
["amount", (0, import_kit10.getU64Encoder)()],
|
|
572
578
|
["expiryTs", (0, import_kit10.getI64Encoder)()],
|
|
573
579
|
["expectedSubscriptionAuthorityInitId", (0, import_kit10.getI64Encoder)()]
|
|
574
580
|
]);
|
|
575
581
|
}
|
|
576
|
-
function
|
|
582
|
+
function getCreateFixedDelegationDataDecoder() {
|
|
577
583
|
return (0, import_kit10.getStructDecoder)([
|
|
578
584
|
["nonce", (0, import_kit10.getU64Decoder)()],
|
|
579
|
-
["
|
|
580
|
-
["periodLengthS", (0, import_kit10.getU64Decoder)()],
|
|
581
|
-
["startTs", (0, import_kit10.getI64Decoder)()],
|
|
585
|
+
["amount", (0, import_kit10.getU64Decoder)()],
|
|
582
586
|
["expiryTs", (0, import_kit10.getI64Decoder)()],
|
|
583
587
|
["expectedSubscriptionAuthorityInitId", (0, import_kit10.getI64Decoder)()]
|
|
584
588
|
]);
|
|
585
589
|
}
|
|
590
|
+
function getCreateFixedDelegationDataCodec() {
|
|
591
|
+
return (0, import_kit10.combineCodec)(getCreateFixedDelegationDataEncoder(), getCreateFixedDelegationDataDecoder());
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
// src/generated/types/createRecurringDelegationData.ts
|
|
595
|
+
var import_kit11 = require("@solana/kit");
|
|
596
|
+
function getCreateRecurringDelegationDataEncoder() {
|
|
597
|
+
return (0, import_kit11.getStructEncoder)([
|
|
598
|
+
["nonce", (0, import_kit11.getU64Encoder)()],
|
|
599
|
+
["amountPerPeriod", (0, import_kit11.getU64Encoder)()],
|
|
600
|
+
["periodLengthS", (0, import_kit11.getU64Encoder)()],
|
|
601
|
+
["startTs", (0, import_kit11.getI64Encoder)()],
|
|
602
|
+
["expiryTs", (0, import_kit11.getI64Encoder)()],
|
|
603
|
+
["expectedSubscriptionAuthorityInitId", (0, import_kit11.getI64Encoder)()]
|
|
604
|
+
]);
|
|
605
|
+
}
|
|
606
|
+
function getCreateRecurringDelegationDataDecoder() {
|
|
607
|
+
return (0, import_kit11.getStructDecoder)([
|
|
608
|
+
["nonce", (0, import_kit11.getU64Decoder)()],
|
|
609
|
+
["amountPerPeriod", (0, import_kit11.getU64Decoder)()],
|
|
610
|
+
["periodLengthS", (0, import_kit11.getU64Decoder)()],
|
|
611
|
+
["startTs", (0, import_kit11.getI64Decoder)()],
|
|
612
|
+
["expiryTs", (0, import_kit11.getI64Decoder)()],
|
|
613
|
+
["expectedSubscriptionAuthorityInitId", (0, import_kit11.getI64Decoder)()]
|
|
614
|
+
]);
|
|
615
|
+
}
|
|
586
616
|
function getCreateRecurringDelegationDataCodec() {
|
|
587
|
-
return (0,
|
|
617
|
+
return (0, import_kit11.combineCodec)(getCreateRecurringDelegationDataEncoder(), getCreateRecurringDelegationDataDecoder());
|
|
588
618
|
}
|
|
589
619
|
|
|
590
620
|
// src/generated/types/header.ts
|
|
591
|
-
var
|
|
621
|
+
var import_kit12 = require("@solana/kit");
|
|
592
622
|
function getHeaderEncoder() {
|
|
593
|
-
return (0,
|
|
594
|
-
["discriminator", (0,
|
|
595
|
-
["version", (0,
|
|
596
|
-
["bump", (0,
|
|
597
|
-
["delegator", (0,
|
|
598
|
-
["delegatee", (0,
|
|
599
|
-
["payer", (0,
|
|
600
|
-
["initId", (0,
|
|
623
|
+
return (0, import_kit12.getStructEncoder)([
|
|
624
|
+
["discriminator", (0, import_kit12.getU8Encoder)()],
|
|
625
|
+
["version", (0, import_kit12.getU8Encoder)()],
|
|
626
|
+
["bump", (0, import_kit12.getU8Encoder)()],
|
|
627
|
+
["delegator", (0, import_kit12.getAddressEncoder)()],
|
|
628
|
+
["delegatee", (0, import_kit12.getAddressEncoder)()],
|
|
629
|
+
["payer", (0, import_kit12.getAddressEncoder)()],
|
|
630
|
+
["initId", (0, import_kit12.getI64Encoder)()]
|
|
601
631
|
]);
|
|
602
632
|
}
|
|
603
633
|
function getHeaderDecoder() {
|
|
604
|
-
return (0,
|
|
605
|
-
["discriminator", (0,
|
|
606
|
-
["version", (0,
|
|
607
|
-
["bump", (0,
|
|
608
|
-
["delegator", (0,
|
|
609
|
-
["delegatee", (0,
|
|
610
|
-
["payer", (0,
|
|
611
|
-
["initId", (0,
|
|
634
|
+
return (0, import_kit12.getStructDecoder)([
|
|
635
|
+
["discriminator", (0, import_kit12.getU8Decoder)()],
|
|
636
|
+
["version", (0, import_kit12.getU8Decoder)()],
|
|
637
|
+
["bump", (0, import_kit12.getU8Decoder)()],
|
|
638
|
+
["delegator", (0, import_kit12.getAddressDecoder)()],
|
|
639
|
+
["delegatee", (0, import_kit12.getAddressDecoder)()],
|
|
640
|
+
["payer", (0, import_kit12.getAddressDecoder)()],
|
|
641
|
+
["initId", (0, import_kit12.getI64Decoder)()]
|
|
612
642
|
]);
|
|
613
643
|
}
|
|
614
644
|
function getHeaderCodec() {
|
|
615
|
-
return (0,
|
|
645
|
+
return (0, import_kit12.combineCodec)(getHeaderEncoder(), getHeaderDecoder());
|
|
616
646
|
}
|
|
617
647
|
|
|
618
648
|
// src/generated/types/planData.ts
|
|
619
|
-
var
|
|
649
|
+
var import_kit13 = require("@solana/kit");
|
|
620
650
|
function getPlanDataEncoder() {
|
|
621
|
-
return (0,
|
|
622
|
-
["planId", (0,
|
|
623
|
-
["mint", (0,
|
|
651
|
+
return (0, import_kit13.getStructEncoder)([
|
|
652
|
+
["planId", (0, import_kit13.getU64Encoder)()],
|
|
653
|
+
["mint", (0, import_kit13.getAddressEncoder)()],
|
|
624
654
|
["terms", getPlanTermsEncoder()],
|
|
625
|
-
["endTs", (0,
|
|
626
|
-
["destinations", (0,
|
|
627
|
-
["pullers", (0,
|
|
628
|
-
["metadataUri", (0,
|
|
655
|
+
["endTs", (0, import_kit13.getI64Encoder)()],
|
|
656
|
+
["destinations", (0, import_kit13.getArrayEncoder)((0, import_kit13.getAddressEncoder)(), { size: 4 })],
|
|
657
|
+
["pullers", (0, import_kit13.getArrayEncoder)((0, import_kit13.getAddressEncoder)(), { size: 4 })],
|
|
658
|
+
["metadataUri", (0, import_kit13.fixEncoderSize)((0, import_kit13.getUtf8Encoder)(), 128)]
|
|
629
659
|
]);
|
|
630
660
|
}
|
|
631
661
|
function getPlanDataDecoder() {
|
|
632
|
-
return (0,
|
|
633
|
-
["planId", (0,
|
|
634
|
-
["mint", (0,
|
|
662
|
+
return (0, import_kit13.getStructDecoder)([
|
|
663
|
+
["planId", (0, import_kit13.getU64Decoder)()],
|
|
664
|
+
["mint", (0, import_kit13.getAddressDecoder)()],
|
|
635
665
|
["terms", getPlanTermsDecoder()],
|
|
636
|
-
["endTs", (0,
|
|
637
|
-
["destinations", (0,
|
|
638
|
-
["pullers", (0,
|
|
639
|
-
["metadataUri", (0,
|
|
666
|
+
["endTs", (0, import_kit13.getI64Decoder)()],
|
|
667
|
+
["destinations", (0, import_kit13.getArrayDecoder)((0, import_kit13.getAddressDecoder)(), { size: 4 })],
|
|
668
|
+
["pullers", (0, import_kit13.getArrayDecoder)((0, import_kit13.getAddressDecoder)(), { size: 4 })],
|
|
669
|
+
["metadataUri", (0, import_kit13.fixDecoderSize)((0, import_kit13.getUtf8Decoder)(), 128)]
|
|
640
670
|
]);
|
|
641
671
|
}
|
|
642
672
|
function getPlanDataCodec() {
|
|
643
|
-
return (0,
|
|
673
|
+
return (0, import_kit13.combineCodec)(getPlanDataEncoder(), getPlanDataDecoder());
|
|
644
674
|
}
|
|
645
675
|
|
|
646
676
|
// src/generated/types/planStatus.ts
|
|
647
|
-
var
|
|
677
|
+
var import_kit14 = require("@solana/kit");
|
|
648
678
|
var PlanStatus = /* @__PURE__ */ ((PlanStatus2) => {
|
|
649
679
|
PlanStatus2[PlanStatus2["Sunset"] = 0] = "Sunset";
|
|
650
680
|
PlanStatus2[PlanStatus2["Active"] = 1] = "Active";
|
|
651
681
|
return PlanStatus2;
|
|
652
682
|
})(PlanStatus || {});
|
|
653
683
|
function getPlanStatusEncoder() {
|
|
654
|
-
return (0,
|
|
684
|
+
return (0, import_kit14.getEnumEncoder)(PlanStatus);
|
|
655
685
|
}
|
|
656
686
|
function getPlanStatusDecoder() {
|
|
657
|
-
return (0,
|
|
687
|
+
return (0, import_kit14.getEnumDecoder)(PlanStatus);
|
|
658
688
|
}
|
|
659
689
|
function getPlanStatusCodec() {
|
|
660
|
-
return (0,
|
|
690
|
+
return (0, import_kit14.combineCodec)(getPlanStatusEncoder(), getPlanStatusDecoder());
|
|
661
691
|
}
|
|
662
692
|
|
|
663
693
|
// src/generated/types/planTerms.ts
|
|
664
|
-
var
|
|
694
|
+
var import_kit15 = require("@solana/kit");
|
|
665
695
|
function getPlanTermsEncoder() {
|
|
666
|
-
return (0,
|
|
667
|
-
["amount", (0,
|
|
668
|
-
["periodHours", (0,
|
|
669
|
-
["createdAt", (0,
|
|
696
|
+
return (0, import_kit15.getStructEncoder)([
|
|
697
|
+
["amount", (0, import_kit15.getU64Encoder)()],
|
|
698
|
+
["periodHours", (0, import_kit15.getU64Encoder)()],
|
|
699
|
+
["createdAt", (0, import_kit15.getI64Encoder)()]
|
|
670
700
|
]);
|
|
671
701
|
}
|
|
672
702
|
function getPlanTermsDecoder() {
|
|
673
|
-
return (0,
|
|
674
|
-
["amount", (0,
|
|
675
|
-
["periodHours", (0,
|
|
676
|
-
["createdAt", (0,
|
|
703
|
+
return (0, import_kit15.getStructDecoder)([
|
|
704
|
+
["amount", (0, import_kit15.getU64Decoder)()],
|
|
705
|
+
["periodHours", (0, import_kit15.getU64Decoder)()],
|
|
706
|
+
["createdAt", (0, import_kit15.getI64Decoder)()]
|
|
677
707
|
]);
|
|
678
708
|
}
|
|
679
709
|
function getPlanTermsCodec() {
|
|
680
|
-
return (0,
|
|
710
|
+
return (0, import_kit15.combineCodec)(getPlanTermsEncoder(), getPlanTermsDecoder());
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// src/generated/types/resumeData.ts
|
|
714
|
+
var import_kit16 = require("@solana/kit");
|
|
715
|
+
function getResumeDataEncoder() {
|
|
716
|
+
return (0, import_kit16.getStructEncoder)([["expectedExpiresAtTs", (0, import_kit16.getI64Encoder)()]]);
|
|
717
|
+
}
|
|
718
|
+
function getResumeDataDecoder() {
|
|
719
|
+
return (0, import_kit16.getStructDecoder)([["expectedExpiresAtTs", (0, import_kit16.getI64Decoder)()]]);
|
|
720
|
+
}
|
|
721
|
+
function getResumeDataCodec() {
|
|
722
|
+
return (0, import_kit16.combineCodec)(getResumeDataEncoder(), getResumeDataDecoder());
|
|
681
723
|
}
|
|
682
724
|
|
|
683
725
|
// src/generated/types/subscribeData.ts
|
|
684
|
-
var
|
|
726
|
+
var import_kit17 = require("@solana/kit");
|
|
685
727
|
function getSubscribeDataEncoder() {
|
|
686
|
-
return (0,
|
|
687
|
-
["planId", (0,
|
|
688
|
-
["planBump", (0,
|
|
689
|
-
["expectedMint", (0,
|
|
690
|
-
["expectedAmount", (0,
|
|
691
|
-
["expectedPeriodHours", (0,
|
|
692
|
-
["expectedCreatedAt", (0,
|
|
693
|
-
["expectedSubscriptionAuthorityInitId", (0,
|
|
728
|
+
return (0, import_kit17.getStructEncoder)([
|
|
729
|
+
["planId", (0, import_kit17.getU64Encoder)()],
|
|
730
|
+
["planBump", (0, import_kit17.getU8Encoder)()],
|
|
731
|
+
["expectedMint", (0, import_kit17.getAddressEncoder)()],
|
|
732
|
+
["expectedAmount", (0, import_kit17.getU64Encoder)()],
|
|
733
|
+
["expectedPeriodHours", (0, import_kit17.getU64Encoder)()],
|
|
734
|
+
["expectedCreatedAt", (0, import_kit17.getI64Encoder)()],
|
|
735
|
+
["expectedSubscriptionAuthorityInitId", (0, import_kit17.getI64Encoder)()]
|
|
694
736
|
]);
|
|
695
737
|
}
|
|
696
738
|
function getSubscribeDataDecoder() {
|
|
697
|
-
return (0,
|
|
698
|
-
["planId", (0,
|
|
699
|
-
["planBump", (0,
|
|
700
|
-
["expectedMint", (0,
|
|
701
|
-
["expectedAmount", (0,
|
|
702
|
-
["expectedPeriodHours", (0,
|
|
703
|
-
["expectedCreatedAt", (0,
|
|
704
|
-
["expectedSubscriptionAuthorityInitId", (0,
|
|
739
|
+
return (0, import_kit17.getStructDecoder)([
|
|
740
|
+
["planId", (0, import_kit17.getU64Decoder)()],
|
|
741
|
+
["planBump", (0, import_kit17.getU8Decoder)()],
|
|
742
|
+
["expectedMint", (0, import_kit17.getAddressDecoder)()],
|
|
743
|
+
["expectedAmount", (0, import_kit17.getU64Decoder)()],
|
|
744
|
+
["expectedPeriodHours", (0, import_kit17.getU64Decoder)()],
|
|
745
|
+
["expectedCreatedAt", (0, import_kit17.getI64Decoder)()],
|
|
746
|
+
["expectedSubscriptionAuthorityInitId", (0, import_kit17.getI64Decoder)()]
|
|
705
747
|
]);
|
|
706
748
|
}
|
|
707
749
|
function getSubscribeDataCodec() {
|
|
708
|
-
return (0,
|
|
750
|
+
return (0, import_kit17.combineCodec)(getSubscribeDataEncoder(), getSubscribeDataDecoder());
|
|
709
751
|
}
|
|
710
752
|
|
|
711
753
|
// src/generated/types/transferData.ts
|
|
712
|
-
var
|
|
754
|
+
var import_kit18 = require("@solana/kit");
|
|
713
755
|
function getTransferDataEncoder() {
|
|
714
|
-
return (0,
|
|
715
|
-
["amount", (0,
|
|
716
|
-
["delegator", (0,
|
|
717
|
-
["mint", (0,
|
|
756
|
+
return (0, import_kit18.getStructEncoder)([
|
|
757
|
+
["amount", (0, import_kit18.getU64Encoder)()],
|
|
758
|
+
["delegator", (0, import_kit18.getAddressEncoder)()],
|
|
759
|
+
["mint", (0, import_kit18.getAddressEncoder)()]
|
|
718
760
|
]);
|
|
719
761
|
}
|
|
720
762
|
function getTransferDataDecoder() {
|
|
721
|
-
return (0,
|
|
722
|
-
["amount", (0,
|
|
723
|
-
["delegator", (0,
|
|
724
|
-
["mint", (0,
|
|
763
|
+
return (0, import_kit18.getStructDecoder)([
|
|
764
|
+
["amount", (0, import_kit18.getU64Decoder)()],
|
|
765
|
+
["delegator", (0, import_kit18.getAddressDecoder)()],
|
|
766
|
+
["mint", (0, import_kit18.getAddressDecoder)()]
|
|
725
767
|
]);
|
|
726
768
|
}
|
|
727
769
|
function getTransferDataCodec() {
|
|
728
|
-
return (0,
|
|
770
|
+
return (0, import_kit18.combineCodec)(getTransferDataEncoder(), getTransferDataDecoder());
|
|
729
771
|
}
|
|
730
772
|
|
|
731
773
|
// src/generated/types/updatePlanData.ts
|
|
732
|
-
var
|
|
774
|
+
var import_kit19 = require("@solana/kit");
|
|
733
775
|
function getUpdatePlanDataEncoder() {
|
|
734
|
-
return (0,
|
|
735
|
-
["status", (0,
|
|
736
|
-
["endTs", (0,
|
|
737
|
-
["pullers", (0,
|
|
738
|
-
["metadataUri", (0,
|
|
776
|
+
return (0, import_kit19.getStructEncoder)([
|
|
777
|
+
["status", (0, import_kit19.getU8Encoder)()],
|
|
778
|
+
["endTs", (0, import_kit19.getI64Encoder)()],
|
|
779
|
+
["pullers", (0, import_kit19.getArrayEncoder)((0, import_kit19.getAddressEncoder)(), { size: 4 })],
|
|
780
|
+
["metadataUri", (0, import_kit19.fixEncoderSize)((0, import_kit19.getUtf8Encoder)(), 128)],
|
|
781
|
+
["expectedCreatedAt", (0, import_kit19.getI64Encoder)()],
|
|
782
|
+
["expectedEndTs", (0, import_kit19.getI64Encoder)()],
|
|
783
|
+
["expectedPullers", (0, import_kit19.getArrayEncoder)((0, import_kit19.getAddressEncoder)(), { size: 4 })],
|
|
784
|
+
["expectedMetadataUri", (0, import_kit19.fixEncoderSize)((0, import_kit19.getUtf8Encoder)(), 128)]
|
|
739
785
|
]);
|
|
740
786
|
}
|
|
741
787
|
function getUpdatePlanDataDecoder() {
|
|
742
|
-
return (0,
|
|
743
|
-
["status", (0,
|
|
744
|
-
["endTs", (0,
|
|
745
|
-
["pullers", (0,
|
|
746
|
-
["metadataUri", (0,
|
|
788
|
+
return (0, import_kit19.getStructDecoder)([
|
|
789
|
+
["status", (0, import_kit19.getU8Decoder)()],
|
|
790
|
+
["endTs", (0, import_kit19.getI64Decoder)()],
|
|
791
|
+
["pullers", (0, import_kit19.getArrayDecoder)((0, import_kit19.getAddressDecoder)(), { size: 4 })],
|
|
792
|
+
["metadataUri", (0, import_kit19.fixDecoderSize)((0, import_kit19.getUtf8Decoder)(), 128)],
|
|
793
|
+
["expectedCreatedAt", (0, import_kit19.getI64Decoder)()],
|
|
794
|
+
["expectedEndTs", (0, import_kit19.getI64Decoder)()],
|
|
795
|
+
["expectedPullers", (0, import_kit19.getArrayDecoder)((0, import_kit19.getAddressDecoder)(), { size: 4 })],
|
|
796
|
+
["expectedMetadataUri", (0, import_kit19.fixDecoderSize)((0, import_kit19.getUtf8Decoder)(), 128)]
|
|
747
797
|
]);
|
|
748
798
|
}
|
|
749
799
|
function getUpdatePlanDataCodec() {
|
|
750
|
-
return (0,
|
|
800
|
+
return (0, import_kit19.combineCodec)(getUpdatePlanDataEncoder(), getUpdatePlanDataDecoder());
|
|
751
801
|
}
|
|
752
802
|
|
|
753
803
|
// src/generated/accounts/fixedDelegation.ts
|
|
754
804
|
function getFixedDelegationEncoder() {
|
|
755
|
-
return (0,
|
|
805
|
+
return (0, import_kit20.getStructEncoder)([
|
|
756
806
|
["header", getHeaderEncoder()],
|
|
757
|
-
["subscriptionAuthority", (0,
|
|
758
|
-
["mint", (0,
|
|
759
|
-
["amount", (0,
|
|
760
|
-
["expiryTs", (0,
|
|
807
|
+
["subscriptionAuthority", (0, import_kit20.getAddressEncoder)()],
|
|
808
|
+
["mint", (0, import_kit20.getAddressEncoder)()],
|
|
809
|
+
["amount", (0, import_kit20.getU64Encoder)()],
|
|
810
|
+
["expiryTs", (0, import_kit20.getI64Encoder)()]
|
|
761
811
|
]);
|
|
762
812
|
}
|
|
763
813
|
function getFixedDelegationDecoder() {
|
|
764
|
-
return (0,
|
|
814
|
+
return (0, import_kit20.getStructDecoder)([
|
|
765
815
|
["header", getHeaderDecoder()],
|
|
766
|
-
["subscriptionAuthority", (0,
|
|
767
|
-
["mint", (0,
|
|
768
|
-
["amount", (0,
|
|
769
|
-
["expiryTs", (0,
|
|
816
|
+
["subscriptionAuthority", (0, import_kit20.getAddressDecoder)()],
|
|
817
|
+
["mint", (0, import_kit20.getAddressDecoder)()],
|
|
818
|
+
["amount", (0, import_kit20.getU64Decoder)()],
|
|
819
|
+
["expiryTs", (0, import_kit20.getI64Decoder)()]
|
|
770
820
|
]);
|
|
771
821
|
}
|
|
772
822
|
function getFixedDelegationCodec() {
|
|
773
|
-
return (0,
|
|
823
|
+
return (0, import_kit20.combineCodec)(getFixedDelegationEncoder(), getFixedDelegationDecoder());
|
|
774
824
|
}
|
|
775
825
|
function decodeFixedDelegation(encodedAccount) {
|
|
776
|
-
return (0,
|
|
826
|
+
return (0, import_kit20.decodeAccount)(encodedAccount, getFixedDelegationDecoder());
|
|
777
827
|
}
|
|
778
828
|
async function fetchFixedDelegation(rpc, address, config) {
|
|
779
829
|
const maybeAccount = await fetchMaybeFixedDelegation(rpc, address, config);
|
|
780
|
-
(0,
|
|
830
|
+
(0, import_kit20.assertAccountExists)(maybeAccount);
|
|
781
831
|
return maybeAccount;
|
|
782
832
|
}
|
|
783
833
|
async function fetchMaybeFixedDelegation(rpc, address, config) {
|
|
784
|
-
const maybeAccount = await (0,
|
|
834
|
+
const maybeAccount = await (0, import_kit20.fetchEncodedAccount)(rpc, address, config);
|
|
785
835
|
return decodeFixedDelegation(maybeAccount);
|
|
786
836
|
}
|
|
787
837
|
async function fetchAllFixedDelegation(rpc, addresses, config) {
|
|
788
838
|
const maybeAccounts = await fetchAllMaybeFixedDelegation(rpc, addresses, config);
|
|
789
|
-
(0,
|
|
839
|
+
(0, import_kit20.assertAccountsExist)(maybeAccounts);
|
|
790
840
|
return maybeAccounts;
|
|
791
841
|
}
|
|
792
842
|
async function fetchAllMaybeFixedDelegation(rpc, addresses, config) {
|
|
793
|
-
const maybeAccounts = await (0,
|
|
843
|
+
const maybeAccounts = await (0, import_kit20.fetchEncodedAccounts)(rpc, addresses, config);
|
|
794
844
|
return maybeAccounts.map((maybeAccount) => decodeFixedDelegation(maybeAccount));
|
|
795
845
|
}
|
|
796
846
|
async function fetchFixedDelegationFromSeeds(rpc, seeds, config = {}) {
|
|
797
847
|
const maybeAccount = await fetchMaybeFixedDelegationFromSeeds(rpc, seeds, config);
|
|
798
|
-
(0,
|
|
848
|
+
(0, import_kit20.assertAccountExists)(maybeAccount);
|
|
799
849
|
return maybeAccount;
|
|
800
850
|
}
|
|
801
851
|
async function fetchMaybeFixedDelegationFromSeeds(rpc, seeds, config = {}) {
|
|
@@ -805,52 +855,52 @@ async function fetchMaybeFixedDelegationFromSeeds(rpc, seeds, config = {}) {
|
|
|
805
855
|
}
|
|
806
856
|
|
|
807
857
|
// src/generated/accounts/plan.ts
|
|
808
|
-
var
|
|
858
|
+
var import_kit21 = require("@solana/kit");
|
|
809
859
|
function getPlanEncoder() {
|
|
810
|
-
return (0,
|
|
811
|
-
["discriminator", (0,
|
|
812
|
-
["owner", (0,
|
|
813
|
-
["bump", (0,
|
|
814
|
-
["status", (0,
|
|
860
|
+
return (0, import_kit21.getStructEncoder)([
|
|
861
|
+
["discriminator", (0, import_kit21.getU8Encoder)()],
|
|
862
|
+
["owner", (0, import_kit21.getAddressEncoder)()],
|
|
863
|
+
["bump", (0, import_kit21.getU8Encoder)()],
|
|
864
|
+
["status", (0, import_kit21.getU8Encoder)()],
|
|
815
865
|
["data", getPlanDataEncoder()]
|
|
816
866
|
]);
|
|
817
867
|
}
|
|
818
868
|
function getPlanDecoder() {
|
|
819
|
-
return (0,
|
|
820
|
-
["discriminator", (0,
|
|
821
|
-
["owner", (0,
|
|
822
|
-
["bump", (0,
|
|
823
|
-
["status", (0,
|
|
869
|
+
return (0, import_kit21.getStructDecoder)([
|
|
870
|
+
["discriminator", (0, import_kit21.getU8Decoder)()],
|
|
871
|
+
["owner", (0, import_kit21.getAddressDecoder)()],
|
|
872
|
+
["bump", (0, import_kit21.getU8Decoder)()],
|
|
873
|
+
["status", (0, import_kit21.getU8Decoder)()],
|
|
824
874
|
["data", getPlanDataDecoder()]
|
|
825
875
|
]);
|
|
826
876
|
}
|
|
827
877
|
function getPlanCodec() {
|
|
828
|
-
return (0,
|
|
878
|
+
return (0, import_kit21.combineCodec)(getPlanEncoder(), getPlanDecoder());
|
|
829
879
|
}
|
|
830
880
|
function decodePlan(encodedAccount) {
|
|
831
|
-
return (0,
|
|
881
|
+
return (0, import_kit21.decodeAccount)(encodedAccount, getPlanDecoder());
|
|
832
882
|
}
|
|
833
883
|
async function fetchPlan(rpc, address, config) {
|
|
834
884
|
const maybeAccount = await fetchMaybePlan(rpc, address, config);
|
|
835
|
-
(0,
|
|
885
|
+
(0, import_kit21.assertAccountExists)(maybeAccount);
|
|
836
886
|
return maybeAccount;
|
|
837
887
|
}
|
|
838
888
|
async function fetchMaybePlan(rpc, address, config) {
|
|
839
|
-
const maybeAccount = await (0,
|
|
889
|
+
const maybeAccount = await (0, import_kit21.fetchEncodedAccount)(rpc, address, config);
|
|
840
890
|
return decodePlan(maybeAccount);
|
|
841
891
|
}
|
|
842
892
|
async function fetchAllPlan(rpc, addresses, config) {
|
|
843
893
|
const maybeAccounts = await fetchAllMaybePlan(rpc, addresses, config);
|
|
844
|
-
(0,
|
|
894
|
+
(0, import_kit21.assertAccountsExist)(maybeAccounts);
|
|
845
895
|
return maybeAccounts;
|
|
846
896
|
}
|
|
847
897
|
async function fetchAllMaybePlan(rpc, addresses, config) {
|
|
848
|
-
const maybeAccounts = await (0,
|
|
898
|
+
const maybeAccounts = await (0, import_kit21.fetchEncodedAccounts)(rpc, addresses, config);
|
|
849
899
|
return maybeAccounts.map((maybeAccount) => decodePlan(maybeAccount));
|
|
850
900
|
}
|
|
851
901
|
async function fetchPlanFromSeeds(rpc, seeds, config = {}) {
|
|
852
902
|
const maybeAccount = await fetchMaybePlanFromSeeds(rpc, seeds, config);
|
|
853
|
-
(0,
|
|
903
|
+
(0, import_kit21.assertAccountExists)(maybeAccount);
|
|
854
904
|
return maybeAccount;
|
|
855
905
|
}
|
|
856
906
|
async function fetchMaybePlanFromSeeds(rpc, seeds, config = {}) {
|
|
@@ -860,58 +910,58 @@ async function fetchMaybePlanFromSeeds(rpc, seeds, config = {}) {
|
|
|
860
910
|
}
|
|
861
911
|
|
|
862
912
|
// src/generated/accounts/recurringDelegation.ts
|
|
863
|
-
var
|
|
913
|
+
var import_kit22 = require("@solana/kit");
|
|
864
914
|
function getRecurringDelegationEncoder() {
|
|
865
|
-
return (0,
|
|
915
|
+
return (0, import_kit22.getStructEncoder)([
|
|
866
916
|
["header", getHeaderEncoder()],
|
|
867
|
-
["subscriptionAuthority", (0,
|
|
868
|
-
["mint", (0,
|
|
869
|
-
["currentPeriodStartTs", (0,
|
|
870
|
-
["periodLengthS", (0,
|
|
871
|
-
["expiryTs", (0,
|
|
872
|
-
["amountPerPeriod", (0,
|
|
873
|
-
["amountPulledInPeriod", (0,
|
|
917
|
+
["subscriptionAuthority", (0, import_kit22.getAddressEncoder)()],
|
|
918
|
+
["mint", (0, import_kit22.getAddressEncoder)()],
|
|
919
|
+
["currentPeriodStartTs", (0, import_kit22.getI64Encoder)()],
|
|
920
|
+
["periodLengthS", (0, import_kit22.getU64Encoder)()],
|
|
921
|
+
["expiryTs", (0, import_kit22.getI64Encoder)()],
|
|
922
|
+
["amountPerPeriod", (0, import_kit22.getU64Encoder)()],
|
|
923
|
+
["amountPulledInPeriod", (0, import_kit22.getU64Encoder)()]
|
|
874
924
|
]);
|
|
875
925
|
}
|
|
876
926
|
function getRecurringDelegationDecoder() {
|
|
877
|
-
return (0,
|
|
927
|
+
return (0, import_kit22.getStructDecoder)([
|
|
878
928
|
["header", getHeaderDecoder()],
|
|
879
|
-
["subscriptionAuthority", (0,
|
|
880
|
-
["mint", (0,
|
|
881
|
-
["currentPeriodStartTs", (0,
|
|
882
|
-
["periodLengthS", (0,
|
|
883
|
-
["expiryTs", (0,
|
|
884
|
-
["amountPerPeriod", (0,
|
|
885
|
-
["amountPulledInPeriod", (0,
|
|
929
|
+
["subscriptionAuthority", (0, import_kit22.getAddressDecoder)()],
|
|
930
|
+
["mint", (0, import_kit22.getAddressDecoder)()],
|
|
931
|
+
["currentPeriodStartTs", (0, import_kit22.getI64Decoder)()],
|
|
932
|
+
["periodLengthS", (0, import_kit22.getU64Decoder)()],
|
|
933
|
+
["expiryTs", (0, import_kit22.getI64Decoder)()],
|
|
934
|
+
["amountPerPeriod", (0, import_kit22.getU64Decoder)()],
|
|
935
|
+
["amountPulledInPeriod", (0, import_kit22.getU64Decoder)()]
|
|
886
936
|
]);
|
|
887
937
|
}
|
|
888
938
|
function getRecurringDelegationCodec() {
|
|
889
|
-
return (0,
|
|
939
|
+
return (0, import_kit22.combineCodec)(getRecurringDelegationEncoder(), getRecurringDelegationDecoder());
|
|
890
940
|
}
|
|
891
941
|
function decodeRecurringDelegation(encodedAccount) {
|
|
892
|
-
return (0,
|
|
942
|
+
return (0, import_kit22.decodeAccount)(encodedAccount, getRecurringDelegationDecoder());
|
|
893
943
|
}
|
|
894
944
|
async function fetchRecurringDelegation(rpc, address, config) {
|
|
895
945
|
const maybeAccount = await fetchMaybeRecurringDelegation(rpc, address, config);
|
|
896
|
-
(0,
|
|
946
|
+
(0, import_kit22.assertAccountExists)(maybeAccount);
|
|
897
947
|
return maybeAccount;
|
|
898
948
|
}
|
|
899
949
|
async function fetchMaybeRecurringDelegation(rpc, address, config) {
|
|
900
|
-
const maybeAccount = await (0,
|
|
950
|
+
const maybeAccount = await (0, import_kit22.fetchEncodedAccount)(rpc, address, config);
|
|
901
951
|
return decodeRecurringDelegation(maybeAccount);
|
|
902
952
|
}
|
|
903
953
|
async function fetchAllRecurringDelegation(rpc, addresses, config) {
|
|
904
954
|
const maybeAccounts = await fetchAllMaybeRecurringDelegation(rpc, addresses, config);
|
|
905
|
-
(0,
|
|
955
|
+
(0, import_kit22.assertAccountsExist)(maybeAccounts);
|
|
906
956
|
return maybeAccounts;
|
|
907
957
|
}
|
|
908
958
|
async function fetchAllMaybeRecurringDelegation(rpc, addresses, config) {
|
|
909
|
-
const maybeAccounts = await (0,
|
|
959
|
+
const maybeAccounts = await (0, import_kit22.fetchEncodedAccounts)(rpc, addresses, config);
|
|
910
960
|
return maybeAccounts.map((maybeAccount) => decodeRecurringDelegation(maybeAccount));
|
|
911
961
|
}
|
|
912
962
|
async function fetchRecurringDelegationFromSeeds(rpc, seeds, config = {}) {
|
|
913
963
|
const maybeAccount = await fetchMaybeRecurringDelegationFromSeeds(rpc, seeds, config);
|
|
914
|
-
(0,
|
|
964
|
+
(0, import_kit22.assertAccountExists)(maybeAccount);
|
|
915
965
|
return maybeAccount;
|
|
916
966
|
}
|
|
917
967
|
async function fetchMaybeRecurringDelegationFromSeeds(rpc, seeds, config = {}) {
|
|
@@ -921,54 +971,54 @@ async function fetchMaybeRecurringDelegationFromSeeds(rpc, seeds, config = {}) {
|
|
|
921
971
|
}
|
|
922
972
|
|
|
923
973
|
// src/generated/accounts/subscriptionAuthority.ts
|
|
924
|
-
var
|
|
974
|
+
var import_kit23 = require("@solana/kit");
|
|
925
975
|
function getSubscriptionAuthorityEncoder() {
|
|
926
|
-
return (0,
|
|
927
|
-
["discriminator", (0,
|
|
928
|
-
["user", (0,
|
|
929
|
-
["tokenMint", (0,
|
|
930
|
-
["payer", (0,
|
|
931
|
-
["bump", (0,
|
|
932
|
-
["initId", (0,
|
|
976
|
+
return (0, import_kit23.getStructEncoder)([
|
|
977
|
+
["discriminator", (0, import_kit23.getU8Encoder)()],
|
|
978
|
+
["user", (0, import_kit23.getAddressEncoder)()],
|
|
979
|
+
["tokenMint", (0, import_kit23.getAddressEncoder)()],
|
|
980
|
+
["payer", (0, import_kit23.getAddressEncoder)()],
|
|
981
|
+
["bump", (0, import_kit23.getU8Encoder)()],
|
|
982
|
+
["initId", (0, import_kit23.getI64Encoder)()]
|
|
933
983
|
]);
|
|
934
984
|
}
|
|
935
985
|
function getSubscriptionAuthorityDecoder() {
|
|
936
|
-
return (0,
|
|
937
|
-
["discriminator", (0,
|
|
938
|
-
["user", (0,
|
|
939
|
-
["tokenMint", (0,
|
|
940
|
-
["payer", (0,
|
|
941
|
-
["bump", (0,
|
|
942
|
-
["initId", (0,
|
|
986
|
+
return (0, import_kit23.getStructDecoder)([
|
|
987
|
+
["discriminator", (0, import_kit23.getU8Decoder)()],
|
|
988
|
+
["user", (0, import_kit23.getAddressDecoder)()],
|
|
989
|
+
["tokenMint", (0, import_kit23.getAddressDecoder)()],
|
|
990
|
+
["payer", (0, import_kit23.getAddressDecoder)()],
|
|
991
|
+
["bump", (0, import_kit23.getU8Decoder)()],
|
|
992
|
+
["initId", (0, import_kit23.getI64Decoder)()]
|
|
943
993
|
]);
|
|
944
994
|
}
|
|
945
995
|
function getSubscriptionAuthorityCodec() {
|
|
946
|
-
return (0,
|
|
996
|
+
return (0, import_kit23.combineCodec)(getSubscriptionAuthorityEncoder(), getSubscriptionAuthorityDecoder());
|
|
947
997
|
}
|
|
948
998
|
function decodeSubscriptionAuthority(encodedAccount) {
|
|
949
|
-
return (0,
|
|
999
|
+
return (0, import_kit23.decodeAccount)(encodedAccount, getSubscriptionAuthorityDecoder());
|
|
950
1000
|
}
|
|
951
1001
|
async function fetchSubscriptionAuthority(rpc, address, config) {
|
|
952
1002
|
const maybeAccount = await fetchMaybeSubscriptionAuthority(rpc, address, config);
|
|
953
|
-
(0,
|
|
1003
|
+
(0, import_kit23.assertAccountExists)(maybeAccount);
|
|
954
1004
|
return maybeAccount;
|
|
955
1005
|
}
|
|
956
1006
|
async function fetchMaybeSubscriptionAuthority(rpc, address, config) {
|
|
957
|
-
const maybeAccount = await (0,
|
|
1007
|
+
const maybeAccount = await (0, import_kit23.fetchEncodedAccount)(rpc, address, config);
|
|
958
1008
|
return decodeSubscriptionAuthority(maybeAccount);
|
|
959
1009
|
}
|
|
960
1010
|
async function fetchAllSubscriptionAuthority(rpc, addresses, config) {
|
|
961
1011
|
const maybeAccounts = await fetchAllMaybeSubscriptionAuthority(rpc, addresses, config);
|
|
962
|
-
(0,
|
|
1012
|
+
(0, import_kit23.assertAccountsExist)(maybeAccounts);
|
|
963
1013
|
return maybeAccounts;
|
|
964
1014
|
}
|
|
965
1015
|
async function fetchAllMaybeSubscriptionAuthority(rpc, addresses, config) {
|
|
966
|
-
const maybeAccounts = await (0,
|
|
1016
|
+
const maybeAccounts = await (0, import_kit23.fetchEncodedAccounts)(rpc, addresses, config);
|
|
967
1017
|
return maybeAccounts.map((maybeAccount) => decodeSubscriptionAuthority(maybeAccount));
|
|
968
1018
|
}
|
|
969
1019
|
async function fetchSubscriptionAuthorityFromSeeds(rpc, seeds, config = {}) {
|
|
970
1020
|
const maybeAccount = await fetchMaybeSubscriptionAuthorityFromSeeds(rpc, seeds, config);
|
|
971
|
-
(0,
|
|
1021
|
+
(0, import_kit23.assertAccountExists)(maybeAccount);
|
|
972
1022
|
return maybeAccount;
|
|
973
1023
|
}
|
|
974
1024
|
async function fetchMaybeSubscriptionAuthorityFromSeeds(rpc, seeds, config = {}) {
|
|
@@ -978,52 +1028,52 @@ async function fetchMaybeSubscriptionAuthorityFromSeeds(rpc, seeds, config = {})
|
|
|
978
1028
|
}
|
|
979
1029
|
|
|
980
1030
|
// src/generated/accounts/subscriptionDelegation.ts
|
|
981
|
-
var
|
|
1031
|
+
var import_kit24 = require("@solana/kit");
|
|
982
1032
|
function getSubscriptionDelegationEncoder() {
|
|
983
|
-
return (0,
|
|
1033
|
+
return (0, import_kit24.getStructEncoder)([
|
|
984
1034
|
["header", getHeaderEncoder()],
|
|
985
1035
|
["terms", getPlanTermsEncoder()],
|
|
986
|
-
["amountPulledInPeriod", (0,
|
|
987
|
-
["currentPeriodStartTs", (0,
|
|
988
|
-
["expiresAtTs", (0,
|
|
1036
|
+
["amountPulledInPeriod", (0, import_kit24.getU64Encoder)()],
|
|
1037
|
+
["currentPeriodStartTs", (0, import_kit24.getI64Encoder)()],
|
|
1038
|
+
["expiresAtTs", (0, import_kit24.getI64Encoder)()]
|
|
989
1039
|
]);
|
|
990
1040
|
}
|
|
991
1041
|
function getSubscriptionDelegationDecoder() {
|
|
992
|
-
return (0,
|
|
1042
|
+
return (0, import_kit24.getStructDecoder)([
|
|
993
1043
|
["header", getHeaderDecoder()],
|
|
994
1044
|
["terms", getPlanTermsDecoder()],
|
|
995
|
-
["amountPulledInPeriod", (0,
|
|
996
|
-
["currentPeriodStartTs", (0,
|
|
997
|
-
["expiresAtTs", (0,
|
|
1045
|
+
["amountPulledInPeriod", (0, import_kit24.getU64Decoder)()],
|
|
1046
|
+
["currentPeriodStartTs", (0, import_kit24.getI64Decoder)()],
|
|
1047
|
+
["expiresAtTs", (0, import_kit24.getI64Decoder)()]
|
|
998
1048
|
]);
|
|
999
1049
|
}
|
|
1000
1050
|
function getSubscriptionDelegationCodec() {
|
|
1001
|
-
return (0,
|
|
1051
|
+
return (0, import_kit24.combineCodec)(getSubscriptionDelegationEncoder(), getSubscriptionDelegationDecoder());
|
|
1002
1052
|
}
|
|
1003
1053
|
function decodeSubscriptionDelegation(encodedAccount) {
|
|
1004
|
-
return (0,
|
|
1054
|
+
return (0, import_kit24.decodeAccount)(encodedAccount, getSubscriptionDelegationDecoder());
|
|
1005
1055
|
}
|
|
1006
1056
|
async function fetchSubscriptionDelegation(rpc, address, config) {
|
|
1007
1057
|
const maybeAccount = await fetchMaybeSubscriptionDelegation(rpc, address, config);
|
|
1008
|
-
(0,
|
|
1058
|
+
(0, import_kit24.assertAccountExists)(maybeAccount);
|
|
1009
1059
|
return maybeAccount;
|
|
1010
1060
|
}
|
|
1011
1061
|
async function fetchMaybeSubscriptionDelegation(rpc, address, config) {
|
|
1012
|
-
const maybeAccount = await (0,
|
|
1062
|
+
const maybeAccount = await (0, import_kit24.fetchEncodedAccount)(rpc, address, config);
|
|
1013
1063
|
return decodeSubscriptionDelegation(maybeAccount);
|
|
1014
1064
|
}
|
|
1015
1065
|
async function fetchAllSubscriptionDelegation(rpc, addresses, config) {
|
|
1016
1066
|
const maybeAccounts = await fetchAllMaybeSubscriptionDelegation(rpc, addresses, config);
|
|
1017
|
-
(0,
|
|
1067
|
+
(0, import_kit24.assertAccountsExist)(maybeAccounts);
|
|
1018
1068
|
return maybeAccounts;
|
|
1019
1069
|
}
|
|
1020
1070
|
async function fetchAllMaybeSubscriptionDelegation(rpc, addresses, config) {
|
|
1021
|
-
const maybeAccounts = await (0,
|
|
1071
|
+
const maybeAccounts = await (0, import_kit24.fetchEncodedAccounts)(rpc, addresses, config);
|
|
1022
1072
|
return maybeAccounts.map((maybeAccount) => decodeSubscriptionDelegation(maybeAccount));
|
|
1023
1073
|
}
|
|
1024
1074
|
async function fetchSubscriptionDelegationFromSeeds(rpc, seeds, config = {}) {
|
|
1025
1075
|
const maybeAccount = await fetchMaybeSubscriptionDelegationFromSeeds(rpc, seeds, config);
|
|
1026
|
-
(0,
|
|
1076
|
+
(0, import_kit24.assertAccountExists)(maybeAccount);
|
|
1027
1077
|
return maybeAccount;
|
|
1028
1078
|
}
|
|
1029
1079
|
async function fetchMaybeSubscriptionDelegationFromSeeds(rpc, seeds, config = {}) {
|
|
@@ -1033,30 +1083,30 @@ async function fetchMaybeSubscriptionDelegationFromSeeds(rpc, seeds, config = {}
|
|
|
1033
1083
|
}
|
|
1034
1084
|
|
|
1035
1085
|
// src/generated/errors/subscriptions.ts
|
|
1036
|
-
var
|
|
1086
|
+
var import_kit44 = require("@solana/kit");
|
|
1037
1087
|
|
|
1038
1088
|
// src/generated/programs/subscriptions.ts
|
|
1039
|
-
var
|
|
1040
|
-
var
|
|
1089
|
+
var import_kit43 = require("@solana/kit");
|
|
1090
|
+
var import_program_client_core19 = require("@solana/program-client-core");
|
|
1041
1091
|
|
|
1042
1092
|
// src/generated/instructions/cancelSubscription.ts
|
|
1043
|
-
var
|
|
1093
|
+
var import_kit25 = require("@solana/kit");
|
|
1044
1094
|
var import_program_client_core = require("@solana/program-client-core");
|
|
1045
1095
|
var CANCEL_SUBSCRIPTION_DISCRIMINATOR = 12;
|
|
1046
1096
|
function getCancelSubscriptionDiscriminatorBytes() {
|
|
1047
|
-
return (0,
|
|
1097
|
+
return (0, import_kit25.getU8Encoder)().encode(CANCEL_SUBSCRIPTION_DISCRIMINATOR);
|
|
1048
1098
|
}
|
|
1049
1099
|
function getCancelSubscriptionInstructionDataEncoder() {
|
|
1050
|
-
return (0,
|
|
1100
|
+
return (0, import_kit25.transformEncoder)((0, import_kit25.getStructEncoder)([["discriminator", (0, import_kit25.getU8Encoder)()]]), (value) => ({
|
|
1051
1101
|
...value,
|
|
1052
1102
|
discriminator: CANCEL_SUBSCRIPTION_DISCRIMINATOR
|
|
1053
1103
|
}));
|
|
1054
1104
|
}
|
|
1055
1105
|
function getCancelSubscriptionInstructionDataDecoder() {
|
|
1056
|
-
return (0,
|
|
1106
|
+
return (0, import_kit25.getStructDecoder)([["discriminator", (0, import_kit25.getU8Decoder)()]]);
|
|
1057
1107
|
}
|
|
1058
1108
|
function getCancelSubscriptionInstructionDataCodec() {
|
|
1059
|
-
return (0,
|
|
1109
|
+
return (0, import_kit25.combineCodec)(getCancelSubscriptionInstructionDataEncoder(), getCancelSubscriptionInstructionDataDecoder());
|
|
1060
1110
|
}
|
|
1061
1111
|
async function getCancelSubscriptionInstructionAsync(input, config) {
|
|
1062
1112
|
const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
@@ -1075,9 +1125,9 @@ async function getCancelSubscriptionInstructionAsync(input, config) {
|
|
|
1075
1125
|
});
|
|
1076
1126
|
}
|
|
1077
1127
|
if (!accounts.eventAuthority.value) {
|
|
1078
|
-
accounts.eventAuthority.value = await (0,
|
|
1128
|
+
accounts.eventAuthority.value = await (0, import_kit25.getProgramDerivedAddress)({
|
|
1079
1129
|
programAddress,
|
|
1080
|
-
seeds: [(0,
|
|
1130
|
+
seeds: [(0, import_kit25.getUtf8Encoder)().encode("event_authority")]
|
|
1081
1131
|
});
|
|
1082
1132
|
}
|
|
1083
1133
|
if (!accounts.selfProgram.value) {
|
|
@@ -1126,7 +1176,7 @@ function getCancelSubscriptionInstruction(input, config) {
|
|
|
1126
1176
|
}
|
|
1127
1177
|
function parseCancelSubscriptionInstruction(instruction) {
|
|
1128
1178
|
if (instruction.accounts.length < 5) {
|
|
1129
|
-
throw new
|
|
1179
|
+
throw new import_kit25.SolanaError(import_kit25.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1130
1180
|
actualAccountMetas: instruction.accounts.length,
|
|
1131
1181
|
expectedAccountMetas: 5
|
|
1132
1182
|
});
|
|
@@ -1150,24 +1200,151 @@ function parseCancelSubscriptionInstruction(instruction) {
|
|
|
1150
1200
|
};
|
|
1151
1201
|
}
|
|
1152
1202
|
|
|
1153
|
-
// src/generated/instructions/
|
|
1154
|
-
var
|
|
1203
|
+
// src/generated/instructions/cancelSubscriptionNow.ts
|
|
1204
|
+
var import_kit26 = require("@solana/kit");
|
|
1155
1205
|
var import_program_client_core2 = require("@solana/program-client-core");
|
|
1206
|
+
var CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR = 17;
|
|
1207
|
+
function getCancelSubscriptionNowDiscriminatorBytes() {
|
|
1208
|
+
return (0, import_kit26.getU8Encoder)().encode(CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR);
|
|
1209
|
+
}
|
|
1210
|
+
function getCancelSubscriptionNowInstructionDataEncoder() {
|
|
1211
|
+
return (0, import_kit26.transformEncoder)(
|
|
1212
|
+
(0, import_kit26.getStructEncoder)([
|
|
1213
|
+
["discriminator", (0, import_kit26.getU8Encoder)()],
|
|
1214
|
+
["cancelSubscriptionNowData", getCancelSubscriptionNowDataEncoder()]
|
|
1215
|
+
]),
|
|
1216
|
+
(value) => ({ ...value, discriminator: CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR })
|
|
1217
|
+
);
|
|
1218
|
+
}
|
|
1219
|
+
function getCancelSubscriptionNowInstructionDataDecoder() {
|
|
1220
|
+
return (0, import_kit26.getStructDecoder)([
|
|
1221
|
+
["discriminator", (0, import_kit26.getU8Decoder)()],
|
|
1222
|
+
["cancelSubscriptionNowData", getCancelSubscriptionNowDataDecoder()]
|
|
1223
|
+
]);
|
|
1224
|
+
}
|
|
1225
|
+
function getCancelSubscriptionNowInstructionDataCodec() {
|
|
1226
|
+
return (0, import_kit26.combineCodec)(
|
|
1227
|
+
getCancelSubscriptionNowInstructionDataEncoder(),
|
|
1228
|
+
getCancelSubscriptionNowInstructionDataDecoder()
|
|
1229
|
+
);
|
|
1230
|
+
}
|
|
1231
|
+
async function getCancelSubscriptionNowInstructionAsync(input, config) {
|
|
1232
|
+
const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1233
|
+
const originalAccounts = {
|
|
1234
|
+
subscriber: { value: input.subscriber ?? null, isWritable: false },
|
|
1235
|
+
merchant: { value: input.merchant ?? null, isWritable: false },
|
|
1236
|
+
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
1237
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
1238
|
+
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
1239
|
+
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
1240
|
+
};
|
|
1241
|
+
const accounts = originalAccounts;
|
|
1242
|
+
const args = { ...input };
|
|
1243
|
+
if (!accounts.subscriptionPda.value) {
|
|
1244
|
+
accounts.subscriptionPda.value = await findSubscriptionDelegationPda({
|
|
1245
|
+
planPda: (0, import_program_client_core2.getAddressFromResolvedInstructionAccount)("planPda", accounts.planPda.value),
|
|
1246
|
+
subscriber: (0, import_program_client_core2.getAddressFromResolvedInstructionAccount)("subscriber", accounts.subscriber.value)
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
if (!accounts.eventAuthority.value) {
|
|
1250
|
+
accounts.eventAuthority.value = await (0, import_kit26.getProgramDerivedAddress)({
|
|
1251
|
+
programAddress,
|
|
1252
|
+
seeds: [(0, import_kit26.getUtf8Encoder)().encode("event_authority")]
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
if (!accounts.selfProgram.value) {
|
|
1256
|
+
accounts.selfProgram.value = programAddress;
|
|
1257
|
+
accounts.selfProgram.isWritable = false;
|
|
1258
|
+
}
|
|
1259
|
+
const getAccountMeta = (0, import_program_client_core2.getAccountMetaFactory)(programAddress, "programId");
|
|
1260
|
+
return Object.freeze({
|
|
1261
|
+
accounts: [
|
|
1262
|
+
getAccountMeta("subscriber", accounts.subscriber),
|
|
1263
|
+
getAccountMeta("merchant", accounts.merchant),
|
|
1264
|
+
getAccountMeta("planPda", accounts.planPda),
|
|
1265
|
+
getAccountMeta("subscriptionPda", accounts.subscriptionPda),
|
|
1266
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1267
|
+
getAccountMeta("selfProgram", accounts.selfProgram)
|
|
1268
|
+
],
|
|
1269
|
+
data: getCancelSubscriptionNowInstructionDataEncoder().encode(args),
|
|
1270
|
+
programAddress
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
function getCancelSubscriptionNowInstruction(input, config) {
|
|
1274
|
+
const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
1275
|
+
const originalAccounts = {
|
|
1276
|
+
subscriber: { value: input.subscriber ?? null, isWritable: false },
|
|
1277
|
+
merchant: { value: input.merchant ?? null, isWritable: false },
|
|
1278
|
+
planPda: { value: input.planPda ?? null, isWritable: false },
|
|
1279
|
+
subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
|
|
1280
|
+
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
1281
|
+
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
1282
|
+
};
|
|
1283
|
+
const accounts = originalAccounts;
|
|
1284
|
+
const args = { ...input };
|
|
1285
|
+
if (!accounts.selfProgram.value) {
|
|
1286
|
+
accounts.selfProgram.value = programAddress;
|
|
1287
|
+
accounts.selfProgram.isWritable = false;
|
|
1288
|
+
}
|
|
1289
|
+
const getAccountMeta = (0, import_program_client_core2.getAccountMetaFactory)(programAddress, "programId");
|
|
1290
|
+
return Object.freeze({
|
|
1291
|
+
accounts: [
|
|
1292
|
+
getAccountMeta("subscriber", accounts.subscriber),
|
|
1293
|
+
getAccountMeta("merchant", accounts.merchant),
|
|
1294
|
+
getAccountMeta("planPda", accounts.planPda),
|
|
1295
|
+
getAccountMeta("subscriptionPda", accounts.subscriptionPda),
|
|
1296
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1297
|
+
getAccountMeta("selfProgram", accounts.selfProgram)
|
|
1298
|
+
],
|
|
1299
|
+
data: getCancelSubscriptionNowInstructionDataEncoder().encode(args),
|
|
1300
|
+
programAddress
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
function parseCancelSubscriptionNowInstruction(instruction) {
|
|
1304
|
+
if (instruction.accounts.length < 6) {
|
|
1305
|
+
throw new import_kit26.SolanaError(import_kit26.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1306
|
+
actualAccountMetas: instruction.accounts.length,
|
|
1307
|
+
expectedAccountMetas: 6
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
let accountIndex = 0;
|
|
1311
|
+
const getNextAccount = () => {
|
|
1312
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1313
|
+
accountIndex += 1;
|
|
1314
|
+
return accountMeta;
|
|
1315
|
+
};
|
|
1316
|
+
return {
|
|
1317
|
+
programAddress: instruction.programAddress,
|
|
1318
|
+
accounts: {
|
|
1319
|
+
subscriber: getNextAccount(),
|
|
1320
|
+
merchant: getNextAccount(),
|
|
1321
|
+
planPda: getNextAccount(),
|
|
1322
|
+
subscriptionPda: getNextAccount(),
|
|
1323
|
+
eventAuthority: getNextAccount(),
|
|
1324
|
+
selfProgram: getNextAccount()
|
|
1325
|
+
},
|
|
1326
|
+
data: getCancelSubscriptionNowInstructionDataDecoder().decode(instruction.data)
|
|
1327
|
+
};
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
// src/generated/instructions/closeSubscriptionAuthority.ts
|
|
1331
|
+
var import_kit27 = require("@solana/kit");
|
|
1332
|
+
var import_program_client_core3 = require("@solana/program-client-core");
|
|
1156
1333
|
var CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 6;
|
|
1157
1334
|
function getCloseSubscriptionAuthorityDiscriminatorBytes() {
|
|
1158
|
-
return (0,
|
|
1335
|
+
return (0, import_kit27.getU8Encoder)().encode(CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);
|
|
1159
1336
|
}
|
|
1160
1337
|
function getCloseSubscriptionAuthorityInstructionDataEncoder() {
|
|
1161
|
-
return (0,
|
|
1338
|
+
return (0, import_kit27.transformEncoder)((0, import_kit27.getStructEncoder)([["discriminator", (0, import_kit27.getU8Encoder)()]]), (value) => ({
|
|
1162
1339
|
...value,
|
|
1163
1340
|
discriminator: CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR
|
|
1164
1341
|
}));
|
|
1165
1342
|
}
|
|
1166
1343
|
function getCloseSubscriptionAuthorityInstructionDataDecoder() {
|
|
1167
|
-
return (0,
|
|
1344
|
+
return (0, import_kit27.getStructDecoder)([["discriminator", (0, import_kit27.getU8Decoder)()]]);
|
|
1168
1345
|
}
|
|
1169
1346
|
function getCloseSubscriptionAuthorityInstructionDataCodec() {
|
|
1170
|
-
return (0,
|
|
1347
|
+
return (0, import_kit27.combineCodec)(
|
|
1171
1348
|
getCloseSubscriptionAuthorityInstructionDataEncoder(),
|
|
1172
1349
|
getCloseSubscriptionAuthorityInstructionDataDecoder()
|
|
1173
1350
|
);
|
|
@@ -1180,7 +1357,7 @@ function getCloseSubscriptionAuthorityInstruction(input, config) {
|
|
|
1180
1357
|
receiver: { value: input.receiver ?? null, isWritable: true }
|
|
1181
1358
|
};
|
|
1182
1359
|
const accounts = originalAccounts;
|
|
1183
|
-
const getAccountMeta = (0,
|
|
1360
|
+
const getAccountMeta = (0, import_program_client_core3.getAccountMetaFactory)(programAddress, "omitted");
|
|
1184
1361
|
return Object.freeze({
|
|
1185
1362
|
accounts: [
|
|
1186
1363
|
getAccountMeta("user", accounts.user),
|
|
@@ -1193,7 +1370,7 @@ function getCloseSubscriptionAuthorityInstruction(input, config) {
|
|
|
1193
1370
|
}
|
|
1194
1371
|
function parseCloseSubscriptionAuthorityInstruction(instruction) {
|
|
1195
1372
|
if (instruction.accounts.length < 2) {
|
|
1196
|
-
throw new
|
|
1373
|
+
throw new import_kit27.SolanaError(import_kit27.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1197
1374
|
actualAccountMetas: instruction.accounts.length,
|
|
1198
1375
|
expectedAccountMetas: 2
|
|
1199
1376
|
});
|
|
@@ -1222,29 +1399,29 @@ function parseCloseSubscriptionAuthorityInstruction(instruction) {
|
|
|
1222
1399
|
}
|
|
1223
1400
|
|
|
1224
1401
|
// src/generated/instructions/createFixedDelegation.ts
|
|
1225
|
-
var
|
|
1226
|
-
var
|
|
1402
|
+
var import_kit28 = require("@solana/kit");
|
|
1403
|
+
var import_program_client_core4 = require("@solana/program-client-core");
|
|
1227
1404
|
var CREATE_FIXED_DELEGATION_DISCRIMINATOR = 1;
|
|
1228
1405
|
function getCreateFixedDelegationDiscriminatorBytes() {
|
|
1229
|
-
return (0,
|
|
1406
|
+
return (0, import_kit28.getU8Encoder)().encode(CREATE_FIXED_DELEGATION_DISCRIMINATOR);
|
|
1230
1407
|
}
|
|
1231
1408
|
function getCreateFixedDelegationInstructionDataEncoder() {
|
|
1232
|
-
return (0,
|
|
1233
|
-
(0,
|
|
1234
|
-
["discriminator", (0,
|
|
1409
|
+
return (0, import_kit28.transformEncoder)(
|
|
1410
|
+
(0, import_kit28.getStructEncoder)([
|
|
1411
|
+
["discriminator", (0, import_kit28.getU8Encoder)()],
|
|
1235
1412
|
["fixedDelegation", getCreateFixedDelegationDataEncoder()]
|
|
1236
1413
|
]),
|
|
1237
1414
|
(value) => ({ ...value, discriminator: CREATE_FIXED_DELEGATION_DISCRIMINATOR })
|
|
1238
1415
|
);
|
|
1239
1416
|
}
|
|
1240
1417
|
function getCreateFixedDelegationInstructionDataDecoder() {
|
|
1241
|
-
return (0,
|
|
1242
|
-
["discriminator", (0,
|
|
1418
|
+
return (0, import_kit28.getStructDecoder)([
|
|
1419
|
+
["discriminator", (0, import_kit28.getU8Decoder)()],
|
|
1243
1420
|
["fixedDelegation", getCreateFixedDelegationDataDecoder()]
|
|
1244
1421
|
]);
|
|
1245
1422
|
}
|
|
1246
1423
|
function getCreateFixedDelegationInstructionDataCodec() {
|
|
1247
|
-
return (0,
|
|
1424
|
+
return (0, import_kit28.combineCodec)(
|
|
1248
1425
|
getCreateFixedDelegationInstructionDataEncoder(),
|
|
1249
1426
|
getCreateFixedDelegationInstructionDataDecoder()
|
|
1250
1427
|
);
|
|
@@ -1264,7 +1441,7 @@ function getCreateFixedDelegationInstruction(input, config) {
|
|
|
1264
1441
|
if (!accounts.systemProgram.value) {
|
|
1265
1442
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1266
1443
|
}
|
|
1267
|
-
const getAccountMeta = (0,
|
|
1444
|
+
const getAccountMeta = (0, import_program_client_core4.getAccountMetaFactory)(programAddress, "omitted");
|
|
1268
1445
|
return Object.freeze({
|
|
1269
1446
|
accounts: [
|
|
1270
1447
|
getAccountMeta("delegator", accounts.delegator),
|
|
@@ -1280,7 +1457,7 @@ function getCreateFixedDelegationInstruction(input, config) {
|
|
|
1280
1457
|
}
|
|
1281
1458
|
function parseCreateFixedDelegationInstruction(instruction) {
|
|
1282
1459
|
if (instruction.accounts.length < 5) {
|
|
1283
|
-
throw new
|
|
1460
|
+
throw new import_kit28.SolanaError(import_kit28.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1284
1461
|
actualAccountMetas: instruction.accounts.length,
|
|
1285
1462
|
expectedAccountMetas: 5
|
|
1286
1463
|
});
|
|
@@ -1312,29 +1489,29 @@ function parseCreateFixedDelegationInstruction(instruction) {
|
|
|
1312
1489
|
}
|
|
1313
1490
|
|
|
1314
1491
|
// src/generated/instructions/createPlan.ts
|
|
1315
|
-
var
|
|
1316
|
-
var
|
|
1492
|
+
var import_kit29 = require("@solana/kit");
|
|
1493
|
+
var import_program_client_core5 = require("@solana/program-client-core");
|
|
1317
1494
|
var CREATE_PLAN_DISCRIMINATOR = 7;
|
|
1318
1495
|
function getCreatePlanDiscriminatorBytes() {
|
|
1319
|
-
return (0,
|
|
1496
|
+
return (0, import_kit29.getU8Encoder)().encode(CREATE_PLAN_DISCRIMINATOR);
|
|
1320
1497
|
}
|
|
1321
1498
|
function getCreatePlanInstructionDataEncoder() {
|
|
1322
|
-
return (0,
|
|
1323
|
-
(0,
|
|
1324
|
-
["discriminator", (0,
|
|
1499
|
+
return (0, import_kit29.transformEncoder)(
|
|
1500
|
+
(0, import_kit29.getStructEncoder)([
|
|
1501
|
+
["discriminator", (0, import_kit29.getU8Encoder)()],
|
|
1325
1502
|
["planData", getPlanDataEncoder()]
|
|
1326
1503
|
]),
|
|
1327
1504
|
(value) => ({ ...value, discriminator: CREATE_PLAN_DISCRIMINATOR })
|
|
1328
1505
|
);
|
|
1329
1506
|
}
|
|
1330
1507
|
function getCreatePlanInstructionDataDecoder() {
|
|
1331
|
-
return (0,
|
|
1332
|
-
["discriminator", (0,
|
|
1508
|
+
return (0, import_kit29.getStructDecoder)([
|
|
1509
|
+
["discriminator", (0, import_kit29.getU8Decoder)()],
|
|
1333
1510
|
["planData", getPlanDataDecoder()]
|
|
1334
1511
|
]);
|
|
1335
1512
|
}
|
|
1336
1513
|
function getCreatePlanInstructionDataCodec() {
|
|
1337
|
-
return (0,
|
|
1514
|
+
return (0, import_kit29.combineCodec)(getCreatePlanInstructionDataEncoder(), getCreatePlanInstructionDataDecoder());
|
|
1338
1515
|
}
|
|
1339
1516
|
function getCreatePlanInstruction(input, config) {
|
|
1340
1517
|
const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
@@ -1343,7 +1520,8 @@ function getCreatePlanInstruction(input, config) {
|
|
|
1343
1520
|
planPda: { value: input.planPda ?? null, isWritable: true },
|
|
1344
1521
|
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
1345
1522
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
1346
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false }
|
|
1523
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1524
|
+
payer: { value: input.payer ?? null, isWritable: true }
|
|
1347
1525
|
};
|
|
1348
1526
|
const accounts = originalAccounts;
|
|
1349
1527
|
const args = { ...input };
|
|
@@ -1353,22 +1531,23 @@ function getCreatePlanInstruction(input, config) {
|
|
|
1353
1531
|
if (!accounts.tokenProgram.value) {
|
|
1354
1532
|
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1355
1533
|
}
|
|
1356
|
-
const getAccountMeta = (0,
|
|
1534
|
+
const getAccountMeta = (0, import_program_client_core5.getAccountMetaFactory)(programAddress, "omitted");
|
|
1357
1535
|
return Object.freeze({
|
|
1358
1536
|
accounts: [
|
|
1359
1537
|
getAccountMeta("merchant", accounts.merchant),
|
|
1360
1538
|
getAccountMeta("planPda", accounts.planPda),
|
|
1361
1539
|
getAccountMeta("tokenMint", accounts.tokenMint),
|
|
1362
1540
|
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1363
|
-
getAccountMeta("tokenProgram", accounts.tokenProgram)
|
|
1364
|
-
|
|
1541
|
+
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1542
|
+
getAccountMeta("payer", accounts.payer)
|
|
1543
|
+
].filter((x) => x !== void 0),
|
|
1365
1544
|
data: getCreatePlanInstructionDataEncoder().encode(args),
|
|
1366
1545
|
programAddress
|
|
1367
1546
|
});
|
|
1368
1547
|
}
|
|
1369
1548
|
function parseCreatePlanInstruction(instruction) {
|
|
1370
1549
|
if (instruction.accounts.length < 5) {
|
|
1371
|
-
throw new
|
|
1550
|
+
throw new import_kit29.SolanaError(import_kit29.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1372
1551
|
actualAccountMetas: instruction.accounts.length,
|
|
1373
1552
|
expectedAccountMetas: 5
|
|
1374
1553
|
});
|
|
@@ -1379,6 +1558,12 @@ function parseCreatePlanInstruction(instruction) {
|
|
|
1379
1558
|
accountIndex += 1;
|
|
1380
1559
|
return accountMeta;
|
|
1381
1560
|
};
|
|
1561
|
+
let optionalAccountsRemaining = instruction.accounts.length - 5;
|
|
1562
|
+
const getNextOptionalAccount = () => {
|
|
1563
|
+
if (optionalAccountsRemaining === 0) return void 0;
|
|
1564
|
+
optionalAccountsRemaining -= 1;
|
|
1565
|
+
return getNextAccount();
|
|
1566
|
+
};
|
|
1382
1567
|
return {
|
|
1383
1568
|
programAddress: instruction.programAddress,
|
|
1384
1569
|
accounts: {
|
|
@@ -1386,36 +1571,37 @@ function parseCreatePlanInstruction(instruction) {
|
|
|
1386
1571
|
planPda: getNextAccount(),
|
|
1387
1572
|
tokenMint: getNextAccount(),
|
|
1388
1573
|
systemProgram: getNextAccount(),
|
|
1389
|
-
tokenProgram: getNextAccount()
|
|
1574
|
+
tokenProgram: getNextAccount(),
|
|
1575
|
+
payer: getNextOptionalAccount()
|
|
1390
1576
|
},
|
|
1391
1577
|
data: getCreatePlanInstructionDataDecoder().decode(instruction.data)
|
|
1392
1578
|
};
|
|
1393
1579
|
}
|
|
1394
1580
|
|
|
1395
1581
|
// src/generated/instructions/createRecurringDelegation.ts
|
|
1396
|
-
var
|
|
1397
|
-
var
|
|
1582
|
+
var import_kit30 = require("@solana/kit");
|
|
1583
|
+
var import_program_client_core6 = require("@solana/program-client-core");
|
|
1398
1584
|
var CREATE_RECURRING_DELEGATION_DISCRIMINATOR = 2;
|
|
1399
1585
|
function getCreateRecurringDelegationDiscriminatorBytes() {
|
|
1400
|
-
return (0,
|
|
1586
|
+
return (0, import_kit30.getU8Encoder)().encode(CREATE_RECURRING_DELEGATION_DISCRIMINATOR);
|
|
1401
1587
|
}
|
|
1402
1588
|
function getCreateRecurringDelegationInstructionDataEncoder() {
|
|
1403
|
-
return (0,
|
|
1404
|
-
(0,
|
|
1405
|
-
["discriminator", (0,
|
|
1589
|
+
return (0, import_kit30.transformEncoder)(
|
|
1590
|
+
(0, import_kit30.getStructEncoder)([
|
|
1591
|
+
["discriminator", (0, import_kit30.getU8Encoder)()],
|
|
1406
1592
|
["recurringDelegation", getCreateRecurringDelegationDataEncoder()]
|
|
1407
1593
|
]),
|
|
1408
1594
|
(value) => ({ ...value, discriminator: CREATE_RECURRING_DELEGATION_DISCRIMINATOR })
|
|
1409
1595
|
);
|
|
1410
1596
|
}
|
|
1411
1597
|
function getCreateRecurringDelegationInstructionDataDecoder() {
|
|
1412
|
-
return (0,
|
|
1413
|
-
["discriminator", (0,
|
|
1598
|
+
return (0, import_kit30.getStructDecoder)([
|
|
1599
|
+
["discriminator", (0, import_kit30.getU8Decoder)()],
|
|
1414
1600
|
["recurringDelegation", getCreateRecurringDelegationDataDecoder()]
|
|
1415
1601
|
]);
|
|
1416
1602
|
}
|
|
1417
1603
|
function getCreateRecurringDelegationInstructionDataCodec() {
|
|
1418
|
-
return (0,
|
|
1604
|
+
return (0, import_kit30.combineCodec)(
|
|
1419
1605
|
getCreateRecurringDelegationInstructionDataEncoder(),
|
|
1420
1606
|
getCreateRecurringDelegationInstructionDataDecoder()
|
|
1421
1607
|
);
|
|
@@ -1435,7 +1621,7 @@ function getCreateRecurringDelegationInstruction(input, config) {
|
|
|
1435
1621
|
if (!accounts.systemProgram.value) {
|
|
1436
1622
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1437
1623
|
}
|
|
1438
|
-
const getAccountMeta = (0,
|
|
1624
|
+
const getAccountMeta = (0, import_program_client_core6.getAccountMetaFactory)(programAddress, "omitted");
|
|
1439
1625
|
return Object.freeze({
|
|
1440
1626
|
accounts: [
|
|
1441
1627
|
getAccountMeta("delegator", accounts.delegator),
|
|
@@ -1453,7 +1639,7 @@ function getCreateRecurringDelegationInstruction(input, config) {
|
|
|
1453
1639
|
}
|
|
1454
1640
|
function parseCreateRecurringDelegationInstruction(instruction) {
|
|
1455
1641
|
if (instruction.accounts.length < 5) {
|
|
1456
|
-
throw new
|
|
1642
|
+
throw new import_kit30.SolanaError(import_kit30.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1457
1643
|
actualAccountMetas: instruction.accounts.length,
|
|
1458
1644
|
expectedAccountMetas: 5
|
|
1459
1645
|
});
|
|
@@ -1485,23 +1671,23 @@ function parseCreateRecurringDelegationInstruction(instruction) {
|
|
|
1485
1671
|
}
|
|
1486
1672
|
|
|
1487
1673
|
// src/generated/instructions/deletePlan.ts
|
|
1488
|
-
var
|
|
1489
|
-
var
|
|
1674
|
+
var import_kit31 = require("@solana/kit");
|
|
1675
|
+
var import_program_client_core7 = require("@solana/program-client-core");
|
|
1490
1676
|
var DELETE_PLAN_DISCRIMINATOR = 9;
|
|
1491
1677
|
function getDeletePlanDiscriminatorBytes() {
|
|
1492
|
-
return (0,
|
|
1678
|
+
return (0, import_kit31.getU8Encoder)().encode(DELETE_PLAN_DISCRIMINATOR);
|
|
1493
1679
|
}
|
|
1494
1680
|
function getDeletePlanInstructionDataEncoder() {
|
|
1495
|
-
return (0,
|
|
1681
|
+
return (0, import_kit31.transformEncoder)((0, import_kit31.getStructEncoder)([["discriminator", (0, import_kit31.getU8Encoder)()]]), (value) => ({
|
|
1496
1682
|
...value,
|
|
1497
1683
|
discriminator: DELETE_PLAN_DISCRIMINATOR
|
|
1498
1684
|
}));
|
|
1499
1685
|
}
|
|
1500
1686
|
function getDeletePlanInstructionDataDecoder() {
|
|
1501
|
-
return (0,
|
|
1687
|
+
return (0, import_kit31.getStructDecoder)([["discriminator", (0, import_kit31.getU8Decoder)()]]);
|
|
1502
1688
|
}
|
|
1503
1689
|
function getDeletePlanInstructionDataCodec() {
|
|
1504
|
-
return (0,
|
|
1690
|
+
return (0, import_kit31.combineCodec)(getDeletePlanInstructionDataEncoder(), getDeletePlanInstructionDataDecoder());
|
|
1505
1691
|
}
|
|
1506
1692
|
function getDeletePlanInstruction(input, config) {
|
|
1507
1693
|
const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
@@ -1510,7 +1696,7 @@ function getDeletePlanInstruction(input, config) {
|
|
|
1510
1696
|
planPda: { value: input.planPda ?? null, isWritable: true }
|
|
1511
1697
|
};
|
|
1512
1698
|
const accounts = originalAccounts;
|
|
1513
|
-
const getAccountMeta = (0,
|
|
1699
|
+
const getAccountMeta = (0, import_program_client_core7.getAccountMetaFactory)(programAddress, "programId");
|
|
1514
1700
|
return Object.freeze({
|
|
1515
1701
|
accounts: [getAccountMeta("owner", accounts.owner), getAccountMeta("planPda", accounts.planPda)],
|
|
1516
1702
|
data: getDeletePlanInstructionDataEncoder().encode({}),
|
|
@@ -1519,7 +1705,7 @@ function getDeletePlanInstruction(input, config) {
|
|
|
1519
1705
|
}
|
|
1520
1706
|
function parseDeletePlanInstruction(instruction) {
|
|
1521
1707
|
if (instruction.accounts.length < 2) {
|
|
1522
|
-
throw new
|
|
1708
|
+
throw new import_kit31.SolanaError(import_kit31.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1523
1709
|
actualAccountMetas: instruction.accounts.length,
|
|
1524
1710
|
expectedAccountMetas: 2
|
|
1525
1711
|
});
|
|
@@ -1538,23 +1724,23 @@ function parseDeletePlanInstruction(instruction) {
|
|
|
1538
1724
|
}
|
|
1539
1725
|
|
|
1540
1726
|
// src/generated/instructions/initSubscriptionAuthority.ts
|
|
1541
|
-
var
|
|
1542
|
-
var
|
|
1727
|
+
var import_kit32 = require("@solana/kit");
|
|
1728
|
+
var import_program_client_core8 = require("@solana/program-client-core");
|
|
1543
1729
|
var INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 0;
|
|
1544
1730
|
function getInitSubscriptionAuthorityDiscriminatorBytes() {
|
|
1545
|
-
return (0,
|
|
1731
|
+
return (0, import_kit32.getU8Encoder)().encode(INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);
|
|
1546
1732
|
}
|
|
1547
1733
|
function getInitSubscriptionAuthorityInstructionDataEncoder() {
|
|
1548
|
-
return (0,
|
|
1734
|
+
return (0, import_kit32.transformEncoder)((0, import_kit32.getStructEncoder)([["discriminator", (0, import_kit32.getU8Encoder)()]]), (value) => ({
|
|
1549
1735
|
...value,
|
|
1550
1736
|
discriminator: INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR
|
|
1551
1737
|
}));
|
|
1552
1738
|
}
|
|
1553
1739
|
function getInitSubscriptionAuthorityInstructionDataDecoder() {
|
|
1554
|
-
return (0,
|
|
1740
|
+
return (0, import_kit32.getStructDecoder)([["discriminator", (0, import_kit32.getU8Decoder)()]]);
|
|
1555
1741
|
}
|
|
1556
1742
|
function getInitSubscriptionAuthorityInstructionDataCodec() {
|
|
1557
|
-
return (0,
|
|
1743
|
+
return (0, import_kit32.combineCodec)(
|
|
1558
1744
|
getInitSubscriptionAuthorityInstructionDataEncoder(),
|
|
1559
1745
|
getInitSubscriptionAuthorityInstructionDataDecoder()
|
|
1560
1746
|
);
|
|
@@ -1573,14 +1759,14 @@ async function getInitSubscriptionAuthorityInstructionAsync(input, config) {
|
|
|
1573
1759
|
const accounts = originalAccounts;
|
|
1574
1760
|
if (!accounts.subscriptionAuthority.value) {
|
|
1575
1761
|
accounts.subscriptionAuthority.value = await findSubscriptionAuthorityPda({
|
|
1576
|
-
user: (0,
|
|
1577
|
-
tokenMint: (0,
|
|
1762
|
+
user: (0, import_program_client_core8.getAddressFromResolvedInstructionAccount)("owner", accounts.owner.value),
|
|
1763
|
+
tokenMint: (0, import_program_client_core8.getAddressFromResolvedInstructionAccount)("tokenMint", accounts.tokenMint.value)
|
|
1578
1764
|
});
|
|
1579
1765
|
}
|
|
1580
1766
|
if (!accounts.systemProgram.value) {
|
|
1581
1767
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1582
1768
|
}
|
|
1583
|
-
const getAccountMeta = (0,
|
|
1769
|
+
const getAccountMeta = (0, import_program_client_core8.getAccountMetaFactory)(programAddress, "omitted");
|
|
1584
1770
|
return Object.freeze({
|
|
1585
1771
|
accounts: [
|
|
1586
1772
|
getAccountMeta("owner", accounts.owner),
|
|
@@ -1610,7 +1796,7 @@ function getInitSubscriptionAuthorityInstruction(input, config) {
|
|
|
1610
1796
|
if (!accounts.systemProgram.value) {
|
|
1611
1797
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1612
1798
|
}
|
|
1613
|
-
const getAccountMeta = (0,
|
|
1799
|
+
const getAccountMeta = (0, import_program_client_core8.getAccountMetaFactory)(programAddress, "omitted");
|
|
1614
1800
|
return Object.freeze({
|
|
1615
1801
|
accounts: [
|
|
1616
1802
|
getAccountMeta("owner", accounts.owner),
|
|
@@ -1627,7 +1813,7 @@ function getInitSubscriptionAuthorityInstruction(input, config) {
|
|
|
1627
1813
|
}
|
|
1628
1814
|
function parseInitSubscriptionAuthorityInstruction(instruction) {
|
|
1629
1815
|
if (instruction.accounts.length < 6) {
|
|
1630
|
-
throw new
|
|
1816
|
+
throw new import_kit32.SolanaError(import_kit32.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1631
1817
|
actualAccountMetas: instruction.accounts.length,
|
|
1632
1818
|
expectedAccountMetas: 6
|
|
1633
1819
|
});
|
|
@@ -1660,23 +1846,29 @@ function parseInitSubscriptionAuthorityInstruction(instruction) {
|
|
|
1660
1846
|
}
|
|
1661
1847
|
|
|
1662
1848
|
// src/generated/instructions/resumeSubscription.ts
|
|
1663
|
-
var
|
|
1664
|
-
var
|
|
1849
|
+
var import_kit33 = require("@solana/kit");
|
|
1850
|
+
var import_program_client_core9 = require("@solana/program-client-core");
|
|
1665
1851
|
var RESUME_SUBSCRIPTION_DISCRIMINATOR = 13;
|
|
1666
1852
|
function getResumeSubscriptionDiscriminatorBytes() {
|
|
1667
|
-
return (0,
|
|
1853
|
+
return (0, import_kit33.getU8Encoder)().encode(RESUME_SUBSCRIPTION_DISCRIMINATOR);
|
|
1668
1854
|
}
|
|
1669
1855
|
function getResumeSubscriptionInstructionDataEncoder() {
|
|
1670
|
-
return (0,
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1856
|
+
return (0, import_kit33.transformEncoder)(
|
|
1857
|
+
(0, import_kit33.getStructEncoder)([
|
|
1858
|
+
["discriminator", (0, import_kit33.getU8Encoder)()],
|
|
1859
|
+
["resumeData", getResumeDataEncoder()]
|
|
1860
|
+
]),
|
|
1861
|
+
(value) => ({ ...value, discriminator: RESUME_SUBSCRIPTION_DISCRIMINATOR })
|
|
1862
|
+
);
|
|
1674
1863
|
}
|
|
1675
1864
|
function getResumeSubscriptionInstructionDataDecoder() {
|
|
1676
|
-
return (0,
|
|
1865
|
+
return (0, import_kit33.getStructDecoder)([
|
|
1866
|
+
["discriminator", (0, import_kit33.getU8Decoder)()],
|
|
1867
|
+
["resumeData", getResumeDataDecoder()]
|
|
1868
|
+
]);
|
|
1677
1869
|
}
|
|
1678
1870
|
function getResumeSubscriptionInstructionDataCodec() {
|
|
1679
|
-
return (0,
|
|
1871
|
+
return (0, import_kit33.combineCodec)(getResumeSubscriptionInstructionDataEncoder(), getResumeSubscriptionInstructionDataDecoder());
|
|
1680
1872
|
}
|
|
1681
1873
|
async function getResumeSubscriptionInstructionAsync(input, config) {
|
|
1682
1874
|
const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
@@ -1689,23 +1881,24 @@ async function getResumeSubscriptionInstructionAsync(input, config) {
|
|
|
1689
1881
|
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
1690
1882
|
};
|
|
1691
1883
|
const accounts = originalAccounts;
|
|
1884
|
+
const args = { ...input };
|
|
1692
1885
|
if (!accounts.subscriptionPda.value) {
|
|
1693
1886
|
accounts.subscriptionPda.value = await findSubscriptionDelegationPda({
|
|
1694
|
-
planPda: (0,
|
|
1695
|
-
subscriber: (0,
|
|
1887
|
+
planPda: (0, import_program_client_core9.getAddressFromResolvedInstructionAccount)("planPda", accounts.planPda.value),
|
|
1888
|
+
subscriber: (0, import_program_client_core9.getAddressFromResolvedInstructionAccount)("subscriber", accounts.subscriber.value)
|
|
1696
1889
|
});
|
|
1697
1890
|
}
|
|
1698
1891
|
if (!accounts.eventAuthority.value) {
|
|
1699
|
-
accounts.eventAuthority.value = await (0,
|
|
1892
|
+
accounts.eventAuthority.value = await (0, import_kit33.getProgramDerivedAddress)({
|
|
1700
1893
|
programAddress,
|
|
1701
|
-
seeds: [(0,
|
|
1894
|
+
seeds: [(0, import_kit33.getUtf8Encoder)().encode("event_authority")]
|
|
1702
1895
|
});
|
|
1703
1896
|
}
|
|
1704
1897
|
if (!accounts.selfProgram.value) {
|
|
1705
1898
|
accounts.selfProgram.value = programAddress;
|
|
1706
1899
|
accounts.selfProgram.isWritable = false;
|
|
1707
1900
|
}
|
|
1708
|
-
const getAccountMeta = (0,
|
|
1901
|
+
const getAccountMeta = (0, import_program_client_core9.getAccountMetaFactory)(programAddress, "programId");
|
|
1709
1902
|
return Object.freeze({
|
|
1710
1903
|
accounts: [
|
|
1711
1904
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -1715,7 +1908,7 @@ async function getResumeSubscriptionInstructionAsync(input, config) {
|
|
|
1715
1908
|
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1716
1909
|
getAccountMeta("selfProgram", accounts.selfProgram)
|
|
1717
1910
|
],
|
|
1718
|
-
data: getResumeSubscriptionInstructionDataEncoder().encode(
|
|
1911
|
+
data: getResumeSubscriptionInstructionDataEncoder().encode(args),
|
|
1719
1912
|
programAddress
|
|
1720
1913
|
});
|
|
1721
1914
|
}
|
|
@@ -1730,11 +1923,12 @@ function getResumeSubscriptionInstruction(input, config) {
|
|
|
1730
1923
|
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
1731
1924
|
};
|
|
1732
1925
|
const accounts = originalAccounts;
|
|
1926
|
+
const args = { ...input };
|
|
1733
1927
|
if (!accounts.selfProgram.value) {
|
|
1734
1928
|
accounts.selfProgram.value = programAddress;
|
|
1735
1929
|
accounts.selfProgram.isWritable = false;
|
|
1736
1930
|
}
|
|
1737
|
-
const getAccountMeta = (0,
|
|
1931
|
+
const getAccountMeta = (0, import_program_client_core9.getAccountMetaFactory)(programAddress, "programId");
|
|
1738
1932
|
return Object.freeze({
|
|
1739
1933
|
accounts: [
|
|
1740
1934
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -1744,13 +1938,13 @@ function getResumeSubscriptionInstruction(input, config) {
|
|
|
1744
1938
|
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1745
1939
|
getAccountMeta("selfProgram", accounts.selfProgram)
|
|
1746
1940
|
],
|
|
1747
|
-
data: getResumeSubscriptionInstructionDataEncoder().encode(
|
|
1941
|
+
data: getResumeSubscriptionInstructionDataEncoder().encode(args),
|
|
1748
1942
|
programAddress
|
|
1749
1943
|
});
|
|
1750
1944
|
}
|
|
1751
1945
|
function parseResumeSubscriptionInstruction(instruction) {
|
|
1752
1946
|
if (instruction.accounts.length < 6) {
|
|
1753
|
-
throw new
|
|
1947
|
+
throw new import_kit33.SolanaError(import_kit33.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1754
1948
|
actualAccountMetas: instruction.accounts.length,
|
|
1755
1949
|
expectedAccountMetas: 6
|
|
1756
1950
|
});
|
|
@@ -1776,23 +1970,23 @@ function parseResumeSubscriptionInstruction(instruction) {
|
|
|
1776
1970
|
}
|
|
1777
1971
|
|
|
1778
1972
|
// src/generated/instructions/revokeAbandonedDelegation.ts
|
|
1779
|
-
var
|
|
1780
|
-
var
|
|
1973
|
+
var import_kit34 = require("@solana/kit");
|
|
1974
|
+
var import_program_client_core10 = require("@solana/program-client-core");
|
|
1781
1975
|
var REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR = 15;
|
|
1782
1976
|
function getRevokeAbandonedDelegationDiscriminatorBytes() {
|
|
1783
|
-
return (0,
|
|
1977
|
+
return (0, import_kit34.getU8Encoder)().encode(REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR);
|
|
1784
1978
|
}
|
|
1785
1979
|
function getRevokeAbandonedDelegationInstructionDataEncoder() {
|
|
1786
|
-
return (0,
|
|
1980
|
+
return (0, import_kit34.transformEncoder)((0, import_kit34.getStructEncoder)([["discriminator", (0, import_kit34.getU8Encoder)()]]), (value) => ({
|
|
1787
1981
|
...value,
|
|
1788
1982
|
discriminator: REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR
|
|
1789
1983
|
}));
|
|
1790
1984
|
}
|
|
1791
1985
|
function getRevokeAbandonedDelegationInstructionDataDecoder() {
|
|
1792
|
-
return (0,
|
|
1986
|
+
return (0, import_kit34.getStructDecoder)([["discriminator", (0, import_kit34.getU8Decoder)()]]);
|
|
1793
1987
|
}
|
|
1794
1988
|
function getRevokeAbandonedDelegationInstructionDataCodec() {
|
|
1795
|
-
return (0,
|
|
1989
|
+
return (0, import_kit34.combineCodec)(
|
|
1796
1990
|
getRevokeAbandonedDelegationInstructionDataEncoder(),
|
|
1797
1991
|
getRevokeAbandonedDelegationInstructionDataDecoder()
|
|
1798
1992
|
);
|
|
@@ -1805,7 +1999,7 @@ function getRevokeAbandonedDelegationInstruction(input, config) {
|
|
|
1805
1999
|
subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false }
|
|
1806
2000
|
};
|
|
1807
2001
|
const accounts = originalAccounts;
|
|
1808
|
-
const getAccountMeta = (0,
|
|
2002
|
+
const getAccountMeta = (0, import_program_client_core10.getAccountMetaFactory)(programAddress, "programId");
|
|
1809
2003
|
return Object.freeze({
|
|
1810
2004
|
accounts: [
|
|
1811
2005
|
getAccountMeta("payer", accounts.payer),
|
|
@@ -1818,7 +2012,7 @@ function getRevokeAbandonedDelegationInstruction(input, config) {
|
|
|
1818
2012
|
}
|
|
1819
2013
|
function parseRevokeAbandonedDelegationInstruction(instruction) {
|
|
1820
2014
|
if (instruction.accounts.length < 3) {
|
|
1821
|
-
throw new
|
|
2015
|
+
throw new import_kit34.SolanaError(import_kit34.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1822
2016
|
actualAccountMetas: instruction.accounts.length,
|
|
1823
2017
|
expectedAccountMetas: 3
|
|
1824
2018
|
});
|
|
@@ -1841,23 +2035,23 @@ function parseRevokeAbandonedDelegationInstruction(instruction) {
|
|
|
1841
2035
|
}
|
|
1842
2036
|
|
|
1843
2037
|
// src/generated/instructions/revokeAbandonedSubscription.ts
|
|
1844
|
-
var
|
|
1845
|
-
var
|
|
2038
|
+
var import_kit35 = require("@solana/kit");
|
|
2039
|
+
var import_program_client_core11 = require("@solana/program-client-core");
|
|
1846
2040
|
var REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR = 16;
|
|
1847
2041
|
function getRevokeAbandonedSubscriptionDiscriminatorBytes() {
|
|
1848
|
-
return (0,
|
|
2042
|
+
return (0, import_kit35.getU8Encoder)().encode(REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR);
|
|
1849
2043
|
}
|
|
1850
2044
|
function getRevokeAbandonedSubscriptionInstructionDataEncoder() {
|
|
1851
|
-
return (0,
|
|
2045
|
+
return (0, import_kit35.transformEncoder)((0, import_kit35.getStructEncoder)([["discriminator", (0, import_kit35.getU8Encoder)()]]), (value) => ({
|
|
1852
2046
|
...value,
|
|
1853
2047
|
discriminator: REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR
|
|
1854
2048
|
}));
|
|
1855
2049
|
}
|
|
1856
2050
|
function getRevokeAbandonedSubscriptionInstructionDataDecoder() {
|
|
1857
|
-
return (0,
|
|
2051
|
+
return (0, import_kit35.getStructDecoder)([["discriminator", (0, import_kit35.getU8Decoder)()]]);
|
|
1858
2052
|
}
|
|
1859
2053
|
function getRevokeAbandonedSubscriptionInstructionDataCodec() {
|
|
1860
|
-
return (0,
|
|
2054
|
+
return (0, import_kit35.combineCodec)(
|
|
1861
2055
|
getRevokeAbandonedSubscriptionInstructionDataEncoder(),
|
|
1862
2056
|
getRevokeAbandonedSubscriptionInstructionDataDecoder()
|
|
1863
2057
|
);
|
|
@@ -1871,7 +2065,7 @@ function getRevokeAbandonedSubscriptionInstruction(input, config) {
|
|
|
1871
2065
|
planPda: { value: input.planPda ?? null, isWritable: false }
|
|
1872
2066
|
};
|
|
1873
2067
|
const accounts = originalAccounts;
|
|
1874
|
-
const getAccountMeta = (0,
|
|
2068
|
+
const getAccountMeta = (0, import_program_client_core11.getAccountMetaFactory)(programAddress, "programId");
|
|
1875
2069
|
return Object.freeze({
|
|
1876
2070
|
accounts: [
|
|
1877
2071
|
getAccountMeta("payer", accounts.payer),
|
|
@@ -1885,7 +2079,7 @@ function getRevokeAbandonedSubscriptionInstruction(input, config) {
|
|
|
1885
2079
|
}
|
|
1886
2080
|
function parseRevokeAbandonedSubscriptionInstruction(instruction) {
|
|
1887
2081
|
if (instruction.accounts.length < 4) {
|
|
1888
|
-
throw new
|
|
2082
|
+
throw new import_kit35.SolanaError(import_kit35.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1889
2083
|
actualAccountMetas: instruction.accounts.length,
|
|
1890
2084
|
expectedAccountMetas: 4
|
|
1891
2085
|
});
|
|
@@ -1909,23 +2103,23 @@ function parseRevokeAbandonedSubscriptionInstruction(instruction) {
|
|
|
1909
2103
|
}
|
|
1910
2104
|
|
|
1911
2105
|
// src/generated/instructions/revokeDelegation.ts
|
|
1912
|
-
var
|
|
1913
|
-
var
|
|
2106
|
+
var import_kit36 = require("@solana/kit");
|
|
2107
|
+
var import_program_client_core12 = require("@solana/program-client-core");
|
|
1914
2108
|
var REVOKE_DELEGATION_DISCRIMINATOR = 3;
|
|
1915
2109
|
function getRevokeDelegationDiscriminatorBytes() {
|
|
1916
|
-
return (0,
|
|
2110
|
+
return (0, import_kit36.getU8Encoder)().encode(REVOKE_DELEGATION_DISCRIMINATOR);
|
|
1917
2111
|
}
|
|
1918
2112
|
function getRevokeDelegationInstructionDataEncoder() {
|
|
1919
|
-
return (0,
|
|
2113
|
+
return (0, import_kit36.transformEncoder)((0, import_kit36.getStructEncoder)([["discriminator", (0, import_kit36.getU8Encoder)()]]), (value) => ({
|
|
1920
2114
|
...value,
|
|
1921
2115
|
discriminator: REVOKE_DELEGATION_DISCRIMINATOR
|
|
1922
2116
|
}));
|
|
1923
2117
|
}
|
|
1924
2118
|
function getRevokeDelegationInstructionDataDecoder() {
|
|
1925
|
-
return (0,
|
|
2119
|
+
return (0, import_kit36.getStructDecoder)([["discriminator", (0, import_kit36.getU8Decoder)()]]);
|
|
1926
2120
|
}
|
|
1927
2121
|
function getRevokeDelegationInstructionDataCodec() {
|
|
1928
|
-
return (0,
|
|
2122
|
+
return (0, import_kit36.combineCodec)(getRevokeDelegationInstructionDataEncoder(), getRevokeDelegationInstructionDataDecoder());
|
|
1929
2123
|
}
|
|
1930
2124
|
function getRevokeDelegationInstruction(input, config) {
|
|
1931
2125
|
const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
@@ -1934,7 +2128,7 @@ function getRevokeDelegationInstruction(input, config) {
|
|
|
1934
2128
|
delegationAccount: { value: input.delegationAccount ?? null, isWritable: true }
|
|
1935
2129
|
};
|
|
1936
2130
|
const accounts = originalAccounts;
|
|
1937
|
-
const getAccountMeta = (0,
|
|
2131
|
+
const getAccountMeta = (0, import_program_client_core12.getAccountMetaFactory)(programAddress, "programId");
|
|
1938
2132
|
return Object.freeze({
|
|
1939
2133
|
accounts: [
|
|
1940
2134
|
getAccountMeta("authority", accounts.authority),
|
|
@@ -1946,7 +2140,7 @@ function getRevokeDelegationInstruction(input, config) {
|
|
|
1946
2140
|
}
|
|
1947
2141
|
function parseRevokeDelegationInstruction(instruction) {
|
|
1948
2142
|
if (instruction.accounts.length < 2) {
|
|
1949
|
-
throw new
|
|
2143
|
+
throw new import_kit36.SolanaError(import_kit36.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1950
2144
|
actualAccountMetas: instruction.accounts.length,
|
|
1951
2145
|
expectedAccountMetas: 2
|
|
1952
2146
|
});
|
|
@@ -1965,23 +2159,23 @@ function parseRevokeDelegationInstruction(instruction) {
|
|
|
1965
2159
|
}
|
|
1966
2160
|
|
|
1967
2161
|
// src/generated/instructions/revokeSubscriptionAuthority.ts
|
|
1968
|
-
var
|
|
1969
|
-
var
|
|
2162
|
+
var import_kit37 = require("@solana/kit");
|
|
2163
|
+
var import_program_client_core13 = require("@solana/program-client-core");
|
|
1970
2164
|
var REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 14;
|
|
1971
2165
|
function getRevokeSubscriptionAuthorityDiscriminatorBytes() {
|
|
1972
|
-
return (0,
|
|
2166
|
+
return (0, import_kit37.getU8Encoder)().encode(REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);
|
|
1973
2167
|
}
|
|
1974
2168
|
function getRevokeSubscriptionAuthorityInstructionDataEncoder() {
|
|
1975
|
-
return (0,
|
|
2169
|
+
return (0, import_kit37.transformEncoder)((0, import_kit37.getStructEncoder)([["discriminator", (0, import_kit37.getU8Encoder)()]]), (value) => ({
|
|
1976
2170
|
...value,
|
|
1977
2171
|
discriminator: REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR
|
|
1978
2172
|
}));
|
|
1979
2173
|
}
|
|
1980
2174
|
function getRevokeSubscriptionAuthorityInstructionDataDecoder() {
|
|
1981
|
-
return (0,
|
|
2175
|
+
return (0, import_kit37.getStructDecoder)([["discriminator", (0, import_kit37.getU8Decoder)()]]);
|
|
1982
2176
|
}
|
|
1983
2177
|
function getRevokeSubscriptionAuthorityInstructionDataCodec() {
|
|
1984
|
-
return (0,
|
|
2178
|
+
return (0, import_kit37.combineCodec)(
|
|
1985
2179
|
getRevokeSubscriptionAuthorityInstructionDataEncoder(),
|
|
1986
2180
|
getRevokeSubscriptionAuthorityInstructionDataDecoder()
|
|
1987
2181
|
);
|
|
@@ -1999,11 +2193,11 @@ async function getRevokeSubscriptionAuthorityInstructionAsync(input, config) {
|
|
|
1999
2193
|
const accounts = originalAccounts;
|
|
2000
2194
|
if (!accounts.subscriptionAuthority.value) {
|
|
2001
2195
|
accounts.subscriptionAuthority.value = await findSubscriptionAuthorityPda({
|
|
2002
|
-
user: (0,
|
|
2003
|
-
tokenMint: (0,
|
|
2196
|
+
user: (0, import_program_client_core13.getAddressFromResolvedInstructionAccount)("user", accounts.user.value),
|
|
2197
|
+
tokenMint: (0, import_program_client_core13.getAddressFromResolvedInstructionAccount)("tokenMint", accounts.tokenMint.value)
|
|
2004
2198
|
});
|
|
2005
2199
|
}
|
|
2006
|
-
const getAccountMeta = (0,
|
|
2200
|
+
const getAccountMeta = (0, import_program_client_core13.getAccountMetaFactory)(programAddress, "omitted");
|
|
2007
2201
|
return Object.freeze({
|
|
2008
2202
|
accounts: [
|
|
2009
2203
|
getAccountMeta("user", accounts.user),
|
|
@@ -2028,7 +2222,7 @@ function getRevokeSubscriptionAuthorityInstruction(input, config) {
|
|
|
2028
2222
|
receiver: { value: input.receiver ?? null, isWritable: true }
|
|
2029
2223
|
};
|
|
2030
2224
|
const accounts = originalAccounts;
|
|
2031
|
-
const getAccountMeta = (0,
|
|
2225
|
+
const getAccountMeta = (0, import_program_client_core13.getAccountMetaFactory)(programAddress, "omitted");
|
|
2032
2226
|
return Object.freeze({
|
|
2033
2227
|
accounts: [
|
|
2034
2228
|
getAccountMeta("user", accounts.user),
|
|
@@ -2044,7 +2238,7 @@ function getRevokeSubscriptionAuthorityInstruction(input, config) {
|
|
|
2044
2238
|
}
|
|
2045
2239
|
function parseRevokeSubscriptionAuthorityInstruction(instruction) {
|
|
2046
2240
|
if (instruction.accounts.length < 5) {
|
|
2047
|
-
throw new
|
|
2241
|
+
throw new import_kit37.SolanaError(import_kit37.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2048
2242
|
actualAccountMetas: instruction.accounts.length,
|
|
2049
2243
|
expectedAccountMetas: 5
|
|
2050
2244
|
});
|
|
@@ -2076,29 +2270,29 @@ function parseRevokeSubscriptionAuthorityInstruction(instruction) {
|
|
|
2076
2270
|
}
|
|
2077
2271
|
|
|
2078
2272
|
// src/generated/instructions/subscribe.ts
|
|
2079
|
-
var
|
|
2080
|
-
var
|
|
2273
|
+
var import_kit38 = require("@solana/kit");
|
|
2274
|
+
var import_program_client_core14 = require("@solana/program-client-core");
|
|
2081
2275
|
var SUBSCRIBE_DISCRIMINATOR = 11;
|
|
2082
2276
|
function getSubscribeDiscriminatorBytes() {
|
|
2083
|
-
return (0,
|
|
2277
|
+
return (0, import_kit38.getU8Encoder)().encode(SUBSCRIBE_DISCRIMINATOR);
|
|
2084
2278
|
}
|
|
2085
2279
|
function getSubscribeInstructionDataEncoder() {
|
|
2086
|
-
return (0,
|
|
2087
|
-
(0,
|
|
2088
|
-
["discriminator", (0,
|
|
2280
|
+
return (0, import_kit38.transformEncoder)(
|
|
2281
|
+
(0, import_kit38.getStructEncoder)([
|
|
2282
|
+
["discriminator", (0, import_kit38.getU8Encoder)()],
|
|
2089
2283
|
["subscribeData", getSubscribeDataEncoder()]
|
|
2090
2284
|
]),
|
|
2091
2285
|
(value) => ({ ...value, discriminator: SUBSCRIBE_DISCRIMINATOR })
|
|
2092
2286
|
);
|
|
2093
2287
|
}
|
|
2094
2288
|
function getSubscribeInstructionDataDecoder() {
|
|
2095
|
-
return (0,
|
|
2096
|
-
["discriminator", (0,
|
|
2289
|
+
return (0, import_kit38.getStructDecoder)([
|
|
2290
|
+
["discriminator", (0, import_kit38.getU8Decoder)()],
|
|
2097
2291
|
["subscribeData", getSubscribeDataDecoder()]
|
|
2098
2292
|
]);
|
|
2099
2293
|
}
|
|
2100
2294
|
function getSubscribeInstructionDataCodec() {
|
|
2101
|
-
return (0,
|
|
2295
|
+
return (0, import_kit38.combineCodec)(getSubscribeInstructionDataEncoder(), getSubscribeInstructionDataDecoder());
|
|
2102
2296
|
}
|
|
2103
2297
|
async function getSubscribeInstructionAsync(input, config) {
|
|
2104
2298
|
const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
@@ -2117,24 +2311,24 @@ async function getSubscribeInstructionAsync(input, config) {
|
|
|
2117
2311
|
const args = { ...input };
|
|
2118
2312
|
if (!accounts.subscriptionPda.value) {
|
|
2119
2313
|
accounts.subscriptionPda.value = await findSubscriptionDelegationPda({
|
|
2120
|
-
planPda: (0,
|
|
2121
|
-
subscriber: (0,
|
|
2314
|
+
planPda: (0, import_program_client_core14.getAddressFromResolvedInstructionAccount)("planPda", accounts.planPda.value),
|
|
2315
|
+
subscriber: (0, import_program_client_core14.getAddressFromResolvedInstructionAccount)("subscriber", accounts.subscriber.value)
|
|
2122
2316
|
});
|
|
2123
2317
|
}
|
|
2124
2318
|
if (!accounts.systemProgram.value) {
|
|
2125
2319
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2126
2320
|
}
|
|
2127
2321
|
if (!accounts.eventAuthority.value) {
|
|
2128
|
-
accounts.eventAuthority.value = await (0,
|
|
2322
|
+
accounts.eventAuthority.value = await (0, import_kit38.getProgramDerivedAddress)({
|
|
2129
2323
|
programAddress,
|
|
2130
|
-
seeds: [(0,
|
|
2324
|
+
seeds: [(0, import_kit38.getUtf8Encoder)().encode("event_authority")]
|
|
2131
2325
|
});
|
|
2132
2326
|
}
|
|
2133
2327
|
if (!accounts.selfProgram.value) {
|
|
2134
2328
|
accounts.selfProgram.value = programAddress;
|
|
2135
2329
|
accounts.selfProgram.isWritable = false;
|
|
2136
2330
|
}
|
|
2137
|
-
const getAccountMeta = (0,
|
|
2331
|
+
const getAccountMeta = (0, import_program_client_core14.getAccountMetaFactory)(programAddress, "omitted");
|
|
2138
2332
|
return Object.freeze({
|
|
2139
2333
|
accounts: [
|
|
2140
2334
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -2173,7 +2367,7 @@ function getSubscribeInstruction(input, config) {
|
|
|
2173
2367
|
accounts.selfProgram.value = programAddress;
|
|
2174
2368
|
accounts.selfProgram.isWritable = false;
|
|
2175
2369
|
}
|
|
2176
|
-
const getAccountMeta = (0,
|
|
2370
|
+
const getAccountMeta = (0, import_program_client_core14.getAccountMetaFactory)(programAddress, "omitted");
|
|
2177
2371
|
return Object.freeze({
|
|
2178
2372
|
accounts: [
|
|
2179
2373
|
getAccountMeta("subscriber", accounts.subscriber),
|
|
@@ -2192,7 +2386,7 @@ function getSubscribeInstruction(input, config) {
|
|
|
2192
2386
|
}
|
|
2193
2387
|
function parseSubscribeInstruction(instruction) {
|
|
2194
2388
|
if (instruction.accounts.length < 8) {
|
|
2195
|
-
throw new
|
|
2389
|
+
throw new import_kit38.SolanaError(import_kit38.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2196
2390
|
actualAccountMetas: instruction.accounts.length,
|
|
2197
2391
|
expectedAccountMetas: 8
|
|
2198
2392
|
});
|
|
@@ -2227,29 +2421,29 @@ function parseSubscribeInstruction(instruction) {
|
|
|
2227
2421
|
}
|
|
2228
2422
|
|
|
2229
2423
|
// src/generated/instructions/transferFixed.ts
|
|
2230
|
-
var
|
|
2231
|
-
var
|
|
2424
|
+
var import_kit39 = require("@solana/kit");
|
|
2425
|
+
var import_program_client_core15 = require("@solana/program-client-core");
|
|
2232
2426
|
var TRANSFER_FIXED_DISCRIMINATOR = 4;
|
|
2233
2427
|
function getTransferFixedDiscriminatorBytes() {
|
|
2234
|
-
return (0,
|
|
2428
|
+
return (0, import_kit39.getU8Encoder)().encode(TRANSFER_FIXED_DISCRIMINATOR);
|
|
2235
2429
|
}
|
|
2236
2430
|
function getTransferFixedInstructionDataEncoder() {
|
|
2237
|
-
return (0,
|
|
2238
|
-
(0,
|
|
2239
|
-
["discriminator", (0,
|
|
2431
|
+
return (0, import_kit39.transformEncoder)(
|
|
2432
|
+
(0, import_kit39.getStructEncoder)([
|
|
2433
|
+
["discriminator", (0, import_kit39.getU8Encoder)()],
|
|
2240
2434
|
["transferData", getTransferDataEncoder()]
|
|
2241
2435
|
]),
|
|
2242
2436
|
(value) => ({ ...value, discriminator: TRANSFER_FIXED_DISCRIMINATOR })
|
|
2243
2437
|
);
|
|
2244
2438
|
}
|
|
2245
2439
|
function getTransferFixedInstructionDataDecoder() {
|
|
2246
|
-
return (0,
|
|
2247
|
-
["discriminator", (0,
|
|
2440
|
+
return (0, import_kit39.getStructDecoder)([
|
|
2441
|
+
["discriminator", (0, import_kit39.getU8Decoder)()],
|
|
2248
2442
|
["transferData", getTransferDataDecoder()]
|
|
2249
2443
|
]);
|
|
2250
2444
|
}
|
|
2251
2445
|
function getTransferFixedInstructionDataCodec() {
|
|
2252
|
-
return (0,
|
|
2446
|
+
return (0, import_kit39.combineCodec)(getTransferFixedInstructionDataEncoder(), getTransferFixedInstructionDataDecoder());
|
|
2253
2447
|
}
|
|
2254
2448
|
async function getTransferFixedInstructionAsync(input, config) {
|
|
2255
2449
|
const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
@@ -2267,16 +2461,16 @@ async function getTransferFixedInstructionAsync(input, config) {
|
|
|
2267
2461
|
const accounts = originalAccounts;
|
|
2268
2462
|
const args = { ...input };
|
|
2269
2463
|
if (!accounts.eventAuthority.value) {
|
|
2270
|
-
accounts.eventAuthority.value = await (0,
|
|
2464
|
+
accounts.eventAuthority.value = await (0, import_kit39.getProgramDerivedAddress)({
|
|
2271
2465
|
programAddress,
|
|
2272
|
-
seeds: [(0,
|
|
2466
|
+
seeds: [(0, import_kit39.getUtf8Encoder)().encode("event_authority")]
|
|
2273
2467
|
});
|
|
2274
2468
|
}
|
|
2275
2469
|
if (!accounts.selfProgram.value) {
|
|
2276
2470
|
accounts.selfProgram.value = programAddress;
|
|
2277
2471
|
accounts.selfProgram.isWritable = false;
|
|
2278
2472
|
}
|
|
2279
|
-
const getAccountMeta = (0,
|
|
2473
|
+
const getAccountMeta = (0, import_program_client_core15.getAccountMetaFactory)(programAddress, "programId");
|
|
2280
2474
|
return Object.freeze({
|
|
2281
2475
|
accounts: [
|
|
2282
2476
|
getAccountMeta("delegationPda", accounts.delegationPda),
|
|
@@ -2312,7 +2506,7 @@ function getTransferFixedInstruction(input, config) {
|
|
|
2312
2506
|
accounts.selfProgram.value = programAddress;
|
|
2313
2507
|
accounts.selfProgram.isWritable = false;
|
|
2314
2508
|
}
|
|
2315
|
-
const getAccountMeta = (0,
|
|
2509
|
+
const getAccountMeta = (0, import_program_client_core15.getAccountMetaFactory)(programAddress, "programId");
|
|
2316
2510
|
return Object.freeze({
|
|
2317
2511
|
accounts: [
|
|
2318
2512
|
getAccountMeta("delegationPda", accounts.delegationPda),
|
|
@@ -2331,7 +2525,7 @@ function getTransferFixedInstruction(input, config) {
|
|
|
2331
2525
|
}
|
|
2332
2526
|
function parseTransferFixedInstruction(instruction) {
|
|
2333
2527
|
if (instruction.accounts.length < 9) {
|
|
2334
|
-
throw new
|
|
2528
|
+
throw new import_kit39.SolanaError(import_kit39.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2335
2529
|
actualAccountMetas: instruction.accounts.length,
|
|
2336
2530
|
expectedAccountMetas: 9
|
|
2337
2531
|
});
|
|
@@ -2360,29 +2554,29 @@ function parseTransferFixedInstruction(instruction) {
|
|
|
2360
2554
|
}
|
|
2361
2555
|
|
|
2362
2556
|
// src/generated/instructions/transferRecurring.ts
|
|
2363
|
-
var
|
|
2364
|
-
var
|
|
2557
|
+
var import_kit40 = require("@solana/kit");
|
|
2558
|
+
var import_program_client_core16 = require("@solana/program-client-core");
|
|
2365
2559
|
var TRANSFER_RECURRING_DISCRIMINATOR = 5;
|
|
2366
2560
|
function getTransferRecurringDiscriminatorBytes() {
|
|
2367
|
-
return (0,
|
|
2561
|
+
return (0, import_kit40.getU8Encoder)().encode(TRANSFER_RECURRING_DISCRIMINATOR);
|
|
2368
2562
|
}
|
|
2369
2563
|
function getTransferRecurringInstructionDataEncoder() {
|
|
2370
|
-
return (0,
|
|
2371
|
-
(0,
|
|
2372
|
-
["discriminator", (0,
|
|
2564
|
+
return (0, import_kit40.transformEncoder)(
|
|
2565
|
+
(0, import_kit40.getStructEncoder)([
|
|
2566
|
+
["discriminator", (0, import_kit40.getU8Encoder)()],
|
|
2373
2567
|
["transferData", getTransferDataEncoder()]
|
|
2374
2568
|
]),
|
|
2375
2569
|
(value) => ({ ...value, discriminator: TRANSFER_RECURRING_DISCRIMINATOR })
|
|
2376
2570
|
);
|
|
2377
2571
|
}
|
|
2378
2572
|
function getTransferRecurringInstructionDataDecoder() {
|
|
2379
|
-
return (0,
|
|
2380
|
-
["discriminator", (0,
|
|
2573
|
+
return (0, import_kit40.getStructDecoder)([
|
|
2574
|
+
["discriminator", (0, import_kit40.getU8Decoder)()],
|
|
2381
2575
|
["transferData", getTransferDataDecoder()]
|
|
2382
2576
|
]);
|
|
2383
2577
|
}
|
|
2384
2578
|
function getTransferRecurringInstructionDataCodec() {
|
|
2385
|
-
return (0,
|
|
2579
|
+
return (0, import_kit40.combineCodec)(getTransferRecurringInstructionDataEncoder(), getTransferRecurringInstructionDataDecoder());
|
|
2386
2580
|
}
|
|
2387
2581
|
async function getTransferRecurringInstructionAsync(input, config) {
|
|
2388
2582
|
const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
@@ -2400,16 +2594,16 @@ async function getTransferRecurringInstructionAsync(input, config) {
|
|
|
2400
2594
|
const accounts = originalAccounts;
|
|
2401
2595
|
const args = { ...input };
|
|
2402
2596
|
if (!accounts.eventAuthority.value) {
|
|
2403
|
-
accounts.eventAuthority.value = await (0,
|
|
2597
|
+
accounts.eventAuthority.value = await (0, import_kit40.getProgramDerivedAddress)({
|
|
2404
2598
|
programAddress,
|
|
2405
|
-
seeds: [(0,
|
|
2599
|
+
seeds: [(0, import_kit40.getUtf8Encoder)().encode("event_authority")]
|
|
2406
2600
|
});
|
|
2407
2601
|
}
|
|
2408
2602
|
if (!accounts.selfProgram.value) {
|
|
2409
2603
|
accounts.selfProgram.value = programAddress;
|
|
2410
2604
|
accounts.selfProgram.isWritable = false;
|
|
2411
2605
|
}
|
|
2412
|
-
const getAccountMeta = (0,
|
|
2606
|
+
const getAccountMeta = (0, import_program_client_core16.getAccountMetaFactory)(programAddress, "programId");
|
|
2413
2607
|
return Object.freeze({
|
|
2414
2608
|
accounts: [
|
|
2415
2609
|
getAccountMeta("delegationPda", accounts.delegationPda),
|
|
@@ -2445,7 +2639,7 @@ function getTransferRecurringInstruction(input, config) {
|
|
|
2445
2639
|
accounts.selfProgram.value = programAddress;
|
|
2446
2640
|
accounts.selfProgram.isWritable = false;
|
|
2447
2641
|
}
|
|
2448
|
-
const getAccountMeta = (0,
|
|
2642
|
+
const getAccountMeta = (0, import_program_client_core16.getAccountMetaFactory)(programAddress, "programId");
|
|
2449
2643
|
return Object.freeze({
|
|
2450
2644
|
accounts: [
|
|
2451
2645
|
getAccountMeta("delegationPda", accounts.delegationPda),
|
|
@@ -2464,7 +2658,7 @@ function getTransferRecurringInstruction(input, config) {
|
|
|
2464
2658
|
}
|
|
2465
2659
|
function parseTransferRecurringInstruction(instruction) {
|
|
2466
2660
|
if (instruction.accounts.length < 9) {
|
|
2467
|
-
throw new
|
|
2661
|
+
throw new import_kit40.SolanaError(import_kit40.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2468
2662
|
actualAccountMetas: instruction.accounts.length,
|
|
2469
2663
|
expectedAccountMetas: 9
|
|
2470
2664
|
});
|
|
@@ -2493,29 +2687,29 @@ function parseTransferRecurringInstruction(instruction) {
|
|
|
2493
2687
|
}
|
|
2494
2688
|
|
|
2495
2689
|
// src/generated/instructions/transferSubscription.ts
|
|
2496
|
-
var
|
|
2497
|
-
var
|
|
2690
|
+
var import_kit41 = require("@solana/kit");
|
|
2691
|
+
var import_program_client_core17 = require("@solana/program-client-core");
|
|
2498
2692
|
var TRANSFER_SUBSCRIPTION_DISCRIMINATOR = 10;
|
|
2499
2693
|
function getTransferSubscriptionDiscriminatorBytes() {
|
|
2500
|
-
return (0,
|
|
2694
|
+
return (0, import_kit41.getU8Encoder)().encode(TRANSFER_SUBSCRIPTION_DISCRIMINATOR);
|
|
2501
2695
|
}
|
|
2502
2696
|
function getTransferSubscriptionInstructionDataEncoder() {
|
|
2503
|
-
return (0,
|
|
2504
|
-
(0,
|
|
2505
|
-
["discriminator", (0,
|
|
2697
|
+
return (0, import_kit41.transformEncoder)(
|
|
2698
|
+
(0, import_kit41.getStructEncoder)([
|
|
2699
|
+
["discriminator", (0, import_kit41.getU8Encoder)()],
|
|
2506
2700
|
["transferData", getTransferDataEncoder()]
|
|
2507
2701
|
]),
|
|
2508
2702
|
(value) => ({ ...value, discriminator: TRANSFER_SUBSCRIPTION_DISCRIMINATOR })
|
|
2509
2703
|
);
|
|
2510
2704
|
}
|
|
2511
2705
|
function getTransferSubscriptionInstructionDataDecoder() {
|
|
2512
|
-
return (0,
|
|
2513
|
-
["discriminator", (0,
|
|
2706
|
+
return (0, import_kit41.getStructDecoder)([
|
|
2707
|
+
["discriminator", (0, import_kit41.getU8Decoder)()],
|
|
2514
2708
|
["transferData", getTransferDataDecoder()]
|
|
2515
2709
|
]);
|
|
2516
2710
|
}
|
|
2517
2711
|
function getTransferSubscriptionInstructionDataCodec() {
|
|
2518
|
-
return (0,
|
|
2712
|
+
return (0, import_kit41.combineCodec)(
|
|
2519
2713
|
getTransferSubscriptionInstructionDataEncoder(),
|
|
2520
2714
|
getTransferSubscriptionInstructionDataDecoder()
|
|
2521
2715
|
);
|
|
@@ -2537,16 +2731,16 @@ async function getTransferSubscriptionInstructionAsync(input, config) {
|
|
|
2537
2731
|
const accounts = originalAccounts;
|
|
2538
2732
|
const args = { ...input };
|
|
2539
2733
|
if (!accounts.eventAuthority.value) {
|
|
2540
|
-
accounts.eventAuthority.value = await (0,
|
|
2734
|
+
accounts.eventAuthority.value = await (0, import_kit41.getProgramDerivedAddress)({
|
|
2541
2735
|
programAddress,
|
|
2542
|
-
seeds: [(0,
|
|
2736
|
+
seeds: [(0, import_kit41.getUtf8Encoder)().encode("event_authority")]
|
|
2543
2737
|
});
|
|
2544
2738
|
}
|
|
2545
2739
|
if (!accounts.selfProgram.value) {
|
|
2546
2740
|
accounts.selfProgram.value = programAddress;
|
|
2547
2741
|
accounts.selfProgram.isWritable = false;
|
|
2548
2742
|
}
|
|
2549
|
-
const getAccountMeta = (0,
|
|
2743
|
+
const getAccountMeta = (0, import_program_client_core17.getAccountMetaFactory)(programAddress, "programId");
|
|
2550
2744
|
return Object.freeze({
|
|
2551
2745
|
accounts: [
|
|
2552
2746
|
getAccountMeta("subscriptionPda", accounts.subscriptionPda),
|
|
@@ -2584,7 +2778,7 @@ function getTransferSubscriptionInstruction(input, config) {
|
|
|
2584
2778
|
accounts.selfProgram.value = programAddress;
|
|
2585
2779
|
accounts.selfProgram.isWritable = false;
|
|
2586
2780
|
}
|
|
2587
|
-
const getAccountMeta = (0,
|
|
2781
|
+
const getAccountMeta = (0, import_program_client_core17.getAccountMetaFactory)(programAddress, "programId");
|
|
2588
2782
|
return Object.freeze({
|
|
2589
2783
|
accounts: [
|
|
2590
2784
|
getAccountMeta("subscriptionPda", accounts.subscriptionPda),
|
|
@@ -2604,7 +2798,7 @@ function getTransferSubscriptionInstruction(input, config) {
|
|
|
2604
2798
|
}
|
|
2605
2799
|
function parseTransferSubscriptionInstruction(instruction) {
|
|
2606
2800
|
if (instruction.accounts.length < 10) {
|
|
2607
|
-
throw new
|
|
2801
|
+
throw new import_kit41.SolanaError(import_kit41.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2608
2802
|
actualAccountMetas: instruction.accounts.length,
|
|
2609
2803
|
expectedAccountMetas: 10
|
|
2610
2804
|
});
|
|
@@ -2634,29 +2828,29 @@ function parseTransferSubscriptionInstruction(instruction) {
|
|
|
2634
2828
|
}
|
|
2635
2829
|
|
|
2636
2830
|
// src/generated/instructions/updatePlan.ts
|
|
2637
|
-
var
|
|
2638
|
-
var
|
|
2831
|
+
var import_kit42 = require("@solana/kit");
|
|
2832
|
+
var import_program_client_core18 = require("@solana/program-client-core");
|
|
2639
2833
|
var UPDATE_PLAN_DISCRIMINATOR = 8;
|
|
2640
2834
|
function getUpdatePlanDiscriminatorBytes() {
|
|
2641
|
-
return (0,
|
|
2835
|
+
return (0, import_kit42.getU8Encoder)().encode(UPDATE_PLAN_DISCRIMINATOR);
|
|
2642
2836
|
}
|
|
2643
2837
|
function getUpdatePlanInstructionDataEncoder() {
|
|
2644
|
-
return (0,
|
|
2645
|
-
(0,
|
|
2646
|
-
["discriminator", (0,
|
|
2838
|
+
return (0, import_kit42.transformEncoder)(
|
|
2839
|
+
(0, import_kit42.getStructEncoder)([
|
|
2840
|
+
["discriminator", (0, import_kit42.getU8Encoder)()],
|
|
2647
2841
|
["updatePlanData", getUpdatePlanDataEncoder()]
|
|
2648
2842
|
]),
|
|
2649
2843
|
(value) => ({ ...value, discriminator: UPDATE_PLAN_DISCRIMINATOR })
|
|
2650
2844
|
);
|
|
2651
2845
|
}
|
|
2652
2846
|
function getUpdatePlanInstructionDataDecoder() {
|
|
2653
|
-
return (0,
|
|
2654
|
-
["discriminator", (0,
|
|
2847
|
+
return (0, import_kit42.getStructDecoder)([
|
|
2848
|
+
["discriminator", (0, import_kit42.getU8Decoder)()],
|
|
2655
2849
|
["updatePlanData", getUpdatePlanDataDecoder()]
|
|
2656
2850
|
]);
|
|
2657
2851
|
}
|
|
2658
2852
|
function getUpdatePlanInstructionDataCodec() {
|
|
2659
|
-
return (0,
|
|
2853
|
+
return (0, import_kit42.combineCodec)(getUpdatePlanInstructionDataEncoder(), getUpdatePlanInstructionDataDecoder());
|
|
2660
2854
|
}
|
|
2661
2855
|
async function getUpdatePlanInstructionAsync(input, config) {
|
|
2662
2856
|
const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
|
|
@@ -2669,16 +2863,16 @@ async function getUpdatePlanInstructionAsync(input, config) {
|
|
|
2669
2863
|
const accounts = originalAccounts;
|
|
2670
2864
|
const args = { ...input };
|
|
2671
2865
|
if (!accounts.eventAuthority.value) {
|
|
2672
|
-
accounts.eventAuthority.value = await (0,
|
|
2866
|
+
accounts.eventAuthority.value = await (0, import_kit42.getProgramDerivedAddress)({
|
|
2673
2867
|
programAddress,
|
|
2674
|
-
seeds: [(0,
|
|
2868
|
+
seeds: [(0, import_kit42.getUtf8Encoder)().encode("event_authority")]
|
|
2675
2869
|
});
|
|
2676
2870
|
}
|
|
2677
2871
|
if (!accounts.selfProgram.value) {
|
|
2678
2872
|
accounts.selfProgram.value = programAddress;
|
|
2679
2873
|
accounts.selfProgram.isWritable = false;
|
|
2680
2874
|
}
|
|
2681
|
-
const getAccountMeta = (0,
|
|
2875
|
+
const getAccountMeta = (0, import_program_client_core18.getAccountMetaFactory)(programAddress, "programId");
|
|
2682
2876
|
return Object.freeze({
|
|
2683
2877
|
accounts: [
|
|
2684
2878
|
getAccountMeta("owner", accounts.owner),
|
|
@@ -2704,7 +2898,7 @@ function getUpdatePlanInstruction(input, config) {
|
|
|
2704
2898
|
accounts.selfProgram.value = programAddress;
|
|
2705
2899
|
accounts.selfProgram.isWritable = false;
|
|
2706
2900
|
}
|
|
2707
|
-
const getAccountMeta = (0,
|
|
2901
|
+
const getAccountMeta = (0, import_program_client_core18.getAccountMetaFactory)(programAddress, "programId");
|
|
2708
2902
|
return Object.freeze({
|
|
2709
2903
|
accounts: [
|
|
2710
2904
|
getAccountMeta("owner", accounts.owner),
|
|
@@ -2718,7 +2912,7 @@ function getUpdatePlanInstruction(input, config) {
|
|
|
2718
2912
|
}
|
|
2719
2913
|
function parseUpdatePlanInstruction(instruction) {
|
|
2720
2914
|
if (instruction.accounts.length < 4) {
|
|
2721
|
-
throw new
|
|
2915
|
+
throw new import_kit42.SolanaError(import_kit42.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2722
2916
|
actualAccountMetas: instruction.accounts.length,
|
|
2723
2917
|
expectedAccountMetas: 4
|
|
2724
2918
|
});
|
|
@@ -2770,62 +2964,66 @@ var SubscriptionsInstruction = /* @__PURE__ */ ((SubscriptionsInstruction2) => {
|
|
|
2770
2964
|
SubscriptionsInstruction2[SubscriptionsInstruction2["RevokeSubscriptionAuthority"] = 14] = "RevokeSubscriptionAuthority";
|
|
2771
2965
|
SubscriptionsInstruction2[SubscriptionsInstruction2["RevokeAbandonedDelegation"] = 15] = "RevokeAbandonedDelegation";
|
|
2772
2966
|
SubscriptionsInstruction2[SubscriptionsInstruction2["RevokeAbandonedSubscription"] = 16] = "RevokeAbandonedSubscription";
|
|
2967
|
+
SubscriptionsInstruction2[SubscriptionsInstruction2["CancelSubscriptionNow"] = 17] = "CancelSubscriptionNow";
|
|
2773
2968
|
return SubscriptionsInstruction2;
|
|
2774
2969
|
})(SubscriptionsInstruction || {});
|
|
2775
2970
|
function identifySubscriptionsInstruction(instruction) {
|
|
2776
2971
|
const data = "data" in instruction ? instruction.data : instruction;
|
|
2777
|
-
if ((0,
|
|
2972
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(0), 0)) {
|
|
2778
2973
|
return 0 /* InitSubscriptionAuthority */;
|
|
2779
2974
|
}
|
|
2780
|
-
if ((0,
|
|
2975
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(1), 0)) {
|
|
2781
2976
|
return 1 /* CreateFixedDelegation */;
|
|
2782
2977
|
}
|
|
2783
|
-
if ((0,
|
|
2978
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(2), 0)) {
|
|
2784
2979
|
return 2 /* CreateRecurringDelegation */;
|
|
2785
2980
|
}
|
|
2786
|
-
if ((0,
|
|
2981
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(3), 0)) {
|
|
2787
2982
|
return 3 /* RevokeDelegation */;
|
|
2788
2983
|
}
|
|
2789
|
-
if ((0,
|
|
2984
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(4), 0)) {
|
|
2790
2985
|
return 4 /* TransferFixed */;
|
|
2791
2986
|
}
|
|
2792
|
-
if ((0,
|
|
2987
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(5), 0)) {
|
|
2793
2988
|
return 5 /* TransferRecurring */;
|
|
2794
2989
|
}
|
|
2795
|
-
if ((0,
|
|
2990
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(6), 0)) {
|
|
2796
2991
|
return 6 /* CloseSubscriptionAuthority */;
|
|
2797
2992
|
}
|
|
2798
|
-
if ((0,
|
|
2993
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(7), 0)) {
|
|
2799
2994
|
return 7 /* CreatePlan */;
|
|
2800
2995
|
}
|
|
2801
|
-
if ((0,
|
|
2996
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(8), 0)) {
|
|
2802
2997
|
return 8 /* UpdatePlan */;
|
|
2803
2998
|
}
|
|
2804
|
-
if ((0,
|
|
2999
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(9), 0)) {
|
|
2805
3000
|
return 9 /* DeletePlan */;
|
|
2806
3001
|
}
|
|
2807
|
-
if ((0,
|
|
3002
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(10), 0)) {
|
|
2808
3003
|
return 10 /* TransferSubscription */;
|
|
2809
3004
|
}
|
|
2810
|
-
if ((0,
|
|
3005
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(11), 0)) {
|
|
2811
3006
|
return 11 /* Subscribe */;
|
|
2812
3007
|
}
|
|
2813
|
-
if ((0,
|
|
3008
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(12), 0)) {
|
|
2814
3009
|
return 12 /* CancelSubscription */;
|
|
2815
3010
|
}
|
|
2816
|
-
if ((0,
|
|
3011
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(13), 0)) {
|
|
2817
3012
|
return 13 /* ResumeSubscription */;
|
|
2818
3013
|
}
|
|
2819
|
-
if ((0,
|
|
3014
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(14), 0)) {
|
|
2820
3015
|
return 14 /* RevokeSubscriptionAuthority */;
|
|
2821
3016
|
}
|
|
2822
|
-
if ((0,
|
|
3017
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(15), 0)) {
|
|
2823
3018
|
return 15 /* RevokeAbandonedDelegation */;
|
|
2824
3019
|
}
|
|
2825
|
-
if ((0,
|
|
3020
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(16), 0)) {
|
|
2826
3021
|
return 16 /* RevokeAbandonedSubscription */;
|
|
2827
3022
|
}
|
|
2828
|
-
|
|
3023
|
+
if ((0, import_kit43.containsBytes)(data, (0, import_kit43.getU8Encoder)().encode(17), 0)) {
|
|
3024
|
+
return 17 /* CancelSubscriptionNow */;
|
|
3025
|
+
}
|
|
3026
|
+
throw new import_kit43.SolanaError(import_kit43.SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {
|
|
2829
3027
|
instructionData: data,
|
|
2830
3028
|
programName: "subscriptions"
|
|
2831
3029
|
});
|
|
@@ -2834,114 +3032,121 @@ function parseSubscriptionsInstruction(instruction) {
|
|
|
2834
3032
|
const instructionType = identifySubscriptionsInstruction(instruction);
|
|
2835
3033
|
switch (instructionType) {
|
|
2836
3034
|
case 0 /* InitSubscriptionAuthority */: {
|
|
2837
|
-
(0,
|
|
3035
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2838
3036
|
return {
|
|
2839
3037
|
instructionType: 0 /* InitSubscriptionAuthority */,
|
|
2840
3038
|
...parseInitSubscriptionAuthorityInstruction(instruction)
|
|
2841
3039
|
};
|
|
2842
3040
|
}
|
|
2843
3041
|
case 1 /* CreateFixedDelegation */: {
|
|
2844
|
-
(0,
|
|
3042
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2845
3043
|
return {
|
|
2846
3044
|
instructionType: 1 /* CreateFixedDelegation */,
|
|
2847
3045
|
...parseCreateFixedDelegationInstruction(instruction)
|
|
2848
3046
|
};
|
|
2849
3047
|
}
|
|
2850
3048
|
case 2 /* CreateRecurringDelegation */: {
|
|
2851
|
-
(0,
|
|
3049
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2852
3050
|
return {
|
|
2853
3051
|
instructionType: 2 /* CreateRecurringDelegation */,
|
|
2854
3052
|
...parseCreateRecurringDelegationInstruction(instruction)
|
|
2855
3053
|
};
|
|
2856
3054
|
}
|
|
2857
3055
|
case 3 /* RevokeDelegation */: {
|
|
2858
|
-
(0,
|
|
3056
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2859
3057
|
return {
|
|
2860
3058
|
instructionType: 3 /* RevokeDelegation */,
|
|
2861
3059
|
...parseRevokeDelegationInstruction(instruction)
|
|
2862
3060
|
};
|
|
2863
3061
|
}
|
|
2864
3062
|
case 4 /* TransferFixed */: {
|
|
2865
|
-
(0,
|
|
3063
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2866
3064
|
return {
|
|
2867
3065
|
instructionType: 4 /* TransferFixed */,
|
|
2868
3066
|
...parseTransferFixedInstruction(instruction)
|
|
2869
3067
|
};
|
|
2870
3068
|
}
|
|
2871
3069
|
case 5 /* TransferRecurring */: {
|
|
2872
|
-
(0,
|
|
3070
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2873
3071
|
return {
|
|
2874
3072
|
instructionType: 5 /* TransferRecurring */,
|
|
2875
3073
|
...parseTransferRecurringInstruction(instruction)
|
|
2876
3074
|
};
|
|
2877
3075
|
}
|
|
2878
3076
|
case 6 /* CloseSubscriptionAuthority */: {
|
|
2879
|
-
(0,
|
|
3077
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2880
3078
|
return {
|
|
2881
3079
|
instructionType: 6 /* CloseSubscriptionAuthority */,
|
|
2882
3080
|
...parseCloseSubscriptionAuthorityInstruction(instruction)
|
|
2883
3081
|
};
|
|
2884
3082
|
}
|
|
2885
3083
|
case 7 /* CreatePlan */: {
|
|
2886
|
-
(0,
|
|
3084
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2887
3085
|
return { instructionType: 7 /* CreatePlan */, ...parseCreatePlanInstruction(instruction) };
|
|
2888
3086
|
}
|
|
2889
3087
|
case 8 /* UpdatePlan */: {
|
|
2890
|
-
(0,
|
|
3088
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2891
3089
|
return { instructionType: 8 /* UpdatePlan */, ...parseUpdatePlanInstruction(instruction) };
|
|
2892
3090
|
}
|
|
2893
3091
|
case 9 /* DeletePlan */: {
|
|
2894
|
-
(0,
|
|
3092
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2895
3093
|
return { instructionType: 9 /* DeletePlan */, ...parseDeletePlanInstruction(instruction) };
|
|
2896
3094
|
}
|
|
2897
3095
|
case 10 /* TransferSubscription */: {
|
|
2898
|
-
(0,
|
|
3096
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2899
3097
|
return {
|
|
2900
3098
|
instructionType: 10 /* TransferSubscription */,
|
|
2901
3099
|
...parseTransferSubscriptionInstruction(instruction)
|
|
2902
3100
|
};
|
|
2903
3101
|
}
|
|
2904
3102
|
case 11 /* Subscribe */: {
|
|
2905
|
-
(0,
|
|
3103
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2906
3104
|
return { instructionType: 11 /* Subscribe */, ...parseSubscribeInstruction(instruction) };
|
|
2907
3105
|
}
|
|
2908
3106
|
case 12 /* CancelSubscription */: {
|
|
2909
|
-
(0,
|
|
3107
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2910
3108
|
return {
|
|
2911
3109
|
instructionType: 12 /* CancelSubscription */,
|
|
2912
3110
|
...parseCancelSubscriptionInstruction(instruction)
|
|
2913
3111
|
};
|
|
2914
3112
|
}
|
|
2915
3113
|
case 13 /* ResumeSubscription */: {
|
|
2916
|
-
(0,
|
|
3114
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2917
3115
|
return {
|
|
2918
3116
|
instructionType: 13 /* ResumeSubscription */,
|
|
2919
3117
|
...parseResumeSubscriptionInstruction(instruction)
|
|
2920
3118
|
};
|
|
2921
3119
|
}
|
|
2922
3120
|
case 14 /* RevokeSubscriptionAuthority */: {
|
|
2923
|
-
(0,
|
|
3121
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2924
3122
|
return {
|
|
2925
3123
|
instructionType: 14 /* RevokeSubscriptionAuthority */,
|
|
2926
3124
|
...parseRevokeSubscriptionAuthorityInstruction(instruction)
|
|
2927
3125
|
};
|
|
2928
3126
|
}
|
|
2929
3127
|
case 15 /* RevokeAbandonedDelegation */: {
|
|
2930
|
-
(0,
|
|
3128
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2931
3129
|
return {
|
|
2932
3130
|
instructionType: 15 /* RevokeAbandonedDelegation */,
|
|
2933
3131
|
...parseRevokeAbandonedDelegationInstruction(instruction)
|
|
2934
3132
|
};
|
|
2935
3133
|
}
|
|
2936
3134
|
case 16 /* RevokeAbandonedSubscription */: {
|
|
2937
|
-
(0,
|
|
3135
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
2938
3136
|
return {
|
|
2939
3137
|
instructionType: 16 /* RevokeAbandonedSubscription */,
|
|
2940
3138
|
...parseRevokeAbandonedSubscriptionInstruction(instruction)
|
|
2941
3139
|
};
|
|
2942
3140
|
}
|
|
3141
|
+
case 17 /* CancelSubscriptionNow */: {
|
|
3142
|
+
(0, import_kit43.assertIsInstructionWithAccounts)(instruction);
|
|
3143
|
+
return {
|
|
3144
|
+
instructionType: 17 /* CancelSubscriptionNow */,
|
|
3145
|
+
...parseCancelSubscriptionNowInstruction(instruction)
|
|
3146
|
+
};
|
|
3147
|
+
}
|
|
2943
3148
|
default:
|
|
2944
|
-
throw new
|
|
3149
|
+
throw new import_kit43.SolanaError(import_kit43.SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
|
|
2945
3150
|
instructionType,
|
|
2946
3151
|
programName: "subscriptions"
|
|
2947
3152
|
});
|
|
@@ -2949,34 +3154,35 @@ function parseSubscriptionsInstruction(instruction) {
|
|
|
2949
3154
|
}
|
|
2950
3155
|
function subscriptionsProgram() {
|
|
2951
3156
|
return (client) => {
|
|
2952
|
-
return (0,
|
|
3157
|
+
return (0, import_kit43.extendClient)(client, {
|
|
2953
3158
|
subscriptions: {
|
|
2954
3159
|
accounts: {
|
|
2955
|
-
fixedDelegation: (0,
|
|
2956
|
-
plan: (0,
|
|
2957
|
-
recurringDelegation: (0,
|
|
2958
|
-
subscriptionAuthority: (0,
|
|
2959
|
-
subscriptionDelegation: (0,
|
|
2960
|
-
eventAuthority: (0,
|
|
3160
|
+
fixedDelegation: (0, import_program_client_core19.addSelfFetchFunctions)(client, getFixedDelegationCodec()),
|
|
3161
|
+
plan: (0, import_program_client_core19.addSelfFetchFunctions)(client, getPlanCodec()),
|
|
3162
|
+
recurringDelegation: (0, import_program_client_core19.addSelfFetchFunctions)(client, getRecurringDelegationCodec()),
|
|
3163
|
+
subscriptionAuthority: (0, import_program_client_core19.addSelfFetchFunctions)(client, getSubscriptionAuthorityCodec()),
|
|
3164
|
+
subscriptionDelegation: (0, import_program_client_core19.addSelfFetchFunctions)(client, getSubscriptionDelegationCodec()),
|
|
3165
|
+
eventAuthority: (0, import_program_client_core19.addSelfFetchFunctions)(client, getEventAuthorityCodec())
|
|
2961
3166
|
},
|
|
2962
3167
|
instructions: {
|
|
2963
|
-
initSubscriptionAuthority: (input) => (0,
|
|
2964
|
-
createFixedDelegation: (input) => (0,
|
|
2965
|
-
createRecurringDelegation: (input) => (0,
|
|
2966
|
-
revokeDelegation: (input) => (0,
|
|
2967
|
-
transferFixed: (input) => (0,
|
|
2968
|
-
transferRecurring: (input) => (0,
|
|
2969
|
-
closeSubscriptionAuthority: (input) => (0,
|
|
2970
|
-
createPlan: (input) => (0,
|
|
2971
|
-
updatePlan: (input) => (0,
|
|
2972
|
-
deletePlan: (input) => (0,
|
|
2973
|
-
transferSubscription: (input) => (0,
|
|
2974
|
-
subscribe: (input) => (0,
|
|
2975
|
-
cancelSubscription: (input) => (0,
|
|
2976
|
-
resumeSubscription: (input) => (0,
|
|
2977
|
-
revokeSubscriptionAuthority: (input) => (0,
|
|
2978
|
-
revokeAbandonedDelegation: (input) => (0,
|
|
2979
|
-
revokeAbandonedSubscription: (input) => (0,
|
|
3168
|
+
initSubscriptionAuthority: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getInitSubscriptionAuthorityInstructionAsync(input)),
|
|
3169
|
+
createFixedDelegation: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getCreateFixedDelegationInstruction(input)),
|
|
3170
|
+
createRecurringDelegation: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getCreateRecurringDelegationInstruction(input)),
|
|
3171
|
+
revokeDelegation: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getRevokeDelegationInstruction(input)),
|
|
3172
|
+
transferFixed: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getTransferFixedInstructionAsync(input)),
|
|
3173
|
+
transferRecurring: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getTransferRecurringInstructionAsync(input)),
|
|
3174
|
+
closeSubscriptionAuthority: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getCloseSubscriptionAuthorityInstruction(input)),
|
|
3175
|
+
createPlan: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getCreatePlanInstruction(input)),
|
|
3176
|
+
updatePlan: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getUpdatePlanInstructionAsync(input)),
|
|
3177
|
+
deletePlan: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getDeletePlanInstruction(input)),
|
|
3178
|
+
transferSubscription: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getTransferSubscriptionInstructionAsync(input)),
|
|
3179
|
+
subscribe: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getSubscribeInstructionAsync(input)),
|
|
3180
|
+
cancelSubscription: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getCancelSubscriptionInstructionAsync(input)),
|
|
3181
|
+
resumeSubscription: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getResumeSubscriptionInstructionAsync(input)),
|
|
3182
|
+
revokeSubscriptionAuthority: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getRevokeSubscriptionAuthorityInstructionAsync(input)),
|
|
3183
|
+
revokeAbandonedDelegation: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getRevokeAbandonedDelegationInstruction(input)),
|
|
3184
|
+
revokeAbandonedSubscription: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getRevokeAbandonedSubscriptionInstruction(input)),
|
|
3185
|
+
cancelSubscriptionNow: (input) => (0, import_program_client_core19.addSelfPlanAndSendFunctions)(client, getCancelSubscriptionNowInstructionAsync(input))
|
|
2980
3186
|
},
|
|
2981
3187
|
pdas: {
|
|
2982
3188
|
fixedDelegation: findFixedDelegationPda,
|
|
@@ -2985,7 +3191,9 @@ function subscriptionsProgram() {
|
|
|
2985
3191
|
subscriptionAuthority: findSubscriptionAuthorityPda,
|
|
2986
3192
|
subscriptionDelegation: findSubscriptionDelegationPda,
|
|
2987
3193
|
eventAuthority: findEventAuthorityPda
|
|
2988
|
-
}
|
|
3194
|
+
},
|
|
3195
|
+
identifyInstruction: identifySubscriptionsInstruction,
|
|
3196
|
+
parseInstruction: parseSubscriptionsInstruction
|
|
2989
3197
|
}
|
|
2990
3198
|
});
|
|
2991
3199
|
};
|
|
@@ -3063,6 +3271,8 @@ var SUBSCRIPTIONS_ERROR__ALREADY_SUBSCRIBED = 517;
|
|
|
3063
3271
|
var SUBSCRIPTIONS_ERROR__PLAN_ALREADY_EXISTS = 518;
|
|
3064
3272
|
var SUBSCRIPTIONS_ERROR__PLAN_TERMS_MISMATCH = 519;
|
|
3065
3273
|
var SUBSCRIPTIONS_ERROR__PLAN_END_TS_CANNOT_EXTEND = 520;
|
|
3274
|
+
var SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_APPROVAL = 521;
|
|
3275
|
+
var SUBSCRIPTIONS_ERROR__STALE_PLAN_APPROVAL = 522;
|
|
3066
3276
|
var SUBSCRIPTIONS_ERROR__INVALID_EVENT_AUTHORITY = 600;
|
|
3067
3277
|
var SUBSCRIPTIONS_ERROR__INVALID_EVENT_DATA = 601;
|
|
3068
3278
|
var SUBSCRIPTIONS_ERROR__INVALID_EVENT_TAG = 602;
|
|
@@ -3138,6 +3348,8 @@ if (process.env["NODE_ENV"] !== "production") {
|
|
|
3138
3348
|
[SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_ON_LANDING_REQUIRES_EXPIRY]: `start_ts of 0 (start on landing) requires a non-zero expiry`,
|
|
3139
3349
|
[SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_GREATER_THAN_EXPIRY]: `start time specified is greater than expiry`,
|
|
3140
3350
|
[SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_IN_PAST]: `Past start time specified`,
|
|
3351
|
+
[SUBSCRIPTIONS_ERROR__STALE_PLAN_APPROVAL]: `Plan update approval does not match the current plan state`,
|
|
3352
|
+
[SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_APPROVAL]: `Subscription approval does not match the current subscription`,
|
|
3141
3353
|
[SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY]: `Delegation init_id does not match current SubscriptionAuthority`,
|
|
3142
3354
|
[SUBSCRIPTIONS_ERROR__SUBSCRIPTION_ALREADY_CANCELLED]: `Subscription already cancelled`,
|
|
3143
3355
|
[SUBSCRIPTIONS_ERROR__SUBSCRIPTION_CANCELLED]: `Subscription cancelled and past valid period`,
|
|
@@ -3156,7 +3368,7 @@ function getSubscriptionsErrorMessage(code) {
|
|
|
3156
3368
|
return "Error message not available in production bundles.";
|
|
3157
3369
|
}
|
|
3158
3370
|
function isSubscriptionsError(error, transactionMessage, code) {
|
|
3159
|
-
return (0,
|
|
3371
|
+
return (0, import_kit44.isProgramError)(error, transactionMessage, SUBSCRIPTIONS_PROGRAM_ADDRESS, code);
|
|
3160
3372
|
}
|
|
3161
3373
|
|
|
3162
3374
|
// src/constants.ts
|
|
@@ -3178,10 +3390,11 @@ var PLAN_OWNER_OFFSET = 1;
|
|
|
3178
3390
|
var MAX_PLAN_DESTINATIONS = 4;
|
|
3179
3391
|
var MAX_PLAN_PULLERS = 4;
|
|
3180
3392
|
var METADATA_URI_LEN = 128;
|
|
3393
|
+
var UNKNOWN_INIT_ID = -9223372036854775808n;
|
|
3181
3394
|
|
|
3182
3395
|
// src/accounts/decode.ts
|
|
3183
3396
|
function toEncodedAccount(raw, programAddress) {
|
|
3184
|
-
const base64Encoder = (0,
|
|
3397
|
+
const base64Encoder = (0, import_kit45.getBase64Encoder)();
|
|
3185
3398
|
const data = base64Encoder.encode(raw.account.data[0]);
|
|
3186
3399
|
return {
|
|
3187
3400
|
address: raw.pubkey,
|
|
@@ -3298,31 +3511,31 @@ async function fetchSubscriptionsForUser(rpc, user, programAddress) {
|
|
|
3298
3511
|
}
|
|
3299
3512
|
|
|
3300
3513
|
// src/plugin.ts
|
|
3301
|
-
var
|
|
3302
|
-
var
|
|
3514
|
+
var import_kit47 = require("@solana/kit");
|
|
3515
|
+
var import_program_client_core20 = require("@solana/program-client-core");
|
|
3303
3516
|
var import_token = require("@solana-program/token");
|
|
3304
3517
|
|
|
3305
3518
|
// src/transfer-hook.ts
|
|
3306
|
-
var
|
|
3519
|
+
var import_kit46 = require("@solana/kit");
|
|
3307
3520
|
var import_token_2022 = require("@solana-program/token-2022");
|
|
3308
3521
|
var DEFAULT_ADDRESS = "11111111111111111111111111111111";
|
|
3309
3522
|
var EXTRA_ACCOUNT_METAS_SEED = "extra-account-metas";
|
|
3310
3523
|
var TLV_HEADER_LEN = 12;
|
|
3311
3524
|
var POD_SLICE_COUNT_LEN = 4;
|
|
3312
3525
|
var EXTRA_ACCOUNT_META_LEN = 35;
|
|
3313
|
-
var
|
|
3526
|
+
var ADDRESS_LEN = 32;
|
|
3314
3527
|
var PDA_PROGRAM_INDEX_OFFSET = 1 << 7;
|
|
3315
3528
|
var EXECUTE_DISCRIMINATOR = Uint8Array.from([105, 37, 101, 197, 75, 251, 102, 26]);
|
|
3316
|
-
var addressDecoder = (0,
|
|
3317
|
-
var addressEncoder = (0,
|
|
3529
|
+
var addressDecoder = (0, import_kit46.getAddressDecoder)();
|
|
3530
|
+
var addressEncoder = (0, import_kit46.getAddressEncoder)();
|
|
3318
3531
|
function roleFor(isSigner, isWritable) {
|
|
3319
|
-
if (isSigner && isWritable) return
|
|
3320
|
-
if (isSigner) return
|
|
3321
|
-
if (isWritable) return
|
|
3322
|
-
return
|
|
3532
|
+
if (isSigner && isWritable) return import_kit46.AccountRole.WRITABLE_SIGNER;
|
|
3533
|
+
if (isSigner) return import_kit46.AccountRole.READONLY_SIGNER;
|
|
3534
|
+
if (isWritable) return import_kit46.AccountRole.WRITABLE;
|
|
3535
|
+
return import_kit46.AccountRole.READONLY;
|
|
3323
3536
|
}
|
|
3324
3537
|
async function fetchData(rpc, address) {
|
|
3325
|
-
const account = await (0,
|
|
3538
|
+
const account = await (0, import_kit46.fetchEncodedAccount)(rpc, address);
|
|
3326
3539
|
if (!account.exists) throw new Error("transfer hook: referenced account not found");
|
|
3327
3540
|
return account.data;
|
|
3328
3541
|
}
|
|
@@ -3380,18 +3593,18 @@ async function unpackSeeds(config, previous, instructionData, rpc) {
|
|
|
3380
3593
|
}
|
|
3381
3594
|
return seeds;
|
|
3382
3595
|
}
|
|
3383
|
-
async function
|
|
3596
|
+
async function unpackAddressData(config, previous, instructionData, rpc) {
|
|
3384
3597
|
const rest = config.subarray(1);
|
|
3385
3598
|
if (config[0] === 1) {
|
|
3386
3599
|
const offset = rest[0];
|
|
3387
|
-
return addressDecoder.decode(instructionData.subarray(offset, offset +
|
|
3600
|
+
return addressDecoder.decode(instructionData.subarray(offset, offset + ADDRESS_LEN));
|
|
3388
3601
|
}
|
|
3389
3602
|
if (config[0] === 2) {
|
|
3390
3603
|
const [accountIndex, offset] = [rest[0], rest[1]];
|
|
3391
3604
|
const data = await fetchData(rpc, previous[accountIndex].address);
|
|
3392
|
-
return addressDecoder.decode(data.subarray(offset, offset +
|
|
3605
|
+
return addressDecoder.decode(data.subarray(offset, offset + ADDRESS_LEN));
|
|
3393
3606
|
}
|
|
3394
|
-
throw new Error("transfer hook: invalid
|
|
3607
|
+
throw new Error("transfer hook: invalid address data");
|
|
3395
3608
|
}
|
|
3396
3609
|
async function resolveMeta(meta, previous, instructionData, hookProgram, rpc) {
|
|
3397
3610
|
const role = roleFor(meta.isSigner, meta.isWritable);
|
|
@@ -3399,11 +3612,11 @@ async function resolveMeta(meta, previous, instructionData, hookProgram, rpc) {
|
|
|
3399
3612
|
return { address: addressDecoder.decode(meta.addressConfig), role };
|
|
3400
3613
|
}
|
|
3401
3614
|
if (meta.discriminator === 2) {
|
|
3402
|
-
return { address: await
|
|
3615
|
+
return { address: await unpackAddressData(meta.addressConfig, previous, instructionData, rpc), role };
|
|
3403
3616
|
}
|
|
3404
3617
|
const programId = meta.discriminator === 1 ? hookProgram : previous[meta.discriminator - PDA_PROGRAM_INDEX_OFFSET].address;
|
|
3405
3618
|
const seeds = await unpackSeeds(meta.addressConfig, previous, instructionData, rpc);
|
|
3406
|
-
const [pda] = await (0,
|
|
3619
|
+
const [pda] = await (0, import_kit46.getProgramDerivedAddress)({ programAddress: programId, seeds });
|
|
3407
3620
|
return { address: pda, role };
|
|
3408
3621
|
}
|
|
3409
3622
|
async function resolveTransferHookAccounts(rpc, args) {
|
|
@@ -3414,23 +3627,23 @@ async function resolveTransferHookAccounts(rpc, args) {
|
|
|
3414
3627
|
const hook = extensions.find((extension) => extension.__kind === "TransferHook");
|
|
3415
3628
|
if (!hook || hook.programId === DEFAULT_ADDRESS) return [];
|
|
3416
3629
|
const hookProgram = hook.programId;
|
|
3417
|
-
const [validationPda] = await (0,
|
|
3630
|
+
const [validationPda] = await (0, import_kit46.getProgramDerivedAddress)({
|
|
3418
3631
|
programAddress: hookProgram,
|
|
3419
3632
|
seeds: [EXTRA_ACCOUNT_METAS_SEED, addressEncoder.encode(args.mint)]
|
|
3420
3633
|
});
|
|
3421
3634
|
const trailing = [
|
|
3422
|
-
{ address: hookProgram, role:
|
|
3423
|
-
{ address: validationPda, role:
|
|
3635
|
+
{ address: hookProgram, role: import_kit46.AccountRole.READONLY },
|
|
3636
|
+
{ address: validationPda, role: import_kit46.AccountRole.READONLY }
|
|
3424
3637
|
];
|
|
3425
|
-
const validationAccount = await (0,
|
|
3638
|
+
const validationAccount = await (0, import_kit46.fetchEncodedAccount)(rpc, validationPda);
|
|
3426
3639
|
if (!validationAccount.exists) return trailing;
|
|
3427
3640
|
const instructionData = executeInstructionData(args.amount);
|
|
3428
3641
|
const previous = [
|
|
3429
|
-
{ address: args.source, role:
|
|
3430
|
-
{ address: args.mint, role:
|
|
3431
|
-
{ address: args.destination, role:
|
|
3432
|
-
{ address: args.authority, role:
|
|
3433
|
-
{ address: validationPda, role:
|
|
3642
|
+
{ address: args.source, role: import_kit46.AccountRole.READONLY },
|
|
3643
|
+
{ address: args.mint, role: import_kit46.AccountRole.READONLY },
|
|
3644
|
+
{ address: args.destination, role: import_kit46.AccountRole.READONLY },
|
|
3645
|
+
{ address: args.authority, role: import_kit46.AccountRole.READONLY },
|
|
3646
|
+
{ address: validationPda, role: import_kit46.AccountRole.READONLY }
|
|
3434
3647
|
];
|
|
3435
3648
|
for (const meta of readMetas(validationAccount.data)) {
|
|
3436
3649
|
const resolved = await resolveMeta(meta, previous, instructionData, hookProgram, rpc);
|
|
@@ -3495,7 +3708,7 @@ function appendPayer(instruction, payer) {
|
|
|
3495
3708
|
return withTrailing(instruction, [
|
|
3496
3709
|
{
|
|
3497
3710
|
address: payer.address,
|
|
3498
|
-
role:
|
|
3711
|
+
role: import_kit47.AccountRole.WRITABLE_SIGNER,
|
|
3499
3712
|
signer: payer
|
|
3500
3713
|
}
|
|
3501
3714
|
]);
|
|
@@ -3524,7 +3737,7 @@ async function getCloseSubscriptionAuthorityOverlayInstructionAsync(input) {
|
|
|
3524
3737
|
pdaConfig(input.programAddress)
|
|
3525
3738
|
);
|
|
3526
3739
|
if (input.receiver) {
|
|
3527
|
-
ix = withTrailing(ix, [{ address: input.receiver, role:
|
|
3740
|
+
ix = withTrailing(ix, [{ address: input.receiver, role: import_kit47.AccountRole.WRITABLE }]);
|
|
3528
3741
|
}
|
|
3529
3742
|
return ix;
|
|
3530
3743
|
}
|
|
@@ -3549,7 +3762,7 @@ async function getRevokeSubscriptionAuthorityOverlayInstructionAsync(input) {
|
|
|
3549
3762
|
pdaConfig(input.programAddress)
|
|
3550
3763
|
);
|
|
3551
3764
|
if (input.receiver) {
|
|
3552
|
-
ix = withTrailing(ix, [{ address: input.receiver, role:
|
|
3765
|
+
ix = withTrailing(ix, [{ address: input.receiver, role: import_kit47.AccountRole.WRITABLE }]);
|
|
3553
3766
|
}
|
|
3554
3767
|
return ix;
|
|
3555
3768
|
}
|
|
@@ -3643,14 +3856,14 @@ function getRevokeDelegationOverlayInstruction(input) {
|
|
|
3643
3856
|
pdaConfig(input.programAddress)
|
|
3644
3857
|
);
|
|
3645
3858
|
if (input.receiver) {
|
|
3646
|
-
ix = withTrailing(ix, [{ address: input.receiver, role:
|
|
3859
|
+
ix = withTrailing(ix, [{ address: input.receiver, role: import_kit47.AccountRole.WRITABLE }]);
|
|
3647
3860
|
}
|
|
3648
3861
|
return ix;
|
|
3649
3862
|
}
|
|
3650
3863
|
function getRevokeSubscriptionOverlayInstruction(input) {
|
|
3651
|
-
const trailing = [{ address: input.planPda, role:
|
|
3864
|
+
const trailing = [{ address: input.planPda, role: import_kit47.AccountRole.READONLY }];
|
|
3652
3865
|
if (input.receiver) {
|
|
3653
|
-
trailing.push({ address: input.receiver, role:
|
|
3866
|
+
trailing.push({ address: input.receiver, role: import_kit47.AccountRole.WRITABLE });
|
|
3654
3867
|
}
|
|
3655
3868
|
return withTrailing(
|
|
3656
3869
|
getRevokeDelegationInstruction(
|
|
@@ -3742,32 +3955,41 @@ async function getCreatePlanOverlayInstructionAsync(input) {
|
|
|
3742
3955
|
{ owner: input.owner.address, planId: input.planId },
|
|
3743
3956
|
pdaConfig(input.programAddress)
|
|
3744
3957
|
);
|
|
3745
|
-
return
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3958
|
+
return appendPayer(
|
|
3959
|
+
getCreatePlanInstruction(
|
|
3960
|
+
{
|
|
3961
|
+
merchant: input.owner,
|
|
3962
|
+
planData: {
|
|
3963
|
+
destinations,
|
|
3964
|
+
endTs: input.endTs,
|
|
3965
|
+
metadataUri: input.metadataUri,
|
|
3966
|
+
mint: input.mint,
|
|
3967
|
+
planId: input.planId,
|
|
3968
|
+
pullers,
|
|
3969
|
+
terms: {
|
|
3970
|
+
amount: input.amount,
|
|
3971
|
+
createdAt: 0n,
|
|
3972
|
+
periodHours: input.periodHours
|
|
3973
|
+
}
|
|
3974
|
+
},
|
|
3975
|
+
planPda,
|
|
3976
|
+
tokenMint: input.mint,
|
|
3977
|
+
tokenProgram: input.tokenProgram
|
|
3760
3978
|
},
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
},
|
|
3765
|
-
pdaConfig(input.programAddress)
|
|
3979
|
+
pdaConfig(input.programAddress)
|
|
3980
|
+
),
|
|
3981
|
+
input.payer
|
|
3766
3982
|
);
|
|
3767
3983
|
}
|
|
3768
3984
|
async function getUpdatePlanOverlayInstruction(input) {
|
|
3985
|
+
if (input.expectedCreatedAt === void 0 || input.expectedEndTs === void 0 || input.expectedPullers === void 0 || input.expectedMetadataUri === void 0) {
|
|
3986
|
+
throw new Error(
|
|
3987
|
+
"getUpdatePlanOverlayInstruction requires expectedCreatedAt, expectedEndTs, expectedPullers, and expectedMetadataUri. Use the plugin client `subscriptions.instructions.updatePlan(...)` to auto-fetch from the live plan."
|
|
3988
|
+
);
|
|
3989
|
+
}
|
|
3769
3990
|
assertMetadataUri(input.metadataUri);
|
|
3770
3991
|
const pullers = padPlanPullers(input.pullers);
|
|
3992
|
+
const expectedPullers = padPlanPullers(input.expectedPullers);
|
|
3771
3993
|
return getUpdatePlanInstruction(
|
|
3772
3994
|
{
|
|
3773
3995
|
...await eventAccounts(input.programAddress),
|
|
@@ -3775,6 +3997,10 @@ async function getUpdatePlanOverlayInstruction(input) {
|
|
|
3775
3997
|
planPda: input.planPda,
|
|
3776
3998
|
updatePlanData: {
|
|
3777
3999
|
endTs: input.endTs,
|
|
4000
|
+
expectedCreatedAt: input.expectedCreatedAt,
|
|
4001
|
+
expectedEndTs: input.expectedEndTs,
|
|
4002
|
+
expectedMetadataUri: input.expectedMetadataUri,
|
|
4003
|
+
expectedPullers,
|
|
3778
4004
|
metadataUri: input.metadataUri,
|
|
3779
4005
|
pullers,
|
|
3780
4006
|
status: input.status
|
|
@@ -3835,6 +4061,19 @@ async function getCancelSubscriptionOverlayInstructionAsync(input) {
|
|
|
3835
4061
|
pdaConfig(input.programAddress)
|
|
3836
4062
|
);
|
|
3837
4063
|
}
|
|
4064
|
+
async function getCancelSubscriptionNowOverlayInstructionAsync(input) {
|
|
4065
|
+
return await getCancelSubscriptionNowInstructionAsync(
|
|
4066
|
+
{
|
|
4067
|
+
...await eventAccounts(input.programAddress),
|
|
4068
|
+
cancelSubscriptionNowData: { expectedCurrentPeriodStartTs: input.expectedCurrentPeriodStartTs },
|
|
4069
|
+
merchant: input.merchant,
|
|
4070
|
+
planPda: input.planPda,
|
|
4071
|
+
subscriber: input.subscriber,
|
|
4072
|
+
subscriptionPda: input.subscriptionPda
|
|
4073
|
+
},
|
|
4074
|
+
pdaConfig(input.programAddress)
|
|
4075
|
+
);
|
|
4076
|
+
}
|
|
3838
4077
|
async function getResumeSubscriptionOverlayInstructionAsync(input) {
|
|
3839
4078
|
const [subscriptionAuthority] = await findSubscriptionAuthorityPda(
|
|
3840
4079
|
{ tokenMint: input.tokenMint, user: input.subscriber.address },
|
|
@@ -3844,6 +4083,7 @@ async function getResumeSubscriptionOverlayInstructionAsync(input) {
|
|
|
3844
4083
|
{
|
|
3845
4084
|
...await eventAccounts(input.programAddress),
|
|
3846
4085
|
planPda: input.planPda,
|
|
4086
|
+
resumeData: { expectedExpiresAtTs: input.expectedExpiresAtTs },
|
|
3847
4087
|
subscriber: input.subscriber,
|
|
3848
4088
|
subscriptionAuthority,
|
|
3849
4089
|
subscriptionPda: input.subscriptionPda
|
|
@@ -3853,7 +4093,7 @@ async function getResumeSubscriptionOverlayInstructionAsync(input) {
|
|
|
3853
4093
|
}
|
|
3854
4094
|
function subscriptionsProgram2() {
|
|
3855
4095
|
return (client) => {
|
|
3856
|
-
return (0,
|
|
4096
|
+
return (0, import_kit47.pipe)(client, subscriptionsProgram(), (c) => {
|
|
3857
4097
|
const queries = {
|
|
3858
4098
|
activeDelegationSummary: async (wallet) => {
|
|
3859
4099
|
const delegations = await fetchDelegationsByDelegator(c.rpc, wallet);
|
|
@@ -3906,21 +4146,29 @@ function subscriptionsProgram2() {
|
|
|
3906
4146
|
});
|
|
3907
4147
|
};
|
|
3908
4148
|
const instructions = {
|
|
3909
|
-
cancelSubscription: (input) => (0,
|
|
4149
|
+
cancelSubscription: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
3910
4150
|
client,
|
|
3911
4151
|
getCancelSubscriptionOverlayInstructionAsync({
|
|
3912
4152
|
...input,
|
|
3913
4153
|
subscriber: input.subscriber ?? client.identity
|
|
3914
4154
|
})
|
|
3915
4155
|
),
|
|
3916
|
-
|
|
4156
|
+
cancelSubscriptionNow: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
4157
|
+
client,
|
|
4158
|
+
getCancelSubscriptionNowOverlayInstructionAsync({
|
|
4159
|
+
...input,
|
|
4160
|
+
merchant: input.merchant ?? client.payer,
|
|
4161
|
+
subscriber: input.subscriber ?? client.identity
|
|
4162
|
+
})
|
|
4163
|
+
),
|
|
4164
|
+
closeSubscriptionAuthority: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
3917
4165
|
client,
|
|
3918
4166
|
getCloseSubscriptionAuthorityOverlayInstructionAsync({
|
|
3919
4167
|
...input,
|
|
3920
4168
|
user: input.user ?? client.identity
|
|
3921
4169
|
})
|
|
3922
4170
|
),
|
|
3923
|
-
createFixedDelegation: (input) => (0,
|
|
4171
|
+
createFixedDelegation: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
3924
4172
|
client,
|
|
3925
4173
|
(async () => {
|
|
3926
4174
|
const delegator = input.delegator ?? client.identity;
|
|
@@ -3938,14 +4186,15 @@ function subscriptionsProgram2() {
|
|
|
3938
4186
|
});
|
|
3939
4187
|
})()
|
|
3940
4188
|
),
|
|
3941
|
-
createPlan: (input) => (0,
|
|
4189
|
+
createPlan: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
3942
4190
|
client,
|
|
3943
4191
|
getCreatePlanOverlayInstructionAsync({
|
|
3944
4192
|
...input,
|
|
3945
|
-
owner: input.owner ?? client.identity
|
|
4193
|
+
owner: input.owner ?? client.identity,
|
|
4194
|
+
payer: input.payer ?? (client.payer === client.identity ? void 0 : client.payer)
|
|
3946
4195
|
})
|
|
3947
4196
|
),
|
|
3948
|
-
createRecurringDelegation: (input) => (0,
|
|
4197
|
+
createRecurringDelegation: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
3949
4198
|
client,
|
|
3950
4199
|
(async () => {
|
|
3951
4200
|
const delegator = input.delegator ?? client.identity;
|
|
@@ -3963,14 +4212,14 @@ function subscriptionsProgram2() {
|
|
|
3963
4212
|
});
|
|
3964
4213
|
})()
|
|
3965
4214
|
),
|
|
3966
|
-
deletePlan: (input) => (0,
|
|
4215
|
+
deletePlan: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
3967
4216
|
client,
|
|
3968
4217
|
getDeletePlanOverlayInstruction({
|
|
3969
4218
|
...input,
|
|
3970
4219
|
owner: input.owner ?? client.identity
|
|
3971
4220
|
})
|
|
3972
4221
|
),
|
|
3973
|
-
initSubscriptionAuthority: (input) => (0,
|
|
4222
|
+
initSubscriptionAuthority: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
3974
4223
|
client,
|
|
3975
4224
|
getInitSubscriptionAuthorityOverlayInstructionAsync({
|
|
3976
4225
|
...input,
|
|
@@ -3978,35 +4227,35 @@ function subscriptionsProgram2() {
|
|
|
3978
4227
|
payer: input.payer ?? (client.payer === client.identity ? void 0 : client.payer)
|
|
3979
4228
|
})
|
|
3980
4229
|
),
|
|
3981
|
-
resumeSubscription: (input) => (0,
|
|
4230
|
+
resumeSubscription: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
3982
4231
|
client,
|
|
3983
4232
|
getResumeSubscriptionOverlayInstructionAsync({
|
|
3984
4233
|
...input,
|
|
3985
4234
|
subscriber: input.subscriber ?? client.identity
|
|
3986
4235
|
})
|
|
3987
4236
|
),
|
|
3988
|
-
revokeDelegation: (input) => (0,
|
|
4237
|
+
revokeDelegation: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
3989
4238
|
client,
|
|
3990
4239
|
getRevokeDelegationOverlayInstruction({
|
|
3991
4240
|
...input,
|
|
3992
4241
|
authority: input.authority ?? client.identity
|
|
3993
4242
|
})
|
|
3994
4243
|
),
|
|
3995
|
-
revokeSubscription: (input) => (0,
|
|
4244
|
+
revokeSubscription: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
3996
4245
|
client,
|
|
3997
4246
|
getRevokeSubscriptionOverlayInstruction({
|
|
3998
4247
|
...input,
|
|
3999
4248
|
authority: input.authority ?? client.identity
|
|
4000
4249
|
})
|
|
4001
4250
|
),
|
|
4002
|
-
revokeSubscriptionAuthority: (input) => (0,
|
|
4251
|
+
revokeSubscriptionAuthority: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
4003
4252
|
client,
|
|
4004
4253
|
getRevokeSubscriptionAuthorityOverlayInstructionAsync({
|
|
4005
4254
|
...input,
|
|
4006
4255
|
user: input.user ?? client.identity
|
|
4007
4256
|
})
|
|
4008
4257
|
),
|
|
4009
|
-
subscribe: (input) => (0,
|
|
4258
|
+
subscribe: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
4010
4259
|
client,
|
|
4011
4260
|
(async () => {
|
|
4012
4261
|
const subscriber = input.subscriber ?? client.identity;
|
|
@@ -4054,7 +4303,7 @@ function subscriptionsProgram2() {
|
|
|
4054
4303
|
});
|
|
4055
4304
|
})()
|
|
4056
4305
|
),
|
|
4057
|
-
transferFixed: (input) => (0,
|
|
4306
|
+
transferFixed: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
4058
4307
|
client,
|
|
4059
4308
|
(async () => await getTransferFixedOverlayInstructionAsync({
|
|
4060
4309
|
...input,
|
|
@@ -4062,7 +4311,7 @@ function subscriptionsProgram2() {
|
|
|
4062
4311
|
transferHookAccounts: await resolveDelegationHookAccounts(input)
|
|
4063
4312
|
}))()
|
|
4064
4313
|
),
|
|
4065
|
-
transferRecurring: (input) => (0,
|
|
4314
|
+
transferRecurring: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
4066
4315
|
client,
|
|
4067
4316
|
(async () => await getTransferRecurringOverlayInstructionAsync({
|
|
4068
4317
|
...input,
|
|
@@ -4070,7 +4319,7 @@ function subscriptionsProgram2() {
|
|
|
4070
4319
|
transferHookAccounts: await resolveDelegationHookAccounts(input)
|
|
4071
4320
|
}))()
|
|
4072
4321
|
),
|
|
4073
|
-
transferSubscription: (input) => (0,
|
|
4322
|
+
transferSubscription: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
4074
4323
|
client,
|
|
4075
4324
|
(async () => {
|
|
4076
4325
|
const [subscriptionAuthority] = await findSubscriptionAuthorityPda(
|
|
@@ -4098,12 +4347,26 @@ function subscriptionsProgram2() {
|
|
|
4098
4347
|
});
|
|
4099
4348
|
})()
|
|
4100
4349
|
),
|
|
4101
|
-
updatePlan: (input) => (0,
|
|
4350
|
+
updatePlan: (input) => (0, import_program_client_core20.addSelfPlanAndSendFunctions)(
|
|
4102
4351
|
client,
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4352
|
+
(async () => {
|
|
4353
|
+
let { expectedCreatedAt, expectedEndTs, expectedMetadataUri, expectedPullers } = input;
|
|
4354
|
+
if (expectedCreatedAt === void 0 || expectedEndTs === void 0 || expectedPullers === void 0 || expectedMetadataUri === void 0) {
|
|
4355
|
+
const plan = await fetchPlan(c.rpc, input.planPda);
|
|
4356
|
+
expectedCreatedAt = expectedCreatedAt ?? plan.data.data.terms.createdAt;
|
|
4357
|
+
expectedEndTs = expectedEndTs ?? plan.data.data.endTs;
|
|
4358
|
+
expectedMetadataUri = expectedMetadataUri ?? plan.data.data.metadataUri;
|
|
4359
|
+
expectedPullers = expectedPullers ?? [...plan.data.data.pullers];
|
|
4360
|
+
}
|
|
4361
|
+
return await getUpdatePlanOverlayInstruction({
|
|
4362
|
+
...input,
|
|
4363
|
+
expectedCreatedAt,
|
|
4364
|
+
expectedEndTs,
|
|
4365
|
+
expectedMetadataUri,
|
|
4366
|
+
expectedPullers,
|
|
4367
|
+
owner: input.owner ?? client.identity
|
|
4368
|
+
});
|
|
4369
|
+
})()
|
|
4107
4370
|
)
|
|
4108
4371
|
};
|
|
4109
4372
|
return {
|
|
@@ -4121,6 +4384,7 @@ function subscriptionsProgram2() {
|
|
|
4121
4384
|
0 && (module.exports = {
|
|
4122
4385
|
AccountDiscriminator,
|
|
4123
4386
|
CANCEL_SUBSCRIPTION_DISCRIMINATOR,
|
|
4387
|
+
CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR,
|
|
4124
4388
|
CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR,
|
|
4125
4389
|
CREATE_FIXED_DELEGATION_DISCRIMINATOR,
|
|
4126
4390
|
CREATE_PLAN_DISCRIMINATOR,
|
|
@@ -4214,6 +4478,8 @@ function subscriptionsProgram2() {
|
|
|
4214
4478
|
SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_ON_LANDING_REQUIRES_EXPIRY,
|
|
4215
4479
|
SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_GREATER_THAN_EXPIRY,
|
|
4216
4480
|
SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_IN_PAST,
|
|
4481
|
+
SUBSCRIPTIONS_ERROR__STALE_PLAN_APPROVAL,
|
|
4482
|
+
SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_APPROVAL,
|
|
4217
4483
|
SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY,
|
|
4218
4484
|
SUBSCRIPTIONS_ERROR__SUBSCRIPTION_ALREADY_CANCELLED,
|
|
4219
4485
|
SUBSCRIPTIONS_ERROR__SUBSCRIPTION_CANCELLED,
|
|
@@ -4233,6 +4499,7 @@ function subscriptionsProgram2() {
|
|
|
4233
4499
|
TRANSFER_RECURRING_DISCRIMINATOR,
|
|
4234
4500
|
TRANSFER_SUBSCRIPTION_DISCRIMINATOR,
|
|
4235
4501
|
U64_BYTE_SIZE,
|
|
4502
|
+
UNKNOWN_INIT_ID,
|
|
4236
4503
|
UPDATE_PLAN_DISCRIMINATOR,
|
|
4237
4504
|
ValidationError,
|
|
4238
4505
|
ZERO_ADDRESS,
|
|
@@ -4298,6 +4565,16 @@ function subscriptionsProgram2() {
|
|
|
4298
4565
|
getCancelSubscriptionInstructionDataCodec,
|
|
4299
4566
|
getCancelSubscriptionInstructionDataDecoder,
|
|
4300
4567
|
getCancelSubscriptionInstructionDataEncoder,
|
|
4568
|
+
getCancelSubscriptionNowDataCodec,
|
|
4569
|
+
getCancelSubscriptionNowDataDecoder,
|
|
4570
|
+
getCancelSubscriptionNowDataEncoder,
|
|
4571
|
+
getCancelSubscriptionNowDiscriminatorBytes,
|
|
4572
|
+
getCancelSubscriptionNowInstruction,
|
|
4573
|
+
getCancelSubscriptionNowInstructionAsync,
|
|
4574
|
+
getCancelSubscriptionNowInstructionDataCodec,
|
|
4575
|
+
getCancelSubscriptionNowInstructionDataDecoder,
|
|
4576
|
+
getCancelSubscriptionNowInstructionDataEncoder,
|
|
4577
|
+
getCancelSubscriptionNowOverlayInstructionAsync,
|
|
4301
4578
|
getCancelSubscriptionOverlayInstructionAsync,
|
|
4302
4579
|
getCloseSubscriptionAuthorityDiscriminatorBytes,
|
|
4303
4580
|
getCloseSubscriptionAuthorityInstruction,
|
|
@@ -4366,6 +4643,9 @@ function subscriptionsProgram2() {
|
|
|
4366
4643
|
getRecurringDelegationCodec,
|
|
4367
4644
|
getRecurringDelegationDecoder,
|
|
4368
4645
|
getRecurringDelegationEncoder,
|
|
4646
|
+
getResumeDataCodec,
|
|
4647
|
+
getResumeDataDecoder,
|
|
4648
|
+
getResumeDataEncoder,
|
|
4369
4649
|
getResumeSubscriptionDiscriminatorBytes,
|
|
4370
4650
|
getResumeSubscriptionInstruction,
|
|
4371
4651
|
getResumeSubscriptionInstructionAsync,
|
|
@@ -4451,6 +4731,7 @@ function subscriptionsProgram2() {
|
|
|
4451
4731
|
identifySubscriptionsInstruction,
|
|
4452
4732
|
isSubscriptionsError,
|
|
4453
4733
|
parseCancelSubscriptionInstruction,
|
|
4734
|
+
parseCancelSubscriptionNowInstruction,
|
|
4454
4735
|
parseCloseSubscriptionAuthorityInstruction,
|
|
4455
4736
|
parseCreateFixedDelegationInstruction,
|
|
4456
4737
|
parseCreatePlanInstruction,
|