@streamflow/staking 11.0.4 → 11.1.0-alpha.p335.b571df3

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.
@@ -1,6 +1,6 @@
1
1
  import { IdlAccounts, Address, Program, ProgramAccount, Idl, AccountsCoder } from '@coral-xyz/anchor';
2
2
  import { PublicKey, Keypair, Connection, Commitment, ConnectionConfig, TransactionInstruction } from '@solana/web3.js';
3
- import { ICluster, ITransactionExt, ITransactionResult } from '@streamflow/common';
3
+ import { ICluster, ITransactionExt, ITransactionResult, IPrepareResult } from '@streamflow/common';
4
4
  import PQueue from 'p-queue';
5
5
  import BN from 'bn.js';
6
6
  import { FeeManager } from './solana/descriptor/fee_manager.js';
@@ -29,7 +29,9 @@ declare const REWARD_VAULT_PREFIX: Buffer;
29
29
  declare const REWARD_ENTRY_PREFIX: Buffer;
30
30
  declare const CONFIG_PREFIX: Buffer;
31
31
  declare const FEE_VALUE_PREFIX: Buffer;
32
+ declare const FUND_DELEGATE_PREFIX: Buffer;
32
33
  declare const STREAMFLOW_TREASURY_PUBLIC_KEY: PublicKey;
34
+ declare const WORKER_PUBLIC_KEY: PublicKey;
33
35
  declare const ANCHOR_DISCRIMINATOR_OFFSET = 8;
34
36
  declare const STAKE_ENTRY_STAKE_POOL_OFFSET: number;
35
37
  declare const STAKE_ENTRY_PAYER_OFFSET: number;
@@ -70,6 +72,7 @@ declare const constants_FEE_PRECISION_FACTOR: typeof FEE_PRECISION_FACTOR;
70
72
  declare const constants_FEE_PRECISION_FACTOR_BN: typeof FEE_PRECISION_FACTOR_BN;
71
73
  declare const constants_FEE_PROGRAM_ID: typeof FEE_PROGRAM_ID;
72
74
  declare const constants_FEE_VALUE_PREFIX: typeof FEE_VALUE_PREFIX;
75
+ declare const constants_FUND_DELEGATE_PREFIX: typeof FUND_DELEGATE_PREFIX;
73
76
  declare const constants_REWARD_AMOUNT_DECIMALS: typeof REWARD_AMOUNT_DECIMALS;
74
77
  declare const constants_REWARD_AMOUNT_PRECISION_FACTOR: typeof REWARD_AMOUNT_PRECISION_FACTOR;
75
78
  declare const constants_REWARD_AMOUNT_PRECISION_FACTOR_BN: typeof REWARD_AMOUNT_PRECISION_FACTOR_BN;
@@ -101,8 +104,9 @@ declare const constants_STAKE_POOL_PROGRAM_ID: typeof STAKE_POOL_PROGRAM_ID;
101
104
  declare const constants_STAKE_VAULT_PREFIX: typeof STAKE_VAULT_PREFIX;
102
105
  declare const constants_STREAMFLOW_TREASURY_PUBLIC_KEY: typeof STREAMFLOW_TREASURY_PUBLIC_KEY;
103
106
  declare const constants_U64_MAX: typeof U64_MAX;
