@streamflow/stream 12.0.0 → 12.1.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/dist/cjs/index.cjs +525 -6
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/solana/descriptor/streamflow_aligned_unlocks.d.cts +399 -1
- package/dist/cjs/solana/index.cjs +525 -6
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +49 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +524 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/descriptor/idl/streamflow.json +53 -1
- package/dist/esm/solana/descriptor/idl/streamflow_aligned_unlocks.json +400 -2
- package/dist/esm/solana/descriptor/streamflow_aligned_unlocks.d.ts +399 -1
- package/dist/esm/solana/index.d.ts +49 -1
- package/dist/esm/solana/index.js +524 -7
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
package/dist/esm/index.js
CHANGED
|
@@ -177,6 +177,8 @@ var Contract = class {
|
|
|
177
177
|
this.oldMetadata = stream.oldMetadata;
|
|
178
178
|
this.payer = stream.payer.toBase58();
|
|
179
179
|
this.bump = stream.bump;
|
|
180
|
+
this.feePartner = stream.feePartner.toBase58();
|
|
181
|
+
this.cancelRequestTime = stream.cancelRequestTime.toNumber();
|
|
180
182
|
this.type = buildStreamType(this);
|
|
181
183
|
this.isAligned = false;
|
|
182
184
|
}
|
|
@@ -381,7 +383,9 @@ var streamLayout = BufferLayout.struct([
|
|
|
381
383
|
BufferLayout.u8("auto_claim_fee_claimed"),
|
|
382
384
|
BufferLayout.blob(32, "old_metadata"),
|
|
383
385
|
BufferLayout.blob(32, "payer"),
|
|
384
|
-
BufferLayout.u8("bump")
|
|
386
|
+
BufferLayout.u8("bump"),
|
|
387
|
+
BufferLayout.blob(32, "fee_partner"),
|
|
388
|
+
BufferLayout.blob(8, "cancel_request_time")
|
|
385
389
|
]);
|
|
386
390
|
BufferLayout.struct([
|
|
387
391
|
BufferLayout.blob(32, "pubkey"),
|
|
@@ -596,7 +600,9 @@ var decodeStream = (buf) => {
|
|
|
596
600
|
fundsUnlockedAtLastRateChange: new BN3(raw.funds_unlocked_at_last_rate_change, LE),
|
|
597
601
|
oldMetadata: new PublicKey(raw.old_metadata),
|
|
598
602
|
payer: new PublicKey(raw.payer),
|
|
599
|
-
bump: raw.bump
|
|
603
|
+
bump: raw.bump,
|
|
604
|
+
feePartner: new PublicKey(raw.fee_partner),
|
|
605
|
+
cancelRequestTime: new BN3(raw.cancel_request_time, LE)
|
|
600
606
|
};
|
|
601
607
|
};
|
|
602
608
|
async function signAllTransactionWithRecipients(sender, items) {
|
|
@@ -1065,6 +1071,33 @@ var transferStreamInstruction = async (programId, {
|
|
|
1065
1071
|
data
|
|
1066
1072
|
});
|
|
1067
1073
|
};
|
|
1074
|
+
var requestCancelStreamInstruction = async (programId, { authority, metadata }) => {
|
|
1075
|
+
const keys = [
|
|
1076
|
+
{ pubkey: authority, isSigner: true, isWritable: false },
|
|
1077
|
+
{ pubkey: metadata, isSigner: false, isWritable: true }
|
|
1078
|
+
];
|
|
1079
|
+
const data = Buffer.concat([Buffer.from(await sha256.digest("global:request_cancel")).slice(0, 8), Buffer.alloc(10)]);
|
|
1080
|
+
return new TransactionInstruction({
|
|
1081
|
+
keys,
|
|
1082
|
+
programId,
|
|
1083
|
+
data
|
|
1084
|
+
});
|
|
1085
|
+
};
|
|
1086
|
+
var withdrawCancelRequestInstruction = async (programId, { authority, metadata }) => {
|
|
1087
|
+
const keys = [
|
|
1088
|
+
{ pubkey: authority, isSigner: true, isWritable: false },
|
|
1089
|
+
{ pubkey: metadata, isSigner: false, isWritable: true }
|
|
1090
|
+
];
|
|
1091
|
+
const data = Buffer.concat([
|
|
1092
|
+
Buffer.from(await sha256.digest("global:withdraw_cancel_request")).slice(0, 8),
|
|
1093
|
+
Buffer.alloc(10)
|
|
1094
|
+
]);
|
|
1095
|
+
return new TransactionInstruction({
|
|
1096
|
+
keys,
|
|
1097
|
+
programId,
|
|
1098
|
+
data
|
|
1099
|
+
});
|
|
1100
|
+
};
|
|
1068
1101
|
var topupStreamInstruction = async (amount, programId, {
|
|
1069
1102
|
sender,
|
|
1070
1103
|
senderTokens,
|
|
@@ -1114,7 +1147,7 @@ var streamflow_aligned_unlocks_default = {
|
|
|
1114
1147
|
address: "aSTRM2NKoKxNnkmLWk9sz3k74gKBk9t7bpPrTGxMszH",
|
|
1115
1148
|
metadata: {
|
|
1116
1149
|
name: "streamflow_aligned_unlocks",
|
|
1117
|
-
version: "1.
|
|
1150
|
+
version: "1.7.0",
|
|
1118
1151
|
spec: "0.1.0",
|
|
1119
1152
|
description: "Proxy to update unlock amount within Streamflow vesting protocol according to Token performance and other metrics"
|
|
1120
1153
|
},
|
|
@@ -1497,6 +1530,388 @@ var streamflow_aligned_unlocks_default = {
|
|
|
1497
1530
|
],
|
|
1498
1531
|
args: []
|
|
1499
1532
|
},
|
|
1533
|
+
{
|
|
1534
|
+
name: "cancel_v2",
|
|
1535
|
+
discriminator: [
|
|
1536
|
+
160,
|
|
1537
|
+
58,
|
|
1538
|
+
112,
|
|
1539
|
+
172,
|
|
1540
|
+
233,
|
|
1541
|
+
228,
|
|
1542
|
+
38,
|
|
1543
|
+
140
|
|
1544
|
+
],
|
|
1545
|
+
accounts: [
|
|
1546
|
+
{
|
|
1547
|
+
name: "caller",
|
|
1548
|
+
writable: true,
|
|
1549
|
+
signer: true
|
|
1550
|
+
},
|
|
1551
|
+
{
|
|
1552
|
+
name: "sender",
|
|
1553
|
+
writable: true
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
name: "sender_tokens",
|
|
1557
|
+
docs: [
|
|
1558
|
+
"Associated token account address of `sender`."
|
|
1559
|
+
],
|
|
1560
|
+
writable: true,
|
|
1561
|
+
pda: {
|
|
1562
|
+
seeds: [
|
|
1563
|
+
{
|
|
1564
|
+
kind: "account",
|
|
1565
|
+
path: "sender"
|
|
1566
|
+
},
|
|
1567
|
+
{
|
|
1568
|
+
kind: "account",
|
|
1569
|
+
path: "token_program"
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
kind: "account",
|
|
1573
|
+
path: "mint"
|
|
1574
|
+
}
|
|
1575
|
+
],
|
|
1576
|
+
program: {
|
|
1577
|
+
kind: "const",
|
|
1578
|
+
value: [
|
|
1579
|
+
140,
|
|
1580
|
+
151,
|
|
1581
|
+
37,
|
|
1582
|
+
143,
|
|
1583
|
+
78,
|
|
1584
|
+
36,
|
|
1585
|
+
137,
|
|
1586
|
+
241,
|
|
1587
|
+
187,
|
|
1588
|
+
61,
|
|
1589
|
+
16,
|
|
1590
|
+
41,
|
|
1591
|
+
20,
|
|
1592
|
+
142,
|
|
1593
|
+
13,
|
|
1594
|
+
131,
|
|
1595
|
+
11,
|
|
1596
|
+
90,
|
|
1597
|
+
19,
|
|
1598
|
+
153,
|
|
1599
|
+
218,
|
|
1600
|
+
255,
|
|
1601
|
+
16,
|
|
1602
|
+
132,
|
|
1603
|
+
4,
|
|
1604
|
+
142,
|
|
1605
|
+
123,
|
|
1606
|
+
216,
|
|
1607
|
+
219,
|
|
1608
|
+
233,
|
|
1609
|
+
248,
|
|
1610
|
+
89
|
|
1611
|
+
]
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
name: "recipient",
|
|
1617
|
+
writable: true
|
|
1618
|
+
},
|
|
1619
|
+
{
|
|
1620
|
+
name: "recipient_tokens",
|
|
1621
|
+
docs: [
|
|
1622
|
+
"CHECK; Associated token account address of `recipient`."
|
|
1623
|
+
],
|
|
1624
|
+
writable: true,
|
|
1625
|
+
pda: {
|
|
1626
|
+
seeds: [
|
|
1627
|
+
{
|
|
1628
|
+
kind: "account",
|
|
1629
|
+
path: "recipient"
|
|
1630
|
+
},
|
|
1631
|
+
{
|
|
1632
|
+
kind: "account",
|
|
1633
|
+
path: "token_program"
|
|
1634
|
+
},
|
|
1635
|
+
{
|
|
1636
|
+
kind: "account",
|
|
1637
|
+
path: "mint"
|
|
1638
|
+
}
|
|
1639
|
+
],
|
|
1640
|
+
program: {
|
|
1641
|
+
kind: "const",
|
|
1642
|
+
value: [
|
|
1643
|
+
140,
|
|
1644
|
+
151,
|
|
1645
|
+
37,
|
|
1646
|
+
143,
|
|
1647
|
+
78,
|
|
1648
|
+
36,
|
|
1649
|
+
137,
|
|
1650
|
+
241,
|
|
1651
|
+
187,
|
|
1652
|
+
61,
|
|
1653
|
+
16,
|
|
1654
|
+
41,
|
|
1655
|
+
20,
|
|
1656
|
+
142,
|
|
1657
|
+
13,
|
|
1658
|
+
131,
|
|
1659
|
+
11,
|
|
1660
|
+
90,
|
|
1661
|
+
19,
|
|
1662
|
+
153,
|
|
1663
|
+
218,
|
|
1664
|
+
255,
|
|
1665
|
+
16,
|
|
1666
|
+
132,
|
|
1667
|
+
4,
|
|
1668
|
+
142,
|
|
1669
|
+
123,
|
|
1670
|
+
216,
|
|
1671
|
+
219,
|
|
1672
|
+
233,
|
|
1673
|
+
248,
|
|
1674
|
+
89
|
|
1675
|
+
]
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
name: "proxy_metadata",
|
|
1681
|
+
docs: [
|
|
1682
|
+
"Proxy Contract"
|
|
1683
|
+
],
|
|
1684
|
+
writable: true,
|
|
1685
|
+
pda: {
|
|
1686
|
+
seeds: [
|
|
1687
|
+
{
|
|
1688
|
+
kind: "const",
|
|
1689
|
+
value: [
|
|
1690
|
+
99,
|
|
1691
|
+
111,
|
|
1692
|
+
110,
|
|
1693
|
+
116,
|
|
1694
|
+
114,
|
|
1695
|
+
97,
|
|
1696
|
+
99,
|
|
1697
|
+
116
|
|
1698
|
+
]
|
|
1699
|
+
},
|
|
1700
|
+
{
|
|
1701
|
+
kind: "account",
|
|
1702
|
+
path: "stream_metadata"
|
|
1703
|
+
}
|
|
1704
|
+
]
|
|
1705
|
+
}
|
|
1706
|
+
},
|
|
1707
|
+
{
|
|
1708
|
+
name: "proxy_tokens",
|
|
1709
|
+
writable: true,
|
|
1710
|
+
pda: {
|
|
1711
|
+
seeds: [
|
|
1712
|
+
{
|
|
1713
|
+
kind: "account",
|
|
1714
|
+
path: "proxy_metadata"
|
|
1715
|
+
},
|
|
1716
|
+
{
|
|
1717
|
+
kind: "account",
|
|
1718
|
+
path: "token_program"
|
|
1719
|
+
},
|
|
1720
|
+
{
|
|
1721
|
+
kind: "account",
|
|
1722
|
+
path: "mint"
|
|
1723
|
+
}
|
|
1724
|
+
],
|
|
1725
|
+
program: {
|
|
1726
|
+
kind: "const",
|
|
1727
|
+
value: [
|
|
1728
|
+
140,
|
|
1729
|
+
151,
|
|
1730
|
+
37,
|
|
1731
|
+
143,
|
|
1732
|
+
78,
|
|
1733
|
+
36,
|
|
1734
|
+
137,
|
|
1735
|
+
241,
|
|
1736
|
+
187,
|
|
1737
|
+
61,
|
|
1738
|
+
16,
|
|
1739
|
+
41,
|
|
1740
|
+
20,
|
|
1741
|
+
142,
|
|
1742
|
+
13,
|
|
1743
|
+
131,
|
|
1744
|
+
11,
|
|
1745
|
+
90,
|
|
1746
|
+
19,
|
|
1747
|
+
153,
|
|
1748
|
+
218,
|
|
1749
|
+
255,
|
|
1750
|
+
16,
|
|
1751
|
+
132,
|
|
1752
|
+
4,
|
|
1753
|
+
142,
|
|
1754
|
+
123,
|
|
1755
|
+
216,
|
|
1756
|
+
219,
|
|
1757
|
+
233,
|
|
1758
|
+
248,
|
|
1759
|
+
89
|
|
1760
|
+
]
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
},
|
|
1764
|
+
{
|
|
1765
|
+
name: "stream_metadata",
|
|
1766
|
+
writable: true
|
|
1767
|
+
},
|
|
1768
|
+
{
|
|
1769
|
+
name: "escrow_tokens",
|
|
1770
|
+
writable: true
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
name: "streamflow_treasury",
|
|
1774
|
+
writable: true
|
|
1775
|
+
},
|
|
1776
|
+
{
|
|
1777
|
+
name: "streamflow_treasury_tokens",
|
|
1778
|
+
writable: true,
|
|
1779
|
+
pda: {
|
|
1780
|
+
seeds: [
|
|
1781
|
+
{
|
|
1782
|
+
kind: "account",
|
|
1783
|
+
path: "streamflow_treasury"
|
|
1784
|
+
},
|
|
1785
|
+
{
|
|
1786
|
+
kind: "account",
|
|
1787
|
+
path: "token_program"
|
|
1788
|
+
},
|
|
1789
|
+
{
|
|
1790
|
+
kind: "account",
|
|
1791
|
+
path: "mint"
|
|
1792
|
+
}
|
|
1793
|
+
],
|
|
1794
|
+
program: {
|
|
1795
|
+
kind: "const",
|
|
1796
|
+
value: [
|
|
1797
|
+
140,
|
|
1798
|
+
151,
|
|
1799
|
+
37,
|
|
1800
|
+
143,
|
|
1801
|
+
78,
|
|
1802
|
+
36,
|
|
1803
|
+
137,
|
|
1804
|
+
241,
|
|
1805
|
+
187,
|
|
1806
|
+
61,
|
|
1807
|
+
16,
|
|
1808
|
+
41,
|
|
1809
|
+
20,
|
|
1810
|
+
142,
|
|
1811
|
+
13,
|
|
1812
|
+
131,
|
|
1813
|
+
11,
|
|
1814
|
+
90,
|
|
1815
|
+
19,
|
|
1816
|
+
153,
|
|
1817
|
+
218,
|
|
1818
|
+
255,
|
|
1819
|
+
16,
|
|
1820
|
+
132,
|
|
1821
|
+
4,
|
|
1822
|
+
142,
|
|
1823
|
+
123,
|
|
1824
|
+
216,
|
|
1825
|
+
219,
|
|
1826
|
+
233,
|
|
1827
|
+
248,
|
|
1828
|
+
89
|
|
1829
|
+
]
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
name: "partner",
|
|
1835
|
+
writable: true
|
|
1836
|
+
},
|
|
1837
|
+
{
|
|
1838
|
+
name: "partner_tokens",
|
|
1839
|
+
writable: true,
|
|
1840
|
+
pda: {
|
|
1841
|
+
seeds: [
|
|
1842
|
+
{
|
|
1843
|
+
kind: "account",
|
|
1844
|
+
path: "partner"
|
|
1845
|
+
},
|
|
1846
|
+
{
|
|
1847
|
+
kind: "account",
|
|
1848
|
+
path: "token_program"
|
|
1849
|
+
},
|
|
1850
|
+
{
|
|
1851
|
+
kind: "account",
|
|
1852
|
+
path: "mint"
|
|
1853
|
+
}
|
|
1854
|
+
],
|
|
1855
|
+
program: {
|
|
1856
|
+
kind: "const",
|
|
1857
|
+
value: [
|
|
1858
|
+
140,
|
|
1859
|
+
151,
|
|
1860
|
+
37,
|
|
1861
|
+
143,
|
|
1862
|
+
78,
|
|
1863
|
+
36,
|
|
1864
|
+
137,
|
|
1865
|
+
241,
|
|
1866
|
+
187,
|
|
1867
|
+
61,
|
|
1868
|
+
16,
|
|
1869
|
+
41,
|
|
1870
|
+
20,
|
|
1871
|
+
142,
|
|
1872
|
+
13,
|
|
1873
|
+
131,
|
|
1874
|
+
11,
|
|
1875
|
+
90,
|
|
1876
|
+
19,
|
|
1877
|
+
153,
|
|
1878
|
+
218,
|
|
1879
|
+
255,
|
|
1880
|
+
16,
|
|
1881
|
+
132,
|
|
1882
|
+
4,
|
|
1883
|
+
142,
|
|
1884
|
+
123,
|
|
1885
|
+
216,
|
|
1886
|
+
219,
|
|
1887
|
+
233,
|
|
1888
|
+
248,
|
|
1889
|
+
89
|
|
1890
|
+
]
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
name: "mint",
|
|
1896
|
+
docs: [
|
|
1897
|
+
"The SPL token mint account."
|
|
1898
|
+
],
|
|
1899
|
+
writable: true
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
name: "streamflow_program",
|
|
1903
|
+
address: "strmRqUCoQUgGUan5YhzUZa6KqdzwX5L6FpUxfmKg5m"
|
|
1904
|
+
},
|
|
1905
|
+
{
|
|
1906
|
+
name: "token_program",
|
|
1907
|
+
docs: [
|
|
1908
|
+
"The SPL program needed in case an associated account",
|
|
1909
|
+
"for the new recipient is being created."
|
|
1910
|
+
]
|
|
1911
|
+
}
|
|
1912
|
+
],
|
|
1913
|
+
args: []
|
|
1914
|
+
},
|
|
1500
1915
|
{
|
|
1501
1916
|
name: "change_oracle",
|
|
1502
1917
|
discriminator: [
|
|
@@ -1784,7 +2199,8 @@ var streamflow_aligned_unlocks_default = {
|
|
|
1784
2199
|
name: "mint"
|
|
1785
2200
|
},
|
|
1786
2201
|
{
|
|
1787
|
-
name: "fee_oracle"
|
|
2202
|
+
name: "fee_oracle",
|
|
2203
|
+
address: "B743wFVk2pCYhV91cn287e1xY7f1vt4gdY48hhNiuQmT"
|
|
1788
2204
|
},
|
|
1789
2205
|
{
|
|
1790
2206
|
name: "price_oracle"
|
|
@@ -2210,6 +2626,21 @@ var streamflow_aligned_unlocks_default = {
|
|
|
2210
2626
|
code: 6016,
|
|
2211
2627
|
name: "InvalidFloorPrice",
|
|
2212
2628
|
msg: "Provided floor price is invalid, should be less than minimum price"
|
|
2629
|
+
},
|
|
2630
|
+
{
|
|
2631
|
+
code: 6017,
|
|
2632
|
+
name: "AmountNotUpdated",
|
|
2633
|
+
msg: "Update won't lead to any changes in unlock schedule"
|
|
2634
|
+
},
|
|
2635
|
+
{
|
|
2636
|
+
code: 6018,
|
|
2637
|
+
name: "OldMetadataNotDrained",
|
|
2638
|
+
msg: "Old metadata account must be drained"
|
|
2639
|
+
},
|
|
2640
|
+
{
|
|
2641
|
+
code: 6019,
|
|
2642
|
+
name: "NewMetadataMissing",
|
|
2643
|
+
msg: "New metadata account does not exist"
|
|
2213
2644
|
}
|
|
2214
2645
|
],
|
|
2215
2646
|
types: [
|
|
@@ -2720,7 +3151,7 @@ var deriveTestOraclePDA = (programId, mint, creator) => {
|
|
|
2720
3151
|
};
|
|
2721
3152
|
var deriveStreamMetadataPDA = (programId, mint, sender, nonce) => {
|
|
2722
3153
|
return PublicKey.findProgramAddressSync(
|
|
2723
|
-
[METADATA_SEED, mint.toBuffer(), sender.toBuffer(), new BN3(nonce).toArrayLike(Buffer, "
|
|
3154
|
+
[METADATA_SEED, mint.toBuffer(), sender.toBuffer(), new BN3(nonce).toArrayLike(Buffer, "be", 4)],
|
|
2724
3155
|
programId
|
|
2725
3156
|
)[0];
|
|
2726
3157
|
};
|
|
@@ -2836,7 +3267,9 @@ async function toDecodedStream(schema) {
|
|
|
2836
3267
|
fundsUnlockedAtLastRateChange: toBN(schema.amountUnlockedAtLastRateUpdate),
|
|
2837
3268
|
oldMetadata: PublicKey.default,
|
|
2838
3269
|
payer,
|
|
2839
|
-
bump: schema.bump ? schema.bump : 0
|
|
3270
|
+
bump: schema.bump ? schema.bump : 0,
|
|
3271
|
+
feePartner: partner,
|
|
3272
|
+
cancelRequestTime: toBN(isoToUnix(schema.cancelRequestDt))
|
|
2840
3273
|
};
|
|
2841
3274
|
}
|
|
2842
3275
|
function toPrecisionBN(value, precision = ALIGNED_PRECISION_FACTOR_POW2) {
|
|
@@ -3884,6 +4317,90 @@ var SolanaStreamClient = class {
|
|
|
3884
4317
|
ixs.push(...ixsAta, cancelIx);
|
|
3885
4318
|
return ixs;
|
|
3886
4319
|
}
|
|
4320
|
+
/**
|
|
4321
|
+
* Requests cancellation of a stream by the fee partner authority.
|
|
4322
|
+
* @param {IRequestCancelData} data - Request cancel parameters including stream ID
|
|
4323
|
+
* @param {IInteractStreamExt} extParams - Transaction configuration including invoker wallet and compute settings
|
|
4324
|
+
* @returns Transaction result
|
|
4325
|
+
*/
|
|
4326
|
+
async requestCancel(data, extParams) {
|
|
4327
|
+
const ixs = await this.prepareRequestCancelInstructions(data, extParams);
|
|
4328
|
+
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
|
|
4329
|
+
const signature = await signAndExecuteTransaction(
|
|
4330
|
+
this.connection,
|
|
4331
|
+
extParams.invoker,
|
|
4332
|
+
tx,
|
|
4333
|
+
{
|
|
4334
|
+
hash,
|
|
4335
|
+
context,
|
|
4336
|
+
commitment: this.getCommitment()
|
|
4337
|
+
},
|
|
4338
|
+
this.schedulingParams
|
|
4339
|
+
);
|
|
4340
|
+
return { ixs, txId: signature };
|
|
4341
|
+
}
|
|
4342
|
+
/**
|
|
4343
|
+
* Creates Transaction Instructions for request_cancel
|
|
4344
|
+
* @param {IRequestCancelData} data - Request cancel parameters including stream ID
|
|
4345
|
+
* @param {IPrepareStreamExt} extParams - Transaction configuration including invoker wallet and compute settings
|
|
4346
|
+
* @returns Transaction instructions
|
|
4347
|
+
*/
|
|
4348
|
+
async prepareRequestCancelInstructions({ id }, { invoker, computePrice, computeLimit }) {
|
|
4349
|
+
assertHasPublicKey(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
4350
|
+
const ixs = prepareBaseInstructions(this.connection, {
|
|
4351
|
+
computePrice,
|
|
4352
|
+
computeLimit
|
|
4353
|
+
});
|
|
4354
|
+
ixs.push(
|
|
4355
|
+
await requestCancelStreamInstruction(this.programId, {
|
|
4356
|
+
authority: invoker.publicKey,
|
|
4357
|
+
metadata: new PublicKey(id)
|
|
4358
|
+
})
|
|
4359
|
+
);
|
|
4360
|
+
return ixs;
|
|
4361
|
+
}
|
|
4362
|
+
/**
|
|
4363
|
+
* Withdraws a previously submitted cancel request.
|
|
4364
|
+
* @param {IWithdrawCancelRequestData} data - Withdraw cancel request parameters including stream ID
|
|
4365
|
+
* @param {IInteractStreamExt} extParams - Transaction configuration including invoker wallet and compute settings
|
|
4366
|
+
* @returns Transaction result
|
|
4367
|
+
*/
|
|
4368
|
+
async withdrawCancelRequest(data, extParams) {
|
|
4369
|
+
const ixs = await this.prepareWithdrawCancelRequestInstructions(data, extParams);
|
|
4370
|
+
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
|
|
4371
|
+
const signature = await signAndExecuteTransaction(
|
|
4372
|
+
this.connection,
|
|
4373
|
+
extParams.invoker,
|
|
4374
|
+
tx,
|
|
4375
|
+
{
|
|
4376
|
+
hash,
|
|
4377
|
+
context,
|
|
4378
|
+
commitment: this.getCommitment()
|
|
4379
|
+
},
|
|
4380
|
+
this.schedulingParams
|
|
4381
|
+
);
|
|
4382
|
+
return { ixs, txId: signature };
|
|
4383
|
+
}
|
|
4384
|
+
/**
|
|
4385
|
+
* Creates Transaction Instructions for withdraw_cancel_request
|
|
4386
|
+
* @param {IWithdrawCancelRequestData} data - Withdraw cancel request parameters including stream ID
|
|
4387
|
+
* @param {IPrepareStreamExt} extParams - Transaction configuration including invoker wallet and compute settings
|
|
4388
|
+
* @returns Transaction instructions
|
|
4389
|
+
*/
|
|
4390
|
+
async prepareWithdrawCancelRequestInstructions({ id }, { invoker, computePrice, computeLimit }) {
|
|
4391
|
+
assertHasPublicKey(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
4392
|
+
const ixs = prepareBaseInstructions(this.connection, {
|
|
4393
|
+
computePrice,
|
|
4394
|
+
computeLimit
|
|
4395
|
+
});
|
|
4396
|
+
ixs.push(
|
|
4397
|
+
await withdrawCancelRequestInstruction(this.programId, {
|
|
4398
|
+
authority: invoker.publicKey,
|
|
4399
|
+
metadata: new PublicKey(id)
|
|
4400
|
+
})
|
|
4401
|
+
);
|
|
4402
|
+
return ixs;
|
|
4403
|
+
}
|
|
3887
4404
|
/**
|
|
3888
4405
|
* Attempts changing the stream/vesting contract's recipient (effectively transferring the stream/vesting contract).
|
|
3889
4406
|
* Potential associated token account rent fee (to make it rent-exempt) is paid by the transaction initiator.
|
|
@@ -4897,6 +5414,6 @@ var timelockIDL_default = {
|
|
|
4897
5414
|
]
|
|
4898
5415
|
};
|
|
4899
5416
|
|
|
4900
|
-
export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW2 as ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, AlignedContract, AlignedProxyErrorCode, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, Contract, ContractErrorCode, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, MAX_SAFE_UNIX_TIME_VALUE2 as MAX_SAFE_UNIX_TIME_VALUE, METADATA_SEED, ORIGINAL_CONTRACT_SENDER_OFFSET, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, REPOPULATED_METADATA_SEED, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, SolanaStreamClient, StreamDirection, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, createClient, createStreamInstruction, createStreamV2Instruction, createUncheckedStreamInstruction, createUncheckedStreamV2Instruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveStreamMetadataPDA, deriveTestOraclePDA, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, timelockIDL_default as timelockIDL, topupStreamInstruction, transferStreamInstruction, transformContract, updateStreamInstruction, withdrawStreamInstruction };
|
|
5417
|
+
export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW2 as ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, AlignedContract, AlignedProxyErrorCode, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, Contract, ContractErrorCode, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, MAX_SAFE_UNIX_TIME_VALUE2 as MAX_SAFE_UNIX_TIME_VALUE, METADATA_SEED, ORIGINAL_CONTRACT_SENDER_OFFSET, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, REPOPULATED_METADATA_SEED, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, SolanaStreamClient, StreamDirection, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, createClient, createStreamInstruction, createStreamV2Instruction, createUncheckedStreamInstruction, createUncheckedStreamV2Instruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveStreamMetadataPDA, deriveTestOraclePDA, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, requestCancelStreamInstruction, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, timelockIDL_default as timelockIDL, topupStreamInstruction, transferStreamInstruction, transformContract, updateStreamInstruction, withdrawCancelRequestInstruction, withdrawStreamInstruction };
|
|
4901
5418
|
//# sourceMappingURL=index.js.map
|
|
4902
5419
|
//# sourceMappingURL=index.js.map
|