should we make all methods + config funcs individual exports that relate to a central state instance?
versus how it is now where most utils are members + methods of the large Algonaut() class.
import { configure } from "mobx"
configure({
useProxies: "never"
})
then, instead of how we do it now,
it would look something like...
import {
setNodeConfig,
connect,
sendAlgo
} from '@thencc/algonautjs';
// set node to use (globally)
setNodeConfig({
BASE_SERVER: 'https://testnet-algorand.api.purestake.io/ps2',
API_TOKEN: { 'X-API-Key': 'MY_KEY_HERE' }, // key is header, value is token
LEDGER: 'TestNet',
PORT: ''
});
// connect acct
let accts = await connect(); // uses inkey as single wallet default. similar to how it is now. + stores in localstorage
// construct a txn + sign it + send it
let t = await sendAlgo({
to: '123',
amount: 1000
});
idea:
import {
AnyWalletState
} from '@thencc/algonautjs';
console.log(AnyWalletState.address); // would be populated on page load IF user had connected an acct to the dapp previously
should we make all methods + config funcs individual exports that relate to a central state instance? versus how it is now where most utils are members + methods of the large Algonaut() class.
reference: look how mobx does this w a global configure func (https://mobx.js.org/configuration.html#proxy-support)
then, instead of how we do it now, it would look something like...
idea: