@medialane/sdk 0.162.0 → 0.162.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/starknet/index.cjs
CHANGED
|
@@ -11873,20 +11873,7 @@ async function waitUntilDeployed(provider, address, timeoutMs = 9e4, sleep = (ms
|
|
|
11873
11873
|
wait = Math.min(Math.round(wait * 1.5), 5e3);
|
|
11874
11874
|
}
|
|
11875
11875
|
}
|
|
11876
|
-
async function
|
|
11877
|
-
let sealed = options.forceNew ? null : deps.store.load();
|
|
11878
|
-
let privateKeyHex;
|
|
11879
|
-
if (!sealed) {
|
|
11880
|
-
onStep("creating-passkey");
|
|
11881
|
-
const created = await deps.passkey.createOwnerKey();
|
|
11882
|
-
sealed = created.sealed;
|
|
11883
|
-
privateKeyHex = created.privateKeyHex;
|
|
11884
|
-
deps.store.save(sealed);
|
|
11885
|
-
} else {
|
|
11886
|
-
privateKeyHex = await deps.passkey.unlockOwnerKey(sealed);
|
|
11887
|
-
}
|
|
11888
|
-
onStep("deploying");
|
|
11889
|
-
const wallet = { ownerAddress: sealed.address, ownerPubKey: sealed.ownerPubKey, privateKeyHex };
|
|
11876
|
+
async function deployWallet(deps, wallet) {
|
|
11890
11877
|
const sponsored = deps.deploySponsoredImpl ?? deploySponsored;
|
|
11891
11878
|
const selfFunded = deps.deploySelfFundedImpl ?? deploySelfFunded;
|
|
11892
11879
|
if (deps.deployProxyUrl) {
|
|
@@ -11909,7 +11896,26 @@ async function completeDeployment(deps, onStep, options = {}) {
|
|
|
11909
11896
|
} else {
|
|
11910
11897
|
await selfFunded({ provider: deps.provider(), ...wallet });
|
|
11911
11898
|
}
|
|
11912
|
-
await (deps.waitUntilDeployedImpl ?? waitUntilDeployed)(deps.provider(),
|
|
11899
|
+
await (deps.waitUntilDeployedImpl ?? waitUntilDeployed)(deps.provider(), wallet.ownerAddress);
|
|
11900
|
+
}
|
|
11901
|
+
async function completeDeployment(deps, onStep, options = {}) {
|
|
11902
|
+
let sealed = options.forceNew ? null : deps.store.load();
|
|
11903
|
+
let privateKeyHex;
|
|
11904
|
+
const wasStored = sealed !== null;
|
|
11905
|
+
if (!sealed) {
|
|
11906
|
+
onStep("creating-passkey");
|
|
11907
|
+
const created = await deps.passkey.createOwnerKey();
|
|
11908
|
+
sealed = created.sealed;
|
|
11909
|
+
privateKeyHex = created.privateKeyHex;
|
|
11910
|
+
deps.store.save(sealed);
|
|
11911
|
+
} else {
|
|
11912
|
+
privateKeyHex = await deps.passkey.unlockOwnerKey(sealed);
|
|
11913
|
+
}
|
|
11914
|
+
const onChain = wasStored ? await (deps.isDeployedImpl ?? isDeployed)(deps.provider(), sealed.address).catch(() => false) : false;
|
|
11915
|
+
if (!onChain) {
|
|
11916
|
+
onStep("deploying");
|
|
11917
|
+
await deployWallet(deps, { ownerAddress: sealed.address, ownerPubKey: sealed.ownerPubKey, privateKeyHex });
|
|
11918
|
+
}
|
|
11913
11919
|
onStep("signing-in");
|
|
11914
11920
|
const address = sealed.address;
|
|
11915
11921
|
const siwsToken = await (deps.requestSiwsTokenImpl ?? requestSiwsToken)({
|