@streamflow/stream 9.3.4 → 9.4.0-alpha.p325.15b4539
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/{BaseStreamClient-CHsnYIS9.d.cts → BaseStreamClient-BRangMb7.d.cts} +5 -0
- package/dist/cjs/aptos/index.d.cts +2 -2
- package/dist/cjs/evm/index.d.cts +2 -2
- package/dist/cjs/{index-C23IQA_J.d.cts → index-BLHxwbFK.d.cts} +1 -1
- package/dist/cjs/{index-W_ordLlY.d.cts → index-Bk3BX3xT.d.cts} +1 -1
- package/dist/cjs/{index-BPXCu9SM.d.cts → index-CQ0MapA9.d.cts} +1 -1
- package/dist/cjs/{index-BUzIZ0Xt.d.cts → index-odfplH5I.d.cts} +48 -10
- package/dist/cjs/index.cjs +60 -22
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +10 -10
- package/dist/cjs/solana/index.cjs +57 -22
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +2 -2
- package/dist/cjs/sui/index.d.cts +2 -2
- package/dist/esm/{BaseStreamClient-CHsnYIS9.d.ts → BaseStreamClient-BRangMb7.d.ts} +5 -0
- package/dist/esm/aptos/index.d.ts +2 -2
- package/dist/esm/evm/index.d.ts +2 -2
- package/dist/esm/{index-NAVXCAs6.d.ts → index-C2SrwWri.d.ts} +1 -1
- package/dist/esm/{index-DeXLiSzq.d.ts → index-D_k66_bp.d.ts} +1 -1
- package/dist/esm/{index-Dy_mbGDE.d.ts → index-DfKoIGsU.d.ts} +48 -10
- package/dist/esm/{index-Qi50rkRx.d.ts → index-DnUf1qd8.d.ts} +1 -1
- package/dist/esm/index.d.ts +10 -10
- package/dist/esm/index.js +58 -23
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +2 -2
- package/dist/esm/solana/index.js +57 -22
- package/dist/esm/solana/index.js.map +1 -1
- package/dist/esm/sui/index.d.ts +2 -2
- package/package.json +4 -4
|
@@ -257,7 +257,12 @@ interface ITransactionResult {
|
|
|
257
257
|
ixs: (TransactionInstruction | Types.TransactionPayload)[];
|
|
258
258
|
txId: string;
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* Schema outlining vesting protocol fees.
|
|
262
|
+
*/
|
|
260
263
|
interface IFees {
|
|
264
|
+
creationFeeSol?: number;
|
|
265
|
+
autoClaimFeeSol?: number;
|
|
261
266
|
streamflowFee: number;
|
|
262
267
|
partnerFee: number;
|
|
263
268
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AptosStreamClient, C as ConfigResource, b as Contract, F as FeeTableResource, I as ICreateStreamAptosExt, a as ITransactionAptosExt, S as StreamResource, c as constants, A as default, e as extractAptosErrorCode, n as normalizeAptosAddress } from '../index-
|
|
2
|
-
import '../BaseStreamClient-
|
|
1
|
+
export { A as AptosStreamClient, C as ConfigResource, b as Contract, F as FeeTableResource, I as ICreateStreamAptosExt, a as ITransactionAptosExt, S as StreamResource, c as constants, A as default, e as extractAptosErrorCode, n as normalizeAptosAddress } from '../index-Bk3BX3xT.cjs';
|
|
2
|
+
import '../BaseStreamClient-BRangMb7.cjs';
|
|
3
3
|
import '@coral-xyz/anchor';
|
|
4
4
|
import '@solana/web3.js';
|
|
5
5
|
import '@streamflow/common';
|
package/dist/cjs/evm/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { a as EvmContract, E as EvmStreamClient, F as FeesAbiResult, S as StreamAbiResult, c as constants, E as default, _ as ercAbi, e as extractEvmErrorCode } from '../index-
|
|
1
|
+
export { a as EvmContract, E as EvmStreamClient, F as FeesAbiResult, S as StreamAbiResult, c as constants, E as default, _ as ercAbi, e as extractEvmErrorCode } from '../index-BLHxwbFK.cjs';
|
|
2
2
|
import 'ethers';
|
|
3
3
|
import 'bn.js';
|
|
4
|
-
import '../BaseStreamClient-
|
|
4
|
+
import '../BaseStreamClient-BRangMb7.cjs';
|
|
5
5
|
import '@coral-xyz/anchor';
|
|
6
6
|
import '@solana/web3.js';
|
|
7
7
|
import '@streamflow/common';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ethers, BigNumber } from 'ethers';
|
|
2
2
|
import BN from 'bn.js';
|
|
3
|
-
import { B as BaseStreamClient, I as ICreateStreamData, g as ICreateResult, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, r as IUpdateData, p as IGetOneData, S as Stream, q as IGetAllData, s as IGetFeesData, t as IFees, L as LinearStream, b as StreamType, G as ContractErrorCode } from './BaseStreamClient-
|
|
3
|
+
import { B as BaseStreamClient, I as ICreateStreamData, g as ICreateResult, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, r as IUpdateData, p as IGetOneData, S as Stream, q as IGetAllData, s as IGetFeesData, t as IFees, L as LinearStream, b as StreamType, G as ContractErrorCode } from './BaseStreamClient-BRangMb7.cjs';
|
|
4
4
|
import { IChain, ICluster } from '@streamflow/common';
|
|
5
5
|
|
|
6
6
|
declare class EvmStreamClient extends BaseStreamClient {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LinearStream, b as StreamType, B as BaseStreamClient, I as ICreateStreamData, g as ICreateResult, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, p as IGetOneData, r as IUpdateData, s as IGetFeesData, t as IFees } from './BaseStreamClient-
|
|
1
|
+
import { L as LinearStream, b as StreamType, B as BaseStreamClient, I as ICreateStreamData, g as ICreateResult, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, p as IGetOneData, r as IUpdateData, s as IGetFeesData, t as IFees } from './BaseStreamClient-BRangMb7.cjs';
|
|
2
2
|
import { WalletContextState } from '@manahippo/aptos-wallet-adapter';
|
|
3
3
|
import BN from 'bn.js';
|
|
4
4
|
import { AptosAccount } from 'aptos';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseStreamClient, N as ISuiIdParameters, I as ICreateStreamData, f as ICreateStreamSuiExt, g as ICreateResult, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, k as ITransactionSuiExt, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, p as IGetOneData, P as Contract, r as IUpdateData, s as IGetFeesData, t as IFees, Q as SuiErrorInfo, R as ClassResource, T as FeeTableResource, U as FeeValueResource, V as IContractCreated, W as IContractWithdrawn, X as StreamResource, Y as SuiParsedError, Z as SuiSignAndExecuteTransactionBlockInput } from './BaseStreamClient-
|
|
1
|
+
import { B as BaseStreamClient, N as ISuiIdParameters, I as ICreateStreamData, f as ICreateStreamSuiExt, g as ICreateResult, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, k as ITransactionSuiExt, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, p as IGetOneData, P as Contract, r as IUpdateData, s as IGetFeesData, t as IFees, Q as SuiErrorInfo, R as ClassResource, T as FeeTableResource, U as FeeValueResource, V as IContractCreated, W as IContractWithdrawn, X as StreamResource, Y as SuiParsedError, Z as SuiSignAndExecuteTransactionBlockInput } from './BaseStreamClient-BRangMb7.cjs';
|
|
2
2
|
import { ICluster } from '@streamflow/common';
|
|
3
3
|
import { SuiClient, GetTransactionBlockParams, SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
4
4
|
|
|
@@ -4,7 +4,7 @@ import { ITransactionSolanaExt, IProgramAccount, ConfirmationParams, ThrottlePar
|
|
|
4
4
|
import { IdlAccounts, IdlTypes, Program } from '@coral-xyz/anchor';
|
|
5
5
|
import { SignerWalletAdapter } from '@solana/wallet-adapter-base';
|
|
6
6
|
import BN from 'bn.js';
|
|
7
|
-
import { u as IRecipient, L as LinearStream, b as StreamType, A as AlignedStream, O as OracleTypeName, c as SolanaStreamClientOptions, B as BaseStreamClient, I as ICreateStreamData, g as ICreateResult, a as ICreateAlignedStreamData, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, p as IGetOneData, S as Stream, q as IGetAllData, r as IUpdateData, s as IGetFeesData, t as IFees } from './BaseStreamClient-
|
|
7
|
+
import { u as IRecipient, L as LinearStream, b as StreamType, A as AlignedStream, O as OracleTypeName, c as SolanaStreamClientOptions, B as BaseStreamClient, I as ICreateStreamData, g as ICreateResult, a as ICreateAlignedStreamData, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, p as IGetOneData, S as Stream, q as IGetAllData, r as IUpdateData, s as IGetFeesData, t as IFees } from './BaseStreamClient-BRangMb7.cjs';
|
|
8
8
|
import { StreamflowAlignedUnlocks } from './solana/descriptor/streamflow_aligned_unlocks.cjs';
|
|
9
9
|
import { ICluster, ContractError, IChain } from '@streamflow/common';
|
|
10
10
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
@@ -205,6 +205,8 @@ type ClientCreationOptions = Omit<SolanaStreamClientOptions, "chain" | "sendRate
|
|
|
205
205
|
declare class SolanaStreamClient extends BaseStreamClient {
|
|
206
206
|
private readonly connection;
|
|
207
207
|
private readonly programId;
|
|
208
|
+
private readonly partnerOracleProgramId;
|
|
209
|
+
private readonly feeOraclePublicKey;
|
|
208
210
|
private readonly commitment;
|
|
209
211
|
readonly alignedProxyProgram: Program<StreamflowAlignedUnlocks>;
|
|
210
212
|
private readonly schedulingParams;
|
|
@@ -492,6 +494,12 @@ declare class SolanaStreamClient extends BaseStreamClient {
|
|
|
492
494
|
* @returns Default streamflow fee
|
|
493
495
|
*/
|
|
494
496
|
getDefaultStreamflowFee(): Promise<number>;
|
|
497
|
+
/**
|
|
498
|
+
* Get all defaults fees applied by the protocol.
|
|
499
|
+
*
|
|
500
|
+
* Protocol will use fees set for WITHDRAWOR as default if they are set.
|
|
501
|
+
*/
|
|
502
|
+
getDefaultFees(): Promise<IFees>;
|
|
495
503
|
/**
|
|
496
504
|
* Extracts error code from an error
|
|
497
505
|
* @param {Error} err - Error
|
|
@@ -696,19 +704,32 @@ declare const ALIGNED_UNLOCKS_PROGRAM_ID: {
|
|
|
696
704
|
testnet: string;
|
|
697
705
|
local: string;
|
|
698
706
|
};
|
|
707
|
+
declare const PARTNER_ORACLE_PROGRAM_ID: {
|
|
708
|
+
devnet: string;
|
|
709
|
+
mainnet: string;
|
|
710
|
+
testnet: string;
|
|
711
|
+
local: string;
|
|
712
|
+
};
|
|
713
|
+
declare const FEE_ORACLE_PUBLIC_KEY: {
|
|
714
|
+
devnet: string;
|
|
715
|
+
mainnet: string;
|
|
716
|
+
testnet: string;
|
|
717
|
+
local: string;
|
|
718
|
+
};
|
|
699
719
|
declare const ALIGNED_COMPUTE_LIMIT = 300000;
|
|
700
720
|
declare const CONTRACT_DISCRIMINATOR: number[];
|
|
701
721
|
declare const TEST_ORACLE_DISCRIMINATOR: number[];
|
|
702
722
|
declare const CONTRACT_SEED: Buffer$1;
|
|
703
723
|
declare const ESCROW_SEED: Buffer$1;
|
|
704
724
|
declare const TEST_ORACLE_SEED: Buffer$1;
|
|
705
|
-
declare const PARTNER_ORACLE_PROGRAM_ID = "pardpVtPjC8nLj1Dwncew62mUzfChdCX1EaoZe8oCAa";
|
|
706
725
|
declare const STREAMFLOW_TREASURY_PUBLIC_KEY: PublicKey;
|
|
726
|
+
declare const WITHDRAWOR = "wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u";
|
|
707
727
|
declare const WITHDRAWOR_PUBLIC_KEY: PublicKey;
|
|
708
|
-
declare const FEE_ORACLE_PUBLIC_KEY: PublicKey;
|
|
709
728
|
declare const AIRDROP_TEST_TOKEN = "Gssm3vfi8s65R31SBdmQRq6cKeYojGgup7whkw4VCiQj";
|
|
710
729
|
declare const FEES_METADATA_SEED: Buffer$1;
|
|
711
|
-
declare const
|
|
730
|
+
declare const DEFAULT_CREATION_FEE_SOL = 90000000;
|
|
731
|
+
declare const DEFAULT_AUTO_CLAIM_FEE_SOL = 190000000;
|
|
732
|
+
declare const DEFAULT_STREAMFLOW_FEE = 0.19;
|
|
712
733
|
declare const AIRDROP_AMOUNT = 1;
|
|
713
734
|
declare const PARTNER_SCHEMA: {
|
|
714
735
|
struct: {
|
|
@@ -718,8 +739,15 @@ declare const PARTNER_SCHEMA: {
|
|
|
718
739
|
len: number;
|
|
719
740
|
};
|
|
720
741
|
};
|
|
721
|
-
|
|
722
|
-
|
|
742
|
+
creation_fee: string;
|
|
743
|
+
auto_claim_fee: string;
|
|
744
|
+
token_fee_percent: string;
|
|
745
|
+
buffer: {
|
|
746
|
+
array: {
|
|
747
|
+
type: string;
|
|
748
|
+
len: number;
|
|
749
|
+
};
|
|
750
|
+
};
|
|
723
751
|
};
|
|
724
752
|
};
|
|
725
753
|
declare const PARTNERS_SCHEMA: {
|
|
@@ -732,8 +760,15 @@ declare const PARTNERS_SCHEMA: {
|
|
|
732
760
|
len: number;
|
|
733
761
|
};
|
|
734
762
|
};
|
|
735
|
-
|
|
736
|
-
|
|
763
|
+
creation_fee: string;
|
|
764
|
+
auto_claim_fee: string;
|
|
765
|
+
token_fee_percent: string;
|
|
766
|
+
buffer: {
|
|
767
|
+
array: {
|
|
768
|
+
type: string;
|
|
769
|
+
len: number;
|
|
770
|
+
};
|
|
771
|
+
};
|
|
737
772
|
};
|
|
738
773
|
};
|
|
739
774
|
};
|
|
@@ -751,6 +786,8 @@ declare const constants_ALIGNED_UNLOCKS_PROGRAM_ID: typeof ALIGNED_UNLOCKS_PROGR
|
|
|
751
786
|
declare const constants_CONTRACT_DISCRIMINATOR: typeof CONTRACT_DISCRIMINATOR;
|
|
752
787
|
declare const constants_CONTRACT_SEED: typeof CONTRACT_SEED;
|
|
753
788
|
declare const constants_CREATE_PARAMS_PADDING: typeof CREATE_PARAMS_PADDING;
|
|
789
|
+
declare const constants_DEFAULT_AUTO_CLAIM_FEE_SOL: typeof DEFAULT_AUTO_CLAIM_FEE_SOL;
|
|
790
|
+
declare const constants_DEFAULT_CREATION_FEE_SOL: typeof DEFAULT_CREATION_FEE_SOL;
|
|
754
791
|
declare const constants_DEFAULT_STREAMFLOW_FEE: typeof DEFAULT_STREAMFLOW_FEE;
|
|
755
792
|
declare const constants_ESCROW_SEED: typeof ESCROW_SEED;
|
|
756
793
|
declare const constants_FEES_METADATA_SEED: typeof FEES_METADATA_SEED;
|
|
@@ -771,9 +808,10 @@ declare const constants_STREAM_STRUCT_OFFSET_SENDER: typeof STREAM_STRUCT_OFFSET
|
|
|
771
808
|
declare const constants_TEST_ORACLE_DISCRIMINATOR: typeof TEST_ORACLE_DISCRIMINATOR;
|
|
772
809
|
declare const constants_TEST_ORACLE_SEED: typeof TEST_ORACLE_SEED;
|
|
773
810
|
declare const constants_TX_FINALITY_CONFIRMED: typeof TX_FINALITY_CONFIRMED;
|
|
811
|
+
declare const constants_WITHDRAWOR: typeof WITHDRAWOR;
|
|
774
812
|
declare const constants_WITHDRAWOR_PUBLIC_KEY: typeof WITHDRAWOR_PUBLIC_KEY;
|
|
775
813
|
declare namespace constants {
|
|
776
|
-
export { constants_AIRDROP_AMOUNT as AIRDROP_AMOUNT, constants_AIRDROP_TEST_TOKEN as AIRDROP_TEST_TOKEN, constants_ALIGNED_COMPUTE_LIMIT as ALIGNED_COMPUTE_LIMIT, constants_ALIGNED_PRECISION_FACTOR_POW as ALIGNED_PRECISION_FACTOR_POW, constants_ALIGNED_UNLOCKS_PROGRAM_ID as ALIGNED_UNLOCKS_PROGRAM_ID, constants_CONTRACT_DISCRIMINATOR as CONTRACT_DISCRIMINATOR, constants_CONTRACT_SEED as CONTRACT_SEED, constants_CREATE_PARAMS_PADDING as CREATE_PARAMS_PADDING, constants_DEFAULT_STREAMFLOW_FEE as DEFAULT_STREAMFLOW_FEE, constants_ESCROW_SEED as ESCROW_SEED, constants_FEES_METADATA_SEED as FEES_METADATA_SEED, constants_FEE_ORACLE_PUBLIC_KEY as FEE_ORACLE_PUBLIC_KEY, constants_ORIGINAL_CONTRACT_SENDER_OFFSET as ORIGINAL_CONTRACT_SENDER_OFFSET, constants_PARTNERS_SCHEMA as PARTNERS_SCHEMA, constants_PARTNER_ORACLE_PROGRAM_ID as PARTNER_ORACLE_PROGRAM_ID, constants_PARTNER_SCHEMA as PARTNER_SCHEMA, constants_PROGRAM_ID as PROGRAM_ID, constants_SOLANA_ERROR_MAP as SOLANA_ERROR_MAP, constants_SOLANA_ERROR_MATCH_REGEX as SOLANA_ERROR_MATCH_REGEX, constants_STREAMFLOW_TREASURY_PUBLIC_KEY as STREAMFLOW_TREASURY_PUBLIC_KEY, constants_STREAM_STRUCT_OFFSETS as STREAM_STRUCT_OFFSETS, constants_STREAM_STRUCT_OFFSET_CLOSED as STREAM_STRUCT_OFFSET_CLOSED, constants_STREAM_STRUCT_OFFSET_MINT as STREAM_STRUCT_OFFSET_MINT, constants_STREAM_STRUCT_OFFSET_RECIPIENT as STREAM_STRUCT_OFFSET_RECIPIENT, constants_STREAM_STRUCT_OFFSET_SENDER as STREAM_STRUCT_OFFSET_SENDER, constants_TEST_ORACLE_DISCRIMINATOR as TEST_ORACLE_DISCRIMINATOR, constants_TEST_ORACLE_SEED as TEST_ORACLE_SEED, constants_TX_FINALITY_CONFIRMED as TX_FINALITY_CONFIRMED, constants_WITHDRAWOR_PUBLIC_KEY as WITHDRAWOR_PUBLIC_KEY };
|
|
814
|
+
export { constants_AIRDROP_AMOUNT as AIRDROP_AMOUNT, constants_AIRDROP_TEST_TOKEN as AIRDROP_TEST_TOKEN, constants_ALIGNED_COMPUTE_LIMIT as ALIGNED_COMPUTE_LIMIT, constants_ALIGNED_PRECISION_FACTOR_POW as ALIGNED_PRECISION_FACTOR_POW, constants_ALIGNED_UNLOCKS_PROGRAM_ID as ALIGNED_UNLOCKS_PROGRAM_ID, constants_CONTRACT_DISCRIMINATOR as CONTRACT_DISCRIMINATOR, constants_CONTRACT_SEED as CONTRACT_SEED, constants_CREATE_PARAMS_PADDING as CREATE_PARAMS_PADDING, constants_DEFAULT_AUTO_CLAIM_FEE_SOL as DEFAULT_AUTO_CLAIM_FEE_SOL, constants_DEFAULT_CREATION_FEE_SOL as DEFAULT_CREATION_FEE_SOL, constants_DEFAULT_STREAMFLOW_FEE as DEFAULT_STREAMFLOW_FEE, constants_ESCROW_SEED as ESCROW_SEED, constants_FEES_METADATA_SEED as FEES_METADATA_SEED, constants_FEE_ORACLE_PUBLIC_KEY as FEE_ORACLE_PUBLIC_KEY, constants_ORIGINAL_CONTRACT_SENDER_OFFSET as ORIGINAL_CONTRACT_SENDER_OFFSET, constants_PARTNERS_SCHEMA as PARTNERS_SCHEMA, constants_PARTNER_ORACLE_PROGRAM_ID as PARTNER_ORACLE_PROGRAM_ID, constants_PARTNER_SCHEMA as PARTNER_SCHEMA, constants_PROGRAM_ID as PROGRAM_ID, constants_SOLANA_ERROR_MAP as SOLANA_ERROR_MAP, constants_SOLANA_ERROR_MATCH_REGEX as SOLANA_ERROR_MATCH_REGEX, constants_STREAMFLOW_TREASURY_PUBLIC_KEY as STREAMFLOW_TREASURY_PUBLIC_KEY, constants_STREAM_STRUCT_OFFSETS as STREAM_STRUCT_OFFSETS, constants_STREAM_STRUCT_OFFSET_CLOSED as STREAM_STRUCT_OFFSET_CLOSED, constants_STREAM_STRUCT_OFFSET_MINT as STREAM_STRUCT_OFFSET_MINT, constants_STREAM_STRUCT_OFFSET_RECIPIENT as STREAM_STRUCT_OFFSET_RECIPIENT, constants_STREAM_STRUCT_OFFSET_SENDER as STREAM_STRUCT_OFFSET_SENDER, constants_TEST_ORACLE_DISCRIMINATOR as TEST_ORACLE_DISCRIMINATOR, constants_TEST_ORACLE_SEED as TEST_ORACLE_SEED, constants_TX_FINALITY_CONFIRMED as TX_FINALITY_CONFIRMED, constants_WITHDRAWOR as WITHDRAWOR, constants_WITHDRAWOR_PUBLIC_KEY as WITHDRAWOR_PUBLIC_KEY };
|
|
777
815
|
}
|
|
778
816
|
|
|
779
817
|
declare const _default: {
|
|
@@ -851,4 +889,4 @@ declare namespace index {
|
|
|
851
889
|
export { type index_Account as Account, index_AlignedContract as AlignedContract, type index_AlignedUnlocksContract as AlignedUnlocksContract, type index_BatchItem as BatchItem, type index_BatchItemError as BatchItemError, type index_BatchItemResult as BatchItemResult, type index_BatchItemSuccess as BatchItemSuccess, type index_ChangeOracleParams as ChangeOracleParams, type index_ClientCreationOptions as ClientCreationOptions, index_Contract as Contract, index_ContractError as ContractError, type index_CreateParams as CreateParams, type index_CreateTestOracleParams as CreateTestOracleParams, type index_DecodedStream as DecodedStream, index_IChain as IChain, index_ICluster as ICluster, type index_ICreateSolanaExt as ICreateSolanaExt, type index_ICreateStreamInstructions as ICreateStreamInstructions, type index_ICreateStreamSolanaExt as ICreateStreamSolanaExt, type index_IInteractStreamSolanaExt as IInteractStreamSolanaExt, type index_IPrepareCreateStreamSolanaExt as IPrepareCreateStreamSolanaExt, type index_IPrepareStreamSolanaExt as IPrepareStreamSolanaExt, type index_ISearchStreams as ISearchStreams, type index_ITopUpStreamSolanaExt as ITopUpStreamSolanaExt, type index_ITransactionSolanaExtWithInstructions as ITransactionSolanaExtWithInstructions, type index_InstructionGenerator as InstructionGenerator, type index_MetadataRecipientHashMap as MetadataRecipientHashMap, type index_OracleType as OracleType, index_SolanaStreamClient as SolanaStreamClient, type index_TestOracle as TestOracle, type index_UpdateTestOracleParams as UpdateTestOracleParams, index_cancelStreamInstruction as cancelStreamInstruction, index_constants as constants, index_createStreamInstruction as createStreamInstruction, index_createUncheckedStreamInstruction as createUncheckedStreamInstruction, index_decodeStream as decodeStream, index_deriveContractPDA as deriveContractPDA, index_deriveEscrowPDA as deriveEscrowPDA, index_deriveTestOraclePDA as deriveTestOraclePDA, index_extractSolanaErrorCode as extractSolanaErrorCode, index_sendAndConfirmStreamRawTransaction as sendAndConfirmStreamRawTransaction, index_signAllTransactionWithRecipients as signAllTransactionWithRecipients, _default as timelockIDL, index_topupStreamInstruction as topupStreamInstruction, index_transferStreamInstruction as transferStreamInstruction, index_updateStreamInstruction as updateStreamInstruction, index_withdrawStreamInstruction as withdrawStreamInstruction };
|
|
852
890
|
}
|
|
853
891
|
|
|
854
|
-
export { type
|
|
892
|
+
export { type UpdateTestOracleParams as $, ALIGNED_PRECISION_FACTOR_POW as A, constants as B, CREATE_PARAMS_PADDING as C, DEFAULT_CREATION_FEE_SOL as D, ESCROW_SEED as E, FEE_ORACLE_PUBLIC_KEY as F, type ClientCreationOptions as G, decodeStream as H, type ICreateStreamSolanaExt as I, signAllTransactionWithRecipients as J, sendAndConfirmStreamRawTransaction as K, extractSolanaErrorCode as L, deriveContractPDA as M, deriveEscrowPDA as N, ORIGINAL_CONTRACT_SENDER_OFFSET as O, PROGRAM_ID as P, deriveTestOraclePDA as Q, type AlignedUnlocksContract as R, SolanaStreamClient as S, TX_FINALITY_CONFIRMED as T, type OracleType as U, type TestOracle as V, WITHDRAWOR as W, type CreateParams as X, type ChangeOracleParams as Y, type CreateTestOracleParams as Z, _default as _, type IInteractStreamSolanaExt as a, type ISearchStreams as a0, type Account as a1, type ICreateSolanaExt as a2, type ITransactionSolanaExtWithInstructions as a3, type IPrepareCreateStreamSolanaExt as a4, type IPrepareStreamSolanaExt as a5, type ICreateStreamInstructions as a6, Contract as a7, AlignedContract as a8, type DecodedStream as a9, type MetadataRecipientHashMap as aa, type BatchItem as ab, type BatchItemSuccess as ac, type BatchItemError as ad, type BatchItemResult as ae, type InstructionGenerator as af, createStreamInstruction as ag, createUncheckedStreamInstruction as ah, withdrawStreamInstruction as ai, updateStreamInstruction as aj, cancelStreamInstruction as ak, transferStreamInstruction as al, topupStreamInstruction as am, type ITopUpStreamSolanaExt as b, STREAM_STRUCT_OFFSET_SENDER as c, STREAM_STRUCT_OFFSET_RECIPIENT as d, STREAM_STRUCT_OFFSET_MINT as e, STREAM_STRUCT_OFFSET_CLOSED as f, STREAM_STRUCT_OFFSETS as g, ALIGNED_UNLOCKS_PROGRAM_ID as h, index as i, PARTNER_ORACLE_PROGRAM_ID as j, ALIGNED_COMPUTE_LIMIT as k, CONTRACT_DISCRIMINATOR as l, TEST_ORACLE_DISCRIMINATOR as m, CONTRACT_SEED as n, TEST_ORACLE_SEED as o, STREAMFLOW_TREASURY_PUBLIC_KEY as p, WITHDRAWOR_PUBLIC_KEY as q, AIRDROP_TEST_TOKEN as r, FEES_METADATA_SEED as s, DEFAULT_AUTO_CLAIM_FEE_SOL as t, DEFAULT_STREAMFLOW_FEE as u, AIRDROP_AMOUNT as v, PARTNER_SCHEMA as w, PARTNERS_SCHEMA as x, SOLANA_ERROR_MATCH_REGEX as y, SOLANA_ERROR_MAP as z };
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -2732,6 +2732,8 @@ __export(constants_exports3, {
|
|
|
2732
2732
|
CONTRACT_DISCRIMINATOR: () => CONTRACT_DISCRIMINATOR,
|
|
2733
2733
|
CONTRACT_SEED: () => CONTRACT_SEED,
|
|
2734
2734
|
CREATE_PARAMS_PADDING: () => CREATE_PARAMS_PADDING,
|
|
2735
|
+
DEFAULT_AUTO_CLAIM_FEE_SOL: () => DEFAULT_AUTO_CLAIM_FEE_SOL,
|
|
2736
|
+
DEFAULT_CREATION_FEE_SOL: () => DEFAULT_CREATION_FEE_SOL,
|
|
2735
2737
|
DEFAULT_STREAMFLOW_FEE: () => DEFAULT_STREAMFLOW_FEE,
|
|
2736
2738
|
ESCROW_SEED: () => ESCROW_SEED,
|
|
2737
2739
|
FEES_METADATA_SEED: () => FEES_METADATA_SEED,
|
|
@@ -2752,6 +2754,7 @@ __export(constants_exports3, {
|
|
|
2752
2754
|
TEST_ORACLE_DISCRIMINATOR: () => TEST_ORACLE_DISCRIMINATOR,
|
|
2753
2755
|
TEST_ORACLE_SEED: () => TEST_ORACLE_SEED,
|
|
2754
2756
|
TX_FINALITY_CONFIRMED: () => TX_FINALITY_CONFIRMED,
|
|
2757
|
+
WITHDRAWOR: () => WITHDRAWOR,
|
|
2755
2758
|
WITHDRAWOR_PUBLIC_KEY: () => WITHDRAWOR_PUBLIC_KEY
|
|
2756
2759
|
});
|
|
2757
2760
|
var TX_FINALITY_CONFIRMED = "confirmed";
|
|
@@ -2780,25 +2783,40 @@ var ALIGNED_UNLOCKS_PROGRAM_ID = {
|
|
|
2780
2783
|
[common.ICluster.Testnet]: "aSTRM2NKoKxNnkmLWk9sz3k74gKBk9t7bpPrTGxMszH",
|
|
2781
2784
|
[common.ICluster.Local]: "aSTRM2NKoKxNnkmLWk9sz3k74gKBk9t7bpPrTGxMszH"
|
|
2782
2785
|
};
|
|
2786
|
+
var PARTNER_ORACLE_PROGRAM_ID = {
|
|
2787
|
+
[common.ICluster.Devnet]: "pardoTarcc6HKsPcbXkVycxsJsoN9QEzrdHgVdHAGY3",
|
|
2788
|
+
[common.ICluster.Mainnet]: "pardpVtPjC8nLj1Dwncew62mUzfChdCX1EaoZe8oCAa",
|
|
2789
|
+
[common.ICluster.Testnet]: "pardoTarcc6HKsPcbXkVycxsJsoN9QEzrdHgVdHAGY3",
|
|
2790
|
+
[common.ICluster.Local]: "pardoTarcc6HKsPcbXkVycxsJsoN9QEzrdHgVdHAGY3"
|
|
2791
|
+
};
|
|
2792
|
+
var FEE_ORACLE_PUBLIC_KEY = {
|
|
2793
|
+
[common.ICluster.Devnet]: "Aa2JJfFzUN3V54DXUHRBJowFw416xfZHpPk9DaNy3iYs",
|
|
2794
|
+
[common.ICluster.Mainnet]: "B743wFVk2pCYhV91cn287e1xY7f1vt4gdY48hhNiuQmT",
|
|
2795
|
+
[common.ICluster.Testnet]: "Aa2JJfFzUN3V54DXUHRBJowFw416xfZHpPk9DaNy3iYs",
|
|
2796
|
+
[common.ICluster.Local]: "Aa2JJfFzUN3V54DXUHRBJowFw416xfZHpPk9DaNy3iYs"
|
|
2797
|
+
};
|
|
2783
2798
|
var ALIGNED_COMPUTE_LIMIT = 3e5;
|
|
2784
2799
|
var CONTRACT_DISCRIMINATOR = [172, 138, 115, 242, 121, 67, 183, 26];
|
|
2785
2800
|
var TEST_ORACLE_DISCRIMINATOR = [198, 49, 63, 134, 232, 251, 168, 28];
|
|
2786
2801
|
var CONTRACT_SEED = buffer.Buffer.from("contract", "utf-8");
|
|
2787
2802
|
var ESCROW_SEED = buffer.Buffer.from("strm", "utf-8");
|
|
2788
2803
|
var TEST_ORACLE_SEED = buffer.Buffer.from("test-oracle", "utf-8");
|
|
2789
|
-
var PARTNER_ORACLE_PROGRAM_ID = "pardpVtPjC8nLj1Dwncew62mUzfChdCX1EaoZe8oCAa";
|
|
2790
2804
|
var STREAMFLOW_TREASURY_PUBLIC_KEY = new web3_js.PublicKey("5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw");
|
|
2791
|
-
var
|
|
2792
|
-
var
|
|
2805
|
+
var WITHDRAWOR = "wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u";
|
|
2806
|
+
var WITHDRAWOR_PUBLIC_KEY = new web3_js.PublicKey(WITHDRAWOR);
|
|
2793
2807
|
var AIRDROP_TEST_TOKEN = "Gssm3vfi8s65R31SBdmQRq6cKeYojGgup7whkw4VCiQj";
|
|
2794
2808
|
var FEES_METADATA_SEED = buffer.Buffer.from("strm_fees");
|
|
2795
|
-
var
|
|
2809
|
+
var DEFAULT_CREATION_FEE_SOL = 9e7;
|
|
2810
|
+
var DEFAULT_AUTO_CLAIM_FEE_SOL = 19e7;
|
|
2811
|
+
var DEFAULT_STREAMFLOW_FEE = 0.19;
|
|
2796
2812
|
var AIRDROP_AMOUNT = 1;
|
|
2797
2813
|
var PARTNER_SCHEMA = {
|
|
2798
2814
|
struct: {
|
|
2799
2815
|
pubkey: { array: { type: "u8", len: 32 } },
|
|
2800
|
-
|
|
2801
|
-
|
|
2816
|
+
creation_fee: "u32",
|
|
2817
|
+
auto_claim_fee: "u32",
|
|
2818
|
+
token_fee_percent: "f32",
|
|
2819
|
+
buffer: { array: { type: "u8", len: 16 } }
|
|
2802
2820
|
}
|
|
2803
2821
|
};
|
|
2804
2822
|
var PARTNERS_SCHEMA = { array: { type: PARTNER_SCHEMA } };
|
|
@@ -5114,6 +5132,8 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
5114
5132
|
this.commitment = commitment;
|
|
5115
5133
|
this.connection = new web3_js.Connection(optionsOrClusterUrl, this.commitment);
|
|
5116
5134
|
this.programId = programId !== "" ? new web3_js.PublicKey(programId) : new web3_js.PublicKey(PROGRAM_ID[cluster]);
|
|
5135
|
+
this.partnerOracleProgramId = new web3_js.PublicKey(PARTNER_ORACLE_PROGRAM_ID[cluster]);
|
|
5136
|
+
this.feeOraclePublicKey = new web3_js.PublicKey(FEE_ORACLE_PUBLIC_KEY[cluster]);
|
|
5117
5137
|
this.schedulingParams = {
|
|
5118
5138
|
sendThrottler: sendThrottler ?? solana.buildSendThrottler(sendRate)
|
|
5119
5139
|
};
|
|
@@ -5128,6 +5148,8 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
5128
5148
|
this.commitment = commitment2;
|
|
5129
5149
|
this.connection = new web3_js.Connection(clusterUrl, this.commitment);
|
|
5130
5150
|
this.programId = programId2 !== "" ? new web3_js.PublicKey(programId2) : new web3_js.PublicKey(PROGRAM_ID[cluster2]);
|
|
5151
|
+
this.partnerOracleProgramId = new web3_js.PublicKey(PARTNER_ORACLE_PROGRAM_ID[cluster2]);
|
|
5152
|
+
this.feeOraclePublicKey = new web3_js.PublicKey(FEE_ORACLE_PUBLIC_KEY[cluster2]);
|
|
5131
5153
|
const schedulingOptions = sendScheduler && "sendRate" in sendScheduler ? sendScheduler : void 0;
|
|
5132
5154
|
const sendThrottler2 = !sendScheduler ? solana.buildSendThrottler(1) : "sendRate" in sendScheduler ? solana.buildSendThrottler(sendScheduler.sendRate ?? 1, sendScheduler.sendInterval) : sendScheduler;
|
|
5133
5155
|
this.schedulingParams = {
|
|
@@ -5351,7 +5373,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
5351
5373
|
partner: partnerPublicKey,
|
|
5352
5374
|
recipient: recipientPublicKey,
|
|
5353
5375
|
withdrawor: WITHDRAWOR_PUBLIC_KEY,
|
|
5354
|
-
feeOracle:
|
|
5376
|
+
feeOracle: this.feeOraclePublicKey,
|
|
5355
5377
|
priceOracle: oracle,
|
|
5356
5378
|
tokenProgram: tokenProgramId,
|
|
5357
5379
|
streamflowProgram: this.programId
|
|
@@ -5442,7 +5464,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
5442
5464
|
partner: partnerPublicKey,
|
|
5443
5465
|
partnerTokens,
|
|
5444
5466
|
mint: new web3_js.PublicKey(mint),
|
|
5445
|
-
feeOracle:
|
|
5467
|
+
feeOracle: this.feeOraclePublicKey,
|
|
5446
5468
|
rent: web3_js.SYSVAR_RENT_PUBKEY,
|
|
5447
5469
|
timelockProgram: this.programId,
|
|
5448
5470
|
tokenProgram: tokenProgramId,
|
|
@@ -5569,7 +5591,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
5569
5591
|
metadata: metadataPubKey,
|
|
5570
5592
|
escrowTokens,
|
|
5571
5593
|
mint: new web3_js.PublicKey(mint),
|
|
5572
|
-
feeOracle:
|
|
5594
|
+
feeOracle: this.feeOraclePublicKey,
|
|
5573
5595
|
rent: web3_js.SYSVAR_RENT_PUBKEY,
|
|
5574
5596
|
timelockProgram: this.programId,
|
|
5575
5597
|
tokenProgram: tokenProgramId,
|
|
@@ -6375,30 +6397,43 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
6375
6397
|
* @returns Fees
|
|
6376
6398
|
*/
|
|
6377
6399
|
async getFees({ address }) {
|
|
6378
|
-
const
|
|
6379
|
-
[buffer.Buffer.from(FEES_METADATA_SEED)],
|
|
6380
|
-
new web3_js.PublicKey(PARTNER_ORACLE_PROGRAM_ID)
|
|
6381
|
-
);
|
|
6382
|
-
const data = await this.connection.getAccountInfo(metadataPubKey);
|
|
6400
|
+
const data = await this.connection.getAccountInfo(this.feeOraclePublicKey);
|
|
6383
6401
|
if (!data) {
|
|
6384
6402
|
return null;
|
|
6385
6403
|
}
|
|
6386
6404
|
const partners = borsh__namespace.deserialize(PARTNERS_SCHEMA, data.data);
|
|
6387
|
-
const
|
|
6388
|
-
|
|
6389
|
-
|
|
6405
|
+
for (const partner of partners) {
|
|
6406
|
+
const partnerAddress = new web3_js.PublicKey(partner.pubkey).toString();
|
|
6407
|
+
if (partnerAddress === address) {
|
|
6408
|
+
return {
|
|
6409
|
+
creationFeeSol: Number(partner.creation_fee),
|
|
6410
|
+
autoClaimFeeSol: Number(partner.auto_claim_fee),
|
|
6411
|
+
streamflowFee: Number(partner.token_fee_percent.toFixed(4)),
|
|
6412
|
+
partnerFee: 0
|
|
6413
|
+
};
|
|
6414
|
+
}
|
|
6390
6415
|
}
|
|
6391
|
-
return
|
|
6392
|
-
streamflowFee: Number(filteredPartners[0].strm_fee.toFixed(4)),
|
|
6393
|
-
partnerFee: Number(filteredPartners[0].partner_fee.toFixed(4))
|
|
6394
|
-
};
|
|
6416
|
+
return null;
|
|
6395
6417
|
}
|
|
6396
6418
|
/**
|
|
6397
6419
|
* Gets default streamflow fee
|
|
6398
6420
|
* @returns Default streamflow fee
|
|
6399
6421
|
*/
|
|
6400
6422
|
async getDefaultStreamflowFee() {
|
|
6401
|
-
return
|
|
6423
|
+
return (await this.getDefaultFees()).streamflowFee;
|
|
6424
|
+
}
|
|
6425
|
+
/**
|
|
6426
|
+
* Get all defaults fees applied by the protocol.
|
|
6427
|
+
*
|
|
6428
|
+
* Protocol will use fees set for WITHDRAWOR as default if they are set.
|
|
6429
|
+
*/
|
|
6430
|
+
async getDefaultFees() {
|
|
6431
|
+
return await this.getFees({ address: WITHDRAWOR }) || {
|
|
6432
|
+
creationFeeSol: DEFAULT_CREATION_FEE_SOL,
|
|
6433
|
+
autoClaimFeeSol: DEFAULT_AUTO_CLAIM_FEE_SOL,
|
|
6434
|
+
streamflowFee: DEFAULT_STREAMFLOW_FEE,
|
|
6435
|
+
partnerFee: 0
|
|
6436
|
+
};
|
|
6402
6437
|
}
|
|
6403
6438
|
/**
|
|
6404
6439
|
* Extracts error code from an error
|
|
@@ -7707,6 +7742,8 @@ exports.CONTRACT_DISCRIMINATOR = CONTRACT_DISCRIMINATOR;
|
|
|
7707
7742
|
exports.CONTRACT_SEED = CONTRACT_SEED;
|
|
7708
7743
|
exports.CREATE_PARAMS_PADDING = CREATE_PARAMS_PADDING;
|
|
7709
7744
|
exports.ContractErrorCode = ContractErrorCode;
|
|
7745
|
+
exports.DEFAULT_AUTO_CLAIM_FEE_SOL = DEFAULT_AUTO_CLAIM_FEE_SOL;
|
|
7746
|
+
exports.DEFAULT_CREATION_FEE_SOL = DEFAULT_CREATION_FEE_SOL;
|
|
7710
7747
|
exports.DEFAULT_STREAMFLOW_FEE = DEFAULT_STREAMFLOW_FEE;
|
|
7711
7748
|
exports.ESCROW_SEED = ESCROW_SEED;
|
|
7712
7749
|
exports.FEES_METADATA_SEED = FEES_METADATA_SEED;
|
|
@@ -7737,6 +7774,7 @@ exports.StreamflowSui = sui_exports;
|
|
|
7737
7774
|
exports.TEST_ORACLE_DISCRIMINATOR = TEST_ORACLE_DISCRIMINATOR;
|
|
7738
7775
|
exports.TEST_ORACLE_SEED = TEST_ORACLE_SEED;
|
|
7739
7776
|
exports.TX_FINALITY_CONFIRMED = TX_FINALITY_CONFIRMED;
|
|
7777
|
+
exports.WITHDRAWOR = WITHDRAWOR;
|
|
7740
7778
|
exports.WITHDRAWOR_PUBLIC_KEY = WITHDRAWOR_PUBLIC_KEY;
|
|
7741
7779
|
exports.WITHDRAW_AVAILABLE_AMOUNT = WITHDRAW_AVAILABLE_AMOUNT;
|
|
7742
7780
|
exports.buildStreamType = buildStreamType;
|