@medialane/sdk 0.180.0 → 0.182.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/README.md +2 -4
- package/dist/{chunk-WYKCGQPN.js → chunk-3ME5YKTW.js} +2 -3
- package/dist/chunk-3ME5YKTW.js.map +1 -0
- package/dist/{chunk-VJVBWHAD.cjs → chunk-7EYJC5CB.cjs} +2 -3
- package/dist/chunk-7EYJC5CB.cjs.map +1 -0
- package/dist/{chunk-PNUHSQPU.cjs → chunk-F5USCCM4.cjs} +37 -126
- package/dist/chunk-F5USCCM4.cjs.map +1 -0
- package/dist/{chunk-H263CTVH.js → chunk-JZXIZGHW.js} +34 -119
- package/dist/chunk-JZXIZGHW.js.map +1 -0
- package/dist/{errors-DThsFcc1.d.cts → errors-C3dgi8bK.d.cts} +35 -26
- package/dist/{errors-CTVls5-y.d.ts → errors-kFtjB-a3.d.ts} +35 -26
- package/dist/evm/index.cjs +3 -3
- package/dist/evm/index.d.cts +1 -1
- package/dist/evm/index.d.ts +1 -1
- package/dist/evm/index.js +1 -1
- package/dist/index.cjs +83 -104
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -27
- package/dist/index.d.ts +7 -27
- package/dist/index.js +9 -14
- package/dist/index.js.map +1 -1
- package/dist/solana/index.cjs +2 -2
- package/dist/solana/index.d.cts +1 -1
- package/dist/solana/index.d.ts +1 -1
- package/dist/solana/index.js +1 -1
- package/dist/starknet/index.cjs +137 -290
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +15 -120
- package/dist/starknet/index.d.ts +15 -120
- package/dist/starknet/index.js +62 -214
- package/dist/starknet/index.js.map +1 -1
- package/dist/stellar/index.cjs +2 -2
- package/dist/stellar/index.d.cts +1 -1
- package/dist/stellar/index.d.ts +1 -1
- package/dist/stellar/index.js +1 -1
- package/dist/{types-BTNjkUst.d.cts → types-DC4jNPAF.d.cts} +0 -4
- package/dist/{types-BTNjkUst.d.ts → types-DC4jNPAF.d.ts} +0 -4
- package/package.json +1 -1
- package/dist/chunk-H263CTVH.js.map +0 -1
- package/dist/chunk-PNUHSQPU.cjs.map +0 -1
- package/dist/chunk-VJVBWHAD.cjs.map +0 -1
- package/dist/chunk-WYKCGQPN.js.map +0 -1
package/dist/starknet/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { normalizeAddress, collectionHref, dropHref, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, starkKeyPairFromPrivateKey
|
|
2
|
-
export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-
|
|
3
|
-
import { getStarknetCoordinates, getCoordinates } from '../chunk-
|
|
4
|
-
import { CallData, hash, cairo,
|
|
1
|
+
import { normalizeAddress, collectionHref, dropHref, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, starkKeyPairFromPrivateKey } from '../chunk-JZXIZGHW.js';
|
|
2
|
+
export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-JZXIZGHW.js';
|
|
3
|
+
import { getStarknetCoordinates, getCoordinates } from '../chunk-3ME5YKTW.js';
|
|
4
|
+
import { CallData, hash, cairo, uint256, CairoOption, CairoOptionVariant, RpcProvider, num, ec, validateAndParseAddress, Account, typedData, stark, byteArray, Contract, TypedDataRevision, constants, shortString } from 'starknet';
|
|
5
5
|
import { extract, expand } from '@noble/hashes/hkdf.js';
|
|
6
6
|
import { sha256 } from '@noble/hashes/sha2.js';
|
|
7
7
|
|
|
@@ -38,16 +38,6 @@ function resolveToken(currency) {
|
|
|
38
38
|
if (!token) throw new MedialaneError(`Unsupported currency: ${currency}`, "INVALID_PARAMS");
|
|
39
39
|
return token;
|
|
40
40
|
}
|
|
41
|
-
var _providerCache = /* @__PURE__ */ new WeakMap();
|
|
42
|
-
function getProvider(config) {
|
|
43
|
-
let p = _providerCache.get(config);
|
|
44
|
-
if (!p) {
|
|
45
|
-
const urls = [config.rpcUrl];
|
|
46
|
-
p = new RpcProvider({ nodeUrl: urls[0], baseFetch: createFailoverFetch(urls) });
|
|
47
|
-
_providerCache.set(config, p);
|
|
48
|
-
}
|
|
49
|
-
return p;
|
|
50
|
-
}
|
|
51
41
|
|
|
52
42
|
// src/starknet/abis/ipMarketplace.ts
|
|
53
43
|
var IPMarketplaceABI = [
|
|
@@ -10680,10 +10670,9 @@ function dropClaimLinks(origin, collection, list) {
|
|
|
10680
10670
|
|
|
10681
10671
|
// src/starknet/services/drop.ts
|
|
10682
10672
|
var DropService = class {
|
|
10683
|
-
constructor(config
|
|
10673
|
+
constructor(config) {
|
|
10684
10674
|
this.factoryAddress = getStarknetCoordinates(config.chain).dropFactory;
|
|
10685
10675
|
this.config = config;
|
|
10686
|
-
this.reader = reader ?? new RpcProvider({ nodeUrl: config.rpcUrl });
|
|
10687
10676
|
}
|
|
10688
10677
|
async createDrop(account, params) {
|
|
10689
10678
|
const res = await account.execute([dropCalls.create(this.factoryAddress, params)]);
|
|
@@ -10691,7 +10680,7 @@ var DropService = class {
|
|
|
10691
10680
|
}
|
|
10692
10681
|
/** Mints `quantity` to the account, paying the drop's price and the platform fee. */
|
|
10693
10682
|
async claim(account, params) {
|
|
10694
|
-
const drop = await readDrop(
|
|
10683
|
+
const drop = await readDrop(account.provider, params.collection);
|
|
10695
10684
|
const calls = dropCalls.claim(params.collection, {
|
|
10696
10685
|
quantity: params.quantity,
|
|
10697
10686
|
proof: params.proof,
|
|
@@ -10978,7 +10967,6 @@ function parseCreatorCoinCreated(receipt) {
|
|
|
10978
10967
|
var CreatorCoinService = class {
|
|
10979
10968
|
constructor(config) {
|
|
10980
10969
|
this.factoryAddress = getStarknetCoordinates(config.chain).creatorCoinFactory;
|
|
10981
|
-
this.config = config;
|
|
10982
10970
|
}
|
|
10983
10971
|
_factory(account) {
|
|
10984
10972
|
return newContract(CreatorCoinFactoryABI, this.factoryAddress, account);
|
|
@@ -10995,13 +10983,9 @@ var CreatorCoinService = class {
|
|
|
10995
10983
|
const r = await this._factory(account).is_creator_coin(address);
|
|
10996
10984
|
return BigInt(r) === 1n;
|
|
10997
10985
|
}
|
|
10998
|
-
async getGuarantees(coinAddress) {
|
|
10999
|
-
return getCreatorCoinGuarantees(coinAddress, new RpcProvider({ nodeUrl: this.config.rpcUrl }));
|
|
11000
|
-
}
|
|
11001
10986
|
};
|
|
11002
10987
|
var TicketService = class {
|
|
11003
10988
|
constructor(config) {
|
|
11004
|
-
this.config = config;
|
|
11005
10989
|
this.factoryAddress = getStarknetCoordinates(config.chain).ipTicketsFactory;
|
|
11006
10990
|
}
|
|
11007
10991
|
_factory(account, factoryAddress) {
|
|
@@ -11012,10 +10996,6 @@ var TicketService = class {
|
|
|
11012
10996
|
_collection(address, account) {
|
|
11013
10997
|
return newContract(IPTicketCollectionABI, normalizeAddress("STARKNET", address), account);
|
|
11014
10998
|
}
|
|
11015
|
-
_collectionRead(address) {
|
|
11016
|
-
const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
11017
|
-
return newContract(IPTicketCollectionABI, normalizeAddress("STARKNET", address), provider);
|
|
11018
|
-
}
|
|
11019
10999
|
async deployCollection(account, params) {
|
|
11020
11000
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
11021
11001
|
params.name,
|
|
@@ -11047,34 +11027,9 @@ var TicketService = class {
|
|
|
11047
11027
|
const res = await account.execute([call]);
|
|
11048
11028
|
return { txHash: res.transaction_hash };
|
|
11049
11029
|
}
|
|
11050
|
-
async isValid(params) {
|
|
11051
|
-
const result = await this._collectionRead(params.collection).call("is_valid", [
|
|
11052
|
-
cairo.uint256(params.tokenId),
|
|
11053
|
-
params.holder
|
|
11054
|
-
]);
|
|
11055
|
-
return Boolean(result);
|
|
11056
|
-
}
|
|
11057
|
-
async getTicketCount(params) {
|
|
11058
|
-
const result = await this._collectionRead(params.collection).call("ticket_count", []);
|
|
11059
|
-
return BigInt(result);
|
|
11060
|
-
}
|
|
11061
|
-
async getTicket(params) {
|
|
11062
|
-
const t = await this._collectionRead(params.collection).call("get_ticket", [
|
|
11063
|
-
cairo.uint256(params.tokenId)
|
|
11064
|
-
]);
|
|
11065
|
-
return {
|
|
11066
|
-
maxSupply: BigInt(t.max_supply),
|
|
11067
|
-
minted: BigInt(t.minted),
|
|
11068
|
-
startTime: t.start_time?.variant === "Some" ? Number(t.start_time.values[0] ?? t.start_time.value) : null,
|
|
11069
|
-
endTime: t.end_time?.variant === "Some" ? Number(t.end_time.values[0] ?? t.end_time.value) : null,
|
|
11070
|
-
royaltyBps: Number(t.royalty_bps),
|
|
11071
|
-
metadataUri: t.metadata_uri
|
|
11072
|
-
};
|
|
11073
|
-
}
|
|
11074
11030
|
};
|
|
11075
11031
|
var ClubService = class {
|
|
11076
11032
|
constructor(config) {
|
|
11077
|
-
this.config = config;
|
|
11078
11033
|
this.factoryAddress = getStarknetCoordinates(config.chain).ipClubFactory;
|
|
11079
11034
|
}
|
|
11080
11035
|
_factory(account, factoryAddress) {
|
|
@@ -11085,10 +11040,6 @@ var ClubService = class {
|
|
|
11085
11040
|
_collection(address, account) {
|
|
11086
11041
|
return newContract(IPClubCollectionABI, normalizeAddress("STARKNET", address), account);
|
|
11087
11042
|
}
|
|
11088
|
-
_collectionRead(address) {
|
|
11089
|
-
const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
11090
|
-
return newContract(IPClubCollectionABI, normalizeAddress("STARKNET", address), provider);
|
|
11091
|
-
}
|
|
11092
11043
|
async deployCollection(account, params) {
|
|
11093
11044
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
11094
11045
|
params.name,
|
|
@@ -11120,36 +11071,9 @@ var ClubService = class {
|
|
|
11120
11071
|
const res = await account.execute([call]);
|
|
11121
11072
|
return { txHash: res.transaction_hash };
|
|
11122
11073
|
}
|
|
11123
|
-
async isMember(params) {
|
|
11124
|
-
const result = await this._collectionRead(params.collection).call("is_member", [
|
|
11125
|
-
params.holder
|
|
11126
|
-
]);
|
|
11127
|
-
return Boolean(result);
|
|
11128
|
-
}
|
|
11129
|
-
async isMemberOf(params) {
|
|
11130
|
-
const result = await this._collectionRead(params.collection).call("is_member_of", [
|
|
11131
|
-
cairo.uint256(params.tokenId),
|
|
11132
|
-
params.holder
|
|
11133
|
-
]);
|
|
11134
|
-
return Boolean(result);
|
|
11135
|
-
}
|
|
11136
|
-
async getMembership(params) {
|
|
11137
|
-
const m = await this._collectionRead(params.collection).call("get_membership", [
|
|
11138
|
-
cairo.uint256(params.tokenId)
|
|
11139
|
-
]);
|
|
11140
|
-
return {
|
|
11141
|
-
maxSupply: BigInt(m.max_supply),
|
|
11142
|
-
minted: BigInt(m.minted),
|
|
11143
|
-
startTime: m.start_time?.variant === "Some" ? Number(m.start_time.values[0] ?? m.start_time.value) : null,
|
|
11144
|
-
endTime: m.end_time?.variant === "Some" ? Number(m.end_time.values[0] ?? m.end_time.value) : null,
|
|
11145
|
-
royaltyBps: Number(m.royalty_bps),
|
|
11146
|
-
metadataUri: m.metadata_uri
|
|
11147
|
-
};
|
|
11148
|
-
}
|
|
11149
11074
|
};
|
|
11150
11075
|
var SponsorshipService = class {
|
|
11151
11076
|
constructor(config) {
|
|
11152
|
-
this.config = config;
|
|
11153
11077
|
this.sponsorshipAddress = getStarknetCoordinates(config.chain).ipSponsorship;
|
|
11154
11078
|
}
|
|
11155
11079
|
_contract(account, address) {
|
|
@@ -11159,14 +11083,6 @@ var SponsorshipService = class {
|
|
|
11159
11083
|
}
|
|
11160
11084
|
return newContract(IPSponsorshipABI, normalizeAddress("STARKNET", resolved), account);
|
|
11161
11085
|
}
|
|
11162
|
-
_contractRead(address) {
|
|
11163
|
-
const resolved = address ?? this.sponsorshipAddress;
|
|
11164
|
-
if (!resolved) {
|
|
11165
|
-
throw new Error("IP-Sponsorship address not configured for this chain");
|
|
11166
|
-
}
|
|
11167
|
-
const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
11168
|
-
return newContract(IPSponsorshipABI, normalizeAddress("STARKNET", resolved), provider);
|
|
11169
|
-
}
|
|
11170
11086
|
async createOffer(account, params) {
|
|
11171
11087
|
const specificSponsor = params.specificSponsor ? new CairoOption(CairoOptionVariant.Some, params.specificSponsor) : new CairoOption(CairoOptionVariant.None);
|
|
11172
11088
|
const call = this._contract(account, params.sponsorshipAddress).populate("create_offer", [
|
|
@@ -11260,69 +11176,14 @@ var SponsorshipService = class {
|
|
|
11260
11176
|
const res = await account.execute([call]);
|
|
11261
11177
|
return { txHash: res.transaction_hash };
|
|
11262
11178
|
}
|
|
11263
|
-
async getOffer(params) {
|
|
11264
|
-
const o = await this._contractRead(params.sponsorshipAddress).call("get_offer", [
|
|
11265
|
-
cairo.uint256(params.offerId)
|
|
11266
|
-
]);
|
|
11267
|
-
return {
|
|
11268
|
-
author: o.author,
|
|
11269
|
-
nftContract: o.nft_contract,
|
|
11270
|
-
tokenId: BigInt(o.token_id),
|
|
11271
|
-
minAmount: BigInt(o.min_amount),
|
|
11272
|
-
duration: Number(o.duration),
|
|
11273
|
-
paymentToken: o.payment_token,
|
|
11274
|
-
licenseTermsUri: o.license_terms_uri,
|
|
11275
|
-
transferable: Boolean(o.transferable),
|
|
11276
|
-
specificSponsor: o.specific_sponsor?.variant === "Some" ? o.specific_sponsor.values?.[0] ?? o.specific_sponsor.value : null,
|
|
11277
|
-
open: Boolean(o.open),
|
|
11278
|
-
royaltyBps: BigInt(o.royalty_bps)
|
|
11279
|
-
};
|
|
11280
|
-
}
|
|
11281
|
-
async getBid(params) {
|
|
11282
|
-
const result = await this._contractRead(params.sponsorshipAddress).call("get_bid", [
|
|
11283
|
-
cairo.uint256(params.offerId),
|
|
11284
|
-
params.sponsor
|
|
11285
|
-
]);
|
|
11286
|
-
return BigInt(result);
|
|
11287
|
-
}
|
|
11288
|
-
async getProposal(params) {
|
|
11289
|
-
const p = await this._contractRead(params.sponsorshipAddress).call("get_proposal", [
|
|
11290
|
-
cairo.uint256(params.proposalId)
|
|
11291
|
-
]);
|
|
11292
|
-
return {
|
|
11293
|
-
proposer: p.proposer,
|
|
11294
|
-
nftContract: p.nft_contract,
|
|
11295
|
-
tokenId: BigInt(p.token_id),
|
|
11296
|
-
amount: BigInt(p.amount),
|
|
11297
|
-
duration: Number(p.duration),
|
|
11298
|
-
validUntil: Number(p.valid_until),
|
|
11299
|
-
paymentToken: p.payment_token,
|
|
11300
|
-
licenseTermsUri: p.license_terms_uri,
|
|
11301
|
-
transferable: Boolean(p.transferable),
|
|
11302
|
-
open: Boolean(p.open),
|
|
11303
|
-
royaltyBps: BigInt(p.royalty_bps)
|
|
11304
|
-
};
|
|
11305
|
-
}
|
|
11306
|
-
async getLastOfferId(params) {
|
|
11307
|
-
const result = await this._contractRead(params?.sponsorshipAddress).call("get_last_offer_id", []);
|
|
11308
|
-
return BigInt(result);
|
|
11309
|
-
}
|
|
11310
|
-
async getLastProposalId(params) {
|
|
11311
|
-
const result = await this._contractRead(params?.sponsorshipAddress).call("get_last_proposal_id", []);
|
|
11312
|
-
return BigInt(result);
|
|
11313
|
-
}
|
|
11314
|
-
async getLastLicenseId(params) {
|
|
11315
|
-
const result = await this._contractRead(params?.sponsorshipAddress).call("get_last_license_id", []);
|
|
11316
|
-
return BigInt(result);
|
|
11317
|
-
}
|
|
11318
|
-
async royaltyInfo(params) {
|
|
11319
|
-
const [recipient, amount] = await this._contractRead(params.sponsorshipAddress).call("royalty_info", [
|
|
11320
|
-
cairo.uint256(params.licenseId),
|
|
11321
|
-
cairo.uint256(params.salePrice)
|
|
11322
|
-
]);
|
|
11323
|
-
return { recipient, amount: BigInt(amount) };
|
|
11324
|
-
}
|
|
11325
11179
|
};
|
|
11180
|
+
function createChainProvider(backendUrl, apiKey) {
|
|
11181
|
+
return new RpcProvider({
|
|
11182
|
+
nodeUrl: `${backendUrl.replace(/\/$/, "")}/v1/rpc`,
|
|
11183
|
+
headers: apiKey ? { "x-api-key": apiKey } : {},
|
|
11184
|
+
blockIdentifier: "latest"
|
|
11185
|
+
});
|
|
11186
|
+
}
|
|
11326
11187
|
|
|
11327
11188
|
// src/starknet/client.ts
|
|
11328
11189
|
var MedialaneClient = class {
|
|
@@ -11363,54 +11224,22 @@ var MedialaneClient = class {
|
|
|
11363
11224
|
get chain() {
|
|
11364
11225
|
return this.config.chain;
|
|
11365
11226
|
}
|
|
11366
|
-
get
|
|
11367
|
-
|
|
11227
|
+
get provider() {
|
|
11228
|
+
if (!this.config.backendUrl) {
|
|
11229
|
+
throw new Error("backendUrl not configured. Pass backendUrl to MedialaneClient to use .provider");
|
|
11230
|
+
}
|
|
11231
|
+
return this._provider ?? (this._provider = createChainProvider(this.config.backendUrl, this.config.apiKey));
|
|
11368
11232
|
}
|
|
11369
11233
|
get marketplaceContract() {
|
|
11370
11234
|
return this.config.marketplaceContract;
|
|
11371
11235
|
}
|
|
11372
11236
|
};
|
|
11373
11237
|
|
|
11374
|
-
// src/starknet/
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
const
|
|
11378
|
-
|
|
11379
|
-
const contract = newContract(
|
|
11380
|
-
IPMarketplaceABI,
|
|
11381
|
-
config.marketplaceContract,
|
|
11382
|
-
getProvider(config)
|
|
11383
|
-
);
|
|
11384
|
-
const entry = { contract };
|
|
11385
|
-
_contractCache.set(config, entry);
|
|
11386
|
-
return entry;
|
|
11387
|
-
}
|
|
11388
|
-
async function getOrderDetails(orderHash, config) {
|
|
11389
|
-
const { contract } = makeContract(config);
|
|
11390
|
-
return contract.get_order_details(orderHash);
|
|
11391
|
-
}
|
|
11392
|
-
async function getCounter(address, config) {
|
|
11393
|
-
const { contract } = makeContract(config);
|
|
11394
|
-
return BigInt((await contract.get_counter(address)).toString());
|
|
11395
|
-
}
|
|
11396
|
-
|
|
11397
|
-
// src/starknet/marketplace1155/orders.ts
|
|
11398
|
-
var _contractCache2 = /* @__PURE__ */ new WeakMap();
|
|
11399
|
-
function getContract(config) {
|
|
11400
|
-
let c = _contractCache2.get(config);
|
|
11401
|
-
if (!c) {
|
|
11402
|
-
c = newContract(Medialane1155ABI, config.marketplace1155Contract, getProvider(config));
|
|
11403
|
-
_contractCache2.set(config, c);
|
|
11404
|
-
}
|
|
11405
|
-
return c;
|
|
11406
|
-
}
|
|
11407
|
-
async function getOrderDetails1155(orderHash, config) {
|
|
11408
|
-
const contract = getContract(config);
|
|
11409
|
-
return contract.get_order_details(orderHash);
|
|
11410
|
-
}
|
|
11411
|
-
async function getCounter1155(address, config) {
|
|
11412
|
-
const contract = getContract(config);
|
|
11413
|
-
return BigInt((await contract.get_counter(address)).toString());
|
|
11238
|
+
// src/starknet/erc20.ts
|
|
11239
|
+
async function erc20Balance(provider, token, holder) {
|
|
11240
|
+
const read = (entrypoint) => provider.callContract({ contractAddress: token, entrypoint, calldata: [holder] }, "latest");
|
|
11241
|
+
const [low = "0x0", high = "0x0"] = await read("balanceOf").catch(() => read("balance_of"));
|
|
11242
|
+
return BigInt(low) + (BigInt(high) << 128n);
|
|
11414
11243
|
}
|
|
11415
11244
|
var STARKNET_DOMAIN = [
|
|
11416
11245
|
{ name: "name", type: "shortstring" },
|
|
@@ -11509,7 +11338,7 @@ function build1155CancellationTypedData(message, chainId) {
|
|
|
11509
11338
|
|
|
11510
11339
|
// src/starknet/marketplace/build.ts
|
|
11511
11340
|
function contractFor(cfg) {
|
|
11512
|
-
return newContract(IPMarketplaceABI, cfg.marketplaceContract
|
|
11341
|
+
return newContract(IPMarketplaceABI, cfg.marketplaceContract);
|
|
11513
11342
|
}
|
|
11514
11343
|
function buildListingOrder(i, cfg) {
|
|
11515
11344
|
const orderParams = {
|
|
@@ -11595,7 +11424,7 @@ function buildCancelTypedData(orderHash, offerer, cfg) {
|
|
|
11595
11424
|
return stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
|
|
11596
11425
|
}
|
|
11597
11426
|
function contractFor2(cfg) {
|
|
11598
|
-
return newContract(Medialane1155ABI, cfg.marketplace1155Contract
|
|
11427
|
+
return newContract(Medialane1155ABI, cfg.marketplace1155Contract);
|
|
11599
11428
|
}
|
|
11600
11429
|
function buildListing1155Order(i, cfg) {
|
|
11601
11430
|
const orderParams = {
|
|
@@ -11700,7 +11529,8 @@ var StarknetVenue = class {
|
|
|
11700
11529
|
]);
|
|
11701
11530
|
}
|
|
11702
11531
|
getOrderDetails(orderRef) {
|
|
11703
|
-
|
|
11532
|
+
const marketplace = newContract(IPMarketplaceABI, this.deps.config.marketplaceContract, this.deps.provider);
|
|
11533
|
+
return marketplace.get_order_details(orderRef);
|
|
11704
11534
|
}
|
|
11705
11535
|
async getCounter(address) {
|
|
11706
11536
|
return this.readCounter(this.deps.config.marketplaceContract, address);
|
|
@@ -11955,6 +11785,29 @@ async function signInWithWallet(args) {
|
|
|
11955
11785
|
}
|
|
11956
11786
|
}
|
|
11957
11787
|
|
|
11788
|
+
// src/starknet/api-key-confirmation.ts
|
|
11789
|
+
function apiKeyConfirmationTypedData(input) {
|
|
11790
|
+
return {
|
|
11791
|
+
domain: { name: "Medialane", version: "1", chainId: "SN_MAIN", revision: "1" },
|
|
11792
|
+
primaryType: "ApiKeyConfirmation",
|
|
11793
|
+
types: {
|
|
11794
|
+
StarknetDomain: [
|
|
11795
|
+
{ name: "name", type: "shortstring" },
|
|
11796
|
+
{ name: "version", type: "shortstring" },
|
|
11797
|
+
{ name: "chainId", type: "shortstring" },
|
|
11798
|
+
{ name: "revision", type: "shortstring" }
|
|
11799
|
+
],
|
|
11800
|
+
ApiKeyConfirmation: [
|
|
11801
|
+
{ name: "action", type: "shortstring" },
|
|
11802
|
+
{ name: "key", type: "string" },
|
|
11803
|
+
{ name: "account", type: "string" },
|
|
11804
|
+
{ name: "expiresAt", type: "timestamp" }
|
|
11805
|
+
]
|
|
11806
|
+
},
|
|
11807
|
+
message: { action: input.action, key: input.key, account: input.account, expiresAt: input.expiresAt }
|
|
11808
|
+
};
|
|
11809
|
+
}
|
|
11810
|
+
|
|
11958
11811
|
// src/starknet/funding/chain-transfer.ts
|
|
11959
11812
|
var FundingTransferNotSentError = class extends Error {
|
|
11960
11813
|
constructor(message = "The transfer was not sent.") {
|
|
@@ -11962,13 +11815,13 @@ var FundingTransferNotSentError = class extends Error {
|
|
|
11962
11815
|
this.name = "FundingTransferNotSentError";
|
|
11963
11816
|
}
|
|
11964
11817
|
};
|
|
11965
|
-
function fundingApiFor(client
|
|
11818
|
+
function fundingApiFor(client) {
|
|
11966
11819
|
return {
|
|
11967
|
-
createFunding: (input) => client.createFunding(input
|
|
11968
|
-
getFundingChallenge: (id, payer) => client.getFundingChallenge(id, payer
|
|
11969
|
-
authorizeFunding: (id, input) => client.authorizeFunding(id, input
|
|
11970
|
-
submitFunding: (id, txHash) => client.submitFunding(id, txHash
|
|
11971
|
-
cancelFunding: (id) => client.cancelFunding(id
|
|
11820
|
+
createFunding: (input) => client.createFunding(input),
|
|
11821
|
+
getFundingChallenge: (id, payer) => client.getFundingChallenge(id, payer),
|
|
11822
|
+
authorizeFunding: (id, input) => client.authorizeFunding(id, input),
|
|
11823
|
+
submitFunding: (id, txHash) => client.submitFunding(id, txHash),
|
|
11824
|
+
cancelFunding: (id) => client.cancelFunding(id)
|
|
11972
11825
|
};
|
|
11973
11826
|
}
|
|
11974
11827
|
function buildFundingTransferCall(instructions) {
|
|
@@ -12057,7 +11910,7 @@ async function assertTransactionSucceeded(provider, txHash, retryDelaysMs = RECE
|
|
|
12057
11910
|
}
|
|
12058
11911
|
throw new UserFacingError("Verification timed out. Check your account for the transaction status.");
|
|
12059
11912
|
}
|
|
12060
|
-
async function executeIntent(
|
|
11913
|
+
async function executeIntent(signer, client, intent, opts = {}) {
|
|
12061
11914
|
let calls;
|
|
12062
11915
|
if (intent.requiresSignature) {
|
|
12063
11916
|
const signature = await signer.signTypedData(intent.typedData);
|
|
@@ -12067,20 +11920,20 @@ async function executeIntent(provider, signer, client, intent, opts = {}) {
|
|
|
12067
11920
|
calls = intent.calls;
|
|
12068
11921
|
}
|
|
12069
11922
|
const { txHash } = await signer.execute(calls, { intentIds: [intent.id] });
|
|
12070
|
-
const receipt = await assertTransactionSucceeded(provider, txHash);
|
|
11923
|
+
const receipt = await assertTransactionSucceeded(client.provider, txHash);
|
|
12071
11924
|
await Promise.all([
|
|
12072
11925
|
syncTransactionBestEffort(client, txHash),
|
|
12073
11926
|
opts.confirm !== false ? confirmIntentBestEffort(client, intent.id, txHash) : void 0
|
|
12074
11927
|
]);
|
|
12075
11928
|
return { txHash, receipt };
|
|
12076
11929
|
}
|
|
12077
|
-
async function executeIntents(
|
|
11930
|
+
async function executeIntents(signer, client, intents, opts = {}) {
|
|
12078
11931
|
if (intents.some((i) => i.requiresSignature)) {
|
|
12079
11932
|
throw new Error("Expected prebuilt intents (requiresSignature=false)");
|
|
12080
11933
|
}
|
|
12081
11934
|
const calls = intents.flatMap((i) => i.calls);
|
|
12082
11935
|
const { txHash } = await signer.execute(calls, { intentIds: intents.map((i) => i.id) });
|
|
12083
|
-
const receipt = await assertTransactionSucceeded(provider, txHash);
|
|
11936
|
+
const receipt = await assertTransactionSucceeded(client.provider, txHash);
|
|
12084
11937
|
await Promise.all([
|
|
12085
11938
|
syncTransactionBestEffort(client, txHash),
|
|
12086
11939
|
...opts.confirm !== false ? intents.map((i) => confirmIntentBestEffort(client, i.id, txHash)) : []
|
|
@@ -12521,12 +12374,7 @@ async function estimateSelfFundedFee(provider, address, calls) {
|
|
|
12521
12374
|
async function feeTokenBalance(provider, address, unit) {
|
|
12522
12375
|
const token = getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
|
|
12523
12376
|
if (!token) throw new Error(`No fee token for unit ${unit}`);
|
|
12524
|
-
|
|
12525
|
-
contractAddress: token.address,
|
|
12526
|
-
entrypoint: "balance_of",
|
|
12527
|
-
calldata: [address]
|
|
12528
|
-
});
|
|
12529
|
-
return BigInt(low) + (BigInt(high) << 128n);
|
|
12377
|
+
return erc20Balance(provider, token.address, address);
|
|
12530
12378
|
}
|
|
12531
12379
|
function selfFundedExecutor(deps) {
|
|
12532
12380
|
return {
|
|
@@ -12823,6 +12671,6 @@ async function claimSessionWallet(api, walletAddress, deps) {
|
|
|
12823
12671
|
if (removeOwnerGuid) await deps.removeOwner(sealed, removeOwnerGuid);
|
|
12824
12672
|
}
|
|
12825
12673
|
|
|
12826
|
-
export { MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreatorCoinFactoryABI, CreatorCoinService, DROP_MAX_CLAIM_QUANTITY, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, FundingTransferNotSentError, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidRecoveryKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PopService, SUGGESTED_DEFAULT_PRICE, SponsoredCallRejectedError, SponsorshipService, StarknetVenue, TicketService, VALIDATED_EKUBO_PARAMS, accountFor, allowsFallbackFunding, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildCancelEscapeCall, buildCancellationTypedData, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildFundingTransferCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildPopAllowlist, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, claimSessionWallet, toRaw as coinToRaw, completeDeployment, computeOwnerGuid, confirmIntentBestEffort, createDeploymentCoordinator, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, decodePopClaimFragment, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, dropCalls, dropClaimLinks, dropClaimedBy, dropMintCost, dropMintState, encodeByteArray, encodePairingPayload, encodePopClaimFragment, encodeRecoveryKey, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, feeAmount, feeBps, fundWithChainTransfer, fundingApiFor,
|
|
12674
|
+
export { MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreatorCoinFactoryABI, CreatorCoinService, DROP_MAX_CLAIM_QUANTITY, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, FundingTransferNotSentError, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidRecoveryKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PopService, SUGGESTED_DEFAULT_PRICE, SponsoredCallRejectedError, SponsorshipService, StarknetVenue, TicketService, VALIDATED_EKUBO_PARAMS, accountFor, allowsFallbackFunding, apiKeyConfirmationTypedData, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildCancelEscapeCall, buildCancellationTypedData, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildFundingTransferCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildPopAllowlist, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, claimSessionWallet, toRaw as coinToRaw, completeDeployment, computeOwnerGuid, confirmIntentBestEffort, createChainProvider, createDeploymentCoordinator, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, decodePopClaimFragment, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, dropCalls, dropClaimLinks, dropClaimedBy, dropMintCost, dropMintState, encodeByteArray, encodePairingPayload, encodePopClaimFragment, encodeRecoveryKey, erc20Balance, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, feeAmount, feeBps, fundWithChainTransfer, fundingApiFor, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, parseAccountAddress, parseCreatorCoinCreated, parsePairingPayload, parseRecoveryKey, popCalls, popClaimInfo, popClaimLinks, popClaimLinksCsv, popClaimState, popHasClaimed, priceToEkuboParams, readDrop, requestSiwsToken, selfFundedExecutor, signInWithWallet, sponsoredExecutor, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractTerms as toDropContractTerms, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyPopProof, waitUntilDeployed };
|
|
12827
12675
|
//# sourceMappingURL=index.js.map
|
|
12828
12676
|
//# sourceMappingURL=index.js.map
|