I am having problem with invoking deploy() function from frontend. I am using typescript binding of deployer contract
const ownerAddr = new Address("GD75OZRV62DYS6RMUCVUIYWKZ2BTP2WMSOFNCPEOJPYHYFIYRCE6SHCD")
const routerAddr = new Address("CACIQ6HWPBEMPQYKRRAZSM6ZQORTBTS7DNXCRTI6NQYMUP2BHOXTBUVD")
const handleDeploy = async () => {
const deploy = await DeployerClient.default.deploy({
wasm_hash: Buffer.from(wasmHash, 'hex'),
salt: Buffer.from("4b230010c1dc15dfd0e52e4ef874906dbe4ba5c362593595725e3b2d9c9511cb", 'hex'),
constructor_args: [ownerAddr.toScVal(), routerAddr.toScVal()]
})
}
Above is resulting in a console error:
Uncaught (in promise) TypeError: cannot interpret n2 value as ScVal ({"_switch":{"name":"scvAddress","value":18},"_arm":"address","_value":{"_switch":{"name":"scAddressTypeAccount","value":0},"_arm":"accountId","_value":{"_switch":{"name":"publicKeyTypeEd25519","value":0},"_arm":"ed25519","_armType":{"_length":32},"_value":{"type":"Buffer","data":[255,215,102,53,246,135,137,122,44,160,171,68,98,202,206,131,55,234,204,147,138,209,60,142,75,240,124,21,24,136,137,233]}}}})
at Spec2.nativeToScVal (spec.js:667:21)
at spec.js:610:37
at Array.map (<anonymous>)
at Spec2.nativeToScVal (spec.js:609:62)
at spec.js:506:22
at Array.map (<anonymous>)
at Spec2.funcArgsToScVals (spec.js:505:26)
at Client.assembleTransaction2 [as deploy] (client.js:129:30)
at Object.handleDeploy [as onClick] (Welcome.tsx:43:53)
at onClick (index.tsx:109:25)
What is the correct way to pass this constructor_args for deploy function