flipmeme-sdk 1.3.42 → 1.3.45
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 +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +22 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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';
|
|
4
5
|
import { PublicKey, Transaction, VersionedTransaction, Connection, TransactionSignature, Keypair } from '@solana/web3.js';
|
|
5
6
|
import { Signer, ethers, BigNumber } from 'ethers';
|
|
6
7
|
import Decimal from 'decimal.js';
|
|
@@ -416,7 +417,13 @@ declare class FlipmemeSDK {
|
|
|
416
417
|
buy(params: BuyParams | EthBuyParams): Promise<ConfirmResult>;
|
|
417
418
|
flipSell(params: SellParams | EthSellParams): Promise<ConfirmResult>;
|
|
418
419
|
profileSell(data: ProfileSellParams | EthProfileSellParams): Promise<ConfirmResult>;
|
|
419
|
-
buyCredit(params: TransferParams): Promise<
|
|
420
|
+
buyCredit(params: TransferParams): Promise<{
|
|
421
|
+
signature: string;
|
|
422
|
+
latestBlockhash: Readonly<{
|
|
423
|
+
blockhash: _solana_web3_js.Blockhash;
|
|
424
|
+
lastValidBlockHeight: number;
|
|
425
|
+
}>;
|
|
426
|
+
}>;
|
|
420
427
|
getTotalPrice(type: PurcahseType, collectionId: string, amount: number): Promise<string>;
|
|
421
428
|
/**
|
|
422
429
|
* create lookup table account with lookuptable addresses and return lookup table account
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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';
|
|
4
5
|
import { PublicKey, Transaction, VersionedTransaction, Connection, TransactionSignature, Keypair } from '@solana/web3.js';
|
|
5
6
|
import { Signer, ethers, BigNumber } from 'ethers';
|
|
6
7
|
import Decimal from 'decimal.js';
|
|
@@ -416,7 +417,13 @@ declare class FlipmemeSDK {
|
|
|
416
417
|
buy(params: BuyParams | EthBuyParams): Promise<ConfirmResult>;
|
|
417
418
|
flipSell(params: SellParams | EthSellParams): Promise<ConfirmResult>;
|
|
418
419
|
profileSell(data: ProfileSellParams | EthProfileSellParams): Promise<ConfirmResult>;
|
|
419
|
-
buyCredit(params: TransferParams): Promise<
|
|
420
|
+
buyCredit(params: TransferParams): Promise<{
|
|
421
|
+
signature: string;
|
|
422
|
+
latestBlockhash: Readonly<{
|
|
423
|
+
blockhash: _solana_web3_js.Blockhash;
|
|
424
|
+
lastValidBlockHeight: number;
|
|
425
|
+
}>;
|
|
426
|
+
}>;
|
|
420
427
|
getTotalPrice(type: PurcahseType, collectionId: string, amount: number): Promise<string>;
|
|
421
428
|
/**
|
|
422
429
|
* create lookup table account with lookuptable addresses and return lookup table account
|
package/dist/index.js
CHANGED
|
@@ -32600,20 +32600,14 @@ var SolanaConnector = class {
|
|
|
32600
32600
|
}
|
|
32601
32601
|
const latestBlockhash = yield this.config.provider.connection.getLatestBlockhash();
|
|
32602
32602
|
const blockHash = latestBlockhash.blockhash;
|
|
32603
|
-
const transaction = new import_web34.Transaction(
|
|
32604
|
-
feePayer: this.config.wallet,
|
|
32605
|
-
recentBlockhash: blockHash
|
|
32606
|
-
}).add(
|
|
32603
|
+
const transaction = new import_web34.Transaction().add(
|
|
32607
32604
|
import_web34.SystemProgram.transfer({
|
|
32608
32605
|
fromPubkey: params.userPubkey,
|
|
32609
32606
|
toPubkey: this.configAddresses.ADMIN_FOR_CREDIT_BUY,
|
|
32610
32607
|
lamports: new import_decimal3.default(params.amount).mul(10 ** 9).floor().toNumber()
|
|
32611
32608
|
})
|
|
32612
32609
|
);
|
|
32613
|
-
return yield this.
|
|
32614
|
-
transaction,
|
|
32615
|
-
this.config.provider.connection
|
|
32616
|
-
);
|
|
32610
|
+
return yield this.sendTxn(transaction, null);
|
|
32617
32611
|
});
|
|
32618
32612
|
}
|
|
32619
32613
|
claimReferralReward(params) {
|
|
@@ -32745,10 +32739,10 @@ var SolanaConnector = class {
|
|
|
32745
32739
|
for (let i = 0; i < mintingCount; i++) {
|
|
32746
32740
|
totalPrice = totalPrice.plus(
|
|
32747
32741
|
getPrice(
|
|
32748
|
-
expectedMintCount.
|
|
32749
|
-
expectedNftCount.
|
|
32750
|
-
steepness.
|
|
32751
|
-
midPoint.
|
|
32742
|
+
expectedMintCount.toString(),
|
|
32743
|
+
expectedNftCount.toString(),
|
|
32744
|
+
steepness.toString(),
|
|
32745
|
+
midPoint.toString(),
|
|
32752
32746
|
startPriceStr,
|
|
32753
32747
|
endPriceStr
|
|
32754
32748
|
)
|
|
@@ -32758,10 +32752,10 @@ var SolanaConnector = class {
|
|
|
32758
32752
|
for (let i = 0; i < buyingCount; i++) {
|
|
32759
32753
|
totalPrice = totalPrice.plus(
|
|
32760
32754
|
getPrice(
|
|
32761
|
-
expectedMintCount.
|
|
32762
|
-
expectedNftCount.
|
|
32763
|
-
steepness.
|
|
32764
|
-
midPoint.
|
|
32755
|
+
expectedMintCount.toString(),
|
|
32756
|
+
expectedNftCount.toString(),
|
|
32757
|
+
steepness.toString(),
|
|
32758
|
+
midPoint.toString(),
|
|
32765
32759
|
startPriceStr,
|
|
32766
32760
|
endPriceStr
|
|
32767
32761
|
)
|
|
@@ -32773,10 +32767,10 @@ var SolanaConnector = class {
|
|
|
32773
32767
|
expectedNftCount = Math.min(expectedNftCount + 1, totalSupply);
|
|
32774
32768
|
totalPrice = totalPrice.plus(
|
|
32775
32769
|
getPrice(
|
|
32776
|
-
expectedMintCount.
|
|
32777
|
-
expectedNftCount.
|
|
32778
|
-
steepness.
|
|
32779
|
-
midPoint.
|
|
32770
|
+
expectedMintCount.toString(),
|
|
32771
|
+
expectedNftCount.toString(),
|
|
32772
|
+
steepness.toString(),
|
|
32773
|
+
midPoint.toString(),
|
|
32780
32774
|
startPriceStr,
|
|
32781
32775
|
endPriceStr
|
|
32782
32776
|
)
|
|
@@ -32817,20 +32811,20 @@ var SolanaConnector = class {
|
|
|
32817
32811
|
totalSupply
|
|
32818
32812
|
);
|
|
32819
32813
|
currentPrice = getPrice(
|
|
32820
|
-
expectedMintCount.
|
|
32821
|
-
expectedNftCount.
|
|
32822
|
-
steepness.
|
|
32823
|
-
midPoint.
|
|
32814
|
+
expectedMintCount.toString(),
|
|
32815
|
+
expectedNftCount.toString(),
|
|
32816
|
+
steepness.toString(),
|
|
32817
|
+
midPoint.toString(),
|
|
32824
32818
|
startPriceStr,
|
|
32825
32819
|
endPriceStr
|
|
32826
32820
|
);
|
|
32827
32821
|
} else if (type === "sell" /* SELL */) {
|
|
32828
32822
|
expectedNftCount = Math.min(expectedNftCount + index, totalSupply);
|
|
32829
32823
|
currentPrice = getPrice(
|
|
32830
|
-
expectedMintCount.
|
|
32831
|
-
expectedNftCount.
|
|
32832
|
-
steepness.
|
|
32833
|
-
midPoint.
|
|
32824
|
+
expectedMintCount.toString(),
|
|
32825
|
+
expectedNftCount.toString(),
|
|
32826
|
+
steepness.toString(),
|
|
32827
|
+
midPoint.toString(),
|
|
32834
32828
|
startPriceStr,
|
|
32835
32829
|
endPriceStr
|
|
32836
32830
|
);
|