Smart Contract TransferTransaction: get assetId

Hi,
I wrote the following Smart Contract

match tx {
  case tx:TransferTransaction =>
    let assetId = tx.assetId
    toBase58String(assetId) == base58'9vg1hJidBhsyDq6FVgdeMjZPfAcqz5EdgU7VsnyY2Tnw'
case _ => true
}

But the Waves IDE gives the following error
“Compilation failed: Undefined field assetId of variable of type Union(List(TransferTransaction)) in 65-75”

Why tx.assetId is not defined?

Thanks,
Klaus

match tx {
  case tx:TransferTransaction =>
    tx.transferAssetId == base58'9vg1hJidBhsyDq6FVgdeMjZPfAcqz5EdgU7VsnyY2Tnw'
case _ => true
}

big thanks. Seems, it is wrong in documentation (https://docs.wavesplatform.com/en/technical-details/waves-contracts-language-description/standard-library.html) or did I understand it wrong?

hmm, Waves IDE didn’t showed any errors, but after sending it to the blockchain, I get the following error, if I make a transaction in WavesJ with the smart account
“{
“error” : 1,
“message” : “failed to parse json message”,
“cause” : “java.util.NoSuchElementException: key not found: transferAssetId”,
“validationErrors” : { }
}”

The correct name of the field is assetId. The incorrect name transferAssetId was removed from code and documentation. It was temporary confusion.

thanks @alexey.kiselev
But if I use assetId in Waves IDE, I get the error
“Compilation failed: Undefined field assetId of variable of type Union(List(TransferTransaction)) in 51-61” and if I compile the code with WavesJ, I get the error
“Exception in thread “main” java.io.IOException: {
“error” : 305,
“message” : “Too many expressions”
}”

My code is:

match tx { 
  case tx:TransferTransaction =>
    tx.assetId != base58'9vg1hJidBhsyDq6FVgdeMjZPfAcqz5EdgU7VsnyY2Tnw'
  case _ => true
}

The IDE should be fixed, the old name has stuck there.
With WavesJ I can compile this script (using testnet) and get some Base64 string:

node.compileScript(...)

returns

"base64:AQQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAA..."

BTW it’s dangerous to return true without checking signature, because this way you allow anyone to send transactions from your account. I realize this is test code, but don’t push this to mainnet accidentally

@peterz
thanks. So you used my smart contract code for compiling? Strange, I always get an error:
Exception in thread “main” java.io.IOException: {
“error” : 305,
“message” : “Too many expressions”
}
at com.wavesplatform.wavesj.Node.exec(Node.java:297)
at com.wavesplatform.wavesj.Node.compileScript(Node.java:222)
at Main.main(Main.java:74)

Other smart contract code compiles without problems.