deploy

suspend fun deploy(wasmBytes: ByteArray, constructorArgs: Map<String, Any?> = emptyMap(), source: String, signer: KeyPair, network: Network, rpcUrl: String, salt: ByteArray = Random.nextBytes(32), loadSpec: Boolean = true): ContractClient

Deploy a contract in one step (RECOMMENDED).

This is the primary deployment method that handles everything:

  1. Upload WASM (with duplicate detection)

  2. Deploy contract with optional constructor

  3. Load contract spec

  4. Return ready-to-use client

For advanced scenarios requiring WASM reuse, see install and deployFromWasmId.

Return

ContractClient for the deployed contract

Parameters

wasmBytes

The contract WASM code

constructorArgs

Constructor arguments as native Kotlin types

source

Source account for transactions

signer

KeyPair for signing

network

Network to deploy to

rpcUrl

RPC server URL

salt

Salt for contract ID generation (default: random)

loadSpec

Whether to load spec after deployment (default: true)

Samples