@microcosmmoney/portal-react 3.13.7 → 3.13.8
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.
|
@@ -179,13 +179,23 @@ function MiningModal({ isOpen, onClose, userDetails, onSuccess }) {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
catch { }
|
|
182
|
-
const
|
|
183
|
-
const
|
|
184
|
-
const
|
|
182
|
+
const { Keypair, PublicKey } = await Promise.resolve().then(() => __importStar(require("@solana/web3.js")));
|
|
183
|
+
const refKeypair = Keypair.generate();
|
|
184
|
+
const reference = refKeypair.publicKey;
|
|
185
|
+
const response = await (0, api_1.createMiningRequest)({ mcc_amount: parseFloat(mccAmount) * 1000000000, stablecoin_type: stablecoin, reference: reference.toBase58() });
|
|
185
186
|
if (!response.success || !response.data)
|
|
186
187
|
throw new Error(response.error || t("errorCreateRequest"));
|
|
187
188
|
setMiningRequest(response.data);
|
|
188
|
-
const
|
|
189
|
+
const vault = STABLECOIN_VAULTS[stablecoin];
|
|
190
|
+
const mint = STABLECOIN_MINTS[stablecoin];
|
|
191
|
+
const payUrl = (0, solana_pay_1.createSolanaPayUrl)({
|
|
192
|
+
recipient: vault,
|
|
193
|
+
amount: response.data.usdc_amount_with_discount / 1000000,
|
|
194
|
+
splToken: mint,
|
|
195
|
+
reference,
|
|
196
|
+
label: "Microcosm Mining",
|
|
197
|
+
message: `Mine ${mccAmount} MCC`,
|
|
198
|
+
});
|
|
189
199
|
setSolanaPayUrl(payUrl);
|
|
190
200
|
setBackendStatus("created");
|
|
191
201
|
if (isMobile) {
|