flipmeme-sdk 1.3.29 → 1.3.31
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -19,6 +19,7 @@ interface SolanaConfig {
|
|
|
19
19
|
wallet?: PublicKey | undefined;
|
|
20
20
|
sendTransaction?: (transaction: Transaction | VersionedTransaction, connection: Connection, options?: SendTransactionOptions) => Promise<TransactionSignature>;
|
|
21
21
|
signAllTransactions?: (txs: Array<Transaction | VersionedTransaction>) => Promise<Array<Transaction | VersionedTransaction>>;
|
|
22
|
+
walletProvider: any;
|
|
22
23
|
}
|
|
23
24
|
interface CollectionParams {
|
|
24
25
|
sessionId: string;
|
|
@@ -416,7 +417,7 @@ 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<any>;
|
|
420
421
|
getTotalPrice(type: PurcahseType, collectionId: string, amount: number): Promise<string>;
|
|
421
422
|
/**
|
|
422
423
|
* create lookup table account with lookuptable addresses and return lookup table account
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ interface SolanaConfig {
|
|
|
19
19
|
wallet?: PublicKey | undefined;
|
|
20
20
|
sendTransaction?: (transaction: Transaction | VersionedTransaction, connection: Connection, options?: SendTransactionOptions) => Promise<TransactionSignature>;
|
|
21
21
|
signAllTransactions?: (txs: Array<Transaction | VersionedTransaction>) => Promise<Array<Transaction | VersionedTransaction>>;
|
|
22
|
+
walletProvider: any;
|
|
22
23
|
}
|
|
23
24
|
interface CollectionParams {
|
|
24
25
|
sessionId: string;
|
|
@@ -416,7 +417,7 @@ 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<any>;
|
|
420
421
|
getTotalPrice(type: PurcahseType, collectionId: string, amount: number): Promise<string>;
|
|
421
422
|
/**
|
|
422
423
|
* create lookup table account with lookuptable addresses and return lookup table account
|
package/dist/index.js
CHANGED
|
@@ -32423,14 +32423,7 @@ var SolanaConnector = class {
|
|
|
32423
32423
|
start = new import_bn.default(2e5);
|
|
32424
32424
|
end = new import_bn.default(1e6);
|
|
32425
32425
|
}
|
|
32426
|
-
const instruction = yield this.program.methods.createCollection(
|
|
32427
|
-
sessionId,
|
|
32428
|
-
name,
|
|
32429
|
-
tokenUri,
|
|
32430
|
-
totalSupply,
|
|
32431
|
-
start,
|
|
32432
|
-
end
|
|
32433
|
-
).accountsStrict({
|
|
32426
|
+
const instruction = yield this.program.methods.createCollection(sessionId, name, tokenUri, totalSupply, start, end).accountsStrict({
|
|
32434
32427
|
state: this.configAddresses.STATE_ID,
|
|
32435
32428
|
collection: collectionPda2,
|
|
32436
32429
|
collectionNft: collectionNftPda2,
|
|
@@ -32595,15 +32588,19 @@ var SolanaConnector = class {
|
|
|
32595
32588
|
if (!this.program) {
|
|
32596
32589
|
throw new Error("Program not initialized");
|
|
32597
32590
|
}
|
|
32598
|
-
const
|
|
32591
|
+
const latestBlockhash = yield this.config.provider.connection.getLatestBlockhash();
|
|
32592
|
+
const transaction = new import_web34.Transaction({
|
|
32593
|
+
feePayer: params.userPubkey,
|
|
32594
|
+
recentBlockhash: latestBlockhash == null ? void 0 : latestBlockhash.blockhash
|
|
32595
|
+
}).add(
|
|
32599
32596
|
import_web34.SystemProgram.transfer({
|
|
32600
32597
|
fromPubkey: params.userPubkey,
|
|
32601
32598
|
toPubkey: this.configAddresses.ADMIN_FOR_CREDIT_BUY,
|
|
32602
32599
|
lamports: new import_decimal3.default(params.amount).mul(10 ** 9).floor().toNumber()
|
|
32603
32600
|
})
|
|
32604
32601
|
);
|
|
32605
|
-
console.log("this.config", this.config);
|
|
32606
|
-
return yield this.config.sendTransaction(
|
|
32602
|
+
console.log("this.config =", this.config);
|
|
32603
|
+
return yield this.config.walletProvider.sendTransaction(
|
|
32607
32604
|
transaction,
|
|
32608
32605
|
this.config.provider.connection
|
|
32609
32606
|
);
|