deployFromWasmId

suspend fun deployFromWasmId(wasmId: String, constructorArgs: List<SCValXdr> = emptyList(), source: String, signer: KeyPair, network: Network, rpcUrl: String, salt: ByteArray = secureRandomBytes(32), loadSpec: Boolean = true): ContractClient

Deploy a contract from an existing WASM ID (ADVANCED - Step 2 of 2).

This is a power-user method for deploying contracts from a previously uploaded WASM. Use this to deploy multiple contract instances from the same WASM code (saves fees and time).

Most developers should use the one-step deploy method instead.

Return

ContractClient for the deployed contract

Parameters

wasmId

WASM ID (hex string) from install

constructorArgs

Constructor arguments as List (XDR)

source

Source account

signer

KeyPair for signing

network

Network to deploy to

rpcUrl

RPC server URL

salt

Salt for contract ID generation (default: 32 bytes from the platform CSPRNG)

loadSpec

Whether to load the contract spec from the uploaded code before deploying, so the returned client carries it (default: true)

Throws

if the network refuses the deployment transaction at submission

if wasmId is not a valid hex string

Samples