wharfkit / session

Create account-based sessions, perform transactions, and allow users to login using Antelope-based blockchains.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use of `send_transaction2`

DenisCarriere opened this issue · comments

commented

Allow Wharfkit session to use send_transaction2 (push retry functionality)

params:

  • retry_trx: true
  • retry_trx_num_blocks: number

Currently using send_transaction

result.response = await context.client.v1.chain.send_transaction(signed)

send_transaction2 included in EOSIO core library
https://github.com/greymass/eosio-core/blob/1de041c7824bfc472e23806eee5452182d711f1c/src/api/v1/chain.ts#L161

Adding a few notes here on how we'll probably handle this, since it's the only issue open related to multiple methods of pushing transactions.

What we'll probably need is some sort of optional BroadcastPlugin, with a default being loaded in so the current experience doesn't change at all. Optionally, developers could specify a new plugin that modifies the behavior of how transactions are broadcast. These plugins would allow the use of send_transaction2 or any future broadcasting endpoint, or potentially the ability to do failover or broadcast mirroring to multiple endpoints at the same time.

The BroadcastPlugin interface will need to be defined, taking in a signed transaction and then returning a standardized response from the API to indicate success/failure, along with error handling