diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..caeb526b --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +NETWORK=stokenet +#Mainnet: 1 +#Stokenet: 2 +NETWORK_ID=2 +DAPP_DEFINITION=account_tdx_2_129kev9w27tsl7qjg0dlyze70kxnlzycs8v2c85kzec40gg8mt73f7y \ No newline at end of file diff --git a/.gitignore b/.gitignore index ea546958..411baa5a 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ next-env.d.ts /playwright/.cache/ localhost:3000/ +.env diff --git a/src/app/subscriptions.ts b/src/app/subscriptions.ts index 1acd6c8f..d69c0a7e 100644 --- a/src/app/subscriptions.ts +++ b/src/app/subscriptions.ts @@ -29,9 +29,12 @@ let subs: Subscription[] = []; export function initializeSubscriptions(store: AppStore) { rdtInstance = RadixDappToolkit({ - dAppDefinitionAddress: - "account_tdx_2_129kev9w27tsl7qjg0dlyze70kxnlzycs8v2c85kzec40gg8mt73f7y", - networkId: RadixNetwork.Stokenet, + dAppDefinitionAddress: process.env.DAPP_DEFINITION_ADDRESS + ? process.env.DAPP_DEFINITION_ADDRESS + : "", + networkId: process.env.NETWORK_ID + ? parseInt(process.env.NETWORK_ID) + : RadixNetwork.Stokenet, }); rdtInstance.walletApi.setRequestData( DataRequestBuilder.accounts().exactly(1) @@ -48,7 +51,7 @@ export function initializeSubscriptions(store: AppStore) { setRdt(rdtInstance); // TODO: "black" on the light theme rdtInstance.buttonApi.setTheme("white"); - adex.init("stokenet"); + adex.init(process.env.NETWORK ? process.env.NETWORK : "stokenet"); subs.push( adex.clientState.stateChanged$.subscribe((newState) => { const serializedState: adex.StaticState = JSON.parse(