Files
TokenizeRWATemplate/projects/TokenizeRWATemplate-contracts/smart_contracts/hello_world/deploy-config.ts
Raghav d62f2fd1ca
Some checks failed
Release / Run TokenizeRWATemplate-contracts release (push) Has been cancelled
Release / Run TokenizeRWATemplate-frontend release (push) Has been cancelled
Update project templates and workspace configuration files
Co-Authored-By: Oz <oz-agent@warp.dev>
2026-04-16 10:38:17 +05:30

34 lines
1.1 KiB
TypeScript
Executable File

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}`,
)
}