Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions components/molecules/form-pledge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { TransactionModal } from '../../molecules/transaction-modal'
import { Utils } from '../../../shared/utils'
import styles from './style.module.css'
import { Spacer } from '../../atoms/spacer'
import { abundance, crowdfund } from '../../../shared/contracts'
import { abundance, crowdfund, server } from '../../../shared/contracts'
import { signTransaction } from '@stellar/freighter-api'
import { BASE_FEE, xdr } from '@stellar/stellar-sdk'
import { BASE_FEE, TransactionBuilder, xdr } from '@stellar/stellar-sdk'

export interface IFormPledgeProps {
account: string
Expand Down Expand Up @@ -47,8 +47,15 @@ function MintButton({
title={`Mint ${displayAmount} ${symbol}`}
onClick={async () => {
setSubmitting(true)
const tx = await abundance.mint({ to: account, amount: amount })
await tx.signAndSend()
const tx = await abundance.mint({ to: account, amount: amount });
const signedXdr = await signTransaction(tx.toXDR(), {
network: 'TESTNET',
});
let signed_tx = TransactionBuilder.fromXDR(
signedXdr,
"Test SDF Network ; September 2015"
);
const txRes = await server.sendTransaction(signed_tx);
setSubmitting(false)
onComplete()
}}
Expand Down