@medialane/sdk 0.161.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.
@@ -1,5 +1,5 @@
1
- import { bB as ResolvedConfig, aY as CreatePopCollectionParams, bI as TxResult, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bm as MintTicketsParams, aW as CreateMembershipParams, bl as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, by as ProposeSponsorshipParams, k as ApiClient, bj as MedialaneConfig, bk as MedialaneErrorCode, br as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bO as SealedOwner, bP as ReceiptProviderLike, bQ as WalletExecutor, bR as ExecutedTransaction, bS as PasskeyOwner, bT as CreatedOwner } from '../errors-B8xAxhKE.cjs';
2
- export { bU as InvalidRecoveryKeyError, bV as OwnerSigner, bu as PasskeyCancelledError, bW as PasskeyConfig, bv as PasskeyUnsupportedError, bw as PasskeyUnsupportedReason, bX as RecoveryKey, bK as UserFacingError, bY as createPasskeyOwner, bZ as encodeRecoveryKey, b_ as parseRecoveryKey } from '../errors-B8xAxhKE.cjs';
1
+ import { bB as ResolvedConfig, aY as CreatePopCollectionParams, bI as TxResult, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bm as MintTicketsParams, aW as CreateMembershipParams, bl as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, by as ProposeSponsorshipParams, k as ApiClient, bj as MedialaneConfig, bk as MedialaneErrorCode, br as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bO as SealedOwner, bP as ReceiptProviderLike, bQ as WalletExecutor, bR as ExecutedTransaction, bS as PasskeyOwner, bT as CreatedOwner } from '../errors-BqEIRoRE.cjs';
2
+ export { bU as InvalidRecoveryKeyError, bV as OwnerSigner, bu as PasskeyCancelledError, bW as PasskeyConfig, bv as PasskeyUnsupportedError, bw as PasskeyUnsupportedReason, bX as RecoveryKey, bK as UserFacingError, bY as createPasskeyOwner, bZ as encodeRecoveryKey, b_ as parseRecoveryKey } from '../errors-BqEIRoRE.cjs';
3
3
  import { AccountInterface, ProviderInterface, Call, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
4
4
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-PPshMWr7.cjs';
5
5
  import 'zod';
@@ -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;
@@ -1,5 +1,5 @@
1
- import { bB as ResolvedConfig, aY as CreatePopCollectionParams, bI as TxResult, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bm as MintTicketsParams, aW as CreateMembershipParams, bl as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, by as ProposeSponsorshipParams, k as ApiClient, bj as MedialaneConfig, bk as MedialaneErrorCode, br as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bO as SealedOwner, bP as ReceiptProviderLike, bQ as WalletExecutor, bR as ExecutedTransaction, bS as PasskeyOwner, bT as CreatedOwner } from '../errors-CBIdzKXr.js';
2
- export { bU as InvalidRecoveryKeyError, bV as OwnerSigner, bu as PasskeyCancelledError, bW as PasskeyConfig, bv as PasskeyUnsupportedError, bw as PasskeyUnsupportedReason, bX as RecoveryKey, bK as UserFacingError, bY as createPasskeyOwner, bZ as encodeRecoveryKey, b_ as parseRecoveryKey } from '../errors-CBIdzKXr.js';
1
+ import { bB as ResolvedConfig, aY as CreatePopCollectionParams, bI as TxResult, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bm as MintTicketsParams, aW as CreateMembershipParams, bl as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, by as ProposeSponsorshipParams, k as ApiClient, bj as MedialaneConfig, bk as MedialaneErrorCode, br as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bO as SealedOwner, bP as ReceiptProviderLike, bQ as WalletExecutor, bR as ExecutedTransaction, bS as PasskeyOwner, bT as CreatedOwner } from '../errors-DM_aST08.js';
2
+ export { bU as InvalidRecoveryKeyError, bV as OwnerSigner, bu as PasskeyCancelledError, bW as PasskeyConfig, bv as PasskeyUnsupportedError, bw as PasskeyUnsupportedReason, bX as RecoveryKey, bK as UserFacingError, bY as createPasskeyOwner, bZ as encodeRecoveryKey, b_ as parseRecoveryKey } from '../errors-DM_aST08.js';
3
3
  import { AccountInterface, ProviderInterface, Call, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
4
4
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-PPshMWr7.js';
5
5
  import 'zod';
@@ -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;
@@ -1,5 +1,5 @@
1
- import { normalizeAddress, collectionHref, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, starkKeyPairFromPrivateKey, createFailoverFetch } from '../chunk-QRIOXXO6.js';
2
- export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-QRIOXXO6.js';
1
+ import { normalizeAddress, collectionHref, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, starkKeyPairFromPrivateKey, createFailoverFetch } from '../chunk-3WJPE76T.js';
2
+ export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-3WJPE76T.js';
3
3
  import { getStarknetCoordinates, getCoordinates } from '../chunk-PBJLHXDB.js';
4
4
  import { hash, cairo, uint256, RpcProvider, CairoOption, CairoOptionVariant, num, ec, validateAndParseAddress, Account, typedData, stark, CallData, byteArray, Contract, TypedDataRevision, constants, shortString } from 'starknet';
5
5
  import { extract, expand } from '@noble/hashes/hkdf.js';
@@ -11872,20 +11872,7 @@ async function waitUntilDeployed(provider, address, timeoutMs = 9e4, sleep = (ms
11872
11872
  wait = Math.min(Math.round(wait * 1.5), 5e3);
11873
11873
  }
11874
11874
  }
11875
- async function completeDeployment(deps, onStep, options = {}) {
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 };
11875
+ async function deployWallet(deps, wallet) {
11889
11876
  const sponsored = deps.deploySponsoredImpl ?? deploySponsored;
11890
11877
  const selfFunded = deps.deploySelfFundedImpl ?? deploySelfFunded;
11891
11878
  if (deps.deployProxyUrl) {
@@ -11908,7 +11895,26 @@ async function completeDeployment(deps, onStep, options = {}) {
11908
11895
  } else {
11909
11896
  await selfFunded({ provider: deps.provider(), ...wallet });
11910
11897
  }
11911
- await (deps.waitUntilDeployedImpl ?? waitUntilDeployed)(deps.provider(), sealed.address);
11898
+ await (deps.waitUntilDeployedImpl ?? waitUntilDeployed)(deps.provider(), wallet.ownerAddress);
11899
+ }
11900
+ async function completeDeployment(deps, onStep, options = {}) {
11901
+ let sealed = options.forceNew ? null : deps.store.load();
11902
+ let privateKeyHex;
11903
+ const wasStored = sealed !== null;
11904
+ if (!sealed) {
11905
+ onStep("creating-passkey");
11906
+ const created = await deps.passkey.createOwnerKey();
11907
+ sealed = created.sealed;
11908
+ privateKeyHex = created.privateKeyHex;
11909
+ deps.store.save(sealed);
11910
+ } else {
11911
+ privateKeyHex = await deps.passkey.unlockOwnerKey(sealed);
11912
+ }
11913
+ const onChain = wasStored ? await (deps.isDeployedImpl ?? isDeployed)(deps.provider(), sealed.address).catch(() => false) : false;
11914
+ if (!onChain) {
11915
+ onStep("deploying");
11916
+ await deployWallet(deps, { ownerAddress: sealed.address, ownerPubKey: sealed.ownerPubKey, privateKeyHex });
11917
+ }
11912
11918
  onStep("signing-in");
11913
11919
  const address = sealed.address;
11914
11920
  const siwsToken = await (deps.requestSiwsTokenImpl ?? requestSiwsToken)({