@medialane/sdk 0.162.0 → 0.163.0
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.
|
@@ -8441,6 +8441,7 @@ interface DeploymentDeps {
|
|
|
8441
8441
|
deploySelfFundedImpl?: typeof deploySelfFunded;
|
|
8442
8442
|
requestSiwsTokenImpl?: typeof requestSiwsToken;
|
|
8443
8443
|
waitUntilDeployedImpl?: typeof waitUntilDeployed;
|
|
8444
|
+
isDeployedImpl?: typeof isDeployed;
|
|
8444
8445
|
}
|
|
8445
8446
|
declare function completeDeployment(deps: DeploymentDeps, onStep: (step: DeploymentStep) => void, options?: {
|
|
8446
8447
|
forceNew?: boolean;
|
package/dist/starknet/index.d.ts
CHANGED
|
@@ -8441,6 +8441,7 @@ interface DeploymentDeps {
|
|
|
8441
8441
|
deploySelfFundedImpl?: typeof deploySelfFunded;
|
|
8442
8442
|
requestSiwsTokenImpl?: typeof requestSiwsToken;
|
|
8443
8443
|
waitUntilDeployedImpl?: typeof waitUntilDeployed;
|
|
8444
|
+
isDeployedImpl?: typeof isDeployed;
|
|
8444
8445
|
}
|
|
8445
8446
|
declare function completeDeployment(deps: DeploymentDeps, onStep: (step: DeploymentStep) => void, options?: {
|
|
8446
8447
|
forceNew?: boolean;
|
package/dist/starknet/index.js
CHANGED
|
@@ -11600,6 +11600,10 @@ function createOwnerStore(config) {
|
|
|
11600
11600
|
return this.load()?.address ?? null;
|
|
11601
11601
|
},
|
|
11602
11602
|
save(sealed) {
|
|
11603
|
+
const previous = this.load();
|
|
11604
|
+
if (previous && previous.address !== sealed.address) {
|
|
11605
|
+
localStorage.setItem(`${storeKey}:${previous.address}`, JSON.stringify(previous));
|
|
11606
|
+
}
|
|
11603
11607
|
localStorage.setItem(storeKey, JSON.stringify(sealed));
|
|
11604
11608
|
announce();
|
|
11605
11609
|
},
|
|
@@ -11872,20 +11876,7 @@ async function waitUntilDeployed(provider, address, timeoutMs = 9e4, sleep = (ms
|
|
|
11872
11876
|
wait = Math.min(Math.round(wait * 1.5), 5e3);
|
|
11873
11877
|
}
|
|
11874
11878
|
}
|
|
11875
|
-
async function
|
|
11876
|
-
let sealed = options.forceNew ? null : deps.store.load();
|
|
11877
|
-
let privateKeyHex;
|
|
11878
|
-
if (!sealed) {
|
|
11879
|
-
onStep("creating-passkey");
|
|
11880
|
-
const created = await deps.passkey.createOwnerKey();
|
|
11881
|
-
sealed = created.sealed;
|
|
11882
|
-
privateKeyHex = created.privateKeyHex;
|
|
11883
|
-
deps.store.save(sealed);
|
|
11884
|
-
} else {
|
|
11885
|
-
privateKeyHex = await deps.passkey.unlockOwnerKey(sealed);
|
|
11886
|
-
}
|
|
11887
|
-
onStep("deploying");
|
|
11888
|
-
const wallet = { ownerAddress: sealed.address, ownerPubKey: sealed.ownerPubKey, privateKeyHex };
|
|
11879
|
+
async function deployWallet(deps, wallet) {
|
|
11889
11880
|
const sponsored = deps.deploySponsoredImpl ?? deploySponsored;
|
|
11890
11881
|
const selfFunded = deps.deploySelfFundedImpl ?? deploySelfFunded;
|
|
11891
11882
|
if (deps.deployProxyUrl) {
|
|
@@ -11908,7 +11899,25 @@ async function completeDeployment(deps, onStep, options = {}) {
|
|
|
11908
11899
|
} else {
|
|
11909
11900
|
await selfFunded({ provider: deps.provider(), ...wallet });
|
|
11910
11901
|
}
|
|
11911
|
-
await (deps.waitUntilDeployedImpl ?? waitUntilDeployed)(deps.provider(),
|
|
11902
|
+
await (deps.waitUntilDeployedImpl ?? waitUntilDeployed)(deps.provider(), wallet.ownerAddress);
|
|
11903
|
+
}
|
|
11904
|
+
async function completeDeployment(deps, onStep, options = {}) {
|
|
11905
|
+
let sealed = options.forceNew ? null : deps.store.load();
|
|
11906
|
+
if (sealed && await (deps.isDeployedImpl ?? isDeployed)(deps.provider(), sealed.address).catch(() => false)) {
|
|
11907
|
+
sealed = null;
|
|
11908
|
+
}
|
|
11909
|
+
let privateKeyHex;
|
|
11910
|
+
if (!sealed) {
|
|
11911
|
+
onStep("creating-passkey");
|
|
11912
|
+
const created = await deps.passkey.createOwnerKey();
|
|
11913
|
+
sealed = created.sealed;
|
|
11914
|
+
privateKeyHex = created.privateKeyHex;
|
|
11915
|
+
deps.store.save(sealed);
|
|
11916
|
+
} else {
|
|
11917
|
+
privateKeyHex = await deps.passkey.unlockOwnerKey(sealed);
|
|
11918
|
+
}
|
|
11919
|
+
onStep("deploying");
|
|
11920
|
+
await deployWallet(deps, { ownerAddress: sealed.address, ownerPubKey: sealed.ownerPubKey, privateKeyHex });
|
|
11912
11921
|
onStep("signing-in");
|
|
11913
11922
|
const address = sealed.address;
|
|
11914
11923
|
const siwsToken = await (deps.requestSiwsTokenImpl ?? requestSiwsToken)({
|