flipmeme-sdk 1.3.53 → 1.4.1

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
@@ -1,19 +1,16 @@
1
1
  import { AnchorProvider } from '@coral-xyz/anchor';
2
2
  import { SendTransactionOptions } from '@solana/wallet-adapter-base';
3
3
  import BN from 'bn.js';
4
- import * as _solana_web3_js from '@solana/web3.js';
5
4
  import { PublicKey, Transaction, VersionedTransaction, Connection, TransactionSignature, Keypair } from '@solana/web3.js';
6
- import { Signer, ethers, BigNumber } from 'ethers';
7
- import Decimal from 'decimal.js';
8
5
 
9
6
  declare enum BlockchainType {
10
7
  SOLANA = "solana",
11
8
  ETHEREUM = "ethereum"
12
9
  }
13
10
  interface EthereumConfig {
14
- signer?: Signer;
11
+ rpcUrl: string;
12
+ privateKey?: string;
15
13
  chainId: number;
16
- provider: ethers.providers.BaseProvider;
17
14
  }
18
15
  interface SolanaConfig {
19
16
  provider: AnchorProvider;
@@ -26,8 +23,6 @@ interface CollectionParams {
26
23
  name: string;
27
24
  tokenUri: string;
28
25
  totalSupply: number;
29
- symbol?: string;
30
- premint?: number;
31
26
  }
32
27
  interface CreateCollectionResponse {
33
28
  collectionId: string;
@@ -37,10 +32,6 @@ interface SellData {
37
32
  tokenIds: string[];
38
33
  collectionInfo: CollectionInfo;
39
34
  }
40
- interface EthSellData {
41
- tokenIds: number[];
42
- collectionId: string;
43
- }
44
35
  interface ReserveToken {
45
36
  buy: string[] | null;
46
37
  mintAndBuy: string[] | null;
@@ -51,17 +42,6 @@ interface BuyParams {
51
42
  reserveToken: ReserveToken | null;
52
43
  slippage: number;
53
44
  }
54
- /**
55
- * buy param for mint and buy or buy
56
- * if baseUri is null means the param is used for buy from liquidity pool
57
- * and in this case amount should be 0;
58
- */
59
- interface EthBuyParams {
60
- collectionAddress: string;
61
- baseUri?: string;
62
- amount: number;
63
- tokenIds: number[];
64
- }
65
45
  interface NftInfo {
66
46
  nftId: string;
67
47
  nftOnwer: string;
@@ -125,18 +105,10 @@ interface SellParams {
125
105
  slippage: number;
126
106
  ownedTokens: string[];
127
107
  }
128
- interface EthSellParams {
129
- collectionAddress: string;
130
- tokenIds: number[];
131
- }
132
108
  interface ProfileSellParams {
133
109
  data: Record<string, SellData>;
134
110
  slippage: number;
135
111
  }
136
- interface EthProfileSellParams {
137
- data: Record<string, EthSellData>;
138
- slippage: number;
139
- }
140
112
  declare function isEthereumConfig(config: EthereumConfig | SolanaConfig): config is EthereumConfig;
141
113
  declare function isSolanaConfig(config: EthereumConfig | SolanaConfig): config is SolanaConfig;
142
114
  interface TransferParams {
@@ -203,14 +175,6 @@ interface AssetInfo {
203
175
  assetData: AssetData;
204
176
  assetProof: MerkleProof;
205
177
  }
206
- interface ETHAddresses {
207
- TREASURY: string;
208
- LP_SELL_OUT: string;
209
- LP_PROVIDER: string;
210
- ROYALTY: string;
211
- FACTORY: string;
212
- PROTOCOL_FEE_BPS: number;
213
- }
214
178
 
215
179
  declare const SOLANA_MAIN: {
216
180
  LOOKUP_TABLE_STR: string;
@@ -387,25 +351,6 @@ declare const VALID_SIZE_PAIR: {
387
351
  maxDepth: number;
388
352
  };
389
353
  };
390
- declare const ETH_COMMON: {
391
- TREASURY: string;
392
- LP_SELL_OUT: string;
393
- LP_PROVIDER: string;
394
- ROYALTY: string;
395
- ADMIN_FOR_CREDIT_BUY: string;
396
- REFERRAL_CLAIM: string;
397
- PROTOCOL_FEE_BPS: number;
398
- };
399
- declare const ETH_DEV: {
400
- TREASURY: string;
401
- LP_SELL_OUT: string;
402
- LP_PROVIDER: string;
403
- ROYALTY: string;
404
- ADMIN_FOR_CREDIT_BUY: string;
405
- REFERRAL_CLAIM: string;
406
- PROTOCOL_FEE_BPS: number;
407
- FACTORY: string;
408
- };
409
354
 
410
355
  declare class FlipmemeSDK {
411
356
  private blockchainType;
@@ -414,16 +359,10 @@ declare class FlipmemeSDK {
414
359
  constructor(chainType: BlockchainType, plateform: PLATFORM, config: EthereumConfig | SolanaConfig);
415
360
  updateConfig(chainType: BlockchainType, plateform: PLATFORM, config: EthereumConfig | SolanaConfig): void;
416
361
  createCollection(params: CollectionParams): Promise<CreateCollectionResponse>;
417
- buy(params: BuyParams | EthBuyParams): Promise<ConfirmResult>;
418
- flipSell(params: SellParams | EthSellParams): Promise<ConfirmResult>;
419
- profileSell(data: ProfileSellParams | EthProfileSellParams): Promise<ConfirmResult>;
420
- buyCredit(params: TransferParams): Promise<{
421
- signature: string;
422
- latestBlockhash: Readonly<{
423
- blockhash: _solana_web3_js.Blockhash;
424
- lastValidBlockHeight: number;
425
- }>;
426
- }>;
362
+ buy(params: BuyParams): Promise<ConfirmResult>;
363
+ flipSell(params: SellParams): Promise<ConfirmResult>;
364
+ profileSell(data: ProfileSellParams): Promise<ConfirmResult>;
365
+ buyCredit(params: TransferParams): Promise<string>;
427
366
  getTotalPrice(type: PurcahseType, collectionId: string, amount: number): Promise<string>;
428
367
  /**
429
368
  * create lookup table account with lookuptable addresses and return lookup table account
@@ -436,7 +375,7 @@ declare class FlipmemeSDK {
436
375
  claimReferralReward(params: TransferParams): Promise<void>;
437
376
  getConnectedAccount(): PublicKey;
438
377
  /**For testing */
439
- getStateInfo(): Promise<[string, BigNumber, string, BigNumber, BigNumber, string] | {
378
+ getStateInfo(): Promise<{
440
379
  admin: PublicKey;
441
380
  treasury: PublicKey;
442
381
  lpSellout: PublicKey;
@@ -446,7 +385,7 @@ declare class FlipmemeSDK {
446
385
  protocolFeeBps: number;
447
386
  sellerFeeBasisPoints: number;
448
387
  }>;
449
- getCollectionInfo(collectionId: string): Promise<CollectionInfo | [string, BigNumber, string, BigNumber, BigNumber, boolean, BigNumber, string, string, string]>;
388
+ getCollectionInfo(collectionId: string): Promise<CollectionInfo>;
450
389
  getTransactionTest(signature: string, transactionType?: string): Promise<BuyResponse[] | SellResponse[]>;
451
390
  getInstructionData(instruction: string): Promise<void>;
452
391
  }
@@ -457,11 +396,10 @@ declare class FlipmemeSDK {
457
396
  declare function placeTensorCollectionBid(price: number, quantity: number, collectionMint: string, privateKey: string, tensorApiKey: string): Promise<String>;
458
397
 
459
398
  declare function decodeStr(str: string): string;
460
- declare function getPrice(_mintCount: string, _nftCount: string, _steepness: string, _midPoint: string, _startPrice: string, _endPrice: string): Decimal;
461
399
 
462
400
  /**
463
401
  * this function only works for solana mainnet. So don't need to get connection as parameter
464
402
  */
465
403
  declare function placeMagicEdenCollectionBid(price: number, quantity: number, collectionMint: string, privateKey: string, magicApiKey: string): Promise<String | undefined>;
466
404
 
467
- export { type AssetData, type AssetInfo, BlockchainType, type BuyParams, type BuyResponse, COLLECTION_BID_PRICE, type CollectionInfo, type CollectionParams, type Compression, type ConfirmResult, type CreateCollectionResponse, ENV, type ETHAddresses, ETH_COMMON, ETH_DEV, type EthBuyParams, type EthProfileSellParams, type EthSellData, type EthSellParams, type EthereumConfig, FlipmemeSDK, type MerkleProof, type NetworkAddress, type NftInfo, type Ownership, PLATFORM, type ProfileSellParams, PurcahseType, 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, type TransferParams, VALID_SIZE_PAIR, decodeStr, getPrice, isEthereumConfig, isSolanaConfig, placeMagicEdenCollectionBid, placeTensorCollectionBid };
405
+ export { type AssetData, type AssetInfo, BlockchainType, type BuyParams, type BuyResponse, COLLECTION_BID_PRICE, type CollectionInfo, type CollectionParams, type Compression, type ConfirmResult, type CreateCollectionResponse, ENV, type EthereumConfig, FlipmemeSDK, type MerkleProof, type NetworkAddress, type NftInfo, type Ownership, PLATFORM, type ProfileSellParams, PurcahseType, 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, type TransferParams, VALID_SIZE_PAIR, decodeStr, isEthereumConfig, isSolanaConfig, placeMagicEdenCollectionBid, placeTensorCollectionBid };
package/dist/index.d.ts CHANGED
@@ -1,19 +1,16 @@
1
1
  import { AnchorProvider } from '@coral-xyz/anchor';
2
2
  import { SendTransactionOptions } from '@solana/wallet-adapter-base';
3
3
  import BN from 'bn.js';
4
- import * as _solana_web3_js from '@solana/web3.js';
5
4
  import { PublicKey, Transaction, VersionedTransaction, Connection, TransactionSignature, Keypair } from '@solana/web3.js';
6
- import { Signer, ethers, BigNumber } from 'ethers';
7
- import Decimal from 'decimal.js';
8
5
 
9
6
  declare enum BlockchainType {
10
7
  SOLANA = "solana",
11
8
  ETHEREUM = "ethereum"
12
9
  }
13
10
  interface EthereumConfig {
14
- signer?: Signer;
11
+ rpcUrl: string;
12
+ privateKey?: string;
15
13
  chainId: number;
16
- provider: ethers.providers.BaseProvider;
17
14
  }
18
15
  interface SolanaConfig {
19
16
  provider: AnchorProvider;
@@ -26,8 +23,6 @@ interface CollectionParams {
26
23
  name: string;
27
24
  tokenUri: string;
28
25
  totalSupply: number;
29
- symbol?: string;
30
- premint?: number;
31
26
  }
32
27
  interface CreateCollectionResponse {
33
28
  collectionId: string;
@@ -37,10 +32,6 @@ interface SellData {
37
32
  tokenIds: string[];
38
33
  collectionInfo: CollectionInfo;
39
34
  }
40
- interface EthSellData {
41
- tokenIds: number[];
42
- collectionId: string;
43
- }
44
35
  interface ReserveToken {
45
36
  buy: string[] | null;
46
37
  mintAndBuy: string[] | null;
@@ -51,17 +42,6 @@ interface BuyParams {
51
42
  reserveToken: ReserveToken | null;
52
43
  slippage: number;
53
44
  }
54
- /**
55
- * buy param for mint and buy or buy
56
- * if baseUri is null means the param is used for buy from liquidity pool
57
- * and in this case amount should be 0;
58
- */
59
- interface EthBuyParams {
60
- collectionAddress: string;
61
- baseUri?: string;
62
- amount: number;
63
- tokenIds: number[];
64
- }
65
45
  interface NftInfo {
66
46
  nftId: string;
67
47
  nftOnwer: string;
@@ -125,18 +105,10 @@ interface SellParams {
125
105
  slippage: number;
126
106
  ownedTokens: string[];
127
107
  }
128
- interface EthSellParams {
129
- collectionAddress: string;
130
- tokenIds: number[];
131
- }
132
108
  interface ProfileSellParams {
133
109
  data: Record<string, SellData>;
134
110
  slippage: number;
135
111
  }
136
- interface EthProfileSellParams {
137
- data: Record<string, EthSellData>;
138
- slippage: number;
139
- }
140
112
  declare function isEthereumConfig(config: EthereumConfig | SolanaConfig): config is EthereumConfig;
141
113
  declare function isSolanaConfig(config: EthereumConfig | SolanaConfig): config is SolanaConfig;
142
114
  interface TransferParams {
@@ -203,14 +175,6 @@ interface AssetInfo {
203
175
  assetData: AssetData;
204
176
  assetProof: MerkleProof;
205
177
  }
206
- interface ETHAddresses {
207
- TREASURY: string;
208
- LP_SELL_OUT: string;
209
- LP_PROVIDER: string;
210
- ROYALTY: string;
211
- FACTORY: string;
212
- PROTOCOL_FEE_BPS: number;
213
- }
214
178
 
215
179
  declare const SOLANA_MAIN: {
216
180
  LOOKUP_TABLE_STR: string;
@@ -387,25 +351,6 @@ declare const VALID_SIZE_PAIR: {
387
351
  maxDepth: number;
388
352
  };
389
353
  };
390
- declare const ETH_COMMON: {
391
- TREASURY: string;
392
- LP_SELL_OUT: string;
393
- LP_PROVIDER: string;
394
- ROYALTY: string;
395
- ADMIN_FOR_CREDIT_BUY: string;
396
- REFERRAL_CLAIM: string;
397
- PROTOCOL_FEE_BPS: number;
398
- };
399
- declare const ETH_DEV: {
400
- TREASURY: string;
401
- LP_SELL_OUT: string;
402
- LP_PROVIDER: string;
403
- ROYALTY: string;
404
- ADMIN_FOR_CREDIT_BUY: string;
405
- REFERRAL_CLAIM: string;
406
- PROTOCOL_FEE_BPS: number;
407
- FACTORY: string;
408
- };
409
354
 
410
355
  declare class FlipmemeSDK {
411
356
  private blockchainType;
@@ -414,16 +359,10 @@ declare class FlipmemeSDK {
414
359
  constructor(chainType: BlockchainType, plateform: PLATFORM, config: EthereumConfig | SolanaConfig);
415
360
  updateConfig(chainType: BlockchainType, plateform: PLATFORM, config: EthereumConfig | SolanaConfig): void;
416
361
  createCollection(params: CollectionParams): Promise<CreateCollectionResponse>;
417
- buy(params: BuyParams | EthBuyParams): Promise<ConfirmResult>;
418
- flipSell(params: SellParams | EthSellParams): Promise<ConfirmResult>;
419
- profileSell(data: ProfileSellParams | EthProfileSellParams): Promise<ConfirmResult>;
420
- buyCredit(params: TransferParams): Promise<{
421
- signature: string;
422
- latestBlockhash: Readonly<{
423
- blockhash: _solana_web3_js.Blockhash;
424
- lastValidBlockHeight: number;
425
- }>;
426
- }>;
362
+ buy(params: BuyParams): Promise<ConfirmResult>;
363
+ flipSell(params: SellParams): Promise<ConfirmResult>;
364
+ profileSell(data: ProfileSellParams): Promise<ConfirmResult>;
365
+ buyCredit(params: TransferParams): Promise<string>;
427
366
  getTotalPrice(type: PurcahseType, collectionId: string, amount: number): Promise<string>;
428
367
  /**
429
368
  * create lookup table account with lookuptable addresses and return lookup table account
@@ -436,7 +375,7 @@ declare class FlipmemeSDK {
436
375
  claimReferralReward(params: TransferParams): Promise<void>;
437
376
  getConnectedAccount(): PublicKey;
438
377
  /**For testing */
439
- getStateInfo(): Promise<[string, BigNumber, string, BigNumber, BigNumber, string] | {
378
+ getStateInfo(): Promise<{
440
379
  admin: PublicKey;
441
380
  treasury: PublicKey;
442
381
  lpSellout: PublicKey;
@@ -446,7 +385,7 @@ declare class FlipmemeSDK {
446
385
  protocolFeeBps: number;
447
386
  sellerFeeBasisPoints: number;
448
387
  }>;
449
- getCollectionInfo(collectionId: string): Promise<CollectionInfo | [string, BigNumber, string, BigNumber, BigNumber, boolean, BigNumber, string, string, string]>;
388
+ getCollectionInfo(collectionId: string): Promise<CollectionInfo>;
450
389
  getTransactionTest(signature: string, transactionType?: string): Promise<BuyResponse[] | SellResponse[]>;
451
390
  getInstructionData(instruction: string): Promise<void>;
452
391
  }
@@ -457,11 +396,10 @@ declare class FlipmemeSDK {
457
396
  declare function placeTensorCollectionBid(price: number, quantity: number, collectionMint: string, privateKey: string, tensorApiKey: string): Promise<String>;
458
397
 
459
398
  declare function decodeStr(str: string): string;
460
- declare function getPrice(_mintCount: string, _nftCount: string, _steepness: string, _midPoint: string, _startPrice: string, _endPrice: string): Decimal;
461
399
 
462
400
  /**
463
401
  * this function only works for solana mainnet. So don't need to get connection as parameter
464
402
  */
465
403
  declare function placeMagicEdenCollectionBid(price: number, quantity: number, collectionMint: string, privateKey: string, magicApiKey: string): Promise<String | undefined>;
466
404
 
467
- export { type AssetData, type AssetInfo, BlockchainType, type BuyParams, type BuyResponse, COLLECTION_BID_PRICE, type CollectionInfo, type CollectionParams, type Compression, type ConfirmResult, type CreateCollectionResponse, ENV, type ETHAddresses, ETH_COMMON, ETH_DEV, type EthBuyParams, type EthProfileSellParams, type EthSellData, type EthSellParams, type EthereumConfig, FlipmemeSDK, type MerkleProof, type NetworkAddress, type NftInfo, type Ownership, PLATFORM, type ProfileSellParams, PurcahseType, 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, type TransferParams, VALID_SIZE_PAIR, decodeStr, getPrice, isEthereumConfig, isSolanaConfig, placeMagicEdenCollectionBid, placeTensorCollectionBid };
405
+ export { type AssetData, type AssetInfo, BlockchainType, type BuyParams, type BuyResponse, COLLECTION_BID_PRICE, type CollectionInfo, type CollectionParams, type Compression, type ConfirmResult, type CreateCollectionResponse, ENV, type EthereumConfig, FlipmemeSDK, type MerkleProof, type NetworkAddress, type NftInfo, type Ownership, PLATFORM, type ProfileSellParams, PurcahseType, 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, type TransferParams, VALID_SIZE_PAIR, decodeStr, isEthereumConfig, isSolanaConfig, placeMagicEdenCollectionBid, placeTensorCollectionBid };