@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.
@@ -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, createAndEstimateTransaction, prepareTransaction, checkOrCreateAtaBatch, pk } from '@streamflow/common/solana';
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';
@@ -1720,13 +1720,7 @@ var BaseDistributorClient = class {
1720
1720
  return { distributorPublicKey, ixs };
1721
1721
  }
1722
1722
  async create(data, extParams) {
1723
- const invoker = extParams.invoker.publicKey;
1724
- invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
1725
- const { ixs, distributorPublicKey } = await createAndEstimateTransaction(
1726
- (params) => this.prepareCreateInstructions(data, { ...params, invoker: extParams.invoker }),
1727
- extParams,
1728
- (q) => q.ixs
1729
- );
1723
+ const { ixs, distributorPublicKey } = await this.prepareCreateInstructions(data, extParams);
1730
1724
  const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
1731
1725
  const signature = await wrappedSignAndExecuteTransaction(
1732
1726
  this.connection,
@@ -1746,10 +1740,7 @@ var BaseDistributorClient = class {
1746
1740
  };
1747
1741
  }
1748
1742
  async claim(data, extParams) {
1749
- const ixs = await createAndEstimateTransaction(
1750
- (params) => this.prepareClaimInstructions(data, { ...params, invoker: extParams.invoker }),
1751
- extParams
1752
- );
1743
+ const ixs = await this.prepareClaimInstructions(data, extParams);
1753
1744
  const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
1754
1745
  const signature = await wrappedSignAndExecuteTransaction(
1755
1746
  this.connection,
@@ -1820,10 +1811,7 @@ var BaseDistributorClient = class {
1820
1811
  return ixs;
1821
1812
  }
1822
1813
  async closeClaim(data, extParams) {
1823
- const ixs = await createAndEstimateTransaction(
1824
- (params) => this.prepareCloseClaimInstructions(data, { ...params, invoker: extParams.invoker }),
1825
- extParams
1826
- );
1814
+ const ixs = await this.prepareCloseClaimInstructions(data, extParams);
1827
1815
  const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
1828
1816
  const signature = await wrappedSignAndExecuteTransaction(
1829
1817
  this.connection,
@@ -1902,10 +1890,7 @@ var BaseDistributorClient = class {
1902
1890
  return ixs;
1903
1891
  }
1904
1892
  async clawback(data, extParams) {
1905
- const ixs = await createAndEstimateTransaction(
1906
- (params) => this.prepareClawbackInstructions(data, { ...params, invoker: extParams.invoker }),
1907
- extParams
1908
- );
1893
+ const ixs = await this.prepareClawbackInstructions(data, extParams);
1909
1894
  const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
1910
1895
  const signature = await wrappedSignAndExecuteTransaction(
1911
1896
  this.connection,