This commit is contained in:
SaraJane
2025-12-30 13:07:28 +00:00
commit 93e3f09667
95 changed files with 20233 additions and 0 deletions

View File

@ -0,0 +1,33 @@
import { AlgorandClient } from '@algorandfoundation/algokit-utils'
import { HelloWorldFactory } from '../artifacts/hello_world/HelloWorldClient'
// Below is a showcase of various deployment options you can use in TypeScript Client
export async function deploy() {
console.log('=== Deploying HelloWorld ===')
const algorand = AlgorandClient.fromEnvironment()
const deployer = await algorand.account.fromEnvironment('DEPLOYER')
const factory = algorand.client.getTypedAppFactory(HelloWorldFactory, {
defaultSender: deployer.addr,
})
const { appClient, result } = await factory.deploy({ onUpdate: 'append', onSchemaBreak: 'append' })
// If app was just created fund the app account
if (['create', 'replace'].includes(result.operationPerformed)) {
await algorand.send.payment({
amount: (1).algo(),
sender: deployer.addr,
receiver: appClient.appAddress,
})
}
const method = 'hello'
const response = await appClient.send.hello({
args: { name: 'world' },
})
console.log(
`Called ${method} on ${appClient.appClient.appName} (${appClient.appClient.appId}) with name = world, received: ${response.return}`,
)
}