flipmeme-sdk 1.3.84 → 1.3.85

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.mjs CHANGED
@@ -1,4 +1,6 @@
1
1
  var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -14,6 +16,7 @@ var __spreadValues = (a, b) => {
14
16
  }
15
17
  return a;
16
18
  };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
17
20
  var __export = (target, all) => {
18
21
  for (var name in all)
19
22
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -40851,6 +40854,35 @@ function placeSpaaceCollectionBid(price, collection, tokenIdStart, tokenIdEnd, w
40851
40854
  }
40852
40855
  });
40853
40856
  }
40857
+
40858
+ // src/evm/opensea.ts
40859
+ import { JsonRpcProvider, Wallet } from "opensea-js/node_modules/ethers";
40860
+ import { OpenSeaSDK } from "opensea-js";
40861
+ function placeOpenSeaCollectionBid(nework, privKey, rpcUrl, apiKey, params) {
40862
+ return __async(this, null, function* () {
40863
+ const privateKey = decodeStr(privKey);
40864
+ const provider = new JsonRpcProvider(rpcUrl);
40865
+ const signer = new Wallet(privateKey, provider);
40866
+ const sdk = new OpenSeaSDK(signer, {
40867
+ chain: nework,
40868
+ apiKey
40869
+ });
40870
+ const contractInfo = yield sdk.api.getContract(params.collectionAddress, nework);
40871
+ if (contractInfo.collection == null) {
40872
+ throw new Error("Failed to fetch collection info(slug name) from OpenSea");
40873
+ }
40874
+ console.log("contractInfo", contractInfo);
40875
+ const expirationTime = Math.floor(Date.now() / 1e3) + params.expirationHours * 3600;
40876
+ const offer = yield sdk.createCollectionOffer(__spreadProps(__spreadValues({}, params), {
40877
+ collectionSlug: contractInfo.collection,
40878
+ accountAddress: yield signer.getAddress(),
40879
+ expirationTime
40880
+ }));
40881
+ if (!offer) {
40882
+ throw new Error("Failed to create collection offer");
40883
+ }
40884
+ });
40885
+ }
40854
40886
  export {
40855
40887
  APE_DEV,
40856
40888
  BASE_DEV,
@@ -40887,6 +40919,7 @@ export {
40887
40919
  isEthereumConfig,
40888
40920
  isSolanaConfig,
40889
40921
  placeMagicEdenCollectionBid,
40922
+ placeOpenSeaCollectionBid,
40890
40923
  placeSpaaceCollectionBid,
40891
40924
  placeTensorCollectionBid
40892
40925
  };