flipmeme-sdk 1.3.75 → 1.3.77
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/README.md +4 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -394,6 +394,7 @@ Sells NFTs back to the collection's liquidity pool.
|
|
|
394
394
|
interface EthSellParams {
|
|
395
395
|
collectionAddress: string; // Collection contract address
|
|
396
396
|
tokenIds: number[]; // Token IDs to sell
|
|
397
|
+
minPrice: string; // Price in wei
|
|
397
398
|
}
|
|
398
399
|
```
|
|
399
400
|
|
|
@@ -410,8 +411,11 @@ Promise<ConfirmResult>;
|
|
|
410
411
|
const result = await sdk.flipSell({
|
|
411
412
|
collectionAddress: "0x1234...",
|
|
412
413
|
tokenIds: [5, 10, 15],
|
|
414
|
+
minPrice: price
|
|
413
415
|
});
|
|
414
416
|
|
|
417
|
+
//`price` is calculated by getTotalPrice function
|
|
418
|
+
|
|
415
419
|
console.log(`Sold ${result.successCount} NFTs`);
|
|
416
420
|
```
|
|
417
421
|
|
package/dist/index.js
CHANGED
|
@@ -35065,8 +35065,11 @@ var EthereumConnector = class {
|
|
|
35065
35065
|
throw new Error("Signer not initialized");
|
|
35066
35066
|
}
|
|
35067
35067
|
const usdWETHPrice = yield getUSDPriceInWETH();
|
|
35068
|
+
console.log(`Current USD price in WETH: ${usdWETHPrice}`);
|
|
35068
35069
|
const amountInWei = new import_decimal2.default(usdWETHPrice).mul(params.amount).toFixed(0);
|
|
35069
|
-
|
|
35070
|
+
console.log(`usdWETHPrice: ${usdWETHPrice}, amount: ${params.amount}, amountInWei: ${amountInWei}`);
|
|
35071
|
+
const usdAmountInWei = new import_decimal2.default(params.amount).mul(new import_decimal2.default(10).pow(6)).toFixed(0);
|
|
35072
|
+
const tx = yield this.factory.buyCreditByEth(ETH_COMMON.ADMIN_FOR_CREDIT_BUY, usdAmountInWei, (_a = params.slippage) != null ? _a : 300, { value: amountInWei });
|
|
35070
35073
|
const receipt = yield tx.wait();
|
|
35071
35074
|
return receipt.transactionHash;
|
|
35072
35075
|
});
|