Skip to content

Commit

Permalink
prototype env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor committed Jan 1, 2024
1 parent 2fe8b80 commit cde52eb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NETWORK=stokenet
#Mainnet: 1
#Stokenet: 2
NETWORK_ID=2
DAPP_DEFINITION=account_tdx_2_129kev9w27tsl7qjg0dlyze70kxnlzycs8v2c85kzec40gg8mt73f7y
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ next-env.d.ts
/playwright/.cache/

localhost:3000/
.env
11 changes: 7 additions & 4 deletions src/app/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down

0 comments on commit cde52eb

Please sign in to comment.