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

Add some default ESR options to the TransactContext

aaroncox opened this issue · comments

Every developer working with ESR payloads in a plugin shouldn't have to manually define these if they don't want:

https://github.com/wharfkit/resource-provider-plugin/blob/14f4860c47449bc6ed2b770b49247515538e11ab/src/index.ts#L144-L147

We either need an easier way to create an ESR payload (a helper of some sort in the context) or to include those as a default so you can just pass them when creating an ESR object, like so:

        const request = await SigningRequest.create(
            {transaction: response.data.request[1]},
            context.esrOptions
        )

So will the context.esrOptions also house and allow overriding of the callback server (cb.anchor.link)?
Or that is going to be part of implementing the UI communication?

Yeah, that'll be a part of the UI communication, through the wallet plugins themselves.

ESR itself and the esrOptions parameter above are just so that developers don't need to specify the encoding options:

https://github.com/greymass/eosio-signing-request/blob/6fc84b2355577d6461676bff417c76e4f6f2f5c3/src/signing-request.ts#L281-L288