perun-network / erdstall-ts-sdk

TypeScript client SDK to interact with Erdstall.
Apache License 2.0
5 stars 2 forks source link

Expose `Provider` from `ErdstallClient/ErdstallSession` #73

Open ndzik opened 3 years ago

ndzik commented 3 years ago

The ErdstallClient and ErdstallSession require a provider to be able to communicate with the underlying ledger. From a user perspective it would be nice to have the Provider exposed.

Example:

I am currently a user of this SDK and heavily use the ErdstallSession in my code. For 9 out of 10 things it does the job I need and gives a way to access whatever I need. But the tenth thing is connecting to a Contract on the ledger. To make this work, I have to use a Provider and it would be nice to just be able to retrieve that Provider form the Session I use everywhere else. Otherwise I am forced to manually track this provider, which is possible but not feels awkward, when it is right in front of me but locked behind a protected directive.

Any thoughts?