@streamflow/common 11.0.4 → 11.0.5

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.
@@ -14,6 +14,8 @@ declare function assertHasPublicKey<T extends {
14
14
  publicKey: PublicKey;
15
15
  };
16
16
 
17
+ declare const isDev: boolean;
18
+
17
19
  /**
18
20
  * Used for conversion of token amounts to their Big Number representation.
19
21
  * Get Big Number representation in the smallest units from the same value in the highest units.
@@ -60,4 +62,4 @@ interface FetchTokenPriceOptions {
60
62
  }
61
63
  declare const fetchTokenPrice: (mintId: string, cluster?: ICluster, options?: FetchTokenPriceOptions) => Promise<TokenPriceResult>;
62
64
 
63
- export { type FetchTokenPriceOptions, ICluster, type TokenPriceResult, type TokensPricesResponse, assertHasPublicKey, divCeilN, fetchTokenPrice, getBN, getNumberFromBN, handleContractError, invariant, multiplyBigIntByNumber, sleep };
65
+ export { type FetchTokenPriceOptions, ICluster, type TokenPriceResult, type TokensPricesResponse, assertHasPublicKey, divCeilN, fetchTokenPrice, getBN, getNumberFromBN, handleContractError, invariant, isDev, multiplyBigIntByNumber, sleep };
@@ -14,6 +14,8 @@ declare function assertHasPublicKey<T extends {
14
14
  publicKey: PublicKey;
15
15
  };
16
16
 
17
+ declare const isDev: boolean;
18
+
17
19
  /**
18
20
  * Used for conversion of token amounts to their Big Number representation.
19
21
  * Get Big Number representation in the smallest units from the same value in the highest units.
@@ -60,4 +62,4 @@ interface FetchTokenPriceOptions {
60
62
  }
61
63
  declare const fetchTokenPrice: (mintId: string, cluster?: ICluster, options?: FetchTokenPriceOptions) => Promise<TokenPriceResult>;
62
64
 
63
- export { type FetchTokenPriceOptions, ICluster, type TokenPriceResult, type TokensPricesResponse, assertHasPublicKey, divCeilN, fetchTokenPrice, getBN, getNumberFromBN, handleContractError, invariant, multiplyBigIntByNumber, sleep };
65
+ export { type FetchTokenPriceOptions, ICluster, type TokenPriceResult, type TokensPricesResponse, assertHasPublicKey, divCeilN, fetchTokenPrice, getBN, getNumberFromBN, handleContractError, invariant, isDev, multiplyBigIntByNumber, sleep };
package/dist/esm/index.js CHANGED
@@ -2157,6 +2157,11 @@ var unwrapExecutionParams = ({ computeLimit, ...rest }, connection) => {
2157
2157
  return { ...rest, computeLimit: consumeLimitFn, skipSimulation: computeLimit === "autoSimulate" };
2158
2158
  };
2159
2159
 
2160
+ // lib/env.ts
2161
+ var isDev = process.env?.NODE_ENV === "development" || // @ts-expect-error - import.meta.env is not defined in the type definitions
2162
+ import.meta.env?.NODE_ENV === "development" || // @ts-expect-error - import.meta.env is not defined in the type definitions
2163
+ (import.meta.env?.DEV ?? false);
2164
+
2160
2165
  // lib/fetch-token-price.ts
2161
2166
  var fetchTokenPrice = async (mintId, cluster = "mainnet" /* Mainnet */, options) => {
2162
2167
  const url = `https://token-api.streamflow.finance/price?ids=${encodeURIComponent(mintId)}&cluster=${encodeURIComponent(cluster)}`;
@@ -2179,6 +2184,6 @@ var fetchTokenPrice = async (mintId, cluster = "mainnet" /* Mainnet */, options)
2179
2184
  }
2180
2185
  };
2181
2186
 
2182
- export { ContractError, ICluster, TransactionFailedError, assertHasPublicKey, ata, ataBatchExist, buildPartnerOracle, buildSendThrottler, checkOrCreateAtaBatch, confirmAndEnsureTransaction, createAndEstimateTransaction, createAtaBatch, createVersionedTransaction, deserializeRawTransaction, divCeilN, enrichAtaParams, estimateComputeUnitPrice, executeMultipleTransactions, executeTransaction, fetchTokenPrice, generateCreateAtaBatchTx, getBN, getFilters, getMintAndProgram, getMultipleAccountsInfoBatched, getNumberFromBN, getProgramAccounts, handleContractError, invariant, isSignerKeypair, isSignerWallet, isTransactionVersioned, multiplyBigIntByNumber, pk, prepareBaseInstructions, prepareTransaction, prepareWrappedAccount, resolveTransactionAccounts, sendAndConfirmTransaction, signAndExecuteTransaction, signTransaction, simulateTransaction, sleep, unwrapExecutionParams };
2187
+ export { ContractError, ICluster, TransactionFailedError, assertHasPublicKey, ata, ataBatchExist, buildPartnerOracle, buildSendThrottler, checkOrCreateAtaBatch, confirmAndEnsureTransaction, createAndEstimateTransaction, createAtaBatch, createVersionedTransaction, deserializeRawTransaction, divCeilN, enrichAtaParams, estimateComputeUnitPrice, executeMultipleTransactions, executeTransaction, fetchTokenPrice, generateCreateAtaBatchTx, getBN, getFilters, getMintAndProgram, getMultipleAccountsInfoBatched, getNumberFromBN, getProgramAccounts, handleContractError, invariant, isDev, isSignerKeypair, isSignerWallet, isTransactionVersioned, multiplyBigIntByNumber, pk, prepareBaseInstructions, prepareTransaction, prepareWrappedAccount, resolveTransactionAccounts, sendAndConfirmTransaction, signAndExecuteTransaction, signTransaction, simulateTransaction, sleep, unwrapExecutionParams };
2183
2188
  //# sourceMappingURL=index.js.map
2184
2189
  //# sourceMappingURL=index.js.map