I'm trying to broadcast transaction having following actions:
actions: [
transactions.createAccount(),
transactions.transfer(new BN(swapParams.value.toFixed())),
transactions.deployContract(new Uint8Array(bytecode)),
transactions.functionCall(
ABI.init.method,
{
secretHash: Buffer.from(swapParams.secretHash, 'hex').toString('base64'),
expiration: `${toNearTimestampFormat(swapParams.expiration)}`,
buyer: swapParams.recipientAddress
},
new BN(ABI.init.gas),
new BN(0)
)
]
But when I invoke
const tx = await from.signAndSendTransaction(addressToString(options.to), options.actions)
I receive following callstack:
Any idea what might be the reason?
I'm using:
near-js-api: 0.39.0
According to the documentation, source code, and defined types signAndSendTransaction
should take a single argument (an object with receiverId
and actions
fields):
const tx = await from.signAndSendTransaction({
receiverId: addressToString(options.to),
actions: options.actions
})
Was there an example/doc that mislead you, so you arrived with this function call interface? We should fix that.