@medialane/sdk 0.60.0 → 0.61.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/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/starknet/index.cjs +12 -12
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.js +12 -12
- package/dist/starknet/index.js.map +1 -1
- package/package.json +2 -2
package/dist/starknet/index.cjs
CHANGED
|
@@ -10621,6 +10621,14 @@ function toSignatureArray(sig) {
|
|
|
10621
10621
|
const s = sig;
|
|
10622
10622
|
return [s.r.toString(), s.s.toString()];
|
|
10623
10623
|
}
|
|
10624
|
+
function newContract(abi, address, providerOrAccount) {
|
|
10625
|
+
const C = starknet.Contract;
|
|
10626
|
+
return C.length === 1 ? new starknet.Contract({ abi, address, providerOrAccount }) : new starknet.Contract(
|
|
10627
|
+
abi,
|
|
10628
|
+
address,
|
|
10629
|
+
providerOrAccount
|
|
10630
|
+
);
|
|
10631
|
+
}
|
|
10624
10632
|
function getChainId(config) {
|
|
10625
10633
|
if (config.chain !== "STARKNET") {
|
|
10626
10634
|
throw new Error(`SNIP-12 signing is Starknet-only; got chain "${config.chain}"`);
|
|
@@ -10647,7 +10655,7 @@ function getProvider(config) {
|
|
|
10647
10655
|
|
|
10648
10656
|
// src/starknet/marketplace/build.ts
|
|
10649
10657
|
function contractFor(cfg) {
|
|
10650
|
-
return
|
|
10658
|
+
return newContract(IPMarketplaceABI, cfg.marketplaceContract, getProvider(cfg));
|
|
10651
10659
|
}
|
|
10652
10660
|
function buildListingOrder(i, cfg) {
|
|
10653
10661
|
const orderParams = {
|
|
@@ -10739,11 +10747,7 @@ function makeContract(config) {
|
|
|
10739
10747
|
const cached = _contractCache.get(config);
|
|
10740
10748
|
const provider = getProvider(config);
|
|
10741
10749
|
if (cached) return { ...cached, provider };
|
|
10742
|
-
const contract =
|
|
10743
|
-
IPMarketplaceABI,
|
|
10744
|
-
config.marketplaceContract,
|
|
10745
|
-
provider
|
|
10746
|
-
);
|
|
10750
|
+
const contract = newContract(IPMarketplaceABI, config.marketplaceContract, provider);
|
|
10747
10751
|
_contractCache.set(config, { contract });
|
|
10748
10752
|
return { contract, provider };
|
|
10749
10753
|
}
|
|
@@ -11020,7 +11024,7 @@ var MarketplaceModule = class {
|
|
|
11020
11024
|
}
|
|
11021
11025
|
};
|
|
11022
11026
|
function contractFor2(cfg) {
|
|
11023
|
-
return
|
|
11027
|
+
return newContract(Medialane1155ABI, cfg.marketplace1155Contract, getProvider(cfg));
|
|
11024
11028
|
}
|
|
11025
11029
|
function buildListing1155Order(i, cfg) {
|
|
11026
11030
|
const orderParams = {
|
|
@@ -11118,11 +11122,7 @@ function getContract(config) {
|
|
|
11118
11122
|
let c = _contractCache2.get(config);
|
|
11119
11123
|
if (!c) {
|
|
11120
11124
|
const provider = getProvider(config);
|
|
11121
|
-
c =
|
|
11122
|
-
Medialane1155ABI,
|
|
11123
|
-
config.marketplace1155Contract,
|
|
11124
|
-
provider
|
|
11125
|
-
);
|
|
11125
|
+
c = newContract(Medialane1155ABI, config.marketplace1155Contract, provider);
|
|
11126
11126
|
_contractCache2.set(config, c);
|
|
11127
11127
|
}
|
|
11128
11128
|
return c;
|