@medialane/sdk 0.35.0 → 0.35.1

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { Contract, hash, cairo, num, uint256, RpcProvider, TypedDataRevision, shortString, constants } from 'starknet';
2
+ import { hash, cairo, num, Contract, uint256, RpcProvider, TypedDataRevision, shortString, constants } from 'starknet';
3
3
 
4
4
  // src/config.ts
5
5
 
@@ -6317,13 +6317,19 @@ async function getCreatorCoinPrice(coinAddress, provider) {
6317
6317
  const quotePerCoin = (quoteIsToken0 ? 1 / priceT1perT0 : priceT1perT0) * decAdj;
6318
6318
  return { quotePerCoin, quoteToken, quoteSymbol: token?.symbol ?? null, quoteDecimals };
6319
6319
  }
6320
- var factoryContract = new Contract(
6321
- CreatorCoinFactoryABI,
6322
- CREATOR_COIN_FACTORY_CONTRACT_MAINNET
6323
- );
6320
+ var _factoryContract = null;
6321
+ function factoryContract() {
6322
+ if (!_factoryContract) {
6323
+ _factoryContract = new Contract(
6324
+ CreatorCoinFactoryABI,
6325
+ CREATOR_COIN_FACTORY_CONTRACT_MAINNET
6326
+ );
6327
+ }
6328
+ return _factoryContract;
6329
+ }
6324
6330
  function buildCreateCreatorCoinCall(params) {
6325
6331
  const salt = params.salt ?? BigInt("0x" + Date.now().toString(16));
6326
- return factoryContract.populate("create_creator_coin", [
6332
+ return factoryContract().populate("create_creator_coin", [
6327
6333
  params.owner,
6328
6334
  params.name,
6329
6335
  params.symbol,
@@ -6356,7 +6362,7 @@ function buildLaunchOnEkuboCalls(params) {
6356
6362
  calldata: [CREATOR_COIN_FACTORY_CONTRACT_MAINNET, amt.low, amt.high]
6357
6363
  });
6358
6364
  }
6359
- calls.push(factoryContract.populate("launch_on_ekubo", [launchParameters, ekuboParameters]));
6365
+ calls.push(factoryContract().populate("launch_on_ekubo", [launchParameters, ekuboParameters]));
6360
6366
  return calls;
6361
6367
  }
6362
6368
  var CREATOR_COIN_CREATED_SELECTOR = hash.getSelectorFromName("CreatorCoinCreated");