@medialane/sdk 0.127.0 → 0.129.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.
- package/dist/{services-9dR1FQF_.d.ts → errors-DQJIxfVu.d.ts} +6 -3
- package/dist/{services-CzBHF_gq.d.cts → errors-Fgqpww_8.d.cts} +6 -3
- package/dist/index.cjs +13 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -9
- package/dist/index.js.map +1 -1
- package/dist/starknet/index.cjs +15 -10
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +2 -2
- package/dist/starknet/index.d.ts +2 -2
- package/dist/starknet/index.js +15 -11
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bi as ResolvedConfig, bq as TxResult, aD as CreatePopCollectionParams, ao as ClaimConditions, az as CreateDropParams, aI as CreateTicketParams, b2 as MintTicketsParams, aB as CreateMembershipParams, b1 as MintMembershipsParams, aG as CreateSponsorshipOfferParams, bf as ProposeSponsorshipParams, l as ApiClient, a$ as MedialaneConfig, b0 as MedialaneErrorCode, b7 as OrderDetails, R as ResolvedFeeConfig, F as ApiIntentCreated,
|
|
2
|
-
export {
|
|
1
|
+
import { bi as ResolvedConfig, bq as TxResult, aD as CreatePopCollectionParams, ao as ClaimConditions, az as CreateDropParams, aI as CreateTicketParams, b2 as MintTicketsParams, aB as CreateMembershipParams, b1 as MintMembershipsParams, aG as CreateSponsorshipOfferParams, bf as ProposeSponsorshipParams, l as ApiClient, a$ as MedialaneConfig, b0 as MedialaneErrorCode, b7 as OrderDetails, R as ResolvedFeeConfig, F as ApiIntentCreated, by as SealedOwner, bz as ReceiptProviderLike, bA as WalletExecutor, bB as ExecutedTransaction, bC as PasskeyOwner } from '../errors-Fgqpww_8.cjs';
|
|
2
|
+
export { bD as CreatedOwner, bE as OwnerSigner, ba as PasskeyCancelledError, bF as PasskeyConfig, bs as UserFacingError, bG as createPasskeyOwner } from '../errors-Fgqpww_8.cjs';
|
|
3
3
|
import { AccountInterface, Call, ProviderInterface, 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-CuSlc_YE.cjs';
|
|
5
5
|
import 'zod';
|
package/dist/starknet/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bi as ResolvedConfig, bq as TxResult, aD as CreatePopCollectionParams, ao as ClaimConditions, az as CreateDropParams, aI as CreateTicketParams, b2 as MintTicketsParams, aB as CreateMembershipParams, b1 as MintMembershipsParams, aG as CreateSponsorshipOfferParams, bf as ProposeSponsorshipParams, l as ApiClient, a$ as MedialaneConfig, b0 as MedialaneErrorCode, b7 as OrderDetails, R as ResolvedFeeConfig, F as ApiIntentCreated,
|
|
2
|
-
export {
|
|
1
|
+
import { bi as ResolvedConfig, bq as TxResult, aD as CreatePopCollectionParams, ao as ClaimConditions, az as CreateDropParams, aI as CreateTicketParams, b2 as MintTicketsParams, aB as CreateMembershipParams, b1 as MintMembershipsParams, aG as CreateSponsorshipOfferParams, bf as ProposeSponsorshipParams, l as ApiClient, a$ as MedialaneConfig, b0 as MedialaneErrorCode, b7 as OrderDetails, R as ResolvedFeeConfig, F as ApiIntentCreated, by as SealedOwner, bz as ReceiptProviderLike, bA as WalletExecutor, bB as ExecutedTransaction, bC as PasskeyOwner } from '../errors-DQJIxfVu.js';
|
|
2
|
+
export { bD as CreatedOwner, bE as OwnerSigner, ba as PasskeyCancelledError, bF as PasskeyConfig, bs as UserFacingError, bG as createPasskeyOwner } from '../errors-DQJIxfVu.js';
|
|
3
3
|
import { AccountInterface, Call, ProviderInterface, 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-CuSlc_YE.js';
|
|
5
5
|
import 'zod';
|
package/dist/starknet/index.js
CHANGED
|
@@ -246,12 +246,11 @@ function deriveErrorCode(status) {
|
|
|
246
246
|
return "UNKNOWN";
|
|
247
247
|
}
|
|
248
248
|
var MedialaneApiError = class extends Error {
|
|
249
|
-
constructor(status, message, retryAfterMs, details
|
|
249
|
+
constructor(status, message, retryAfterMs, details) {
|
|
250
250
|
super(message);
|
|
251
251
|
this.status = status;
|
|
252
252
|
this.retryAfterMs = retryAfterMs;
|
|
253
253
|
this.details = details;
|
|
254
|
-
this.isAuthored = isAuthored;
|
|
255
254
|
this.name = "MedialaneApiError";
|
|
256
255
|
this.code = deriveErrorCode(status);
|
|
257
256
|
}
|
|
@@ -288,14 +287,12 @@ var ApiClient = class {
|
|
|
288
287
|
});
|
|
289
288
|
if (!response.ok && !allowed(response.status)) {
|
|
290
289
|
const text = await response.text().catch(() => response.statusText);
|
|
291
|
-
let message =
|
|
292
|
-
let details;
|
|
293
|
-
let isAuthored = false;
|
|
290
|
+
let message = `Request failed with status ${response.status}`;
|
|
291
|
+
let details = text;
|
|
294
292
|
try {
|
|
295
293
|
const body = JSON.parse(text);
|
|
296
294
|
if (typeof body.error === "string" && body.error.trim() !== "") {
|
|
297
295
|
message = body.error;
|
|
298
|
-
isAuthored = true;
|
|
299
296
|
}
|
|
300
297
|
details = body;
|
|
301
298
|
} catch {
|
|
@@ -304,8 +301,7 @@ var ApiClient = class {
|
|
|
304
301
|
response.status,
|
|
305
302
|
message,
|
|
306
303
|
parseRetryAfter(response.headers.get("retry-after")),
|
|
307
|
-
details
|
|
308
|
-
isAuthored
|
|
304
|
+
details
|
|
309
305
|
);
|
|
310
306
|
}
|
|
311
307
|
return response;
|
|
@@ -11620,6 +11616,14 @@ async function requestSiwsToken({
|
|
|
11620
11616
|
return token;
|
|
11621
11617
|
}
|
|
11622
11618
|
|
|
11619
|
+
// src/errors.ts
|
|
11620
|
+
var UserFacingError = class extends Error {
|
|
11621
|
+
constructor(message) {
|
|
11622
|
+
super(message);
|
|
11623
|
+
this.name = "UserFacingError";
|
|
11624
|
+
}
|
|
11625
|
+
};
|
|
11626
|
+
|
|
11623
11627
|
// src/starknet/services/executeIntent.ts
|
|
11624
11628
|
async function confirmIntentBestEffort(client, intentId, txHash) {
|
|
11625
11629
|
await client.api.confirmIntent(intentId, txHash).catch(() => {
|
|
@@ -11649,14 +11653,14 @@ async function assertTransactionSucceeded(provider, txHash, retryDelaysMs = RECE
|
|
|
11649
11653
|
const receipt = await provider.getTransactionReceipt(txHash);
|
|
11650
11654
|
const status = receipt.execution_status ?? receipt.status;
|
|
11651
11655
|
if (status === "REVERTED" || status === "REJECTED") {
|
|
11652
|
-
throw new
|
|
11656
|
+
throw new UserFacingError("Transaction was submitted but reverted onchain. Please check your balance and try again.");
|
|
11653
11657
|
}
|
|
11654
11658
|
if (status) return receipt;
|
|
11655
11659
|
} catch (err) {
|
|
11656
11660
|
if (err instanceof Error && err.message.includes("reverted onchain")) throw err;
|
|
11657
11661
|
}
|
|
11658
11662
|
}
|
|
11659
|
-
throw new
|
|
11663
|
+
throw new UserFacingError("Verification timed out. Check your account for the transaction status.");
|
|
11660
11664
|
}
|
|
11661
11665
|
async function executeIntent(provider, signer, client, intent, opts = {}) {
|
|
11662
11666
|
let calls;
|
|
@@ -12889,6 +12893,6 @@ function createMediaWallet(config) {
|
|
|
12889
12893
|
};
|
|
12890
12894
|
}
|
|
12891
12895
|
|
|
12892
|
-
export { ADMIN_HEADERS, ADMIN_SCOPE, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreatorCoinFactoryABI, CreatorCoinService, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidStarkPrivateKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PasskeyCancelledError, PopService, SUGGESTED_DEFAULT_PRICE, SponsoredCallRejectedError, SponsorshipService, StarknetVenue, TicketService, VALIDATED_EKUBO_PARAMS, accountFor, adminRequestDigest, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createAdminSessionGrant, createMediaWallet, createOwnerStore, createPasskeyOwner, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, encodeAdminHeaders, encodeByteArray, encodePairingPayload, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isRecoveryKeyForWallet, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerAliveTypedData, ownerConstructorCalldata, parseAccountAddress, parseAdminHeaders, parseCreatorCoinCreated, parsePairingPayload, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, selfFundedExecutor, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, userMayPayInstead, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyAdminRequestSig, waitUntilDeployed };
|
|
12896
|
+
export { ADMIN_HEADERS, ADMIN_SCOPE, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreatorCoinFactoryABI, CreatorCoinService, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidStarkPrivateKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PasskeyCancelledError, PopService, SUGGESTED_DEFAULT_PRICE, SponsoredCallRejectedError, SponsorshipService, StarknetVenue, TicketService, UserFacingError, VALIDATED_EKUBO_PARAMS, accountFor, adminRequestDigest, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createAdminSessionGrant, createMediaWallet, createOwnerStore, createPasskeyOwner, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, encodeAdminHeaders, encodeByteArray, encodePairingPayload, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isRecoveryKeyForWallet, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerAliveTypedData, ownerConstructorCalldata, parseAccountAddress, parseAdminHeaders, parseCreatorCoinCreated, parsePairingPayload, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, selfFundedExecutor, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, userMayPayInstead, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyAdminRequestSig, waitUntilDeployed };
|
|
12893
12897
|
//# sourceMappingURL=index.js.map
|
|
12894
12898
|
//# sourceMappingURL=index.js.map
|