@streamflow/launchpad 9.4.0-alpha.p325.15b4539 → 10.0.0-alpha.p313.18b7be3

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,10 +1,9 @@
1
1
  import { IdlAccounts, Address, Program, ProgramAccount } from '@coral-xyz/anchor';
2
2
  import { Keypair, Connection, Commitment, ConnectionConfig, PublicKey, TransactionInstruction } from '@solana/web3.js';
3
- import { ICluster, ITransactionResult } from '@streamflow/common';
3
+ import { ICluster, ITransactionExt, ITransactionResult } from '@streamflow/common';
4
4
  import PQueue from 'p-queue';
5
5
  import { StreamflowLaunchpad } from './solana/descriptor/streamflow_launchpad.cjs';
6
6
  import { SignerWalletAdapter } from '@solana/wallet-adapter-base';
7
- import { ITransactionSolanaExt } from '@streamflow/common/solana';
8
7
  import { OracleTypeName } from '@streamflow/stream';
9
8
  import BN from 'bn.js';
10
9
 
@@ -34,7 +33,7 @@ declare namespace constants {
34
33
 
35
34
  type Launchpad = IdlAccounts<StreamflowLaunchpad>["launchpad"];
36
35
  type DepositAccount = IdlAccounts<StreamflowLaunchpad>["depositAccount"];
37
- interface IInteractSolanaExt extends ITransactionSolanaExt {
36
+ interface IInteractExt extends ITransactionExt {
38
37
  invoker: SignerWalletAdapter | Keypair;
39
38
  }
40
39
  interface ILaunchpad {
@@ -108,8 +107,6 @@ declare class SolanaLaunchpadClient {
108
107
  private readonly sendThrottler;
109
108
  private readonly dynamicVestingId;
110
109
  private readonly vestingId;
111
- private readonly partnerOracleProgramId;
112
- private readonly feeOraclePublicKey;
113
110
  readonly program: Program<StreamflowLaunchpad>;
114
111
  constructor({ clusterUrl, cluster, commitment, programIds, sendRate, sendThrottler, }: IInitOptions);
115
112
  getCurrentProgramId(): PublicKey;
@@ -117,26 +114,26 @@ declare class SolanaLaunchpadClient {
117
114
  getLaunchpad(id: Address): Promise<Launchpad>;
118
115
  searchLaunchpads(criteria?: Partial<Pick<Launchpad, keyof typeof LAUNCHPAD_BYTE_OFFSETS>>): Promise<ProgramAccount<Launchpad>[]>;
119
116
  getDepositAccount(id: Address): Promise<DepositAccount>;
120
- createLaunchpad(data: ICreateLaunchpad, extParams: IInteractSolanaExt): Promise<CreationResult>;
121
- prepareCreateLaunchpadInstructions({ baseMint: baseMintKey, quoteMint: quoteMintKey, receiver, priceOracle, nonce, price, individualDepositingCap, maxDepositingCap, depositingStartTs, depositingEndTs, vestingStartTs, vestingEndTs, vestingPeriod, oracleType, minPrice, maxPrice, minPercentage, maxPercentage, tickSize, skipInitial, isMemoRequired, tokenProgramId, }: ICreateLaunchpad, extParams: IInteractSolanaExt): Promise<{
117
+ createLaunchpad(data: ICreateLaunchpad, extParams: IInteractExt): Promise<CreationResult>;
118
+ prepareCreateLaunchpadInstructions({ baseMint: baseMintKey, quoteMint: quoteMintKey, receiver, priceOracle, nonce, price, individualDepositingCap, maxDepositingCap, depositingStartTs, depositingEndTs, vestingStartTs, vestingEndTs, vestingPeriod, oracleType, minPrice, maxPrice, minPercentage, maxPercentage, tickSize, skipInitial, isMemoRequired, tokenProgramId, }: ICreateLaunchpad, extParams: IInteractExt): Promise<{
122
119
  ixs: TransactionInstruction[];
123
120
  publicKey: PublicKey;
124
121
  }>;
125
- fundLaunchpad(data: IFundLaunchpad, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
126
- prepareFundLaunchpadInstructions({ launchpad: launchpadKey, amount, baseMint: baseMintKey, tokenProgramId }: IFundLaunchpad, extParams: IInteractSolanaExt): Promise<{
122
+ fundLaunchpad(data: IFundLaunchpad, extParams: IInteractExt): Promise<ITransactionResult>;
123
+ prepareFundLaunchpadInstructions({ launchpad: launchpadKey, amount, baseMint: baseMintKey, tokenProgramId }: IFundLaunchpad, extParams: IInteractExt): Promise<{
127
124
  ixs: TransactionInstruction[];
128
125
  }>;
129
- deposit(data: IDeposit, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
130
- prepareDepositInstructions({ launchpad: launchpadKey, quoteMint: quoteMintKey, amount, autoCap, memo, owner, tokenProgramId, }: IDeposit, extParams: IInteractSolanaExt): Promise<{
126
+ deposit(data: IDeposit, extParams: IInteractExt): Promise<ITransactionResult>;
127
+ prepareDepositInstructions({ launchpad: launchpadKey, quoteMint: quoteMintKey, amount, autoCap, memo, owner, tokenProgramId, }: IDeposit, extParams: IInteractExt): Promise<{
131
128
  ixs: TransactionInstruction[];
132
129
  publicKey: PublicKey;
133
130
  }>;
134
- claimDeposits(data: IClaimDeposits, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
135
- prepareClaimDepositsInstructions({ launchpad: launchpadKey, tokenProgramId }: IClaimDeposits, extParams: IInteractSolanaExt): Promise<{
131
+ claimDeposits(data: IClaimDeposits, extParams: IInteractExt): Promise<ITransactionResult>;
132
+ prepareClaimDepositsInstructions({ launchpad: launchpadKey, tokenProgramId }: IClaimDeposits, extParams: IInteractExt): Promise<{
136
133
  ixs: TransactionInstruction[];
137
134
  }>;
138
- claimAllocatedVested(data: IClaimAllocatedVested, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
139
- prepareClaimAllocatedVestedInstructions({ launchpad: launchpadKey, baseMint: baseMintKey, owner, tokenProgramId }: IClaimAllocatedVested, extParams: IInteractSolanaExt): Promise<{
135
+ claimAllocatedVested(data: IClaimAllocatedVested, extParams: IInteractExt): Promise<ITransactionResult>;
136
+ prepareClaimAllocatedVestedInstructions({ launchpad: launchpadKey, baseMint: baseMintKey, owner, tokenProgramId }: IClaimAllocatedVested, extParams: IInteractExt): Promise<{
140
137
  ixs: TransactionInstruction[];
141
138
  streamKeypair: Keypair;
142
139
  }>;
@@ -147,4 +144,4 @@ declare const deriveLaunchpadPDA: (programId: PublicKey, baseMint: PublicKey, no
147
144
  declare const deriveDepositPDA: (programId: PublicKey, launchpad: PublicKey, owner: PublicKey) => PublicKey;
148
145
  declare const deriveVaultPDA: (programId: PublicKey, launchpad: PublicKey) => PublicKey;
149
146
 
150
- export { type DepositAccount, type IClaimAllocatedInstant, type IClaimAllocatedVested, type IClaimDeposits, type ICreateLaunchpad, type IDeposit, type IFundLaunchpad, type IInteractSolanaExt, type Launchpad, SolanaLaunchpadClient, constants, deriveDepositPDA, deriveLaunchpadPDA, deriveVaultPDA };
147
+ export { type DepositAccount, type IClaimAllocatedInstant, type IClaimAllocatedVested, type IClaimDeposits, type ICreateLaunchpad, type IDeposit, type IFundLaunchpad, type IInteractExt, type Launchpad, SolanaLaunchpadClient, constants, deriveDepositPDA, deriveLaunchpadPDA, deriveVaultPDA };
@@ -1,10 +1,9 @@
1
1
  import { IdlAccounts, Address, Program, ProgramAccount } from '@coral-xyz/anchor';
2
2
  import { Keypair, Connection, Commitment, ConnectionConfig, PublicKey, TransactionInstruction } from '@solana/web3.js';
3
- import { ICluster, ITransactionResult } from '@streamflow/common';
3
+ import { ICluster, ITransactionExt, ITransactionResult } from '@streamflow/common';
4
4
  import PQueue from 'p-queue';
5
5
  import { StreamflowLaunchpad } from './solana/descriptor/streamflow_launchpad.js';
6
6
  import { SignerWalletAdapter } from '@solana/wallet-adapter-base';
7
- import { ITransactionSolanaExt } from '@streamflow/common/solana';
8
7
  import { OracleTypeName } from '@streamflow/stream';
9
8
  import BN from 'bn.js';
10
9
 
@@ -34,7 +33,7 @@ declare namespace constants {
34
33
 
35
34
  type Launchpad = IdlAccounts<StreamflowLaunchpad>["launchpad"];
36
35
  type DepositAccount = IdlAccounts<StreamflowLaunchpad>["depositAccount"];
37
- interface IInteractSolanaExt extends ITransactionSolanaExt {
36
+ interface IInteractExt extends ITransactionExt {
38
37
  invoker: SignerWalletAdapter | Keypair;
39
38
  }
40
39
  interface ILaunchpad {
@@ -108,8 +107,6 @@ declare class SolanaLaunchpadClient {
108
107
  private readonly sendThrottler;
109
108
  private readonly dynamicVestingId;
110
109
  private readonly vestingId;
111
- private readonly partnerOracleProgramId;
112
- private readonly feeOraclePublicKey;
113
110
  readonly program: Program<StreamflowLaunchpad>;
114
111
  constructor({ clusterUrl, cluster, commitment, programIds, sendRate, sendThrottler, }: IInitOptions);
115
112
  getCurrentProgramId(): PublicKey;
@@ -117,26 +114,26 @@ declare class SolanaLaunchpadClient {
117
114
  getLaunchpad(id: Address): Promise<Launchpad>;
118
115
  searchLaunchpads(criteria?: Partial<Pick<Launchpad, keyof typeof LAUNCHPAD_BYTE_OFFSETS>>): Promise<ProgramAccount<Launchpad>[]>;
119
116
  getDepositAccount(id: Address): Promise<DepositAccount>;
120
- createLaunchpad(data: ICreateLaunchpad, extParams: IInteractSolanaExt): Promise<CreationResult>;
121
- prepareCreateLaunchpadInstructions({ baseMint: baseMintKey, quoteMint: quoteMintKey, receiver, priceOracle, nonce, price, individualDepositingCap, maxDepositingCap, depositingStartTs, depositingEndTs, vestingStartTs, vestingEndTs, vestingPeriod, oracleType, minPrice, maxPrice, minPercentage, maxPercentage, tickSize, skipInitial, isMemoRequired, tokenProgramId, }: ICreateLaunchpad, extParams: IInteractSolanaExt): Promise<{
117
+ createLaunchpad(data: ICreateLaunchpad, extParams: IInteractExt): Promise<CreationResult>;
118
+ prepareCreateLaunchpadInstructions({ baseMint: baseMintKey, quoteMint: quoteMintKey, receiver, priceOracle, nonce, price, individualDepositingCap, maxDepositingCap, depositingStartTs, depositingEndTs, vestingStartTs, vestingEndTs, vestingPeriod, oracleType, minPrice, maxPrice, minPercentage, maxPercentage, tickSize, skipInitial, isMemoRequired, tokenProgramId, }: ICreateLaunchpad, extParams: IInteractExt): Promise<{
122
119
  ixs: TransactionInstruction[];
123
120
  publicKey: PublicKey;
124
121
  }>;
125
- fundLaunchpad(data: IFundLaunchpad, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
126
- prepareFundLaunchpadInstructions({ launchpad: launchpadKey, amount, baseMint: baseMintKey, tokenProgramId }: IFundLaunchpad, extParams: IInteractSolanaExt): Promise<{
122
+ fundLaunchpad(data: IFundLaunchpad, extParams: IInteractExt): Promise<ITransactionResult>;
123
+ prepareFundLaunchpadInstructions({ launchpad: launchpadKey, amount, baseMint: baseMintKey, tokenProgramId }: IFundLaunchpad, extParams: IInteractExt): Promise<{
127
124
  ixs: TransactionInstruction[];
128
125
  }>;
129
- deposit(data: IDeposit, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
130
- prepareDepositInstructions({ launchpad: launchpadKey, quoteMint: quoteMintKey, amount, autoCap, memo, owner, tokenProgramId, }: IDeposit, extParams: IInteractSolanaExt): Promise<{
126
+ deposit(data: IDeposit, extParams: IInteractExt): Promise<ITransactionResult>;
127
+ prepareDepositInstructions({ launchpad: launchpadKey, quoteMint: quoteMintKey, amount, autoCap, memo, owner, tokenProgramId, }: IDeposit, extParams: IInteractExt): Promise<{
131
128
  ixs: TransactionInstruction[];
132
129
  publicKey: PublicKey;
133
130
  }>;
134
- claimDeposits(data: IClaimDeposits, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
135
- prepareClaimDepositsInstructions({ launchpad: launchpadKey, tokenProgramId }: IClaimDeposits, extParams: IInteractSolanaExt): Promise<{
131
+ claimDeposits(data: IClaimDeposits, extParams: IInteractExt): Promise<ITransactionResult>;
132
+ prepareClaimDepositsInstructions({ launchpad: launchpadKey, tokenProgramId }: IClaimDeposits, extParams: IInteractExt): Promise<{
136
133
  ixs: TransactionInstruction[];
137
134
  }>;
138
- claimAllocatedVested(data: IClaimAllocatedVested, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
139
- prepareClaimAllocatedVestedInstructions({ launchpad: launchpadKey, baseMint: baseMintKey, owner, tokenProgramId }: IClaimAllocatedVested, extParams: IInteractSolanaExt): Promise<{
135
+ claimAllocatedVested(data: IClaimAllocatedVested, extParams: IInteractExt): Promise<ITransactionResult>;
136
+ prepareClaimAllocatedVestedInstructions({ launchpad: launchpadKey, baseMint: baseMintKey, owner, tokenProgramId }: IClaimAllocatedVested, extParams: IInteractExt): Promise<{
140
137
  ixs: TransactionInstruction[];
141
138
  streamKeypair: Keypair;
142
139
  }>;
@@ -147,4 +144,4 @@ declare const deriveLaunchpadPDA: (programId: PublicKey, baseMint: PublicKey, no
147
144
  declare const deriveDepositPDA: (programId: PublicKey, launchpad: PublicKey, owner: PublicKey) => PublicKey;
148
145
  declare const deriveVaultPDA: (programId: PublicKey, launchpad: PublicKey) => PublicKey;
149
146
 
150
- export { type DepositAccount, type IClaimAllocatedInstant, type IClaimAllocatedVested, type IClaimDeposits, type ICreateLaunchpad, type IDeposit, type IFundLaunchpad, type IInteractSolanaExt, type Launchpad, SolanaLaunchpadClient, constants, deriveDepositPDA, deriveLaunchpadPDA, deriveVaultPDA };
147
+ export { type DepositAccount, type IClaimAllocatedInstant, type IClaimAllocatedVested, type IClaimDeposits, type ICreateLaunchpad, type IDeposit, type IFundLaunchpad, type IInteractExt, type Launchpad, SolanaLaunchpadClient, constants, deriveDepositPDA, deriveLaunchpadPDA, deriveVaultPDA };
package/dist/esm/index.js CHANGED
@@ -1,12 +1,10 @@
1
1
  import { Program, translateError, parseIdlErrors } from '@coral-xyz/anchor';
2
2
  import { getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID, createTransferCheckedInstruction } from '@solana/spl-token';
3
3
  import { PublicKey, clusterApiUrl, Connection, TransactionInstruction, Keypair } from '@solana/web3.js';
4
- import { ICluster, invariant, getBN, ContractError } from '@streamflow/common';
5
- import { buildSendThrottler, pk, getFilters, getMintAndProgram, checkOrCreateAtaBatch, prepareBaseInstructions, prepareTransaction, signAndExecuteTransaction } from '@streamflow/common/solana';
6
- import { constants, deriveTestOraclePDA, deriveContractPDA, deriveEscrowPDA } from '@streamflow/stream/solana';
4
+ import { ICluster, buildSendThrottler, pk, invariant, getFilters, getBN, getMintAndProgram, checkOrCreateAtaBatch, prepareBaseInstructions, prepareTransaction, signAndExecuteTransaction, ContractError } from '@streamflow/common';
5
+ import { ALIGNED_UNLOCKS_PROGRAM_ID, PROGRAM_ID as PROGRAM_ID$1, deriveTestOraclePDA, ALIGNED_PRECISION_FACTOR_POW, deriveContractPDA, deriveEscrowPDA, FEE_ORACLE_PUBLIC_KEY, WITHDRAWOR_PUBLIC_KEY } from '@streamflow/stream';
7
6
  import BN2 from 'bn.js';
8
7
  import '@solana/wallet-adapter-base';
9
- import '@streamflow/stream';
10
8
 
11
9
  var __defProp = Object.defineProperty;
12
10
  var __export = (target, all) => {
@@ -1219,11 +1217,9 @@ var SolanaLaunchpadClient = class {
1219
1217
  connection: this.connection
1220
1218
  });
1221
1219
  this.dynamicVestingId = pk(
1222
- programIds?.dynamicVesting ? programIds.dynamicVesting : constants.ALIGNED_UNLOCKS_PROGRAM_ID[cluster]
1220
+ programIds?.dynamicVesting ? programIds.dynamicVesting : ALIGNED_UNLOCKS_PROGRAM_ID[cluster]
1223
1221
  );
1224
- this.vestingId = pk(programIds?.vesting ? programIds.vesting : constants.PROGRAM_ID[cluster]);
1225
- this.partnerOracleProgramId = new PublicKey(constants.PARTNER_ORACLE_PROGRAM_ID[cluster]);
1226
- this.feeOraclePublicKey = new PublicKey(constants.FEE_ORACLE_PUBLIC_KEY[cluster]);
1222
+ this.vestingId = pk(programIds?.vesting ? programIds.vesting : PROGRAM_ID$1[cluster]);
1227
1223
  }
1228
1224
  getCurrentProgramId() {
1229
1225
  invariant(this.program, `Program is not found`);
@@ -1295,11 +1291,11 @@ var SolanaLaunchpadClient = class {
1295
1291
  vestingEndTs: new BN2(vestingEndTs),
1296
1292
  vestingPeriod: new BN2(vestingPeriod),
1297
1293
  oracleType: !!oracleType ? { [oracleType]: {} } : { none: {} },
1298
- minPrice: getBN(minPrice, constants.ALIGNED_PRECISION_FACTOR_POW),
1299
- maxPrice: getBN(maxPrice, constants.ALIGNED_PRECISION_FACTOR_POW),
1300
- minPercentage: getBN(minPercentage, constants.ALIGNED_PRECISION_FACTOR_POW),
1301
- maxPercentage: getBN(maxPercentage, constants.ALIGNED_PRECISION_FACTOR_POW),
1302
- tickSize: getBN(tickSize, constants.ALIGNED_PRECISION_FACTOR_POW),
1294
+ minPrice: getBN(minPrice, ALIGNED_PRECISION_FACTOR_POW),
1295
+ maxPrice: getBN(maxPrice, ALIGNED_PRECISION_FACTOR_POW),
1296
+ minPercentage: getBN(minPercentage, ALIGNED_PRECISION_FACTOR_POW),
1297
+ maxPercentage: getBN(maxPercentage, ALIGNED_PRECISION_FACTOR_POW),
1298
+ tickSize: getBN(tickSize, ALIGNED_PRECISION_FACTOR_POW),
1303
1299
  skipInitial,
1304
1300
  isMemoRequired
1305
1301
  }).accounts({
@@ -1446,8 +1442,8 @@ var SolanaLaunchpadClient = class {
1446
1442
  proxyTokens: proxyTokensKey,
1447
1443
  streamMetadata: streamKey,
1448
1444
  escrowTokens: escrowKey,
1449
- withdrawor: constants.WITHDRAWOR_PUBLIC_KEY,
1450
- feeOracle: this.feeOraclePublicKey,
1445
+ withdrawor: WITHDRAWOR_PUBLIC_KEY,
1446
+ feeOracle: FEE_ORACLE_PUBLIC_KEY,
1451
1447
  tokenProgram: tokenProgramId
1452
1448
  }).accountsPartial({
1453
1449
  streamflowProgram: this.vestingId,