The issue is that I can’t make that snippet work in my code
This is where I’m trying to make it work predicate-practice-client1/App.tsx at predicate-sendtx · ewynx/predicate-practice-client1 · GitHub The thing that I changed is that the predicate is instantiated with the provider (testnet beta-3).
The initial error was "Invalid b256 (argument="b256", value="0x01", code=INVALID_ARGUMENT..".
Then I changed the id to a longer hex and now the error is "Invalid struct UtxoId. Field "outputIndex" not present. (argument="UtxoId", value"
Hi Elena – I couldn’t replicate this issue. I cloned your repo and ran it as-is, only changing the private key to a valid one. You can try with my testnet test wallet:
Also, it seems like the error that is caused by calling predicate.sendTransaction(request); comes from request.toTransactionBytes() which is done in sendTransaction. But I don’t know what to change to fix it.
Hi @elena , so I was finding a few different validation issues with code you provided. This may happen when using test cases as your exemplary usage. Unit test cases, especially the one you were using as reference will use mocks to ensure we are only testing the functionality of a specific service or class, the Predicate class in this instance. And not the functionality of other services. However this will be done in end to end or feature level tests.
This meant the resource itself was being mocked in the test to make it available to the predicate, however this isn’t the case in your example repository. I have forked your repository and added exemplar usage of sendTransaction using a resource available to the instantiated predicate: Github - predicate sendTransaction example.