BUG: "Insufficient input in transaction" error always occurs with App Wallet after updating SDK
I use App Wallets for my web tools.
I used to be able to transact, mint, and burn, with no problems at all, this was with SDK versions:
"@meshsdk/core": "^1.5.11-beta.7",
"@meshsdk/react": "^1.1.10-beta.4",
However, after updating recently to:
"@meshsdk/core": "^1.5.25",
"@meshsdk/react": "^1.1.12",
My App Wallet errored consistently with:
Error: [Transaction] An error occurred during build: Insufficient input in transaction. shortage: {ada in inputs: 0, ada in outputs: 1189560, fee 219489
NOTE! "ada in inputs" must be >= ("ada in outputs" + fee) before adding change
and "ada in inputs" must be == ("ada in outputs" + fee) after adding change
}.
The wallet had at least 100 ADA, and no assets in it. Only after downgrading back to the old beta versions, was I able to mint/transact again.
Can you try 1.6.4 see if the issue persists?
Can you try
1.6.4see if the issue persists?
I upgraded to the latest:
{
"@meshsdk/core": "^1.6.9",
"@meshsdk/react": "^1.6.9"
}
I can't create a new TX at all now. I get the following error:
Error: [Transaction] An error occurred during build: TypeError: this.initiator.getUtxos is not a function.
And yes, TypeScript too isn't happy with the AppWallet and Transaction combo after updating Mesh. Here is my code:
const provider = new BlockfrostProvider(BLOCKFROST_API_KEY)
const wallet = new AppWallet({
networkId: 1,
fetcher: provider,
submitter: provider,
key: {
type: 'mnemonic',
words: TRADE_APP_MNEMONIC,
},
})
const tx = new Transaction({ initiator: wallet }) // <--- TypeScript angry
I'm now using the following version:
{
"@meshsdk/core": "^1.6.12",
"@meshsdk/react": "^1.6.12"
}
Still unable to use AppWallet as initiator in new Transaction.
Just checked the class type signature, AppWallet is no longer a IInitiator, please use MeshWallet instead (same way of initiating)
Just checked the class type signature,
AppWalletis no longer aIInitiator, please useMeshWalletinstead (same way of initiating)
Thanks that worked!