@streamflow/distributor 8.0.0-alpha.p287.84ff30f → 8.0.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/cjs/index.cjs +4 -19
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/solana/index.cjs +4 -19
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/esm/index.js +5 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.js +5 -20
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PublicKey, TransactionInstruction, Connection, SystemProgram } from '@solana/web3.js';
|
|
2
2
|
import '@solana/wallet-adapter-base';
|
|
3
3
|
import { ICluster, ContractError, divCeilN, invariant, getNumberFromBN, getBN } from '@streamflow/common';
|
|
4
|
-
import { signAndExecuteTransaction, buildSendThrottler, prepareBaseInstructions, getMintAndProgram, ata, prepareWrappedAccount,
|
|
4
|
+
import { signAndExecuteTransaction, buildSendThrottler, prepareBaseInstructions, getMintAndProgram, ata, prepareWrappedAccount, prepareTransaction, checkOrCreateAtaBatch, pk } from '@streamflow/common/solana';
|
|
5
5
|
import { Program } from '@coral-xyz/anchor';
|
|
6
6
|
import * as borsh8 from '@coral-xyz/borsh';
|
|
7
7
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
@@ -1748,13 +1748,7 @@ var BaseDistributorClient = class {
|
|
|
1748
1748
|
return { distributorPublicKey, ixs };
|
|
1749
1749
|
}
|
|
1750
1750
|
async create(data, extParams) {
|
|
1751
|
-
const
|
|
1752
|
-
invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
1753
|
-
const { ixs, distributorPublicKey } = await createAndEstimateTransaction(
|
|
1754
|
-
(params) => this.prepareCreateInstructions(data, { ...params, invoker: extParams.invoker }),
|
|
1755
|
-
extParams,
|
|
1756
|
-
(q) => q.ixs
|
|
1757
|
-
);
|
|
1751
|
+
const { ixs, distributorPublicKey } = await this.prepareCreateInstructions(data, extParams);
|
|
1758
1752
|
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
|
|
1759
1753
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1760
1754
|
this.connection,
|
|
@@ -1774,10 +1768,7 @@ var BaseDistributorClient = class {
|
|
|
1774
1768
|
};
|
|
1775
1769
|
}
|
|
1776
1770
|
async claim(data, extParams) {
|
|
1777
|
-
const ixs = await
|
|
1778
|
-
(params) => this.prepareClaimInstructions(data, { ...params, invoker: extParams.invoker }),
|
|
1779
|
-
extParams
|
|
1780
|
-
);
|
|
1771
|
+
const ixs = await this.prepareClaimInstructions(data, extParams);
|
|
1781
1772
|
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
|
|
1782
1773
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1783
1774
|
this.connection,
|
|
@@ -1848,10 +1839,7 @@ var BaseDistributorClient = class {
|
|
|
1848
1839
|
return ixs;
|
|
1849
1840
|
}
|
|
1850
1841
|
async closeClaim(data, extParams) {
|
|
1851
|
-
const ixs = await
|
|
1852
|
-
(params) => this.prepareCloseClaimInstructions(data, { ...params, invoker: extParams.invoker }),
|
|
1853
|
-
extParams
|
|
1854
|
-
);
|
|
1842
|
+
const ixs = await this.prepareCloseClaimInstructions(data, extParams);
|
|
1855
1843
|
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
|
|
1856
1844
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1857
1845
|
this.connection,
|
|
@@ -1930,10 +1918,7 @@ var BaseDistributorClient = class {
|
|
|
1930
1918
|
return ixs;
|
|
1931
1919
|
}
|
|
1932
1920
|
async clawback(data, extParams) {
|
|
1933
|
-
const ixs = await
|
|
1934
|
-
(params) => this.prepareClawbackInstructions(data, { ...params, invoker: extParams.invoker }),
|
|
1935
|
-
extParams
|
|
1936
|
-
);
|
|
1921
|
+
const ixs = await this.prepareClawbackInstructions(data, extParams);
|
|
1937
1922
|
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
|
|
1938
1923
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1939
1924
|
this.connection,
|