@solana/subscriptions 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -856,10 +856,10 @@ import {
856
856
  assertIsInstructionWithAccounts,
857
857
  containsBytes,
858
858
  extendClient,
859
- getU8Encoder as getU8Encoder19,
859
+ getU8Encoder as getU8Encoder20,
860
860
  SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,
861
861
  SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,
862
- SolanaError as SolanaError14
862
+ SolanaError as SolanaError15
863
863
  } from "@solana/kit";
864
864
  import {
865
865
  addSelfFetchFunctions,
@@ -1512,7 +1512,7 @@ function parseInitSubscriptionAuthorityInstruction(instruction) {
1512
1512
  };
1513
1513
  }
1514
1514
 
1515
- // src/generated/instructions/revokeDelegation.ts
1515
+ // src/generated/instructions/resumeSubscription.ts
1516
1516
  import {
1517
1517
  combineCodec as combineCodec24,
1518
1518
  getStructDecoder as getStructDecoder22,
@@ -1523,22 +1523,143 @@ import {
1523
1523
  SolanaError as SolanaError8,
1524
1524
  transformEncoder as transformEncoder8
1525
1525
  } from "@solana/kit";
1526
- import { getAccountMetaFactory as getAccountMetaFactory8 } from "@solana/program-client-core";
1526
+ import {
1527
+ getAccountMetaFactory as getAccountMetaFactory8,
1528
+ getAddressFromResolvedInstructionAccount as getAddressFromResolvedInstructionAccount3
1529
+ } from "@solana/program-client-core";
1530
+ var RESUME_SUBSCRIPTION_DISCRIMINATOR = 13;
1531
+ function getResumeSubscriptionDiscriminatorBytes() {
1532
+ return getU8Encoder13().encode(RESUME_SUBSCRIPTION_DISCRIMINATOR);
1533
+ }
1534
+ function getResumeSubscriptionInstructionDataEncoder() {
1535
+ return transformEncoder8(getStructEncoder22([["discriminator", getU8Encoder13()]]), (value) => ({
1536
+ ...value,
1537
+ discriminator: RESUME_SUBSCRIPTION_DISCRIMINATOR
1538
+ }));
1539
+ }
1540
+ function getResumeSubscriptionInstructionDataDecoder() {
1541
+ return getStructDecoder22([["discriminator", getU8Decoder13()]]);
1542
+ }
1543
+ function getResumeSubscriptionInstructionDataCodec() {
1544
+ return combineCodec24(getResumeSubscriptionInstructionDataEncoder(), getResumeSubscriptionInstructionDataDecoder());
1545
+ }
1546
+ async function getResumeSubscriptionInstructionAsync(input, config) {
1547
+ const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
1548
+ const originalAccounts = {
1549
+ subscriber: { value: input.subscriber ?? null, isWritable: false },
1550
+ planPda: { value: input.planPda ?? null, isWritable: false },
1551
+ subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
1552
+ eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
1553
+ selfProgram: { value: input.selfProgram ?? null, isWritable: false }
1554
+ };
1555
+ const accounts = originalAccounts;
1556
+ if (!accounts.subscriptionPda.value) {
1557
+ accounts.subscriptionPda.value = await findSubscriptionDelegationPda({
1558
+ planPda: getAddressFromResolvedInstructionAccount3("planPda", accounts.planPda.value),
1559
+ subscriber: getAddressFromResolvedInstructionAccount3("subscriber", accounts.subscriber.value)
1560
+ });
1561
+ }
1562
+ if (!accounts.eventAuthority.value) {
1563
+ accounts.eventAuthority.value = "3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7";
1564
+ }
1565
+ if (!accounts.selfProgram.value) {
1566
+ accounts.selfProgram.value = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44";
1567
+ }
1568
+ const getAccountMeta = getAccountMetaFactory8(programAddress, "programId");
1569
+ return Object.freeze({
1570
+ accounts: [
1571
+ getAccountMeta("subscriber", accounts.subscriber),
1572
+ getAccountMeta("planPda", accounts.planPda),
1573
+ getAccountMeta("subscriptionPda", accounts.subscriptionPda),
1574
+ getAccountMeta("eventAuthority", accounts.eventAuthority),
1575
+ getAccountMeta("selfProgram", accounts.selfProgram)
1576
+ ],
1577
+ data: getResumeSubscriptionInstructionDataEncoder().encode({}),
1578
+ programAddress
1579
+ });
1580
+ }
1581
+ function getResumeSubscriptionInstruction(input, config) {
1582
+ const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
1583
+ const originalAccounts = {
1584
+ subscriber: { value: input.subscriber ?? null, isWritable: false },
1585
+ planPda: { value: input.planPda ?? null, isWritable: false },
1586
+ subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },
1587
+ eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
1588
+ selfProgram: { value: input.selfProgram ?? null, isWritable: false }
1589
+ };
1590
+ const accounts = originalAccounts;
1591
+ if (!accounts.eventAuthority.value) {
1592
+ accounts.eventAuthority.value = "3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7";
1593
+ }
1594
+ if (!accounts.selfProgram.value) {
1595
+ accounts.selfProgram.value = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44";
1596
+ }
1597
+ const getAccountMeta = getAccountMetaFactory8(programAddress, "programId");
1598
+ return Object.freeze({
1599
+ accounts: [
1600
+ getAccountMeta("subscriber", accounts.subscriber),
1601
+ getAccountMeta("planPda", accounts.planPda),
1602
+ getAccountMeta("subscriptionPda", accounts.subscriptionPda),
1603
+ getAccountMeta("eventAuthority", accounts.eventAuthority),
1604
+ getAccountMeta("selfProgram", accounts.selfProgram)
1605
+ ],
1606
+ data: getResumeSubscriptionInstructionDataEncoder().encode({}),
1607
+ programAddress
1608
+ });
1609
+ }
1610
+ function parseResumeSubscriptionInstruction(instruction) {
1611
+ if (instruction.accounts.length < 5) {
1612
+ throw new SolanaError8(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS8, {
1613
+ actualAccountMetas: instruction.accounts.length,
1614
+ expectedAccountMetas: 5
1615
+ });
1616
+ }
1617
+ let accountIndex = 0;
1618
+ const getNextAccount = () => {
1619
+ const accountMeta = instruction.accounts[accountIndex];
1620
+ accountIndex += 1;
1621
+ return accountMeta;
1622
+ };
1623
+ return {
1624
+ programAddress: instruction.programAddress,
1625
+ accounts: {
1626
+ subscriber: getNextAccount(),
1627
+ planPda: getNextAccount(),
1628
+ subscriptionPda: getNextAccount(),
1629
+ eventAuthority: getNextAccount(),
1630
+ selfProgram: getNextAccount()
1631
+ },
1632
+ data: getResumeSubscriptionInstructionDataDecoder().decode(instruction.data)
1633
+ };
1634
+ }
1635
+
1636
+ // src/generated/instructions/revokeDelegation.ts
1637
+ import {
1638
+ combineCodec as combineCodec25,
1639
+ getStructDecoder as getStructDecoder23,
1640
+ getStructEncoder as getStructEncoder23,
1641
+ getU8Decoder as getU8Decoder14,
1642
+ getU8Encoder as getU8Encoder14,
1643
+ SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS9,
1644
+ SolanaError as SolanaError9,
1645
+ transformEncoder as transformEncoder9
1646
+ } from "@solana/kit";
1647
+ import { getAccountMetaFactory as getAccountMetaFactory9 } from "@solana/program-client-core";
1527
1648
  var REVOKE_DELEGATION_DISCRIMINATOR = 3;
