@medialane/sdk 0.122.0 → 0.122.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.
@@ -12707,6 +12707,20 @@ async function deploySelfFunded(input) {
12707
12707
  });
12708
12708
  return { transactionHash: transaction_hash };
12709
12709
  }
12710
+ async function waitUntilDeployed(provider, address, timeoutMs = 9e4, sleep2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms))) {
12711
+ const deadline = Date.now() + timeoutMs;
12712
+ let wait = 1e3;
12713
+ for (; ; ) {
12714
+ if (await isDeployed(provider, address)) return;
12715
+ if (Date.now() >= deadline) {
12716
+ throw new Error(
12717
+ "Your wallet was submitted but has not appeared on Starknet yet. Please try again in a moment."
12718
+ );
12719
+ }
12720
+ await sleep2(wait);
12721
+ wait = Math.min(Math.round(wait * 1.5), 5e3);
12722
+ }
12723
+ }
12710
12724
  async function completeDeployment(deps, onStep, options = {}) {
12711
12725
  let sealed = options.forceNew ? null : deps.store.load();
12712
12726
  let privateKeyHex;
@@ -12743,6 +12757,7 @@ async function completeDeployment(deps, onStep, options = {}) {
12743
12757
  } else {
12744
12758
  await selfFunded({ provider: deps.provider(), ...wallet });
12745
12759
  }
12760
+ await (deps.waitUntilDeployedImpl ?? waitUntilDeployed)(deps.provider(), sealed.address);
12746
12761
  onStep("signing-in");
12747
12762
  const address = sealed.address;
12748
12763
  const siwsToken = await (deps.requestSiwsTokenImpl ?? requestSiwsToken)({
@@ -13006,5 +13021,6 @@ exports.validateCoinSupply = validateSupply;
13006
13021
  exports.validateCoinSymbol = validateSymbol;
13007
13022
  exports.validatePrice = validatePrice;
13008
13023
  exports.verifyAdminRequestSig = verifyAdminRequestSig;
13024
+ exports.waitUntilDeployed = waitUntilDeployed;
13009
13025
  //# sourceMappingURL=index.cjs.map
13010
13026
  //# sourceMappingURL=index.cjs.map