Skip to content

Commit b3d5ca0

Browse files
committed
fix: allow stx fee transfer for paid mint
1 parent 8c9a6c6 commit b3d5ca0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/ClientPage.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useCallback, useEffect, useState } from "react";
55
import { connect, disconnect, openContractCall, request } from "@stacks/connect";
66
import { STACKS_MAINNET, STACKS_TESTNET } from "@stacks/network";
77
import {
8+
PostConditionMode,
89
cvToValue,
910
fetchCallReadOnlyFunction,
1011
hexToCV,
@@ -1085,6 +1086,10 @@ export default function ClientPage() {
10851086
setError("Connect wallet first.");
10861087
return;
10871088
}
1089+
if (infernoFeeUstx === null) {
1090+
setError("Price not loaded yet. Click “Refresh On-Chain” and try again.");
1091+
return;
1092+
}
10881093

10891094
setError("");
10901095
setStatus("Minting Inferno Pulse...");
@@ -1095,6 +1100,9 @@ export default function ClientPage() {
10951100
contractName: CONTRACT_NAME,
10961101
functionName: "mint-paid-kind",
10971102
functionArgs: [uintCV(INFERNO_PULSE.kind)],
1103+
// This call transfers STX as a mint fee. In Allow mode, the wallet
1104+
// doesn't require us to enumerate the exact STX movement as a post-condition.
1105+
postConditionMode: PostConditionMode.Allow,
10981106
network: STACKS_NETWORK_OBJ,
10991107
appDetails: {
11001108
name: APP_NAME,

0 commit comments

Comments
 (0)