1528
1649
  function getRevokeDelegationDiscriminatorBytes() {
1529
- return getU8Encoder13().encode(REVOKE_DELEGATION_DISCRIMINATOR);
1650
+ return getU8Encoder14().encode(REVOKE_DELEGATION_DISCRIMINATOR);
1530
1651
  }
1531
1652
  function getRevokeDelegationInstructionDataEncoder() {
1532
- return transformEncoder8(getStructEncoder22([["discriminator", getU8Encoder13()]]), (value) => ({
1653
+ return transformEncoder9(getStructEncoder23([["discriminator", getU8Encoder14()]]), (value) => ({
1533
1654
  ...value,
1534
1655
  discriminator: REVOKE_DELEGATION_DISCRIMINATOR
1535
1656
  }));
1536
1657
  }
1537
1658
  function getRevokeDelegationInstructionDataDecoder() {
1538
- return getStructDecoder22([["discriminator", getU8Decoder13()]]);
1659
+ return getStructDecoder23([["discriminator", getU8Decoder14()]]);
1539
1660
  }
1540
1661
  function getRevokeDelegationInstructionDataCodec() {
1541
- return combineCodec24(getRevokeDelegationInstructionDataEncoder(), getRevokeDelegationInstructionDataDecoder());
1662
+ return combineCodec25(getRevokeDelegationInstructionDataEncoder(), getRevokeDelegationInstructionDataDecoder());
1542
1663
  }
1543
1664
  function getRevokeDelegationInstruction(input, config) {
1544
1665
  const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
@@ -1547,7 +1668,7 @@ function getRevokeDelegationInstruction(input, config) {
1547
1668
  delegationAccount: { value: input.delegationAccount ?? null, isWritable: true }
1548
1669
  };
1549
1670
  const accounts = originalAccounts;
1550
- const getAccountMeta = getAccountMetaFactory8(programAddress, "programId");
1671
+ const getAccountMeta = getAccountMetaFactory9(programAddress, "programId");
1551
1672
  return Object.freeze({
1552
1673
  accounts: [
1553
1674
  getAccountMeta("authority", accounts.authority),
@@ -1559,7 +1680,7 @@ function getRevokeDelegationInstruction(input, config) {
1559
1680
  }
1560
1681
  function parseRevokeDelegationInstruction(instruction) {
1561
1682
  if (instruction.accounts.length < 2) {
1562
- throw new SolanaError8(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS8, {
1683
+ throw new SolanaError9(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS9, {
1563
1684
  actualAccountMetas: instruction.accounts.length,
1564
1685
  expectedAccountMetas: 2
1565
1686
  });
@@ -1579,40 +1700,40 @@ function parseRevokeDelegationInstruction(instruction) {
1579
1700
 
1580
1701
  // src/generated/instructions/subscribe.ts
1581
1702
  import {
1582
- combineCodec as combineCodec25,
1583
- getStructDecoder as getStructDecoder23,
1584
- getStructEncoder as getStructEncoder23,
1585
- getU8Decoder as getU8Decoder14,
1586
- getU8Encoder as getU8Encoder14,
1587
- SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS9,
1588
- SolanaError as SolanaError9,
1589
- transformEncoder as transformEncoder9
1703
+ combineCodec as combineCodec26,
1704
+ getStructDecoder as getStructDecoder24,
1705
+ getStructEncoder as getStructEncoder24,
1706
+ getU8Decoder as getU8Decoder15,
1707
+ getU8Encoder as getU8Encoder15,
1708
+ SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS10,
1709
+ SolanaError as SolanaError10,
1710
+ transformEncoder as transformEncoder10
1590
1711
  } from "@solana/kit";
1591
1712
  import {
1592
- getAccountMetaFactory as getAccountMetaFactory9,
1593
- getAddressFromResolvedInstructionAccount as getAddressFromResolvedInstructionAccount3
1713
+ getAccountMetaFactory as getAccountMetaFactory10,
1714
+ getAddressFromResolvedInstructionAccount as getAddressFromResolvedInstructionAccount4
1594
1715
  } from "@solana/program-client-core";
1595
1716
  var SUBSCRIBE_DISCRIMINATOR = 11;
1596
1717
  function getSubscribeDiscriminatorBytes() {
1597
- return getU8Encoder14().encode(SUBSCRIBE_DISCRIMINATOR);
1718
+ return getU8Encoder15().encode(SUBSCRIBE_DISCRIMINATOR);
1598
1719
  }
1599
1720
  function getSubscribeInstructionDataEncoder() {
1600
- return transformEncoder9(
1601
- getStructEncoder23([
1602
- ["discriminator", getU8Encoder14()],
1721
+ return transformEncoder10(
1722
+ getStructEncoder24([
1723
+ ["discriminator", getU8Encoder15()],
1603
1724
  ["subscribeData", getSubscribeDataEncoder()]
1604
1725
  ]),
1605
1726
  (value) => ({ ...value, discriminator: SUBSCRIBE_DISCRIMINATOR })
1606
1727
  );
1607
1728
  }
1608
1729
  function getSubscribeInstructionDataDecoder() {
1609
- return getStructDecoder23([
1610
- ["discriminator", getU8Decoder14()],
1730
+ return getStructDecoder24([
1731
+ ["discriminator", getU8Decoder15()],
1611
1732
  ["subscribeData", getSubscribeDataDecoder()]
1612
1733
  ]);
1613
1734
  }
1614
1735
  function getSubscribeInstructionDataCodec() {
1615
- return combineCodec25(getSubscribeInstructionDataEncoder(), getSubscribeInstructionDataDecoder());
1736
+ return combineCodec26(getSubscribeInstructionDataEncoder(), getSubscribeInstructionDataDecoder());
1616
1737
  }
1617
1738
  async function getSubscribeInstructionAsync(input, config) {
1618
1739
  const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
@@ -1630,8 +1751,8 @@ async function getSubscribeInstructionAsync(input, config) {
1630
1751
  const args = { ...input };
1631
1752
  if (!accounts.subscriptionPda.value) {
1632
1753
  accounts.subscriptionPda.value = await findSubscriptionDelegationPda({
1633
- planPda: getAddressFromResolvedInstructionAccount3("planPda", accounts.planPda.value),
1634
- subscriber: getAddressFromResolvedInstructionAccount3("subscriber", accounts.subscriber.value)
1754
+ planPda: getAddressFromResolvedInstructionAccount4("planPda", accounts.planPda.value),
1755
+ subscriber: getAddressFromResolvedInstructionAccount4("subscriber", accounts.subscriber.value)
1635
1756
  });
1636
1757
  }
1637
1758
  if (!accounts.systemProgram.value) {
@@ -1643,7 +1764,7 @@ async function getSubscribeInstructionAsync(input, config) {
1643
1764
  if (!accounts.selfProgram.value) {
1644
1765
  accounts.selfProgram.value = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44";
1645
1766
  }
1646
- const getAccountMeta = getAccountMetaFactory9(programAddress, "programId");
1767
+ const getAccountMeta = getAccountMetaFactory10(programAddress, "programId");
1647
1768
  return Object.freeze({
1648
1769
  accounts: [
1649
1770
  getAccountMeta("subscriber", accounts.subscriber),
@@ -1682,7 +1803,7 @@ function getSubscribeInstruction(input, config) {
1682
1803
  if (!accounts.selfProgram.value) {
1683
1804
  accounts.selfProgram.value = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44";
1684
1805
  }
1685
- const getAccountMeta = getAccountMetaFactory9(programAddress, "programId");
1806
+ const getAccountMeta = getAccountMetaFactory10(programAddress, "programId");
1686
1807
  return Object.freeze({
1687
1808
  accounts: [
1688
1809
  getAccountMeta("subscriber", accounts.subscriber),
@@ -1700,7 +1821,7 @@ function getSubscribeInstruction(input, config) {
1700
1821
  }
1701
1822
  function parseSubscribeInstruction(instruction) {
1702
1823
  if (instruction.accounts.length < 8) {
1703
- throw new SolanaError9(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS9, {
1824
+ throw new SolanaError10(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS10, {
1704
1825
  actualAccountMetas: instruction.accounts.length,
1705
1826
  expectedAccountMetas: 8
1706
1827
  });
@@ -1729,37 +1850,37 @@ function parseSubscribeInstruction(instruction) {
1729
1850
 
1730
1851
  // src/generated/instructions/transferFixed.ts
1731
1852
  import {
1732
- combineCodec as combineCodec26,
1733
- getStructDecoder as getStructDecoder24,
1734
- getStructEncoder as getStructEncoder24,
1735
- getU8Decoder as getU8Decoder15,
1736
- getU8Encoder as getU8Encoder15,
1737
- SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS10,
1738
- SolanaError as SolanaError10,
1739
- transformEncoder as transformEncoder10
1853
+ combineCodec as combineCodec27,
1854
+ getStructDecoder as getStructDecoder25,
1855
+ getStructEncoder as getStructEncoder25,
1856
+ getU8Decoder as getU8Decoder16,
1857
+ getU8Encoder as getU8Encoder16,
1858
+ SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS11,
1859
+ SolanaError as SolanaError11,
1860
+ transformEncoder as transformEncoder11
1740
1861
  } from "@solana/kit";
1741
- import { getAccountMetaFactory as getAccountMetaFactory10 } from "@solana/program-client-core";
1862
+ import { getAccountMetaFactory as getAccountMetaFactory11 } from "@solana/program-client-core";
1742
1863
  var TRANSFER_FIXED_DISCRIMINATOR = 4;
1743
1864
  function getTransferFixedDiscriminatorBytes() {
1744
- return getU8Encoder15().encode(TRANSFER_FIXED_DISCRIMINATOR);
1865
+ return getU8Encoder16().encode(TRANSFER_FIXED_DISCRIMINATOR);
1745
1866
  }
1746
1867
  function getTransferFixedInstructionDataEncoder() {
1747
- return transformEncoder10(
1748
- getStructEncoder24([
1749
- ["discriminator", getU8Encoder15()],
1868
+ return transformEncoder11(
1869
+ getStructEncoder25([
1870
+ ["discriminator", getU8Encoder16()],
1750
1871
  ["transferData", getTransferDataEncoder()]
1751
1872
  ]),
1752
1873
  (value) => ({ ...value, discriminator: TRANSFER_FIXED_DISCRIMINATOR })
1753
1874
  );
1754
1875
  }
1755
1876
  function getTransferFixedInstructionDataDecoder() {
1756
- return getStructDecoder24([
1757
- ["discriminator", getU8Decoder15()],
1877
+ return getStructDecoder25([
1878
+ ["discriminator", getU8Decoder16()],
1758
1879
  ["transferData", getTransferDataDecoder()]
1759
1880
  ]);
1760
1881
  }
1761
1882
  function getTransferFixedInstructionDataCodec() {
1762
- return combineCodec26(getTransferFixedInstructionDataEncoder(), getTransferFixedInstructionDataDecoder());
1883
+ return combineCodec27(getTransferFixedInstructionDataEncoder(), getTransferFixedInstructionDataDecoder());
1763
1884
  }
1764
1885
  function getTransferFixedInstruction(input, config) {
1765
1886
  const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
@@ -1781,7 +1902,7 @@ function getTransferFixedInstruction(input, config) {
1781
1902
  if (!accounts.selfProgram.value) {
1782
1903
  accounts.selfProgram.value = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44";
1783
1904
  }
1784
- const getAccountMeta = getAccountMetaFactory10(programAddress, "programId");
1905
+ const getAccountMeta = getAccountMetaFactory11(programAddress, "programId");
1785
1906
  return Object.freeze({
1786
1907
  accounts: [
1787
1908
  getAccountMeta("delegationPda", accounts.delegationPda),
@@ -1799,7 +1920,7 @@ function getTransferFixedInstruction(input, config) {
1799
1920
  }
1800
1921
  function parseTransferFixedInstruction(instruction) {
1801
1922
  if (instruction.accounts.length < 8) {
1802
- throw new SolanaError10(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS10, {
1923
+ throw new SolanaError11(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS11, {
1803
1924
  actualAccountMetas: instruction.accounts.length,
1804
1925
  expectedAccountMetas: 8
1805
1926
  });
@@ -1828,37 +1949,37 @@ function parseTransferFixedInstruction(instruction) {
1828
1949
 
1829
1950
  // src/generated/instructions/transferRecurring.ts
1830
1951
  import {
1831
- combineCodec as combineCodec27,
1832
- getStructDecoder as getStructDecoder25,
1833
- getStructEncoder as getStructEncoder25,
1834
- getU8Decoder as getU8Decoder16,
1835
- getU8Encoder as getU8Encoder16,
1836
- SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS11,
1837
- SolanaError as SolanaError11,
1838
- transformEncoder as transformEncoder11
1952
+ combineCodec as combineCodec28,
1953
+ getStructDecoder as getStructDecoder26,
1954
+ getStructEncoder as getStructEncoder26,
1955
+ getU8Decoder as getU8Decoder17,
1956
+ getU8Encoder as getU8Encoder17,
1957
+ SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS12,
1958
+ SolanaError as SolanaError12,
1959
+ transformEncoder as transformEncoder12
1839
1960
  } from "@solana/kit";
1840
- import { getAccountMetaFactory as getAccountMetaFactory11 } from "@solana/program-client-core";
1961
+ import { getAccountMetaFactory as getAccountMetaFactory12 } from "@solana/program-client-core";
1841
1962
  var TRANSFER_RECURRING_DISCRIMINATOR = 5;
1842
1963
  function getTransferRecurringDiscriminatorBytes() {
1843
- return getU8Encoder16().encode(TRANSFER_RECURRING_DISCRIMINATOR);
1964
+ return getU8Encoder17().encode(TRANSFER_RECURRING_DISCRIMINATOR);
1844
1965
  }
1845
1966
  function getTransferRecurringInstructionDataEncoder() {
1846
- return transformEncoder11(
1847
- getStructEncoder25([
1848
- ["discriminator", getU8Encoder16()],
1967
+ return transformEncoder12(
1968
+ getStructEncoder26([
1969
+ ["discriminator", getU8Encoder17()],
1849
1970
  ["transferData", getTransferDataEncoder()]
1850
1971
  ]),
1851
1972
  (value) => ({ ...value, discriminator: TRANSFER_RECURRING_DISCRIMINATOR })
1852
1973
  );
1853
1974
  }
1854
1975
  function getTransferRecurringInstructionDataDecoder() {
1855
- return getStructDecoder25([
1856
- ["discriminator", getU8Decoder16()],
1976
+ return getStructDecoder26([
1977
+ ["discriminator", getU8Decoder17()],
1857
1978
  ["transferData", getTransferDataDecoder()]
1858
1979
  ]);
1859
1980
  }
1860
1981
  function getTransferRecurringInstructionDataCodec() {
1861
- return combineCodec27(getTransferRecurringInstructionDataEncoder(), getTransferRecurringInstructionDataDecoder());
1982
+ return combineCodec28(getTransferRecurringInstructionDataEncoder(), getTransferRecurringInstructionDataDecoder());
1862
1983
  }
1863
1984
  function getTransferRecurringInstruction(input, config) {
1864
1985
  const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
@@ -1880,7 +2001,7 @@ function getTransferRecurringInstruction(input, config) {
1880
2001
  if (!accounts.selfProgram.value) {
1881
2002
  accounts.selfProgram.value = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44";
1882
2003
  }
1883
- const getAccountMeta = getAccountMetaFactory11(programAddress, "programId");
2004
+ const getAccountMeta = getAccountMetaFactory12(programAddress, "programId");
1884
2005
  return Object.freeze({
1885
2006
  accounts: [
1886
2007
  getAccountMeta("delegationPda", accounts.delegationPda),
@@ -1898,7 +2019,7 @@ function getTransferRecurringInstruction(input, config) {
1898
2019
  }
1899
2020
  function parseTransferRecurringInstruction(instruction) {
1900
2021
  if (instruction.accounts.length < 8) {
1901
- throw new SolanaError11(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS11, {
2022
+ throw new SolanaError12(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS12, {
1902
2023
  actualAccountMetas: instruction.accounts.length,
1903
2024
  expectedAccountMetas: 8
1904
2025
  });
@@ -1927,37 +2048,37 @@ function parseTransferRecurringInstruction(instruction) {
1927
2048
 
1928
2049
  // src/generated/instructions/transferSubscription.ts
1929
2050
  import {
1930
- combineCodec as combineCodec28,
1931
- getStructDecoder as getStructDecoder26,
1932
- getStructEncoder as getStructEncoder26,
1933
- getU8Decoder as getU8Decoder17,
1934
- getU8Encoder as getU8Encoder17,
1935
- SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS12,
1936
- SolanaError as SolanaError12,
1937
- transformEncoder as transformEncoder12
2051
+ combineCodec as combineCodec29,
2052
+ getStructDecoder as getStructDecoder27,
2053
+ getStructEncoder as getStructEncoder27,
2054
+ getU8Decoder as getU8Decoder18,
2055
+ getU8Encoder as getU8Encoder18,
2056
+ SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS13,
2057
+ SolanaError as SolanaError13,
2058
+ transformEncoder as transformEncoder13
1938
2059
  } from "@solana/kit";
1939
- import { getAccountMetaFactory as getAccountMetaFactory12 } from "@solana/program-client-core";
2060
+ import { getAccountMetaFactory as getAccountMetaFactory13 } from "@solana/program-client-core";
1940
2061
  var TRANSFER_SUBSCRIPTION_DISCRIMINATOR = 10;
1941
2062
  function getTransferSubscriptionDiscriminatorBytes() {
1942
- return getU8Encoder17().encode(TRANSFER_SUBSCRIPTION_DISCRIMINATOR);
2063
+ return getU8Encoder18().encode(TRANSFER_SUBSCRIPTION_DISCRIMINATOR);
1943
2064
  }
1944
2065
  function getTransferSubscriptionInstructionDataEncoder() {
1945
- return transformEncoder12(
1946
- getStructEncoder26([
1947
- ["discriminator", getU8Encoder17()],
2066
+ return transformEncoder13(
2067
+ getStructEncoder27([
2068
+ ["discriminator", getU8Encoder18()],
1948
2069
  ["transferData", getTransferDataEncoder()]
1949
2070
  ]),
1950
2071
  (value) => ({ ...value, discriminator: TRANSFER_SUBSCRIPTION_DISCRIMINATOR })
1951
2072
  );
1952
2073
  }
1953
2074
  function getTransferSubscriptionInstructionDataDecoder() {
1954
- return getStructDecoder26([
1955
- ["discriminator", getU8Decoder17()],
2075
+ return getStructDecoder27([
2076
+ ["discriminator", getU8Decoder18()],
1956
2077
  ["transferData", getTransferDataDecoder()]
1957
2078
  ]);
1958
2079
  }
1959
2080
  function getTransferSubscriptionInstructionDataCodec() {
1960
- return combineCodec28(
2081
+ return combineCodec29(
1961
2082
  getTransferSubscriptionInstructionDataEncoder(),
1962
2083
  getTransferSubscriptionInstructionDataDecoder()
1963
2084
  );
@@ -1983,7 +2104,7 @@ function getTransferSubscriptionInstruction(input, config) {
1983
2104
  if (!accounts.selfProgram.value) {
1984
2105
  accounts.selfProgram.value = "De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44";
1985
2106
  }
1986
- const getAccountMeta = getAccountMetaFactory12(programAddress, "programId");
2107
+ const getAccountMeta = getAccountMetaFactory13(programAddress, "programId");
1987
2108
  return Object.freeze({
1988
2109
  accounts: [
1989
2110
  getAccountMeta("subscriptionPda", accounts.subscriptionPda),
@@ -2002,7 +2123,7 @@ function getTransferSubscriptionInstruction(input, config) {
2002
2123
  }
2003
2124
  function parseTransferSubscriptionInstruction(instruction) {
2004
2125
  if (instruction.accounts.length < 9) {
2005
- throw new SolanaError12(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS12, {
2126
+ throw new SolanaError13(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS13, {
2006
2127
  actualAccountMetas: instruction.accounts.length,
2007
2128
  expectedAccountMetas: 9
2008
2129
  });
@@ -2032,37 +2153,37 @@ function parseTransferSubscriptionInstruction(instruction) {
2032
2153
 
2033
2154
  // src/generated/instructions/updatePlan.ts
2034
2155
  import {
2035
- combineCodec as combineCodec29,
2036
- getStructDecoder as getStructDecoder27,
2037
- getStructEncoder as getStructEncoder27,
2038
- getU8Decoder as getU8Decoder18,
2039
- getU8Encoder as getU8Encoder18,
2040
- SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS13,
2041
- SolanaError as SolanaError13,
2042
- transformEncoder as transformEncoder13
2156
+ combineCodec as combineCodec30,
2157
+ getStructDecoder as getStructDecoder28,
2158
+ getStructEncoder as getStructEncoder28,
2159
+ getU8Decoder as getU8Decoder19,
2160
+ getU8Encoder as getU8Encoder19,
2161
+ SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS14,
2162
+ SolanaError as SolanaError14,
2163
+ transformEncoder as transformEncoder14
2043
2164
  } from "@solana/kit";
2044
- import { getAccountMetaFactory as getAccountMetaFactory13 } from "@solana/program-client-core";
2165
+ import { getAccountMetaFactory as getAccountMetaFactory14 } from "@solana/program-client-core";
2045
2166
  var UPDATE_PLAN_DISCRIMINATOR = 8;
2046
2167
  function getUpdatePlanDiscriminatorBytes() {
2047
- return getU8Encoder18().encode(UPDATE_PLAN_DISCRIMINATOR);
2168
+ return getU8Encoder19().encode(UPDATE_PLAN_DISCRIMINATOR);
2048
2169
  }
2049
2170
  function getUpdatePlanInstructionDataEncoder() {
2050
- return transformEncoder13(
2051
- getStructEncoder27([
2052
- ["discriminator", getU8Encoder18()],
2171
+ return transformEncoder14(
2172
+ getStructEncoder28([
2173
+ ["discriminator", getU8Encoder19()],
2053
2174
  ["updatePlanData", getUpdatePlanDataEncoder()]
2054
2175
  ]),
2055
2176
  (value) => ({ ...value, discriminator: UPDATE_PLAN_DISCRIMINATOR })
2056
2177
  );
2057
2178
  }
2058
2179
  function getUpdatePlanInstructionDataDecoder() {
2059
- return getStructDecoder27([
2060
- ["discriminator", getU8Decoder18()],
2180
+ return getStructDecoder28([
2181
+ ["discriminator", getU8Decoder19()],
2061
2182
  ["updatePlanData", getUpdatePlanDataDecoder()]
2062
2183
  ]);
2063
2184
  }
2064
2185
  function getUpdatePlanInstructionDataCodec() {
2065
- return combineCodec29(getUpdatePlanInstructionDataEncoder(), getUpdatePlanInstructionDataDecoder());
2186
+ return combineCodec30(getUpdatePlanInstructionDataEncoder(), getUpdatePlanInstructionDataDecoder());
2066
2187
  }
2067
2188
  function getUpdatePlanInstruction(input, config) {
2068
2189
  const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;
@@ -2072,7 +2193,7 @@ function getUpdatePlanInstruction(input, config) {
2072
2193
  };
2073
2194
  const accounts = originalAccounts;
2074
2195
  const args = { ...input };
2075
- const getAccountMeta = getAccountMetaFactory13(programAddress, "programId");
2196
+ const getAccountMeta = getAccountMetaFactory14(programAddress, "programId");
2076
2197
  return Object.freeze({
2077
2198
  accounts: [getAccountMeta("owner", accounts.owner), getAccountMeta("planPda", accounts.planPda)],
2078
2199
  data: getUpdatePlanInstructionDataEncoder().encode(args),
@@ -2081,7 +2202,7 @@ function getUpdatePlanInstruction(input, config) {
2081
2202
  }
2082
2203
  function parseUpdatePlanInstruction(instruction) {
2083
2204
  if (instruction.accounts.length < 2) {
2084
- throw new SolanaError13(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS13, {
2205
+ throw new SolanaError14(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS14, {
2085
2206
  actualAccountMetas: instruction.accounts.length,
2086
2207
  expectedAccountMetas: 2
2087
2208
  });
@@ -2124,50 +2245,54 @@ var SubscriptionsInstruction = /* @__PURE__ */ ((SubscriptionsInstruction2) => {
2124
2245
  SubscriptionsInstruction2[SubscriptionsInstruction2["TransferSubscription"] = 10] = "TransferSubscription";
2125
2246
  SubscriptionsInstruction2[SubscriptionsInstruction2["Subscribe"] = 11] = "Subscribe";
2126
2247
  SubscriptionsInstruction2[SubscriptionsInstruction2["CancelSubscription"] = 12] = "CancelSubscription";
2248
+ SubscriptionsInstruction2[SubscriptionsInstruction2["ResumeSubscription"] = 13] = "ResumeSubscription";
2127
2249
  return SubscriptionsInstruction2;
2128
2250
  })(SubscriptionsInstruction || {});
2129
2251
  function identifySubscriptionsInstruction(instruction) {
2130
2252
  const data = "data" in instruction ? instruction.data : instruction;
2131
- if (containsBytes(data, getU8Encoder19().encode(0), 0)) {
2253
+ if (containsBytes(data, getU8Encoder20().encode(0), 0)) {
2132
2254
  return 0 /* InitSubscriptionAuthority */;
2133
2255
  }
2134
- if (containsBytes(data, getU8Encoder19().encode(1), 0)) {
2256
+ if (containsBytes(data, getU8Encoder20().encode(1), 0)) {
2135
2257
  return 1 /* CreateFixedDelegation */;
2136
2258
  }
2137
- if (containsBytes(data, getU8Encoder19().encode(2), 0)) {
2259
+ if (containsBytes(data, getU8Encoder20().encode(2), 0)) {
2138
2260
  return 2 /* CreateRecurringDelegation */;
2139
2261
  }
2140
- if (containsBytes(data, getU8Encoder19().encode(3), 0)) {
2262
+ if (containsBytes(data, getU8Encoder20().encode(3), 0)) {
2141
2263
  return 3 /* RevokeDelegation */;
2142
2264
  }
2143
- if (containsBytes(data, getU8Encoder19().encode(4), 0)) {
2265
+ if (containsBytes(data, getU8Encoder20().encode(4), 0)) {
2144
2266
  return 4 /* TransferFixed */;
2145
2267
  }
2146
- if (containsBytes(data, getU8Encoder19().encode(5), 0)) {
2268
+ if (containsBytes(data, getU8Encoder20().encode(5), 0)) {
2147
2269
  return 5 /* TransferRecurring */;
2148
2270
  }
2149
- if (containsBytes(data, getU8Encoder19().encode(6), 0)) {
2271
+ if (containsBytes(data, getU8Encoder20().encode(6), 0)) {
2150
2272
  return 6 /* CloseSubscriptionAuthority */;
2151
2273
  }
2152
- if (containsBytes(data, getU8Encoder19().encode(7), 0)) {
2274
+ if (containsBytes(data, getU8Encoder20().encode(7), 0)) {
2153
2275
  return 7 /* CreatePlan */;
2154
2276
  }
2155
- if (containsBytes(data, getU8Encoder19().encode(8), 0)) {
2277
+ if (containsBytes(data, getU8Encoder20().encode(8), 0)) {
2156
2278
  return 8 /* UpdatePlan */;
2157
2279
  }
2158
- if (containsBytes(data, getU8Encoder19().encode(9), 0)) {
2280
+ if (containsBytes(data, getU8Encoder20().encode(9), 0)) {
2159
2281
  return 9 /* DeletePlan */;
2160
2282
  }
2161
- if (containsBytes(data, getU8Encoder19().encode(10), 0)) {
2283
+ if (containsBytes(data, getU8Encoder20().encode(10), 0)) {
2162
2284
  return 10 /* TransferSubscription */;
2163
2285
  }
2164
- if (containsBytes(data, getU8Encoder19().encode(11), 0)) {
2286
+ if (containsBytes(data, getU8Encoder20().encode(11), 0)) {
2165
2287
  return 11 /* Subscribe */;
2166
2288
  }
2167
- if (containsBytes(data, getU8Encoder19().encode(12), 0)) {
2289
+ if (containsBytes(data, getU8Encoder20().encode(12), 0)) {
2168
2290
  return 12 /* CancelSubscription */;
2169
2291
  }
2170
- throw new SolanaError14(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {
2292
+ if (containsBytes(data, getU8Encoder20().encode(13), 0)) {
2293
+ return 13 /* ResumeSubscription */;
2294
+ }
2295
+ throw new SolanaError15(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {
2171
2296
  instructionData: data,
2172
2297
  programName: "subscriptions"
2173
2298
  });
@@ -2254,8 +2379,15 @@ function parseSubscriptionsInstruction(instruction) {
2254
2379
  ...parseCancelSubscriptionInstruction(instruction)
2255
2380
  };
2256
2381
  }
2382
+ case 13 /* ResumeSubscription */: {
2383
+ assertIsInstructionWithAccounts(instruction);
2384
+ return {
2385
+ instructionType: 13 /* ResumeSubscription */,
2386
+ ...parseResumeSubscriptionInstruction(instruction)
2387
+ };
2388
+ }
2257
2389
  default:
2258
- throw new SolanaError14(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
2390
+ throw new SolanaError15(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
2259
2391
  instructionType,
2260
2392
  programName: "subscriptions"
2261
2393
  });
@@ -2286,7 +2418,8 @@ function subscriptionsProgram() {
2286
2418
  deletePlan: (input) => addSelfPlanAndSendFunctions(client, getDeletePlanInstruction(input)),
2287
2419
  transferSubscription: (input) => addSelfPlanAndSendFunctions(client, getTransferSubscriptionInstruction(input)),
2288
2420
  subscribe: (input) => addSelfPlanAndSendFunctions(client, getSubscribeInstructionAsync(input)),
2289
- cancelSubscription: (input) => addSelfPlanAndSendFunctions(client, getCancelSubscriptionInstructionAsync(input))
2421
+ cancelSubscription: (input) => addSelfPlanAndSendFunctions(client, getCancelSubscriptionInstructionAsync(input)),
2422
+ resumeSubscription: (input) => addSelfPlanAndSendFunctions(client, getResumeSubscriptionInstructionAsync(input))
2290
2423
  },
2291
2424
  pdas: {
2292
2425
  fixedDelegation: findFixedDelegationPda,
@@ -2444,7 +2577,7 @@ if (process.env["NODE_ENV"] !== "production") {
2444
2577
  [SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY]: `Delegation init_id does not match current SubscriptionAuthority`,
2445
2578
  [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_ALREADY_CANCELLED]: `Subscription already cancelled`,
2446
2579
  [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_CANCELLED]: `Subscription cancelled and past valid period`,
2447
- [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_NOT_CANCELLED]: `Subscription must be cancelled before revoke`,
2580
+ [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_NOT_CANCELLED]: `Subscription is not cancelled`,
2448
2581
  [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_PLAN_MISMATCH]: `Subscription does not belong to this plan`,
2449
2582
  [SUBSCRIPTIONS_ERROR__SUNSET_REQUIRES_END_TS]: `Sunset requires a non-zero end timestamp`,
2450
2583
  [SUBSCRIPTIONS_ERROR__UNAUTHORIZED]: `Caller not authorized for this action`,
@@ -2941,6 +3074,16 @@ function getCancelSubscriptionOverlayInstructionAsync(input) {
2941
3074
  pdaConfig(input.programAddress)
2942
3075
  );
2943
3076
  }
3077
+ function getResumeSubscriptionOverlayInstructionAsync(input) {
3078
+ return getResumeSubscriptionInstructionAsync(
3079
+ {
3080
+ planPda: input.planPda,
3081
+ subscriber: input.subscriber,
3082
+ subscriptionPda: input.subscriptionPda
3083
+ },
3084
+ pdaConfig(input.programAddress)
3085
+ );
3086
+ }
2944
3087
  function subscriptionsProgram2() {
2945
3088
  return (client) => {
2946
3089
  return pipe(client, subscriptionsProgram(), (c) => {
@@ -3019,6 +3162,13 @@ function subscriptionsProgram2() {
3019
3162
  payer: input.payer ?? (client.payer === client.identity ? void 0 : client.payer)
3020
3163
  })
3021
3164
  ),
3165
+ resumeSubscription: (input) => addSelfPlanAndSendFunctions2(
3166
+ client,
3167
+ getResumeSubscriptionOverlayInstructionAsync({
3168
+ ...input,
3169
+ subscriber: input.subscriber ?? client.identity
3170
+ })
3171
+ ),
3022
3172
  revokeDelegation: (input) => addSelfPlanAndSendFunctions2(
3023
3173
  client,
3024
3174
  getRevokeDelegationOverlayInstruction({
@@ -3129,6 +3279,7 @@ export {
3129
3279
  PLAN_SIZE,
3130
3280
  PROGRAM_ID,
3131
3281
  PlanStatus,
3282
+ RESUME_SUBSCRIPTION_DISCRIMINATOR,
3132
3283
  REVOKE_DELEGATION_DISCRIMINATOR,
3133
3284
  SUBSCRIBE_DISCRIMINATOR,
3134
3285
  SUBSCRIPTIONS_ERROR__ACCOUNT_NOT_WRITABLE,
@@ -3346,6 +3497,13 @@ export {
3346
3497
  getRecurringDelegationCodec,
3347
3498
  getRecurringDelegationDecoder,
3348
3499
  getRecurringDelegationEncoder,
3500
+ getResumeSubscriptionDiscriminatorBytes,
3501
+ getResumeSubscriptionInstruction,
3502
+ getResumeSubscriptionInstructionAsync,
3503
+ getResumeSubscriptionInstructionDataCodec,
3504
+ getResumeSubscriptionInstructionDataDecoder,
3505
+ getResumeSubscriptionInstructionDataEncoder,
3506
+ getResumeSubscriptionOverlayInstructionAsync,
3349
3507
  getRevokeDelegationDiscriminatorBytes,
3350
3508
  getRevokeDelegationInstruction,
3351
3509
  getRevokeDelegationInstructionDataCodec,
@@ -3409,6 +3567,7 @@ export {
3409
3567
  parseCreateRecurringDelegationInstruction,
3410
3568
  parseDeletePlanInstruction,
3411
3569
  parseInitSubscriptionAuthorityInstruction,
3570
+ parseResumeSubscriptionInstruction,
3412
3571
  parseRevokeDelegationInstruction,
3413
3572
  parseSubscribeInstruction,
3414
3573
  parseSubscriptionsInstruction,