flipmeme-sdk 1.3.84 → 1.3.86

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.d.mts CHANGED
@@ -6,6 +6,7 @@ import * as _solana_web3_js from '@solana/web3.js';
6
6
  import { PublicKey, Transaction, VersionedTransaction, Connection, TransactionSignature, Keypair } from '@solana/web3.js';
7
7
  import { Signer, ethers, BigNumber } from 'ethers';
8
8
  import Decimal from 'decimal.js';
9
+ import { Chain } from 'opensea-js';
9
10
 
10
11
  declare enum BlockchainType {
11
12
  SOLANA = "solana",
@@ -586,4 +587,12 @@ declare function placeMagicEdenCollectionBid(price: number, quantity: number, co
586
587
 
587
588
  declare function placeSpaaceCollectionBid(price: number, collection: string, tokenIdStart: string, tokenIdEnd: string, walletAddr: string, apiKey: string, source?: string): Promise<String | undefined>;
588
589
 
589
- export { APE_DEV, type AssetData, type AssetInfo, BASE_DEV, BASE_MAIN, BlockchainType, type BuyParams, type BuyResponse, COLLECTION_BID_PRICE, ChainEnv, type CollectionInfo, type CollectionParams, type Compression, type ConfirmResult, type CreateCollectionResponse, ENV, type ETHAddresses, ETHEREUM_DEV, ETHEREUM_RPC, ETH_ADDR, ETH_COMMON, ETH_MAX_PROCESS_COUNT, type EthAddr, type EthBuyParams, type EthProfileSellParams, type EthSellData, type EthSellParams, type EthTransferParams, type EthereumConfig, FlipmemeSDK, type MerkleProof, type NetworkAddress, type NftInfo, type Ownership, PLATFORM, type ProfileSellParams, PurcahseType, ROUTER, RPC, type ReserveToken, type SDKSignature, type SDKTransaction, SDK_SOLANA_CONFIG, SOLANA_COMMON, SOLANA_DEV, SOLANA_MAIN, SOLANA_PUBKEYS, SOLANA_PUBKEYS_DEV, SOLANA_PUBKEYS_STAGE, SOLANA_STAGE, type SellData, type SellParams, type SellResponse, type SolanaConfig, TOKENS, type TransactionData, type TransferParams, VALID_SIZE_PAIR, decodeStr, getPrice, getSOLPriceInUSD, getUSDPriceInSOL, getUSDPriceInWETH, isEthereumConfig, isSolanaConfig, placeMagicEdenCollectionBid, placeSpaaceCollectionBid, placeTensorCollectionBid };
590
+ interface CollectionBidParams {
591
+ collectionAddress: string;
592
+ amount: number;
593
+ quantity: number;
594
+ expirationHours: number;
595
+ }
596
+ declare function placeOpenSeaCollectionBid(nework: Chain, privKey: string, rpcUrl: string, apiKey: string, params: CollectionBidParams): Promise<void>;
597
+
598
+ export { APE_DEV, type AssetData, type AssetInfo, BASE_DEV, BASE_MAIN, BlockchainType, type BuyParams, type BuyResponse, COLLECTION_BID_PRICE, ChainEnv, type CollectionBidParams, type CollectionInfo, type CollectionParams, type Compression, type ConfirmResult, type CreateCollectionResponse, ENV, type ETHAddresses, ETHEREUM_DEV, ETHEREUM_RPC, ETH_ADDR, ETH_COMMON, ETH_MAX_PROCESS_COUNT, type EthAddr, type EthBuyParams, type EthProfileSellParams, type EthSellData, type EthSellParams, type EthTransferParams, type EthereumConfig, FlipmemeSDK, type MerkleProof, type NetworkAddress, type NftInfo, type Ownership, PLATFORM, type ProfileSellParams, PurcahseType, ROUTER, RPC, type ReserveToken, type SDKSignature, type SDKTransaction, SDK_SOLANA_CONFIG, SOLANA_COMMON, SOLANA_DEV, SOLANA_MAIN, SOLANA_PUBKEYS, SOLANA_PUBKEYS_DEV, SOLANA_PUBKEYS_STAGE, SOLANA_STAGE, type SellData, type SellParams, type SellResponse, type SolanaConfig, TOKENS, type TransactionData, type TransferParams, VALID_SIZE_PAIR, decodeStr, getPrice, getSOLPriceInUSD, getUSDPriceInSOL, getUSDPriceInWETH, isEthereumConfig, isSolanaConfig, placeMagicEdenCollectionBid, placeOpenSeaCollectionBid, placeSpaaceCollectionBid, placeTensorCollectionBid };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import * as _solana_web3_js from '@solana/web3.js';
6
6
  import { PublicKey, Transaction, VersionedTransaction, Connection, TransactionSignature, Keypair } from '@solana/web3.js';
7
7
  import { Signer, ethers, BigNumber } from 'ethers';
8
8
  import Decimal from 'decimal.js';
9
+ import { Chain } from 'opensea-js';
9
10
 
10
11
  declare enum BlockchainType {
11
12
  SOLANA = "solana",
@@ -586,4 +587,12 @@ declare function placeMagicEdenCollectionBid(price: number, quantity: number, co
586
587
 
587
588
  declare function placeSpaaceCollectionBid(price: number, collection: string, tokenIdStart: string, tokenIdEnd: string, walletAddr: string, apiKey: string, source?: string): Promise<String | undefined>;
588
589
 
589
- export { APE_DEV, type AssetData, type AssetInfo, BASE_DEV, BASE_MAIN, BlockchainType, type BuyParams, type BuyResponse, COLLECTION_BID_PRICE, ChainEnv, type CollectionInfo, type CollectionParams, type Compression, type ConfirmResult, type CreateCollectionResponse, ENV, type ETHAddresses, ETHEREUM_DEV, ETHEREUM_RPC, ETH_ADDR, ETH_COMMON, ETH_MAX_PROCESS_COUNT, type EthAddr, type EthBuyParams, type EthProfileSellParams, type EthSellData, type EthSellParams, type EthTransferParams, type EthereumConfig, FlipmemeSDK, type MerkleProof, type NetworkAddress, type NftInfo, type Ownership, PLATFORM, type ProfileSellParams, PurcahseType, ROUTER, RPC, type ReserveToken, type SDKSignature, type SDKTransaction, SDK_SOLANA_CONFIG, SOLANA_COMMON, SOLANA_DEV, SOLANA_MAIN, SOLANA_PUBKEYS, SOLANA_PUBKEYS_DEV, SOLANA_PUBKEYS_STAGE, SOLANA_STAGE, type SellData, type SellParams, type SellResponse, type SolanaConfig, TOKENS, type TransactionData, type TransferParams, VALID_SIZE_PAIR, decodeStr, getPrice, getSOLPriceInUSD, getUSDPriceInSOL, getUSDPriceInWETH, isEthereumConfig, isSolanaConfig, placeMagicEdenCollectionBid, placeSpaaceCollectionBid, placeTensorCollectionBid };
590
+ interface CollectionBidParams {
591
+ collectionAddress: string;
592
+ amount: number;
593
+ quantity: number;
594
+ expirationHours: number;
595
+ }
596
+ declare function placeOpenSeaCollectionBid(nework: Chain, privKey: string, rpcUrl: string, apiKey: string, params: CollectionBidParams): Promise<void>;
597
+
598
+ export { APE_DEV, type AssetData, type AssetInfo, BASE_DEV, BASE_MAIN, BlockchainType, type BuyParams, type BuyResponse, COLLECTION_BID_PRICE, ChainEnv, type CollectionBidParams, type CollectionInfo, type CollectionParams, type Compression, type ConfirmResult, type CreateCollectionResponse, ENV, type ETHAddresses, ETHEREUM_DEV, ETHEREUM_RPC, ETH_ADDR, ETH_COMMON, ETH_MAX_PROCESS_COUNT, type EthAddr, type EthBuyParams, type EthProfileSellParams, type EthSellData, type EthSellParams, type EthTransferParams, type EthereumConfig, FlipmemeSDK, type MerkleProof, type NetworkAddress, type NftInfo, type Ownership, PLATFORM, type ProfileSellParams, PurcahseType, ROUTER, RPC, type ReserveToken, type SDKSignature, type SDKTransaction, SDK_SOLANA_CONFIG, SOLANA_COMMON, SOLANA_DEV, SOLANA_MAIN, SOLANA_PUBKEYS, SOLANA_PUBKEYS_DEV, SOLANA_PUBKEYS_STAGE, SOLANA_STAGE, type SellData, type SellParams, type SellResponse, type SolanaConfig, TOKENS, type TransactionData, type TransferParams, VALID_SIZE_PAIR, decodeStr, getPrice, getSOLPriceInUSD, getUSDPriceInSOL, getUSDPriceInWETH, isEthereumConfig, isSolanaConfig, placeMagicEdenCollectionBid, placeOpenSeaCollectionBid, placeSpaaceCollectionBid, placeTensorCollectionBid };
package/dist/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
8
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
9
  var __getProtoOf = Object.getPrototypeOf;
@@ -19,6 +21,7 @@ var __spreadValues = (a, b) => {
19
21
  }
20
22
  return a;
21
23
  };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
25
  var __export = (target, all) => {
23
26
  for (var name in all)
24
27
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -99,6 +102,7 @@ __export(index_exports, {
99
102
  isEthereumConfig: () => isEthereumConfig,
100
103
  isSolanaConfig: () => isSolanaConfig,
101
104
  placeMagicEdenCollectionBid: () => placeMagicEdenCollectionBid,
105
+ placeOpenSeaCollectionBid: () => placeOpenSeaCollectionBid,
102
106
  placeSpaaceCollectionBid: () => placeSpaaceCollectionBid,
103
107
  placeTensorCollectionBid: () => placeTensorCollectionBid
104
108
  });
@@ -34737,6 +34741,10 @@ var EthereumConnector = class {
34737
34741
  return __async(this, null, function* () {
34738
34742
  var _a;
34739
34743
  let endPrice = collection.endPrice;
34744
+ let [isAvailable, errorMsg] = this.isPriceAvailable(endPrice);
34745
+ if (!isAvailable) {
34746
+ throw new Error(`Price ${endPrice} Error: ${errorMsg}`);
34747
+ }
34740
34748
  const startPrice = new import_decimal2.default(endPrice).div(17).toFixed(0);
34741
34749
  console.log(`Creating collection with startPrice: ${startPrice} and endPrice: ${endPrice}`);
34742
34750
  let tx = yield this.factory.createCollection(
@@ -40890,6 +40898,35 @@ function placeSpaaceCollectionBid(price, collection, tokenIdStart, tokenIdEnd, w
40890
40898
  }
40891
40899
  });
40892
40900
  }
40901
+
40902
+ // src/evm/opensea.ts
40903
+ var import_ethers64 = require("opensea-js/node_modules/ethers");
40904
+ var import_opensea_js = require("opensea-js");
40905
+ function placeOpenSeaCollectionBid(nework, privKey, rpcUrl, apiKey, params) {
40906
+ return __async(this, null, function* () {
40907
+ const privateKey = decodeStr(privKey);
40908
+ const provider = new import_ethers64.JsonRpcProvider(rpcUrl);
40909
+ const signer = new import_ethers64.Wallet(privateKey, provider);
40910
+ const sdk = new import_opensea_js.OpenSeaSDK(signer, {
40911
+ chain: nework,
40912
+ apiKey
40913
+ });
40914
+ const contractInfo = yield sdk.api.getContract(params.collectionAddress, nework);
40915
+ if (contractInfo.collection == null) {
40916
+ throw new Error("Failed to fetch collection info(slug name) from OpenSea");
40917
+ }
40918
+ console.log("contractInfo", contractInfo);
40919
+ const expirationTime = Math.floor(Date.now() / 1e3) + params.expirationHours * 3600;
40920
+ const offer = yield sdk.createCollectionOffer(__spreadProps(__spreadValues({}, params), {
40921
+ collectionSlug: contractInfo.collection,
40922
+ accountAddress: yield signer.getAddress(),
40923
+ expirationTime
40924
+ }));
40925
+ if (!offer) {
40926
+ throw new Error("Failed to create collection offer");
40927
+ }
40928
+ });
40929
+ }
40893
40930
  // Annotate the CommonJS export names for ESM import in node:
40894
40931
  0 && (module.exports = {
40895
40932
  APE_DEV,
@@ -40927,6 +40964,7 @@ function placeSpaaceCollectionBid(price, collection, tokenIdStart, tokenIdEnd, w
40927
40964
  isEthereumConfig,
40928
40965
  isSolanaConfig,
40929
40966
  placeMagicEdenCollectionBid,
40967
+ placeOpenSeaCollectionBid,
40930
40968
  placeSpaaceCollectionBid,
40931
40969
  placeTensorCollectionBid
40932
40970
  });