@medialane/sdk 0.156.1 → 0.158.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/{chunk-ZFRHADHR.cjs → chunk-3IJQNNFE.cjs} +2 -2
- package/dist/{chunk-ZFRHADHR.cjs.map → chunk-3IJQNNFE.cjs.map} +1 -1
- package/dist/{chunk-ASDN46XU.js → chunk-SEBUPNF4.js} +2 -2
- package/dist/{chunk-ASDN46XU.js.map → chunk-SEBUPNF4.js.map} +1 -1
- package/dist/{errors-BKaHnCOI.d.ts → errors-D037rFnb.d.ts} +0 -2
- package/dist/{errors-CAKnNI3N.d.cts → errors-D_k2He89.d.cts} +0 -2
- package/dist/index.cjs +67 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/starknet/index.cjs +62 -62
- package/dist/starknet/index.d.cts +2 -2
- package/dist/starknet/index.d.ts +2 -2
- package/dist/starknet/index.js +2 -2
- package/package.json +1 -1
package/dist/starknet/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3IJQNNFE_cjs = require('../chunk-3IJQNNFE.cjs');
|
|
4
4
|
var chunkOUPVVMLK_cjs = require('../chunk-OUPVVMLK.cjs');
|
|
5
5
|
var starknet = require('starknet');
|
|
6
6
|
var hkdf_js = require('@noble/hashes/hkdf.js');
|
|
@@ -33,7 +33,7 @@ function getChainId(config) {
|
|
|
33
33
|
return starknet.constants.StarknetChainId.SN_MAIN;
|
|
34
34
|
}
|
|
35
35
|
function resolveToken(currency) {
|
|
36
|
-
const token =
|
|
36
|
+
const token = chunk3IJQNNFE_cjs.SUPPORTED_TOKENS.find(
|
|
37
37
|
(t) => t.symbol === currency.toUpperCase() || t.address.toLowerCase() === currency.toLowerCase()
|
|
38
38
|
);
|
|
39
39
|
if (!token) throw new MedialaneError(`Unsupported currency: ${currency}`, "INVALID_PARAMS");
|
|
@@ -44,7 +44,7 @@ function getProvider(config) {
|
|
|
44
44
|
let p = _providerCache.get(config);
|
|
45
45
|
if (!p) {
|
|
46
46
|
const urls = [config.rpcUrl];
|
|
47
|
-
p = new starknet.RpcProvider({ nodeUrl: urls[0], baseFetch:
|
|
47
|
+
p = new starknet.RpcProvider({ nodeUrl: urls[0], baseFetch: chunk3IJQNNFE_cjs.createFailoverFetch(urls) });
|
|
48
48
|
_providerCache.set(config, p);
|
|
49
49
|
}
|
|
50
50
|
return p;
|
|
@@ -9059,7 +9059,7 @@ var PopService = class {
|
|
|
9059
9059
|
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).popFactory;
|
|
9060
9060
|
}
|
|
9061
9061
|
_collection(address, account) {
|
|
9062
|
-
return newContract(POPCollectionABI,
|
|
9062
|
+
return newContract(POPCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9063
9063
|
}
|
|
9064
9064
|
async claim(account, collectionAddress) {
|
|
9065
9065
|
const call = this._collection(collectionAddress, account).populate("claim", []);
|
|
@@ -9150,7 +9150,7 @@ var DropService = class {
|
|
|
9150
9150
|
this.config = config;
|
|
9151
9151
|
}
|
|
9152
9152
|
_collection(address, account) {
|
|
9153
|
-
return newContract(DropCollectionABI,
|
|
9153
|
+
return newContract(DropCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9154
9154
|
}
|
|
9155
9155
|
async claim(account, collectionAddress, quantity = 1) {
|
|
9156
9156
|
const collection = this._collection(collectionAddress, account);
|
|
@@ -9235,14 +9235,14 @@ var ERC1155CollectionService = class {
|
|
|
9235
9235
|
_factory(account) {
|
|
9236
9236
|
return newContract(
|
|
9237
9237
|
IPCollection1155FactoryABI,
|
|
9238
|
-
|
|
9238
|
+
chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", this.factoryAddress),
|
|
9239
9239
|
account
|
|
9240
9240
|
);
|
|
9241
9241
|
}
|
|
9242
9242
|
_collection(address, account) {
|
|
9243
9243
|
return newContract(
|
|
9244
9244
|
IPCollection1155ABI,
|
|
9245
|
-
|
|
9245
|
+
chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address),
|
|
9246
9246
|
account
|
|
9247
9247
|
);
|
|
9248
9248
|
}
|
|
@@ -9470,20 +9470,20 @@ function buildLaunchOnEkuboCalls(params) {
|
|
|
9470
9470
|
}
|
|
9471
9471
|
var CREATOR_COIN_CREATED_SELECTOR = starknet.hash.getSelectorFromName("CreatorCoinCreated");
|
|
9472
9472
|
function parseCreatorCoinCreated(receipt) {
|
|
9473
|
-
const factory =
|
|
9473
|
+
const factory = chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", chunkOUPVVMLK_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory);
|
|
9474
9474
|
for (const ev of receipt?.events ?? []) {
|
|
9475
9475
|
let from;
|
|
9476
9476
|
try {
|
|
9477
|
-
from =
|
|
9477
|
+
from = chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", ev.from_address ?? "");
|
|
9478
9478
|
} catch {
|
|
9479
9479
|
continue;
|
|
9480
9480
|
}
|
|
9481
9481
|
if (from !== factory) continue;
|
|
9482
9482
|
const k0 = ev.keys?.[0];
|
|
9483
|
-
if (!k0 ||
|
|
9483
|
+
if (!k0 || chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", k0) !== chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", CREATOR_COIN_CREATED_SELECTOR)) continue;
|
|
9484
9484
|
const data = ev.data ?? [];
|
|
9485
9485
|
if (data.length < 1) continue;
|
|
9486
|
-
return
|
|
9486
|
+
return chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", data[data.length - 1]);
|
|
9487
9487
|
}
|
|
9488
9488
|
throw new Error("Coin deployed but the coin address could not be read from the receipt");
|
|
9489
9489
|
}
|
|
@@ -9519,14 +9519,14 @@ var TicketService = class {
|
|
|
9519
9519
|
_factory(account, factoryAddress) {
|
|
9520
9520
|
const address = factoryAddress ?? this.factoryAddress;
|
|
9521
9521
|
if (!address) throw new Error("IP-Tickets factory address not configured for this chain");
|
|
9522
|
-
return newContract(IPTicketCollectionFactoryABI,
|
|
9522
|
+
return newContract(IPTicketCollectionFactoryABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9523
9523
|
}
|
|
9524
9524
|
_collection(address, account) {
|
|
9525
|
-
return newContract(IPTicketCollectionABI,
|
|
9525
|
+
return newContract(IPTicketCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9526
9526
|
}
|
|
9527
9527
|
_collectionRead(address) {
|
|
9528
9528
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
9529
|
-
return newContract(IPTicketCollectionABI,
|
|
9529
|
+
return newContract(IPTicketCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), provider);
|
|
9530
9530
|
}
|
|
9531
9531
|
async deployCollection(account, params) {
|
|
9532
9532
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
@@ -9592,14 +9592,14 @@ var ClubService = class {
|
|
|
9592
9592
|
_factory(account, factoryAddress) {
|
|
9593
9593
|
const address = factoryAddress ?? this.factoryAddress;
|
|
9594
9594
|
if (!address) throw new Error("IP-Club factory address not configured for this chain");
|
|
9595
|
-
return newContract(IPClubFactoryABI,
|
|
9595
|
+
return newContract(IPClubFactoryABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9596
9596
|
}
|
|
9597
9597
|
_collection(address, account) {
|
|
9598
|
-
return newContract(IPClubCollectionABI,
|
|
9598
|
+
return newContract(IPClubCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9599
9599
|
}
|
|
9600
9600
|
_collectionRead(address) {
|
|
9601
9601
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
9602
|
-
return newContract(IPClubCollectionABI,
|
|
9602
|
+
return newContract(IPClubCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), provider);
|
|
9603
9603
|
}
|
|
9604
9604
|
async deployCollection(account, params) {
|
|
9605
9605
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
@@ -9669,7 +9669,7 @@ var SponsorshipService = class {
|
|
|
9669
9669
|
if (!resolved) {
|
|
9670
9670
|
throw new Error("IP-Sponsorship address not configured for this chain");
|
|
9671
9671
|
}
|
|
9672
|
-
return newContract(IPSponsorshipABI,
|
|
9672
|
+
return newContract(IPSponsorshipABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", resolved), account);
|
|
9673
9673
|
}
|
|
9674
9674
|
_contractRead(address) {
|
|
9675
9675
|
const resolved = address ?? this.sponsorshipAddress;
|
|
@@ -9677,7 +9677,7 @@ var SponsorshipService = class {
|
|
|
9677
9677
|
throw new Error("IP-Sponsorship address not configured for this chain");
|
|
9678
9678
|
}
|
|
9679
9679
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
9680
|
-
return newContract(IPSponsorshipABI,
|
|
9680
|
+
return newContract(IPSponsorshipABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", resolved), provider);
|
|
9681
9681
|
}
|
|
9682
9682
|
async createOffer(account, params) {
|
|
9683
9683
|
const specificSponsor = params.specificSponsor ? new starknet.CairoOption(starknet.CairoOptionVariant.Some, params.specificSponsor) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
|
|
@@ -9712,7 +9712,7 @@ var SponsorshipService = class {
|
|
|
9712
9712
|
const approveCall = {
|
|
9713
9713
|
contractAddress: params.paymentToken,
|
|
9714
9714
|
entrypoint: "approve",
|
|
9715
|
-
calldata: [
|
|
9715
|
+
calldata: [chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", sponsorshipAddress), amount.low.toString(), amount.high.toString()]
|
|
9716
9716
|
};
|
|
9717
9717
|
const bidCall = this._contract(account, sponsorshipAddress).populate("place_bid", [
|
|
9718
9718
|
starknet.cairo.uint256(params.offerId),
|
|
@@ -9839,7 +9839,7 @@ var SponsorshipService = class {
|
|
|
9839
9839
|
// src/starknet/client.ts
|
|
9840
9840
|
var MedialaneClient = class {
|
|
9841
9841
|
constructor(rawConfig = {}) {
|
|
9842
|
-
this.config =
|
|
9842
|
+
this.config = chunk3IJQNNFE_cjs.resolveConfig(rawConfig);
|
|
9843
9843
|
this.services = {
|
|
9844
9844
|
pop: new PopService(this.config),
|
|
9845
9845
|
drop: new DropService(this.config),
|
|
@@ -9850,9 +9850,9 @@ var MedialaneClient = class {
|
|
|
9850
9850
|
sponsorship: new SponsorshipService(this.config)
|
|
9851
9851
|
};
|
|
9852
9852
|
if (!this.config.backendUrl) {
|
|
9853
|
-
const sentinel = new
|
|
9853
|
+
const sentinel = new chunk3IJQNNFE_cjs.ApiClient("https://medialane-sdk-no-backend.invalid", this.config.apiKey);
|
|
9854
9854
|
const apiMethodNames = new Set(
|
|
9855
|
-
Object.getOwnPropertyNames(
|
|
9855
|
+
Object.getOwnPropertyNames(chunk3IJQNNFE_cjs.ApiClient.prototype).filter(
|
|
9856
9856
|
(k) => k !== "constructor" && typeof sentinel[k] === "function"
|
|
9857
9857
|
)
|
|
9858
9858
|
);
|
|
@@ -9869,7 +9869,7 @@ var MedialaneClient = class {
|
|
|
9869
9869
|
}
|
|
9870
9870
|
});
|
|
9871
9871
|
} else {
|
|
9872
|
-
this.api = new
|
|
9872
|
+
this.api = new chunk3IJQNNFE_cjs.ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
|
|
9873
9873
|
}
|
|
9874
9874
|
}
|
|
9875
9875
|
get chain() {
|
|
@@ -10041,7 +10041,7 @@ function buildListingOrder(i, cfg) {
|
|
|
10041
10041
|
salt: i.salt,
|
|
10042
10042
|
counter: i.counter
|
|
10043
10043
|
};
|
|
10044
|
-
const typedData =
|
|
10044
|
+
const typedData = chunk3IJQNNFE_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
10045
10045
|
return { orderParams, typedData };
|
|
10046
10046
|
}
|
|
10047
10047
|
function buildOfferOrder(i, cfg) {
|
|
@@ -10062,11 +10062,11 @@ function buildOfferOrder(i, cfg) {
|
|
|
10062
10062
|
salt: i.salt,
|
|
10063
10063
|
counter: i.counter
|
|
10064
10064
|
};
|
|
10065
|
-
const typedData =
|
|
10065
|
+
const typedData = chunk3IJQNNFE_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
10066
10066
|
return { orderParams, typedData };
|
|
10067
10067
|
}
|
|
10068
10068
|
function registerPayload(orderParams, signature) {
|
|
10069
|
-
return
|
|
10069
|
+
return chunk3IJQNNFE_cjs.stringifyBigInts({
|
|
10070
10070
|
parameters: {
|
|
10071
10071
|
...orderParams,
|
|
10072
10072
|
offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
|
|
@@ -10097,14 +10097,14 @@ function buildFulfillCalls(a, cfg) {
|
|
|
10097
10097
|
return fee ? [approve, fulfill, fee] : [approve, fulfill];
|
|
10098
10098
|
}
|
|
10099
10099
|
function buildCancelCalls(a, cfg) {
|
|
10100
|
-
const cancelRequest =
|
|
10100
|
+
const cancelRequest = chunk3IJQNNFE_cjs.stringifyBigInts({
|
|
10101
10101
|
cancelation: { order_hash: a.orderHash, offerer: a.offerer },
|
|
10102
10102
|
signature: a.signature
|
|
10103
10103
|
});
|
|
10104
10104
|
return [contractFor(cfg).populate("cancel_order", [cancelRequest])];
|
|
10105
10105
|
}
|
|
10106
10106
|
function buildCancelTypedData(orderHash, offerer, cfg) {
|
|
10107
|
-
return
|
|
10107
|
+
return chunk3IJQNNFE_cjs.stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
|
|
10108
10108
|
}
|
|
10109
10109
|
function contractFor2(cfg) {
|
|
10110
10110
|
return newContract(Medialane1155ABI, cfg.marketplace1155Contract, getProvider(cfg));
|
|
@@ -10127,7 +10127,7 @@ function buildListing1155Order(i, cfg) {
|
|
|
10127
10127
|
salt: i.salt,
|
|
10128
10128
|
counter: i.counter
|
|
10129
10129
|
};
|
|
10130
|
-
const typedData =
|
|
10130
|
+
const typedData = chunk3IJQNNFE_cjs.stringifyBigInts(
|
|
10131
10131
|
build1155OrderTypedData(orderParams, getChainId(cfg))
|
|
10132
10132
|
);
|
|
10133
10133
|
return { orderParams, typedData };
|
|
@@ -10150,13 +10150,13 @@ function buildOffer1155Order(i, cfg) {
|
|
|
10150
10150
|
salt: i.salt,
|
|
10151
10151
|
counter: i.counter
|
|
10152
10152
|
};
|
|
10153
|
-
const typedData =
|
|
10153
|
+
const typedData = chunk3IJQNNFE_cjs.stringifyBigInts(
|
|
10154
10154
|
build1155OrderTypedData(orderParams, getChainId(cfg))
|
|
10155
10155
|
);
|
|
10156
10156
|
return { orderParams, typedData };
|
|
10157
10157
|
}
|
|
10158
10158
|
function registerPayload2(orderParams, signature) {
|
|
10159
|
-
return
|
|
10159
|
+
return chunk3IJQNNFE_cjs.stringifyBigInts({
|
|
10160
10160
|
parameters: {
|
|
10161
10161
|
...orderParams,
|
|
10162
10162
|
offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
|
|
@@ -10187,14 +10187,14 @@ function buildFulfill1155Calls(a, cfg) {
|
|
|
10187
10187
|
return fee ? [approve, fulfill, fee] : [approve, fulfill];
|
|
10188
10188
|
}
|
|
10189
10189
|
function buildCancel1155Calls(a, cfg) {
|
|
10190
|
-
const cancelPayload =
|
|
10190
|
+
const cancelPayload = chunk3IJQNNFE_cjs.stringifyBigInts({
|
|
10191
10191
|
cancelation: { order_hash: a.orderHash, offerer: a.offerer },
|
|
10192
10192
|
signature: a.signature
|
|
10193
10193
|
});
|
|
10194
10194
|
return [contractFor2(cfg).populate("cancel_order", [cancelPayload])];
|
|
10195
10195
|
}
|
|
10196
10196
|
function buildCancel1155TypedData(orderHash, offerer, cfg) {
|
|
10197
|
-
return
|
|
10197
|
+
return chunk3IJQNNFE_cjs.stringifyBigInts(
|
|
10198
10198
|
build1155CancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg))
|
|
10199
10199
|
);
|
|
10200
10200
|
}
|
|
@@ -10537,14 +10537,14 @@ async function assertTransactionSucceeded(provider, txHash, retryDelaysMs = RECE
|
|
|
10537
10537
|
const receipt = await provider.getTransactionReceipt(txHash);
|
|
10538
10538
|
const status = receipt.execution_status ?? receipt.status;
|
|
10539
10539
|
if (status === "REVERTED" || status === "REJECTED") {
|
|
10540
|
-
throw new
|
|
10540
|
+
throw new chunk3IJQNNFE_cjs.UserFacingError("Transaction was submitted but reverted onchain. Please check your balance and try again.");
|
|
10541
10541
|
}
|
|
10542
10542
|
if (status) return receipt;
|
|
10543
10543
|
} catch (err) {
|
|
10544
10544
|
if (err instanceof Error && err.message.includes("reverted onchain")) throw err;
|
|
10545
10545
|
}
|
|
10546
10546
|
}
|
|
10547
|
-
throw new
|
|
10547
|
+
throw new chunk3IJQNNFE_cjs.UserFacingError("Verification timed out. Check your account for the transaction status.");
|
|
10548
10548
|
}
|
|
10549
10549
|
async function executeIntent(provider, signer, client, intent, opts = {}) {
|
|
10550
10550
|
let calls;
|
|
@@ -10597,14 +10597,14 @@ function u2562(low, high) {
|
|
|
10597
10597
|
return (BigInt(low ?? 0) + (BigInt(high ?? 0) << 128n)).toString();
|
|
10598
10598
|
}
|
|
10599
10599
|
function deployedCollectionFromReceipt(receipt, service) {
|
|
10600
|
-
const factory =
|
|
10600
|
+
const factory = chunk3IJQNNFE_cjs.getService(service)?.onchain?.STARKNET?.factoryAddress;
|
|
10601
10601
|
const { event, address } = DEPLOY_EVENTS[service];
|
|
10602
10602
|
const selector = BigInt(starknet.hash.getSelectorFromName(event));
|
|
10603
10603
|
for (const e of receipt.events ?? []) {
|
|
10604
10604
|
if (factory && !sameFelt(e.from_address, factory)) continue;
|
|
10605
10605
|
if (!sameFelt(e.keys?.[0], selector)) continue;
|
|
10606
10606
|
const value = address(e);
|
|
10607
|
-
if (value) return
|
|
10607
|
+
if (value) return chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", value);
|
|
10608
10608
|
}
|
|
10609
10609
|
return null;
|
|
10610
10610
|
}
|
|
@@ -10725,13 +10725,13 @@ function buildRemoveOwnerByGuidCall(accountAddress, ownerGuid) {
|
|
|
10725
10725
|
}
|
|
10726
10726
|
function buildDeployAccountParams(ownerPubkey, salt = 0) {
|
|
10727
10727
|
return {
|
|
10728
|
-
classHash:
|
|
10729
|
-
constructorCalldata:
|
|
10728
|
+
classHash: chunk3IJQNNFE_cjs.STARKNET_MEDIAWALLET_CLASS_HASH,
|
|
10729
|
+
constructorCalldata: chunk3IJQNNFE_cjs.ownerConstructorCalldata(ownerPubkey),
|
|
10730
10730
|
addressSalt: starknet.num.toHex(salt),
|
|
10731
|
-
contractAddress:
|
|
10731
|
+
contractAddress: chunk3IJQNNFE_cjs.computeAccountAddress(ownerPubkey, salt)
|
|
10732
10732
|
};
|
|
10733
10733
|
}
|
|
10734
|
-
var norm = (address) =>
|
|
10734
|
+
var norm = (address) => chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address);
|
|
10735
10735
|
var SIGNER_TYPE_NAMES = ["Starknet", "Secp256k1", "Secp256r1"];
|
|
10736
10736
|
function encodeFeltArray(items) {
|
|
10737
10737
|
return [starknet.num.toHex(items.length), ...items];
|
|
@@ -10924,7 +10924,7 @@ var InvalidRecoveryKeyError = class extends Error {
|
|
|
10924
10924
|
var canonicalAddress = (address) => `0x${BigInt(address).toString(16).padStart(64, "0")}`;
|
|
10925
10925
|
function keyPair(privateKey) {
|
|
10926
10926
|
try {
|
|
10927
|
-
return
|
|
10927
|
+
return chunk3IJQNNFE_cjs.starkKeyPairFromPrivateKey(privateKey);
|
|
10928
10928
|
} catch {
|
|
10929
10929
|
throw new InvalidRecoveryKeyError();
|
|
10930
10930
|
}
|
|
@@ -10937,7 +10937,7 @@ function parseRecoveryKey(input) {
|
|
|
10937
10937
|
const trimmed = input.trim();
|
|
10938
10938
|
if (!trimmed.startsWith(PREFIX)) {
|
|
10939
10939
|
const { privateKeyHex, publicKeyHex } = keyPair(trimmed);
|
|
10940
|
-
return { walletAddress:
|
|
10940
|
+
return { walletAddress: chunk3IJQNNFE_cjs.computeAccountAddress(publicKeyHex, 0), privateKey: privateKeyHex };
|
|
10941
10941
|
}
|
|
10942
10942
|
const parts = trimmed.slice(PREFIX.length).split(":");
|
|
10943
10943
|
const [walletAddress, privateKey] = parts;
|
|
@@ -10959,7 +10959,7 @@ function describeRecoveryAction(escape) {
|
|
|
10959
10959
|
return "none";
|
|
10960
10960
|
}
|
|
10961
10961
|
function normalizeWalletAddress(address) {
|
|
10962
|
-
return
|
|
10962
|
+
return chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address);
|
|
10963
10963
|
}
|
|
10964
10964
|
function isValidStarknetAddress(address) {
|
|
10965
10965
|
try {
|
|
@@ -11004,7 +11004,7 @@ async function estimateSelfFundedFee(provider, address, calls) {
|
|
|
11004
11004
|
return { feeRaw: estimate.overall_fee, unit: estimate.unit, balanceRaw };
|
|
11005
11005
|
}
|
|
11006
11006
|
async function feeTokenBalance(provider, address, unit) {
|
|
11007
|
-
const token =
|
|
11007
|
+
const token = chunk3IJQNNFE_cjs.getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
|
|
11008
11008
|
if (!token) throw new Error(`No fee token for unit ${unit}`);
|
|
11009
11009
|
const [low = "0x0", high = "0x0"] = await provider.callContract({
|
|
11010
11010
|
contractAddress: token.address,
|
|
@@ -11031,7 +11031,7 @@ function sponsoredExecutor(deps) {
|
|
|
11031
11031
|
{ proxyUrl: deps.proxyUrl, fetchImpl: deps.fetchImpl },
|
|
11032
11032
|
{
|
|
11033
11033
|
address: userAddress,
|
|
11034
|
-
signTypedData: async (data) =>
|
|
11034
|
+
signTypedData: async (data) => chunk3IJQNNFE_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
|
|
11035
11035
|
},
|
|
11036
11036
|
calls
|
|
11037
11037
|
);
|
|
@@ -11091,7 +11091,7 @@ async function deploySelfFunded(input) {
|
|
|
11091
11091
|
});
|
|
11092
11092
|
const { transaction_hash } = await account.deployAccount({
|
|
11093
11093
|
classHash,
|
|
11094
|
-
constructorCalldata:
|
|
11094
|
+
constructorCalldata: chunk3IJQNNFE_cjs.ownerConstructorCalldata(input.ownerPubKey),
|
|
11095
11095
|
addressSalt: 0,
|
|
11096
11096
|
contractAddress: input.ownerAddress
|
|
11097
11097
|
});
|
|
@@ -11154,7 +11154,7 @@ async function completeDeployment(deps, onStep, options = {}) {
|
|
|
11154
11154
|
backendUrl: deps.backendUrl,
|
|
11155
11155
|
walletAddress: address,
|
|
11156
11156
|
signer: {
|
|
11157
|
-
signMessage: async (td) =>
|
|
11157
|
+
signMessage: async (td) => chunk3IJQNNFE_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(td, address))
|
|
11158
11158
|
}
|
|
11159
11159
|
});
|
|
11160
11160
|
deps.store.notifyChange();
|
|
@@ -11259,7 +11259,7 @@ function createMediaWallet(config) {
|
|
|
11259
11259
|
address: sealed.address,
|
|
11260
11260
|
signTypedData: async (data) => {
|
|
11261
11261
|
const privateKeyHex = await unlockOnce(sealed);
|
|
11262
|
-
return
|
|
11262
|
+
return chunk3IJQNNFE_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, sealed.address));
|
|
11263
11263
|
},
|
|
11264
11264
|
execute: async (calls) => {
|
|
11265
11265
|
const { transactionHash } = await run(sealed, calls);
|
|
@@ -11331,51 +11331,51 @@ async function claimSessionWallet(api, walletAddress, deps) {
|
|
|
11331
11331
|
|
|
11332
11332
|
Object.defineProperty(exports, "InvalidStarkPrivateKeyError", {
|
|
11333
11333
|
enumerable: true,
|
|
11334
|
-
get: function () { return
|
|
11334
|
+
get: function () { return chunk3IJQNNFE_cjs.InvalidStarkPrivateKeyError; }
|
|
11335
11335
|
});
|
|
11336
11336
|
Object.defineProperty(exports, "PasskeyCancelledError", {
|
|
11337
11337
|
enumerable: true,
|
|
11338
|
-
get: function () { return
|
|
11338
|
+
get: function () { return chunk3IJQNNFE_cjs.PasskeyCancelledError; }
|
|
11339
11339
|
});
|
|
11340
11340
|
Object.defineProperty(exports, "UserFacingError", {
|
|
11341
11341
|
enumerable: true,
|
|
11342
|
-
get: function () { return
|
|
11342
|
+
get: function () { return chunk3IJQNNFE_cjs.UserFacingError; }
|
|
11343
11343
|
});
|
|
11344
11344
|
Object.defineProperty(exports, "computeAccountAddress", {
|
|
11345
11345
|
enumerable: true,
|
|
11346
|
-
get: function () { return
|
|
11346
|
+
get: function () { return chunk3IJQNNFE_cjs.computeAccountAddress; }
|
|
11347
11347
|
});
|
|
11348
11348
|
Object.defineProperty(exports, "createPasskeyOwner", {
|
|
11349
11349
|
enumerable: true,
|
|
11350
|
-
get: function () { return
|
|
11350
|
+
get: function () { return chunk3IJQNNFE_cjs.createPasskeyOwner; }
|
|
11351
11351
|
});
|
|
11352
11352
|
Object.defineProperty(exports, "deriveAesKey", {
|
|
11353
11353
|
enumerable: true,
|
|
11354
|
-
get: function () { return
|
|
11354
|
+
get: function () { return chunk3IJQNNFE_cjs.deriveAesKey; }
|
|
11355
11355
|
});
|
|
11356
11356
|
Object.defineProperty(exports, "generateStarkKeyPair", {
|
|
11357
11357
|
enumerable: true,
|
|
11358
|
-
get: function () { return
|
|
11358
|
+
get: function () { return chunk3IJQNNFE_cjs.generateStarkKeyPair; }
|
|
11359
11359
|
});
|
|
11360
11360
|
Object.defineProperty(exports, "ownerConstructorCalldata", {
|
|
11361
11361
|
enumerable: true,
|
|
11362
|
-
get: function () { return
|
|
11362
|
+
get: function () { return chunk3IJQNNFE_cjs.ownerConstructorCalldata; }
|
|
11363
11363
|
});
|
|
11364
11364
|
Object.defineProperty(exports, "sealPrivateKey", {
|
|
11365
11365
|
enumerable: true,
|
|
11366
|
-
get: function () { return
|
|
11366
|
+
get: function () { return chunk3IJQNNFE_cjs.sealPrivateKey; }
|
|
11367
11367
|
});
|
|
11368
11368
|
Object.defineProperty(exports, "signWithPrivateKey", {
|
|
11369
11369
|
enumerable: true,
|
|
11370
|
-
get: function () { return
|
|
11370
|
+
get: function () { return chunk3IJQNNFE_cjs.signWithPrivateKey; }
|
|
11371
11371
|
});
|
|
11372
11372
|
Object.defineProperty(exports, "starkKeyPairFromPrivateKey", {
|
|
11373
11373
|
enumerable: true,
|
|
11374
|
-
get: function () { return
|
|
11374
|
+
get: function () { return chunk3IJQNNFE_cjs.starkKeyPairFromPrivateKey; }
|
|
11375
11375
|
});
|
|
11376
11376
|
Object.defineProperty(exports, "unsealPrivateKey", {
|
|
11377
11377
|
enumerable: true,
|
|
11378
|
-
get: function () { return
|
|
11378
|
+
get: function () { return chunk3IJQNNFE_cjs.unsealPrivateKey; }
|
|
11379
11379
|
});
|
|
11380
11380
|
exports.COIN_MAX_SUPPLY = MAX_SUPPLY;
|
|
11381
11381
|
exports.COIN_MIN_SUPPLY = MIN_SUPPLY;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bC as ResolvedConfig, bJ as TxResult, aY as CreatePopCollectionParams, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bm as MintTicketsParams, aW as CreateMembershipParams, bl as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, bz 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, bP as SealedOwner, bQ as ReceiptProviderLike, bR as WalletExecutor, bS as ExecutedTransaction, bT as PasskeyOwner, bU as CreatedOwner } from '../errors-
|
|
2
|
-
export { bV as InvalidRecoveryKeyError, bW as OwnerSigner, bu as PasskeyCancelledError, bX as PasskeyConfig, bY as RecoveryKey, bL as UserFacingError, bZ as createPasskeyOwner, b_ as encodeRecoveryKey, b$ as parseRecoveryKey } from '../errors-
|
|
1
|
+
import { bC as ResolvedConfig, bJ as TxResult, aY as CreatePopCollectionParams, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bm as MintTicketsParams, aW as CreateMembershipParams, bl as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, bz 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, bP as SealedOwner, bQ as ReceiptProviderLike, bR as WalletExecutor, bS as ExecutedTransaction, bT as PasskeyOwner, bU as CreatedOwner } from '../errors-D_k2He89.cjs';
|
|
2
|
+
export { bV as InvalidRecoveryKeyError, bW as OwnerSigner, bu as PasskeyCancelledError, bX as PasskeyConfig, bY as RecoveryKey, bL as UserFacingError, bZ as createPasskeyOwner, b_ as encodeRecoveryKey, b$ as parseRecoveryKey } from '../errors-D_k2He89.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-CO6YYHVA.cjs';
|
|
5
5
|
import 'zod';
|
package/dist/starknet/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bC as ResolvedConfig, bJ as TxResult, aY as CreatePopCollectionParams, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bm as MintTicketsParams, aW as CreateMembershipParams, bl as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, bz 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, bP as SealedOwner, bQ as ReceiptProviderLike, bR as WalletExecutor, bS as ExecutedTransaction, bT as PasskeyOwner, bU as CreatedOwner } from '../errors-
|
|
2
|
-
export { bV as InvalidRecoveryKeyError, bW as OwnerSigner, bu as PasskeyCancelledError, bX as PasskeyConfig, bY as RecoveryKey, bL as UserFacingError, bZ as createPasskeyOwner, b_ as encodeRecoveryKey, b$ as parseRecoveryKey } from '../errors-
|
|
1
|
+
import { bC as ResolvedConfig, bJ as TxResult, aY as CreatePopCollectionParams, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bm as MintTicketsParams, aW as CreateMembershipParams, bl as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, bz 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, bP as SealedOwner, bQ as ReceiptProviderLike, bR as WalletExecutor, bS as ExecutedTransaction, bT as PasskeyOwner, bU as CreatedOwner } from '../errors-D037rFnb.js';
|
|
2
|
+
export { bV as InvalidRecoveryKeyError, bW as OwnerSigner, bu as PasskeyCancelledError, bX as PasskeyConfig, bY as RecoveryKey, bL as UserFacingError, bZ as createPasskeyOwner, b_ as encodeRecoveryKey, b$ as parseRecoveryKey } from '../errors-D037rFnb.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-CO6YYHVA.js';
|
|
5
5
|
import 'zod';
|
package/dist/starknet/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { normalizeAddress, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, starkKeyPairFromPrivateKey, createFailoverFetch } from '../chunk-
|
|
2
|
-
export { InvalidStarkPrivateKeyError, PasskeyCancelledError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-
|
|
1
|
+
import { normalizeAddress, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, starkKeyPairFromPrivateKey, createFailoverFetch } from '../chunk-SEBUPNF4.js';
|
|
2
|
+
export { InvalidStarkPrivateKeyError, PasskeyCancelledError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-SEBUPNF4.js';
|
|
3
3
|
import { getStarknetCoordinates, getCoordinates } from '../chunk-3PZUSEAW.js';
|
|
4
4
|
import { hash, cairo, uint256, RpcProvider, CairoOption, CairoOptionVariant, num, ec, validateAndParseAddress, Account, typedData, stark, Contract, TypedDataRevision, constants, shortString } from 'starknet';
|
|
5
5
|
import { extract, expand } from '@noble/hashes/hkdf.js';
|