@streamflow/distributor 9.0.4 → 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.
- package/dist/cjs/index.cjs +27 -28
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +0 -1
- package/dist/cjs/solana/index.cjs +27 -28
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +18 -19
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +18 -19
- package/dist/esm/solana/index.js +1 -2
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Keypair, PublicKey, TransactionInstruction, Connection, Commitment, ConnectionConfig } from '@solana/web3.js';
|
|
2
2
|
import { SignerWalletAdapter } from '@solana/wallet-adapter-base';
|
|
3
|
-
import { ITransactionResult, ICluster } from '@streamflow/common';
|
|
4
|
-
import { ITransactionSolanaExt, ITransactionSolanaExtResolved, IProgramAccount, unwrapExecutionParams, signAndExecuteTransaction } from '@streamflow/common/solana';
|
|
3
|
+
import { ITransactionExt, ITransactionResult, ICluster, ITransactionExtResolved, IProgramAccount, unwrapExecutionParams, signAndExecuteTransaction } from '@streamflow/common';
|
|
5
4
|
import BN from 'bn.js';
|
|
6
5
|
import { IdlTypes, Program } from '@coral-xyz/anchor';
|
|
7
6
|
import { AlignedDistributor } from './descriptor/aligned_distributor.js';
|
|
@@ -27,10 +26,10 @@ type CompressedClaimStatus = MerkleDistributorAccountTypes["compressedClaimStatu
|
|
|
27
26
|
type AnyClaimStatus = ClaimStatus | CompressedClaimStatus;
|
|
28
27
|
type OracleType = IdlTypes<AlignedDistributor>["oracleType"];
|
|
29
28
|
type OracleTypeName = "none" | "pyth" | "switchboard" | "test";
|
|
30
|
-
interface
|
|
29
|
+
interface IInteractExt extends ITransactionExt {
|
|
31
30
|
invoker: SignerWalletAdapter | Keypair;
|
|
32
31
|
}
|
|
33
|
-
interface
|
|
32
|
+
interface ICreateExt extends IInteractExt {
|
|
34
33
|
isNative?: boolean;
|
|
35
34
|
}
|
|
36
35
|
interface ICreateDistributorData {
|
|
@@ -642,40 +641,40 @@ declare abstract class BaseDistributorClient {
|
|
|
642
641
|
getConnection(): Connection;
|
|
643
642
|
getCommitment(): Commitment | undefined;
|
|
644
643
|
getDistributorProgramId(): PublicKey;
|
|
645
|
-
prepareCreateInstructions(data: ICreateDistributorData | ICreateAlignedDistributorData, extParams:
|
|
644
|
+
prepareCreateInstructions(data: ICreateDistributorData | ICreateAlignedDistributorData, extParams: ITransactionExtResolved<ICreateExt>): Promise<{
|
|
646
645
|
distributorPublicKey: PublicKey;
|
|
647
646
|
ixs: TransactionInstruction[];
|
|
648
647
|
}>;
|
|
649
|
-
create(data: ICreateDistributorData | ICreateAlignedDistributorData, extParams:
|
|
648
|
+
create(data: ICreateDistributorData | ICreateAlignedDistributorData, extParams: ICreateExt): Promise<ICreateDistributorResult>;
|
|
650
649
|
/**
|
|
651
650
|
* @public
|
|
652
651
|
* @overload
|
|
653
652
|
*/
|
|
654
|
-
claim(data: IClaimData, extParams:
|
|
653
|
+
claim(data: IClaimData, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
655
654
|
/**
|
|
656
655
|
* @internal
|
|
657
656
|
*/
|
|
658
|
-
claim(data: IClaimData, extParams:
|
|
657
|
+
claim(data: IClaimData, extParams: IInteractExt, _serviceTransfer?: unknown): Promise<ITransactionResult>;
|
|
659
658
|
/**
|
|
660
659
|
* @public
|
|
661
660
|
* @overload
|
|
662
661
|
*/
|
|
663
|
-
prepareClaimInstructions(data: IClaimData, extParams:
|
|
662
|
+
prepareClaimInstructions(data: IClaimData, extParams: ITransactionExtResolved<IInteractExt>): Promise<TransactionInstruction[]>;
|
|
664
663
|
/**
|
|
665
664
|
* @internal
|
|
666
665
|
*/
|
|
667
|
-
prepareClaimInstructions(data: IClaimData, extParams:
|
|
668
|
-
closeClaim(data: ICloseClaimData, extParams:
|
|
669
|
-
prepareCloseClaimInstructions(data: ICloseClaimData, extParams:
|
|
670
|
-
prepareClawbackInstructions(data: IClawbackData, extParams:
|
|
671
|
-
clawback(data: IClawbackData, extParams:
|
|
666
|
+
prepareClaimInstructions(data: IClaimData, extParams: ITransactionExtResolved<IInteractExt>, _serviceTransfer?: unknown): Promise<TransactionInstruction[]>;
|
|
667
|
+
closeClaim(data: ICloseClaimData, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
668
|
+
prepareCloseClaimInstructions(data: ICloseClaimData, extParams: ITransactionExtResolved<IInteractExt>): Promise<TransactionInstruction[]>;
|
|
669
|
+
prepareClawbackInstructions(data: IClawbackData, extParams: ITransactionExtResolved<IInteractExt>): Promise<TransactionInstruction[]>;
|
|
670
|
+
clawback(data: IClawbackData, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
672
671
|
getClaim(claimStatus: string | PublicKey): Promise<AnyClaimStatus | null>;
|
|
673
672
|
getClaims(data: IGetClaimData[]): Promise<(AnyClaimStatus | null)[]>;
|
|
674
673
|
getDistributors(data: IGetDistributors): Promise<(MerkleDistributor | null)[]>;
|
|
675
674
|
searchDistributors(data: ISearchDistributors): Promise<IProgramAccount<MerkleDistributor>[]>;
|
|
676
675
|
protected prepareClaimFeeInstruction(payer: PublicKey, fee?: bigint): TransactionInstruction;
|
|
677
676
|
protected getNewDistributorArgs(data: ICreateDistributorData): NewDistributorArgs;
|
|
678
|
-
protected unwrapExecutionParams<T extends
|
|
677
|
+
protected unwrapExecutionParams<T extends IInteractExt>(extParams: T): ReturnType<typeof unwrapExecutionParams<T>>;
|
|
679
678
|
private decodeClaimStatus;
|
|
680
679
|
}
|
|
681
680
|
|
|
@@ -1477,10 +1476,10 @@ type index_ICloseClaimData = ICloseClaimData;
|
|
|
1477
1476
|
type index_ICreateAlignedDistributorData = ICreateAlignedDistributorData;
|
|
1478
1477
|
type index_ICreateDistributorData = ICreateDistributorData;
|
|
1479
1478
|
type index_ICreateDistributorResult = ICreateDistributorResult;
|
|
1480
|
-
type
|
|
1479
|
+
type index_ICreateExt = ICreateExt;
|
|
1481
1480
|
type index_IGetClaimData = IGetClaimData;
|
|
1482
1481
|
type index_IGetDistributors = IGetDistributors;
|
|
1483
|
-
type
|
|
1482
|
+
type index_IInteractExt = IInteractExt;
|
|
1484
1483
|
type index_ISearchDistributors = ISearchDistributors;
|
|
1485
1484
|
type index_ISetClawbackReceiverData = ISetClawbackReceiverData;
|
|
1486
1485
|
type index_ISetDataAdmin = ISetDataAdmin;
|
|
@@ -1530,7 +1529,7 @@ declare const index_setClawbackReceiver: typeof setClawbackReceiver;
|
|
|
1530
1529
|
declare const index_toLamportsSOL: typeof toLamportsSOL;
|
|
1531
1530
|
declare const index_wrappedSignAndExecuteTransaction: typeof wrappedSignAndExecuteTransaction;
|
|
1532
1531
|
declare namespace index {
|
|
1533
|
-
export { type index_AirdropFeeClient as AirdropFeeClient, type index_AirdropFeeDynamic as AirdropFeeDynamic, type index_AirdropFeeQueryOptionsOverrides as AirdropFeeQueryOptionsOverrides, type index_AirdropFeeResponse as AirdropFeeResponse, type index_AirdropFeeServiceResponse as AirdropFeeServiceResponse, type index_AlignedDistributorData as AlignedDistributorData, index_AnchorErrorCode as AnchorErrorCode, type index_AnyClaimStatus as AnyClaimStatus, type index_ClaimLockedAccounts as ClaimLockedAccounts, type index_ClaimStatus as ClaimStatus, type index_ClawbackAccounts as ClawbackAccounts, type index_CloseClaimAccounts as CloseClaimAccounts, type index_CompressedClaimStatus as CompressedClaimStatus, index_ContractErrorCode as ContractErrorCode, index_FEE_ALLOCATION_FACTOR_FALLBACK_DENOMINATOR as FEE_ALLOCATION_FACTOR_FALLBACK_DENOMINATOR, index_FEE_ALLOCATION_FACTOR_FALLBACK_NUMERATOR as FEE_ALLOCATION_FACTOR_FALLBACK_NUMERATOR, type index_IClaimData as IClaimData, type index_IClawbackData as IClawbackData, type index_ICloseClaimData as ICloseClaimData, type index_ICreateAlignedDistributorData as ICreateAlignedDistributorData, type index_ICreateDistributorData as ICreateDistributorData, type index_ICreateDistributorResult as ICreateDistributorResult, type
|
|
1532
|
+
export { type index_AirdropFeeClient as AirdropFeeClient, type index_AirdropFeeDynamic as AirdropFeeDynamic, type index_AirdropFeeQueryOptionsOverrides as AirdropFeeQueryOptionsOverrides, type index_AirdropFeeResponse as AirdropFeeResponse, type index_AirdropFeeServiceResponse as AirdropFeeServiceResponse, type index_AlignedDistributorData as AlignedDistributorData, index_AnchorErrorCode as AnchorErrorCode, type index_AnyClaimStatus as AnyClaimStatus, type index_ClaimLockedAccounts as ClaimLockedAccounts, type index_ClaimStatus as ClaimStatus, type index_ClawbackAccounts as ClawbackAccounts, type index_CloseClaimAccounts as CloseClaimAccounts, type index_CompressedClaimStatus as CompressedClaimStatus, index_ContractErrorCode as ContractErrorCode, index_FEE_ALLOCATION_FACTOR_FALLBACK_DENOMINATOR as FEE_ALLOCATION_FACTOR_FALLBACK_DENOMINATOR, index_FEE_ALLOCATION_FACTOR_FALLBACK_NUMERATOR as FEE_ALLOCATION_FACTOR_FALLBACK_NUMERATOR, type index_IClaimData as IClaimData, type index_IClawbackData as IClawbackData, type index_ICloseClaimData as ICloseClaimData, type index_ICreateAlignedDistributorData as ICreateAlignedDistributorData, type index_ICreateDistributorData as ICreateDistributorData, type index_ICreateDistributorResult as ICreateDistributorResult, type index_ICreateExt as ICreateExt, type index_IGetClaimData as IGetClaimData, type index_IGetDistributors as IGetDistributors, type index_IInteractExt as IInteractExt, type index_ISearchDistributors as ISearchDistributors, type index_ISetClawbackReceiverData as ISetClawbackReceiverData, type index_ISetDataAdmin as ISetDataAdmin, index_MAXIMUM_FEE_FALLBACK as MAXIMUM_FEE_FALLBACK, index_MINIMUM_FEE_FALLBACK as MINIMUM_FEE_FALLBACK, index_MerkleDistributor as MerkleDistributor, type index_MerkleDistributorAccountTypes as MerkleDistributorAccountTypes, type index_MerkleDistributorFields as MerkleDistributorFields, type index_MerkleDistributorJSON as MerkleDistributorJSON, type index_NewAlignedDistributorArgs as NewAlignedDistributorArgs, type index_NewClaimAccounts as NewClaimAccounts, type index_NewClaimArgs as NewClaimArgs, type index_NewDistributorAccounts as NewDistributorAccounts, type index_NewDistributorArgs as NewDistributorArgs, type index_OracleType as OracleType, type index_OracleTypeName as OracleTypeName, type index_SetAdminAccounts as SetAdminAccounts, type index_SetClawbackReceiverAccounts as SetClawbackReceiverAccounts, index_SolanaAlignedDistributorClient as SolanaAlignedDistributorClient, index_SolanaDistributorClient as SolanaDistributorClient, index_applyFeeLogic as applyFeeLogic, index_calculateAirdropFeeLamports as calculateAirdropFeeLamports, index_calculateAmountWithTransferFees as calculateAmountWithTransferFees, index_calculateClaimableLamportsFromPrices as calculateClaimableLamportsFromPrices, index_calculateDynamicFeeFromSolParams as calculateDynamicFeeFromSolParams, index_claimLocked as claimLocked, index_clawback as clawback, index_closeClaim as closeClaim, index_constants as constants, index_fetchAirdropFee as fetchAirdropFee, index_fromCode as fromCode, index_fromTxError as fromTxError, index_getAlignedDistributorPda as getAlignedDistributorPda, index_getClaimantStatusPda as getClaimantStatusPda, index_getDistributorPda as getDistributorPda, index_getEventAuthorityPda as getEventAuthorityPda, index_getTestOraclePda as getTestOraclePda, index_isCompressedClaimStatus as isCompressedClaimStatus, index_newClaim as newClaim, index_newDistributor as newDistributor, index_resolveAirdropFeeLamportsUsingApi as resolveAirdropFeeLamportsUsingApi, index_setAdmin as setAdmin, index_setClawbackReceiver as setClawbackReceiver, index_toLamportsSOL as toLamportsSOL, index_wrappedSignAndExecuteTransaction as wrappedSignAndExecuteTransaction };
|
|
1534
1533
|
}
|
|
1535
1534
|
|
|
1536
|
-
export { type AirdropFeeClient, type AirdropFeeDynamic, type AirdropFeeQueryOptionsOverrides, type AirdropFeeResponse, type AirdropFeeServiceResponse, type AlignedDistributorData, AnchorErrorCode, type AnyClaimStatus, type ClaimLockedAccounts, type ClaimStatus, type ClawbackAccounts, type CloseClaimAccounts, type CompressedClaimStatus, ContractErrorCode, FEE_ALLOCATION_FACTOR_FALLBACK_DENOMINATOR, FEE_ALLOCATION_FACTOR_FALLBACK_NUMERATOR, type IClaimData, type IClawbackData, type ICloseClaimData, type ICreateAlignedDistributorData, type ICreateDistributorData, type ICreateDistributorResult, type
|
|
1535
|
+
export { type AirdropFeeClient, type AirdropFeeDynamic, type AirdropFeeQueryOptionsOverrides, type AirdropFeeResponse, type AirdropFeeServiceResponse, type AlignedDistributorData, AnchorErrorCode, type AnyClaimStatus, type ClaimLockedAccounts, type ClaimStatus, type ClawbackAccounts, type CloseClaimAccounts, type CompressedClaimStatus, ContractErrorCode, FEE_ALLOCATION_FACTOR_FALLBACK_DENOMINATOR, FEE_ALLOCATION_FACTOR_FALLBACK_NUMERATOR, type IClaimData, type IClawbackData, type ICloseClaimData, type ICreateAlignedDistributorData, type ICreateDistributorData, type ICreateDistributorResult, type ICreateExt, type IGetClaimData, type IGetDistributors, type IInteractExt, type ISearchDistributors, type ISetClawbackReceiverData, type ISetDataAdmin, MAXIMUM_FEE_FALLBACK, MINIMUM_FEE_FALLBACK, MerkleDistributor, type MerkleDistributorAccountTypes, type MerkleDistributorFields, type MerkleDistributorJSON, type NewAlignedDistributorArgs, type NewClaimAccounts, type NewClaimArgs, type NewDistributorAccounts, type NewDistributorArgs, type OracleType, type OracleTypeName, type SetAdminAccounts, type SetClawbackReceiverAccounts, SolanaAlignedDistributorClient, SolanaDistributorClient, applyFeeLogic, calculateAirdropFeeLamports, calculateAmountWithTransferFees, calculateClaimableLamportsFromPrices, calculateDynamicFeeFromSolParams, claimLocked, clawback, closeClaim, constants, fetchAirdropFee, fromCode, fromTxError, getAlignedDistributorPda, getClaimantStatusPda, getDistributorPda, getEventAuthorityPda, getTestOraclePda, index as i, isCompressedClaimStatus, newClaim, newDistributor, resolveAirdropFeeLamportsUsingApi, setAdmin, setClawbackReceiver, toLamportsSOL, wrappedSignAndExecuteTransaction };
|
package/dist/esm/solana/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PublicKey, TransactionInstruction, Connection, SystemProgram } from '@solana/web3.js';
|
|
2
2
|
import '@solana/wallet-adapter-base';
|
|
3
|
-
import { ICluster, multiplyBigIntByNumber, fetchTokenPrice, ContractError, divCeilN, invariant, getNumberFromBN, getBN } from '@streamflow/common';
|
|
4
|
-
import { signAndExecuteTransaction, buildSendThrottler, prepareBaseInstructions, getMintAndProgram, ata, prepareWrappedAccount, createAndEstimateTransaction, prepareTransaction, checkOrCreateAtaBatch, pk, unwrapExecutionParams } from '@streamflow/common/solana';
|
|
3
|
+
import { ICluster, multiplyBigIntByNumber, fetchTokenPrice, signAndExecuteTransaction, ContractError, divCeilN, invariant, getNumberFromBN, getBN, buildSendThrottler, prepareBaseInstructions, getMintAndProgram, ata, prepareWrappedAccount, createAndEstimateTransaction, prepareTransaction, checkOrCreateAtaBatch, pk, unwrapExecutionParams } from '@streamflow/common';
|
|
5
4
|
import { Program } from '@coral-xyz/anchor';
|
|
6
5
|
import * as borsh7 from '@coral-xyz/borsh';
|
|
7
6
|
import { Buffer as Buffer$1 } from 'buffer';
|