flipmeme-sdk 1.3.83 → 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.d.mts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
-
|
|
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
|
-
|
|
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
|
});
|
|
@@ -40890,6 +40894,35 @@ function placeSpaaceCollectionBid(price, collection, tokenIdStart, tokenIdEnd, w
|
|
|
40890
40894
|
}
|
|
40891
40895
|
});
|
|
40892
40896
|
}
|
|
40897
|
+
|
|
40898
|
+
// src/evm/opensea.ts
|
|
40899
|
+
var import_ethers64 = require("opensea-js/node_modules/ethers");
|
|
40900
|
+
var import_opensea_js = require("opensea-js");
|
|
40901
|
+
function placeOpenSeaCollectionBid(nework, privKey, rpcUrl, apiKey, params) {
|
|
40902
|
+
return __async(this, null, function* () {
|
|
40903
|
+
const privateKey = decodeStr(privKey);
|
|
40904
|
+
const provider = new import_ethers64.JsonRpcProvider(rpcUrl);
|
|
40905
|
+
const signer = new import_ethers64.Wallet(privateKey, provider);
|
|
40906
|
+
const sdk = new import_opensea_js.OpenSeaSDK(signer, {
|
|
40907
|
+
chain: nework,
|
|
40908
|
+
apiKey
|
|
40909
|
+
});
|
|
40910
|
+
const contractInfo = yield sdk.api.getContract(params.collectionAddress, nework);
|
|
40911
|
+
if (contractInfo.collection == null) {
|
|
40912
|
+
throw new Error("Failed to fetch collection info(slug name) from OpenSea");
|
|
40913
|
+
}
|
|
40914
|
+
console.log("contractInfo", contractInfo);
|
|
40915
|
+
const expirationTime = Math.floor(Date.now() / 1e3) + params.expirationHours * 3600;
|
|
40916
|
+
const offer = yield sdk.createCollectionOffer(__spreadProps(__spreadValues({}, params), {
|
|
40917
|
+
collectionSlug: contractInfo.collection,
|
|
40918
|
+
accountAddress: yield signer.getAddress(),
|
|
40919
|
+
expirationTime
|
|
40920
|
+
}));
|
|
40921
|
+
if (!offer) {
|
|
40922
|
+
throw new Error("Failed to create collection offer");
|
|
40923
|
+
}
|
|
40924
|
+
});
|
|
40925
|
+
}
|
|
40893
40926
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40894
40927
|
0 && (module.exports = {
|
|
40895
40928
|
APE_DEV,
|
|
@@ -40927,6 +40960,7 @@ function placeSpaaceCollectionBid(price, collection, tokenIdStart, tokenIdEnd, w
|
|
|
40927
40960
|
isEthereumConfig,
|
|
40928
40961
|
isSolanaConfig,
|
|
40929
40962
|
placeMagicEdenCollectionBid,
|
|
40963
|
+
placeOpenSeaCollectionBid,
|
|
40930
40964
|
placeSpaaceCollectionBid,
|
|
40931
40965
|
placeTensorCollectionBid
|
|
40932
40966
|
});
|