107
+ declare const constants_WORKER_PUBLIC_KEY: typeof WORKER_PUBLIC_KEY;
104
108
  declare namespace constants {
105
- export { constants_ANCHOR_DISCRIMINATOR_OFFSET as ANCHOR_DISCRIMINATOR_OFFSET, constants_CONFIG_PREFIX as CONFIG_PREFIX, constants_DEFAULT_FEE as DEFAULT_FEE, constants_DEFAULT_FEE_BN as DEFAULT_FEE_BN, constants_FEE_PRECISION_FACTOR as FEE_PRECISION_FACTOR, constants_FEE_PRECISION_FACTOR_BN as FEE_PRECISION_FACTOR_BN, constants_FEE_PROGRAM_ID as FEE_PROGRAM_ID, constants_FEE_VALUE_PREFIX as FEE_VALUE_PREFIX, constants_REWARD_AMOUNT_DECIMALS as REWARD_AMOUNT_DECIMALS, constants_REWARD_AMOUNT_PRECISION_FACTOR as REWARD_AMOUNT_PRECISION_FACTOR, constants_REWARD_AMOUNT_PRECISION_FACTOR_BN as REWARD_AMOUNT_PRECISION_FACTOR_BN, constants_REWARD_ENTRY_BYTE_OFFSETS as REWARD_ENTRY_BYTE_OFFSETS, constants_REWARD_ENTRY_PREFIX as REWARD_ENTRY_PREFIX, constants_REWARD_ENTRY_REWARD_POOL_OFFSET as REWARD_ENTRY_REWARD_POOL_OFFSET, constants_REWARD_ENTRY_STAKE_ENTRY_OFFSET as REWARD_ENTRY_STAKE_ENTRY_OFFSET, constants_REWARD_POOL_BYTE_OFFSETS as REWARD_POOL_BYTE_OFFSETS, constants_REWARD_POOL_DYNAMIC_PROGRAM_ID as REWARD_POOL_DYNAMIC_PROGRAM_ID, constants_REWARD_POOL_MINT_OFFSET as REWARD_POOL_MINT_OFFSET, constants_REWARD_POOL_PREFIX as REWARD_POOL_PREFIX, constants_REWARD_POOL_PROGRAM_ID as REWARD_POOL_PROGRAM_ID, constants_REWARD_POOL_STAKE_POOL_OFFSET as REWARD_POOL_STAKE_POOL_OFFSET, constants_REWARD_VAULT_PREFIX as REWARD_VAULT_PREFIX, constants_SCALE_PRECISION_FACTOR as SCALE_PRECISION_FACTOR, constants_SCALE_PRECISION_FACTOR_BN as SCALE_PRECISION_FACTOR_BN, constants_STAKE_ENTRY_BYTE_OFFSETS as STAKE_ENTRY_BYTE_OFFSETS, constants_STAKE_ENTRY_DISCRIMINATOR as STAKE_ENTRY_DISCRIMINATOR, constants_STAKE_ENTRY_OWNER_OFFSET as STAKE_ENTRY_OWNER_OFFSET, constants_STAKE_ENTRY_PAYER_OFFSET as STAKE_ENTRY_PAYER_OFFSET, constants_STAKE_ENTRY_PREFIX as STAKE_ENTRY_PREFIX, constants_STAKE_ENTRY_STAKE_POOL_OFFSET as STAKE_ENTRY_STAKE_POOL_OFFSET, constants_STAKE_MINT_PREFIX as STAKE_MINT_PREFIX, constants_STAKE_POOL_BYTE_OFFSETS as STAKE_POOL_BYTE_OFFSETS, constants_STAKE_POOL_CREATOR_OFFSET as STAKE_POOL_CREATOR_OFFSET, constants_STAKE_POOL_MINT_OFFSET as STAKE_POOL_MINT_OFFSET, constants_STAKE_POOL_PREFIX as STAKE_POOL_PREFIX, constants_STAKE_POOL_PROGRAM_ID as STAKE_POOL_PROGRAM_ID, constants_STAKE_VAULT_PREFIX as STAKE_VAULT_PREFIX, constants_STREAMFLOW_TREASURY_PUBLIC_KEY as STREAMFLOW_TREASURY_PUBLIC_KEY, constants_U64_MAX as U64_MAX };
109
+ export { constants_ANCHOR_DISCRIMINATOR_OFFSET as ANCHOR_DISCRIMINATOR_OFFSET, constants_CONFIG_PREFIX as CONFIG_PREFIX, constants_DEFAULT_FEE as DEFAULT_FEE, constants_DEFAULT_FEE_BN as DEFAULT_FEE_BN, constants_FEE_PRECISION_FACTOR as FEE_PRECISION_FACTOR, constants_FEE_PRECISION_FACTOR_BN as FEE_PRECISION_FACTOR_BN, constants_FEE_PROGRAM_ID as FEE_PROGRAM_ID, constants_FEE_VALUE_PREFIX as FEE_VALUE_PREFIX, constants_FUND_DELEGATE_PREFIX as FUND_DELEGATE_PREFIX, constants_REWARD_AMOUNT_DECIMALS as REWARD_AMOUNT_DECIMALS, constants_REWARD_AMOUNT_PRECISION_FACTOR as REWARD_AMOUNT_PRECISION_FACTOR, constants_REWARD_AMOUNT_PRECISION_FACTOR_BN as REWARD_AMOUNT_PRECISION_FACTOR_BN, constants_REWARD_ENTRY_BYTE_OFFSETS as REWARD_ENTRY_BYTE_OFFSETS, constants_REWARD_ENTRY_PREFIX as REWARD_ENTRY_PREFIX, constants_REWARD_ENTRY_REWARD_POOL_OFFSET as REWARD_ENTRY_REWARD_POOL_OFFSET, constants_REWARD_ENTRY_STAKE_ENTRY_OFFSET as REWARD_ENTRY_STAKE_ENTRY_OFFSET, constants_REWARD_POOL_BYTE_OFFSETS as REWARD_POOL_BYTE_OFFSETS, constants_REWARD_POOL_DYNAMIC_PROGRAM_ID as REWARD_POOL_DYNAMIC_PROGRAM_ID, constants_REWARD_POOL_MINT_OFFSET as REWARD_POOL_MINT_OFFSET, constants_REWARD_POOL_PREFIX as REWARD_POOL_PREFIX, constants_REWARD_POOL_PROGRAM_ID as REWARD_POOL_PROGRAM_ID, constants_REWARD_POOL_STAKE_POOL_OFFSET as REWARD_POOL_STAKE_POOL_OFFSET, constants_REWARD_VAULT_PREFIX as REWARD_VAULT_PREFIX, constants_SCALE_PRECISION_FACTOR as SCALE_PRECISION_FACTOR, constants_SCALE_PRECISION_FACTOR_BN as SCALE_PRECISION_FACTOR_BN, constants_STAKE_ENTRY_BYTE_OFFSETS as STAKE_ENTRY_BYTE_OFFSETS, constants_STAKE_ENTRY_DISCRIMINATOR as STAKE_ENTRY_DISCRIMINATOR, constants_STAKE_ENTRY_OWNER_OFFSET as STAKE_ENTRY_OWNER_OFFSET, constants_STAKE_ENTRY_PAYER_OFFSET as STAKE_ENTRY_PAYER_OFFSET, constants_STAKE_ENTRY_PREFIX as STAKE_ENTRY_PREFIX, constants_STAKE_ENTRY_STAKE_POOL_OFFSET as STAKE_ENTRY_STAKE_POOL_OFFSET, constants_STAKE_MINT_PREFIX as STAKE_MINT_PREFIX, constants_STAKE_POOL_BYTE_OFFSETS as STAKE_POOL_BYTE_OFFSETS, constants_STAKE_POOL_CREATOR_OFFSET as STAKE_POOL_CREATOR_OFFSET, constants_STAKE_POOL_MINT_OFFSET as STAKE_POOL_MINT_OFFSET, constants_STAKE_POOL_PREFIX as STAKE_POOL_PREFIX, constants_STAKE_POOL_PROGRAM_ID as STAKE_POOL_PROGRAM_ID, constants_STAKE_VAULT_PREFIX as STAKE_VAULT_PREFIX, constants_STREAMFLOW_TREASURY_PUBLIC_KEY as STREAMFLOW_TREASURY_PUBLIC_KEY, constants_U64_MAX as U64_MAX, constants_WORKER_PUBLIC_KEY as WORKER_PUBLIC_KEY };
106
110
  }
