near / pagoda-relayer-rs

Rust Reference Implementation of Relayer for NEP-366 Meta Transactions
MIT License
32 stars 15 forks source link

use `wait_until` optional param when calling jsonrpc-client #68

Closed anthony-near closed 6 months ago

anthony-near commented 8 months ago

When https://github.com/near/near-jsonrpc-client-rs/pull/136 is merged (also contains useful examples for implementation) and a new version of the near-jsonrpc-client crate is released:

  1. update the near-jsonrpc-client crate version in Cargo.toml to the latest
  2. update the data dtype of send_meta_tx() fn signature to include an optional wait_until param, which can be one of INCLUDED, INCLUDED_FINAL, EXECUTED, FINAL corresponding to the TxExecutionStatus enum. NOTE: NONE from the TxExecutionStatus enum is the same as the async endpoint and we don't want a tx hash returned.
    i. I'm not sure what the response format will be for each of the TxExecutionStatus enum values of wait_until, so you may need to either create a separate method that for the different return types or support multiple return types and update other references in the code to support the Option of either dtype
  3. check with the fastauth team their desired level of finality for /send_meta_tx and for /create_account_atomic i. If the fastauth team which wait_until option of the TxExecutionStatus enum they'd like to use for /create_account_atomic, update the RPC calls from /create_account_atomic to use the desired wait_until params
  4. add a test that makes use of the wait_until param with the value of INCLUDED or INCLUDED_FINAL for /send_meta_tx. Think the old version of the call to the jsonrpc-client only returns the result when the tx is FINAL

Docs for updated RPC method: https://docs.near.org/api/rpc/transactions#send-tx