anoma / namada-interface

Apache License 2.0
77 stars 95 forks source link

SDK: Provide mechanism to re-initialize wasm in instance with new settings #860

Closed jurevans closed 1 month ago

jurevans commented 1 month ago

The current sdk package does not provide a direct way of updating itself should new values for rpcUrl and nativeToken be needed by the client. In its current state, it is required that we create a new instance of Sdk, but this shouldn't necessarily be needed, since we only need to reload the wasms that depend on those values.

Allowing this instance to be updated will clean up logic in the client, as we can maintain one global instance of Sdk, and simply update to fix all queries/broadcasts.