flipmeme-sdk 1.2.13 → 1.2.14
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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +52 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -143,6 +143,7 @@ declare class FlipmemeSDK {
|
|
|
143
143
|
*/
|
|
144
144
|
createLookupTableAndExtend(addressesToAdd: PublicKey[]): Promise<PublicKey>;
|
|
145
145
|
extendLookupTable(lookupTableAddress: PublicKey, addressesToAdd: PublicKey[], isInitial?: boolean): Promise<void>;
|
|
146
|
+
finalizeSale(collectionId: string): Promise<void>;
|
|
146
147
|
/**For testing */
|
|
147
148
|
getStateInfo(): Promise<{
|
|
148
149
|
admin: PublicKey;
|
package/dist/index.d.ts
CHANGED
|
@@ -143,6 +143,7 @@ declare class FlipmemeSDK {
|
|
|
143
143
|
*/
|
|
144
144
|
createLookupTableAndExtend(addressesToAdd: PublicKey[]): Promise<PublicKey>;
|
|
145
145
|
extendLookupTable(lookupTableAddress: PublicKey, addressesToAdd: PublicKey[], isInitial?: boolean): Promise<void>;
|
|
146
|
+
finalizeSale(collectionId: string): Promise<void>;
|
|
146
147
|
/**For testing */
|
|
147
148
|
getStateInfo(): Promise<{
|
|
148
149
|
admin: PublicKey;
|
package/dist/index.js
CHANGED
|
@@ -3129,6 +3129,49 @@ var SolanaConnector = class {
|
|
|
3129
3129
|
return totalPrice.toString();
|
|
3130
3130
|
});
|
|
3131
3131
|
}
|
|
3132
|
+
finalizeSale(collectionId) {
|
|
3133
|
+
return __async(this, null, function* () {
|
|
3134
|
+
var _a;
|
|
3135
|
+
if (!this.program) {
|
|
3136
|
+
throw new Error("Program not initialized");
|
|
3137
|
+
}
|
|
3138
|
+
const {
|
|
3139
|
+
collectionInfo: { creator }
|
|
3140
|
+
} = yield this.getCollectionInfo(collectionId);
|
|
3141
|
+
const { collectionPda: collectionPda2 } = yield getTradingAccounts(
|
|
3142
|
+
collectionId,
|
|
3143
|
+
this.config.wallet,
|
|
3144
|
+
this.program.programId,
|
|
3145
|
+
void 0,
|
|
3146
|
+
void 0
|
|
3147
|
+
);
|
|
3148
|
+
const instruction = yield (_a = this.program) == null ? void 0 : _a.methods.moveLiquidity().accountsStrict({
|
|
3149
|
+
state: SOLANA_PUBKEYS.STATE_ID,
|
|
3150
|
+
collection: collectionPda2,
|
|
3151
|
+
treasury: SOLANA_PUBKEYS.TREASURY_ID,
|
|
3152
|
+
collectionCreator: creator,
|
|
3153
|
+
lpProvisioner: SOLANA_PUBKEYS.LP_PROVISIONER_ID,
|
|
3154
|
+
eventAuthority: eventAuthority(this.program.programId),
|
|
3155
|
+
program: this.program.programId
|
|
3156
|
+
}).instruction();
|
|
3157
|
+
try {
|
|
3158
|
+
const { signature, latestBlockhash } = yield this.sendTxn(
|
|
3159
|
+
[instruction],
|
|
3160
|
+
null
|
|
3161
|
+
);
|
|
3162
|
+
const confirmResult = yield this.config.provider.connection.confirmTransaction({
|
|
3163
|
+
blockhash: latestBlockhash.blockhash,
|
|
3164
|
+
lastValidBlockHeight: latestBlockhash.lastValidBlockHeight,
|
|
3165
|
+
signature
|
|
3166
|
+
});
|
|
3167
|
+
console.log("confirmResult", confirmResult);
|
|
3168
|
+
console.log("signature", signature);
|
|
3169
|
+
return signature;
|
|
3170
|
+
} catch (e) {
|
|
3171
|
+
console.error("Distribute failed", JSON.stringify(e));
|
|
3172
|
+
}
|
|
3173
|
+
});
|
|
3174
|
+
}
|
|
3132
3175
|
//for testing
|
|
3133
3176
|
getStateInfo() {
|
|
3134
3177
|
return __async(this, null, function* () {
|
|
@@ -3581,21 +3624,15 @@ var FlipmemeSDK = class {
|
|
|
3581
3624
|
}
|
|
3582
3625
|
});
|
|
3583
3626
|
}
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
// maxDepth
|
|
3594
|
-
// );
|
|
3595
|
-
// } else {
|
|
3596
|
-
// throw new Error("Cannot call this function");
|
|
3597
|
-
// }
|
|
3598
|
-
// }
|
|
3627
|
+
finalizeSale(collectionId) {
|
|
3628
|
+
return __async(this, null, function* () {
|
|
3629
|
+
if (this.blockchainType === "solana" /* SOLANA */ && this.solana) {
|
|
3630
|
+
yield this.solana.finalizeSale(collectionId);
|
|
3631
|
+
} else {
|
|
3632
|
+
throw new Error("Cannot call this function");
|
|
3633
|
+
}
|
|
3634
|
+
});
|
|
3635
|
+
}
|
|
3599
3636
|
/**For testing */
|
|
3600
3637
|
getStateInfo() {
|
|
3601
3638
|
return __async(this, null, function* () {
|