Hi, I am currently building the frontend of my dapp mostly starting off from fcl-demo repo of the week 4 lecture.
The transaction is as follows.
import FlowToken from 0x01cf0e2f2f715450
// This transaction configures an account to store and receive tokens defined by
// the FlowToken contract.
transaction {
var address: Address
// var receiverRef: [&FlowToken.Vault{FlowToken.Receiver}]
prepare(acct: AuthAccount) {
self.address = acct.address
// Create a new empty Vault object
let vaultA <- FlowToken.createEmptyVault()
// Store the vault in the account storage
acct.save<@FlowToken.Vault>(<-vaultA, to: /storage/FlowVault)
log("Empty Vault stored")
// Create a public Receiver capability to the Vault
acct.link<&FlowToken.Vault{FlowToken.Receiver, FlowToken.Balance}>(/public/FlowReceiver, target: /storage/FlowVault)
log("References created")
}
}
When I run this transaction via Go SDK, it seems working fine.
However, when I send the transaction with following using js-sdk
using the account created by the dammy wallet, I get the error in the title.
const { transactionId } = await fcl.send([
fcl.transaction(simpleTransaction),
fcl.proposer(fcl.currentUser().authorization),
fcl.authorizations([
fcl.currentUser().authorization,
]),
fcl.payer(fcl.currentUser().authorization),
fcl.ref(block.id)
])
The code is at https://github.com/makoto/alley-oop/blob/master/src/dex/SetupVault.js