This commit is contained in:
SaraJane
2026-01-19 22:38:27 +00:00
parent 581d449fdc
commit cdf35e058d
12 changed files with 1300 additions and 29 deletions

View File

@ -1,10 +1,10 @@
import { AlgorandClient } from '@algorandfoundation/algokit-utils'
import { OnSchemaBreak, OnUpdate } from '@algorandfoundation/algokit-utils/types/app'
import { useWallet } from '@txnlab/use-wallet-react'
import { useSnackbar } from 'notistack'
import { useState } from 'react'
import { HelloWorldFactory } from '../contracts/HelloWorld'
import { OnSchemaBreak, OnUpdate } from '@algorandfoundation/algokit-utils/types/app'
import { HelloWorldFactory } from '../../TokenizeRWATemplate-contracts/smart_contracts/artifacts/hello_world/HelloWorldClient'
import { getAlgodConfigFromViteEnvironment, getIndexerConfigFromViteEnvironment } from '../utils/network/getAlgoClientConfigs'
import { AlgorandClient } from '@algorandfoundation/algokit-utils'
interface AppCallsInterface {
openModal: boolean
@ -23,11 +23,20 @@ const AppCalls = ({ openModal, setModalState }: AppCallsInterface) => {
algodConfig,
indexerConfig,
})
algorand.setDefaultSigner(transactionSigner)
if (transactionSigner) {
// @ts-expect-error - optional API depending on algokit-utils version
algorand.setDefaultSigner?.(transactionSigner)
}
const sendAppCall = async () => {
setLoading(true)
if (!activeAddress || !transactionSigner) {
enqueueSnackbar('Please connect a wallet first.', { variant: 'warning' })
setLoading(false)
return
}
// Please note, in typical production scenarios,
// you wouldn't want to use deploy directly from your frontend.
// Instead, you would deploy your contract on your backend and reference it by id.