107
111
 
108
112
  /**
@@ -1054,7 +1058,7 @@ type RewardPoolDynamic = {
1054
1058
  "address": "RWRDyfZa6Rk9UYi85yjYYfGmoUqffLqjo6vZdFawEez";
1055
1059
  "metadata": {
1056
1060
  "name": "rewardPoolDynamic";
1057
- "version": "2.4.0";
1061
+ "version": "2.6.0";
1058
1062
  "spec": "0.1.0";
1059
1063
  "description": "Reward pools with dynamic rewards distribution";
1060
1064
  };
@@ -1511,6 +1515,173 @@ type RewardPoolDynamic = {
1511
1515
  ];
1512
1516
  "args": [];
1513
1517
  },
1518
+ {
1519
+ "name": "createFundDelegate";
1520
+ "discriminator": [
1521
+ 131,
1522
+ 15,
1523
+ 250,
1524
+ 148,
1525
+ 39,
1526
+ 103,
1527
+ 14,
1528
+ 232
1529
+ ];
1530
+ "accounts": [
1531
+ {
1532
+ "name": "rewardPool";
1533
+ "docs": [
1534
+ "Reward Pool"
1535
+ ];
1536
+ },
1537
+ {
1538
+ "name": "mint";
1539
+ "docs": [
1540
+ "Mint of reward tokens"
1541
+ ];
1542
+ "relations": [
1543
+ "rewardPool"
1544
+ ];
1545
+ },
1546
+ {
1547
+ "name": "fundDelegate";
1548
+ "docs": [
1549
+ "Fund Delegate account that stores fund configuration"
1550
+ ];
1551
+ "writable": true;
1552
+ "pda": {
1553
+ "seeds": [
1554
+ {
1555
+ "kind": "const";
1556
+ "value": [
1557
+ 102,
1558
+ 117,
1559
+ 110,
1560
+ 100,
1561
+ 45,
1562
+ 100,
1563
+ 101,
1564
+ 108,
1565
+ 101,
1566
+ 103,
1567
+ 97,
1568
+ 116,
1569
+ 101
1570
+ ];
1571
+ },
1572
+ {
1573
+ "kind": "account";
1574
+ "path": "rewardPool";
1575
+ }
1576
+ ];
1577
+ };
1578
+ },
1579
+ {
1580
+ "name": "tokenAccount";
1581
+ "docs": [
1582
+ "Token account that stores tokens for funding, should be topped up prior to funding"
1583
+ ];
1584
+ "writable": true;
1585
+ "pda": {
1586
+ "seeds": [
1587
+ {
1588
+ "kind": "account";
1589
+ "path": "fundDelegate";
1590
+ },
1591
+ {
1592
+ "kind": "account";
1593
+ "path": "tokenProgram";
1594
+ },
1595
+ {
1596
+ "kind": "account";
1597
+ "path": "mint";
1598
+ }
1599
+ ];
1600
+ "program": {
1601
+ "kind": "const";
1602
+ "value": [
1603
+ 140,
1604
+ 151,
1605
+ 37,
1606
+ 143,
1607
+ 78,
1608
+ 36,
1609
+ 137,
1610
+ 241,
1611
+ 187,
1612
+ 61,
1613
+ 16,
1614
+ 41,
1615
+ 20,
1616
+ 142,
1617
+ 13,
1618
+ 131,
1619
+ 11,
1620
+ 90,
1621
+ 19,
1622
+ 153,
1623
+ 218,
1624
+ 255,
1625
+ 16,
1626
+ 132,
1627
+ 4,
1628
+ 142,
1629
+ 123,
1630
+ 216,
1631
+ 219,
1632
+ 233,
1633
+ 248,
1634
+ 89
1635
+ ];
1636
+ };
1637
+ };
1638
+ },
1639
+ {
1640
+ "name": "authority";
1641
+ "docs": [
1642
+ "Reward Pool authority"
1643
+ ];
1644
+ "writable": true;
1645
+ "signer": true;
1646
+ "relations": [
1647
+ "rewardPool"
1648
+ ];
1649
+ },
1650
+ {
1651
+ "name": "worker";
1652
+ "writable": true;
1653
+ "address": "wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u";
1654
+ },
1655
+ {
1656
+ "name": "associatedTokenProgram";
1657
+ "docs": [
1658
+ "The [Associated Token] program."
1659
+ ];
1660
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
1661
+ },
1662
+ {
1663
+ "name": "tokenProgram";
1664
+ },
1665
+ {
1666
+ "name": "systemProgram";
1667
+ "address": "11111111111111111111111111111111";
1668
+ }
1669
+ ];
1670
+ "args": [
1671
+ {
1672
+ "name": "startTs";
1673
+ "type": "u64";
1674
+ },
1675
+ {
1676
+ "name": "period";
1677
+ "type": "u64";
1678
+ },
1679
+ {
1680
+ "name": "expiryTs";
1681
+ "type": "u64";
1682
+ }
1683
+ ];
1684
+ },
1514
1685
  {
1515
1686
  "name": "createPool";
1516
1687
  "discriminator": [
@@ -1539,115 +1710,398 @@ type RewardPoolDynamic = {
1539
1710
  "pda": {
1540
1711
  "seeds": [
1541
1712
  {
1542
- "kind": "const";
1543
- "value": [
1544
- 114,
1545
- 101,
1546
- 119,
1547
- 97,
1548
- 114,
1549
- 100,
1550
- 45,
1551
- 112,
1552
- 111,
1553
- 111,
1554
- 108
1555
- ];
1713
+ "kind": "const";
1714
+ "value": [
1715
+ 114,
1716
+ 101,
1717
+ 119,
1718
+ 97,
1719
+ 114,
1720
+ 100,
1721
+ 45,
1722
+ 112,
1723
+ 111,
1724
+ 111,
1725
+ 108
1726
+ ];
1727
+ },
1728
+ {
1729
+ "kind": "account";
1730
+ "path": "stakePool";
1731
+ },
1732
+ {
1733
+ "kind": "account";
1734
+ "path": "mint";
1735
+ },
1736
+ {
1737
+ "kind": "arg";
1738
+ "path": "nonce";
1739
+ }
1740
+ ];
1741
+ };
1742
+ },
1743
+ {
1744
+ "name": "mint";
1745
+ "docs": [
1746
+ "Mint used for rewards"
1747
+ ];
1748
+ },
1749
+ {
1750
+ "name": "vault";
1751
+ "docs": [
1752
+ "Escrow Account that will store the tokens"
1753
+ ];
1754
+ "writable": true;
1755
+ "pda": {
1756
+ "seeds": [
1757
+ {
1758
+ "kind": "const";
1759
+ "value": [
1760
+ 114,
1761
+ 101,
1762
+ 119,
1763
+ 97,
1764
+ 114,
1765
+ 100,
1766
+ 45,
1767
+ 118,
1768
+ 97,
1769
+ 117,
1770
+ 108,
1771
+ 116
1772
+ ];
1773
+ },
1774
+ {
1775
+ "kind": "account";
1776
+ "path": "rewardPool";
1777
+ }
1778
+ ];
1779
+ };
1780
+ },
1781
+ {
1782
+ "name": "governor";
1783
+ "docs": [
1784
+ "Governor to be set for the RewardPool"
1785
+ ];
1786
+ "optional": true;
1787
+ },
1788
+ {
1789
+ "name": "creator";
1790
+ "docs": [
1791
+ "Reward Pool creator"
1792
+ ];
1793
+ "writable": true;
1794
+ "signer": true;
1795
+ },
1796
+ {
1797
+ "name": "tokenProgram";
1798
+ },
1799
+ {
1800
+ "name": "systemProgram";
1801
+ "address": "11111111111111111111111111111111";
1802
+ }
1803
+ ];
1804
+ "args": [
1805
+ {
1806
+ "name": "nonce";
1807
+ "type": "u8";
1808
+ },
1809
+ {
1810
+ "name": "permissionless";
1811
+ "type": "bool";
1812
+ },
1813
+ {
1814
+ "name": "claimPeriod";
1815
+ "type": "u64";
1816
+ },
1817
+ {
1818
+ "name": "claimStartTs";
1819
+ "type": "u64";
1820
+ }
1821
+ ];
1822
+ },
1823
+ {
1824
+ "name": "fundAsDelegate";
1825
+ "discriminator": [
1826
+ 165,
1827
+ 90,
1828
+ 78,
1829
+ 137,
1830
+ 23,
1831
+ 155,
1832
+ 220,
1833
+ 116
1834
+ ];
1835
+ "accounts": [
1836
+ {
1837
+ "name": "caller";
1838
+ "docs": [
1839
+ "Worker initiated the transaction"
1840
+ ];
1841
+ "writable": true;
1842
+ "signer": true;
1843
+ },
1844
+ {
1845
+ "name": "authority";
1846
+ "writable": true;
1847
+ "relations": [
1848
+ "rewardPool"
1849
+ ];
1850
+ },
1851
+ {
1852
+ "name": "from";
1853
+ "docs": [
1854
+ "Token Account from which tokens will be transferred"
1855
+ ];
1856
+ "writable": true;
1857
+ "pda": {
1858
+ "seeds": [
1859
+ {
1860
+ "kind": "account";
1861
+ "path": "fundDelegate";
1862
+ },
1863
+ {
1864
+ "kind": "account";
1865
+ "path": "tokenProgram";
1866
+ },
1867
+ {
1868
+ "kind": "account";
1869
+ "path": "mint";
1870
+ }
1871
+ ];
1872
+ "program": {
1873
+ "kind": "const";
1874
+ "value": [
1875
+ 140,
1876
+ 151,
1877
+ 37,
1878
+ 143,
1879
+ 78,
1880
+ 36,
1881
+ 137,
1882
+ 241,
1883
+ 187,
1884
+ 61,
1885
+ 16,
1886
+ 41,
1887
+ 20,
1888
+ 142,
1889
+ 13,
1890
+ 131,
1891
+ 11,
1892
+ 90,
1893
+ 19,
1894
+ 153,
1895
+ 218,
1896
+ 255,
1897
+ 16,
1898
+ 132,
1899
+ 4,
1900
+ 142,
1901
+ 123,
1902
+ 216,
1903
+ 219,
1904
+ 233,
1905
+ 248,
1906
+ 89
1907
+ ];
1908
+ };
1909
+ };
1910
+ },
1911
+ {
1912
+ "name": "vault";
1913
+ "docs": [
1914
+ "Reward Pool Vault that stores tokens"
1915
+ ];
1916
+ "writable": true;
1917
+ "relations": [
1918
+ "rewardPool"
1919
+ ];
1920
+ },
1921
+ {
1922
+ "name": "mint";
1923
+ "docs": [
1924
+ "Mint of reward tokens"
1925
+ ];
1926
+ "relations": [
1927
+ "rewardPool"
1928
+ ];
1929
+ },
1930
+ {
1931
+ "name": "stakePool";
1932
+ "docs": [
1933
+ "Original Stake Pool"
1934
+ ];
1935
+ "relations": [
1936
+ "rewardPool"
1937
+ ];
1938
+ },
1939
+ {
1940
+ "name": "rewardPool";
1941
+ "docs": [
1942
+ "Reward Pool"
1943
+ ];
1944
+ "writable": true;
1945
+ },
1946
+ {
1947
+ "name": "fundDelegate";
1948
+ "docs": [
1949
+ "Fund Delegate account that stores fund configuration"
1950
+ ];
1951
+ "writable": true;
1952
+ "pda": {
1953
+ "seeds": [
1954
+ {
1955
+ "kind": "const";
1956
+ "value": [
1957
+ 102,
1958
+ 117,
1959
+ 110,
1960
+ 100,
1961
+ 45,
1962
+ 100,
1963
+ 101,
1964
+ 108,
1965
+ 101,
1966
+ 103,
1967
+ 97,
1968
+ 116,
1969
+ 101
1970
+ ];
1971
+ },
1972
+ {
1973
+ "kind": "account";
1974
+ "path": "rewardPool";
1975
+ }
1976
+ ];
1977
+ };
1978
+ },
1979
+ {
1980
+ "name": "streamflowTreasury";
1981
+ "writable": true;
1982
+ "address": "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw";
1983
+ },
1984
+ {
1985
+ "name": "streamflowTreasuryTokens";
1986
+ "writable": true;
1987
+ "pda": {
1988
+ "seeds": [
1989
+ {
1990
+ "kind": "account";
1991
+ "path": "streamflowTreasury";
1556
1992
  },
1557
1993
  {
1558
1994
  "kind": "account";
1559
- "path": "stakePool";
1995
+ "path": "tokenProgram";
1560
1996
  },
1561
1997
  {
1562
1998
  "kind": "account";
1563
1999
  "path": "mint";
1564
- },
1565
- {
1566
- "kind": "arg";
1567
- "path": "nonce";
1568
2000
  }
1569
2001
  ];
2002
+ "program": {
2003
+ "kind": "const";
2004
+ "value": [
2005
+ 140,
2006
+ 151,
2007
+ 37,
2008
+ 143,
2009
+ 78,
2010
+ 36,
2011
+ 137,
2012
+ 241,
2013
+ 187,
2014
+ 61,
2015
+ 16,
2016
+ 41,
2017
+ 20,
2018
+ 142,
2019
+ 13,
2020
+ 131,
2021
+ 11,
2022
+ 90,
2023
+ 19,
2024
+ 153,
2025
+ 218,
2026
+ 255,
2027
+ 16,
2028
+ 132,
2029
+ 4,
2030
+ 142,
2031
+ 123,
2032
+ 216,
2033
+ 219,
2034
+ 233,
2035
+ 248,
2036
+ 89
2037
+ ];
2038
+ };
1570
2039
  };
1571
2040
  },
1572
2041
  {
1573
- "name": "mint";
2042
+ "name": "config";
1574
2043
  "docs": [
1575
- "Mint used for rewards"
2044
+ "Fee Configuration"
1576
2045
  ];
2046
+ "pda": {
2047
+ "seeds": [
2048
+ {
2049
+ "kind": "const";
2050
+ "value": [
2051
+ 99,
2052
+ 111,
2053
+ 110,
2054
+ 102,
2055
+ 105,
2056
+ 103
2057
+ ];
2058
+ }
2059
+ ];
2060
+ "program": {
2061
+ "kind": "account";
2062
+ "path": "feeProgram";
2063
+ };
2064
+ };
1577
2065
  },
1578
2066
  {
1579
- "name": "vault";
1580
- "docs": [
1581
- "Escrow Account that will store the tokens"
1582
- ];
1583
- "writable": true;
2067
+ "name": "feeValue";
2068
+ "optional": true;
1584
2069
  "pda": {
1585
2070
  "seeds": [
1586
2071
  {
1587
2072
  "kind": "const";
1588
2073
  "value": [
1589
- 114,
2074
+ 102,
2075
+ 101,
1590
2076
  101,
1591
- 119,
1592
- 97,
1593
- 114,
1594
- 100,
1595
2077
  45,
1596
2078
  118,
1597
2079
  97,
1598
- 117,
1599
2080
  108,
1600
- 116
2081
+ 117,
2082
+ 101
1601
2083
  ];
1602
2084
  },
1603
2085
  {
1604
2086
  "kind": "account";
1605
- "path": "rewardPool";
2087
+ "path": "authority";
1606
2088
  }
1607
2089
  ];
2090
+ "program": {
2091
+ "kind": "account";
2092
+ "path": "feeProgram";
2093
+ };
1608
2094
  };
1609
2095
  },
1610
2096
  {
1611
- "name": "governor";
1612
- "docs": [
1613
- "Governor to be set for the RewardPool"
1614
- ];
1615
- "optional": true;
1616
- },
1617
- {
1618
- "name": "creator";
1619
- "docs": [
1620
- "Reward Pool creator"
1621
- ];
1622
- "writable": true;
1623
- "signer": true;
2097
+ "name": "feeProgram";
2098
+ "address": "FEELzfBhsWXTNJX53zZcDVfRNoFYZQ6cZA3jLiGVL16V";
1624
2099
  },
1625
2100
  {
1626
2101
  "name": "tokenProgram";
1627
- },
1628
- {
1629
- "name": "systemProgram";
1630
- "address": "11111111111111111111111111111111";
1631
- }
1632
- ];
1633
- "args": [
1634
- {
1635
- "name": "nonce";
1636
- "type": "u8";
1637
- },
1638
- {
1639
- "name": "permissionless";
1640
- "type": "bool";
1641
- },
1642
- {
1643
- "name": "claimPeriod";
1644
- "type": "u64";
1645
- },
1646
- {
1647
- "name": "claimStartTs";
1648
- "type": "u64";
1649
2102
  }
1650
2103
  ];
2104
+ "args": [];
1651
2105
  },
1652
2106
  {
1653
2107
  "name": "fundPool";
@@ -1966,6 +2420,19 @@ type RewardPoolDynamic = {
1966
2420
  0
1967
2421
  ];
1968
2422
  },
2423
+ {
2424
+ "name": "fundDelegate";
2425
+ "discriminator": [
2426
+ 49,
2427
+ 154,
2428
+ 133,
2429
+ 22,
2430
+ 46,
2431
+ 68,
2432
+ 68,
2433
+ 44
2434
+ ];
2435
+ },
1969
2436
  {
1970
2437
  "name": "governor";
1971
2438
  "discriminator": [
@@ -2130,6 +2597,26 @@ type RewardPoolDynamic = {
2130
2597
  "code": 6016;
2131
2598
  "name": "voteRequired";
2132
2599
  "msg": "Vote is required for claiming";
2600
+ },
2601
+ {
2602
+ "code": 6017;
2603
+ "name": "invalidFundStart";
2604
+ "msg": "Fund start can not be in the past";
2605
+ },
2606
+ {
2607
+ "code": 6018;
2608
+ "name": "invalidFundPeriod";
2609
+ "msg": "Fund period should be >= 1 day and less or equal than expiration";
2610
+ },
2611
+ {
2612
+ "code": 6019;
2613
+ "name": "invalidFundExpiry";
2614
+ "msg": "Fund expiration should be later than start time";
2615
+ },
2616
+ {
2617
+ "code": 6020;
2618
+ "name": "alreadyFunded";
2619
+ "msg": "Fund already happened for the current period";
2133
2620
  }
2134
2621
  ];
2135
2622
  "types": [
@@ -2215,6 +2702,114 @@ type RewardPoolDynamic = {
2215
2702
  ];
2216
2703
  };
2217
2704
  },
2705
+ {
2706
+ "name": "fundDelegate";
2707
+ "type": {
2708
+ "kind": "struct";
2709
+ "fields": [
2710
+ {
2711
+ "name": "bump";
2712
+ "docs": [
2713
+ "Bump seed"
2714
+ ];
2715
+ "type": "u8";
2716
+ },
2717
+ {
2718
+ "name": "buffer";
2719
+ "docs": [
2720
+ "Buffer to account for space"
2721
+ ];
2722
+ "type": {
2723
+ "array": [
2724
+ "u8",
2725
+ 7
2726
+ ];
2727
+ };
2728
+ },
2729
+ {
2730
+ "name": "rewardPool";
2731
+ "docs": [
2732
+ "Reward Pool"
2733
+ ];
2734
+ "type": "pubkey";
2735
+ },
2736
+ {
2737
+ "name": "startTs";
2738
+ "docs": [
2739
+ "Time when the first fund happens"
2740
+ ];
2741
+ "type": "u64";
2742
+ },
2743
+ {
2744
+ "name": "period";
2745
+ "docs": [
2746
+ "Period of funds in seconds"
2747
+ ];
2748
+ "type": "u64";
2749
+ },
2750
+ {
2751
+ "name": "expiryTs";
2752
+ "docs": [
2753
+ "Time when vault expires and funds stop"
2754
+ ];
2755
+ "type": "u64";
2756
+ },
2757
+ {
2758
+ "name": "lastFundTs";
2759
+ "docs": [
2760
+ "Time when last fund happened"
2761
+ ];
2762
+ "type": "u64";
2763
+ },
2764
+ {
2765
+ "name": "mode";
2766
+ "docs": [
2767
+ "Funding mode, may have its own configuration"
2768
+ ];
2769
+ "type": {
2770
+ "defined": {
2771
+ "name": "fundMode";
2772
+ };
2773
+ };
2774
+ },
2775
+ {
2776
+ "name": "buffer1";
2777
+ "docs": [
2778
+ "Buffer for additional fields"
2779
+ ];
2780
+ "type": {
2781
+ "array": [
2782
+ "u8",
2783
+ 64
2784
+ ];
2785
+ };
2786
+ },
2787
+ {
2788
+ "name": "buffer2";
2789
+ "docs": [
2790
+ "Buffer for additional fields"
2791
+ ];
2792
+ "type": {
2793
+ "array": [
2794
+ "u8",
2795
+ 64
2796
+ ];
2797
+ };
2798
+ }
2799
+ ];
2800
+ };
2801
+ },
2802
+ {
2803
+ "name": "fundMode";
2804
+ "type": {
2805
+ "kind": "enum";
2806
+ "variants": [
2807
+ {
2808
+ "name": "revShare";
2809
+ }
2810
+ ];
2811
+ };
2812
+ },
2218
2813
  {
2219
2814
  "name": "governor";
2220
2815
  "type": {
@@ -2892,6 +3487,18 @@ interface UpdateRewardPoolArgs {
2892
3487
  }
2893
3488
  type ClaimRewardPoolArgs = CreateRewardEntryArgs & GovernorWithVoteArgs;
2894
3489
  type CloseRewardEntryArgs = CreateRewardEntryArgs;
3490
+ interface CreateFundDelegateArgs extends TokenProgram {
3491
+ rewardPool: Address;
3492
+ startTs: BN;
3493
+ period: BN;
3494
+ expiryTs: BN;
3495
+ }
3496
+ interface CreateFundDelegatePrepareResult extends IPrepareResult {
3497
+ tokenAccount: Address;
3498
+ }
3499
+ interface CreateFundDelegateResult extends ITransactionResult {
3500
+ tokenAccount: Address;
3501
+ }
2895
3502
  interface CreateStakePoolArgs extends TokenProgram {
2896
3503
  mint: Address;
2897
3504
  nonce: number;
@@ -3028,6 +3635,8 @@ declare class SolanaStakingClient {
3028
3635
  prepareCloseRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType }: CreateRewardEntryArgs, extParams: IInteractExt): Promise<{
3029
3636
  ixs: TransactionInstruction[];
3030
3637
  }>;
3638
+ createFundDelegate(data: CreateFundDelegateArgs, extParams: IInteractExt): Promise<CreateFundDelegateResult>;
3639
+ prepareCreateFundDelegateInstructions({ rewardPool, startTs, period, expiryTs, tokenProgramId }: CreateFundDelegateArgs, extParams: IInteractExt): Promise<CreateFundDelegatePrepareResult>;
3031
3640
  updateRewardPool(data: UpdateRewardPoolArgs, extParams: IInteractExt): Promise<{
3032
3641
  ixs: TransactionInstruction[];
3033
3642
  txId: string;
@@ -3053,6 +3662,7 @@ declare const deriveRewardVaultPDA: (programId: PublicKey, rewardPool: PublicKey
3053
3662
  declare const deriveRewardEntryPDA: (programId: PublicKey, rewardPool: PublicKey, stakeEntry: PublicKey) => PublicKey;
3054
3663
  declare const deriveConfigPDA: (programId: PublicKey) => PublicKey;
3055
3664
  declare const deriveFeeValuePDA: (programId: PublicKey, target: PublicKey) => PublicKey;
3665
+ declare const deriveFundDelegatePDA: (programId: PublicKey, rewardPool: PublicKey) => PublicKey;
3056
3666
 
3057
3667
  declare class RewardEntryAccumulator implements RewardEntry {
3058
3668
  lastAccountedTs: BN;
@@ -3087,4 +3697,4 @@ declare function calculateAmountWithTransferFees(connection: Connection, transfe
3087
3697
 
3088
3698
  declare const calculateStakeWeight: (minDuration: BN, maxDuration: BN, maxWeight: BN, duration: BN) => BN;
3089
3699
 
3090
- export { type BaseStakePoolArgs, type ClaimRewardPoolArgs, type CloseRewardEntryArgs, type CloseStakeEntryArgs, type CreateRewardEntryArgs, type CreateRewardPoolArgs, type CreateStakePoolArgs, type DefaultFeeValueConfig, type FeeValue, type FundPoolArgs, type IInteractExt, type RewardEntry, RewardEntryAccumulator, type RewardPool, SolanaStakingClient, type StakeAndCreateEntriesArgs, type StakeArgs, type StakeEntry, type StakePool, type UnstakeAndClaimArgs, type UnstakeAndCloseArgs, type UnstakeArgs, type UpdateRewardPoolArgs, calcRewards, calculateAmountWithTransferFees, calculateDecimalsShift, calculateFeeAmount, calculateRewardAmountFromRate, calculateRewardAmountFromValue, calculateRewardRateFromAmount, calculateStakeWeight, constants, deriveConfigPDA, deriveFeeValuePDA, deriveRewardEntryPDA, deriveRewardPoolPDA, deriveRewardVaultPDA, deriveStakeEntryPDA, deriveStakeMintPDA, deriveStakePoolPDA, deriveStakeVaultPDA };
3700
+ export { type BaseStakePoolArgs, type ClaimRewardPoolArgs, type CloseRewardEntryArgs, type CloseStakeEntryArgs, type CreateFundDelegateArgs, type CreateFundDelegatePrepareResult, type CreateFundDelegateResult, type CreateRewardEntryArgs, type CreateRewardPoolArgs, type CreateStakePoolArgs, type DefaultFeeValueConfig, type FeeValue, type FundPoolArgs, type IInteractExt, type RewardEntry, RewardEntryAccumulator, type RewardPool, SolanaStakingClient, type StakeAndCreateEntriesArgs, type StakeArgs, type StakeEntry, type StakePool, type UnstakeAndClaimArgs, type UnstakeAndCloseArgs, type UnstakeArgs, type UpdateRewardPoolArgs, calcRewards, calculateAmountWithTransferFees, calculateDecimalsShift, calculateFeeAmount, calculateRewardAmountFromRate, calculateRewardAmountFromValue, calculateRewardRateFromAmount, calculateStakeWeight, constants, deriveConfigPDA, deriveFeeValuePDA, deriveFundDelegatePDA, deriveRewardEntryPDA, deriveRewardPoolPDA, deriveRewardVaultPDA, deriveStakeEntryPDA, deriveStakeMintPDA, deriveStakePoolPDA, deriveStakeVaultPDA };