snarkVM icon indicating copy to clipboard operation
snarkVM copied to clipboard

Update REST Endpoints

Open ilitteri opened this issue 3 years ago • 4 comments

Motivation

Updated

  • GET /testnet3/records/all is now POST and returns a list of records.
  • GET /testnet3/records/unspent is now POST and returns a list of records.
  • GET /testnet3/records/spent is now POST and returns a list of records.

Created

  • POST /testnet3/ciphertexts/unspent - Retrieves a vector of unspent record ciphertexts given a view key.
  • GET /testnet3/record/ciphertext/{commitment} - Retrieves the record ciphertext given its commitment. This endpoint is needed because the Aleo CLI should be able to retrieve the record/s associated with their commitments which can be inputs of the execute command.
  • POST /testnet3/transfer - Creates a transfer from account A given its private key to account B given its address, for a given amount. This endpoint is needed to make transfers between accounts and to make a faucet of a sort.

/testnet3/transfer request example

{
    "from": "APrivateKey1zkp6ka4UZu9JfMFDBqzKBffX7HQpsneKtzCTwnHb5GXVDpL",
    "to": "aleo1ttf46heagh0e50esnd0ju29xjka6jd9ccsq7hqg9n4wv57mx4uzsm4frgf",
    "amount": 1
}

Related PRs/Issues

This PR addresses:

  • #1056
  • #1077

ilitteri avatar Oct 04 '22 21:10 ilitteri

The compiler job failure seems transient, but the clippy one isn't.

ljedrz avatar Oct 05 '22 14:10 ljedrz

The compiler job failure seems transient, but the clippy one isn't.

I saw that the clippy warning was added in another PR. Do you think that we should address it in this PR, or should be do that in another?

ilitteri avatar Oct 05 '22 15:10 ilitteri

I saw that the clippy warning was added in another PR.

If it was caused by a different change, I think it should be a separate PR, so it could possibly be merged sooner.

ljedrz avatar Oct 05 '22 16:10 ljedrz

@ilitteri could you take a look at the merge conflicts for this PR? We made a few bug + clippy fixes to the REST endpoints in PRs today.

howardwu avatar Oct 06 '22 00:10 howardwu