@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/index.cjs
CHANGED
|
@@ -11636,6 +11636,14 @@ function toSignatureArray(sig) {
|
|
|
11636
11636
|
const s = sig;
|
|
11637
11637
|
return [s.r.toString(), s.s.toString()];
|
|
11638
11638
|
}
|
|
11639
|
+
function newContract(abi, address, providerOrAccount) {
|
|
11640
|
+
const C = starknet.Contract;
|
|
11641
|
+
return C.length === 1 ? new starknet.Contract({ abi, address, providerOrAccount }) : new starknet.Contract(
|
|
11642
|
+
abi,
|
|
11643
|
+
address,
|
|
11644
|
+
providerOrAccount
|
|
11645
|
+
);
|
|
11646
|
+
}
|
|
11639
11647
|
function getChainId(config) {
|
|
11640
11648
|
if (config.chain !== "STARKNET") {
|
|
11641
11649
|
throw new Error(`SNIP-12 signing is Starknet-only; got chain "${config.chain}"`);
|
|
@@ -11662,7 +11670,7 @@ function getProvider(config) {
|
|
|
11662
11670
|
|
|
11663
11671
|
// src/starknet/marketplace/build.ts
|
|
11664
11672
|
function contractFor(cfg) {
|
|
11665
|
-
return
|
|
11673
|
+
return newContract(IPMarketplaceABI, cfg.marketplaceContract, getProvider(cfg));
|
|
11666
11674
|
}
|
|
11667
11675
|
function buildListingOrder(i, cfg) {
|
|
11668
11676
|
const orderParams = {
|
|
@@ -11754,11 +11762,7 @@ function makeContract(config) {
|
|
|
11754
11762
|
const cached = _contractCache.get(config);
|
|
11755
11763
|
const provider = getProvider(config);
|
|
11756
11764
|
if (cached) return { ...cached, provider };
|
|
11757
|
-
const contract =
|
|
11758
|
-
IPMarketplaceABI,
|
|
11759
|
-
config.marketplaceContract,
|
|
11760
|
-
provider
|
|
11761
|
-
);
|
|
11765
|
+
const contract = newContract(IPMarketplaceABI, config.marketplaceContract, provider);
|
|
11762
11766
|
_contractCache.set(config, { contract });
|
|
11763
11767
|
return { contract, provider };
|
|
11764
11768
|
}
|
|
@@ -12035,7 +12039,7 @@ var MarketplaceModule = class {
|
|
|
12035
12039
|
}
|
|
12036
12040
|
};
|
|
12037
12041
|
function contractFor2(cfg) {
|
|
12038
|
-
return
|
|
12042
|
+
return newContract(Medialane1155ABI, cfg.marketplace1155Contract, getProvider(cfg));
|
|
12039
12043
|
}
|
|
12040
12044
|
function buildListing1155Order(i, cfg) {
|
|
12041
12045
|
const orderParams = {
|
|
@@ -12133,11 +12137,7 @@ function getContract(config) {
|
|
|
12133
12137
|
let c = _contractCache2.get(config);
|
|
12134
12138
|
if (!c) {
|
|
12135
12139
|
const provider = getProvider(config);
|
|
12136
|
-
c =
|
|
12137
|
-
Medialane1155ABI,
|
|
12138
|
-
config.marketplace1155Contract,
|
|
12139
|
-
provider
|
|
12140
|
-
);
|
|
12140
|
+
c = newContract(Medialane1155ABI, config.marketplace1155Contract, provider);
|
|
12141
12141
|
_contractCache2.set(config, c);
|
|
12142
12142
|
}
|
|
12143
12143
|
return c;
|