flipmeme-sdk 1.3.9 → 1.3.10

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
@@ -56,6 +56,7 @@ interface NetworkAddress {
56
56
  ROYALITY_ID: PublicKey;
57
57
  MPL_CORE: PublicKey;
58
58
  ADMIN_FOR_CREDIT_BUY: PublicKey;
59
+ REFERRAL_ID: PublicKey;
59
60
  RENT_TOKEN_ID: PublicKey;
60
61
  SYSTEM_PROGRAM_ID: PublicKey;
61
62
  }
@@ -110,7 +111,7 @@ interface ProfileSellParams {
110
111
  }
111
112
  declare function isEthereumConfig(config: EthereumConfig | SolanaConfig): config is EthereumConfig;
112
113
  declare function isSolanaConfig(config: EthereumConfig | SolanaConfig): config is SolanaConfig;
113
- interface BuyCreditParams {
114
+ interface TransferParams {
114
115
  userPubkey: PublicKey;
115
116
  amount: number;
116
117
  }
@@ -185,7 +186,7 @@ declare class FlipmemeSDK {
185
186
  buy(params: BuyParams): Promise<ConfirmResult>;
186
187
  flipSell(params: SellParams): Promise<ConfirmResult>;
187
188
  profileSell(data: ProfileSellParams): Promise<ConfirmResult>;
188
- buyCredit(params: BuyCreditParams): Promise<string>;
189
+ buyCredit(params: TransferParams): Promise<string>;
189
190
  getTotalPrice(type: PurcahseType, collectionId: string, amount: number): Promise<string>;
190
191
  /**
191
192
  * create lookup table account with lookuptable addresses and return lookup table account
@@ -226,6 +227,7 @@ declare const SOLANA_COMMON: {
226
227
  LP_PROVISIONER_ID: PublicKey;
227
228
  ROYALITY_ID: PublicKey;
228
229
  MPL_CORE: PublicKey;
230
+ REFERRAL_ID: PublicKey;
229
231
  ADMIN_FOR_CREDIT_BUY: PublicKey;
230
232
  RENT_TOKEN_ID: PublicKey;
231
233
  SYSTEM_PROGRAM_ID: PublicKey;
@@ -245,6 +247,7 @@ declare const SOLANA_PUBKEYS: {
245
247
  LP_PROVISIONER_ID: PublicKey;
246
248
  ROYALITY_ID: PublicKey;
247
249
  MPL_CORE: PublicKey;
250
+ REFERRAL_ID: PublicKey;
248
251
  ADMIN_FOR_CREDIT_BUY: PublicKey;
249
252
  RENT_TOKEN_ID: PublicKey;
250
253
  SYSTEM_PROGRAM_ID: PublicKey;
@@ -258,6 +261,7 @@ declare const SOLANA_PUBKEYS_DEV: {
258
261
  LP_PROVISIONER_ID: PublicKey;
259
262
  ROYALITY_ID: PublicKey;
260
263
  MPL_CORE: PublicKey;
264
+ REFERRAL_ID: PublicKey;
261
265
  ADMIN_FOR_CREDIT_BUY: PublicKey;
262
266
  RENT_TOKEN_ID: PublicKey;
263
267
  SYSTEM_PROGRAM_ID: PublicKey;
@@ -369,4 +373,4 @@ declare function placeTensorCollectionBid(price: number, quantity: number, colle
369
373
 
370
374
  declare function decodeStr(str: string): string;
371
375
 
372
- export { type AssetData, type AssetInfo, BlockchainType, type BuyCreditParams, 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, type ProfileSellParams, PurcahseType, RPC, type ReserveToken, type SDKSignature, type SDKTransaction, SDK_SOLANA_CONFIG, SOLANA_COMMON, SOLANA_DEV, SOLANA_MAIN, SOLANA_PUBKEYS, SOLANA_PUBKEYS_DEV, type SellData, type SellParams, type SellResponse, type SolanaConfig, VALID_SIZE_PAIR, decodeStr, isEthereumConfig, isSolanaConfig, placeTensorCollectionBid };
376
+ 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, type ProfileSellParams, PurcahseType, RPC, type ReserveToken, type SDKSignature, type SDKTransaction, SDK_SOLANA_CONFIG, SOLANA_COMMON, SOLANA_DEV, SOLANA_MAIN, SOLANA_PUBKEYS, SOLANA_PUBKEYS_DEV, type SellData, type SellParams, type SellResponse, type SolanaConfig, type TransferParams, VALID_SIZE_PAIR, decodeStr, isEthereumConfig, isSolanaConfig, placeTensorCollectionBid };
package/dist/index.d.ts CHANGED
@@ -56,6 +56,7 @@ interface NetworkAddress {
56
56
  ROYALITY_ID: PublicKey;
57
57
  MPL_CORE: PublicKey;
58
58
  ADMIN_FOR_CREDIT_BUY: PublicKey;
59
+ REFERRAL_ID: PublicKey;
59
60
  RENT_TOKEN_ID: PublicKey;
60
61
  SYSTEM_PROGRAM_ID: PublicKey;
61
62
  }
@@ -110,7 +111,7 @@ interface ProfileSellParams {
110
111
  }
111
112
  declare function isEthereumConfig(config: EthereumConfig | SolanaConfig): config is EthereumConfig;
112
113
  declare function isSolanaConfig(config: EthereumConfig | SolanaConfig): config is SolanaConfig;
113
- interface BuyCreditParams {
114
+ interface TransferParams {
114
115
  userPubkey: PublicKey;
115
116
  amount: number;
116
117
  }
@@ -185,7 +186,7 @@ declare class FlipmemeSDK {
185
186
  buy(params: BuyParams): Promise<ConfirmResult>;
186
187
  flipSell(params: SellParams): Promise<ConfirmResult>;
187
188
  profileSell(data: ProfileSellParams): Promise<ConfirmResult>;
188
- buyCredit(params: BuyCreditParams): Promise<string>;
189
+ buyCredit(params: TransferParams): Promise<string>;
189
190
  getTotalPrice(type: PurcahseType, collectionId: string, amount: number): Promise<string>;
190
191
  /**
191
192
  * create lookup table account with lookuptable addresses and return lookup table account
@@ -226,6 +227,7 @@ declare const SOLANA_COMMON: {
226
227
  LP_PROVISIONER_ID: PublicKey;
227
228
  ROYALITY_ID: PublicKey;
228
229
  MPL_CORE: PublicKey;
230
+ REFERRAL_ID: PublicKey;
229
231
  ADMIN_FOR_CREDIT_BUY: PublicKey;
230
232
  RENT_TOKEN_ID: PublicKey;
231
233
  SYSTEM_PROGRAM_ID: PublicKey;
@@ -245,6 +247,7 @@ declare const SOLANA_PUBKEYS: {
245
247
  LP_PROVISIONER_ID: PublicKey;
246
248
  ROYALITY_ID: PublicKey;
247
249
  MPL_CORE: PublicKey;
250
+ REFERRAL_ID: PublicKey;
248
251
  ADMIN_FOR_CREDIT_BUY: PublicKey;
249
252
  RENT_TOKEN_ID: PublicKey;
250
253
  SYSTEM_PROGRAM_ID: PublicKey;
@@ -258,6 +261,7 @@ declare const SOLANA_PUBKEYS_DEV: {
258
261
  LP_PROVISIONER_ID: PublicKey;
259
262
  ROYALITY_ID: PublicKey;
260
263
  MPL_CORE: PublicKey;
264
+ REFERRAL_ID: PublicKey;
261
265
  ADMIN_FOR_CREDIT_BUY: PublicKey;
262
266
  RENT_TOKEN_ID: PublicKey;
263
267
  SYSTEM_PROGRAM_ID: PublicKey;
@@ -369,4 +373,4 @@ declare function placeTensorCollectionBid(price: number, quantity: number, colle
369
373
 
370
374
  declare function decodeStr(str: string): string;
371
375
 
372
- export { type AssetData, type AssetInfo, BlockchainType, type BuyCreditParams, 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, type ProfileSellParams, PurcahseType, RPC, type ReserveToken, type SDKSignature, type SDKTransaction, SDK_SOLANA_CONFIG, SOLANA_COMMON, SOLANA_DEV, SOLANA_MAIN, SOLANA_PUBKEYS, SOLANA_PUBKEYS_DEV, type SellData, type SellParams, type SellResponse, type SolanaConfig, VALID_SIZE_PAIR, decodeStr, isEthereumConfig, isSolanaConfig, placeTensorCollectionBid };
376
+ 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, type ProfileSellParams, PurcahseType, RPC, type ReserveToken, type SDKSignature, type SDKTransaction, SDK_SOLANA_CONFIG, SOLANA_COMMON, SOLANA_DEV, SOLANA_MAIN, SOLANA_PUBKEYS, SOLANA_PUBKEYS_DEV, type SellData, type SellParams, type SellResponse, type SolanaConfig, type TransferParams, VALID_SIZE_PAIR, decodeStr, isEthereumConfig, isSolanaConfig, placeTensorCollectionBid };
package/dist/index.js CHANGED
@@ -2054,6 +2054,7 @@ var SOLANA_COMMON = {
2054
2054
  ),
2055
2055
  ROYALITY_ID: new import_web3.PublicKey("6oYqWqe23Ff1pnP2qPGhtYAgC7zD3fdWCUfvafaoTJEX"),
2056
2056
  MPL_CORE: new import_web3.PublicKey("CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d"),
2057
+ REFERRAL_ID: new import_web3.PublicKey(""),
2057
2058
  ADMIN_FOR_CREDIT_BUY: new import_web3.PublicKey(
2058
2059
  "ELaia39FeuTV1EttanpKMy6jbWViJAmjUurnZCB7VxBg"
2059
2060
  ),
@@ -2529,6 +2530,24 @@ var SolanaConnector = class {
2529
2530
  );
2530
2531
  });
2531
2532
  }
2533
+ claimReferralReward(params) {
2534
+ return __async(this, null, function* () {
2535
+ if (!this.program) {
2536
+ throw new Error("Program not initialized");
2537
+ }
2538
+ const transaction = new import_web34.Transaction().add(
2539
+ import_web34.SystemProgram.transfer({
2540
+ fromPubkey: this.configAddresses.ADMIN_FOR_CREDIT_BUY,
2541
+ toPubkey: params.userPubkey,
2542
+ lamports: new import_decimal2.default(params.amount).mul(10 ** 9).toNumber()
2543
+ })
2544
+ );
2545
+ return yield this.config.sendTransaction(
2546
+ transaction,
2547
+ this.config.provider.connection
2548
+ );
2549
+ });
2550
+ }
2532
2551
  getCollectionInfo(collectionId) {
2533
2552
  return __async(this, null, function* () {
2534
2553
  if (!this.program) {